fix(api): 修正更新隐私协议的API路径格式

feat(ui): 在顶部导航栏添加客服按钮及样式
添加客服按钮功能,包括获取IM链接和用户信息验证

refactor(order): 重构分销订单状态显示逻辑
统一订单状态显示为"未完成"、"完成"和"退款",并调整对应颜色
This commit is contained in:
pikachu1995@126.com
2025-11-23 16:30:41 +08:00
parent 5f6eb6a26d
commit 756cb28daa
5 changed files with 66 additions and 18 deletions

View File

@@ -114,5 +114,5 @@ export const getPrivacy = (type) => {
}
//修改隐私协议数据
export const updatePrivacy = (id,type,params) => {
return putRequest(`/other/article/updateArticle/${type}?id=${id}`, params, {"Content-Type": "application/json"})
return putRequest(`/other/article/updateArticle/${type}/${id}`, params, {"Content-Type": "application/json"})
}

View File

@@ -210,7 +210,7 @@
},
filterStatus (status) { // 过滤订单状态
const arr = [
{status: 'WAIT_BILL', title: '待结算'},
{status: 'NO_COMPLETED', title: '未完成'},
{status: 'COMPLETE', title: '完成'},
{status: 'REFUND', title: '退款'},
]
@@ -219,21 +219,20 @@
return arr[i].title;
}
}
return '未完成'; // 默认返回未完成
},
filterStatusColor (status) { // 状态tag标签颜色
const arr = [
{status: 'WAIT_BILL', color: 'blue'},
{status: 'WAIT_CASH', color: 'orange'},
{status: 'COMPLETE_CASH', color: 'green'},
{status: 'CANCEL', color: 'red'},
{status: 'NO_COMPLETED', color: 'red'},
{status: 'REFUND', color: 'magenta'},
{status: 'NO_COMPLETED', color: 'orange'},
{status: 'COMPLETE', color: 'green'},
{status: 'REFUND', color: 'red'},
]
for (let i=0;i<arr.length;i++) {
if (arr[i].status === status) {
return arr[i].color;
}
}
return 'orange'; // 默认返回橙色
}
},
mounted() {

View File

@@ -29,6 +29,11 @@
class="user-dropdown-innercon"
>
<ul class="nav-list">
<li class="nav-item " @click="im">
<Tooltip content="联系客服">
<Button type="info" size="small" :loading='load' icon="md-chatbubbles">客服</Button>
</Tooltip>
</li>
<li class="nav-item " @click="handleClickSetting">
<Tooltip content="设置">
<Icon size="16" type="md-settings" />
@@ -88,6 +93,8 @@ import configDrawer from "@/views/main-components/config-drawer.vue";
import Cookies from "js-cookie";
import util from "@/libs/util.js";
import { logout } from "@/api/index";
import { getIMDetail } from "@/api/common";
import { userMsg } from "@/api/index";
const config = require("@/config/index.js");
export default {
components: {
@@ -103,6 +110,8 @@ export default {
userInfo: {}, // 用户信息
storeSideLogo: "", //logo图片
IMLink: "", // IM链接
load: false, // 加载IM状态
};
},
computed: {
@@ -131,6 +140,34 @@ export default {
handleClickSetting() {
this.$refs.config.open();
},
/**
* 点击登录im的时候需要去判断一下当前店铺信息是否失效
* 失效的话重新请求刷新token保证最新的token去访问im
*/
async im () {
// 获取访问Token
let accessToken = this.getStore("accessToken");
this.load = true
await this.getIMDetailMethods();
const userInfo = await userMsg();
this.load = false
if (userInfo.success && this.IMLink) {
window.open(`${this.IMLink}?token=` + accessToken);
}
else{
this.$Message.error("请登录后再联系客服");
}
},
// 获取im信息
async getIMDetailMethods () {
let res = await getIMDetail();
if (res.success) {
this.IMLink = res.result;
}
},
// 初始化方法
init() {
// 菜单

View File

@@ -63,16 +63,14 @@ export default {
width: 100,
sortable: false,
render: (h, params) => {
if (params.row.distributionOrderStatus == "COMPLETE_CASH") {
return h("Tag", { props: { color: "green" } },"提现完成");
} else if (params.row.distributionOrderStatus == "WAIT_BILL") {
return h("Tag", { props: { color: "blue" } } ,"待结算");
} else if (params.row.distributionOrderStatus == "WAIT_CASH") {
return h("Tag", { props: { color: "orange" } }, "待提现");
} else if (params.row.distributionOrderStatus == "CANCEL") {
return h("Tag", { props: { color: "red" } }, "订单已取消");
}else if (params.row.distributionOrderStatus == "REFUND") {
return h("Tag", { props: { color: "magenta" } }, "退款");
if (params.row.distributionOrderStatus == "NO_COMPLETED") {
return h("Tag", { props: { color: "orange" } }, "完成");
} else if (params.row.distributionOrderStatus == "COMPLETE") {
return h("Tag", { props: { color: "green" } }, "完成");
} else if (params.row.distributionOrderStatus == "REFUND") {
return h("Tag", { props: { color: "red" } }, "退款");
} else {
return h("Tag", { props: { color: "orange" } }, "未完成");
}
},

View File

@@ -188,6 +188,20 @@
align-items: center;
}
/* 顶部右侧自定义按钮列表,确保水平排列 */
.nav-list {
display: inline-flex;
align-items: center;
gap: 10px;
list-style: none;
margin: 0;
padding: 0;
}
.nav-list .nav-item {
display: inline-flex;
align-items: center;
}
.full-screen-btn-con {
display: inline-block;