Compare commits

..

No commits in common. "9dffbedf94a6edb5ee55a21fb4b825fc3baca1d0" and "0a71636436147821ecc9eee664c53bb045c4d8f7" have entirely different histories.

5 changed files with 209 additions and 179 deletions

View File

@ -1,3 +0,0 @@
export const apiArr = {
orderList: '/api/v2/wechat/commodity/order', // 商品订单列表
}

View File

@ -19,7 +19,8 @@
/* */ /* */
"modules" : { "modules" : {
"Payment" : {}, "Payment" : {},
"OAuth" : {} "OAuth" : {},
"Share" : {}
}, },
/* */ /* */
"distribute" : { "distribute" : {
@ -51,7 +52,7 @@
"appleiap" : {}, "appleiap" : {},
"weixin" : { "weixin" : {
"__platform__" : [ "ios", "android" ], "__platform__" : [ "ios", "android" ],
"appid" : "", "appid" : "wxb4018c78fa143450",
"UniversalLinks" : "" "UniversalLinks" : ""
} }
}, },
@ -60,6 +61,12 @@
"appid" : "wxb4018c78fa143450", "appid" : "wxb4018c78fa143450",
"UniversalLinks" : "" "UniversalLinks" : ""
} }
},
"share" : {
"weixin" : {
"appid" : "wxb4018c78fa143450",
"UniversalLinks" : ""
}
} }
} }
} }

View File

