Ver código fonte

bugfix 样式修改

谢杰标 2 anos atrás
pai
commit
5b813a7afb

+ 16 - 5
pages/course/index.vue

@@ -40,10 +40,14 @@
               <img src="../../static/icon/icon-search.png" />
               <u-input
                 style="padding-left: 10rpx"
-                v-model="paramList[current].goodsName"
-                :type="type"
+                v-model="goodsName"
+                type="text"
                 :border="border"
                 placeholder="搜索"
+                @blur="initList"
+                :auto-blur="true"
+                confirm-type="search"
+                :clearable="false"
               />
             </view>
           </view>
@@ -414,7 +418,6 @@ export default {
           goodsType: 1,
           subjectId: 0,
           sortType: 1,
-          goodsName: "",
         },
         {
           pageNum: 1,
@@ -424,7 +427,6 @@ export default {
           goodsType: 2,
           subjectId: 0,
           sortType: 1,
-          goodsName: "",
         },
         {
           pageNum: 1,
@@ -434,9 +436,9 @@ export default {
           goodsType: 6,
           subjectId: 0,
           sortType: 1,
-          goodsName: "",
         },
       ],
+      goodsName: "",
       list1: [],
       list2: [],
       list3: [],
@@ -594,6 +596,9 @@ export default {
     courseList() {
       var self = this;
       var param = this.paramList[0];
+      if (this.goodsName) {
+        param.goodsName = this.goodsName;
+      }
       this.$api.goodsList(param).then((res) => {
         self.paramList[0].total = res.data.total;
         self.list1.push.apply(self.list1, res.data.rows);
@@ -606,6 +611,9 @@ export default {
     bankList() {
       var self = this;
       var param = this.paramList[1];
+      if (this.goodsName) {
+        param.goodsName = this.goodsName;
+      }
       this.$api.goodsList(param).then((res) => {
         self.paramList[1].total = res.data.total;
         self.list2.push.apply(self.list2, res.data.rows);
@@ -618,6 +626,9 @@ export default {
     liveList() {
       var self = this;
       var param = this.paramList[2];
+      if (this.goodsName) {
+        param.goodsName = this.goodsName;
+      }
       this.$api.goodsList(param).then((res) => {
         self.paramList[2].total = res.data.total;
         self.list3.push.apply(self.list3, res.data.rows);

+ 9 - 4
pages2/order/confirm_pay.vue

@@ -34,7 +34,7 @@
               </view>
               <view class="priceTag"> ¥ {{ item.standPrice }} </view>
               <Class-time-tip
-                v-if="item.gradObj&&item.gradObj.gradeId"
+                v-if="item.gradObj && item.gradObj.gradeId"
                 :classInfo="item.gradObj"
               ></Class-time-tip>
             </view>
@@ -144,11 +144,12 @@ export default {
   },
   onPullDownRefresh() {},
   onLoad(option) {
+    console.log(this.sac, 666);
     let self = this;
     this.fromCart = option.fromCart;
     console.log(self.shoppingCartList, 6);
     let list = self.shoppingCartList;
-    console.log(list,66)
+    console.log(list, 66);
     this.isBK = option.isBK;
     for (let i = 0; i < list.length; i++) {
       this.totalPrice += Number(list[i].standPrice);
@@ -158,7 +159,7 @@ export default {
   onShow() {},
   methods: {
     postOrder() {
-      console.log(12312312321)
+      console.log(12312312321);
       let list = this.shoppingCartList;
       for (let i = 0; i < list.length; i++) {
         let item = list[i];
@@ -183,6 +184,10 @@ export default {
         }
       }
       let data = { goodsList: list };
+      // 邀请码
+      if (this.sac) {
+        data["shareActivityCode"] = this.sac;
+      }
       // #ifdef MP-WEIXIN
       this.$api.placeSmallOrder(data).then((res) => {
         console.log(res, "res");
@@ -398,7 +403,7 @@ export default {
     },
   },
   onReachBottom() {},
-  computed: { ...mapGetters(["userInfo", "shoppingCartList"]) },
+  computed: { ...mapGetters(["userInfo", "shoppingCartList", "sac"]) },
   components: { ClassTimeTip },
 };
 </script>

+ 5 - 5
pages2/register/register.vue

@@ -704,15 +704,15 @@ export default {
                             res.data.data.user_account
                           );
                           uni.setStorageSync("token", res.data.data.token);
-						  // 修改邀请码
-                          let sac = uni.getStorageSync("sac");
+                          // 修改邀请码
+                          let sac = this.$store.getters.sac;
                           sac &&
                             that.$api
                               .shareActivityCode({ shareActivityCode: sac })
                               .then((res) => {
-                                if (res.data.code == 200) {
-                                  uni.removeStorageSync("sac");
-                                }
+                                // if (res.data.code == 200) {
+                                //   uni.removeStorageSync("sac");
+                                // }
                               });
                           that.$api.getInfo({ fromPlat: 1 }).then((resdata) => {
                             if (resdata.data.code == 200) {

+ 4 - 4
pages4/login/login.vue

@@ -479,12 +479,12 @@ export default {
       uni.setStorageSync("user_account", res.data.data.user_account);
       uni.setStorageSync("token", res.data.data.token);
       // 修改邀请码
-      let sac = uni.getStorageSync("sac");
+      let sac = this.$store.getters.sac;
       sac &&
         this.$api.shareActivityCode({ shareActivityCode: sac }).then((res) => {
-          if (res.data.code == 200) {
-            uni.removeStorageSync("sac");
-          }
+          // if (res.data.code == 200) {
+          //   uni.removeStorageSync("sac");
+          // }
         });
       // /app/user/getInfo 登录用户信息// fromPlat来源平台 1小程序 2PC网站
       this.$api.getInfo({ fromPlat: 1 }).then((resdata) => {

+ 6 - 8
pages5/scan/recommen.vue

@@ -28,7 +28,9 @@
         </view>
       </view>
     </view>
-    <view class="tip">温馨提示:在线课程属虚拟商品,活动期间购买不予退款,请按需购买</view>
+    <view class="tip"
+      >温馨提示:在线课程属虚拟商品,活动期间购买不予退款,请按需购买</view
+    >
   </view>
 </template>
 
@@ -48,7 +50,7 @@ export default {
       for (let i = 0; i < arrs.length; i++) {
         optObj[arrs[i].split("=")[0]] = arrs[i].split("=")[1];
       }
-      uni.setStorageSync("sac", optObj.sac);
+      this.$store.commit('setSac', optObj.sac)
       this.getCourseList(optObj.sharekey);
       this.shareActivityCode(optObj.sac);
     }
@@ -94,11 +96,7 @@ export default {
             AuthorizationToken: "WX " + token,
             TenantId: config.tenantId,
           },
-          success: (res) => {
-            if (res.data.code == 200) {
-              uni.removeStorageSync("sac");
-            }
-          },
+          success: (res) => {},
           fail: (err) => {},
         });
     },
@@ -223,7 +221,7 @@ export default {
   }
   .tip {
     text-align: center;
-    color: #A7B0B8;
+    color: #a7b0b8;
     padding: 16rpx 30rpx 0;
   }
 }

+ 19 - 14
store/index.js

@@ -5,15 +5,15 @@ import method from '@/common/methodTool'
 Vue.use(Vuex);
 const store = new Vuex.Store({
 	state: {
-		hideBuyState:false, //是否隐藏购买流程和订单列表
+		hideBuyState: false, //是否隐藏购买流程和订单列表
 		login: true,
 		token: '',
 		avatarUrl: '',
 		userName: '',
-		playNextId:'', //正在播放的节id
+		playNextId: '', //正在播放的节id
 		userInfo: null,
 		dictObj: null,
-		chapterOpen:true,
+		chapterOpen: true,
 		allowLoading: true,
 		goodsAuditionConfigIdList: [], //当前访问页面的试听节ID
 		shoppingCartList: [], //购物车支付商品
@@ -23,10 +23,11 @@ const store = new Vuex.Store({
 		copyData: null, //存放审核资料数据
 		playChannelId: 0, //正在播放的直播频道号
 		playVID: 0, //正在播放的保利威视频ID
-		liveLast:null,
+		liveLast: null,
 		tabNums: 0, // '我的'右上角的数字
-		sysTime:0, //系统时间
+		sysTime: 0, //系统时间
 		scene: 0, //进入小程序的场景值
+		sac: ''
 	},
 	getters: {
 		sysTime: state => {
@@ -91,9 +92,10 @@ const store = new Vuex.Store({
 		playChannelId: state => state.playChannelId,
 		playVID: state => state.playVID,
 		liveLast: state => state.liveLast,
+		sac: state => state.sac
 	},
 	mutations: {
-		commonSystemTime(state,time) {
+		commonSystemTime(state, time) {
 			state.sysTime = time;
 		},
 		tabNum(state, nums) {
@@ -109,17 +111,17 @@ const store = new Vuex.Store({
 			// 	})
 			// }
 		},
-		updateLiveLast(state,liveLast) {
+		updateLiveLast(state, liveLast) {
 			state.liveLast = liveLast
 		},
-		updateAllowLoading(state,isShowloading) {
+		updateAllowLoading(state, isShowloading) {
 			state.allowLoading = isShowloading
 		},
-		updatePlayNextId(state,str) {
-			console.log(str,'str')
+		updatePlayNextId(state, str) {
+			console.log(str, 'str')
 			state.playNextId = str
 		},
-		updateChapterOpen(state,boolean) {
+		updateChapterOpen(state, boolean) {
 			state.chapterOpen = boolean
 		},
 		updataCopyData(state, objs) {
@@ -151,7 +153,10 @@ const store = new Vuex.Store({
 		},
 		setScene(state, scene) {
 			state.scene = scene
-		}
+		},
+		setSac(state, sac) {
+			state.sac = sac
+		},
 	},
 	actions: {
 		/**
@@ -162,7 +167,7 @@ const store = new Vuex.Store({
 		}) {
 			return new Promise(resolve => {
 				api.commonSystemTime().then(res => {
-					if(res.data.code == 200) {
+					if (res.data.code == 200) {
 						commit('commonSystemTime', res.data.data)
 						resolve()
 					}
@@ -190,7 +195,7 @@ const store = new Vuex.Store({
 				}
 			})
 		},
-		async appCommonConfig(context,data) {
+		async appCommonConfig(context, data) {
 			const resdata = await api.appCommonConfig(data)
 			if (resdata.data.code == 200) {
 				context.state.hideBuyState = resdata.data.data.hide;