作者 杨世雄

绑定经销商

... ... @@ -314,6 +314,9 @@ Page({
paySign: res.data.data.paySign,
success(res) {
// console.log(res);
if(wx.getStorageSync('is_share')){
that.DefaultFollow()
}
wx.redirectTo({
url: '/pages/VtuanOrder/VtuanOrder',
})
... ... @@ -391,6 +394,43 @@ Page({
}
},
// 分享进入默认关注
async DefaultFollow(){
try {
const {
data
} = await request({
url: 'api/index2/guan1',
data: {
id: wx.getStorageSync('s4_id')
}
})
// console.log(data);
if (data.code == 1) {
that.setData({
msg: data.msg
})
that.popSuccessTest()
setTimeout(() => {
wx.navigateBack()
}, 800);
} else {
that.setData({
msg: data.msg
})
that.popTest()
}
that.getmoreList()
} catch (err) {
// console.log(err);
that.setData({
msg: err.msg
})
that.popTest()
}
},
changeChe() { //小象积分
if (this.data.img1) {
this.setData({
... ...
... ... @@ -38,16 +38,20 @@ Page({
onLoad: function (options) {
let that = this
console.log(options,'分享参数')
if (options.scene) {
that.setData({
id: options.scene,
})
} else {
if (options.is_share == 1) {
this.setData({
that.setData({
is_share: options.is_share,
id: options.id,
})
wx.setStorageSync('is_share', options.is_share)
wx.setStorageSync('s4_id', options.s4_id)
wx.setStorageSync('s4_name', options.s4_name)
} else {
that.setData({
id: options.id,
... ... @@ -468,9 +472,11 @@ Page({
},
onShareAppMessage(options) {
var that = this;
let s4_id = wx.getStorageSync('s4_id')
let s4_name = wx.getStorageSync('s4_name')
var shareObj = {
title: that.data.tuanDetail.goods_name, // 默认是小程序的名称(可以写slogan等)
path: '/pages/VtuanDetail/VtuanDetail?id=' + that.data.id + '&is_share=1', // 默认是当前页面,必须是以‘/’开头的完整路径
path: '/pages/VtuanDetail/VtuanDetail?id=' + that.data.id + '&is_share=1' + '&s4_id='+ s4_id + '&s4_name=' + s4_name , // 默认是当前页面,必须是以‘/’开头的完整路径
imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
};
// 返回shareObj
... ...
... ... @@ -57,7 +57,7 @@
</view>
<!-- 普通 -->
<view class="obligation">
<view class="address" wx:if="{{way != 10}}">
<view class="address" wx:if="{{way != 10&&address}}">
<view class="shiqu">{{address.address}}</view>
<view class="address_big_title">{{address.address2}}</view>
<view class="kehu">
... ...
... ... @@ -59,8 +59,9 @@ Page({
id: options.scene,
type: 2,
})
wx.setStorageSync('s4_id', options.s4_id)
wx.setStorageSync('s4_name', options.s4_name)
// wx.setStorageSync('s4_id', options.s4_id)
// wx.setStorageSync('s4_name', options.s4_name)
} else {
that.setData({
id: options.id,
... ... @@ -72,6 +73,24 @@ Page({
if (options.s4_name) {
wx.setStorageSync('s4_name', options.s4_name)
}
if(options.is_share){
wx.setStorageSync('is_share', options.is_share)
}
// 改
// if (options.is_share == 1) {
// that.setData({
// is_share: options.is_share,
// id: options.id,
// type: options.type,
// })
// wx.setStorageSync('is_share', options.is_share)
// wx.setStorageSync('s4_id', options.s4_id)
// wx.setStorageSync('s4_name', options.s4_name)
// } else {
// that.setData({
// id: options.id,
// })
// }
}
if (!token) {
wx.showModal({
... ... @@ -326,7 +345,7 @@ Page({
// 设置菜单中的转发按钮触发转发事件时的转发内容
var shareObj = {
title: "分享", // 默认是小程序的名称(可以写slogan等)
path: '/pages/details/details?id=' + that.data.id + '&type=' + that.data.type + '&s4_id=' + s4_id + '&s4_name=' + s4_name, // 默认是当前页面,必须是以‘/’开头的完整路径
path: '/pages/details/details?id=' + that.data.id + '&type=' + that.data.type + '&s4_id=' + s4_id + '&s4_name=' + s4_name + '&is_share=1', // 默认是当前页面,必须是以‘/’开头的完整路径
imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
success: function (res) {
console.log(res, '转发成功')
... ...
... ... @@ -3,6 +3,7 @@
"van-count-down": "@vant/weapp/count-down/index",
"lfy-login":"../../components/lfylogin"
},
"navigationBarTitleText": "商品详情"
"navigationBarTitleText": "商品详情",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
\ No newline at end of file
... ...
... ... @@ -337,6 +337,9 @@ Page({
url: '/pages/binding4S/binding4S',
})
}
if(wx.getStorageSync('is_share')){
that.DefaultFollow()
}
},
fail(res) {
// console.log(res)
... ... @@ -487,4 +490,41 @@ Page({
})
})
},
// 分享进入默认关注
async DefaultFollow(){
try {
const {
data
} = await request({
url: 'api/index2/guan1',
data: {
id: wx.getStorageSync('s4_id')
}
})
// console.log(data);
if (data.code == 1) {
that.setData({
msg: data.msg
})
that.popSuccessTest()
setTimeout(() => {
wx.navigateBack()
}, 800);
} else {
that.setData({
msg: data.msg
})
that.popTest()
}
that.getmoreList()
} catch (err) {
// console.log(err);
that.setData({
msg: err.msg
})
that.popTest()
}
}
})
\ No newline at end of file
... ...