sqmoneyadd.vue 7.0 KB

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