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
d8546463
Commit
d8546463
authored
Apr 29, 2021
by
程默
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'nativehome_tst' of
http://code.mayi888.com/chengmo/mayi-mp-shop
into nativehome_tst
parents
7d93cbf7
b559d7b3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
20 deletions
+71
-20
src/api/daoke.js
+25
-0
src/api/index.js
+17
-0
src/main.js
+14
-3
src/utils/mayi.js
+15
-17
src/utils/themeModule.js
+0
-0
No files found.
src/api/daoke.js
0 → 100644
View file @
d8546463
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 @
d8546463
...
@@ -33,6 +33,22 @@ console.log(process.env,'-----------------config------')
...
@@ -33,6 +33,22 @@ console.log(process.env,'-----------------config------')
},
},
get_multi_merchant_by_tags
(
data
){
get_multi_merchant_by_tags
(
data
){
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/shop/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 @
d8546463
...
@@ -6,6 +6,7 @@ import goodsApi from "./api/goods"
...
@@ -6,6 +6,7 @@ import goodsApi from "./api/goods"
import
orderApi
from
"./api/order"
import
orderApi
from
"./api/order"
import
promoteApi
from
"./api/promote"
;
import
promoteApi
from
"./api/promote"
;
import
indexApi
from
'./api/index'
import
indexApi
from
'./api/index'
import
{
createdUserJWTApi
,
getBcakUrlApi
}
from
"./api/daoke"
;
import
cartApi
from
'./api/cart'
import
cartApi
from
'./api/cart'
import
classificationApi
from
"./api/classification"
;
import
classificationApi
from
"./api/classification"
;
import
spokesmanApi
from
'./api/spokesman'
import
spokesmanApi
from
'./api/spokesman'
...
@@ -18,6 +19,7 @@ import fenxiaoModel from "@/utils/fenxiaoModel";
...
@@ -18,6 +19,7 @@ import fenxiaoModel from "@/utils/fenxiaoModel";
// themeMemberCardClick
// themeMemberCardClick
// } from "@/utils/mayi";
// } from "@/utils/mayi";
import
{
$themeToLink
,
$themeAddToCard
,
$themeArticleLike
}
from
"@/utils/mayi"
;
import
{
$themeToLink
,
$themeAddToCard
,
$themeArticleLike
}
from
"@/utils/mayi"
;
import
"@/utils/themeModule"
;
// import { themeToLinkInit } from "@/utils/themeModule";
// import { themeToLinkInit } from "@/utils/themeModule";
import
shop
from
"./api/shop"
;
import
shop
from
"./api/shop"
;
import
spokesman
from
"@/api/spokesman"
;
import
spokesman
from
"@/api/spokesman"
;
...
@@ -38,12 +40,11 @@ Vue.prototype.$mpAnalytics = mpAnalytics;
...
@@ -38,12 +40,11 @@ Vue.prototype.$mpAnalytics = mpAnalytics;
const
app
=
new
Vue
(
App
)
const
app
=
new
Vue
(
App
)
app
.
$mount
()
app
.
$mount
()
// 初始化
// themeToLinkInit({ homeNative: 2, getCoupon, themeMemberCardClick });
// glob挂载到
// glob挂载到
let
mpApp
=
getApp
();
let
mpApp
=
getApp
();
Vue
.
prototype
.
mpApp
=
mpApp
Vue
.
prototype
.
mpApp
=
mpApp
// 初始化
mpApp
.
fenxiaoModel
=
new
fenxiaoModel
({
mpApp
.
fenxiaoModel
=
new
fenxiaoModel
({
query_login_spoken
:
spokesman
.
query_login_spoken
,
query_login_spoken
:
spokesman
.
query_login_spoken
,
becomepokesmanCustomer
:
spokesman
.
becomepokesmanCustomer
,
becomepokesmanCustomer
:
spokesman
.
becomepokesmanCustomer
,
...
@@ -56,7 +57,17 @@ mpApp.fenxiaoModel = new fenxiaoModel({
...
@@ -56,7 +57,17 @@ mpApp.fenxiaoModel = new fenxiaoModel({
oneClickShopQuickCopy
:
spokesman
.
oneClickShopQuickCopy
,
oneClickShopQuickCopy
:
spokesman
.
oneClickShopQuickCopy
,
apply_for_withdraw
:
spokesman
.
apply_for_withdraw
apply_for_withdraw
:
spokesman
.
apply_for_withdraw
});
});
// 多主题方法初始化
global
.
themeToLinkInit
({
homeNative
:
2
,
wx
,
getCoupon
,
themeMemberCardClick
,
requireFun
:
{
createdUserJWT
:
createdUserJWTApi
,
getBcakUrl
:
getBcakUrlApi
}
});
// 数据异步回调函数
// 数据异步回调函数
// 商城
// 商城
mpApp
.
shopCallBack
=
function
()
{
}
mpApp
.
shopCallBack
=
function
()
{
}
...
...
src/utils/mayi.js
View file @
d8546463
...
@@ -156,6 +156,7 @@ export function $themeAddToCard(item, callback) {
...
@@ -156,6 +156,7 @@ export function $themeAddToCard(item, callback) {
}
}
function
toPage
(
backPath
,
backParams
=
""
)
{
function
toPage
(
backPath
,
backParams
=
""
)
{
console
.
log
(
backPath
,
backParams
,
'--------------------------159'
);
wx
.
navigateTo
({
wx
.
navigateTo
({
url
:
`../index/main?from=themeLink&backpath=
${
encodeURIComponent
(
backPath
)}
¶ms=
${
encodeURIComponent
(
backParams
)}
`
url
:
`../index/main?from=themeLink&backpath=
${
encodeURIComponent
(
backPath
)}
¶ms=
${
encodeURIComponent
(
backParams
)}
`
});
});
...
@@ -299,30 +300,27 @@ export function themeMemberCardClick (item) {
...
@@ -299,30 +300,27 @@ export function themeMemberCardClick (item) {
});
});
}
else
{
}
else
{
if
(
res
.
data
.
msg
==
"不能重复领卡"
)
{
if
(
res
.
data
.
msg
==
"不能重复领卡"
)
{
let
query
=
{
cardId
:
cardData
.
id
,
userTel
:
userInfo
.
mobilephone
};
console
.
log
(
"---------------------------to-----1"
)
let
url
=
`../index/main?from=themeLink&backpath=
${
encodeURIComponent
(
"/personalCenter/membershipCard"
)}
¶ms=
${
encodeURIComponent
(
query
)}
`
;
let
backParams
=
`&cardId=
${
cardData
.
id
}
&userTel=
${
userInfo
.
mobilephone
}
`
;
wx
.
navigateTo
({
url
});
toPage
(
"/personalCenter/membershipCard"
,
backParams
);
}
else
{
}
else
{
wx
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
"none"
});
wx
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
"none"
});
}
}
}
}
});
});
}
else
if
(
cardData
.
receiveWay
==
1
)
{
}
else
if
(
cardData
.
receiveWay
==
1
)
{
// 自动领取
// 自动领取
console
.
log
(
"自动领取"
);
console
.
log
(
"自动领取"
);
}
else
if
(
cardData
.
receiveWay
==
2
)
{
}
else
if
(
cardData
.
receiveWay
==
2
)
{
// 付费购买
// 付费购买
if
(
cardData
.
receiveStatus
==
0
)
{
if
(
cardData
.
receiveStatus
==
0
)
{
let
query
=
{
cardId
:
cardData
.
id
};
console
.
log
(
"---------------------------to-----2"
)
let
url
=
`../index/main?from=themeLink&backpath=
${
encodeURIComponent
(
"/pay/payCard"
)}
¶ms=
${
encodeURIComponent
(
query
)
}
`
;
let
backParams
=
`&cardId=
${
cardData
.
id
}
`
;
wx
.
navigateTo
({
url
}
);
toPage
(
"/pay/payCard"
,
backParams
);
}
else
{
}
else
{
let
query
=
{
console
.
log
(
"---------------------------to-----3"
)
cardId
:
cardData
.
id
,
let
backParams
=
`&cardId=
${
cardData
.
id
}
&userTel=
${
userInfo
.
mobilephone
}
`
;
userTel
:
userInfo
.
mobilephone
toPage
(
"/personalCenter/membershipCard"
,
backParams
);
};
let
url
=
`../index/main?from=themeLink&backpath=
${
encodeURIComponent
(
"/personalCenter/membershipCard"
)}
¶ms=
${
encodeURIComponent
(
query
)}
`
;
wx
.
navigateTo
({
url
});
}
}
}
else
{
}
else
{
console
.
error
(
"无效的领取方式"
);
console
.
error
(
"无效的领取方式"
);
...
...
src/utils/themeModule.js
View file @
d8546463
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