hallpay.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  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" @click="lookimg(wx.image)"><image class="upload-image" :src="wx.image" mode="aspectFit"></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. // 查看大图
  249. lookimg(src) {
  250. console.log(src);
  251. let arr = [src];
  252. uni.previewImage({
  253. current: src,
  254. urls: arr
  255. });
  256. },
  257. //swiper 切换
  258. changeTab(e) {
  259. this.tabCurrentIndex = e.target.current;
  260. },
  261. toBack() {
  262. uni.navigateBack({});
  263. },
  264. change(num) {
  265. this.tabCurrentIndex = num * 1;
  266. },
  267. // 打开客服
  268. openKf() {
  269. this.$refs.popupkf.open();
  270. },
  271. // 关闭客服
  272. cancel() {
  273. this.$refs.popupkf.close();
  274. },
  275. buy() {
  276. if (this.image == '') {
  277. return this.$api.msg('请上传支付凭证');
  278. }
  279. up_image({ id: this.info.id, image: this.image }).then(({ data }) => {
  280. uni.navigateTo({
  281. url: '/pages/money/success'
  282. });
  283. });
  284. }
  285. }
  286. };
  287. </script>
  288. <style lang="less">
  289. .center {
  290. background: #f8f6f6;
  291. min-height: 100%;
  292. height: auto;
  293. }
  294. .top {
  295. margin-top: 10rpx;
  296. background-color: #ffffff;
  297. padding: 56rpx 0;
  298. display: flex;
  299. flex-direction: column;
  300. justify-content: center;
  301. align-items: center;
  302. .top-main {
  303. display: flex;
  304. justify-content: center;
  305. align-items: center;
  306. line-height: 1;
  307. .num {
  308. font-size: 28rpx;
  309. font-family: PingFang SC;
  310. font-weight: bold;
  311. color: #fd3b39;
  312. text {
  313. font-size: 50rpx;
  314. }
  315. }
  316. .top-image {
  317. margin-left: 10rpx;
  318. width: 26rpx;
  319. height: 28rpx;
  320. }
  321. }
  322. .downtime {
  323. margin-top: 20rpx;
  324. }
  325. }
  326. .product {
  327. margin-top: 20rpx;
  328. padding: 35rpx 35rpx 40rpx 35rpx;
  329. background-color: #ffffff;
  330. justify-content: flex-start;
  331. align-items: flex-start;
  332. .product-image {
  333. width: 210rpx;
  334. height: 210rpx;
  335. border-radius: 10rpx;
  336. }
  337. .product-info {
  338. margin-left: 26rpx;
  339. padding-top: 10rpx;
  340. line-height: 1;
  341. .title {
  342. line-height: 1;
  343. font-size: 30rpx;
  344. font-family: PingFang SC;
  345. font-weight: bold;
  346. color: #333333;
  347. text {
  348. color: #999999;
  349. }
  350. }
  351. .buyId {
  352. margin-top: 30rpx;
  353. }
  354. .buyName {
  355. margin-top: 24rpx;
  356. }
  357. .buyPhone {
  358. margin-top: 24rpx;
  359. }
  360. }
  361. }
  362. .main {
  363. margin-top: 20rpx;
  364. padding: 30rpx 0 40rpx;
  365. background: #ffffff;
  366. .main-tip {
  367. padding: 0 30rpx;
  368. font-size: 30rpx;
  369. font-family: PingFang SC;
  370. font-weight: 500;
  371. color: #999999;
  372. }
  373. .main-title {
  374. margin-top: 34rpx;
  375. justify-content: flex-start;
  376. .current {
  377. background: linear-gradient(143.2747deg, #ff6a00, #ee0979) !important;
  378. color: #ffffff !important;
  379. }
  380. .main-item {
  381. width: 33%;
  382. }
  383. .mt-item {
  384. margin: 0 auto;
  385. width: 160rpx;
  386. height: 60rpx;
  387. background: #f8f8f8;
  388. border-radius: 10rpx;
  389. display: flex;
  390. justify-content: center;
  391. align-items: center;
  392. .mt-image {
  393. width: 32rpx;
  394. height: 32rpx;
  395. }
  396. .mt-image1 {
  397. width: 38rpx;
  398. height: 32rpx;
  399. }
  400. .mt-image2 {
  401. width: 36rpx;
  402. height: 32rpx;
  403. }
  404. .mt-font {
  405. margin-left: 10rpx;
  406. font-size: 30rpx;
  407. font-family: PingFang SC;
  408. font-weight: bold;
  409. color: #333333;
  410. }
  411. }
  412. }
  413. .swiper-box {
  414. width: 100%;
  415. padding: 14rpx 30rpx 0;
  416. .tc-item {
  417. padding: 50rpx 2rpx 0;
  418. line-height: 1;
  419. .tcitem-name {
  420. width: 118rpx;
  421. font-size: 30rpx;
  422. font-family: PingFang SC;
  423. font-weight: 500;
  424. color: #999999;
  425. }
  426. .ali-name {
  427. width: 380rpx;
  428. font-size: 30rpx;
  429. font-family: PingFang SC;
  430. font-weight: 500;
  431. color: #333333;
  432. }
  433. .tcitem-image {
  434. width: 26rpx;
  435. height: 28rpx;
  436. }
  437. }
  438. }
  439. }
  440. .upload-image {
  441. width: 160rpx;
  442. height: 160rpx;
  443. border-radius: 10rpx;
  444. }
  445. .upload-title {
  446. font-size: 30rpx;
  447. font-family: PingFang SC;
  448. font-weight: bold;
  449. color: #333333;
  450. }
  451. .upload-main {
  452. padding-top: 32rpx;
  453. display: flex;
  454. justify-content: center;
  455. align-items: center;
  456. flex-direction: column;
  457. .upload-font {
  458. margin-top: 24rpx;
  459. font-size: 30rpx;
  460. font-family: PingFang SC;
  461. font-weight: bold;
  462. color: #333333;
  463. }
  464. }
  465. .upload {
  466. margin-top: 20rpx;
  467. padding: 34rpx 30rpx 40rpx 30rpx;
  468. background: #ffffff;
  469. }
  470. .bottom {
  471. position: fixed;
  472. bottom: 0;
  473. background: #ffffff;
  474. width: 750rpx;
  475. height: 146rpx;
  476. justify-content: flex-start;
  477. .bottom-item {
  478. margin-left: 30rpx;
  479. display: flex;
  480. flex-direction: column;
  481. align-items: center;
  482. .bi-image {
  483. width: 38rpx;
  484. height: 34rpx;
  485. }
  486. .bottom-font {
  487. margin-top: 14rpx;
  488. font-size: 24rpx;
  489. font-family: PingFang SC;
  490. font-weight: bold;
  491. color: #333333;
  492. }
  493. .bottom-num {
  494. line-height: 1;
  495. font-size: 24rpx;
  496. font-family: PingFang SC;
  497. font-weight: bold;
  498. color: #333333;
  499. }
  500. }
  501. .shu {
  502. margin-left: 20rpx;
  503. width: 2px;
  504. height: 74rpx;
  505. background: #c0bfc0;
  506. }
  507. .btn {
  508. margin-left: 20rpx;
  509. width: 430rpx;
  510. height: 80rpx;
  511. background: #fd3b39;
  512. border-radius: 20rpx;
  513. text-align: center;
  514. font-size: 34rpx;
  515. font-family: PingFang SC;
  516. font-weight: bold;
  517. color: #ffffff;
  518. line-height: 80rpx;
  519. }
  520. }
  521. // 文章页底部高度撑开
  522. .contentBottomHeight {
  523. height: 150rpx;
  524. }
  525. .popup-box {
  526. width: 522rpx;
  527. height: 605rpx;
  528. background-color: #ffffff;
  529. border-radius: 20rpx;
  530. position: relative;
  531. .img {
  532. position: relative;
  533. top: -56rpx;
  534. left: 0;
  535. width: 522rpx;
  536. height: 132rpx;
  537. display: flex;
  538. justify-content: center;
  539. image {
  540. border-radius: 20rpx 20rpx 0 0;
  541. width: 450rpx;
  542. height: 132rpx;
  543. }
  544. }
  545. .mian {
  546. margin-top: -44rpx;
  547. display: flex;
  548. flex-direction: column;
  549. align-items: center;
  550. // padding: 32rpx 32rpx;
  551. background-color: #ffffff;
  552. border-radius: 0 0 20rpx 20rpx;
  553. text-align: center;
  554. .delivery {
  555. font-size: 40rpx;
  556. color: #333333;
  557. display: flex;
  558. align-items: center;
  559. flex-direction: column;
  560. .title {
  561. }
  562. image {
  563. margin-top: 48rpx;
  564. width: 172rpx;
  565. height: 160rpx;
  566. }
  567. }
  568. .nocancel {
  569. font-size: 32rpx;
  570. color: #333333;
  571. margin-top: 14rpx;
  572. }
  573. .comfirm-box {
  574. margin-top: 52rpx;
  575. display: flex;
  576. // margin-bottom: 32rpx;
  577. // justify-content: space-around;
  578. .cancel {
  579. display: flex;
  580. align-items: center;
  581. justify-content: center;
  582. width: 197rpx;
  583. height: 74rpx;
  584. border: 1px solid #dcc786;
  585. border-radius: 38rpx;
  586. font-size: 32rpx;
  587. color: #605128;
  588. }
  589. .comfirm {
  590. margin-left: 32rpx;
  591. display: flex;
  592. align-items: center;
  593. justify-content: center;
  594. width: 197rpx;
  595. height: 74rpx;
  596. background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
  597. border-radius: 38px;
  598. font-size: 32rpx;
  599. color: #605128;
  600. }
  601. }
  602. }
  603. }
  604. </style>