pay.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. <template>
  2. <view class="center">
  3. <view class="" style="height: 20rpx;">
  4. </view>
  5. <view class="main">
  6. <view class="main-tip">请向以下账号自行转账(任选一种方式)</view>
  7. <view class="main-title flex">
  8. <view class="mt-item" @click="change('1')" :class="{ current: tabCurrentIndex === 1 }" v-if="info.bank && info.bank.fullname">
  9. <view class="mt-font" :class="{ current: tabCurrentIndex === 1 }">银行卡</view>
  10. </view>
  11. <view class="mt-item" @click="change('0')" :class="{ current: tabCurrentIndex === 0 }" v-if="info.ali && info.ali.fullname">
  12. <view class="mt-font" :class="{ current: tabCurrentIndex === 0 }">支付宝</view>
  13. </view>
  14. <view class="mt-item" @click="change('2')" :class="{ current: tabCurrentIndex === 2 }" v-if="info.wx && info.wx.fullname">
  15. <view class="mt-font" :class="{ current: tabCurrentIndex === 2 }">微信</view>
  16. </view>
  17. </view>
  18. <template v-if="tabCurrentIndex == 0 && info.ali && info.ali.fullname">
  19. <view class="tc-item flex">
  20. <view class="tcitem-name">姓名</view>
  21. <view class="ali-name">{{info.ali.fullname}}</view>
  22. </view>
  23. <view class="tc-item flex">
  24. <view class="tcitem-name">支付宝账号</view>
  25. <view class="ali-name">{{info.ali.alino}}</view>
  26. </view>
  27. <view class="tc-item flex">
  28. <view class="tcitem-name">微信收款码</view>
  29. <image :src="info.ali.qr" mode="" @click="lookImg(info.ali.qr)"></image>
  30. </view>
  31. </template>
  32. <template v-if="tabCurrentIndex == 1 && info.bank && info.bank.fullname">
  33. <view class="tc-item flex">
  34. <view class="tcitem-name">姓名</view>
  35. <view class="ali-name">{{info.bank.fullname}}</view>
  36. </view>
  37. <view class="tc-item flex">
  38. <view class="tcitem-name">开户行</view>
  39. <view class="ali-name">{{info.bank.bank}}</view>
  40. </view>
  41. <view class="tc-item flex">
  42. <view class="tcitem-name">所属支行</view>
  43. <view class="ali-name">{{info.bank.subbranch}}</view>
  44. </view>
  45. <view class="tc-item flex">
  46. <view class="tcitem-name">银行卡号</view>
  47. <view class="ali-name">{{info.bank.bankno}}</view>
  48. </view>
  49. </template>
  50. <template v-if="tabCurrentIndex ==2 && info.wx && info.wx.fullname">
  51. <view class="tc-item flex">
  52. <view class="tcitem-name">姓名</view>
  53. <view class="ali-name">{{info.wx.fullname}}</view>
  54. </view>
  55. <view class="tc-item flex">
  56. <view class="tcitem-name">微信账号</view>
  57. <view class="ali-name">{{info.wx.wxno}}</view>
  58. </view>
  59. <view class="tc-item flex">
  60. <view class="tcitem-name">微信收款码</view>
  61. <image :src="info.wx.qr" mode="" @click="lookImg(info.wx.qr)"></image>
  62. </view>
  63. </template>
  64. </view>
  65. <view class="upload">
  66. <view class="upload-title">上传支付截图</view>
  67. <view class="upload-main">
  68. <image v-if="!pz" class="upload-image" src="../../static/img/add.png" mode="" @click="upimg"></image>
  69. <image v-else :src="pz" mode="" class="upload-image" @click="upimg"></image>
  70. <view class="upload-font">点击上传支付截图</view>
  71. </view>
  72. </view>
  73. <view class="bottom flex">
  74. <view class="btn" @click="goUp()">立即上传</view>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. import { upload } from '@/api/order.js';
  80. import {
  81. getCardInfo,
  82. upEvaluation
  83. } from '@/api/zero.js'
  84. export default {
  85. data() {
  86. return {
  87. tabCurrentIndex: 1,
  88. info: {},
  89. pz: '',
  90. pzing: false,
  91. };
  92. },
  93. onLoad(opt) {
  94. if (opt.id) {
  95. this.id = opt.id
  96. this.getInfo()
  97. }
  98. },
  99. methods: {
  100. lookImg(img) {
  101. let arr = img.split(',')
  102. uni.previewImage({
  103. current: 0,
  104. loop: false,
  105. urls: arr,
  106. indicator: 'default'
  107. });
  108. },
  109. //上传凭证
  110. goUp() {
  111. if(this.pzing) {
  112. return
  113. }
  114. if(!this.pz) {
  115. return this.$api.msg('请上传支付截图')
  116. }
  117. this.pzing = true
  118. upEvaluation({
  119. id: this.id,
  120. up_files: this.pz
  121. }).then(res => {
  122. uni.showToast({
  123. title:'上传成功',
  124. duration:2000
  125. });
  126. this.pzing = false
  127. setTimeout(()=> {
  128. uni.navigateBack()
  129. },1500)
  130. }).catch(err => {
  131. this.pzing = false
  132. })
  133. },
  134. upimg() {
  135. upload({
  136. file: ''
  137. })
  138. .then(e => {
  139. console.log(e,'e')
  140. this.pz = e[0].url
  141. console.log(this.pz)
  142. })
  143. .catch(e => {});
  144. },
  145. getInfo() {
  146. getCardInfo({
  147. id: this.id
  148. }).then(res => {
  149. // console.log(info)
  150. this.info = res.data.result
  151. })
  152. },
  153. open() {
  154. this.$refs.popup.open();
  155. },
  156. close() {
  157. this.$refs.popup.close();
  158. },
  159. nav(url) {
  160. uni.navigateTo({
  161. url
  162. });
  163. },
  164. //swiper 切换
  165. changeTab(e) {
  166. this.tabCurrentIndex = e.target.current;
  167. },
  168. toBack() {
  169. uni.navigateBack({});
  170. },
  171. change(num) {
  172. this.tabCurrentIndex = num * 1;
  173. }
  174. }
  175. };
  176. </script>
  177. <style lang="less">
  178. .center {
  179. background: #f8f6f6;
  180. min-height: 100%;
  181. height: auto;
  182. }
  183. .top {
  184. margin-top: 10rpx;
  185. background-color: #ffffff;
  186. padding: 56rpx 0;
  187. display: flex;
  188. flex-direction: column;
  189. justify-content: center;
  190. align-items: center;
  191. .top-main {
  192. display: flex;
  193. justify-content: center;
  194. align-items: center;
  195. line-height: 1;
  196. .num {
  197. font-size: 28rpx;
  198. font-weight: bold;
  199. color: #fd3b39;
  200. text {
  201. font-size: 50rpx;
  202. }
  203. }
  204. .top-image {
  205. margin-left: 10rpx;
  206. width: 26rpx;
  207. height: 28rpx;
  208. }
  209. }
  210. .downtime {
  211. margin-top: 20rpx;
  212. }
  213. }
  214. .product {
  215. margin-top: 20rpx;
  216. padding: 35rpx 35rpx 40rpx 35rpx;
  217. background-color: #ffffff;
  218. justify-content: flex-start;
  219. align-items: flex-start;
  220. .product-image {
  221. width: 210rpx;
  222. height: 210rpx;
  223. border-radius: 10rpx;
  224. }
  225. .product-info {
  226. margin-left: 26rpx;
  227. padding-top: 10rpx;
  228. line-height: 1;
  229. .title {
  230. line-height: 1;
  231. font-size: 30rpx;
  232. font-weight: bold;
  233. color: #333333;
  234. text {
  235. color: #999999;
  236. }
  237. }
  238. .buyId {
  239. margin-top: 30rpx;
  240. }
  241. .buyName {
  242. margin-top: 24rpx;
  243. }
  244. .buyPhone {
  245. margin-top: 24rpx;
  246. }
  247. }
  248. }
  249. .main {
  250. padding: 30rpx 0 40rpx;
  251. background: #ffffff;
  252. .main-tip {
  253. padding: 0 30rpx;
  254. font-size: 30rpx;
  255. font-weight: 500;
  256. color: #999999;
  257. }
  258. .main-title {
  259. padding: 0 30rpx;
  260. margin-top: 34rpx;
  261. padding-bottom: 50rpx;
  262. .current {
  263. background: #fd3b39 !important;
  264. color: #ffffff !important;
  265. }
  266. .mt-item {
  267. width: 160rpx;
  268. height: 60rpx;
  269. background: #f8f8f8;
  270. border-radius: 10rpx;
  271. display: flex;
  272. justify-content: center;
  273. align-items: center;
  274. .mt-image {
  275. width: 32rpx;
  276. height: 32rpx;
  277. }
  278. .mt-image1 {
  279. width: 38rpx;
  280. height: 32rpx;
  281. }
  282. .mt-image2 {
  283. width: 36rpx;
  284. height: 32rpx;
  285. }
  286. .mt-font {
  287. margin-left: 10rpx;
  288. font-size: 30rpx;
  289. font-weight: bold;
  290. color: #333333;
  291. }
  292. }
  293. }
  294. .swiper-box {
  295. width: 100%;
  296. padding: 14rpx 30rpx 0;
  297. }
  298. }
  299. .upload {
  300. margin-top: 20rpx;
  301. padding: 34rpx 30rpx 40rpx 30rpx;
  302. background: #ffffff;
  303. .upload-title {
  304. font-size: 30rpx;
  305. font-weight: bold;
  306. color: #333333;
  307. }
  308. .upload-main {
  309. padding-top: 32rpx;
  310. display: flex;
  311. justify-content: center;
  312. align-items: center;
  313. flex-direction: column;
  314. .upload-image {
  315. width: 160rpx;
  316. height: 160rpx;
  317. border-radius: 10rpx;
  318. }
  319. .upload-font {
  320. margin-top: 24rpx;
  321. font-size: 30rpx;
  322. font-weight: bold;
  323. color: #333333;
  324. }
  325. }
  326. }
  327. .bottom {
  328. position: fixed;
  329. bottom: 0;
  330. background: #ffffff;
  331. width: 750rpx;
  332. height: 146rpx;
  333. justify-content: center;
  334. .bottom-item {
  335. margin-left: 30rpx;
  336. display: flex;
  337. flex-direction: column;
  338. align-items: center;
  339. .bi-image {
  340. width: 38rpx;
  341. height: 34rpx;
  342. }
  343. .bottom-font {
  344. margin-top: 14rpx;
  345. font-size: 24rpx;
  346. font-weight: bold;
  347. color: #333333;
  348. }
  349. .bottom-num {
  350. line-height: 1;
  351. font-size: 24rpx;
  352. font-weight: bold;
  353. color: #333333;
  354. }
  355. }
  356. .shu {
  357. margin-left: 20rpx;
  358. width: 2px;
  359. height: 74rpx;
  360. background: #c0bfc0;
  361. }
  362. .btn {
  363. margin-left: 40rpx;
  364. width: 430rpx;
  365. height: 80rpx;
  366. background: #fd3b39;
  367. border-radius: 20rpx;
  368. text-align: center;
  369. font-size: 34rpx;
  370. font-weight: bold;
  371. color: #ffffff;
  372. line-height: 80rpx;
  373. }
  374. }
  375. .tc-item {
  376. padding: 10rpx 0 10rpx 20rpx;
  377. justify-content: flex-start;
  378. image {
  379. width: 200rpx;
  380. height: 200rpx;
  381. }
  382. .tcitem-name {
  383. width: 200rpx;
  384. font-size: 30rpx;
  385. font-weight: 500;
  386. color: #999999;
  387. }
  388. .ali-name {
  389. width: 380rpx;
  390. font-size: 30rpx;
  391. font-weight: 500;
  392. color: #333333;
  393. }
  394. .tcitem-image {
  395. width: 26rpx;
  396. height: 28rpx;
  397. }
  398. }
  399. </style>