upload.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <view class="content">
  3. <view class="tit">
  4. 上传支付凭证
  5. </view>
  6. <view class="up-wrap" @click="imgsub('upimg')">
  7. <image :src="upimg" mode="" v-if="upimg"></image>
  8. <image v-else src="../../static/img/upimg.png" mode=""></image>
  9. </view>
  10. <view class="btn" @click="evaluationUpload">提交审核</view>
  11. <view class=" flex btn" style="justify-content: center;">
  12. <!-- <view class="zftype">
  13. 支付方式:
  14. </view> -->
  15. <picker mode="selector" :range="chooseList" @change="bangTypeChange" style="width: 100%;">
  16. <view>支付方式:{{type || '请选择支付方式'}}</view>
  17. </picker>
  18. </view>
  19. <view class="base-info" v-if="type !== ''">
  20. <view class="base-item flex" v-if="type == '微信'">
  21. <view class="item-name">微信号</view>
  22. <input type="text" value="" class="item-val" placeholder="" v-model="toUser.wx_no" />
  23. </view>
  24. <view class="base-item flex" v-if="type == '微信'">
  25. <view class="item-name">收款码</view>
  26. <view class="img-wrap">
  27. <image :src="toUser.wx_qr" mode=""></image>
  28. </view>
  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.alipay_name" disabled/>
  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.alipay_no" disabled/>
  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.account_Bank" disabled/>
  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_branch" disabled/>
  45. </view>
  46. <view class="base-item flex" v-if="type=='银行卡'">
  47. <view class="item-name">开户行姓名</view>
  48. <input type="text" value="" class="item-val" placeholder="" v-model="toUser.bank_name" disabled/>
  49. </view>
  50. <view class="base-item flex" v-if="type=='银行卡'">
  51. <view class="item-name">银行卡账号</view>
  52. <input type="text" value="" class="item-val" placeholder="" v-model="toUser.bank_card" disabled/>
  53. </view>
  54. </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. obj.$api.prePage().refresh();
  112. setTimeout(() => {
  113. uni.navigateBack({
  114. })
  115. },2000)
  116. // this.page = 1
  117. // this.list = []
  118. // this.loadingType = 'more'
  119. // this.loadData()
  120. console.log(res,'上传凭证+++++')
  121. })
  122. },
  123. }
  124. }
  125. </script>
  126. <style lang="scss" scoped>
  127. .tit {
  128. padding: 30rpx 25rpx;
  129. text-align: center;
  130. font-size: 32rpx;
  131. font-family: PingFang SC;
  132. font-weight: bold;
  133. color: #101010;
  134. }
  135. .up-wrap {
  136. margin:auto;
  137. width: 225rpx;
  138. height: 225rpx;
  139. background: #FFFFFF;
  140. border-radius: 10rpx;
  141. image {
  142. width: 225rpx;
  143. height: 225rpx;
  144. border-radius: 10rpx;
  145. }
  146. }
  147. .btn {
  148. margin: 70rpx auto 0;
  149. width: 702rpx;
  150. line-height: 84rpx;
  151. background: linear-gradient(30deg, #FF4C4C, #FE6238);
  152. border-radius: 10rpx;
  153. font-size: 32rpx;
  154. font-family: PingFang SC;
  155. font-weight: bold;
  156. color: #FFFFFF;
  157. text-align: center;
  158. }
  159. .choose-wrap {
  160. justify-content: flex-start;
  161. padding-left: 30rpx;
  162. line-height: 100rpx;
  163. font-size: 30rpx;
  164. font-family: PingFang SC;
  165. font-weight: bold;
  166. // color: #333333;
  167. }
  168. .base-info {
  169. margin: auto;
  170. width: 702rpx;
  171. // height: 1106px;
  172. background: #FFFFFF;
  173. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  174. border-radius: 20rpx;
  175. .base-item {
  176. border: 1px solid #eee;
  177. line-height: 100rpx;
  178. font-size: 30rpx;
  179. font-family: PingFang SC;
  180. font-weight: 500;
  181. color: #333333;
  182. padding-left: 25rpx;
  183. .img-wrap {
  184. width: 478rpx;
  185. image {
  186. width: 200rpx;
  187. height: 200rpx;
  188. }
  189. }
  190. .avatar {
  191. margin: auto;
  192. width: 200rpx;
  193. height: 200rpx;
  194. border-radius: 50%;
  195. // background-color: #aaa;
  196. image {
  197. width: 200rpx;
  198. height: 200rpx;
  199. border-radius: 50%;
  200. }
  201. }
  202. .item-name {
  203. font-weight: bold;
  204. }
  205. .item-val {
  206. display: block;
  207. line-height: 100rpx;
  208. height: 100rpx;
  209. width: 478rpx;
  210. font-size: 28rpx;
  211. font-family: PingFang SC;
  212. font-weight: 400;
  213. color: #000;
  214. }
  215. }
  216. }
  217. </style>