订单
This commit is contained in:
		
							parent
							
								
									4140d8e8d6
								
							
						
					
					
						commit
						3f513f121a
					
				@ -1,6 +1,7 @@
 | 
			
		||||
import bin from "../../../utils/bin"
 | 
			
		||||
Component({
 | 
			
		||||
    properties: {
 | 
			
		||||
        index:Number
 | 
			
		||||
    },
 | 
			
		||||
    data: {
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
@ -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>
 | 
			
		||||
 | 
			
		||||
@ -5,14 +5,16 @@ Page({
 | 
			
		||||
   * 页面的初始数据
 | 
			
		||||
   */
 | 
			
		||||
  data: {
 | 
			
		||||
 | 
			
		||||
    index:0
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * 生命周期函数--监听页面加载
 | 
			
		||||
   */
 | 
			
		||||
  onLoad: function (options) {
 | 
			
		||||
 | 
			
		||||
    this.setData({
 | 
			
		||||
      index: options.index == undefined ? 0:options.index
 | 
			
		||||
    })
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,3 @@
 | 
			
		||||
<view class="box">
 | 
			
		||||
    <tab style="width:100%"></tab>
 | 
			
		||||
    <tab style="width:100%" index="{{index}}"></tab>
 | 
			
		||||
</view>
 | 
			
		||||
@ -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({
 | 
			
		||||
@ -104,12 +104,20 @@ Page({
 | 
			
		||||
        console.log(r)
 | 
			
		||||
        let { timeStamp, nonceStr, signType, sign } = r.data.data.wdata
 | 
			
		||||
        // timeStamp = timeStamp
 | 
			
		||||
        timeStamp =  timeStamp.toString()
 | 
			
		||||
        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"
 | 
			
		||||
            })}
 | 
			
		||||
        })
 | 
			
		||||
      })
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user