hallpay.vue 17 KB

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