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 e74906d7
authored
Nov 10, 2022
by
zhangquan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交注册
1 parent
1b0bddfc
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
93 additions
and
26 deletions
pages/authentication/login/login.js
pages/authentication/register/register.js
pages/authentication/registerInfo/registerInfo.js
pages/authentication/registerInfo/registerInfo.scss
pages/authentication/registerInfo/registerInfo.wxml
pages/checkProduct/checkProduct.js
pages/tab/discovery/components/product/product.wxml
pages/authentication/login/login.js
View file @
e74906d
...
@@ -226,6 +226,9 @@ Page({
...
@@ -226,6 +226,9 @@ Page({
wxLogin
({
wxLogin
({
detail
detail
})
{
})
{
if
(
!
detail
?.
code
)
{
return
wx
.
$api
.
showToast
(
'当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
)
}
if
(
!
detail
.
code
||
this
.
data
.
showLoading
)
return
if
(
!
detail
.
code
||
this
.
data
.
showLoading
)
return
// this.setShowLoading(true)
// this.setShowLoading(true)
wx
.
showLoading
()
wx
.
showLoading
()
...
...
pages/authentication/register/register.js
View file @
e74906d
...
@@ -58,42 +58,89 @@ Page({
...
@@ -58,42 +58,89 @@ Page({
toRegister
({
toRegister
({
detail
detail
})
{
})
{
if
(
!
detail
.
code
)
return
if
(
!
detail
?.
code
)
{
let
params
=
{
return
wx
.
$api
.
showToast
(
'当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
)
detail
,
...
this
.
data
.
linkParams
}
}
let
autoParam
=
{...
detail
}
delete
autoParam
.
code
delete
autoParam
.
cloudID
wx
.
showLoading
()
USERAPI
.
authUserPhone
(
autoParam
,
this
.
loginToken
).
then
(({
code
,
data
,
message
,
errId
})
=>
{
if
(
code
==
'0'
||
errId
==
'30990103'
){
let
{
loginUserInfoList
}
=
data
let
target
=
null
if
(
code
==
'0'
&&
loginUserInfoList
?.
length
){
target
=
loginUserInfoList
.
find
(
item
=>
item
.
merchantId
==
this
.
data
.
linkParams
.
merchantId
)
}
if
(
target
&&
target
.
department
){
this
.
register
(
detail
)
}
else
{
this
.
isTypeEmpty
(
detail
)
}
}
else
if
(
errId
==
'200122'
){
wx
.
hideLoading
()
this
.
init
(
2
)
}
else
{
wx
.
hideLoading
()
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
}
}).
catch
(({
errMsg
})
=>
{
wx
.
hideLoading
()
wx
.
$api
.
showToast
(
errMsg
||
'系统异常'
)
})
},
isTypeEmpty
(
detail
){
if
(
this
.
data
.
linkParams
.
type
==
1
){
if
(
this
.
data
.
linkParams
.
type
==
1
){
wx
.
$router
.
go
(
'/pages/authentication/registerInfo/registerInfo'
,
params
)
wx
.
hideLoading
()
wx
.
$router
.
go
(
'/pages/authentication/registerInfo/registerInfo'
,{
detail
,
...
this
.
data
.
linkParams
})
}
else
{
}
else
{
let
randomName
=
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
(
1
)
*
10000
)
this
.
register
(
detail
)
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
){
register
(
detail
){
USERAPI
.
register
(
params
).
then
((
res
)
=>
{
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
}
wx
.
showLoading
()
USERAPI
.
register
(
regParmas
).
then
((
res
)
=>
{
console
.
log
(
res
,
'errId'
)
console
.
log
(
res
,
'errId'
)
if
(
res
.
code
==
'0'
){
if
(
res
.
code
==
'0'
){
this
.
toLogin
(
detail
)
this
.
toLogin
(
detail
)
}
else
if
(
res
.
errId
==
'200122'
){
}
else
if
(
res
.
errId
==
'200122'
){
wx
.
hideLoading
()
this
.
init
(
2
)
this
.
init
(
2
)
}
else
{
}
else
{
wx
.
hideLoading
()
wx
.
$api
.
showToast
(
res
.
message
||
'系统异常'
)
wx
.
$api
.
showToast
(
res
.
message
||
'系统异常'
)
}
}
}).
catch
(({
errMsg
})
=>
{
wx
.
hideLoading
()
wx
.
$api
.
showToast
(
errMsg
||
'系统异常'
)
})
})
},
},
toLogin
(
detail
){
toLogin
(
detail
){
wx
.
showLoading
()
USERAPI
.
authUserPhone
(
detail
,
this
.
loginToken
).
then
(({
USERAPI
.
authUserPhone
(
detail
,
this
.
loginToken
).
then
(({
code
,
code
,
data
,
data
,
...
@@ -103,14 +150,16 @@ Page({
...
@@ -103,14 +150,16 @@ Page({
if
(
code
==
'0'
){
if
(
code
==
'0'
){
this
.
checkLoginUserInfo
(
data
)
this
.
checkLoginUserInfo
(
data
)
}
else
if
(
errId
==
'200122'
){
}
else
if
(
errId
==
'200122'
){
wx
.
hideLoading
()
this
.
init
(
1
)
this
.
init
(
1
)
}
else
{
}
else
{
wx
.
hideLoading
()
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
}
}
}).
catch
(({
}).
catch
(({
errMsg
errMsg
})
=>
{
})
=>
{
this
.
setShowLoading
(
false
)
wx
.
hideLoading
(
)
wx
.
$api
.
showToast
(
'系统异常'
)
wx
.
$api
.
showToast
(
'系统异常'
)
})
})
},
},
...
...
pages/authentication/registerInfo/registerInfo.js
View file @
e74906d
...
@@ -111,18 +111,26 @@ Page({
...
@@ -111,18 +111,26 @@ Page({
weChatNickName
:
merchantFileRequest
.
fileName
,
weChatNickName
:
merchantFileRequest
.
fileName
,
weChatAvatarUrl
:
merchantFileRequest
.
fileUrl
weChatAvatarUrl
:
merchantFileRequest
.
fileUrl
}
}
wx
.
showLoading
()
USERAPI
.
register
(
params
).
then
((
res
)
=>
{
USERAPI
.
register
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
==
'0'
){
if
(
res
.
code
==
'0'
){
this
.
toLogin
()
this
.
toLogin
()
}
else
if
(
res
.
errId
==
'200122'
){
}
else
if
(
res
.
errId
==
'200122'
){
wx
.
hideLoading
()
this
.
init
(
2
)
this
.
init
(
2
)
}
else
{
}
else
{
wx
.
hideLoading
()
wx
.
$api
.
showToast
(
res
.
message
||
'系统异常'
)
wx
.
$api
.
showToast
(
res
.
message
||
'系统异常'
)
}
}
}).
catch
(({
errMsg
})
=>
{
wx
.
hideLoading
()
wx
.
$api
.
showToast
(
errMsg
||
'系统异常'
)
})
})
//
},
},
toLogin
(){
toLogin
(){
wx
.
showLoading
()
USERAPI
.
authUserPhone
(
this
.
data
.
dataFromOptions
.
detail
,
this
.
loginToken
).
then
(({
USERAPI
.
authUserPhone
(
this
.
data
.
dataFromOptions
.
detail
,
this
.
loginToken
).
then
(({
code
,
code
,
data
,
data
,
...
@@ -132,15 +140,17 @@ Page({
...
@@ -132,15 +140,17 @@ Page({
if
(
code
==
'0'
){
if
(
code
==
'0'
){
this
.
checkLoginUserInfo
(
data
)
this
.
checkLoginUserInfo
(
data
)
}
else
if
(
errId
==
'200122'
){
}
else
if
(
errId
==
'200122'
){
wx
.
hideLoading
()
this
.
init
(
1
)
this
.
init
(
1
)
}
else
{
}
else
{
wx
.
hideLoading
()
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
}
}
}).
catch
(({
}).
catch
(({
errMsg
errMsg
})
=>
{
})
=>
{
this
.
setShowLoading
(
false
)
wx
.
hideLoading
(
)
wx
.
$api
.
showToast
(
'系统异常'
)
wx
.
$api
.
showToast
(
errMsg
||
'系统异常'
)
})
})
},
},
checkLoginUserInfo
({
checkLoginUserInfo
({
...
...
pages/authentication/registerInfo/registerInfo.scss
View file @
e74906d
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
}
}
.placeholder
{
.placeholder
{
margin-top
:
2rpx
;
margin-top
:
2rpx
;
color
:
#999999
;
}
}
.depart-name
,
input
{
.depart-name
,
input
{
display
:
inline-block
;
display
:
inline-block
;
...
...
pages/authentication/registerInfo/registerInfo.wxml
View file @
e74906d
...
@@ -8,7 +8,8 @@
...
@@ -8,7 +8,8 @@
</view>
</view>
<view class="info-item" bindtap="selectDepartment">
<view class="info-item" bindtap="selectDepartment">
<text class="label">部门</text>
<text class="label">部门</text>
<text class="depart-name">{{department.name}}</text>
<text wx:if="{{department.id}}" class="depart-name">{{department.name}}</text>
<text wx:else style="color:#999999;" class="depart-name">请选择部门</text>
<image class="right-arrow" src="{{IMGURL}}right_arrow_grey_icon.png"></image>
<image class="right-arrow" src="{{IMGURL}}right_arrow_grey_icon.png"></image>
</view>
</view>
</view>
</view>
...
...
pages/checkProduct/checkProduct.js
View file @
e74906d
...
@@ -233,6 +233,9 @@ Page({
...
@@ -233,6 +233,9 @@ Page({
});
});
},
},
authSuccess
(){
authSuccess
(){
this
.
setData
({
showAuth
:
false
})
this
.
createImg
()
this
.
createImg
()
},
},
toSetting
(){
toSetting
(){
...
...
pages/tab/discovery/components/product/product.wxml
View file @
e74906d
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
<view class="project-img">
<view class="project-img">
<block wx:for="{{tab}}" wx:key="index">
<block wx:for="{{tab}}" wx:key="index">
<view id="to-{{index}}" class="img-item img-item{{actNum+1}}{{index+1}}">
<view id="to-{{index}}" class="img-item img-item{{actNum+1}}{{index+1}}">
<image webp class="img-item{{actNum+1}}{{index+1}}" src="{{IMGURL}}scene/scene{{actNum+1}}{{index+1}}.png?v={{img_version}}" />
<image
lazy-load="{{true}}"
webp class="img-item{{actNum+1}}{{index+1}}" src="{{IMGURL}}scene/scene{{actNum+1}}{{index+1}}.png?v={{img_version}}" />
<view class="video-bg" wx:if="{{index==5 && senceData[actNum].videoList.length}}">
<view class="video-bg" wx:if="{{index==5 && senceData[actNum].videoList.length}}">
<view class="video-list">
<view class="video-list">
<block wx:for="{{senceData[actNum].videoList}}" wx:key="i">
<block wx:for="{{senceData[actNum].videoList}}" wx:key="i">
...
...
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