This commit is contained in:
pplokijuhyg 2019-12-28 14:27:57 +08:00
parent 4140d8e8d6
commit 3f513f121a
5 changed files with 23 additions and 12 deletions

View File

@ -1,6 +1,7 @@
import bin from "../../../utils/bin"
Component({
properties: {
index:Number
},
data: {
},

View File

@ -1,4 +1,4 @@
<van-tabs class="tab" swipe-threshold="5">
<van-tabs class="tab" swipe-threshold="5" active="{{index}}">
<van-tab title="待付款" bind:tap="todetail">
<commodity bind:shua="shua" wx:for="{{WAITPAY}}" wx:for-index="j" wx:key="{{j}}" data-id="{{item.order_id}}" num="{{item.goods_num}}" cprice="{{item.goods_price}}" freight="{{item.integral_money}}" goods="{{item.goods_list}}" gid="{{item.order_id}}" type="1"></commodity>
</van-tab>

View File

@ -5,14 +5,16 @@ Page({
* 页面的初始数据
*/
data: {
index:0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
index: options.index == undefined ? 0:options.index
})
},
/**

View File

@ -1,3 +1,3 @@
<view class="box">
<tab style="width:100%"></tab>
<tab style="width:100%" index="{{index}}"></tab>
</view>

View File

@ -108,8 +108,16 @@ Page({
console.log(timeStamp)
wx.requestPayment({
timeStamp, nonceStr, package: r.data.data.wdata.package, signType, paySign: sign,
success(res) {console.log("成功")},
fail(res) {console.log(res)}
success(res) {
console.log("成功")
wx.redirectTo({
url: "/pages/order/order?index=1"
})
},
fail(res) { console.log(res)
wx.redirectTo({
url: "/pages/order/order?index=0"
})}
})
})
})