addBankCard.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <view class="content">
  3. <view class="content3 flex s-row">
  4. <view class="flex flex-space-between width100">
  5. 上传银行卡正面
  6. </view>
  7. <u-button type="primary" @click="uploadImg(3)">上传银行卡号页</u-button>
  8. <view class="flex flex-space-between width100">
  9. <view>银行卡卡号</view>
  10. <view class="flex">
  11. <u--input placeholder="输入银行卡号码" inputAlign='right' border="none" v-model="dataDetails.name">
  12. </u--input>
  13. <u--image src="../../static/images/xiangji-2.png" width="40px" height="40px" @click='photograph'>
  14. </u--image>
  15. </view>
  16. </view>
  17. <view class="flex flex-space-between width100">
  18. <view>开户行</view>
  19. <view class="flex">
  20. <u--input placeholder="输入开户行" inputAlign='right' border="none" v-model="dataDetails.name">
  21. </u--input>
  22. </view>
  23. </view>
  24. <view class="flex flex-space-between width100">
  25. <view>开户支行</view>
  26. <view class="flex">
  27. <u--input placeholder="选择开户支行" inputAlign='right' border="none" v-model="dataDetails.name">
  28. </u--input>
  29. <view>手动输入</view>
  30. </view>
  31. </view>
  32. <view class="flex flex-space-between width100">
  33. <view>收款人</view>
  34. <view class="flex">
  35. <u--input placeholder="输入收款人姓名" inputAlign='right' border="none" v-model="dataDetails.name">
  36. </u--input>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="" @click="submit">提交</view>
  41. <u-action-sheet :actions="$helper.imgTypeList" :title="$helper.imgType" :show="isShowimgType"
  42. @select="imgTypeSelect" :closeOnClickOverlay="true" :closeOnClickAction="true" @close="isShowimgType=false">
  43. </u-action-sheet>
  44. </view>
  45. </template>
  46. <script>
  47. import upload from '@/components/upload.vue';
  48. import uploadImage from '@/components/ossutil/uploadFile.js';
  49. var _this;
  50. export default {
  51. components: {},
  52. data() {
  53. return {
  54. uploadType: '',
  55. isShowimgType: false,
  56. dataDetails: {
  57. name: '阿萨啊',
  58. carNumberList: [{
  59. kahao: '',
  60. addressUrl: ''
  61. }],
  62. bankList: [{
  63. yhk: '',
  64. kh: '',
  65. khh: '',
  66. khzh: '',
  67. skr: ''
  68. }],
  69. },
  70. imagesrc: ''
  71. };
  72. },
  73. onLoad() {
  74. _this = this;
  75. },
  76. methods: {
  77. //设置图片
  78. setImage(e) {
  79. // debugger
  80. console.log(e);
  81. //显示在页面
  82. //this.imagesrc = e.path;
  83. if (e.dotype == 'idphoto') {
  84. _this.zjzClipper(e.path);
  85. } else if (e.dotype == 'watermark') {
  86. _this.watermark(e.path);
  87. } else {
  88. _this.savePhoto(e.path);
  89. }
  90. },
  91. //保存图片到相册,方便核查
  92. savePhoto(path) {
  93. // debugger
  94. this.imagesrc = path;
  95. uploadImage(path, 'appData/',
  96. result => {
  97. // 上传成功
  98. console.log('图片地址', result)
  99. }
  100. )
  101. //保存到相册
  102. // uni.saveImageToPhotosAlbum({
  103. // filePath: path,
  104. // success: () => {
  105. // uni.showToast({
  106. // title: '已保存至相册',
  107. // duration: 2000
  108. // });
  109. // }
  110. // });
  111. },
  112. uploadImg(type) {
  113. this.uploadType = type
  114. this.isShowimgType = true
  115. },
  116. photograph() {
  117. console.log('拍照')
  118. let that = this;
  119. uni.chooseImage({
  120. count: 1,
  121. success: function(res) {
  122. console.log(JSON.stringify(res.tempFilePaths));
  123. uploadImage(res.tempFilePaths[0], 'appData/',
  124. result => {
  125. // 上传成功
  126. console.log('图片地址', result)
  127. }
  128. )
  129. }
  130. });
  131. },
  132. imgTypeSelect(val) {
  133. console.log(val)
  134. console.log(this.uploadType)
  135. if (val.name == '相册') {
  136. uni.chooseImage({
  137. count: 1,
  138. sourceType: this.$helper.chooseImage.sourceType,
  139. success: function(res) {
  140. console.log(JSON.stringify(res.tempFilePaths));
  141. uploadImage(res.tempFilePaths[0], 'appData/',
  142. result => {
  143. // 上传成功
  144. console.log('图片地址', result)
  145. switch (this.uploadType) {
  146. case 0:
  147. console.log('人车合影')
  148. break
  149. case 1:
  150. console.log('身份正面')
  151. break
  152. case 2:
  153. console.log('身份反面')
  154. break
  155. case 3:
  156. console.log('银行卡')
  157. break
  158. case 4:
  159. }
  160. }
  161. )
  162. }
  163. });
  164. } else {
  165. switch (this.uploadType) {
  166. case 0:
  167. console.log('人车合影')
  168. break
  169. case 1:
  170. uni.$u.route('/pages/mine/camera/idcard/idcard?dotype=face');
  171. console.log('身份正面')
  172. break
  173. case 2:
  174. console.log('身份反面')
  175. break
  176. case 3:
  177. console.log('银行卡')
  178. break
  179. case 4:
  180. }
  181. }
  182. },
  183. //身份证正面
  184. getImgUrl1(src) {
  185. // console.log(src)
  186. // console.log('------------res-----------')
  187. // let that = this;
  188. // that.id[0] = src
  189. // that.id1 = src
  190. // that.certificates = false
  191. // that.personImgs.personImg = that.id[0]
  192. // that.$api.doRequest('get', '/driverViewInfo/personShibie', that
  193. // .personImgs).then(res => {
  194. // if (res.data.data.recPerson != null) {
  195. // if (res.data.data.recPerson != "") {
  196. // that.$set(that.DriverViewInfo, 'driverName', res
  197. // .data.data.recPerson)
  198. // }
  199. // }
  200. // if (res.data.data.recPersonNo != null) {
  201. // if (res.data.data.recPersonNo != "") {
  202. // that.$set(that.DriverViewInfo, 'numberCard', res
  203. // .data.data.recPersonNo)
  204. // }
  205. // }
  206. // }).catch(res => {
  207. // uni.showToast({
  208. // title: res.data.message,
  209. // icon: 'none',
  210. // duration: 2000
  211. // })
  212. // })
  213. },
  214. submit(){
  215. console.log(' tijia')
  216. },
  217. },
  218. };
  219. </script>
  220. <style scoped lang="scss">
  221. .row4-img {
  222. width: 32rpx;
  223. height: 32rpx;
  224. }
  225. </style>