Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
store-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 9b371a83
authored
Oct 24, 2022
by
张晓玮
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'v3.0' into 'zhangxw_dev_3.0'
V3.0 See merge request
!57
2 parents
2e5c36db
aed465fb
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
378 additions
and
181 deletions
api/api.js
api/usersApi/UsersApi.js
pages/authentication/accountItems/accountItems.json
pages/authentication/customerService/customerService.js
pages/authentication/customerService/customerService.scss
pages/authentication/customerService/customerService.wxml
pages/authentication/login/login.js
pages/authentication/register/register.js
pages/authentication/registerInfo/registerInfo.js
pages/checkProduct/checkProduct.js
pages/tab/discovery/components/product/product.js
pages/tab/discovery/components/product/product.scss
pages/tab/discovery/constant/data.js
pages/tab/discovery/discovery.js
pages/tab/discovery/discovery.scss
pages/tab/discovery/discovery.wxml
pages/tab/mine/components/userInfo/userInfo.wxml
pages/tab/mine/mine.js
utils/constantData.js
utils/share.js
api/api.js
View file @
9b371a8
import
api
from
'../utils/request/request'
import
api
from
'../utils/request/request'
import
ssoApi
from
'./ssoApi'
import
ssoApi
from
'./ssoApi'
const
common
=
'scrm.api.carlife.common.'
const
common
=
'scrm.api.carlife.common.'
const
{
appId
}
=
wx
.
getAccountInfoSync
().
miniProgram
module
.
exports
=
{
module
.
exports
=
{
ssoApi
,
ssoApi
,
commonApi
:
{
commonApi
:
{
...
@@ -22,6 +25,20 @@ module.exports = {
...
@@ -22,6 +25,20 @@ module.exports = {
noSignAttr
:
[
'file'
]
noSignAttr
:
[
'file'
]
})
})
},
},
createQrcode
(
data
)
{
return
api
.
post
({
method
:
'scrm.api.wechat.miniprogram.createQrcode'
,
...
data
,
appId
},
true
)
},
getQrcodeParams
(
data
)
{
return
api
.
post
({
method
:
'scrm.api.wechat.get.scene.by.id'
,
...
data
},
true
)
}
},
},
/** 线索埋点数据上报
/** 线索埋点数据上报
* operationType 操作类型(0:分享 1:浏览 2:申请活动)
* operationType 操作类型(0:分享 1:浏览 2:申请活动)
...
...
api/usersApi/UsersApi.js
View file @
9b371a8
...
@@ -124,5 +124,32 @@ class UsersApi {
...
@@ -124,5 +124,32 @@ class UsersApi {
true
true
)
)
}
}
/**获取微信用户信息 */
async
getWXUserInfo
()
{
let
wx_user_info
=
wx
.
$storage
.
get
(
'wx_user_info'
)
if
(
!
wx_user_info
)
{
const
data
=
await
this
.
getUserProfile
()
wx
.
$storage
.
set
(
'wx_user_info'
,
data
)
return
data
}
else
return
wx_user_info
}
/** 手机号授权解析(单纯解析内容返回前端)
* 只传loginToken就返回unionId和openid
* 传加密信息就解析手机号
*/
async
getUserProfile
(
loginToken
,
detail
=
{})
{
if
(
detail
.
errMsg
&&
detail
.
errMsg
==
'getPhoneNumber:fail user deny'
)
Promise
.
reject
()
delete
detail
.
errMsg
if
(
!
loginToken
)
{
let
res
=
await
this
.
wxCodeLogin
()
loginToken
=
res
.
data
}
detail
.
loginToken
=
loginToken
return
api
.
post
({
method
:
'scrm.api.sso.wechat.applets.phone.grant.analysis'
,
...
detail
,
platformEntrance
:
'STORE_ASSISTANT'
})
}
}
}
export
default
UsersApi
export
default
UsersApi
\ No newline at end of file
\ No newline at end of file
pages/authentication/accountItems/accountItems.json
View file @
9b371a8
{
{
"usingComponents"
:
{
"usingComponents"
:
{
"navigation-bar"
:
"/components/NavigationBar/NavigationBar"
"navigation-bar"
:
"/components/NavigationBar/NavigationBar"
}
},
"navigationBarTitleText"
:
"选择账号"
}
}
\ No newline at end of file
\ No newline at end of file
pages/authentication/customerService/customerService.js
View file @
9b371a8
...
@@ -14,6 +14,11 @@ Page({
...
@@ -14,6 +14,11 @@ Page({
onLoad
(
options
)
{
onLoad
(
options
)
{
},
},
toDial
(){
wx
.
makePhoneCall
({
phoneNumber
:
'18902454229'
,
})
},
/**
/**
* 生命周期函数--监听页面初次渲染完成
* 生命周期函数--监听页面初次渲染完成
...
...
pages/authentication/customerService/customerService.scss
View file @
9b371a8
...
@@ -37,11 +37,16 @@
...
@@ -37,11 +37,16 @@
color
:
#1B233D
;
color
:
#1B233D
;
margin-bottom
:
8rpx
;
margin-bottom
:
8rpx
;
}
}
.dial
{
display
:
flex
;
justify-content
:
center
;
}
.phone
{
.phone
{
font-weight
:
400
;
font-weight
:
400
;
font-size
:
22rpx
;
font-size
:
22rpx
;
color
:
#
9299AD
;
color
:
#
5971F6
;
line-height
:
32rpx
;
line-height
:
32rpx
;
margin-right
:
8rpx
;
}
}
}
}
}
}
...
...
pages/authentication/customerService/customerService.wxml
View file @
9b371a8
...
@@ -3,11 +3,11 @@
...
@@ -3,11 +3,11 @@
<view class="service-wrap">
<view class="service-wrap">
<image class="qrcode" src="{{IMGURL}}service.png"></image>
<image class="qrcode" src="{{IMGURL}}service.png"></image>
<view class="tip">扫码添加客服企微</view>
<view class="tip">扫码添加客服企微</view>
<view class="hotline">
<view class="hotline"
catchtap='toDial'
>
<view class="title">客服热线</view>
<view class="title">客服热线</view>
<view>
<view
class="dial"
>
<text class="phone">189 0245 4229</text>
<text class="phone">189 0245 4229</text>
<image></image>
<image
style="width: 32rpx;height: 32rpx;" src="{{IMGURL}}phone.png"
></image>
</view>
</view>
</view>
</view>
</view>
</view>
...
...
pages/authentication/login/login.js
View file @
9b371a8
...
@@ -101,7 +101,7 @@ Page({
...
@@ -101,7 +101,7 @@ Page({
mobile
:
formData
.
phone
,
mobile
:
formData
.
phone
,
code
:
formData
.
code
code
:
formData
.
code
}
}
if
(
this
.
data
.
showLoading
)
return
;
if
(
this
.
data
.
showLoading
||
this
.
data
.
disabled
)
return
;
this
.
setShowLoading
(
true
)
this
.
setShowLoading
(
true
)
USERAPI
.
phoneSmsLogin
(
obj
).
then
(({
USERAPI
.
phoneSmsLogin
(
obj
).
then
(({
code
,
code
,
...
@@ -145,6 +145,8 @@ Page({
...
@@ -145,6 +145,8 @@ Page({
switchLoginMethod
(
e
){
switchLoginMethod
(
e
){
const
{
type
}
=
e
.
target
.
dataset
const
{
type
}
=
e
.
target
.
dataset
this
.
setData
({
this
.
setData
({
count
:
null
,
[
'formData.code'
]:
''
,
loginMethod
:
type
loginMethod
:
type
})
})
},
},
...
@@ -159,8 +161,8 @@ Page({
...
@@ -159,8 +161,8 @@ Page({
},
},
checkInfo
(){
checkInfo
(){
this
.
setData
({
this
.
setData
({
phoneReady
:
this
.
validate
.
methods
.
tel
(
this
.
data
.
formData
.
phone
),
phoneReady
:
this
.
data
.
formData
.
phone
&&
this
.
validate
.
methods
.
tel
(
this
.
data
.
formData
.
phone
),
disabled
:
!
this
.
validate
.
methods
.
tel
(
this
.
data
.
formData
.
phone
)
||
this
.
data
.
formData
?.
code
?.
length
!=
4
disabled
:
!
(
this
.
data
.
formData
.
phone
&&
this
.
validate
.
methods
.
tel
(
this
.
data
.
formData
.
phone
)
)
||
this
.
data
.
formData
?.
code
?.
length
!=
4
})
})
},
},
/**获取验证码 */
/**获取验证码 */
...
@@ -263,7 +265,7 @@ Page({
...
@@ -263,7 +265,7 @@ Page({
* 生命周期函数--监听页面卸载
* 生命周期函数--监听页面卸载
*/
*/
onUnload
()
{
onUnload
()
{
clearTimeout
()
},
},
/**
/**
...
...
pages/authentication/register/register.js
View file @
9b371a8
import
USERAPI
from
'~/api/usersApi/index'
import
USERAPI
from
'~/api/usersApi/index'
const
navStyle
=
"background-color: transparent;"
;
const
navStyle
=
"background-color: transparent;"
;
import
{
selectAccountLogin
,
setLoginInfo
}
from
'../lib/index'
Page
({
Page
({
/**
/**
...
@@ -51,32 +55,14 @@ Page({
...
@@ -51,32 +55,14 @@ Page({
if
(
confirm
)
this
.
init
()
if
(
confirm
)
this
.
init
()
})
})
},
},
// toRegister(){
// console.log(this.loginToken)
// },
toRegister
({
toRegister
({
detail
detail
})
{
})
{
if
(
!
detail
.
code
)
return
if
(
!
detail
.
code
)
return
wx
.
showLoading
()
let
params
=
{
USERAPI
.
authUserPhone
(
detail
,
this
.
loginToken
).
then
(({
detail
,
code
,
...
this
.
data
.
linkParams
data
,
message
,
errId
})
=>
{
wx
.
hideLoading
()
if
(
code
==
'0'
||
errId
==
'30990103'
){
let
target
=
null
if
(
code
==
'0'
&&
data
.
loginUserInfoList
?.
length
){
let
{
loginUserInfoList
}
=
data
target
=
loginUserInfoList
.
find
(
item
=>
item
.
merchantId
==
this
.
data
.
linkParams
.
merchantId
)
}
if
(
target
){
wx
.
$router
.
go
(
'/pages/authentication/registerSuccess/registerSuccess'
,{
type
:
0
})
return
;
}
}
let
params
=
{...
this
.
data
.
linkParams
}
if
(
this
.
data
.
linkParams
.
type
==
1
){
if
(
this
.
data
.
linkParams
.
type
==
1
){
wx
.
$router
.
go
(
'/pages/authentication/registerInfo/registerInfo'
,
params
)
wx
.
$router
.
go
(
'/pages/authentication/registerInfo/registerInfo'
,
params
)
}
else
{
}
else
{
...
@@ -92,25 +78,52 @@ Page({
...
@@ -92,25 +78,52 @@ Page({
weChatNickName
:
merchantFileRequest
.
fileName
,
weChatNickName
:
merchantFileRequest
.
fileName
,
weChatAvatarUrl
:
merchantFileRequest
.
fileUrl
weChatAvatarUrl
:
merchantFileRequest
.
fileUrl
}
}
this
.
register
(
regParmas
)
this
.
register
(
regParmas
,
detail
)
}
}
},
register
(
params
,
detail
){
USERAPI
.
register
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
==
'0'
){
this
.
toLogin
(
detail
)
}
else
{
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
}
})
},
toLogin
(
detail
){
USERAPI
.
authUserPhone
(
detail
,
this
.
loginToken
).
then
(({
code
,
data
,
message
,
errId
})
=>
{
if
(
code
==
'0'
){
this
.
checkLoginUserInfo
(
data
)
}
else
{
}
else
{
wx
.
hideLoading
()
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
}
}
}).
catch
(({
}).
catch
(({
errMsg
errMsg
})
=>
{
})
=>
{
this
.
setShowLoading
(
false
)
wx
.
$api
.
showToast
(
'系统异常'
)
wx
.
$api
.
showToast
(
'系统异常'
)
})
})
},
},
register
(
params
){
checkLoginUserInfo
({
USERAPI
.
register
(
params
).
then
((
res
)
=>
{
loginUserInfoList
,
if
(
res
.
code
==
'0'
){
sessionId
wx
.
$router
.
go
(
'/pages/authentication/registerSuccess/registerSuccess'
,{
type
:
1
})
})
{
}
else
{
/**多个账号 */
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
console
.
log
(
loginUserInfoList
,
'loginUserInfoList'
)
}
if
(
loginUserInfoList
.
length
>
1
)
wx
.
$router
.
go
(
'/pages/authentication/accountItems/accountItems'
,
{
sessionId
,
...
this
.
options
})
/**只有一个账号 */
else
selectAccountLogin
({
id
:
loginUserInfoList
[
0
].
uuid
,
sessionId
})
})
},
},
/**
/**
...
...
pages/authentication/registerInfo/registerInfo.js
View file @
9b371a8
// pages/authentication/registerInfo/registerInfo.js
// pages/authentication/registerInfo/registerInfo.js
import
USERAPI
from
'~/api/usersApi/index'
import
USERAPI
from
'~/api/usersApi/index'
import
{
selectAccountLogin
,
setLoginInfo
}
from
'../lib/index'
Page
({
Page
({
/**
/**
...
@@ -27,7 +31,6 @@ Page({
...
@@ -27,7 +31,6 @@ Page({
},
},
onRoute
(
options
){
onRoute
(
options
){
console
.
log
(
options
,
111
)
this
.
setData
({
this
.
setData
({
dataFromOptions
:
options
,
dataFromOptions
:
options
,
staffName
:
options
.
staffName
staffName
:
options
.
staffName
...
@@ -81,7 +84,6 @@ Page({
...
@@ -81,7 +84,6 @@ Page({
})
})
},
},
onConfirm
(
e
){
onConfirm
(
e
){
console
.
log
(
e
)
const
{
value
}
=
e
.
detail
const
{
value
}
=
e
.
detail
this
.
setData
({
this
.
setData
({
department
:
value
department
:
value
...
@@ -95,7 +97,6 @@ Page({
...
@@ -95,7 +97,6 @@ Page({
})
})
},
},
handleRegister
({
detail
}){
handleRegister
({
detail
}){
console
.
log
(
detail
,
'detaildetaildetail'
)
const
{
merchantId
,
merchantFileRequest
}
=
this
.
data
.
dataFromOptions
const
{
merchantId
,
merchantFileRequest
}
=
this
.
data
.
dataFromOptions
let
params
=
{
let
params
=
{
merchantId
,
merchantId
,
...
@@ -108,16 +109,50 @@ Page({
...
@@ -108,16 +109,50 @@ Page({
weChatNickName
:
merchantFileRequest
.
fileName
,
weChatNickName
:
merchantFileRequest
.
fileName
,
weChatAvatarUrl
:
merchantFileRequest
.
fileUrl
weChatAvatarUrl
:
merchantFileRequest
.
fileUrl
}
}
console
.
log
(
params
,
'ddd'
)
USERAPI
.
register
(
params
).
then
((
res
)
=>
{
USERAPI
.
register
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
==
'0'
){
if
(
res
.
code
==
'0'
){
wx
.
$router
.
go
(
'/pages/authentication/registerSuccess/registerSuccess'
,{
type
:
1
}
)
this
.
toLogin
(
)
}
else
{
}
else
{
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
}
}
})
})
//
//
},
},
toLogin
(){
USERAPI
.
authUserPhone
(
this
.
data
.
dataFromOptions
.
detail
,
this
.
loginToken
).
then
(({
code
,
data
,
message
,
errId
})
=>
{
if
(
code
==
'0'
){
this
.
checkLoginUserInfo
(
data
)
}
else
{
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
}
}).
catch
(({
errMsg
})
=>
{
this
.
setShowLoading
(
false
)
wx
.
$api
.
showToast
(
'系统异常'
)
})
},
checkLoginUserInfo
({
loginUserInfoList
,
sessionId
})
{
/**多个账号 */
if
(
loginUserInfoList
.
length
>
1
)
wx
.
$router
.
go
(
'/pages/authentication/accountItems/accountItems'
,
{
sessionId
,
...
this
.
options
})
/**只有一个账号 */
else
selectAccountLogin
({
id
:
loginUserInfoList
[
0
].
uuid
,
sessionId
})
},
inputStaffNamme
(
e
){
inputStaffNamme
(
e
){
const
{
value
}
=
e
.
detail
const
{
value
}
=
e
.
detail
this
.
setData
({
this
.
setData
({
...
...
pages/checkProduct/checkProduct.js
View file @
9b371a8
...
@@ -2,7 +2,9 @@ const navStyle = "background-color: #fff";
...
@@ -2,7 +2,9 @@ const navStyle = "background-color: #fff";
import
{
senceData
}
from
"~/pages/tab/discovery/constant/data"
;
import
{
senceData
}
from
"~/pages/tab/discovery/constant/data"
;
import
Draw
from
"~/utils/Draw.js"
;
import
Draw
from
"~/utils/Draw.js"
;
import
{
IMG_URL
}
from
"~/utils/constantData.js"
;
import
{
IMG_URL
}
from
"~/utils/constantData.js"
;
import
ActivityApi
from
'~/api/activityApi/index'
import
{
commonApi
}
from
'~/api/api.js'
const
IMGURL
=
IMG_URL
const
IMGURL
=
IMG_URL
Page
({
Page
({
/**
/**
...
@@ -28,31 +30,8 @@ Page({
...
@@ -28,31 +30,8 @@ Page({
name
:
"下载为海报"
,
name
:
"下载为海报"
,
},
},
],
],
imgHeightArr
:
[
[
1110
,
1290
,
596
,
744
,
490
,
1532
],
[
2168
,
1290
,
596
,
830
,
490
,
752
],
[
1110
,
1290
,
596
,
984
,
490
],
[
678
,
1266
,
1398
,
830
,
490
,
1666
],
],
posterUrl
:
""
,
//海报url
posterUrl
:
""
,
//海报url
},
},
// observers: {
// actNum: function (actNum) {
// let imgList = [
// `${IMGURL}index/scene${actNum + 1}1.png`,
// `${IMGURL}index/scene${actNum + 1}2.png`,
// `${IMGURL}index/scene${actNum + 1}3.png`,
// `${IMGURL}index/scene${actNum + 1}4.png`,
// `${IMGURL}index/scene${actNum + 1}5.png`,
// ];
// if (actNum != 2) {
// imgList.push(`${IMGURL}index/scene${actNum + 1}6.png`);
// }
// this.setData({
// imgList,
// });
// },
// },
navbarReady
(
e
)
{
navbarReady
(
e
)
{
let
{
let
{
height
height
...
@@ -76,6 +55,15 @@ Page({
...
@@ -76,6 +55,15 @@ Page({
isShow
:
true
,
isShow
:
true
,
});
});
},
},
setRouteParams
(
obj
){
const
{
actNum
,
activeNavIdx
,
fromLocal
}
=
obj
this
.
setData
({
actNum
,
activeNavIdx
,
fromLocal
})
this
.
createImg
()
},
createImg
(){
createImg
(){
if
(
this
.
data
.
isShow
&&
this
.
data
.
fromLocal
==
1
){
if
(
this
.
data
.
isShow
&&
this
.
data
.
fromLocal
==
1
){
let
{
actNum
,
activeNavIdx
}
=
this
.
data
;
let
{
actNum
,
activeNavIdx
}
=
this
.
data
;
...
@@ -91,9 +79,16 @@ Page({
...
@@ -91,9 +79,16 @@ Page({
width
:
imgW
,
width
:
imgW
,
height
:
imgH
height
:
imgH
});
});
// ActivityApi.getActivityVisitorList({
// let scene = {
// actNum, activeNavIdx
// actNum,
// }).then(response => {
// activeNavIdx
// }
let
params
=
{
scene
:
`actNum=
${
actNum
}
&activeNavIdx=
${
activeNavIdx
}
`
,
path
:
'pages/checkProduct/checkProduct'
}
commonApi
.
createQrcode
(
params
).
then
(
response
=>
{
let
qrcode
=
response
?.
data
this
.
setData
({
this
.
setData
({
imgH
:
(
imgH
/
imgW
)
*
450
imgH
:
(
imgH
/
imgW
)
*
450
})
})
...
@@ -106,24 +101,23 @@ Page({
...
@@ -106,24 +101,23 @@ Page({
height
:
imgH
,
height
:
imgH
,
url
:
img
,
url
:
img
,
},
},
//
{
{
//
x:imgW-64,
x
:
imgW
-
64
,
//
y: imgH-arr[actNum]-64,
y
:
imgH
-
arr
[
actNum
]
-
64
,
//
width: 64,
width
:
64
,
//
height: 64,
height
:
64
,
// url: respons
e, //二维码
url
:
qrcod
e
,
//二维码
//
},
},
];
];
drawFun
.
begin
({
drawFun
.
begin
({
imageList
:
imgList
,
imageList
:
imgList
,
}).
then
(
resp
=>
{
}).
then
(
resp
=>
{
console
.
log
(
'posterUrl.path'
,
resp
)
this
.
setData
({
this
.
setData
({
posterUrl
:
resp
.
path
,
posterUrl
:
resp
.
path
,
});
});
wx
.
hideLoading
()
wx
.
hideLoading
()
})
})
//
})
})
}
}
})
})
}
}
...
@@ -151,7 +145,6 @@ Page({
...
@@ -151,7 +145,6 @@ Page({
wx
.
saveImageToPhotosAlbum
({
wx
.
saveImageToPhotosAlbum
({
filePath
:
this
.
data
.
posterUrl
,
//仅为示例,并非真实的资源
filePath
:
this
.
data
.
posterUrl
,
//仅为示例,并非真实的资源
success
(
res
)
{
success
(
res
)
{
console
.
log
(
'res: '
,
res
);
wx
.
$api
.
showToast
(
'下载成功!'
)
wx
.
$api
.
showToast
(
'下载成功!'
)
}
}
})
})
...
@@ -171,17 +164,7 @@ Page({
...
@@ -171,17 +164,7 @@ Page({
});
});
},
},
onRoute
(
options
)
{
onRoute
(
options
)
{
wx
.
nextTick
(()
=>
{
let
{
actNum
,
activeNavIdx
,
fromLocal
}
=
this
.
options
this
.
shareQuery
=
`actNum=
${
actNum
}
&activeNavIdx=
${
activeNavIdx
}
`
console
.
log
(
" this.options: "
,
this
.
options
);
this
.
setData
({
actNum
,
activeNavIdx
,
fromLocal
})
this
.
createImg
()
})
},
},
noPageAuth
:
true
,
noPageAuth
:
true
,
...
@@ -190,7 +173,36 @@ Page({
...
@@ -190,7 +173,36 @@ Page({
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
(
options
)
{
onLoad
(
options
)
{
console
.
log
(
options
,
'onLoad'
)
console
.
log
(
options
)
wx
.
nextTick
(()
=>
{
let
{
actNum
,
activeNavIdx
,
scene
}
=
this
.
options
// let name = wx.$storage.get('staff_name') || (wx.$storage.get('userInfo') ? wx.$storage.get('userInfo').name : '')
let
name
=
wx
.
$storage
.
get
(
'userInfo'
)
?
wx
.
$storage
.
get
(
'userInfo'
).
name
:
''
this
.
shareTitle
=
`
${
name
}
给你分享一个
${
senceData
[
actNum
].
productList
[
activeNavIdx
].
proName
}
~`
this
.
shareQuery
=
`actNum=
${
actNum
}
&activeNavIdx=
${
activeNavIdx
}
`
wx
.
setNavigationBarTitle
({
title
:
senceData
[
actNum
].
name
||
'特色产品'
})
if
(
scene
){
let
qrcodeQuery
=
decodeURIComponent
(
scene
)
let
id
=
qrcodeQuery
.
split
(
'='
).
pop
()
let
paramsObj
=
{}
if
(
id
){
commonApi
.
getQrcodeParams
({
id
}).
then
(
res
=>
{
if
(
res
.
code
==
'0'
){
let
paramsArr
=
res
?.
data
?.
scene
?.
split
(
'&'
);
paramsArr
.
forEach
(
item
=>
{
let
keyValArr
=
item
?.
split
(
'='
);
paramsObj
[
keyValArr
[
0
]]
=
keyValArr
[
1
]
})
this
.
setRouteParams
({...
paramsObj
,
fromLocal
:
0
})
}
})
}
}
else
{
this
.
setRouteParams
(
this
.
options
)
}
})
},
},
/**
/**
...
...
pages/tab/discovery/components/product/product.js
View file @
9b371a8
...
@@ -86,6 +86,21 @@ Component({
...
@@ -86,6 +86,21 @@ Component({
curTabIdx
:
idx
curTabIdx
:
idx
})
})
},
},
download
()
{
wx
.
downloadFile
({
url
:
'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/video/digital_card_30s.mp4'
,
success
(
res
)
{
if
(
res
.
statusCode
===
200
)
{
wx
.
saveVideoToPhotosAlbum
({
filePath
:
res
.
tempFilePath
,
success
(
res
)
{
wx
.
$api
.
showToast
(
'保存成功!'
)
}
})
}
}
})
},
getImgHeight
(){
getImgHeight
(){
let
query
=
wx
.
createSelectorQuery
().
in
(
this
)
let
query
=
wx
.
createSelectorQuery
().
in
(
this
)
let
heightArr
=
[]
let
heightArr
=
[]
...
@@ -96,7 +111,6 @@ Component({
...
@@ -96,7 +111,6 @@ Component({
heightArr
.
push
(
s
)
heightArr
.
push
(
s
)
})
})
this
.
data
.
heightArr
=
heightArr
this
.
data
.
heightArr
=
heightArr
console
.
log
(
this
.
data
.
heightArr
)
}).
exec
()
}).
exec
()
},
},
getImgHeight
()
{
getImgHeight
()
{
...
...
pages/tab/discovery/components/product/product.scss
View file @
9b371a8
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
width
:
188rpx
;
width
:
188rpx
;
height
:
64rpx
;
height
:
64rpx
;
border-radius
:
12rpx
;
border-radius
:
12rpx
;
font-weight
:
5
00
;
font-weight
:
6
00
;
font-size
:
24rpx
;
font-size
:
24rpx
;
letter-spacing
:
0
;
letter-spacing
:
0
;
text-align
:
center
;
text-align
:
center
;
...
...
pages/tab/discovery/constant/data.js
View file @
9b371a8
...
@@ -4,6 +4,8 @@ var senceData = [
...
@@ -4,6 +4,8 @@ var senceData = [
img
:
'scene_talk.png'
,
img
:
'scene_talk.png'
,
active
:
'icon-car11'
,
active
:
'icon-car11'
,
playImg
:
'img1'
,
playImg
:
'img1'
,
sceneCode
:
'SC001'
,
show
:
0
,
productList
:
[
productList
:
[
{
{
img
:
'product-img1'
,
img
:
'product-img1'
,
...
@@ -45,6 +47,8 @@ var senceData = [
...
@@ -45,6 +47,8 @@ var senceData = [
img
:
'scene_delivery.png'
,
img
:
'scene_delivery.png'
,
active
:
'icon-car21'
,
active
:
'icon-car21'
,
playImg
:
'img2'
,
playImg
:
'img2'
,
sceneCode
:
'SC002'
,
show
:
0
,
productList
:
[
productList
:
[
{
{
img
:
'product-img2'
,
img
:
'product-img2'
,
...
@@ -71,27 +75,29 @@ var senceData = [
...
@@ -71,27 +75,29 @@ var senceData = [
img
:
'scene_within_12mth.png'
,
img
:
'scene_within_12mth.png'
,
active
:
'icon-car21'
,
active
:
'icon-car21'
,
playImg
:
'img2'
,
playImg
:
'img2'
,
sceneCode
:
'SC003'
,
show
:
0
,
productList
:
[
productList
:
[
{
{
img
:
'product-img3'
,
img
:
'product-img3'
,
proName
:
'漆面保护膜'
,
proName
:
'漆面保护膜'
,
price
:
'12000'
,
price
:
'12000'
,
profit
:
'
21600万
'
,
profit
:
'
180000
'
,
type
:
'membrane'
,
type
:
'membrane'
,
productType
:
'protectMembrane'
,
productType
:
'protectMembrane'
,
path
:
'paintProtect'
,
path
:
'paintProtect'
,
sale
:
100
00
,
//销量
sale
:
100
,
//销量
varType
:
1
varType
:
1
},
},
{
{
img
:
'product-img4'
,
img
:
'product-img4'
,
proName
:
'改色膜'
,
proName
:
'改色膜'
,
price
:
'5000'
,
price
:
'5000'
,
profit
:
'300000
00
'
,
profit
:
'300000'
,
type
:
'membrane'
,
type
:
'membrane'
,
productType
:
'colorMembrane'
,
productType
:
'colorMembrane'
,
path
:
'changingFilm'
,
path
:
'changingFilm'
,
sale
:
100
00
,
//销量
sale
:
100
,
//销量
varType
:
1
varType
:
1
}
}
]
]
...
@@ -101,6 +107,8 @@ var senceData = [
...
@@ -101,6 +107,8 @@ var senceData = [
img
:
'scene_more_12mth.png'
,
img
:
'scene_more_12mth.png'
,
active
:
'icon-car31'
,
active
:
'icon-car31'
,
playImg
:
'img3'
,
playImg
:
'img3'
,
sceneCode
:
'SC004'
,
show
:
0
,
productList
:
[
productList
:
[
{
{
img
:
'product-img5'
,
img
:
'product-img5'
,
...
...
pages/tab/discovery/discovery.js
View file @
9b371a8
// pages/tab/output/output.js
// pages/tab/output/output.js
const
navStyle
=
"background-color: transparent;"
;
const
navStyle
=
"background-color: transparent;"
;
import
{
senceData
}
from
"./constant/data"
;
import
{
senceData
}
from
"./constant/data"
;
import
ActivityApi
from
'~/api/activityApi/index'
Page
({
Page
({
/**
/**
...
@@ -9,7 +10,7 @@ Page({
...
@@ -9,7 +10,7 @@ Page({
data
:
{
data
:
{
senceData
,
senceData
,
headerHeight
:
0
,
headerHeight
:
0
,
actNum
:
0
,
actNum
:
3
,
navStyle
,
navStyle
,
// 预估弹框
// 预估弹框
visible
:
false
,
visible
:
false
,
...
@@ -24,6 +25,79 @@ Page({
...
@@ -24,6 +25,79 @@ Page({
},
},
isFirst
:
true
,
isFirst
:
true
,
changeSale
:
0
,
changeSale
:
0
,
sceneCodeList
:[],
currentId
:
0
,
showPage
:
false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{
const
{
merchantId
}
=
wx
.
$storage
.
get
(
'userInfo'
)
wx
.
showLoading
({
title
:
'加载中...'
,
})
ActivityApi
.
getOpenSceneList
({
merchantId
}).
then
(
res
=>
{
wx
.
hideLoading
()
if
(
res
?.
length
>
0
){
let
sceneCodeList
=
[]
let
senceData
=
[...
this
.
data
.
senceData
]
let
res
=
[
{
sceneCode
:
'SC001'
,
status
:
1
},
{
sceneCode
:
'SC002'
,
status
:
1
},
{
sceneCode
:
'SC003'
,
status
:
1
},
{
sceneCode
:
'SC004'
,
status
:
1
}
]
res
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
status
==
1
)
{
let
sceneTarget
=
senceData
.
find
(
sitem
=>
sitem
.
sceneCode
==
item
.
sceneCode
)
sceneTarget
.
show
=
1
}
})
senceData
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
show
==
1
)
{
sceneCodeList
.
push
(
item
.
sceneCode
)
}
})
let
idx
=
sceneCodeList
.
findIndex
(
item
=>
item
==
'SC004'
)
let
actNum
=
0
,
currentId
=
0
;
if
(
sceneCodeList
?.
length
){
if
(
idx
>-
1
){
actNum
=
3
currentId
=
idx
}
else
{
actNum
=
senceData
.
findIndex
(
item
=>
item
.
sceneCode
==
sceneCodeList
[
0
])
}
}
this
.
setData
({
sceneCodeList
,
senceData
,
actNum
,
currentId
})
}
this
.
setData
({
showPage
:
true
})
}).
catch
(
err
=>
{
this
.
setData
({
showPage
:
true
})
})
},
},
navbarReady
(
e
)
{
navbarReady
(
e
)
{
let
{
let
{
...
@@ -45,7 +119,7 @@ Page({
...
@@ -45,7 +119,7 @@ Page({
changeSwiper
(
e
){
changeSwiper
(
e
){
this
.
setData
({
this
.
setData
({
actNum
:
e
.
detail
.
current
,
actNum
:
e
.
detail
.
current
ItemId
,
});
});
},
},
...
@@ -72,7 +146,6 @@ Page({
...
@@ -72,7 +146,6 @@ Page({
});
});
},
},
clickDialog
(
e
)
{
clickDialog
(
e
)
{
console
.
log
(
e
.
changedTouches
[
0
].
clientY
);
if
(
e
.
changedTouches
[
0
].
clientY
<
352
)
{
if
(
e
.
changedTouches
[
0
].
clientY
<
352
)
{
this
.
setData
({
this
.
setData
({
visible
:
false
,
visible
:
false
,
...
@@ -90,7 +163,6 @@ Page({
...
@@ -90,7 +163,6 @@ Page({
});
});
},
},
clickDialog
(
e
)
{
clickDialog
(
e
)
{
console
.
log
(
e
.
changedTouches
[
0
].
clientY
);
if
(
e
.
changedTouches
[
0
].
clientY
<
352
)
{
if
(
e
.
changedTouches
[
0
].
clientY
<
352
)
{
this
.
setData
({
this
.
setData
({
visible
:
false
,
visible
:
false
,
...
@@ -101,11 +173,9 @@ Page({
...
@@ -101,11 +173,9 @@ Page({
},
},
// 提交测算
// 提交测算
submit
(
e
)
{
submit
(
e
)
{
console
.
log
(
e
);
let
sales
=
e
?
+
e
.
detail
.
value
.
sales
:
this
.
data
.
formData
.
sales
;
let
sales
=
e
?
+
e
.
detail
.
value
.
sales
:
this
.
data
.
formData
.
sales
;
let
flow
=
e
?
+
e
.
detail
.
value
.
flow
:
this
.
data
.
formData
.
flow
;
let
flow
=
e
?
+
e
.
detail
.
value
.
flow
:
this
.
data
.
formData
.
flow
;
const
reg
=
/^
[
1-9
]\d
*$/
;
const
reg
=
/^
[
1-9
]\d
*$/
;
console
.
log
(
reg
.
test
(
sales
),
flow
,
"---"
);
if
(
!
reg
.
test
(
sales
))
{
if
(
!
reg
.
test
(
sales
))
{
wx
.
showToast
({
wx
.
showToast
({
title
:
"门店月平均新车销量应为正整数"
,
title
:
"门店月平均新车销量应为正整数"
,
...
@@ -127,19 +197,6 @@ Page({
...
@@ -127,19 +197,6 @@ Page({
"lastFormData.flow"
:
flow
,
"lastFormData.flow"
:
flow
,
});
});
const
_this
=
this
;
const
_this
=
this
;
// this.data.tabList.forEach((item, index) => {
// item.productList.forEach((i, lastIndex) => {
// if (i.profit) {
// let name = `tabList[${index}].productList[${lastIndex}].profit`;
// let profit = _this.formula(i.productType, sales, flow);
// console.log(name, profit);
// this.setData({
// [name]: profit,
// });
// }
// });
// });
this
.
data
.
senceData
.
forEach
((
item
,
index
)
=>
{
this
.
data
.
senceData
.
forEach
((
item
,
index
)
=>
{
item
.
productList
.
forEach
((
i
,
lastIndex
)
=>
{
item
.
productList
.
forEach
((
i
,
lastIndex
)
=>
{
if
(
i
.
profit
)
{
if
(
i
.
profit
)
{
...
@@ -148,7 +205,6 @@ Page({
...
@@ -148,7 +205,6 @@ Page({
let
name
=
`senceData[
${
index
}
].productList[
${
lastIndex
}
].profit`
;
let
name
=
`senceData[
${
index
}
].productList[
${
lastIndex
}
].profit`
;
// let changeSale = `senceData[${index}].productList[${lastIndex}].changeSale`;
// let changeSale = `senceData[${index}].productList[${lastIndex}].changeSale`;
let
profit
=
_this
.
formula
(
i
.
productType
,
sales
,
flow
);
let
profit
=
_this
.
formula
(
i
.
productType
,
sales
,
flow
);
console
.
log
(
name
,
profit
);
this
.
setData
({
this
.
setData
({
[
name
]:
profit
,
[
name
]:
profit
,
[
sale
]:
sales
[
sale
]:
sales
...
@@ -158,13 +214,6 @@ Page({
...
@@ -158,13 +214,6 @@ Page({
});
});
});
});
// 触发自定义事件 利润 数量
// this.triggerEvent('countProfit', profit, sales)
// let type = this.getProductType(sceneIndex, tabIndex);
// let profit = this.formula(type, sales, flow);
// console.log('profit: ', profit);
this
.
setData
({
this
.
setData
({
visible
:
false
,
visible
:
false
,
});
});
...
@@ -181,17 +230,7 @@ Page({
...
@@ -181,17 +230,7 @@ Page({
});
});
}
}
},
},
// // 获取场景下的产品类型
// getProductType(sceneIndex, tabIndex) {
// let typeArray = [
// ["benefitCard"], //数字无忧权益卡
// ["sunMembrane"], //汽车太阳膜
// ["protectMembrane", "colorMembrane"], //'漆面保护膜','改色膜'
// ["digitBeauty", "chair", "ar", "lamp", "navigation"], //'数字化美容','座椅通风','AR导航','氛围灯','360全景导航'
// ];
// return typeArray[sceneIndex][tabIndex];
// },
// 计算公式,参数:productType
formula
(
productType
,
sales
,
flow
)
{
formula
(
productType
,
sales
,
flow
)
{
let
profit
=
0
;
let
profit
=
0
;
switch
(
productType
)
{
switch
(
productType
)
{
...
@@ -205,11 +244,11 @@ Page({
...
@@ -205,11 +244,11 @@ Page({
break
;
break
;
case
"protectMembrane"
:
case
"protectMembrane"
:
// 漆面保护膜
// 漆面保护膜
profit
=
(
flow
*
0.15
*
12
000
*
12
).
toFixed
(
0
);
profit
=
(
sales
*
0.05
*
3
000
*
12
).
toFixed
(
0
);
break
;
break
;
case
"colorMembrane"
:
case
"colorMembrane"
:
// 改色膜
// 改色膜
profit
=
(
flow
*
0.05
*
5000
*
12
).
toFixed
(
0
);
profit
=
(
sales
*
0.05
*
5000
*
12
).
toFixed
(
0
);
break
;
break
;
case
"digitBeauty"
:
case
"digitBeauty"
:
// 数字化美容
// 数字化美容
...
@@ -232,8 +271,6 @@ Page({
...
@@ -232,8 +271,6 @@ Page({
profit
=
(
flow
*
2880
*
0.9
*
0.015
).
toFixed
(
0
);
profit
=
(
flow
*
2880
*
0.9
*
0.015
).
toFixed
(
0
);
break
;
break
;
}
}
console
.
log
(
profit
.
length
);
console
.
log
(
productType
,
sales
,
flow
,
profit
);
if
(
profit
.
length
>
9
)
{
if
(
profit
.
length
>
9
)
{
return
(
profit
/
10000
).
toFixed
(
0
)
+
"万"
;
return
(
profit
/
10000
).
toFixed
(
0
)
+
"万"
;
}
else
{
}
else
{
...
@@ -255,12 +292,7 @@ Page({
...
@@ -255,12 +292,7 @@ Page({
});
});
return
false
;
return
false
;
},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{
},
methods
:{
methods
:{
},
},
/**
/**
...
...
pages/tab/discovery/discovery.scss
View file @
9b371a8
/* pages/tab/output/output.wxss */
/* pages/tab/output/output.wxss */
page
{
background-color
:
#fff
;
}
.container
{
.container
{
position
:
relative
;
position
:
relative
;
.scene-wrap
{
.scene-wrap
{
...
@@ -153,3 +155,14 @@
...
@@ -153,3 +155,14 @@
}
}
}
}
.emptyData
{
width
:
100%
;
text-align
:
center
;
.tip
{
margin-top
:
16rpx
;
font-size
:
28rpx
;
color
:
#7A8299
;
text-align
:
center
;
}
}
pages/tab/discovery/discovery.wxml
View file @
9b371a8
<view
style="background:#fff;"
class="container">
<view class="container">
<image style="height: {{headerHeight+45}}px;" src="{{IMGURL}}discovery_center_bg.png" class="bg-img"></image>
<image
wx:if="{{sceneCodeList.length>0 && showPage}}"
style="height: {{headerHeight+45}}px;" src="{{IMGURL}}discovery_center_bg.png" class="bg-img"></image>
<navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}" page-title="发现">
<navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}" page-title="发现">
<text>发现</text>
<text>发现</text>
</navigation-bar>
</navigation-bar>
<block wx:if="{{sceneCodeList.length>0 && showPage}}">
<view style="padding-top: {{headerHeight}}px;">
<view style="padding-top: {{headerHeight}}px;">
<view class="header">
<view class="header">
<swiper bindchange="changeSwiper
" class="scene-wrap" circular="{{true}}" previousMargin="40rpx" nextMargin="40rpx">
<swiper bindchange="changeSwiper" current="{{currentId}}
" class="scene-wrap" circular="{{true}}" previousMargin="40rpx" nextMargin="40rpx">
<block wx:for="{{senceData}}" wx:key="index">
<block wx:for="{{senceData}}" wx:key="index">
<swiper-item
>
<swiper-item item-id="{{index}}" wx:if="{{item.show}}"
>
<image class="scene-img" src="{{IMGURL}}{{item.img}}"></image>
<image class="scene-img" src="{{IMGURL}}{{item.img}}"></image>
</swiper-item>
</swiper-item>
</block>
</block>
...
@@ -16,20 +17,16 @@
...
@@ -16,20 +17,16 @@
</view>
</view>
<product senceData="{{senceData}}" actNum="{{actNum}}" headerHeight="{{headerHeight}}"></product>
<product senceData="{{senceData}}" actNum="{{actNum}}" headerHeight="{{headerHeight}}"></product>
</view>
</view>
</view>
<!-- 在线客服 -->
<image class="chat" src="{{IMGURL}}customer_service.png" bindtap="goConsult" />
<!-- 在线客服
-->
<!-- 申请活动
-->
<image class="applyAct" src="{{IMGURL}}application_activity.png" bindtap="applyActivity" />
<image class="applyAct" src="{{IMGURL}}application_activity.png" bindtap="applyActivity" />
<!-- 测算按钮 -->
<!-- 测算按钮 -->
<view class="calculate" bindtap="showCalculate">
<view class="calculate" bindtap="showCalculate">
<image class="icon-calculate" webp src="{{IMGURL}}calc.png"></image>
<image class="icon-calculate" webp src="{{IMGURL}}calc.png"></image>
</view>
</view>
<!-- 测算弹窗 -->
<!-- 测算弹窗 -->
<view class="dialog-wrapper" bindtap="clickDialog" hidden="{{!visible}}">
<view class="dialog-wrapper" bindtap="clickDialog" hidden="{{!visible}}">
<view class="dialog-box">
<view class="dialog-box">
<form bindsubmit="submit">
<form bindsubmit="submit">
<view class="dialog-header">
<view class="dialog-header">
...
@@ -55,4 +52,20 @@
...
@@ -55,4 +52,20 @@
</view>
</view>
</form>
</form>
</view>
</view>
</view>
</block>
<block wx:if="{{sceneCodeList.length<=0 && showPage}}">
<view class="emptyData" style="margin-top: {{headerHeight+32}}px;">
<image src="{{IMGURL}}toLink.png" style="height: 400rpx;width: 400rpx;"></image>
<view class="tip">
<view>您的门店尚未开通业务场景,</view>
<view>请联系在线客服进行咨询,谢谢。</view>
</view>
</view>
</block>
</view>
</view>
<!-- 在线客服 -->
<image class="chat" src="{{IMGURL}}customer_service.png" bindtap="goConsult" />
pages/tab/mine/components/userInfo/userInfo.wxml
View file @
9b371a8
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
</block>
</block>
<view class="flex_sc label">
<view class="flex_sc label">
<image class="icon" src="{{IMGURL}}shop_icon.png" />
<image class="icon" src="{{IMGURL}}shop_icon.png" />
<view class="tip">{{strSubstr.getString(user.merchantName,
1
0)}}</view>
<view class="tip">{{strSubstr.getString(user.merchantName,
user.seriseName?10:2
0)}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
\ No newline at end of file
pages/tab/mine/mine.js
View file @
9b371a8
...
@@ -99,6 +99,7 @@ Page({
...
@@ -99,6 +99,7 @@ Page({
bussinessId
:
id
,
bussinessId
:
id
,
...
storage
...
storage
}
}
wx
.
$storage
.
set
(
'staff_name'
,
staffName
)
return
USERINFO
return
USERINFO
},
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
...
...
utils/constantData.js
View file @
9b371a8
...
@@ -12,5 +12,6 @@ export const STORAGE_OBJECTkEY = {
...
@@ -12,5 +12,6 @@ export const STORAGE_OBJECTkEY = {
app_title
:
'appTitle'
,
app_title
:
'appTitle'
,
auto_login_object
:
'auto_login_object'
,
auto_login_object
:
'auto_login_object'
,
address_info
:
'address_info'
,
address_info
:
'address_info'
,
srcm_shopmall_merchant_id
:
'srcm_shopmall_merchant_id'
srcm_shopmall_merchant_id
:
'srcm_shopmall_merchant_id'
,
wx_user_info
:
'wx_user_info'
}
}
utils/share.js
View file @
9b371a8
...
@@ -9,18 +9,17 @@
...
@@ -9,18 +9,17 @@
* @param {*} onViewTrack 开启浏览埋点
* @param {*} onViewTrack 开启浏览埋点
* @returns
* @returns
*/
*/
import
{
import
{
taskShareReport
taskShareReport
}
from
'~/api/api.js'
}
from
'~/api/api.js'
// import USERAPI from '~/api/usersApi/index'
// import USERAPI from '~/api/usersApi/index'
class
Share
{
class
Share
{
constructor
()
{
constructor
()
{
console
.
log
(
'---------------- 分享初始化 ----------------'
)
console
.
log
(
'---------------- 分享初始化 ----------------'
)
this
.
initPageProxy
()
this
.
initPageProxy
()
}
}
/**全局注册事件 */
/**全局注册事件 */
initPageProxy
()
{
initPageProxy
()
{
let
thisPage
=
Page
let
thisPage
=
Page
let
_this
=
this
let
_this
=
this
Page
=
function
(
el
)
{
Page
=
function
(
el
)
{
...
@@ -30,10 +29,9 @@ class Share {
...
@@ -30,10 +29,9 @@ class Share {
thisPage
.
apply
(
this
,
arguments
)
thisPage
.
apply
(
this
,
arguments
)
}
}
}
}
}
}
/**设置全局分享 */
/**设置全局分享 */
pageLeaveProxy
(
page
)
{
pageLeaveProxy
(
page
)
{
const
onLoad
=
page
.
onLoad
,
const
onLoad
=
page
.
onLoad
,
that
=
this
that
=
this
if
(
page
.
onShareAppMessage
)
{
if
(
page
.
onShareAppMessage
)
{
...
@@ -85,14 +83,14 @@ class Share {
...
@@ -85,14 +83,14 @@ class Share {
}
}
}
}
}
}
getCommonData
()
{
getCommonData
()
{
const
USERINFO
=
wx
.
$storage
.
get
(
'userInfo'
)
const
USERINFO
=
wx
.
$storage
.
get
(
'userInfo'
)
return
{
return
{
USERINFO
USERINFO
}
}
}
}
setCommonShareQuery
(
query
)
{
setCommonShareQuery
(
query
)
{
const
{
const
{
WXUSERINFO
,
WXUSERINFO
,
USERINFO
USERINFO
...
@@ -100,8 +98,8 @@ class Share {
...
@@ -100,8 +98,8 @@ class Share {
query
=
`
${
query
?
`?
${
query
}
&`
:
'?'
}
merchantId=
${
USERINFO
.
merchantId
}
&shareOpenId=
${
WXUSERINFO
.
openId
}
`
query
=
`
${
query
?
`?
${
query
}
&`
:
'?'
}
merchantId=
${
USERINFO
.
merchantId
}
&shareOpenId=
${
WXUSERINFO
.
openId
}
`
if
(
USERINFO
.
phone
)
query
+=
`&sharePhone=
${
USERINFO
.
phone
}
`
if
(
USERINFO
.
phone
)
query
+=
`&sharePhone=
${
USERINFO
.
phone
}
`
return
query
return
query
}
}
reportShareData
(
shareTrackData
)
{
reportShareData
(
shareTrackData
)
{
const
{
const
{
USERINFO
USERINFO
}
=
this
.
getCommonData
(),
}
=
this
.
getCommonData
(),
...
@@ -118,6 +116,6 @@ class Share {
...
@@ -118,6 +116,6 @@ class Share {
}
}
let
jsonList
=
JSON
.
stringify
(
data
)
let
jsonList
=
JSON
.
stringify
(
data
)
taskShareReport
({
jsonList
})
taskShareReport
({
jsonList
})
}
}
}
}
new
Share
()
new
Share
()
\ No newline at end of file
\ No newline at end of file
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