Parcourir la source

扫码打开文件,小微修改

zouling il y a 1 an
Parent
commit
247e19f429

+ 8 - 0
api/common.js

@@ -70,6 +70,14 @@ export function getFjDel(data) {
     'method': 'get',
   })
 }
+// 附件-列表(二维码接口)
+export function getEwmList(data) {
+  return request({
+    'url': '/fj/ewmList',
+    'method': 'get',
+	'data':data
+  })
+}
 // 业务统计 system:statistics:loan
 export function getCount(data) {
   return request({

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "皖源融资担保",
     "appid" : "__UNI__FA20DEF",
     "description" : "",
-    "versionName" : "1.0.4",
-    "versionCode" : 104,
+    "versionName" : "1.0.5",
+    "versionCode" : 105,
     "transformPx" : false,
     "app-plus" : {
         "usingComponents" : true,

+ 18 - 4
pages/index/index.vue

@@ -14,10 +14,11 @@
 						<input  placeholder="请输入您要找的客户名称" confirm-type="search" v-model="usename" @confirm="getConfirm"/>
 					</view>
 					<block slot="right">
-						<!-- #ifndef H5 -->
+						
 						<view class="topr flexcc" @click='getScanFn'>
 							<image :src="codeimg"></image>
 						</view>
+						<!-- #ifndef H5 -->
 						<!-- #endif -->
 					</block>
 				</uni-nav-bar>
@@ -132,7 +133,7 @@
 	import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
 	import waitList from "@/components/wait/list.vue"
 	let { calendar } = require("@/components/lunc-calendar/calendar.js");
-	import {getRemindList,getNoticeList,getbannerList} from "@/api/common.js"
+	import {getRemindList,getNoticeList,getbannerList,getEwmList} from "@/api/common.js"
 	import {getChangeFace} from "@/api/mine/card.js"
 	import {getDictionaryFn} from "@/api/mine/register.js"
 	import {getHyperlinkList} from "@/api/mine/work.js"
@@ -410,14 +411,27 @@
 				success: function(red) {
 					let result = red.result;
 					var a=JSON.parse(result)
+					// console.log(a)
 					if (typeof result == 'string') {
 						try {
-							
 							//type1,认证,2 文件
 							if(a.type==1){
 								that.$tab.navigateTo(`/work/pages/prove/index`)
 							}else if(a.type==2){
-								that.getDown(result.url)
+								// {"type":"2","loanApplicationNumber":"RZDB202405281425037292766","bigType":"c","fileType":"dbyxh"},
+								var params={
+									loanApplicationNumber:a.loanApplicationNumber,
+									bigType:a.bigType,
+									type:a.fileType,
+								}
+								getEwmList(params).then(res=>{
+									if(res.code==200){
+										var data=res.data;
+										if(data.url){
+											that.getDown(data.url)
+										}
+									}
+								})
 							}else{
 								
 							}

+ 28 - 2
work/components/popup/popup.vue

@@ -349,7 +349,10 @@
 			</view>
 			<view class="ttit">小微企业说明</view>
 			<view class="conttxt">
-				 <rich-text :nodes="content"></rich-text>
+				<block v-if="xwimgList&&xwimgList.length">
+					<image :src="baseUrl+ite" v-for="(ite,idx) in xwimgList" :key="idx" class="imgs" @click="getPreviewImage(xwimgList,idx)"></image>
+				</block>
+				 <rich-text :nodes="content" v-else></rich-text>
 			</view>
 			<view class="conbtns flexcj">
 				<view class="cbtns bga" @click="getClose">取消</view>
@@ -398,6 +401,12 @@
 					return ''
 				}
 			},
+			xwimgList:{
+				type: Array,
+				default () {
+					return []
+				}
+			},
 			shtg:{
 				type: [Number,String],
 				default () {
@@ -529,6 +538,23 @@
 			getCloseAdd(){
 				this.addflag=false;
 			},
+			getPreviewImage(arr,idx){
+				var newArr=[];
+				arr.forEach(ite=>{
+					var ds=this.baseUrl+ite
+					newArr.push(ds)
+				})
+				uni.previewImage({
+					urls: newArr,
+					current:idx,
+					success: function(data) {
+						
+					},
+					fail: function(err) {
+						
+					}
+				});
+			},
 			getChose(ite,idx){
 				const index = this.shrylist.findIndex(text => text.userId === ite.userId);
 				var obj={
@@ -790,7 +816,7 @@ border-radius: 20rpx;z-index: 10;top: 50%;transform: translateY(-50%);padding: 4
 		.conttxt{font-weight: bold;font-size: 30rpx;color: #222327;padding: 0 34rpx;text-align: center;
 			padding-top: 36rpx;
 			text{color: #00A9F0;}
-			
+			.imgs{margin-bottom: 10rpx;}
 		}	
 	}
 	// 上传图片

+ 8 - 3
work/pages/business/add.vue

@@ -1113,7 +1113,7 @@
 			<view class="bgbox" @click="lookflag=false" ></view>
 			<image :src="lookico" class="looimg" @click="getPreview(lookico)"></image>
 		</block>
-		<pop-up :type='ftype' :content="content" @getClose='getClose'></pop-up>
+		<pop-up :type='ftype' :xwimgList="xwimgList" :content="content" @getClose='getClose'></pop-up>
 	</view>
 </template>
 
@@ -1312,7 +1312,7 @@
 				{tit:'当前从事项目情况证明',type:'dqcsxmqkzm'},{tit:'企业基本注册信息查询单',type:'qyjbzcxxcxd'},{tit:'水电费发票(一年)',type:'sdffpyn'},{tit:'人员工资表',type:'rggzb'},{tit:'纳税申报表',type:'nssbb'},
 				],
 				content:'',//小微企业富文本
-				
+				xwimgList:[],//小微企业图片
 				ptype:'add',
 				id:'',//申请id
 				declareFj:{},//
@@ -2005,8 +2005,13 @@
 						var list=res.rows;
 						if(list&&list.length){
 							var content=list[0].explainContent;
-							// this.content=content;
 							this.content=this.formatRichText(content);
+							
+							// 图片
+							if(list[0].explainImage){
+								this.xwimgList=list[0].explainImage.split(',')
+							}
+							
 						}
 					}
 				})

+ 95 - 4
work/pages/file/list.vue

@@ -28,11 +28,11 @@
 		<view class="plr18">
 			<bus-list :datalist="list" :wtdt="wtdt" :type="type" @getXzFn="getXzFn"></bus-list>
 		</view>
-		<!-- <view style="height: 100rpx;"></view> -->
-		<!-- <view class="scanbox flexcc">
+		<view style="height: 100rpx;"></view>
+		<view class="scanbox flexcc" @click='getScanFn'>
 			<image :src="scanimg"></image>
 			扫码查看
-		</view> -->
+		</view>
 	</view>
 </template>
 
@@ -41,7 +41,7 @@
 	const baseUrl = config.baseUrl
 	const baseName = config.baseName
 	import busList from "@/work/components/business/list.vue"
-	import {getListOss} from "@/api/common.js"
+	import {getListOss,getEwmList} from "@/api/common.js"
 	import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
 	export default{
 		components:{busList},
@@ -78,6 +78,97 @@
 			getDetail(e){
 				this.$tab.navigateTo("/work/pages/file/wjdetails?id="+e)
 			},
+			getScanFn(){
+				// 扫码识别
+				var that = this;
+				uni.scanCode({
+					onlyFromCamera: true,
+					autoZoom:false,
+					scanType: ['qrCode'],
+					success: function(red) {
+						let result = red.result;
+						var a=JSON.parse(result)
+						// console.log(a)
+						if (typeof result == 'string') {
+							try {
+								//type1,认证,2 文件
+								if(a.type==1){
+									that.$tab.navigateTo(`/work/pages/prove/index`)
+								}else if(a.type==2){
+									// {"type":"2","loanApplicationNumber":"RZDB202405281425037292766","bigType":"c","fileType":"dbyxh"},
+									var params={
+										loanApplicationNumber:a.loanApplicationNumber,
+										bigType:a.bigType,
+										type:a.fileType,
+									}
+									getEwmList(params).then(res=>{
+										if(res.code==200){
+											var data=res.data;
+											if(data.url){
+												that.getDown(data.url)
+											}
+										}
+									})
+								}else{
+									
+								}
+							} catch (e) {
+								uni.navigateBack({
+									delta: 1
+								})
+								uni.showToast({
+									title: '扫码查询失败,请检查二维码是否正确',
+									icon: "none"
+								})
+								return
+							}
+						}
+						
+					},
+					fail: function(e) {
+						if (e && e.errMsg && e.errMsg.indexOf('scanCode:fail cancel') != -1) {
+							return;
+						}
+						uni.showToast({
+							title: '扫码失败',
+							icon: "none"
+						})
+					},
+				});
+			},
+			getDown(e){
+				uni.showLoading({
+					title: '加载中'
+				});
+				var url=baseUrl+e;
+				let index1 = e.lastIndexOf("."); // 得到一个索引值
+				let index2 = e.length;
+				let type = e.substring(index1, index2);
+				if ((type.indexOf('jpg') > -1 || type.indexOf('jpeg') > -1 || type.indexOf('png') > -1)) {
+					uni.previewImage({
+						current: 0,
+						urls: [url],
+						// background: '#ffffff'
+					});
+					uni.hideLoading();
+				} else {
+					uni.downloadFile({
+						url: url,//文件的下载路径
+						success(result) {
+								uni.hideLoading()
+							var filePath = result.tempFilePath;
+							   uni.openDocument({
+							     filePath: filePath,
+							     showMenu: true,
+							     success: function (res) {
+							       // console.log('打开文档成功');
+							     }
+							   });
+						},
+						fail(res) {uni.hideLoading()}
+					})
+				}
+			},
 			getConfirm(){
 				this.getrefreshData()
 			},

+ 2 - 2
work/pages/prove/addqy.vue

@@ -11,8 +11,8 @@
 					</view>
 				</view>
 				<view class="mb28">
-					<view class="cardtip">企业信息会跟进上传的营业执照图片自动识别,支持手动输入。</view>
-					<view class="cardtip">如果识别错误,可尝试再次拍照</view>
+					<view class="cardtip">企业信息会根据上传的营业执照图片自动识别,支持手动输入。</view>
+					<view class="cardtip">如果识别错误,可尝试再次拍照</view>
 				</view>
 				<!--  style="color: red;" -->
 				<view class="flexe">

+ 2 - 2
work/pages/prove/index.vue

@@ -16,8 +16,8 @@
 			</view>
 		</view>
 		<view class="mb28">
-			<view class="cardtip">身份信息会跟进上传的证件照片自动识别,支持手动输入</view>
-			<view class="cardtip">如果识别错误,可尝试再次拍照</view>
+			<view class="cardtip">身份信息会根据上传的证件照片自动识别,支持手动输入</view>
+			<view class="cardtip">如果识别错误,可尝试再次拍照</view>
 		</view>
 				
 		<!-- 身份信息 -->