tea 3 сар өмнө
parent
commit
325dad3f4a

+ 29 - 28
kxmall-admin-ui/src/views/order/storeOrder/index.vue

@@ -1,16 +1,16 @@
 <template>
   <div class="app-container">
     <el-tabs v-model="queryParams.orderStatus" @tab-click="onOrderStatusChange">
-      <el-tab-pane v-for="item in status" :key="item.name" :label="item.label" :name="item.name" />
+      <el-tab-pane v-for="item in status" :key="item.name" :label="item.label" :name="item.name"/>
     </el-tabs>
     <el-form ref="queryForm" :model="queryParams" size="small" :inline="true" label-width="68px">
       <el-form-item prop="storageId">
         <el-select v-model="queryParams.storageId" placeholder="请选择前置仓" clearable>
-          <el-option v-for="item in storages" :key="item.id" :label="item.name" :value="item.id" />
+          <el-option v-for="item in storages" :key="item.id" :label="item.name" :value="item.id"/>
         </el-select>
       </el-form-item>
       <el-form-item prop="orderId">
-        <el-input v-model="queryParams.orderId" clearable placeholder="输入订单号" @keyup.enter.native="toQuery" />
+        <el-input v-model="queryParams.orderId" clearable placeholder="输入订单号" @keyup.enter.native="toQuery"/>
       </el-form-item>
       <el-form-item prop="createTime">
         <el-date-picker
@@ -104,8 +104,8 @@
       >
         <template slot-scope="{row}">
           <el-tag :type="row.shippingType==1 ? 'error' : 'success'">{{
-            row.shippingType == 1 ? '配送' : '自提'
-          }}
+              row.shippingType == 1 ? '配送' : '自提'
+            }}
           </el-tag>
         </template>
       </el-table-column>
@@ -245,7 +245,7 @@
             @command="handleDeliveryCommand(row, $event)"
           >
             <el-button type="primary" size="mini">
-              配送方式<i class="el-icon-arrow-down el-icon--right" />
+              配送方式<i class="el-icon-arrow-down el-icon--right"/>
             </el-button>
             <el-dropdown-menu slot="dropdown">
               <el-dropdown-item command="system">系统配送</el-dropdown-item>
@@ -272,7 +272,8 @@
       @pagination="getList"
     />
     <!-- 添加或修改订单对话框 -->
-    <el-dialog title="订单详情" :visible.sync="open" width="1050px" append-to-body class="order-detail-dialog" :custom-class	="order-detail-dialog">
+    <el-dialog title="订单详情" :visible.sync="open" width="1050px" append-to-body class="order-detail-dialog"
+               :custom-class="order-detail-dialog">
       <div class="detail-container">
         <!-- 基本信息部分 -->
         <div class="detail-section">
@@ -549,7 +550,7 @@
                 >
                   <img :src="photo.imageUrl" alt="订单照片" class="photo-thumbnail">
                   <div class="photo-overlay">
-                    <i class="el-icon-zoom-in" />
+                    <i class="el-icon-zoom-in"/>
                   </div>
                 </div>
               </div>
@@ -601,7 +602,7 @@
     >
       <el-form>
         <el-form-item label="核销码">
-          <el-input v-model="verifyCode" placeholder="请输入核销码" />
+          <el-input v-model="verifyCode" placeholder="请输入核销码"/>
         </el-form-item>
       </el-form>
       <span slot="footer" class="dialog-footer">
@@ -675,7 +676,7 @@
 
 <script>
 import Clipboard from 'clipboard'
