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
prodEnv
=
require
(
'./prod.env'
)
...
...
@@ -9,6 +17,7 @@ module.exports = merge(prodEnv, {//zjgyl
// BASE_URL:"'http://192.168.1.146:3005'",
// BASE_URL:"'http://192.168.1.127:3000'",
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://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 {
// 购买会员卡新页面
options_isCard
:
''
,
options_isCardTitle
:
''
,
batchNumber
:
''
,
totalMoney
:
''
};
},
onLoad
(
options
)
{
...
...
@@ -27,7 +29,23 @@ export default {
});
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
//mpvue 的混合周期 使用小程序生命周期数据未初始化
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_isCard
=
options
.
isCard
;
this
.
options_isCardTitle
=
options
.
isCardTit
;
...
...
@@ -65,7 +83,10 @@ export default {
console
.
log
(
"支付成功"
,
res
,
this
.
options
);
const
orderSn
=
this
.
options
.
orderSn
;
let
vm
=
this
try
{
const
subscribeMessageObj
=
this
.
$store
.
state
.
subscribeMessageObj
;
if
(
subscribeMessageObj
&&
Object
.
keys
(
subscribeMessageObj
).
length
>
0
)
{
// TODO 小程序订阅消息埋点
...
...
@@ -85,36 +106,56 @@ export default {
wx
.
requestSubscribeMessage
({
tmplIds
:
tmplIds
,
success
(
res
)
{
fn
(
vm
)
console
.
log
(
"message success response: "
,
res
);
},
fail
(
res
)
{
console
.
log
(
"message fail response: "
,
res
)
}
})
}
else
{
fn
(
vm
)
}
}
else
{
console
.
log
(
'来这里了'
)
fn
(
this
)
}
}
catch
(
err
)
{
console
.
error
(
"subscribeMessage-err"
,
err
);
}
this
.
message
=
"支付成功"
;
if
(
!
this
.
options_isCard
){
let
query
=
{
orderSn
:
this
.
options
.
orderSn
};
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
)}
`
});
function
fn
(
_this
){
_this
.
message
=
"支付成功"
;
if
(
!
_this
.
options_isCard
){
let
query
;
if
(
_this
.
batchNumber
){
query
=
{
orderSn
:
_this
.
options
.
orderSn
,
batchNumber
:
_this
.
batchNumber
,
multiMerchantsFlag
:
1
,
totalMoney
:
_this
.
totalMoney
};
}
else
{
query
=
{
orderSn
:
_this
.
options
.
orderSn
};
}
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
=>
{
...
...
@@ -145,6 +186,16 @@ export default {
});
},
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
=
{
orderSn
:
this
.
options
.
orderSn
,
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