@ -17,27 +17,26 @@
<view v-for="(item, index) in orderData" :key="index"> <view v-for="(item, index) in orderData" :key="index">
<view class="contentList"> <view class="contentList">
<!-- 订单头部信息 --> <!-- 订单头部信息 -->
<view class="order-header" @click="toDetails(item.order_status)"> <view class="order-header" @click="toDetails(item.status)">
<text>提交订单{{ item.order_time }}</text> <text>提交订单{{ item.createTime }}</text>
<view <view
v-if="item.order_status == 6 || item.order_status == 5" v-if="item.status == '已取消' || item.status == '已完成'"
class="status3" class="status3"
>{{ getOrderStatus(item.order_status) }}</view >{{ item.status }}</view
> >
<view v-else-if="item.order_status == 7" class="status2"> <view v-else-if="item.status == '退款中'" class="status2">
<img src="http://localhost:8080/refund.png" /> <img
{{ getOrderStatus(item.order_status) }} src="http://localhost:8080/refund.png"
/>
{{ item.status }}
</view> </view>
<view v-else class="order_status">{{ <view v-else class="status">{{ item.status }}</view>
getOrderStatus(item.order_status)
}}</view>
</view> </view>
<!-- 商品列表 --> <!-- 商品列表 -->
<view class="goods-list" @click="toDetails(item.order_status)"> <view class="goods-list" @click="toDetails(item.status)">
<view <view
v-for="(goods, goodsIndex) in item.commodity_order_item_list v-for="(goods, goodsIndex) in item.goodsList"
.commodity_pic"
:key="goodsIndex" :key="goodsIndex"
class="goods-item" class="goods-item"
> >
@ -47,30 +46,28 @@
<!-- 订单底部信息 --> <!-- 订单底部信息 -->
<view class="order-footer"> <view class="order-footer">
<view <view class="order-footer-text" @click="toDetails(item.status)"
class="order-footer-text" >{{ item.totalCount }}件商品共计
@click="toDetails(item.order_status)" <text> {{ item.totalPrice }}</text>
>{{ item.total_count }}件商品共计
<text> {{ item.total_amount }}</text>
</view> </view>
<view> <view>
<view class="btn-group" v-if="item.order_status === 1"> <view class="btn-group" v-if="item.status === '待付款'">
<button class="cancel-btn" @click="cancelOrder"> <button class="cancel-btn" @click="cancelOrder">
取消订单 取消订单
</button> </button>
<button class="yfd-btn" @click="cancelOrder">运费单</button> <button class="yfd-btn" @click="cancelOrder">运费单</button>
<button class="pay-btn" @click="goToPay">立即支付</button> <button class="pay-btn" @click="goToPay">立即支付</button>
</view> </view>
<view class="btn-group" v-if="item.order_status === 3"> <view class="btn-group" v-if="item.status === '待发货'">
<button class="yfd-btn" @click="cancelOrder">运费单</button> <button class="yfd-btn" @click="cancelOrder">运费单</button>
</view> </view>
<view class="btn-group" v-if="item.order_status === 6"> <view class="btn-group" v-if="item.status === '已取消'">
<button class="yfd-btn" @click="cancelOrder">运费单</button> <button class="yfd-btn" @click="cancelOrder">运费单</button>
<button class="pay-btn" @click="cancelOrder"> <button class="pay-btn" @click="cancelOrder">
再来一单 再来一单
</button> </button>
</view> </view>
<view class="btn-group" v-if="item.order_status === 4"> <view class="btn-group" v-if="item.status === '配送中'">
<button class="cancel-btn" @click="checkLogistics"> <button class="cancel-btn" @click="checkLogistics">
查看物流 查看物流
</button> </button>
@ -79,7 +76,7 @@
再来一单 再来一单
</button> </button>
</view> </view>
<view class="btn-group" v-if="item.order_status === 5"> <view class="btn-group" v-if="item.status === '已完成'">
<button class="cancel-btn" @click="orderEvaluate"> <button class="cancel-btn" @click="orderEvaluate">
服务评价 服务评价
</button> </button>
@ -88,7 +85,7 @@
再来一单 再来一单
</button> </button>
</view> </view>
<view class="btn-group" v-if="item.order_status === 7"> <view class="btn-group" v-if="item.status === '退款中'">
<button class="pay-btn" @click="cancelOrder"> <button class="pay-btn" @click="cancelOrder">
再来一单 再来一单
</button> </button>
@ -103,8 +100,7 @@
</view> </view>
</template> </template>
<script> <script>
import { picUrl, NavgateTo, request } from "../../../utils"; import { picUrl, NavgateTo } from "../../../utils";
import { apiArr } from "../../../api/order"
export default { export default {
data() { data() {
@ -117,13 +113,91 @@ export default {
{ category_name: "已完成" }, { category_name: "已完成" },
], ],
selectedTab: 0, selectedTab: 0,
orderData:[], orderData: [
{
createTime: "2025-07-15 23:23:23",
status: "待付款",
goodsList: [
{ image: "http://localhost:8080/order_index1.png" },
{ image: "http://localhost:8080/order_index2.png" },
{ image: "http://localhost:8080/order_index3.png" },
{ image: "http://localhost:8080/order_index4.png" },
{ image: "http://localhost:8080/order_index5.png" },
],
totalCount: 1,
totalPrice: "¥4704.00",
},
{
createTime: "2025-07-15 23:23:23",
status: "待发货",
goodsList: [
{ image: "http://localhost:8080/order_index1.png" },
{ image: "http://localhost:8080/order_index2.png" },
{ image: "http://localhost:8080/order_index3.png" },
{ image: "http://localhost:8080/order_index4.png" },
{ image: "http://localhost:8080/order_index5.png" },
],
totalCount: 2,
totalPrice: "¥4704.00",
},
{
createTime: "2025-07-15 23:23:23",
status: "已取消",
goodsList: [
{ image: "http://localhost:8080/order_index1.png" },
{ image: "http://localhost:8080/order_index2.png" },
{ image: "http://localhost:8080/order_index3.png" },
{ image: "http://localhost:8080/order_index4.png" },
{ image: "http://localhost:8080/order_index5.png" },
],
totalCount: 3,
totalPrice: "¥4704.00",
},
{
createTime: "2025-07-15 23:23:23",
status: "配送中",
goodsList: [
{ image: "http://localhost:8080/order_index1.png" },
{ image: "http://localhost:8080/order_index2.png" },
{ image: "http://localhost:8080/order_index3.png" },
{ image: "http://localhost:8080/order_index4.png" },
{ image: "http://localhost:8080/order_index5.png" },
],
totalCount: 2,
totalPrice: "¥4704.00",
},
{
createTime: "2025-07-15 23:23:23",
status: "已完成",
goodsList: [
{ image: "http://localhost:8080/order_index1.png" },
{ image: "http://localhost:8080/order_index2.png" },
{ image: "http://localhost:8080/order_index3.png" },
{ image: "http://localhost:8080/order_index4.png" },
{ image: "http://localhost:8080/order_index5.png" },
],
totalCount: 3,
totalPrice: "¥4704.00",
},
{
createTime: "2025-07-15 23:23:23",
status: "退款中",
goodsList: [
{ image: "http://localhost:8080/order_index1.png" },
{ image: "http://localhost:8080/order_index2.png" },
{ image: "http://localhost:8080/order_index3.png" },
{ image: "http://localhost:8080/order_index4.png" },
{ image: "http://localhost:8080/order_index5.png" },
],
totalCount: 3,
totalPrice: "¥4704.00",
},
],
}; };
}, },
methods: { methods: {
selectTab(index, item) { selectTab(index, item) {
this.selectedTab = index; this.selectedTab = index;
this.getOrderList()
}, },
cancelOrder() { cancelOrder() {
// //
@ -140,8 +214,8 @@ export default {
goToPay() { goToPay() {
console.log("🚀 ~ goToPay ~ goToPay:", "去支付..."); console.log("🚀 ~ goToPay ~ goToPay:", "去支付...");
}, },
toDetails(order_status) { toDetails(status) {
NavgateTo(`/packages/myOrders/orderDetails/index?order_status=${order_status}`); NavgateTo(`/packages/myOrders/orderDetails/index?status=${status}`);
}, },
checkLogistics() { checkLogistics() {
@ -150,56 +224,8 @@ export default {
orderEvaluate(){ orderEvaluate(){
NavgateTo(`/packages/myOrders/orderEvaluate/index`); NavgateTo(`/packages/myOrders/orderEvaluate/index`);
},
getOrderStatus(order_status){
switch(order_status){
case 1:
return '待付款'
case 2:
return '支付中'
case 3:
return '待发货'
case 4:
return '配送中'
case 5:
return '已完成'
case 6:
return '已取消'
case 7:
return '退款中'
case 8:
return '已退款'
}
},
getOrderList(){
request(apiArr.orderList, "POST", {
user_id: uni.getStorageSync('userId')
}).then(res => {
const orderList = res.order_list || [];
let filteredData = orderList;
if (this.selectedTab !== 0) {
const statusMap = {
1: 1, //
2: 3, //
3: 4, //
4: 5 //
};
const targetStatus = statusMap[this.selectedTab];
if (targetStatus) {
filteredData = orderList.filter(item => item.order_status === targetStatus);
}
}
this.orderData = filteredData;
})
} }
}, },
onLoad(options) {
this.getOrderList();
},
}; };
</script> </script>
<style> <style>

View File

@ -8,15 +8,15 @@
"miniprogram": { "miniprogram": {
"list": [ "list": [
{ {
"name": "packages/shop/address/index", "name": "packages/shop/goods/index",
"pathName": "packages/shop/address/index", "pathName": "packages/shop/goods/index",
"query": "", "query": "id=30",
"scene": null, "scene": null,
"launchMode": "default" "launchMode": "default"
}, },
{ {
"name": "packages/shop/addAddress/index", "name": "packages/shop/shopCar/index",
"pathName": "packages/shop/addAddress/index", "pathName": "packages/shop/shopCar/index",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null