瀏覽代碼

快递功能

wenjie 1 月之前
父節點
當前提交
a04000db85

+ 1 - 1
components/topNavtar/topNavtar.js

@@ -5,7 +5,7 @@ Component({
    * 页面的初始数据
    */
   data: {
-    paddingTopNum: wx.getWindowInfo().statusBarHeight+7
+    paddingTopNum: wx.getWindowInfo().statusBarHeight+9
   },
 
   /**

二進制
images/icon/write.png


+ 1 - 1
pages/applyRefund/applyRefund.js

@@ -349,7 +349,7 @@ Page({
         }
       })
       if(num == this.data.refundItem.totalNum){//全部商品退款 +运费
-        total+=this.data.refundItem.transfee
+        total=(total*100+this.data.refundItem.transfee*100)/100
       }
 
       this.setData({

+ 1 - 1
pages/category/category.wxml

@@ -167,7 +167,7 @@
   <view class="bottom-box">
     <view class="left" bindtap="openCar">
       <view class="num" wx:if="{{totalInfo.count}}">{{totalInfo.count}}</view>
-      <image class="icon" src="../../images/icon/car-icon.png" mode="" />
+      <image class="icon" src="/images/icon/car-btn.png" mode="" />
       <view class="price-box">
         <view class="top">
           <view class="price">¥{{totalInfo.finalMoney}}</view>

+ 1 - 1
pages/index/index.js

@@ -866,7 +866,7 @@ Page({
    */
   getHotSalesProds() {
     if(!this.data.shop_id||this.data.shop_id == 0){
-      return
+      return console.log('店铺不存在');
     }
     var param = {
       url: "/search/searchProdPage",

+ 10 - 0
pages/order-detail/order-detail.js

@@ -257,6 +257,16 @@ Page({
       }
     })
   },
+  /**
+   * 去评价
+   */
+  goWrite(e){
+    var info = e.currentTarget.dataset.info;
+    wx.setStorageSync("orderItemInfo", this.data.orderItemDtos);
+    wx.navigateTo({
+      url: '/pages/prodComm/prodComm',
+    })
+  },
 
     /**
    * 取消订单

+ 6 - 0
pages/order-detail/order-detail.wxml

@@ -58,6 +58,12 @@
           申请售后
         </view>
       </view>
+      <view class="item" wx:if="{{status == 80}}" bind:tap="goWrite">
+        <image class="icon" src="../../images/icon/write.png" mode=""/>
+        <view class="label">
+          评价晒单
+        </view>
+      </view>
       <!-- <view class="item" wx:if="{{status != 0}}">
         <image class="icon" src="../../images/icon/buy-icon.png" mode=""/>
         <view class="label">

+ 20 - 7
pages/orderList/orderList.js

@@ -21,6 +21,7 @@ Page({
     current: 1,
     pages: 0,
     sts: 9,//9是自定义的全部
+    type:'all'
   },
 
   /**
@@ -33,7 +34,7 @@ Page({
         sts: options.sts
       });
     }
-    this.loadOrderData(this.data.sts, 1);
+    this.loadOrderData(this.data.sts,this.data.type, 1);
   },
 
   /**
@@ -44,7 +45,7 @@ Page({
   /**
    * 加载订单数据
    */
-  loadOrderData: function (sts, current) {
+  loadOrderData: function (sts,dvyType, current) {
     var ths = this;
     wx.showLoading();
     let data = {
@@ -55,6 +56,9 @@ Page({
       data.status = sts
 
     }
+    if(dvyType != 'all'){
+      data.dvyType = dvyType
+    }
     //加载订单列表
     var params = {
       url: "/p/myOrder/myOrder",
@@ -92,6 +96,15 @@ Page({
     http.request(params);
   },
 
+  handleType(e){
+    var type = e.currentTarget.dataset.type;
+    this.setData({
+      type
+    })
+    this.loadOrderData(this.data.sts,type, 1);
+
+  },
+
   /**
    * 状态点击事件
    */
@@ -100,7 +113,7 @@ Page({
     this.setData({
       sts: sts
     });
-    this.loadOrderData(sts, 1);
+    this.loadOrderData(sts,this.data.type, 1);
   },
 
   /**
@@ -137,7 +150,7 @@ Page({
    */
   onReachBottom: function () {
     if (this.data.current < this.data.pages) {
-      this.loadOrderData(this.data.sts, this.data.current + 1);
+      this.loadOrderData(this.data.sts,this.data.type, this.data.current + 1);
     }
   },
 
@@ -193,7 +206,7 @@ Page({
             data: {},
             callBack: function (res) {
               //console.log(res);
-              ths.loadOrderData(ths.data.sts, 1);
+              ths.loadOrderData(ths.data.sts,ths.data.type, 1);
               wx.hideLoading();
             }
           };
@@ -301,7 +314,7 @@ Page({
             data: {},
             callBack: function (res) {
               //console.log(res);
-              ths.loadOrderData(ths.data.sts, 1);
+              ths.loadOrderData(ths.data.sts,ths.data.type, 1);
               wx.hideLoading();
             }
           };
@@ -328,7 +341,7 @@ Page({
             method: "DELETE",
             data: {},
             callBack: function (res) {
-              ths.loadOrderData(ths.data.sts, 1);
+              ths.loadOrderData(ths.data.sts,ths.data.type, 1);
               wx.hideLoading();
             }
           }

+ 16 - 8
pages/orderList/orderList.wxml

@@ -1,12 +1,20 @@
 <!-- pages/orderList/orderList.wxml -->
 <view class='container'>
   <!-- 头部菜单 -->
-  <view class='order-tit'>
-    <text bindtap='onStsTap' data-sts="9" class="{{sts==9?'on':''}}">全部</text>
-    <text bindtap='onStsTap' data-sts="0" class="{{sts==0?'on':''}}">待支付</text>
-    <!-- <text bindtap='onStsTap' data-sts="2" class="{{sts==2?'on':''}}">待发货</text> -->
-    <text bindtap='onStsTap' data-sts="20" class="{{sts==20?'on':''}}">待收货</text>
-    <text bindtap='onStsTap' data-sts="80" class="{{sts==80?'on':''}}">已完成</text>
+  <view class="search-box">
+    <view class="type-box">
+      <view class="type-item {{type == 'all'?'active':''}}" data-type="all" bind:tap="handleType">全部</view>
+      <view class="type-item {{type == '3'?'active':''}}" data-type="3" bind:tap="handleType">配送(外卖)</view>
+      <view class="type-item {{type == '1'?'active':''}}" data-type="1" bind:tap="handleType">快递</view>
+    </view>
+    <view class='order-tit'>
+      <text bindtap='onStsTap' data-sts="9" class="{{sts==9?'on':''}}">全部</text>
+      <text bindtap='onStsTap' data-sts="0" class="{{sts==0?'on':''}}">待支付</text>
+      <!-- <text bindtap='onStsTap' data-sts="2" class="{{sts==2?'on':''}}">待发货</text> -->
+      <text bindtap='onStsTap' data-sts="20" class="{{sts==20?'on':''}}">待收货</text>
+      <text bindtap='onStsTap' data-sts="80" class="{{sts==80?'on':''}}">已完成</text>
+      <text bindtap='onStsTap' wx:if="{{type == 1}}" data-sts="60" class="{{sts==60?'on':''}}">已取消</text>
+    </view>
   </view>
   <!-- end 头部菜单 -->
   <view class='main'>
@@ -43,7 +51,7 @@
         <!-- <view class="order-num">
           <text>订单编号:{{item.orderNumber}}</text>
         </view> -->
-        <view class="delivery-info" wx:if="{{item.hbOrderStatus>0&&item.hbOrderStatus<50}}">
+        <view class="delivery-info" wx:if="{{item.hbOrderStatus>0&&item.hbOrderStatus<50&&item.dvyType == 3}}">
           <view class="title-box">  <image src='../../images/icon/car.png' class='icon'/>  预计{{item.estimatedTimeStr + ' ' + item.estimatedTime}}前可送达</view>
           <view class="desc">您的订单预计{{item.estimatedTimeStr + ' ' + item.estimatedTime}}前送达</view>
           <view class="time">{{item.payTime}}</view>
@@ -119,7 +127,7 @@
             <!-- <text class="button warn" bindtap="" data-ordernum="{{item.orderNumber}}" hover-class='none'>再次购买</text> -->
             <text wx:if="{{item.hbOrderStatus==0}}" class="button warn" data-ordertype="{{item.orderType}}" bindtap="onPayAgain" data-ordernum="{{item.orderNumber}}" hover-class='none'>付款</text>
             <!-- <text wx:if="{{item.hbOrderStatus==20 ||item.hbOrderStatus==30 ||item.hbOrderStatus==40 || item.hbOrderStatus==80}}" class="button" bindtap="toDeliveryPage" data-lat="{{item.latitude}}" data-lon="{{item.longitude}}" data-ordernum="{{item.orderNumber}}" hover-class='none'>查看物流</text> -->
-            <text wx:if="{{item.hbOrderStatus==3}}" class="button warn" bindtap="onConfirmReceive" data-ordernum="{{item.orderNumber}}" hover-class='none'>确认收货</text>
+            <text wx:if="{{(item.hbOrderStatus==20 || item.hbOrderStatus==30 || item.hbOrderStatus==40 ||item.hbOrderStatus==70)&&item.dvyType == 1}}" class="button warn" bindtap="onConfirmReceive" data-ordernum="{{item.orderNumber}}" hover-class='none'>确认收货</text>
             <!-- 评价status==5 -->
             <text wx:if="{{item.hbOrderStatus==80 && item.orderItemDtos[0].commSts==0}}" class="button warn" bindtap="onComment" data-info="{{item.orderItemDtos}}" data-ordernum="{{item.orderNumber}}" hover-class='none'>评价</text>
           </view>

+ 52 - 11
pages/orderList/orderList.wxss

@@ -7,35 +7,76 @@ page {
 }
 
 /* 头部菜单 */
-
-.order-tit {
+.search-box{
   position: fixed;
   top: 0;
+  width: 100%;
+  height: 168rpx;
+  background: #fff;
+  z-index: 999;
+  padding: 20rpx 24rpx;
+  box-sizing: border-box;
+}
+.type-box{
+  display: flex;
+}
+.type-box .type-item{
+  font-size: 32rpx;
+  color: #AAAAAA;
+  margin-right: 64rpx;
+}
+.type-box .type-item.active{
+  font-weight: bold;
+  font-size: 32rpx;
+  color: #222222;
+  position: relative;
+}
+.type-box .type-item.active::after{
+  content: '';
+  display: block;
+  width: 40rpx;
+  height: 8rpx;
+  background: #FF941A;
+  border-radius: 4rpx 4rpx 4rpx 4rpx;
+  position: absolute;
+  left: 50%;
+  bottom: -20rpx;
+  transform: translateX(-20rpx);
+
+}
+
+.order-tit {
   display: flex;
-  justify-content: space-around;
+  /* justify-content: space-around; */
   z-index: 999;
   width: 100%;
-  height: 88rpx;
-  line-height: 88rpx;
+  height: 48rpx;
+  line-height: 48rpx;
   background-color: #fff;
+  margin-top: 38rpx;
 }
 
 .order-tit text {
-  display: block;
-  font-size: 24rpx;
+  width: 104rpx;
+  height: 48rpx;
+  line-height: 48rpx;
   text-align: center;
+  background: #F6F6F6;
+  border-radius: 24rpx 24rpx 24rpx 24rpx;
+  font-size: 24rpx;
+  color: #222222;
+  margin-right: 16rpx;
 }
 
 .order-tit text.on {
-  border-bottom: 4rpx solid #FF941A;
-  color: #FF941A;
-  font-weight: 600;
+  background: #FF941A;
+  color: #FFFFFF;
 }
 
 /*  end 头部菜单 */
 
 .main {
-  margin-top: 108rpx;
+  margin-top: 188rpx;
 }
 
 /* 商品列表 */

+ 1 - 1
utils/config.js

@@ -4,7 +4,7 @@
 
 var domain = "https://shop.api.zswlgz.com"; //统一接口域名,测试环境 
 var wsDomain = "wss://shop-h5.dev.zswllife.cn/api"; //统一接口域名,测试环境 
-// var domain = "http://12e88ddc.r39.cpolar.top"; //统一接口域名,正式环境 
+var domain = "http://66b5ef7.r39.cpolar.top"; //统一接口域名,正式环境 
 // var wsDomain = "wss://shop.haimamart.com/api"; //统一接口域名,正式环境 
 
 // var domain = "http://192.168.1.206:8112"; //统一接口域名,测试环境