hallpay.vue 16 KB

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