Commit 01b174e3 by luyt

fix:分享功能

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