pay.vue 9.2 KB

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