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 d153b831
authored
Oct 22, 2022
by
wuwx
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'develop' of 192.168.3.233:saas_plus/business-assistant into develop
2 parents
6e53597d
01b174e3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
110 additions
and
96 deletions
pages/checkProduct/checkProduct.js
pages/checkProduct/checkProduct.wxml
pages/tab/index/components/product/product.js
pages/tab/index/components/product/product.wxml
pages/tab/index/index.wxml
utils/constantData.js
pages/checkProduct/checkProduct.js
View file @
d153b83
// pages/checkProduct/checkProduct.js
// const navStyle = "background-color: transparent;";
const
navStyle
=
"background-color: #fff"
;
import
{
senceData
}
from
"~/pages/tab/index/constant/data"
;
import
{
IMG_URL
}
from
"~/utils/constantData.js"
;
import
{
senceData
}
from
"~/pages/tab/index/constant/data"
;
import
{
IMG_URL
}
from
"~/utils/constantData.js"
;
import
Draw
from
"~/utils/Draw.js"
;
import
{
createQrCodeApi
,
sceneByIdApi
}
from
"~/api/checkProduct.js"
;
import
{
createQrCodeApi
,
sceneByIdApi
}
from
"~/api/checkProduct.js"
;
import
utils
from
"~/utils/util.js"
;
Page
({
...
...
@@ -26,18 +19,19 @@ Page({
// 模态框
isShow
:
true
,
// IMG_URL: `${IMG_URL}index`,
btnList
:
[{
src
:
`
${
IMG_URL
}
index/wechat.png`
,
name
:
"微信转发"
,
},
// {
// src: `${IMG_URL}index/moments.png`,
// name: "朋友圈分享",
// },
{
src
:
`
${
IMG_URL
}
index/down.png`
,
name
:
"下载为海报"
,
},
btnList
:
[
{
src
:
`
${
IMG_URL
}
index/wechat.png`
,
name
:
"微信转发"
,
},
// {
// src: `${IMG_URL}index/moments.png`,
// name: "朋友圈分享",
// },
{
src
:
`
${
IMG_URL
}
index/down.png`
,
name
:
"下载为海报"
,
},
],
// 4种场景下图片所有的高 (单位 rpx)
imgHeightArr
:
[
...
...
@@ -52,8 +46,9 @@ Page({
isShare
:
false
,
// 是否授权昵称
hasUserInfo
:
false
,
phone
:
''
,
//授权手机号
userInfo
:
''
phone
:
""
,
//授权手机号
userInfo
:
""
,
isAuthphone
:
true
,
//授权昵称弹窗显示,更多按钮显示
},
observers
:
{
actNum
:
function
(
actNum
)
{
...
...
@@ -77,10 +72,7 @@ Page({
},
// navbar高度设置
navbarReady
(
e
)
{
let
{
height
,
statusBarHeight
}
=
e
.
detail
;
let
{
height
,
statusBarHeight
}
=
e
.
detail
;
this
.
setData
({
headerHeight
:
height
/
2
+
statusBarHeight
,
// headerHeight: height / 2 + statusBarHeight,
...
...
@@ -111,23 +103,29 @@ Page({
actNum
,
activeNavIdx
,
apiData
,
outshowVideo
outshowVideo
,
// origin //跳转来源 home
}
=
options
;
// if(actNum&&activeNavIdx)return
// 设置标题
this
.
shareTitle
=
`给你分享一个
${
senceData
[
actNum
]?.
productList
[
activeNavIdx
].
proName
}
~
`;
this.setData({
actNum,
activeNavIdx,
apiData,
outshowVideo
outshowVideo
,
// origin
// isShare
});
let apiDataJson = JSON.stringify(apiData);
let item = apiData[actNum]?.productList[activeNavIdx];
this
.
shareQuery
=
`sceneCode=
${
apiData
[
actNum
].
sceneCode
}
&productCode=
${
item
?.
productCode
}
&
isShare
=
$
{
true
}
&
productDesc
=
$
{
item
?.
productName
}
&
category
=
$
{
item
?.
category
}
&
actNum
=
$
{
actNum
}
&
activeNavIdx
=
$
{
activeNavIdx
}
&
apiData
=
$
{
apiDataJson
}
`;
this.shareQuery = `
sceneCode
=
$
{
apiData
[
actNum
].
sceneCode
}
&
productCode
=
$
{
item
?.
productCode
}
&
isShare
=
$
{
true
}
&
productDesc
=
$
{
item
?.
productName
}
&
category
=
$
{
item
?.
category
}
&
actNum
=
$
{
actNum
}
&
activeNavIdx
=
$
{
activeNavIdx
}
&
apiData
=
$
{
apiDataJson
}
`;
this.shareTrackData = {
sceneCode: apiData[actNum]?.sceneCode,
productCode: item?.productCode,
...
...
@@ -141,9 +139,7 @@ Page({
},
// 分享按钮
handleClick(e) {
let {
index
} = e.currentTarget.dataset;
let { index } = e.currentTarget.dataset;
switch (index) {
case 0:
this.wechatFn();
...
...
@@ -160,11 +156,7 @@ Page({
},
// 下载海报
async download() {
let {
actNum,
activeNavIdx,
imgHeightArr
} = this.data;
let { actNum, activeNavIdx, imgHeightArr } = this.data;
let wx_user_info = wx.$storage.get("wx_user_info");
// console.log('wx_user_info: ', wx_user_info.appId);
let params = {
...
...
@@ -195,8 +187,9 @@ Page({
let _this = this;
wx.getImageInfo({
src: `
https
:
//img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/longpic${actNum + 1
}.
png
`,
src: `
https
:
//img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/longpic${
actNum
+
1
}.
png
`,
success: async () => {
// // console.log("imgAllHeight: ", imgAllHeight);
// let drawFun = new Draw({
...
...
@@ -227,25 +220,27 @@ Page({
// ];
let
arr
=
[
456
,
222
,
0
,
496
];
let
imgList
=
[{
x
:
0
,
y
:
0
,
width
:
_this
.
data
.
imgWidth
,
height
:
_this
.
data
.
imgHeight
,
url
:
`https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/longpic
${
actNum
+
1
let
imgList
=
[
{
x
:
0
,
y
:
0
,
width
:
_this
.
data
.
imgWidth
,
height
:
_this
.
data
.
imgHeight
,
url
:
`https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/longpic
${
actNum
+
1
}.
png
`,
},
{
// x: 245 * 2,
// y: erCodeHeight + 30,
// width: 120 * 2,
// height: 120 * 2,
x: _this.data.imgWidth - 64,
y: _this.data.imgHeight - arr[actNum] - 64,
width: 64,
height: 64,
url: res.data, //二维码
},
},
{
// x: 245 * 2,
// y: erCodeHeight + 30,
// width: 120 * 2,
// height: 120 * 2,
x: _this.data.imgWidth - 64,
y: _this.data.imgHeight - arr[actNum] - 64,
width: 64,
height: 64,
url: res.data, //二维码
},
];
// console.log(imgList)
let posterUrl = await drawFun.begin({
...
...
@@ -289,9 +284,11 @@ 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,
});
});
...
...
@@ -303,6 +300,8 @@ Page({
console.log("分享options12255565: ", options);
// actNum,activeNavIdx isShare
if (!options || utils.isEmptyObj(options)) return;
// this.analysisOption();
// 解析二维码参数
if (options.scene) {
this.setData({
...
...
@@ -313,11 +312,7 @@ Page({
}
// 扫码进来
let {
actNum,
activeNavIdx,
isShare
} = options;
let { actNum, activeNavIdx, isShare } = options;
if (isShare == "true") {
this.setData({
isShow: false,
...
...
@@ -332,14 +327,16 @@ Page({
actNum,
activeNavIdx,
isShare: true,
outshowVideo:false, //显示视频列表
outshowVideo:
false, //显示视频列表
});
// 发请求
let senceItem = senceData[actNum];
let item = senceData[actNum]?.productList[activeNavIdx];
this.shareQuery = `
sceneCode
=
$
{
senceItem
?.
sceneCode
}
&
productCode
=
$
{
item
?.
productCode
}
&
isShare
=
$
{
true
}
&
productDesc
=
$
{
item
?.
productName
}
&
category
=
$
{
item
?.
category
}
&
actNum
=
$
{
actNum
}
&
activeNavIdx
=
$
{
activeNavIdx
}
`;
this.shareQuery = `
sceneCode
=
$
{
senceItem
?.
sceneCode
}
&
productCode
=
$
{
item
?.
productCode
}
&
isShare
=
$
{
true
}
&
productDesc
=
$
{
item
?.
productName
}
&
category
=
$
{
item
?.
category
}
&
actNum
=
$
{
actNum
}
&
activeNavIdx
=
$
{
activeNavIdx
}
`;
this.shareTrackData = {
sceneCode: senceItem?.sceneCode,
productCode: item?.productCode,
...
...
@@ -349,12 +346,26 @@ 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) {
let id = str.split("%3D")[1];
let res = await sceneByIdApi({
id
id
,
});
// console.log('res: ', res);
return res;
...
...
@@ -372,17 +383,17 @@ Page({
// console.log('res: ', res.userInfo.nickName);
// userInfo.nickName
this.setData({
userInfo: res.userInfo
})
let wx_user_info = wx.$storage.get(
'wx_user_info')
userInfo: res.userInfo
,
})
;
let wx_user_info = wx.$storage.get(
"wx_user_info");
// console.log('wx_user_info: ', wx_user_info);
let obj ={
let obj =
{
...wx_user_info,
nickName:res.userInfo.nickName,
avatarUrl:res.userInfo.avatarUrl,
}
nickName:
res.userInfo.nickName,
avatarUrl:
res.userInfo.avatarUrl,
}
;
// console.log('obj',obj)
wx.$storage.set(
'wx_user_info', obj)
wx.$storage.set(
"wx_user_info", obj);
// this.onLoad(null);
},
});
...
...
@@ -391,40 +402,40 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow(options) {
},
onShow(options) {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
onShareAppMessage() {},
/**
* 浏览埋点
*/
onShareTimeline() {
},
onShareTimeline() {},
onViewTrack: true,
});
\ No newline at end of file
});
pages/checkProduct/checkProduct.wxml
View file @
d153b83
...
...
@@ -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>
pages/tab/index/components/product/product.js
View file @
d153b83
...
...
@@ -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
=
[
"场景说明"
,
...
...
pages/tab/index/components/product/product.wxml
View file @
d153b83
...
...
@@ -67,7 +67,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"
...
...
pages/tab/index/index.wxml
View file @
d153b83
...
...
@@ -135,8 +135,8 @@
<view class="dialog-box">
<form bindsubmit="submit">
<view class="dialog-header">
<view wx:if="{{isReset}}" class="header-btn btn-gray" bindtap="showCalculate">取消</view>
<view wx:if="{{
!
isReset}}" class="header-btn btn-gray" bindtap="reset">重置</view>
<view wx:if="{{
!
isReset}}" class="header-btn btn-gray" bindtap="showCalculate">取消</view>
<view wx:if="{{isReset}}" class="header-btn btn-gray" bindtap="reset">重置</view>
<button class="header-btn btn-primary" form-type="submit">确定</button>
</view>
<view class="dialog-content">
...
...
utils/constantData.js
View file @
d153b83
...
...
@@ -13,5 +13,6 @@ export const STORAGE_OBJECTkEY = {
auto_login_object
:
'auto_login_object'
,
wx_user_info
:
'wx_user_info'
,
userPhone
:
'userPhone'
,
firstLogin
:
'firstLogin'
firstLogin
:
'firstLogin'
,
authphone
:
'authphone'
}
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