Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
business-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 01b174e3
authored
Oct 22, 2022
by
luyt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix:分享功能
1 parent
dc6cb58b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
19 deletions
pages/checkProduct/checkProduct.js
pages/checkProduct/checkProduct.wxml
pages/tab/index/components/product/product.js
pages/tab/index/components/product/product.wxml
pages/checkProduct/checkProduct.js
View file @
01b174e
...
@@ -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) {
...
...
pages/checkProduct/checkProduct.wxml
View file @
01b174e
...
@@ -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>
pages/tab/index/components/product/product.js
View file @
01b174e
...
@@ -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
=
[
"场景说明"
,
"场景说明"
,
...
...
pages/tab/index/components/product/product.wxml
View file @
01b174e
...
@@ -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"
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment