hallpay.vue 17 KB

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