Kaynağa Gözat

Merge branch 'master' into dev

wenjie 1 ay önce
ebeveyn
işleme
c78d61a394

+ 19 - 6
pages/category/category.js

@@ -81,10 +81,15 @@ Page({
         index:this.data.subIndex+1
       }
     }}
-    this.onleftMenuTab(data)
-    // this.setData({
-    //   topHeight:0
-    // })
+    
+    this.setData({
+      topHeight:15
+    },() => {
+      // 3. 延迟恢复样式(避免视觉闪烁)
+      setTimeout(() => {
+        this.onleftMenuTab(data)
+      }, 0);
+    })
   },
   handleSale(){
     this.setData({
@@ -230,7 +235,8 @@ Page({
       })
       // 二级分类有商品
       if(data.productBeBound == 1){
-        this.getProdList(data.categoryId)
+        this.getAllProList(data.categoryId)
+        // this.getProdList(data.categoryId)
       }else{//二级分类有三级分类
         this.getAllProList(data.categoryId)
         this.setData({
@@ -589,7 +595,14 @@ Page({
       method: "post",
       data,
       callBack: (res) => {
-        this.getCarData()
+        if(res.code == 500){
+          wx.showToast({
+            title: res.msg,
+            icon:'none'
+          })
+        }else{
+          this.getCarData()
+        }
       }
     };
     http.request(params);

+ 2 - 2
pages/category/category.wxml

@@ -88,7 +88,6 @@
       <image class="banner" src="../../images/imgs/banner.png" mode="" />
       <!-- <text wx:if="{{subCategoryList.length>0}}" class="sub-title" >{{subCategoryList[subIndex].categoryName}}</text> -->
     <view class="loading" wx:if="{{showLoading}}">
-      <!-- <van-icon class="icon" color="#006CE8" size="50rpx" name="replay" /> -->
       <image class="icon" src="../../images/imgs/loading-icon.png" mode=""/>
     </view>
       <view class="right-top-box">
@@ -108,7 +107,8 @@
           </view>
         </view>
       </view>
-      <scroll-view class="right-box"  scroll-y="true" 	enable-passive scroll-into-view="{{rightView}}"	upper-threshold="10" 	lower-threshold="10"  scroll-top="{{topHeight}}" bindscroll="scroll"bindscrolltoupper="scrollTop" bindscrolltolower="scrollBottom">
+      <scroll-view class="right-box"  scroll-y="true" 	enable-passive 	upper-threshold="10" 	lower-threshold="10"  scroll-top="{{topHeight}}" bindscroll="scroll" bindscrolltoupper="scrollTop" bindscrolltolower="scrollBottom">
+        <view style="height:20px"></view>
         <view class="product-item" id="{{'test'+index}}" wx:for="{{productList}}">
           <image class="pic" src="{{item.pic}}" mode="" data-prodId="{{item.prodId}}" bind:tap="toProdPage" />
           <view class="info">

+ 1 - 0
pages/category/category.wxss

@@ -374,6 +374,7 @@ scroll-view ::-webkit-scrollbar {
   /* padding-bottom: 500rpx; */
   padding-top: 98rpx;
   position: relative;
+  height: 100%;
 }
 
 .rightcontent  .product-item{

+ 19 - 6
pages/category1/category.js

@@ -81,10 +81,15 @@ Page({
         index:this.data.subIndex+1
       }
     }}
-    this.onleftMenuTab(data)
-    // this.setData({
-    //   topHeight:0
-    // })
+    
+    this.setData({
+      topHeight:15
+    },() => {
+      // 3. 延迟恢复样式(避免视觉闪烁)
+      setTimeout(() => {
+        this.onleftMenuTab(data)
+      }, 0);
+    })
   },
   handleSale(){
     this.setData({
@@ -230,7 +235,8 @@ Page({
       })
       // 二级分类有商品
       if(data.productBeBound == 1){
-        this.getProdList(data.categoryId)
+        this.getAllProList(data.categoryId)
+        // this.getProdList(data.categoryId)
       }else{//二级分类有三级分类
         this.getAllProList(data.categoryId)
         this.setData({
@@ -589,7 +595,14 @@ Page({
       method: "post",
       data,
       callBack: (res) => {
-        this.getCarData()
+        if(res.code == 500){
+          wx.showToast({
+            title: res.msg,
+            icon:'none'
+          })
+        }else{
+          this.getCarData()
+        }
       }
     };
     http.request(params);

+ 2 - 1
pages/category1/category.wxml

@@ -83,7 +83,7 @@
 
     <!-- 右侧内容start -->
     <!-- scroll-view  -->
-    <view scroll-y="true" class='rightcontent' 	enable-passive scroll-into-view="{{rightView}}"	upper-threshold="10" 	lower-threshold="10"  scroll-top="{{topHeight}}" bindscroll="scroll"bindscrolltoupper="scrollTop" bindscrolltolower="scrollBottom">
+    <view scroll-y="true" class='rightcontent' 	enable-passive scroll-into-view="{{rightView}}"	upper-threshold="10" 	lower-threshold="10"  scroll-top="{{topHeight}}" bindscroll="scroll" bindscrolltoupper="scrollTop" bindscrolltolower="scrollBottom">
       <image class="banner" src="../../images/imgs/banner.png" mode="" />
       <!-- <text wx:if="{{subCategoryList.length>0}}" class="sub-title" >{{subCategoryList[subIndex].categoryName}}</text> -->
     <view class="loading" wx:if="{{showLoading}}">
@@ -108,6 +108,7 @@
         </view>
       </view>
       <scroll-view class="right-box"  scroll-y="true" 	enable-passive scroll-into-view="{{rightView}}"	upper-threshold="10" 	lower-threshold="10"  scroll-top="{{topHeight}}" bindscroll="scroll"bindscrolltoupper="scrollTop" bindscrolltolower="scrollBottom">
+        <view style="height:20px"></view>
         <view class="product-item" id="{{'test'+index}}" wx:for="{{productList}}">
           <image class="pic" src="{{item.pic}}" mode="" data-prodId="{{item.prodId}}" bind:tap="toProdPage" />
           <view class="info">

+ 2 - 0
pages/category1/category.wxss

@@ -374,6 +374,8 @@ scroll-view ::-webkit-scrollbar {
   /* padding-bottom: 500rpx; */
   padding-top: 98rpx;
   position: relative;
+  height: 100%;
+
 }
 
 .rightcontent  .product-item{

+ 18 - 5
pages/order-detail/order-detail.js

@@ -45,7 +45,8 @@ Page({
     estimatedTime: '',
     estimatedTimeStr: '',
     sendInfo:null,//骑手信息
-    markers:[]
+    markers:[],
+    timer:null,//定时器
   },
 
   /**
@@ -113,18 +114,30 @@ Page({
         
         wx.hideLoading();
         if(res.status==40){//配送中再获取骑手位置
-          ths.getSenderPosition()
+          ths.startGetposition()
         }
       }
     };
     http.request(params);
 
   },
+  /**
+   * 
+   * 开始定时查询骑手位置
+   */
+  startGetposition(){
+   let timer =  setInterval(() => {//1分钟查询一次
+      this.getSenderPosition()
+    }, 60000);
+    this.setData({
+      timer
+    })
+  },
   /**
    * 获取骑手位置
    */
   getSenderPosition: function (e) {
-    wx.showLoading();
+    // wx.showLoading();
     var ths = this;
     var params = {
       url: "/p/location/info",
@@ -133,7 +146,7 @@ Page({
         orderNumber:this.data.orderNumber //'1978351838923198464'
       },
       callBack: res => {
-        wx.hideLoading();
+        // wx.hideLoading();
         console.log(res);
         if(res.code == 200&&res.data){
           let markers = [
@@ -370,7 +383,7 @@ Page({
    * 生命周期函数--监听页面卸载
    */
   onUnload() {
-
+    clearInterval(this.data.timer)
   },
 
   /**

+ 1 - 1
pages/order-detail/order-detail.wxml

@@ -121,7 +121,7 @@
       </view>
       <view class="item">
         <view class="label"> 积分({{totalUsableScore}}):</view>
-        <view class="value">¥{{reduceAmount}}</view>
+        <view class="value">-¥{{reduceAmount}}</view>
       </view>
       <view class="total">
         <view class="label">总计:</view>

+ 16 - 16
pages/prod/prod.js

@@ -857,14 +857,14 @@ Page({
    */
   addToCart: function (event) {
     if(this.data.totalStocks == 0) return
-    // let skuList = this.data.skuList[0]
-    // if (skuList.weight > 20000) {
-    //   wx.showToast({
-    //     title: "商品超过20kg,太重咯~",
-    //     icon: "none"
-    //   })
-    //   return;
-    // }
+    let skuList = this.data.skuList[0]
+    if (skuList.weight > 20000) {
+      wx.showToast({
+        title: "商品超过20kg,太重咯~",
+        icon: "none"
+      })
+      return;
+    }
     if(this.data.totalStocks<0){
       wx.showToast({
         title: "该商品暂无库存~",
@@ -925,14 +925,14 @@ Page({
    */
   buyNow: function () {
     if(this.data.totalStocks == 0) return
-    // let skuList = this.data.skuList[0]
-    // if (skuList.weight > 20000) {
-    //   wx.showToast({
-    //     title: "商品超过20kg,太重咯~",
-    //     icon: "none"
-    //   })
-    //   return;
-    // }
+    let skuList = this.data.skuList[0]
+    if (skuList.weight > 20000) {
+      wx.showToast({
+        title: "商品超过20kg,太重咯~",
+        icon: "none"
+      })
+      return;
+    }
     if(this.data.totalStocks<0){
       wx.showToast({
         title: "该商品暂无库存~",