Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mini_own
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
geruidan
mini_own
Commits
3b7064b1
Commit
3b7064b1
authored
Mar 24, 2023
by
小耗子
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商城修改
parent
c9dd295e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
48 deletions
+54
-48
manifest.json
manifest.json
+1
-1
pages/h5/index.vue
pages/h5/index.vue
+1
-1
pages/h5/pay.vue
pages/h5/pay.vue
+3
-0
pages/index/defalutScreen.vue
pages/index/defalutScreen.vue
+8
-25
shopro/store/modules/user.js
shopro/store/modules/user.js
+41
-21
No files found.
manifest.json
View file @
3b7064b1
...
...
@@ -54,7 +54,7 @@
"quickapp"
:
{},
/*
小程序特有相关
*/
"mp-weixin"
:
{
"appid"
:
"wx
60c6530c49c52ff7
"
,
"appid"
:
"wx
91fa336def077983
"
,
"setting"
:
{
"urlCheck"
:
false
,
"minified"
:
true
...
...
pages/h5/index.vue
View file @
3b7064b1
...
...
@@ -28,7 +28,7 @@
if
(
!
res
.
code
&&
res
.
data
)
{
let
code
=
res
.
data
.
sfCode
;
let
time
=
new
Date
().
getTime
();
this
.
webUrl
=
`https://wxcs.zhonghuihaotai.com/webpage/wxdist/index.html#/
${
this
.
appointPage
?
this
.
appointPage
:
""
}
?mallId=1
06975910000477&companyId=999999998
&time=
${
time
}
&sfCode=
${
code
}
&authMode=force`
this
.
webUrl
=
`https://wxcs.zhonghuihaotai.com/webpage/wxdist/index.html#/
${
this
.
appointPage
?
this
.
appointPage
:
""
}
?mallId=1
19583623123146&companyId=625
&time=
${
time
}
&sfCode=
${
code
}
&authMode=force`
// this.webUrl = `https://wxcs.zhonghuihaotai.com/webpage/wxdist/index.html#/?mallId=106975910000477&companyId=999999998&time=${time}&sfCode=${code}`
console
.
log
(
this
.
webUrl
)
}
...
...
pages/h5/pay.vue
View file @
3b7064b1
...
...
@@ -84,6 +84,9 @@
this
.
actuallyPay
=
actuallyPay
;
this
.
orderId
=
orderId
;
this
.
params
=
JSON
.
parse
(
decodeURIComponent
(
data
));
},
onLaunch
(){
console
.
log
(
"
关闭
"
)
}
}
...
...
pages/index/defalutScreen.vue
View file @
3b7064b1
...
...
@@ -26,7 +26,7 @@
...
mapGetters
([
'
userInfo
'
,
'
todayNum
'
])
},
methods
:
{
...
mapActions
([
'
getPhoneNumber
'
,
'
registerInfoFn
'
,
'
getWeRunDataFn
'
,
'
authCheck
'
,
'
getUserInfo
'
]),
...
mapActions
([
'
getPhoneNumber
'
,
'
registerInfoFn
'
,
'
authCheck
'
,
'
getUserInfo
'
]),
// 切换底部tab;
changeTabBar
()
{
if
(
this
.
unregistered
)
{
...
...
@@ -45,11 +45,12 @@
},
async
authAndWeRun
()
{
let
auth
=
await
this
.
authCheck
();
console
.
log
(
"
调用authcheck的值
"
+
auth
)
let
that
=
this
;
if
(
auth
==
0
)
{
this
.
unregistered
=
true
;
}
else
if
(
auth
==
2001
)
{
this
.
getUserInfo
();
this
.
unregistered
=
false
;
that
.
unregistered
=
true
;
}
else
if
(
auth
==
2001
)
{
that
.
unregistered
=
false
;
}
},
async
loginSession
()
{
...
...
@@ -69,6 +70,7 @@
*/
if
(
this
.
checkSessionStatus
&&
token
)
{
let
token
=
uni
.
getStorageSync
(
'
token
'
);
console
.
log
(
"
token的值====================
"
+
token
)
this
.
authAndWeRun
();
}
else
{
// session 不存在,调用login。userInfo 。更新session
...
...
@@ -76,13 +78,11 @@
success
:
function
(
info
)
{
//调用code
console
.
log
(
"
code000000000000000000000000==========
"
,
info
.
code
)
that
.
$store
.
commit
(
'
wxCode
'
,
info
.
code
);
//按钮切换全选。
let
userInfo
=
that
.
getUserInfo
();
let
userInfo
=
that
.
getUserInfo
(
info
.
code
);
userInfo
.
then
(
res
=>
{
that
.
authCheck
().
then
(
checkCode
=>
{
if
(
checkCode
==
0
)
{
that
.
unregistered
=
true
;
}
else
if
(
checkCode
==
2001
)
{
that
.
unregistered
=
false
;
}
})
})
...
...
@@ -95,7 +95,6 @@
let
that
=
this
;
uni
.
checkSession
({
//校验session
success
(
res
)
{
//有效
console
.
log
(
"
有效session
"
)
if
(
res
.
errMsg
===
"
checkSession:ok
"
)
{
that
.
checkSessionStatus
=
true
;
// 如果有缓存信息
...
...
@@ -110,22 +109,6 @@
})
}
// async getAuth(){
// let token = uni.getStorageSync('token');
// // 如果有缓存信息
// if (token) {
// let auth = await this.authCheck();
// if(auth == 0) {
// this.unregistered = true;
// }else if(auth == 2001){
// this.unregistered = false;
// }
// } else {
// let getUserInfo = await this.getUserInfo();
// }
// }
},
onHide
()
{},
onShow
()
{
...
...
shopro/store/modules/user.js
View file @
3b7064b1
...
...
@@ -2,22 +2,16 @@
import
http
from
'
@/shopro/request/index
'
import
api
from
"
@/shopro/request/index
"
;
const
state
=
{
mallId
:
'
1
06975910000477
'
,
mallId
:
'
1
19583623123146
'
,
sessionkey
:
uni
.
getStorageSync
(
"
sessionkey
"
)
||
""
,
userInfo
:
{},
registerInfo
:
{
//注册信息
companyId
:
'
999999998
'
,
//开放式传
companyId
:
'
625
'
,
//开放式传
mobile
:
''
,
//封闭式传
empcardno
:
''
,
//封闭式传
registerType
:
'
register
'
//注册时的类型为普通注册
},
wxCode
:
''
,
// weRunData:{//今日步数
// todayNum: 0,
// totalNum: 0,
// updateDate: "",
// yesterdayNum: 0
// },
todayNum
:
0
,
sessionStatus
:
false
}
...
...
@@ -27,7 +21,8 @@ const getters = {
userInfo
:
state
=>
state
.
userInfo
,
todayNum
:
state
=>
state
.
todayNum
,
wxCode
:
state
=>
state
.
wxCode
,
sessionStatus
:
state
=>
state
.
sessionStatus
sessionStatus
:
state
=>
state
.
sessionStatus
,
mallId
:
state
=>
state
.
mallId
}
const
actions
=
{
...
...
@@ -41,12 +36,13 @@ const actions = {
state
},
code
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
mallId
=
'
106975910000477
'
uni
.
setStorageSync
(
"
mallId
"
,
mallId
)
let
code
=
state
.
wxCode
;
uni
.
setStorageSync
(
"
mallId
"
,
state
.
mallId
);
// console.log(state.wxCode)
// let code = state.wxCode;
http
(
'
user.getHomePage
'
,
{
code
:
code
,
mallId
:
mallId
mallId
:
state
.
mallId
}).
then
(
res
=>
{
if
(
!
res
.
code
)
{
let
{
sessionKey
}
=
res
.
data
;
...
...
@@ -75,13 +71,26 @@ const actions = {
api
(
"
user.authCheck
"
,
{
mallId
:
mallId
}).
then
(
res
=>
{
console
.
log
(
"
authcheck状态码=========================
"
)
console
.
log
(
res
)
let
data
=
res
.
data
;
if
(
res
.
code
===
0
)
{
resolve
(
res
.
code
)
}
else
if
(
res
.
code
==
1001
)
{
reject
(
res
.
code
)
}
else
if
(
res
.
code
==
2001
)
{
uni
.
login
({
success
:
function
(
info
)
{
//调用code
state
.
wxCode
==
info
.
code
;
dispatch
(
'
getUserInfo
'
,
info
.
code
);
}
})
resolve
(
res
.
code
);
}
else
{
reject
(
res
.
code
)
uni
.
showToast
({
title
:
res
.
msg
,
duration
:
2000
,
icon
:
'
none
'
});
resolve
(
res
.
code
)
}
});
})
...
...
@@ -140,12 +149,22 @@ const actions = {
// 查询步数
getWeRunDataFn
({
state
}){
return
new
Promise
((
resolve
,
reject
)
=>
{
let
wRunEncryptedData
=
{}
// let wRunEncryptedData = {}
let
data
=
""
wx
.
getWeRunData
({
success
:
function
(
res
)
{
wRunEncryptedData
.
encryptedData
=
encodeURIComponent
(
res
.
encryptedData
);
wRunEncryptedData
.
iv
=
encodeURIComponent
(
res
.
iv
);
http
(
'
user.wxRun
'
,
wRunEncryptedData
).
then
(
res
=>
{
let
obj
=
{
encryptedData
:
res
.
encryptedData
,
iv
:
res
.
iv
,
sessionKey
:
uni
.
getStorageSync
(
"
sessionKey
"
)
}
data
=
JSON
.
stringify
(
obj
)
// wRunEncryptedData.encryptedData = encodeURIComponent(res.encryptedData);
// wRunEncryptedData.iv = encodeURIComponent(res.iv);
// wRunEncryptedData.sessionKey = encodeURIComponent(uni.getStorageSync("sessionKey") );
http
(
'
user.wxRun
'
,
{
data
:
data
}).
then
(
res
=>
{
console
.
log
(
"
微信步数++=========================
"
)
console
.
log
(
res
)
if
(
!
res
.
code
&&
res
.
data
)
{
state
.
todayNum
=
res
.
data
.
todayNum
;
resolve
(
res
.
data
);
...
...
@@ -163,7 +182,7 @@ const actions = {
fail
:
function
(
err
){
console
.
log
(
err
)
uni
.
showToast
({
title
:
"
您未
开通微信运动,请关注微信运动公众号后重试
"
,
title
:
"
您未
授权微信步数,请点击右上角...进去设置开启授权
"
,
duration
:
2000
,
icon
:
'
none
'
});
...
...
@@ -183,6 +202,7 @@ const mutations = {
wxCode
(
state
,
code
)
{
state
.
wxCode
=
code
;
}
}
export
default
{
state
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment