Forráskód Böngészése

Signed-off-by: 李妹妹 <1639016684@qq.com>

李妹妹 1 hónapja
szülő
commit
96e0e22e6f

+ 4 - 1
api/companyUser.js

@@ -235,7 +235,10 @@ export function addAttachment(data) {
 export function getAttachment(data) {
 	return request('/app/attachment/list', data, 'GET', 'application/json;charset=UTF-8');
 }
-
+//新建体检报告
+export function addUrl(data) {
+	return request('/app/attachment/addList', data, 'POST', 'application/json;charset=UTF-8');
+}
 //删除附件
 export function deleteAttachment(data) {
 	return request('/app/attachment/'+data, data, 'DELETE');

+ 1 - 1
pages/home/components/HotProduct.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="group-goods" v-if="detail.length>0">
+	<view class="group-goods" v-if="detail.length>0" v-cloak>
 		<view class="title-box x-bc">
 			<view class="row">
 				<image class="w40 h40 mr4" src="/static/images/hot.png"></image><text class="title"><text

+ 1 - 1
pages/home/components/NewProduct.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="group-goods" v-if="detail.length>0">
+	<view class="group-goods" v-if="detail.length>0" v-cloak>
 		<view class="title-box x-bc">
 			<text class="title"><text class="color-orange">新品</text>首发</text>
 			<view class="group-people x-f  row" @tap="navTo('/pages/home/productList')">

+ 10 - 0
pages/shopping/productDetails.vue

@@ -3,6 +3,7 @@
 			<view class="share-box centerV ">
 				<image class="w48 h48 " src="/static/images/weixin.png" mode=""></image>
 				<text class="color-text mt8 weight-500 fs20">微信分享</text>
+				<button class="share" data-name="shareBtn" open-type="share"></button>
 			</view>
 		<!-- 商品轮播图片 -->
 		<view class="shop-banner" @click="showImg()">
@@ -935,6 +936,15 @@
 		border-radius: 16rpx 16rpx 16rpx 16rpx;
 		border: 1rpx solid #EFF3F7;
 		background-color: #FFFFFF;
+		.share{
+			display: inline-block;
+					position: absolute;
+					top: 0;
+					left: 0;
+					width: 100%;
+					height: 100%;
+					opacity: 0;
+		}
 	}
 	.shop-banner{
 		height: 756upx;

+ 0 - 1
pages_user/user/complaint.vue

@@ -190,7 +190,6 @@
 									this.imgList = res.tempFilePaths
 									
 								}
-						 
 								this.photos = this.photos.concat(JSON.parse(uploadFileRes.data).url)
 							}
 						});

+ 24 - 22
pages_user/user/default.vue

@@ -14,8 +14,8 @@
 						<view class="time">2021-04-21</view>
 					</view>
 				</view> -->
-				<view class="img" v-for="(item,index) in dataList" :key="index" @tap="viewImage" :data-url="dataList[index]">
-					<image :src="item.url"  @longpress="cancel(item)"></image>
+				<view class="img" v-for="(item,index) in dataList" :key="index" @tap="viewImage" :data-url="dataList[index]" @longpress="cancel(item)">
+					<image :src="item.url" ></image>
 					<!-- <image class="close-img" src="@/static/images/close32.png" mode="" @tap.stop="delImg" :data-index="index"></image> -->
 					<view class="text">
 						<view class="title">体检报告</view>
@@ -31,7 +31,7 @@
 <script>
 	
 	import {
-		addAttachment,
+		addAttachment,addUrl,
 		getAttachment,deleteAttachment
 	} from '@/api/companyUser.js'
 	export default {
@@ -47,7 +47,8 @@
 				checked: 1,
 				dataList:[],
 				imgList:[],
-				photos:[]
+				photos:[],
+				list:[]
 			};
 		},
 		onLoad(option) {
@@ -55,7 +56,7 @@
 			if(option.id){
 			this.parentId=option.id
 			uni.setNavigationBarTitle({
-			title: option.title
+			title: option.fileName
 			});
 			this.getAttachment()
 			}
@@ -81,6 +82,7 @@
 					res => {
 						if (res.code == 200) {
 							this.dataList = res.data.list
+							this.list=res.data.list.map(item=>item.url)
 						} else {
 							uni.showToast({
 								icon: 'none',
@@ -144,7 +146,7 @@
 		chooseImageFunction: function(type) {
 			var that = this;
 			uni.chooseImage({
-				count:1, // 默认9
+				count:10, // 默认9
 				sourceType: [type],
 				success: (res) => {
 					console.log(res,'res')
@@ -156,29 +158,26 @@
 							'user': 'test'  // 上传附带参数
 						},
 						success: (uploadFileRes) => {
-							// 根据接口具体返回格式   赋值具体对应url
-							this.url=JSON.parse(uploadFileRes.data).url
-						    this.addAttachment()
-							// if (this.imgList.length != 0) {
-							// 	this.imgList = this.imgList.concat(res.tempFilePaths)
-							// } else {
-							// 	this.imgList = res.tempFilePaths
-							// }
-							// this.photos = this.photos.concat(JSON.parse(uploadFileRes.data).url)
-							
+							console.log(uploadFileRes.data,'data')
+							if (this.imgList.length != 0) {
+								this.imgList = this.imgList.concat(res.tempFilePaths)
+							} else {
+								this.imgList = res.tempFilePaths
+							}
+							this.photos=this.photos.concat(JSON.parse(uploadFileRes.data).url)
+							this.addAttachment()
 						}
-					});
-					 
+					}); 
 				}
 			});
 		},
 		addAttachment(){
 			var data={
 				type:1,
-				url:this.url,
+				urlList:this.photos,
 				parentId:this.parentId
 			}
-			addAttachment(data).then(
+			addUrl(data).then(
 				res => {
 					if (res.code == 200) {
 						uni.showToast({
@@ -200,9 +199,11 @@
 		
 		// 查看图片
 		viewImage(e) {
+			var data=e.currentTarget.dataset.url
+			// console.log(data.url,'url')
 			uni.previewImage({
-				urls: this.imgList,
-				current: e.currentTarget.dataset.url
+				urls: this.list,
+				current: data.url
 			});
 		},
 		// 删除上传的图片
@@ -275,6 +276,7 @@ margin-bottom:20rpx ;
 					width: 100%;
 					height: 100%;
 				}
+
 				.close-img{
 					width: 32upx;
 					height: 32upx;

+ 1 - 1
pages_user/user/myFolder.vue

@@ -8,7 +8,7 @@
 			<view class="align-center justify-between wrap">
 				<view class="box" v-for="(item,index) in dataList" :key="index" @longpress="cancel(item)">
 					<view class="img" @click="navgetTo(item)">
-						<view class="num">{{item.size||0}}张</view>
+						<view class="num">{{item.picCount||0}}张</view>
 					</view>
 					<view class="text ellipsis">{{item.fileName}}</view>
 				</view>