Prechádzať zdrojové kódy

售后流程 积分相关展示

wenjie 4 dní pred
rodič
commit
565b8ab3e5

+ 34 - 1
pages/DetailsOfRefund/DetailsOfRefund.js

@@ -16,6 +16,15 @@ Page({
     orderAmount: '', //订单总金额
     orderItems: {}, //订单项 
     refundAmount: '', //退款金额
+    goodsTotal:0,
+    records:[],//退款流程
+    refundStatusObj:{
+      1:'申请原因',
+      2:'商家待审核',
+      3:'审核通过',
+      4:'驳回',
+      5:'退款成功',
+    },
     refundDelivery: [], //收货地址对象
     refundId: '', //记录ID
     refundTime: '', //退款时间
@@ -26,6 +35,7 @@ Page({
     buyerReason: '', //退款原因
     shopName: '', //店铺名称
     refundScore: 0, // 退款积分
+    photoFiles:[],
     addCarshow: false,
     selectTimeshow: false,
     flowShow: false,
@@ -49,7 +59,7 @@ Page({
     statusObj:{
       10:{
         title:'待审核',
-        desc:'申请通过后,将退回至原账户'
+        desc:'等待商家处理申请'
       },
       20:{
         title:'处理中',
@@ -115,6 +125,10 @@ Page({
           img=item.pic.split(',')
           item.pic=img[0]
         })
+        let photoFiles = []
+        if(res.photoFiles){
+          photoFiles = res.photoFiles.split(',')
+        }
         ths.setData({
           applyTime: res.applyTime, //申请时间
           applyType: res.applyType, //申请类型:1,仅退款,2退款退货
@@ -125,6 +139,10 @@ Page({
           orderNumber: res.orderNumber, //订单项 
           refundSn: res.refundSn, //退款编号
           refundAmount: res.refundAmount, //退款金额
+          goodsTotal:res.goodsTotal,
+          records:res.records,//退款流程
+          offsetPoints:res.offsetPoints,
+          freightAmount:res.freightAmount,
           refundDelivery: res.refundDelivery, //收货地址对象
           refundId: res.refundId, //记录ID
           refundTime: res.refundTime, //退款时间
@@ -132,6 +150,7 @@ Page({
           updateTime: res.updateTime, //更新时间
           rejectMessage: res.rejectMessage, //拒绝理由
           buyerReason: res.buyerReason, //退款原因
+          photoFiles, //图片
           shopName: res.shopName,
           refundScore: res.refundScore, // 退款积分
           payer: res.refundDelivery.payer,//运费承担方
@@ -144,6 +163,20 @@ Page({
     http.request(params);
   },
 
+  // 一键复制事件
+  copyBtn: function(e) {
+    let data = e.currentTarget.dataset.value
+    wx.setClipboardData({
+      //准备复制的数据
+      data,
+      success: function(res) {
+        wx.showToast({
+          title: '复制成功',
+        });
+      }
+    })
+  },
+
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 23 - 27
pages/DetailsOfRefund/DetailsOfRefund.wxml

@@ -34,36 +34,30 @@
       </view>
     </view> -->
 
-    <!-- <view class="process-box box">
+    <view class="process-box box">
       <view class="sub-title">退款流程</view>
       
       <view class="step-box">
-        <view class="step-item" wx:for="{{4}}">
+        <view class="step-item" wx:for="{{records}}" >
           <view class="point {{index == 0?'active':''}}"></view>
           <view class="line"></view>
-          <view class="title">退款成功</view>
-          <view class="desc">已完成退款,具体到账时间请查询支付宝</view>
-          <view class="time">2024-12-13 11:12:30</view>
-          <view class="img-list" wx:if="{{index == 3}}">
-            <view class="img"></view>
-            <view class="img"></view>
-            <view class="img"></view>
-            <view class="img"></view>
-            <view class="img"></view>
-            <view class="img"></view>
-            <view class="img"></view>
-            <view class="img"></view>
-            <view class="img"></view>
-          </view>
+          <view class="title">{{refundStatusObj[item.auditStatus]}}</view>
+          <view class="desc">{{item.instructions}}</view>
+          <view class="time">{{item.updateTime}}</view>
         </view>
+      
+          <view class="img-list">
+            <!-- <view class="img"></view> -->
+           <image wx:for="{{photoFiles}}" src="{{item}}" mode="" class="img"/>
+          </view>
       </view>
 
-    </view> -->
+    </view>
 
     <view class="refund-goods box">
       <view class="title-box">
         <view class="title">退款商品</view>
-        <view class="price">退款金额:¥21</view>
+        <view class="price">退款金额:¥{{goodsTotal}}</view>
       </view>
       <view class="good-list">
         <view class="good-item" wx:for="{{orderItems}}" wx:key="*this">
@@ -74,8 +68,8 @@
             <view class="price">单价:¥{{item.price}}</view>
           </view>
           <view class="price-box">
-            <view class="price">¥{{item.productTotalAmount}}</view>
-            <view class="num">x{{item.prodCount}}</view>
+            <view class="price">¥{{item.productCount*item.price}}</view>
+            <view class="num">x{{item.productCount}}</view>
           </view>
         </view>
 
@@ -88,19 +82,21 @@
     <view class="goods-info box">
       <view class="item">
         <view class="label">商品金额</view>
-        <view class="value">¥54.00</view>
+        <view class="value">¥{{goodsTotal}}</view>
       </view>
       <view class="item">
         <view class="label">运费(快递)</view>
-        <view class="value">¥54.00</view>
+        <view class="value">¥{{freightAmount}}</view>
       </view>
       <view class="item">
-        <view class="label">积分({{refundScore}})</view>
-        <view class="value">¥{{refundScore}}</view>
+        <view class="label">积分({{offsetPoints}})</view>
+        <view class="value">¥{{(offsetPoints/100)}}</view>
       </view>
       <view class="total">
         <view class="label">总计:</view>
-        <view class="value">¥54.00</view>
+        <view class="value">¥{{refundAmount}}</view>
+        <!-- <view class="value" wx:if="{{refundAmount}}">¥{{refundAmount}}</view>
+        <view class="value" wx:else="">¥{{offsetPoints}}</view> -->
       </view>
     </view>
 
@@ -110,14 +106,14 @@
         <view class="label">订单编号</view>
         <view class="value-box">
           <view class="value">{{orderNumber}}</view>
-          <image class="icon" src="../../images/icon/copy.png" mode=""/>
+          <image bind:tap="copyBtn" data-value="{{orderNumber}}" class="icon" src="../../images/icon/copy.png" mode=""/>
         </view>
       </view>
       <view class="item">
         <view class="label">售后编号</view>
         <view class="value-box">
           <view class="value">{{refundSn}}</view>
-          <image class="icon" src="../../images/icon/copy.png" mode=""/>
+          <image class="icon" bind:tap="copyBtn" data-value="{{refundSn}}" src="../../images/icon/copy.png" mode=""/>
         </view>
       </view>
       <view class="item">

+ 2 - 2
pages/DetailsOfRefund/DetailsOfRefund.wxss

@@ -135,12 +135,12 @@
   left: 0;
   z-index: 8;
 }
-.DetailsOfRefund .process-box .step-box .step-item .img-list{
+.DetailsOfRefund .process-box .step-box .img-list{
   display: flex;
   overflow: auto;
   margin-top: 12rpx;
 }
-.DetailsOfRefund .process-box .step-box .step-item .img-list .img{
+.DetailsOfRefund .process-box .step-box .img-list .img{
   width: 120rpx;
   height: 120rpx;
   background: #F6F6F6;

+ 17 - 4
pages/applyRefund/applyRefund.js

@@ -71,13 +71,14 @@ Page({
    * 提交退款
    */
   apply(){
+    console.log(this.data.refundItem.orderItemDtos,this.data.refundItem.orderItemDtos.some(i=>i.checked));
      // 检查数据完整性
      if (this.data.buyerReason === '') {
         return wx.showToast({
           icon: 'none',
           title: '请选择退款原因',
         })
-      }else if(!this.data.refundItem.orderItemDtos.every(i=>i.checked)){
+      }else if(!this.data.refundItem.orderItemDtos.some(i=>i.checked)){
         return wx.showToast({
           icon: 'none',
           title: '请选择退款商品',
@@ -92,6 +93,7 @@ Page({
       pics = pics.substring(0, pics.length - 1)
     }
     let goodsNum = 0
+    let refundAmount = this.data.total 
     let orderRefundSkuList = []
     this.data.refundItem.orderItemDtos.forEach(item=>{
       if(item.checked){
@@ -104,18 +106,24 @@ Page({
         goodsNum+=item.num
       }
     })
+    if(this.data.refundItem.actualTotal == 0){//积分支付 不用管退款金额
+      refundAmount = 0
+    }else if(refundAmount>=this.data.refundItem.actualTotal){//支付了钱的订单 并且退款钱超过实际支付钱 传实际支付金额
+      refundAmount = this.data.refundItem.actualTotal
+    }
 
     let data = {
       orderNumber: this.data.orderNumber, //订单编号
       applyType: this.data.applyType, //退款方式(1:仅退款 2退款退货)
       isReceiver: this.data.applyType == 1?0:1, //货物状态(1:已收到货 0:未收到货)
       buyerReason: this.data.reasonList[this.data.buyerReason].name, //退款原因
-      goodsNum: this.data.goodsNum, //退款数量(0或不传值则为全部数量)
-      refundAmount: this.data.refundItem.actualTotal, //退款金额
+      goodsNum, //退款数量(0或不传值则为全部数量)
+      refundAmount: refundAmount, //退款金额
+      freightAmount:this.data.refundItem.transfee,
       buyerMobile: this.data.refundItem.userAddrDto.mobile, //手机号码(默认当前订单手机号码)
       buyerDesc: this.data.buyerDesc, //备注说明
       photoFiles: pics, //凭证图片列表
-      refundType: 1, //退款单类型(1:整单退款,2:单个物品退款)
+      refundType: goodsNum == this.data.refundItem.totalNum ?1:2, //退款单类型(1:整单退款,2:单个物品退款)
       orderRefundSkuList: orderRefundSkuList
     }
     if(this.data.refundId){//再次申请
@@ -284,11 +292,16 @@ Page({
 
    totalPrice(){
      let total = 0
+     let num = 0
       this.data.refundItem.orderItemDtos.forEach(item=>{
         if(item.checked){
           total+=item.price*item.num
+          num+=item.num
         }
       })
+      if(num == this.data.refundItem.totalNum){//全部商品退款 +运费
+        total+=this.data.refundItem.transfee
+      }
 
       this.setData({
         total

+ 1 - 1
pages/index/index.wxml

@@ -64,7 +64,7 @@
           <van-grid-item class="my-grid-item" use-slot bind:click="selectMenu" wx:for="{{categoryList}}" wx:key="categoryId" data-pic="{{item.pic}}" data-itemid="{{item.categoryId}}" data-index="{{index}}" data-categories="{{item.categories}}" data-categoryName="{{item.categoryName}}" badge="应季水果">
             <image class="swiper-grid-image" src="{{item.icon}}" />
             <text class="swiper-grid-text">{{item.categoryName}}</text>
-            <view class="label">应季果</view>
+            <view class="label" wx:if="{{item.label}}">{{'应季果蔬'||item.label}}</view>
           </van-grid-item>
         </van-grid>
   </view>

+ 22 - 2
pages/locationAdd/locationAdd.js

@@ -9,7 +9,8 @@ Page({
    */
   data: {
     address: '',
-    addressList: []
+    addressList: [],
+    shopList:[]
   },
 
   /**
@@ -57,6 +58,25 @@ Page({
     }
     http.request(params);
   },
+
+  /**
+   * 获取附近店铺
+   */
+  getshopList() {
+    wx.showLoading();
+    var params = {
+      url: "/p/shop/addrShop",
+      method: "GET",
+      data: {addrId:'',platform:1},
+      callBack: (res) => {
+        // this.setData({
+        //   shopList: res
+        // });
+        wx.hideLoading();
+      }
+    }
+    http.request(params);
+  },
   /**
    *维护地址
    */
@@ -80,7 +100,7 @@ Page({
         wx.hideLoading();
         this.getAddrList()
         // 当前定位显示选择地址的名称 不再显示路名
-        // this.getTxmap()
+        this.getTxmap()
        wx.setStorageSync('ADDRESS', e.currentTarget.dataset.item.addressName)
         setTimeout(() => {
           let pages = getCurrentPages();

+ 108 - 209
pages/order-detail/order-detail.js

@@ -1,6 +1,7 @@
-// pages/order-detail/order-detail.js
-
+// pages/DetailsOfRefund/DetailsOfRefund.js
 var http = require('../../utils/http.js');
+var util = require('../../utils/util.js');
+
 Page({
 
   /**
@@ -22,12 +23,14 @@ Page({
     orderItemDtos: [],
     remarks: "",
     actualTotal: 0,
+    canRefund:false,
     userAddrDto: null,
     orderNumber: "",
     createTime: "",
     status: 0,
     productTotalAmount: '',
     transfee: '',
+    totalNum:0,
     reduceAmount: '',
     prodid: '',
     orderType: 0,
@@ -41,6 +44,74 @@ Page({
     orderNumSend:''
   },
 
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    this.setData({
+      orderNumSend:options.orderNum
+    })
+    this.loadOrderDetail(options.orderNum);
+
+  },
+  /**
+   * 加载订单数据
+   */
+  loadOrderDetail: function(orderNum) {
+    var ths = this;
+    wx.showLoading();
+    //加载订单详情
+    var params = {
+      url: "/p/myOrder/orderDetail",
+      method: "GET",
+      data: {
+        orderNumber: orderNum
+      },
+      callBack: function(res) {
+        let img=''
+        res.orderItemDtos.forEach(e=>{
+          img=e.pic.split(',')
+          e.pic=img[0]
+        })
+
+        var dvyType
+        if(res.dvyType == 1){
+          dvyType = '运费(快递)'
+        }else if(res.dvyType == 3){
+          dvyType = '配送费(即时配送)'
+        }else{
+          dvyType = '自提'
+        }
+        ths.setData({
+          totalUsableScore:res.totalUsableScore,
+          dvyType:dvyType,
+          orderNumber: orderNum,
+          actualTotal: res.actualTotal, //实际支付总额(商品总额+运费)
+          canRefund:res.canRefund,
+          userAddrDto: res.userAddrDto,
+          remarks: res.remarks,
+          orderItemDtos: res.orderItemDtos,
+          createTime: res.createTime,
+          status: res.status,
+          // status: res.status,//海博订单状态
+          productTotalAmount: res.total, //所有商品总额
+          transfee: res.transfee, //运费
+          totalNum:res.totalNum,
+          reduceAmount: res.reduceAmount,
+          orderType: res.orderType,
+          shopName: res.shopName,
+          canRefund: res.canRefund,
+          canAllRefund: res.canAllRefund,
+          orderScore: res.orderScore, // 整单使用积分
+
+        });
+        
+        wx.hideLoading();
+      }
+    };
+    http.request(params);
+
+  },
   //跳转商品详情页
   toProdPage: function(e) {
     var prodid = e.currentTarget.dataset.prodid;
@@ -57,40 +128,6 @@ Page({
   },
 
   /**
-   * 是否最后一个商品在执行单个商品退款事件
-   */
-  applyLastProdRefund: function() {
-    if(this.data.status==2) { //待发货状态下
-      // 遍历商品list
-      if(this.data.orderItemDtos.length > 1) {  //如果商品列表长度大于1
-        let sum = []
-        this.data.orderItemDtos.forEach((el,index) => {
-          if (el.refundSn) { //如果拥有退款单号
-            sum.push(el)
-            this.setData({
-              sum
-            })
-          }
-        })
-        console.log(this.data.sum)
-        if(this.data.sum.length == this.data.orderItemDtos.length-1) {
-          // 如果拥有退款单号的item等于商品列表数据长度-1,那么点击的这件商品就是最后意见商品
-          this.setData({
-            isLastProd: true
-          })
-        }else if(this.data.sum.length == this.data.orderItemDtos.length) {
-          // 如果拥有退款单号的item等于商品列表数据长度,那么不可撤销申请
-          this.setData({
-            irrevocable: true  //不可撤销
-          })
-        }
-      }
-      console.log('isLastProd:',this.data.isLastProd)
-      console.log('irrevocable:',this.data.irrevocable)
-    }
-  },
-
-   /**
    * 付款
    */
   onPayAgain: function (e) {
@@ -131,8 +168,8 @@ Page({
     http.request(params);
   },
 
-   //删除已完成||已取消的订单
-   delOrderList: function (e) {
+  //删除已完成||已取消的订单
+  delOrderList: function (e) {
     var ths = this
     wx.showModal({
       title: '',
@@ -198,222 +235,84 @@ Page({
    * 申请退款
    */
   applyRefund: function(e) {
-      var item = {}
-      item.orderNumber = this.data.orderNumber;
-      item.actualTotal = this.data.actualTotal;
-      item.transfee = this.data.transfee;
-      item.status = this.data.status; //订单状态
-      item.orderItemDtos = this.data.orderItemDtos;
-      item.orderScore = this.data.orderScore,  // 整单积分
-      item.userAddrDto = this.data.userAddrDto,  // 用户信息
-      //拿到存储在本地的订单项数据
-      wx.setStorageSync("refundItem", item);
- 
-      wx.redirectTo({ //通过wx.redirectTo实现跳转(关闭当前页面,跳转到应用内某个页面)
-        url: '/pages/applyRefund/applyRefund',
-      })
- 
-  },
-  // applyRefund: function(e) {
-  //   var refundType = e.currentTarget.dataset.refundtype // 退款类型 1整单  2单个物品
-  //   var status = this.data.status
-  //   this.loadOrderDetail(this.data.orderNumber)  //请求订单详情数据
-  //   if (e.currentTarget.dataset.refundtype == 1) { //整单退款
-  //     var item = {}
-  //     item.orderNumber = this.data.orderNumber;
-  //     item.actualTotal = this.data.actualTotal;
-  //     item.transfee = this.data.transfee;
-  //     item.status = this.data.status; //订单状态
-  //     item.orderItemDtos = this.data.orderItemDtos;
-  //     item.orderScore = this.data.orderScore,  // 整单积分
-  //     item.userAddrDto = this.data.userAddrDto,  // 用户信息
-  //     //拿到存储在本地的订单项数据
-  //     wx.setStorageSync("refundItem", item);
-  //     // console.log('订单详情页获取到的整单退item:',item)
-  //   } else if(e.currentTarget.dataset.refundtype == 2) { //单个商品退款
-  //     this.applyLastProdRefund() //是否最后一个商品执行单个商品退款
-  //     console.log('isLastProd:',this.data.isLastProd)
-  //     // 将数据存储到本地
-  //     var item = e.currentTarget.dataset.item;
-  //     if(this.data.orderItemDtos.length == 1) {
-  //       item.addTransfee = true
-  //     }else {
-  //       item.addTransfee = false
-  //     }
-  //     item.orderNumber = this.data.orderNumber;
-  //     item.transfee = this.data.transfee;
-  //     item.status = this.data.status; //订单状态
-  //     item.isLastProd = this.data.isLastProd?this.data.isLastProd:undefined //是否最后一款商品
-  //     //拿到存储在本地的订单项数据
-  //     wx.setStorageSync("refundItem", item);
-  //     console.log(item)
-  //     console.log(item.actualTotal)
-  //   }
-  //   /**
-  //    * 判断跳转页面(根据订单是否已发货)
-  //    */
-  //   var type = e.currentTarget.dataset.type;
-    
-  //   // if (status == 2) {   //待发货,直接跳转到申请页,不需要选择退货方式
-  //     wx.redirectTo({ //通过wx.redirectTo实现跳转(关闭当前页面,跳转到应用内某个页面)
-  //       url: '/pages/applyRefund/applyRefund?type=' + type + '&refundType=' + refundType,
-  //     })
-  //   // } else  {  //已发货,跳转到选择退货方式页
-  //   //   wx.redirectTo({
-  //   //     url: '/pages/chooseRefundWay/chooseRefundWay?refundType=' + refundType
-  //   //   })
-  //   // }
-  // },
-
-
-  /**
-   * 查看退款
-   */
-  viewRefund: function(e) {
-    var refundSn = e.currentTarget.dataset.refundsn;
-    this.applyLastProdRefund() //是否最后一个商品执行单个商品退款
-    console.log(this.data.irrevocable)
-    wx.navigateTo({
-      url: '/pages/DetailsOfRefund/DetailsOfRefund?refundSn=' + refundSn + '&irrevocable=' + this.data.irrevocable+'&userAddrDto='+JSON.stringify(this.data.userAddrDto) +'&orderNumber=' + this.data.orderNumSend
+    var item = {}
+    item.orderNumber = this.data.orderNumber;
+    item.actualTotal = this.data.actualTotal;
+    item.transfee = this.data.transfee;
+    item.status = this.data.status; //订单状态
+    item.orderItemDtos = this.data.orderItemDtos;
+    item.totalNum = this.data.totalNum
+    item.orderScore = this.data.orderScore,  // 整单积分
+    item.userAddrDto = this.data.userAddrDto,  // 用户信息
+    //拿到存储在本地的订单项数据
+    wx.setStorageSync("refundItem", item);
+
+    wx.redirectTo({ //通过wx.redirectTo实现跳转(关闭当前页面,跳转到应用内某个页面)
+      url: '/pages/applyRefund/applyRefund',
     })
-  },
 
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function(options) {
-    this.setData({
-      orderNumSend:options.orderNum
-    })
-    this.loadOrderDetail(options.orderNum);
-  },
-
-  /**
-   * 加载订单数据
-   */
-  loadOrderDetail: function(orderNum) {
-    var ths = this;
-    wx.showLoading();
-    //加载订单详情
-    var params = {
-      url: "/p/myOrder/orderDetail",
-      method: "GET",
-      data: {
-        orderNumber: orderNum
-      },
-      callBack: function(res) {
-        let img=''
-        res.orderItemDtos.forEach(e=>{
-          img=e.pic.split(',')
-          e.pic=img[0]
-        })
-
-        var dvyType
-        if(res.dvyType == 1){
-          dvyType = '运费(快递)'
-        }else if(res.dvyType == 3){
-          dvyType = '配送费(即时配送)'
-        }else{
-          dvyType = '自提'
-        }
-        ths.setData({
-          totalUsableScore:res.totalUsableScore,
-          dvyType:dvyType,
-          orderNumber: orderNum,
-          actualTotal: res.actualTotal, //实际支付总额(商品总额+运费)
-          userAddrDto: res.userAddrDto,
-          remarks: res.remarks,
-          orderItemDtos: res.orderItemDtos,
-          createTime: res.createTime,
-          status: res.status,
-          // status: res.status,//海博订单状态
-          productTotalAmount: res.total, //所有商品总额
-          transfee: res.transfee, //运费
-          reduceAmount: res.reduceAmount,
-          orderType: res.orderType,
-          shopName: res.shopName,
-          canRefund: res.canRefund,
-          canAllRefund: res.canAllRefund,
-          orderScore: res.orderScore, // 整单使用积分
+},
 
+  // 一键复制事件
+  copyBtn: function(e) {
+    let data = e.currentTarget.dataset.value
+    wx.setClipboardData({
+      //准备复制的数据
+      data,
+      success: function(res) {
+        wx.showToast({
+          title: '复制成功',
         });
-        
-        wx.hideLoading();
       }
-    };
-    http.request(params);
-
+    })
   },
 
-
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
-  onReady: function() {
+  onReady() {
 
   },
 
   /**
    * 生命周期函数--监听页面显示
    */
-  onShow: function() {
+  onShow() {
 
   },
 
   /**
    * 生命周期函数--监听页面隐藏
    */
-  onHide: function() {
+  onHide() {
 
   },
 
   /**
    * 生命周期函数--监听页面卸载
    */
-  onUnload: function() {
+  onUnload() {
 
   },
 
   /**
    * 页面相关事件处理函数--监听用户下拉动作
    */
-  onPullDownRefresh: function() {
+  onPullDownRefresh() {
 
   },
 
   /**
    * 页面上拉触底事件的处理函数
    */
-  onReachBottom: function() {
+  onReachBottom() {
 
   },
 
   /**
    * 用户点击右上角分享
    */
-  onShareAppMessage: function() {
-
-  },
-
-  toGroupDetails: function(e) {
-    wx.navigateTo({
-      url: '/pages/spellGroupDetails/spellGroupDetails?orderNumber=' + e.currentTarget.dataset.ordernumber,
-    })
-  },
-
-
-  // 一键复制事件
-  copyBtn: function(e) {
-    var ths = this;
-    wx.setClipboardData({
-      //准备复制的数据
-      data: ths.data.orderNumber,
-      success: function(res) {
-        wx.showToast({
-          title: '复制成功',
-        });
-      }
-    })
-  },
+  onShareAppMessage() {
 
+  }
 })

+ 1 - 2
pages/order-detail/order-detail.json

@@ -1,4 +1,3 @@
 {
-  "backgroundTextStyle": "light",
-  "navigationBarTitleText": "订单详情"
+  "usingComponents": {}
 }

+ 56 - 166
pages/order-detail/order-detail.wxml

@@ -1,19 +1,5 @@
-<!--pages/order-detail/order-detail.wxml-->
-
-  <!-- 地址 -->
-  <view class='order-detail'>
-    
-    <view class="order-sts">{{statusObject[status]}}</view>
-
-    <view class="pay-box" wx:if="{{status == 0}}">
-    
-      <view class="pay-btn-box">
-        <view class="cancel-btn" bindtap="onCancelOrder">取消订单</view>
-        <view class="pay-btn" bindtap="onPayAgain">立即支付¥{{actualTotal}}</view>
-      </view>
-    </view>
-
-    <view class="oprate-box box">
+<view class="DetailsOfRefund">
+  <view class="oprate-box box">
       <view class="item" wx:if="{{status == 60}}" bindtap="delOrderList" data-ordernum="{{orderNumber}}">
         <image class="icon" src="../../images/icon/del-icon.png" mode=""/>
         <view class="label">
@@ -26,7 +12,7 @@
           联系商家
         </view>
      </button>
-     <view class="item" wx:if="{{status !=0}}" bind:tap="applyRefund">
+     <view class="item" wx:if="{{status !=0 &&canRefund}}" bind:tap="applyRefund">
         <image class="icon" src="../../images/icon/apply.png" mode=""/>
         <view class="label">
           申请售后
@@ -40,173 +26,77 @@
       </view> -->
       
     </view>
+   
 
-    <view class='delivery-addr box'>
-      <view class='user-info'>
-        <text class='item'>{{userAddrDto.receiver}}</text>
-        <text class='item'>{{userAddrDto.mobile}}</text>
-      </view>
-      <view class='addr'>{{userAddrDto.address}}{{userAddrDto.addressName}}{{userAddrDto.addrDetail}}</view>
-    </view>
-
-    <!-- 商品信息 -->
-    <view class='prod-item box'>
-      <view class="order-num">
-        <view class='order-state clearfix'>
-          <!-- 店铺 -->
-          <view class="shop-box">
+    <view class="refund-goods box">
+      <view class="shop-box">
             <view class="shop-icon">
               <image src="../../images/icon/shop.png"></image>
             </view>
             <view class="shop-name">{{shopName}}</view>
           </view>
-          <!-- /店铺 -->
-          <!-- <text class="order-sts  gray">{{['','待支付','待发货','待收货','已完成','已完成','已取消','拼团中'][status]}}</text> -->
-        </view>
-      </view>
-      <block wx:for="{{orderItemDtos}}" wx:key='prodId'>
-        <view class='item-cont' bindtap='toProdPage' data-prodid="{{item.prodId}}">
-          <view class='prod-pic'>
-            <image src='{{item.pic}}'></image>
+      <view class="good-list">
+        <view class="good-item" wx:for="{{orderItemDtos}}" wx:key='prodId'>
+          <image src="{{item.pic}}" mode="" class="img"/>
+          <view class="info">
+            <view class="good-name">{{item.prodName}}</view>
+            <!-- <view class="desc">规格:5kg,盒</view> -->
+            <view class="price">单价:¥{{item.price}}</view>
           </view>
-          <!-- 拼团商品展示icon -->
-          <view class="spell-group-icon">
-            <text class="group-text" wx:if="{{item.orderType!=null}}">{{['','拼团','秒杀','积分'][orderType]}}</text>
+          <view class="price-box">
+            <view class="price">¥{{item.prodCount*item.price}}</view>
+            <view class="num">x{{item.prodCount}}</view>
           </view>
-          <view class='prod-info'>
-            <view class='prodname'>
-              {{item.prodName}}
-            </view>
-            <view class='prod-info-cont'>
-              <!-- 拼团icon -->
-              <view class="spell-group-icon" wx:if="{{orderType}}">
-                <!-- orderType 订单类型(0普通订单 1团购订单 2秒杀订单) -->
-                <text class="group-text">{{['','拼团','秒杀','积分'][orderType]}}</text>
-              </view>
-              <!-- /拼团icon -->
-              <view class='number'>{{item.skuName||''}} {{item.prodCount}} 件</view>
-              <!-- <text class='info-item'>{{item.skuName}}</text> -->
-            </view>
-            <view class='price-nums clearfix'>
-              <text class='prodprice'><text wx:if="{{item.price}}" class='symbol'>¥</text>
-                <text wx:if="{{item.price}}" class='big-num'>{{wxs.parsePrice(item.price)[0]}}</text>
-                <text wx:if="{{item.price}}" class='small-num'>.{{wxs.parsePrice(item.price)[1]}}</text>
-                <text wx:if="{{item.price && orderType==3}}" class='small-num'>+</text>
-                <text class='big-num' wx:if="{{orderType==3}}">{{item.useScore}} 积分</text>
-              </text>
-              <!-- <view class='btn-box'>
-                <text class='btn'>申请售后</text>
-                <text class='btn'>加购物车</text>
-              </view> -->
-            </view>
-          </view>
-          <!-- 申请退款btn -->
-          <!-- <text class="apply-refund-btn" catchtap="applyRefund" data-itemactualtotal="{{item.actualTotal}}" data-item="{{item}}" wx:if="{{!item.refundSn && canRefund && orderType !=3||item.status==6}}" data-refundtype="2" data-type="{{status == 2?'1':'2'}}">申请退款</text> -->
-          <!-- <text class="apply-refund-btn" catchtap="viewRefund" data-ordernumber='{{item.orderNumber}}' data-refundsn="{{item.refundSn}}" wx:if="{{item.refundSn}}">查看退款</text> -->
-          <!-- 申请退款btn -->
-        </view>
-      </block>
-      <view class='prod-foot'>
-        <view class='btn'>
-          <button wx:if="{{item.status==0}}" class="button" bindtap="onCancelOrder" data-ordernum="{{item.primaryOrderNo}}" hover-class='none'>取消订单</button>
-          <!-- <button wx:if="{{item.status==1}}" class="button warn" bindtap="onConfirmReceive" data-ordernum="{{item.primaryOrderNo}}" hover-class='none'>再次购买</button> -->
-          <button wx:if="{{item.status==1}}" class="button warn" bindtap="onPayAgain" data-ordernum="{{item.primaryOrderNo}}" hover-class='none'>付款</button>
-          <button wx:if="{{item.status==3 || item.status==5}}" class="button" bindtap="toDeliveryPage" data-ordernum="{{item.primaryOrderNo}}" hover-class='none'>查看物流</button>
-          <button wx:if="{{item.status==3}}" class="button warn" bindtap="onConfirmReceive" data-ordernum="{{item.primaryOrderNo}}" hover-class='none'>确认收货</button>
         </view>
+
       </view>
+        <!-- <view class="open-btn">
+          展开(共7件) <image class="arrow" src="../../images/icon/black-down-arrow.png" mode=""/>
+        </view> -->
     </view>
 
-    <view class='order-msg box'>
-      <view class='msg-item'>
-        <view class='item'>
-          <view class='item-tit'>商品总额:</view>
-          <view class='item-txt price'>
-            <text class='symbol'>¥</text>
-            <text class='big-num'>{{wxs.parsePrice(productTotalAmount)[0]}}</text>
-            <text class='small-num'>.{{wxs.parsePrice(productTotalAmount)[1]}}</text>
-          </view>
-        </view>
-        <view class='item'>
-          <!-- <view class='item-tit'>运费:</view> -->
-          <view class='item-tit'>{{dvyType}}:</view>
-          <view class='item-txt price'>
-            <text class='symbol'>¥</text>
-            <text class='big-num'>{{wxs.parsePrice(transfee)[0]}}</text>
-            <text class='small-num'>.{{wxs.parsePrice(transfee)[1]}}</text>
-          </view>
-        </view>
-        <view class='item'>
-          <view class='item-tit'>
-          <!-- <text class="item-tit" wx:if="{{orderType && orderType!=3}}">{{orderType==1?'团购':'秒杀'}}</text> -->
-          <!-- 优惠: -->
-          积分({{totalUsableScore}}):
-          </view>
-          <view class='item-txt price'>
-            <text class='symbol'>-¥</text>
-            <text class='big-num'>{{wxs.parsePrice(reduceAmount)[0]}}</text>
-            <text class='small-num'>.{{wxs.parsePrice(reduceAmount)[1]}}</text>
-          </view>
-        </view>
-        <view class='item payment'>
-          <view class='item-txt price'>
-            订单总额:
-            <text class='symbol' wx:if="{{actualTotal && actualTotal > 0}}">¥</text>
-            <text class='big-num' wx:if="{{actualTotal && actualTotal > 0}}">{{wxs.parsePrice(actualTotal)[0]}}</text>
-            <text class='small-num' wx:if="{{actualTotal && actualTotal > 0}}">.{{wxs.parsePrice(actualTotal)[1]}}</text>
-            <text class='small-num' wx:if="{{(actualTotal && actualTotal > 0) && (orderType==3 || orderScore > 0)}}">+</text>
-            <text class='big-num' wx:if="{{orderType==3 || totalUsableScore > 0}}">{{totalUsableScore}} <text class='small-num'>积分</text></text>
-          </view>
-        </view>
+    <view class="goods-info box">
+      <view class="item">
+        <view class="label">商品金额</view>
+        <view class="value">¥{{productTotalAmount}}</view>
+      </view>
+      <view class="item">
+        <view class="label">{{dvyType}}:</view>
+        <view class="value">¥{{transfee}}</view>
+      </view>
+      <view class="item">
+        <view class="label"> 积分({{totalUsableScore}}):</view>
+        <view class="value">¥{{reduceAmount}}</view>
+      </view>
+      <view class="total">
+        <view class="label">总计:</view>
+        <view class="value" wx:if="{{actualTotal}}">¥{{actualTotal}}</view>
+        <view class="value" wx:else="">{{totalUsableScore}}积分</view>
       </view>
     </view>
 
-    <!-- 订单信息 -->
-    <view class='order-msg box'>
-    <view class="sub-title">订单信息</view>
-      <view class='msg-item'>
-        <view class='item'>
-          <text class='item-tit'>订单编号:</text>
-          <text class='item-txt'>{{orderNumber}}</text>
-          <text class='copy-btn' bindtap='copyBtn'>复制</text>
-        </view>
-        <view class='item'>
-          <text class='item-tit'>下单时间:</text>
-          <text class='item-txt'>{{createTime}}</text>
+    <view class="order-info box">
+      <view class="title">订单信息</view>
+      <view class="item">
+        <view class="label">订单编号:</view>
+        <view class="value-box">
+          <view class="value">{{orderNumber}}</view>
+          <image bind:tap="copyBtn" data-value="{{orderNumber}}" class="icon" src="../../images/icon/copy.png" mode=""/>
         </view>
       </view>
-      <view class='msg-item'>
-        <view class='item'>
-          <text class='item-tit'>支付方式:</text>
-          <text class='item-txt'>微信支付</text>
-        </view>
-        <!-- <view class='item'>
-          <text class='item-tit'>配送方式:</text>
-          <text class='item-txt'>普通配送</text>
-        </view> -->
-        <view class='item'>
-          <text class='item-tit'>订单备注:</text>
-          <text class='item-txt'>{{remarks?remarks:''}}</text>
-        </view>
+     
+      <view class="item">
+        <view class="label">下单时间:</view>
+        <view class="value">{{createTime}}</view>
       </view>
-    </view>
-
-    
-
-    <!-- 底部栏 -->
-    <view class='order-detail-footer'>
-      <!-- <text class='dele-order' wx:if="{{status==5||status==6}}" bindtap='delOrderList' data-ordernum="{{orderNumber}}">删除订单</text> -->
-      <view class='footer-box'>
-        <!-- <text class="apply-refund-btn refund-full" data-refundtype="1" catchtap="applyRefund" wx:if="{{canAllRefund && orderType!=3}}" data-type="{{status == 2?'1':'2'}}">整单退款</text> -->
-        <!-- <text class="apply-refund-btn refund-full" data-refundtype="1" catchtap="applyRefund" data-type="{{status == 2?'1':'2'}}">整单退款</text>
-        <button class='apply-service foot-btn' open-type="contact">联系客服</button> -->
-        <!-- <text class='buy-again'>再次购买</text> -->
-
-        <!-- 【团购按钮】 -->
-        <!-- <button class='apply-service foot-btn' bindtap="toGroupDetails" data-ordernumber='{{orderNumber}}' wx:if="{{orderType==1}}">查看团购详情</button> -->
-        <!-- 【团购按钮】 -->
+      <view class="item">
+        <view class="label">支付方式:</view>
+        <view class="value">微信支付</view>
+      </view>
+      <view class="item">
+        <view class="label">订单备注:</view>
+        <view class="value">{{remarks?remarks:''}}</view>
       </view>
     </view>
 
-  </view>
-<wxs module="wxs" src="../../wxs/number.wxs" />
+</view>

+ 143 - 433
pages/order-detail/order-detail.wxss

@@ -1,164 +1,79 @@
-/* pages/order-detail/order-detail.wxss */
-.clearfix:after {
-  content: ".";
-  display: block;
-  height: 0;
-  clear: both;
-  visibility: hidden;
+/* pages/DetailsOfRefund/DetailsOfRefund.wxss */
+.DetailsOfRefund{
+  padding: 20rpx 24rpx 120rpx;
+  background: #F6F6F6;
 }
 
-image {
-  width: 100%;
-  height: 100%;
-}
-page {
- 
-}
-.display {
-  display: none!important;
-}
-
-/* 头部流程-等待商家发货 */
-.process {
-  padding: 20rpx;
-  font-size: 28rpx;
-  border-bottom: 1px solid #f2f2f2;
-  background: #fff;
-}
-.process-top {
-  padding: 20rpx 0;
-  margin-top: 10rpx;
+/* 店铺 */
+.shop-box {
+  display: inline-block;
 }
 .shop-icon {
-  width: 70rpx;
-  height: 70rpx;
+  display: inline-block;
+  width: 35rpx;
+  height: 35rpx;
   margin-right: 15rpx;
   vertical-align: middle;
 }
-.wait {
-  vertical-align: middle;
-}
-/* 进程 */
-.process-list {
-  position: relative;
-  padding-top: 30rpx;
-  padding-bottom: 15rpx;
-  display: flex;
-  justify-content: space-between;
-}
-.process-item {
-  font-size: 25rpx;
-  color: #aaa;
-  text-align: center;
-}
-.buyers-pay {
-  text-align: left;
-}
-.successful {
-  text-align: right;
-}
-.current-txt {
-  color: #17b606;
-}
-.item-icon {
-  width: 20rpx;
-  height: 20rpx;
+.shop-icon > image {
+  width: 100%;
+  height: 100%;
 }
-.solid-round {
+.shop-name {
   display: inline-block;
-  width: 12rpx;
-  height: 12rpx;
-  background: #bbb;
-  border-radius: 50%;
-}
-/* 进度条 */
-.line {
-  position: absolute;
-  bottom: 28rpx;
-  height: 3rpx;
-  background: #f0f0f0;
-}
-.line-current {
-  background: #46b229;
-}
-.line01 {
-  left: 33rpx;
-  width: 42%;
-}
-.line02 {
-  right: 33rpx;
-  width: 42%;
-}
-.spell-line01 {
-  width: 25%;
-  left: 33rpx;
-}
-.spell-line02 {
-  width: 25%;
-  left: 255rpx;
-}
-.spell-line03 {
-  width: 25%;
-  right: 33rpx;
+  vertical-align: middle;
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #222222;
 }
 
+.DetailsOfRefund .result-box{
+  padding: 0 28rpx ;
+}
 
-/*  地址  */
-.order-detail {
-  margin-bottom: 120rpx;
-  font-size: 30rpx;
-  padding: 20rpx 24rpx 200rpx;
-  background: #F9F9F9;
-  min-height: 100vh;
-  color: #222;
+.DetailsOfRefund .result-box .result{
+  position: relative;
+  padding: 24rpx 0;
   
 }
 
-.sub-title{
+.DetailsOfRefund .result-box .result .title{
   font-weight: bold;
   font-size: 32rpx;
   color: #222222;
-  padding: 24rpx 0;
+}
+.DetailsOfRefund .result-box .result .title.small{
+  font-size: 28rpx;
 }
 
-.pay-btn-box{
+.DetailsOfRefund .result-box .result .desc{
+  font-size: 24rpx;
+  color: #AAAAAA;
+  margin-top: 20rpx;
+}
+.DetailsOfRefund .result-box .result .title-box{
   display: flex;
   justify-content: space-between;
 }
-.pay-btn-box .cancel-btn{
-  width: 226rpx;
-  height: 68rpx;
-  line-height: 68rpx;
-  text-align: center;
-  background: #FFFFFF;
-  border-radius: 60rpx 60rpx 60rpx 60rpx;
-  font-weight: bold;
-  font-size: 28rpx;
-  color: #AAAAAA;
-}
-.pay-btn-box .pay-btn{
-  width: 456rpx;
-  height: 68rpx;
-  line-height: 68rpx;
-  text-align: center;
-  background: #FF941A;
-  border-radius: 60rpx 60rpx 60rpx 60rpx;
+
+.DetailsOfRefund .result-box .result .price{
   font-weight: bold;
   font-size: 28rpx;
-  color: #FFFFFF;
+  color: #FF4D3A;
 }
-.order-detail .box{ 
+
+.box{
   background: #FFFFFF;
   border-radius: 16rpx 16rpx 16rpx 16rpx;
   margin-bottom: 20rpx;
 }
 
-.order-detail .oprate-box{
+.DetailsOfRefund .oprate-box{
   display: flex;
   padding: 0 24rpx;
   
 }
-.order-detail .oprate-box .item{
+.DetailsOfRefund .oprate-box .item{
   width: 25%;
   text-align: center;
   margin: 0;
@@ -170,368 +85,163 @@ page {
   outline: none;
   line-height: normal;
 }
-.order-detail wx-button:after {
+.DetailsOfRefund wx-button:after {
   border: none;
 }
-.order-detail .oprate-box .item .icon{
+.DetailsOfRefund .oprate-box .item .icon{
   width: 40rpx;
   height: 40rpx;
 }
 
-.order-detail .oprate-box .item .label{
+.DetailsOfRefund .oprate-box .item .label{
   font-size: 28rpx;
   color: #222222;
   margin-top: 20rpx;
 }
-.order-detail .delivery-addr {
-  padding: 20rpx 30rpx;
-  background: #fff;
-}
-.order-detail .delivery-addr .user-info {
-  line-height: 48rpx;
-  word-wrap: break-word;
-  word-break: break-all;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  display: -webkit-box;
-  -webkit-line-clamp: 1;
-  -webkit-box-orient: vertical;
-  font-weight: bold;
-  font-size: 32rpx;
-  color: #222222;
+
+
+.DetailsOfRefund .refund-goods{
+  padding: 24rpx;
 }
-.order-detail .delivery-addr .user-info .item {
+
+.DetailsOfRefund .refund-goods .title-box{
+  display: flex;
+  justify-content: space-between;
+  padding-bottom: 24rpx;
+  font-weight: bold;
   font-size: 28rpx;
-  margin-right: 30rpx;
-  vertical-align: top;
-  display: inline-block;
 }
-.order-detail .delivery-addr .addr {
-  font-size: 28rpx;
-  line-height: 36rpx;
-  font-size: 28rpx;
-  color: #AAAAAA;
-  margin-top: 20rpx;
+.DetailsOfRefund .refund-goods .title-box .title{
+  color: #222222;
 }
-
-/* 商品列表 */
-.prod-item {
-  background-color: #fff;
-  margin-top: 15rpx;
-  font-size: 28rpx;
+.DetailsOfRefund .refund-goods .title-box .price{
+  color: #FF4D3A;
 }
-/* 拼团icon */
-/* .group-text {
-  font-size: 23rpx;
-  color: #fff;
-  background: #fe4443;
-  padding: 5rpx 10rpx;
-  border-radius: 8rpx;
-  position: absolute;
-  top: 40rpx;
-  left: 40rpx;
 
-} */
-
-.prod-item .item-cont .prod-pic image {
-  width: 180rpx;
-  height: 180rpx;
+.DetailsOfRefund .refund-goods .good-list{
 }
-.prod-item .item-cont {
-  position: relative;
+.DetailsOfRefund .refund-goods .good-list .good-item{
+  border-top:1rpx solid #F0F0F0;
+  padding: 20rpx 0;
   display: flex;
-  align-items: center;
-  padding: 20rpx 30rpx;
-  border-top: 2rpx solid #f1f1f1;
-}
-.prod-item .item-cont .prod-pic {
-  font-size: 0;
-  display: block;
-  width: 160rpx;
-  height: 160rpx;
-  overflow: hidden;
-  background: #fff;
-  margin-right: 16rpx;
-}
-.prod-item .item-cont .prod-pic image {
-  width: 100%;
-  height: 100%;
+
 }
-.prod-item .item-cont .prod-info {
-  margin-left: 10rpx;
-  font-size: 28rpx;
-  width: 100%;
-  position: relative;
-  -webkit-flex: 1;
-  -ms-flex: 1;
-  -webkit-box-flex: 1;
-  -moz-box-flex: 1;
+.DetailsOfRefund .refund-goods .good-list .good-item .img{
+  width: 120rpx;
+  height: 120rpx;
+  border-radius: 16rpx;
+  background: #F6F6F6;
+}
+.DetailsOfRefund .refund-goods .good-list .good-item .info{
+  margin-left: 20rpx;
   flex: 1;
 }
-/* 申请退款按钮 */
-.apply-refund-btn {
-  position: absolute;
-  right: 20rpx;
-  bottom: 25rpx;
-  font-size: 23rpx;
-  padding: 7rpx 15rpx;
-  color: #e43130;
-  border: 1rpx solid #e43130;
-  border-radius: 30rpx;
+.DetailsOfRefund .refund-goods .good-list .good-item .info .good-name{
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #222222;
 }
-
-.prod-item .item-cont .prod-info .prodname {
-  font-size: 30rpx;
-  line-height: 40rpx;
-  max-height: 86rpx;
-  overflow: hidden;
-  display: -webkit-box;
-  -webkit-line-clamp: 2;
-  -webkit-box-orient: vertical;
-  text-overflow: ellipsis;
-  word-break: break-all;
-}
-.prod-item .item-cont .prod-info .prod-info-cont {
-  position: relative;
+.DetailsOfRefund .refund-goods .good-list .good-item .info .desc{
   font-size: 24rpx;
   color: #AAAAAA;
-  margin-top: 20rpx;
-   overflow: hidden;
-    text-overflow: ellipsis;
-    display: -webkit-box;
-    -webkit-line-clamp: 2;
-    flex-direction: column
-}
-.prod-item .item-cont .prod-info .prod-info-cont .info-item {
-  color: #999;
-  height: 28rpx;
   margin-top: 10rpx;
-  font-size: 24rpx;
-  overflow: hidden;
-  display: -webkit-box;
-  -webkit-line-clamp: 1;
-  -webkit-box-orient: vertical;
-  text-overflow: ellipsis;
-  word-break: break-all;
-  width: 75%;
-}
-.spell-group-icon {
-  display: inline-block;
-  vertical-align: middle;
-  margin-right: 5rpx;
 }
-.group-text {
-  display: block;
-  font-size: 23rpx;
-  color: #fff;
-  background: #e43130;
-  padding: 6rpx 10rpx;
+.DetailsOfRefund .refund-goods .good-list .good-item .info .price{
+  color: #AAAAAA;
+  font-size: 24rpx;
 }
-.prod-item .item-cont .prod-info .prod-info-cont .number {
-  display: inline-block;
-  margin-right: 20rpx;
-  vertical-align: middle;
-  overflow: hidden;
-  display: -webkit-box;
-  -webkit-line-clamp: 1;
-  -webkit-box-orient: vertical;
-  text-overflow: ellipsis;
-  word-break: break-all;
-
+.DetailsOfRefund .refund-goods .good-list .good-item .price-box{
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+  align-items: flex-end;
 }
-.prod-item .price-nums {
-  margin-top: 20rpx;
+.DetailsOfRefund .refund-goods .good-list .good-item .price-box .price{
+  font-weight: bold;
+  font-size: 32rpx;
+  color: #FF4D3A;
 }
-.prod-item .price-nums .prodprice {
-  color: #e43130;
-  height: 50rpx;
-  line-height: 50rpx;
+.DetailsOfRefund .refund-goods .good-list .good-item .price-box .num{
   font-size: 24rpx;
-  float: left;
-}
-.prod-item .price-nums .btn-box {
-  float: right;
-  text-align: right;
+  color: #AAAAAA;
 }
-.prod-item .price-nums .btn-box .btn {
-  padding: 6rpx 30rpx;
-  line-height: 36rpx;
-  margin-left: 20rpx;
+.DetailsOfRefund .refund-goods .open-btn{
+  display: flex;
+  align-items: center;
+  justify-content: center;
   font-size: 24rpx;
-  display: inline-block;
-  border: 2rpx solid #e4e4e4;
-  border-radius: 50rpx;
-}
-
-/* 
-订单信息 */
-
-.order-msg {
-  background: #fff;
-  margin-top: 15rpx;
-  font-size: 30rpx;
-  padding: 0 20rpx;
-
+  color: #222222;
+  margin-top: 20rpx;
 }
-
-.order-msg .msg-item {
-  /* padding: 20rpx; */
+.DetailsOfRefund .refund-goods .open-btn .arrow{
+  width: 20rpx;
+  height: 20rpx;
 }
 
-.order-msg .msg-item:first-child {
-  border: 0;
+.DetailsOfRefund .goods-info{
+  padding: 24rpx;
 }
-
-.order-msg .msg-item .item {
+.DetailsOfRefund .goods-info .item{
   display: flex;
-  padding: 10rpx 0;
-  align-items: center;
   justify-content: space-between;
-}
+  padding-bottom: 28rpx;
 
-.order-msg .msg-item .item.payment {
-  border-top: 2rpx solid #f1f1f1;
-  color: #e43130;
-  padding-top: 30rpx;
 }
-
-.order-msg .msg-item .item .item-tit {
+.DetailsOfRefund .goods-info .item .label{
   font-size: 28rpx;
-  color: #222;
-  line-height: 48rpx;
+  color: #222222;
 }
 
-.order-msg .msg-item .item .item-txt {
-  flex: 1;
-  line-height: 48rpx;
+.DetailsOfRefund .goods-info .item .value{
+  font-weight: bold;
   font-size: 28rpx;
+  color: #FF4D3A;
 }
-
-.order-msg .msg-item .item  .copy-btn {
-  display: block;
-  margin-left: 20rpx;
-  border: 2rpx solid #bbb;
-  padding: 6rpx 24rpx;
-  padding-top: 10rpx;
-  border-radius: 50rpx;
-  font-size: 26rpx;
-  line-height: 28rpx;
-}
-
-.order-msg .msg-item .item .item-txt.price {
-  text-align: right;
-}
-
-/* 底部栏 */
-.order-detail-footer {
-  position: fixed;
-  bottom: 0;
-  left: -24rpx;
-  width: 100%;
-  max-width: 750rpx;
-  background: #fff;
-  margin: auto;
-  display: -webkit-flex;
-  display: -webkit-box;
-  display: -moz-box;
-  display: -ms-flexbox;
+.DetailsOfRefund .goods-info .total{
   display: flex;
-  padding: 24rpx 0;
-  font-size: 30rpx;
-  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
-}
-.order-detail-footer .dele-order {
-  margin-left: 20rpx;
-  line-height: 60rpx;
-  display: block;
-  margin-right: 20rpx;
-  width: 150rpx;
-  text-align: center;
+  justify-content: space-between;
+  padding-top: 28rpx ;
+  border-top: 2rpx solid #F0F0F0;
 }
-.order-detail-footer .footer-box {
-  flex: 1;
-  text-align: right;
-  line-height: 60rpx;
-}
-.order-detail-footer .footer-box .buy-again {
-  font-size: 26rpx;
-  color: #fff;
-  background: #e43130;
-  border-radius: 50rpx;
-  padding: 10rpx 20rpx;
-  margin-right: 20rpx;
-}
-.order-detail-footer .footer-box .apply-service {
-  display: inline-block;
-  font-size: 26rpx;
-  border-radius: 50rpx;
-  border: 1px solid #bbb;
-  margin-right: 20rpx;
-  background: #fff; 
-  color: #555;
-  line-height: 1em;
-  padding: 15rpx 25rpx;
-  vertical-align: middle;
+.DetailsOfRefund .goods-info .total .label{
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #222222;
 }
-.order-detail-footer .footer-box .apply-service::after{
-  border:0;
+.DetailsOfRefund .goods-info .total .value{
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #FF4D3A;
 }
-.clearfix:after {
-  content: " ";
-  display: table;
-  clear: both;
+
+.DetailsOfRefund .order-info{
+  padding: 28rpx 24rpx;
 }
-/* 底部整单退款 */
-.refund-full{
-  position: relative;
-  bottom: 0;
-  font-size: 26rpx;
-  padding:  12rpx 25rpx;
+.DetailsOfRefund .order-info .title{
+  font-weight: bold;
+  font-size: 32rpx;
+  color: #222222;
 }
-
-/* 根据状态显示不同的颜色 */
-
-.order-state {
-  padding: 20rpx;
-  /* margin-right: 20rpx; */
+.DetailsOfRefund .order-info .item{
+  padding-top: 28rpx;
+  display: flex;
+  justify-content: space-between;
 }
-
-/* 店铺 */
-.shop-box {
-  display: inline-block;
+.DetailsOfRefund .order-info .item .label{
+  font-size: 28rpx;
+  color: #AAAAAA;
 }
-.shop-icon {
-  display: inline-block;
-  width: 35rpx;
-  height: 35rpx;
-  margin-right: 15rpx;
-  vertical-align: middle;
+.DetailsOfRefund .order-info .item .value-box{
+  display: flex;
+  align-items: center;
 }
-.shop-icon > image {
-  width: 100%;
-  height: 100%;
+.DetailsOfRefund .order-info .item .value-box .icon{
+  width: 30rpx;
+  height: 30rpx;
+  margin-left: 20rpx;
 }
-.shop-name {
-  display: inline-block;
-  vertical-align: middle;
+.DetailsOfRefund .order-info .item .value{
   font-weight: bold;
   font-size: 28rpx;
   color: #222222;
-}
-
-.order-sts{
-  font-weight: bold;
-  font-size: 36rpx;
-  color: #222222;
-  margin-bottom: 20rpx;
-}
-
-.order-state .order-sts.gray {
-  color: #777777;
-  height: 32rpx;
-  line-height: 32rpx;
-}
-
-.order-state .order-sts.normal {
-  color: #333;
-}
+}

+ 424 - 0
pages/order-detail2/order-detail.js

@@ -0,0 +1,424 @@
+// pages/order-detail/order-detail.js
+
+var http = require('../../utils/http.js');
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    statusObject: {
+      0: '待支付',
+      20: '订单已接单',
+      30: '订单待配送',
+      40: '订单配送中',
+      50: '订单取消待审核',
+      60: '订单已取消',
+      70: '订单已送达',
+      80: '订单已完成'
+    },
+    totalUsableScore:0,
+    dvyType:'',//配送方式
+    orderItemDtos: [],
+    remarks: "",
+    actualTotal: 0,
+    canRefund:false,
+    userAddrDto: null,
+    orderNumber: "",
+    createTime: "",
+    status: 0,
+    productTotalAmount: '',
+    transfee: '',
+    totalNum:0,
+    reduceAmount: '',
+    prodid: '',
+    orderType: 0,
+    shopName: '', //店铺名称
+    canRefund: false, // 能否退款
+    canAllRefund: false, // 能否整单退款
+    isLastProd: false,  //最后一款商品
+    irrevocable: false,  //不可撤销
+    sum: [],  //本单已申请单个退款的商品数组
+    orderScore: 0, // 整单使用积分
+    orderNumSend:''
+  },
+
+  //跳转商品详情页
+  toProdPage: function(e) {
+    var prodid = e.currentTarget.dataset.prodid;
+    if(this.data.orderType==3){
+      console.log('积分商品')
+      wx.navigateTo({
+        url: '/pages/convertProdDet/convertProdDet?prodid=' + prodid,
+      })
+    }else{
+      wx.navigateTo({
+        url: '/pages/prod/prod?prodid=' + prodid,
+      })
+    }
+  },
+
+  /**
+   * 是否最后一个商品在执行单个商品退款事件
+   */
+  applyLastProdRefund: function() {
+    if(this.data.status==2) { //待发货状态下
+      // 遍历商品list
+      if(this.data.orderItemDtos.length > 1) {  //如果商品列表长度大于1
+        let sum = []
+        this.data.orderItemDtos.forEach((el,index) => {
+          if (el.refundSn) { //如果拥有退款单号
+            sum.push(el)
+            this.setData({
+              sum
+            })
+          }
+        })
+        console.log(this.data.sum)
+        if(this.data.sum.length == this.data.orderItemDtos.length-1) {
+          // 如果拥有退款单号的item等于商品列表数据长度-1,那么点击的这件商品就是最后意见商品
+          this.setData({
+            isLastProd: true
+          })
+        }else if(this.data.sum.length == this.data.orderItemDtos.length) {
+          // 如果拥有退款单号的item等于商品列表数据长度,那么不可撤销申请
+          this.setData({
+            irrevocable: true  //不可撤销
+          })
+        }
+      }
+      console.log('isLastProd:',this.data.isLastProd)
+      console.log('irrevocable:',this.data.irrevocable)
+    }
+  },
+
+   /**
+   * 付款
+   */
+  onPayAgain: function (e) {
+    wx.showLoading({
+      mask: true
+    });
+    var ths = this;
+    var orderType = this.data.orderType;
+    var params = {
+      url: "/p/order/pay",
+      method: "POST",
+      data: {
+        orderType: orderType ? orderType : 0,
+        payType: 1,
+        orderNumbers: this.data.orderNumber
+      },
+      callBack: res => {
+        //console.log(res);
+        wx.hideLoading();
+        wx.requestPayment({
+          timeStamp: res.timeStamp,
+          nonceStr: res.nonceStr,
+          package: res.package,
+          signType: res.signType,
+          paySign: res.paySign,
+          success: function () {
+            ths.loadOrderDetail(this.data.orderNumber)  //请求订单详情数据
+            // wx.navigateTo({
+            //   url: '/pages/pay-result/pay-result?sts=1&orderNumbers=' + e.currentTarget.dataset.ordernum,
+            // })
+          },
+          fail: function (err) {
+            //console.log("支付失败");
+          }
+        })
+      }
+    };
+    http.request(params);
+  },
+
+   //删除已完成||已取消的订单
+   delOrderList: function (e) {
+    var ths = this
+    wx.showModal({
+      title: '',
+      content: '确定要删除此订单吗?',
+      confirmColor: "#FF941A",
+      success(res) {
+        if (res.confirm) {
+          var ordernum = e.currentTarget.dataset.ordernum;
+          wx.showLoading();
+          var params = {
+            url: "/p/myOrder/" + ordernum,
+            method: "DELETE",
+            data: {},
+            callBack: function (res) {
+              ths.loadOrderData(ths.data.sts, 1);
+              wx.hideLoading();
+            }
+          }
+          http.request(params);
+        } else if (res.cancel) {
+          console.log('用户点击取消')
+        }
+      }
+    })
+  },
+
+    /**
+   * 取消订单
+   */
+  onCancelOrder: function (e) {
+    var ths = this;
+    wx.showModal({
+      title: '',
+      content: '要取消此订单?',
+      confirmColor: "#FF941A",
+      cancelText: '否',
+      confirmText: '是',
+      success(res) {
+        if (res.confirm) {
+          wx.showLoading({
+            mask: true
+          });
+
+          var params = {
+            url: "/p/myOrder/cancel/" + ths.data.orderNumber,
+            method: "PUT",
+            data: {},
+            callBack: function (res) {
+              //console.log(res);
+              ths.loadOrderDetail(ths.data.orderNumber)  //请求订单详情数据
+              wx.hideLoading();
+            }
+          };
+          http.request(params);
+        } else if (res.cancel) {
+          //console.log('用户点击取消')
+        }
+      }
+    })
+  },
+
+  /**
+   * 申请退款
+   */
+  applyRefund: function(e) {
+      var item = {}
+      item.orderNumber = this.data.orderNumber;
+      item.actualTotal = this.data.actualTotal;
+      item.transfee = this.data.transfee;
+      item.status = this.data.status; //订单状态
+      item.orderItemDtos = this.data.orderItemDtos;
+      item.totalNum = this.data.totalNum
+      item.orderScore = this.data.orderScore,  // 整单积分
+      item.userAddrDto = this.data.userAddrDto,  // 用户信息
+      //拿到存储在本地的订单项数据
+      wx.setStorageSync("refundItem", item);
+ 
+      wx.redirectTo({ //通过wx.redirectTo实现跳转(关闭当前页面,跳转到应用内某个页面)
+        url: '/pages/applyRefund/applyRefund',
+      })
+ 
+  },
+  // applyRefund: function(e) {
+  //   var refundType = e.currentTarget.dataset.refundtype // 退款类型 1整单  2单个物品
+  //   var status = this.data.status
+  //   this.loadOrderDetail(this.data.orderNumber)  //请求订单详情数据
+  //   if (e.currentTarget.dataset.refundtype == 1) { //整单退款
+  //     var item = {}
+  //     item.orderNumber = this.data.orderNumber;
+  //     item.actualTotal = this.data.actualTotal;
+  //     item.transfee = this.data.transfee;
+  //     item.status = this.data.status; //订单状态
+  //     item.orderItemDtos = this.data.orderItemDtos;
+  //     item.orderScore = this.data.orderScore,  // 整单积分
+  //     item.userAddrDto = this.data.userAddrDto,  // 用户信息
+  //     //拿到存储在本地的订单项数据
+  //     wx.setStorageSync("refundItem", item);
+  //     // console.log('订单详情页获取到的整单退item:',item)
+  //   } else if(e.currentTarget.dataset.refundtype == 2) { //单个商品退款
+  //     this.applyLastProdRefund() //是否最后一个商品执行单个商品退款
+  //     console.log('isLastProd:',this.data.isLastProd)
+  //     // 将数据存储到本地
+  //     var item = e.currentTarget.dataset.item;
+  //     if(this.data.orderItemDtos.length == 1) {
+  //       item.addTransfee = true
+  //     }else {
+  //       item.addTransfee = false
+  //     }
+  //     item.orderNumber = this.data.orderNumber;
+  //     item.transfee = this.data.transfee;
+  //     item.status = this.data.status; //订单状态
+  //     item.isLastProd = this.data.isLastProd?this.data.isLastProd:undefined //是否最后一款商品
+  //     //拿到存储在本地的订单项数据
+  //     wx.setStorageSync("refundItem", item);
+  //     console.log(item)
+  //     console.log(item.actualTotal)
+  //   }
+  //   /**
+  //    * 判断跳转页面(根据订单是否已发货)
+  //    */
+  //   var type = e.currentTarget.dataset.type;
+    
+  //   // if (status == 2) {   //待发货,直接跳转到申请页,不需要选择退货方式
+  //     wx.redirectTo({ //通过wx.redirectTo实现跳转(关闭当前页面,跳转到应用内某个页面)
+  //       url: '/pages/applyRefund/applyRefund?type=' + type + '&refundType=' + refundType,
+  //     })
+  //   // } else  {  //已发货,跳转到选择退货方式页
+  //   //   wx.redirectTo({
+  //   //     url: '/pages/chooseRefundWay/chooseRefundWay?refundType=' + refundType
+  //   //   })
+  //   // }
+  // },
+
+
+  /**
+   * 查看退款
+   */
+  viewRefund: function(e) {
+    var refundSn = e.currentTarget.dataset.refundsn;
+    this.applyLastProdRefund() //是否最后一个商品执行单个商品退款
+    console.log(this.data.irrevocable)
+    wx.navigateTo({
+      url: '/pages/DetailsOfRefund/DetailsOfRefund?refundSn=' + refundSn + '&irrevocable=' + this.data.irrevocable+'&userAddrDto='+JSON.stringify(this.data.userAddrDto) +'&orderNumber=' + this.data.orderNumSend
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function(options) {
+    this.setData({
+      orderNumSend:options.orderNum
+    })
+    this.loadOrderDetail(options.orderNum);
+  },
+
+  /**
+   * 加载订单数据
+   */
+  loadOrderDetail: function(orderNum) {
+    var ths = this;
+    wx.showLoading();
+    //加载订单详情
+    var params = {
+      url: "/p/myOrder/orderDetail",
+      method: "GET",
+      data: {
+        orderNumber: orderNum
+      },
+      callBack: function(res) {
+        let img=''
+        res.orderItemDtos.forEach(e=>{
+          img=e.pic.split(',')
+          e.pic=img[0]
+        })
+
+        var dvyType
+        if(res.dvyType == 1){
+          dvyType = '运费(快递)'
+        }else if(res.dvyType == 3){
+          dvyType = '配送费(即时配送)'
+        }else{
+          dvyType = '自提'
+        }
+        ths.setData({
+          totalUsableScore:res.totalUsableScore,
+          dvyType:dvyType,
+          orderNumber: orderNum,
+          actualTotal: res.actualTotal, //实际支付总额(商品总额+运费)
+          canRefund:res.canRefund,
+          userAddrDto: res.userAddrDto,
+          remarks: res.remarks,
+          orderItemDtos: res.orderItemDtos,
+          createTime: res.createTime,
+          status: res.status,
+          // status: res.status,//海博订单状态
+          productTotalAmount: res.total, //所有商品总额
+          transfee: res.transfee, //运费
+          totalNum:res.totalNum,
+          reduceAmount: res.reduceAmount,
+          orderType: res.orderType,
+          shopName: res.shopName,
+          canRefund: res.canRefund,
+          canAllRefund: res.canAllRefund,
+          orderScore: res.orderScore, // 整单使用积分
+
+        });
+        
+        wx.hideLoading();
+      }
+    };
+    http.request(params);
+
+  },
+
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function() {
+
+  },
+
+  toGroupDetails: function(e) {
+    wx.navigateTo({
+      url: '/pages/spellGroupDetails/spellGroupDetails?orderNumber=' + e.currentTarget.dataset.ordernumber,
+    })
+  },
+
+
+  // 一键复制事件
+  copyBtn: function(e) {
+    var ths = this;
+    wx.setClipboardData({
+      //准备复制的数据
+      data: ths.data.orderNumber,
+      success: function(res) {
+        wx.showToast({
+          title: '复制成功',
+        });
+      }
+    })
+  },
+
+})

+ 4 - 0
pages/order-detail2/order-detail.json

@@ -0,0 +1,4 @@
+{
+  "backgroundTextStyle": "light",
+  "navigationBarTitleText": "订单详情"
+}

+ 212 - 0
pages/order-detail2/order-detail.wxml

@@ -0,0 +1,212 @@
+<!--pages/order-detail/order-detail.wxml-->
+
+  <!-- 地址 -->
+  <view class='order-detail'>
+    
+    <view class="order-sts">{{statusObject[status]}}</view>
+
+    <view class="pay-box" wx:if="{{status == 0}}">
+    
+      <view class="pay-btn-box">
+        <view class="cancel-btn" bindtap="onCancelOrder">取消订单</view>
+        <view class="pay-btn" bindtap="onPayAgain">立即支付¥{{actualTotal}}</view>
+      </view>
+    </view>
+
+    <view class="oprate-box box">
+      <view class="item" wx:if="{{status == 60}}" bindtap="delOrderList" data-ordernum="{{orderNumber}}">
+        <image class="icon" src="../../images/icon/del-icon.png" mode=""/>
+        <view class="label">
+          删除订单
+        </view>
+      </view>
+      <button class='item' open-type="contact" wx:if="{{status >= 20&&status != 60}}">
+        <image class="icon" src="../../images/icon/chat-icon.png" mode=""/>
+        <view class="label">
+          联系商家
+        </view>
+     </button>
+     <view class="item" wx:if="{{status !=0 &&canRefund}}" bind:tap="applyRefund">
+        <image class="icon" src="../../images/icon/apply.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">
+          再次购买
+        </view>
+      </view> -->
+      
+    </view>
+
+    <view class='delivery-addr box'>
+      <view class='user-info'>
+        <text class='item'>{{userAddrDto.receiver}}</text>
+        <text class='item'>{{userAddrDto.mobile}}</text>
+      </view>
+      <view class='addr'>{{userAddrDto.address}}{{userAddrDto.addressName}}{{userAddrDto.addrDetail}}</view>
+    </view>
+
+    <!-- 商品信息 -->
+    <view class='prod-item box'>
+      <view class="order-num">
+        <view class='order-state clearfix'>
+          <!-- 店铺 -->
+          <view class="shop-box">
+            <view class="shop-icon">
+              <image src="../../images/icon/shop.png"></image>
+            </view>
+            <view class="shop-name">{{shopName}}</view>
+          </view>
+          <!-- /店铺 -->
+          <!-- <text class="order-sts  gray">{{['','待支付','待发货','待收货','已完成','已完成','已取消','拼团中'][status]}}</text> -->
+        </view>
+      </view>
+      <block wx:for="{{orderItemDtos}}" wx:key='prodId'>
+        <view class='item-cont' bindtap='toProdPage' data-prodid="{{item.prodId}}">
+          <view class='prod-pic'>
+            <image src='{{item.pic}}'></image>
+          </view>
+          <!-- 拼团商品展示icon -->
+          <view class="spell-group-icon">
+            <text class="group-text" wx:if="{{item.orderType!=null}}">{{['','拼团','秒杀','积分'][orderType]}}</text>
+          </view>
+          <view class='prod-info'>
+            <view class='prodname'>
+              {{item.prodName}}
+            </view>
+            <view class='prod-info-cont'>
+              <!-- 拼团icon -->
+              <view class="spell-group-icon" wx:if="{{orderType}}">
+                <!-- orderType 订单类型(0普通订单 1团购订单 2秒杀订单) -->
+                <text class="group-text">{{['','拼团','秒杀','积分'][orderType]}}</text>
+              </view>
+              <!-- /拼团icon -->
+              <view class='number'>{{item.skuName||''}} {{item.prodCount}} 件</view>
+              <!-- <text class='info-item'>{{item.skuName}}</text> -->
+            </view>
+            <view class='price-nums clearfix'>
+              <text class='prodprice'><text wx:if="{{item.price}}" class='symbol'>¥</text>
+                <text wx:if="{{item.price}}" class='big-num'>{{wxs.parsePrice(item.price)[0]}}</text>
+                <text wx:if="{{item.price}}" class='small-num'>.{{wxs.parsePrice(item.price)[1]}}</text>
+                <text wx:if="{{item.price && orderType==3}}" class='small-num'>+</text>
+                <text class='big-num' wx:if="{{orderType==3}}">{{item.useScore}} 积分</text>
+              </text>
+              <!-- <view class='btn-box'>
+                <text class='btn'>申请售后</text>
+                <text class='btn'>加购物车</text>
+              </view> -->
+            </view>
+          </view>
+          <!-- 申请退款btn -->
+          <!-- <text class="apply-refund-btn" catchtap="applyRefund" data-itemactualtotal="{{item.actualTotal}}" data-item="{{item}}" wx:if="{{!item.refundSn && canRefund && orderType !=3||item.status==6}}" data-refundtype="2" data-type="{{status == 2?'1':'2'}}">申请退款</text> -->
+          <!-- <text class="apply-refund-btn" catchtap="viewRefund" data-ordernumber='{{item.orderNumber}}' data-refundsn="{{item.refundSn}}" wx:if="{{item.refundSn}}">查看退款</text> -->
+          <!-- 申请退款btn -->
+        </view>
+      </block>
+      <view class='prod-foot'>
+        <view class='btn'>
+          <button wx:if="{{item.status==0}}" class="button" bindtap="onCancelOrder" data-ordernum="{{item.primaryOrderNo}}" hover-class='none'>取消订单</button>
+          <!-- <button wx:if="{{item.status==1}}" class="button warn" bindtap="onConfirmReceive" data-ordernum="{{item.primaryOrderNo}}" hover-class='none'>再次购买</button> -->
+          <button wx:if="{{item.status==1}}" class="button warn" bindtap="onPayAgain" data-ordernum="{{item.primaryOrderNo}}" hover-class='none'>付款</button>
+          <button wx:if="{{item.status==3 || item.status==5}}" class="button" bindtap="toDeliveryPage" data-ordernum="{{item.primaryOrderNo}}" hover-class='none'>查看物流</button>
+          <button wx:if="{{item.status==3}}" class="button warn" bindtap="onConfirmReceive" data-ordernum="{{item.primaryOrderNo}}" hover-class='none'>确认收货</button>
+        </view>
+      </view>
+    </view>
+
+    <view class='order-msg box'>
+      <view class='msg-item'>
+        <view class='item'>
+          <view class='item-tit'>商品总额:</view>
+          <view class='item-txt price'>
+            <text class='symbol'>¥</text>
+            <text class='big-num'>{{wxs.parsePrice(productTotalAmount)[0]}}</text>
+            <text class='small-num'>.{{wxs.parsePrice(productTotalAmount)[1]}}</text>
+          </view>
+        </view>
+        <view class='item'>
+          <!-- <view class='item-tit'>运费:</view> -->
+          <view class='item-tit'>{{dvyType}}:</view>
+          <view class='item-txt price'>
+            <text class='symbol'>¥</text>
+            <text class='big-num'>{{wxs.parsePrice(transfee)[0]}}</text>
+            <text class='small-num'>.{{wxs.parsePrice(transfee)[1]}}</text>
+          </view>
+        </view>
+        <view class='item'>
+          <view class='item-tit'>
+          <!-- <text class="item-tit" wx:if="{{orderType && orderType!=3}}">{{orderType==1?'团购':'秒杀'}}</text> -->
+          <!-- 优惠: -->
+          积分({{totalUsableScore}}):
+          </view>
+          <view class='item-txt price'>
+            <text class='symbol'>-¥</text>
+            <text class='big-num'>{{wxs.parsePrice(reduceAmount)[0]}}</text>
+            <text class='small-num'>.{{wxs.parsePrice(reduceAmount)[1]}}</text>
+          </view>
+        </view>
+        <view class='item payment'>
+          <view class='item-txt price'>
+            订单总额:
+            <text class='symbol' wx:if="{{actualTotal && actualTotal > 0}}">¥</text>
+            <text class='big-num' wx:if="{{actualTotal && actualTotal > 0}}">{{wxs.parsePrice(actualTotal)[0]}}</text>
+            <text class='small-num' wx:if="{{actualTotal && actualTotal > 0}}">.{{wxs.parsePrice(actualTotal)[1]}}</text>
+            <text class='small-num' wx:if="{{(actualTotal && actualTotal > 0) && (orderType==3 || orderScore > 0)}}">+</text>
+            <text class='big-num' wx:if="{{orderType==3 || totalUsableScore > 0}}">{{totalUsableScore}} <text class='small-num'>积分</text></text>
+          </view>
+        </view>
+      </view>
+    </view>
+
+    <!-- 订单信息 -->
+    <view class='order-msg box'>
+    <view class="sub-title">订单信息</view>
+      <view class='msg-item'>
+        <view class='item'>
+          <text class='item-tit'>订单编号:</text>
+          <text class='item-txt'>{{orderNumber}}</text>
+          <text class='copy-btn' bindtap='copyBtn'>复制</text>
+        </view>
+        <view class='item'>
+          <text class='item-tit'>下单时间:</text>
+          <text class='item-txt'>{{createTime}}</text>
+        </view>
+      </view>
+      <view class='msg-item'>
+        <view class='item'>
+          <text class='item-tit'>支付方式:</text>
+          <text class='item-txt'>微信支付</text>
+        </view>
+        <!-- <view class='item'>
+          <text class='item-tit'>配送方式:</text>
+          <text class='item-txt'>普通配送</text>
+        </view> -->
+        <view class='item'>
+          <text class='item-tit'>订单备注:</text>
+          <text class='item-txt'>{{remarks?remarks:''}}</text>
+        </view>
+      </view>
+    </view>
+
+    
+
+    <!-- 底部栏 -->
+    <view class='order-detail-footer'>
+      <!-- <text class='dele-order' wx:if="{{status==5||status==6}}" bindtap='delOrderList' data-ordernum="{{orderNumber}}">删除订单</text> -->
+      <view class='footer-box'>
+        <!-- <text class="apply-refund-btn refund-full" data-refundtype="1" catchtap="applyRefund" wx:if="{{canAllRefund && orderType!=3}}" data-type="{{status == 2?'1':'2'}}">整单退款</text> -->
+        <!-- <text class="apply-refund-btn refund-full" data-refundtype="1" catchtap="applyRefund" data-type="{{status == 2?'1':'2'}}">整单退款</text>
+        <button class='apply-service foot-btn' open-type="contact">联系客服</button> -->
+        <!-- <text class='buy-again'>再次购买</text> -->
+
+        <!-- 【团购按钮】 -->
+        <!-- <button class='apply-service foot-btn' bindtap="toGroupDetails" data-ordernumber='{{orderNumber}}' wx:if="{{orderType==1}}">查看团购详情</button> -->
+        <!-- 【团购按钮】 -->
+      </view>
+    </view>
+
+  </view>
+<wxs module="wxs" src="../../wxs/number.wxs" />

+ 537 - 0
pages/order-detail2/order-detail.wxss

@@ -0,0 +1,537 @@
+/* pages/order-detail/order-detail.wxss */
+.clearfix:after {
+  content: ".";
+  display: block;
+  height: 0;
+  clear: both;
+  visibility: hidden;
+}
+
+image {
+  width: 100%;
+  height: 100%;
+}
+page {
+ 
+}
+.display {
+  display: none!important;
+}
+
+/* 头部流程-等待商家发货 */
+.process {
+  padding: 20rpx;
+  font-size: 28rpx;
+  border-bottom: 1px solid #f2f2f2;
+  background: #fff;
+}
+.process-top {
+  padding: 20rpx 0;
+  margin-top: 10rpx;
+}
+.shop-icon {
+  width: 70rpx;
+  height: 70rpx;
+  margin-right: 15rpx;
+  vertical-align: middle;
+}
+.wait {
+  vertical-align: middle;
+}
+/* 进程 */
+.process-list {
+  position: relative;
+  padding-top: 30rpx;
+  padding-bottom: 15rpx;
+  display: flex;
+  justify-content: space-between;
+}
+.process-item {
+  font-size: 25rpx;
+  color: #aaa;
+  text-align: center;
+}
+.buyers-pay {
+  text-align: left;
+}
+.successful {
+  text-align: right;
+}
+.current-txt {
+  color: #17b606;
+}
+.item-icon {
+  width: 20rpx;
+  height: 20rpx;
+}
+.solid-round {
+  display: inline-block;
+  width: 12rpx;
+  height: 12rpx;
+  background: #bbb;
+  border-radius: 50%;
+}
+/* 进度条 */
+.line {
+  position: absolute;
+  bottom: 28rpx;
+  height: 3rpx;
+  background: #f0f0f0;
+}
+.line-current {
+  background: #46b229;
+}
+.line01 {
+  left: 33rpx;
+  width: 42%;
+}
+.line02 {
+  right: 33rpx;
+  width: 42%;
+}
+.spell-line01 {
+  width: 25%;
+  left: 33rpx;
+}
+.spell-line02 {
+  width: 25%;
+  left: 255rpx;
+}
+.spell-line03 {
+  width: 25%;
+  right: 33rpx;
+}
+
+
+/*  地址  */
+.order-detail {
+  margin-bottom: 120rpx;
+  font-size: 30rpx;
+  padding: 20rpx 24rpx 200rpx;
+  background: #F9F9F9;
+  min-height: 100vh;
+  color: #222;
+  
+}
+
+.sub-title{
+  font-weight: bold;
+  font-size: 32rpx;
+  color: #222222;
+  padding: 24rpx 0;
+}
+
+.pay-btn-box{
+  display: flex;
+  justify-content: space-between;
+}
+.pay-btn-box .cancel-btn{
+  width: 226rpx;
+  height: 68rpx;
+  line-height: 68rpx;
+  text-align: center;
+  background: #FFFFFF;
+  border-radius: 60rpx 60rpx 60rpx 60rpx;
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #AAAAAA;
+}
+.pay-btn-box .pay-btn{
+  width: 456rpx;
+  height: 68rpx;
+  line-height: 68rpx;
+  text-align: center;
+  background: #FF941A;
+  border-radius: 60rpx 60rpx 60rpx 60rpx;
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #FFFFFF;
+}
+.order-detail .box{ 
+  background: #FFFFFF;
+  border-radius: 16rpx 16rpx 16rpx 16rpx;
+  margin-bottom: 20rpx;
+}
+
+.order-detail .oprate-box{
+  display: flex;
+  padding: 0 24rpx;
+  
+}
+.order-detail .oprate-box .item{
+  width: 25%;
+  text-align: center;
+  margin: 0;
+  border: none;
+  background-color: #fff !important;
+  padding: 24rpx 0;
+  display: block!important;
+  -webkit-tap-highlight-color: transparent;
+  outline: none;
+  line-height: normal;
+}
+.order-detail wx-button:after {
+  border: none;
+}
+.order-detail .oprate-box .item .icon{
+  width: 40rpx;
+  height: 40rpx;
+}
+
+.order-detail .oprate-box .item .label{
+  font-size: 28rpx;
+  color: #222222;
+  margin-top: 20rpx;
+}
+.order-detail .delivery-addr {
+  padding: 20rpx 30rpx;
+  background: #fff;
+}
+.order-detail .delivery-addr .user-info {
+  line-height: 48rpx;
+  word-wrap: break-word;
+  word-break: break-all;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 1;
+  -webkit-box-orient: vertical;
+  font-weight: bold;
+  font-size: 32rpx;
+  color: #222222;
+}
+.order-detail .delivery-addr .user-info .item {
+  font-size: 28rpx;
+  margin-right: 30rpx;
+  vertical-align: top;
+  display: inline-block;
+}
+.order-detail .delivery-addr .addr {
+  font-size: 28rpx;
+  line-height: 36rpx;
+  font-size: 28rpx;
+  color: #AAAAAA;
+  margin-top: 20rpx;
+}
+
+/* 商品列表 */
+.prod-item {
+  background-color: #fff;
+  margin-top: 15rpx;
+  font-size: 28rpx;
+}
+/* 拼团icon */
+/* .group-text {
+  font-size: 23rpx;
+  color: #fff;
+  background: #fe4443;
+  padding: 5rpx 10rpx;
+  border-radius: 8rpx;
+  position: absolute;
+  top: 40rpx;
+  left: 40rpx;
+
+} */
+
+.prod-item .item-cont .prod-pic image {
+  width: 180rpx;
+  height: 180rpx;
+}
+.prod-item .item-cont {
+  position: relative;
+  display: flex;
+  align-items: center;
+  padding: 20rpx 30rpx;
+  border-top: 2rpx solid #f1f1f1;
+}
+.prod-item .item-cont .prod-pic {
+  font-size: 0;
+  display: block;
+  width: 160rpx;
+  height: 160rpx;
+  overflow: hidden;
+  background: #fff;
+  margin-right: 16rpx;
+}
+.prod-item .item-cont .prod-pic image {
+  width: 100%;
+  height: 100%;
+}
+.prod-item .item-cont .prod-info {
+  margin-left: 10rpx;
+  font-size: 28rpx;
+  width: 100%;
+  position: relative;
+  -webkit-flex: 1;
+  -ms-flex: 1;
+  -webkit-box-flex: 1;
+  -moz-box-flex: 1;
+  flex: 1;
+}
+/* 申请退款按钮 */
+.apply-refund-btn {
+  position: absolute;
+  right: 20rpx;
+  bottom: 25rpx;
+  font-size: 23rpx;
+  padding: 7rpx 15rpx;
+  color: #e43130;
+  border: 1rpx solid #e43130;
+  border-radius: 30rpx;
+}
+
+.prod-item .item-cont .prod-info .prodname {
+  font-size: 30rpx;
+  line-height: 40rpx;
+  max-height: 86rpx;
+  overflow: hidden;
+  display: -webkit-box;
+  -webkit-line-clamp: 2;
+  -webkit-box-orient: vertical;
+  text-overflow: ellipsis;
+  word-break: break-all;
+}
+.prod-item .item-cont .prod-info .prod-info-cont {
+  position: relative;
+  font-size: 24rpx;
+  color: #AAAAAA;
+  margin-top: 20rpx;
+   overflow: hidden;
+    text-overflow: ellipsis;
+    display: -webkit-box;
+    -webkit-line-clamp: 2;
+    flex-direction: column
+}
+.prod-item .item-cont .prod-info .prod-info-cont .info-item {
+  color: #999;
+  height: 28rpx;
+  margin-top: 10rpx;
+  font-size: 24rpx;
+  overflow: hidden;
+  display: -webkit-box;
+  -webkit-line-clamp: 1;
+  -webkit-box-orient: vertical;
+  text-overflow: ellipsis;
+  word-break: break-all;
+  width: 75%;
+}
+.spell-group-icon {
+  display: inline-block;
+  vertical-align: middle;
+  margin-right: 5rpx;
+}
+.group-text {
+  display: block;
+  font-size: 23rpx;
+  color: #fff;
+  background: #e43130;
+  padding: 6rpx 10rpx;
+}
+.prod-item .item-cont .prod-info .prod-info-cont .number {
+  display: inline-block;
+  margin-right: 20rpx;
+  vertical-align: middle;
+  overflow: hidden;
+  display: -webkit-box;
+  -webkit-line-clamp: 1;
+  -webkit-box-orient: vertical;
+  text-overflow: ellipsis;
+  word-break: break-all;
+
+}
+.prod-item .price-nums {
+  margin-top: 20rpx;
+}
+.prod-item .price-nums .prodprice {
+  color: #e43130;
+  height: 50rpx;
+  line-height: 50rpx;
+  font-size: 24rpx;
+  float: left;
+}
+.prod-item .price-nums .btn-box {
+  float: right;
+  text-align: right;
+}
+.prod-item .price-nums .btn-box .btn {
+  padding: 6rpx 30rpx;
+  line-height: 36rpx;
+  margin-left: 20rpx;
+  font-size: 24rpx;
+  display: inline-block;
+  border: 2rpx solid #e4e4e4;
+  border-radius: 50rpx;
+}
+
+/* 
+订单信息 */
+
+.order-msg {
+  background: #fff;
+  margin-top: 15rpx;
+  font-size: 30rpx;
+  padding: 0 20rpx;
+
+}
+
+.order-msg .msg-item {
+  /* padding: 20rpx; */
+}
+
+.order-msg .msg-item:first-child {
+  border: 0;
+}
+
+.order-msg .msg-item .item {
+  display: flex;
+  padding: 10rpx 0;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.order-msg .msg-item .item.payment {
+  border-top: 2rpx solid #f1f1f1;
+  color: #e43130;
+  padding-top: 30rpx;
+}
+
+.order-msg .msg-item .item .item-tit {
+  font-size: 28rpx;
+  color: #222;
+  line-height: 48rpx;
+}
+
+.order-msg .msg-item .item .item-txt {
+  flex: 1;
+  line-height: 48rpx;
+  font-size: 28rpx;
+}
+
+.order-msg .msg-item .item  .copy-btn {
+  display: block;
+  margin-left: 20rpx;
+  border: 2rpx solid #bbb;
+  padding: 6rpx 24rpx;
+  padding-top: 10rpx;
+  border-radius: 50rpx;
+  font-size: 26rpx;
+  line-height: 28rpx;
+}
+
+.order-msg .msg-item .item .item-txt.price {
+  text-align: right;
+}
+
+/* 底部栏 */
+.order-detail-footer {
+  position: fixed;
+  bottom: 0;
+  left: -24rpx;
+  width: 100%;
+  max-width: 750rpx;
+  background: #fff;
+  margin: auto;
+  display: -webkit-flex;
+  display: -webkit-box;
+  display: -moz-box;
+  display: -ms-flexbox;
+  display: flex;
+  padding: 24rpx 0;
+  font-size: 30rpx;
+  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
+}
+.order-detail-footer .dele-order {
+  margin-left: 20rpx;
+  line-height: 60rpx;
+  display: block;
+  margin-right: 20rpx;
+  width: 150rpx;
+  text-align: center;
+}
+.order-detail-footer .footer-box {
+  flex: 1;
+  text-align: right;
+  line-height: 60rpx;
+}
+.order-detail-footer .footer-box .buy-again {
+  font-size: 26rpx;
+  color: #fff;
+  background: #e43130;
+  border-radius: 50rpx;
+  padding: 10rpx 20rpx;
+  margin-right: 20rpx;
+}
+.order-detail-footer .footer-box .apply-service {
+  display: inline-block;
+  font-size: 26rpx;
+  border-radius: 50rpx;
+  border: 1px solid #bbb;
+  margin-right: 20rpx;
+  background: #fff; 
+  color: #555;
+  line-height: 1em;
+  padding: 15rpx 25rpx;
+  vertical-align: middle;
+}
+.order-detail-footer .footer-box .apply-service::after{
+  border:0;
+}
+.clearfix:after {
+  content: " ";
+  display: table;
+  clear: both;
+}
+/* 底部整单退款 */
+.refund-full{
+  position: relative;
+  bottom: 0;
+  font-size: 26rpx;
+  padding:  12rpx 25rpx;
+}
+
+/* 根据状态显示不同的颜色 */
+
+.order-state {
+  padding: 20rpx;
+  /* margin-right: 20rpx; */
+}
+
+/* 店铺 */
+.shop-box {
+  display: inline-block;
+}
+.shop-icon {
+  display: inline-block;
+  width: 35rpx;
+  height: 35rpx;
+  margin-right: 15rpx;
+  vertical-align: middle;
+}
+.shop-icon > image {
+  width: 100%;
+  height: 100%;
+}
+.shop-name {
+  display: inline-block;
+  vertical-align: middle;
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #222222;
+}
+
+.order-sts{
+  font-weight: bold;
+  font-size: 36rpx;
+  color: #222222;
+  margin-bottom: 20rpx;
+}
+
+.order-state .order-sts.gray {
+  color: #777777;
+  height: 32rpx;
+  line-height: 32rpx;
+}
+
+.order-state .order-sts.normal {
+  color: #333;
+}

+ 16 - 17
pages/prod/prod.js

@@ -857,15 +857,14 @@ Page({
    */
   addToCart: function (event) {
     if(this.data.totalStocks == 0) return
-    let skuList = this.data.skuList[0]
-    console.log(333333,skuList);
-    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: "该商品暂无库存~",
@@ -926,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: "该商品暂无库存~",

+ 2 - 1
pages/user/user.js

@@ -39,6 +39,7 @@ Page({
    */
   onShow: function() {
     this.setData({
+      // isAuthInfo: Boolean(wx.getStorageSync('loginResult').userId),
       isAuthInfo: Boolean(wx.getStorageSync('loginResult').nickName),
       loginResult: wx.getStorageSync('loginResult')
     })
@@ -429,7 +430,7 @@ Page({
       url:'/p/score/scoreInfo',
       method:'GET',
       dontTrunLogin: true,
-      data:{},
+      data:{platform:1},
       callBack: res => {
         this.setData({
           userLevelInfo: res