Quellcode durchsuchen

Signed-off-by: 1004749546@qq.com <1004749546@qq.com>
修改

1004749546@qq.com vor 4 Jahren
Ursprung
Commit
c65aef6e27
3 geänderte Dateien mit 17 neuen und 2 gelöschten Zeilen
  1. 1 0
      pages/toDoList/addBacklog.vue
  2. 12 2
      pages/toDoList/backlogDetail.vue
  3. 4 0
      pages/toDoList/toDoList.vue

+ 1 - 0
pages/toDoList/addBacklog.vue

@@ -182,6 +182,7 @@
 						saveBackLog(params).then(res=>{
 							this.toashMsg(res.message)
 							if(res.status == 200) {
+								this.$emit('refreshBL')
 								uni.navigateBack()
 							} 
 							this.loading = false

+ 12 - 2
pages/toDoList/backlogDetail.vue

@@ -2,7 +2,7 @@
 	<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 v-for="(item,index) in infoData.backlogPhotoList" :key="index">
+			<swiper-item @click="showImg" v-for="(item,index) in infoData.backlogPhotoList" :key="index">
 				<div class="swiper-item uni-bg-red">
 					<u-image mode="aspectFit" width="750upx" height="400upx" :src="item.photoPath"></u-image>
 				</div>
@@ -98,10 +98,20 @@
 			this.getRecordData(option.id)
 		},
 		methods: {
+			// 图片预览
+			showImg () {
+				let arr = []
+				this.infoData.backlogPhotoList.map(item=>{
+					arr.push(item.photoPath)
+				})
+				uni.previewImage({
+					urls: arr
+				})
+			},
 			// 获取详情数据
 			getData (id) {
 				getBackLogDetail({id:id}).then(res=>{
-					console.log(res,'rrrrrrrr')
+					// console.log(res,'rrrrrrrr')
 					if(res.status==200){
 						this.infoData = res.data 
 					} else {

+ 4 - 0
pages/toDoList/toDoList.vue

@@ -145,8 +145,12 @@
 			}
 		},
 		onLoad() {
+			this.$on('refreshBL',this.getRow(1))
 			this.pageInit()
 		},
+		onUnload() {
+			this.$off('refreshBL',this.getRow(1))
+		},
 		methods:{
 			pageInit () {
 				this.sortIndex = 1