Commit 9ab00e09 authored by Mac's avatar Mac

分享跳转首页操作

parent ce6dec53
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
let t = getCurrentPages(); let t = getCurrentPages();
let u = uni.getStorageSync("mall_UserInfo"); let u = uni.getStorageSync("mall_UserInfo");
let uid = u.UserId ? u.UserId : 0; let uid = u.UserId ? u.UserId : 0;
this.path = '/' + t[t.length - 1].route+"?id=" + this.goodId + "&user_id=" + uid; this.path = '/pages/index/index?id=' + this.goodId + "&user_id=" + uid+'&JumpType=1';
//console.log(t[t.length - 1]); //console.log(t[t.length - 1]);
this.favorStatus = this.favorite; this.favorStatus = this.favorite;
......
...@@ -302,7 +302,8 @@ export default { ...@@ -302,7 +302,8 @@ export default {
url: "/api/Mall/GetGoosPoster", url: "/api/Mall/GetGoosPoster",
data: { data: {
goodsId: this.id, goodsId: this.id,
path: "/pages/goods/goods?id=" + this.id + "&user_id=" + u.UserId, // path: "/pages/goods/goods?id=" + this.id + "&user_id=" + u.UserId,
path: "/pages/index/index?id=" + this.id + "&user_id=" + u.UserId+'&JumpType=1',
}, },
}, },
(res) => { (res) => {
......
...@@ -444,7 +444,8 @@ export default { ...@@ -444,7 +444,8 @@ export default {
this.g.app_share_title != null && this.g.app_share_title != "" this.g.app_share_title != null && this.g.app_share_title != ""
? this.g.app_share_title ? this.g.app_share_title
: this.g.name, : this.g.name,
path: "/pages/goods/goods?id=" + this.id + "&user_id=" + uid+ "&SmallShopId=" + SmallShopId, // path: "/pages/goods/goods?id=" + this.id + "&user_id=" + uid+ "&SmallShopId=" + SmallShopId,
path: "/pages/index/index?id=" + this.id + "&user_id=" + uid+ "&SmallShopId=" + SmallShopId+'&JumpType=1',
imageUrl: imageUrl:
this.g.app_share_pic != null && this.g.app_share_pic != "" this.g.app_share_pic != null && this.g.app_share_pic != ""
? this.g.app_share_pic ? this.g.app_share_pic
......
...@@ -130,6 +130,8 @@ export default { ...@@ -130,6 +130,8 @@ export default {
showAuth:false, showAuth:false,
U:{}, U:{},
shopData:{}, shopData:{},
JumpType:0,
GoodsId:29,
}; };
}, },
components: { components: {
...@@ -221,7 +223,14 @@ export default { ...@@ -221,7 +223,14 @@ export default {
withShareTicket: true, withShareTicket: true,
menus: ["shareAppMessage", "shareTimeline"], menus: ["shareAppMessage", "shareTimeline"],
}); });
if(options && options.JumpType){//跳转类型 1为详情2为直播列表
this.JumpType = options.JumpType
}
if(options && options.id){//商品详情
this.GoodsId = options.id
}else {
this.GoodsId = options.GoodsId ? options.GoodsId : 29;
}
that.u = uni.getStorageSync("mall_UserInfo") that.u = uni.getStorageSync("mall_UserInfo")
wx.getUserInfo({ wx.getUserInfo({
success: function (res) { success: function (res) {
...@@ -233,6 +242,15 @@ export default { ...@@ -233,6 +242,15 @@ export default {
Photo: res.userInfo.avatarUrl, Photo: res.userInfo.avatarUrl,
}; };
that.updateuserinfo(msg); that.updateuserinfo(msg);
// 如果登录的情况下直接跳转商品详情或者直播列表
setTimeout(()=>{
if(that.JumpType==1){//商品详情
uni.navigateTo({ url: '/pages/goods/goods?GoodsId=' + that.GoodsId });
}else if(that.JumpType==2){//直播列表
uni.navigateTo({ url: '/pages/live/index'});
}
},500)
}else{ }else{
//静默登录操作 //静默登录操作
uni.login({ uni.login({
...@@ -412,6 +430,15 @@ export default { ...@@ -412,6 +430,15 @@ export default {
that.u = res.data that.u = res.data
uni.removeStorageSync('pid'); uni.removeStorageSync('pid');
uni.removeStorageSync('SmallShopId'); uni.removeStorageSync('SmallShopId');
// 如果登录的情况下直接跳转商品详情或者直播列表
setTimeout(()=>{
if(that.JumpType==1){//商品详情
uni.navigateTo({ url: '/pages/goods/goods?GoodsId=' + that.GoodsId });
}else if(that.JumpType==2){//直播列表
uni.navigateTo({ url: '/pages/live/index'});
}
},500)
}else{ }else{
if (!that.u) { if (!that.u) {
that.u = { that.u = {
...@@ -690,7 +717,14 @@ export default { ...@@ -690,7 +717,14 @@ export default {
reloadUserinfo() { reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
this.$refs.son[0].getSmallShopById(2)//第一次登陆成功后去调取微店的信息 this.$refs.son[0].getSmallShopById(2)//第一次登陆成功后去调取微店的信息
// 如果登录的情况下直接跳转商品详情或者直播列表
setTimeout(()=>{
if(that.JumpType==1){//商品详情
uni.navigateTo({ url: '/pages/goods/goods?GoodsId=' + that.GoodsId });
}else if(that.JumpType==2){//直播列表
uni.navigateTo({ url: '/pages/live/index'});
}
},500)
}, },
//关闭登录窗口 //关闭登录窗口
gbAuth(){ gbAuth(){
......
...@@ -92,7 +92,8 @@ export default { ...@@ -92,7 +92,8 @@ export default {
{ {
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',
With: that.qrcode.QrCodeSize, With: that.qrcode.QrCodeSize,
}, },
}, },
......
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
<button <button
open-type="contact" open-type="contact"
:send-message-title="d.OrderInfo.GoodsName" :send-message-title="d.OrderInfo.GoodsName"
:send-message-path="'/pages/goods/goods?id=' + d.OrderInfo.GoodsId + '&user_id=' + uid" :send-message-path="'/pages/index/index?id=' + d.OrderInfo.GoodsId + '&user_id=' + uid+'&JumpType=1'"
:send-message-img="d.OrderInfo.CoverImagePath" :send-message-img="d.OrderInfo.CoverImagePath"
:show-message-card="true" :show-message-card="true"
> >
......
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
<button <button
open-type="contact" open-type="contact"
:send-message-title="x.GoodsName" :send-message-title="x.GoodsName"
:send-message-path="'/pages/goods/goods?id=' + x.GoodsId + '&user_id=' + uid" :send-message-path="'/pages/index/index?id=' + x.GoodsId + '&user_id=' + uid+'&JumpType=1'"
:send-message-img=" x.CoverImagePath " :send-message-img=" x.CoverImagePath "
:show-message-card="true" :show-message-card="true"
> >
......
...@@ -411,7 +411,8 @@ export default { ...@@ -411,7 +411,8 @@ export default {
this.g.app_share_title != null && this.g.app_share_title != "" this.g.app_share_title != null && this.g.app_share_title != ""
? this.g.app_share_title ? this.g.app_share_title
: this.g.name, : this.g.name,
path: "/pages/goods/goods?id=" + this.id + "&user_id=" + uid, // path: "/pages/goods/goods?id=" + this.id + "&user_id=" + uid,
path: "/pages/index/index?id=" + this.id + "&user_id=" + uid+'&JumpType=1',
imageUrl: imageUrl:
this.g.app_share_pic != null && this.g.app_share_pic != "" this.g.app_share_pic != null && this.g.app_share_pic != ""
? this.g.app_share_pic ? this.g.app_share_pic
......
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