wangguoyu 1 month ago
parent
commit
fe478b5f43
1 changed files with 29 additions and 33 deletions
  1. 29 33
      pages/chanpinneirong/chanpin1.vue

+ 29 - 33
pages/chanpinneirong/chanpin1.vue

@@ -1,8 +1,8 @@
 <template>
 <template>
 	<view class="ezy-page-body xuexi-page-body">
 	<view class="ezy-page-body xuexi-page-body">
 		<!-- 滚动区域 -->
 		<!-- 滚动区域 -->
-		<scroll-view v-if="existData" :scroll-with-animation="true" scroll-y
-			:scroll-top="scrollTop" @scroll="handleScroll">
+		<scroll-view v-if="existData" :scroll-with-animation="true" scroll-y :scroll-top="scrollTop"
+			@scroll="handleScroll">
 			<view class="xxjl-card-box-padding">
 			<view class="xxjl-card-box-padding">
 				<view class="xxjl-card-box">
 				<view class="xxjl-card-box">
 					<!-- 显示内容 -->
 					<!-- 显示内容 -->
@@ -190,8 +190,8 @@
 					// this.$nextTick(() => {
 					// this.$nextTick(() => {
 					// 	this.updateTitlePositions();
 					// 	this.updateTitlePositions();
 					// });
 					// });
-				}else{
-					 this.existData = false;
+				} else {
+					this.existData = false;
 				}
 				}
 			},
 			},
 
 
@@ -269,40 +269,36 @@
 					"jieId": jieId
 					"jieId": jieId
 				}
 				}
 				console.log('req', req);
 				console.log('req', req);
-				try {
-					const res = await shuxueSave(req);
-					if (res.code == 0 && res.data) {
-						let curJieAndDanyuan = this.getJieAndDanyuan(this.banbenInfo, jieId);
-						if (!curJieAndDanyuan) {
-							toast("未找到课程信息");
-							return false;
-						}
+				const res = await shuxueSave(req);
+				if (res.code == 0 && res.data) {
+					let curJieAndDanyuan = this.getJieAndDanyuan(this.banbenInfo, jieId);
+					if (!curJieAndDanyuan) {
+						toast("未找到课程信息");
+						return false;
+					}
 
 
-						const cacheData = cacheManager.get('contentInfo') || {};
-						cacheData.curDanyuanName = curJieAndDanyuan.danyuan.danyuanName;
-						cacheData.curKechengName = curJieAndDanyuan.jie.jieIntro;
-						cacheData.danyuanId = curJieAndDanyuan.jie.danyuanId;
-						cacheData.curJieId = jieId;
-						cacheData.type = curJieAndDanyuan.jie.type;
-						cacheManager.set('contentInfo', cacheData);
+					const cacheData = cacheManager.get('contentInfo') || {};
+					cacheData.curDanyuanName = curJieAndDanyuan.danyuan.danyuanName;
+					cacheData.curKechengName = curJieAndDanyuan.jie.jieIntro;
+					cacheData.danyuanId = curJieAndDanyuan.jie.danyuanId;
+					cacheData.curJieId = jieId;
+					cacheData.type = curJieAndDanyuan.jie.type;
+					cacheManager.set('contentInfo', cacheData);
 
 
-						if (type == 1) {
-							uni.navigateTo({
-								url: `/pages/xinshuxue/lookShipin?jieId=${jieId}`
-							})
-						} else {
-							uni.navigateTo({
-								url: `/pages/xinshuxue/unitTest?jieId=${jieId}`
-							})
-						}
+					if (type == 1) {
+						uni.navigateTo({
+							url: `/pages/xinshuxue/lookShipin?jieId=${jieId}`
+						})
 					} else {
 					} else {
-						toast("保存位置出错");
-						return false;
+						uni.navigateTo({
+							url: `/pages/xinshuxue/unitTest?jieId=${jieId}`
+						})
 					}
 					}
-				} catch (error) {
-					toast("保存失败");
+				} else {
+					toast("保存位置出错");
 					return false;
 					return false;
 				}
 				}
+
 			},
 			},
 			handlePlay(da, code) {
 			handlePlay(da, code) {
 
 
@@ -345,4 +341,4 @@
 
 
 		}
 		}
 	}
 	}
-</script>
+</script>