zhashaonan il y a 7 ans
Parent
commit
3e48acc58e

+ 2 - 7
pages/confirmOrder/confirmOrder.js

@@ -81,10 +81,7 @@ Page({
         })
         appInstance.globalData.fcodeErr = res.message
         wx.navigateBack()      
-
       }
-    }, function () {
-      wx.navigateBack()
     })
   },
   getGoodsList(summary, goods_list) {
@@ -115,6 +112,7 @@ Page({
     let goods_num = this.data.num
     let iscart = this.data.ifcart
     let cart_id = this.data.cart_id
+    
     let vat_hash = this.data.datas['payinfo'].vat_hash
     let offpay_hash = this.data.datas['payinfo'].offpay_hash
     let offpay_hash_batch = this.data.datas['payinfo'].offpay_hash_batch
@@ -136,7 +134,6 @@ Page({
       offpay_hash_batch
     }, function (res) {
       wx.hideLoading()
-      console.log(res)
       if (res.code == 200) {
 
 
@@ -148,10 +145,9 @@ Page({
           title: res.message,
           duration: 2000
         })
+        appInstance.globalData.fcodeErr = res.message
         wx.navigateBack()
       }
-    }, function (err) {
-      wx.navigateBack()
     })
   },
   /**
@@ -167,7 +163,6 @@ Page({
   onShow: function () {
     if (!this.data.firstLoad) {
       let defaultAddress = appInstance.globalData.defaultAddress
-      console.log(defaultAddress)
       this.setData({
         defaultAddress
       })

+ 1 - 1
pages/confirmOrder/confirmOrder.wxml

@@ -31,7 +31,7 @@
 
   <view class="mt20 bacfff" wx:for="{{goods_list}}" wx:for-index="idx" wx:key="idx">
     <view class="order_goods_content vux-1px-b">
-      <image class="order_content_img" src="{{item.goods_image_url}}"></image>
+      <image class="order_content_img" mode="widthFix" src="{{item.goods_image_url}}"></image>
       <view class="order_content_middle">
         <view>{{item.goods_mobile_name}}</view>
         <view class="order_letter_pro">{{item.goods_spec}}</view>

+ 0 - 1
pages/confirmOrder/confirmOrder.wxss

@@ -69,7 +69,6 @@
   -webkit-flex: 0 0 33.3333%;
   flex: 0 0 33.3333%;
   width: 175rpx;
-  height: 175rpx;
 }
 
 .order_content_middle {

+ 16 - 3
pages/details/details.js

@@ -21,7 +21,8 @@ Page({
     sec_index: 0,
     goodsNumber: 1,
     cartOrBuy: '',
-    getgift: ''
+    getgift: '',
+    options_goods_id:'' 
   },
 
   /**
@@ -30,10 +31,10 @@ Page({
   onLoad: function (options) {
     let webViewUrl = `https://passport.lrlz.com/mobile/index.php?act=goods_common&op=detail&goods_id=${options.goods_id}&client_type=ios`
     this.setData({
-      webViewUrl
+      webViewUrl,
+      options_goods_id: options_goods_id
     })
     this.getDatas(options.goods_id)
-    // this.getDatas(6779)
   },
   getDatas(goods_id) {
     wx.showLoading({
@@ -135,6 +136,14 @@ Page({
       });
       return;
     }
+    if (this.data.getOneSummary.goods_storage < 1) {
+      wx.showToast({
+        title: '客官!暂时没有库存!',
+        icon: 'none',
+        duration: 1500
+      })
+      return
+    }
     let cartOrBuy = this.data.cartOrBuy
     this.setData({
       animation_flag: false
@@ -232,6 +241,10 @@ Page({
         duration: 2000
       })
       app.globalData.fcodeErr = ''
+      this.setData({
+        animation_flag: false
+      })
+      this.getDatas(this.data.options_goods_id)  
     }
     if (app.globalData.backLogin) {
       this.getDatas(this.data.getOneSummary.goods_id);

+ 4 - 2
pages/details/details.wxml

@@ -116,10 +116,12 @@
       <image class="details_tabbar_icon" src="../../image/shopcart-icon.png"></image>
       <view class="details_tabbar_label">购物车</view>
     </navigator>
-    <view class="details_tabbar_simple" bindtap='animation_flag' data-flag="true" data-cartorbuy="isCart">加入购物车</view>
-    <view class="details_tabbar_simple buy" bindtap='animation_flag' data-flag="true" data-cartorbuy="isBuy">立即购买</view>
+      <view class="details_tabbar_simple" bindtap='animation_flag' data-flag="true" data-cartorbuy="isCart">加入购物车</view>
+      <view class="details_tabbar_simple buy" bindtap='animation_flag' data-flag="true" data-cartorbuy="isBuy">立即购买</view>
   </view>
 
+
+
   <view class="animation_popup {{animation_flag ? 'show_popup' : ''}}" bindtap='animation_flag' data-flag="false"></view>
   <view class="simple_shopcart {{animation_flag ? 'show_animation' : ''}}">
     <view class="simple_goods_info pab30 vux-1px-b">

+ 3 - 1
pages/details/details.wxss

@@ -324,7 +324,9 @@
 .details_tabbar_simple.buy {
   background: rgb(255, 78, 78);
 }
-
+.details_tabbar_simple.buy.soldout {
+   flex: 3 1 0%;
+}
 .simple_shopcart {
   position: fixed;
   left: 0;