1234567891011121314151617181920212223242526272829303132333435363738 |
- import toast from '../utils/tool/toast';
- export default {
- methods:{
- /* 支付
- * mode 状态
- * confirmOrder
- *
- * */
- wxPay:function (data,callback,msg = false) {
- return uni.requestPayment({
- 'timeStamp': data.timeStamp,
- 'nonceStr': data.nonceStr,
- 'package': data.package,
- 'signType': data.signType,
- 'paySign': data.paySign,
- 'complete': (res)=>{
- let status = res.errMsg === 'requestPayment:ok';
- if (msg && !status) {
- toast.info('支付取消');
- }
- return callback && callback(status);
- },
- 'success':(res) => {
- if (msg) {
- toast.success('支付成功');
- }
- }
- });
- }
- }
- }
|