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
c4b5e895
Commit
c4b5e895
authored
Oct 14, 2019
by
程默
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
同步
parent
55758803
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
16 deletions
+29
-16
config/dev.env.js
+4
-2
config/prod.env.js
+1
-1
src/api/wxPay.js
+4
-0
src/pages/index/index.vue
+3
-4
src/pages/login/index.vue
+5
-1
src/pages/wxPay/index.vue
+11
-7
src/utils/request.js
+1
-1
No files found.
config/dev.env.js
View file @
c4b5e895
...
...
@@ -4,6 +4,8 @@ var prodEnv = require('./prod.env')
module
.
exports
=
merge
(
prodEnv
,
{
NODE_ENV
:
'"development"'
,
OLSHOP_URL
:
'"https://test-m-shop.mayi888.cn/innerApi/shopApiService"'
,
IMG_DOMAIN
:
'"http://test-bucket-ant.oss-cn-shanghai.aliyuncs.com"'
// OLSHOP_URL:'"https://test-m-shop.mayi888.cn/innerApi/shopApiService"',
OLSHOP_URL
:
'"https://shop.mayi888.com/innerApi/shopApiService"'
,
// IMG_DOMAIN: '"http://test-bucket-ant.oss-cn-shanghai.aliyuncs.com"'
IMG_DOMAIN
:
'"http://cdn.mayi888.com"'
})
config/prod.env.js
View file @
c4b5e895
module
.
exports
=
{
NODE_ENV
:
'"production"'
,
OLSHOP_URL
:
'"http
://shop.mayi888.com
"'
,
OLSHOP_URL
:
'"http
s://shop.mayi888.com/innerApi/shopApiService
"'
,
IMG_DOMAIN
:
'"http://cdn.mayi888.com"'
}
src/api/wxPay.js
View file @
c4b5e895
...
...
@@ -3,5 +3,8 @@ import {requestPOST,requestPOST1} from "@/utils/request.js";
export
default
{
to_wx_pay
(
options
)
{
return
requestPOST1
(
`
${
process
.
env
.
OLSHOP_URL
}
/pay/to_wx_pay`
,
options
)
},
cancelPayment
(
options
)
{
return
requestPOST1
(
`
${
process
.
env
.
OLSHOP_URL
}
/pay/payment_cancel?orderSn=
${
options
}
`
)
}
}
\ No newline at end of file
src/pages/index/index.vue
View file @
c4b5e895
...
...
@@ -10,11 +10,11 @@ import { serialize, getQueryVariable, DFSImg } from "@/utils/index";
export
default
{
data
()
{
return
{
shopId
:
"ant
good
"
,
shopId
:
"ant"
,
options
:
{},
session_key
:
""
,
baseUrl
:
"https://test-m-shop.mayi888.cn"
,
//
baseUrl: "https://shop.mayi888.com",
//
baseUrl:"https://test-m-shop.mayi888.cn",
baseUrl
:
"https://shop.mayi888.com"
,
link
:
this
.
baseUrl
,
page
:
"/"
,
params
:
"?mixid="
+
this
.
shopId
,
...
...
@@ -111,7 +111,6 @@ export default {
wx
.
authorize
({
scope
:
"scope.userLocation"
,
success
()
{
// 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问
that
.
getLocationHandle
();
}
});
...
...
src/pages/login/index.vue
View file @
c4b5e895
...
...
@@ -111,7 +111,7 @@ export default {
this
.
openid
=
res
.
data
.
data
.
openid
;
this
.
isShow
=
true
;
}
else
{
wx
.
showToast
({
title
:
res
.
data
.
msg
})
wx
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
'none'
})
}
})
.
catch
(
err
=>
{});
...
...
@@ -120,7 +120,11 @@ export default {
});
},
getUserInfo
:
function
(
e
)
{
wx
.
showLoading
({
title
:
"加载中"
});
if
(
e
.
target
.
errMsg
==
"getUserInfo:ok"
&&
this
.
isShow
)
{
wx
.
hideLoading
();
if
(
this
.
isHaveUnion
)
{
//是会员 直接登录
wx
.
reLaunch
({
...
...
src/pages/wxPay/index.vue
View file @
c4b5e895
...
...
@@ -60,22 +60,26 @@ export default {
payData
.
fail
=
res
=>
{
console
.
log
(
"支付失败"
,
res
,
this
.
options
.
orderSn
);
this
.
message
=
"支付失败"
;
wxPay
.
cancelPayment
(
this
.
options
.
orderSn
).
then
(()
=>
{
console
.
log
(
"取消成功"
);
});
this
.
toPage
();
};
payData
.
complete
=
res
=>
{
if
(
res
.
errMsg
==
"chooseWXPay:cancel"
)
{
console
.
log
(
"支付取消"
,
this
.
options
);
this
.
message
=
"支付取消"
;
this
.
toPage
();
}
console
.
log
(
"支付completa"
,
res
,
this
.
options
.
orderSn
);
// if (res.errMsg == "requestPayment:fail cancel") {
// console.log("支付取消", this.options);
// this.message = "支付取消";
// this.toPage();
// }
};
wx
.
requestPayment
(
payData
);
}
else
{
// wx.showToast({ title: res.data.msg
});
wx
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
"none"
});
}
})
.
catch
(
err
=>
{
// wx.showToast({ title: err
});
wx
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
"none"
});
});
},
toPage
()
{
...
...
src/utils/request.js
View file @
c4b5e895
let
shopMixid
=
"ant
good
"
;
let
shopMixid
=
"ant"
;
// wx.getStore
export
async
function
requestGET
(
url
,
options
)
{
...
...
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