hallpay.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  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. // import { json } from 'node:stream/consumers';
  184. export default {
  185. components: {
  186. uniCountdowns
  187. },
  188. data() {
  189. return {
  190. type: 1,
  191. // 倒计时
  192. stopTime: {
  193. stopTimeH: 0,
  194. stopTimeM: 0,
  195. stopTimeS: 0
  196. },
  197. tabCurrentIndex: 0,
  198. id: '',
  199. info: '',
  200. bank: '',
  201. wx: '',
  202. zfb: '',
  203. image: '',
  204. status: 1,
  205. text: '123456',
  206. payTime: ''
  207. };
  208. },
  209. onLoad(option) {
  210. this.id = option.ordid;
  211. this.getpayTime();
  212. if (option.type) {
  213. this.type = option.type;
  214. }
  215. },
  216. methods: {
  217. uploads() {
  218. upload({
  219. filename: ''
  220. }).then(data => {
  221. this.image = data[0].url;
  222. }).catch((e)=>{
  223. uni.showModal({
  224. title: '上传失败',
  225. content: JSON.stringify(e),
  226. showCancel: false,
  227. });
  228. });
  229. },
  230. getpayTime() {
  231. time().then(({ data }) => {
  232. this.payTime = data.tow_time * 1 * 60;
  233. this.loadData();
  234. });
  235. },
  236. loadData() {
  237. user_auction_order({ type: 1, order_id: this.id }).then(({ data }) => {
  238. let time = data.time * 1 > data.radd_time * 1 ? data.time : data.radd_time;
  239. let now_time = timeComputed(time + this.payTime);
  240. this.status = data.status;
  241. this.stopTime.stopTimeH = now_time.hours;
  242. this.stopTime.stopTimeM = now_time.minutes;
  243. this.stopTime.stopTimeS = now_time.seconds;
  244. this.info = data;
  245. this.zfb = data.zfb;
  246. this.wx = data.wx;
  247. this.bank = data.bank;
  248. console.log(data.zfb.length, '123456');
  249. if (data.zfb.length == []) {
  250. this.tabCurrentIndex = 1;
  251. if (data.bank.length == []) {
  252. this.tabCurrentIndex = 2;
  253. }
  254. }
  255. console.log(this.tabCurrentIndex);
  256. });
  257. },
  258. nav(url) {
  259. uni.navigateTo({
  260. url
  261. });
  262. },
  263. copy(value) {
  264. let obj = this;
  265. let content = value; //需要复制的内容
  266. console.log('复制的内容:', content);
  267. // content = typeof content === 'string' ? content : content.toString(); // 复制内容,必须字符串,数字需要转换为字符串
  268. const result = uniCopy(content);
  269. if (result === false) {
  270. uni.showToast({
  271. title: '不支持'
  272. });
  273. } else {
  274. uni.showToast({
  275. title: '复制成功',
  276. icon: 'none'
  277. });
  278. }
  279. },
  280. tocall() {
  281. let num = this.zfb != '' ? this.zfb.phone : this.wx != '' ? this.wx.phone : this.bank.phone;
  282. console.log(num);
  283. uni.makePhoneCall({
  284. phoneNumber: num //仅为示例
  285. });
  286. },
  287. // 查看大图
  288. lookimg(src) {
  289. console.log(src);
  290. let arr = [src];
  291. uni.previewImage({
  292. current: src,
  293. urls: arr
  294. });
  295. },
  296. //swiper 切换
  297. changeTab(e) {
  298. this.tabCurrentIndex = e.target.current;
  299. },
  300. toBack() {
  301. uni.navigateBack({});
  302. },
  303. change(num) {
  304. this.tabCurrentIndex = num * 1;
  305. },
  306. // 打开客服
  307. openKf() {
  308. this.$refs.popupkf.open();
  309. },
  310. // 关闭客服
  311. cancel() {
  312. this.$refs.popupkf.close();
  313. },
  314. buy() {
  315. if (this.image == '') {
  316. return this.$api.msg('请上传支付凭证');
  317. }
  318. if (this.type == 1) {
  319. up_image({ id: this.info.id, image: this.image }).then(({ data }) => {
  320. uni.navigateTo({
  321. url: '/pages/money/success'
  322. });
  323. });
  324. }
  325. if (this.type == 2) {
  326. edit_voucher({ order_id: this.id, image: this.image }).then(({ data }) => {
  327. uni.navigateTo({
  328. url: '/pages/money/success'
  329. });
  330. });
  331. }
  332. }
  333. }
  334. };
  335. </script>
  336. <style lang="less">
  337. .center {
  338. background: #f8f6f6;
  339. min-height: 100%;
  340. height: auto;
  341. }
  342. .top {
  343. margin-top: 10rpx;
  344. background-color: #ffffff;
  345. padding: 56rpx 0;
  346. display: flex;
  347. flex-direction: column;
  348. justify-content: center;
  349. align-items: center;
  350. .top-main {
  351. display: flex;
  352. justify-content: center;
  353. align-items: center;
  354. line-height: 1;
  355. .num {
  356. font-size: 28rpx;
  357. font-family: PingFang SC;
  358. font-weight: bold;
  359. color: #fd3b39;
  360. text {
  361. font-size: 50rpx;
  362. }
  363. }
  364. .top-image {
  365. margin-left: 10rpx;
  366. width: 26rpx;
  367. height: 28rpx;
  368. }
  369. }
  370. .downtime {
  371. margin-top: 20rpx;
  372. }
  373. }
  374. .product {
  375. margin-top: 20rpx;
  376. padding: 35rpx 35rpx 40rpx 35rpx;
  377. background-color: #ffffff;
  378. justify-content: flex-start;
  379. align-items: flex-start;
  380. .product-image {
  381. width: 210rpx;
  382. height: 210rpx;
  383. border-radius: 10rpx;
  384. }
  385. .product-info {
  386. margin-left: 26rpx;
  387. padding-top: 10rpx;
  388. line-height: 1;
  389. .title {
  390. line-height: 1;
  391. font-size: 30rpx;
  392. font-family: PingFang SC;
  393. font-weight: bold;
  394. color: #333333;
  395. text {
  396. color: #999999;
  397. }
  398. }
  399. .buyId {
  400. margin-top: 30rpx;
  401. }
  402. .buyName {
  403. margin-top: 24rpx;
  404. }
  405. .buyPhone {
  406. margin-top: 24rpx;
  407. }
  408. }
  409. }
  410. .main {
  411. margin-top: 20rpx;
  412. padding: 30rpx 0 40rpx;
  413. background: #ffffff;
  414. .main-tip {
  415. padding: 0 30rpx;
  416. font-size: 30rpx;
  417. font-family: PingFang SC;
  418. font-weight: 500;
  419. color: #999999;
  420. }
  421. .main-title {
  422. margin-top: 34rpx;
  423. justify-content: flex-start;
  424. .current {
  425. background: linear-gradient(143.2747deg, #ff6a00, #ee0979) !important;
  426. color: #ffffff !important;
  427. }
  428. .main-item {
  429. width: 33%;
  430. }
  431. .mt-item {
  432. margin: 0 auto;
  433. width: 160rpx;
  434. height: 60rpx;
  435. background: #f8f8f8;
  436. border-radius: 10rpx;
  437. display: flex;
  438. justify-content: center;
  439. align-items: center;
  440. .mt-image {
  441. width: 32rpx;
  442. height: 32rpx;
  443. }
  444. .mt-image1 {
  445. width: 38rpx;
  446. height: 32rpx;
  447. }
  448. .mt-image2 {
  449. width: 36rpx;
  450. height: 32rpx;
  451. }
  452. .mt-font {
  453. margin-left: 10rpx;
  454. font-size: 30rpx;
  455. font-family: PingFang SC;
  456. font-weight: bold;
  457. color: #333333;
  458. }
  459. }
  460. }
  461. .swiper-box {
  462. width: 100%;
  463. padding: 14rpx 30rpx 0;
  464. .tc-item {
  465. padding: 50rpx 2rpx 0;
  466. line-height: 1;
  467. .tcitem-name {
  468. width: 118rpx;
  469. font-size: 30rpx;
  470. font-family: PingFang SC;
  471. font-weight: 500;
  472. color: #999999;
  473. }
  474. .ali-name {
  475. width: 380rpx;
  476. font-size: 30rpx;
  477. font-family: PingFang SC;
  478. font-weight: 500;
  479. color: #333333;
  480. }
  481. .tcitem-image {
  482. width: 26rpx;
  483. height: 28rpx;
  484. }
  485. }
  486. }
  487. }
  488. .upload-image {
  489. width: 160rpx;
  490. height: 160rpx;
  491. border-radius: 10rpx;
  492. }
  493. .upload-title {
  494. font-size: 30rpx;
  495. font-family: PingFang SC;
  496. font-weight: bold;
  497. color: #333333;
  498. }
  499. .upload-main {
  500. padding-top: 32rpx;
  501. display: flex;
  502. justify-content: center;
  503. align-items: center;
  504. flex-direction: column;
  505. .upload-font {
  506. margin-top: 24rpx;
  507. font-size: 30rpx;
  508. font-family: PingFang SC;
  509. font-weight: bold;
  510. color: #333333;
  511. }
  512. }
  513. .upload {
  514. margin-top: 20rpx;
  515. padding: 34rpx 30rpx 40rpx 30rpx;
  516. background: #ffffff;
  517. }
  518. .bottom {
  519. position: fixed;
  520. bottom: 0;
  521. background: #ffffff;
  522. width: 750rpx;
  523. height: 146rpx;
  524. justify-content: flex-start;
  525. .bottom-item {
  526. margin-left: 30rpx;
  527. display: flex;
  528. flex-direction: column;
  529. align-items: center;
  530. .bi-image {
  531. width: 38rpx;
  532. height: 34rpx;
  533. }
  534. .bottom-font {
  535. margin-top: 14rpx;
  536. font-size: 24rpx;
  537. font-family: PingFang SC;
  538. font-weight: bold;
  539. color: #333333;
  540. }
  541. .bottom-num {
  542. line-height: 1;
  543. font-size: 24rpx;
  544. font-family: PingFang SC;
  545. font-weight: bold;
  546. color: #333333;
  547. }
  548. }
  549. .shu {
  550. margin-left: 20rpx;
  551. width: 2px;
  552. height: 74rpx;
  553. background: #c0bfc0;
  554. }
  555. .btn {
  556. margin-left: 20rpx;
  557. width: 430rpx;
  558. height: 80rpx;
  559. background: #fd3b39;
  560. border-radius: 20rpx;
  561. text-align: center;
  562. font-size: 34rpx;
  563. font-family: PingFang SC;
  564. font-weight: bold;
  565. color: #ffffff;
  566. line-height: 80rpx;
  567. }
  568. }
  569. // 文章页底部高度撑开
  570. .contentBottomHeight {
  571. height: 150rpx;
  572. }
  573. .popup-box {
  574. width: 522rpx;
  575. height: 605rpx;
  576. background-color: #ffffff;
  577. border-radius: 20rpx;
  578. position: relative;
  579. .img {
  580. position: relative;
  581. top: -56rpx;
  582. left: 0;
  583. width: 522rpx;
  584. height: 132rpx;
  585. display: flex;
  586. justify-content: center;
  587. image {
  588. border-radius: 20rpx 20rpx 0 0;
  589. width: 450rpx;
  590. height: 132rpx;
  591. }
  592. }
  593. .mian {
  594. margin-top: -44rpx;
  595. display: flex;
  596. flex-direction: column;
  597. align-items: center;
  598. // padding: 32rpx 32rpx;
  599. background-color: #ffffff;
  600. border-radius: 0 0 20rpx 20rpx;
  601. text-align: center;
  602. .delivery {
  603. font-size: 40rpx;
  604. color: #333333;
  605. display: flex;
  606. align-items: center;
  607. flex-direction: column;
  608. .title {
  609. }
  610. image {
  611. margin-top: 48rpx;
  612. width: 172rpx;
  613. height: 160rpx;
  614. }
  615. }
  616. .nocancel {
  617. font-size: 32rpx;
  618. color: #333333;
  619. margin-top: 14rpx;
  620. }
  621. .comfirm-box {
  622. margin-top: 52rpx;
  623. display: flex;
  624. // margin-bottom: 32rpx;
  625. // justify-content: space-around;
  626. .cancel {
  627. display: flex;
  628. align-items: center;
  629. justify-content: center;
  630. width: 197rpx;
  631. height: 74rpx;
  632. border: 1px solid #dcc786;
  633. border-radius: 38rpx;
  634. font-size: 32rpx;
  635. color: #605128;
  636. }
  637. .comfirm {
  638. margin-left: 32rpx;
  639. display: flex;
  640. align-items: center;
  641. justify-content: center;
  642. width: 197rpx;
  643. height: 74rpx;
  644. background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
  645. border-radius: 38px;
  646. font-size: 32rpx;
  647. color: #605128;
  648. }
  649. }
  650. }
  651. }
  652. </style>