From fb187e6acc0c9e908da313bf267e4681e9e78ee6 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期三, 25 六月 2025 20:36:12 +0800
Subject: [PATCH] update 商户端查看订单
---
pages/tabbar/user/utils/tool.vue | 5
pages/supplier/suppler-order/suppler-order.vue | 666 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
pages.json | 11
static/mine/order.png | 0
4 files changed, 681 insertions(+), 1 deletions(-)
diff --git a/pages.json b/pages.json
index 553798b..a606eaf 100644
--- a/pages.json
+++ b/pages.json
@@ -1447,7 +1447,18 @@
"navigationBarTitleText": "鍘ㄧ"
}
}]
+ },
+ {
+ "root": "pages/supplier",
+ "pages": [{
+ "path" : "suppler-order/suppler-order",
+ "style" :
+ {
+ "navigationBarTitleText" : ""
+ }
+ }]
}
+
// ,
// {
// "root": "pages/commodity-square",
diff --git a/pages/supplier/suppler-order/suppler-order.vue b/pages/supplier/suppler-order/suppler-order.vue
new file mode 100644
index 0000000..df4e95d
--- /dev/null
+++ b/pages/supplier/suppler-order/suppler-order.vue
@@ -0,0 +1,666 @@
+<template>
+ <view class="content">
+ <view class="navbar">
+ <view
+ v-for="(item, index) in navList"
+ :key="index"
+ class="nav-item"
+ :class="{ current: tabCurrentIndex === index }"
+ @click="tabClick(index)"
+ >{{ item.text }}</view
+ >
+ </view>
+ <swiper
+ :current="tabCurrentIndex"
+ class="swiper-box"
+ duration="300"
+ @change="changeTab"
+ >
+ <swiper-item
+ class="tab-content"
+ v-for="(tabItem, tabIndex) in navList"
+ :key="tabIndex"
+ >
+ <scroll-view
+ class="list-scroll-content"
+ scroll-y
+ @scrolltolower="loadData(tabIndex)"
+ >
+ <!-- 绌虹櫧椤� -->
+ <u-empty
+ text="鏆傛棤璁㈠崟"
+ mode="list"
+ v-if="tabItem.loaded === true && tabItem.orderList.length === 0"
+ ></u-empty>
+ <!-- 璁㈠崟鍒楄〃 -->
+ <view
+ class="seller-view"
+ :key="oderIndex"
+ v-for="(order, oderIndex) in tabItem.orderList"
+ >
+ <!-- 搴楅摵鍚嶇О -->
+ <view class="seller-info u-flex u-row-between">
+ <view class="seller-name wes" >
+ <view class="name wes">{{ order.storeName }}</view>
+ </view>
+ <view class="order-sn">{{
+ order.orderStatus | orderStatusList
+ }}</view>
+ </view>
+ <view>
+ <view>
+ <view
+ class="goods-item-view"
+ >
+ <view
+ class="goods-img"
+ v-for="(goods, goodsIndex) in order.orderItems"
+ :key="goodsIndex"
+ >
+ <u-image
+ border-radius="6"
+ width="100%"
+ height="100%"
+ :src="goods.image"
+ ></u-image>
+ </view>
+ <view class="goods-info">
+ <view
+ v-if="order.orderItems.length <= 1"
+ class="goods-title u-line-2"
+ >{{ order.groupName }}</view
+ >
+ <view
+ v-if="order.orderItems.length <= 1"
+ class="goods-price"
+ >
+ 锟{ order.flowPrice | unitPrice }}
+ </view>
+ </view>
+ <view v-if="order.orderItems.length <= 1" class="goods-num">
+ <view>x{{ order.groupNum }}</view>
+ </view>
+ </view>
+ </view>
+ <view class="btn-view u-flex u-row-between">
+ <view class="description">
+ <!-- 绛夊緟浠樻 -->
+ <div v-if="order.payStatus === 'PAID'">宸蹭粯閲戦:</div>
+ <div v-else>搴斾粯閲戦:</div>
+ <div class="price">锟{ order.flowPrice | unitPrice }}</div>
+ </view>
+ <view class="goods-btn flex flex-a-c">
+ <!-- 鍏ㄩ儴 -->
+ <view
+ ripple
+ class="rebuy-btn"
+ shape="circle"
+ size="mini"
+ v-if="order.allowOperationVO.pay"
+ @click="selectPhone(order.sn)"
+ >鏌ョ湅鑱旂郴鏂瑰紡</view
+ >
+ <view
+ ripple
+ class="rebuy-btn"
+ shape="circle"
+ size="mini"
+ v-if="order.orderStatus==='UNDELIVERED'"
+ >鍙戣揣</view
+ >
+ <!-- 绛夊緟鏀惰揣 -->
+ <view
+ ripple
+ shape="circle"
+ class="rebuy-btn"
+ size="mini"
+ v-if="order.allowOperationVO.showLogistics"
+ @click="navigateToLogistics(order)"
+ >
+ 鏌ョ湅鐗╂祦
+ </view>
+ </view>
+ </view>
+ </view>
+ </view>
+ <uni-load-more :status="tabItem.loadStatus"></uni-load-more>
+ </scroll-view>
+ </swiper-item>
+ </swiper>
+ </uni-popup>
+ </view>
+</template>
+
+<script>
+import '@/components/uview-components/uview-ui';
+import { getOrderXcxList, cancelOrder, confirmReceipt ,getOrderDetail} from "@/api/order.js";
+import { getClearReason } from "@/api/after-sale.js";
+import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
+export default {
+
+ data() {
+ return {
+ lightColor: this.$lightColor,
+ tabCurrentIndex: 0, //瀵艰埅鏍忕储寮�
+ userInfo:{
+ name:'',
+ phone:'',
+ address:''
+ },
+ navList: [
+ //瀵艰埅鏍弆ist
+ // {
+ // state: 0,
+ // text: "鍏ㄩ儴",
+ // loadStatus: "more",
+ // orderList: [],
+ // pageNumber: 1,
+ // },
+ {
+ state: 1,
+ text: "寰呬粯娆�",
+ loadStatus: "more",
+ orderList: [],
+ pageNumber: 1,
+ },
+ {
+ state: 2,
+ text: "寰呭彂璐�",
+ loadStatus: "more",
+ orderList: [],
+ pageNumber: 1,
+ },
+ {
+ state: 3,
+ text: "宸插彂璐�",
+ loadStatus: "more",
+ orderList: [],
+ pageNumber: 1,
+ },
+ // {
+ // state: 4,
+ // text: "宸插畬鎴�",
+ // loadStatus: "more",
+ // orderList: [],
+ // pageNumber: 1,
+ // },
+ // {
+ // state: 5,
+ // text: "宸插彇娑�",
+ // loadStatus: "more",
+ // orderList: [],
+ // pageNumber: 1,
+ // },
+ ],
+ status: "", //鎺ユ敹瀵艰埅鏍忕姸鎬�
+ params: {
+ pageNumber: 1,
+ pageSize: 10,
+ tag: "WAIT_PAY",
+ },
+ orderStatus: [
+ //璁㈠崟鐘舵��
+ // {
+ // orderStatus: "ALL", //鍏ㄩ儴
+ // },
+ {
+ orderStatus: "WAIT_PAY", //浠d粯娆�
+ },
+ {
+ orderStatus: "WAIT_SHIP",
+ },
+ {
+ orderStatus: "WAIT_ROG", //寰呮敹璐�
+ },
+ // {
+ // orderStatus: "COMPLETE", //宸插畬鎴�
+ // },
+ // {
+ // orderStatus: "CANCELLED", //宸插彇娑�
+ // },
+ // {
+ // orderStatus: "STAY_PICKED_UP", //寰呰嚜鎻�
+ // },
+ ],
+ cancelShow: false, //鏄惁鏄剧ず鍙栨秷
+ orderSn: "", //ordersn
+ reason: "", //鍙栨秷鍘熷洜
+ cancelList: "", //鍙栨秷鍒楄〃
+ rogShow: false, //鏄剧ず鏄惁鏀惰揣
+ };
+ },
+
+ /**
+ * 璺宠浆鍒颁釜浜轰腑蹇�
+ */
+ onBackPress(e) {
+ if (e.from == "backbutton") {
+ uni.switchTab({
+ url: "/pages/tabbar/user/my",
+ });
+ return true; //闃绘榛樿杩斿洖琛屼负
+ }
+ },
+ onPullDownRefresh() {
+ if (this.tabCurrentIndex) {
+ this.initData(this.tabCurrentIndex);
+ } else {
+ this.initData(0);
+ }
+ // this.loadData(this.status);
+ },
+ onShow() {
+ if(this.$options.filters.tipsToLogin()){
+ if (!this.tabCurrentIndex) {
+ this.initData(0);
+ }
+ }
+ // this.loadData(this.status);
+ },
+
+ onLoad(options) {
+ /**
+ * 淇app绔偣鍑婚櫎鍏ㄩ儴璁㈠崟澶栫殑鎸夐挳杩涘叆鏃朵笉鍔犺浇鏁版嵁鐨勯棶棰�
+ * 鏇挎崲onLoad涓嬩唬鐮佸嵆鍙�
+ */
+ let status = Number(options.status);
+ this.status = status;
+
+ this.tabCurrentIndex = status;
+ // if (status == 0) {
+ // this.loadData(status);
+ // }
+ },
+
+ watch: {
+ /**鐩戝惉鏇存敼璇锋眰鏁版嵁 */
+ tabCurrentIndex(val) {
+ this.params.tag = this.orderStatus[val].orderStatus;
+ //鍒囨崲鏍囩椤靛皢鎵�鏈夌殑椤垫暟閮介噸缃负1
+ this.navList.forEach((res) => {
+ res.pageNumber = 1;
+ res.loadStatus = "more";
+ res.orderList = [];
+ });
+ this.loadData(val);
+ },
+ },
+ methods: {
+ async selectPhone(sn){
+ const orderInfo = await getOrderDetail(sn)
+ console.log('----------------->',orderInfo)
+ this.userInfo = {};
+ this.userInfo.name = orderInfo.data.result.order.consigneeName
+ this.userInfo.phone =orderInfo.data.result.order.consigneeMobile
+ this.userInfo.address = orderInfo.data.result.order.consigneeAddressPath
+
+ uni.showModal({
+ title:"鐢ㄦ埛鑱旂郴鐢佃瘽",
+ content:orderInfo.data.result.order.consigneeMobile
+ })
+
+ },
+ /**
+ * 鍒濆鍖栨暟鎹�
+ */
+ initData(index) {
+ this.navList[index].pageNumber = 1;
+ this.navList[index].loadStatus = "more";
+ this.navList[index].orderList = [];
+ this.loadData(index);
+ },
+
+ /**
+ * 鑾峰彇璁㈠崟鍒楄〃
+ */
+ loadData(index) {
+ this.params.pageNumber = this.navList[index].pageNumber;
+ // this.params.tag = this.orderStatus[index].orderStatus;
+ getOrderXcxList(this.params).then((res) => {
+ uni.stopPullDownRefresh();
+ if (!res.data.success) {
+ this.navList[index].loadStatus = "noMore";
+ return false;
+ }
+ let orderList = res.data.result.records;
+ if (orderList.length == 0) {
+ this.navList[index].loadStatus = "noMore";
+ } else if (orderList.length < 10) {
+ this.navList[index].loadStatus = "noMore";
+ }
+ if (orderList.length > 0) {
+ this.navList[index].orderList =
+ this.navList[index].orderList.concat(orderList);
+ this.navList[index].pageNumber += 1;
+ }
+ });
+ },
+ //swiper 鍒囨崲鐩戝惉
+ changeTab(e) {
+ this.tabCurrentIndex = e.target.current;
+ },
+ //椤堕儴tab鐐瑰嚮
+ tabClick(index) {
+ this.tabCurrentIndex = index;
+ },
+
+ //璁㈠崟鐘舵�佹枃瀛楀拰棰滆壊
+ orderStateExp(state) {
+ let stateTip = "",
+ stateTipColor = this.$lightColor;
+ switch (+state) {
+ case 1:
+ stateTip = "寰呬粯娆�";
+ break;
+ case 2:
+ stateTip = "寰呭彂璐�";
+ break;
+ case 9:
+ stateTip = "璁㈠崟宸插叧闂�";
+ stateTipColor = "#909399";
+ break;
+
+ //鏇村鑷畾涔�
+ }
+ return {
+ stateTip,
+ stateTipColor,
+ };
+ },
+ /**
+ * 閫夋嫨鍙栨秷鍘熷洜
+ */
+ reasonChange(reason) {
+ this.reason = reason;
+ },
+
+ /**
+ * 鎻愪氦鍙栨秷璁㈠崟锛堟湭浠樻锛�
+ */
+ submitCancel() {
+ cancelOrder(this.orderSn, { reason: this.reason }).then((res) => {
+ if (res.data.success) {
+ uni.showToast({
+ title: "璁㈠崟宸插彇娑�",
+ duration: 2000,
+ icon: "none",
+ });
+ this.initData(this.tabCurrentIndex);
+
+ this.cancelShow = false;
+ } else {
+ uni.showToast({
+ title: res.data.message,
+ duration: 2000,
+ icon: "none",
+ });
+ this.cancelShow = false;
+ }
+ });
+ },
+
+ /**
+ * 纭鏀惰揣鏄剧ず
+ */
+ onRog(sn) {
+ this.orderSn = sn;
+ this.rogShow = true;
+ },
+
+ /**
+ * 鐐瑰嚮纭鏀惰揣
+ */
+ confirmRog() {
+ confirmReceipt(this.orderSn).then((res) => {
+ if (res.data.code == 200) {
+ uni.showToast({
+ title: "宸茬‘璁ゆ敹璐�",
+ duration: 2000,
+ icon: "none",
+ });
+ this.initData(this.tabCurrentIndex);
+ this.rogShow = false;
+ }
+ });
+ },
+
+ /**
+ * 璇勪环鍟嗗搧
+ */
+ onComment(sn) {
+ uni.navigateTo({
+ url: "./evaluate/myEvaluate",
+ });
+ },
+
+ /**
+ * 閲嶆柊璐拱
+ */
+ reBuy(order) {
+ console.log(order);
+ return;
+ uni.navigateTo({
+ url:
+ "/pages/product/goods?id=" + order.id + "&goodsId=" + order.goodsId,
+ });
+ },
+
+ /**
+ * 鏌ョ湅鐗╂祦
+ */
+ navigateToLogistics(order) {
+ uni.navigateTo({
+ url:
+ "/pages/mine/msgTips/packageMsg/logisticsDetail?order_sn=" + order.sn,
+ });
+ },
+ },
+};
+</script>
+
+<style lang="scss" scoped>
+page,
+.content {
+ background: $page-color-base;
+ height: 100%;
+}
+
+.swiper-box {
+ height: calc(100vh - 40px);
+ // #ifdef H5
+ height: calc(100vh - 40px - 44px);
+ // #endif
+}
+
+.list-scroll-content {
+ height: 100%;
+}
+
+.navbar {
+ display: flex;
+ height: 40px;
+ padding: 0 5px;
+ background: #fff;
+ box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
+ position: relative;
+ z-index: 10;
+
+ .nav-item {
+ flex: 1;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100%;
+ font-size: 26rpx;
+ color: $font-color-light;
+ position: relative;
+
+ &.current {
+ color: $main-color;
+
+ &:after {
+ content: "";
+ position: absolute;
+ left: 50%;
+ bottom: 0;
+ transform: translateX(-50%);
+ width: 44px;
+ height: 0;
+ border-bottom: 2px solid $main-color;
+ }
+ }
+ }
+}
+
+.uni-swiper-item {
+ height: auto;
+}
+
+.seller-view {
+ border-radius: 20rpx;
+ background-color: #fff;
+ margin: 20rpx 0rpx;
+
+ .seller-info {
+ height: 70rpx;
+ padding: 0 20rpx;
+
+ .seller-name {
+ flex:10;
+ font-size: 28rpx;
+ font-weight: 600;
+ display: flex;
+ flex-direction: row;
+
+ .name {
+ margin-left: 15rpx;
+ margin-top: -2rpx;
+ }
+ }
+
+ .order-sn {
+ flex:2;
+ width:120rpx;
+ text-align: center;
+ color: $aider-light-color;
+ font-size: 26rpx;
+ }
+ }
+
+ .goods-item-view {
+ display: flex;
+ flex-wrap: wrap;
+ flex-direction: row;
+ padding: 10rpx 20rpx;
+
+ .goods-img {
+ width: 131rpx;
+ height: 131rpx;
+ margin-right: 10rpx;
+ margin-bottom: 10rpx;
+ }
+
+ .goods-info {
+ padding-left: 30rpx;
+ flex: 1;
+
+ .goods-title {
+ margin-bottom: 10rpx;
+ color: #333333;
+ }
+
+ .goods-specs {
+ font-size: 24rpx;
+ margin-bottom: 10rpx;
+ color: #cccccc;
+ }
+
+ .goods-price {
+ font-size: 28rpx;
+ margin-bottom: 10rpx;
+ color: $aider-light-color;
+ }
+ }
+
+ .goods-num {
+ width: 60rpx;
+ color: $main-color;
+ }
+ }
+
+ .btn-view {
+ padding: 25rpx 30rpx;
+ font-size: 26rpx;
+
+ .description {
+ display: flex;
+ color: #909399;
+ size: 24rpx;
+ flex: 1;
+ .price {
+ color: $main-color;
+
+ }
+ }
+ }
+}
+
+.cancel-popup {
+ .header {
+ display: flex;
+ flex-direction: row;
+ justify-content: center;
+ margin: 15rpx 0rpx;
+ }
+
+ .body {
+ padding: 30rpx;
+
+ .title {
+ font-weight: 600;
+ }
+
+ .value {
+ display: flex;
+ flex-direction: column;
+ margin: 20rpx 0;
+ .radio-view {
+ margin: 20rpx 0rpx;
+ }
+ }
+ }
+
+ .footer {
+ text-align: center;
+ }
+}
+.goods-btn{
+ display: flex;
+}
+.cancel-btn,.pay-btn,.rebuy-btn{
+ text-align: center;
+ margin-left: 15rpx;
+ font-size: 24rpx;
+ padding: 14rpx 20rpx;
+ border-radius: 100px;
+
+}
+.cancel-btn {
+ color: #333639 !important;
+ background: rgba(46, 51, 56, .05) !important;
+}
+
+.pay-btn {
+
+ background-color: $light-color !important;
+
+ color: #ffffff !important;
+}
+
+.rebuy-btn {
+ color: $light-color !important;
+ border-color: $light-color !important;
+ background-color: #ffffff !important;
+}
+</style>
+
diff --git a/pages/tabbar/user/utils/tool.vue b/pages/tabbar/user/utils/tool.vue
index 9bf9844..8ab95d7 100644
--- a/pages/tabbar/user/utils/tool.vue
+++ b/pages/tabbar/user/utils/tool.vue
@@ -127,7 +127,10 @@
<image src="/static/mine/setting.png" mode=""></image>
<view>鍟嗗搧绠$悊</view>
</view>
-
+ <view class="interact-item" @click="navigateTo('/pages/goods-manager/goodsList/goodsList')">
+ <image src="/static/mine/order.png" mode=""></image>
+ <view>鍟嗘埛璁㈠崟绠$悊</view>
+ </view>
</view>
</div>
diff --git a/static/mine/order.png b/static/mine/order.png
new file mode 100644
index 0000000..8b3ad56
--- /dev/null
+++ b/static/mine/order.png
Binary files differ
--
Gitblit v1.8.0