Commit 01b174e3 by luyt

fix:分享功能

1 parent dc6cb58b
......@@ -48,6 +48,7 @@ Page({
hasUserInfo: false,
phone: "", //授权手机号
userInfo: "",
isAuthphone: true, //授权昵称弹窗显示,更多按钮显示
},
observers: {
actNum: function (actNum) {
......@@ -108,7 +109,7 @@ Page({
// if(actNum&&activeNavIdx)return
// 设置标题
this.shareTitle = `~给你分享一个${senceData[actNum]?.productList[activeNavIdx].proName}`;
this.shareTitle = `给你分享一个${senceData[actNum]?.productList[activeNavIdx].proName}~`;
this.setData({
actNum,
......@@ -283,34 +284,24 @@ Page({
let res = e.detail;
this.onLoad(null);
wx.nextTick(() => {
//储存手机号
// console.log("储存手机号",res.phone)
wx.$storage.set("authphone", res.phone);
this.setData({
// isShare: res.isShare,
phone: res.phone,
});
});
//储存手机号
wx.$storage.set("authphone", phone);
},
/**
* 生命周期函数--监听页面加载 (扫码,分享链接)
*/
async onLoad(options) {
// 有手机号就不用再一次授权昵称,手机号
let phone = wx.$storage.get("authphone");
if (phone) {
this.setData({
origin: "",
});
}
console.log("分享options12255565: ", options);
// actNum,activeNavIdx isShare
if (!options || utils.isEmptyObj(options)) return;
this.analysisOption();
},
// 解析二维码回调
async analysisOption() {
// this.analysisOption();
// 解析二维码参数
if (options.scene) {
this.setData({
......@@ -355,7 +346,20 @@ Page({
// actNum,
// activeNavIdx,
};
// 有手机号就不用再一次授权昵称,手机号
let phone = wx.$storage.get("authphone");
console.log("储存手机号", phone);
if (phone) {
this.setData({
isAuthphone: false,
outshowVideo: true,
isShare:false,
});
}
},
// 解析二维码回调
async analysisOption() {},
// 解析扫码进来参数
async analysisQRcode(str) {
......
......@@ -4,7 +4,7 @@
</view> -->
<product stickyTop="{{headerHeight}}" class="productCon" style="padding-top:{{headerHeight}}px" actNum="{{actNum}}" wrapactiveNavIdx="{{activeNavIdx}}" outshowVideo="{{outshowVideo}}" senceData="{{senceData}}" outshowVideo="{{outshowVideo}}" isShare="{{isShare}}" bindauthorized="authorizedFn" />
<product stickyTop="{{headerHeight}}" class="productCon" style="padding-top:{{headerHeight}}px" isAuthphone="{{isAuthphone}}" actNum="{{actNum}}" wrapactiveNavIdx="{{activeNavIdx}}" senceData="{{senceData}}" outshowVideo="{{outshowVideo}}" isShare="{{isShare}}" bindauthorized="authorizedFn" />
<!-- 分享弹框 -->
<!-- <shareModel actNum="{{actNum}}" isShow="{{isShow}}" bindmodelclose="modelcloseFn" /> -->
<view class="share-wrap" wx:if="{{isShow}}">
......@@ -36,4 +36,4 @@
</view>
<!-- 授权昵称 -->
<!-- !hasUserInfo && !isShow -->
<view wx:if="{{!hasUserInfo && isShare}}" class="user-profile" bindtap="getUserProfile"></view>
<view wx:if="{{!hasUserInfo && isShare && isAuthphone}}" class="user-profile" bindtap="getUserProfile"></view>
......@@ -25,6 +25,7 @@ Component({
type: Boolean,
value: true,
}, //显示视频列表
isAuthphone:Boolean
},
/**
......@@ -75,7 +76,8 @@ Component({
},
},
observers: {
actNum: function () {
actNum: function (newval, oldval) {
console.log('newval, oldval: ', newval, oldval);
let navList;
let tab = [
"场景说明",
......
......@@ -66,7 +66,7 @@
<!-- wx:if="{{isShare && actNum != 2 && index == 4}}" -->
<!-- wx:if="{{ isShare && actNum != 2 && index == 4}}" -->
<button
wx:if="{{ isShare && !getMoreBtn && actNum != 2 && index == 4}}"
wx:if="{{ isShare && isAuthphone && !getMoreBtn && actNum != 2 && index == 4}}"
class="more-btn"
data-index="{{index}}"
bindgetphonenumber="getUserInfo"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!