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 b1110cf7
authored
Oct 22, 2022
by
zhangquan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
第一轮bug修复
1 parent
58baece7
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
188 additions
and
93 deletions
api/api.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
api/api.js
View file @
b1110cf
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:申请活动)
...
...
pages/authentication/accountItems/accountItems.json
View file @
b1110cf
{
{
"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 @
b1110cf
...
@@ -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 @
b1110cf
...
@@ -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 @
b1110cf
...
@@ -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 @
b1110cf
...
@@ -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 @
b1110cf
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,66 +55,75 @@ Page({
...
@@ -51,66 +55,75 @@ 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
=
{
detail
,
...
this
.
data
.
linkParams
}
if
(
this
.
data
.
linkParams
.
type
==
1
){
wx
.
$router
.
go
(
'/pages/authentication/registerInfo/registerInfo'
,
params
)
}
else
{
let
randomName
=
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
(
1
)
*
10000
)
let
{
merchantFileRequest
,
merchantId
}
=
this
.
data
.
linkParams
let
regParmas
=
{
merchantId
,
loginToken
:
this
.
loginToken
,
encryptedData
:
detail
.
encryptedData
,
iv
:
detail
.
iv
,
merchantFileRequest
:
JSON
.
stringify
(
merchantFileRequest
),
staffName
:
merchantFileRequest
.
fileName
||
randomName
,
weChatNickName
:
merchantFileRequest
.
fileName
,
weChatAvatarUrl
:
merchantFileRequest
.
fileUrl
}
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
(({
USERAPI
.
authUserPhone
(
detail
,
this
.
loginToken
).
then
(({
code
,
code
,
data
,
data
,
message
,
message
,
errId
errId
})
=>
{
})
=>
{
wx
.
hideLoading
()
if
(
code
==
'0'
){
if
(
code
==
'0'
||
errId
==
'30990103'
){
this
.
checkLoginUserInfo
(
data
)
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
){
wx
.
$router
.
go
(
'/pages/authentication/registerInfo/registerInfo'
,
params
)
}
else
{
let
randomName
=
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
(
1
)
*
10000
)
let
{
merchantFileRequest
,
merchantId
}
=
this
.
data
.
linkParams
let
regParmas
=
{
merchantId
,
loginToken
:
this
.
loginToken
,
encryptedData
:
detail
.
encryptedData
,
iv
:
detail
.
iv
,
merchantFileRequest
:
JSON
.
stringify
(
merchantFileRequest
),
staffName
:
merchantFileRequest
.
fileName
||
randomName
,
weChatNickName
:
merchantFileRequest
.
fileName
,
weChatAvatarUrl
:
merchantFileRequest
.
fileUrl
}
this
.
register
(
regParmas
)
}
}
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 @
b1110cf
// 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
({
/**
/**
...
@@ -111,13 +115,49 @@ Page({
...
@@ -111,13 +115,49 @@ Page({
console
.
log
(
params
,
'ddd'
)
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
})
{
/**多个账号 */
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
})
},
inputStaffNamme
(
e
){
inputStaffNamme
(
e
){
const
{
value
}
=
e
.
detail
const
{
value
}
=
e
.
detail
this
.
setData
({
this
.
setData
({
...
...
pages/checkProduct/checkProduct.js
View file @
b1110cf
...
@@ -3,6 +3,9 @@ import { senceData } from "~/pages/tab/discovery/constant/data";
...
@@ -3,6 +3,9 @@ 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
ActivityApi
from
'~/api/activityApi/index'
import
{
commonApi
}
from
'~/api/api.js'
const
IMGURL
=
IMG_URL
const
IMGURL
=
IMG_URL
Page
({
Page
({
/**
/**
...
@@ -28,31 +31,8 @@ Page({
...
@@ -28,31 +31,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 +56,15 @@ Page({
...
@@ -76,6 +56,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 +80,17 @@ Page({
...
@@ -91,9 +80,17 @@ 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
=>
{
console
.
log
(
response
,
'responseresponse'
)
let
qrcode
=
response
?.
data
this
.
setData
({
this
.
setData
({
imgH
:
(
imgH
/
imgW
)
*
450
imgH
:
(
imgH
/
imgW
)
*
450
})
})
...
@@ -106,13 +103,13 @@ Page({
...
@@ -106,13 +103,13 @@ 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
,
...
@@ -123,7 +120,7 @@ Page({
...
@@ -123,7 +120,7 @@ Page({
});
});
wx
.
hideLoading
()
wx
.
hideLoading
()
})
})
//
})
})
}
}
})
})
}
}
...
@@ -172,15 +169,30 @@ Page({
...
@@ -172,15 +169,30 @@ Page({
},
},
onRoute
(
options
)
{
onRoute
(
options
)
{
wx
.
nextTick
(()
=>
{
wx
.
nextTick
(()
=>
{
let
{
actNum
,
activeNavIdx
,
fromLocal
}
=
this
.
options
this
.
shareQuery
=
`actNum=
${
actNum
}
&activeNavIdx=
${
activeNavIdx
}
`
console
.
log
(
" this.options: "
,
this
.
options
);
console
.
log
(
" this.options: "
,
this
.
options
);
this
.
setData
({
let
{
actNum
,
activeNavIdx
,
scene
}
=
this
.
options
actNum
,
this
.
shareTitle
=
senceData
[
actNum
].
productList
[
activeNavIdx
].
proName
activeNavIdx
,
this
.
shareQuery
=
`actNum=
${
actNum
}
&activeNavIdx=
${
activeNavIdx
}
`
fromLocal
if
(
scene
){
})
let
qrcodeQuery
=
decodeURIComponent
(
scene
)
this
.
createImg
()
let
id
=
qrcodeQuery
.
split
(
'='
).
pop
()
let
paramsObj
=
{}
if
(
id
){
commonApi
.
getQrcodeParams
({
id
}).
then
(
res
=>
{
console
.
log
(
res
?.
data
?.
scene
,
'responseresponse12233'
)
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
)
}
})
})
},
},
...
...
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