editBankCard.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <view class="content">
  3. <view class="content3 flex s-row">
  4. <view class="title">上传银行卡卡号页</view>
  5. <view @click="uploadImg" class="picture picture3">
  6. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  7. <view class="text">上传银行卡卡号页</view>
  8. </view>
  9. <!-- <u-button type="primary" @click="uploadImg(3,index)">上传银行卡号页</u-button> -->
  10. <!-- <image class="preview" :src="item.payeeAddressUrl" mode="aspectFit"
  11. style="width:710rpx:height:710rpx;margin: 20rpx;"> </image> -->
  12. <view class="flex row">
  13. <view class="left-text">银行卡卡号</view>
  14. <view class="flex">
  15. <u--input placeholder="输入银行卡号码" inputAlign='left' border="none" v-model="dataDetails.bankCard">
  16. </u--input>
  17. </view>
  18. </view>
  19. <view class="flex row">
  20. <view class="left-text">开户行</view>
  21. <u--input placeholder="输入开户行" inputAlign='left' border="none" v-model="dataDetails.bankDeposit">
  22. </u--input>
  23. </view>
  24. <view class="flex row">
  25. <view class="left-text khzh-styel">开户支行</view>
  26. <view class="flex align-center" v-if="isShowManualInput">
  27. <u--input class="select-bankzh" placeholder="输入开户支行" inputAlign='left' border="none"
  28. v-model="dataDetails.bankDepositBranch">
  29. </u--input>
  30. <view @click="manualInput" class="type">选择支行</view>
  31. </view>
  32. <view class="flex align-center" v-if="!isShowManualInput">
  33. <!-- <u--input @click="selectZhbank" placeholder="选择开户支行" inputAlign='left' border="none" disabled>
  34. </u--input> -->
  35. <view class="select-bankzh" @click="selectZhbank">选择开户支行</view>
  36. <view @click="manualInput" class="type">手动输入</view>
  37. </view>
  38. </view>
  39. <view class="flex row noborder">
  40. <view class="left-text">收款人</view>
  41. <view class="flex">
  42. <u--input placeholder="输入收款人姓名" inputAlign='left' border="none" v-model="dataDetails.payeeName">
  43. </u--input>
  44. </view>
  45. </view>
  46. <u-picker :show="isShowBank" :columns="bankType[index]" :closeOnClickOverlay='true' @close='zhBankClose'
  47. @cancel='zhBankClose' @confirm='confirmBank'></u-picker>
  48. </u-picker>
  49. </view>
  50. <u-toast ref="uToast"></u-toast>
  51. <view class="submit-btn" @click="submit">提交</view>
  52. <u-action-sheet :actions="$helper.imgTypeList" :title="$helper.imgType" :show="isShowimgType"
  53. @select="imgTypeSelect" :closeOnClickOverlay="true" :closeOnClickAction="true" @close="isShowimgType=false">
  54. </u-action-sheet>
  55. </view>
  56. </template>
  57. <script>
  58. import upload from '@/components/upload.vue';
  59. import uploadImage from '@/components/ossutil/uploadFile.js';
  60. var _this;
  61. export default {
  62. components: {},
  63. data() {
  64. return {
  65. isShowimgType: false,
  66. dataDetails: {},
  67. imagesrc: '',
  68. bankType: [],
  69. isShowBank: false,
  70. isShowManualInput: false,
  71. index: ''
  72. };
  73. },
  74. onLoad() {
  75. _this = this;
  76. },
  77. methods: {
  78. manualInput() {
  79. if (this.isShowManualInput) {
  80. if (uni.$u.test.isEmpty(this.bankType[this.index])) {
  81. this.$refs.uToast.show({
  82. type: 'error',
  83. message: "请先上传银行卡!",
  84. })
  85. return true
  86. }
  87. this.isShowBank = true
  88. } else {
  89. this.isShowBank = false
  90. }
  91. this.isShowManualInput = !this.isShowManualInput
  92. },
  93. //设置图片
  94. setImage(e) {
  95. console.log(e);
  96. //显示在页面
  97. //this.imagesrc = e.path;
  98. if (e.dotype == 'idphoto') {
  99. _this.zjzClipper(e.path);
  100. } else if (e.dotype == 'watermark') {
  101. _this.watermark(e.path);
  102. } else {
  103. _this.savePhoto(e.path);
  104. }
  105. },
  106. //保存图片到相册,方便核查
  107. savePhoto(path) {
  108. this.imagesrc = path;
  109. uploadImage(path, 'appData/',
  110. result => {
  111. // 上传成功
  112. console.log('图片地址', result)
  113. }
  114. )
  115. //保存到相册
  116. // uni.saveImageToPhotosAlbum({
  117. // filePath: path,
  118. // success: () => {
  119. // uni.showToast({
  120. // title: '已保存至相册',
  121. // duration: 2000
  122. // });
  123. // }
  124. // });
  125. },
  126. uploadImg() {
  127. this.isShowimgType = true
  128. },
  129. photograph() {
  130. console.log('拍照')
  131. let that = this;
  132. uni.chooseImage({
  133. count: 1,
  134. success: function(res) {
  135. console.log(JSON.stringify(res.tempFilePaths));
  136. uploadImage(res.tempFilePaths[0], 'appData/',
  137. result => {
  138. // 上传成功
  139. console.log('图片地址', result)
  140. }
  141. )
  142. }
  143. });
  144. },
  145. imgTypeSelect(val) {
  146. console.log(val)
  147. if (val.name == '相册') {
  148. uni.chooseImage({
  149. count: 1,
  150. sourceType: this.$helper.chooseImage.sourceType,
  151. success: function(res) {
  152. console.log(JSON.stringify(res.tempFilePaths));
  153. uploadImage(res.tempFilePaths[0], 'appData/',
  154. result => {
  155. // 上传成功
  156. console.log('图片地址', result)
  157. }
  158. )
  159. }
  160. });
  161. } else {
  162. }
  163. },
  164. //身份证正面
  165. getImgUrl1(src) {
  166. // console.log(src)
  167. // console.log('------------res-----------')
  168. // let that = this;
  169. // that.id[0] = src
  170. // that.id1 = src
  171. // that.certificates = false
  172. // that.personImgs.personImg = that.id[0]
  173. // that.$api.doRequest('get', '/driverViewInfo/personShibie', that
  174. // .personImgs).then(res => {
  175. // if (res.data.data.recPerson != null) {
  176. // if (res.data.data.recPerson != "") {
  177. // that.$set(that.DriverViewInfo, 'driverName', res
  178. // .data.data.recPerson)
  179. // }
  180. // }
  181. // if (res.data.data.recPersonNo != null) {
  182. // if (res.data.data.recPersonNo != "") {
  183. // that.$set(that.DriverViewInfo, 'numberCard', res
  184. // .data.data.recPersonNo)
  185. // }
  186. // }
  187. // }).catch(res => {
  188. // uni.showToast({
  189. // title: res.data.message,
  190. // icon: 'none',
  191. // duration: 2000
  192. // })
  193. // })
  194. },
  195. submit() {
  196. console.log(' tijia')
  197. },
  198. },
  199. };
  200. </script>
  201. <style scoped lang="scss">
  202. .row4-img {
  203. width: 32rpx;
  204. height: 32rpx;
  205. }
  206. .content {
  207. padding: 20rpx;
  208. }
  209. .content3 {
  210. background: white;
  211. padding: 20rpx;
  212. box-sizing: border-box;
  213. .left-text {
  214. // background: red;
  215. width: 290rpx;
  216. color: #333333;
  217. display: flex;
  218. align-items: center;
  219. }
  220. .row {
  221. border-bottom: 1px solid #EEEEEE;
  222. padding-bottom: 28rpx;
  223. margin-top: 26rpx;
  224. .ch-style {}
  225. }
  226. .row-ch {
  227. padding-right: 180rpx;
  228. box-sizing: border-box;
  229. }
  230. }
  231. .title {
  232. color: #999999;
  233. margin: 20rpx 0;
  234. }
  235. .picture {
  236. margin-top: 20rpx;
  237. background: #F5F6FA;
  238. border-radius: 10rpx;
  239. display: flex;
  240. flex-direction: column;
  241. justify-content: center;
  242. align-items: center;
  243. color: #6A7282;
  244. }
  245. .picture {
  246. width: 100%;
  247. height: 440rpx;
  248. .text {
  249. margin-top: 20rpx;
  250. }
  251. }
  252. .xj-image {
  253. width: 100rpx;
  254. height: 100rpx;
  255. }
  256. .picture3 {
  257. background: url(../../../static/images/mine/yhkzm.png);
  258. background-size: 100% 100%;
  259. }
  260. .select-bankzh {
  261. width: 230rpx;
  262. // height: 48rpx;
  263. }
  264. .type {
  265. background: #2772FB;
  266. border-radius: 10rpx;
  267. color: white;
  268. box-sizing: border-box;
  269. padding: 4rpx 10rpx;
  270. font-size: 26rpx;
  271. display: flex;
  272. justify-content: center;
  273. align-items: center;
  274. height: 68rpx;
  275. }
  276. .submit-btn {
  277. position: fixed;
  278. bottom: 40rpx;
  279. width: 90%;
  280. background: #2772FB;
  281. color: white;
  282. text-align: center;
  283. margin-left: 5%;
  284. padding: 30rpx 0;
  285. border-radius: 50rpx;
  286. }
  287. </style>