hallpay.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. <style lang="scss">
  2. .app-body{
  3. .top{
  4. margin-top: 5px;
  5. background-color: #fff;
  6. padding: 32px 0;
  7. display: flex;
  8. flex-direction: column;
  9. justify-content: center;
  10. .price{
  11. font-size: 16px;
  12. font-weight: 700;
  13. color: #787878;
  14. }
  15. .pay_money{
  16. font-size: 16px;
  17. font-weight: 700;
  18. color: #fd3b39;
  19. font-size: 28px;
  20. }
  21. .last_time{
  22. padding: 20rpx 0;
  23. }
  24. .out_time{
  25. font-size: 14px;
  26. margin-top: 12px;
  27. }
  28. }
  29. /**产品item**/
  30. .goods-item{
  31. margin-top: 11px;
  32. padding: 20px 20px 22px 20px;
  33. background-color: #fff;
  34. justify-content: flex-start;
  35. align-items: flex-start;
  36. .product-image{
  37. width: 120px;
  38. height: 120px;
  39. border-radius: 5px;
  40. }
  41. .info{
  42. margin-left: 14px;
  43. padding-top: 5px;
  44. line-height: 1;
  45. .title{
  46. font-size: 17px;
  47. font-weight: 700;
  48. color: #333;
  49. }
  50. .info-value{
  51. margin-top: 12px;
  52. font-size: 17px;
  53. color: #333;
  54. font-weight: 600;
  55. .label{color: #999;}
  56. .sb{font-size: 12px;background: #4076f6;color: #fff;padding: 4px 6px;border-radius: 4px;}
  57. }
  58. }
  59. }
  60. .main{
  61. margin-top: 11px;
  62. padding: 17px 0 22px;
  63. background: #fff;
  64. .main-tip{
  65. padding: 0 17px;
  66. font-size: 17px;
  67. font-family: PingFang SC;
  68. font-weight: 500;
  69. color: #999;
  70. }
  71. .main-items{
  72. margin-top: 19px;
  73. justify-content: flex-start;
  74. height: 40px;
  75. padding:0 40rpx;
  76. .item{
  77. width: calc(33% - 10px);
  78. margin-right: 10px;
  79. height: 34px;
  80. background: #f8f8f8;
  81. border-radius: 5px;
  82. display: flex;
  83. justify-content: center;
  84. align-items: center;
  85. .icon{
  86. width: 21px;
  87. height: 18px;
  88. }
  89. .text{
  90. margin-left: 5px;
  91. font-size: 17px;
  92. font-weight: 700;
  93. color: #333;
  94. }
  95. &.active{
  96. background: linear-gradient(143.2747deg, #ff6a00, #ee0979) !important;
  97. color: #fff !important;
  98. .text{
  99. color: #fff;
  100. }
  101. }
  102. }
  103. }
  104. .swiper-box{
  105. padding: 8px 17px 0;
  106. height: 210px;
  107. swiper{height: 100%;}
  108. .pay-item{
  109. padding: 28px 1px 0;
  110. .label{
  111. width: 67px;
  112. font-size: 17px;
  113. font-family: PingFang SC;
  114. font-weight: 500;
  115. color: #999;
  116. }
  117. .value{
  118. width: calc(100% - 100px);
  119. font-size: 17px;
  120. font-weight: 500;
  121. color: #333;
  122. }
  123. .copy{
  124. image{width: 14px;height: 16px}
  125. }
  126. }
  127. }
  128. }
  129. .upload-item{
  130. margin-top: 11px;
  131. padding: 19px 17px 22px 17px;
  132. background: #fff;
  133. .upload-title{
  134. font-size: 17px;
  135. font-weight: 700;
  136. color: #333;
  137. }
  138. .upload-image{
  139. padding-top: 18px;
  140. display: flex;
  141. justify-content: center;
  142. align-items: center;
  143. flex-direction: column;
  144. image{width: 90px;height: 90px;}
  145. }
  146. .upload-font{
  147. margin-top: 13px;
  148. font-size: 17px;
  149. font-weight: 700;
  150. color: #333;
  151. }
  152. }
  153. .foot86{
  154. height: 90px;
  155. }
  156. .foot-view{
  157. position: fixed;
  158. bottom: 0;
  159. background: #fff;
  160. width: calc(100% - 20px);
  161. height: 83px;
  162. justify-content: flex-start;
  163. padding: 0 10px;
  164. .lxitem{
  165. image{width: 21px;height: 19px;}
  166. .text{margin-top: 8px;font-size: 12px;font-weight: 700;color: #333;}
  167. }
  168. .sm{margin:0 12px;width: 1px;height: 42px; background: #c0bfc0;}
  169. .btn{
  170. margin-left: 11px;
  171. height: 45px;
  172. background: #fd3b39;
  173. border-radius: 11px;
  174. text-align: center;
  175. font-size: 19px;
  176. font-weight: 700;
  177. color: #fff;
  178. line-height: 45px;
  179. }
  180. }
  181. }
  182. .line{
  183. width: 100%;
  184. overflow:hidden; //超出的文本隐藏
  185. text-overflow:ellipsis; //溢出用省略号显示
  186. white-space:nowrap; //溢出不换行,只能显示一行
  187. }
  188. </style>
  189. <template>
  190. <view class="app-body">
  191. <view class="top fx-h fx-bc fx-ac">
  192. <view class="price">挂售价格¥{{ data.price || '-' }}</view>
  193. <view class="pay_money">实际支付¥{{ data.price || '-' }}</view>
  194. <view class="last_time" v-if="data.status == 1">
  195. <view class=" fx-h fx-bc fx-ac" v-if="data.end_type == 1">
  196. <view class="label" style="padding: 10px 0;font-weight: bold;">离超时</view>
  197. <cz-countdown :fontSize="26" :startTime="utils.date('Y-m-d H:i:s')" :endTime="utils.date('Y-m-d H:i:s',data.end_time)"></cz-countdown>
  198. </view>
  199. <view class=" fx-h fx-bc fx-ac" v-if="data.end_type == 2">
  200. <view class="label" style="padding: 10px 0;font-weight: bold;">离过期</view>
  201. <cz-countdown :fontSize="26" :startTime="utils.date('Y-m-d H:i:s')" :endTime="utils.date('Y-m-d H:i:s',data.end_time)"></cz-countdown>
  202. </view>
  203. </view>
  204. <view class="out_time" v-if="data.status == 0">订单已过期</view>
  205. <view class="out_time" style="color: #f9ae3d;font-size: 18px;" v-if="data.status == 2">订单审核中</view>
  206. <view class="out_time" style="color: #5ac725;font-size: 18px;" v-if="data.status == 3">订单已完成</view>
  207. </view>
  208. <view class="goods-item fx-r">
  209. <image class="product-image" :src="data.image" mode="aspectFill"></image>
  210. <view class="info">
  211. <view class="title">{{ data.name || "" }}</view>
  212. <view class="info-value">
  213. <text class="label">卖家ID:</text>
  214. {{ data.collection_uid || ""}}
  215. </view>
  216. <view class="info-value">
  217. <text class="label">卖家昵称:</text>
  218. {{ data.collection_nickname || "" }}
  219. </view>
  220. <view class="info-value">
  221. <text class="label">卖家手机号:</text>
  222. {{ data.collection_mobile || "" }}
  223. </view>
  224. <view class="info-value fx-r">
  225. <text class="label">聊天联系:</text>
  226. <view class="sb" @tap="tapChat">点击聊天</view>
  227. </view>
  228. </view>
  229. </view>
  230. <view class="main">
  231. <view class="main-tip">请向以下账号自行转账(任选一种方式)</view>
  232. <view class="main-items fx-r">
  233. <view class="item" @tap="tapCurrent(index)" :class="current == index ? 'active' : ''" v-for="(item,index) in data.bank">
  234. <image class="icon" v-if="item.type == 3" :src=" current == index ? '/static/img/bank_active.png' : '/static/img/bank.png'"></image>
  235. <image class="icon" v-if="item.type == 1" :src=" current == index ? '/static/img/bank_active.png' : '/static/img/bank.png'"></image>
  236. <image class="icon" v-if="item.type == 2" :src=" current == index ? '/static/img/alipay_active.png' : '/static/img/alipay.png'"></image>
  237. <view class="text" v-if="item.type == 1">微信</view>
  238. <view class="text" v-if="item.type == 2">支付宝</view>
  239. <view class="text" v-if="item.type == 3">银行卡</view>
  240. </view>
  241. </view>
  242. <!--数据-->
  243. <view class="swiper-box">
  244. <swiper :current="current" :disable-touch="true">
  245. <swiper-item v-for="(item,index) in data.bank">
  246. <template v-if="item.type == 3">
  247. <view class="pay-item">
  248. <view class="tr fx-r">
  249. <view class="td label">姓名</view>
  250. <view class="td value line">{{ item.name }}</view>
  251. <view class="fx-g1"></view>
  252. <view class="td copy" @tap="tapCopy(item.name)"><image src="/static/img/ac_copy.png"></image></view>
  253. </view>
  254. </view>
  255. <view class="pay-item">
  256. <view class="tr fx-r">
  257. <view class="td label">银行</view>
  258. <view class="td value line">{{item.bank }}</view>
  259. <view class="fx-g1"></view>
  260. <view class="td copy" @tap="tapCopy(item.bank)"><image src="/static/img/ac_copy.png"></image></view>
  261. </view>
  262. </view>
  263. <view class="pay-item">
  264. <view class="tr fx-r">
  265. <view class="td label">支行</view>
  266. <view class="td value line">{{item.bank_name }}</view>
  267. <view class="fx-g1"></view>
  268. <view class="td copy" @tap="tapCopy(item.bank_name)"><image src="/static/img/ac_copy.png"></image></view>
  269. </view>
  270. </view>
  271. <view class="pay-item">
  272. <view class="tr fx-r">
  273. <view class="td label">账号</view>
  274. <view class="td value line">{{ item.payment }} </view>
  275. <view class="fx-g1"></view>
  276. <view class="td copy" @tap="tapCopy(item.payment)"><image src="/static/img/ac_copy.png"></image></view>
  277. </view>
  278. </view>
  279. </template>
  280. <template v-if="item.type == 2">
  281. <view class="pay-item">
  282. <view class="tr fx-r">
  283. <view class="td label">账号</view>
  284. <view class="td value">{{ item.payment }} </view>
  285. <view class="fx-g1"></view>
  286. <view class="td copy" @tap="tapCopy(item.payment)"><image src="/static/img/ac_copy.png"></image></view>
  287. </view>
  288. </view>
  289. <view class="pay-item">
  290. <view class="tr fx-r">
  291. <view class="td label">姓名</view>
  292. <view class="td value">{{ item.name }}</view>
  293. <view class="fx-g1"></view>
  294. <view class="td copy" @tap="tapCopy(item.name)"><image src="/static/img/ac_copy.png"></image></view>
  295. </view>
  296. </view>
  297. </template>
  298. <template v-if="item.type == 1">
  299. <view class="pay-item">
  300. <view class="tr fx-r">
  301. <view class="td label">账号</view>
  302. <view class="td value">{{ item.payment }} </view>
  303. <view class="fx-g1"></view>
  304. <view class="td copy" @tap="tapCopy(item.payment)"><image src="/static/img/ac_copy.png"></image></view>
  305. </view>
  306. </view>
  307. <view class="pay-item">
  308. <view class="tr fx-r">
  309. <view class="td label">姓名</view>
  310. <view class="td value">{{ item.name }}</view>
  311. <view class="fx-g1"></view>
  312. <view class="td copy" @tap="tapCopy(item.name)"><image src="/static/img/ac_copy.png"></image></view>
  313. </view>
  314. </view>
  315. <view class="pay-item">
  316. <view class="tr fx-r">
  317. <view class="td label">微信二维码</view>
  318. <view class="td value">
  319. <image @tap="tapOpenImg(item.img)" :src="item.img" mode="aspectFill" style="width: 80px;height: 80px"></image>
  320. </view>
  321. </view>
  322. </view>
  323. </template>
  324. </swiper-item>
  325. </swiper>
  326. </view>
  327. </view>
  328. <view class="upload-item" @tap="upImg">
  329. <view class="upload-title">上传支付截图</view>
  330. <view class="fx-h fx-bc fx-ac">
  331. <view class="upload-image">
  332. <image :src=" upImgUrl || '/static/img/upimg.png'" mode="aspectFill"></image>
  333. </view>
  334. <view class="upload-font">点击上传支付截图</view>
  335. </view>
  336. </view>
  337. <view class="foot86"></view>
  338. <view class="foot-view fx-r fx-bc ">
  339. <view class="lxitem fx-h fx-bc fx-ac">
  340. <image src="/static/img/ac-up-tel.png"></image>
  341. <view class="text">联系卖家</view>
  342. </view>
  343. <view class="sm"></view>
  344. <view class="lxitem fx-h fx-bc fx-ac">
  345. <image src="/static/img/ac-up-kf.png"></image>
  346. <view class="text">联系客服</view>
  347. </view>
  348. <view class="btn fx-g1" v-if="data.status == 2" @tap="tapSubmit">修改凭证</view>
  349. <view class="btn fx-g1" v-if="data.status == 1" @tap="tapSubmit">完成上传</view>
  350. </view>
  351. </view>
  352. </template>
  353. <script>
  354. import {mapState,mapMutations } from 'vuex';
  355. export default {
  356. computed: mapState(['user']),
  357. data() {
  358. return {
  359. statusBarHeight : 20,
  360. current : 0,
  361. orderId : 0,
  362. data : {},
  363. upImgUrl : "",
  364. isSubumit : false
  365. }
  366. },
  367. onLoad(options) {
  368. this.orderId = options.id || 0;
  369. this.initView();
  370. },
  371. methods: {
  372. /**
  373. * 加载基础配置
  374. */
  375. initView:function(){
  376. uni.showLoading({ title: '获取数据中..' });
  377. var post = {};
  378. post.id = this.orderId;
  379. this
  380. .request
  381. .post("auctionOrderItem",post)
  382. .then(res => {
  383. uni.hideLoading();
  384. if(res.code == 200) {
  385. this.data = res.data;
  386. } else {
  387. this.utils.Tip(res.msg);
  388. }
  389. })
  390. .catch(res=>{
  391. uni.hideLoading();
  392. uni.showModal({title: '系统提示',content: '加载失败,返回在尝试',showCancel: false});
  393. });
  394. },
  395. /**
  396. * 切换
  397. * @param {Object} index
  398. */
  399. tapCurrent:function(index) {
  400. this.current = index;
  401. },
  402. /**
  403. * 打开图片
  404. */
  405. tapOpenImg:function(img){
  406. uni.previewImage({
  407. current:0,
  408. urls:[img]
  409. });
  410. },
  411. /**
  412. * 复制
  413. * @param {Object} item
  414. */
  415. tapCopy:function(item) {
  416. uni.setClipboardData({
  417. data : item,
  418. showToast : true
  419. });
  420. },
  421. upImg(){
  422. // #ifdef APP-PLUS
  423. this.$store.dispatch('permission/requestPermissions', 'WRITE_EXTERNAL_STORAGE').then(res => {
  424. if(res !== 1) return;
  425. this.upImgS();
  426. });
  427. return;
  428. // #endif
  429. this.upImgS();
  430. },
  431. upImgS() {
  432. uni.chooseImage({
  433. count: 1,
  434. sizeType: ['compressed'],
  435. success: (res) => {
  436. let img = res.tempFilePaths[0];
  437. this.utils.loadIng();
  438. this
  439. .request
  440. .post("qiniu")
  441. .then(res=>{
  442. uni.uploadFile({
  443. url: 'https://up-z0.qiniup.com',
  444. filePath: img,
  445. name: 'file',
  446. formData: {
  447. 'key': res.data.mk_str,
  448. 'token': res.data.token
  449. },
  450. success: (uploadFileRes) => {
  451. uni.hideLoading();
  452. if(uploadFileRes.statusCode == 200) {
  453. this.upImgUrl = res.data.url;
  454. } else {
  455. this.utils.Tip("上传失败,请重新尝试");
  456. }
  457. },
  458. fail:()=>{
  459. uni.hideLoading();
  460. this.utils.Tip("上传失败,请重新尝试");
  461. }
  462. });
  463. })
  464. .catch(err=>{
  465. uni.hideLoading();
  466. this.utils.Tip("请重新上传图片");
  467. });
  468. }
  469. });
  470. },
  471. /**
  472. * 提交数据
  473. */
  474. tapSubmit:function(){
  475. if(this.upImgUrl == '') {
  476. this.utils.Tip("请上传打款凭证");
  477. return;
  478. }
  479. if(this.isSubumit) return;
  480. this.isSubumit = true;
  481. uni.showLoading({ title: '获取数据中..' });
  482. var post = {};
  483. post.id = this.orderId;
  484. post.img = this.upImgUrl;
  485. this
  486. .request
  487. .post("auctionOrderSubProof",post)
  488. .then(res => {
  489. this.isSubumit = false;
  490. uni.hideLoading();
  491. if(res.code == 200) {
  492. uni.redirectTo({
  493. url:"hallpay_ok"
  494. })
  495. } else {
  496. this.utils.showAlert({title: '系统提示',content: res.msg});
  497. }
  498. })
  499. .catch(res=>{
  500. this.isSubumit = false;
  501. uni.hideLoading();
  502. uni.showModal({title: '系统提示',content: '加载失败,返回在尝试',showCancel: false});
  503. });
  504. },
  505. /**
  506. * 聊天chat
  507. */
  508. tapChat:function(){
  509. uni.navigateTo({
  510. url:"/pages/chat/friend/info?usercode=" + this.data.collection_usercode
  511. })
  512. }
  513. }
  514. }
  515. </script>