Commit 60799c67 authored by Mac's avatar Mac

1

parent 25b48f40
......@@ -218,10 +218,7 @@ export default {
if (options && options.SmallShopId) {
uni.setStorageSync("SmallShopId", { SmallShopId: options.SmallShopId });
}
if (options && options.Up) {//校园id
uni.setStorageSync("Up", { Up: options.Up });
this.IsOpenSchool = options.Up==2?1:0
}
if (options && options.scene) {
//兼容之前小程序的调转
......@@ -269,6 +266,13 @@ export default {
this.GoodsId = options.GoodsId ? options.GoodsId : 29;
}
that.u = uni.getStorageSync("mall_UserInfo");
if(that.u){//进入页面时 判断登录缓存里是否是校园模式
that.IsOpenSchool = that.u.UserPageType==2?1:0
}
if (options && options.Up) {//校园id
uni.setStorageSync("Up", { Up: options.Up });
that.IsOpenSchool = options.Up==2?1:0//分享进来是否是校园模式
}
wx.getUserInfo({
success: function (res) {
if (uni.getStorageSync("mall_UserInfo")) {
......@@ -480,7 +484,7 @@ export default {
uni.removeStorageSync("SmallShopId");
uni.removeStorageSync("Up");
that.getPageType()
if(this.IsOpenSchool !=res.data.IsOpenSchool){
if(res.data.IsOpenSchool==1){//校园开启
that.init()
}
// 如果登录的情况下直接跳转商品详情或者直播列表
......@@ -578,15 +582,20 @@ export default {
return n.substr(1);
},
init() {
if(this.IsOpenSchool==0){
this.IsOpenSchool = uni.getStorageSync("mall_UserInfo")?uni.getStorageSync("mall_UserInfo").IsOpenSchool:0;
let mall_IsOpenSchool = uni.getStorageSync("mall_UserInfo")?uni.getStorageSync("mall_UserInfo").IsOpenSchool:0
let open_school=0;
console.log(this.IsOpenSchool,mall_IsOpenSchool)
if(this.IsOpenSchool==1 && mall_IsOpenSchool==1){//this.IsOpenSchool 通过分享进来的 是否是校园 1 是0不是 mall_IsOpenSchool缓存获取校园模式开启没有
open_school=1
}else{
open_school=0
}
this.request2(
{
url: "/api/Mall/GetHome",
data: {
page_id: this.pageId,
open_school:this.IsOpenSchool,
open_school:open_school,
},
},
(res) => {
......@@ -806,7 +815,7 @@ export default {
this.u = uni.getStorageSync("mall_UserInfo");
this.$refs.son[0].getSmallShopById(2); //第一次登陆成功后去调取微店的信息
this.getPageType()//获取用户类型(校园)
if(this.IsOpenSchool !=this.u.IsOpenSchool){
if(this.u.IsOpenSchool==1){
this.init()
}
// 如果登录的情况下直接跳转商品详情或者直播列表
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment