浏览代码

Merge branch 'deploy' of http://git.chelingzhu.com/chelingzhu-web/storeCheck-app into deploy

lilei 4 年之前
父节点
当前提交
4ef491135f
共有 2 个文件被更改,包括 23 次插入10 次删除
  1. 1 1
      pages/toDoList/addBacklog.vue
  2. 22 9
      pages/toDoList/backlogDetail.vue

+ 1 - 1
pages/toDoList/addBacklog.vue

@@ -54,7 +54,7 @@
 		},
 		data() {
 			return {
-				action: 'http://md.test.zyucgj.com/saas/clz/upload', // 图片上传后端地址
+				action: getApp().globalData.baseUrl + 'upload', //自行修改各自的对应的接口, // 图片上传后端地址
 				showUploadList: false, 
 				// 如果将某个ref的组件实例赋值给data中的变量,在小程序中会因为循环引用而报错
 				// 这里直接获取内部的lists变量即可

+ 22 - 9
pages/toDoList/backlogDetail.vue

@@ -1,10 +1,10 @@
 <template>
 	<view class="back-content">
 		<!-- 轮播图 -->
-		<swiper v-if="infoData.backlogPhotoList && infoData.backlogPhotoList.length" class="top-ad-swiper" :indicator-dots="false" :autoplay="true" :interval="5000" :duration="600" :circular="true">
-			<swiper-item @click="showImg" v-for="(item,index) in infoData.backlogPhotoList" :key="index">
+		<swiper v-if="backlogPhotoList.length && status!='loading'" class="top-ad-swiper" :indicator-dots="false" :autoplay="true" :interval="5000" :duration="600" :circular="true">
+			<swiper-item @click="showImg" v-for="(item,index) in backlogPhotoList" :key="index">
 				<div class="swiper-item uni-bg-red">
-					<u-image mode="aspectFit" width="750upx" height="400upx" :src="item.photoPath"></u-image>
+					<u-image mode="aspectFit" width="750upx" height="400upx" :src="item"></u-image>
 				</div>
 			</swiper-item>
 		</swiper>
@@ -85,8 +85,10 @@
 		}, 
 		data() {
 			return {
+				status: 'loading',
 				backlogId: '', // 待办id
 				infoData:{}, // 详情数据
+				backlogPhotoList: [], // 图片列表
 				numList: [],
 				comment: '', // 评论
 				isFocus: false  // 评论键盘是否弹起
@@ -100,24 +102,35 @@
 		methods: {
 			// 图片预览
 			showImg () {
-				let arr = []
-				this.infoData.backlogPhotoList.map(item=>{
-					arr.push(item.photoPath)
-				})
 				uni.previewImage({
-					urls: arr
+					urls: this.backlogPhotoList
 				})
 			},
 			// 获取详情数据
 			getData (id) {
+				uni.showLoading({
+					title: '加载中,请稍后...'
+				})
+				this.status = 'loading'
 				getBackLogDetail({id:id}).then(res=>{
-					// console.log(res,'rrrrrrrr')
+					console.log(res,'rrrrrrrr')
 					if(res.status==200){
 						this.infoData = res.data 
+						let arr = []
+						this.infoData.backlogPhotoList.map(item=>{
+							if(item.photoPath) {
+								arr.push(item.photoPath)
+							}
+						})
+						this.backlogPhotoList = arr
+						console.log(this.backlogPhotoList,'this.backlogPhotoList')
 					} else {
 						this.toashMsg(res.message)
 						this.infoData = {}
+						this.backlogPhotoList = []
 					}
+					uni.hideLoading()
+					this.status = 'nomore'
 				})
 			},
 			// 获取进度数据