Bläddra i källkod

Merge branch 'dev_v3_zb' of http://git.dgtis.com/armg/wxapp_shuibei into dev_v3

HHE-5476 3 veckor sedan
förälder
incheckning
5f22b7031d

+ 10 - 10
components/CategorySelector/index.vue

@@ -34,7 +34,7 @@
       >
         <text class="category-name">{{ child.name }}</text>
         <view class="checkbox">
-          <text v-if="selectedSecondLevel.includes(child.id)" class="checked">✓</text>
+          <text v-if="selectedSecondLevel.includes(String(child.id))" class="checked">✓</text>
           <text v-else class="unchecked">○</text>
         </view>
       </view>
@@ -184,7 +184,7 @@ const setSelectedState = (ids) => {
     // 先查找二级分类
     for (const parent of props.categoryList) {
       if (parent.child) {
-        const child = parent.child.find(c => String(c.id) === id)
+        const child = parent.child.find(c => String(c.id) == id)
         if (child) {
           if (!selectedSecondLevel.value.includes(id)) {
             selectedSecondLevel.value.push(id)
@@ -194,20 +194,20 @@ const setSelectedState = (ids) => {
         }
       }
     }
-
+	console.log("found",found,id)
     // 如果没有找到对应的二级分类,检查是否是一级分类
     if (!found) {
-      const firstLevel = props.categoryList.find(item => String(item.id) === id)
+      const firstLevel = props.categoryList.find(item => String(item.id) == id)
       if (firstLevel) {
         // 如果是一级分类,检查是否有子分类
         if (firstLevel.child && firstLevel.child.length > 0) {
           // 有子分类的一级分类:选中所有子分类
-          firstLevel.child.forEach(child => {
-            const childId = String(child.id)
-            if (!selectedSecondLevel.value.includes(childId)) {
-              selectedSecondLevel.value.push(childId)
-            }
-          })
+          // firstLevel.child.forEach(child => {
+          //   const childId = String(child.id)
+          //   if (!selectedSecondLevel.value.includes(childId)) {
+          //     selectedSecondLevel.value.push(childId)
+          //   }
+          // })
         } else {
           // 没有子分类的一级分类:直接选中
           if (!selectedSecondLevel.value.includes(id)) {

+ 7 - 2
components/addressWindow/index.vue

@@ -11,12 +11,12 @@
 				<view class='item' :class='active == index ? "active" : ""'
 					v-for="(item, index) in addressList" @tap='tapAddress(index, item.id)' :key='index'>
 					<view class='address'>
-						<view class='address-t'>{{ item.province }}{{ item.city }}{{ item.district }}{{ item.detail }}</view>
+						<view class='address-t'><text>{{ item.province }}{{ item.city }}{{ item.district }}{{ item.detail }}</text><view v-if="item.isDefault" class="default">默认</view></view>
 						<view class='name'>{{ item.realName }}<text class='phone'>{{
 							item.phone }}</text></view>
 						
 					</view>
-					<view v-if="active == index" class="default">默认</view>
+					
 				</view>
 			</view>
 			<!-- 无地址 -->
@@ -186,6 +186,7 @@ function fetchAddressList() {
 	border-radius: 8rpx;
 	text-align: center;
 	line-height: 40rpx;
+	flex-shrink: 0;
 }
 
 .address-window .list .item .address .name {
@@ -200,6 +201,10 @@ function fetchAddressList() {
 }
 .address-t {
 	font-weight: bold;
+	display: flex;
+	justify-content: space-between;
+	align-items: start;
+	flex-wrap: nowrap;
 }
 .addressBnt-btn {
 	padding: 22rpx 32rpx;

+ 43 - 0
components/uni-empty-view/uni-empty-view.vue

@@ -0,0 +1,43 @@
+<template>
+	<view class="empty">
+		<image src="/static/images/empty@2x.png" mode=""></image>
+		<view class="">{{ text }}</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name:"uni-empty-view",
+		props:{
+			text:{
+				type:String,
+				default:'暂无数据'
+			}
+		},
+		data() {
+			return {
+				
+			};
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+.empty {
+	padding: 50rpx 0;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	flex-direction: column;
+	image {
+		width: 440rpx;
+		height: 401rpx;
+		margin-bottom: 32rpx;
+	}
+	view {
+		color: #333333;
+		font-size: 32rpx;
+		line-height: 1;
+	}
+}
+</style>

+ 1 - 1
manifest.json

@@ -1,6 +1,6 @@
 {
     "name" : "wxapp-shuibei",
-    "appid" : "__UNI__5EF0BA0",
+    "appid" : "__UNI__B79C3A2",
     "description" : "",
     "versionName" : "1.0.0",
     "versionCode" : "100",

+ 11 - 3
pages.json

@@ -64,7 +64,7 @@
       "path": "pages/order_list/index",
       "style": {
         "navigationBarTitleText": "我的订单",
-        "navigationBarBackgroundColor": "#ffe079",
+        "navigationBarBackgroundColor": "#ffffff",
         "navigationBarTextStyle": "black"
       }
     },
@@ -72,7 +72,7 @@
       "path": "pages/order_details/index",
       "style": {
         "navigationBarTitleText": "订单详情",
-        "navigationBarBackgroundColor": "#ffe079",
+        "navigationBarBackgroundColor": "#ffffff",
         "navigationBarTextStyle": "black",
         "app-plus": {
           // #ifdef APP-PLUS
@@ -329,7 +329,15 @@
             "navigationBarBackgroundColor": "#ffffff",
             "navigationBarTextStyle": "black"
           }
-        }
+		},
+		{
+			"path": "productCate/productCate",
+			"style": {
+				"navigationBarTitleText": "添加规格",
+				"navigationBarBackgroundColor": "#ffffff",
+				"navigationBarTextStyle": "black"
+			}
+		}
       ]
     },
     {

+ 17 - 8
pages/goods/goods_details/index.vue

@@ -631,6 +631,8 @@
 
 	const ChangeAttr = (res) => {
 		const productSelect = productValue.value[res];
+		console.log(res,productSelect);
+		if(!productSelect && !productSelect?.id) return
 		if (productSelect) {
 			attr.value.productSelect = {
 				...attr.value.productSelect,
@@ -740,13 +742,19 @@
 		let value = [];
 
 		const allKeys = Object.keys(productValue.value);
+		let keys = [...allKeys]
+		try {
+			keys = [...allKeys].sort((a, b) => {
+				// 提取完整的数字(包括小数)
+				const numA = parseFloat(a.match(/\d+(\.\d+)?/)[0]);
+				const numB = parseFloat(b.match(/\d+(\.\d+)?/)[0]);
+				return numA - numB; // 从小到大排序
+			});
+		} catch (error) {
+			//TODO handle the exception
+		}
 		// 手动排序:按数字部分从小到大排序
-		const keys = [...allKeys].sort((a, b) => {
-			// 提取完整的数字(包括小数)
-			const numA = parseFloat(a.match(/\d+(\.\d+)?/)[0]);
-			const numB = parseFloat(b.match(/\d+(\.\d+)?/)[0]);
-			return numA - numB; // 从小到大排序
-		});
+		
 
 		for (let i = 0; i < keys.length; i++) {
 			const key = keys[i];
@@ -761,10 +769,11 @@
 		if (value.length == 0) {
 			value = [keys[0]]
 		}
-
+		const vlist = value[0].split(',');
 		attr.value.productAttr.forEach((item, i) => {
-			item.index = value[i];
+			item.index = vlist[i];
 		});
+			console.log("attr.value.productAttr",attr.value.productAttr)
 
 		const productSelect = productValue.value[value.join(",")];
 

+ 1 - 1
pages/index/index.vue

@@ -2,7 +2,7 @@
 	<view class="page-container">
 		<up-navbar class="inde-nav-bar" :bgColor="navBgColor">
 			<template #left>
-				<view class="nav-slot" v-if="!merchantNameShow()" @click="toBrowsingHistory()">
+				<view class="nav-slot" v-if="!merchantNameShow() && !!merchantInfo.merchantName" @click="toBrowsingHistory()">
 					<image class="dianpu" src="@/static/images/dianpu.png" mode="widthFix"></image>
 					<view class="storeName line1">{{ merchantInfo.merchantName }}</view>
 					<image class="zhankai" src="@/static/images/zhankai.png" mode="widthFix"></image>

+ 14 - 1
pages/merchantCenter/index.vue

@@ -2,7 +2,12 @@
 	<view class="container">
 		<up-navbar class="inde-nav-bar" :bgColor="navBgColor">
 			<template #left>
-				<view></view>
+				<view class="back_extend" @click="handleFunctionClick('/pages/index/index','我的商城')">
+					<uni-icons type="left" size="22" color="#333"></uni-icons>
+					 <view class="">
+					 	返回商城
+					 </view>
+				</view>
 			</template>
 			<template #center>
 				<view class="page-title">门店主页</view>
@@ -412,6 +417,14 @@
 </script>
 
 <style scoped lang="scss">
+	
+	.back_extend{
+		display: flex;
+		justify-content: flex-start;
+		align-items: center;
+		color: #333;
+		font-size: 28rpx;
+	}
 	.container {
 		background-color: #f5f5f5;
 		min-height: 100vh;

+ 1 - 0
pages/merchantCenters/postInformation.vue

@@ -136,6 +136,7 @@ const handleTemplatePublish = () => {
 .publish-button {
   background: #F8C008;
   border: none;
+  font-weight: bold;
   border-radius: 16rpx;
   color: #333333;
   font-size: 32rpx;

+ 441 - 0
pages/merchantCenters/productCate/productCate.vue

@@ -0,0 +1,441 @@
+<template>
+	<view class="container">
+		<view class="main-title">
+			<view class="tit">
+				规格类型
+			</view>
+			<view class="cate-add" @click="addAttr">
+				新增
+			</view>
+		</view>
+
+		<view class="cate-list">
+			<view class="cate-item" v-for="(item,index) in attr" :key="index">
+				<view class="cate-header">
+					<view class="cate-name">
+						<image class="pen" src="@/static/images/edit-pen.png"></image>
+						<up-input class="cate-name-ipt" v-model="item.attrName" placeholder="请输入规格类型" inputAlign="left"
+							border="none" type="text">
+						</up-input>
+					</view>
+					<view class="delete-icon" @click="deleteAttr(index)">
+						<image class="delete" src="/static/images/delete.png"></image>
+					</view>
+				</view>
+
+				<view class="cate-child">
+					<view class="children">
+						<view class="children-item" v-for="(child,idx) in item.attrValue" :key="'c'+idx">
+							<view class="cname">
+								{{child}}
+							</view>
+							<image class="close" @click="deleteSub(index,idx)" src="@/static/images/close-icon.png"
+								mode=""></image>
+						</view>
+					</view>
+					<view class="cate-child-add" @click="addSub(index)">
+						<image class="plus" src="@/static/images/plus-icon.png" mode=""></image>
+						<view class="add">
+							添加规格项
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="bottom-actions">
+			<view class="action-btn" @click="throttle(ensureClickHandle,500)"> 确定 </view>
+		</view>
+
+		<up-popup :show="showPopUp" :round="20" :duration="150" mode="bottom" @close="showPopUp=false"
+			@open="showPopUp=true">
+			<view class="pop-container">
+				<view class="pop-header">
+					规格类型
+					<image class="pop-close" src="/static/images/close-icon.png" mode="" @click="showPopUp=false">
+					</image>
+				</view>
+				<view class="pop-ipt">
+					<textarea class="item-textarea" @confirm="ensureAttrHandle" maxlength="100" :focus="iptFocus"
+						v-model="cipt" placeholder="请输入规格类型" />
+				</view>
+				<view class="action-btn" @click="ensureAttrHandle"> 确定 </view>
+			</view>
+		</up-popup>
+	</view>
+</template>
+
+<script setup>
+	import {
+		ref,
+		computed,
+		watch,
+		nextTick
+	} from 'vue';
+	import {
+		onShow,
+		onLoad,
+		onBackPress
+	} from "@dcloudio/uni-app";
+	import {
+		productCategory,
+		productSave,
+		productUpdate,
+		templatesList,
+		productInfo
+	} from "@/api/merchant";
+	import CategorySelector from '@/components/CategorySelector';
+	import {
+		useAppStore
+	} from "@/stores/app";
+	import {
+		useImageUpload
+	} from "@/hooks/useImageUpload";
+	import {
+		useToast
+	} from "@/hooks/useToast";
+	import {
+		debounce,
+		throttle
+	} from '../../../uni_modules/uview-plus';
+	const {
+		Toast
+	} = useToast();
+	const appStore = useAppStore();
+
+	const cateDemo = {
+		"id": 1586,
+		"productId": 729,
+		"attrName": "圈号",
+		"attrValues": "56mm,68mm,78mm",
+		"type": 0,
+		"isDel": false
+	}
+	const attr = ref([])
+
+	const showPopUp = ref(false)
+
+	const cipt = ref('')
+	const cIndex = ref();
+	const cSubIndex = ref()
+	const iptFocus = ref(false)
+
+	// 当前变更类型,0代表规格值,1代表规格子值
+	const cType = ref(0)
+
+	const ensureClickHandle = () => {
+		console.log("ensure")
+
+		let flag = true;
+
+		if (!attr.value || attr.value.length <= 0) {
+			return Toast({
+				title: "规格不能为空"
+			})
+		}
+
+		attr.value.forEach(item => {
+			if (!item.attrName) {
+				flag = false
+				return Toast({
+					title: "规格名称不能为空"
+				})
+			}
+			if (item.attrValue && item.attrValue.length > 0) {
+				item.attrValue.forEach(child => {
+					if (!child) {
+						flag = false
+						return Toast({
+							title: "规格子集名称不能为空"
+						})
+					}
+				})
+			} else {
+				flag = false
+				return Toast({
+					title: "规格子集不能为空"
+				})
+			}
+		})
+		if (!flag) return
+		appStore.SET_CPATTR(attr.value)
+		uni.$emit("updateAttr", attr.value)
+		setTimeout(() => {
+			uni.navigateBack()
+		},300)
+	}
+
+	onLoad(() => {
+		const data = appStore.cProductAttr;
+		attr.value = data.concat();
+	})
+
+	throttle()
+
+	// 添加规格
+	const addAttr = () => {
+		attr.value.push({
+			attrName: '',
+			attrValue: []
+		})
+		cType.value = 0;
+		cIndex.value = attr.value.length - 1
+		cipt.value = '';
+		showPopUp.value = true;
+
+		setTimeout(() => {
+			iptFocus.value = true
+		}, 500)
+	}
+
+	// 删除规格
+	const deleteAttr = (index) => {
+		attr.value.splice(index, 1)
+	}
+
+	// 删除规格子项值
+	const deleteSub = (index, idx) => {
+		attr.value[index].attrValue.splice(idx, 1)
+	}
+
+	// 新增规格子项值
+	const addSub = (index) => {
+		cType.value = 1;
+		cIndex.value = index
+		cipt.value = '';
+		showPopUp.value = true;
+		setTimeout(() => {
+			iptFocus.value = true
+		}, 500)
+	}
+
+	const ensureAttrHandle = () => {
+
+		if (!cipt.value || !cipt.value.trim()) {
+			return Toast({
+				title: "请输入规格值"
+			});
+		}
+		if (cType.value == 0) {
+			attr.value[cIndex.value].attrName = cipt.value.trim()
+		} else {
+			attr.value[cIndex.value].attrValue.push(
+				cipt.value.trim()
+			)
+		}
+		iptFocus.value = false
+		console.log(attr.value)
+		showPopUp.value = false;
+	}
+</script>
+
+<style scoped lang="scss">
+	page {
+		background-color: #f9f7f0;
+		height: 100%;
+	}
+
+	.container {
+		padding: 16rpx;
+		background-color: #f9f7f0;
+		padding-bottom: calc(132rpx + constant(safe-area-inset-bottom));
+		padding-bottom: calc(132rpx + env(safe-area-inset-bottom));
+
+		.main-title {
+			width: 100%;
+			height: 48rpx;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			margin-bottom: 16rpx;
+
+			.tit {
+				font-size: 32rpx;
+				color: #333;
+				font-weight: bold;
+			}
+
+			.cate-add {
+				padding: 16rpx 0 16rpx 16rpx;
+				font-size: 28rpx;
+				color: #F8C008;
+				font-weight: bold;
+			}
+		}
+	}
+
+	.cate-list {
+
+
+		.cate-item {
+			width: 100%;
+			padding: 20rpx;
+			background-color: #fff;
+			border-radius: 16rpx;
+			margin-bottom: 20rpx;
+
+			.cate-header {
+				width: 100%;
+				height: 64rpx;
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				border-bottom: 1px solid #F1F3F8;
+				padding-bottom: 20rpx;
+
+				.cate-name {
+					display: flex;
+					justify-content: flex-start;
+					align-items: center;
+
+					.pen {
+						width: 32rpx;
+						height: 32rpx;
+						margin-right: 16rpx;
+					}
+
+					.cate-name-ipt {
+						height: 44rpx;
+						line-height: 44rpx;
+						font-size: 28rpx;
+						color: #333;
+					}
+				}
+
+				.delete-icon {
+					padding: 10rpx 0 10rpx 10rpx;
+					display: flex;
+					justify-content: center;
+					align-items: center;
+
+					.delete {
+						width: 32rpx;
+						height: 32rpx;
+					}
+				}
+			}
+
+			.children {
+				width: 100%;
+				display: flex;
+				margin-top: 20rpx;
+				justify-content: flex-start;
+				align-items: center;
+				flex-wrap: wrap;
+			}
+
+			.children-item {
+				min-width: 120rpx;
+				padding: 8rpx 16rpx;
+				border-radius: 8rpx;
+				margin-right: 20rpx;
+				margin-bottom: 20rpx;
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				background-color: #F9F7F0;
+
+				.cname {
+					font-size: 28rpx;
+					color: #333;
+					margin-right: 16rpx;
+					line-height: 44rpx;
+				}
+
+				.close {
+					width: 32rpx;
+					height: 32rpx;
+				}
+			}
+
+			.cate-child-add {
+				padding: 8rpx 16rpx;
+				width: 220rpx;
+				background-color: rgba(248, 192, 8, 0.10);
+				border-radius: 8rpx;
+				display: flex;
+				justify-content: flex-start;
+				align-items: center;
+
+				.add {
+					font-size: 28rpx;
+					line-height: 44rpx;
+					color: #F8C008;
+				}
+
+				.plus {
+					width: 32rpx;
+					height: 32rpx;
+					margin-right: 16rpx;
+				}
+			}
+		}
+	}
+
+	.bottom-actions {
+		position: fixed;
+		bottom: 0;
+		left: 0;
+		right: 0;
+		width: 100%;
+		z-index: 8;
+		background: #FFFFFF;
+		padding: 22rpx 32rpx calc(22rpx + constant(safe-area-inset-bottom));
+		padding: 22rpx 32rpx calc(22rpx + env(safe-area-inset-bottom));
+
+
+	}
+
+	.action-btn {
+		font-weight: bold;
+		line-height: 88rpx;
+		text-align: center;
+		border-radius: 16rpx;
+		font-size: 32rpx;
+		font-weight: bold;
+		background: #F8C008;
+	}
+
+	.pop-container {
+		background-color: #fff;
+		border-radius: 40rpx 40rpx 0 0;
+		position: relative;
+		padding: 22rpx 32rpx calc(22rpx + constant(safe-area-inset-bottom));
+		padding: 22rpx 32rpx calc(22rpx + env(safe-area-inset-bottom));
+
+		.pop-header {
+			height: 44rpx;
+			width: 100%;
+			text-align: center;
+			line-height: 48rpx;
+			font-size: 32rpx;
+			color: #333;
+			font-weight: bold;
+
+			.pop-close {
+				width: 32rpx;
+				height: 32rpx;
+				position: absolute;
+				right: 32rpx;
+				top: 32rpx;
+			}
+		}
+
+		.pop-ipt {
+			width: 100%;
+			display: flex;
+			background-color: #F9F7F0;
+			border-radius: 16rpx;
+			margin-top: 32rpx;
+			margin-bottom: 32rpx;
+		}
+
+	}
+
+	.item-textarea {
+		width: 100rpx;
+		height: 200rpx;
+		padding: 16rpx;
+		flex: 1;
+		text-align: left;
+	}
+</style>

+ 0 - 1
pages/merchantCenters/productCenter.vue

@@ -10,7 +10,6 @@
               v-model="searchVal"
               placeholder="请输入搜索内容"
               placeholder-class="placeholder"
-              @input="onSearch"
               @confirm="onSearch"
               :focus="isFocus"
           />

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1677 - 1346
pages/merchantCenters/releaseProduct.vue


+ 977 - 0
pages/order_details/bf.vue

@@ -0,0 +1,977 @@
+<template>
+  <view>
+    <view class="order-details">
+      <!-- 给header上与data上加on为退款订单-->
+      <view class="header" :class="isGoodsReturn ? 'on' : ''">
+        <view class="picTxt acea-row row-middle">
+          <!-- <view class="pictrue" v-if="isGoodsReturn == false">
+            <image :src="orderInfo.statusPic"></image>
+          </view> -->
+          <view class="data" :class="isGoodsReturn ? 'on' : ''">
+            <view class="state">{{ orderInfo.orderStatusMsg }}</view>
+            <view>{{ orderInfo.createTime }}</view>
+          </view>
+        </view>
+      </view>
+
+      <view v-if="!isGoodsReturn" class="pad30">
+        <view class="nav">
+          <uni-steps
+            :active="curOrderStep"
+            :options="orderSteps"
+            activeColor="#e9c279"
+          ></uni-steps>
+        </view>
+        <view
+          v-if="orderInfo.shippingType == 2 && orderInfo.paid"
+          class="writeOff borRadius14"
+        >
+          <view class="title">核销信息</view>
+          <view class="grayBg">
+            <view class="pictrue">
+              <!-- <div class="qrcode" ref="qrcode"></div> -->
+              <!-- <canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}100%`, height: `${qrcodeSize}100%`}"/> -->
+              <image :src="codeImg"></image>
+            </view>
+          </view>
+          <view class="gear">
+            <image src="../../static/images/writeOff.jpg"></image>
+          </view>
+          <view class="num">{{ orderInfo.verifyCode }}</view>
+          <view class="rules" v-if="orderInfo.systemStore">
+            <view class="item">
+              <view class="rulesTitle acea-row row-middle">
+                <text class="iconfont icon-shijian"></text>核销时间
+              </view>
+              <view class="info">
+                每日:<text class="time">{{
+                  orderInfo.systemStore.dayTime.replace(",", "-")
+                }}</text>
+              </view>
+            </view>
+            <view class="item">
+              <view class="rulesTitle acea-row row-middle">
+                <text class="iconfont icon-shuoming1"></text>使用说明
+              </view>
+              <view class="info">可将二维码出示给店员扫描或提供数字核销码</view>
+            </view>
+          </view>
+        </view>
+        <view v-if="orderInfo.shippingType === 1" class="address borRadius14">
+          <view class="name"
+            >{{ orderInfo.realName
+            }}<text class="phone">{{ orderInfo.userPhone }}</text></view
+          >
+          <view>{{ orderInfo.userAddress }}</view>
+        </view>
+        <view v-else class="address" style="margin-top: 15rpx">
+          <view class="name" @tap="makePhone"
+            >{{ orderInfo.systemStore ? orderInfo.systemStore.name : ""
+            }}<text class="phone">{{
+              orderInfo.systemStore ? orderInfo.systemStore.phone : ""
+            }}</text
+            ><text class="iconfont icon-tonghua font-color"></text
+          ></view>
+          <view>{{
+            orderInfo.systemStore ? orderInfo.systemStore.detailedAddress : ""
+          }}</view>
+        </view>
+
+        <orderGoods
+          :mallType="orderInfo.mallType"
+          :evaluate="evaluate"
+          :productType="orderInfo.type"
+          :orderId="order_id"
+          :ids="id"
+          :uniId="uniId"
+          :cartInfo="cartInfo"
+          :sbMerchant="sbMerchant"
+          :jump="true"
+        ></orderGoods>
+        <!-- <div class="goodCall borRadius14" @click="kefuClick">
+          <span class="iconfont icon-kefu"></span><span>联系客服</span>
+        </div> -->
+      </view>
+
+      <view class="pad30">
+        <view class="nav refund" v-if="orderInfo.refundStatus > 0">
+          <view class="title">
+            <image src="/static/images/shuoming.png" mode=""></image>
+            {{ getRefundStatus() }}
+          </view>
+          <view class="con pad30">{{ getRefundReason() }}</view>
+        </view>
+        <view class="wrapper borRadius14">
+          <view class="item acea-row row-between">
+            <view>订单编号:</view>
+            <view class="conter acea-row row-middle row-right"
+              >{{ orderInfo.orderId }}
+              <!-- #ifndef H5 -->
+              <text class="copy" @tap="copy">复制</text>
+              <!-- #endif -->
+              <!-- #ifdef H5 -->
+              <text class="copy copy-data" @click="setOrderId">复制</text>
+              <!-- #endif -->
+            </view>
+          </view>
+          <view class="item acea-row row-between">
+            <view>下单时间:</view>
+            <view class="conter">{{ orderInfo.createTime || 0 }}</view>
+          </view>
+          <view class="item acea-row row-between">
+            <view>支付状态:</view>
+            <view class="conter" v-if="orderInfo.paid">已支付</view>
+            <view class="conter" v-else>未支付</view>
+          </view>
+          <view class="item acea-row row-between">
+            <view>支付方式:</view>
+            <view class="conter" v-if="orderInfo.mallType === 0">{{
+              orderInfo.payTypeStr
+            }}</view>
+            <view class="conter" v-else>贝币</view>
+          </view>
+          <view class="item acea-row row-between" v-if="orderInfo.mark">
+            <view>买家留言:</view>
+            <view class="conter">{{ orderInfo.mark }}</view>
+          </view>
+        </view>
+        <!-- 退款订单详情 "-->
+        <view v-if="isGoodsReturn" class="wrapper borRadius14">
+          <view class="item acea-row row-between">
+            <view>收货人:</view>
+            <view class="conter">{{ orderInfo.realName }}</view>
+          </view>
+          <view class="item acea-row row-between">
+            <view>联系电话:</view>
+            <view class="conter">{{ orderInfo.userPhone }}</view>
+          </view>
+          <view class="item acea-row row-between">
+            <view>收货地址:</view>
+            <view class="conter">{{ orderInfo.userAddress }}</view>
+          </view>
+          <view class="item acea-row row-between">
+            <view>退款快递单号:</view>
+            <view class="conter">{{ orderInfo.refundExpressNum }}</view>
+          </view>
+        </view>
+        <view v-if="orderInfo.status > 0">
+          <view
+            class="wrapper borRadius14"
+            v-if="orderInfo.deliveryType == 'express'"
+          >
+            <view class="item acea-row row-between">
+              <view>配送方式:</view>
+              <view class="conter">发货</view>
+            </view>
+            <view class="item acea-row row-between">
+              <view>快递公司:</view>
+              <view class="conter">{{ orderInfo.deliveryName || "" }}</view>
+            </view>
+            <view class="item acea-row row-between">
+              <view>快递号:</view>
+              <view class="conter">{{ orderInfo.deliveryId || "" }}</view>
+            </view>
+          </view>
+          <view
+            class="wrapper borRadius14"
+            v-else-if="orderInfo.deliveryType == 'send'"
+          >
+            <view class="item acea-row row-between">
+              <view>配送方式:</view>
+              <view class="conter">送货</view>
+            </view>
+            <view class="item acea-row row-between">
+              <view>配送人姓名:</view>
+              <view class="conter">{{ orderInfo.deliveryName || "" }}</view>
+            </view>
+            <view class="item acea-row row-between">
+              <view>联系电话:</view>
+              <view class="conter acea-row row-middle row-right"
+                >{{ orderInfo.deliveryId || ""
+                }}<text class="copy" @tap="goTel">拨打</text></view
+              >
+            </view>
+          </view>
+          <view
+            class="wrapper borRadius14"
+            v-else-if="orderInfo.deliveryType == 'fictitious'"
+          >
+            <view class="item acea-row row-between">
+              <view>虚拟发货:</view>
+              <view class="conter">已发货,请注意查收</view>
+            </view>
+          </view>
+        </view>
+        <view class="wrapper borRadius14">
+          <view class="item acea-row row-between">
+            <view>商品总价:</view>
+            <view class="conter" v-if="orderInfo.mallType === 0">
+              ¥{{ orderInfo.proTotalPrice }}
+            </view>
+            <view class="conter" v-else>{{ orderInfo.proTotalPrice }}</view>
+          </view>
+          <view
+            class="item acea-row row-between"
+            v-if="orderInfo.payPostage > 0"
+          >
+            <view>运费:</view>
+            <view class="conter">¥{{ orderInfo.payPostage }}</view>
+          </view>
+          <view
+            class="item acea-row row-between"
+            v-if="orderInfo.payPostage > 0 && orderInfo?.additionalAmount"
+          >
+            <view>附加费:</view>
+            <view class="conter">¥{{ orderInfo.additionalAmount }}</view>
+          </view>
+          <!-- <view class="item acea-row row-between" v-if="orderInfo.couponId">
+            <view>优惠券抵扣:</view>
+            <view class="conter">-¥{{ orderInfo.couponPrice }}</view>
+          </view> -->
+          <view
+            class="item acea-row row-between"
+            v-if="orderInfo.mallType === 0"
+          >
+            <view>会员折扣:</view>
+            <view class="conter">-¥{{ orderInfo.vipLevelDis }}</view>
+          </view>
+          <view
+            v-if="orderInfo.mallType === 0"
+            class="actualPay acea-row row-right"
+          >
+            实付款:<text class="money font-color">
+              ¥{{ orderInfo.payPrice }}
+            </text>
+          </view>
+          <view v-else class="actualPay acea-row row-right"
+            >实付款:<text class="money font-color">
+              {{ Number(orderInfo.proTotalPrice) }}贝币
+            </text>
+          </view>
+        </view>
+        <view style="height: 120rpx"></view>
+        <view
+          class="footer acea-row row-right row-middle"
+          v-if="isGoodsReturn == false"
+        >
+          <view class="qs-btn" v-if="!orderInfo.paid" @click.stop="cancelOrder"
+            >取消订单</view
+          >
+          <view
+            class="bnt bg-color"
+            v-if="!orderInfo.paid"
+            @tap="pay_open(orderInfo.orderId)"
+            >立即付款</view
+          >
+
+          <navigator
+            hover-class="none"
+            :url="
+              '/pages/users/goods_return/index?orderId=' + orderInfo.orderId
+            "
+            class="bnt cancel"
+            v-else-if="
+              orderInfo.paid === true &&
+              orderInfo.refundStatus === 0 &&
+              orderInfo.type !== 1 &&
+              orderInfo.mallType !== 1 &&
+              type === 'normal'
+            "
+          >
+            申请退款
+          </navigator>
+          <navigator
+            class="bnt cancel"
+            v-if="orderInfo.deliveryType == 'express' && orderInfo.status > 0"
+            hover-class="none"
+            :url="`/pages/users/goods_logistics/index?orderId=${orderInfo.orderId}`"
+            >查看物流
+          </navigator>
+          <view
+            class="bnt bg-color"
+            v-if="orderInfo.status == 1"
+            @tap="confirmOrder"
+            >确认收货</view
+          >
+          <view class="bnt cancel" v-if="orderInfo.status == 3" @tap="delOrder"
+            >删除订单</view
+          >
+          <view
+            class="bnt bg-color"
+            v-if="orderInfo.status == 3 && orderInfo.type !== 1"
+            @tap="goOrderConfirm"
+            >再次购买</view
+          >
+        </view>
+      </view>
+    </view>
+    <payment
+      :payMode="payMode"
+      :showPopup="showPopup"
+      @payComplete="payComplete"
+      @close="payClose"
+      :order_id="pay_order_id"
+      :totalPrice="totalPrice"
+      :mallType="orderInfo.mallType"
+    ></payment>
+  </view>
+</template>
+
+<script setup>
+import { ref, reactive, computed } from "vue";
+import { useAppStore } from "@/stores/app.js";
+import { onLoad, onShow, onHide } from "@dcloudio/uni-app";
+import {
+  getOrderDetail,
+  orderTake,
+  orderDel,
+  orderCancel,
+  qrcodeApi,
+} from "@/api/order.js";
+import { openOrderRefundSubscribe } from "@/utils/SubscribeMessage.js";
+import payment from "@/components/payment";
+import orderGoods from "@/components/orderGoods";
+import { toLogin } from "@/libs/login.js";
+import { useToast } from "@/hooks/useToast";
+import { getPreOrder } from "@/libs/order";
+
+const appStore = useAppStore();
+const { Toast } = useToast();
+
+const codeImg = ref("");
+const order_id = ref("");
+const evaluate = ref(0);
+const cartInfo = ref([]);
+const sbMerchant = ref({});
+const orderInfo = reactive({
+  systemStore: {},
+  pstatus: {},
+});
+const system_store = ref({});
+const isGoodsReturn = ref(false);
+const status = ref({});
+const isClose = ref(false);
+const payMode = ref([
+  {
+    name: "支付宝支付",
+    icon: "icon-zhifubao",
+    value: "alipay",
+    title: "支付宝快捷支付",
+    payChannel: "appAliPay",
+  },
+  {
+    name: "微信支付",
+    icon: "icon-wechat",
+    value: "weixin",
+    title: "微信快捷支付",
+    payChannel: "weixinApp",
+  },
+  {
+    name: "余额支付",
+    icon: "icon-balance",
+    value: "yue",
+    title: "可用余额:",
+    payChannel: "yue",
+    number: 0,
+  },
+]);
+const showPopup = ref(false);
+const pay_order_id = ref("");
+const totalPrice = ref("0");
+const id = ref(0);
+const uniId = ref("");
+const type = ref("normal");
+
+function payComplete() {
+  showPopup.value = false;
+  pay_order_id.value = "";
+  getOrderInfo();
+}
+function openSubcribe(page) {
+  uni.showLoading({ title: "正在加载" });
+  openOrderRefundSubscribe()
+    .then(() => {
+      uni.hideLoading();
+      uni.navigateTo({ url: page });
+    })
+    .catch(() => {
+      uni.hideLoading();
+    });
+}
+function makePhone() {
+  uni.makePhoneCall({
+    phoneNumber: system_store.value.phone,
+  });
+}
+function payClose() {
+  showPopup.value = false;
+}
+function pay_open() {
+  showPopup.value = true;
+  pay_order_id.value = orderInfo.orderId;
+  totalPrice.value = orderInfo.payPrice;
+}
+
+function getRefundStatus() {
+  const statusMap = {
+    1: "商家审核中",
+    2: "商家已退款",
+    3: "商家退款中",
+  };
+  return orderInfo?.refundStatus ? statusMap[orderInfo.refundStatus] : "";
+}
+
+function getRefundReason() {
+  if (orderInfo.refundStatus == 1) {
+    return "您已成功发起退款申请,请耐心等待商家处理;退款前请与商家协商一致,有助于更好的处理售后问题";
+  } else if (orderInfo.refundStatus == 2) {
+    return "退款已成功受理,如商家已寄出商品请尽快退回;感谢您的支持";
+  } else if (orderInfo?.refundReason) {
+    return "拒绝原因:" + orderInfo?.refundReason;
+  }
+}
+
+// 订单步骤配置
+const orderSteps = ref([
+  { title: "待付款" },
+  { title: "待发货" },
+  { title: "待收货" },
+  { title: "已完成" },
+]);
+
+// 当前的订单状态
+const curOrderStep = computed(() => {
+  let step = 0;
+  if (!orderInfo.paid) {
+    step = 0; // 待付款
+  } else if (orderInfo.status === 0) {
+    step = 1; // 待发货
+  } else if (orderInfo.status === 1) {
+    step = 2; // 待收货
+  } else if (orderInfo.status === 2 || orderInfo.status === 3) {
+    step = 3; // 已完成
+  }
+  return step;
+});
+function getOrderInfo() {
+  uni.showLoading({ title: "正在加载中" });
+  getOrderDetail(order_id.value)
+    .then((res) => {
+      uni.hideLoading();
+      Object.assign(orderInfo, res.data);
+      evaluate.value = res.data.status == 2 ? 2 : 0;
+      system_store.value = res.data.systemStore;
+      id.value = res.data.id;
+      cartInfo.value = res.data.orderInfoList;
+      sbMerchant.value = res.data.sbMerchant;
+      if (res.data.refundStatus != 0) isGoodsReturn.value = true;
+      if (orderInfo.shippingType == 2 && orderInfo.paid)
+        markCode(res.data.verifyCode);
+      if (orderInfo.refundStatus > 0) {
+        // uni.setNavigationBarColor({
+        //   frontColor: "#ffffff",
+        //   backgroundColor: "#666666",
+        // });
+      }
+    })
+    .catch((err) => {
+      uni.hideLoading();
+      Toast({ title: err }, "/pages/users/order_list/index");
+    });
+}
+function markCode(text) {
+  qrcodeApi({
+    height: "145",
+    text: text,
+    width: "145",
+  }).then((res) => {
+    codeImg.value = res.data.code;
+  });
+}
+// #ifndef H5
+function copy() {
+  uni.setClipboardData({
+    data: orderInfo.orderId,
+  });
+}
+// #endif
+function goTel() {
+  uni.makePhoneCall({
+    phoneNumber: orderInfo.deliveryId,
+  });
+}
+function getOrderStatus() {
+  let _orderInfo = orderInfo || {},
+    _status = _orderInfo.pstatus || { type: 0 },
+    _statusObj = {};
+  let typeVal = parseInt(_status.type),
+    delivery_type = _orderInfo.deliveryType,
+    seckill_id = _orderInfo.seckillId ? parseInt(_orderInfo.seckillId) : 0,
+    bargain_id = _orderInfo.bargainId ? parseInt(_orderInfo.bargainId) : 0,
+    combination_id = _orderInfo.combinationId
+      ? parseInt(_orderInfo.combinationId)
+      : 0;
+  _statusObj = {
+    type: typeVal == 9 ? -9 : typeVal,
+    class_status: 0,
+  };
+  if (typeVal == 1 && combination_id > 0) _statusObj.class_status = 1;
+  if (typeVal == 2 && delivery_type == "express") _statusObj.class_status = 2;
+  if (typeVal == 2) _statusObj.class_status = 3;
+  if (typeVal == 4 || typeVal == 0) _statusObj.class_status = 4;
+  if (
+    !seckill_id &&
+    !bargain_id &&
+    !combination_id &&
+    (typeVal == 3 || typeVal == 4)
+  )
+    _statusObj.class_status = 5;
+  status.value = _statusObj;
+}
+function goJoinPink() {
+  uni.navigateTo({
+    url:
+      "/pages/activity/goods_combination_status/index?id=" + orderInfo.pinkId,
+  });
+}
+function goOrderConfirm() {
+  const params = {
+    mallType: orderInfo.mallType,
+    preOrderType: "again",
+    orderDetails: [{ orderNo: order_id.value }],
+  };
+  getPreOrder(params);
+}
+function confirmOrder() {
+  uni.showModal({
+    title: "确认收货",
+    content: "为保障权益,请收到货确认无误后,再确认收货",
+    success: function (res) {
+      if (res.confirm) {
+        orderTake(id.value)
+          .then(() => {
+            Toast({ title: "操作成功", icon: "success" }, function () {
+              getOrderInfo();
+            });
+          })
+          .catch((err) => {
+            Toast({ title: err });
+          });
+      }
+    },
+  });
+}
+function delOrder() {
+  orderDel(id.value)
+    .then(() => {
+      Toast({ title: "删除成功", icon: "success" }, { tab: 3, url: 1 });
+    })
+    .catch((err) => {
+      Toast({ title: err });
+    });
+}
+function cancelOrder() {
+  uni.showModal({
+    title: "提示",
+    content: "确认取消该订单?",
+    success: function (res) {
+      if (res.confirm) {
+        orderCancel(orderInfo.id)
+          .then(() => {
+            Toast({ title: "取消成功" });
+            uni.navigateTo({ url: "/pages/order_list/index" });
+          })
+          .catch((err) => {
+            Toast({ title: err });
+            getOrderInfo();
+          });
+      }
+    },
+  });
+}
+
+// 生命周期
+onLoad((options) => {
+  type.value =
+    options.type == undefined || options.type == null ? "normal" : options.type;
+  if (!options.order_id && !options.uniId) {
+    Toast({ title: "缺少参数" }, { tab: 3, url: 1 });
+    return;
+  }
+  order_id.value = options.order_id;
+});
+onShow(() => {
+  if (appStore.isLogin) {
+    getOrderInfo();
+    payMode.value[2].number = appStore.$userInfo.nowMoney;
+    payMode.value = [...payMode.value];
+  } else {
+    toLogin();
+  }
+});
+onHide(() => {
+  isClose.value = true;
+});
+
+const setOrderId = () => {
+  uni.setClipboardData({
+    data: orderInfo.orderId,
+    success: function () {
+      Toast({ title: "复制成功" });
+    },
+  });
+};
+</script>
+
+<style scoped lang="scss">
+.order-details {
+  .header {
+    height: 250rpx;
+    padding: 0 30rpx;
+    background-color: $header-color;
+
+    &.on {
+      background-color: $header-color !important;
+    }
+
+    .picTxt {
+      height: 150rpx;
+
+      .pictrue {
+        width: 110rpx;
+        height: 110rpx;
+
+        image {
+          width: 100%;
+          height: 100%;
+        }
+      }
+
+      .data {
+        color: rgba(255, 255, 255, 0.8);
+        font-size: 24rpx;
+        margin-left: 27rpx;
+
+        &.on {
+          margin-left: 0;
+        }
+
+        .state {
+          font-size: 30rpx;
+          font-weight: bold;
+          color: #fff;
+          margin-bottom: 7rpx;
+        }
+        .time {
+          margin-left: 20rpx;
+        }
+      }
+    }
+  }
+
+  .nav {
+    background-color: #fff;
+    font-size: 26rpx;
+    color: #282828;
+    padding: 27rpx 0;
+    width: 100%;
+    border-radius: 14rpx;
+    margin: -100rpx auto 0 auto;
+  }
+
+  .address {
+    font-size: 26rpx;
+    color: #868686;
+    background-color: #fff;
+    margin-top: 15rpx;
+    padding: 30rpx 24rpx;
+
+    .name {
+      font-size: 30rpx;
+      color: #282828;
+      margin-bottom: 15rpx;
+
+      .phone {
+        margin-left: 40rpx;
+      }
+      .iconfont {
+        font-size: 34rpx;
+        margin-left: 10rpx;
+      }
+    }
+  }
+
+  .line {
+    width: 100%;
+    height: 3rpx;
+
+    image {
+      width: 100%;
+      height: 100%;
+      display: block;
+    }
+  }
+
+  .wrapper {
+    background-color: #fff;
+    margin-top: 12rpx;
+    padding: 30rpx 24rpx;
+
+    .item {
+      font-size: 28rpx;
+      color: #282828;
+
+      & ~ .item {
+        margin-top: 20rpx;
+      }
+
+      .conter {
+        color: #868686;
+        text-align: right;
+
+        .copy {
+          font-size: 20rpx;
+          color: #333;
+          border-radius: 20rpx;
+          border: 1rpx solid #666;
+          padding: 3rpx 15rpx;
+          margin-left: 24rpx;
+        }
+      }
+    }
+
+    .actualPay {
+      border-top: 1rpx solid #eee;
+      margin-top: 30rpx;
+      padding-top: 30rpx;
+
+      .money {
+        font-weight: bold;
+        font-size: 30rpx;
+      }
+    }
+  }
+
+  .footer {
+    width: 100%;
+    height: 100rpx;
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    background-color: #fff;
+    padding: 0 30rpx;
+    box-sizing: border-box;
+
+    .bnt {
+      width: 158rpx;
+      height: 54rpx;
+      text-align: center;
+      line-height: 54rpx;
+      border-radius: 50rpx;
+      color: #fff;
+      font-size: 27rpx;
+
+      &.cancel {
+        color: #F8C008;
+        border: 1rpx solid #F8C008;
+      }
+
+      & ~ .bnt {
+        margin-left: 18rpx;
+      }
+    }
+  }
+
+  .writeOff {
+    background-color: #fff;
+    margin-top: 15rpx;
+    padding-bottom: 50rpx;
+
+    .title {
+      font-size: 30rpx;
+      color: #282828;
+      height: 87rpx;
+      border-bottom: 1px solid #f0f0f0;
+      padding: 0 24rpx;
+      line-height: 87rpx;
+    }
+
+    .grayBg {
+      background-color: #f2f5f7;
+      width: 590rpx;
+      height: 384rpx;
+      border-radius: 20rpx 20rpx 0 0;
+      margin: 50rpx auto 0 auto;
+      padding-top: 55rpx;
+
+      .pictrue {
+        width: 290rpx;
+        height: 290rpx;
+        margin: 0 auto;
+
+        image {
+          width: 100%;
+          height: 100%;
+          display: block;
+        }
+      }
+    }
+
+    .gear {
+      width: 590rpx;
+      height: 30rpx;
+      margin: 0 auto;
+
+      image {
+        width: 100%;
+        height: 100%;
+        display: block;
+      }
+    }
+
+    .num {
+      background-color: #f0c34c;
+      width: 590rpx;
+      height: 84rpx;
+      color: #282828;
+      font-size: 48rpx;
+      margin: 0 auto;
+      border-radius: 0 0 20rpx 20rpx;
+      text-align: center;
+      padding-top: 4rpx;
+    }
+
+    .rules {
+      margin: 46rpx 30rpx 0 30rpx;
+      border-top: 1px solid #f0f0f0;
+      padding-top: 10rpx;
+
+      .item {
+        margin-top: 20rpx;
+
+        .rulesTitle {
+          font-size: 28rpx;
+          color: #282828;
+
+          .iconfont {
+            font-size: 30rpx;
+            color: #333;
+            margin-right: 8rpx;
+            margin-top: 5rpx;
+          }
+        }
+
+        .info {
+          font-size: 28rpx;
+          color: #999;
+          margin-top: 7rpx;
+
+          .time {
+            margin-left: 20rpx;
+          }
+        }
+      }
+    }
+  }
+
+  .map {
+    height: 86rpx;
+    font-size: 30rpx;
+    color: #282828;
+    line-height: 86rpx;
+    border-bottom: 1px solid #f0f0f0;
+    margin-top: 15rpx;
+    background-color: #fff;
+    padding: 0 24rpx;
+
+    .place {
+      font-size: 26rpx;
+      width: 176rpx;
+      height: 50rpx;
+      border-radius: 25rpx;
+      line-height: 50rpx;
+      text-align: center;
+
+      .iconfont {
+        font-size: 27rpx;
+        height: 27rpx;
+        line-height: 27rpx;
+        margin: 2rpx 3rpx 0 0;
+      }
+    }
+  }
+
+  .refund {
+    padding: 0 !important;
+    margin-top: 15rpx;
+    background-color: #fff;
+
+    .title {
+      display: flex;
+      align-items: center;
+      font-size: 30rpx;
+      color: #333;
+      height: 86rpx;
+      border-bottom: 1px solid #f5f5f5;
+      font-weight: 400;
+      padding: 0 24rpx;
+
+      image {
+        width: 32rpx;
+        height: 32rpx;
+        margin-right: 10rpx;
+      }
+    }
+
+    .con {
+      font-size: 25rpx;
+      color: #666666;
+      padding: 30rpx 24rpx;
+    }
+  }
+}
+
+.goodCall {
+  color: $theme-color;
+  text-align: center;
+  width: 100%;
+  height: 86rpx;
+  padding: 0 30rpx;
+  border-bottom: 1rpx solid #eee;
+  font-size: 30rpx;
+  line-height: 86rpx;
+  background: #fff;
+
+  .icon-kefu {
+    font-size: 36rpx;
+    margin-right: 15rpx;
+  }
+
+  /* #ifdef MP */
+  button {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    height: 86rpx;
+    font-size: 30rpx;
+    color: $theme-color;
+  }
+  /* #endif */
+}
+</style>
+
+<style>
+.qs-btn {
+  width: auto;
+  height: 60rpx;
+  text-align: center;
+  line-height: 60rpx;
+  border-radius: 50rpx;
+  color: #fff;
+  font-size: 27rpx;
+  padding: 0 3%;
+  color: #aaa;
+  border: 1px solid #ddd;
+  margin-right: 20rpx;
+}
+</style>

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1110 - 964
pages/order_details/index.vue


+ 401 - 0
pages/order_list/bf.vue

@@ -0,0 +1,401 @@
+<template>
+  <view>
+    <view class="my-order">
+      <view class="header">
+        <view class="picTxt acea-row row-between-wrapper">
+          <view class="text">
+            <view class="name">订单信息</view>
+            <view>
+              <text class="consumer-order"
+                >消费订单:{{ orderDataState.orderCount || 0 }}</text
+              >
+              <text
+                >总消费:¥{{
+                  formattedSumPrice
+                }}</text
+              >
+            </view>
+          </view>
+          <view class="pictrue">
+            <image src="/static/images/orderTime.png"></image>
+          </view>
+        </view>
+      </view>
+      <view class="nav acea-row row-around">
+        <view
+          class="item"
+          :class="orderStatus == 0 ? 'on' : ''"
+          @click="statusClick(0)"
+        >
+          <view>待付款</view>
+          <view class="num">{{ orderDataState.unPaidCount || 0 }}</view>
+        </view>
+        <view
+          class="item"
+          :class="orderStatus == 1 ? 'on' : ''"
+          @click="statusClick(1)"
+        >
+          <view>待发货</view>
+          <view class="num">{{ orderDataState.unShippedCount || 0 }}</view>
+        </view>
+        <view
+          class="item"
+          :class="orderStatus == 2 ? 'on' : ''"
+          @click="statusClick(2)"
+        >
+          <view>待收货</view>
+          <view class="num">{{ orderDataState.receivedCount || 0 }}</view>
+        </view>
+        <!-- <view
+          class="item"
+          :class="orderStatus == 3 ? 'on' : ''"
+          @click="statusClick(3)"
+        >
+          <view>待评价</view>
+          <view class="num">{{ orderDataState.evaluatedCount || 0 }}</view>
+        </view> -->
+        <view
+          class="item"
+          :class="orderStatus == 4 ? 'on' : ''"
+          @click="statusClick(4)"
+        >
+          <view>已完成</view>
+          <view class="num">{{ orderDataState.completeCount || 0 }}</view>
+        </view>
+        <view class="item" @click="toReturnList">
+          <view>退货/退款</view>
+          <view class="num">{{ orderDataState.refundCount || 0 }}</view>
+        </view>
+      </view>
+      <view class="list">
+        <OrderListCard
+          v-for="(item, index) in orderList"
+          :key="index"
+          :order="item"
+          :index="index"
+          @cancelOrder="cancelOrder"
+          @goPay="goPay"
+          @goOrderDetails="goOrderDetails"
+          :mallType="0"
+          @delOrder="delOrder"
+        />
+      </view>
+      <view
+        class="loadingicon acea-row row-center-wrapper"
+        v-if="orderList.length > 0"
+      >
+        <text
+          class="loading iconfont icon-jiazai"
+          :hidden="loading == false"
+        ></text
+        >{{ loadTitle }}
+      </view>
+      <view v-if="orderList.length == 0">
+        <emptyPage title="暂无订单~"></emptyPage>
+      </view>
+    </view>
+    <!-- <view class='noCart' v-if="orderList.length == 0 && page > 1">
+      <view class='pictrue'>
+        <image src='/static/images/noOrder.png'></image>
+      </view>
+    </view> -->
+    <payment
+      @closePopup="closePayPopup"
+      :payMode="payMode"
+      :showPopup="showPopup"
+      @payComplete="payComplete"
+      @payFail="payFail"
+      @onChangeFun="onChangeFun"
+      :order_id="pay_order_id"
+      :totalPrice="totalPrice"
+    ></payment>
+  </view>
+</template>
+
+<script setup>
+import { ref, onMounted,computed } from "vue";
+import { onShow,onLoad, onReachBottom } from "@dcloudio/uni-app";
+import OrderListCard from "@/components/OrderListCard";
+import { useAppStore } from "@/stores/app";
+import { getOrderList, orderData, orderCancel, orderDel } from "@/api/order.js";
+import payment from "@/components/payment";
+import { toLogin } from "@/libs/login.js";
+import emptyPage from "@/components/emptyPage.vue";
+import { useToast } from "@/hooks/useToast";
+
+const appStore = useAppStore();
+const { Toast } = useToast();
+
+// 状态
+const loading = ref(false);
+const loadend = ref(false);
+const loadTitle = ref("加载更多");
+const orderList = ref([]);
+const orderDataState = ref({});
+const orderStatus = ref(0);
+const page = ref(1);
+const limit = ref(10);
+const payMode = ref([
+  {
+    name: "微信支付",
+    icon: "icon-weixinzhifu",
+    value: "weixin",
+    title: "微信快捷支付",
+  },
+  {
+    name: "余额支付",
+    icon: "icon-yuezhifu",
+    value: "yue",
+    title: "可用余额:",
+    number: 0,
+  },
+]);
+const showPopup = ref(false);
+const pay_order_id = ref("");
+const totalPrice = ref("0");
+
+// 生命周期
+// onMounted(() => {
+//   if (appStore.isLogin) {
+//     loadend.value = false;
+//     page.value = 1;
+//     orderList.value = [];
+//     getOrderData();
+//     getOrderListFn();
+//   } else {
+//     toLogin();
+//   }
+// });
+
+// 页面显示时
+
+onShow(() => {
+  console.log('onShow')
+  if (appStore.isLogin) {
+    loadend.value = false;
+    page.value = 1;
+    orderList.value = [];
+    getOrderData();
+    getOrderListFn();
+  } else {
+    // toLogin();
+  }
+});
+onLoad((options)=>{
+  if (appStore.isLogin) {
+    if(options.status  && options.status!= 5){
+      statusClick(options.status)
+    }else if(options.status  && options.status == 5){
+      toReturnList()
+    }
+  } else {
+    // toLogin();
+  }
+})
+
+// 下拉加载
+onReachBottom(() => {
+  getOrderListFn();
+});
+
+function onChangeFun(state) {
+  let action = state.action || null;
+  let value = state.value !== undefined ? state.value : null;
+  if (action && typeof [action] === "function") {
+    [action](value);
+  }
+}
+function getOrderData() {
+  orderData().then((res) => {
+    orderDataState.value = res.data;
+  });
+}
+function cancelOrder(index, order_id) {
+  if (!order_id) return Toast({ title: "缺少订单号无法取消订单" });
+  uni.showLoading({ title: "正在删除中" });
+  orderCancel(order_id)
+    .then((res) => {
+      uni.hideLoading();
+      Toast({ title: "删除成功", icon: "success" }, () => {
+        orderList.value.splice(index, 1);
+        orderDataState.value.unpaid_count--;
+        getOrderData();
+      });
+    })
+    .catch((err) => {
+      Toast({ title: err });
+    });
+}
+
+function goPay(pay_price, order_id) {
+  appStore.USERINFO().then((res) => {
+    if (res.nowMoney) {
+      showPopup.value = true;
+      pay_order_id.value = order_id;
+      totalPrice.value = pay_price;
+    }
+  });
+}
+const closePayPopup = () => {
+  console.log("payClose");
+  showPopup.value = false;
+};
+function payComplete() {
+  console.log("payComplete");
+  loadend.value = false;
+  page.value = 1;
+  orderList.value = [];
+  showPopup.value = false;
+  getOrderData();
+  getOrderListFn();
+}
+function payFail() {
+  showPopup.value = false;
+}
+function goOrderDetails(order_id) {
+  if (!order_id) return Toast({ title: "缺少订单号无法查看订单详情" });
+  uni.navigateTo({ url: "/pages/order_details/index?order_id=" + order_id });
+}
+
+function toReturnList() {
+  uni.navigateTo({ url: "/pages/users/user_return_list/index" });
+}
+function statusClick(status) {
+  if (status === orderStatus.value) return;
+  orderStatus.value = status;
+  loadend.value = false;
+  page.value = 1;
+  orderList.value = [];
+  getOrderListFn();
+}
+function getOrderListFn() {
+  if (loadend.value || loading.value) return;
+  loading.value = true;
+  loadTitle.value = "加载更多";
+  getOrderList({
+    type: orderStatus.value,
+    page: page.value,
+    limit: limit.value,
+    mallType: 0,
+  })
+    .then((res) => {
+      let list = res.data.list || [];
+      let isLoadend = list.length < limit.value;
+      // orderList.value = uni.$util.SplitArray(list, orderList.value)
+      orderList.value = [...list, ...orderList.value];
+      loadend.value = isLoadend;
+      loading.value = false;
+      loadTitle.value = isLoadend ? "我也是有底线的" : "加载更多";
+      page.value += 1;
+    })
+    .catch(() => {
+      loading.value = false;
+      loadTitle.value = "加载更多";
+    });
+}
+function delOrder(order_id, index) {
+  orderDel(order_id)
+    .then((res) => {
+      orderList.value.splice(index, 1);
+      orderDataState.value.unpaid_count--;
+      getOrderData();
+      Toast({ title: "删除成功", icon: "success" });
+    })
+    .catch((err) => {
+      Toast({ title: err });
+    });
+}
+const formattedSumPrice = computed(() => {
+  const price = orderDataState.value.sumPrice;
+  if (price === null || price === undefined || price === '' || isNaN(price)) {
+    return '0.00';
+  }
+  return Number(price).toFixed(2);
+});
+</script>
+
+<style scoped lang="scss">
+.my-order {
+  .header {
+    height: 250rpx;
+    padding: 0 30rpx;
+    background-color: $header-color;
+
+    .picTxt {
+      height: 190rpx;
+
+      .text {
+        color: #000;
+        font-size: 26rpx;
+        font-family: "Guildford Pro";
+
+        .name {
+          font-size: 34rpx;
+          font-weight: bold;
+          color: #000;
+          margin-bottom: 20rpx;
+        }
+
+        .consumer-order {
+          margin-right: 30rpx;
+        }
+      }
+
+      .pictrue {
+        width: 122rpx;
+        height: 109rpx;
+
+        image {
+          width: 100%;
+          height: 100%;
+        }
+      }
+    }
+  }
+
+  .nav {
+    background-color: #fff;
+    width: 690rpx;
+    height: 140rpx;
+    border-radius: 14rpx;
+    margin: -60rpx auto 0 auto;
+
+    .item {
+      text-align: center;
+      font-size: 26rpx;
+      color: #282828;
+      padding: 26rpx 0;
+
+      &.on {
+        font-weight: bold;
+        border-bottom: 5rpx solid $border-color;
+      }
+
+      .num {
+        margin-top: 18rpx;
+      }
+    }
+  }
+
+  .list {
+    width: 690rpx;
+    margin: 14rpx auto 0 auto;
+  }
+}
+
+.noCart {
+  margin-top: 171rpx;
+  padding-top: 0.1rpx;
+
+  .pictrue {
+    width: 414rpx;
+    height: 336rpx;
+    margin: 78rpx auto 56rpx auto;
+
+    image {
+      width: 100%;
+      height: 100%;
+    }
+  }
+}
+</style>

+ 317 - 373
pages/order_list/index.vue

@@ -1,401 +1,345 @@
 <template>
-  <view>
-    <view class="my-order">
-      <view class="header">
-        <view class="picTxt acea-row row-between-wrapper">
-          <view class="text">
-            <view class="name">订单信息</view>
-            <view>
-              <text class="consumer-order"
-                >消费订单:{{ orderDataState.orderCount || 0 }}</text
-              >
-              <text
-                >总消费:¥{{
-                  formattedSumPrice
-                }}</text
-              >
-            </view>
-          </view>
-          <view class="pictrue">
-            <image src="/static/images/orderTime.png"></image>
-          </view>
-        </view>
-      </view>
-      <view class="nav acea-row row-around">
-        <view
-          class="item"
-          :class="orderStatus == 0 ? 'on' : ''"
-          @click="statusClick(0)"
-        >
-          <view>待付款</view>
-          <view class="num">{{ orderDataState.unPaidCount || 0 }}</view>
-        </view>
-        <view
-          class="item"
-          :class="orderStatus == 1 ? 'on' : ''"
-          @click="statusClick(1)"
-        >
-          <view>待发货</view>
-          <view class="num">{{ orderDataState.unShippedCount || 0 }}</view>
-        </view>
-        <view
-          class="item"
-          :class="orderStatus == 2 ? 'on' : ''"
-          @click="statusClick(2)"
-        >
-          <view>待收货</view>
-          <view class="num">{{ orderDataState.receivedCount || 0 }}</view>
-        </view>
-        <!-- <view
-          class="item"
-          :class="orderStatus == 3 ? 'on' : ''"
-          @click="statusClick(3)"
-        >
-          <view>待评价</view>
-          <view class="num">{{ orderDataState.evaluatedCount || 0 }}</view>
-        </view> -->
-        <view
-          class="item"
-          :class="orderStatus == 4 ? 'on' : ''"
-          @click="statusClick(4)"
-        >
-          <view>已完成</view>
-          <view class="num">{{ orderDataState.completeCount || 0 }}</view>
-        </view>
-        <view class="item" @click="toReturnList">
-          <view>退货/退款</view>
-          <view class="num">{{ orderDataState.refundCount || 0 }}</view>
-        </view>
-      </view>
-      <view class="list">
-        <OrderListCard
-          v-for="(item, index) in orderList"
-          :key="index"
-          :order="item"
-          :index="index"
-          @cancelOrder="cancelOrder"
-          @goPay="goPay"
-          @goOrderDetails="goOrderDetails"
-          :mallType="0"
-          @delOrder="delOrder"
-        />
-      </view>
-      <view
-        class="loadingicon acea-row row-center-wrapper"
-        v-if="orderList.length > 0"
-      >
-        <text
-          class="loading iconfont icon-jiazai"
-          :hidden="loading == false"
-        ></text
-        >{{ loadTitle }}
-      </view>
-      <view v-if="orderList.length == 0">
-        <emptyPage title="暂无订单~"></emptyPage>
-      </view>
-    </view>
-    <!-- <view class='noCart' v-if="orderList.length == 0 && page > 1">
-      <view class='pictrue'>
-        <image src='/static/images/noOrder.png'></image>
-      </view>
-    </view> -->
-    <payment
-      @closePopup="closePayPopup"
-      :payMode="payMode"
-      :showPopup="showPopup"
-      @payComplete="payComplete"
-      @payFail="payFail"
-      @onChangeFun="onChangeFun"
-      :order_id="pay_order_id"
-      :totalPrice="totalPrice"
-    ></payment>
-  </view>
+	<view>
+		<view class="my-order">
+			<view class="nav">
+				<up-tabs :scrollable="false" lineColor="#F8C008" :activeStyle="{color:'#F8C008',fontSize:'28rpx'}"
+					:inactiveStyle="{color:'#333333',fontSize:'28rpx'}" :list="list" @click="statusClick"
+					:current="oldOrderStatus"></up-tabs>
+			</view>
+			<view class="list" v-if="orderList.length">
+				<OrderListCard v-for="(item, index) in orderList" :key="index" :order="item" :index="index"
+					@cancelOrder="cancelOrder" @goPay="goPay" @goOrderDetails="goOrderDetails" :mallType="0"
+					@delOrder="delOrder" />
+			</view>
+			<view class="loadingicon acea-row row-center-wrapper" v-if="orderList.length > 0">
+				<text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>{{ loadTitle }}
+			</view>
+			<view class="empty" v-if="orderList.length == 0">
+				<uni-empty-view />
+			</view>
+		</view>
+		<payment @closePopup="closePayPopup" :payMode="payMode" :showPopup="showPopup" @payComplete="payComplete"
+			@payFail="payFail" @onChangeFun="onChangeFun" :order_id="pay_order_id" :totalPrice="totalPrice"></payment>
+	</view>
 </template>
 
 <script setup>
-import { ref, onMounted,computed } from "vue";
-import { onShow,onLoad, onReachBottom } from "@dcloudio/uni-app";
-import OrderListCard from "@/components/OrderListCard";
-import { useAppStore } from "@/stores/app";
-import { getOrderList, orderData, orderCancel, orderDel } from "@/api/order.js";
-import payment from "@/components/payment";
-import { toLogin } from "@/libs/login.js";
-import emptyPage from "@/components/emptyPage.vue";
-import { useToast } from "@/hooks/useToast";
+	import {
+		ref,
+		onMounted
+	} from "vue";
+	import {
+		onShow,
+		onReachBottom
+	} from "@dcloudio/uni-app";
+	import OrderListCard from "@/components/OrderListCard";
+	import {
+		useAppStore
+	} from "@/stores/app";
+	import {
+		getOrderList,
+		orderData,
+		orderCancel,
+		orderDel
+	} from "@/api/order.js";
+	import payment from "@/components/payment";
+	import {
+		toLogin
+	} from "@/libs/login.js";
+	import emptyPage from "@/components/emptyPage.vue";
+	import {
+		useToast
+	} from "@/hooks/useToast";
 
-const appStore = useAppStore();
-const { Toast } = useToast();
+	const appStore = useAppStore();
+	const {
+		Toast
+	} = useToast();
 
-// 状态
-const loading = ref(false);
-const loadend = ref(false);
-const loadTitle = ref("加载更多");
-const orderList = ref([]);
-const orderDataState = ref({});
-const orderStatus = ref(0);
-const page = ref(1);
-const limit = ref(10);
-const payMode = ref([
-  {
-    name: "微信支付",
-    icon: "icon-weixinzhifu",
-    value: "weixin",
-    title: "微信快捷支付",
-  },
-  {
-    name: "余额支付",
-    icon: "icon-yuezhifu",
-    value: "yue",
-    title: "可用余额:",
-    number: 0,
-  },
-]);
-const showPopup = ref(false);
-const pay_order_id = ref("");
-const totalPrice = ref("0");
+	// 状态
+	const loading = ref(false);
+	const loadend = ref(false);
+	const loadTitle = ref("加载更多");
+	const orderList = ref([]);
+	const orderDataState = ref({});
+	const orderStatus = ref(0);
+	const oldOrderStatus = ref(0); //老数据
+	const page = ref(1);
+	const limit = ref(10);
+	const payMode = ref([{
+			name: "微信支付",
+			icon: "icon-weixinzhifu",
+			value: "weixin",
+			title: "微信快捷支付",
+		},
+		{
+			name: "余额支付",
+			icon: "icon-yuezhifu",
+			value: "yue",
+			title: "可用余额:",
+			number: 0,
+		},
+	]);
+	const showPopup = ref(false);
+	const pay_order_id = ref("");
+	const totalPrice = ref("0");
 
-// 生命周期
-// onMounted(() => {
-//   if (appStore.isLogin) {
-//     loadend.value = false;
-//     page.value = 1;
-//     orderList.value = [];
-//     getOrderData();
-//     getOrderListFn();
-//   } else {
-//     toLogin();
-//   }
-// });
+	const list = ref([{
+			name: '待付款',
+			orderStatus: 0
+		},
+		{
+			name: '待发货',
+			orderStatus: 1
+		},
+		{
+			name: '待收货',
+			orderStatus: 2
+		},
+		{
+			name: '已完成',
+			orderStatus: 4
+		},
+		{
+			name: '退货/退款',
+			orderStatus: -3
+		},
+	]) //头部导航
 
-// 页面显示时
+	// 生命周期
+	onMounted(() => {
+		if (appStore.isLogin) {
+			loadend.value = false;
+			page.value = 1;
+			orderList.value = [];
+			getOrderData();
+			getOrderListFn();
+		} else {
+			toLogin();
+		}
+	});
 
-onShow(() => {
-  console.log('onShow')
-  if (appStore.isLogin) {
-    loadend.value = false;
-    page.value = 1;
-    orderList.value = [];
-    getOrderData();
-    getOrderListFn();
-  } else {
-    // toLogin();
-  }
-});
-onLoad((options)=>{
-  if (appStore.isLogin) {
-    if(options.status  && options.status!= 5){
-      statusClick(options.status)
-    }else if(options.status  && options.status == 5){
-      toReturnList()
-    }
-  } else {
-    // toLogin();
-  }
-})
+	// 页面显示时
 
-// 下拉加载
-onReachBottom(() => {
-  getOrderListFn();
-});
+	onShow(() => {
+		if (appStore.isLogin) {
+			loadend.value = false;
+			page.value = 1;
+			orderList.value = [];
+			getOrderData();
+			getOrderListFn();
+		} else {
+			toLogin();
+		}
+	});
 
-function onChangeFun(state) {
-  let action = state.action || null;
-  let value = state.value !== undefined ? state.value : null;
-  if (action && typeof [action] === "function") {
-    [action](value);
-  }
-}
-function getOrderData() {
-  orderData().then((res) => {
-    orderDataState.value = res.data;
-  });
-}
-function cancelOrder(index, order_id) {
-  if (!order_id) return Toast({ title: "缺少订单号无法取消订单" });
-  uni.showLoading({ title: "正在删除中" });
-  orderCancel(order_id)
-    .then((res) => {
-      uni.hideLoading();
-      Toast({ title: "删除成功", icon: "success" }, () => {
-        orderList.value.splice(index, 1);
-        orderDataState.value.unpaid_count--;
-        getOrderData();
-      });
-    })
-    .catch((err) => {
-      Toast({ title: err });
-    });
-}
+	// 下拉加载
+	onReachBottom(() => {
+		getOrderListFn();
+	});
 
-function goPay(pay_price, order_id) {
-  appStore.USERINFO().then((res) => {
-    if (res.nowMoney) {
-      showPopup.value = true;
-      pay_order_id.value = order_id;
-      totalPrice.value = pay_price;
-    }
-  });
-}
-const closePayPopup = () => {
-  console.log("payClose");
-  showPopup.value = false;
-};
-function payComplete() {
-  console.log("payComplete");
-  loadend.value = false;
-  page.value = 1;
-  orderList.value = [];
-  showPopup.value = false;
-  getOrderData();
-  getOrderListFn();
-}
-function payFail() {
-  showPopup.value = false;
-}
-function goOrderDetails(order_id) {
-  if (!order_id) return Toast({ title: "缺少订单号无法查看订单详情" });
-  uni.navigateTo({ url: "/pages/order_details/index?order_id=" + order_id });
-}
+	function onChangeFun(state) {
+		let action = state.action || null;
+		let value = state.value !== undefined ? state.value : null;
+		if (action && typeof [action] === "function") {
+			[action](value);
+		}
+	}
 
-function toReturnList() {
-  uni.navigateTo({ url: "/pages/users/user_return_list/index" });
-}
-function statusClick(status) {
-  if (status === orderStatus.value) return;
-  orderStatus.value = status;
-  loadend.value = false;
-  page.value = 1;
-  orderList.value = [];
-  getOrderListFn();
-}
-function getOrderListFn() {
-  if (loadend.value || loading.value) return;
-  loading.value = true;
-  loadTitle.value = "加载更多";
-  getOrderList({
-    type: orderStatus.value,
-    page: page.value,
-    limit: limit.value,
-    mallType: 0,
-  })
-    .then((res) => {
-      let list = res.data.list || [];
-      let isLoadend = list.length < limit.value;
-      // orderList.value = uni.$util.SplitArray(list, orderList.value)
-      orderList.value = [...list, ...orderList.value];
-      loadend.value = isLoadend;
-      loading.value = false;
-      loadTitle.value = isLoadend ? "我也是有底线的" : "加载更多";
-      page.value += 1;
-    })
-    .catch(() => {
-      loading.value = false;
-      loadTitle.value = "加载更多";
-    });
-}
-function delOrder(order_id, index) {
-  orderDel(order_id)
-    .then((res) => {
-      orderList.value.splice(index, 1);
-      orderDataState.value.unpaid_count--;
-      getOrderData();
-      Toast({ title: "删除成功", icon: "success" });
-    })
-    .catch((err) => {
-      Toast({ title: err });
-    });
-}
-const formattedSumPrice = computed(() => {
-  const price = orderDataState.value.sumPrice;
-  if (price === null || price === undefined || price === '' || isNaN(price)) {
-    return '0.00';
-  }
-  return Number(price).toFixed(2);
-});
-</script>
+	function getOrderData() {
+		orderData().then((res) => {
+			orderDataState.value = res.data;
+		});
+	}
 
-<style scoped lang="scss">
-.my-order {
-  .header {
-    height: 250rpx;
-    padding: 0 30rpx;
-    background-color: $header-color;
+	function cancelOrder(index, order_id) {
+		if (!order_id) return Toast({
+			title: "缺少订单号无法取消订单"
+		});
+		uni.showLoading({
+			title: "正在删除中"
+		});
+		orderCancel(order_id)
+			.then((res) => {
+				uni.hideLoading();
+				Toast({
+					title: "删除成功",
+					icon: "success"
+				}, () => {
+					orderList.value.splice(index, 1);
+					orderDataState.value.unpaid_count--;
+					getOrderData();
+				});
+			})
+			.catch((err) => {
+				Toast({
+					title: err
+				});
+			});
+	}
 
-    .picTxt {
-      height: 190rpx;
+	function goPay(pay_price, order_id) {
+		appStore.USERINFO().then((res) => {
+			if (res.nowMoney) {
+				showPopup.value = true;
+				pay_order_id.value = order_id;
+				totalPrice.value = pay_price;
+			}
+		});
+	}
+	const closePayPopup = () => {
+		console.log("payClose");
+		showPopup.value = false;
+	};
 
-      .text {
-        color: #000;
-        font-size: 26rpx;
-        font-family: "Guildford Pro";
+	function payComplete() {
+		console.log("payComplete");
+		loadend.value = false;
+		page.value = 1;
+		orderList.value = [];
+		showPopup.value = false;
+		getOrderData();
+		getOrderListFn();
+	}
 
-        .name {
-          font-size: 34rpx;
-          font-weight: bold;
-          color: #000;
-          margin-bottom: 20rpx;
-        }
+	function payFail() {
+		showPopup.value = false;
+	}
 
-        .consumer-order {
-          margin-right: 30rpx;
-        }
-      }
+	function goOrderDetails(order_id) {
+		if (!order_id) return Toast({
+			title: "缺少订单号无法查看订单详情"
+		});
+		uni.navigateTo({
+			url: "/pages/order_details/index?order_id=" + order_id
+		});
+	}
 
-      .pictrue {
-        width: 122rpx;
-        height: 109rpx;
+	function toReturnList() {
+		uni.navigateTo({
+			url: "/pages/users/user_return_list/index"
+		});
+	}
 
-        image {
-          width: 100%;
-          height: 100%;
-        }
-      }
-    }
-  }
+	const changeStatus = (item) => {
+		// oldOrderStatus.value = item.index;
+	}
 
-  .nav {
-    background-color: #fff;
-    width: 690rpx;
-    height: 140rpx;
-    border-radius: 14rpx;
-    margin: -60rpx auto 0 auto;
+	function statusClick(item) {
 
-    .item {
-      text-align: center;
-      font-size: 26rpx;
-      color: #282828;
-      padding: 26rpx 0;
+		if (item.orderStatus === orderStatus.value) return;
+		
+		orderStatus.value = item.orderStatus;
+		loadend.value = false;
+		page.value = 1;
+		orderList.value = [];
+		getOrderListFn();
+	}
 
-      &.on {
-        font-weight: bold;
-        border-bottom: 5rpx solid $border-color;
-      }
+	function getOrderListFn() {
+		if (loadend.value || loading.value) return;
+		loading.value = true;
+		loadTitle.value = "加载更多";
+		getOrderList({
+				type: orderStatus.value,
+				page: page.value,
+				limit: limit.value,
+				mallType: 0,
+			})
+			.then((res) => {
+				let list = res.data.list || [];
+				let isLoadend = list.length < limit.value;
+				// orderList.value = uni.$util.SplitArray(list, orderList.value)
+				orderList.value = [...list, ...orderList.value];
+				loadend.value = isLoadend;
+				loading.value = false;
+				loadTitle.value = isLoadend ? "我也是有底线的" : "加载更多";
+				page.value += 1;
+			})
+			.catch(() => {
+				loading.value = false;
+				loadTitle.value = "加载更多";
+			});
+	}
 
-      .num {
-        margin-top: 18rpx;
-      }
-    }
-  }
+	function delOrder(order_id, index) {
+		orderDel(order_id)
+			.then((res) => {
+				orderList.value.splice(index, 1);
+				orderDataState.value.unpaid_count--;
+				getOrderData();
+				Toast({
+					title: "删除成功",
+					icon: "success"
+				});
+			})
+			.catch((err) => {
+				Toast({
+					title: err
+				});
+			});
+	}
+</script>
+<style>
+	page {
+		background: #F9F7F0;
+	}
+</style>
+<style scoped lang="scss">
+	.empty {
+		height: calc(100vh - 44px);
+		/* #ifdef H5 */
+		height: calc(100vh - 88px);
+		/* #endif */
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
 
-  .list {
-    width: 690rpx;
-    margin: 14rpx auto 0 auto;
-  }
-}
+	.my-order {
 
-.noCart {
-  margin-top: 171rpx;
-  padding-top: 0.1rpx;
+		.nav {
+			background: #FFFFFF;
 
-  .pictrue {
-    width: 414rpx;
-    height: 336rpx;
-    margin: 78rpx auto 56rpx auto;
+			// height: 140rpx;
+			background-color: #fff;
 
-    image {
-      width: 100%;
-      height: 100%;
-    }
-  }
-}
-</style>
+			.item {
+				text-align: center;
+				font-size: 26rpx;
+				color: #282828;
+				padding: 26rpx 0;
+
+				&.on {
+					font-weight: bold;
+					border-bottom: 5rpx solid $border-color;
+				}
+
+				.num {
+					margin-top: 18rpx;
+				}
+			}
+		}
+
+		.list {
+			width: 690rpx;
+			margin: 16rpx auto 0 auto;
+		}
+	}
+
+	.noCart {
+		margin-top: 171rpx;
+		padding-top: 0.1rpx;
+
+		.pictrue {
+			width: 414rpx;
+			height: 336rpx;
+			margin: 78rpx auto 56rpx auto;
+
+			image {
+				width: 100%;
+				height: 100%;
+			}
+		}
+	}
+</style>

+ 411 - 276
pages/users/goods_return/index.vue

@@ -1,282 +1,417 @@
 <template>
-  <view>
-    <form @submit="subRefund" report-submit="true">
-      <view class="apply-return">
-        <view
-          class="goodsStyle acea-row row-between borRadius14"
-          v-for="(item, idx) in orderInfo.orderInfoList"
-          :key="idx"
-        >
-          <view class="pictrue">
-            <image :src="item.image"></image>
-          </view>
-          <view class="text acea-row row-between">
-            <view class="name line2">{{ item.storeName }}</view>
-            <view class="money">
-              <view>¥{{ item.price }}</view>
-              <view class="num">x{{ item.cartNum }}</view>
-            </view>
-          </view>
-        </view>
-        <view class="list borRadius14">
-          <view class="item acea-row row-between-wrapper">
-            <view>退货件数</view>
-            <view class="num">{{ orderInfo.totalNum }}</view>
-          </view>
-          <view class="item acea-row row-between-wrapper">
-            <view>退款金额</view>
-            <view class="num">¥{{ orderInfo.payPrice }}</view>
-          </view>
-          <view
-            class="item acea-row row-between-wrapper"
-            @tap="toggleTab('region')"
-          >
-            <view>退款原因</view>
-            <picker
-              class="num"
-              @change="bindPickerChange"
-              :value="index"
-              :range="RefundArray"
-            >
-              <view class="picker acea-row row-between-wrapper">
-                <view class="reason">{{ RefundArray[index] }}</view>
-                <text class="iconfont icon-jiantou"></text>
-              </view>
-            </picker>
-          </view>
-          <view class="item textarea acea-row row-between">
-            <view>快递单号</view>
-            <input name="refund_express_num" placeholder-class="express-num" placeholder="请输入快递单号" />
-          </view>
-          <view class="item textarea acea-row row-between">
-            <view>备注说明</view>
-            <textarea
-              placeholder="填写备注信息,100字以内"
-              class="num"
-              name="refund_reason_wap_explain"
-              placeholder-class="填写备注信息,100字以内"
-            ></textarea>
-          </view>
-          <button class="returnBnt bg-color" form-type="submit">
-            申请退款
-          </button>
-        </view>
-      </view>
-    </form>
-  </view>
+	<view>
+
+		<view class="apply-return">
+			<view class="apply-return-top">
+				<view class="apply-return-list">
+					<view class="apply-return-card" v-for="(item, idx) in orderInfo.orderInfoList" :key="idx">
+						<image :src="item.image" mode="aspectFill"></image>
+						<view class="con">
+							<view class="name">
+								<view class="">{{ item.storeName }}</view>
+								<view class="">¥{{ item.price }}</view>
+							</view>
+							<view class="num">
+								<view class="">{{ item.sku }}</view>
+								<view class="">X{{ item.cartNum }}</view>
+							</view>
+						</view>
+					</view>
+				</view>
+				<view class="apply-return-b">
+					<view class="item">
+						<view>退货件数</view>
+						<view class="num">{{ orderInfo.totalNum }}</view>
+					</view>
+					<view class="item">
+						<view>退款金额</view>
+						<view class="red">¥{{ orderInfo.payPrice }}</view>
+					</view>
+				</view>
+			</view>
+
+			<view class="list">
+
+				<view class="item acea-row row-between-wrapper" @tap="toggleTab('region')">
+					<view>退款原因</view>
+					<picker class="num" @change="bindPickerChange" :value="index" :range="RefundArray">
+						<view class="picker acea-row row-between-wrapper">
+							<view class="reason">{{ RefundArray[index] }}</view>
+							<image class="iconfont" src="/static/images/shop/go@2x.png" mode=""></image>
+						</view>
+					</picker>
+				</view>
+				<view class="item">
+					<view>快递单号</view>
+					<input v-model="form.refund_express_num" placeholder-class="express-num" placeholder="请输入快递单号" />
+				</view>
+				<view class="textarea">
+					<view>备注说明</view>
+					<textarea v-model="form.refund_reason_wap_explain" count placeholder="填写备注信息,100字以内" class="num"></textarea>
+				</view>
+
+			</view>
+		</view>
+		<view class="kong"></view>
+		<view class="footer">
+			<button @click="subRefund" class="returnBnt" form-type="submit">
+				申请退款
+			</button>
+		</view>
+	</view>
 </template>
 
 <script setup>
-import {
-  ref,
-  reactive,
-  watch,
-} from "vue";
-import { useAppStore } from "@/stores/app";
-import { onLoad } from "@dcloudio/uni-app";
-import {
-  ordeRefundReason,
-  orderRefundVerify,
-  applyRefund,
-} from "@/api/order.js";
-import { toLogin } from "@/libs/login.js";
-
-const appStore = useAppStore();
-import { useToast } from "@/hooks/useToast";
-
-const refund_reason_wap_imgPath = ref([]);
-const orderInfo = reactive({});
-const RefundArray = ref([]);
-const index = ref(0);
-const orderId = ref(0);
-
-const { Toast } = useToast();
-
-
-watch(() => appStore.isLogin, (newV) => {
-  if (newV) {
-    getOrderInfo();
-    getRefundReason();
-  }
-});
-
-onLoad((options) => {
-  if (!options.orderId)
-    return Toast({ title: "缺少订单id,无法退款" }, { tab: 3, url: 1 });
-  orderId.value = options.orderId;
-  if (appStore.isLogin) {
-    getOrderInfo();
-    getRefundReason();
-  } else {
-    toLogin();
-  }
-});
-
-function onLoadFun() {
-  getOrderInfo();
-  getRefundReason();
-}
-
-/**
- * 获取订单详情
- */
-function getOrderInfo() {
-  applyRefund(orderId.value).then((res) => {
-    Object.assign(orderInfo, res.data);
-  });
-}
-
-/**
- * 获取退款理由
- */
-function getRefundReason() {
-  ordeRefundReason().then((res) => {
-    RefundArray.value = res.data;
-  });
-}
-
-/**
- * 申请退货
- */
-function subRefund(e) {
-  const value = e.detail.value;
-  orderRefundVerify({
-    text: RefundArray.value[index.value] || "",
-    refund_reason_wap_explain: value.refund_reason_wap_explain,
-    refund_express_num: value.refund_express_num,
-    refund_reason_wap_img: refund_reason_wap_imgPath.value.join(","),
-    uni: orderId.value,
-  })
-    .then((res) => {
-      return Toast(
-        { title: "申请成功", icon: "success" },
-        { tab: 5, url: "/pages/users/user_return_list/index?isT=1" }
-      );
-    })
-    .catch((err) => {
-      return Toast({ title: err });
-    });
-}
-
-function bindPickerChange(e) {
-  index.value = e.detail.value;
-}
-
-function toggleTab() {
-  // 保留原逻辑
-}
-</script>
+	import {
+		ref,
+		reactive,
+		watch,
+	} from "vue";
+	import {
+		useAppStore
+	} from "@/stores/app";
+	import {
+		onLoad
+	} from "@dcloudio/uni-app";
+	import {
+		ordeRefundReason,
+		orderRefundVerify,
+		applyRefund,
+	} from "@/api/order.js";
+	import {
+		toLogin
+	} from "@/libs/login.js";
 
-<style scoped lang="scss">
-.apply-return {
-  padding: 20rpx 30rpx 70rpx 30rpx;
-
-  .list {
-    background-color: #fff;
-    margin-top: 18rpx;
-    padding: 0 24rpx 70rpx 24rpx;
-
-    .item {
-      min-height: 90rpx;
-      border-bottom: 1rpx solid #eee;
-      font-size: 30rpx;
-      color: #333;
-
-      .num {
-        color: #282828;
-        width: 427rpx;
-        text-align: right;
-
-        .picker {
-          .reason {
-            width: 385rpx;
-          }
-          .iconfont {
-            color: #666;
-            font-size: 30rpx;
-            margin-top: 2rpx;
-          }
-        }
-      }
-
-      ::v-deep .express-num {
-        text-align: right;
-      }
-
-      &.textarea {
-        padding: 24rpx 0;
-
-        textarea {
-          height: 100rpx;
-          font-size: 30rpx;
-        }
-      }
-
-      .placeholder {
-        color: #bbb;
-      }
-
-      .title {
-        height: 95rpx;
-        width: 100%;
-
-        .tip {
-          font-size: 30rpx;
-          color: #bbb;
-        }
-      }
-
-      .upload {
-        padding-bottom: 36rpx;
-
-        .pictrue {
-          border-radius: 14rpx;
-          margin: 22rpx 23rpx 0 0;
-          width: 156rpx;
-          height: 156rpx;
-          position: relative;
-          font-size: 24rpx;
-          color: #bbb;
-
-          &:nth-of-type(4n) {
-            margin-right: 0;
-          }
-
-          image {
-            width: 100%;
-            height: 100%;
-            border-radius: 14rpx;
-          }
-
-          .icon-guanbi1 {
-            position: absolute;
-            font-size: 45rpx;
-            top: -10rpx;
-            right: -10rpx;
-          }
-
-          .icon-icon25201 {
-            color: #bfbfbf;
-            font-size: 50rpx;
-          }
-
-          &:nth-last-child(1) {
-            border: 1rpx solid #ddd;
-            box-sizing: border-box;
-          }
-        }
-      }
-    }
-    .returnBnt {
-      font-size: 32rpx;
-      color: #fff;
-      width: 100%;
-      height: 86rpx;
-      border-radius: 50rpx;
-      text-align: center;
-      line-height: 86rpx;
-      margin: 43rpx auto;
-    }
-  }
-}
+	const appStore = useAppStore();
+	import {
+		useToast
+	} from "@/hooks/useToast";
+
+	const refund_reason_wap_imgPath = ref([]);
+	const orderInfo = reactive({});
+	const RefundArray = ref([]);
+	const index = ref(0);
+	const orderId = ref(0);
+
+	const {
+		Toast
+	} = useToast();
+
+	const form = ref({
+		text:'',
+		refund_express_num: '',
+		refund_reason_wap_explain: '',
+		uni: '',
+		refund_reason_wap_img: ''
+	})
+
+	watch(() => appStore.isLogin, (newV) => {
+		if (newV) {
+			getOrderInfo();
+			getRefundReason();
+		}
+	});
+
+	onLoad((options) => {
+		if (!options.orderId)
+			return Toast({
+				title: "缺少订单id,无法退款"
+			}, {
+				tab: 3,
+				url: 1
+			});
+		form.value.uni = options.orderId
+		orderId.value = options.orderId;
+		if (appStore.isLogin) {
+			getOrderInfo();
+			getRefundReason();
+		} else {
+			toLogin();
+		}
+	});
+
+	function onLoadFun() {
+		getOrderInfo();
+		getRefundReason();
+	}
+
+	/**
+	 * 获取订单详情
+	 */
+	function getOrderInfo() {
+		applyRefund(orderId.value).then((res) => {
+			Object.assign(orderInfo, res.data);
+		});
+	}
+
+	/**
+	 * 获取退款理由
+	 */
+	function getRefundReason() {
+		ordeRefundReason().then((res) => {
+			RefundArray.value = res.data;
+			if (res.data.length) {
+				form.value.text = res.data[index.value]
+			}
+		});
+	}
+
+	/**
+	 * 申请退货
+	 */
+	function subRefund(e) {
+		orderRefundVerify(form.value)
+			.then((res) => {
+				return Toast({
+					title: "申请成功",
+					icon: "success"
+				}, {
+					tab: 5,
+					url: "/pages/users/user_return_list/index?isT=1"
+				});
+			})
+			.catch((err) => {
+				return Toast({
+					title: err
+				});
+			});
+	}
+
+	function bindPickerChange(e) {
+		index.value = e.detail.value;
+		form.value.text = RefundArray.value[e.detail.value]
+	}
+
+	function toggleTab() {
+		// 保留原逻辑
+	}
+</script>
+<style>
+	page {
+		background: #F9F7F0;
+	}
 </style>
+<style scoped lang="scss">
+	.apply-return {
+		padding: 16rpx;
+
+		.apply-return-top {
+			padding: 16rpx;
+			border-radius: 16rpx;
+			background: #FFFFFF;
+
+			.apply-return-card {
+				display: flex;
+				margin-bottom: 16rpx;
+
+				image {
+					width: 160rpx;
+					height: 160rpx;
+					margin-right: 16rpx;
+					border-radius: 16rpx;
+				}
+
+				.con {
+					flex: 1;
+
+					.name {
+						font-size: 28rpx;
+						display: flex;
+						font-weight: bold;
+						align-items: center;
+						justify-content: space-between;
+					}
+
+					.num {
+						margin-top: 8rpx;
+						color: #666666;
+						font-size: 24rpx;
+						display: flex;
+						align-items: center;
+						justify-content: space-between;
+					}
+				}
+			}
+
+		}
+
+		.apply-return-top {
+			.item {
+				margin-bottom: 16rpx;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+
+				&:last-child {
+					margin-bottom: 0;
+				}
+
+				color: #333333;
+				font-size: 28rpx;
+
+				.red {
+					color: #FD5F3C;
+					font-weight: bold;
+				}
+			}
+		}
+
+		.list {
+
+
+
+			.item {
+				padding: 0 16rpx;
+				height: 100rpx;
+				margin-top: 16rpx;
+				border-radius: 16rpx;
+				background-color: #fff;
+
+				font-size: 28rpx;
+				color: #333333;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+
+				input {
+					font-size: 28rpx;
+					text-align: right;
+				}
+
+				.num {
+					color: #282828;
+					width: 427rpx;
+					text-align: right;
+
+					.picker {
+						.reason {
+							width: 385rpx;
+						}
+
+
+					}
+				}
+
+				.iconfont {
+					width: 32rpx;
+					height: 32rpx;
+					margin-left: 8rpx;
+				}
+
+				::v-deep .express-num {
+					text-align: right;
+				}
+
+
+
+				.placeholder {
+					color: #bbb;
+				}
+
+				.title {
+					height: 95rpx;
+					width: 100%;
+
+					.tip {
+						font-size: 30rpx;
+						color: #bbb;
+					}
+				}
+
+				.upload {
+					padding-bottom: 36rpx;
+
+					.pictrue {
+						border-radius: 14rpx;
+						margin: 22rpx 23rpx 0 0;
+						width: 156rpx;
+						height: 156rpx;
+						position: relative;
+						font-size: 24rpx;
+						color: #bbb;
+
+						&:nth-of-type(4n) {
+							margin-right: 0;
+						}
+
+						image {
+							width: 100%;
+							height: 100%;
+							border-radius: 14rpx;
+						}
+
+						.icon-guanbi1 {
+							position: absolute;
+							font-size: 45rpx;
+							top: -10rpx;
+							right: -10rpx;
+						}
+
+						.icon-icon25201 {
+							color: #bfbfbf;
+							font-size: 50rpx;
+						}
+
+						&:nth-last-child(1) {
+							border: 1rpx solid #ddd;
+							box-sizing: border-box;
+						}
+					}
+				}
+			}
+
+
+		}
+
+		.textarea {
+			padding: 16rpx;
+			border-radius: 16rpx;
+			margin-top: 16rpx;
+			background: #FFFFFF;
+
+			view {
+				margin-bottom: 16rpx;
+			}
+
+			textarea {
+				width: 100%;
+				padding: 16rpx;
+				font-size: 28rpx;
+				height: 264rpx;
+				background: #F9F7F0;
+				border-radius: 16rpx;
+			}
+		}
+	}
+
+	.kong {
+		height: calc(132rpx + constant(safe-area-inset-bottom));
+		height: calc(132rpx + env(safe-area-inset-bottom));
+		background: #F9F7F0;
+	}
+
+	.footer {
+		padding: 22rpx 32rpx calc(22rpx + constant(safe-area-inset-bottom));
+		padding: 22rpx 32rpx calc(22rpx + env(safe-area-inset-bottom));
+		position: fixed;
+		bottom: 0;
+		width: 100%;
+		background-color: #fff;
+		z-index: 277;
+		box-shadow: inset 0rpx 1rpx 0rpx 0rpx #F1F3F8;
+	}
+
+	.returnBnt {
+		text-align: center;
+		color: #333333;
+		font-size: 32rpx;
+		line-height: 88rpx;
+		border-radius: 16rpx;
+		background: #F8C008;
+		font-weight: bold;
+		&::after {
+			width: 0;
+			border: none;
+		}
+	}
+</style>

+ 2 - 2
pages/users/personal_info/personal_info.vue

@@ -35,7 +35,7 @@
 					<text class="label_width">性别</text>
 					<view class="flex-center-between">
 						<text>{{sexText}}</text>
-						<image style="width: 32rpx;height: 32rpx;" src="/static/images/shop/go@2x.png" mode=""></image>
+						<image style="width: 32rpx;height: 32rpx;" src="/static/images/right.png" mode=""></image>
 					</view>
 				</view>
 				<view class="flex-center-between border-bottom personal-info-item">
@@ -44,7 +44,7 @@
 						:value="valueRegion" :range="multiArray">
 						<view class='flex-center-between'>
 							<view class="picker line1">{{ region[0] }},{{ region[1] }},{{ region[2] }}</view>
-							<image style="width: 32rpx;height: 32rpx;" src="/static/images/shop/go@2x.png" mode=""></image>
+							<image style="width: 32rpx;height: 32rpx;" src="/static/images/right.png" mode=""></image>
 						</view>
 					</picker>
 					

BIN
static/images/close-icon.png


BIN
static/images/delete.png


BIN
static/images/edit-pen.png


BIN
static/images/empty@2x.png


BIN
static/images/plus-icon.png


BIN
static/images/shop/closeOrder@2x.png


BIN
static/images/shop/daifahuo@2x.png


BIN
static/images/shop/daifukuan@2x.png


BIN
static/images/shop/delorder@2x.png


BIN
static/images/shop/dingwei@2x.png


BIN
static/images/shop/yiwancheng@2x.png


BIN
static/images/shuoming.png


+ 8 - 0
stores/app.js

@@ -47,6 +47,8 @@ export const useAppStore = defineStore("app", {
 	  // 首页展示刷新标识,当浏览了新店铺主页/扫店铺码时,改为true,首页onshow时判断true刷新列表并改为false
 	  indexRefreshFlag: false,
 	  cartRefreshFlag: false,
+	  cProductAttr: [],
+	  cProductAttrValue: []
     };
   },
   getters: {
@@ -67,6 +69,12 @@ export const useAppStore = defineStore("app", {
     SET_REFRESH(val) {
       this.refreshArticles = val;
     },
+	SET_CPATTR(val){
+		this.cProductAttr = val
+	},
+	SET_CPATTRVALUE(val){
+		this.cProductAttrValue = val
+	},
     SET_CART_REFRESH(val) {
       this.cartRefreshFlag = val;
     },