Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
aa1f8ba7
Commit
aa1f8ba7
authored
Jul 08, 2020
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
抖音兼容
parent
654db285
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
3 deletions
+51
-3
src/App.vue
+7
-1
src/api/order.js
+9
-0
src/api/wxPay.js
+3
-0
src/pages/login/index.vue
+32
-2
No files found.
src/App.vue
View file @
aa1f8ba7
...
...
@@ -2,9 +2,15 @@
export
default
{
created
()
{
// NODE_ENV
let
extConfig
=
wx
.
getExtConfigSync
?
wx
.
getExtConfigSync
():
{}
let
extConfig
=
{};
if
(
process
.
env
.
NODE_ENV
==
"development"
)
{
extConfig
=
{
mixid
:
'antgood'
}
}
else
{
if
(
MINI_ENV
==
'tt'
){
extConfig
=
{
mixid
:
'ant'
}
}
else
{
extConfig
=
wx
.
getExtConfigSync
?
wx
.
getExtConfigSync
():
{}
}
}
this
.
$store
.
commit
(
"setExtConfig"
,
extConfig
.
mixid
);
...
...
src/api/order.js
0 → 100644
View file @
aa1f8ba7
import
{
requestPOST
,
requestGET
}
from
"@/utils/request.js"
;
// wx
export
default
{
//登录
orderDetail
(
options
)
{
return
requestGET
(
`
${
process
.
env
.
OLSHOP_URL
}
/order/detail`
,
options
);
}
};
src/api/wxPay.js
View file @
aa1f8ba7
...
...
@@ -4,6 +4,9 @@ export default {
to_wx_pay
(
options
)
{
return
requestPOST1
(
`
${
process
.
env
.
OLSHOP_URL
}
/pay/to_wx_pay`
,
options
);
},
to_tt_pay
(
options
)
{
return
requestPOST1
(
`
${
process
.
env
.
OLSHOP_URL
}
/pay/to_tt_pay`
,
options
);
},
cancelPayment
(
options
)
{
return
requestPOST1
(
`
${
process
.
env
.
OLSHOP_URL
}
/pay/payment_cancel?orderSn=
${
options
}
`
...
...
src/pages/login/index.vue
View file @
aa1f8ba7
...
...
@@ -5,6 +5,7 @@
<p
class=
"shopName"
v-if=
"shopName"
>
{{
shopName
}}
</p>
<div
class=
"btn_info"
>
<button
class=
"btn"
lang=
"zh_CN"
open-type=
"getUserInfo"
@
getuserinfo=
"getUserInfo"
@
click=
"clickLogin"
>
一键登录
</button>
<!--
<div
class=
"codeLogin"
>
短信验证码登录
</div>
-->
</div>
<!--
<div>
{{
testd
}}
</div>
...
...
@@ -17,7 +18,7 @@
<div
class=
"btn_info1"
>
<h1>
绑定手机号
</h1>
<span
class=
"hint"
>
检测到您的账号还未绑定手机号,请绑定手机号
</span>
<button
class=
"btn"
open-type=
"getPhoneNumber"
@
getphonenumber=
"getPhoneNumber"
>
绑定手机号一键绑定
</button>
<button
class=
"btn"
open-type=
"getPhoneNumber"
@
getphonenumber=
"getPhoneNumber"
v-if=
"!isTT"
>
绑定手机号一键绑定
</button>
<div
class=
"btn2"
@
click=
"handbindHandle"
>
手动绑定手机号
</div>
</div>
<div
class=
"layer"
@
click=
"isShowPhone=false"
></div>
...
...
@@ -64,6 +65,11 @@ export default {
test_isHaveUnion
:
""
,
test_unionId
:
""
,
fromType
:
''
,
//来源类型 mini:小程序跳转到当前登录页
ttData
:{
iv
:
""
,
encryptedData
:
""
,
},
isTT
:
MINI_ENV
==
'tt'
,
};
},
created
()
{},
...
...
@@ -238,6 +244,9 @@ export default {
e
.
target
=
{
rawData
:
e
.
rawData
};
this
.
ttData
.
iv
=
e
.
mp
.
detail
.
iv
;
this
.
ttData
.
encryptedData
=
e
.
mp
.
detail
.
encryptedData
;
console
.
log
(
this
.
ttData
,
'------------------------247'
)
}
console
.
log
(
e
,
e
.
mp
,
e
.
target
.
rawData
,
'-----------------------229'
)
if
(
this
.
isHaveUnion
)
{
...
...
@@ -271,7 +280,10 @@ export default {
this
.
userInfo
=
JSON
.
parse
(
e
.
target
.
rawData
);
console
.
log
(
this
.
userInfo
,
"this.userInfo"
);
this
.
$store
.
commit
(
'setUserInfo'
,
this
.
userInfo
)
// if(MINI_ENV=='tt'){
// this.bindUser();
// return;
// }
if
(
this
.
unionId
)
{
login
.
checkUnionid
({
unionId
:
this
.
unionId
,
openId
:
this
.
openid
},
MINI_ENV
)
...
...
@@ -378,6 +390,11 @@ export default {
city
:
this
.
userInfo
.
city
,
otherPhone
:
0
};
if
(
MINI_ENV
==
'tt'
){
query
.
iv
=
this
.
ttData
.
iv
;
query
.
encryptedData
=
this
.
ttData
.
encryptedData
;
query
.
sessionKey
=
this
.
session_key
;
}
if
(
this
.
$store
.
state
.
spokesmanGroupId
!=
""
)
{
query
.
spokesmanRelId
=
this
.
$store
.
state
.
spokesmanRelId
;
query
.
spokesmanGroupId
=
this
.
$store
.
state
.
spokesmanGroupId
;
...
...
@@ -388,6 +405,7 @@ export default {
login
.
bindUser
(
query
,
MINI_ENV
)
.
then
(
res
=>
{
wx
.
hideLoading
();
//绑定成功
if
(
res
.
data
.
code
==
200
)
{
this
.
NEED_CERTIFIED
=
res
.
data
.
data
.
NEED_CERTIFIED
;
...
...
@@ -405,6 +423,8 @@ export default {
// this.backPath
// }¶ms=${encodeURIComponent(this.backParams)}`
// });
}
else
{
wx
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
"none"
});
}
})
.
catch
(
err
=>
{
...
...
@@ -482,6 +502,16 @@ export default {
width
:
200px
;
border-radius
:
5px
;
}
.codeLogin
{
background-color
:
#e5e5e5
;
color
:
#fff
;
height
:
45px
;
width
:
200px
;
border-radius
:
5px
;
text-align
:
center
;
line-height
:
45px
;
margin-top
:
20px
;
}
}
.enterpriseLogin
{
position
:
absolute
;
...
...
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