sqmoneyadd.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <view >
  3. <uni-forms ref="form" :model="datainfo">
  4. <view class="check">
  5. <view class="cbox">
  6. <view class="chmain">
  7. <uni-forms-item label="资讯类型" name="phonenumber">
  8. <picker range-key='text' :value="syqxidx" :range="sexs" @change='bindDateChange'>
  9. <view class="flexc">
  10. <view class="flex1 txr f13" :class="datainfo.iszc?'co27':'coa'">{{datainfo.iszc?'是':'请选择资讯类型'}}</view>
  11. <view class="rimg"><image :src="rimg"></image></view>
  12. </view>
  13. </picker>
  14. </uni-forms-item>
  15. </view>
  16. </view>
  17. <view class="cbox" style="flex: 1;">
  18. <view class="chmain">
  19. <uni-forms-item label-width='0' name="realName">
  20. <uni-easyinput type="textarea" autoHeight v-model="datainfo.realName" disabled :inputBorder='false' placeholder="车牌号" />
  21. </uni-forms-item>
  22. <uni-forms-item label-width='0' name="realName">
  23. <uni-easyinput type="textarea" autoHeight v-model="datainfo.realName" disabled :inputBorder='false' placeholder="用途" />
  24. </uni-forms-item>
  25. <uni-forms-item label-width='0' name="realName">
  26. <uni-easyinput type="textarea" autoHeight v-model="datainfo.realName" disabled :inputBorder='false' placeholder="状态" />
  27. </uni-forms-item>
  28. <view class="imgs">
  29. <view class="img" @click="getPreview">
  30. <image :src="car" class="pimg"></image>
  31. <image :src="del" class="del" @click="getDelFn"></image>
  32. </view>
  33. <view class="addbox" @click="getaddImage">
  34. <image :src="photo"></image>
  35. <view>添加图片</view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="rfbtn">确定</view>
  41. <loading></loading>
  42. </view>
  43. </uni-forms>
  44. </view>
  45. </template>
  46. <script>
  47. import config from '@/config'
  48. import editorBox from "@/manage/components/editor/editor.vue"
  49. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  50. import {uploadIdentify} from '@/utils/common.js'
  51. export default {
  52. components: {editorBox},
  53. data() {
  54. return {
  55. rimg: require('@/work/static/people/rimg.png'),
  56. photo:require("@/work/static/service/photo.png"),
  57. car:require('@/work/static/car/carico.png'),
  58. del:require('@/work/static/service/rdel.png'),
  59. baseUrl: config.baseUrl,
  60. checkflag:true,
  61. datainfo: {
  62. sex:0,
  63. realName: '',
  64. idCard: '',
  65. address: '',
  66. expirationDate: '',
  67. phonenumber: '',
  68. front: '',
  69. back: '',
  70. },
  71. syqxidx:'',
  72. sexs: [{
  73. text: '男',
  74. value: 0
  75. }, {
  76. text: '女',
  77. value: 1
  78. }],
  79. }
  80. },
  81. onLoad: function() {
  82. },
  83. methods: {
  84. checkPermi,
  85. checkRole,
  86. bindDateChange(e){
  87. var val=e.detail.value;
  88. // this.datainfo.applicationBank=this.sdyhlist[val].value;
  89. // this.applicationBank=this.sdyhlist[val].label;
  90. },
  91. getPreview(idx,arr) {
  92. var newArr=[];
  93. arr.forEach(ite=>{
  94. var ds=this.baseUrl+ite
  95. newArr.push(ds)
  96. })
  97. uni.previewImage({
  98. urls: newArr,
  99. current:idx,
  100. success: function(data) {},
  101. fail: function(err) {}
  102. });
  103. },
  104. getDelFn(){
  105. var that=this;
  106. uni.showModal({
  107. title: '确认删除',
  108. content: "是否确认删除",
  109. cancelText: '取消',
  110. confirmText: '确认',
  111. success: function(res) {
  112. if (res.confirm) {
  113. // that.filelist.splice(idx,1)
  114. } else if (res.cancel) {
  115. }
  116. }
  117. });
  118. },
  119. getaddImage(e){
  120. let that = this;
  121. // var rs=['D:\\idcard.png']
  122. // if(rs&&rs.length>0){
  123. // var obj={
  124. // type:e,
  125. // // url:baseUrl+rs.join(',')
  126. // url:rs.join(',')
  127. // }
  128. // that.getOcrIdCard(obj)
  129. // }
  130. // return
  131. let file =[],count=9
  132. uni.chooseImage({
  133. count: 1,
  134. success:function(res){
  135. let img= res.tempFilePaths;
  136. if(img.length + file.length > count){
  137. uni.showToast({
  138. title: '最多上传'+count+'张图片',
  139. icon: 'none',
  140. duration: 2000
  141. })
  142. }else{
  143. let imglen = res.tempFilePaths.length;
  144. var fuwufile = [];
  145. uploadIdentify('/common/upload',img,0,0,0,imglen,fuwufile,function(rs){
  146. var resurl=rs[0];
  147. if(e=='front'){
  148. that.datainfo.front=resurl.fileName;
  149. }else{
  150. that.datainfo.back=resurl.fileName;
  151. }
  152. if(rs&&rs.length>0){
  153. var obj={
  154. type:e,
  155. url:resurl.urlOnline
  156. }
  157. that.getOcrIdCard(obj)
  158. }
  159. })
  160. }
  161. }
  162. });
  163. },
  164. }
  165. }
  166. </script>
  167. <style>
  168. page{background: #F3F3F0;}
  169. </style>
  170. <style lang="scss" scoped>
  171. .check /deep/ .uni-forms-item{min-height: 106rpx;box-sizing: border-box;display: flex;align-items: center;margin-bottom: 0;border-bottom: 2rpx solid #E6E6E6;padding:10rpx 0;}
  172. .check .cbox /deep/ .uni-forms-item:last-child{border: none;}
  173. .check /deep/ .uni-forms-item__label{font-weight: bold;font-size: 26rpx;color: #222327;flex: 0 0 auto;width: auto !important;}
  174. .check /deep/ .uni-easyinput{flex: 1;text-align: left;font-size: 26rpx;color: #222327;}
  175. .check /deep/ .uni-easyinput__content-textarea{min-height: 40rpx;font-size: 26rpx;}
  176. .check /deep/ .uni-easyinput__placeholder-class{font-size: 26rpx;color: #AAAAAA;}
  177. .check /deep/ .uni-easyinput__content-input{padding-left: 0 !important;}
  178. .check /deep/ .uni-input-input{font-size: 26rpx;}
  179. .check /deep/ .uni-textarea-textarea{font-size: 26rpx;}
  180. .check /deep/ .is-disabled{color: #222327;background-color: #ffffff !important;}
  181. .check /deep/ .uni-data-checklist .checklist-group .checklist-box{margin:10rpx 8rpx 10rpx 16rpx;}
  182. .check /deep/ .uni-data-checklist{flex: 0 0 auto;}
  183. .check{min-height: 100vh;padding: 20rpx 18rpx 110rpx;box-sizing: border-box;box-sizing: border-box;display: flex;flex-direction: column;}
  184. .cbox{background: #FFFFFF;border-radius: 20rpx;flex: 1;margin-bottom: 24rpx;display: flex;flex-direction: column;flex:0 0 auto;
  185. .chmain{
  186. padding: 0 32rpx;
  187. .rimg{width: 16rpx;height: 28rpx;flex: 0 0 auto;margin-left: 20rpx;
  188. image{width: 100%;height: 100%;}
  189. }
  190. .checkimg{width: 80rpx;height: 40rpx;margin-right: 8rpx;}
  191. .imgs{display: flex;align-items: center;flex-wrap: wrap;margin-top: 60rpx;
  192. .img{width: 142rpx;height:142rpx;border-radius: 20rpx;margin: 0 28rpx 20rpx 0;position: relative;
  193. &:nth-of-type(4n){margin-right: 0;}
  194. }
  195. .pimg{width: 100%;height: 100%;border-radius: 20rpx;}
  196. .del{width: 24rpx;height: 24rpx;position: absolute;right: 0;top: 0;}
  197. }
  198. .addbox{background: #F0F0F0;border-radius: 20rpx;display: flex;align-items: center;flex-direction: column;width: 142rpx;height:142rpx;justify-content: center;margin-bottom: 20rpx;
  199. image{width: 48rpx;height: 42rpx;margin-bottom: 12rpx;}
  200. view{font-weight: 500;font-size: 24rpx;color: #666666;}
  201. }
  202. }
  203. }
  204. </style>