Commit efcb83c2 authored by Mac's avatar Mac

分享代码提交

parent 46436e3c
...@@ -379,6 +379,9 @@ export default { ...@@ -379,6 +379,9 @@ export default {
if (custom_params.user_id) { if (custom_params.user_id) {
uni.setStorageSync("pid", { pid: custom_params.user_id }); uni.setStorageSync("pid", { pid: custom_params.user_id });
} }
if (custom_params.Up) {//分享进入校园id
uni.setStorageSync("Up", { Up: custom_params.Up });
}
} }
if (option && option.user_id) { if (option && option.user_id) {
uni.setStorageSync("pid", { pid: option.user_id }); uni.setStorageSync("pid", { pid: option.user_id });
......
...@@ -205,12 +205,24 @@ export default { ...@@ -205,12 +205,24 @@ export default {
this.contentHeight = this.$utils.calcContentHeight(); this.contentHeight = this.$utils.calcContentHeight();
} }
} }
let mall_UserInfo = uni.getStorageSync("mall_UserInfo");
if(mall_UserInfo){//进入页面时 判断登录缓存里是否是校园模式
this.IsOpenSchool = mall_UserInfo.UserPageType==2?1:0
}
if (options && options.Up) {//校园id
uni.setStorageSync("Up", { Up: options.Up });
this.IsOpenSchool = options.Up==2?1:0//分享进来是否是校园模式
}
if (options && options.custom_params) { if (options && options.custom_params) {
let custom_params = JSON.parse(decodeURIComponent(options.custom_params)); let custom_params = JSON.parse(decodeURIComponent(options.custom_params));
console.log(custom_params); console.log(custom_params);
if (custom_params.user_id) { if (custom_params.user_id) {
uni.setStorageSync("pid", { pid: custom_params.user_id }); uni.setStorageSync("pid", { pid: custom_params.user_id });
} }
if (custom_params.Up) {//校园id
uni.setStorageSync("Up", { Up: custom_params.Up });
this.IsOpenSchool = custom_params.Up==2?1:0//分享进来是否是校园模式
}
} }
if (options && options.user_id) { if (options && options.user_id) {
uni.setStorageSync("pid", { pid: options.user_id }); uni.setStorageSync("pid", { pid: options.user_id });
...@@ -266,13 +278,6 @@ export default { ...@@ -266,13 +278,6 @@ export default {
this.GoodsId = options.GoodsId ? options.GoodsId : 29; this.GoodsId = options.GoodsId ? options.GoodsId : 29;
} }
that.u = uni.getStorageSync("mall_UserInfo"); 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({ wx.getUserInfo({
success: function (res) { success: function (res) {
if (uni.getStorageSync("mall_UserInfo")) { if (uni.getStorageSync("mall_UserInfo")) {
...@@ -839,12 +844,14 @@ export default { ...@@ -839,12 +844,14 @@ export default {
data: {}, data: {},
}, },
(res) => { (res) => {
// uni.setStorageSync('UserPageType', res.data);
let mall_UserInfo = uni.getStorageSync("mall_UserInfo")?uni.getStorageSync("mall_UserInfo"):{}; let mall_UserInfo = uni.getStorageSync("mall_UserInfo")?uni.getStorageSync("mall_UserInfo"):{};
mall_UserInfo.IsOpenSchool=res.data.IsOpenSchool; mall_UserInfo.IsOpenSchool=res.data.IsOpenSchool;
mall_UserInfo.UserPageType=res.data.UserPageType; mall_UserInfo.UserPageType=res.data.UserPageType;
uni.setStorageSync("mall_UserInfo", mall_UserInfo); uni.setStorageSync("mall_UserInfo", mall_UserInfo);
if(this.IsOpenSchool==1 && res.data.UserPageType!=2){//这种情况是自己注册过 但是 通过分享进来的判断
this.IsOpenSchool = 0;
this.init()
}
} }
); );
}, },
......
...@@ -201,7 +201,8 @@ export default { ...@@ -201,7 +201,8 @@ export default {
? uni.getStorageSync("mall_UserInfo").UserSmallShopId ? uni.getStorageSync("mall_UserInfo").UserSmallShopId
: 0; : 0;
} }
let customParams = encodeURIComponent(JSON.stringify({ user_id: uid ,SmallShopId:SmallShopId})); let Up = uni.getStorageSync("mall_UserInfo")?uni.getStorageSync("mall_UserInfo").UserPageType:0;
let customParams = encodeURIComponent(JSON.stringify({ user_id: uid ,SmallShopId:SmallShopId,Up:Up}));
wx.navigateTo({ wx.navigateTo({
url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${cx.roomid}&custom_params=${customParams}`, url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${cx.roomid}&custom_params=${customParams}`,
}); });
......
...@@ -75,12 +75,13 @@ export default { ...@@ -75,12 +75,13 @@ export default {
if(SmallShopId==0){ if(SmallShopId==0){
SmallShopId = that.UserInfo.UserSmallShopId?that.UserInfo.UserSmallShopId:0; SmallShopId = that.UserInfo.UserSmallShopId?that.UserInfo.UserSmallShopId:0;
} }
let Up = uni.getStorageSync("mall_UserInfo")?uni.getStorageSync("mall_UserInfo").UserPageType:0;
that.request2( that.request2(
{ {
url: "/api/AppletUser/GetWeiXinQRCodeForApplet", url: "/api/AppletUser/GetWeiXinQRCodeForApplet",
data: { data: {
// Path: "pages/live/index?user_id=" + that.UserInfo.UserId+'&SmallShopId='+ SmallShopId, // Path: "pages/live/index?user_id=" + that.UserInfo.UserId+'&SmallShopId='+ SmallShopId,
Path: "/pages/index/index?user_id=" + that.UserInfo.UserId+'&SmallShopId='+ SmallShopId+'&JumpType=2', Path: "/pages/index/index?user_id=" + that.UserInfo.UserId+'&SmallShopId='+ SmallShopId+'&JumpType=2'+ "&Up=" + Up,
With: that.qrcode.QrCodeSize, With: that.qrcode.QrCodeSize,
}, },
}, },
......
...@@ -474,11 +474,12 @@ ...@@ -474,11 +474,12 @@
let UserInfo = uni.getStorageSync('mall_UserInfo') ?uni.getStorageSync('mall_UserInfo'):{}; let UserInfo = uni.getStorageSync('mall_UserInfo') ?uni.getStorageSync('mall_UserInfo'):{};
let SmallShopId = this.applyState let SmallShopId = this.applyState
uni.showNavigationBarLoading(); uni.showNavigationBarLoading();
let Up = uni.getStorageSync("mall_UserInfo")?uni.getStorageSync("mall_UserInfo").UserPageType:0;
that.request2( that.request2(
{ {
url: '/api/AppletUser/GetWeiXinQRCodeForAppletSmallShops', url: '/api/AppletUser/GetWeiXinQRCodeForAppletSmallShops',
data: { data: {
Path:'pages/index/index?user_id=' + UserInfo.UserId+'&SmallShopId='+ SmallShopId, Path:'pages/index/index?user_id=' + UserInfo.UserId+'&SmallShopId='+ SmallShopId+ "&Up=" + Up,
With:212, With:212,
} }
}, },
......
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