editBankCard.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  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="$u.throttle(submit, 1000)">提交</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 permision from "@/js_sdk/wa-permission/permission.js"
  60. import uploadImage from '@/components/ossutil/uploadFile.js';
  61. var _this;
  62. export default {
  63. components: {},
  64. data() {
  65. return {
  66. isShowimgType: false,
  67. dataDetails: {},
  68. imagesrc: '',
  69. bankType: [],
  70. submitstatus: false,
  71. isShowBank: false,
  72. isShowManualInput: false,
  73. index: ''
  74. };
  75. },
  76. onLoad() {
  77. this.get_camera_permission()
  78. _this = this;
  79. },
  80. methods: {
  81. async get_camera_permission() {
  82. var photol = await permision.requestAndroidPermission("android.permission.CAMERA")
  83. if (photol == false) {
  84. uni.showModal({
  85. title: '提示',
  86. content: '您已经关闭相机权限,去设置',
  87. success: function(res) {
  88. if (res.confirm) {
  89. permision.gotoAppPermissionSetting()
  90. // plus.runtime.openURL("app-settings:");
  91. } else if (res.cancel) {
  92. console.log('用户点击取消');
  93. }
  94. }
  95. });
  96. }
  97. },
  98. manualInput() {
  99. if (this.isShowManualInput) {
  100. if (uni.$u.test.isEmpty(this.bankType[this.index])) {
  101. this.$refs.uToast.show({
  102. type: 'error',
  103. message: "请先上传银行卡!",
  104. })
  105. return true
  106. }
  107. this.isShowBank = true
  108. } else {
  109. this.isShowBank = false
  110. }
  111. this.isShowManualInput = !this.isShowManualInput
  112. },
  113. //设置图片
  114. setImage(e) {
  115. console.log(e);
  116. //显示在页面
  117. //this.imagesrc = e.path;
  118. if (e.dotype == 'idphoto') {
  119. _this.zjzClipper(e.path);
  120. } else if (e.dotype == 'watermark') {
  121. _this.watermark(e.path);
  122. } else {
  123. _this.savePhoto(e.path);
  124. }
  125. },
  126. //保存图片到相册,方便核查
  127. savePhoto(path) {
  128. this.imagesrc = path;
  129. uploadImage(path, 'appData/',
  130. result => {
  131. // 上传成功
  132. console.log('图片地址', result)
  133. }
  134. )
  135. //保存到相册
  136. // uni.saveImageToPhotosAlbum({
  137. // filePath: path,
  138. // success: () => {
  139. // uni.showToast({
  140. // title: '已保存至相册',
  141. // duration: 2000
  142. // });
  143. // }
  144. // });
  145. },
  146. uploadImg() {
  147. this.isShowimgType = true
  148. },
  149. photograph() {
  150. console.log('拍照')
  151. let that = this;
  152. uni.chooseImage({
  153. count: 1,
  154. sizeType: ['compressed'],
  155. success: function(res) {
  156. console.log(JSON.stringify(res.tempFilePaths));
  157. uploadImage(res.tempFilePaths[0], 'appData/',
  158. result => {
  159. // 上传成功
  160. console.log('图片地址', result)
  161. }
  162. )
  163. }
  164. });
  165. },
  166. imgTypeSelect(val) {
  167. console.log(val)
  168. if (val.name == '相册') {
  169. uni.chooseImage({
  170. count: 1,
  171. sizeType: ['compressed'],
  172. sourceType: this.$helper.chooseImage.sourceType,
  173. success: function(res) {
  174. console.log(JSON.stringify(res.tempFilePaths));
  175. uploadImage(res.tempFilePaths[0], 'appData/',
  176. result => {
  177. // 上传成功
  178. console.log('图片地址', result)
  179. }
  180. )
  181. }
  182. });
  183. } else {
  184. }
  185. },
  186. //身份证正面
  187. getImgUrl1(src) {
  188. // console.log(src)
  189. // console.log('------------res-----------')
  190. // let that = this;
  191. // that.id[0] = src
  192. // that.id1 = src
  193. // that.certificates = false
  194. // that.personImgs.personImg = that.id[0]
  195. // that.$api.doRequest('get', '/driverViewInfo/personShibie', that
  196. // .personImgs).then(res => {
  197. // if (res.data.data.recPerson != null) {
  198. // if (res.data.data.recPerson != "") {
  199. // that.$set(that.DriverViewInfo, 'driverName', res
  200. // .data.data.recPerson)
  201. // }
  202. // }
  203. // if (res.data.data.recPersonNo != null) {
  204. // if (res.data.data.recPersonNo != "") {
  205. // that.$set(that.DriverViewInfo, 'numberCard', res
  206. // .data.data.recPersonNo)
  207. // }
  208. // }
  209. // }).catch(res => {
  210. // uni.showToast({
  211. // title: res.data.message,
  212. // icon: 'none',
  213. // duration: 2000
  214. // })
  215. // })
  216. },
  217. submit() {
  218. console.log(' tijia')
  219. },
  220. },
  221. };
  222. </script>
  223. <style scoped lang="scss">
  224. .row4-img {
  225. width: 32rpx;
  226. height: 32rpx;
  227. }
  228. .content {
  229. padding: 20rpx;
  230. height: calc(100vh - 23vh);
  231. }
  232. .content3 {
  233. background: white;
  234. padding: 20rpx;
  235. box-sizing: border-box;
  236. .left-text {
  237. // background: red;
  238. width: 290rpx;
  239. color: #333333;
  240. display: flex;
  241. align-items: center;
  242. }
  243. .row {
  244. border-bottom: 1px solid #EEEEEE;
  245. padding-bottom: 28rpx;
  246. margin-top: 26rpx;
  247. .ch-style {}
  248. }
  249. .row-ch {
  250. padding-right: 180rpx;
  251. box-sizing: border-box;
  252. }
  253. }
  254. .title {
  255. color: #999999;
  256. margin: 20rpx 0;
  257. }
  258. .picture {
  259. margin-top: 20rpx;
  260. background: #F5F6FA;
  261. border-radius: 10rpx;
  262. display: flex;
  263. flex-direction: column;
  264. justify-content: center;
  265. align-items: center;
  266. color: #6A7282;
  267. }
  268. .picture {
  269. width: 100%;
  270. height: 440rpx;
  271. .text {
  272. margin-top: 20rpx;
  273. }
  274. }
  275. .xj-image {
  276. width: 100rpx;
  277. height: 100rpx;
  278. }
  279. .picture3 {
  280. background: url(../../../static/images/mine/yhkzm.png);
  281. background-size: 100% 100%;
  282. }
  283. .select-bankzh {
  284. width: 230rpx;
  285. // height: 48rpx;
  286. }
  287. .type {
  288. background: #2772FB;
  289. border-radius: 10rpx;
  290. color: white;
  291. box-sizing: border-box;
  292. padding: 4rpx 10rpx;
  293. font-size: 26rpx;
  294. display: flex;
  295. justify-content: center;
  296. align-items: center;
  297. height: 68rpx;
  298. }
  299. .submit-btn {
  300. position: fixed;
  301. bottom: 40rpx;
  302. width: 90%;
  303. background: #2772FB;
  304. color: white;
  305. text-align: center;
  306. margin-left: 5%;
  307. padding: 30rpx 0;
  308. border-radius: 50rpx;
  309. }
  310. </style>