Преглед на файлове

售后 订单页面编写

wenjie преди 1 седмица
родител
ревизия
7b319b7023
променени са 40 файла, в които са добавени 3951 реда и са изтрити 2577 реда
  1. 2 1
      app.json
  2. BIN
      images/icon/black-down-arrow.png
  3. BIN
      images/icon/copy.png
  4. BIN
      images/icon/make-integral.png
  5. BIN
      images/icon/photo.png
  6. BIN
      images/icon/warn.png
  7. BIN
      packageMemberIntegral/images/icon/integral-bg.png
  8. 26 22
      packageMemberIntegral/pages/integralIndex/integralIndex.wxml
  9. 55 55
      packageMemberIntegral/pages/integralIndex/integralIndex.wxss
  10. 7 1
      packageMemberIntegral/pages/integralSubmitOrder/integralSubmitOrder.js
  11. 9 613
      pages/DetailsOfRefund/DetailsOfRefund.js
  12. 1 3
      pages/DetailsOfRefund/DetailsOfRefund.json
  13. 138 244
      pages/DetailsOfRefund/DetailsOfRefund.wxml
  14. 181 518
      pages/DetailsOfRefund/DetailsOfRefund.wxss
  15. 670 0
      pages/DetailsOfRefund1/DetailsOfRefund.js
  16. 5 0
      pages/DetailsOfRefund1/DetailsOfRefund.json
  17. 267 0
      pages/DetailsOfRefund1/DetailsOfRefund.wxml
  18. 633 0
      pages/DetailsOfRefund1/DetailsOfRefund.wxss
  19. 63 522
      pages/applyRefund/applyRefund.js
  20. 1 3
      pages/applyRefund/applyRefund.json
  21. 82 141
      pages/applyRefund/applyRefund.wxml
  22. 233 370
      pages/applyRefund/applyRefund.wxss
  23. 636 0
      pages/applyRefund1/applyRefund.js
  24. 5 0
      pages/applyRefund1/applyRefund.json
  25. 165 0
      pages/applyRefund1/applyRefund.wxml
  26. 451 0
      pages/applyRefund1/applyRefund.wxss
  27. 3 2
      pages/basket/basket.js
  28. 3 2
      pages/category/category.js
  29. 35 14
      pages/locationAdd/locationAdd.wxml
  30. 31 3
      pages/locationAdd/locationAdd.wxss
  31. 89 0
      pages/order-detail/order-detail.js
  32. 55 41
      pages/order-detail/order-detail.wxml
  33. 48 6
      pages/order-detail/order-detail.wxss
  34. 1 1
      pages/orderList/orderList.wxml
  35. 2 1
      pages/pay-result/pay-result.js
  36. 3 2
      pages/prod/prod.js
  37. 7 1
      pages/submit-order/submit-order.js
  38. 27 8
      pages/submit-order/submit-order.wxml
  39. 16 2
      project.private.config.json
  40. 1 1
      utils/http.js

+ 2 - 1
app.json

@@ -151,6 +151,7 @@
     "van-empty": "@vant/weapp/empty/index",
     "van-toast": "@vant/weapp/toast/index",
     "navbar": "/components/topNavtar/topNavtar",
-    "van-loading": "@vant/weapp/loading/index"
+    "van-loading": "@vant/weapp/loading/index",
+    "van-action-sheet": "@vant/weapp/action-sheet/index"
   }
 }

BIN
images/icon/black-down-arrow.png


BIN
images/icon/copy.png


BIN
images/icon/make-integral.png


BIN
images/icon/photo.png


BIN
images/icon/warn.png


BIN
packageMemberIntegral/images/icon/integral-bg.png


+ 26 - 22
packageMemberIntegral/pages/integralIndex/integralIndex.wxml

@@ -1,31 +1,35 @@
 <!-- 积分商城 -->
 <view class="integral-index">
-  <view class="integral-msg">
-    <image src="../../images/icon/integral-bg.png" class="bg" />
-    <view class="my-integral">
-      <view class="number-box">
-        <view class="text">我的积分</view>
-        <view class="number">{{scoreInfo.score}}</view>
-      </view>
-      <view class="det" bindtap="navigateTo" data-path="scoreDet">
-        明细
-        <image src="../../../images/icon/white-arr.png" />
-      </view>
+  <view class="num-box">
+    <view class="num-item">
+      <view class="num">100</view>
+      <view class="desc">总充值积分</view>
     </view>
-    <view class="make" bindtap="navigateTo" data-path="scoreIndex">
-      <image src="../../../images/icon/make-integral.png" />
-      赚积分
+    <view class="num-item">
+      <view class="num">100</view>
+      <view class="desc">当前可用积分</view>
     </view>
-  </view>
-  <view class="integral-list">
-    <view class="member-tit">
-      <view class="text">积分兑换</view>
+    <view class="num-item">
+      <view class="num">100</view>
+      <view class="desc">已过期积分</view>
     </view>
-    <view class="con-box">
-      <block wx:for="{{scoreProdList}}" wx:for-item="prod" wx:key="prodId" >
-        <goodsitem prod="{{prod}}" bindtap="toScoreProdDet" data-scoreprodid="{{prod.prodId}}"></goodsitem>
-      </block>
+    <view class="num-item">
+      <view class="num">100</view>
+      <view class="desc">已消耗积分</view>
     </view>
+  </view>
+  <view class="integral-list">
+      <view class="title">可用积分记录</view>
+      <view class="item" wx:for="{{scoreProdList}}" wx:key="prodId" >
+        <view class="title-box">
+          <view class="title">购物</view>
+          <view class="num {{item.num>0?'green':''}}">{{item.num>0?'+':'-'}}{{item.num}}</view>
+        </view>
+        <view class="time-box">
+          <view class="time">9月17日 12:48</view>
+          <view class="total">当前可用积分 100</view>
+        </view>
+      </view>
     <view class="empty" wx:if="{{!scoreProdList.length}}">暂无数据</view>
     <view class="empty all" wx:if="{{current==pages}}">已经到底啦~</view>
   </view>

+ 55 - 55
packageMemberIntegral/pages/integralIndex/integralIndex.wxss

@@ -1,79 +1,79 @@
-/* 积分中心 */
-
-@import"../memberIndex/memberIndex.wxss";
 
-page {
-  background: #f6f7f9;
-}
-
-.integral-index {
-  position: relative;
-}
+/* 积分中心 */
 
