hallpay.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  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="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">
  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="buy()">立即购买</view>
  140. </view>
  141. </view>
  142. </template>
  143. <script>
  144. import uniCountdowns from '@/components/uni-countdown/uni-countdowns.vue';
  145. import uniCopy from '@/components/js_sdk/xb-copy/uni-copy.js';
  146. import { user_auction_order, upload, up_image } from '@/api/order.js';
  147. import { timeComputed } from '@/utils/rocessor.js';
  148. export default {
  149. components: {
  150. uniCountdowns
  151. },
  152. data() {
  153. return {
  154. // 倒计时
  155. stopTime: {
  156. stopTimeH: 0,
  157. stopTimeM: 0,
  158. stopTimeS: 0
  159. },
  160. tabCurrentIndex: 0,
  161. id: '',
  162. info: '',
  163. bank: '',
  164. wx: '',
  165. zfb: '',
  166. image: ''
  167. };
  168. },
  169. onLoad(option) {
  170. this.id = option.ordid;
  171. this.loadData();
  172. },
  173. methods: {
  174. uploads() {
  175. upload({
  176. filename: ''
  177. }).then(data => {
  178. this.image = data[0].url;
  179. });
  180. },
  181. loadData() {
  182. user_auction_order({ type: 1, order_id: this.id }).then(({ data }) => {
  183. let now_time = timeComputed(data.time + 3600);
  184. console.log(now_time);
  185. this.stopTime.stopTimeH = now_time.hours;
  186. this.stopTime.stopTimeM = now_time.minutes;
  187. this.stopTime.stopTimeS = now_time.seconds;
  188. this.info = data;
  189. this.zfb = data.zfb;
  190. this.wx = data.wx;
  191. this.bank = data.bank;
  192. console.log(data.zfb.length, '123456');
  193. if (data.zfb.length == []) {
  194. this.tabCurrentIndex = 1;
  195. if (data.bank.length == []) {
  196. this.tabCurrentIndex = 2;
  197. }
  198. }
  199. console.log(this.tabCurrentIndex);
  200. });
  201. },
  202. open() {
  203. this.$refs.popup.open();
  204. },
  205. close() {
  206. this.$refs.popup.close();
  207. },
  208. nav(url) {
  209. uni.navigateTo({
  210. url
  211. });
  212. },
  213. copy(value) {
  214. let obj = this;
  215. let content = value; //需要复制的内容
  216. console.log('复制的内容:', content);
  217. // content = typeof content === 'string' ? content : content.toString(); // 复制内容,必须字符串,数字需要转换为字符串
  218. const result = uniCopy(content);
  219. if (result === false) {
  220. uni.showToast({
  221. title: '不支持'
  222. });
  223. } else {
  224. uni.showToast({
  225. title: '复制成功',
  226. icon: 'none'
  227. });
  228. }
  229. },
  230. tocall() {
  231. let num = this.zfb != '' ? this.zfb.phone : this.wx != '' ? this.wx.phone : this.bank.phone;
  232. console.log(num);
  233. uni.makePhoneCall({
  234. phoneNumber: num //仅为示例
  235. });
  236. },
  237. //swiper 切换
  238. changeTab(e) {
  239. this.tabCurrentIndex = e.target.current;
  240. },
  241. toBack() {
  242. uni.navigateBack({});
  243. },
  244. change(num) {
  245. this.tabCurrentIndex = num * 1;
  246. },
  247. buy() {
  248. if (this.image == '') {
  249. return this.$api.msg('请上传支付凭证');
  250. }
  251. up_image({ id: this.info.id, image: this.image }).then(({ data }) => {
  252. uni.navigateTo({
  253. url: '/pages/money/success'
  254. });
  255. });
  256. }
  257. }
  258. };
  259. </script>
  260. <style lang="less">
  261. .center {
  262. background: #f8f6f6;
  263. min-height: 100%;
  264. height: auto;
  265. }
  266. .top {
  267. margin-top: 10rpx;
  268. background-color: #ffffff;
  269. padding: 56rpx 0;
  270. display: flex;
  271. flex-direction: column;
  272. justify-content: center;
  273. align-items: center;
  274. .top-main {
  275. display: flex;
  276. justify-content: center;
  277. align-items: center;
  278. line-height: 1;
  279. .num {
  280. font-size: 28rpx;
  281. font-family: PingFang SC;
  282. font-weight: bold;
  283. color: #fd3b39;
  284. text {
  285. font-size: 50rpx;
  286. }
  287. }
  288. .top-image {
  289. margin-left: 10rpx;
  290. width: 26rpx;
  291. height: 28rpx;
  292. }
  293. }
  294. .downtime {
  295. margin-top: 20rpx;
  296. }
  297. }
  298. .product {
  299. margin-top: 20rpx;
  300. padding: 35rpx 35rpx 40rpx 35rpx;
  301. background-color: #ffffff;
  302. justify-content: flex-start;
  303. align-items: flex-start;
  304. .product-image {
  305. width: 210rpx;
  306. height: 210rpx;
  307. border-radius: 10rpx;
  308. }
  309. .product-info {
  310. margin-left: 26rpx;
  311. padding-top: 10rpx;
  312. line-height: 1;
  313. .title {
  314. line-height: 1;
  315. font-size: 30rpx;
  316. font-family: PingFang SC;
  317. font-weight: bold;
  318. color: #333333;
  319. text {
  320. color: #999999;
  321. }
  322. }
  323. .buyId {
  324. margin-top: 30rpx;
  325. }
  326. .buyName {
  327. margin-top: 24rpx;
  328. }
  329. .buyPhone {
  330. margin-top: 24rpx;
  331. }
  332. }
  333. }
  334. .main {
  335. margin-top: 20rpx;
  336. padding: 30rpx 0 40rpx;
  337. background: #ffffff;
  338. .main-tip {
  339. padding: 0 30rpx;
  340. font-size: 30rpx;
  341. font-family: PingFang SC;
  342. font-weight: 500;
  343. color: #999999;
  344. }
  345. .main-title {
  346. margin-top: 34rpx;
  347. justify-content: flex-start;
  348. .current {
  349. background: linear-gradient(143.2747deg, #ff6a00, #ee0979) !important;
  350. color: #ffffff !important;
  351. }
  352. .main-item {
  353. width: 33%;
  354. }
  355. .mt-item {
  356. margin: 0 auto;
  357. width: 160rpx;
  358. height: 60rpx;
  359. background: #f8f8f8;
  360. border-radius: 10rpx;
  361. display: flex;
  362. justify-content: center;
  363. align-items: center;
  364. .mt-image {
  365. width: 32rpx;
  366. height: 32rpx;
  367. }
  368. .mt-image1 {
  369. width: 38rpx;
  370. height: 32rpx;
  371. }
  372. .mt-image2 {
  373. width: 36rpx;
  374. height: 32rpx;
  375. }
  376. .mt-font {
  377. margin-left: 10rpx;
  378. font-size: 30rpx;
  379. font-family: PingFang SC;
  380. font-weight: bold;
  381. color: #333333;
  382. }
  383. }
  384. }
  385. .swiper-box {
  386. width: 100%;
  387. padding: 14rpx 30rpx 0;
  388. .tc-item {
  389. padding: 50rpx 2rpx 0;
  390. line-height: 1;
  391. .tcitem-name {
  392. width: 118rpx;
  393. font-size: 30rpx;
  394. font-family: PingFang SC;
  395. font-weight: 500;
  396. color: #999999;
  397. }
  398. .ali-name {
  399. width: 380rpx;
  400. font-size: 30rpx;
  401. font-family: PingFang SC;
  402. font-weight: 500;
  403. color: #333333;
  404. }
  405. .tcitem-image {
  406. width: 26rpx;
  407. height: 28rpx;
  408. }
  409. }
  410. }
  411. }
  412. .upload-image {
  413. width: 160rpx;
  414. height: 160rpx;
  415. border-radius: 10rpx;
  416. }
  417. .upload-title {
  418. font-size: 30rpx;
  419. font-family: PingFang SC;
  420. font-weight: bold;
  421. color: #333333;
  422. }
  423. .upload-main {
  424. padding-top: 32rpx;
  425. display: flex;
  426. justify-content: center;
  427. align-items: center;
  428. flex-direction: column;
  429. .upload-font {
  430. margin-top: 24rpx;
  431. font-size: 30rpx;
  432. font-family: PingFang SC;
  433. font-weight: bold;
  434. color: #333333;
  435. }
  436. }
  437. .upload {
  438. margin-top: 20rpx;
  439. padding: 34rpx 30rpx 40rpx 30rpx;
  440. background: #ffffff;
  441. }
  442. .bottom {
  443. position: fixed;
  444. bottom: 0;
  445. background: #ffffff;
  446. width: 750rpx;
  447. height: 146rpx;
  448. justify-content: flex-start;
  449. .bottom-item {
  450. margin-left: 30rpx;
  451. display: flex;
  452. flex-direction: column;
  453. align-items: center;
  454. .bi-image {
  455. width: 38rpx;
  456. height: 34rpx;
  457. }
  458. .bottom-font {
  459. margin-top: 14rpx;
  460. font-size: 24rpx;
  461. font-family: PingFang SC;
  462. font-weight: bold;
  463. color: #333333;
  464. }
  465. .bottom-num {
  466. line-height: 1;
  467. font-size: 24rpx;
  468. font-family: PingFang SC;
  469. font-weight: bold;
  470. color: #333333;
  471. }
  472. }
  473. .shu {
  474. margin-left: 20rpx;
  475. width: 2px;
  476. height: 74rpx;
  477. background: #c0bfc0;
  478. }
  479. .btn {
  480. margin-left: 20rpx;
  481. width: 430rpx;
  482. height: 80rpx;
  483. background: #fd3b39;
  484. border-radius: 20rpx;
  485. text-align: center;
  486. font-size: 34rpx;
  487. font-family: PingFang SC;
  488. font-weight: bold;
  489. color: #ffffff;
  490. line-height: 80rpx;
  491. }
  492. }
  493. // 文章页底部高度撑开
  494. .contentBottomHeight {
  495. height: 150rpx;
  496. }
  497. </style>