hallpay.vue 15 KB

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