-.integral-index .integral-msg {
-  width: 750rpx;
-  height: 290rpx;
-  position: relative;
+.integral-index{
+  padding: 20rpx 24rpx;
+  background: #F6F6F6;
+  min-height: 100vh;
 }
 
-.integral-index .integral-msg .bg {
-  position: absolute;
-  left: 0;
-  top: 0;
-  width: 100%;
-  height: 100%;
+.integral-index .num-box{
+  background: #FFFFFF;
+  border-radius: 16rpx 16rpx 16rpx 16rpx;
+  display: flex;
+  margin-bottom: 20rpx;
 }
-
-.integral-index .integral-msg .my-integral {
+.integral-index .num-box .num-item{
+  flex: 1;
   display: flex;
-  padding: 90rpx 30rpx 0;
-  color: #fff;
-  position: relative;
+  flex-direction: column;
   align-items: center;
 }
 
-.integral-index .integral-msg .my-integral .number-box .text {
-  font-size: 24rpx;
+.integral-index .num-box .num-item .num{
+  font-weight: bold;
+  font-size: 40rpx;
+  color: #222222;
+  margin-top: 28rpx;
 }
 
-.integral-index .integral-msg .my-integral .number-box .number {
-  font-size: 90rpx;
-  font-family: arial;
-  margin-top: 10rpx;
+.integral-index .num-box .num-item .desc{
+  font-size: 24rpx;
+  color: #222222;
+  padding: 12rpx 0 28rpx;
 }
 
-.integral-index .integral-msg .my-integral .det {
-  font-size: 24rpx;
-  margin-left: 20rpx;
-  margin-top: 76rpx;
+.integral-index .integral-list{
+  background: #FFFFFF;
+  border-radius: 16rpx 16rpx 16rpx 16rpx;
+  padding: 28rpx 24rpx;
+
+}
+.integral-index .integral-list .title{
+  font-weight: bold;
+  font-size: 32rpx;
+  color: #222222;
 }
 
-.integral-index .integral-msg .my-integral .det image {
-  width: 12rpx;
-  height: 20rpx;
+.integral-index .integral-list .item{
+  border-bottom: 1rpx solid #F0F0F0;
+  padding: 24rpx 0;
 }
 
-.integral-index .integral-msg .make {
-  position: absolute;
-  right: 30rpx;
-  bottom: 70rpx;
-  padding: 6rpx 12rpx 6rpx 6rpx;
-  background: #fff;
-  color: #ee3f0f;
-  font-size: 24rpx;
-  height: 42rpx;
-  line-height: 42rpx;
-  border-radius: 54rpx;
+.integral-index .integral-list .item .title-box,.time-box{
+  display: flex;
+  justify-content: space-between;
 }
 
-.integral-index .integral-msg .make image {
-  width: 42rpx;
-  height: 42rpx;
-  vertical-align: top;
-  margin-left: 4rpx;
+.integral-index .integral-list .item .title-box .title{
+  font-weight: bold;
+font-size: 28rpx;
+color: #222222;
 }
 
-/* 积分中心 */
+.integral-index .integral-list .item .title-box .num{
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #FF4D3A;
+}
+.integral-index .integral-list .item .title-box .num.green{
+  color: #42D86F;
+}
+.integral-index .integral-list .item .time-box{
+  font-size: 24rpx;
+  color: #AAAAAA;
+  margin-top: 20rpx;
+}
 
 .empty {
   display: block;

+ 7 - 1
packageMemberIntegral/pages/integralSubmitOrder/integralSubmitOrder.js

@@ -149,7 +149,13 @@ Page({
       },
       callBack: res => {
         wx.hideLoading();
-        this.calWeixinPay(res.orderNumbers);
+        if(res.nextPay){
+          this.calWeixinPay(res.orderNumbers);
+        }else{
+          wx.redirectTo({
+            url: `/pages/pay-result/pay-result?sts=1&orderNumbers=${res.orderNumbers}&orderType=${this.data.orderType}`,
+          })
+        }
       }
     };
     http.request(params);

+ 9 - 613
pages/DetailsOfRefund/DetailsOfRefund.js

@@ -1,670 +1,66 @@
 // pages/DetailsOfRefund/DetailsOfRefund.js
-var http = require('../../utils/http.js');
-var util = require('../../utils/util.js');
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-    showView: true, //隐藏是展示
-    applyTime: '', //申请时间
-    applyType: 1, //申请类型:1,仅退款,2退款退货
-    goodsNum: '', //退货数量
-    handelTime: '', //卖家处理时间
-    orderAmount: '', //订单总金额
-    orderItems: {}, //订单项 
-    refundAmount: '', //退款金额
-    refundDelivery: [], //收货地址对象
-    refundId: '', //记录ID
-    refundTime: '', //退款时间
-    returnMoneySts: 1, //处理退款状态:(1.买家申请 2.卖家接受 3.买家发货 4.卖家收货 5.退款成功 6.买家撤回申请 7.商家拒绝 -1.退款关闭)
-    updateTime: '', //更新时间
-    refundSn: '', //退款编号
-    rejectMessage: '', //拒绝理由
-    buyerReason: '', //退款原因
-    shopName: '', //店铺名称
-    refundScore: 0, // 退款积分
-    addCarshow: false,
-    selectTimeshow: false,
-    flowShow: false,
-    userAddrDto: {},
-    payer: '',
-    sendPay:'',
-    sts: 0,
-    nomDay: '',
-    tomorrowDay: '',
-    timeIntervals: [],
-    columns: [],
-    combinedTextValue: '',
-    sendInfo: {},
-    currentSelectedIndex: -1, // 初始没有选中项,索引设为 -1
-    steps: [{
-        text: '步骤一',
-        desc: '描述信息',
-        inactiveIcon: 'location-o',
-        activeIcon: 'success',
-      },
-      {
-        text: '步骤二',
-        desc: '描述信息',
-        inactiveIcon: 'circle',
-        activeIcon: 'plus',
-      },
-      {
-        text: '步骤三',
-        desc: '描述信息',
-        inactiveIcon: 'circle',
-        activeIcon: 'cross',
-      },
-      {
-        text: '步骤四',
-        desc: '描述信息',
-        inactiveIcon: 'circle',
-        activeIcon: 'fail',
-      },
-    ],
-    cancelPay: false,
-    remainingTime: '',
-    timeFormat: '',
-    orderNumSend:'',
-    countdown_hours:'',
-    countdown_minutes:''
+    
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function (options) {
-    this.setData({
-      orderNumSend:options.orderNumber
-    })
-    this.getTime()
-    this.setData({
-      refundSn: options.refundSn,
-    });
-    if(options.userAddrDto){
-      this.setData({
-        userAddrDto: JSON.parse(options.userAddrDto)
-      })
-    }
-    //获取退款申请详情
-    this.getRefundDetail()
-  },
-
-  /**
-   * 更多说明&收起
-   */
-  onChangeShowState: function () {
-    var that = this;
-    that.setData({
-      showView: (!that.data.showView)
-    })
-  },
-  // 发起配送
-  sendDistribution: function () {
-    this.setData({
-      addCarshow: true
-    })
-  },
-  onClose: function () {
-    this.setData({
-      addCarshow: false
-    })
-  },
-  timeOnClose: function () {
-    this.setData({
-      selectTimeshow: false
-    })
-  },
-  submitBtn:function(){
-    if (Object.keys(this.data.sendInfo).length === 0) {
-      wx.showToast({
-        title: '请先选择取件时间',
-        icon: 'none'
-      })
-      return
-    }
-    this.submitExpress()
-  },
-  submitExpress:function(){
-    var params = {
-      url: `/p/orderRefund/submitExpress/${this.data.refundSn}`,
-      method: "GET",
-      callBack: res => {
-        wx.showToast({
-          title: '提交成功',
-          icon: 'none',
-        })
-        this.setData({
-          addCarshow:false
-        })
-        this.getRefundDetail()
-      }
-    };
-    http.request(params);
-  },
-  // 辅助函数,将中文日期格式转换为YYYY-MM-DD格式
-  formatDate: function (dateStr) {
-    let parts = dateStr.match(/(\d+)月(\d+)日/);
-    if (parts) {
-      let month = parseInt(parts[1]);
-      let day = parseInt(parts[2]);
-      let year = new Date().getFullYear();
-      return `${year}-${month.toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`;
-    }
-    return dateStr;
-  },
-  selectUpTime: function () {
-    this.getDayTime()
-    this.getTime()
-    let day = []
-    day.push({
-      id: 1,
-      text: this.data.nomDay
-    }, {
-      id: 2,
-      text: this.data.tomorrowDay
-    })
-    let data = []
-    data.push({
-      values: day,
-      className: 'column1',
-    }, {
-      values: this.data.timeIntervals,
-      defaultIndex: 2,
-      className: 'column2',
-    })
-    this.setData({
-      selectTimeshow: true,
-      columns: data
-    })
-  },
+  onLoad(options) {
 
-  // 获取今明天并转换
-  getDayTime: function () {
-    const today = new Date();
-    const month = (today.getMonth() + 1).toString().padStart(2, '0');
-    const day = today.getDate().toString().padStart(2, '0');
-    const todayFormat = `${month}月${day}日`;
-    const tomorrow = new Date(today.getTime() + 24 * 60 * 60 * 1000);
-    const tomorrowMonth = (tomorrow.getMonth() + 1).toString().padStart(2, '0');
-    const tomorrowDay = tomorrow.getDate().toString().padStart(2, '0');
-    const tomorrowFormat = `${tomorrowMonth}月${tomorrowDay}日`;
-    this.setData({
-      nomDay: todayFormat,
-      tomorrowDay: tomorrowFormat
-    })
-  },
-
-  // 时间段转换
-  getTime: function (selectedDate) {
-    const timeIntervals = [];
-    // 如果没有传入日期参数(首次加载等情况),则使用当前日期
-    const now = selectedDate ? new Date(selectedDate) : new Date();
-    if (isNaN(now.getTime())) {
-      console.error('传入的日期格式不正确,无法解析为有效日期');
-      return;
-    }
-    const currentTimeStamp = now.getTime();
-    for (let hour = 0; hour < 23; hour++) {
-      const start = hour.toString().padStart(2, '0') + ':00';
-      const end = (hour + 1).toString().padStart(2, '0') + ':00';
-      const interval = start + '~' + end;
-      // 创建对应时间段开始时间的日期对象
-      const startDate = new Date(now);
-      startDate.setHours(hour, 0, 0, 0);
-      const startTimestamp = startDate.getTime();
-      // 通过比较时间戳来判断时间段是否已过去
-      const hidden = startTimestamp < currentTimeStamp;
-      timeIntervals.push({
-        text: interval,
-        disabled: hidden
-      });
-    }
-    this.setData({
-      timeIntervals
-    });
-  },
-
-  // 日期转换方法
-  convertDateToNumber: function (dateStr) {
-    if (!dateStr) {
-      throw new Error('日期字符串不能为空');
-    }
-    dateStr = dateStr.trim();
-    let parts = dateStr.match(/(\d+)月(\d+)日/);
-    if (!parts) {
-      throw new Error('日期格式不正确,请按照XX月XX日的格式输入');
-    }
-    return new Date(2024, parseInt(parts[1]) - 1, parseInt(parts[2]));
-  },
-
-  // 选择器change事件
-  onChange(event) {
-    const {
-      picker,
-      value,
-      index
-    } = event.detail;
-    value.map((item, index) => {
-      if (index === 0) {
-        var date1 = this.convertDateToNumber(item.text);
-        var date2 = new Date();
-        if (date1 > date2) {
-          this.updateTimeIntervalsDisabled(item.id);
-        } else {
-          this.updateTimeIntervalsDisabled(item.id);
-        }
-      }
-    })
-  },
-  onConfirm(event) {
-    const {
-      picker,
-      value,
-      index
-    } = event.detail;
-    var currentDate = new Date();
-    var currentYear = currentDate.getFullYear();
-    if (value.length >= 2) {
-      const text1 = value[0].text; //text1为12月25日
-      const text2 = value[1].text.slice(0, 5); //text2为15:00
-      const month = ("0" + (parseInt(text1.split("月")[0]))).slice(-2); // 将中文月格式转换为数字(注意要减1,因为月份是从0开始计数),并补0
-      const day = text1.split("月")[1].split("日")[0];
-      const hour = text2.split(":")[0];
-      const minute = text2.split(":")[1];
-      const combinedText = `${currentYear}-${month}-${day} ${hour}:${minute}:00`;
-      let dateObj = new Date(combinedText);
-      let timestamp = Math.floor(dateObj.getTime() / 1000);
-      // 获取配送费
-      let that = this
-      var params = {
-        url: "/p/orderRefund/refundPrice",
-        method: "GET",
-        data: {
-          refundSn: this.data.refundSn, //退款编号
-          deliveryTime: timestamp
-        },
-        callBack: function (res) {
-          that.setData({
-            sendInfo: res
-          })
-        }
-      };
-      http.request(params);
-      this.setData({
-        combinedTextValue: combinedText,
-        selectTimeshow: false
-      });
-    }
-  },
-  onCancel: function () {
-    this.setData({
-      selectTimeshow: false
-    })
-  },
-  toPaySend: function () {
-    if (Object.keys(this.data.sendInfo).length === 0) {
-      wx.showToast({
-        title: '请先选择取件时间',
-        icon: 'none'
-      })
-      return
-    } else {
-      let that = this
-      wx.showLoading({
-        mask: true
-      });
-      var params = {
-        url: "/p/order/refundPay",
-        method: "POST",
-        data: {
-          payType: 1,
-          orderType: 1,
-          orderNumbers: this.data.refundSn
-        },
-        callBack: (res) => {
-          wx.hideLoading();
-          wx.requestPayment({
-            timeStamp: res.timeStamp,
-            nonceStr: res.nonceStr,
-            package: res.package,
-            signType: res.signType,
-            paySign: res.paySign,
-            success: e => {
-              wx.showModal({
-                title: '支付成功',
-                content: '',
-                showCancel: false,
-                success: () => {
-                  this.setData({
-                    addCarshow:false
-                  })
-                  this.submitExpress()
-                }
-              })
-            },
-            fail: err => {
-              // this.countdownTime()
-              // that.setData({
-              //   cancelPay: true,
-              //   addCarshow:false
-              // })
-            }
-          })
-        }
-      };
-      http.request(params);
-    }
-  },
-  atoncePaySend: function () {
-    wx.showLoading({
-      mask: true
-    });
-    var params = {
-      url: "/p/order/refundPay",
-      method: "POST",
-      data: {
-        payType: 1,
-        orderType: 1,
-        orderNumbers: this.data.refundSn
-      },
-      callBack: (res) => {
-        wx.hideLoading();
-        wx.requestPayment({
-          timeStamp: res.timeStamp,
-          nonceStr: res.nonceStr,
-          package: res.package,
-          signType: res.signType,
-          paySign: res.paySign,
-          success: e => {
-            wx.showModal({
-              title: '支付成功',
-              content: '',
-              showCancel: false,
-              success: () => {
-                // this.setData({
-                //   cancelPay: false
-                // })
-                this.getRefundDetail()
-              }
-            })
-          },
-          fail: err => {}
-        })
-      }
-    };
-    http.request(params);
-  },
-  // 倒计时
-  countdownTime: function () {
-    // 十五分钟对应的毫秒数
-    const fifteenMinutesInMs = 15 * 60 * 1000;
-    const targetTimeStamp = this.data.sendInfo.touchTime;
-    // 计算增加十五分钟后的时间戳
-    const newTimeStamp = targetTimeStamp + fifteenMinutesInMs;
-    const currentTimeStamp = newTimeStamp;
-    const diff = currentTimeStamp - targetTimeStamp;
-    if (diff > 0) {
-      this.setData({
-        remainingTime: diff,
-      });
-      this.countdown();
-    } else {
-    }
   },
-  // 倒计时
-  countdown: function () {
-    const interval = setInterval(() => {
-      if (this.data.remainingTime <= 0) {
-        clearInterval(interval);
-        this.setData({
-          cancelPay: false
-        })
-        return;
-      }
-      this.setData({
-        remainingTime: this.data.remainingTime - 1000,
-      });
-      // 将剩余时间(毫秒)转换为时分秒格式
-      const hours = Math.floor(this.data.remainingTime / (1000 * 60 * 60));
-      const minutes = Math.floor((this.data.remainingTime % (1000 * 60 * 60)) / (1000 * 60));
-      const seconds = Math.floor((this.data.remainingTime % (1000 * 60)) / 1000);
-      const timeFormat = `${this.padZero(hours)}:${this.padZero(minutes)}:${this.padZero(seconds)}`;
-      this.setData({
-        timeFormat: timeFormat
-      });
-    }, 1000);
-  },
-  // 辅助函数,用于将数字转换为两位数格式(不足两位前面补0)
-  padZero(num) {
-    return num < 10 ? '0' + num : num.toString();
-  },
-  // 根据id判断是否开启disabled
-  updateTimeIntervalsDisabled(id) {
-    let datatime = this.data.timeIntervals.map(subItem => {
-      if (id === 2) {
-        subItem.disabled = false;
-      } else if (id === 1) {
-        // 选中当天重新调用getTime方法判断当前时间
-        this.getTime()
-      }
-      return subItem;
-    });
-    // copy上面的数据结构,待优化
-    let day = []
-    day.push({
-      id: 1,
-      text: this.data.nomDay
-    }, {
-      id: 2,
-      text: this.data.tomorrowDay
-    })
-    let data = []
-    data.push({
-      values: day,
-      className: 'column1',
-    }, {
-      values: this.data.timeIntervals,
-      defaultIndex: 2,
-      className: 'column2',
-    })
-    this.setData({
-      timeIntervals: datatime,
-      columns: data
-    });
-  },
-  flowBution: function () {
-    wx.navigateTo({
-      url: '/pages/MaterialFlowInfo/MaterialFlowInfo?refundSn=' + this.data.refundSn
-    })
-    // this.setData({
-    //   flowShow: true
-    // })
-    // wx.navigateTo({
-    //   url: '/pages/MaterialFlow/MaterialFlow',
-    // })
-  },
-  flowOnClose: function () {
-    this.setData({
-      flowShow: false
-    })
-  },
-  /**
-   * 获取退款申请详情
-   */
-  getRefundDetail: function (e) {
-    var ths = this;
-    // wx.showLoading({})
-    var params = {
-      url: "/p/orderRefund/info",
-      method: "GET",
-      data: {
-        refundSn: this.data.refundSn //退款编号
-      },
-      callBack: function (res) {
-        let img=''
-        res.orderItems.map(item=>{
-          img=item.pic.split(',')
-          item.pic=img[0]
-        })
-        ths.setData({
-          applyTime: res.applyTime, //申请时间
-          applyType: res.applyType, //申请类型:1,仅退款,2退款退货
-          goodsNum: res.goodsNum, //退货数量
-          handelTime: res.handelTime, //卖家处理时间
-          orderAmount: res.orderAmount, //订单总金额
-          orderItems: res.orderItems, //订单项 
-          refundSn: res.refundSn, //退款编号
-          refundAmount: res.refundAmount, //退款金额
-          refundDelivery: res.refundDelivery, //收货地址对象
-          refundId: res.refundId, //记录ID
-          refundTime: res.refundTime, //退款时间
-          returnMoneySts: res.returnMoneySts, //处理退款状态:(1.买家申请 2.卖家接受 3.买家发货 4.卖家收货 5.退款成功 6.买家撤回申请 7.商家拒绝 -1.退款关闭)
-          updateTime: res.updateTime, //更新时间
-          rejectMessage: res.rejectMessage, //拒绝理由
-          buyerReason: res.buyerReason, //退款原因
-          shopName: res.shopName,
-          refundScore: res.refundScore, // 退款积分
-          payer: res.refundDelivery.payer,//运费承担方
-          sendPay:res.refundDelivery.deyNu //物流编号,判断是否提交成功
-        })
-        wx.hideLoading();
-        ths.get_countDown()
-      }
-    };
-    http.request(params);
-  },
-/**
- * 同意后倒计时
- * @param {*} e 
- */
-get_countDown:function(){
-  const start = new Date(this.data.handelTime);
-    const end = new Date(start.getTime() + 48 * 60 * 60 * 1000);
-    const interval = setInterval(() => {
-      const now = new Date();
-      const diff = end - now;
-      if (diff <= 0) {
-        clearInterval(interval);
-        this.setData({
-          countdown_hours: '00天',
-          countdown_minutes:'00分钟'
-        });
-      } else {
-        const hours = Math.floor(diff / (1000 * 60 * 60));
-        const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
-        this.setData({
-          countdown_hours:String(hours).padStart(2, '0'),
-          countdown_minutes:String(minutes).padStart(2, '0')
-          // countdown_time:`${String(hours).padStart(2, '0')}小时${String(minutes).padStart(2, '0')}分钟`
-        });
-      }
-    }, 1000);
-},
-  /**
-   * 撤销退货退款申请
-   */
-  cancelApplication: function (e) {
-    console.log('撤销申请')
-    wx.showModal({
-      title: '撤销',
-      content: '确定要撤销本次申请?',
-      success: (res) => {
-        if (res.confirm) {
-          wx.showLoading({})
-          var params = {
-            url: "/p/orderRefund/cancel",
-            method: "PUT",
-            data: this.data.refundSn, //退款订单编号
-            callBack: function (res) {
-              wx.hideLoading();
-              wx.navigateTo({
-                url: '/pages/afterSales/afterSales',
-              })
-            }
-          };
-          http.request(params);
-        } else {
-          console.log('取消')
-        }
-      }
-    })
-
-  },
-
-
-  /**
-   * 跳转修改退款申请
-   */
-  // toAlterRefundApply: function (e) {
-  //   var refundSn = e.currentTarget.dataset.refundsn;
-  //   console.log(e.currentTarget.dataset.refundsn)
-  //   wx.navigateTo({
-  //     url: '/pages/applyRefund/applyRefund?refundSn=' + refundSn,
-  //   })
-  // },
-
-
-  /**
-   * 填写物流信息
-   */
-  toLogisticsPage: function (e) {
-    var refundSn = e.currentTarget.dataset.refundsn;
-    console.log(e.currentTarget.dataset.refundsn)
-    wx.navigateTo({
-      url: '/pages/writeReturnLogistics/writeReturnLogistics?refundSn=' + refundSn,
-    })
-  },
-
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
-  onReady: function () {
+  onReady() {
 
   },
 
   /**
    * 生命周期函数--监听页面显示
    */
-  onShow: function () {
+  onShow() {
 
   },
 
   /**
    * 生命周期函数--监听页面隐藏
    */
-  onHide: function () {
+  onHide() {
 
   },
 
   /**
    * 生命周期函数--监听页面卸载
    */
-  onUnload: function () {
+  onUnload() {
 
   },
 
   /**
    * 页面相关事件处理函数--监听用户下拉动作
    */
-  onPullDownRefresh: function () {
+  onPullDownRefresh() {
 
   },
 
   /**
    * 页面上拉触底事件的处理函数
    */
-  onReachBottom: function () {
+  onReachBottom() {
 
   },
 
   /**
    * 用户点击右上角分享
    */
-  onShareAppMessage: function () {
+  onShareAppMessage() {
 
   }
 })

+ 1 - 3
pages/DetailsOfRefund/DetailsOfRefund.json

@@ -1,5 +1,3 @@
 {
-  "usingComponents": {},
-  "backgroundTextStyle": "light",
-  "navigationBarTitleText": "退款详情"
+  "usingComponents": {}
 }

+ 138 - 244
pages/DetailsOfRefund/DetailsOfRefund.wxml

@@ -1,267 +1,161 @@
-<!-- 退款详情 -->
-<!--pages/DetailsOfRefund/DetailsOfRefund.wxml-->
-
-<view class="page">
-  <!-- 头部状态 -->
-  <view class="describe-box">
-    <!-- 申请行进流程 -->
-    <view class="process">
-      <!-- 提交申请 -->
-      <view class="current-process" wx:if="{{returnMoneySts == 1}}">退款申请待商家处理</view>
-      <view class="acount-for-process" wx:if="{{returnMoneySts == 1}}">
-        你已成功发起退款申请,等待商家处理
-      </view>
-      <view class="acount-for-process" wx:if="{{returnMoneySts == 1}}">
-        {{updateTime}}
-      </view>
-      <!-- 商家拒绝 -->
-      <view class="current-process" wx:if="{{returnMoneySts == 7}}">商家不同意退款申请</view>
-      <view class="acount-for-process" wx:if="{{returnMoneySts == 7}}">
-        你可以修改退款申请
-      </view>
-      <view class="acount-for-process" wx:if="{{returnMoneySts == 7}}">
-        {{updateTime}}
-      </view>
-      <!-- 商家同意退款 -->
-      <view class="current-process" wx:if="{{returnMoneySts == 2}}">商家同意退款</view>
-      <view class="acount-for-process" wx:if="{{returnMoneySts == 2 && applyType == 1}}">
-        商家已同意,等待系统退款
-      </view>
-      <view class="acount-for-process" wx:if="{{returnMoneySts == 2 && applyType == 2}}">
-        商家已同意,请按照商家给出的退货地址寄回商品
-      </view>
-      <view class="acount-for-process" wx:if="{{returnMoneySts == 2}}">
-        {{updateTime}}
-      </view>
-      <!-- 寄出商品(退货退款情况下) -->
-      <view class="current-process" wx:if="{{returnMoneySts == 3}}">等待商家确认收货并退款</view>
-      <view class="acount-for-process" wx:if="{{returnMoneySts == 3}}">
-        你已退货,商家将在收货后尽快处理
-      </view>
-      <view class="acount-for-process" wx:if="{{returnMoneySts == 3}}">
-        {{updateTime}}
-      </view>
-      <!-- 商家确认收货 -->
-      <view class="current-process" wx:if="{{returnMoneySts == 4}}">商家确认收货</view>
-      <view class="acount-for-process" wx:if="{{returnMoneySts == 4}}">
-        商家已确认收货,等待系统退款
-      </view>
-      <view class="acount-for-process" wx:if="{{returnMoneySts == 4}}">
-        {{updateTime}}
-      </view>
-      <!-- 退款成功 -->
-      <view class="current-process" wx:if="{{returnMoneySts == 5}}">退款成功</view>
-      <view class="acount-for-process" wx:if="{{returnMoneySts == 5}}">
-        {{refundTime}}
-      </view>
-      <!-- 退款申请关闭 -->
-      <view class="current-process" wx:if="{{returnMoneySts == -1}}">退款申请关闭</view>
-      <view class="acount-for-process" wx:if="{{returnMoneySts == -1}}">
-        <!-- 由于你超时未处理,系统已关闭本次退款申请 -->
-        {{rejectMessage?rejectMessage:''}}
-      </view>
-      <view class="acount-for-process" wx:if="{{returnMoneySts == -1}}">
-        {{updateTime}}
-      </view>
-      <!-- 买家撤回申请 -->
-      <view class="current-process" wx:if="{{returnMoneySts == 6}}">申请已撤回</view>
-      <view class="acount-for-process" wx:if="{{returnMoneySts == 6}}">
-        你已撤回本次退款申请
-      </view>
-      <view class="acount-for-process" wx:if="{{returnMoneySts == 6}}">
-        {{updateTime}}
-      </view>
-      <!-- 隐藏内容(仅退款) -->
-      <view class="{{showView?'display':'more-content'}}" wx:if="{{returnMoneySts == 1}}">
-        <view class="cont">如果商家同意,申请将达成并退款给你</view>
-        <view class="cont">如果商家拒绝,你可以修改退款申请重新尝试</view>
-        <!-- <view class="cont">如果商家逾期未处理,退款申请将自动达成并退款给你</view> -->
-      </view>
-      <!-- 隐藏内容(退货退款申请商品未寄出) -->
-      <view class="{{showView?'display':'more-content'}}" wx:if="{{returnMoneySts == 2}}">
-        <view class="cont">如果商家同意,请按照给出的退货地址退货</view>
-        <view class="cont">如果商家拒绝,你可以修改退款申请重新尝试</view>
-        <!-- <view class="cont">如果商家逾期未处理,请按照系统给出的退货地址退货</view> -->
-      </view>
-      <!-- 隐藏内容(退货退款并已寄出货物) -->
-      <view class="{{showView?'display':'more-content'}}" wx:if="{{returnMoneySts == 3}}">
-        <view class="cont">如果商家确认收货,申请将达成并退款给你</view>
-        <view class="cont">如果商家拒绝收货,你可以修改退货物流信息重新尝试</view>
-        <!-- <view class="cont">如果商家逾期未处理,系统将自动确认收货并退款给你</view> -->
-      </view>
+<view class="DetailsOfRefund">
+  <view class="result-box box">
+    <view class="result">
+      <view class="title">退款成功</view>
+      <view class="desc">已完成退款,具体到账时间请查询支付宝</view>
     </view>
-    <!-- 申请行进流程end -->
-
-    <!-- 更多说明 -->
-    <view class="{{showView?'more-instructions':'display'}}" bindtap="onChangeShowState" wx:if="{{returnMoneySts < 4 && returnMoneySts !== -1 && applyType == 2}}">
-      <text class="more-txt">更多说明</text>
-      <view class="down-arrow-icon">
-        <image src="../../images/icon/down-arrow.png"></image>
-      </view>
+    <view class="result">
+    <view class="title-box">
+      <view class="title small">退款成功</view>
+      <view class="price">¥21</view>
     </view>
-    <!-- 收起 -->
-    <view class="{{showView?'display':'more-instructions'}}" bindtap="onChangeShowState" wx:if="{{returnMoneySts < 4 && returnMoneySts !== -1 && applyType == 2}}">
-      <text class="more-txt">收起</text>
-      <view class="down-arrow-icon">
-        <image src="../../images/icon/up-arrow.png"></image>
-      </view>
+      <view class="desc">已完成退款,具体到账时间请查询支付宝</view>
     </view>
   </view>
-  <!-- 头部状态end -->
 
-  <!-- 【退款申请被拒绝时显示】拒绝理由 -->
-  <view class="refuse-reason" wx:if="{{returnMoneySts == 7}}">
-    拒绝理由:{{rejectMessage}}
-  </view>
-  <!-- 退货方式 -->
-  <!-- wx:if="{{returnMoneySts == 2 && applyType == 2}}" -->
-  <view class="return-address" wx:if="{{returnMoneySts == 3||returnMoneySts == 2 && applyType == 2}}">
-    <view class="addr-tit">退货方式</view>
-    <view class="address">
-      <view class="return-shop-box">
-        <view>
-          <view class="shop-title">{{payer==1?'商家':'用户'}}承担运费</view>
-          <view class="shop-text" wx:if="{{returnMoneySts==3}}">已发起配送</view>
-          <view class="shop-text" wx:else>请在{{countdown_hours}}小时{{countdown_minutes}}分钟内,发起配送,将货品退回给商家。</view>
+  <view class="oprate-box box">
+      <view class="item">
+        <image class="icon" src="../../images/icon/del-icon.png" mode=""/>
+        <view class="label">
+          删除订单
         </view>
-        <view class="shop-btn" bindtap="sendDistribution" wx:if="{{sendPay==null}}">发起配送</view>
-        <view class="shop-btn" bindtap="flowBution" wx:else>查看物流</view>
       </view>
+      <!-- <button class='item' open-type="contact" >
+        <image class="icon" src="../../images/icon/chat-icon.png" mode=""/>
+        <view class="label">
+          联系商家
+        </view>
+     </button>
+      <view class="item" >
+        <image class="icon" src="../../images/icon/buy-icon.png" mode=""/>
+        <view class="label">
+          再次购买
+        </view>
+      </view> -->
     </view>
-  </view>
-  <!-- <view wx:if="{{cancelPay}}">
-    <view class="pay-card">
-      <view class="loading-time">等待支付,剩余<text style="color: #FF4D3A;">{{timeFormat}}</text></view>
-      <view class="time-out">超过15分钟未支付,订单将自动取消。</view>
-      <view class="pay-btn" bindtap="atoncePaySend">立即支付¥{{sendInfo.price}}</view>
-    </view>
-  </view> -->
-  <van-popup show="{{ addCarshow }}" closeable round position="bottom" custom-style="height: 45%" bind:close="onClose">
-    <view class="popup-box">
-      <view class="popup-title">寄回商品</view>
-      <view class="info-card-box">
-        <view class="card-address">顾客地址</view>
-        <view class="card-info">{{userAddrDto.address}}{{userAddrDto.addressName}}{{userAddrDto.addrDetail}}</view>
-        <view class="card-user">{{userAddrDto.receiver}} {{userAddrDto.mobile}}</view>
-        <view class="card-line"></view>
-        <view class="card-time-box" bindtap="selectUpTime">
-          <view class="card-time">*取件时间</view>
-          <view class="up-time">{{combinedTextValue||'请选择上门时间'}}
-            <van-icon name="arrow" />
+
+    <view class="process-box box">
+      <view class="sub-title">退款流程</view>
+      
+      <view class="step-box">
+        <view class="step-item" wx:for="{{4}}">
+          <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>
       </view>
-      <view class="costSide-card">
-        <view>配送费支付方</view>
-        <view>{{payer==1?'商家':'用户'}}</view>
-      </view>
-      <view class="bottom-button-box">
-        <!-- 支付方:payer=1店铺,2买家 -->
-        <view class="bottom-button" wx:if="{{payer==1}}" bindtap="submitBtn">提交</view>
-        <view class="send-pay-box" wx:else>
-          <view class="sendpay-text">配送费 <text style="color: #FF4D3A;">¥{{sendInfo.price||'0'}}</text></view>
-          <view class="sendpay-btn" bindtap="toPaySend">支付</view>
-        </view>
-      </view>
+
     </view>
-  </van-popup>
-  <van-popup show="{{ selectTimeshow }}" overlay="{{false}}" round position="bottom" custom-style="height: 45%" bind:close="timeOnClose">
-    <view class="popup-box">
-      <view class="popup-title">选择上门时间</view>
-      <van-picker columns="{{ columns }}" show-toolbar bind:cancel="onCancel" bind:confirm="onConfirm" bind:change="onChange" />
-      <!-- <view class="popup-select-day">
-        <view class="day-left">
-          <view class="{{sts==0?'now-day':'tomorrow-day'}}" data-sts="0" data-time="{{nomDay}}" bindtap="selectday">{{nomDay+'(今天)'}}</view>
-          <view style="margin-top: 28rpx;" class="{{sts==1?'now-day':'tomorrow-day'}}" data-sts="1" data-time="{{tomorrowDay}}" bindtap="selectday">{{tomorrowDay+'(明天)'}}</view>
+
+    <view class="refund-goods box">
+      <view class="title-box">
+        <view class="title">退款商品</view>
+        <view class="price">退款金额:¥21</view>
+      </view>
+      <view class="good-list">
+        <view class="good-item">
+          <view class="img"></view>
+          <view class="info">
+            <view class="good-name">赶海季生鲜大闸蟹</view>
+            <view class="desc">规格:5kg,盒</view>
+            <view class="price">单价:¥1.8</view>
+          </view>
+          <view class="price-box">
+            <view class="price">¥103.95</view>
+            <view class="num">x1</view>
+          </view>
         </view>
-        <view class="time-right">
-          <view class="sel-time{{currentSelectedIndex === index? 'selected' : ''}}" wx:for="{{timeIntervals}}" bindtap="selectTime" data-time="{{item}}" data-index="{{index}}">
-          <text wx:if="{{!item.hidden}}">{{item.interval}}</text></view>
+        <view class="good-item">
+          <view class="img"></view>
+          <view class="info">
+            <view class="good-name">赶海季生鲜大闸蟹</view>
+            <view class="desc">规格:5kg,盒</view>
+            <view class="price">单价:¥1.8</view>
+          </view>
+          <view class="price-box">
+            <view class="price">¥103.95</view>
+            <view class="num">x1</view>
+          </view>
         </view>
-      </view> -->
-    </view>
-  </van-popup>
-  <van-popup show="{{ flowShow }}" closeable round position="bottom" custom-style="height: 45%" bind:close="flowOnClose">
-    <van-steps custom-class="steps-style" steps="{{ steps }}" active="{{ active }}" direction="vertical" active-color="#FF941A" />
-  </van-popup>
-  <!-- 【退货退款状态下,买家同意后】退货地址 -->
-  <view class="return-address" wx:if="{{returnMoneySts == 2 && applyType == 2}}">
-    <view class="addr-tit">退货地址</view>
-    <view class="address">
-      <view class="recipient">
-        <text class="addr-cont">收件人:{{refundDelivery.receiverName}}</text>
-        <text class="mobile">{{refundDelivery.receiverMobile}}</text>
+        <view class="good-item">
+          <view class="img"></view>
+          <view class="info">
+            <view class="good-name">赶海季生鲜大闸蟹</view>
+            <view class="desc">规格:5kg,盒</view>
+            <view class="price">单价:¥1.8</view>
+          </view>
+          <view class="price-box">
+            <view class="price">¥103.95</view>
+            <view class="num">x1</view>
+          </view>
+        </view>
+
       </view>
-      <view class="addr">详细地址:{{refundDelivery.receiverAddr}}</view>
+        <view class="open-btn">
+          展开(共7件) <image class="arrow" src="../../images/icon/black-down-arrow.png" mode=""/>
+        </view>
     </view>
-  </view>
 
-
-  <!-- 退款信息 -->
-  <view class="refund-message">
-    <view class="refund-txt">退款信息</view>
-    <view class="goods-msg-box">
-      <!-- 店铺 -->
-      <!-- <view class="shop-box">
-        <view class="shop-img"><image src="../../images/icon/shop.png"></image></view>
-        <view class="shopname">店铺:{{shopName}}</view>
-      </view> -->
-      <!-- 图片 -->
-      <view class="img-box" wx:if="{{orderItems.length==1}}">
-        <image src="{{orderItems[0].pic}}"></image>
+    <view class="goods-info box">
+      <view class="item">
+        <view class="label">商品金额</view>
+        <view class="value">¥54.00</view>
       </view>
-      <!-- 信息 -->
-      <view class="goods-text" wx:if="{{orderItems.length==1}}">
-        <view class="goods-title">{{orderItems[0].prodName}}</view>
-        <view class="goods-quantity">数量:{{orderItems[0].prodCount}}件</view>
+      <view class="item">
+        <view class="label">运费(快递)</view>
+        <view class="value">¥54.00</view>
+      </view>
+      <view class="item">
+        <view class="label">积分(1400)</view>
+        <view class="value">¥54.00</view>
+      </view>
+      <view class="total">
+        <view class="label">总计:</view>
+        <view class="value">¥54.00</view>
       </view>
-
-      <block wx:if="{{orderItems.length>1}}">
-        <view class="refund-goods-item" wx:for="{{orderItems}}" wx:key="*this">
-          <!-- 图片 -->
-          <view class="img-box">
-            <image src="{{item.pic}}"></image>
-          </view>
-          <!-- 信息 -->
-          <view class="goods-text">
-            <view class="goods-title">{{item.prodName}}</view>
-            <view class="goods-quantity">数量:{{item.prodCount}}件</view>
-          </view>
-        </view>
-      </block>
-    </view>
-    <!-- 具体信息 -->
-    <view class="refund-cont">退款方式:{{['','仅退款','退货退款'][applyType]}}</view>
-    <view class="refund-cont">退款原因:{{buyerReason}}</view>
-    <view class="refund-cont">退款金额:
-      <text class="red" wx:if="{{refundAmount && refundAmount > 0}}">¥{{wxs.toPrice(refundAmount?refundAmount:0)}}</text>
-      <text class="red" wx:if="{{(refundScore && refundScore > 0) && (refundAmount && refundAmount > 0)}}">+</text>
-      <text class="red" wx:if="{{refundScore && refundScore > 0}}">{{refundScore}}积分</text>
     </view>
-    <view class="refund-cont">退款编号:{{refundSn}}</view>
-    <view class="refund-cont">申请时间:{{applyTime}}</view>
-    <!-- 【退货申请显示】 -->
-    <view class="refund-cont" wx:if="{{goodsNum>0}}">退货数量:{{goodsNum}}</view>
-    <!-- 联系商家 -->
-    <!-- <view class="contact-merchant">联系商家</view> -->
-    <button class='contact-merchant' open-type="contact">联系客服</button>
-  </view>
 
-
-  <!-- 脚部撤销申请 -->
-  <!-- applyType: 1,  //申请类型:1,仅退款,2退款退货 -->
-  <!-- returnMoneySts: 处理退款状态:(1.买家申请 2.卖家接受 3.买家发货 4.卖家收货 5.退款成功 6.买家撤回申请 7.商家拒绝 -1.退款关闭) -->
-  <view class="foot-box">
-    <view class="footer">
-      <!-- 【申请后-申请完成前】 -->
-      <text class="undo-apply" bindtap="cancelApplication" wx:if="{{returnMoneySts ==1 || returnMoneySts == 7 || (returnMoneySts ==2 && applyType == 2)}}">撤销申请</text>
-      <!-- 【商家拒绝时显示】 -->
-      <!-- <text class="undo-apply apply-current" bindtap="toAlterRefundApply" wx:if="{{returnMoneySts ==1 || returnMoneySts == 7}}" data-refundsn="{{refundSn}}">修改申请</text> -->
-      <!-- 【商家同意后-货物寄出前】 -->
-      <!-- <text class="undo-apply apply-current" bindtap="toLogisticsPage" wx:if="{{returnMoneySts == 2 && applyType == 2}}" data-refundsn="{{refundSn}}">填写退货物流</text> -->
+    <view class="order-info box">
+      <view class="title">订单信息</view>
+      <view class="item">
+        <view class="label">订单编号</view>
+        <view class="value-box">
+          <view class="value">1867402054587256856</view>
+          <image class="icon" src="../../images/icon/copy.png" mode=""/>
+        </view>
+      </view>
+      <view class="item">
+        <view class="label">售后编号</view>
+        <view class="value-box">
+          <view class="value">1867402054587256856</view>
+          <image class="icon" src="../../images/icon/copy.png" mode=""/>
+        </view>
+      </view>
+      <view class="item">
+        <view class="label">申请时间</view>
+        <view class="value">1867402054587256856</view>
+      </view>
+      <view class="item">
+        <view class="label">服务类型</view>
+        <view class="value">仅退款</view>
+      </view>
+      <view class="item">
+        <view class="label">申请原因</view>
+        <view class="value">实物与图片不符合</view>
+      </view>
     </view>
-  </view>
-
-</view>
 
-<wxs module="wxs" src="../../wxs/number.wxs" />
+</view>

+ 181 - 518
pages/DetailsOfRefund/DetailsOfRefund.wxss

@@ -1,633 +1,296 @@
 /* pages/DetailsOfRefund/DetailsOfRefund.wxss */
-.display {
-  display: none;
+.DetailsOfRefund{
+  padding: 20rpx 24rpx 120rpx;
+  background: #F6F6F6;
 }
 
-image {
-  width: 100%;
-  height: 100%;
+.DetailsOfRefund .result-box{
+  padding: 0 28rpx ;
 }
 
-.page {
-  position: fixed;
-  width: 100%;
-  height: 100%;
-  overflow: auto;
-  background: #f7f7f7;
-}
-
-/* 头部状态 */
-.describe-box {
-  background: #fff;
-  margin-bottom: 20rpx;
-}
-
-.process {
-  padding: 20rpx 25rpx;
-  border-bottom: 1rpx solid #f2f2f2;
+.DetailsOfRefund .result-box .result{
+  position: relative;
+  padding: 24rpx 0;
+  
 }
 
-.current-process {
-  font-size: 30rpx;
+.DetailsOfRefund .result-box .result .title{
   font-weight: bold;
-  padding: 10rpx 0;
+  font-size: 32rpx;
+  color: #222222;
 }
-
-.acount-for-process {
+.DetailsOfRefund .result-box .result .title.small{
   font-size: 28rpx;
-  color: #444;
-  line-height: 1.5em;
 }
 
-.red {
-  color: #e43130;
+.DetailsOfRefund .result-box .result .desc{
+  font-size: 24rpx;
+  color: #AAAAAA;
+  margin-top: 20rpx;
 }
-
-/* 隐藏内容 */
-.more-content {
-  border-top: 1rpx dashed #ebebeb;
-  margin-top: 15rpx;
-  padding-top: 10rpx;
+.DetailsOfRefund .result-box .result .title-box{
+  display: flex;
+  justify-content: space-between;
 }
 
-.cont {
+.DetailsOfRefund .result-box .result .price{
+  font-weight: bold;
   font-size: 28rpx;
-  color: #666666;
-  line-height: 1.8em
-}
-
-/* 更多说明 */
-.more-instructions {
-  padding: 18rpx 0;
-  padding-bottom: 22rpx;
-  text-align: center;
-  font-size: 27rpx;
-}
-
-.more-txt {
-  vertical-align: middle;
-}
-
-.down-arrow-icon {
-  display: inline-block;
-  width: 40rpx;
-  height: 25rpx;
-  vertical-align: middle;
+  color: #FF4D3A;
 }
 
-
-/* 退款流程 */
-.refund-schedule {
-  background: #fff;
+.box{
+  background: #FFFFFF;
+  border-radius: 16rpx 16rpx 16rpx 16rpx;
   margin-bottom: 20rpx;
-  padding: 0 25rpx;
-}
-
-.refund-sum {
-  font-size: 28rpx;
-  padding: 25rpx 0;
-  border-bottom: 1rpx solid #f2f2f2;
 }
 
-.progress-bar {
-  position: relative;
+.DetailsOfRefund .oprate-box{
   display: flex;
-  justify-content: space-around;
-  padding: 20rpx 0;
+  padding: 0 24rpx;
+  
 }
-
-.block {
-  display: inline-block;
+.DetailsOfRefund .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;
+}
+.DetailsOfRefund wx-button:after {
+  border: none;
+}
+.DetailsOfRefund .oprate-box .item .icon{
+  width: 40rpx;
+  height: 40rpx;
 }
 
-.round {
-  display: block;
-  width: 13rpx;
-  height: 13rpx;
-  border-radius: 50%;
-  background: #999999;
-  margin: 0 auto;
-  margin-top: 15rpx;
-}
-
-/* 激活状态圆点 */
-.round-current {
-  background: #3388ff;
-}
-
-.block-text {
-  margin-top: 15rpx;
-  text-align: center;
-}
-
-.block-text-tit {
-  font-size: 26rpx;
-  line-height: 2em;
-  color: #777;
-}
-
-.block-text-time {
-  font-size: 22rpx;
-  color: #aaa;
-}
-
-.line {
-  position: absolute;
-  top: 39rpx;
-  display: inline-block;
-  width: 215rpx;
-  height: 5rpx;
-  background: #bdbdbd;
-}
-
-/* 激活状态直线 */
-.line-current {
-  background: #3388ff;
-}
-
-.line01 {
-  left: 145rpx;
-}
-
-.line02 {
-  right: 115rpx;
-}
-
-/* 拒绝理由 */
-.refuse-reason {
+.DetailsOfRefund .oprate-box .item .label{
   font-size: 28rpx;
-  background: #fff;
-  padding: 20rpx;
-  margin-bottom: 20rpx;
+  color: #222222;
+  margin-top: 20rpx;
 }
-
-
-/* 退货地址 */
-.return-address {
-  background: #fff;
-  margin-bottom: 20rpx;
+.DetailsOfRefund .process-box{
+  padding: 24rpx;
 }
-
-.addr-tit {
-  padding: 10rpx 20rpx;
-  border-bottom: 1rpx solid #f2f2f2;
-  font-size: 30rpx;
+.DetailsOfRefund .process-box .sub-title{
   font-weight: bold;
+  font-size: 32rpx;
+  color: #222222;
+  padding-bottom: 20rpx;
 }
 
-.addr {
-  padding-right: .5em;
-}
-
-.address {
-  padding: 20rpx;
-  font-size: 28rpx;
-}
-
-.recipient {
-  padding-bottom: 10rpx;
-}
+.DetailsOfRefund .process-box .step-box{
 
-.mobile {
-  margin-left: 50rpx;
 }
 
-.pay-card {
-  background: #fff;
+.DetailsOfRefund .process-box .step-box .step-item{
+  position: relative;
   margin-bottom: 20rpx;
-  padding: 20rpx;
+  padding-left: 34rpx;
 }
 
-.loading-time {
-  font-family: PingFang SC, PingFang SC;
+.DetailsOfRefund .process-box .step-box .step-item .title{
   font-weight: bold;
   font-size: 28rpx;
   color: #181818;
 }
-
-.time-out {
-  margin-top: 20rpx;
-  font-family: PingFang SC, PingFang SC;
-  font-weight: normal;
+.DetailsOfRefund .process-box .step-box .step-item .desc{
   font-size: 24rpx;
   color: #AAAAAA;
-}
-
-.pay-btn {
   margin-top: 20rpx;
-  width: 220rpx;
-  height: 64rpx;
-  border-radius: 40rpx;
-  border: 2rpx solid #FF4D3A;
-  font-family: PingFang SC, PingFang SC;
-  font-weight: normal;
-  font-size: 28rpx;
-  color: #FF4D3A;
-  text-align: center;
-  line-height: 64rpx;
 }
 
-/* 退货方式 */
-.return-shop-box {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-}
-.shop-title {
-  font-family: PingFang SC, PingFang SC;
-  font-weight: bold;
-  font-size: 28rpx;
-  color: #181818;
-}
-
-.shop-text {
-  margin-top: 20rpx;
-  font-family: PingFang SC, PingFang SC;
-  font-weight: normal;
+.DetailsOfRefund .process-box .step-box .step-item .time{
   font-size: 24rpx;
   color: #AAAAAA;
+  margin-top: 12rpx;
 }
 
-.shop-btn {
-  width: 136rpx;
-  height: 64rpx;
-  background: #FFFFFF;
-  border-radius: 40rpx;
-  border: 2rpx solid #FF4D3A;
-  font-family: PingFang SC, PingFang SC;
-  font-weight: normal;
-  font-size: 28rpx;
-  color: #FF4D3A;
-  line-height: 64rpx;
-  text-align: center;
+.DetailsOfRefund .process-box .step-box .step-item .point{
+  width: 14rpx;
+  height: 14rpx;
+  border-radius: 50%;
+  background: #CCCCCC;
+  position: absolute;
+  top: 0rpx;
+  left: -7rpx;
+  z-index: 9;
 }
-
-.popup-box {
-  padding: 20rpx;
+.DetailsOfRefund .process-box .step-box .step-item .point.active{
+  background: #FF941A;
 }
 
-.popup-title {
-  margin-top: 28rpx;
-  font-family: PingFang SC, PingFang SC;
-  font-weight: 800;
-  font-size: 32rpx;
-  text-align: center;
+.DetailsOfRefund .process-box .step-box .step-item .line{
+  width: 2rpx;
+  height: 115rpx;
+  background: #AAAAAA;
+  position: absolute;
+  top: 0;
+  left: 0;
+  z-index: 8;
 }
-
-.popup-select-day {
+.DetailsOfRefund .process-box .step-box .step-item .img-list{
   display: flex;
+  overflow: auto;
+  margin-top: 12rpx;
 }
-
-.day-left {
-  margin-top: 50rpx;
+.DetailsOfRefund .process-box .step-box .step-item .img-list .img{
+  width: 120rpx;
+  height: 120rpx;
+  background: #F6F6F6;
+  border-radius: 32rpx 32rpx 32rpx 32rpx;
+  margin-right: 16rpx;
+  flex-shrink: 0;
 }
 
-.now-day {
-  font-weight: normal;
-  font-size: 28rpx;
-  color: #222222;
+.DetailsOfRefund .refund-goods{
+  padding: 24rpx;
 }
 
-.tomorrow-day {
-  font-weight: normal;
+.DetailsOfRefund .refund-goods .title-box{
+  display: flex;
+  justify-content: space-between;
+  padding-bottom: 24rpx;
+  font-weight: bold;
   font-size: 28rpx;
-  color: #AAAAAA;
 }
-
-.time-right {
-  margin-top: 50rpx;
-  margin-left: 300rpx;
-  height: 500rpx;
-  overflow-y: auto; 
-  font-weight: normal;
-  font-size: 28rpx;
+.DetailsOfRefund .refund-goods .title-box .title{
   color: #222222;
 }
-.time-right::-webkit-scrollbar {
-  display: none;
+.DetailsOfRefund .refund-goods .title-box .price{
+  color: #FF4D3A;
 }
-.sel-time {
-  margin-bottom:28rpx;
-  font-weight: normal;
-  font-size: 28rpx;
-  color: #AAAAAA;
+
+.DetailsOfRefund .refund-goods .good-list{
 }
-.sel-timeselected{
-  margin-bottom:28rpx;
-  color: #222222;
+.DetailsOfRefund .refund-goods .good-list .good-item{
+  border-top:1rpx solid #F0F0F0;
+  padding: 20rpx 0;
+  display: flex;
+
 }
-.info-card-box {
-  margin-top: 20rpx;
-  background-color: #F9F9F9;
+.DetailsOfRefund .refund-goods .good-list .good-item .img{
+  width: 120rpx;
+  height: 120rpx;
   border-radius: 16rpx;
-  padding: 20rpx;
+  background: #F6F6F6;
 }
-
-.card-address {
-  font-family: PingFang SC, PingFang SC;
-  font-weight: normal;
-  font-size: 28rpx;
-  color: #222222;
+.DetailsOfRefund .refund-goods .good-list .good-item .info{
+  margin-left: 20rpx;
+  flex: 1;
 }
-
-.card-info {
-  margin-top: 20rpx;
-  font-family: PingFang SC, PingFang SC;
+.DetailsOfRefund .refund-goods .good-list .good-item .info .good-name{
   font-weight: bold;
   font-size: 28rpx;
   color: #222222;
 }
-
-.card-user {
-  margin-top: 20rpx;
-  font-family: PingFang SC, PingFang SC;
-  font-weight: normal;
+.DetailsOfRefund .refund-goods .good-list .good-item .info .desc{
   font-size: 24rpx;
   color: #AAAAAA;
+  margin-top: 10rpx;
 }
-
-.card-line {
-  margin-top: 20rpx;
-  border: 2rpx solid #F0F0F0;
-}
-
-.card-time-box {
-  margin-top: 20rpx;
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-}
-
-.card-time {
-  font-family: PingFang SC, PingFang SC;
-  font-weight: normal;
-  font-size: 28rpx;
-  color: #222222;
-}
-
-.up-time {
-  font-family: PingFang SC, PingFang SC;
-  font-weight: normal;
-  font-size: 28rpx;
+.DetailsOfRefund .refund-goods .good-list .good-item .info .price{
   color: #AAAAAA;
+  font-size: 24rpx;
 }
-
-.costSide-card {
-  margin-top: 20rpx;
-  background-color: #F9F9F9;
-  border-radius: 16rpx;
-  padding: 20rpx;
+.DetailsOfRefund .refund-goods .good-list .good-item .price-box{
   display: flex;
-  align-items: center;
+  flex-direction: column;
   justify-content: space-between;
+  align-items: flex-end;
 }
-
-.costSide-card>view:first-child {
-  font-family: PingFang SC, PingFang SC;
-  font-weight: normal;
-  font-size: 28rpx;
-  color: #222222;
+.DetailsOfRefund .refund-goods .good-list .good-item .price-box .price{
+  font-weight: bold;
+  font-size: 32rpx;
+  color: #FF4D3A;
 }
-
-.costSide-card>view:last-child {
-  font-family: PingFang SC, PingFang SC;
-  font-weight: normal;
-  font-size: 28rpx;
+.DetailsOfRefund .refund-goods .good-list .good-item .price-box .num{
+  font-size: 24rpx;
   color: #AAAAAA;
 }
-
-.bottom-button-box {
-  background: #FFFFFF;
-  box-shadow: 0rpx -6rpx 12rpx 2rpx rgba(0, 0, 0, 0.09);
-  border-radius: 32rpx 32rpx 0rpx 0rpx;
+.DetailsOfRefund .refund-goods .open-btn{
   display: flex;
+  align-items: center;
   justify-content: center;
+  font-size: 24rpx;
+  color: #222222;
+  margin-top: 20rpx;
 }
-
-.bottom-button {
-  width: 702rpx;
-  height: 80rpx;
-  background: #FF941A;
-  border-radius: 40rpx;
-  margin-top: 30rpx;
-  font-family: PingFang SC, PingFang SC;
-  font-weight: bold;
-  font-size: 28rpx;
-  color: #FFFFFF;
-  text-align: center;
-  line-height: 80rpx;
+.DetailsOfRefund .refund-goods .open-btn .arrow{
+  width: 20rpx;
+  height: 20rpx;
 }
 
-.picker-style {
-  font-size: 16rpx !important;
-  margin-left: -80rpx;
+.DetailsOfRefund .goods-info{
+  padding: 24rpx;
 }
-
-.send-pay-box {
+.DetailsOfRefund .goods-info .item{
   display: flex;
-  align-items: center;
-  margin-top: 30rpx;
-}
+  justify-content: space-between;
+  padding-bottom: 28rpx;
 
-.sendpay-text {
-  font-family: PingFang SC, PingFang SC;
-  font-weight: normal;
-  font-size: 28rpx;
-  width: 400rpx;
 }
-
-.sendpay-btn {
-  width: 220rpx;
-  height: 80rpx;
-  background: #FF941A;
-  border-radius: 40rpx;
-  font-family: PingFang SC, PingFang SC;
-  font-weight: bold;
+.DetailsOfRefund .goods-info .item .label{
   font-size: 28rpx;
-  color: #FFFFFF;
-  line-height: 80rpx;
-  text-align: center;
-}
-
-/* 查看协商记录 */
-/* .negotiate-record {
-  position: relative;
-  font-size: 25rpx;
-  text-align: left;
-  background: #fff;
-  padding: 20rpx 25rpx;
-  margin-bottom: 20rpx;
-}
-.more-arrow {
-  position: absolute;
-  right: 20rpx;
-  top: 50%;
-  transform: translateY(-50%);
-  width: 22rpx;
-  height: 22rpx;
-} */
-
-
-/* 退款信息 */
-.refund-message {
-  background: #fff;
-  padding: 20rpx 25rpx;
+  color: #222222;
 }
 
-.refund-txt {
-  font-size: 30rpx;
-  margin-bottom: 25rpx;
+.DetailsOfRefund .goods-info .item .value{
   font-weight: bold;
-}
-
-/* 店铺 */
-.shop-box {
-  display: block;
-  padding-bottom: 20rpx;
-  margin-bottom: 20rpx;
-  border-bottom: 1rpx solid #f0f0f0;
-}
-
-.shop-img {
-  display: inline-block;
-  width: 36rpx;
-  height: 36rpx;
-  vertical-align: middle;
-  margin-right: 10rpx;
-}
-
-.shop-img>iamge {
-  display: block;
-  width: 100%;
-  height: 100%;
-}
-
-.shopname {
-  display: inline-block;
-  font-size: 28rpx;
-  line-height: 1em;
-  vertical-align: middle;
-  color: #444444;
-}
-
-/* 商品信息 */
-.goods-msg-box {
-  background: #f9f9f9;
-  padding: 15rpx 20rpx;
-  margin: 15rpx 0;
-}
-
-.img-box {
-  display: inline-block;
-  width: 150rpx;
-  height: 150rpx;
-  margin-right: 20rpx;
-  background: #eee;
-  vertical-align: top;
-}
-
-.goods-text {
-  display: inline-block;
-  vertical-align: top;
-  width: 70%;
-}
-
-.goods-title {
   font-size: 28rpx;
-  display: -webkit-box;
-  -webkit-line-clamp: 2;
-  /*设定显示行数*/
-  -webkit-box-orient: vertical;
-  word-break: break-all;
-  overflow: hidden;
-  text-overflow: ellipsis;
+  color: #FF4D3A;
 }
-
-.goods-quantity {
-  font-size: 28rpx;
-  color: #888888;
-  margin-top: 20rpx;
+.DetailsOfRefund .goods-info .total{
+  display: flex;
+  justify-content: space-between;
+  padding-top: 28rpx ;
+  border-top: 2rpx solid #F0F0F0;
 }
-
-/* 具体信息 */
-.refund-cont {
+.DetailsOfRefund .goods-info .total .label{
+  font-weight: bold;
   font-size: 28rpx;
-  color: #666666;
-  line-height: 2em;
+  color: #222222;
 }
-
-/* 联系商家 */
-.contact-merchant {
+.DetailsOfRefund .goods-info .total .value{
+  font-weight: bold;
   font-size: 28rpx;
-  color: #FF941A;
-  text-align: center;
-  padding-top: 20rpx;
-  margin-top: 20rpx;
-  border-top: 1rpx solid #f2f2f2;
-}
-
-button.contact-merchant {
-  background: #fff;
-}
-
-button.contact-merchant::after {
-  border: 0;
+  color: #FF4D3A;
 }
 
-/* 整单退款商品列表 */
-.refund-goods-item {
-  padding: 20rpx 0;
-  border-bottom: 2rpx solid #ddd;
+.DetailsOfRefund .order-info{
+  padding: 28rpx 24rpx;
 }
-
-.refund-goods-item:last-child {
-  border-bottom: none;
+.DetailsOfRefund .order-info .title{
+  font-weight: bold;
+  font-size: 32rpx;
+  color: #222222;
 }
-
-/* 脚部撤销 */
-.foot-box {
-  display: block;
-  margin-top: 150rpx;
+.DetailsOfRefund .order-info .item{
+  padding-top: 28rpx;
+  display: flex;
+  justify-content: space-between;
 }
-
-.footer {
-  display: block;
-  box-sizing: border-box;
-  position: fixed;
-  width: 100%;
-  bottom: 0;
+.DetailsOfRefund .order-info .item .label{
   font-size: 28rpx;
-  background: #fff;
-  padding: 0 30rpx;
-  text-align: right;
-  box-shadow: 1rpx 10rpx 10rpx 10rpx rgb(236, 236, 236);
+  color: #AAAAAA;
 }
-
-.undo-apply {
-  display: inline-block;
-  box-sizing: border-box;
-  padding: 15rpx 20rpx;
-  font-size: 25rpx;
-  border-radius: 5rpx;
-  margin: 25rpx 0;
-  margin-left: 15rpx;
-  border-radius: 40rpx;
-  border: 1rpx solid #aaaaaa;
-  color: #555555;
+.DetailsOfRefund .order-info .item .value-box{
+  display: flex;
+  align-items: center;
 }
-
-.undo-apply-end {
-  display: inline-block;
-  box-sizing: border-box;
-  margin-left: 15rpx;
-  color: #777;
-  font-size: 30rpx;
-
+.DetailsOfRefund .order-info .item .value-box .icon{
+  width: 30rpx;
+  height: 30rpx;
+  margin-left: 20rpx;
 }
-
-.apply-current {
-  border: 1rpx solid rgb(0, 173, 0);
-  color: rgb(0, 173, 0);
-
+.DetailsOfRefund .order-info .item .value{
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #222222;
 }

+ 670 - 0
pages/DetailsOfRefund1/DetailsOfRefund.js

@@ -0,0 +1,670 @@
+// pages/DetailsOfRefund/DetailsOfRefund.js
+var http = require('../../utils/http.js');
+var util = require('../../utils/util.js');
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    showView: true, //隐藏是展示
+    applyTime: '', //申请时间
+    applyType: 1, //申请类型:1,仅退款,2退款退货
+    goodsNum: '', //退货数量
+    handelTime: '', //卖家处理时间
+    orderAmount: '', //订单总金额
+    orderItems: {}, //订单项 
+    refundAmount: '', //退款金额
+    refundDelivery: [], //收货地址对象
+    refundId: '', //记录ID
+    refundTime: '', //退款时间
+    returnMoneySts: 1, //处理退款状态:(1.买家申请 2.卖家接受 3.买家发货 4.卖家收货 5.退款成功 6.买家撤回申请 7.商家拒绝 -1.退款关闭)
+    updateTime: '', //更新时间
+    refundSn: '', //退款编号
+    rejectMessage: '', //拒绝理由
+    buyerReason: '', //退款原因
+    shopName: '', //店铺名称
+    refundScore: 0, // 退款积分
+    addCarshow: false,
+    selectTimeshow: false,
+    flowShow: false,
+    userAddrDto: {},
+    payer: '',
+    sendPay:'',
+    sts: 0,
+    nomDay: '',
+    tomorrowDay: '',
+    timeIntervals: [],
+    columns: [],
+    combinedTextValue: '',
+    sendInfo: {},
+    currentSelectedIndex: -1, // 初始没有选中项,索引设为 -1
+    steps: [{
+        text: '步骤一',
+        desc: '描述信息',
+        inactiveIcon: 'location-o',
+        activeIcon: 'success',
+      },
+      {
+        text: '步骤二',
+        desc: '描述信息',
+        inactiveIcon: 'circle',
+        activeIcon: 'plus',
+      },
+      {
+        text: '步骤三',
+        desc: '描述信息',
+        inactiveIcon: 'circle',
+        activeIcon: 'cross',
+      },
+      {
+        text: '步骤四',
+        desc: '描述信息',
+        inactiveIcon: 'circle',
+        activeIcon: 'fail',
+      },
+    ],
+    cancelPay: false,
+    remainingTime: '',
+    timeFormat: '',
+    orderNumSend:'',
+    countdown_hours:'',
+    countdown_minutes:''
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.setData({
+      orderNumSend:options.orderNumber
+    })
+    this.getTime()
+    this.setData({
+      refundSn: options.refundSn,
+    });
+    if(options.userAddrDto){
+      this.setData({
+        userAddrDto: JSON.parse(options.userAddrDto)
+      })
+    }
+    //获取退款申请详情
+    this.getRefundDetail()
+  },
+
+  /**
+   * 更多说明&收起
+   */
+  onChangeShowState: function () {
+    var that = this;
+    that.setData({
+      showView: (!that.data.showView)
+    })
+  },
+  // 发起配送
+  sendDistribution: function () {
+    this.setData({
+      addCarshow: true
+    })
+  },
+  onClose: function () {
+    this.setData({
+      addCarshow: false
+    })
+  },
+  timeOnClose: function () {
+    this.setData({
+      selectTimeshow: false
+    })
+  },
+  submitBtn:function(){
+    if (Object.keys(this.data.sendInfo).length === 0) {
+      wx.showToast({
+        title: '请先选择取件时间',
+        icon: 'none'
+      })
+      return
+    }
+    this.submitExpress()
+  },
+  submitExpress:function(){
+    var params = {
+      url: `/p/orderRefund/submitExpress/${this.data.refundSn}`,
+      method: "GET",
+      callBack: res => {
+        wx.showToast({
+          title: '提交成功',
+          icon: 'none',
+        })
+        this.setData({
+          addCarshow:false
+        })
+        this.getRefundDetail()
+      }
+    };
+    http.request(params);
+  },
+  // 辅助函数,将中文日期格式转换为YYYY-MM-DD格式
+  formatDate: function (dateStr) {
+    let parts = dateStr.match(/(\d+)月(\d+)日/);
+    if (parts) {
+      let month = parseInt(parts[1]);
+      let day = parseInt(parts[2]);
+      let year = new Date().getFullYear();
+      return `${year}-${month.toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`;
+    }
+    return dateStr;
+  },
+  selectUpTime: function () {
+    this.getDayTime()
+    this.getTime()
+    let day = []
+    day.push({
+      id: 1,
+      text: this.data.nomDay
+    }, {
+      id: 2,
+      text: this.data.tomorrowDay
+    })
+    let data = []
+    data.push({
+      values: day,
+      className: 'column1',
+    }, {
+      values: this.data.timeIntervals,
+      defaultIndex: 2,
+      className: 'column2',
+    })
+    this.setData({
+      selectTimeshow: true,
+      columns: data
+    })
+  },
+
+  // 获取今明天并转换
+  getDayTime: function () {
+    const today = new Date();
+    const month = (today.getMonth() + 1).toString().padStart(2, '0');
+    const day = today.getDate().toString().padStart(2, '0');
+    const todayFormat = `${month}月${day}日`;
+    const tomorrow = new Date(today.getTime() + 24 * 60 * 60 * 1000);
+    const tomorrowMonth = (tomorrow.getMonth() + 1).toString().padStart(2, '0');
+    const tomorrowDay = tomorrow.getDate().toString().padStart(2, '0');
+    const tomorrowFormat = `${tomorrowMonth}月${tomorrowDay}日`;
+    this.setData({
+      nomDay: todayFormat,
+      tomorrowDay: tomorrowFormat
+    })
+  },
+
+  // 时间段转换
+  getTime: function (selectedDate) {
+    const timeIntervals = [];
+    // 如果没有传入日期参数(首次加载等情况),则使用当前日期
+    const now = selectedDate ? new Date(selectedDate) : new Date();
+    if (isNaN(now.getTime())) {
+      console.error('传入的日期格式不正确,无法解析为有效日期');
+      return;
+    }
+    const currentTimeStamp = now.getTime();
+    for (let hour = 0; hour < 23; hour++) {
+      const start = hour.toString().padStart(2, '0') + ':00';
+      const end = (hour + 1).toString().padStart(2, '0') + ':00';
+      const interval = start + '~' + end;
+      // 创建对应时间段开始时间的日期对象
+      const startDate = new Date(now);
+      startDate.setHours(hour, 0, 0, 0);
+      const startTimestamp = startDate.getTime();
+      // 通过比较时间戳来判断时间段是否已过去
+      const hidden = startTimestamp < currentTimeStamp;
+      timeIntervals.push({
+        text: interval,
+        disabled: hidden
+      });
+    }
+    this.setData({
+      timeIntervals
+    });
+  },
+
+  // 日期转换方法
+  convertDateToNumber: function (dateStr) {
+    if (!dateStr) {
+      throw new Error('日期字符串不能为空');
+    }
+    dateStr = dateStr.trim();
+    let parts = dateStr.match(/(\d+)月(\d+)日/);
+    if (!parts) {
+      throw new Error('日期格式不正确,请按照XX月XX日的格式输入');
+    }
+    return new Date(2024, parseInt(parts[1]) - 1, parseInt(parts[2]));
+  },
+
+  // 选择器change事件
+  onChange(event) {
+    const {
+      picker,
+      value,
+      index
+    } = event.detail;
+    value.map((item, index) => {
+      if (index === 0) {
+        var date1 = this.convertDateToNumber(item.text);
+        var date2 = new Date();
+        if (date1 > date2) {
+          this.updateTimeIntervalsDisabled(item.id);
+        } else {
+          this.updateTimeIntervalsDisabled(item.id);
+        }
+      }
+    })
+  },
+  onConfirm(event) {
+    const {
+      picker,
+      value,
+      index
+    } = event.detail;
+    var currentDate = new Date();
+    var currentYear = currentDate.getFullYear();
+    if (value.length >= 2) {
+      const text1 = value[0].text; //text1为12月25日
+      const text2 = value[1].text.slice(0, 5); //text2为15:00
+      const month = ("0" + (parseInt(text1.split("月")[0]))).slice(-2); // 将中文月格式转换为数字(注意要减1,因为月份是从0开始计数),并补0
+      const day = text1.split("月")[1].split("日")[0];
+      const hour = text2.split(":")[0];
+      const minute = text2.split(":")[1];
+      const combinedText = `${currentYear}-${month}-${day} ${hour}:${minute}:00`;
+      let dateObj = new Date(combinedText);
+      let timestamp = Math.floor(dateObj.getTime() / 1000);
+      // 获取配送费
+      let that = this
+      var params = {
+        url: "/p/orderRefund/refundPrice",
+        method: "GET",
+        data: {
+          refundSn: this.data.refundSn, //退款编号
+          deliveryTime: timestamp
+        },
+        callBack: function (res) {
+          that.setData({
+            sendInfo: res
+          })
+        }
+      };
+      http.request(params);
+      this.setData({
+        combinedTextValue: combinedText,
+        selectTimeshow: false
+      });
+    }
+  },
+  onCancel: function () {
+    this.setData({
+      selectTimeshow: false
+    })
+  },
+  toPaySend: function () {
+    if (Object.keys(this.data.sendInfo).length === 0) {
+      wx.showToast({
+        title: '请先选择取件时间',
+        icon: 'none'
+      })
+      return
+    } else {
+      let that = this
+      wx.showLoading({
+        mask: true
+      });
+      var params = {
+        url: "/p/order/refundPay",
+        method: "POST",
+        data: {
+          payType: 1,
+          orderType: 1,
+          orderNumbers: this.data.refundSn
+        },
+        callBack: (res) => {
+          wx.hideLoading();
+          wx.requestPayment({
+            timeStamp: res.timeStamp,
+            nonceStr: res.nonceStr,
+            package: res.package,
+            signType: res.signType,
+            paySign: res.paySign,
+            success: e => {
+              wx.showModal({
+                title: '支付成功',
+                content: '',
+                showCancel: false,
+                success: () => {
+                  this.setData({
+                    addCarshow:false
+                  })
+                  this.submitExpress()
+                }
+              })
+            },
+            fail: err => {
+              // this.countdownTime()
+              // that.setData({
+              //   cancelPay: true,
+              //   addCarshow:false
+              // })
+            }
+          })
+        }
+      };
+      http.request(params);
+    }
+  },
+  atoncePaySend: function () {
+    wx.showLoading({
+      mask: true
+    });
+    var params = {
+      url: "/p/order/refundPay",
+      method: "POST",
+      data: {
+        payType: 1,
+        orderType: 1,
+        orderNumbers: this.data.refundSn
+      },
+      callBack: (res) => {
+        wx.hideLoading();
+        wx.requestPayment({
+          timeStamp: res.timeStamp,
+          nonceStr: res.nonceStr,
+          package: res.package,
+          signType: res.signType,
+          paySign: res.paySign,
+          success: e => {
+            wx.showModal({
+              title: '支付成功',
+              content: '',
+              showCancel: false,
+              success: () => {
+                // this.setData({
+                //   cancelPay: false
+                // })
+                this.getRefundDetail()
+              }
+            })
+          },
+          fail: err => {}
+        })
+      }
+    };
+    http.request(params);
+  },
+  // 倒计时
+  countdownTime: function () {
+    // 十五分钟对应的毫秒数
+    const fifteenMinutesInMs = 15 * 60 * 1000;
+    const targetTimeStamp = this.data.sendInfo.touchTime;
+    // 计算增加十五分钟后的时间戳
+    const newTimeStamp = targetTimeStamp + fifteenMinutesInMs;
+    const currentTimeStamp = newTimeStamp;
+    const diff = currentTimeStamp - targetTimeStamp;
+    if (diff > 0) {
+      this.setData({
+        remainingTime: diff,
+      });
+      this.countdown();
+    } else {
+    }
+  },
+  // 倒计时
+  countdown: function () {
+    const interval = setInterval(() => {
+      if (this.data.remainingTime <= 0) {
+        clearInterval(interval);
+        this.setData({
+          cancelPay: false
+        })
+        return;
+      }
+      this.setData({
+        remainingTime: this.data.remainingTime - 1000,
+      });
+      // 将剩余时间(毫秒)转换为时分秒格式
+      const hours = Math.floor(this.data.remainingTime / (1000 * 60 * 60));
+      const minutes = Math.floor((this.data.remainingTime % (1000 * 60 * 60)) / (1000 * 60));
+      const seconds = Math.floor((this.data.remainingTime % (1000 * 60)) / 1000);
+      const timeFormat = `${this.padZero(hours)}:${this.padZero(minutes)}:${this.padZero(seconds)}`;
+      this.setData({
+        timeFormat: timeFormat
+      });
+    }, 1000);
+  },
+  // 辅助函数,用于将数字转换为两位数格式(不足两位前面补0)
+  padZero(num) {
+    return num < 10 ? '0' + num : num.toString();
+  },
+  // 根据id判断是否开启disabled
+  updateTimeIntervalsDisabled(id) {
+    let datatime = this.data.timeIntervals.map(subItem => {
+      if (id === 2) {
+        subItem.disabled = false;
+      } else if (id === 1) {
+        // 选中当天重新调用getTime方法判断当前时间
+        this.getTime()
+      }
+      return subItem;
+    });
+    // copy上面的数据结构,待优化
+    let day = []
+    day.push({
+      id: 1,
+      text: this.data.nomDay
+    }, {
+      id: 2,
+      text: this.data.tomorrowDay
+    })
+    let data = []
+    data.push({
+      values: day,
+      className: 'column1',
+    }, {
+      values: this.data.timeIntervals,
+      defaultIndex: 2,
+      className: 'column2',
+    })
+    this.setData({
+      timeIntervals: datatime,
+      columns: data
+    });
+  },
+  flowBution: function () {
+    wx.navigateTo({
+      url: '/pages/MaterialFlowInfo/MaterialFlowInfo?refundSn=' + this.data.refundSn
+    })
+    // this.setData({
+    //   flowShow: true
+    // })
+    // wx.navigateTo({
+    //   url: '/pages/MaterialFlow/MaterialFlow',
+    // })
+  },
+  flowOnClose: function () {
+    this.setData({
+      flowShow: false
+    })
+  },
+  /**
+   * 获取退款申请详情
+   */
+  getRefundDetail: function (e) {
+    var ths = this;
+    // wx.showLoading({})
+    var params = {
+      url: "/p/orderRefund/info",
+      method: "GET",
+      data: {
+        refundSn: this.data.refundSn //退款编号
+      },
+      callBack: function (res) {
+        let img=''
+        res.orderItems.map(item=>{
+          img=item.pic.split(',')
+          item.pic=img[0]
+        })
+        ths.setData({
+          applyTime: res.applyTime, //申请时间
+          applyType: res.applyType, //申请类型:1,仅退款,2退款退货
+          goodsNum: res.goodsNum, //退货数量
+          handelTime: res.handelTime, //卖家处理时间
+          orderAmount: res.orderAmount, //订单总金额
+          orderItems: res.orderItems, //订单项 
+          refundSn: res.refundSn, //退款编号
+          refundAmount: res.refundAmount, //退款金额
+          refundDelivery: res.refundDelivery, //收货地址对象
+          refundId: res.refundId, //记录ID
+          refundTime: res.refundTime, //退款时间
+          returnMoneySts: res.returnMoneySts, //处理退款状态:(1.买家申请 2.卖家接受 3.买家发货 4.卖家收货 5.退款成功 6.买家撤回申请 7.商家拒绝 -1.退款关闭)
+          updateTime: res.updateTime, //更新时间
+          rejectMessage: res.rejectMessage, //拒绝理由
+          buyerReason: res.buyerReason, //退款原因
+          shopName: res.shopName,
+          refundScore: res.refundScore, // 退款积分
+          payer: res.refundDelivery.payer,//运费承担方
+          sendPay:res.refundDelivery.deyNu //物流编号,判断是否提交成功
+        })
+        wx.hideLoading();
+        ths.get_countDown()
+      }
+    };
+    http.request(params);
+  },
+/**
+ * 同意后倒计时
+ * @param {*} e 
+ */
+get_countDown:function(){
+  const start = new Date(this.data.handelTime);
+    const end = new Date(start.getTime() + 48 * 60 * 60 * 1000);
+    const interval = setInterval(() => {
+      const now = new Date();
+      const diff = end - now;
+      if (diff <= 0) {
+        clearInterval(interval);
+        this.setData({
+          countdown_hours: '00天',
+          countdown_minutes:'00分钟'
+        });
+      } else {
+        const hours = Math.floor(diff / (1000 * 60 * 60));
+        const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
+        this.setData({
+          countdown_hours:String(hours).padStart(2, '0'),
+          countdown_minutes:String(minutes).padStart(2, '0')
+          // countdown_time:`${String(hours).padStart(2, '0')}小时${String(minutes).padStart(2, '0')}分钟`
+        });
+      }
+    }, 1000);
+},
+  /**
+   * 撤销退货退款申请
+   */
+  cancelApplication: function (e) {
+    console.log('撤销申请')
+    wx.showModal({
+      title: '撤销',
+      content: '确定要撤销本次申请?',
+      success: (res) => {
+        if (res.confirm) {
+          wx.showLoading({})
+          var params = {
+            url: "/p/orderRefund/cancel",
+            method: "PUT",
+            data: this.data.refundSn, //退款订单编号
+            callBack: function (res) {
+              wx.hideLoading();
+              wx.navigateTo({
+                url: '/pages/afterSales/afterSales',
+              })
+            }
+          };
+          http.request(params);
+        } else {
+          console.log('取消')
+        }
+      }
+    })
+
+  },
+
+
+  /**
+   * 跳转修改退款申请
+   */
+  // toAlterRefundApply: function (e) {
+  //   var refundSn = e.currentTarget.dataset.refundsn;
+  //   console.log(e.currentTarget.dataset.refundsn)
+  //   wx.navigateTo({
+  //     url: '/pages/applyRefund/applyRefund?refundSn=' + refundSn,
+  //   })
+  // },
+
+
+  /**
+   * 填写物流信息
+   */
+  toLogisticsPage: function (e) {
+    var refundSn = e.currentTarget.dataset.refundsn;
+    console.log(e.currentTarget.dataset.refundsn)
+    wx.navigateTo({
+      url: '/pages/writeReturnLogistics/writeReturnLogistics?refundSn=' + refundSn,
+    })
+  },
+
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 5 - 0
pages/DetailsOfRefund1/DetailsOfRefund.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {},
+  "backgroundTextStyle": "light",
+  "navigationBarTitleText": "退款详情"
+}

+ 267 - 0
pages/DetailsOfRefund1/DetailsOfRefund.wxml

@@ -0,0 +1,267 @@
+<!-- 退款详情 -->
+<!--pages/DetailsOfRefund/DetailsOfRefund.wxml-->
+
+<view class="page">
+  <!-- 头部状态 -->
+  <view class="describe-box">
+    <!-- 申请行进流程 -->
+    <view class="process">
+      <!-- 提交申请 -->
+      <view class="current-process" wx:if="{{returnMoneySts == 1}}">退款申请待商家处理</view>
+      <view class="acount-for-process" wx:if="{{returnMoneySts == 1}}">
+        你已成功发起退款申请,等待商家处理
+      </view>
+      <view class="acount-for-process" wx:if="{{returnMoneySts == 1}}">
+        {{updateTime}}
+      </view>
+      <!-- 商家拒绝 -->
+      <view class="current-process" wx:if="{{returnMoneySts == 7}}">商家不同意退款申请</view>
+      <view class="acount-for-process" wx:if="{{returnMoneySts == 7}}">
+        你可以修改退款申请
+      </view>
+      <view class="acount-for-process" wx:if="{{returnMoneySts == 7}}">
+        {{updateTime}}
+      </view>
+      <!-- 商家同意退款 -->
+      <view class="current-process" wx:if="{{returnMoneySts == 2}}">商家同意退款</view>
+      <view class="acount-for-process" wx:if="{{returnMoneySts == 2 && applyType == 1}}">
+        商家已同意,等待系统退款
+      </view>
+      <view class="acount-for-process" wx:if="{{returnMoneySts == 2 && applyType == 2}}">
+        商家已同意,请按照商家给出的退货地址寄回商品
+      </view>
+      <view class="acount-for-process" wx:if="{{returnMoneySts == 2}}">
+        {{updateTime}}
+      </view>
+      <!-- 寄出商品(退货退款情况下) -->
+      <view class="current-process" wx:if="{{returnMoneySts == 3}}">等待商家确认收货并退款</view>
+      <view class="acount-for-process" wx:if="{{returnMoneySts == 3}}">
+        你已退货,商家将在收货后尽快处理
+      </view>
+      <view class="acount-for-process" wx:if="{{returnMoneySts == 3}}">
+        {{updateTime}}
+      </view>
+      <!-- 商家确认收货 -->
+      <view class="current-process" wx:if="{{returnMoneySts == 4}}">商家确认收货</view>
+      <view class="acount-for-process" wx:if="{{returnMoneySts == 4}}">
+        商家已确认收货,等待系统退款
+      </view>
+      <view class="acount-for-process" wx:if="{{returnMoneySts == 4}}">
+        {{updateTime}}
+      </view>
+      <!-- 退款成功 -->
+      <view class="current-process" wx:if="{{returnMoneySts == 5}}">退款成功</view>
+      <view class="acount-for-process" wx:if="{{returnMoneySts == 5}}">
+        {{refundTime}}
+      </view>
+      <!-- 退款申请关闭 -->
+      <view class="current-process" wx:if="{{returnMoneySts == -1}}">退款申请关闭</view>
+      <view class="acount-for-process" wx:if="{{returnMoneySts == -1}}">
+        <!-- 由于你超时未处理,系统已关闭本次退款申请 -->
+        {{rejectMessage?rejectMessage:''}}
+      </view>
+      <view class="acount-for-process" wx:if="{{returnMoneySts == -1}}">
+        {{updateTime}}
+      </view>
+      <!-- 买家撤回申请 -->
+      <view class="current-process" wx:if="{{returnMoneySts == 6}}">申请已撤回</view>
+      <view class="acount-for-process" wx:if="{{returnMoneySts == 6}}">
+        你已撤回本次退款申请
+      </view>
+      <view class="acount-for-process" wx:if="{{returnMoneySts == 6}}">
+        {{updateTime}}
+      </view>
+      <!-- 隐藏内容(仅退款) -->
+      <view class="{{showView?'display':'more-content'}}" wx:if="{{returnMoneySts == 1}}">
+        <view class="cont">如果商家同意,申请将达成并退款给你</view>
+        <view class="cont">如果商家拒绝,你可以修改退款申请重新尝试</view>
+        <!-- <view class="cont">如果商家逾期未处理,退款申请将自动达成并退款给你</view> -->
+      </view>
+      <!-- 隐藏内容(退货退款申请商品未寄出) -->
+      <view class="{{showView?'display':'more-content'}}" wx:if="{{returnMoneySts == 2}}">
+        <view class="cont">如果商家同意,请按照给出的退货地址退货</view>
+        <view class="cont">如果商家拒绝,你可以修改退款申请重新尝试</view>
+        <!-- <view class="cont">如果商家逾期未处理,请按照系统给出的退货地址退货</view> -->
+      </view>
+      <!-- 隐藏内容(退货退款并已寄出货物) -->
+      <view class="{{showView?'display':'more-content'}}" wx:if="{{returnMoneySts == 3}}">
+        <view class="cont">如果商家确认收货,申请将达成并退款给你</view>
+        <view class="cont">如果商家拒绝收货,你可以修改退货物流信息重新尝试</view>
+        <!-- <view class="cont">如果商家逾期未处理,系统将自动确认收货并退款给你</view> -->
+      </view>
+    </view>
+    <!-- 申请行进流程end -->
+
+    <!-- 更多说明 -->
+    <view class="{{showView?'more-instructions':'display'}}" bindtap="onChangeShowState" wx:if="{{returnMoneySts < 4 && returnMoneySts !== -1 && applyType == 2}}">
+      <text class="more-txt">更多说明</text>
+      <view class="down-arrow-icon">
+        <image src="../../images/icon/down-arrow.png"></image>
+      </view>
+    </view>
+    <!-- 收起 -->
+    <view class="{{showView?'display':'more-instructions'}}" bindtap="onChangeShowState" wx:if="{{returnMoneySts < 4 && returnMoneySts !== -1 && applyType == 2}}">
+      <text class="more-txt">收起</text>
+      <view class="down-arrow-icon">
+        <image src="../../images/icon/up-arrow.png"></image>
+      </view>
+    </view>
+  </view>
+  <!-- 头部状态end -->
+
+  <!-- 【退款申请被拒绝时显示】拒绝理由 -->
+  <view class="refuse-reason" wx:if="{{returnMoneySts == 7}}">
+    拒绝理由:{{rejectMessage}}
+  </view>
+  <!-- 退货方式 -->
+  <!-- wx:if="{{returnMoneySts == 2 && applyType == 2}}" -->
+  <view class="return-address" wx:if="{{returnMoneySts == 3||returnMoneySts == 2 && applyType == 2}}">
+    <view class="addr-tit">退货方式</view>
+    <view class="address">
+      <view class="return-shop-box">
+        <view>
+          <view class="shop-title">{{payer==1?'商家':'用户'}}承担运费</view>
+          <view class="shop-text" wx:if="{{returnMoneySts==3}}">已发起配送</view>
+          <view class="shop-text" wx:else>请在{{countdown_hours}}小时{{countdown_minutes}}分钟内,发起配送,将货品退回给商家。</view>
+        </view>
+        <view class="shop-btn" bindtap="sendDistribution" wx:if="{{sendPay==null}}">发起配送</view>
+        <view class="shop-btn" bindtap="flowBution" wx:else>查看物流</view>
+      </view>
+    </view>
+  </view>
+  <!-- <view wx:if="{{cancelPay}}">
+    <view class="pay-card">
+      <view class="loading-time">等待支付,剩余<text style="color: #FF4D3A;">{{timeFormat}}</text></view>
+      <view class="time-out">超过15分钟未支付,订单将自动取消。</view>
+      <view class="pay-btn" bindtap="atoncePaySend">立即支付¥{{sendInfo.price}}</view>
+    </view>
+  </view> -->
+  <van-popup show="{{ addCarshow }}" closeable round position="bottom" custom-style="height: 45%" bind:close="onClose">
+    <view class="popup-box">
+      <view class="popup-title">寄回商品</view>
+      <view class="info-card-box">
+        <view class="card-address">顾客地址</view>
+        <view class="card-info">{{userAddrDto.address}}{{userAddrDto.addressName}}{{userAddrDto.addrDetail}}</view>
+        <view class="card-user">{{userAddrDto.receiver}} {{userAddrDto.mobile}}</view>
+        <view class="card-line"></view>
+        <view class="card-time-box" bindtap="selectUpTime">
+          <view class="card-time">*取件时间</view>
+          <view class="up-time">{{combinedTextValue||'请选择上门时间'}}
+            <van-icon name="arrow" />
+          </view>
+        </view>
+      </view>
+      <view class="costSide-card">
+        <view>配送费支付方</view>
+        <view>{{payer==1?'商家':'用户'}}</view>
+      </view>
+      <view class="bottom-button-box">
+        <!-- 支付方:payer=1店铺,2买家 -->
+        <view class="bottom-button" wx:if="{{payer==1}}" bindtap="submitBtn">提交</view>
+        <view class="send-pay-box" wx:else>
+          <view class="sendpay-text">配送费 <text style="color: #FF4D3A;">¥{{sendInfo.price||'0'}}</text></view>
+          <view class="sendpay-btn" bindtap="toPaySend">支付</view>
+        </view>
+      </view>
+    </view>
+  </van-popup>
+  <van-popup show="{{ selectTimeshow }}" overlay="{{false}}" round position="bottom" custom-style="height: 45%" bind:close="timeOnClose">
+    <view class="popup-box">
+      <view class="popup-title">选择上门时间</view>
+      <van-picker columns="{{ columns }}" show-toolbar bind:cancel="onCancel" bind:confirm="onConfirm" bind:change="onChange" />
+      <!-- <view class="popup-select-day">
+        <view class="day-left">
+          <view class="{{sts==0?'now-day':'tomorrow-day'}}" data-sts="0" data-time="{{nomDay}}" bindtap="selectday">{{nomDay+'(今天)'}}</view>
+          <view style="margin-top: 28rpx;" class="{{sts==1?'now-day':'tomorrow-day'}}" data-sts="1" data-time="{{tomorrowDay}}" bindtap="selectday">{{tomorrowDay+'(明天)'}}</view>
+        </view>
+        <view class="time-right">
+          <view class="sel-time{{currentSelectedIndex === index? 'selected' : ''}}" wx:for="{{timeIntervals}}" bindtap="selectTime" data-time="{{item}}" data-index="{{index}}">
+          <text wx:if="{{!item.hidden}}">{{item.interval}}</text></view>
+        </view>
+      </view> -->
+    </view>
+  </van-popup>
+  <van-popup show="{{ flowShow }}" closeable round position="bottom" custom-style="height: 45%" bind:close="flowOnClose">
+    <van-steps custom-class="steps-style" steps="{{ steps }}" active="{{ active }}" direction="vertical" active-color="#FF941A" />
+  </van-popup>
+  <!-- 【退货退款状态下,买家同意后】退货地址 -->
+  <view class="return-address" wx:if="{{returnMoneySts == 2 && applyType == 2}}">
+    <view class="addr-tit">退货地址</view>
+    <view class="address">
+      <view class="recipient">
+        <text class="addr-cont">收件人:{{refundDelivery.receiverName}}</text>
+        <text class="mobile">{{refundDelivery.receiverMobile}}</text>
+      </view>
+      <view class="addr">详细地址:{{refundDelivery.receiverAddr}}</view>
+    </view>
+  </view>
+
+
+  <!-- 退款信息 -->
+  <view class="refund-message">
+    <view class="refund-txt">退款信息</view>
+    <view class="goods-msg-box">
+      <!-- 店铺 -->
+      <!-- <view class="shop-box">
+        <view class="shop-img"><image src="../../images/icon/shop.png"></image></view>
+        <view class="shopname">店铺:{{shopName}}</view>
+      </view> -->
+      <!-- 图片 -->
+      <view class="img-box" wx:if="{{orderItems.length==1}}">
+        <image src="{{orderItems[0].pic}}"></image>
+      </view>
+      <!-- 信息 -->
+      <view class="goods-text" wx:if="{{orderItems.length==1}}">
+        <view class="goods-title">{{orderItems[0].prodName}}</view>
+        <view class="goods-quantity">数量:{{orderItems[0].prodCount}}件</view>
+      </view>
+
+      <block wx:if="{{orderItems.length>1}}">
+        <view class="refund-goods-item" wx:for="{{orderItems}}" wx:key="*this">
+          <!-- 图片 -->
+          <view class="img-box">
+            <image src="{{item.pic}}"></image>
+          </view>
+          <!-- 信息 -->
+          <view class="goods-text">
+            <view class="goods-title">{{item.prodName}}</view>
+            <view class="goods-quantity">数量:{{item.prodCount}}件</view>
+          </view>
+        </view>
+      </block>
+    </view>
+    <!-- 具体信息 -->
+    <view class="refund-cont">退款方式:{{['','仅退款','退货退款'][applyType]}}</view>
+    <view class="refund-cont">退款原因:{{buyerReason}}</view>
+    <view class="refund-cont">退款金额:
+      <text class="red" wx:if="{{refundAmount && refundAmount > 0}}">¥{{wxs.toPrice(refundAmount?refundAmount:0)}}</text>
+      <text class="red" wx:if="{{(refundScore && refundScore > 0) && (refundAmount && refundAmount > 0)}}">+</text>
+      <text class="red" wx:if="{{refundScore && refundScore > 0}}">{{refundScore}}积分</text>
+    </view>
+    <view class="refund-cont">退款编号:{{refundSn}}</view>
+    <view class="refund-cont">申请时间:{{applyTime}}</view>
+    <!-- 【退货申请显示】 -->
+    <view class="refund-cont" wx:if="{{goodsNum>0}}">退货数量:{{goodsNum}}</view>
+    <!-- 联系商家 -->
+    <!-- <view class="contact-merchant">联系商家</view> -->
+    <button class='contact-merchant' open-type="contact">联系客服</button>
+  </view>
+
+
+  <!-- 脚部撤销申请 -->
+  <!-- applyType: 1,  //申请类型:1,仅退款,2退款退货 -->
+  <!-- returnMoneySts: 处理退款状态:(1.买家申请 2.卖家接受 3.买家发货 4.卖家收货 5.退款成功 6.买家撤回申请 7.商家拒绝 -1.退款关闭) -->
+  <view class="foot-box">
+    <view class="footer">
+      <!-- 【申请后-申请完成前】 -->
+      <text class="undo-apply" bindtap="cancelApplication" wx:if="{{returnMoneySts ==1 || returnMoneySts == 7 || (returnMoneySts ==2 && applyType == 2)}}">撤销申请</text>
+      <!-- 【商家拒绝时显示】 -->
+      <!-- <text class="undo-apply apply-current" bindtap="toAlterRefundApply" wx:if="{{returnMoneySts ==1 || returnMoneySts == 7}}" data-refundsn="{{refundSn}}">修改申请</text> -->
+      <!-- 【商家同意后-货物寄出前】 -->
+      <!-- <text class="undo-apply apply-current" bindtap="toLogisticsPage" wx:if="{{returnMoneySts == 2 && applyType == 2}}" data-refundsn="{{refundSn}}">填写退货物流</text> -->
+    </view>
+  </view>
+
+</view>
+
+<wxs module="wxs" src="../../wxs/number.wxs" />

+ 633 - 0
pages/DetailsOfRefund1/DetailsOfRefund.wxss

@@ -0,0 +1,633 @@
+/* pages/DetailsOfRefund/DetailsOfRefund.wxss */
+.display {
+  display: none;
+}
+
+image {
+  width: 100%;
+  height: 100%;
+}
+
+.page {
+  position: fixed;
+  width: 100%;
+  height: 100%;
+  overflow: auto;
+  background: #f7f7f7;
+}
+
+/* 头部状态 */
+.describe-box {
+  background: #fff;
+  margin-bottom: 20rpx;
+}
+
+.process {
+  padding: 20rpx 25rpx;
+  border-bottom: 1rpx solid #f2f2f2;
+}
+
+.current-process {
+  font-size: 30rpx;
+  font-weight: bold;
+  padding: 10rpx 0;
+}
+
+.acount-for-process {
+  font-size: 28rpx;
+  color: #444;
+  line-height: 1.5em;
+}
+
+.red {
+  color: #e43130;
+}
+
+/* 隐藏内容 */
+.more-content {
+  border-top: 1rpx dashed #ebebeb;
+  margin-top: 15rpx;
+  padding-top: 10rpx;
+}
+
+.cont {
+  font-size: 28rpx;
+  color: #666666;
+  line-height: 1.8em
+}
+
+/* 更多说明 */
+.more-instructions {
+  padding: 18rpx 0;
+  padding-bottom: 22rpx;
+  text-align: center;
+  font-size: 27rpx;
+}
+
+.more-txt {
+  vertical-align: middle;
+}
+
+.down-arrow-icon {
+  display: inline-block;
+  width: 40rpx;
+  height: 25rpx;
+  vertical-align: middle;
+}
+
+
+/* 退款流程 */
+.refund-schedule {
+  background: #fff;
+  margin-bottom: 20rpx;
+  padding: 0 25rpx;
+}
+
+.refund-sum {
+  font-size: 28rpx;
+  padding: 25rpx 0;
+  border-bottom: 1rpx solid #f2f2f2;
+}
+
+.progress-bar {
+  position: relative;
+  display: flex;
+  justify-content: space-around;
+  padding: 20rpx 0;
+}
+
+.block {
+  display: inline-block;
+  text-align: center;
+}
+
+.round {
+  display: block;
+  width: 13rpx;
+  height: 13rpx;
+  border-radius: 50%;
+  background: #999999;
+  margin: 0 auto;
+  margin-top: 15rpx;
+}
+
+/* 激活状态圆点 */
+.round-current {
+  background: #3388ff;
+}
+
+.block-text {
+  margin-top: 15rpx;
+  text-align: center;
+}
+
+.block-text-tit {
+  font-size: 26rpx;
+  line-height: 2em;
+  color: #777;
+}
+
+.block-text-time {
+  font-size: 22rpx;
+  color: #aaa;
+}
+
+.line {
+  position: absolute;
+  top: 39rpx;
+  display: inline-block;
+  width: 215rpx;
+  height: 5rpx;
+  background: #bdbdbd;
+}
+
+/* 激活状态直线 */
+.line-current {
+  background: #3388ff;
+}
+
+.line01 {
+  left: 145rpx;
+}
+
+.line02 {
+  right: 115rpx;
+}
+
+/* 拒绝理由 */
+.refuse-reason {
+  font-size: 28rpx;
+  background: #fff;
+  padding: 20rpx;
+  margin-bottom: 20rpx;
+}
+
+
+/* 退货地址 */
+.return-address {
+  background: #fff;
+  margin-bottom: 20rpx;
+}
+
+.addr-tit {
+  padding: 10rpx 20rpx;
+  border-bottom: 1rpx solid #f2f2f2;
+  font-size: 30rpx;
+  font-weight: bold;
+}
+
+.addr {
+  padding-right: .5em;
+}
+
+.address {
+  padding: 20rpx;
+  font-size: 28rpx;
+}
+
+.recipient {
+  padding-bottom: 10rpx;
+}
+
+.mobile {
+  margin-left: 50rpx;
+}
+
+.pay-card {
+  background: #fff;
+  margin-bottom: 20rpx;
+  padding: 20rpx;
+}
+
+.loading-time {
+  font-family: PingFang SC, PingFang SC;
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #181818;
+}
+
+.time-out {
+  margin-top: 20rpx;
+  font-family: PingFang SC, PingFang SC;
+  font-weight: normal;
+  font-size: 24rpx;
+  color: #AAAAAA;
+}
+
+.pay-btn {
+  margin-top: 20rpx;
+  width: 220rpx;
+  height: 64rpx;
+  border-radius: 40rpx;
+  border: 2rpx solid #FF4D3A;
+  font-family: PingFang SC, PingFang SC;
+  font-weight: normal;
+  font-size: 28rpx;
+  color: #FF4D3A;
+  text-align: center;
+  line-height: 64rpx;
+}
+
+/* 退货方式 */
+.return-shop-box {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.shop-title {
+  font-family: PingFang SC, PingFang SC;
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #181818;
+}
+
+.shop-text {
+  margin-top: 20rpx;
+  font-family: PingFang SC, PingFang SC;
+  font-weight: normal;
+  font-size: 24rpx;
+  color: #AAAAAA;
+}
+
+.shop-btn {
+  width: 136rpx;
+  height: 64rpx;
+  background: #FFFFFF;
+  border-radius: 40rpx;
+  border: 2rpx solid #FF4D3A;
+  font-family: PingFang SC, PingFang SC;
+  font-weight: normal;
+  font-size: 28rpx;
+  color: #FF4D3A;
+  line-height: 64rpx;
+  text-align: center;
+}
+
+.popup-box {
+  padding: 20rpx;
+}
+
+.popup-title {
+  margin-top: 28rpx;
+  font-family: PingFang SC, PingFang SC;
+  font-weight: 800;
+  font-size: 32rpx;
+  text-align: center;
+}
+
+.popup-select-day {
+  display: flex;
+}
+
+.day-left {
+  margin-top: 50rpx;
+}
+
+.now-day {
+  font-weight: normal;
+  font-size: 28rpx;
+  color: #222222;
+}
+
+.tomorrow-day {
+  font-weight: normal;
+  font-size: 28rpx;
+  color: #AAAAAA;
+}
+
+.time-right {
+  margin-top: 50rpx;
+  margin-left: 300rpx;
+  height: 500rpx;
+  overflow-y: auto; 
+  font-weight: normal;
+  font-size: 28rpx;
+  color: #222222;
+}
+.time-right::-webkit-scrollbar {
+  display: none;
+}
+.sel-time {
+  margin-bottom:28rpx;
+  font-weight: normal;
+  font-size: 28rpx;
+  color: #AAAAAA;
+}
+.sel-timeselected{
+  margin-bottom:28rpx;
+  color: #222222;
+}
+.info-card-box {
+  margin-top: 20rpx;
+  background-color: #F9F9F9;
+  border-radius: 16rpx;
+  padding: 20rpx;
+}
+
+.card-address {
+  font-family: PingFang SC, PingFang SC;
+  font-weight: normal;
+  font-size: 28rpx;
+  color: #222222;
+}
+
+.card-info {
+  margin-top: 20rpx;
+  font-family: PingFang SC, PingFang SC;
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #222222;
+}
+
+.card-user {
+  margin-top: 20rpx;
+  font-family: PingFang SC, PingFang SC;
+  font-weight: normal;
+  font-size: 24rpx;
+  color: #AAAAAA;
+}
+
+.card-line {
+  margin-top: 20rpx;
+  border: 2rpx solid #F0F0F0;
+}
+
+.card-time-box {
+  margin-top: 20rpx;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.card-time {
+  font-family: PingFang SC, PingFang SC;
+  font-weight: normal;
+  font-size: 28rpx;
+  color: #222222;
+}
+
+.up-time {
+  font-family: PingFang SC, PingFang SC;
+  font-weight: normal;
+  font-size: 28rpx;
+  color: #AAAAAA;
+}
+
+.costSide-card {
+  margin-top: 20rpx;
+  background-color: #F9F9F9;
+  border-radius: 16rpx;
+  padding: 20rpx;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.costSide-card>view:first-child {
+  font-family: PingFang SC, PingFang SC;
+  font-weight: normal;
+  font-size: 28rpx;
+  color: #222222;
+}
+
+.costSide-card>view:last-child {
+  font-family: PingFang SC, PingFang SC;
+  font-weight: normal;
+  font-size: 28rpx;
+  color: #AAAAAA;
+}
+
+.bottom-button-box {
+  background: #FFFFFF;
+  box-shadow: 0rpx -6rpx 12rpx 2rpx rgba(0, 0, 0, 0.09);
+  border-radius: 32rpx 32rpx 0rpx 0rpx;
+  display: flex;
+  justify-content: center;
+}
+
+.bottom-button {
+  width: 702rpx;
+  height: 80rpx;
+  background: #FF941A;
+  border-radius: 40rpx;
+  margin-top: 30rpx;
+  font-family: PingFang SC, PingFang SC;
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #FFFFFF;
+  text-align: center;
+  line-height: 80rpx;
+}
+
+.picker-style {
+  font-size: 16rpx !important;
+  margin-left: -80rpx;
+}
+
+.send-pay-box {
+  display: flex;
+  align-items: center;
+  margin-top: 30rpx;
+}
+
+.sendpay-text {
+  font-family: PingFang SC, PingFang SC;
+  font-weight: normal;
+  font-size: 28rpx;
+  width: 400rpx;
+}
+
+.sendpay-btn {
+  width: 220rpx;
+  height: 80rpx;
+  background: #FF941A;
+  border-radius: 40rpx;
+  font-family: PingFang SC, PingFang SC;
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #FFFFFF;
+  line-height: 80rpx;
+  text-align: center;
+}
+
+/* 查看协商记录 */
+/* .negotiate-record {
+  position: relative;
+  font-size: 25rpx;
+  text-align: left;
+  background: #fff;
+  padding: 20rpx 25rpx;
+  margin-bottom: 20rpx;
+}
+.more-arrow {
+  position: absolute;
+  right: 20rpx;
+  top: 50%;
+  transform: translateY(-50%);
+  width: 22rpx;
+  height: 22rpx;
+} */
+
+
+/* 退款信息 */
+.refund-message {
+  background: #fff;
+  padding: 20rpx 25rpx;
+}
+
+.refund-txt {
+  font-size: 30rpx;
+  margin-bottom: 25rpx;
+  font-weight: bold;
+}
+
+/* 店铺 */
+.shop-box {
+  display: block;
+  padding-bottom: 20rpx;
+  margin-bottom: 20rpx;
+  border-bottom: 1rpx solid #f0f0f0;
+}
+
+.shop-img {
+  display: inline-block;
+  width: 36rpx;
+  height: 36rpx;
+  vertical-align: middle;
+  margin-right: 10rpx;
+}
+
+.shop-img>iamge {
+  display: block;
+  width: 100%;
+  height: 100%;
+}
+
+.shopname {
+  display: inline-block;
+  font-size: 28rpx;
+  line-height: 1em;
+  vertical-align: middle;
+  color: #444444;
+}
+
+/* 商品信息 */
+.goods-msg-box {
+  background: #f9f9f9;
+  padding: 15rpx 20rpx;
+  margin: 15rpx 0;
+}
+
+.img-box {
+  display: inline-block;
+  width: 150rpx;
+  height: 150rpx;
+  margin-right: 20rpx;
+  background: #eee;
+  vertical-align: top;
+}
+
+.goods-text {
+  display: inline-block;
+  vertical-align: top;
+  width: 70%;
+}
+
+.goods-title {
+  font-size: 28rpx;
+  display: -webkit-box;
+  -webkit-line-clamp: 2;
+  /*设定显示行数*/
+  -webkit-box-orient: vertical;
+  word-break: break-all;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+
+.goods-quantity {
+  font-size: 28rpx;
+  color: #888888;
+  margin-top: 20rpx;
+}
+
+/* 具体信息 */
+.refund-cont {
+  font-size: 28rpx;
+  color: #666666;
+  line-height: 2em;
+}
+
+/* 联系商家 */
+.contact-merchant {
+  font-size: 28rpx;
+  color: #FF941A;
+  text-align: center;
+  padding-top: 20rpx;
+  margin-top: 20rpx;
+  border-top: 1rpx solid #f2f2f2;
+}
+
+button.contact-merchant {
+  background: #fff;
+}
+
+button.contact-merchant::after {
+  border: 0;
+}
+
+/* 整单退款商品列表 */
+.refund-goods-item {
+  padding: 20rpx 0;
+  border-bottom: 2rpx solid #ddd;
+}
+
+.refund-goods-item:last-child {
+  border-bottom: none;
+}
+
+/* 脚部撤销 */
+.foot-box {
+  display: block;
+  margin-top: 150rpx;
+}
+
+.footer {
+  display: block;
+  box-sizing: border-box;
+  position: fixed;
+  width: 100%;
+  bottom: 0;
+  font-size: 28rpx;
+  background: #fff;
+  padding: 0 30rpx;
+  text-align: right;
+  box-shadow: 1rpx 10rpx 10rpx 10rpx rgb(236, 236, 236);
+}
+
+.undo-apply {
+  display: inline-block;
+  box-sizing: border-box;
+  padding: 15rpx 20rpx;
+  font-size: 25rpx;
+  border-radius: 5rpx;
+  margin: 25rpx 0;
+  margin-left: 15rpx;
+  border-radius: 40rpx;
+  border: 1rpx solid #aaaaaa;
+  color: #555555;
+}
+
+.undo-apply-end {
+  display: inline-block;
+  box-sizing: border-box;
+  margin-left: 15rpx;
+  color: #777;
+  font-size: 30rpx;
+
+}
+
+.apply-current {
+  border: 1rpx solid rgb(0, 173, 0);
+  color: rgb(0, 173, 0);
+
+}

+ 63 - 522
pages/applyRefund/applyRefund.js

@@ -1,385 +1,74 @@
 // pages/applyRefund/applyRefund.js
-var http = require('../../utils/http.js');
-var big = require('../../utils/big.min.js');
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-    refundType: 2,  // 退款类型 1整单  2单个物品
-    // 货物状态
-    goodsStateArray: ['未收到货', '已收到货'],
-    isReceiver: 0, //货物状态(1:已收到货 0:未收到货)
-
-    //  退款原因(已收到货)
-    refundProdReasonArray: ['请选择', '拍错/多拍/不喜欢', '协商一致退款', '商品破损/少件', '商品与描述不符', '卖家发错货', '质量问题', '其他'],
-    // 退款原因(未收到货)
-    refundPriReasonArray: ['请选择', '协商一致退款', '拍错/多拍/不喜欢', '商家一直未发货/快递一直未送达', '其他'],
-    buyerReason: 0, //退款原因
-
-
-    refundItem: {}, //订单项数据
-    orderItemId: '', //订单项ID(单个物品退款时使用)
-    orderNumber: '', //订单编号
-
-    applyType: 1, //退款方式(1:仅退款 2退款退货)
-    goodsNum: 1, //退货数量(0或不传值则为全部数量)
-    // quantity: 1,  //退货数量
-    refundAmount: 0, //实际退款金额
-    maxRefundAmount: 0, //最大退款金额
-    buyerMobile: '', //手机号码(默认当前订单手机号码)
-    buyerDesc: '', //备注说明
-    photoFiles: [], //凭证图片列表
-    actualTotal: 0,  //总额
-    isLastProd: false,  //是否最后一样商品
-    prodPrice: 0,  //商品单价
-
-    addTransfee: false, //是否可以加运费(仅一件商品)
-    orderScore: 0, // 整单使用积分
-
-    showNumAndCont: '', // 金额、积分、运费的展示(最多可退)
-    showPriAndScore: '', // 金额、积分、运费的展示(金额+积分)
-    
+    show:false,
+    isAll:false,
+    goodList:[
+      {
+        name:'赶海季生鲜大闸蟹',
+        checked:false
+      },
+      {
+        name:'水果纯甜柿子',
+        checked:false
+      },
+      {
+        name:'空运鲜牛肉',
+        checked:true
+      }
+    ],
+    reasonList:[
+      {name:'暂不需要商品(买错/多买/漏买)'},
+      {name:'冰品融化'},
+      {name:'订单中有商品发错'},
+      {name:'商品斤两不足'},
+      {name:'商品临期到期'},
+      {name:'商品破损/包装破损'},
+      {name:'商品质量问题'},
+      {name:'实物与图文描述不符'},
+      {name:'商家通知我卖完了'},
+      {name:'所有商品未收到'},
+      {name:'整个订单送错'},
+      {name:'订单少选且商家未通知我'},
+      {name:'未在约定时间送达'},
+    ],
   },
 
   /**
-   * 金额、积分、运费的展示
-   * 
-   * refundType: 退款单类型(1:整单退款,2:单个退款)
-   * applyType: 退款方式(1:仅退款 2退款退货)
-   * refundAmount: 实际退款金额
-   * actualTotal: 总额
-   * orderScore: 使用积分
-   * refundItem.status == 2 待发货
-   * refundItem.transfee 运费
-   * isLastProd:是否最后一个订单项item
+   * 生命周期函数--监听页面加载
    */
-  showNumber: function() {
-    var refundItem = this.data.refundItem
-    var refundAmount = this.data.refundAmount
-    var refundType = this.data.refundType
-    var actualTotal = this.data.actualTotal
-    var orderScore = this.data.orderScore
-    var isLastProd = this.isLastProd
-    var showNumAndCont = ''
-    var showPriAndScore = ''
-    // 待发货
-    if(refundItem.status == 2) {
-      // 有金额,无运费,无积分
-      if(refundAmount > 0 && (!refundItem.transfee || refundItem.transfee == 0) && (!orderScore || orderScore == 0)){
-        // 单个退 || 整单退
-        if(refundType == 2 || refundType == 1) {
-          showNumAndCont = '¥' + refundAmount
-          showPriAndScore = '¥' + refundAmount
-        }
-      }
-      // 有金额,有运费,无积分
-      if(actualTotal > 0 && (refundItem.transfee && refundItem.transfee > 0) && (!orderScore || orderScore == 0)) {
-        if(isLastProd && refundType == 2) { 
-          // 单个退 && 最后一个订单项
-          showNumAndCont = '¥' + actualTotal + '+运费' + '¥' + refundItem.transfee // 最多可退
-          showPriAndScore = '¥' + refundAmount // 显示金额+积分
-        }else { // (单个退 && 不是最后一个订单项) || 整单退
-          showNumAndCont = '¥' + refundAmount // 最多可退
-          showPriAndScore = '¥' + refundAmount // 显示金额+积分
-        }
-      }
-      //有金额,有运费,有积分
-      if(actualTotal > 0 && (refundItem.transfee && refundItem.transfee > 0) && (orderScore || orderScore > 0)) {
-        if(isLastProd && refundType == 2) { 
-          // 单个退 && 最后一个订单项
-          showNumAndCont = '¥' + actualTotal + '+运费' + '¥' + refundItem.transfee + '+' + orderScore + '积分' // 最多可退
-          showPriAndScore = '¥' + refundAmount +  '+' + orderScore + '积分' // 显示金额+积分
-        }else { // (单个退 && 不是最后一个订单项) || 整单退
-          showNumAndCont = '¥' + refundAmount + '+' + orderScore + '积分' // 最多可退
-          showPriAndScore = '¥' + refundAmount +  '+' + orderScore + '积分' // 显示金额+积分
-        }
-      }
-      //无金额,无运费,有积分
-      if((!refundAmount || refundAmount == 0) && (!refundItem.transfee || refundItem.transfee == 0) && (orderScore && orderScore > 0)) {
-        // 单个退 || 整单退
-        if(refundType == 2 || refundType == 1){
-          showNumAndCont =  orderScore + '积分'
-          showPriAndScore = orderScore + '积分'
-        }
-      }
-      //无金额,有运费,有积分
-      if((!refundAmount || refundAmount == 0)&& (refundItem.transfee && refundItem.transfee > 0) && (orderScore && orderScore > 0)) {
-        // 单个退 || 整单退
-        if(refundType == 2 || refundType == 1){
-          showNumAndCont = '运费' + '¥' + refundItem.transfee + '+' + orderScore + '积分'
-          showPriAndScore = '¥' + refundItem.transfee + '+' + orderScore + '积分'
-        }
-      }
-      console.log('待发货(最多可退):',showNumAndCont)
-      console.log('待发货(金额+积分):',showPriAndScore)
-
-    };
-
-    // 非待发货(已发货 || 已完成)任何情况都不退运费
-    if(refundItem.status != 2) {
-      // 有金额,无运费,无积分
-      if(refundAmount > 0 && (!refundItem.transfee || refundItem.transfee == 0) && (!orderScore || orderScore == 0)){
-        // 单个退 || 整单退
-        if(refundType == 2 || refundType == 1) {
-          showNumAndCont= '¥' + refundAmount
-          showPriAndScore = '¥' + refundAmount
-        }
-      }
-      // 有金额,有运费,无积分
-      if(refundAmount > 0 && (refundItem.transfee && refundItem.transfee > 0) && (!orderScore || orderScore == 0)) {
-        // 单个退 || 整单退
-        if(refundType == 2 || refundType == 1) {
-          showNumAndCont = '¥' + refundAmount
-          showPriAndScore = '¥' + refundAmount
-        }
-      }
-      //有金额,有运费,有积分
-      if(refundAmount > 0 && (refundItem.transfee && refundItem.transfee > 0) && (orderScore || orderScore > 0)) {
-        // 单个退 || 整单退
-        if(refundType == 2 || refundType == 1){
-          showNumAndCont = '¥' + refundAmount + '+' + orderScore + '积分'
-          showPriAndScore = '¥' + refundAmount + '+' + orderScore + '积分' // 显示金额+积分
-        }
-      }
-      //无金额,无运费,有积分
-      if((!refundAmount || refundAmount == 0) && (!refundItem.transfee || refundItem.transfee == 0) && (orderScore && orderScore > 0)) {
-        // 单个退 || 整单退
-        if(refundType == 2 || refundType == 1){
-          showNumAndCont =  orderScore + '积分'
-          showPriAndScore = orderScore + '积分' // 显示金额+积分
-        }
-      }
-      //无金额,有运费,有积分
-      if((!refundAmount || refundAmount == 0)&& (refundItem.transfee && refundItem.transfee > 0) && (orderScore && orderScore > 0)) {
-        // 单个退 || 整单退
-        if(refundType == 2 || refundType == 1){
-          showNumAndCont = orderScore + '积分'
-          showPriAndScore = orderScore + '积分' // 显示金额+积分
-        }
-      }
-      console.log('已发货(最多可退):',showNumAndCont)
-      console.log('已发货(金额+积分):',showPriAndScore)
-    }
-    this.setData({
-      showNumAndCont,
-      showPriAndScore
-    })
-    console.log('最多可退showNumAndCont:',this.data.showNumAndCont)
-    console.log('金额+积分showPriAndScore:',this.data.showPriAndScore)
-  },
+  onLoad(options) {
 
-  /**
-   * 退款原因选择
-   * refundType:  退款类型 1整单  2单个物品
-   * refundItem.status: 2待发货
-   * isReceiver: 货物状态(1:已收到货 0:未收到货)
-   * applyType:  1仅退款 2退货退款
-   */
-  returnReasonList: function() {
-    if(this.data.applyType == 2) {
-      this.setData({
-        isReceiver: 1 // 已收到货
-      })
-    }else {
-      this.setData({
-        isReceiver: 0 // 已收到货
-      })
-    }
-    console.log('isReceiver货物状态(1:已收到货 0:未收到货)',this.data.isReceiver)
   },
-
-
   /**
-   * 货物状态picker选择
+   * 打开选择原因弹窗
    */
-  goodsStateArray: function(e) {
-    console.log('货物状态', e.detail.value)
+  choose(){
     this.setData({
-      isReceiver: e.detail.value,
-      buyerReason: 0
+      show:true
     })
   },
 
-  /**
-   * 退款原因picker选择
-   */
-  refundReasonChange: function(e) {
-    console.log('退款原因', e.detail.value)
+  close(){
     this.setData({
-      buyerReason: e.detail.value
+      show:false
     })
   },
-
-
-  /**
-   * 生命周期函数--监听页面加载
+ /**
+   * 选择原因
    */
-  onLoad: function(options) {
-    console.log(options,'----参数');
-    // 拿到上一页的参数type(判断退款方式)
-    // console.log('type:',options.type)
-    if (options.type) {
-      this.setData({
-        applyType: options.type  // 1仅退款 2退货退款
-      })
-      // console.log(this.data.type)
-    }
-    // console.log('refundType:',options.refundType)
-    this.setData({
-      refundType: options.refundType  // 退款类型 1整单  2单个物品
-    })
-    console.log('refundType(退款类型 1整单  2单个物品)',this.data.refundType)
-
-    this.getRefundProdInfo()  //获取退款商品信息
+  chooseReason(){
+   
   },
 
-  /**
-   * 获取退款商品信息
-   */
-  getRefundProdInfo: function() {
-    let refundType = this.data.refundType  // 退款类型 1整单  2单个物品
-    //拿到缓存里的订单项数据
-    var refundItem = wx.getStorageSync("refundItem");
-    console.log('拿到缓存里的订单项数据refundItem:',refundItem)
-    this.setData({
-      refundItem: refundItem,
-      orderNumber: refundItem.orderNumber,
-      goodsNum: refundItem.prodCount,
-      actualTotal: refundItem.actualTotal,  //总额
-      isLastProd: refundItem.isLastProd,  //是否最后一样商品
-      addTransfee: refundItem.addTransfee, //只有一件商品可以退运费
-      orderScore: refundItem.useScore // 单个退积分
-    })
-    console.log('单个退orderScore:',this.data.orderScore)
-    // console.log('platformShareReduce:',this.data.refundItem.platformShareReduce)
-    // console.log(refundItem.isLastProd)
-    if(refundType == 1) {  //整单退款
-      this.setData({
-        orderItemDtos: refundItem.orderItemDtos, //商品列表
-        orderScore: refundItem.orderScore,  //整单积分
-      });
-      console.log('整单退orderScore:',this.data.orderScore)
-    }
-    let actualTotal = this.data.actualTotal  //商品总额(不含运费)
-    let prodCount = refundItem.prodCount  //商品总数
-    // console.log('商品总数prodCount',prodCount)
-    // console.log('商品总额(不含运费)actualTotal',actualTotal)
-    if(refundType == 2) {  //单个退
-      // 计算商品单价
-      if(prodCount > 0) {
-        var x = new big(actualTotal)
-        var y = new big(prodCount)
-        // 保留两位小数
-        big.DP = 2
-        // 向下取整
-        big.RM = 1
-        let prodPrice = x.div(y).valueOf()  //商品单价
-        this.setData({
-          prodPrice
-        })
-        // console.log(this.prodPrice)
-      }
-    }
-    
-    this.returnReasonList() // 退款原因选择列表展示
-    this.refundAmount() //退款金额计算
-    
-  },
-  /**
-   * 退款金额计算
-   */
-  refundAmount: function() {
-    let actualTotal = this.data.actualTotal
-    // console.log('总额this.data.actualTotal:',this.data.actualTotal)
-    let refundItem = this.data.refundItem
-    // console.log('商品item,this.data.refundItem:',this.data.refundItem)
-    let refundType = this.data.refundType  // 退款类型 1整单  2单个物品
-    
-    // console.log('refundType退款类型 1整单  2单个物品:',this.data.refundType)
-    // console.log('addTransfee是否可加运费:',this.addTransfee)
-    if (refundItem.status == 2) { //待发货状态
-      if(refundType == 2) {  //单个退,
-        if(refundItem.isLastProd) {  //如果是最后一个可退运费(actualTotal总额不包含运费)
-          this.setData({
-            refundAmount: actualTotal + refundItem.transfee,
-          });
-          // console.log('运费:',refundItem.transfee,'+总额:',actualTotal)
-          // console.log('待发货单个退(最后一个)金额:',this.data.refundAmount)
-        }else { //否则不退
-          this.setData({
-            refundAmount: actualTotal,
-          });
-          if(this.addTransfee) { // 如果是只有一个商品,可退运费
-            this.setData({
-              refundAmount: actualTotal + refundItem.transfee,
-            });
-            // console.log('单个退加运费可退总额:',this.refundAmount)
-          }
-          // console.log('运费:',refundItem.transfee,'+总额:',actualTotal)
-          // console.log('待发货单个退(不是最后一个)金额:',this.data.refundAmount)
-        }
-      } else if(refundType == 1) {  //整单退,退实际金额(actualTotal总额包含运费)
-        this.setData({
-          refundAmount: actualTotal,
-        });
-        // console.log('运费:',refundItem.transfee)
-        // console.log('待发货整单退金额:',this.data.refundAmount)
-      }
-    } else if (refundItem.status != 2) { // 已发货订单(整单退运费(总额包含运费);单个不退运费(总额不包含运费))
-       this.setData({
-         refundAmount: actualTotal,
-       });
-      //  console.log('运费:',refundItem.transfee)
-      //  console.log('已发货整单退金额:',this.data.refundAmount)
-    }
-
-    this.showNumber() // 金额、积分、运费的显示
-  },
-
-    /**
-     * 改变商品数量重新计算价格(数量加减)
-     */
-    changePordNum(e) {
-      var st = e.currentTarget.dataset.st;
-      let actualTotal = this.data.actualTotal  //商品总额(不含运费)
-      var prodCount = this.data.refundItem.prodCount  //商品总数
-      if(st == 0){
-        var goodsNum = this.data.goodsNum - 1 //展示的商品总数
-      }else if(st == 1) {
-        var goodsNum = this.data.goodsNum + 1 //展示的商品总数
-      }
-      if(goodsNum < 1) {
-        wx.showToast({
-          title: '退货数量不能小于1!',
-          icon: 'none',
-        })
-        return
-      }
-      if(goodsNum > prodCount) {
-        wx.showToast({
-          title: '退货数量不能大于订单商品数量!',
-          icon: 'none',
-        })
-        return
-      }
-      big.DP = 2
-      // big.RM = 0
-      this.setData({
-        goodsNum,
-        refundAmount: new big(actualTotal).times(goodsNum).div(prodCount).valueOf()
-      })
-    },
-
-
-
-  /**
+   /**
    * 上传图片
    */
   getUploadImg: function(e) {
-    var idx = e.target.dataset.idx
-    // console.log(idx);
     var ths = this;
     wx.chooseMedia({
       count: 1, // 默认9
@@ -414,223 +103,75 @@ Page({
   },
 
   /**
-   * 删除图片
+   * 选择类型
    */
-  removeImage: function(e) {
-    var idx = e.currentTarget.dataset.idx;
-    var photoFiles = this.data.photoFiles;
-    photoFiles.splice(idx, 1)
-    this.setData({
-      photoFiles: photoFiles
-    });
-    console.log('删除图片')
+  radioChange(e){
+    console.log(e);
   },
 
-
   /**
-   * 申请退款
+   * 全选
    */
-  applyRefund: function () {
-    var myreg = /^1(3|4|5|6|7|8|9)\d{9}$/;
-    var pics = '';
-    this.data.photoFiles.forEach(function (item) {
-      pics += item.path + ',';
-    });
-    if (pics != '') {
-      pics = pics.substring(0, pics.length - 1)
-    }
-    // 检查数据完整性
-    if (this.data.buyerReason == 0) {
-      wx.showToast({
-        icon: 'none',
-        title: '请选择退款原因',
-      })
-    } else if (this.data.actualTotal < 0){
-      wx.showToast({
-        icon: 'none',
-        title: '请填写正确的退款金额',
-      })
-    } else if (this.data.buyerMobile.length !== 11 || !myreg.test(this.data.buyerMobile)) {
-      // console.log(this.data.buyerMobile)
-      wx.showToast({
-        icon: 'none',
-        title: '请填写正确的手机号码',
-      })
-    } else if (this.data.buyerDesc.length == 0) {
-      wx.showToast({
-        icon: 'none',
-        title: '请填写退款说明',
-      })
-    }else{
-      console.log('status:',this.data.refundItem.status)
-      console.log('isLastProd:',this.data.isLastProd)
-      var  refundReasonArray;
-      var  refundReasonArray;
-      if(this.data.isReceiver == 0) { // 未收货
-        refundReasonArray = this.data.refundPriReasonArray
-      }else if(this.data.isReceiver == 1) { // 已收货
-        refundReasonArray = this.data.refundProdReasonArray
-      }
-      if(this.data.refundItem.status == 2 && this.data.isLastProd ) {  //待发货(包含运费)并且是最后一件
-        console.log('待发货并且是最后一件')
-        console.log(this.data.isLastProd)
-        wx.showModal({
-          title: '提示',
-          content: '本次申请的退款商品是本单最后一件商品,退款金额中包含本单运费,一旦提交申请,本单所有商品的退款申请均不可撤销,是否确认提交',
-          success: res => {
-            if (res.confirm) {
-              console.log('用户点击确定')
-              wx.showLoading();
-              var params = {
-                url: "/p/orderRefund/apply",
-                method: "POST",
-                data: {
-                  orderNumber: this.data.orderNumber, //订单编号
-                  applyType: this.data.applyType, //退款方式(1:仅退款 2退款退货)
-                  isReceiver: Number(this.data.isReceiver), //货物状态(1:已收到货 0:未收到货)
-                  buyerReason: refundReasonArray[this.data.buyerReason], //退款原因
-                  goodsNum: this.data.goodsNum, //退款数量(0或不传值则为全部数量)
-                  refundAmount: this.data.refundAmount, //退款金额
-                  buyerMobile: this.data.buyerMobile, //手机号码(默认当前订单手机号码)
-                  buyerDesc: this.data.buyerDesc, //备注说明
-                  photoFiles: pics, //凭证图片列表
-                  refundType: this.data.refundType, //退款单类型(1:整单退款,2:单个物品退款)
-                  orderItemId: this.data.refundItem.orderItemId
-                },
-                callBack: (res) => {
-                  wx.hideLoading();
-                  // 去到我的退款订单页面
-                  wx.redirectTo({
-                    url: '/pages/afterSales/afterSales',
-                  })
-                }
-              };
-              http.request(params);
-            } else if (res.cancel) {
-              console.log('用户点击取消')
-            }
-          }
-        })
-      } else {
-        console.log('非待发货(包含运费)或者非是最后一件')
-        console.log(this.data.isLastProd)
-        wx.showLoading();
-        var params = {
-          url: "/p/orderRefund/apply",
-          method: "POST",
-          data: {
-            orderNumber: this.data.orderNumber, //订单编号
-            applyType: this.data.applyType, //退款方式(1:仅退款 2退款退货)
-            isReceiver: Number(this.data.isReceiver), //货物状态(1:已收到货 0:未收到货)
-            buyerReason: refundReasonArray[this.data.buyerReason], //退款原因
-            goodsNum: this.data.goodsNum, //退款数量(0或不传值则为全部数量)
-            refundAmount: this.data.refundAmount, //退款金额
-            buyerMobile: this.data.buyerMobile, //手机号码(默认当前订单手机号码)
-            buyerDesc: this.data.buyerDesc, //备注说明
-            photoFiles: pics, //凭证图片列表
-            refundType: this.data.refundType, //退款单类型(1:整单退款,2:单个物品退款)
-            orderItemId: this.data.refundItem.orderItemId
-          },
-          callBack: (res) => {
-            wx.hideLoading();
-            // 去到我的退款订单页面
-            wx.redirectTo({
-              url: '/pages/afterSales/afterSales',
-            })
-          }
-        };
-        http.request(params);
-      }
-    }
-  },
+  onSelectedAll(e){
+    console.log(e,this.data);
 
-  /**
-   * 修改退款申请
-   */
-  alterRefundApply: function(e) {
-
-  },
-
-  /**
-   * 将获取到的input内容放进数据里
-   */
-  onDescInput: function(e) {
-    this.setData({
-      buyerDesc: e.detail.value
-    });
-  },
-  onRefInput: function(e) {
-    this.setData({
-      refundAmount: e.detail.value
+    let isAll = !this.data.isAll
+    let goodList = this.data.goodList
+    goodList.forEach(item=>{
+      item.checked = isAll
     })
-  },
-  onMobileInput: function(e) {
     this.setData({
-      buyerMobile: e.detail.value
-    })
-  },
-
-  /**
-   * 退款图片预览
-   */
-  refundPicPreView(e) {
-    var idx = e.currentTarget.dataset.idx
-    var urls = []
-    this.data.photoFiles.forEach(el => {
-      urls.push(el.url)
-    })
-    wx.previewImage({
-      current: urls[idx],
-      urls: urls
+      isAll,
+      goodList
     })
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
-  onReady: function() {
+  onReady() {
 
   },
 
   /**
    * 生命周期函数--监听页面显示
    */
-  onShow: function() {
+  onShow() {
 
   },
 
   /**
    * 生命周期函数--监听页面隐藏
    */
-  onHide: function() {
+  onHide() {
 
   },
 
   /**
    * 生命周期函数--监听页面卸载
    */
-  onUnload: function() {
+  onUnload() {
 
   },
 
   /**
    * 页面相关事件处理函数--监听用户下拉动作
    */
-  onPullDownRefresh: function() {
+  onPullDownRefresh() {
 
   },
 
   /**
    * 页面上拉触底事件的处理函数
    */
-  onReachBottom: function() {
+  onReachBottom() {
 
   },
 
   /**
    * 用户点击右上角分享
    */
-  onShareAppMessage: function() {
+  onShareAppMessage() {
 
   }
-})
+})

+ 1 - 3
pages/applyRefund/applyRefund.json

@@ -1,5 +1,3 @@
 {
-  "usingComponents": {},
-  "backgroundTextStyle": "light",
-  "navigationBarTitleText": "申请退款"
+  "usingComponents": {}
 }

+ 82 - 141
pages/applyRefund/applyRefund.wxml

@@ -1,165 +1,106 @@
-<!-- 申请退款 -->
 <!--pages/applyRefund/applyRefund.wxml-->
+<view class="applyRefund">
 
-<view class="page">
-  <!-- 头部商品信息 -->
-  <view class="top-box">
-    <text class="order-number">订单编号:{{orderNumber}}</text>
+  <view class="notice">
+  <image class="icon" src="../../images/icon/warn.png" mode=""/>
+    部分退款时,有积分消费的,优先返还积分。
   </view>
 
-  <!-- 整单退款 -->
-  <view class="goods-msg-box">
-    <block wx:for="{{orderItemDtos}}" wx:key='prodId' wx:if="{{refundItem.status >=2 && refundItem.orderItemDtos}}">
-      <view class='item-cont' bindtap='toProdPage' data-prodid="{{item.prodId}}">
-        <view class='prod-pic'>
-          <image src='{{item.pic}}'></image>
-        </view>
-        <view class='prod-info'>
-          <view class='prodname'>
-            {{item.prodName}}
-          </view>
-          <view class='prod-info-cont'>
-            <text class='skuname'>{{item.skuName||''}}</text> 
-            <text class='number' decode="{{true}}">&nbsp;×{{item.prodCount}}</text>
+  <view class="apply-type box">
+    <view class="title">售后类型</view>
+    <radio-group bindchange="radioChange">
+      <view class="item">
+          <radio class="radio" value="1" color="#FF941A" />
+          <view class="info">
+            <view class="title">我要退款</view>
+            <view class="desc">没收到货,货已收到货与商家协商后无需退货只退款</view>
           </view>
-          <view class='price-nums clearfix'>
-            <text class='prodprice'>
-              <text class='symbol'>¥</text>
-              <text class='big-num'>{{wxs.parsePrice(item.actualTotal)[0]}}</text>
-              <text class='small-num'>.{{wxs.parsePrice(item.actualTotal)[1]}}</text>
-            </text>
+      </view>
+      <view class="item">
+          <radio class="radio" value="2" color="#FF941A"/>
+          <view class="info">
+            <view class="title">我要退货退款</view>
+            <view class="desc">已收到货,需要退还已收到的商品</view>
           </view>
-        </view>
       </view>
-    </block>
-  </view>
 
-  <!-- 单个退款 -->
-  <view class="goods-msg-box" wx:if="{{!refundItem.orderItemDtos}}">
-    <view class="img-box">
-      <image src="{{refundItem.pic}}"></image>
-    </view>
-    <view class="goods-msg">
-      <view class="goods-title">{{refundItem.prodName}}</view>
-      <view class="goods-quantity">数量:{{refundItem.prodCount}}件</view>
-    </view>
+    </radio-group>
   </view>
 
-
-  <!-- 退款方式 -->
-  <view class="picker-box">
-    <view class="select-show clearfix">
-      <text class="select-text">退款方式</text>
-      <!-- 仅退款/退货退款 -->
-      <text class="select-results">{{['', '仅退款', '退货退款'][applyType]}}</text>
-    </view>
-  </view>
-  <!-- 货物状态【已发货状态下且用户选择仅退款】 -->
-  <!-- 订单状态 1:待付款 2:待发货 3:待收货 4:待评价 5:成功 6:失败 -->
-  <picker class="picker-box" mode="selector" wx:for-idx="idx" bindchange="goodsStateArray" value="{{isReceiver}}" range="{{goodsStateArray}}" wx:if="{{refundItem.status >= 3 && refundItem.status!=6 && applyType==1}}">
-    <view class="select-show select-box clearfix">
-      <text class="select-text">货物状态</text>
-      <text class="select-results select-reason">{{goodsStateArray[isReceiver]}}</text>
-      <view class="right-arrow">
-        <image src="../../images/icon/more.png"></image>
+  <view class="refund-goods box">
+      <view class="title-box">
+        <view class="title">退款商品</view>
+        <view class="price">退款金额:¥21</view>
+      </view>
+      <view class="good-list">
+        <view class="all">
+          <checkbox bindtap='onSelectedAll'  checked="{{isAll}}" color="#105c3e" />全选
+        </view>
+        <view class="good-item" wx:for="{{goodList}}">
+        	<checkbox bindtap='onSelectedItem' data-index="{{index}}" value="{{index}}" checked="{{item.checked}}" color="#105c3e" />
+          <view class="img"></view>
+          <view class="info">
+            <view class="good-name">赶海季生鲜大闸蟹</view>
+            <view class="desc">规格:5kg,盒</view>
+            <view class="price">单价:¥1.8</view>
+          </view>
+          <view class="price-box">
+            <view class="price">¥103.95</view>
+            <view class="num-box">
+              <view class="btn">-</view>
+              <view class="num">1</view>
+              <view class="btn">+</view>
+            </view>
+          </view>
+        </view>
       </view>
+        <view class="open-btn">
+          展开(共7件) <image class="arrow" src="../../images/icon/black-down-arrow.png" mode=""/>
+        </view>
     </view>
-  </picker>
 
-  <!-- 退款原因isReceiver: 0, //货物状态(1:已收到货 0:未收到货) -->
-  <!-- 退款原因(已发货 || 已完成)&& 已收到货 -->
-  <picker class="picker-box picker-reason" wx:if="{{refundItem.status != 2 && isReceiver == 1}}" mode="selector" bindchange="refundReasonChange" value="{{refundProdReasonArray[buyerReason]}}" range="{{refundProdReasonArray}}">
-    <view class="select-show select-box clearfix">
-      <text class="select-text">退款原因</text>
-      <text class="select-results select-reason">{{refundProdReasonArray[buyerReason]}}</text>
-      <view class="right-arrow">
-        <image src="../../images/icon/more.png"></image>
+    <view class="reason-box box">
+      <view class="title-box">
+        <view class="title">退款原因</view>
+        <view class="choose" bindtap="choose" >请选择退款原因 <image class="icon" src="../../images/icon/more.png" mode=""/> </view>
       </view>
-    </view>
-  </picker>
-  <!-- 退款原因(未发货 && 未收到货)|| (已发货 && 未收货) -->
-  <picker class="picker-box picker-reason" wx:if="{{(refundItem.status == 2  || refundItem.status != 2) && isReceiver == 0}}" mode="selector" bindchange="refundReasonChange" value="{{refundPriReasonArray[buyerReason]}}" range="{{refundPriReasonArray}}">
-    <view class="select-show select-box clearfix">
-      <text class="select-text">退款原因</text>
-      <text class="select-results select-reason">{{refundPriReasonArray[buyerReason]}}</text>
-      <view class="right-arrow">
-        <image src="../../images/icon/more.png"></image>
+      <view class="content">
+        <textarea class="reason" placeholder="补充描述和凭证,有助于提高退款效率" value=""/> 
+        <view class="upload"  bindtap="getUploadImg">
+          <image src="../../images/icon/photo.png" mode="" class="photo"/>
+        </view>
       </view>
     </view>
-  </picker>
-
-
-  <!-- 退货数量 -->
-  <view class="refund-quantity clearfix" wx:if="{{applyType == 2 && refundType == 2}}">
-    <text class="qua-text">退货数量</text>
-    <view class="quantity-choose">
-      <text class="reduce" data-st="0" bindtap="changePordNum">-</text>
-      <input class="show-num" value="{{goodsNum}}" disabled="{{true}}" />
-      <text class="add" data-st="1" bindtap="changePordNum">+</text>
-    </view>
-  </view>
-
-  <!-- 退款金额 -->
-  <view class="refund-sum-box">
-    <view class="refund-sum">
-      <label class="refund-sum-tit">退款金额</label>
-      <!-- 如果是待发货状态且使用了平台分摊的优惠金额,则不允许修改退款金额(输入框不可输入) -->
-      <text class="refund-sum-num" wx:if="{{refundItem.status==2 && refundItem.platformShareReduce >0}}">{{showPriAndScore}}</text>
-      <text class="refund-sum-num" wx:else>{{showPriAndScore}}</text>
-      <!-- <input wx:else class="refund-sum-num" type="digit " placeholder="请输入退款金额" value="{{showPriAndScore}}" bindinput="onRefInput" /> -->
-    </view>
 
-    <!-- 最多可退 -->
-    <view class="refund-sum-tips">
-      最多可退:<text>{{showNumAndCont}}</text>
-    </view>
-
-  </view>
 
+    <van-action-sheet show="{{ show }}" title="" bind:click-overlay="close">
+      <view class="reason-content">
+      <view class="title">选择退款原因</view>
+        <view class="notice" style="position: static;width: 100%;">
+          <image class="icon" src="../../images/icon/warn.png" mode=""/>
+          部分退款时,有积分消费的,优先返还积分。
+        </view>
 
-  <!-- 退货信息 -->
-  <view class="refund-message">
-    <!-- 手机 -->
-    <view class="item-num">
-      <label class="item-num-tit">手机号码</label>
-      <input class="item-num-num" type="number" placeholder="请输入退货人手机号码" maxlength="11" value="{{buyerMobile}}" bindinput="onMobileInput" />
-    </view>
-    <!-- 说明 -->
-    <view class="item-num">
-      <label class="item-num-tit">退款说明</label>
-      <input class="item-num-num refund-explain" placeholder="必填,最多50字" maxlength="50" value="{{buyerDesc}}" bindinput="onDescInput" />
-    </view>
-
-    <!-- 上传照片 -->
-    <view class="item-num">
-      <label class="item-num-tit upload-tit">上传凭证</label>
-      <view class="upload-img">
-        <view class="upload-tips">可上传5张图片</view>
-        <!-- 预览缩略图 -->
-        <block wx:for="{{photoFiles}}" wx:key="*this" wx:for-index="idx" wx:for-item="imgItem">
-          <view class="q-image-wrap">
-            <!-- 图片缩略图  -->
-            <image class="q-image" src="{{imgItem.url}}" mode="aspectFill" data-idx="{{idx}}" bindtap="refundPicPreView"></image>
-            <!-- 移除图片的按钮  -->
-            <view class="q-image-remover" data-idx="{{idx}}" data-index="{{index}}" bindtap="removeImage">
-              <image src="../../images/icon/close2.png"></image>
-            </view>
+        <view class="reason-list">
+          <view class="title-box">
+            <view class="sub-title">请选择退款原因</view>
+            <view class="desc">(必选)</view>
           </view>
-        </block>
-        <!-- 添加图片按钮 -->
-        <view class="upload-btn" wx:if="{{photoFiles.length < 5}}" data-idx="{{index}}" bindtap="getUploadImg">+</view>
+          <radio-group bindchange="chooseReason">
+            <view class="item" wx:for="{{reasonList}}" wx:key="{{index}}">
+              <radio class="radio" value="1" color="#FF941A" />
+              <view class="text">{{item.name}}</view>
+            </view>
+          </radio-group>
+        </view>
+        <view class="submit-box">
+          <view class="btn">确认</view>
+        </view>
       </view>
-    </view>
-  </view>
-  <!-- 退货信息end -->
-
-
-  <!-- 提交btn -->
-  <view class="submit-btn" bindtap="applyRefund">提交</view>
-
+    </van-action-sheet>
 
+    <view class="submit-box">
+      <view class="btn">提交</view>
+    </view>
 
 </view>
-
-
-<wxs module="wxs" src="../../wxs/number.wxs" />

+ 233 - 370
pages/applyRefund/applyRefund.wxss

@@ -1,451 +1,314 @@
 /* pages/applyRefund/applyRefund.wxss */
-
-/* 清除浮动 */
-
-.clearfix:after {
-  content: ".";
-  display: block;
-  height: 0;
-  clear: both;
-  visibility: hidden;
+.applyRefund{
+  padding: 76rpx 24rpx 220rpx;
+  background: #F6F6F6;
+  position: relative;
 }
-
-image {
-  display: block;
-  width: 100%;
-  height: 100%;
+.notice{
+  width: 750rpx;
+  height: 56rpx;
+  line-height: 56rpx;
+  background-color: rgba(255, 148, 26, .2);
+  font-size: 28rpx;
+  color: #222222;
+  display: flex;
+  align-items: center;
+  padding: 0 24rpx;
+  box-sizing: border-box;
+  position: absolute;
+  top: 0;
+  left: 0;
 }
-
-.page {
-  position: fixed;
-  width: 100%;
-  height: 100%;
-  background: #f8f8f8;
-  overflow: auto;
+.notice .icon{
+  width: 32rpx;
+  height: 32rpx;
+  margin-right: 16rpx;
 }
-
-input::placeholder {
-  color: #eee;
+.box{
+  background: #FFFFFF;
+  border-radius: 16rpx 16rpx 16rpx 16rpx;
+  margin-bottom: 20rpx;
+}
+.applyRefund .apply-type{
+  padding: 24rpx;
 }
 
-/* 头部商品信息 */
-
-.top-box {
-  text-align: left;
-  padding: 18rpx 20rpx;
-  background: #fff;
-  border-bottom: 1rpx solid #f2f2f2;
+.applyRefund .apply-type .title{
+  font-weight: bold;
+  font-size: 32rpx;
+  color: #222222;
+}
+.applyRefund .apply-type .item{
+  display: flex;
+  padding-top: 24rpx;
+}
+.applyRefund .apply-type .item .info{
+  padding-left: 20rpx;
 }
 
-.order-number {
+.applyRefund .apply-type .item .info .title{
+  font-weight: bold;
   font-size: 28rpx;
-  vertical-align: middle;
+  color: #222222;
 }
 
-.goods-msg-box {
-  background: #fff;
-  margin-bottom: 20rpx;
-  padding: 15rpx 20rpx;
+.applyRefund .apply-type .item .info .desc{
+  font-size: 24rpx;
+  color: #AAAAAA;
+  margin-top: 16rpx;
 }
 
-.img-box {
-  display: inline-block;
-  width: 150rpx;
-  height: 150rpx;
-  background: #f8f8f8;
-  margin-right: 25rpx;
-  vertical-align: top;
+.applyRefund .refund-goods{
+  padding: 24rpx;
 }
 
-.goods-msg {
-  display: inline-block;
-  vertical-align: top;
-  width: 75%;
+.applyRefund .refund-goods .title-box{
+  display: flex;
+  justify-content: space-between;
+  padding-bottom: 24rpx;
+  font-weight: bold;
+  font-size: 28rpx;
 }
-
-.goods-title {
-  font-size: 30rpx;
-  line-height: 1.5em;
-  display: -webkit-box;
-  -webkit-line-clamp: 2; /*设定显示行数*/
-  -webkit-box-orient: vertical;
-  word-break: break-all;
-  overflow: hidden;
-  text-overflow: ellipsis;
+.applyRefund .refund-goods .title-box .title{
+  color: #222222;
 }
-
-.goods-quantity {
-  font-size: 26rpx;
-  color: #888;
-  margin-top: 25rpx;
+.applyRefund .refund-goods .title-box .price{
+  color: #FF4D3A;
 }
 
-/* 整单退款商品列表 */
-
-.item-cont .prod-pic image {
-  width: 180rpx;
-  height: 180rpx;
+.applyRefund .refund-goods .good-list .all{
+  padding-bottom: 24rpx;
+  font-weight: bold;
+  font-size: 24rpx;
+  color: #222222;
 }
-
-.item-cont {
-  position: relative;
+.applyRefund .refund-goods .good-list .good-item{
+  border-top:1rpx solid #F0F0F0;
+  padding: 20rpx 0;
   display: flex;
   align-items: center;
-  padding: 30rpx;
-  border-top: 2rpx solid #f1f1f1;
 }
-
-.item-cont .prod-pic {
-  font-size: 0;
-  display: block;
-  width: 160rpx;
-  height: 160rpx;
-  overflow: hidden;
-  background: #fff;
-  margin-right: 16rpx;
+.applyRefund .refund-goods .good-list .good-item .img{
+  width: 120rpx;
+  height: 120rpx;
+  border-radius: 16rpx;
+  background: #F6F6F6;
 }
-
-.item-cont .prod-pic image {
-  width: 100%;
-  height: 100%;
-}
-
-.item-cont .prod-info {
-  margin-left: 10rpx;
-  font-size: 28rpx;
-  width: 100%;
-  position: relative;
-  height: 80px;
-  -webkit-flex: 1;
-  -ms-flex: 1;
-  -webkit-box-flex: 1;
-  -moz-box-flex: 1;
+.applyRefund .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;
-}
-
-.item-cont .prod-info .prodname {
-  font-size: 30rpx;
-  line-height: 40rpx;
-  max-height: 86rpx;
-  overflow: hidden;
-  display: -webkit-box;
-  -webkit-line-clamp: 1;
-  -webkit-box-orient: vertical;
-  text-overflow: ellipsis;
-  word-break: break-all;
-}
-
-.item-cont .prod-info .prod-info-cont {
-  position: relative;
-  color: #999;
-  margin-top: 20rpx;
-  font-size: 26rpx;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  display: -webkit-box;
-  -webkit-line-clamp: 2;
-  flex-direction: column;
+.applyRefund .refund-goods .good-list .good-item .info .good-name{
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #222222;
 }
-
-.item-cont .prod-info .prod-info-cont .info-item {
-  color: #888;
+.applyRefund .refund-goods .good-list .good-item .info .desc{
+  font-size: 24rpx;
+  color: #AAAAAA;
   margin-top: 10rpx;
-  font-size: 26rpx;
-  overflow: hidden;
-  display: -webkit-box;
-  -webkit-line-clamp: 1;
-  -webkit-box-orient: vertical;
-  text-overflow: ellipsis;
-  word-break: break-all;
-  width: 75%;
 }
-
-.group-text {
-  display: block;
-  font-size: 23rpx;
-  color: #fff;
-  background: #e43130;
-  padding: 6rpx 10rpx;
+.applyRefund .refund-goods .good-list .good-item .info .price{
+  color: #AAAAAA;
+  font-size: 24rpx;
 }
-
-.item-cont .prod-info .prod-info-cont .number {
-  display: inline-block;
-  margin-right: 20rpx;
-  vertical-align: middle;
-}
-.skuname {
-  max-width: 85%;
-  display: -webkit-box;
-  -webkit-line-clamp: 1; /*设定显示行数*/
-  -webkit-box-orient: vertical;
-  word-break: break-all;	
-  overflow: hidden;
-  text-overflow: ellipsis;
+.applyRefund .refund-goods .good-list .good-item .price-box{
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+  align-items: flex-end;
+  height: 120rpx;
 }
-
-.price-nums {
-  margin-top: 18rpx;
+.applyRefund .refund-goods .good-list .good-item .price-box .price{
+  font-weight: bold;
+  font-size: 32rpx;
+  color: #FF4D3A;
 }
-
-.price-nums .prodprice {
-  color: #e43130;
-  font-size: 26rpx;
-  float: left;
+.applyRefund .refund-goods .good-list .good-item .price-box .num-box{
+  display: flex;
 }
-
-.price-nums .btn-box {
-  float: right;
-  text-align: right;
+.applyRefund .refund-goods .good-list .good-item .price-box .num-box .btn{
+  width: 40rpx;
+  height: 40rpx;
+  line-height: 40rpx;
+  text-align: center;
+  background: #F0F0F0;
+  color: #AAAAAA;
+  font-weight: bold;
 }
-
-.price-nums .btn-box .btn {
-  padding: 6rpx 30rpx;
-  line-height: 36rpx;
-  margin-left: 20rpx;
+.applyRefund .refund-goods .good-list .good-item .price-box .num{
   font-size: 24rpx;
-  display: inline-block;
-  border: 2rpx solid #e4e4e4;
-  border-radius: 50rpx;
-}
-
-/* 退款方式&原因 */
-
-.picker-box {
-  background: #fff;
-  border-bottom: 1rpx solid #f2f2f2;
+  color: #222222;
+  width: 80rpx;
+  height: 40rpx;
+  line-height: 40rpx;
+  text-align: center;
+  background: #F0F0F0;
+  margin: 0 4rpx;
 }
-
-.picker-reason {
-  margin-bottom: 20rpx;
+.applyRefund .refund-goods .open-btn{
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  font-size: 24rpx;
+  color: #222222;
+  margin-top: 20rpx;
 }
-
-.select-show {
-  text-align: left;
-  padding: 20rpx 0;
-  margin: 0 20rpx;
+.applyRefund .refund-goods .open-btn .arrow{
+  width: 20rpx;
+  height: 20rpx;
 }
 
-.select-text {
-  font-size: 30rpx;
-  float: left;
+.applyRefund .reason-box{
+  padding: 24rpx;
 }
-
-.select-results {
-  font-size: 30rpx;
-  color: #888;
-  float: right;
+.applyRefund .reason-box .title-box{
+  display: flex;
+  justify-content: space-between;
+  padding-bottom: 20rpx;
 }
-
-.select-box {
-  position: relative;
+.applyRefund .reason-box .title-box .title{
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #222222;
 }
 
-.select-reason {
-  padding-right: 30rpx;
+.applyRefund .reason-box .title-box .choose{
+  display: flex;
+  align-items: center;
+  font-size: 28rpx;
+  color: #AAAAAA;
 }
-
-.right-arrow {
-  position: absolute;
-  right: 0;
-  top: 50%;
-  transform: translateY(-50%);
+.applyRefund .reason-box .title-box .choose .icon{
   width: 20rpx;
   height: 20rpx;
-  display: block;
 }
-
-/* 退货数量 */
-
-.refund-quantity {
-  background: #fff;
-  padding: 20rpx;
-  border-bottom: 1rpx solid #f2f2f2;
-  text-align: left;
-}
-
-.qua-text {
-  font-size: 28rpx;
+.applyRefund .reason-box .content{
+  position: relative;
 }
-
-.quantity-choose {
-  float: right;
+.applyRefund .reason-box textarea{
+  width: 100%;
+  height: 300rpx;
+  background: #F6F6F6;
+  border-radius: 16rpx 16rpx 16rpx 16rpx;
+  box-sizing: border-box;
+  padding: 24rpx;
+}
+.applyRefund .reason-box .content .upload{
+  width: 120rpx;
+  height: 120rpx;
+  background: #FFFFFF;
+  border-radius: 32rpx 32rpx 32rpx 32rpx;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  position: absolute;
+  left: 24rpx;
+  bottom: 24rpx;
+  z-index: 9;
 }
-
-.show-num {
-  display: inline-block;
-  width: 75rpx;
-  height: 65rpx;
-  line-height: 65rpx;
-  font-size: 25rpx;
-  background: #f2f2f5;
-  margin: 0 3rpx;
-  vertical-align: middle;
-  text-align: center;
+.applyRefund .reason-box .content .photo{
+  width: 40rpx;
+  height: 40rpx;
+  
 }
 
-.reduce, .add {
-  display: inline-block;
-  width: 65rpx;
-  height: 65rpx;
-  line-height: 65rpx;
-  background: #f7f7f9;
-  vertical-align: middle;
+.applyRefund .submit-box{
+  position: fixed;
+  left: 0;
+  bottom: 0;
+  z-index: 9;
+  width: 750rpx;
+  height: 166rpx;
+  background: #FFFFFF;
+  border-radius: 32rpx 32rpx 0rpx 0rpx;
+}
+.applyRefund .submit-box .btn{
+  margin-top: 20rpx;
+  margin-left: 24rpx;
+  width: 702rpx;
+  height: 80rpx;
+  line-height: 80rpx;
   text-align: center;
-  color: #aaa;
-}
-
-/* 退款金额 */
-
-.refund-sum-box {
-  font-size: 30rpx;
-}
-
-.refund-sum {
-  background: #fff;
-  padding: 15rpx;
-}
-
-.refund-sum-tit {
-  display: inline-block;
-  vertical-align: midddle;
-  margin-right: 50rpx;
-}
-
-.refund-sum-num {
-  display: inline-block;
-  vertical-align: middle;
-  color: #e43130;
-}
-
-.refund-sum-tips {
-  padding: 15rpx 20rpx;
+  background: #FF941A;
+  border-radius: 40rpx 40rpx 40rpx 40rpx;
+  font-weight: bold;
   font-size: 28rpx;
-  color: #aaa;
+  color: #FFFFFF;
 }
 
-.sub {
-  color: #e43130;
-  vertical-align: middle;
+.reason-content{
+  padding: 0 24rpx 140rpx;
+  background: #F6F6F6;
 }
 
-/* 退款信息填写 */
-
-.refund-message {
-  background: #fff;
-  margin-bottom: 20rpx;
+.reason-content .title{
+  font-weight: bold;
+  font-size: 32rpx;
+  color: #222222;
+  text-align: center;
+  padding: 28rpx 0;
 }
 
-.item-num {
-  background: #fff;
-  border-bottom: 1rpx solid #f2f2f2;
-  padding: 10px 20rpx;
-  font-size: 30rpx;
+.reason-list{
+  background: #FFFFFF;
+  border-radius: 32rpx 32rpx 32rpx 32rpx;
+  padding: 24rpx;
+  max-height: 450rpx;
+  overflow: auto;
+  margin-top: 20rpx;
 }
-
-.item-num-tit {
-  display: inline-block;
-  vertical-align: middle;
-  margin-right: 40rpx;
+.reason-list .title-box{
+  display: flex;
 }
-
-.upload-tit {
-  vertical-align: top;
+.reason-list .title-box .sub-title{
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #222222;
 }
-
-.item-num-num {
-  display: inline-block;
-  vertical-align: middle;
-  width: 70%;
+.reason-list .title-box .desc{
+  font-size: 28rpx;
+  color: #AAAAAA;
 }
 
-/* 订单状态 */
-
-.order-status {
-  padding: 20rpx;
-  background: #fff;
-  border-bottom: 1rpx solid #f2f2f2;
+.reason-content .item{
+  display: flex;
+  padding-top: 20rpx;
 }
 
-/* 上传照片 */
 
-.upload-img {
-  display: inline-block;
-  width: 72%;
-}
+/*checkbox 选项框大小  */
 
-.upload-tips {
-  font-size: 26rpx;
-  color: #888;
-  margin-bottom: 1em;
+checkbox .wx-checkbox-input {
+  border-radius: 50%;
+  width: 32rpx;
+  height: 32rpx;
 }
 
-/* 缩略图 */
+/*checkbox选中后样式  */
 
-.question-images {
-  display: inline-block;
-  vertical-align: bottom;
-}
-
-.q-image-wrap {
-  display: inline-block;
-  position: relative;
-  margin-right: 15rpx;
-  margin-bottom: 10rpx;
+checkbox .wx-checkbox-input.wx-checkbox-input-checked {
+  /* background: #e43130;
+  border-color: #e43130; */
+  background: #FF941A;
+  border-color: #FF941A;
 }
 
-.q-image {
-  display: inline-block;
-  width: 110rpx;
-  height: 110rpx;
-  background: #eee;
-}
+/*checkbox选中后图标样式  */
 
-.q-image-remover {
-  position: absolute;
-  right: -6rpx;
-  top: -6rpx;
-  width: 30rpx;
-  height: 30rpx;
+checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
   text-align: center;
-  font-size: 23rpx;
+  font-size: 20rpx;
+  color: #fff;
+  background: transparent;
+  transform: translate(-50%, -50%) scale(1);
+  -webkit-transform: translate(-50%, -50%) scale(1);
 }
 
-/*  +  */
 
-.upload-img .upload-btn {
-  display: inline-block;
-  width: 100rpx;
-  height: 100rpx;
-  line-height: 90rpx;
-  text-align: center;
-  font-size: 80rpx;
-  color: #ddd;
-  border: 2px dashed #f4f4f4;
-  vertical-align: top;
+.radio {
+  transform: scale(.7);
 }
 
-/* 提交按钮 */
 
-.submit-btn {
-  background: #FF941A;
-  color: #fff;
-  margin: 30rpx 20rpx;
-  margin-top: 70rpx;
-  font-size: 28rpx;
-  padding: 1em 0;
-  text-align: center;
-  border-radius: 40rpx;
-}
+

+ 636 - 0
pages/applyRefund1/applyRefund.js

@@ -0,0 +1,636 @@
+// pages/applyRefund/applyRefund.js
+var http = require('../../utils/http.js');
+var big = require('../../utils/big.min.js');
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    refundType: 2,  // 退款类型 1整单  2单个物品
+    // 货物状态
+    goodsStateArray: ['未收到货', '已收到货'],
+    isReceiver: 0, //货物状态(1:已收到货 0:未收到货)
+
+    //  退款原因(已收到货)
+    refundProdReasonArray: ['请选择', '拍错/多拍/不喜欢', '协商一致退款', '商品破损/少件', '商品与描述不符', '卖家发错货', '质量问题', '其他'],
+    // 退款原因(未收到货)
+    refundPriReasonArray: ['请选择', '协商一致退款', '拍错/多拍/不喜欢', '商家一直未发货/快递一直未送达', '其他'],
+    buyerReason: 0, //退款原因
+
+
+    refundItem: {}, //订单项数据
+    orderItemId: '', //订单项ID(单个物品退款时使用)
+    orderNumber: '', //订单编号
+
+    applyType: 1, //退款方式(1:仅退款 2退款退货)
+    goodsNum: 1, //退货数量(0或不传值则为全部数量)
+    // quantity: 1,  //退货数量
+    refundAmount: 0, //实际退款金额
+    maxRefundAmount: 0, //最大退款金额
+    buyerMobile: '', //手机号码(默认当前订单手机号码)
+    buyerDesc: '', //备注说明
+    photoFiles: [], //凭证图片列表
+    actualTotal: 0,  //总额
+    isLastProd: false,  //是否最后一样商品
+    prodPrice: 0,  //商品单价
+
+    addTransfee: false, //是否可以加运费(仅一件商品)
+    orderScore: 0, // 整单使用积分
+
+    showNumAndCont: '', // 金额、积分、运费的展示(最多可退)
+    showPriAndScore: '', // 金额、积分、运费的展示(金额+积分)
+    
+  },
+
+  /**
+   * 金额、积分、运费的展示
+   * 
+   * refundType: 退款单类型(1:整单退款,2:单个退款)
+   * applyType: 退款方式(1:仅退款 2退款退货)
+   * refundAmount: 实际退款金额
+   * actualTotal: 总额
+   * orderScore: 使用积分
+   * refundItem.status == 2 待发货
+   * refundItem.transfee 运费
+   * isLastProd:是否最后一个订单项item
+   */
+  showNumber: function() {
+    var refundItem = this.data.refundItem
+    var refundAmount = this.data.refundAmount
+    var refundType = this.data.refundType
+    var actualTotal = this.data.actualTotal
+    var orderScore = this.data.orderScore
+    var isLastProd = this.isLastProd
+    var showNumAndCont = ''
+    var showPriAndScore = ''
+    // 待发货
+    if(refundItem.status == 2) {
+      // 有金额,无运费,无积分
+      if(refundAmount > 0 && (!refundItem.transfee || refundItem.transfee == 0) && (!orderScore || orderScore == 0)){
+        // 单个退 || 整单退
+        if(refundType == 2 || refundType == 1) {
+          showNumAndCont = '¥' + refundAmount
+          showPriAndScore = '¥' + refundAmount
+        }
+      }
+      // 有金额,有运费,无积分
+      if(actualTotal > 0 && (refundItem.transfee && refundItem.transfee > 0) && (!orderScore || orderScore == 0)) {
+        if(isLastProd && refundType == 2) { 
+          // 单个退 && 最后一个订单项
+          showNumAndCont = '¥' + actualTotal + '+运费' + '¥' + refundItem.transfee // 最多可退
+          showPriAndScore = '¥' + refundAmount // 显示金额+积分
+        }else { // (单个退 && 不是最后一个订单项) || 整单退
+          showNumAndCont = '¥' + refundAmount // 最多可退
+          showPriAndScore = '¥' + refundAmount // 显示金额+积分
+        }
+      }
+      //有金额,有运费,有积分
+      if(actualTotal > 0 && (refundItem.transfee && refundItem.transfee > 0) && (orderScore || orderScore > 0)) {
+        if(isLastProd && refundType == 2) { 
+          // 单个退 && 最后一个订单项
+          showNumAndCont = '¥' + actualTotal + '+运费' + '¥' + refundItem.transfee + '+' + orderScore + '积分' // 最多可退
+          showPriAndScore = '¥' + refundAmount +  '+' + orderScore + '积分' // 显示金额+积分
+        }else { // (单个退 && 不是最后一个订单项) || 整单退
+          showNumAndCont = '¥' + refundAmount + '+' + orderScore + '积分' // 最多可退
+          showPriAndScore = '¥' + refundAmount +  '+' + orderScore + '积分' // 显示金额+积分
+        }
+      }
+      //无金额,无运费,有积分
+      if((!refundAmount || refundAmount == 0) && (!refundItem.transfee || refundItem.transfee == 0) && (orderScore && orderScore > 0)) {
+        // 单个退 || 整单退
+        if(refundType == 2 || refundType == 1){
+          showNumAndCont =  orderScore + '积分'
+          showPriAndScore = orderScore + '积分'
+        }
+      }
+      //无金额,有运费,有积分
+      if((!refundAmount || refundAmount == 0)&& (refundItem.transfee && refundItem.transfee > 0) && (orderScore && orderScore > 0)) {
+        // 单个退 || 整单退
+        if(refundType == 2 || refundType == 1){
+          showNumAndCont = '运费' + '¥' + refundItem.transfee + '+' + orderScore + '积分'
+          showPriAndScore = '¥' + refundItem.transfee + '+' + orderScore + '积分'
+        }
+      }
+      console.log('待发货(最多可退):',showNumAndCont)
+      console.log('待发货(金额+积分):',showPriAndScore)
+
+    };
+
+    // 非待发货(已发货 || 已完成)任何情况都不退运费
+    if(refundItem.status != 2) {
+      // 有金额,无运费,无积分
+      if(refundAmount > 0 && (!refundItem.transfee || refundItem.transfee == 0) && (!orderScore || orderScore == 0)){
+        // 单个退 || 整单退
+        if(refundType == 2 || refundType == 1) {
+          showNumAndCont= '¥' + refundAmount
+          showPriAndScore = '¥' + refundAmount
+        }
+      }
+      // 有金额,有运费,无积分
+      if(refundAmount > 0 && (refundItem.transfee && refundItem.transfee > 0) && (!orderScore || orderScore == 0)) {
+        // 单个退 || 整单退
+        if(refundType == 2 || refundType == 1) {
+          showNumAndCont = '¥' + refundAmount
+          showPriAndScore = '¥' + refundAmount
+        }
+      }
+      //有金额,有运费,有积分
+      if(refundAmount > 0 && (refundItem.transfee && refundItem.transfee > 0) && (orderScore || orderScore > 0)) {
+        // 单个退 || 整单退
+        if(refundType == 2 || refundType == 1){
+          showNumAndCont = '¥' + refundAmount + '+' + orderScore + '积分'
+          showPriAndScore = '¥' + refundAmount + '+' + orderScore + '积分' // 显示金额+积分
+        }
+      }
+      //无金额,无运费,有积分
+      if((!refundAmount || refundAmount == 0) && (!refundItem.transfee || refundItem.transfee == 0) && (orderScore && orderScore > 0)) {
+        // 单个退 || 整单退
+        if(refundType == 2 || refundType == 1){
+          showNumAndCont =  orderScore + '积分'
+          showPriAndScore = orderScore + '积分' // 显示金额+积分
+        }
+      }
+      //无金额,有运费,有积分
+      if((!refundAmount || refundAmount == 0)&& (refundItem.transfee && refundItem.transfee > 0) && (orderScore && orderScore > 0)) {
+        // 单个退 || 整单退
+        if(refundType == 2 || refundType == 1){
+          showNumAndCont = orderScore + '积分'
+          showPriAndScore = orderScore + '积分' // 显示金额+积分
+        }
+      }
+      console.log('已发货(最多可退):',showNumAndCont)
+      console.log('已发货(金额+积分):',showPriAndScore)
+    }
+    this.setData({
+      showNumAndCont,
+      showPriAndScore
+    })
+    console.log('最多可退showNumAndCont:',this.data.showNumAndCont)
+    console.log('金额+积分showPriAndScore:',this.data.showPriAndScore)
+  },
+
+  /**
+   * 退款原因选择
+   * refundType:  退款类型 1整单  2单个物品
+   * refundItem.status: 2待发货
+   * isReceiver: 货物状态(1:已收到货 0:未收到货)
+   * applyType:  1仅退款 2退货退款
+   */
+  returnReasonList: function() {
+    if(this.data.applyType == 2) {
+      this.setData({
+        isReceiver: 1 // 已收到货
+      })
+    }else {
+      this.setData({
+        isReceiver: 0 // 已收到货
+      })
+    }
+    console.log('isReceiver货物状态(1:已收到货 0:未收到货)',this.data.isReceiver)
+  },
+
+
+  /**
+   * 货物状态picker选择
+   */
+  goodsStateArray: function(e) {
+    console.log('货物状态', e.detail.value)
+    this.setData({
+      isReceiver: e.detail.value,
+      buyerReason: 0
+    })
+  },
+
+  /**
+   * 退款原因picker选择
+   */
+  refundReasonChange: function(e) {
+    console.log('退款原因', e.detail.value)
+    this.setData({
+      buyerReason: e.detail.value
+    })
+  },
+
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function(options) {
+    console.log(options,'----参数');
+    // 拿到上一页的参数type(判断退款方式)
+    // console.log('type:',options.type)
+    if (options.type) {
+      this.setData({
+        applyType: options.type  // 1仅退款 2退货退款
+      })
+      // console.log(this.data.type)
+    }
+    // console.log('refundType:',options.refundType)
+    this.setData({
+      refundType: options.refundType  // 退款类型 1整单  2单个物品
+    })
+    console.log('refundType(退款类型 1整单  2单个物品)',this.data.refundType)
+
+    this.getRefundProdInfo()  //获取退款商品信息
+  },
+
+  /**
+   * 获取退款商品信息
+   */
+  getRefundProdInfo: function() {
+    let refundType = this.data.refundType  // 退款类型 1整单  2单个物品
+    //拿到缓存里的订单项数据
+    var refundItem = wx.getStorageSync("refundItem");
+    console.log('拿到缓存里的订单项数据refundItem:',refundItem)
+    this.setData({
+      refundItem: refundItem,
+      orderNumber: refundItem.orderNumber,
+      goodsNum: refundItem.prodCount,
+      actualTotal: refundItem.actualTotal,  //总额
+      isLastProd: refundItem.isLastProd,  //是否最后一样商品
+      addTransfee: refundItem.addTransfee, //只有一件商品可以退运费
+      orderScore: refundItem.useScore // 单个退积分
+    })
+    console.log('单个退orderScore:',this.data.orderScore)
+    // console.log('platformShareReduce:',this.data.refundItem.platformShareReduce)
+    // console.log(refundItem.isLastProd)
+    if(refundType == 1) {  //整单退款
+      this.setData({
+        orderItemDtos: refundItem.orderItemDtos, //商品列表
+        orderScore: refundItem.orderScore,  //整单积分
+      });
+      console.log('整单退orderScore:',this.data.orderScore)
+    }
+    let actualTotal = this.data.actualTotal  //商品总额(不含运费)
+    let prodCount = refundItem.prodCount  //商品总数
+    // console.log('商品总数prodCount',prodCount)
+    // console.log('商品总额(不含运费)actualTotal',actualTotal)
+    if(refundType == 2) {  //单个退
+      // 计算商品单价
+      if(prodCount > 0) {
+        var x = new big(actualTotal)
+        var y = new big(prodCount)
+        // 保留两位小数
+        big.DP = 2
+        // 向下取整
+        big.RM = 1
+        let prodPrice = x.div(y).valueOf()  //商品单价
+        this.setData({
+          prodPrice
+        })
+        // console.log(this.prodPrice)
+      }
+    }
+    
+    this.returnReasonList() // 退款原因选择列表展示
+    this.refundAmount() //退款金额计算
+    
+  },
+  /**
+   * 退款金额计算
+   */
+  refundAmount: function() {
+    let actualTotal = this.data.actualTotal
+    // console.log('总额this.data.actualTotal:',this.data.actualTotal)
+    let refundItem = this.data.refundItem
+    // console.log('商品item,this.data.refundItem:',this.data.refundItem)
+    let refundType = this.data.refundType  // 退款类型 1整单  2单个物品
+    
+    // console.log('refundType退款类型 1整单  2单个物品:',this.data.refundType)
+    // console.log('addTransfee是否可加运费:',this.addTransfee)
+    if (refundItem.status == 2) { //待发货状态
+      if(refundType == 2) {  //单个退,
+        if(refundItem.isLastProd) {  //如果是最后一个可退运费(actualTotal总额不包含运费)
+          this.setData({
+            refundAmount: actualTotal + refundItem.transfee,
+          });
+          // console.log('运费:',refundItem.transfee,'+总额:',actualTotal)
+          // console.log('待发货单个退(最后一个)金额:',this.data.refundAmount)
+        }else { //否则不退
+          this.setData({
+            refundAmount: actualTotal,
+          });
+          if(this.addTransfee) { // 如果是只有一个商品,可退运费
+            this.setData({
+              refundAmount: actualTotal + refundItem.transfee,
+            });
+            // console.log('单个退加运费可退总额:',this.refundAmount)
+          }
+          // console.log('运费:',refundItem.transfee,'+总额:',actualTotal)
+          // console.log('待发货单个退(不是最后一个)金额:',this.data.refundAmount)
+        }
+      } else if(refundType == 1) {  //整单退,退实际金额(actualTotal总额包含运费)
+        this.setData({
+          refundAmount: actualTotal,
+        });
+        // console.log('运费:',refundItem.transfee)
+        // console.log('待发货整单退金额:',this.data.refundAmount)
+      }
+    } else if (refundItem.status != 2) { // 已发货订单(整单退运费(总额包含运费);单个不退运费(总额不包含运费))
+       this.setData({
+         refundAmount: actualTotal,
+       });
+      //  console.log('运费:',refundItem.transfee)
+      //  console.log('已发货整单退金额:',this.data.refundAmount)
+    }
+
+    this.showNumber() // 金额、积分、运费的显示
+  },
+
+    /**
+     * 改变商品数量重新计算价格(数量加减)
+     */
+    changePordNum(e) {
+      var st = e.currentTarget.dataset.st;
+      let actualTotal = this.data.actualTotal  //商品总额(不含运费)
+      var prodCount = this.data.refundItem.prodCount  //商品总数
+      if(st == 0){
+        var goodsNum = this.data.goodsNum - 1 //展示的商品总数
+      }else if(st == 1) {
+        var goodsNum = this.data.goodsNum + 1 //展示的商品总数
+      }
+      if(goodsNum < 1) {
+        wx.showToast({
+          title: '退货数量不能小于1!',
+          icon: 'none',
+        })
+        return
+      }
+      if(goodsNum > prodCount) {
+        wx.showToast({
+          title: '退货数量不能大于订单商品数量!',
+          icon: 'none',
+        })
+        return
+      }
+      big.DP = 2
+      // big.RM = 0
+      this.setData({
+        goodsNum,
+        refundAmount: new big(actualTotal).times(goodsNum).div(prodCount).valueOf()
+      })
+    },
+
+
+
+  /**
+   * 上传图片
+   */
+  getUploadImg: function(e) {
+    var idx = e.target.dataset.idx
+    // console.log(idx);
+    var ths = this;
+    wx.chooseMedia({
+      count: 1, // 默认9
+      mediaType: ['image'],
+      sourceType: ['album', 'camera'],
+      maxDuration: 30,
+      success: function(res) {
+        // 图片的本地临时文件路径列表
+        var tempFilePaths = res.tempFiles[0].tempFilePath;
+        wx.showLoading({
+          mask: true
+        })
+        var params = {
+          url: "/p/file/upload",
+          filePath: tempFilePaths,
+          name: 'file',
+          callBack: function(res2) {
+            wx.hideLoading();
+            var img = {};
+            img.path = JSON.parse(res2).filePath;
+            img.url = JSON.parse(res2).resourcesUrl + JSON.parse(res2).filePath;
+            var photoFiles = ths.data.photoFiles;
+            photoFiles.push(img);
+            ths.setData({
+              photoFiles: photoFiles
+            })
+          }
+        };
+        http.upload(params);
+      }
+    })
+  },
+
+  /**
+   * 删除图片
+   */
+  removeImage: function(e) {
+    var idx = e.currentTarget.dataset.idx;
+    var photoFiles = this.data.photoFiles;
+    photoFiles.splice(idx, 1)
+    this.setData({
+      photoFiles: photoFiles
+    });
+    console.log('删除图片')
+  },
+
+
+  /**
+   * 申请退款
+   */
+  applyRefund: function () {
+    var myreg = /^1(3|4|5|6|7|8|9)\d{9}$/;
+    var pics = '';
+    this.data.photoFiles.forEach(function (item) {
+      pics += item.path + ',';
+    });
+    if (pics != '') {
+      pics = pics.substring(0, pics.length - 1)
+    }
+    // 检查数据完整性
+    if (this.data.buyerReason == 0) {
+      wx.showToast({
+        icon: 'none',
+        title: '请选择退款原因',
+      })
+    } else if (this.data.actualTotal < 0){
+      wx.showToast({
+        icon: 'none',
+        title: '请填写正确的退款金额',
+      })
+    } else if (this.data.buyerMobile.length !== 11 || !myreg.test(this.data.buyerMobile)) {
+      // console.log(this.data.buyerMobile)
+      wx.showToast({
+        icon: 'none',
+        title: '请填写正确的手机号码',
+      })
+    } else if (this.data.buyerDesc.length == 0) {
+      wx.showToast({
+        icon: 'none',
+        title: '请填写退款说明',
+      })
+    }else{
+      console.log('status:',this.data.refundItem.status)
+      console.log('isLastProd:',this.data.isLastProd)
+      var  refundReasonArray;
+      var  refundReasonArray;
+      if(this.data.isReceiver == 0) { // 未收货
+        refundReasonArray = this.data.refundPriReasonArray
+      }else if(this.data.isReceiver == 1) { // 已收货
+        refundReasonArray = this.data.refundProdReasonArray
+      }
+      if(this.data.refundItem.status == 2 && this.data.isLastProd ) {  //待发货(包含运费)并且是最后一件
+        console.log('待发货并且是最后一件')
+        console.log(this.data.isLastProd)
+        wx.showModal({
+          title: '提示',
+          content: '本次申请的退款商品是本单最后一件商品,退款金额中包含本单运费,一旦提交申请,本单所有商品的退款申请均不可撤销,是否确认提交',
+          success: res => {
+            if (res.confirm) {
+              console.log('用户点击确定')
+              wx.showLoading();
+              var params = {
+                url: "/p/orderRefund/apply",
+                method: "POST",
+                data: {
+                  orderNumber: this.data.orderNumber, //订单编号
+                  applyType: this.data.applyType, //退款方式(1:仅退款 2退款退货)
+                  isReceiver: Number(this.data.isReceiver), //货物状态(1:已收到货 0:未收到货)
+                  buyerReason: refundReasonArray[this.data.buyerReason], //退款原因
+                  goodsNum: this.data.goodsNum, //退款数量(0或不传值则为全部数量)
+                  refundAmount: this.data.refundAmount, //退款金额
+                  buyerMobile: this.data.buyerMobile, //手机号码(默认当前订单手机号码)
+                  buyerDesc: this.data.buyerDesc, //备注说明
+                  photoFiles: pics, //凭证图片列表
+                  refundType: this.data.refundType, //退款单类型(1:整单退款,2:单个物品退款)
+                  orderItemId: this.data.refundItem.orderItemId
+                },
+                callBack: (res) => {
+                  wx.hideLoading();
+                  // 去到我的退款订单页面
+                  wx.redirectTo({
+                    url: '/pages/afterSales/afterSales',
+                  })
+                }
+              };
+              http.request(params);
+            } else if (res.cancel) {
+              console.log('用户点击取消')
+            }
+          }
+        })
+      } else {
+        console.log('非待发货(包含运费)或者非是最后一件')
+        console.log(this.data.isLastProd)
+        wx.showLoading();
+        var params = {
+          url: "/p/orderRefund/apply",
+          method: "POST",
+          data: {
+            orderNumber: this.data.orderNumber, //订单编号
+            applyType: this.data.applyType, //退款方式(1:仅退款 2退款退货)
+            isReceiver: Number(this.data.isReceiver), //货物状态(1:已收到货 0:未收到货)
+            buyerReason: refundReasonArray[this.data.buyerReason], //退款原因
+            goodsNum: this.data.goodsNum, //退款数量(0或不传值则为全部数量)
+            refundAmount: this.data.refundAmount, //退款金额
+            buyerMobile: this.data.buyerMobile, //手机号码(默认当前订单手机号码)
+            buyerDesc: this.data.buyerDesc, //备注说明
+            photoFiles: pics, //凭证图片列表
+            refundType: this.data.refundType, //退款单类型(1:整单退款,2:单个物品退款)
+            orderItemId: this.data.refundItem.orderItemId
+          },
+          callBack: (res) => {
+            wx.hideLoading();
+            // 去到我的退款订单页面
+            wx.redirectTo({
+              url: '/pages/afterSales/afterSales',
+            })
+          }
+        };
+        http.request(params);
+      }
+    }
+  },
+
+  /**
+   * 修改退款申请
+   */
+  alterRefundApply: function(e) {
+
+  },
+
+  /**
+   * 将获取到的input内容放进数据里
+   */
+  onDescInput: function(e) {
+    this.setData({
+      buyerDesc: e.detail.value
+    });
+  },
+  onRefInput: function(e) {
+    this.setData({
+      refundAmount: e.detail.value
+    })
+  },
+  onMobileInput: function(e) {
+    this.setData({
+      buyerMobile: e.detail.value
+    })
+  },
+
+  /**
+   * 退款图片预览
+   */
+  refundPicPreView(e) {
+    var idx = e.currentTarget.dataset.idx
+    var urls = []
+    this.data.photoFiles.forEach(el => {
+      urls.push(el.url)
+    })
+    wx.previewImage({
+      current: urls[idx],
+      urls: urls
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function() {
+
+  }
+})

+ 5 - 0
pages/applyRefund1/applyRefund.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {},
+  "backgroundTextStyle": "light",
+  "navigationBarTitleText": "申请退款"
+}

+ 165 - 0
pages/applyRefund1/applyRefund.wxml

@@ -0,0 +1,165 @@
+<!-- 申请退款 -->
+<!--pages/applyRefund/applyRefund.wxml-->
+
+<view class="page">
+  <!-- 头部商品信息 -->
+  <view class="top-box">
+    <text class="order-number">订单编号:{{orderNumber}}</text>
+  </view>
+
+  <!-- 整单退款 -->
+  <view class="goods-msg-box">
+    <block wx:for="{{orderItemDtos}}" wx:key='prodId' wx:if="{{refundItem.status >=2 && refundItem.orderItemDtos}}">
+      <view class='item-cont' bindtap='toProdPage' data-prodid="{{item.prodId}}">
+        <view class='prod-pic'>
+          <image src='{{item.pic}}'></image>
+        </view>
+        <view class='prod-info'>
+          <view class='prodname'>
+            {{item.prodName}}
+          </view>
+          <view class='prod-info-cont'>
+            <text class='skuname'>{{item.skuName||''}}</text> 
+            <text class='number' decode="{{true}}">&nbsp;×{{item.prodCount}}</text>
+          </view>
+          <view class='price-nums clearfix'>
+            <text class='prodprice'>
+              <text class='symbol'>¥</text>
+              <text class='big-num'>{{wxs.parsePrice(item.actualTotal)[0]}}</text>
+              <text class='small-num'>.{{wxs.parsePrice(item.actualTotal)[1]}}</text>
+            </text>
+          </view>
+        </view>
+      </view>
+    </block>
+  </view>
+
+  <!-- 单个退款 -->
+  <view class="goods-msg-box" wx:if="{{!refundItem.orderItemDtos}}">
+    <view class="img-box">
+      <image src="{{refundItem.pic}}"></image>
+    </view>
+    <view class="goods-msg">
+      <view class="goods-title">{{refundItem.prodName}}</view>
+      <view class="goods-quantity">数量:{{refundItem.prodCount}}件</view>
+    </view>
+  </view>
+
+
+  <!-- 退款方式 -->
+  <view class="picker-box">
+    <view class="select-show clearfix">
+      <text class="select-text">退款方式</text>
+      <!-- 仅退款/退货退款 -->
+      <text class="select-results">{{['', '仅退款', '退货退款'][applyType]}}</text>
+    </view>
+  </view>
+  <!-- 货物状态【已发货状态下且用户选择仅退款】 -->
+  <!-- 订单状态 1:待付款 2:待发货 3:待收货 4:待评价 5:成功 6:失败 -->
+  <picker class="picker-box" mode="selector" wx:for-idx="idx" bindchange="goodsStateArray" value="{{isReceiver}}" range="{{goodsStateArray}}" wx:if="{{refundItem.status >= 3 && refundItem.status!=6 && applyType==1}}">
+    <view class="select-show select-box clearfix">
+      <text class="select-text">货物状态</text>
+      <text class="select-results select-reason">{{goodsStateArray[isReceiver]}}</text>
+      <view class="right-arrow">
+        <image src="../../images/icon/more.png"></image>
+      </view>
+    </view>
+  </picker>
+
+  <!-- 退款原因isReceiver: 0, //货物状态(1:已收到货 0:未收到货) -->
+  <!-- 退款原因(已发货 || 已完成)&& 已收到货 -->
+  <picker class="picker-box picker-reason" wx:if="{{refundItem.status != 2 && isReceiver == 1}}" mode="selector" bindchange="refundReasonChange" value="{{refundProdReasonArray[buyerReason]}}" range="{{refundProdReasonArray}}">
+    <view class="select-show select-box clearfix">
+      <text class="select-text">退款原因</text>
+      <text class="select-results select-reason">{{refundProdReasonArray[buyerReason]}}</text>
+      <view class="right-arrow">
+        <image src="../../images/icon/more.png"></image>
+      </view>
+    </view>
+  </picker>
+  <!-- 退款原因(未发货 && 未收到货)|| (已发货 && 未收货) -->
+  <picker class="picker-box picker-reason" wx:if="{{(refundItem.status == 2  || refundItem.status != 2) && isReceiver == 0}}" mode="selector" bindchange="refundReasonChange" value="{{refundPriReasonArray[buyerReason]}}" range="{{refundPriReasonArray}}">
+    <view class="select-show select-box clearfix">
+      <text class="select-text">退款原因</text>
+      <text class="select-results select-reason">{{refundPriReasonArray[buyerReason]}}</text>
+      <view class="right-arrow">
+        <image src="../../images/icon/more.png"></image>
+      </view>
+    </view>
+  </picker>
+
+
+  <!-- 退货数量 -->
+  <view class="refund-quantity clearfix" wx:if="{{applyType == 2 && refundType == 2}}">
+    <text class="qua-text">退货数量</text>
+    <view class="quantity-choose">
+      <text class="reduce" data-st="0" bindtap="changePordNum">-</text>
+      <input class="show-num" value="{{goodsNum}}" disabled="{{true}}" />
+      <text class="add" data-st="1" bindtap="changePordNum">+</text>
+    </view>
+  </view>
+
+  <!-- 退款金额 -->
+  <view class="refund-sum-box">
+    <view class="refund-sum">
+      <label class="refund-sum-tit">退款金额</label>
+      <!-- 如果是待发货状态且使用了平台分摊的优惠金额,则不允许修改退款金额(输入框不可输入) -->
+      <text class="refund-sum-num" wx:if="{{refundItem.status==2 && refundItem.platformShareReduce >0}}">{{showPriAndScore}}</text>
+      <text class="refund-sum-num" wx:else>{{showPriAndScore}}</text>
+      <!-- <input wx:else class="refund-sum-num" type="digit " placeholder="请输入退款金额" value="{{showPriAndScore}}" bindinput="onRefInput" /> -->
+    </view>
+
+    <!-- 最多可退 -->
+    <view class="refund-sum-tips">
+      最多可退:<text>{{showNumAndCont}}</text>
+    </view>
+
+  </view>
+
+
+  <!-- 退货信息 -->
+  <view class="refund-message">
+    <!-- 手机 -->
+    <view class="item-num">
+      <label class="item-num-tit">手机号码</label>
+      <input class="item-num-num" type="number" placeholder="请输入退货人手机号码" maxlength="11" value="{{buyerMobile}}" bindinput="onMobileInput" />
+    </view>
+    <!-- 说明 -->
+    <view class="item-num">
+      <label class="item-num-tit">退款说明</label>
+      <input class="item-num-num refund-explain" placeholder="必填,最多50字" maxlength="50" value="{{buyerDesc}}" bindinput="onDescInput" />
+    </view>
+
+    <!-- 上传照片 -->
+    <view class="item-num">
+      <label class="item-num-tit upload-tit">上传凭证</label>
+      <view class="upload-img">
+        <view class="upload-tips">可上传5张图片</view>
+        <!-- 预览缩略图 -->
+        <block wx:for="{{photoFiles}}" wx:key="*this" wx:for-index="idx" wx:for-item="imgItem">
+          <view class="q-image-wrap">
+            <!-- 图片缩略图  -->
+            <image class="q-image" src="{{imgItem.url}}" mode="aspectFill" data-idx="{{idx}}" bindtap="refundPicPreView"></image>
+            <!-- 移除图片的按钮  -->
+            <view class="q-image-remover" data-idx="{{idx}}" data-index="{{index}}" bindtap="removeImage">
+              <image src="../../images/icon/close2.png"></image>
+            </view>
+          </view>
+        </block>
+        <!-- 添加图片按钮 -->
+        <view class="upload-btn" wx:if="{{photoFiles.length < 5}}" data-idx="{{index}}" bindtap="getUploadImg">+</view>
+      </view>
+    </view>
+  </view>
+  <!-- 退货信息end -->
+
+
+  <!-- 提交btn -->
+  <view class="submit-btn" bindtap="applyRefund">提交</view>
+
+
+
+</view>
+
+
+<wxs module="wxs" src="../../wxs/number.wxs" />

+ 451 - 0
pages/applyRefund1/applyRefund.wxss

@@ -0,0 +1,451 @@
+/* pages/applyRefund/applyRefund.wxss */
+
+/* 清除浮动 */
+
+.clearfix:after {
+  content: ".";
+  display: block;
+  height: 0;
+  clear: both;
+  visibility: hidden;
+}
+
+image {
+  display: block;
+  width: 100%;
+  height: 100%;
+}
+
+.page {
+  position: fixed;
+  width: 100%;
+  height: 100%;
+  background: #f8f8f8;
+  overflow: auto;
+}
+
+input::placeholder {
+  color: #eee;
+}
+
+/* 头部商品信息 */
+
+.top-box {
+  text-align: left;
+  padding: 18rpx 20rpx;
+  background: #fff;
+  border-bottom: 1rpx solid #f2f2f2;
+}
+
+.order-number {
+  font-size: 28rpx;
+  vertical-align: middle;
+}
+
+.goods-msg-box {
+  background: #fff;
+  margin-bottom: 20rpx;
+  padding: 15rpx 20rpx;
+}
+
+.img-box {
+  display: inline-block;
+  width: 150rpx;
+  height: 150rpx;
+  background: #f8f8f8;
+  margin-right: 25rpx;
+  vertical-align: top;
+}
+
+.goods-msg {
+  display: inline-block;
+  vertical-align: top;
+  width: 75%;
+}
+
+.goods-title {
+  font-size: 30rpx;
+  line-height: 1.5em;
+  display: -webkit-box;
+  -webkit-line-clamp: 2; /*设定显示行数*/
+  -webkit-box-orient: vertical;
+  word-break: break-all;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+
+.goods-quantity {
+  font-size: 26rpx;
+  color: #888;
+  margin-top: 25rpx;
+}
+
+/* 整单退款商品列表 */
+
+.item-cont .prod-pic image {
+  width: 180rpx;
+  height: 180rpx;
+}
+
+.item-cont {
+  position: relative;
+  display: flex;
+  align-items: center;
+  padding: 30rpx;
+  border-top: 2rpx solid #f1f1f1;
+}
+
+.item-cont .prod-pic {
+  font-size: 0;
+  display: block;
+  width: 160rpx;
+  height: 160rpx;
+  overflow: hidden;
+  background: #fff;
+  margin-right: 16rpx;
+}
+
+.item-cont .prod-pic image {
+  width: 100%;
+  height: 100%;
+}
+
+.item-cont .prod-info {
+  margin-left: 10rpx;
+  font-size: 28rpx;
+  width: 100%;
+  position: relative;
+  height: 80px;
+  -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;
+}
+
+.item-cont .prod-info .prodname {
+  font-size: 30rpx;
+  line-height: 40rpx;
+  max-height: 86rpx;
+  overflow: hidden;
+  display: -webkit-box;
+  -webkit-line-clamp: 1;
+  -webkit-box-orient: vertical;
+  text-overflow: ellipsis;
+  word-break: break-all;
+}
+
+.item-cont .prod-info .prod-info-cont {
+  position: relative;
+  color: #999;
+  margin-top: 20rpx;
+  font-size: 26rpx;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 2;
+  flex-direction: column;
+}
+
+.item-cont .prod-info .prod-info-cont .info-item {
+  color: #888;
+  margin-top: 10rpx;
+  font-size: 26rpx;
+  overflow: hidden;
+  display: -webkit-box;
+  -webkit-line-clamp: 1;
+  -webkit-box-orient: vertical;
+  text-overflow: ellipsis;
+  word-break: break-all;
+  width: 75%;
+}
+
+.group-text {
+  display: block;
+  font-size: 23rpx;
+  color: #fff;
+  background: #e43130;
+  padding: 6rpx 10rpx;
+}
+
+.item-cont .prod-info .prod-info-cont .number {
+  display: inline-block;
+  margin-right: 20rpx;
+  vertical-align: middle;
+}
+.skuname {
+  max-width: 85%;
+  display: -webkit-box;
+  -webkit-line-clamp: 1; /*设定显示行数*/
+  -webkit-box-orient: vertical;
+  word-break: break-all;	
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+
+.price-nums {
+  margin-top: 18rpx;
+}
+
+.price-nums .prodprice {
+  color: #e43130;
+  font-size: 26rpx;
+  float: left;
+}
+
+.price-nums .btn-box {
+  float: right;
+  text-align: right;
+}
+
+.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;
+}
+
+/* 退款方式&原因 */
+
+.picker-box {
+  background: #fff;
+  border-bottom: 1rpx solid #f2f2f2;
+}
+
+.picker-reason {
+  margin-bottom: 20rpx;
+}
+
+.select-show {
+  text-align: left;
+  padding: 20rpx 0;
+  margin: 0 20rpx;
+}
+
+.select-text {
+  font-size: 30rpx;
+  float: left;
+}
+
+.select-results {
+  font-size: 30rpx;
+  color: #888;
+  float: right;
+}
+
+.select-box {
+  position: relative;
+}
+
+.select-reason {
+  padding-right: 30rpx;
+}
+
+.right-arrow {
+  position: absolute;
+  right: 0;
+  top: 50%;
+  transform: translateY(-50%);
+  width: 20rpx;
+  height: 20rpx;
+  display: block;
+}
+
+/* 退货数量 */
+
+.refund-quantity {
+  background: #fff;
+  padding: 20rpx;
+  border-bottom: 1rpx solid #f2f2f2;
+  text-align: left;
+}
+
+.qua-text {
+  font-size: 28rpx;
+}
+
+.quantity-choose {
+  float: right;
+}
+
+.show-num {
+  display: inline-block;
+  width: 75rpx;
+  height: 65rpx;
+  line-height: 65rpx;
+  font-size: 25rpx;
+  background: #f2f2f5;
+  margin: 0 3rpx;
+  vertical-align: middle;
+  text-align: center;
+}
+
+.reduce, .add {
+  display: inline-block;
+  width: 65rpx;
+  height: 65rpx;
+  line-height: 65rpx;
+  background: #f7f7f9;
+  vertical-align: middle;
+  text-align: center;
+  color: #aaa;
+}
+
+/* 退款金额 */
+
+.refund-sum-box {
+  font-size: 30rpx;
+}
+
+.refund-sum {
+  background: #fff;
+  padding: 15rpx;
+}
+
+.refund-sum-tit {
+  display: inline-block;
+  vertical-align: midddle;
+  margin-right: 50rpx;
+}
+
+.refund-sum-num {
+  display: inline-block;
+  vertical-align: middle;
+  color: #e43130;
+}
+
+.refund-sum-tips {
+  padding: 15rpx 20rpx;
+  font-size: 28rpx;
+  color: #aaa;
+}
+
+.sub {
+  color: #e43130;
+  vertical-align: middle;
+}
+
+/* 退款信息填写 */
+
+.refund-message {
+  background: #fff;
+  margin-bottom: 20rpx;
+}
+
+.item-num {
+  background: #fff;
+  border-bottom: 1rpx solid #f2f2f2;
+  padding: 10px 20rpx;
+  font-size: 30rpx;
+}
+
+.item-num-tit {
+  display: inline-block;
+  vertical-align: middle;
+  margin-right: 40rpx;
+}
+
+.upload-tit {
+  vertical-align: top;
+}
+
+.item-num-num {
+  display: inline-block;
+  vertical-align: middle;
+  width: 70%;
+}
+
+/* 订单状态 */
+
+.order-status {
+  padding: 20rpx;
+  background: #fff;
+  border-bottom: 1rpx solid #f2f2f2;
+}
+
+/* 上传照片 */
+
+.upload-img {
+  display: inline-block;
+  width: 72%;
+}
+
+.upload-tips {
+  font-size: 26rpx;
+  color: #888;
+  margin-bottom: 1em;
+}
+
+/* 缩略图 */
+
+.question-images {
+  display: inline-block;
+  vertical-align: bottom;
+}
+
+.q-image-wrap {
+  display: inline-block;
+  position: relative;
+  margin-right: 15rpx;
+  margin-bottom: 10rpx;
+}
+
+.q-image {
+  display: inline-block;
+  width: 110rpx;
+  height: 110rpx;
+  background: #eee;
+}
+
+.q-image-remover {
+  position: absolute;
+  right: -6rpx;
+  top: -6rpx;
+  width: 30rpx;
+  height: 30rpx;
+  text-align: center;
+  font-size: 23rpx;
+}
+
+/*  +  */
+
+.upload-img .upload-btn {
+  display: inline-block;
+  width: 100rpx;
+  height: 100rpx;
+  line-height: 90rpx;
+  text-align: center;
+  font-size: 80rpx;
+  color: #ddd;
+  border: 2px dashed #f4f4f4;
+  vertical-align: top;
+}
+
+/* 提交按钮 */
+
+.submit-btn {
+  background: #FF941A;
+  color: #fff;
+  margin: 30rpx 20rpx;
+  margin-top: 70rpx;
+  font-size: 28rpx;
+  padding: 1em 0;
+  text-align: center;
+  border-radius: 40rpx;
+}

+ 3 - 2
pages/basket/basket.js

@@ -76,7 +76,7 @@ Page({
     }
     //加载购物车
     var params = {
-      url: "/p/shopCart/info",
+      url: "/p/shopCart/info/1",
       method: "POST",
       data: reqData,
       dontTrunLogin: true,
@@ -377,7 +377,8 @@ Page({
         count: prodCount,
         prodId: shopCartItemDiscounts[scindex].shopCartItems[index].prodId,
         skuId: shopCartItemDiscounts[scindex].shopCartItems[index].skuId,
-        shopId: shopCartItemDiscounts[scindex].shopCartItems[index].shopId
+        shopId: shopCartItemDiscounts[scindex].shopCartItems[index].shopId,
+        platform:1
       },
       callBack: function (res) {
         shopCartItemDiscounts[scindex].shopCartItems[index].prodCount += prodCount;

+ 3 - 2
pages/category/category.js

@@ -125,7 +125,8 @@ Page({
       "distributionCardNo": item.distributionCardNo||'',
       "prodId": item.prodId,
       "shopId": item.shopId,
-      "skuId": item.skuId||item.skuList[0].skuId
+      "skuId": item.skuId||item.skuList[0].skuId,
+      platform:1
     }
     this.changeCar(data)
   },
@@ -512,7 +513,7 @@ Page({
   // 获取购物车数据
   getCarData() {
     var params = {
-      url: "/p/shopCart/info",
+      url: "/p/shopCart/info/1",
       method: "post",
       data: [{
         "basketId": 0,

+ 35 - 14
pages/locationAdd/locationAdd.wxml

@@ -1,5 +1,5 @@
 <!--pages/locationAdd/locationAdd.wxml-->
-<view class='container'>
+<view class=''>
   <view class="top-card-box">
     <view class="current-location">当前定位</view>
     <view class="location-box">
@@ -13,23 +13,44 @@
       </view>
     </view>
   </view>
-  <view class="address-card-box">
-    <view class="my-address">
-      <view class="address-title">我的收货地址</view>
-      <view class="address-edit" bindtap="editAddress" wx:if="{{addressList.length}}">管理</view>
+  <view class="content">
+    <view class="address-card-box box">
+      <view class="my-address">
+        <view class="address-title">我的收货地址</view>
+        <view class="address-edit" bindtap="editAddress" wx:if="{{addressList.length}}">管理</view>
+      </view>
+      <van-empty description="暂无地址" wx:if="{{!addressList.length}}" />
+      <block wx:else>
+        <view class="address-list-box" catchtap="setDefault" data-item="{{item}}" wx:for="{{addressList}}">
+        <view class="address-check">
+          <van-icon wx:if="{{item.commonAddr==1}}" name="success" color="#FF941A"/>
+        </view>
+        <view class="address-list">
+          <view>{{item.address}}{{item.addressName}}{{item.addrDetail}}</view>
+          <view>{{item.receiver}} {{item.mobile}}</view>
+        </view>
+      </view>
+      </block>
     </view>
-    <van-empty description="暂无地址" wx:if="{{!addressList.length}}" />
-    <block wx:else>
-      <view class="address-list-box" catchtap="setDefault" data-item="{{item}}" wx:for="{{addressList}}">
-      <view class="address-check">
-        <van-icon wx:if="{{item.commonAddr==1}}" name="success" color="#FF941A"/>
+
+    <view class="shop-list ">
+      <view class="near-shop box">
+        <view class="desc">
+          附近的门店
+        </view>
+        <view class="shop">
+          海马购超市(红街店)
+        </view>
+        <view class="desc">
+          以为您选择距离最近的可配送店
+        </view>
       </view>
-      <view class="address-list">
-        <view>{{item.address}}{{item.addressName}}{{item.addrDetail}}</view>
-        <view>{{item.receiver}} {{item.mobile}}</view>
+      <view class="box">
+        <view class="shop">
+          京东便利店(优品3店)
+        </view>
       </view>
     </view>
-    </block>
   </view>
   <view class="add-address-btn" bindtap="onAddAddr">新建地址</view>
 </view>

+ 31 - 3
pages/locationAdd/locationAdd.wxss

@@ -13,6 +13,34 @@ page {
   padding: 20rpx;
 }
 
+.content{
+  padding: 0 24rpx;
+
+}
+
+.box{
+  border-radius: 16rpx;
+  background-color: #fff;
+  padding: 0 24rpx;
+  margin-bottom: 20rpx;
+}
+.shop-list{
+
+}
+.shop{
+  line-height: 92rpx;
+}
+.near-shop{
+  margin-bottom: 20rpx;
+  padding-top: 20rpx;
+  padding-bottom: 20rpx;
+}
+.shop-list .desc{
+  font-size: 24rpx;
+  color: #AAAAAA;
+}
+
+
 .current-location {
   font-family: PingFang SC, PingFang SC;
   font-weight: normal;
@@ -54,9 +82,8 @@ page {
 
 .address-card-box {
   margin-top: 20rpx;
-  padding: 20rpx;
-  background-color: #ffffff;
-  border-radius: 16rpx;
+  padding-top: 20rpx;
+  padding-bottom: 20rpx;
 }
 
 .my-address {
@@ -115,6 +142,7 @@ page {
 .add-address-btn {
   position: fixed;
   bottom: 120rpx;
+  left: 24rpx;
   width: 702rpx;
   height: 80rpx;
   background: #FF941A;

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

@@ -7,6 +7,8 @@ Page({
    * 页面的初始数据
    */
   data: {
+    
+    dvyType:'',//配送方式
     orderItemDtos: [],
     remarks: "",
     actualTotal: 0,
@@ -78,6 +80,82 @@ Page({
     }
   },
 
+   /**
+   * 付款
+   */
+  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);
+  },
+
+    /**
+   * 取消订单
+   */
+  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('用户点击取消')
+        }
+      }
+    })
+  },
+
   /**
    * 申请退款
    */
@@ -173,7 +251,17 @@ Page({
           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({
+          dvyType:dvyType,
           orderNumber: orderNum,
           actualTotal: res.actualTotal, //实际支付总额(商品总额+运费)
           userAddrDto: res.userAddrDto,
@@ -190,6 +278,7 @@ Page({
           canAllRefund: res.canAllRefund,
           orderScore: res.orderScore, // 整单使用积分
         });
+        
         wx.hideLoading();
       }
     };

+ 55 - 41
pages/order-detail/order-detail.wxml

@@ -2,29 +2,31 @@
 
   <!-- 地址 -->
   <view class='order-detail'>
-    <!-- <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="order-sts">{{['','待支付','待发货','待收货','已完成','已完成','已取消','拼团中'][status]}}</view>
 
+    <view class="pay-box" wx:if="{{status == 1}}">
+    
+      <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">
+      <!-- <view class="item">
         <image class="icon" src="../../images/icon/del-icon.png" mode=""/>
         <view class="label">
           删除订单
         </view>
-      </view>
-      <button class='item' open-type="contact">
+      </view> -->
+      <button class='item' open-type="contact" wx:if="{{status >= 2&&status <= 5}}">
         <image class="icon" src="../../images/icon/chat-icon.png" mode=""/>
         <view class="label">
           联系商家
         </view>
      </button>
-      <view class="item">
+      <view class="item" wx:if="{{status == 4}}">
         <image class="icon" src="../../images/icon/buy-icon.png" mode=""/>
         <view class="label">
           再次购买
@@ -32,6 +34,14 @@
       </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">
@@ -100,35 +110,6 @@
       </view>
     </view>
 
-    <!-- 订单信息 -->
-    <view class='order-msg box'>
-      <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-msg box'>
       <view class='msg-item'>
         <view class='item'>
@@ -140,7 +121,8 @@
           </view>
         </view>
         <view class='item'>
-          <view class='item-tit'>运费:</view>
+          <!-- <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>
@@ -168,6 +150,38 @@
       </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> -->

+ 48 - 6
pages/order-detail/order-detail.wxss

@@ -113,6 +113,40 @@ page {
   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;
@@ -121,7 +155,7 @@ page {
 
 .order-detail .oprate-box{
   display: flex;
-  padding: 24rpx;
+  padding: 0 24rpx;
   
 }
 .order-detail .oprate-box .item{
@@ -130,7 +164,7 @@ page {
   margin: 0;
   border: none;
   background-color: #fff !important;
-  padding: 0;
+  padding: 24rpx 0;
   display: block!important;
   -webkit-tap-highlight-color: transparent;
   outline: none;
@@ -162,6 +196,9 @@ page {
   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;
@@ -172,7 +209,9 @@ page {
 .order-detail .delivery-addr .addr {
   font-size: 28rpx;
   line-height: 36rpx;
-  color: #777777;
+  font-size: 28rpx;
+  color: #AAAAAA;
+  margin-top: 20rpx;
 }
 
 /* 商品列表 */
@@ -331,11 +370,12 @@ page {
   background: #fff;
   margin-top: 15rpx;
   font-size: 30rpx;
+  padding: 0 20rpx;
+
 }
 
 .order-msg .msg-item {
-  padding: 20rpx;
-  border-top: 2rpx solid #f1f1f1;
+  /* padding: 20rpx; */
 }
 
 .order-msg .msg-item:first-child {
@@ -346,6 +386,7 @@ page {
   display: flex;
   padding: 10rpx 0;
   align-items: center;
+  justify-content: space-between;
 }
 
 .order-msg .msg-item .item.payment {
@@ -356,13 +397,14 @@ page {
 
 .order-msg .msg-item .item .item-tit {
   font-size: 28rpx;
-  color: #222222;
+  color: #AAAAAA;
   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 {

+ 1 - 1
pages/orderList/orderList.wxml

@@ -4,7 +4,7 @@
   <view class='order-tit'>
     <text bindtap='onStsTap' data-sts="0" class="{{sts==0?'on':''}}">全部</text>
     <text bindtap='onStsTap' data-sts="1" class="{{sts==1?'on':''}}">待支付</text>
-    <text bindtap='onStsTap' data-sts="2" class="{{sts==2?'on':''}}">待发货</text>
+    <!-- <text bindtap='onStsTap' data-sts="2" class="{{sts==2?'on':''}}">待发货</text> -->
     <text bindtap='onStsTap' data-sts="3" class="{{sts==3?'on':''}}">待收货</text>
     <text bindtap='onStsTap' data-sts="5" class="{{sts==5?'on':''}}">已完成</text>
   </view>

+ 2 - 1
pages/pay-result/pay-result.js

@@ -26,7 +26,8 @@ Page({
       }
     })
     wx.redirectTo({
-      url: '/pages/orderList/orderList?sts=' + (this.data.sts == 0 ? '1' : '2')
+      // url: '/pages/orderList/orderList?sts=' + (this.data.sts == 0 ? '1' : '2')
+      url: '/pages/orderList/orderList?sts=' + (this.data.sts == 0 ? '1' : '3')//成功跳转待收货
     })
   },
   toIndex: function () {

+ 3 - 2
pages/prod/prod.js

@@ -751,7 +751,7 @@ Page({
       url: "/p/shopCart/prodCount",
       method: "GET",
       dontTrunLogin: true,
-      data: {},
+      data: {platform:1},
       callBack: (res) => {
         if (res > 0) {
           // wx.setTabBarBadge({
@@ -902,7 +902,8 @@ Page({
         shopId: this.data.shopId,
         shopName: this.data.shopName,
         skuId: this.data.defaultSku.skuId,
-        distributionCardNo: this.data.distributionCardNo
+        distributionCardNo: this.data.distributionCardNo,
+        platform:1
       },
       callBack: (res) => {
         this.setData({

+ 7 - 1
pages/submit-order/submit-order.js

@@ -337,7 +337,13 @@ Page({
       },
       callBack: res => {
         wx.hideLoading();
-        this.calWeixinPay(res.orderNumbers);
+        if(res.nextPay){
+          this.calWeixinPay(res.orderNumbers);
+        }else{
+          wx.redirectTo({
+            url: `/pages/pay-result/pay-result?sts=1&orderNumbers=${res.orderNumbers}&orderType=${this.data.orderType}`,
+          })
+        }
       },
       errCallBack: res => {
         wx.showModal({

+ 27 - 8
pages/submit-order/submit-order.wxml

@@ -87,7 +87,7 @@
       <!-- /店铺商品明细 -->
 
       <!-- 店铺优惠券和买家留言 -->
-      <view class='order-msg'>
+      <!-- <view class='order-msg'>
         <view class='msg-item'>
           <view class='item coupon' bindtap='showCouponPopup' data-index="{{index}}">
             <text class='item-tit'>优惠券:</text>
@@ -102,7 +102,7 @@
           </view>
         </view>
 
-      </view>
+      </view> -->
       <!-- /店铺优惠券和买家留言 -->
 
     </view>
@@ -113,13 +113,13 @@
     <view class='order-msg'>
       <view class='msg-item'>
         <!-- 平台优惠券 -->
-        <view class='item coupon' bindtap='showCouponPopup' data-index="-1">
+        <!-- <view class='item coupon' bindtap='showCouponPopup' data-index="-1">
           <text class='item-tit'>平台优惠券:</text>
           <text class='coupon-btn' wx:if="{{!platformCoupons.canUseLength}}">暂无可用</text>
           <text class='coupon-btn' wx:else>{{platformCoupons.canUseLength}}张可用</text>
           <text class="coupon-amount" wx:if="{{platformCoupons.couponAmount > 0}}"><text class='symbol'>-¥</text>{{wxs.toPrice(platformCoupons.couponAmount)}}</text>
           <text class='arrow'></text>
-        </view>
+        </view> -->
         <!-- 会员积分 -->
         <view class='item coupon' wx:if="{{maxUsableScore > 0}}">
           <view class="member-points">
@@ -140,14 +140,14 @@
           </view>
         </view>
         <!-- 起送价 -->
-        <view class='item'>
+        <!-- <view class='item'>
           <view class='item-tit'>起送价:</view>
           <view class='item-txt price'>
             <text class='symbol'>¥</text>
             <text class='big-num'>{{wxs.parsePrice(deliveryAmount_num)[0]}}</text>
             <text class='small-num'>.{{wxs.parsePrice(deliveryAmount_num)[1]}}</text>
           </view>
-        </view>
+        </view> -->
         <!-- 商品总额 -->
         <view class='item'>
           <view class='item-tit'>商品总额:</view>
@@ -184,15 +184,24 @@
             <text class='small-num'>.{{wxs.parsePrice(totalLevelAmount)[1]}}</text>
           </view>
         </view>
-        <!-- 优惠金额 -->
+        <!-- 积分 -->
         <view class='item'>
-          <view class='item-tit'>总优惠金额:</view>
+          <view class='item-tit'>积分:</view>
           <view class='item-txt price'>
             <text class='symbol'>-¥</text>
             <text class='big-num'>{{wxs.parsePrice(orderReduce)[0]}}</text>
             <text class='small-num'>.{{wxs.parsePrice(orderReduce)[1]}}</text>
           </view>
         </view>
+        <!-- 优惠金额 -->
+        <!-- <view class='item'>
+          <view class='item-tit'>总优惠金额:</view>
+          <view class='item-txt price'>
+            <text class='symbol'>-¥</text>
+            <text class='big-num'>{{wxs.parsePrice(orderReduce)[0]}}</text>
+            <text class='small-num'>.{{wxs.parsePrice(orderReduce)[1]}}</text>
+          </view>
+        </view> -->
         <!-- <view class='item payment'>
           <view class='item-txt price'>
             小计:
@@ -205,6 +214,16 @@
     </view>
     <!-- /总金额计算 -->
 
+    <view class='order-msg' style="margin-top: 20rpx;">
+    <view class="msg-item">
+      <view class='item'>
+            <text>备注:</text>
+            <input placeholder='选填,请先和商家协商一致,付款后商家可见' 	placeholder-style="font-size: 24rpx;color: #AAAAAA;" value="{{remarks}}" data-index="{{index}}" bindinput="onRemarkIpt"></input>
+          </view>
+    </view>
+    </view>
+
+
   </view>
 
   <!-- 底部栏 -->

+ 16 - 2
project.private.config.json

@@ -23,12 +23,26 @@
     "miniprogram": {
       "list": [
         {
-          "name": "pages/Review/Review",
-          "pathName": "pages/Review/Review",
+          "name": "售后详情页",
+          "pathName": "pages/DetailsOfRefund/DetailsOfRefund",
           "query": "",
           "scene": null,
           "launchMode": "default"
         },
+        {
+          "name": "申请售后",
+          "pathName": "pages/applyRefund/applyRefund",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        },
+        {
+          "name": "pages/Review/Review",
+          "pathName": "pages/Review/Review",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        },
         {
           "name": "/pages/prodComm/prodComm",
           "pathName": "/pages/prodComm/prodComm",

+ 1 - 1
utils/http.js

@@ -214,7 +214,7 @@ function getCartCount() {
     url: "/p/shopCart/prodCount",
     method: "GET",
     dontTrunLogin: true,
-    data: {},
+    data: {platform:1},
     callBack: function (res) {
       if (res > 0) {
         wx.setTabBarBadge({