12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- import { getOrderDetail} from '../../api/order.js';
- import { openOrderSubscribe } from '../../utils/SubscribeMessage.js'
- const app = getApp();
- Page({
-
- data: {
- parameter: {
- 'navbar': '1',
- 'return': '0',
- 'title': '支付成功'
- },
- orderId:'',
- order_pay_info: { paid :1 }
- },
- onLoadFun:function(){
- this.getOrderPayInfo();
- },
-
- onLoad: function (options) {
- if (!options.order_id) return app.Tips({title:'缺少参数无法查看订单支付状态'},{tab:3,url:1});
- this.setData({ orderId: options.order_id, status: options.status || 0, msg: options.msg || ''});
- },
-
- getOrderPayInfo:function(){
- var that=this;
- wx.showLoading({title: '正在加载中'});
- getOrderDetail(this.data.orderId).then(res=>{
- wx.hideLoading();
- that.setData({ order_pay_info: res.data, 'parameter.title': res.data.paid ? '支付成功' : '支付失败' });
- }).catch(err=>{
- wx.hideLoading();
- });
- },
-
- goIndex:function(e){
- wx.switchTab({url:'/pages/index/index'});
- },
-
- goOrderDetails:function(e)
- {
- let that = this;
- wx.showLoading({
- title: '正在加载',
- })
- openOrderSubscribe().then(res => {
- wx.hideLoading();
- wx.navigateTo({
- url: '/pages/order_details/index?order_id=' + that.data.orderId
- });
- }).catch(() => {
- wx.hideLoading();
- });
- }
- })
|