En route 1 年間 前
コミット
b6dd4a4568
1 ファイル変更17 行追加14 行削除
  1. 17 14
      pages/course/index.vue

+ 17 - 14
pages/course/index.vue

@@ -75,7 +75,7 @@
 		},
 		data() {
 			return {
-				backTopBtn:false,
+				backTopBtn: false,
 				scrollTop: 0,
 				courseLists: [{
 						name: "课程",
@@ -125,6 +125,9 @@
 			// }, 500);
 		},
 		onLoad(option) {
+			if (option.current) {
+				this.$store.state.current = Number(option.current)
+			}
 			uni.hideTabBar();
 			this.initList()
 			uni.$on('backTop', res => {
@@ -155,11 +158,11 @@
 			}
 		},
 		computed: {
-			...mapGetters(["current","hideBuyState"])
+			...mapGetters(["current", "hideBuyState"])
 		},
 		methods: {
 			backFunc(item) {
-				console.log('asd',item)
+				console.log('asd', item)
 				this.activeData = item
 				this.search()
 			},
@@ -196,17 +199,17 @@
 				this.$store.state.current = e
 			},
 			initList() {
-				if(!this.hideBuyState){
-				this.$api.goodsList({
-					...this.formData,
-					...this.activeData,
-					educationTypeId: this.activeData.educationId,
-					goodsName: this.formData.goodsName,
-					goodsType: this.courseLists[this.$store.state.current].type
-				}).then((res) => {
-					this.goodsList = this.goodsList.concat(res.data.rows)
-					this.total = res.data.total
-				});
+				if (!this.hideBuyState) {
+					this.$api.goodsList({
+						...this.formData,
+						...this.activeData,
+						educationTypeId: this.activeData.educationId,
+						goodsName: this.formData.goodsName,
+						goodsType: this.courseLists[this.$store.state.current].type
+					}).then((res) => {
+						this.goodsList = this.goodsList.concat(res.data.rows)
+						this.total = res.data.total
+					});
 				}
 			},