mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-17 16:35:53 +08:00
fix(api): 修正更新隐私协议的API路径格式
feat(ui): 在顶部导航栏添加客服按钮及样式 添加客服按钮功能,包括获取IM链接和用户信息验证 refactor(order): 重构分销订单状态显示逻辑 统一订单状态显示为"未完成"、"完成"和"退款",并调整对应颜色
This commit is contained in:
@@ -114,5 +114,5 @@ export const getPrivacy = (type) => {
|
|||||||
}
|
}
|
||||||
//修改隐私协议数据
|
//修改隐私协议数据
|
||||||
export const updatePrivacy = (id,type,params) => {
|
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"})
|
||||||
}
|
}
|
||||||
@@ -210,7 +210,7 @@
|
|||||||
},
|
},
|
||||||
filterStatus (status) { // 过滤订单状态
|
filterStatus (status) { // 过滤订单状态
|
||||||
const arr = [
|
const arr = [
|
||||||
{status: 'WAIT_BILL', title: '待结算'},
|
{status: 'NO_COMPLETED', title: '未完成'},
|
||||||
{status: 'COMPLETE', title: '完成'},
|
{status: 'COMPLETE', title: '完成'},
|
||||||
{status: 'REFUND', title: '退款'},
|
{status: 'REFUND', title: '退款'},
|
||||||
]
|
]
|
||||||
@@ -219,21 +219,20 @@
|
|||||||
return arr[i].title;
|
return arr[i].title;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return '未完成'; // 默认返回未完成
|
||||||
},
|
},
|
||||||
filterStatusColor (status) { // 状态tag标签颜色
|
filterStatusColor (status) { // 状态tag标签颜色
|
||||||
const arr = [
|
const arr = [
|
||||||
{status: 'WAIT_BILL', color: 'blue'},
|
{status: 'NO_COMPLETED', color: 'orange'},
|
||||||
{status: 'WAIT_CASH', color: 'orange'},
|
{status: 'COMPLETE', color: 'green'},
|
||||||
{status: 'COMPLETE_CASH', color: 'green'},
|
{status: 'REFUND', color: 'red'},
|
||||||
{status: 'CANCEL', color: 'red'},
|
|
||||||
{status: 'NO_COMPLETED', color: 'red'},
|
|
||||||
{status: 'REFUND', color: 'magenta'},
|
|
||||||
]
|
]
|
||||||
for (let i=0;i<arr.length;i++) {
|
for (let i=0;i<arr.length;i++) {
|
||||||
if (arr[i].status === status) {
|
if (arr[i].status === status) {
|
||||||
return arr[i].color;
|
return arr[i].color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return 'orange'; // 默认返回橙色
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|||||||
@@ -29,6 +29,11 @@
|
|||||||
class="user-dropdown-innercon"
|
class="user-dropdown-innercon"
|
||||||
>
|
>
|
||||||
<ul class="nav-list">
|
<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">
|
<li class="nav-item " @click="handleClickSetting">
|
||||||
<Tooltip content="设置">
|
<Tooltip content="设置">
|
||||||
<Icon size="16" type="md-settings" />
|
<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 Cookies from "js-cookie";
|
||||||
import util from "@/libs/util.js";
|
import util from "@/libs/util.js";
|
||||||
import { logout } from "@/api/index";
|
import { logout } from "@/api/index";
|
||||||
|
import { getIMDetail } from "@/api/common";
|
||||||
|
import { userMsg } from "@/api/index";
|
||||||
const config = require("@/config/index.js");
|
const config = require("@/config/index.js");
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -103,6 +110,8 @@ export default {
|
|||||||
userInfo: {}, // 用户信息
|
userInfo: {}, // 用户信息
|
||||||
|
|
||||||
storeSideLogo: "", //logo图片
|
storeSideLogo: "", //logo图片
|
||||||
|
IMLink: "", // IM链接
|
||||||
|
load: false, // 加载IM状态
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -131,6 +140,34 @@ export default {
|
|||||||
handleClickSetting() {
|
handleClickSetting() {
|
||||||
this.$refs.config.open();
|
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() {
|
init() {
|
||||||
// 菜单
|
// 菜单
|
||||||
|
|||||||
@@ -63,16 +63,14 @@ export default {
|
|||||||
width: 100,
|
width: 100,
|
||||||
sortable: false,
|
sortable: false,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.distributionOrderStatus == "COMPLETE_CASH") {
|
if (params.row.distributionOrderStatus == "NO_COMPLETED") {
|
||||||
return h("Tag", { props: { color: "green" } },"提现完成");
|
return h("Tag", { props: { color: "orange" } }, "未完成");
|
||||||
} else if (params.row.distributionOrderStatus == "WAIT_BILL") {
|
} else if (params.row.distributionOrderStatus == "COMPLETE") {
|
||||||
return h("Tag", { props: { color: "blue" } } ,"待结算");
|
return h("Tag", { props: { color: "green" } }, "完成");
|
||||||
} else if (params.row.distributionOrderStatus == "WAIT_CASH") {
|
} else if (params.row.distributionOrderStatus == "REFUND") {
|
||||||
return h("Tag", { props: { color: "orange" } }, "待提现");
|
return h("Tag", { props: { color: "red" } }, "退款");
|
||||||
} else if (params.row.distributionOrderStatus == "CANCEL") {
|
} else {
|
||||||
return h("Tag", { props: { color: "red" } }, "订单已取消");
|
return h("Tag", { props: { color: "orange" } }, "未完成");
|
||||||
}else if (params.row.distributionOrderStatus == "REFUND") {
|
|
||||||
return h("Tag", { props: { color: "magenta" } }, "退款");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -188,6 +188,20 @@
|
|||||||
align-items: center;
|
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 {
|
.full-screen-btn-con {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|||||||
Reference in New Issue
Block a user