editBankCard.vue 8.0 KB

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