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
cae74365
Commit
cae74365
authored
Nov 19, 2020
by
程智春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订阅
parent
7489c404
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
113 additions
and
20 deletions
+113
-20
config/dev.env.js
+9
-0
src/pages/toMini/index.vue
+26
-0
src/pages/toMini/main.js
+5
-0
src/pages/toMini/main.json
+2
-0
src/pages/wxPay/index.vue
+71
-20
No files found.
config/dev.env.js
View file @
cae74365
/*
* @Author: your name
* @Date: 2020-10-21 09:46:59
* @LastEditTime: 2020-10-22 14:09:41
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \mayi-mp-shop\config\dev.env.js
*/
var
merge
=
require
(
'webpack-merge'
)
var
merge
=
require
(
'webpack-merge'
)
var
prodEnv
=
require
(
'./prod.env'
)
var
prodEnv
=
require
(
'./prod.env'
)
...
@@ -9,6 +17,7 @@ module.exports = merge(prodEnv, {//zjgyl
...
@@ -9,6 +17,7 @@ module.exports = merge(prodEnv, {//zjgyl
// BASE_URL:"'http://192.168.1.146:3005'",
// BASE_URL:"'http://192.168.1.146:3005'",
// BASE_URL:"'http://192.168.1.127:3000'",
// BASE_URL:"'http://192.168.1.127:3000'",
BASE_URL
:
"'https://test-m-shop.mayi888.cn'"
,
BASE_URL
:
"'https://test-m-shop.mayi888.cn'"
,
// BASE_URL:"'http://172.16.1.32:3000'",
OLSHOP_URL
:
'"https://test-m-shop.mayi888.cn/innerApi/shopApiService"'
,
OLSHOP_URL
:
'"https://test-m-shop.mayi888.cn/innerApi/shopApiService"'
,
// OLSHOP_URL:'"https://shop.mayi888.com/innerApi/shopApiService"',
// OLSHOP_URL:'"https://shop.mayi888.com/innerApi/shopApiService"',
...
...
src/pages/toMini/index.vue
0 → 100644
View file @
cae74365
<
template
>
<div>
</div>
</
template
>
<
script
>
export
default
{
onLoad
(
options
){
wx
.
navigateToMiniProgram
({
appId
:
options
.
weappAppId
,
path
:
decodeURIComponent
(
options
.
weappPage
),
// envVersion: 'release',
extraData
:
options
.
extraData
&&
JSON
.
parse
(
options
.
extraData
),
success
(
res
)
{
// 打开成功
}
})
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
\ No newline at end of file
src/pages/toMini/main.js
0 → 100644
View file @
cae74365
import
Vue
from
'vue'
import
App
from
'./index'
const
app
=
new
Vue
(
App
)
app
.
$mount
()
src/pages/toMini/main.json
0 → 100644
View file @
cae74365
{}
\ No newline at end of file
src/pages/wxPay/index.vue
View file @
cae74365
...
@@ -19,6 +19,8 @@ export default {
...
@@ -19,6 +19,8 @@ export default {
// 购买会员卡新页面
// 购买会员卡新页面
options_isCard
:
''
,
options_isCard
:
''
,
options_isCardTitle
:
''
,
options_isCardTitle
:
''
,
batchNumber
:
''
,
totalMoney
:
''
};
};
},
},
onLoad
(
options
)
{
onLoad
(
options
)
{
...
@@ -27,7 +29,23 @@ export default {
...
@@ -27,7 +29,23 @@ export default {
});
});
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
//mpvue 的混合周期 使用小程序生命周期数据未初始化
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
//mpvue 的混合周期 使用小程序生命周期数据未初始化
console
.
log
(
"onload//"
,
options
);
console
.
log
(
"onload//"
,
options
);
this
.
options
=
JSON
.
parse
(
options
.
ordercode
);
if
(
options
.
batchNumber
){
let
ordercode
=
JSON
.
parse
(
options
.
ordercode
)
ordercode
.
orderSn
=
''
ordercode
.
batchNumber
=
options
.
batchNumber
this
.
options
=
ordercode
this
.
batchNumber
=
ordercode
.
batchNumber
console
.
log
(
JSON
.
parse
(
options
.
ordercode
).
orderSn
)
if
(
JSON
.
parse
(
options
.
ordercode
).
orderSn
){
this
.
totalMoney
=
Number
(
JSON
.
parse
(
options
.
ordercode
).
orderSn
.
totalAmount
).
toFixed
(
2
)
}
// }
console
.
log
(
this
.
totalMoney
,
'totalMoney'
)
}
else
{
this
.
options
=
JSON
.
parse
(
options
.
ordercode
);
}
this
.
options_orderType
=
options
.
orderType
;
this
.
options_orderType
=
options
.
orderType
;
this
.
options_isCard
=
options
.
isCard
;
this
.
options_isCard
=
options
.
isCard
;
this
.
options_isCardTitle
=
options
.
isCardTit
;
this
.
options_isCardTitle
=
options
.
isCardTit
;
...
@@ -65,7 +83,10 @@ export default {
...
@@ -65,7 +83,10 @@ export default {
console
.
log
(
"支付成功"
,
res
,
this
.
options
);
console
.
log
(
"支付成功"
,
res
,
this
.
options
);
const
orderSn
=
this
.
options
.
orderSn
;
const
orderSn
=
this
.
options
.
orderSn
;
let
vm
=
this
try
{
try
{
const
subscribeMessageObj
=
this
.
$store
.
state
.
subscribeMessageObj
;
const
subscribeMessageObj
=
this
.
$store
.
state
.
subscribeMessageObj
;
if
(
subscribeMessageObj
&&
Object
.
keys
(
subscribeMessageObj
).
length
>
0
)
{
if
(
subscribeMessageObj
&&
Object
.
keys
(
subscribeMessageObj
).
length
>
0
)
{
// TODO 小程序订阅消息埋点
// TODO 小程序订阅消息埋点
...
@@ -85,36 +106,56 @@ export default {
...
@@ -85,36 +106,56 @@ export default {
wx
.
requestSubscribeMessage
({
wx
.
requestSubscribeMessage
({
tmplIds
:
tmplIds
,
tmplIds
:
tmplIds
,
success
(
res
)
{
success
(
res
)
{
fn
(
vm
)
console
.
log
(
"message success response: "
,
res
);
console
.
log
(
"message success response: "
,
res
);
},
},
fail
(
res
)
{
fail
(
res
)
{
console
.
log
(
"message fail response: "
,
res
)
console
.
log
(
"message fail response: "
,
res
)
}
}
})
})
}
else
{
fn
(
vm
)
}
}
}
else
{
console
.
log
(
'来这里了'
)
fn
(
this
)
}
}
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
error
(
"subscribeMessage-err"
,
err
);
console
.
error
(
"subscribeMessage-err"
,
err
);
}
}
this
.
message
=
"支付成功"
;
function
fn
(
_this
){
if
(
!
this
.
options_isCard
){
_this
.
message
=
"支付成功"
;
let
query
=
{
if
(
!
_this
.
options_isCard
){
orderSn
:
this
.
options
.
orderSn
let
query
;
};
if
(
_this
.
batchNumber
){
wx
.
redirectTo
({
query
=
{
url
:
`../index/main?from=wxPay&backpath=/pay/paySuccess¶ms=
${
JSON
.
stringify
(
orderSn
:
_this
.
options
.
orderSn
,
query
batchNumber
:
_this
.
batchNumber
,
)}
`
multiMerchantsFlag
:
1
,
});
totalMoney
:
_this
.
totalMoney
}
else
{
};
let
query
=
{
}
else
{
cardTitle
:
this
.
options_isCardTitle
query
=
{
};
orderSn
:
_this
.
options
.
orderSn
wx
.
redirectTo
({
};
url
:
`../index/main?from=wxPay&backpath=/pay/payCardSuccess¶ms=
${
JSON
.
stringify
(
}
query
)}
`
wx
.
redirectTo
({
});
url
:
`../index/main?from=wxPay&backpath=/pay/paySuccess¶ms=
${
JSON
.
stringify
(
query
)}
`
});
}
else
{
let
query
=
{
cardTitle
:
_this
.
options_isCardTitle
}
wx
.
redirectTo
({
url
:
`../index/main?from=wxPay&backpath=/pay/payCardSuccess¶ms=
${
JSON
.
stringify
(
query
)}
`
});
}
}
}
};
};
payData
.
fail
=
res
=>
{
payData
.
fail
=
res
=>
{
...
@@ -145,6 +186,16 @@ export default {
...
@@ -145,6 +186,16 @@ export default {
});
});
},
},
toPage
()
{
toPage
()
{
console
.
log
(
'支付失败来这里了'
,
this
.
batchNumber
)
if
(
this
.
batchNumber
){
let
query
=
{
multiMerchantsFlag
:
1
}
wx
.
redirectTo
({
url
:
`../index/main?from=wxPay&backpath=/order/orderList¶ms=
${
JSON
.
stringify
(
query
)}
`
});
return
}
let
query
=
{
let
query
=
{
orderSn
:
this
.
options
.
orderSn
,
orderSn
:
this
.
options
.
orderSn
,
payList
:
true
,
payList
:
true
,
...
...
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