upload.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <view class="content">
  3. <view class="">
  4. {{chooseId}}
  5. </view>
  6. <view class="choose-wrap">
  7. <picker mode="selector" :range="chooseList" @change="bangTypeChange">
  8. <view>{{type || '请选择支付方式'}}</view>
  9. </picker>
  10. </view>
  11. <view class="tit">
  12. 上传支付凭证
  13. </view>
  14. <view class="up-wrap" @click="imgsub('upimg')">
  15. <image :src="upimg" mode="" v-if="upimg"></image>
  16. <image v-else src="../../static/img/upimg.png" mode=""></image>
  17. </view>
  18. <view class="btn" @click="evaluationUpload">提交审核</view>
  19. </view>
  20. </template>
  21. <script>
  22. import { upload } from '@/api/user.js';
  23. import { evaluationUpload } from '@/api/package.js'
  24. export default {
  25. data() {
  26. return {
  27. upimg: '',
  28. type: '',
  29. toUser: {},
  30. chooseList: ['微信','支付宝','银行卡'],
  31. chooseId: ''
  32. }
  33. },
  34. onload(opt) {
  35. if(opt.id) {
  36. this.chooseId = opt.id
  37. console.log(this.chooseId,'this.chooseId')
  38. }
  39. console.log(opt,'dd')
  40. },
  41. methods: {
  42. bangTypeChange(e) {
  43. this.type = this.chooseList[e.detail.value]
  44. },
  45. imgsub(text) {
  46. console.log('imgsub');
  47. upload({
  48. filename: ''
  49. }).then(data => {
  50. // this.upimg = data[0].url;
  51. this.$set(this,text,data[0].url)
  52. });
  53. },
  54. //提交审核
  55. evaluationUpload() {
  56. evaluationUpload().then( res => {
  57. console.log(res,'上传凭证+++++')
  58. })
  59. }
  60. }
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. .tit {
  65. padding: 30rpx 25rpx;
  66. text-align: center;
  67. font-size: 32rpx;
  68. font-family: PingFang SC;
  69. font-weight: bold;
  70. color: #101010;
  71. }
  72. .up-wrap {
  73. margin:auto;
  74. width: 225rpx;
  75. height: 225rpx;
  76. background: #FFFFFF;
  77. border-radius: 10rpx;
  78. image {
  79. width: 225rpx;
  80. height: 225rpx;
  81. border-radius: 10rpx;
  82. }
  83. }
  84. .btn {
  85. margin: 70rpx auto 0;
  86. width: 702rpx;
  87. line-height: 84rpx;
  88. background: linear-gradient(30deg, #FF4C4C, #FE6238);
  89. border-radius: 10rpx;
  90. font-size: 32rpx;
  91. font-family: PingFang SC;
  92. font-weight: bold;
  93. color: #FFFFFF;
  94. text-align: center;
  95. }
  96. </style>