hallpay.vue 16 KB

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