hallpay.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. <template>
  2. <view class="center">
  3. <view class="top">
  4. <view class="top-main">
  5. <view class="num" style="color: #888888;">挂售价格¥{{ info.price }}</view>
  6. <!-- <image class="top-image" src="../../static/img/copy.png" mode=""></image> -->
  7. </view>
  8. <view class="top-main" style="margin-top: 30rpx;">
  9. <view class="num">
  10. <text>实际支付¥ {{ info.actual_price }}</text>
  11. </view>
  12. <!-- <image class="top-image" src="../../static/img/copy.png" mode=""></image> -->
  13. </view>
  14. <view v-if="status == 1">
  15. <view class="downtime" v-if="stopTime.stopTimeH < 0 || stopTime.stopTimeM < 0 || stopTime.stopTimeS < 0">订单已过期</view>
  16. <view class="downtime" v-else>
  17. <uni-countdowns
  18. color="#FFFFFF"
  19. splitor-color="#FD3B39"
  20. background-color="#FD3B39"
  21. border-color="#FD3B39"
  22. :show-day="false"
  23. :hour="stopTime.stopTimeH"
  24. :minute="stopTime.stopTimeM"
  25. :second="stopTime.stopTimeS"
  26. ></uni-countdowns>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="product flex">
  31. <image class="product-image" :src="info.image" mode=""></image>
  32. <view class="product-info">
  33. <view class="title">{{ info.name }}</view>
  34. <view class="title buyId">
  35. <text>卖家ID:</text>
  36. {{ info.collection_id }}
  37. </view>
  38. <view class="title buyName">
  39. <text>卖家昵称:</text>
  40. {{ info.c_nickname }}
  41. </view>
  42. <view class="title buyPhone">
  43. <text>卖家手机号:</text>
  44. {{ zfb != '' ? zfb.phone : wx != '' ? wx.phone : bank.phone }}
  45. </view>
  46. </view>
  47. </view>
  48. <view class="main">
  49. <view class="main-tip">请向以下账号自行转账(任选一种方式)</view>
  50. <view class="main-title flex">
  51. <view class="main-item">
  52. <view class="mt-item" @click="change('0')" :class="{ current: tabCurrentIndex === 0 }" v-if="zfb != ''">
  53. <image class="mt-image" :src="tabCurrentIndex == 0 ? '../../static/img/aliD.png' : '../../static/img/ali.png'" mode=""></image>
  54. <view class="mt-font" :class="{ current: tabCurrentIndex === 0 }">支付宝</view>
  55. </view>
  56. </view>
  57. <view class="main-item">
  58. <view class="mt-item" @click="change('1')" :class="{ current: tabCurrentIndex === 1 }" v-if="bank != ''">
  59. <image class="mt-image1" :src="tabCurrentIndex == 1 ? '../../static/img/bankD.png' : '../../static/img/bank.png'" mode=""></image>
  60. <view class="mt-font" :class="{ current: tabCurrentIndex === 1 }">银行卡</view>
  61. </view>
  62. </view>
  63. <view class="main-item">
  64. <view class="mt-item" @click="change('2')" :class="{ current: tabCurrentIndex === 2 }" v-if="wx != ''">
  65. <image class="mt-image2" :src="tabCurrentIndex == 2 ? '../../static/img/yueD.png' : '../../static/img/yue.png'" mode=""></image>
  66. <view class="mt-font" :class="{ current: tabCurrentIndex === 2 }">微信</view>
  67. </view>
  68. </view>
  69. </view>
  70. <swiper
  71. class="swiper-box"
  72. :duration="500"
  73. @change="changeTab"
  74. :style="{ height: tabCurrentIndex == 2 ? '450rpx' : tabCurrentIndex == 1 ? '340rpx' : '280rpx' }"
  75. :current="tabCurrentIndex"
  76. disable-touch
  77. >
  78. <swiper-item class="tab-content" v-if="zfb != ''">
  79. <scroll-view scroll-y="true" style="height: 100%;">
  80. <view class="tc-item flex">
  81. <view class="tcitem-name">账号</view>
  82. <view class="ali-name">{{ zfb.payment }}</view>
  83. <image class="tcitem-image" src="../../static/img/copy.png" mode="" @click="copy(zfb.payment)"></image>
  84. </view>
  85. <view class="tc-item flex">
  86. <view class="tcitem-name">姓名</view>
  87. <view class="ali-name">{{ zfb.name }}</view>
  88. <image class="tcitem-image" src="../../static/img/copy.png" mode="" @click="copy(zfb.name)"></image>
  89. </view>
  90. </scroll-view>
  91. </swiper-item>
  92. <swiper-item class="tab-content" v-else></swiper-item>
  93. <swiper-item class="tab-content" v-if="bank != ''">
  94. <scroll-view scroll-y="true" style="height: 100%;">
  95. <view class="tc-item flex">
  96. <view class="tcitem-name">姓名</view>
  97. <view class="ali-name">{{ bank.name }}</view>
  98. <image class="tcitem-image" src="../../static/img/copy.png" mode="" @click="copy(bank.name)"></image>
  99. </view>
  100. <view class="tc-item flex">
  101. <view class="tcitem-name">银行</view>
  102. <view class="ali-name">{{ bank.bank }}</view>
  103. <image class="tcitem-image" src="../../static/img/copy.png" mode="" @click="copy(bank.bank)"></image>
  104. </view>
  105. <view class="tc-item flex">
  106. <view class="tcitem-name">支行</view>
  107. <view class="ali-name">{{ bank.bank_name }}</view>
  108. <image @click="copy(bank.bank_name)" class="tcitem-image" src="../../static/img/copy.png" mode=""></image>
  109. </view>
  110. <view class="tc-item flex">
  111. <view class="tcitem-name">账号</view>
  112. <view class="ali-name">{{ bank.payment }}</view>
  113. <image class="tcitem-image" src="../../static/img/copy.png" mode="" @click="copy(bank.payment)"></image>
  114. </view>
  115. </scroll-view>
  116. </swiper-item>
  117. <swiper-item class="tab-content" v-else></swiper-item>
  118. <swiper-item class="tab-content" v-if="wx != ''">
  119. <scroll-view scroll-y="true" style="height: 100%;">
  120. <view class="tc-item flex">
  121. <view class="tcitem-name">账号</view>
  122. <view class="ali-name">{{ wx.payment }}</view>
  123. <image class="tcitem-image" src="../../static/img/copy.png" mode="" @click="copy(wx.payment)"></image>
  124. </view>
  125. <view class="tc-item flex">
  126. <view class="tcitem-name">姓名</view>
  127. <view class="ali-name">{{ wx.name }}</view>
  128. <image class="tcitem-image" src="../../static/img/copy.png" mode="" @click="copy(wx.name)"></image>
  129. </view>
  130. <view class="tc-item">
  131. <view class="upload-title" style="color: #9d9d9d;">微信二维码</view>
  132. <view class="upload-main" @click="lookimg(wx.image)"><image class="upload-image" :src="wx.image" mode="aspectFit"></image></view>
  133. </view>
  134. </scroll-view>
  135. </swiper-item>
  136. <swiper-item class="tab-content" v-else></swiper-item>
  137. </swiper>
  138. </view>
  139. <view class="upload">
  140. <view class="upload-title">上传支付截图</view>
  141. <view class="upload-main">
  142. <image class="upload-image" src="../../static/img/add.png" mode="" v-if="!image" @click="uploads()"></image>
  143. <image class="upload-image" :src="image" mode="" @click="uploads()" v-if="image"></image>
  144. <view class="upload-font">点击上传支付截图</view>
  145. </view>
  146. </view>
  147. <view class="contentBottomHeight"></view>
  148. <view class="bottom flex">
  149. <view class="bottom-item" @click.stop="tocall()">
  150. <image class="bi-image" src="../../static/img/call.png" mode=""></image>
  151. <view class="bottom-font">联系卖家</view>
  152. </view>
  153. <view class="shu"></view>
  154. <view class="bottom-item" @click.stop="openKf()">
  155. <image class="bi-image" src="../../static/img/kf.png" mode=""></image>
  156. <view class="bottom-font">联系客服</view>
  157. </view>
  158. <view class="btn" @click.stop="buy()">完成上传</view>
  159. </view>
  160. <uni-popup ref="popupkf" type="center">
  161. <view class="popup-box">
  162. <view class="img"><image src="../../static/img/img009.png" mode=""></image></view>
  163. <view class="mian">
  164. <view class="delivery">
  165. <view class="title">已经为您定制专属客服</view>
  166. <image src="../../static/img/img010.png" mode=""></image>
  167. </view>
  168. <view class="nocancel">客服VX:{{ text }}</view>
  169. <view class="comfirm-box">
  170. <view class="cancel" @click="cancel">取消</view>
  171. <view class="comfirm" @click="copy(text)">复制微信</view>
  172. </view>
  173. </view>
  174. </view>
  175. </uni-popup>
  176. </view>
  177. </template>
  178. <script>
  179. import uniCountdowns from '@/components/uni-countdown/uni-countdowns.vue';
  180. import uniCopy from '@/components/js_sdk/xb-copy/uni-copy.js';
  181. import { user_auction_order, upload, up_image, edit_voucher, time } from '@/api/order.js';
  182. import { timeComputed } from '@/utils/rocessor.js';
  183. export default {
  184. components: {
  185. uniCountdowns
  186. },
  187. data() {
  188. return {
  189. type: 1,
  190. // 倒计时
  191. stopTime: {
  192. stopTimeH: 0,
  193. stopTimeM: 0,
  194. stopTimeS: 0
  195. },
  196. tabCurrentIndex: 0,
  197. id: '',
  198. info: '',
  199. bank: '',
  200. wx: '',
  201. zfb: '',
  202. image: '',
  203. status: 1,
  204. text: '123456',
  205. payTime: ''
  206. };
  207. },
  208. onLoad(option) {
  209. this.id = option.ordid;
  210. this.getpayTime();
  211. if (option.type) {
  212. this.type = option.type;
  213. }
  214. },
  215. methods: {
  216. uploads() {
  217. upload({
  218. filename: ''
  219. }).then(data => {
  220. this.image = data[0].url;
  221. console.log(this.image);
  222. });
  223. },
  224. getpayTime() {
  225. time().then(({ data }) => {
  226. this.payTime = data.tow_time * 1 * 60;
  227. this.loadData();
  228. });
  229. },
  230. loadData() {
  231. user_auction_order({ type: 1, order_id: this.id }).then(({ data }) => {
  232. let time = data.time * 1 > data.radd_time * 1 ? data.time : data.radd_time;
  233. let now_time = timeComputed(time + this.payTime);
  234. this.status = data.status;
  235. this.stopTime.stopTimeH = now_time.hours;
  236. this.stopTime.stopTimeM = now_time.minutes;
  237. this.stopTime.stopTimeS = now_time.seconds;
  238. this.info = data;
  239. this.zfb = data.zfb;
  240. this.wx = data.wx;
  241. this.bank = data.bank;
  242. console.log(data.zfb.length, '123456');
  243. if (data.zfb.length == []) {
  244. this.tabCurrentIndex = 1;
  245. if (data.bank.length == []) {
  246. this.tabCurrentIndex = 2;
  247. }
  248. }
  249. console.log(this.tabCurrentIndex);
  250. });
  251. },
  252. nav(url) {
  253. uni.navigateTo({
  254. url
  255. });
  256. },
  257. copy(value) {
  258. let obj = this;
  259. let content = value; //需要复制的内容
  260. console.log('复制的内容:', content);
  261. // content = typeof content === 'string' ? content : content.toString(); // 复制内容,必须字符串,数字需要转换为字符串
  262. const result = uniCopy(content);
  263. if (result === false) {
  264. uni.showToast({
  265. title: '不支持'
  266. });
  267. } else {
  268. uni.showToast({
  269. title: '复制成功',
  270. icon: 'none'
  271. });
  272. }
  273. },
  274. tocall() {
  275. let num = this.zfb != '' ? this.zfb.phone : this.wx != '' ? this.wx.phone : this.bank.phone;
  276. console.log(num);
  277. uni.makePhoneCall({
  278. phoneNumber: num //仅为示例
  279. });
  280. },
  281. // 查看大图
  282. lookimg(src) {
  283. console.log(src);
  284. let arr = [src];
  285. uni.previewImage({
  286. current: src,
  287. urls: arr
  288. });
  289. },
  290. //swiper 切换
  291. changeTab(e) {
  292. this.tabCurrentIndex = e.target.current;
  293. },
  294. toBack() {
  295. uni.navigateBack({});
  296. },
  297. change(num) {
  298. this.tabCurrentIndex = num * 1;
  299. },
  300. // 打开客服
  301. openKf() {
  302. this.$refs.popupkf.open();
  303. },
  304. // 关闭客服
  305. cancel() {
  306. this.$refs.popupkf.close();
  307. },
  308. buy() {
  309. if (this.image == '') {
  310. return this.$api.msg('请上传支付凭证');
  311. }
  312. if (this.type == 1) {
  313. up_image({ id: this.info.id, image: this.image }).then(({ data }) => {
  314. uni.navigateTo({
  315. url: '/pages/money/success'
  316. });
  317. });
  318. }
  319. if (this.type == 2) {
  320. edit_voucher({ order_id: this.id, image: this.image }).then(({ data }) => {
  321. uni.navigateTo({
  322. url: '/pages/money/success'
  323. });
  324. });
  325. }
  326. }
  327. }
  328. };
  329. </script>
  330. <style lang="less">
  331. .center {
  332. background: #f8f6f6;
  333. min-height: 100%;
  334. height: auto;
  335. }
  336. .top {
  337. margin-top: 10rpx;
  338. background-color: #ffffff;
  339. padding: 56rpx 0;
  340. display: flex;
  341. flex-direction: column;
  342. justify-content: center;
  343. align-items: center;
  344. .top-main {
  345. display: flex;
  346. justify-content: center;
  347. align-items: center;
  348. line-height: 1;
  349. .num {
  350. font-size: 28rpx;
  351. font-family: PingFang SC;
  352. font-weight: bold;
  353. color: #fd3b39;
  354. text {
  355. font-size: 50rpx;
  356. }
  357. }
  358. .top-image {
  359. margin-left: 10rpx;
  360. width: 26rpx;
  361. height: 28rpx;
  362. }
  363. }
  364. .downtime {
  365. margin-top: 20rpx;
  366. }
  367. }
  368. .product {
  369. margin-top: 20rpx;
  370. padding: 35rpx 35rpx 40rpx 35rpx;
  371. background-color: #ffffff;
  372. justify-content: flex-start;
  373. align-items: flex-start;
  374. .product-image {
  375. width: 210rpx;
  376. height: 210rpx;
  377. border-radius: 10rpx;
  378. }
  379. .product-info {
  380. margin-left: 26rpx;
  381. padding-top: 10rpx;
  382. line-height: 1;
  383. .title {
  384. line-height: 1;
  385. font-size: 30rpx;
  386. font-family: PingFang SC;
  387. font-weight: bold;
  388. color: #333333;
  389. text {
  390. color: #999999;
  391. }
  392. }
  393. .buyId {
  394. margin-top: 30rpx;
  395. }
  396. .buyName {
  397. margin-top: 24rpx;
  398. }
  399. .buyPhone {
  400. margin-top: 24rpx;
  401. }
  402. }
  403. }
  404. .main {
  405. margin-top: 20rpx;
  406. padding: 30rpx 0 40rpx;
  407. background: #ffffff;
  408. .main-tip {
  409. padding: 0 30rpx;
  410. font-size: 30rpx;
  411. font-family: PingFang SC;
  412. font-weight: 500;
  413. color: #999999;
  414. }
  415. .main-title {
  416. margin-top: 34rpx;
  417. justify-content: flex-start;
  418. .current {
  419. background: linear-gradient(143.2747deg, #ff6a00, #ee0979) !important;
  420. color: #ffffff !important;
  421. }
  422. .main-item {
  423. width: 33%;
  424. }
  425. .mt-item {
  426. margin: 0 auto;
  427. width: 160rpx;
  428. height: 60rpx;
  429. background: #f8f8f8;
  430. border-radius: 10rpx;
  431. display: flex;
  432. justify-content: center;
  433. align-items: center;
  434. .mt-image {
  435. width: 32rpx;
  436. height: 32rpx;
  437. }
  438. .mt-image1 {
  439. width: 38rpx;
  440. height: 32rpx;
  441. }
  442. .mt-image2 {
  443. width: 36rpx;
  444. height: 32rpx;
  445. }
  446. .mt-font {
  447. margin-left: 10rpx;
  448. font-size: 30rpx;
  449. font-family: PingFang SC;
  450. font-weight: bold;
  451. color: #333333;
  452. }
  453. }
  454. }
  455. .swiper-box {
  456. width: 100%;
  457. padding: 14rpx 30rpx 0;
  458. .tc-item {
  459. padding: 50rpx 2rpx 0;
  460. line-height: 1;
  461. .tcitem-name {
  462. width: 118rpx;
  463. font-size: 30rpx;
  464. font-family: PingFang SC;
  465. font-weight: 500;
  466. color: #999999;
  467. }
  468. .ali-name {
  469. width: 380rpx;
  470. font-size: 30rpx;
  471. font-family: PingFang SC;
  472. font-weight: 500;
  473. color: #333333;
  474. }
  475. .tcitem-image {
  476. width: 26rpx;
  477. height: 28rpx;
  478. }
  479. }
  480. }
  481. }
  482. .upload-image {
  483. width: 160rpx;
  484. height: 160rpx;
  485. border-radius: 10rpx;
  486. }
  487. .upload-title {
  488. font-size: 30rpx;
  489. font-family: PingFang SC;
  490. font-weight: bold;
  491. color: #333333;
  492. }
  493. .upload-main {
  494. padding-top: 32rpx;
  495. display: flex;
  496. justify-content: center;
  497. align-items: center;
  498. flex-direction: column;
  499. .upload-font {
  500. margin-top: 24rpx;
  501. font-size: 30rpx;
  502. font-family: PingFang SC;
  503. font-weight: bold;
  504. color: #333333;
  505. }
  506. }
  507. .upload {
  508. margin-top: 20rpx;
  509. padding: 34rpx 30rpx 40rpx 30rpx;
  510. background: #ffffff;
  511. }
  512. .bottom {
  513. position: fixed;
  514. bottom: 0;
  515. background: #ffffff;
  516. width: 750rpx;
  517. height: 146rpx;
  518. justify-content: flex-start;
  519. .bottom-item {
  520. margin-left: 30rpx;
  521. display: flex;
  522. flex-direction: column;
  523. align-items: center;
  524. .bi-image {
  525. width: 38rpx;
  526. height: 34rpx;
  527. }
  528. .bottom-font {
  529. margin-top: 14rpx;
  530. font-size: 24rpx;
  531. font-family: PingFang SC;
  532. font-weight: bold;
  533. color: #333333;
  534. }
  535. .bottom-num {
  536. line-height: 1;
  537. font-size: 24rpx;
  538. font-family: PingFang SC;
  539. font-weight: bold;
  540. color: #333333;
  541. }
  542. }
  543. .shu {
  544. margin-left: 20rpx;
  545. width: 2px;
  546. height: 74rpx;
  547. background: #c0bfc0;
  548. }
  549. .btn {
  550. margin-left: 20rpx;
  551. width: 430rpx;
  552. height: 80rpx;
  553. background: #fd3b39;
  554. border-radius: 20rpx;
  555. text-align: center;
  556. font-size: 34rpx;
  557. font-family: PingFang SC;
  558. font-weight: bold;
  559. color: #ffffff;
  560. line-height: 80rpx;
  561. }
  562. }
  563. // 文章页底部高度撑开
  564. .contentBottomHeight {
  565. height: 150rpx;
  566. }
  567. .popup-box {
  568. width: 522rpx;
  569. height: 605rpx;
  570. background-color: #ffffff;
  571. border-radius: 20rpx;
  572. position: relative;
  573. .img {
  574. position: relative;
  575. top: -56rpx;
  576. left: 0;
  577. width: 522rpx;
  578. height: 132rpx;
  579. display: flex;
  580. justify-content: center;
  581. image {
  582. border-radius: 20rpx 20rpx 0 0;
  583. width: 450rpx;
  584. height: 132rpx;
  585. }
  586. }
  587. .mian {
  588. margin-top: -44rpx;
  589. display: flex;
  590. flex-direction: column;
  591. align-items: center;
  592. // padding: 32rpx 32rpx;
  593. background-color: #ffffff;
  594. border-radius: 0 0 20rpx 20rpx;
  595. text-align: center;
  596. .delivery {
  597. font-size: 40rpx;
  598. color: #333333;
  599. display: flex;
  600. align-items: center;
  601. flex-direction: column;
  602. .title {
  603. }
  604. image {
  605. margin-top: 48rpx;
  606. width: 172rpx;
  607. height: 160rpx;
  608. }
  609. }
  610. .nocancel {
  611. font-size: 32rpx;
  612. color: #333333;
  613. margin-top: 14rpx;
  614. }
  615. .comfirm-box {
  616. margin-top: 52rpx;
  617. display: flex;
  618. // margin-bottom: 32rpx;
  619. // justify-content: space-around;
  620. .cancel {
  621. display: flex;
  622. align-items: center;
  623. justify-content: center;
  624. width: 197rpx;
  625. height: 74rpx;
  626. border: 1px solid #dcc786;
  627. border-radius: 38rpx;
  628. font-size: 32rpx;
  629. color: #605128;
  630. }
  631. .comfirm {
  632. margin-left: 32rpx;
  633. display: flex;
  634. align-items: center;
  635. justify-content: center;
  636. width: 197rpx;
  637. height: 74rpx;
  638. background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
  639. border-radius: 38px;
  640. font-size: 32rpx;
  641. color: #605128;
  642. }
  643. }
  644. }
  645. }
  646. </style>