-import { multiply } from '@/utils/math'
+import {multiply} from '@/utils/math'
 import {
   listStoreOrder /** delStoreOrder, addStoreOrder, updateStoreOrder*/,
   getStoreOrder,
@@ -688,8 +689,8 @@ import {
   thirdPartyDistribution,
   cancelOrder
 } from '@/api/order/storeOrder'
-import { listAllStorage } from '@/api/storage/storage'
-import { getRiderByStorageId } from '@/api/rider/rider'
+import {listAllStorage} from '@/api/storage/storage'
+import {getRiderByStorageId} from '@/api/rider/rider'
 
 export default {
   name: 'StoreOrder',
@@ -743,17 +744,17 @@ export default {
       form: {},
       // 表单校验
       status: [
-        { label: '待配货', name: '14' },
-        { label: '配货中', name: '16' },
-        { label: '待配送', name: '20' },
-        { label: '配送中', name: '30' },
-        { label: '已完成', name: '40,50' },
-        { label: '配送异常', name: '32' },
-        { label: '超时订单', name: '34' },
-        { label: '待支付', name: '10' },
-        { label: '已退款', name: '70' },
-        { label: '已取消', name: '80' },
-        { label: '全部订单', name: 'all' }
+        {label: '待配货', name: '14'},
+        {label: '配货中', name: '16'},
+        {label: '待配送', name: '20'},
+        {label: '配送中', name: '30'},
+        {label: '已完成', name: '40,50'},
+        {label: '配送异常', name: '32'},
+        {label: '超时订单', name: '34'},
+        {label: '待支付', name: '10'},
+        {label: '已退款', name: '70'},
+        {label: '已取消', name: '80'},
+        {label: '全部订单', name: 'all'}
       ],
       storages: []
     }
@@ -797,7 +798,7 @@ export default {
   methods: {
     multiply,
     listAllStorage() {
-      listAllStorage().then(({ data }) => {
+      listAllStorage().then(({data}) => {
         this.storages = data
         this.storages.forEach(storage => {
           this.storageMap[storage.id] = storage.name
@@ -929,7 +930,7 @@ export default {
     getList() {
       this.loading = true
       this.storeOrderList = []
-      const params = { ...this.queryParams }
+      const params = {...this.queryParams}
       if (params.createTime) {
         params.startTime = params.createTime[0]
         params.endTime = params.createTime[1]
@@ -961,7 +962,7 @@ export default {
       this.handleQuery()
     },
     viewDetail(id) {
-      getStoreOrder(id).then(({ data }) => {
+      getStoreOrder(id).then(({data}) => {
         this.form = data
         this.open = true
       })
@@ -1051,7 +1052,7 @@ export default {
         thirdPartyDistribution,
         cancelOrder
       }
-      operations[operation]({ id }).then(() => {
+      operations[operation]({id}).then(() => {
         this.$message({
           message: '操作成功',
           type: 'success'
@@ -1060,7 +1061,7 @@ export default {
       })
     },
     check(val) {
-      const loadingInstance = this.$loading({ text: '正在分配中...' })
+      const loadingInstance = this.$loading({text: '正在分配中...'})
       distributeOrder({
         orderNo: this.orderId,
         riderId: val

+ 5 - 2
kxmall-app-ui/pages/order/create.vue

@@ -683,6 +683,7 @@ export default {
       const month = date.getMonth() + 1
       const day = date.getDate()
       const currentHour = date.getHours()
+      const currentMinute = date.getMinutes()
       
       if (date.getHours() >= maxEndHour) {
         dayCount += 1
@@ -781,8 +782,10 @@ export default {
           if (typeof firstTime === 'string') {
             // 尽快到达的情况
             const nextHour = currentHour + 1
-            const estimatedTime = nextHour < 10 ? '0' + nextHour + ':00' : nextHour + ':00'
-            this.orderReqeust.predictTime = `尽快到达(预计${estimatedTime}到达)`
+            const h = nextHour < 10 ? '0' + nextHour : nextHour
+            const m = currentMinute < 10 ? '0' + currentMinute : currentMinute
+            
+            this.orderReqeust.predictTime = `尽快到达(预计${h}:${m}到达)`
             
             const targetDate = new Date(year, month - 1, day + firstAvailableDay, nextHour, 0)
             this.orderReqeust.predictDate = targetDate.getTime()

+ 57 - 17
kxmall-app-ui/pages/order/detail.vue

@@ -10,6 +10,8 @@
       <view class="code-text">核销码: {{ verificationText }}</view>
       <view class="code-hint">请向店员出示此核销码</view>
     </view>
+    <!-- 核销码显示区域 -->
+    
     <view class="state">
       <view class="state-text" v-if="orderDetail.status !== 10"
             :style="state === 5 || state === 8?'color:#1B1C33;font-size:20px':''">
@@ -32,13 +34,21 @@
         {{ (state == 1 || state == 2) && orderDetail.shippingType == 1 ? orderDetail.predictTime : '' }}
         {{ (state == 1 || state == 2) && orderDetail.shippingType == 2 ? orderDetail.predictTime.replaceAll('送达', '取货') : '' }}
         <!-- {{state == 3 || state == 4?'订单已完成':''}} -->
-        {{ state == 3 || state == 4 || state == 5 || state == 8 ? timeFormat(orderDetail.updateTime) : '' }}
+        {{ state == 3 || state == 4 || state == 5 || state == 8 ? orderDetail.updateTime : '' }}
         {{ orderDetail.status == 12 ? '拼团结束:' + orderDetail.groupShopVo.endTime : '' }}
       </view>
-      <view @click="refundOrder" class="state-btn state-btn-prohibit" v-if="state == 1 && !orderDetail.payIntegral"
-            style="margin: 12px auto;">
-        申请退款
+      <!-- 联系师傅按钮 - 在配送中显示 -->
+      <view style="display: flex; justify-content: center; align-items: center; margin: 12px auto;">
+        <view @click="contactRider" class="state-btn state-btn-contact" v-if="state === 2 || state === 1"
+              style="margin: 12px auto;">
+          联系师傅
+        </view>
+        <view @click="refundOrder" class="state-btn state-btn-prohibit" v-if="state === 1 && !orderDetail.payIntegral"
+              style="margin: 12px auto;">
+          申请退款
+        </view>
       </view>
+
       <view style="display: flex; justify-content: center; align-items: center; margin: 12px auto;" v-if="state == 3">
         <view @click="orderAfterSales" class="state-btn state-btn-prohibit" style="margin: 12px auto;">
           申请售后
@@ -161,11 +171,11 @@
       </view>
       <view class="yt-list-cell b-b">
         <text class="cell-tit clamp">下单时间</text>
-        <text class="cell-tip ">{{ timeFormat(orderDetail.createTime) }}</text>
+        <text class="cell-tip ">{{ orderDetail.createTime }}</text>
       </view>
       <view v-if="orderDetail.payTime" class="yt-list-cell b-b">
         <text class="cell-tit clamp">支付时间</text>
-        <text class="cell-tip ">{{ timeFormat(orderDetail.payTime) }}</text>
+        <text class="cell-tip ">{{ orderDetail.payTime }}</text>
       </view>
     
     </view>
@@ -328,7 +338,7 @@ export default {
       this.screenshotList.forEach(item => {
         const userTypeText = this.getUserTypeText(item.userType)
         const screenshotTypeText = this.getScreenshotTypeText(item.screenshotType)
-        const timeText = this.timeFormat(item.uploadTime)
+        const timeText = item.uploadTime
         const groupKey = `${userTypeText}-${screenshotTypeText}-${timeText}`
         
         if (!groups[groupKey]) {
@@ -692,16 +702,6 @@ export default {
         })
       })
     },
-    timeFormat(time) {
-      if (time == undefined) {
-        return
-      }
-      time = time.replace(/\-/g, '/')
-      var date = new Date(time);
-      var month = date.getMonth() + 1 > 9 ? date.getMonth() + 1 : '0' + parseInt(date.getMonth() + 1)
-      var day = date.getDate() > 9 ? date.getDate() : '0' + date.getDate()
-      return date.getFullYear() + '-' + month + '-' + day + ' ' + date.getHours() + ':' + date.getMinutes()
-    },
     showPayment(val) {
       if (val === 'BALANCE') {
         return '余额支付'
@@ -851,6 +851,39 @@ export default {
           }
         }
       })
+    },
+    // 联系师傅
+    contactRider() {
+      const that = this
+      // 获取师傅联系信息
+      that.$api.request('get', 'order/app/getRiderContact', {
+        orderId: that.orderId
+      }).then(res => {
+        const riderInfo = res.data
+        uni.showModal({
+          title: '联系师傅',
+          content: `师傅:${riderInfo.riderName}\n电话:${riderInfo.riderPhone}`,
+          confirmText: '拨打电话',
+          cancelText: '取消',
+          success: (modalRes) => {
+            if (modalRes.confirm) {
+              // 拨打电话
+              uni.makePhoneCall({
+                phoneNumber: riderInfo.riderPhone,
+                success: () => {
+                  console.log('拨打电话成功')
+                },
+                fail: (err) => {
+                  console.log('拨打电话失败', err)
+                  that.$api.msg('拨打电话失败')
+                }
+              })
+            }
+          }
+        })
+      }).catch(err => {
+        that.$api.msg(err.msg || '获取师傅信息失败')
+      })
     }
   }
 }
@@ -946,6 +979,13 @@ page {
     color: #fff;
   }
   
+  .state-btn-contact {
+    border-color: #1890ff;
+    color: #1890ff;
+    background-color: #1890ff;
+    color: #fff;
+  }
+  
   
 }
 

+ 416 - 357
kxmall-app-ui/pages/order/refund.vue

@@ -1,150 +1,157 @@
 <!-- 售后提交 -->
 <template>
-	<view class="apply-return">
-		<!-- 申请售后 -->
-		<view class="container" v-if="selected">
-			<view class="goodsStyle acea-row row-between"
-				v-for="cart in selectProduct"
-				:key="cart.id"
-			>
-				<view class="pictrue">
-					<image :src="JSON.parse(cart.img)[0].url" class="image" />
-				</view>
-				<view class="text acea-row row-between">
-					<view class="name line2">{{ cart.productTitle }}</view>
-					<view class="money">
-						<view>
-							¥{{ cart.price }}
-						</view>
-						<view class="num">x{{ cart.num }}</view>
-					</view>
-				</view>
-			</view>
-			<view class="list">
-				<view v-if="serviceType === 1" class="item acea-row row-between-wrapper">
-					<view>退货件数</view>
-					<view class="num">{{ totalNum || 0  }}</view>
-				</view>
-				<view class="item acea-row row-between-wrapper">
-					<view>退款金额</view>
-					<view class="num">¥{{ totalMoney || 0 }}</view>
-				</view>
-				<picker :value="reason" :range="reasonList" @change="changeReason">
-					<view class="item acea-row row-between-wrapper">
-						<view>退款原因</view>
-						<view class="num">{{reason}}</view>
-						<text class="iconfont icon-jiantou"></text>
-					</view>
-				</picker>
-				<view class="item textarea acea-row row-between">
-					<view>备注说明</view>
-					<textarea class="num"
-						placeholder="填写备注信息,100字以内"
-						v-model="refund_reason_wap_explain"
-					></textarea>
-				</view>
-			</view>
-			<view v-if="serviceType === 0"
-				class="returnBnt bg-color-red"
-				@click="submit"
-			>申请退款</view>
-			<view v-if="serviceType === 1"
-				class="returnBnt bg-color-red"
-				@click="submit"
-			>申请退货</view>
-		</view>
-		<!-- 选择商品 -->
-		<view class="selectProduct" v-else>
-			<view class="selectContainer"
-				v-for="(cart, index) in selectProduct"
-				:key="cart.id"
-			>
-				<view class="checkbox-wrapper">
-				  <checkbox-group @change="switchSelect(index)">
-				    <label class="well-check">
-				      <checkbox color="#eb3729" value :checked="cart.checked"></checkbox>
-				    </label>
-				  </checkbox-group>
-				</view>
-				<view class="pictrue">
-					<image :src="JSON.parse(cart.img)[0].url" class="image" />
-				</view>
-				<view class="content">
-					<view class="title">{{ cart.productTitle || '' }}</view>
-					<view class="skus">
-						<view class="sku">
-							{{ cart.productAttrTitle || '' }}
-						</view>
-						<view class="num">x{{ cart.num || 0 }}</view>
-					</view>
-					<view class="money">
-						¥<view>
-							{{ cart.price	}}
-						</view>
-					</view>
-				</view>
-			</view>
-			<view class="choose">
-				<view class="checkTotal">
-					<checkbox-group @change="allChecked">
-					  <label class="well-check">
-					    <checkbox
-							color="#eb3729"
-							value="allSelect"
-							:checked="isAllSelect"
-						></checkbox>
-					    <text class="checkAll">全选 ({{ cartCount || 0 }})</text>
-					  </label>
-					</checkbox-group>
-					<view class="total">
-						<view class="proTotal">
-							{{ totalNum || 0 }}件商品
-						</view>
-						<view class="moneyTotal">
-							合计 ¥ {{ orderInfo.totalPrice || 0 }}
-						</view>
-					</view>
-				</view>
-				<view class="typeBtn">
-					<view class="button def" @click="chooseType(0)">仅退款</view>
-					<view class="button greenBtn" @click="chooseType(1)" v-if="orderInfo.status === 40 || orderInfo.status === 50">退货退款</view>
-				</view>
-			</view>
-		</view>
-	</view>
+  <view class="apply-return">
+    <!-- 申请售后 -->
+    <view class="container" v-if="selected">
+      <view class="goodsStyle acea-row row-between"
+            v-for="cart in selectProduct"
+            :key="cart.id"
+      >
+        <view class="pictrue">
+          <image :src="JSON.parse(cart.img)[0].url" class="image"/>
+        </view>
+        <view class="text acea-row row-between">
+          <view class="name line2">{{ cart.productTitle }}</view>
+          <view class="money">
+            <view>
+              ¥{{ cart.price }}
+            </view>
+            <view class="num">x{{ cart.num }}</view>
+          </view>
+        </view>
+      </view>
+      <view class="list">
+        <view v-if="serviceType === 1" class="item acea-row row-between-wrapper">
+          <view>退货件数</view>
+          <view class="num">{{ totalNum || 0 }}</view>
+        </view>
+        <view class="item acea-row row-between-wrapper">
+          <view>退款金额</view>
+          <view class="num currency-input-row">
+            <text class="currency-symbol">¥</text>
+            <input class="currency-input" type="number" v-model.number="totalMoney"
+                   placeholder="请输入退款金额" />
+          </view>
+        </view>
+        <picker :value="reason" :range="reasonList" @change="changeReason">
+          <view class="item acea-row row-between-wrapper">
+            <view>退款原因</view>
+            <view class="num">{{ reason }}</view>
+            <text class="iconfont icon-jiantou"></text>
+          </view>
+        </picker>
+        <view class="item textarea acea-row row-between">
+          <view>备注说明</view>
+          <textarea class="num"
+                    placeholder="填写备注信息,100字以内"
+                    v-model="refund_reason_wap_explain"
+          ></textarea>
+        </view>
+      </view>
+      <view v-if="serviceType === 0"
+            class="returnBnt bg-color-red"
+            @click="submit"
+      >申请退款
+      </view>
+      <view v-if="serviceType === 1"
+            class="returnBnt bg-color-red"
+            @click="submit"
+      >申请退货
+      </view>
+    </view>
+    <!-- 选择商品 -->
+    <view class="selectProduct" v-else>
+      <view class="selectContainer"
+            v-for="(cart, index) in selectProduct"
+            :key="cart.id"
+      >
+        <view class="checkbox-wrapper">
+          <checkbox-group @change="switchSelect(index)">
+            <label class="well-check">
+              <checkbox color="#eb3729" value :checked="cart.checked"></checkbox>
+            </label>
+          </checkbox-group>
+        </view>
+        <view class="pictrue">
+          <image :src="JSON.parse(cart.img)[0].url" class="image"/>
+        </view>
+        <view class="content">
+          <view class="title">{{ cart.productTitle || '' }}</view>
+          <view class="skus">
+            <view class="sku">
+              {{ cart.productAttrTitle || '' }}
+            </view>
+            <view class="num">x{{ cart.num || 0 }}</view>
+          </view>
+          <view class="money">
+            ¥
+            <view>
+              {{ cart.price }}
+            </view>
+          </view>
+        </view>
+      </view>
+      <view class="choose">
+        <view class="checkTotal">
+          <checkbox-group @change="allChecked">
+            <label class="well-check">
+              <checkbox
+                  color="#eb3729"
+                  value="allSelect"
+                  :checked="isAllSelect"
+              ></checkbox>
+              <text class="checkAll">全选 ({{ cartCount || 0 }})</text>
+            </label>
+          </checkbox-group>
+          <view class="total">
+            <view class="proTotal">
+              {{ totalNum || 0 }}件商品
+            </view>
+            <view class="moneyTotal">
+              合计 ¥ {{ orderInfo.totalPrice || 0 }}
+            </view>
+          </view>
+        </view>
+        <view class="typeBtn">
+          <view class="button def" @click="chooseType(0)">确认</view>
+        </view>
+      </view>
+    </view>
+  </view>
 </template>
 
 <script>
 
 export default {
-	name: "goodsReturn",
-	data() {
-		return {
-			id: 0,
-			selected: false,
-			orderInfo: {},
-			rebackList: [],
-      reasonList: ['收货地址填错了','与描述不符','信息填错了,重新拍','收到商品损坏了','未按预定时间发货','其它原因'],
-			reason: "",
-			refund_reason_wap_explain: '',
-			refund_reason_wap_img: [],
-			serviceType: null,
-			// 选中售后商品
-			selectProduct: [],
-			productParamList: [],
-			totalNum: 0,
-			totalMoney: 0,
-			isAllSelect: false
-		};
-	},
+  name: "goodsReturn",
+  data() {
+    return {
+      id: 0,
+      selected: false,
+      orderInfo: {},
+      rebackList: [],
+      reasonList: ['收货地址填错了', '与描述不符', '信息填错了,重新拍', '收到商品损坏了', '未按预定时间发货', '其它原因'],
+      reason: "",
+      refund_reason_wap_explain: '',
+      refund_reason_wap_img: [],
+      serviceType: null,
+      // 选中售后商品
+      selectProduct: [],
+      productParamList: [],
+      totalNum: 0,
+      totalMoney: 0,
+      isAllSelect: false,
+      cartCount: 0,
+    };
+  },
   onLoad(option) {
     const that = this
     uni.showLoading({
       title: '正在加载'
     })
-
+    
     that.$api.request('get', 'order/app/getOrderDetail', {
-      orderId : option.id
+      orderId: option.id
     }, failres => {
       uni.hideLoading()
       that.$api.msg(failres.msg)
@@ -158,239 +165,266 @@ export default {
         item.imgs = []
       })
     })
-
+    
   },
-	methods: {
-		changeReason(e) {
-			this.reason = this.reasonList[e.mp.detail.value];
-		},
-		imageuploaded(res) {
-			if (res.status !== 200) {
-				uni.showToast({
-					title: err.msg || err.response.data.msg|| err.response.data.message,
-					icon: 'none',
-					duration: 2000
-				});
-				return
-			}
-			this.refund_reason_wap_img.push(res.data.url);
-		},
-		getAfterSalesMoney() {
+  methods: {
+    changeReason(e) {
+      this.reason = this.reasonList[e.mp.detail.value];
+    },
+    imageuploaded(res) {
+      if (res.status !== 200) {
+        uni.showToast({
+          title: err.msg || err.response.data.msg || err.response.data.message,
+          icon: 'none',
+          duration: 2000
+        });
+        return
+      }
+      this.refund_reason_wap_img.push(res.data.url);
+    },
+    getAfterSalesMoney() {
       this.$api.request('post', 'order/app/storeAfterSales/getRefundAmount', {
-				orderCode: this.orderInfo.orderId,
-				productParamList: this.productParamList
-			}).then(res => {
-					this.totalMoney = res.data
-				}
-			)
-		},
-		getOrderDetail() {
-			uni.showLoading({
-				title: '正在查询商品',
-				duration: 2000,
-			})
-			orderDetail(this.id)
-				.then(res => {
-					this.orderInfo = res.data;
-					
-					this.selectProduct = res.data.cartInfo.map(item => {
-						item.checked = false
-						return item
-					})
-					if (res.data.cartInfo.length === 0) {
-						uni.showToast({
-							title: "订单无可售后商品",
-							icon: 'none',
-							duration: 2000
-						});
-						return
-					}
-					uni.hideLoading()
-				})
-				.catch(err => {
-					uni.hideLoading()
-					// uni.showToast({
-					// 	title: err.msg || err.response.data.msg|| err.response.data.message,
-					// 	icon: 'none',
-					// 	duration: 2000
-					// });
-				});
-		},
-		getRefundReason() {
-			getRefundReason().then(res => {
-				this.reasonList = res.data;
-			});
-		},
-		// 选择退款商品
-		switchSelect (index) {
-			let isAll = true
-			this.selectProduct[index].checked = !this.selectProduct[index].checked
-			this.selectProduct.forEach(item => {
-				if (!item.checked) {
-					isAll = false
-				}
-			})
-			this.isAllSelect = isAll
-		},
-		// 全选
-		allChecked () {
-			this.isAllSelect = !this.isAllSelect
-			this.selectProduct.forEach(item => {
-				item.checked = this.isAllSelect
-			})
-		},
-		// 选择退款类型
-		chooseType (val) {
-			
-			this.selectProduct = this.selectProduct.map(item => {
-				if (item.checked) {
-					this.productParamList.push({
-						productId: item.productId
-					})
-					return item
-				}
-			}).filter(r => r)
-			this.selected = true;
-			this.serviceType = val;
-			
-			this.getAfterSalesMoney();
-		},
-		submit() {
-			const refund_reason_wap_explain = this.refund_reason_wap_explain;
-			if (!this.reason) {
-				uni.showToast({
-					title: "请选择退款原因",
-					icon: 'none',
-					duration: 2000
-				});
-				return
-			}
+        orderCode: this.orderInfo.orderId,
+        productParamList: this.productParamList
+      }).then(res => {
+            this.totalMoney = res.data
+          }
+      )
+    },
+    getOrderDetail() {
+      uni.showLoading({
+        title: '正在查询商品',
+        duration: 2000,
+      })
+      orderDetail(this.id)
+          .then(res => {
+            this.orderInfo = res.data;
+            
+            this.selectProduct = res.data.cartInfo.map(item => {
+              item.checked = false
+              return item
+            })
+            if (res.data.cartInfo.length === 0) {
+              uni.showToast({
+                title: "订单无可售后商品",
+                icon: 'none',
+                duration: 2000
+              });
+              return
+            }
+            uni.hideLoading()
+          })
+          .catch(err => {
+            uni.hideLoading()
+            // uni.showToast({
+            // 	title: err.msg || err.response.data.msg|| err.response.data.message,
+            // 	icon: 'none',
+            // 	duration: 2000
+            // });
+          });
+    },
+    getRefundReason() {
+      getRefundReason().then(res => {
+        this.reasonList = res.data;
+      });
+    },
+    // 选择退款商品
+    switchSelect(index) {
+      let isAll = true
+      this.selectProduct[index].checked = !this.selectProduct[index].checked
+      this.selectProduct.forEach(item => {
+        if (!item.checked) {
+          isAll = false
+        }
+      })
+      this.isAllSelect = isAll
+      
+      this.cartCount = this.selectProduct.filter(item => item.checked).length
+    },
+    // 全选
+    allChecked() {
+      this.isAllSelect = !this.isAllSelect
+      this.selectProduct.forEach(item => {
+        item.checked = this.isAllSelect
+      })
+      
+      this.cartCount = this.selectProduct.filter(item => item.checked).length
+    },
+    // 选择退款类型
+    chooseType(val) {
+      if (!this.cartCount) {
+        uni.showToast({
+          title: "请至少选择一个商品",
+          icon: 'none',
+          duration: 2000
+        });
+      } else {
+        this.selectProduct = this.selectProduct.map(item => {
+          if (item.checked) {
+            this.productParamList.push({
+              productId: item.productId
+            })
+            return item
+          }
+        }).filter(r => r)
+        this.selected = true;
+        this.serviceType = val;
+        
+        this.getAfterSalesMoney();
+      }
+    },
+    submit() {
+      const refund_reason_wap_explain = this.refund_reason_wap_explain;
+      if (!this.reason) {
+        uni.showToast({
+          title: "请选择退款原因",
+          icon: 'none',
+          duration: 2000
+        });
+        return
+      }
       this.$api.request('post', 'order/app/storeAfterSales/applyForAfterSales', {
-				orderCode: this.orderInfo.orderId,
-				serviceType: this.serviceType,
-				reasonForApplication: this.reason,
-				applicationInstructions: refund_reason_wap_explain,
-				applicationDescriptionPicture: this.refund_reason_wap_img.join(","),
-				productParamList: this.productParamList
-			}).then(res => {
-				if (res.code === 200) {
-					uni.showToast({
-						title: res.msg,
-						icon: "success",
-						duration: 2000
-					});
-					setTimeout(() => {
+        orderCode: this.orderInfo.orderId,
+        serviceType: this.serviceType,
+        reasonForApplication: this.reason,
+        applicationInstructions: refund_reason_wap_explain,
+        applicationDescriptionPicture: this.refund_reason_wap_img.join(","),
+        productParamList: this.productParamList
+      }).then(res => {
+        if (res.code === 200) {
+          uni.showToast({
+            title: res.msg,
+            icon: "success",
+            duration: 2000
+          });
+          setTimeout(() => {
             uni.navigateTo({
               url: "/pages/refund/index"
             })
-					}, 1500)
-				}
-			})
-			.catch(err => {
-				uni.showToast({
-					title: err.msg || err.response.data.msg|| err.response.data.message,
-					icon: 'none',
-					duration: 2000
-				});
-			});
-		}
-	}
+          }, 1500)
+        }
+      })
+          .catch(err => {
+            uni.showToast({
+              title: err.msg || err.response.data.msg || err.response.data.message,
+              icon: 'none',
+              duration: 2000
+            });
+          });
+    }
+  }
 };
 </script>
 
 <style lang="scss" scoped>
-.apply-return{
-	.selectProduct{
-		margin-bottom: 180rpx;
-		.selectContainer{
-			padding: 20rpx 32rpx;
-			background-color: #FFF;
-			display: flex;
-			align-items: center;
-			.pictrue{
-				.image{
-					width: 180rpx;
-					height: 180rpx;
-				}
-			}
-			.content{
-				width: 100%;
-				height: 100%;
-				margin-left: 16rpx;
-				font-size: 24rpx;
-				display: flex;
-				flex-direction: column;
-				justify-content: space-between;
-				.title{
-					width: 100%;
-					height: 80rpx;
-					text-overflow: ellipsis;
-					font-size: 28rpx;
-				}
-				.skus{
-					display: flex;
-					justify-content: space-between;
-					color: #999999;
-				}
-				.money{
-					margin-top: 10rpx;
-					display: flex;
-					view{
-						color: #EB3729;
-					}
-				}
-			}
-		}
-		.choose{
-			width: 100%;
-			padding: 20rpx 30rpx;
-			background-color: #FFF;
-			position: fixed;
-			bottom: 0;
-			height: 180rpx;
-			.checkTotal{
-				height: 80rpx;
-				font-size: 28rpx;
-				border-bottom: 2rpx solid #F3F4F5;
-				display: flex;
-				justify-content: space-between;
-				align-items: center;
-				.total{
-					display: flex;
-					.proTotal{
-						color: #666;
-					}
-					.moneyTotal{
-						color: #333;
-						margin-left: 30rpx;
-					}
-				}
-			}
-			.typeBtn{
-				margin-top: 10rpx;
-				display: flex;
-				justify-content: flex-end;
-				align-items: center;
-				.button{
-					width: 160rpx;
-					height: 60rpx;
-					margin: 0 10rpx;
-					line-height: 60rpx;
-					text-align: center;
-					font-size: 24rpx;
-					border-radius: 180rpx;
-				}
-				.def{
-					color: #AAAAAA;
-					border: 2rpx solid #DDDDDD;
-				}
-				.greenBtn{
-					color: #FFF;
-					background-color: #EB3729;
-				}
-			}
-		}
-	}
+.apply-return {
+  .selectProduct {
+    margin-bottom: 180rpx;
+    
+    .selectContainer {
+      padding: 20rpx 32rpx;
+      background-color: #FFF;
+      display: flex;
+      align-items: center;
+      
+      .pictrue {
+        .image {
+          width: 180rpx;
+          height: 180rpx;
+        }
+      }
+      
+      .content {
+        width: 100%;
+        height: 100%;
+        margin-left: 16rpx;
+        font-size: 24rpx;
+        display: flex;
+        flex-direction: column;
+        justify-content: space-between;
+        
+        .title {
+          width: 100%;
+          height: 80rpx;
+          text-overflow: ellipsis;
+          font-size: 28rpx;
+        }
+        
+        .skus {
+          display: flex;
+          justify-content: space-between;
+          color: #999999;
+        }
+        
+        .money {
+          margin-top: 10rpx;
+          display: flex;
+          
+          view {
+            color: #EB3729;
+          }
+        }
+      }
+    }
+    
+    .choose {
+      width: 100%;
+      padding: 20rpx 30rpx;
+      background-color: #FFF;
+      position: fixed;
+      bottom: 0;
+      height: 180rpx;
+      
+      .checkTotal {
+        height: 80rpx;
+        font-size: 28rpx;
+        border-bottom: 2rpx solid #F3F4F5;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        
+        .total {
+          display: flex;
+          
+          .proTotal {
+            color: #666;
+          }
+          
+          .moneyTotal {
+            color: #333;
+            margin-left: 30rpx;
+          }
+        }
+      }
+      
+      .typeBtn {
+        margin-top: 10rpx;
+        display: flex;
+        justify-content: flex-end;
+        align-items: center;
+        
+        .button {
+          width: 160rpx;
+          height: 60rpx;
+          margin: 0 10rpx;
+          line-height: 60rpx;
+          text-align: center;
+          font-size: 24rpx;
+          border-radius: 180rpx;
+        }
+        
+        .def {
+          color: #AAAAAA;
+          border: 2rpx solid #DDDDDD;
+        }
+        
+        .greenBtn {
+          color: #FFF;
+          background-color: #EB3729;
+        }
+      }
+    }
+  }
 }
 
 /**/
@@ -428,12 +462,14 @@ export default {
 .goodsStyle .text .money .num {
   margin-top: 0.07 * 100rpx;
 }
+
 /* layout */
 .acea-row {
   display: flex;
   flex-wrap: wrap;
   /* 辅助类 */
 }
+
 .acea-row.row-between {
   justify-content: space-between;
 }
@@ -561,4 +597,27 @@ export default {
 .bg-color-red {
   background-color: #eb3729 !important;
 }
+
+.currency-input-row {
+  display: flex;
+  align-items: center;
+  width: 100%;
+  max-width: 400px;
+  justify-content: flex-end; /* 内容靠右 */
+}
+
+.currency-symbol {
+  border-radius: 6px;
+  margin-right: 10px;
+}
+
+.currency-input {
+  border: 1px solid #ddd;
+  border-radius: 6px;
+  font-size: 1rem;
+  width: 150px;
+  text-align: center; /* 输入值居中 */
+  transition: border-color 0.3s;
+}
+
 </style>

+ 1 - 1
kxmall-rider-ui/pages/review/review-list.vue

@@ -178,7 +178,7 @@
 				this.request("get", "rider/review/stats", this.token).then(res => {
 					if (res.code === 200) {
 						this.totalReviews = res.data.totalReviews || 0;
-						this.averageRating = (res.data.averageRating || 0).toFixed(1);
+						this.averageRating = (res.data.averageRating || 0);
 					}
 				});
 			},