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

@ -77,13 +77,13 @@ Page({
},
sub() {
if(this.data.list.addressList == null){
if (this.data.list.addressList == null) {
wx.showToast({
title:"请先添加地址",
icon:"none"
title: "请先添加地址",
icon: "none"
})
console.log(123)
return ;
return;
}
bin.getuserid().then((res) => {
bin.request({
@ -107,9 +107,17 @@ Page({
timeStamp = timeStamp.toString()
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)}
timeStamp, nonceStr, package: r.data.data.wdata.package, signType, paySign: sign,
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"
})}
})
})
})