upload.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <view class="content">
  3. <view class="choose-wrap flex">
  4. <view class="zftype">
  5. 支付方式:
  6. </view>
  7. <picker mode="selector" :range="chooseList" @change="bangTypeChange">
  8. <view>{{type || '请选择支付方式'}}</view>
  9. </picker>
  10. </view>
  11. <view class="base-info" v-if="type !== ''">
  12. <view class="base-item flex" v-if="type == '微信'">
  13. <view class="item-name">微信号</view>
  14. <input type="text" value="" class="item-val" placeholder="" v-model="toUser.wx_no" />
  15. </view>
  16. <view class="base-item flex" v-if="type == '微信'">
  17. <view class="item-name">收款码</view>
  18. <view class="img-wrap">
  19. <image :src="toUser.wx_qr" mode=""></image>
  20. </view>
  21. </view>
  22. <view class="base-item flex" v-if="type == '支付宝'">
  23. <view class="item-name">支付宝姓名</view>
  24. <input type="text" value="" class="item-val" placeholder="" v-model="toUser.alipay_name" />
  25. </view>
  26. <view class="base-item flex" v-if="type == '支付宝'">
  27. <view class="item-name">支付宝账号</view>
  28. <input type="text" value="" class="item-val" placeholder="" v-model="toUser.alipay_no" />
  29. </view>
  30. <view class="base-item flex" v-if="type=='银行卡'">
  31. <view class="item-name">开户行</view>
  32. <input type="text" value="" class="item-val" placeholder="" v-model="toUser.account_Bank" />
  33. </view>
  34. <view class="base-item flex" v-if="type=='银行卡'">
  35. <view class="item-name">所属支行</view>
  36. <input type="text" value="" class="item-val" placeholder="" v-model="toUser.bank_branch" />
  37. </view>
  38. <view class="base-item flex" v-if="type=='银行卡'">
  39. <view class="item-name">开户行姓名</view>
  40. <input type="text" value="" class="item-val" placeholder="" v-model="toUser.bank_name" />
  41. </view>
  42. <view class="base-item flex" v-if="type=='银行卡'">
  43. <view class="item-name">银行卡账号</view>
  44. <input type="text" value="" class="item-val" placeholder="" v-model="toUser.bank_card" />
  45. </view>
  46. </view>
  47. <view class="tit">
  48. 上传支付凭证
  49. </view>
  50. <view class="up-wrap" @click="imgsub('upimg')">
  51. <image :src="upimg" mode="" v-if="upimg"></image>
  52. <image v-else src="../../static/img/upimg.png" mode=""></image>
  53. </view>
  54. <view class="btn" @click="evaluationUpload">提交审核</view>
  55. </view>
  56. </template>
  57. <script>
  58. import { upload } from '@/api/user.js';
  59. import { evaluationUpload } from '@/api/package.js'
  60. export default {
  61. data() {
  62. return {
  63. upimg: '',
  64. type: '',
  65. toUser: {},
  66. chooseList: ['微信','支付宝','银行卡'],
  67. chooseId: ''
  68. }
  69. },
  70. onLoad(opt) {
  71. console.log(opt)
  72. if(opt.id) {
  73. this.chooseId = opt.id
  74. console.log(this.chooseId,'this.chooseId')
  75. }
  76. this.toUser = JSON.parse(opt.paytype)
  77. console.log(this.toUser,'dd')
  78. },
  79. methods: {
  80. bangTypeChange(e) {
  81. this.type = this.chooseList[e.detail.value]
  82. },
  83. imgsub(text) {
  84. console.log('imgsub');
  85. upload({
  86. filename: ''
  87. }).then(data => {
  88. // this.upimg = data[0].url;
  89. this.$set(this,text,data[0].url)
  90. });
  91. },
  92. //提交审核
  93. evaluationUpload() {
  94. let obj = this
  95. if(obj.type == '') {
  96. obj.$api.msg('请选择支付方式')
  97. return
  98. }
  99. if(obj.upimg == '') {
  100. obj.$api.msg('请选择上传的凭证')
  101. return
  102. }
  103. evaluationUpload({
  104. pay_evaluation: obj.upimg,
  105. id: obj.chooseId
  106. }).then( res => {
  107. uni.showToast({
  108. title:'提交成功',
  109. duration:2000
  110. });
  111. setTimeout(() => {
  112. uni.navigateBack({
  113. })
  114. },2000)
  115. // this.page = 1
  116. // this.list = []
  117. // this.loadingType = 'more'
  118. // this.loadData()
  119. console.log(res,'上传凭证+++++')
  120. })
  121. },
  122. }
  123. }
  124. </script>
  125. <style lang="scss" scoped>
  126. .tit {
  127. padding: 30rpx 25rpx;
  128. text-align: center;
  129. font-size: 32rpx;
  130. font-family: PingFang SC;
  131. font-weight: bold;
  132. color: #101010;
  133. }
  134. .up-wrap {
  135. margin:auto;
  136. width: 225rpx;
  137. height: 225rpx;
  138. background: #FFFFFF;
  139. border-radius: 10rpx;
  140. image {
  141. width: 225rpx;
  142. height: 225rpx;
  143. border-radius: 10rpx;
  144. }
  145. }
  146. .btn {
  147. margin: 70rpx auto 0;
  148. width: 702rpx;
  149. line-height: 84rpx;
  150. background: linear-gradient(30deg, #FF4C4C, #FE6238);
  151. border-radius: 10rpx;
  152. font-size: 32rpx;
  153. font-family: PingFang SC;
  154. font-weight: bold;
  155. color: #FFFFFF;
  156. text-align: center;
  157. }
  158. .choose-wrap {
  159. justify-content: flex-start;
  160. padding-left: 30rpx;
  161. line-height: 100rpx;
  162. font-size: 30rpx;
  163. font-family: PingFang SC;
  164. font-weight: bold;
  165. color: #333333;
  166. }
  167. .base-info {
  168. margin: auto;
  169. width: 702rpx;
  170. // height: 1106px;
  171. background: #FFFFFF;
  172. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  173. border-radius: 20rpx;
  174. .base-item {
  175. border: 1px solid #eee;
  176. line-height: 100rpx;
  177. font-size: 30rpx;
  178. font-family: PingFang SC;
  179. font-weight: 500;
  180. color: #333333;
  181. padding-left: 25rpx;
  182. .img-wrap {
  183. width: 478rpx;
  184. image {
  185. width: 200rpx;
  186. height: 200rpx;
  187. }
  188. }
  189. .avatar {
  190. margin: auto;
  191. width: 200rpx;
  192. height: 200rpx;
  193. border-radius: 50%;
  194. // background-color: #aaa;
  195. image {
  196. width: 200rpx;
  197. height: 200rpx;
  198. border-radius: 50%;
  199. }
  200. }
  201. .item-name {
  202. font-weight: bold;
  203. }
  204. .item-val {
  205. display: block;
  206. line-height: 100rpx;
  207. height: 100rpx;
  208. width: 478rpx;
  209. font-size: 28rpx;
  210. font-family: PingFang SC;
  211. font-weight: 400;
  212. color: #000;
  213. }
  214. }
  215. }
  216. </style>