Просмотр исходного кода

Merge branch 'master' of http://git.huaml.com/zhh/front-end

wangn 5 лет назад
Родитель
Сommit
e7ab03a24f

+ 2 - 2
ghsApp/src/components/module/app-commodity.vue

@@ -34,7 +34,7 @@
 import { COMMODITY_TYPE } from "@/utils/declare";
 import AppImg from "@/components/app-img";
 import { autoPriceByIdApi, changePriceByIdApi } from '@/api/product/index'
-import productMins from "@/mixins/productContrapose";
+// import productMins from "@/mixins/productContrapose";
 import animationMins from "@/mixins/animation";
 
 import allSelectInput from "@/components/module/allSelectInput";
@@ -44,7 +44,7 @@ export default {
 	components: {
 		AppImg,allSelectInput
 	},
-	mixins: [productMins,animationMins,allSelectInputMins],
+	mixins: [animationMins,allSelectInputMins],
 	props: {
 		info: {
 			required: true,

+ 1 - 1
ghsApp/src/mixins/product.js

@@ -88,7 +88,7 @@ export default {
 		},
 		//选择商品总数
 		allCount() {
-			console.log(444444, this.selectList);
+			// console.log(444444, this.selectList);
 			return this.selectList.length;
 		},
 		/**

+ 5 - 5
ghsApp/src/mixins/productContrapose.js

@@ -54,9 +54,9 @@ export default {
 		 * 当前页面选中的商品列表
 		 */
 		selectList() {
-			console.log('this.getSelectInfo',this.getSelectInfo)
-			console.log('this.pageType',this.pageType)
-			console.log('this.getSelectInfo[this.pageType]',this.getSelectInfo[this.pageType])
+			// console.log('this.getSelectInfo',this.getSelectInfo)
+			// console.log('this.pageType',this.pageType)
+			// console.log('this.getSelectInfo[this.pageType]',this.getSelectInfo[this.pageType])
 			return this.getSelectInfo[this.pageType] || [];
 		},
 		scrollClassId() {
@@ -89,7 +89,7 @@ export default {
 		},
 		//选择商品总数
 		allCount() {
-			console.log(444444, this.selectList);
+			// console.log(444444, this.selectList);
 			return this.selectList.length;
 		},
 		/**
@@ -131,7 +131,7 @@ export default {
 			try {
 				let params = {
 					py: this.py,
-					type: this.type
+					type: this.type?this.type:''
 				};
 				if (extendInfo) {
 					params = { ...params, ...extendInfo };

+ 3 - 0
hdApp/src/App.vue

@@ -10,6 +10,9 @@ export default {
   // 有坑 分包里的页面访问不到
   globalData: {},
   onLaunch () {
+			uni.removeStorageSync('suitInfoList');
+			uni.removeStorageSync('productInfoList');
+			uni.removeStorageSync('pxClassInfoList');
     // #ifdef H5
     // H5开发环境无法微信授权,使用固定的用户 shish 2020.4.30
     if (process.env.NODE_ENV == "development") {

+ 19 - 3
hdApp/src/mixins/product.js

@@ -30,9 +30,22 @@ export default {
 			if(this.isGhsProduct){
 				this.initGhsData(id,shopId);//采购-进店下单
 			}else{
-				this.initGoodsData();//成品
-				this.initData();//组合
-				this.initPxClassData();//课程
+				/*缓存处理*/
+				if(uni.getStorageSync('suitInfoList')){
+					this.suitInfo = uni.getStorageSync('suitInfoList');
+				}else{
+					this.initGoodsData();//成品
+				}
+				if(uni.getStorageSync('productInfoList')){
+					this.productInfo = uni.getStorageSync('productInfoList');
+				}else{
+					this.initData();//组合
+				}
+				if(uni.getStorageSync('pxClassInfoList')){
+					this.pxClassInfo = uni.getStorageSync('pxClassInfoList');
+				}else{
+					this.initPxClassData();//课程
+				}
 			}
 		}
 	},
@@ -245,6 +258,7 @@ export default {
 							child.className = element.className;
 						});
 				});
+				uni.setStorageSync('productInfoList',data);
 				this.productInfo = data;
 				this.classIndex = 0;
 			} catch (error) {
@@ -285,6 +299,7 @@ export default {
 						child.className = element.className;
 					});
 				});
+				uni.setStorageSync('suitInfoList',data);
 				this.suitInfo = data;
 				this.suitClassIndex = 0;
 			} catch (error) {
@@ -741,6 +756,7 @@ export default {
 		async initPxClassData() {
 			try {
 				const { data } = await getPxClassDataApi({pageSize:50});
+				uni.setStorageSync('pxClassInfoList',data.list);
 				this.pxClassInfo = data.list;
 			} catch (error) {
 			} finally {