feat: move project
This commit is contained in:
commit
4a940f28ba
97 changed files with 5047 additions and 0 deletions
39
pages/pay/pay.js
Normal file
39
pages/pay/pay.js
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import R from '../../utils/request';
|
||||
import C from '../../utils/constant';
|
||||
import * as F from '../../utils/func';
|
||||
Page({
|
||||
data: {
|
||||
|
||||
},
|
||||
onLoad(options) {
|
||||
const { order_no, redirect_url } = options;
|
||||
|
||||
R.post('/index.php/api/v1/pay_order_shop', { order_no }).then(({ model }) => {
|
||||
wx.requestPayment({
|
||||
...model,
|
||||
success(res) {
|
||||
wx.showToast({
|
||||
title: '支付成功',
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
success() {
|
||||
wx.redirectTo({
|
||||
url: '/pages/shop/shop?path=user',
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
fail(res) {
|
||||
wx.showToast({
|
||||
title: '支付失败',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
wx.redirectTo({
|
||||
url: '/pages/shop/shop?path=user',
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue