4
0

7 Commits 5fa396e015 ... aa3b8a66e6

Autor SHA1 Nachricht Datum
  wenjie aa3b8a66e6 退货数量显示 vor 2 Tagen
  wenjie 545dab2374 申请退款可退商品数量计算 vor 2 Tagen
  wenjie 8dc90be84b 样式修改 vor 2 Tagen
  wenjie eca9de7260 订单列表bug修复 vor 3 Tagen
  wenjie 28612b1210 分类bug修改 vor 3 Tagen
  wenjie 8bcc7c2435 分类接口替换 vor 3 Tagen
  wenjie 7b660e652f 优化滚动空白 vor 5 Tagen

+ 2 - 2
pages/Review/Review.wxss

@@ -66,14 +66,14 @@
   border-radius: 0rpx 16rpx 16rpx 0rpx;
 }
 
-.review .item .goods-box .goods-list .total-box .price{
+.review .item .goods-box .total-box .price{
   font-weight: 800;
   font-size: 32rpx;
   color: #FF4D3A;
   margin-bottom: 12rpx;
 }
 
-.review .item .goods-box .goods-list .total-box .num{
+.review .item .goods-box .total-box .num{
   font-size: 28rpx;
   color: #AAAAAA;
 }

+ 1 - 1
pages/afterSales/afterSales.wxml

@@ -17,7 +17,7 @@
         <!-- 信息 -->
         <view class="goods-text">
           <view class="goods-title">{{item.orderItems[0].prodName}}</view>
-          <view class="goods-quantity">数量 :{{item.orderItems[0].prodCount}}件</view>
+          <view class="goods-quantity">数量 :{{item.orderItems[0].productCount}}件</view>
           <!-- 查看详情btn -->
           <view class="item-bottom clearfix" data-refundsn="{{item.refundSn}}" bindtap="toRefundDetails">
             <text class="view-details">查看详情</text>

+ 21 - 8
pages/applyRefund/applyRefund.js

@@ -47,10 +47,16 @@ Page({
     }else{
       refundItem = wx.getStorageSync("refundItem");
       console.log('拿到缓存里的订单项数据refundItem:',refundItem)
-      refundItem.orderItemDtos.forEach(item=>{
-        item.num = 1
-        item.checked = true
+      let orderItemDtos = []
+      refundItem.orderItemDtos.forEach((item1,index)=>{
+        let item = item1
+        if(item.prodCount-item.refundCount){//剩余商品数量大于0
+          item.num = item.prodCount-item.refundCount
+          item.checked = true
+          orderItemDtos.push(item)
+        }
       })
+      refundItem.orderItemDtos = orderItemDtos
       this.setData({
         refundId,
         refundItem: refundItem,
@@ -86,10 +92,17 @@ Page({
         orderNumber
       },
       callBack: function(res) {
-        res.orderItemDtos.forEach(item=>{
-        item.num = 1
-        item.checked = true
+        let orderItemDtos = []
+        res.orderItemDtos.forEach((item1,index)=>{
+          let item = item1
+          if(item.prodCount-item.refundCount){//剩余商品数量大于0
+            item.num = item.prodCount-item.refundCount
+            item.checked = true
+            orderItemDtos.push(item)
+          }
       })
+  
+      res.orderItemDtos = orderItemDtos
       wx.hideLoading();
       ths.setData({
         refundId,
@@ -344,7 +357,7 @@ Page({
      let num = 0
       this.data.refundItem.orderItemDtos.forEach(item=>{
         if(item.checked){
-          total+=((item.price*100)*(item.num*100))/10000
+          total= (total*100 + ((item.price*100)*(item.num*100))/100)/100
           num+=item.num
         }
       })
@@ -370,7 +383,7 @@ Page({
         duration: 1200,
         icon: 'none',
       })
-    }else if(num == 1&&refundItem.orderItemDtos[index].num == refundItem.orderItemDtos[index].prodCount){
+    }else if(num == 1&&refundItem.orderItemDtos[index].num == (refundItem.orderItemDtos[index].prodCount-refundItem.orderItemDtos[index].refundCount)){
       return wx.showToast({
         title: '不能超过购买数量',
         duration: 1200,

+ 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">

+ 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">

+ 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 = [
@@ -360,7 +373,7 @@ Page({
    * 生命周期函数--监听页面卸载
    */
   onUnload() {
-
+    clearInterval(this.data.timer)
   },
 
   /**

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

@@ -115,7 +115,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>

+ 8 - 2
pages/orderList/orderList.wxml

@@ -70,11 +70,17 @@
                   </view>
                   <view class='price-nums'>
                     <text class='prodprice'>
-                      <text class='symbol' wx:if="{{item.actualTotal}}">¥</text>
+                      <text class='symbol'>¥</text>
+                      <text class='big-num'>{{wxs.parsePrice(prod.price)[0]}}</text>
+                      <text class='small-num'>.{{wxs.parsePrice(prod.price)[1]}}</text>
+                      <!-- <text class='symbol' wx:if="{{item.actualTotal}}">¥</text>
                       <text class='big-num' wx:if="{{item.actualTotal}}">{{wxs.parsePrice(prod.price)[0]}}</text>
                       <text class='small-num' wx:if="{{item.actualTotal}}">.{{wxs.parsePrice(prod.price)[1]}}</text>
                       <text class='small-num' wx:if="{{item.actualTotal && item.orderType==3}}" decode="{{true}}">&nbsp;+&nbsp;</text>
-                      <text class='big-num' wx:if="{{prod.useScore && item.orderType==3}}">{{prod.useScore}} <text class='small-num'>积分</text></text>
+                      <text class='big-num' wx:if="{{prod.useScore && item.orderType==3}}">
+                      {{prod.useScore}} 
+                      <text class='small-num'>积分</text>
+                      </text> -->
                     </text>
                     <text class="prodcount">x{{prod.prodCount}}</text>
                   </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: "该商品暂无库存~",

+ 1 - 0
pages/user/user.wxml

@@ -69,6 +69,7 @@
         <view class='items' bindtap='toOrderListPage' data-sts="80">
           <image src='../../images/icon/toComment.png'></image>
           <text>已完成</text>
+          <text class='num-badge' wx:if="{{orderAmount.success>0}}">{{orderAmount.success}}</text>
         </view>
         <view class='items' bindtap='toAfterSalesPage'>
           <image src='../../images/icon/refund.png'></image>

+ 3 - 3
pages/user/user.wxss

@@ -243,11 +243,11 @@ page {
 .list-cont .total-order .procedure .items .num-badge {
   position: absolute;
   top: -15rpx;
-  right: -12rpx;
-  color: #e43130;
+  left: calc(50% + 15rpx) ;
+  color: #FFF;
   border: 3rpx solid #e43130;
   border-radius: 50rpx;
-  background: #fff;
+  background: #FF4D3A;
   min-width: 30rpx;
   height: 30rpx;
   line-height: 30rpx;