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
e78a7208
Commit
e78a7208
authored
Apr 29, 2021
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
多主题方法
parent
69298c57
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
16 deletions
+66
-16
src/api/daoke.js
+25
-0
src/api/index.js
+17
-0
src/main.js
+14
-4
src/utils/mayi.js
+10
-12
src/utils/themeModule.js
+0
-0
No files found.
src/api/daoke.js
0 → 100644
View file @
e78a7208
import
indexApi
from
"@/api/index"
;
export
function
getBcakUrlApi
(
data
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
data
.
fromAppid
=
'VsEOuDJqBnGNyXZJWCQS'
indexApi
.
getSsoCallbackUrl
(
data
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
resolve
(
res
.
data
.
data
);
}
});
})
}
export
function
createdUserJWTApi
(
data
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
indexApi
.
createdUserJWT
().
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
resolve
(
res
.
data
.
data
);
}
});
})
}
src/api/index.js
View file @
e78a7208
...
...
@@ -33,6 +33,22 @@ console.log(process.env,'-----------------config------')
},
get_multi_merchant_by_tags
(
data
){
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/shop/get_multi_merchant_by_tags`
,
data
)
},
getSsoCallbackUrl
(
data
)
{
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/common/getSsoCallbackUrl`
,
{
data
}
);
},
// 动态表单获取token 信息
createdUserJWT
(
data
)
{
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/user/createUserJWT`
,
{
data
}
);
}
}
\ No newline at end of file
src/main.js
View file @
e78a7208
...
...
@@ -6,6 +6,7 @@ import goodsApi from "./api/goods"
import
orderApi
from
"./api/order"
import
promoteApi
from
"./api/promote"
;
import
indexApi
from
'./api/index'
import
{
createdUserJWTApi
,
getBcakUrlApi
}
from
"./api/daoke"
;
import
cartApi
from
'./api/cart'
import
classificationApi
from
"./api/classification"
;
import
spokesmanApi
from
'./api/spokesman'
...
...
@@ -17,7 +18,7 @@ import {
getCoupon
,
themeMemberCardClick
}
from
"@/utils/mayi"
;
import
{
themeToLinkInit
}
from
"@/utils/themeModule"
;
import
"@/utils/themeModule"
;
import
shop
from
"./api/shop"
;
import
spokesman
from
"@/api/spokesman"
;
...
...
@@ -37,12 +38,11 @@ Vue.prototype.$mpAnalytics = mpAnalytics;
const
app
=
new
Vue
(
App
)
app
.
$mount
()
// 初始化
themeToLinkInit
({
homeNative
:
2
,
getCoupon
,
themeMemberCardClick
});
// glob挂载到
let
mpApp
=
getApp
();
Vue
.
prototype
.
mpApp
=
mpApp
// 初始化
mpApp
.
fenxiaoModel
=
new
fenxiaoModel
({
query_login_spoken
:
spokesman
.
query_login_spoken
,
becomepokesmanCustomer
:
spokesman
.
becomepokesmanCustomer
,
...
...
@@ -55,7 +55,17 @@ mpApp.fenxiaoModel = new fenxiaoModel({
oneClickShopQuickCopy
:
spokesman
.
oneClickShopQuickCopy
,
apply_for_withdraw
:
spokesman
.
apply_for_withdraw
});
// 多主题方法初始化
global
.
themeToLinkInit
({
homeNative
:
2
,
wx
,
getCoupon
,
themeMemberCardClick
,
requireFun
:
{
createdUserJWT
:
createdUserJWTApi
,
getBcakUrl
:
getBcakUrlApi
}
});
// 数据异步回调函数
// 商城
mpApp
.
shopCallBack
=
function
()
{
}
...
...
src/utils/mayi.js
View file @
e78a7208
...
...
@@ -156,6 +156,7 @@ export function $themeAddToCard(item, callback) {
}
function
toPage
(
backPath
,
backParams
=
""
)
{
console
.
log
(
backPath
,
backParams
,
'--------------------------159'
);
wx
.
navigateTo
({
url
:
`../index/main?from=themeLink&backpath=
${
encodeURIComponent
(
backPath
)}
¶ms=
${
encodeURIComponent
(
backParams
)}
`
});
...
...
@@ -299,9 +300,9 @@ export function themeMemberCardClick (item) {
});
}
else
{
if
(
res
.
data
.
msg
==
"不能重复领卡"
)
{
let
query
=
{
cardId
:
cardData
.
id
,
userTel
:
userInfo
.
mobilephone
};
let
url
=
`../index/main?from=themeLink&backpath=
${
encodeURIComponent
(
"/personalCenter/membershipCard"
)}
¶ms=
${
encodeURIComponent
(
query
)
}
`
;
wx
.
navigateTo
({
url
}
);
console
.
log
(
"---------------------------to-----1"
)
let
backParams
=
`&cardId=
${
cardData
.
id
}
&userTel=
${
userInfo
.
mobilephone
}
`
;
toPage
(
"/personalCenter/membershipCard"
,
backParams
);
}
else
{
wx
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
"none"
});
}
...
...
@@ -313,16 +314,13 @@ export function themeMemberCardClick (item) {
}
else
if
(
cardData
.
receiveWay
==
2
)
{
// 付费购买
if
(
cardData
.
receiveStatus
==
0
)
{
let
query
=
{
cardId
:
cardData
.
id
};
let
url
=
`../index/main?from=themeLink&backpath=
${
encodeURIComponent
(
"/pay/payCard"
)}
¶ms=
${
encodeURIComponent
(
query
)
}
`
;
wx
.
navigateTo
({
url
}
);
console
.
log
(
"---------------------------to-----2"
)
let
backParams
=
`&cardId=
${
cardData
.
id
}
`
;
toPage
(
"/pay/payCard"
,
backParams
);
}
else
{
let
query
=
{
cardId
:
cardData
.
id
,
userTel
:
userInfo
.
mobilephone
};
let
url
=
`../index/main?from=themeLink&backpath=
${
encodeURIComponent
(
"/personalCenter/membershipCard"
)}
¶ms=
${
encodeURIComponent
(
query
)}
`
;
wx
.
navigateTo
({
url
});
console
.
log
(
"---------------------------to-----3"
)
let
backParams
=
`&cardId=
${
cardData
.
id
}
&userTel=
${
userInfo
.
mobilephone
}
`
;
toPage
(
"/personalCenter/membershipCard"
,
backParams
);
}
}
else
{
console
.
error
(
"无效的领取方式"
);
...
...
src/utils/themeModule.js
View file @
e78a7208
This diff is collapsed.
Click to expand it.
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