Compare commits
15 Commits
8ef6f944dc
...
ed4c8efc82
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ed4c8efc82 | ||
![]() |
b4a706820e | ||
![]() |
376a3223dc | ||
![]() |
a85ec69549 | ||
![]() |
ebf4d6d3eb | ||
![]() |
2ccd8265b9 | ||
![]() |
fb1671d062 | ||
![]() |
95e37df2ec | ||
![]() |
cfde72f1ab | ||
![]() |
efc778acbc | ||
![]() |
37384ebadd | ||
![]() |
9a7aee7e97 | ||
![]() |
1a56534d28 | ||
![]() |
79e7e5f087 | ||
![]() |
aea03cf975 |
@ -32,6 +32,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vue/cli-service": "~4.5.0",
|
"@vue/cli-service": "~4.5.0",
|
||||||
"compression-webpack-plugin": "^5.0.0",
|
"compression-webpack-plugin": "^5.0.0",
|
||||||
|
"gulp-sass": "^6.0.0",
|
||||||
"sass-loader": "^7.3.1",
|
"sass-loader": "^7.3.1",
|
||||||
"uglifyjs-webpack-plugin": "^2.2.0",
|
"uglifyjs-webpack-plugin": "^2.2.0",
|
||||||
"vue-template-compiler": "^2.6.11"
|
"vue-template-compiler": "^2.6.11"
|
||||||
@ -40,5 +41,10 @@
|
|||||||
"> 1%",
|
"> 1%",
|
||||||
"last 2 versions",
|
"last 2 versions",
|
||||||
"not dead"
|
"not dead"
|
||||||
]
|
],
|
||||||
|
"description": "```\r npm install\r ```",
|
||||||
|
"main": ".eslintrc.js",
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC"
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
var BASE = {
|
var BASE = {
|
||||||
/**
|
/**
|
||||||
* @description api请求基础路径
|
* @description api请求基础路径
|
||||||
*/
|
*/
|
||||||
API_DEV: {
|
API_DEV: {
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "http://192.168.1.200:8890",
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
buyer: "http://192.168.1.200:8888",
|
||||||
seller: "https://store-api.pickmall.cn",
|
seller: "http://192.168.1.200:8889",
|
||||||
manager: "https://admin-api.pickmall.cn"
|
manager: "http://192.168.1.200:8887"
|
||||||
},
|
},
|
||||||
API_PROD: {
|
API_PROD: {
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "https://common-api.pickmall.cn",
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
buyer: "https://buyer-api.pickmall.cn",
|
||||||
seller: "https://store-api.pickmall.cn",
|
seller: "https://store-api.pickmall.cn",
|
||||||
manager: "https://admin-api.pickmall.cn"
|
manager: "https://admin-api.pickmall.cn"
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -24,6 +24,7 @@ export default {
|
|||||||
if (userInfo.success) {
|
if (userInfo.success) {
|
||||||
//携带商品Id,在IM可以发送商品信息
|
//携带商品Id,在IM可以发送商品信息
|
||||||
if(goodsId && skuId){
|
if(goodsId && skuId){
|
||||||
|
|
||||||
window.open(
|
window.open(
|
||||||
this.IMLink + "?token=" + accessToken + "&id=" + id || this.storeMsg.storeId + "&goodsId=" + goodsId + "&skuId=" + skuId
|
this.IMLink + "?token=" + accessToken + "&id=" + id || this.storeMsg.storeId + "&goodsId=" + goodsId + "&skuId=" + skuId
|
||||||
);
|
);
|
||||||
@ -32,7 +33,6 @@ export default {
|
|||||||
this.IMLink + "?token=" + accessToken + "&id=" + id || this.storeMsg.storeId
|
this.IMLink + "?token=" + accessToken + "&id=" + id || this.storeMsg.storeId
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.$Message.error("请登录后再联系客服");
|
this.$Message.error("请登录后再联系客服");
|
||||||
return;
|
return;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
NODE_ENV=development
|
NODE_ENV=development
|
||||||
VUE_APP_PREVIEW=false
|
VUE_APP_PREVIEW=false
|
||||||
VUE_APP_API_BASE_URL=https://im-api.pickmall.cn
|
VUE_APP_API_BASE_URL=http://192.168.1.200:8885
|
||||||
VUE_APP_WEB_SOCKET_URL=wss://im-api.pickmall.cn/lili/webSocket
|
VUE_APP_WEB_SOCKET_URL=ws://192.168.1.200:8885/lili/webSocket
|
||||||
VUE_APP_COMMON=https://common-api.pickmall.cn
|
VUE_APP_COMMON=http://192.168.1.200:8890
|
||||||
VUE_APP_BUYER=https://buyer-api.pickmall.cn
|
VUE_APP_BUYER=http://192.168.1.200:8888
|
||||||
VUE_APP_SELLER=https://store-api.pickmall.cn
|
VUE_APP_SELLER=http://192.168.1.200:8889
|
||||||
VUE_APP_WEBSITE_NAME="LiLi IM"
|
VUE_APP_WEBSITE_NAME="LiLi IM"
|
||||||
VUE_APP_PC_URL=https://pc-b2b2c.pickmall.cn/
|
VUE_APP_PC_URL=http://127.0.0.1:10001
|
||||||
VUE_APP_PC_STORE=https://store-b2b2c.pickmall.cn/
|
VUE_APP_PC_STORE=https://store-b2b2c.pickmall.cn/
|
@ -13,6 +13,7 @@
|
|||||||
"babel-plugin-prismjs": "^2.0.1",
|
"babel-plugin-prismjs": "^2.0.1",
|
||||||
"core-js": "^3.6.5",
|
"core-js": "^3.6.5",
|
||||||
"element-ui": "^2.14.1",
|
"element-ui": "^2.14.1",
|
||||||
|
"file-loader": "^6.2.0",
|
||||||
"js-audio-recorder": "^1.0.6",
|
"js-audio-recorder": "^1.0.6",
|
||||||
"js-base64": "^2.5.1",
|
"js-base64": "^2.5.1",
|
||||||
"mavon-editor": "^2.10.4",
|
"mavon-editor": "^2.10.4",
|
||||||
|
@ -5,11 +5,17 @@ export const ServeGetTalkList = (data) => {
|
|||||||
return get("/im/talk/list", data);
|
return get("/im/talk/list", data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 获取聊天联系人列表服务接口
|
||||||
|
export const ServeuserContact = (data) => {
|
||||||
|
return get("/im/friend/mutual", data);
|
||||||
|
};
|
||||||
|
|
||||||
// 获取聊天列表服务接口
|
// 获取聊天列表服务接口
|
||||||
export const ServeGetStoreTalkList = (data) => {
|
export const ServeGetStoreTalkList = (data) => {
|
||||||
return get("/im/talk/store/list", data);
|
return get("/im/talk/store/list", data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// 聊天列表创建服务接口
|
// 聊天列表创建服务接口
|
||||||
export const ServeCreateTalkList = (id) => {
|
export const ServeCreateTalkList = (id) => {
|
||||||
return get(`/im/talk/user/${id}`);
|
return get(`/im/talk/user/${id}`);
|
||||||
@ -32,6 +38,7 @@ export const ServeClearTalkUnreadNum = (data) => {
|
|||||||
|
|
||||||
// 获取聊天记录服务接口
|
// 获取聊天记录服务接口
|
||||||
export const ServeTalkRecords = (data) => {
|
export const ServeTalkRecords = (data) => {
|
||||||
|
console.log(data,'----');
|
||||||
return get("/im/message", data);
|
return get("/im/message", data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -42,6 +42,8 @@ export default {
|
|||||||
* 比如 a 和 b 聊天 receiver_id = b的id
|
* 比如 a 和 b 聊天 receiver_id = b的id
|
||||||
*/
|
*/
|
||||||
state.index_name = (resource.talk_type || 1) + "_" + resource.receiver_id;
|
state.index_name = (resource.talk_type || 1) + "_" + resource.receiver_id;
|
||||||
|
|
||||||
|
console.log(state.index_name,'名字');
|
||||||
},
|
},
|
||||||
|
|
||||||
// 数组头部压入对话记录1494593861786271744 1494593778193793024
|
// 数组头部压入对话记录1494593861786271744 1494593778193793024
|
||||||
|
@ -19,23 +19,46 @@
|
|||||||
</el-header>
|
</el-header>
|
||||||
<el-header height="60px" class="header">
|
<el-header height="60px" class="header">
|
||||||
<div class="from-search">
|
<div class="from-search">
|
||||||
<el-input v-model="input" prefix-icon="el-icon-search" placeholder="搜索好友" size="small" />
|
<el-input
|
||||||
|
v-model="input"
|
||||||
|
prefix-icon="el-icon-search"
|
||||||
|
placeholder="搜索好友"
|
||||||
|
size="small"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
<!-- <el-header height="118px" class="logo-header">
|
<!-- <el-header height="118px" class="logo-header">
|
||||||
|
|
||||||
</el-header> -->
|
</el-header> -->
|
||||||
<!-- 置顶栏 -->
|
<!-- 置顶栏 -->
|
||||||
<el-header v-show="loadStatus == 1 && topItems.length > 0" class="subheader"
|
<el-header
|
||||||
:class="{ shadow: subHeaderShadow }" :height="subHeaderPx">
|
v-show="loadStatus == 1 && topItems.length > 0"
|
||||||
<div v-for="item in topItems" :key="item.index_name" class="top-item" @click="clickTab(item.index_name)"
|
class="subheader"
|
||||||
@contextmenu.prevent="topItemsMenu(item, $event)">
|
:class="{ shadow: subHeaderShadow }"
|
||||||
<el-tooltip effect="dark" placement="top-start" :content="item.name ? item.name : item.name">
|
:height="subHeaderPx"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-for="item in topItems"
|
||||||
|
:key="item.index_name"
|
||||||
|
class="top-item"
|
||||||
|
@click="clickTab(item.index_name)"
|
||||||
|
@contextmenu.prevent="topItemsMenu(item, $event)"
|
||||||
|
>
|
||||||
|
<el-tooltip
|
||||||
|
effect="dark"
|
||||||
|
placement="top-start"
|
||||||
|
:content="item.name ? item.name : item.name"
|
||||||
|
>
|
||||||
<div class="avatar">
|
<div class="avatar">
|
||||||
<span v-show="!item.face">
|
<span v-show="!item.face">
|
||||||
{{ (item.name ? item.name : item.name).substr(0, 1) }}
|
{{ (item.name ? item.name : item.name).substr(0, 1) }}
|
||||||
</span>
|
</span>
|
||||||
<img v-show="item.face" :src="item.face" :onerror="$store.state.defaultAvatar" v-if="item.face" />
|
<img
|
||||||
|
v-show="item.face"
|
||||||
|
:src="item.face"
|
||||||
|
:onerror="$store.state.defaultAvatar"
|
||||||
|
v-if="item.face"
|
||||||
|
/>
|
||||||
<face-null :text="item.name" v-else></face-null>
|
<face-null :text="item.name" v-else></face-null>
|
||||||
</div>
|
</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@ -47,31 +70,59 @@
|
|||||||
</el-header>
|
</el-header>
|
||||||
|
|
||||||
<!-- 对话列表栏 -->
|
<!-- 对话列表栏 -->
|
||||||
<el-scrollbar tag="section" ref="menusScrollbar" class="full-height" :native="false">
|
<el-scrollbar
|
||||||
|
tag="section"
|
||||||
|
ref="menusScrollbar"
|
||||||
|
class="full-height"
|
||||||
|
:native="false"
|
||||||
|
>
|
||||||
<el-main class="main">
|
<el-main class="main">
|
||||||
<p v-show="loadStatus === 0" class="empty-data">
|
<p v-show="loadStatus === 0" class="empty-data">
|
||||||
<i class="el-icon-loading" /> 数据加载中...
|
<i class="el-icon-loading" /> 数据加载中...
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p v-show="loadStatus === 1 && talkNum === 0" class="empty-data">
|
<p
|
||||||
|
v-show="loadStatus === 1 && talkNum === 0"
|
||||||
|
class="empty-data"
|
||||||
|
>
|
||||||
暂无聊天消息
|
暂无聊天消息
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p v-show="loadStatus === 1 && talkNum > 0" class="main-menu">
|
<p v-show="loadStatus === 1 && talkNum > 0" class="main-menu">
|
||||||
<span class="title">对话记录({{ talkNum }})</span>
|
<span
|
||||||
|
class="title"
|
||||||
|
:style="{ color: aIndex == 0 ? 'red' : '' }"
|
||||||
|
@click="aIndexclick(0)"
|
||||||
|
>对话记录({{ talkNum }})</span
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="title"
|
||||||
|
:style="{ color: aIndex == 1 ? 'red' : '' }"
|
||||||
|
@click="aIndexclick(1)"
|
||||||
|
>联系人</span
|
||||||
|
>
|
||||||
|
|
||||||
<!-- <el-tag size="mini" type="danger" v-if="myUnreadNum"
|
<!-- <el-tag size="mini" type="danger" v-if="myUnreadNum"
|
||||||
>未读:{{ myUnreadNum }}</el-tag
|
>未读:{{ myUnreadNum }}</el-tag
|
||||||
> -->
|
> -->
|
||||||
</p>
|
</p>
|
||||||
<!-- 对话列表 -->
|
<!-- 对话列表 -->
|
||||||
<template v-if="loadStatus === 1">
|
<template v-if="aIndex === 0">
|
||||||
<div v-for="(item, index) in userTalkItem" :key="item.id" class="talk-item pointer"
|
<div
|
||||||
:class="{ active: activeIndex == index }" @click="clickTab(item.userId, item, index)">
|
v-for="(item, index) in userTalkItem"
|
||||||
|
:key="item.id"
|
||||||
|
class="talk-item pointer"
|
||||||
|
:class="{ active: activeIndex == index }"
|
||||||
|
@click="clickTab(item.userId, item, index, 0)"
|
||||||
|
>
|
||||||
<div class="avatar-box">
|
<div class="avatar-box">
|
||||||
<face :text="item.face" v-if="item.face"></face>
|
<face :text="item.face" v-if="item.face"></face>
|
||||||
<face-null :text="item.name" v-else></face-null>
|
<face-null :text="item.name" v-else></face-null>
|
||||||
<div v-show="item.is_top == 0" class="top-mask" @click.stop="topChatItem(item)">
|
<div
|
||||||
|
v-show="item.is_top == 0"
|
||||||
|
class="top-mask"
|
||||||
|
@click.stop="topChatItem(item)"
|
||||||
|
>
|
||||||
<i class="el-icon-top" />
|
<i class="el-icon-top" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -94,10 +145,16 @@
|
|||||||
BOT
|
BOT
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-show="item.talk_type == 2" class="larkc-tag group">
|
<div
|
||||||
|
v-show="item.talk_type == 2"
|
||||||
|
class="larkc-tag group"
|
||||||
|
>
|
||||||
群组
|
群组
|
||||||
</div>
|
</div>
|
||||||
<div v-show="item.is_disturb" class="larkc-tag disturb">
|
<div
|
||||||
|
v-show="item.is_disturb"
|
||||||
|
class="larkc-tag disturb"
|
||||||
|
>
|
||||||
<i class="iconfont icon-xiaoximiandarao" />
|
<i class="iconfont icon-xiaoximiandarao" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -106,20 +163,85 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="talk-message">
|
<div class="talk-message">
|
||||||
<span v-if="item.lastMessageType === 'MESSAGE'">{{ item.lastTalkMessage }}</span>
|
<span v-if="item.lastMessageType === 'MESSAGE'">{{
|
||||||
<span v-if="item.lastMessageType === 'GOODS'">[商品链接]</span>
|
item.lastTalkMessage
|
||||||
<span v-if="item.lastMessageType === 'ORDER'">[订单链接]</span>
|
}}</span>
|
||||||
|
<span v-if="item.lastMessageType === 'GOODS'"
|
||||||
|
>[商品链接]</span
|
||||||
|
>
|
||||||
|
<span v-if="item.lastMessageType === 'ORDER'"
|
||||||
|
>[订单链接]</span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<template v-if="
|
<template
|
||||||
index_name != item.index_name && item.draft_text
|
v-if="
|
||||||
">
|
index_name != item.index_name && item.draft_text
|
||||||
|
"
|
||||||
|
>
|
||||||
<span class="draft-color">[草稿]</span>
|
<span class="draft-color">[草稿]</span>
|
||||||
<span>{{ item.draft_text }}</span>
|
<span>{{ item.draft_text }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<template v-if="item.is_robot == 0">
|
<template v-if="item.is_robot == 0">
|
||||||
<span v-if="item.talk_type == 1" :class="{ 'online-color': item.is_online == 1 }">
|
<span
|
||||||
|
v-if="item.talk_type == 1"
|
||||||
|
:class="{ 'online-color': item.is_online == 1 }"
|
||||||
|
>
|
||||||
|
[{{ item.is_online == 1 ? "在线" : "离线" }}]
|
||||||
|
</span>
|
||||||
|
<span v-else>[群消息]</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<span>{{ item.msg_text }}</span>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<!-- 联系人 -->
|
||||||
|
<template v-if="aIndex == 1">
|
||||||
|
<div
|
||||||
|
v-for="(item, index) in userContact"
|
||||||
|
:key="item.id"
|
||||||
|
class="talk-item pointer"
|
||||||
|
:class="{ active: activeIndex == index }"
|
||||||
|
@click="clickTab(item.friendId, item, index, 1)"
|
||||||
|
>
|
||||||
|
<div class="avatar-box">
|
||||||
|
<face :text="item.face" v-if="item.face"></face>
|
||||||
|
<face-null :text="item.name" v-else></face-null>
|
||||||
|
<div
|
||||||
|
v-show="item.is_top == 0"
|
||||||
|
class="top-mask"
|
||||||
|
@click.stop="topChatItem(item)"
|
||||||
|
>
|
||||||
|
<i class="el-icon-top" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-box">
|
||||||
|
<div class="title">
|
||||||
|
<div class="card-name">
|
||||||
|
<p class="nickname">
|
||||||
|
{{ item.nickname }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
<template
|
||||||
|
v-if="
|
||||||
|
index_name != item.index_name && item.draft_text
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<span class="draft-color">[草稿]</span>
|
||||||
|
<span>{{ item.draft_text }}</span>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<template v-if="item.is_robot == 0">
|
||||||
|
<span
|
||||||
|
v-if="item.talk_type == 1"
|
||||||
|
:class="{ 'online-color': item.is_online == 1 }"
|
||||||
|
>
|
||||||
[{{ item.is_online == 1 ? "在线" : "离线" }}]
|
[{{ item.is_online == 1 ? "在线" : "离线" }}]
|
||||||
</span>
|
</span>
|
||||||
<span v-else>[群消息]</span>
|
<span v-else>[群消息]</span>
|
||||||
@ -138,9 +260,73 @@
|
|||||||
|
|
||||||
<!-- 聊天面板容器 -->
|
<!-- 聊天面板容器 -->
|
||||||
<el-main class="main-box ov-hidden full-height no-padding flex">
|
<el-main class="main-box ov-hidden full-height no-padding flex">
|
||||||
<WelcomeModule class="flex-8" v-if="index_name == null" />
|
<div v-if="aIndex == 1" class="main-con">
|
||||||
<TalkPanel v-else class="full-height flex-8" :params="params" :goodsParams="goodsParams"
|
<div class="main-con" v-if="bIndex == 0">
|
||||||
:is-online="isFriendOnline" @change-talk="changeTalk" @close-talk="closeTalk" />
|
<WelcomeModule class="flex-8" />
|
||||||
|
</div>
|
||||||
|
<div class="main-con" v-if="bIndex == 1">
|
||||||
|
<div class="main-con">
|
||||||
|
<div class="concent">
|
||||||
|
<div class="concent-img">
|
||||||
|
<div class="conent-left">
|
||||||
|
<img
|
||||||
|
:src="userobj.face"
|
||||||
|
alt=""
|
||||||
|
srcset=""
|
||||||
|
:style="{ width: '65%', height: '100%' }"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="conent-right">
|
||||||
|
<div>
|
||||||
|
名称:
|
||||||
|
<span :style="{ color: 'rgb(158,158,158)' }">{{
|
||||||
|
userobj.nickname
|
||||||
|
}}</span>
|
||||||
|
</div>
|
||||||
|
<div :style="{ color: 'rgb(158,158,158)' }">
|
||||||
|
电话:
|
||||||
|
<span>{{ userobj.mobile }}</span>
|
||||||
|
</div>
|
||||||
|
<div :style="{ color: 'rgb(158,158,158)' }">
|
||||||
|
地区:
|
||||||
|
<span>{{ userobj.email }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="bottomsom">
|
||||||
|
<button @click="bIndex = 3" class="songbutom">发送</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="bIndex == 3"
|
||||||
|
class="main-con"
|
||||||
|
:style="{ width: '100%', height: '100%' }"
|
||||||
|
>
|
||||||
|
<TalkPanel
|
||||||
|
class="full-height flex-8"
|
||||||
|
:params="params"
|
||||||
|
:goodsParams="goodsParams"
|
||||||
|
:is-online="isFriendOnline"
|
||||||
|
@change-talk="changeTalk"
|
||||||
|
@close-talk="closeTalk"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="aIndex == 0" class="main-con">
|
||||||
|
<WelcomeModule class="flex-8" v-if="index_name == null" />
|
||||||
|
<TalkPanel
|
||||||
|
v-else
|
||||||
|
class="full-height flex-8"
|
||||||
|
:params="params"
|
||||||
|
:goodsParams="goodsParams"
|
||||||
|
:is-online="isFriendOnline"
|
||||||
|
@change-talk="changeTalk"
|
||||||
|
@close-talk="closeTalk"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- <OtherLink :toUser="toUser" :goodsParams="goodsParams" :id="id" class="flex-4"/> -->
|
<!-- <OtherLink :toUser="toUser" :goodsParams="goodsParams" :id="id" class="flex-4"/> -->
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
@ -163,6 +349,7 @@ import {
|
|||||||
ServeTopTalkList,
|
ServeTopTalkList,
|
||||||
ServeSetNotDisturb,
|
ServeSetNotDisturb,
|
||||||
ServeCreateTalkList,
|
ServeCreateTalkList,
|
||||||
|
ServeuserContact,
|
||||||
} from "@/api/chat";
|
} from "@/api/chat";
|
||||||
import { ServeDeleteContact, ServeEditContactRemark } from "@/api/contacts";
|
import { ServeDeleteContact, ServeEditContactRemark } from "@/api/contacts";
|
||||||
import { beautifyTime } from "@/utils/functions";
|
import { beautifyTime } from "@/utils/functions";
|
||||||
@ -180,8 +367,11 @@ export default {
|
|||||||
OtherLink,
|
OtherLink,
|
||||||
WelcomeModule,
|
WelcomeModule,
|
||||||
},
|
},
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
aIndex: 0, //0 对话 1联系人
|
||||||
|
bIndex: 0, //0
|
||||||
|
userobj: {},
|
||||||
activeIndex: 9999999, //默认样式索引
|
activeIndex: 9999999, //默认样式索引
|
||||||
subHeaderShadow: false,
|
subHeaderShadow: false,
|
||||||
launchGroupShow: false,
|
launchGroupShow: false,
|
||||||
@ -195,8 +385,8 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
goodsParams: {
|
goodsParams: {
|
||||||
goodsId: '',
|
goodsId: "",
|
||||||
skuId: '',
|
skuId: "",
|
||||||
},
|
},
|
||||||
|
|
||||||
// 查询关键词
|
// 查询关键词
|
||||||
@ -211,6 +401,7 @@ export default {
|
|||||||
// 消息未读数计时器
|
// 消息未读数计时器
|
||||||
interval: null,
|
interval: null,
|
||||||
userTalkItem: [],
|
userTalkItem: [],
|
||||||
|
userContact: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -226,7 +417,7 @@ export default {
|
|||||||
toUser: (state) => state.user.toUser,
|
toUser: (state) => state.user.toUser,
|
||||||
}),
|
}),
|
||||||
// 计算置顶栏目的高度
|
// 计算置顶栏目的高度
|
||||||
subHeaderPx () {
|
subHeaderPx() {
|
||||||
const n = 7; // 一排能显示的用户数
|
const n = 7; // 一排能显示的用户数
|
||||||
const num = this.topItems.length;
|
const num = this.topItems.length;
|
||||||
let len = 60;
|
let len = 60;
|
||||||
@ -239,17 +430,17 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 当前对话好友在线状态
|
// 当前对话好友在线状态
|
||||||
isFriendOnline () {
|
isFriendOnline() {
|
||||||
let index = findTalkIndex(this.index_name);
|
let index = findTalkIndex(this.index_name);
|
||||||
return index >= 0 && this.talks[index].is_online == 1;
|
return index >= 0 && this.talks[index].is_online == 1;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
talkItems (val) {
|
talkItems(val) {
|
||||||
val ? this.$set(this, "userTalkItem", val) : "";
|
val ? this.$set(this, "userTalkItem", val) : "";
|
||||||
},
|
},
|
||||||
// 搜索用户的时候 根据当前用户表进行模糊搜索
|
// 搜索用户的时候 根据当前用户表进行模糊搜索
|
||||||
input (val, oldVal) {
|
input(val, oldVal) {
|
||||||
console.log(val, oldVal);
|
console.log(val, oldVal);
|
||||||
if (val) {
|
if (val) {
|
||||||
let str = ["", ...val, ""].join(".*");
|
let str = ["", ...val, ""].join(".*");
|
||||||
@ -261,7 +452,7 @@ export default {
|
|||||||
this.userTalkItem = this.talkItems;
|
this.userTalkItem = this.talkItems;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
unreadNum (value) {
|
unreadNum(value) {
|
||||||
clearInterval(this.interval);
|
clearInterval(this.interval);
|
||||||
// console.log("%c 更新未读消息", "color:#32ccbc");
|
// console.log("%c 更新未读消息", "color:#32ccbc");
|
||||||
this.$store.commit("SET_UNREAD_NUM", value);
|
this.$store.commit("SET_UNREAD_NUM", value);
|
||||||
@ -277,7 +468,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 监听好友在线状态
|
// 监听好友在线状态
|
||||||
monitorFriendsStatus (value) {
|
monitorFriendsStatus(value) {
|
||||||
this.$store.commit("UPDATE_TALK_ITEM", {
|
this.$store.commit("UPDATE_TALK_ITEM", {
|
||||||
index_name: `1_${value.friend_id}`,
|
index_name: `1_${value.friend_id}`,
|
||||||
is_online: value.status,
|
is_online: value.status,
|
||||||
@ -285,15 +476,15 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeRouteUpdate (to, from, next) {
|
beforeRouteUpdate(to, from, next) {
|
||||||
let index_name = getCacheIndexName();
|
let index_name = getCacheIndexName();
|
||||||
if (index_name) this.clickTab(index_name);
|
if (index_name) this.clickTab(index_name);
|
||||||
next();
|
next();
|
||||||
},
|
},
|
||||||
beforeCreate () {
|
beforeCreate() {
|
||||||
setToken(this.$route.query.token);
|
setToken(this.$route.query.token);
|
||||||
},
|
},
|
||||||
async created () {
|
async created() {
|
||||||
await this.initialize();
|
await this.initialize();
|
||||||
await this.loadUserSetting();
|
await this.loadUserSetting();
|
||||||
/**
|
/**
|
||||||
@ -301,39 +492,49 @@ export default {
|
|||||||
* 所以创建会话 并请求用户列表
|
* 所以创建会话 并请求用户列表
|
||||||
* 如果没有id说明当前商家登录 直接请求用户列表
|
* 如果没有id说明当前商家登录 直接请求用户列表
|
||||||
*/
|
*/
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted () {
|
mounted() {
|
||||||
this.scrollEvent();
|
this.scrollEvent();
|
||||||
|
this.getcon();
|
||||||
},
|
},
|
||||||
destroyed () {
|
destroyed() {
|
||||||
document.title = title;
|
document.title = title;
|
||||||
clearInterval(this.interval);
|
clearInterval(this.interval);
|
||||||
this.clearTalk();
|
this.clearTalk();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
aIndexclick(index) {
|
||||||
|
this.aIndex = index;
|
||||||
|
this.bIndex = 0;
|
||||||
|
},
|
||||||
// 美化时间格式
|
// 美化时间格式
|
||||||
beautifyTime,
|
beautifyTime,
|
||||||
|
|
||||||
//创建会话
|
//创建会话
|
||||||
async createTalk (id) {
|
async createTalk(id) {
|
||||||
await ServeCreateTalkList(id);
|
await ServeCreateTalkList(id);
|
||||||
|
|
||||||
await this.loadChatList();
|
await this.loadChatList();
|
||||||
},
|
},
|
||||||
// header 功能栏隐藏事件
|
// header 功能栏隐藏事件
|
||||||
closeSubMenu () {
|
closeSubMenu() {
|
||||||
this.subMenu = false;
|
this.subMenu = false;
|
||||||
},
|
},
|
||||||
|
getcon() {
|
||||||
|
ServeuserContact().then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.userContact = res.result;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
// 清除当前对话
|
// 清除当前对话
|
||||||
clearTalk () {
|
clearTalk() {
|
||||||
this.params = {
|
this.params = {
|
||||||
talk_type: 0,
|
talk_type: 0,
|
||||||
receiver_id: 0,
|
receiver_id: 0,
|
||||||
nickname: "",
|
nickname: "",
|
||||||
clickFlag: true
|
clickFlag: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$store.commit("UPDATE_DIALOGUE_MESSAGE", {
|
this.$store.commit("UPDATE_DIALOGUE_MESSAGE", {
|
||||||
@ -344,7 +545,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 工具栏事件
|
// 工具栏事件
|
||||||
triggerSubMenu (type) {
|
triggerSubMenu(type) {
|
||||||
this.closeSubMenu();
|
this.closeSubMenu();
|
||||||
|
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
@ -355,14 +556,14 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 监听自定义滚动条事件
|
// 监听自定义滚动条事件
|
||||||
scrollEvent () {
|
scrollEvent() {
|
||||||
let scrollbarEl = this.$refs.menusScrollbar.wrap;
|
let scrollbarEl = this.$refs.menusScrollbar.wrap;
|
||||||
scrollbarEl.onscroll = () => {
|
scrollbarEl.onscroll = () => {
|
||||||
this.subHeaderShadow = scrollbarEl.scrollTop > 0;
|
this.subHeaderShadow = scrollbarEl.scrollTop > 0;
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
// 获取用户对话列表
|
// 获取用户对话列表
|
||||||
loadChatList () {
|
loadChatList() {
|
||||||
this.loadStatus = this.talkNum == 0 ? 0 : 1;
|
this.loadStatus = this.talkNum == 0 ? 0 : 1;
|
||||||
|
|
||||||
ServeGetTalkList()
|
ServeGetTalkList()
|
||||||
@ -376,7 +577,7 @@ export default {
|
|||||||
// 判断
|
// 判断
|
||||||
if (this.$route.query.id) {
|
if (this.$route.query.id) {
|
||||||
let takeData, takeIndex;
|
let takeData, takeIndex;
|
||||||
console.log("用户result", result)
|
console.log("用户result", result);
|
||||||
this.talkItems.forEach((take, index) => {
|
this.talkItems.forEach((take, index) => {
|
||||||
if (take.userId == this.$route.query.id) {
|
if (take.userId == this.$route.query.id) {
|
||||||
takeData = take;
|
takeData = take;
|
||||||
@ -394,16 +595,26 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 切换聊天栏目
|
// 切换聊天栏目
|
||||||
clickTab (id, val, index) {
|
clickTab(id, val, index, con) {
|
||||||
if (!id) return;
|
if (!id) return;
|
||||||
this.activeIndex = index;
|
this.activeIndex = index;
|
||||||
let item =
|
var item = [];
|
||||||
this.talks.find((item) => {
|
if (con == 1) {
|
||||||
return item.userId == id;
|
this.bIndex = 1;
|
||||||
}) || {};
|
item =
|
||||||
|
this.userContact.find((item) => {
|
||||||
|
return item.friendId == id;
|
||||||
|
}) || {};
|
||||||
|
} else {
|
||||||
|
item =
|
||||||
|
this.talks.find((item) => {
|
||||||
|
return item.userId == id;
|
||||||
|
}) || {};
|
||||||
|
}
|
||||||
|
// console.log(item,'');
|
||||||
|
this.userobj = item;
|
||||||
// 点击当前栏目存储当前用户的信息
|
// 点击当前栏目存储当前用户的信息
|
||||||
this.$store.state.user.toUser = val;
|
this.$store.state.user.toUser = val;
|
||||||
|
|
||||||
let nickname = item.name;
|
let nickname = item.name;
|
||||||
|
|
||||||
this.params = {
|
this.params = {
|
||||||
@ -412,7 +623,7 @@ export default {
|
|||||||
nickname,
|
nickname,
|
||||||
is_robot: item.is_robot,
|
is_robot: item.is_robot,
|
||||||
talkId: item.id, //聊天对话的id
|
talkId: item.id, //聊天对话的id
|
||||||
clickFlag: true
|
clickFlag: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
// 更新信息
|
// 更新信息
|
||||||
@ -433,13 +644,13 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 修改当前对话
|
// 修改当前对话
|
||||||
changeTalk (index_name) {
|
changeTalk(index_name) {
|
||||||
console.log("修改当前对话", index_name);
|
console.log("修改当前对话", index_name);
|
||||||
sessionStorage.setItem("send_message_index_name", index_name);
|
sessionStorage.setItem("send_message_index_name", index_name);
|
||||||
this.loadChatList();
|
this.loadChatList();
|
||||||
},
|
},
|
||||||
// 关闭当前对话及刷新对话列表
|
// 关闭当前对话及刷新对话列表
|
||||||
closeTalk () {
|
closeTalk() {
|
||||||
this.$store.commit("UPDATE_DIALOGUE_MESSAGE", {
|
this.$store.commit("UPDATE_DIALOGUE_MESSAGE", {
|
||||||
talk_type: 0,
|
talk_type: 0,
|
||||||
receiver_id: 0,
|
receiver_id: 0,
|
||||||
@ -449,7 +660,7 @@ export default {
|
|||||||
this.loadChatList();
|
this.loadChatList();
|
||||||
},
|
},
|
||||||
// 对话列表的右键自定义菜单
|
// 对话列表的右键自定义菜单
|
||||||
talkItemsMenu (item, event) {
|
talkItemsMenu(item, event) {
|
||||||
let items = {
|
let items = {
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
@ -526,7 +737,7 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
// 置顶栏右键菜单栏
|
// 置顶栏右键菜单栏
|
||||||
topItemsMenu (item, event) {
|
topItemsMenu(item, event) {
|
||||||
this.$contextmenu({
|
this.$contextmenu({
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
@ -544,7 +755,7 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
// 会话列表置顶
|
// 会话列表置顶
|
||||||
topChatItem (item) {
|
topChatItem(item) {
|
||||||
ServeTopTalkList({
|
ServeTopTalkList({
|
||||||
list_id: item.id,
|
list_id: item.id,
|
||||||
type: item.is_top == 0 ? 1 : 2,
|
type: item.is_top == 0 ? 1 : 2,
|
||||||
@ -558,7 +769,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 设置消息免打扰
|
// 设置消息免打扰
|
||||||
setNotDisturb (item) {
|
setNotDisturb(item) {
|
||||||
ServeSetNotDisturb({
|
ServeSetNotDisturb({
|
||||||
talk_type: item.talk_type,
|
talk_type: item.talk_type,
|
||||||
receiver_id: item.receiver_id,
|
receiver_id: item.receiver_id,
|
||||||
@ -573,7 +784,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 移除会话列表
|
// 移除会话列表
|
||||||
delChatItem (item) {
|
delChatItem(item) {
|
||||||
ServeDeleteTalkList({
|
ServeDeleteTalkList({
|
||||||
list_id: item.id,
|
list_id: item.id,
|
||||||
}).then(({ code }) => {
|
}).then(({ code }) => {
|
||||||
@ -584,7 +795,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 解除好友关系
|
// 解除好友关系
|
||||||
removeFriend (item) {
|
removeFriend(item) {
|
||||||
ServeDeleteContact({
|
ServeDeleteContact({
|
||||||
friend_id: item.receiver_id,
|
friend_id: item.receiver_id,
|
||||||
}).then(({ code }) => {
|
}).then(({ code }) => {
|
||||||
@ -598,7 +809,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 修改好友备注信息
|
// 修改好友备注信息
|
||||||
editFriendRemarks (item) {
|
editFriendRemarks(item) {
|
||||||
let title = `您正在设置【${item.name}】好友的备注信息`;
|
let title = `您正在设置【${item.name}】好友的备注信息`;
|
||||||
|
|
||||||
if (item.remark_name) {
|
if (item.remark_name) {
|
||||||
@ -611,7 +822,7 @@ export default {
|
|||||||
customClass: "border-radius0",
|
customClass: "border-radius0",
|
||||||
inputPlaceholder: "请设置好友备注信息",
|
inputPlaceholder: "请设置好友备注信息",
|
||||||
inputValue: item.remark_name ? item.remark_name : item.name,
|
inputValue: item.remark_name ? item.remark_name : item.name,
|
||||||
inputValidator (val) {
|
inputValidator(val) {
|
||||||
return val == null || val == "" ? "好友备注不能为空" : true;
|
return val == null || val == "" ? "好友备注不能为空" : true;
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -644,7 +855,7 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(() => { });
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -653,7 +864,7 @@ export default {
|
|||||||
/deep/ .el-scrollbar__wrap {
|
/deep/ .el-scrollbar__wrap {
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
.user-status{
|
.user-status {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
.aside-box {
|
.aside-box {
|
||||||
@ -793,7 +1004,7 @@ export default {
|
|||||||
.main-menu {
|
.main-menu {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
justify-content: space-around;
|
||||||
padding: 3px 10px 3px 10px;
|
padding: 3px 10px 3px 10px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
@ -802,6 +1013,7 @@ export default {
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #1f2329;
|
color: #1f2329;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
@ -962,7 +1174,6 @@ export default {
|
|||||||
|
|
||||||
// iphone
|
// iphone
|
||||||
@media screen and (max-width: 767px) {
|
@media screen and (max-width: 767px) {
|
||||||
|
|
||||||
.side-edge,
|
.side-edge,
|
||||||
.from-search,
|
.from-search,
|
||||||
.card-box {
|
.card-box {
|
||||||
@ -991,4 +1202,40 @@ export default {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
.main-con {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.concent {
|
||||||
|
width: 80%;
|
||||||
|
height: 80%;
|
||||||
|
margin: 0 auto;
|
||||||
|
.concent-img {
|
||||||
|
width: 100%;
|
||||||
|
height: 15%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
margin-top: 5vw;
|
||||||
|
.conent-left {
|
||||||
|
width: 50%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.conent-right {
|
||||||
|
width: 40%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.bottomsom {
|
||||||
|
height: 50%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
.songbutom {
|
||||||
|
padding: 10px 20px 10px 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
"vuedraggable": "^2.23.2",
|
"vuedraggable": "^2.23.2",
|
||||||
"vuex": "^3.4.0",
|
"vuex": "^3.4.0",
|
||||||
"xss": "^1.0.7",
|
"xss": "^1.0.7",
|
||||||
"price-color":"1.0.2"
|
"price-color": "1.0.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vue/cli-plugin-babel": "^4.4.4",
|
"@vue/cli-plugin-babel": "^4.4.4",
|
||||||
|
@ -1,29 +1,29 @@
|
|||||||
var BASE = {
|
var BASE = {
|
||||||
/**
|
/**
|
||||||
* @description api请求基础路径
|
* @description api请求基础路径
|
||||||
*/
|
*/
|
||||||
API_DEV: {
|
API_DEV: {
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "http://192.168.1.200:8890",
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
buyer: "http://192.168.1.200:8888",
|
||||||
seller: "https://store-api.pickmall.cn",
|
seller: "http://192.168.1.200:8889",
|
||||||
manager: "https://admin-api.pickmall.cn",
|
manager: "http://192.168.1.200:8887"
|
||||||
},
|
},
|
||||||
API_PROD: {
|
API_PROD: {
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "https://common-api.pickmall.cn",
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
buyer: "https://buyer-api.pickmall.cn",
|
||||||
seller: "https://store-api.pickmall.cn",
|
seller: "https://store-api.pickmall.cn",
|
||||||
manager: "https://admin-api.pickmall.cn"
|
manager: "https://admin-api.pickmall.cn",
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @description // 跳转买家端地址 pc端
|
* @description // 跳转买家端地址 pc端
|
||||||
*/
|
*/
|
||||||
PC_URL: "https://pc-b2b2c.pickmall.cn",
|
PC_URL: "http://127.0.0.1:10000",
|
||||||
/**
|
/**
|
||||||
* @description // 跳转买家端地址 wap端
|
* @description // 跳转买家端地址 wap端
|
||||||
*/
|
*/
|
||||||
WAP_URL: "https://m-b2b2c.pickmall.cn",
|
WAP_URL: "https://m-b2b2c.pickmall.cn",
|
||||||
/**
|
/**
|
||||||
* @description api请求基础路径前缀
|
* @description api请求基础路径前缀
|
||||||
*/
|
*/
|
||||||
PREFIX: "/manager"
|
PREFIX: "/manager",
|
||||||
};
|
};
|
||||||
|
@ -42,10 +42,11 @@
|
|||||||
:max="9.9"
|
:max="9.9"
|
||||||
:min="0.1"
|
:min="0.1"
|
||||||
:step="0.1"
|
:step="0.1"
|
||||||
|
precision="1"
|
||||||
v-model="form.couponDiscount"
|
v-model="form.couponDiscount"
|
||||||
style="width: 260px">
|
style="width: 260px">
|
||||||
</InputNumber>
|
</InputNumber>
|
||||||
<span class="describe">请输入0-10之间数字,可以输入一位小数</span>
|
<span class="describe">请输入0-10的数字,可有一位小数</span>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="面额" prop="price" v-if="form.couponType == 'PRICE'">
|
<FormItem label="面额" prop="price" v-if="form.couponType == 'PRICE'">
|
||||||
<Input
|
<Input
|
||||||
|
@ -81,14 +81,14 @@
|
|||||||
label="优惠折扣"
|
label="优惠折扣"
|
||||||
prop="fullRate"
|
prop="fullRate"
|
||||||
>
|
>
|
||||||
<Input
|
<InputNumber
|
||||||
type="text"
|
|
||||||
v-model="form.fullRate"
|
|
||||||
placeholder="优惠折扣"
|
placeholder="优惠折扣"
|
||||||
disabled
|
:max="9.9"
|
||||||
clearable
|
:min="0.1"
|
||||||
style="width: 260px"
|
:step="0.1"
|
||||||
/>
|
precision="1"
|
||||||
|
v-model="form.fullRate"
|
||||||
|
style="width: 260px"/>
|
||||||
<span class="describe">优惠折扣为0-10之间数字,可有一位小数</span>
|
<span class="describe">优惠折扣为0-10之间数字,可有一位小数</span>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="额外赠送">
|
<FormItem label="额外赠送">
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
<Card>
|
<Card>
|
||||||
<Form ref="form" :model="form" :rules="formRule">
|
<Form ref="form" :model="form" :rules="formRule">
|
||||||
<div class="base-info-item">
|
<div class="base-info-item">
|
||||||
<h4>添加积分商品</h4>
|
|
||||||
<div class="form-item-view">
|
<div class="form-item-view">
|
||||||
<FormItem astyle="width: 100%">
|
<FormItem astyle="width: 100%">
|
||||||
<div style="display: flex; margin-bottom: 10px">
|
<div style="display: flex; margin-bottom: 10px">
|
||||||
@ -13,7 +12,8 @@
|
|||||||
ghost
|
ghost
|
||||||
style="margin-left: 10px"
|
style="margin-left: 10px"
|
||||||
@click="delSelectGoods"
|
@click="delSelectGoods"
|
||||||
>批量删除</Button
|
>批量删除
|
||||||
|
</Button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<Table
|
<Table
|
||||||
@ -50,7 +50,8 @@
|
|||||||
v-for="item in categoryList"
|
v-for="item in categoryList"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
>{{ item.name }}</Option
|
>{{ item.name }}
|
||||||
|
</Option
|
||||||
>
|
>
|
||||||
</Select>
|
</Select>
|
||||||
</template>
|
</template>
|
||||||
@ -71,33 +72,16 @@
|
|||||||
</Table>
|
</Table>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem label="兑换时间" prop="time">
|
<FormItem label="活动时间" prop="rangeTime">
|
||||||
<DatePicker
|
<DatePicker type="datetimerange" v-model="form.rangeTime" format="yyyy-MM-dd HH:mm:ss"
|
||||||
type="datetime"
|
placeholder="请选择" :options="options" style="width: 260px">
|
||||||
v-model="form.startTime"
|
|
||||||
format="yyyy-MM-dd HH:mm:ss"
|
|
||||||
placeholder="请选择"
|
|
||||||
:options="options"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
>
|
|
||||||
</DatePicker>
|
|
||||||
-
|
|
||||||
<DatePicker
|
|
||||||
type="datetime"
|
|
||||||
v-model="form.endTime"
|
|
||||||
format="yyyy-MM-dd HH:mm:ss"
|
|
||||||
:options="options"
|
|
||||||
placeholder="请选择"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
>
|
|
||||||
</DatePicker>
|
</DatePicker>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<div>
|
<div>
|
||||||
<Button type="text" @click="closeCurrentPage">返回</Button>
|
<Button type="text" @click="closeCurrentPage">返回</Button>
|
||||||
<Button type="primary" :loading="submitLoading" @click="handleSubmit"
|
<Button type="primary" :loading="submitLoading" @click="handleSubmit"
|
||||||
>提交</Button
|
>提交
|
||||||
|
</Button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -109,31 +93,19 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { addPointsGoods, getPointsGoodsCategoryList } from "@/api/promotion";
|
import {addPointsGoods, getPointsGoodsCategoryList} from "@/api/promotion";
|
||||||
import { regular } from "@/utils";
|
import {regular} from "@/utils";
|
||||||
import skuSelect from "@/components/lili-dialog";
|
import skuSelect from "@/components/lili-dialog";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "addPoinsGoods",
|
name: "addPoinsGoods",
|
||||||
components: {
|
components: {
|
||||||
skuSelect,
|
skuSelect,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const isLtEndDate = (rule, value, callback) => {
|
|
||||||
if (new Date(value).getTime() > new Date(this.form.endTime).getTime()) {
|
|
||||||
callback(new Error());
|
|
||||||
} else {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const isGtStartDate = (rule, value, callback) => {
|
|
||||||
if (new Date(value).getTime() < new Date(this.form.startTime).getTime()) {
|
|
||||||
callback(new Error());
|
|
||||||
} else {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return {
|
return {
|
||||||
form: {
|
form: {
|
||||||
|
rangeTime: ["",""],
|
||||||
promotionGoodsList: [], // 活动商品列表
|
promotionGoodsList: [], // 活动商品列表
|
||||||
},
|
},
|
||||||
showTable: true,
|
showTable: true,
|
||||||
@ -142,50 +114,7 @@ export default {
|
|||||||
submitLoading: false, // 添加或编辑提交状态
|
submitLoading: false, // 添加或编辑提交状态
|
||||||
selectedGoods: [], // 已选商品列表,便于删除
|
selectedGoods: [], // 已选商品列表,便于删除
|
||||||
formRule: {
|
formRule: {
|
||||||
startTime: [
|
rangeTime: [{required: true, message: "请选择活动时间"}],
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
type: "date",
|
|
||||||
message: "请选择开始时间",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
trigger: "change",
|
|
||||||
message: "开始时间要小于结束时间",
|
|
||||||
validator: isLtEndDate,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
endTime: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
type: "date",
|
|
||||||
message: "请选择结束时间",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
trigger: "change",
|
|
||||||
message: "结束时间要大于开始时间",
|
|
||||||
validator: isGtStartDate,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
discount: [
|
|
||||||
{ required: true, message: "请输入折扣" },
|
|
||||||
{
|
|
||||||
pattern: regular.discount,
|
|
||||||
message: "请输入0-10的数字,可有一位小数",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
sellerCommission: [
|
|
||||||
{ required: true, message: "请输入店铺承担比例" },
|
|
||||||
{ pattern: regular.rate, message: "请输入0-100的正整数" },
|
|
||||||
],
|
|
||||||
publishNum: [
|
|
||||||
{ required: true, message: "请输入发放数量" },
|
|
||||||
{ pattern: regular.Integer, message: "请输入正整数" },
|
|
||||||
],
|
|
||||||
couponLimitNum: [
|
|
||||||
{ required: true, message: "请输入领取限制" },
|
|
||||||
{ pattern: regular.Integer, message: "请输入正整数" },
|
|
||||||
],
|
|
||||||
description: [{ required: true, message: "请输入范围描述" }],
|
|
||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
@ -219,7 +148,7 @@ export default {
|
|||||||
key: "price",
|
key: "price",
|
||||||
minWidth: 40,
|
minWidth: 40,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} );
|
return h("priceColorScheme", {props: {value: params.row.price, color: this.$mainColor}});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -293,14 +222,16 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 保存积分商品 */
|
/** 保存积分商品 */
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
|
this.form.startTime=this.form.rangeTime[0]
|
||||||
|
this.form.endTime=this.form.rangeTime[1]
|
||||||
this.$refs.form.validate((valid) => {
|
this.$refs.form.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let params = this.promotionGoodsList;
|
let params = this.promotionGoodsList;
|
||||||
const start = this.$options.filters.unixToDate(this.form.startTime / 1000);
|
const start = this.$options.filters.unixToDate(this.form.startTime / 1000);
|
||||||
const end = this.$options.filters.unixToDate(this.form.endTime / 1000);
|
const end = this.$options.filters.unixToDate(this.form.endTime / 1000);
|
||||||
|
|
||||||
if (!params || params.length == 0) {
|
if (!params || params.length === 0) {
|
||||||
this.$Modal.warning({ title: "提示", content: "请选择指定商品" });
|
this.$Modal.warning({title: "提示", content: "请选择指定商品"});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -373,7 +304,7 @@ export default {
|
|||||||
let list = [];
|
let list = [];
|
||||||
item.forEach((e) => {
|
item.forEach((e) => {
|
||||||
const obj = {
|
const obj = {
|
||||||
settlementPrice: e.settlementPrice || 0,
|
settlementPrice: e.settlementPrice || e.price,
|
||||||
pointsGoodsCategoryId: e.pointsGoodsCategoryId || 0,
|
pointsGoodsCategoryId: e.pointsGoodsCategoryId || 0,
|
||||||
pointsGoodsCategoryName: e.pointsGoodsCategoryName || "",
|
pointsGoodsCategoryName: e.pointsGoodsCategoryName || "",
|
||||||
activeStock: e.activeStock || 1,
|
activeStock: e.activeStock || 1,
|
||||||
@ -407,11 +338,13 @@ h4 {
|
|||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.describe {
|
.describe {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
min-height: 800px;
|
min-height: 800px;
|
||||||
}
|
}
|
||||||
|
@ -508,6 +508,7 @@ export default {
|
|||||||
loading: true,
|
loading: true,
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
API_Shop.pay(this.id).then((res) => {
|
API_Shop.pay(this.id).then((res) => {
|
||||||
|
this.$Modal.remove();
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success(res.message);
|
this.$Message.success(res.message);
|
||||||
this.init();
|
this.init();
|
||||||
|
@ -73,6 +73,7 @@ export default {
|
|||||||
WALLET: "余额支付",
|
WALLET: "余额支付",
|
||||||
},
|
},
|
||||||
supportForm: "", // 支持的支付方式
|
supportForm: "", // 支持的支付方式
|
||||||
|
checkSupport: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: ["res", "type"],
|
props: ["res", "type"],
|
||||||
@ -96,7 +97,7 @@ export default {
|
|||||||
this.setupSetting();
|
this.setupSetting();
|
||||||
},
|
},
|
||||||
onCancel: () => {
|
onCancel: () => {
|
||||||
val.splice(val.length - 1, 1);
|
this.formValidate = JSON.parse(JSON.stringify(this.checkSupport));
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -105,6 +106,7 @@ export default {
|
|||||||
setSetting(this.type, { paymentSupportItems: this.formValidate }).then(
|
setSetting(this.type, { paymentSupportItems: this.formValidate }).then(
|
||||||
(res) => {
|
(res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
this.checkSupport = JSON.parse(JSON.stringify(this.formValidate));
|
||||||
this.$Message.success("保存成功!");
|
this.$Message.success("保存成功!");
|
||||||
this.$Modal.remove();
|
this.$Modal.remove();
|
||||||
} else {
|
} else {
|
||||||
@ -117,12 +119,13 @@ export default {
|
|||||||
// 实例化数据
|
// 实例化数据
|
||||||
async init() {
|
async init() {
|
||||||
this.formValidate = JSON.parse(this.res).paymentSupportItems;
|
this.formValidate = JSON.parse(this.res).paymentSupportItems;
|
||||||
|
this.checkSupport = JSON.parse(JSON.stringify(this.formValidate));
|
||||||
console.log(this.formValidate);
|
console.log(this.formValidate);
|
||||||
|
|
||||||
await getPaymentSupportForm().then((res) => {
|
await getPaymentSupportForm().then((res) => {
|
||||||
// res.result.payments = ["H5", "PC"];
|
// res.result.payments = ["H5", "PC"];
|
||||||
this.supportForm = res.result;
|
this.supportForm = res.result;
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -34,10 +34,18 @@
|
|||||||
<FormItem class="form-item-view-el" label="apiclient_key" prop="apiclient_key">
|
<FormItem class="form-item-view-el" label="apiclient_key" prop="apiclient_key">
|
||||||
<Input v-model="formValidate.apiclientKey" :rows="6" maxlength="2500" show-word-limit type="textarea" placeholder="Enter something..." />
|
<Input v-model="formValidate.apiclientKey" :rows="6" maxlength="2500" show-word-limit type="textarea" placeholder="Enter something..." />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="公钥证书ID" prop="公钥证书ID">
|
<FormItem label="加签方式" prop="publicType">
|
||||||
|
<RadioGroup type="button" button-style="solid" v-model="formValidate.publicType" @change="handlePublicTypeChange">
|
||||||
|
<Radio label="CERT">平台证书</Radio>
|
||||||
|
<Radio label="KEY">微信支付公钥</Radio>
|
||||||
|
</RadioGroup>
|
||||||
|
<span class="desc">商户接收APIv3的请求应答、回调时验签使用,以下两种方式只能使用一种</span>
|
||||||
|
</FormItem>
|
||||||
|
<!-- 当加签方式选择“KEY”时展示 -->
|
||||||
|
<FormItem v-if="formValidate.publicType === 'KEY'" label="公钥证书ID" prop="publicId">
|
||||||
<Input maxlength="300" v-model="formValidate.publicId" />
|
<Input maxlength="300" v-model="formValidate.publicId" />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem class="form-item-view-el" label="公钥证书" prop="publicKey">
|
<FormItem v-if="formValidate.publicType === 'KEY'" class="form-item-view-el" label="公钥证书" prop="publicKey">
|
||||||
<Input v-model="formValidate.publicKey" :rows="6" maxlength="2500" show-word-limit type="textarea" placeholder="Enter something..." />
|
<Input v-model="formValidate.publicKey" :rows="6" maxlength="2500" show-word-limit type="textarea" placeholder="Enter something..." />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="支付回调域名" prop="callbackUrl">
|
<FormItem label="支付回调域名" prop="callbackUrl">
|
||||||
@ -97,7 +105,7 @@ export default {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="layout">
|
<div class="layout">
|
||||||
|
|
||||||
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate">
|
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
|
||||||
<FormItem label="提现审核是否开启">
|
<FormItem label="提现审核是否开启">
|
||||||
<i-switch v-model="formValidate.apply" style="margin-top:7px;"><span slot="open">开</span>
|
<i-switch v-model="formValidate.apply" style="margin-top:7px;"><span slot="open">开</span>
|
||||||
<span slot="close">关</span>
|
<span slot="close">关</span>
|
||||||
@ -36,12 +36,8 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
result:"",
|
result:"",
|
||||||
formValidate: { // 表单数据
|
ruleValidate: {}, // 验证规则
|
||||||
apply: true,
|
formValidate: {},// 表单数据
|
||||||
minPrice: "",
|
|
||||||
type: "",
|
|
||||||
wechatAppId: "",
|
|
||||||
},
|
|
||||||
|
|
||||||
switchTitle: "提现审核是否开启", // 切换title
|
switchTitle: "提现审核是否开启", // 切换title
|
||||||
};
|
};
|
||||||
@ -72,7 +68,29 @@ export default {
|
|||||||
// 实例化数据
|
// 实例化数据
|
||||||
init() {
|
init() {
|
||||||
this.result = JSON.parse(this.res);
|
this.result = JSON.parse(this.res);
|
||||||
|
Object.keys(this.result).map((item) => {
|
||||||
|
this.result[item] += "";
|
||||||
|
});
|
||||||
this.$set(this, "formValidate", { ...this.result });
|
this.$set(this, "formValidate", { ...this.result });
|
||||||
|
Object.keys(this.formValidate).forEach((item) => {
|
||||||
|
this.ruleValidate[item] = [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请填写必填项",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
if (value < 0) {
|
||||||
|
callback(new Error("不能输入负数!"));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
trigger: "change",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -1,29 +1,29 @@
|
|||||||
var BASE = {
|
var BASE = {
|
||||||
/**
|
/**
|
||||||
* @description api请求基础路径
|
* @description api请求基础路径
|
||||||
*/
|
*/
|
||||||
API_DEV: {
|
API_DEV: {
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "http://192.168.1.200:8890",
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
buyer: "http://192.168.1.200:8888",
|
||||||
seller: "https://store-api.pickmall.cn",
|
seller: "http://192.168.1.200:8889",
|
||||||
manager: "https://admin-api.pickmall.cn",
|
manager: "http://192.168.1.200:8887"
|
||||||
},
|
},
|
||||||
API_PROD: {
|
API_PROD: {
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "https://common-api.pickmall.cn",
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
buyer: "https://buyer-api.pickmall.cn",
|
||||||
seller: "https://store-api.pickmall.cn",
|
seller: "https://store-api.pickmall.cn",
|
||||||
manager: "https://admin-api.pickmall.cn",
|
manager: "https://admin-api.pickmall.cn",
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @description // 跳转买家端地址 pc端
|
* @description // 跳转买家端地址 pc端
|
||||||
*/
|
*/
|
||||||
PC_URL: "https://pc-b2b2c.pickmall.cn",
|
PC_URL: "http://127.0.0.1:10000",
|
||||||
/**
|
/**
|
||||||
* @description // 跳转买家端地址 wap端
|
* @description // 跳转买家端地址 wap端
|
||||||
*/
|
*/
|
||||||
WAP_URL: "https://m-b2b2c.pickmall.cn",
|
WAP_URL: "https://m-b2b2c.pickmall.cn",
|
||||||
/**
|
/**
|
||||||
* @description api请求基础路径前缀
|
* @description api请求基础路径前缀
|
||||||
*/
|
*/
|
||||||
PREFIX: "/store",
|
PREFIX: "/store",
|
||||||
};
|
};
|
||||||
|
@ -203,6 +203,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<AutoComplete ref="input" v-model="val.value"
|
<AutoComplete ref="input" v-model="val.value"
|
||||||
|
:disabled="containsSameSkuItem"
|
||||||
:filter-method="filterMethod"
|
:filter-method="filterMethod"
|
||||||
:maxlength="30" placeholder="请输入规格值" style="width: 180px"
|
:maxlength="30" placeholder="请输入规格值" style="width: 180px"
|
||||||
@on-focus="changeSkuVals(val, item.name)"
|
@on-focus="changeSkuVals(val, item.name)"
|
||||||
@ -257,6 +258,7 @@
|
|||||||
|
|
||||||
<FormItem v-if="item.spec_values.length < 10 && item.spec_values.length >= 1 && item.spec_values[0].value !== ''" class="sku-item-content-val flex" label="" style="line-height: 32px;">
|
<FormItem v-if="item.spec_values.length < 10 && item.spec_values.length >= 1 && item.spec_values[0].value !== ''" class="sku-item-content-val flex" label="" style="line-height: 32px;">
|
||||||
<AutoComplete ref="input" v-model="newSkuValues[$index]"
|
<AutoComplete ref="input" v-model="newSkuValues[$index]"
|
||||||
|
:disabled="containsSameSkuItem"
|
||||||
:filter-method="filterMethod"
|
:filter-method="filterMethod"
|
||||||
:maxlength="30" placeholder="自定义规格值" style="width: 180px"
|
:maxlength="30" placeholder="自定义规格值" style="width: 180px"
|
||||||
@on-blur="addSpec($index, item)"
|
@on-blur="addSpec($index, item)"
|
||||||
@ -630,6 +632,10 @@ export default {
|
|||||||
skuTableColumn: [],
|
skuTableColumn: [],
|
||||||
/** 表格数据 */
|
/** 表格数据 */
|
||||||
skuTableData: [],
|
skuTableData: [],
|
||||||
|
// 持久化的sku数据
|
||||||
|
skuTableDataCopy: [],
|
||||||
|
// 持久化的sku数据
|
||||||
|
skuInfoCopy: [],
|
||||||
/** 默认的规格参数 */
|
/** 默认的规格参数 */
|
||||||
skuData: [],
|
skuData: [],
|
||||||
/** 默认的规格值 */
|
/** 默认的规格值 */
|
||||||
@ -671,6 +677,9 @@ export default {
|
|||||||
shopCategory: [],
|
shopCategory: [],
|
||||||
/** 商品单位列表 */
|
/** 商品单位列表 */
|
||||||
goodsUnitList: [],
|
goodsUnitList: [],
|
||||||
|
containsSameSkuItem: false,
|
||||||
|
containsSameSkuValue: false,
|
||||||
|
containsSameSkuNewValue: false,
|
||||||
// 展示商品视频
|
// 展示商品视频
|
||||||
showGoodsVideo: false,
|
showGoodsVideo: false,
|
||||||
ignoreColumn: [
|
ignoreColumn: [
|
||||||
@ -729,17 +738,6 @@ export default {
|
|||||||
desc: "视频大小不能超过10MB",
|
desc: "视频大小不能超过10MB",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onAddSku(index) {
|
|
||||||
if (!this.newSkuValues[index]) {
|
|
||||||
this.$Message.error('请输入规格值')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.skuInfo[index].spec_values.push({
|
|
||||||
name: this.newSkuValues[index].name,
|
|
||||||
value: this.newSkuValues[index],
|
|
||||||
images: this.openImage ? [] : this.baseInfoForm.goodsGalleryFiles
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 图片选择后回调
|
// 图片选择后回调
|
||||||
callbackSelected(val) {
|
callbackSelected(val) {
|
||||||
this.picModelFlag = false;
|
this.picModelFlag = false;
|
||||||
@ -1246,6 +1244,14 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 添加规格项 */
|
/** 添加规格项 */
|
||||||
addSkuItem() {
|
addSkuItem() {
|
||||||
|
if (this.containsSameSkuItem) {
|
||||||
|
this.$Message.error("存在重复规格项!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.containsSameSkuValue) {
|
||||||
|
this.$Message.error("存在重复规格值!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (this.skuInfo.length >= 5) {
|
if (this.skuInfo.length >= 5) {
|
||||||
this.$Message.error("规格项不能大于5个!");
|
this.$Message.error("规格项不能大于5个!");
|
||||||
return;
|
return;
|
||||||
@ -1269,8 +1275,10 @@ export default {
|
|||||||
editSkuItem(val, index, item) {
|
editSkuItem(val, index, item) {
|
||||||
if (this.skuTableData.find((i) => i[val])) {
|
if (this.skuTableData.find((i) => i[val])) {
|
||||||
this.$Message.error("已存在相同规格项!");
|
this.$Message.error("已存在相同规格项!");
|
||||||
|
this.containsSameSkuItem = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.containsSameSkuItem = false;
|
||||||
if (this.zz(0, val) > 20) {
|
if (this.zz(0, val) > 20) {
|
||||||
this.$Message.error("规格值最多十个字符长度!");
|
this.$Message.error("规格值最多十个字符长度!");
|
||||||
// val = val.toString().slice(0, 4);
|
// val = val.toString().slice(0, 4);
|
||||||
@ -1283,6 +1291,11 @@ export default {
|
|||||||
delete e[this.currentSkuItem];
|
delete e[this.currentSkuItem];
|
||||||
return e;
|
return e;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.skuInfo[index].name = val;
|
||||||
|
this.skuInfo[index].spec_values.forEach((e) => {
|
||||||
|
e.name = val;
|
||||||
|
});
|
||||||
this.currentSkuItem = val;
|
this.currentSkuItem = val;
|
||||||
this.renderTableData(this.skuTableData);
|
this.renderTableData(this.skuTableData);
|
||||||
},
|
},
|
||||||
@ -1322,8 +1335,13 @@ export default {
|
|||||||
skuValueChange(val, index, item, $index) {
|
skuValueChange(val, index, item, $index) {
|
||||||
if (this.skuTableData.find((i) => i[val.name] === val.value)) {
|
if (this.skuTableData.find((i) => i[val.name] === val.value)) {
|
||||||
this.$Message.error("已存在相同规格值!");
|
this.$Message.error("已存在相同规格值!");
|
||||||
|
|
||||||
|
this.skuInfo = cloneObj(this.skuInfoCopy);
|
||||||
|
this.skuTableData = cloneObj(this.skuTableDataCopy);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.containsSameSkuValue = false;
|
||||||
if (val.value === '') {
|
if (val.value === '') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1343,6 +1361,8 @@ export default {
|
|||||||
return e;
|
return e;
|
||||||
});
|
});
|
||||||
this.currentSkuVal = val.value;
|
this.currentSkuVal = val.value;
|
||||||
|
this.skuTableDataCopy = cloneObj(this.skuTableData);
|
||||||
|
this.skuInfoCopy = cloneObj(this.skuInfo);
|
||||||
this.renderTableData(this.skuTableData);
|
this.renderTableData(this.skuTableData);
|
||||||
},
|
},
|
||||||
// 获取焦点时,取得规格名对应的规格值
|
// 获取焦点时,取得规格名对应的规格值
|
||||||
@ -1366,6 +1386,12 @@ export default {
|
|||||||
(e) => e[spec.name] !== this.lastEditSkuValue
|
(e) => e[spec.name] !== this.lastEditSkuValue
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 判断是否存在重复规格值
|
||||||
|
if (!this.skuTableData.find((i) => i[val.name] === val.value)) {
|
||||||
|
this.skuTableDataCopy = cloneObj(this.skuTableData);
|
||||||
|
this.skuInfoCopy = cloneObj(this.skuInfo);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/** 移除当前规格项 进行数据变化*/
|
/** 移除当前规格项 进行数据变化*/
|
||||||
handleCloseSkuItem($index, item) {
|
handleCloseSkuItem($index, item) {
|
||||||
@ -1456,6 +1482,21 @@ export default {
|
|||||||
this.$Message.error("请输入规格值");
|
this.$Message.error("请输入规格值");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.containsSameSkuItem) {
|
||||||
|
this.$Message.error("存在重复规格项!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.spec_values.find((i) => i.value === this.newSkuValues[$index])) {
|
||||||
|
this.newSkuValues[$index] = "";
|
||||||
|
this.skuInfo = cloneObj(this.skuInfoCopy);
|
||||||
|
this.skuTableData = cloneObj(this.skuTableDataCopy);
|
||||||
|
this.$Message.error("存在重复规格值!");
|
||||||
|
this.containsSameSkuNewValue = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.validateEmpty(item.spec_values)) {
|
if (this.validateEmpty(item.spec_values)) {
|
||||||
if (item.spec_values.length >= 10) {
|
if (item.spec_values.length >= 10) {
|
||||||
this.$Message.error("规格值不能大于10个!");
|
this.$Message.error("规格值不能大于10个!");
|
||||||
@ -1514,6 +1555,9 @@ export default {
|
|||||||
}
|
}
|
||||||
this.baseInfoForm.regeneratorSkuFlag = true;
|
this.baseInfoForm.regeneratorSkuFlag = true;
|
||||||
this.newSkuValues[$index] = "";
|
this.newSkuValues[$index] = "";
|
||||||
|
|
||||||
|
this.skuTableDataCopy = cloneObj(this.skuTableData);
|
||||||
|
this.skuInfoCopy = cloneObj(this.skuInfo);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleClearSku() {
|
handleClearSku() {
|
||||||
@ -1780,6 +1824,14 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 添加商品 **/
|
/** 添加商品 **/
|
||||||
save() {
|
save() {
|
||||||
|
if (this.containsSameSkuItem) {
|
||||||
|
this.$Message.error("存在重复规格项!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.containsSameSkuValue) {
|
||||||
|
this.$Message.error("存在重复规格值!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.submitLoading = true;
|
this.submitLoading = true;
|
||||||
this.$refs["baseInfoForm"].validate((valid) => {
|
this.$refs["baseInfoForm"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
@ -24,11 +24,6 @@
|
|||||||
<Icon v-show="currentMessageType == 'read'" type="md-checkmark"></Icon>
|
<Icon v-show="currentMessageType == 'read'" type="md-checkmark"></Icon>
|
||||||
</transition>
|
</transition>
|
||||||
<span class="mes-type-btn-text">已读消息</span>
|
<span class="mes-type-btn-text">已读消息</span>
|
||||||
<Badge
|
|
||||||
class="message-count-badge-outer"
|
|
||||||
class-name="message-count-badge"
|
|
||||||
:count="hasReadCount"
|
|
||||||
></Badge>
|
|
||||||
</div>
|
</div>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@ -39,11 +34,6 @@
|
|||||||
<Icon v-show="currentMessageType == 'recycleBin'" type="md-checkmark"></Icon>
|
<Icon v-show="currentMessageType == 'recycleBin'" type="md-checkmark"></Icon>
|
||||||
</transition>
|
</transition>
|
||||||
<span class="mes-type-btn-text">回收站</span>
|
<span class="mes-type-btn-text">回收站</span>
|
||||||
<Badge
|
|
||||||
class="message-count-badge-outer"
|
|
||||||
class-name="message-count-badge"
|
|
||||||
:count="recycleBinCount"
|
|
||||||
></Badge>
|
|
||||||
</div>
|
</div>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@ -98,7 +88,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Cookies from "js-cookie";
|
|
||||||
import * as API_Index from "@/api/index";
|
import * as API_Index from "@/api/index";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -120,8 +109,6 @@
|
|||||||
API_Index.read(v.id).then(res => {
|
API_Index.read(v.id).then(res => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success("操作成功");
|
|
||||||
this.currentMessageType = "unread"
|
|
||||||
this.getAll();
|
this.getAll();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -148,9 +135,7 @@
|
|||||||
API_Index.deleteMessage(v.id).then(res => {
|
API_Index.deleteMessage(v.id).then(res => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success("删除成功");
|
this.refreshMessage()
|
||||||
this.currentMessageType = "read"
|
|
||||||
this.getAll();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -177,9 +162,7 @@
|
|||||||
API_Index.reductionMessage(v.id).then(res => {
|
API_Index.reductionMessage(v.id).then(res => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.setCurrentMesType("read");
|
this.refreshMessage()
|
||||||
this.recycleBinCount -= 1
|
|
||||||
this.hasReadCount +=1
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -205,9 +188,7 @@
|
|||||||
API_Index.clearMessage(v.id).then(res => {
|
API_Index.clearMessage(v.id).then(res => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success("删除成功");
|
this.refreshMessage()
|
||||||
this.currentMessageType = "recycleBin"
|
|
||||||
this.getAll();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -390,6 +371,13 @@
|
|||||||
},
|
},
|
||||||
getContent(v) {
|
getContent(v) {
|
||||||
this.mes.content = v.content;
|
this.mes.content = v.content;
|
||||||
|
|
||||||
|
API_Index.read(v.id).then(res => {
|
||||||
|
this.loading = false;
|
||||||
|
if (res.success) {
|
||||||
|
this.getAll()();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -442,7 +442,7 @@
|
|||||||
<Form :model="faceSheetForm" ref="faceSheetForm" v-if="facesheetFlag" :rules="faceSheetFormValidate">
|
<Form :model="faceSheetForm" ref="faceSheetForm" v-if="facesheetFlag" :rules="faceSheetFormValidate">
|
||||||
<FormItem label="物流公司" prop="logisticsId" style="position: relative" :label-width="90">
|
<FormItem label="物流公司" prop="logisticsId" style="position: relative" :label-width="90">
|
||||||
<Select v-model="faceSheetForm.logisticsId" placeholder="请选择" style="width: 250px">
|
<Select v-model="faceSheetForm.logisticsId" placeholder="请选择" style="width: 250px">
|
||||||
<Option v-for="(item, i) in checkedLogistics" :key="i" :value="item.id">{{ item.name }}
|
<Option v-for="(item, i) in checkedLogistics" :key="i" :value="item.logisticsId">{{ item.name }}
|
||||||
</Option>
|
</Option>
|
||||||
</Select>
|
</Select>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
@ -451,7 +451,7 @@
|
|||||||
:rules="orderDeliverFormValidate" style="position: relative">
|
:rules="orderDeliverFormValidate" style="position: relative">
|
||||||
<FormItem label="物流公司" prop="logisticsId">
|
<FormItem label="物流公司" prop="logisticsId">
|
||||||
<Select v-model="orderDeliveryForm.logisticsId" placeholder="请选择" style="width: 250px">
|
<Select v-model="orderDeliveryForm.logisticsId" placeholder="请选择" style="width: 250px">
|
||||||
<Option v-for="(item, i) in checkedLogistics" :key="i" :value="item.id">{{ item.name }}
|
<Option v-for="(item, i) in checkedLogistics" :key="i" :value="item.logisticsId">{{ item.name }}
|
||||||
</Option>
|
</Option>
|
||||||
</Select>
|
</Select>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
@ -1166,9 +1166,11 @@ export default {
|
|||||||
this.$refs['faceSheetForm'].validate((valid) => {
|
this.$refs['faceSheetForm'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
API_Order.getOrderFaceSheet(this.sn, this.faceSheetForm).then(res => {
|
API_Order.getOrderFaceSheet(this.sn, this.faceSheetForm).then(res => {
|
||||||
if (res.success) {
|
if (res.success && res.result.printTemplate) {
|
||||||
this.someJSONdata = res.result.printTemplate;
|
this.someJSONdata = res.result.printTemplate;
|
||||||
this.toPrints();
|
this.toPrints();
|
||||||
|
}else{
|
||||||
|
this.$Message.success("电子面单发货失败!");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -38,10 +38,10 @@
|
|||||||
:max="9.9"
|
:max="9.9"
|
||||||
:min="0.1"
|
:min="0.1"
|
||||||
:step="0.1"
|
:step="0.1"
|
||||||
|
precision="1"
|
||||||
v-model="form.couponDiscount"
|
v-model="form.couponDiscount"
|
||||||
style="width: 260px">
|
style="width: 260px"/>
|
||||||
</InputNumber>
|
<span class="describe">请输入0-10的数字,可有一位小数</span>
|
||||||
<span class="describe">请输入0-10之间数字,可以输入一位小数</span>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="面额" prop="price" v-if="form.couponType == 'PRICE'">
|
<FormItem label="面额" prop="price" v-if="form.couponType == 'PRICE'">
|
||||||
<Input
|
<Input
|
||||||
@ -256,7 +256,6 @@ export default {
|
|||||||
formRule: {
|
formRule: {
|
||||||
promotionName: [{ required: true, message: "活动名称不能为空" }],
|
promotionName: [{ required: true, message: "活动名称不能为空" }],
|
||||||
couponName: [{ required: true, message: "优惠券名称不能为空" }],
|
couponName: [{ required: true, message: "优惠券名称不能为空" }],
|
||||||
couponLimitNum: [{ required: true, message: "领取限制不能为空" }],
|
|
||||||
price: [{ required: true, message: "请输入面额" }, { validator: checkPrice }],
|
price: [{ required: true, message: "请输入面额" }, { validator: checkPrice }],
|
||||||
consumeThreshold: [
|
consumeThreshold: [
|
||||||
{ required: true, message: "请输入消费门槛" },
|
{ required: true, message: "请输入消费门槛" },
|
||||||
|
@ -154,10 +154,12 @@ export default {
|
|||||||
key: "price",
|
key: "price",
|
||||||
width: 100,
|
width: 100,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.price) {
|
if (params.row.couponType === "PRICE") {
|
||||||
return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} );
|
return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} );
|
||||||
} else {
|
} else if(params.row.couponType === "DISCOUNT") {
|
||||||
return h("div", (params.row.couponDiscount || 0) + "折");
|
return h("div", (params.row.couponDiscount || 0) + "折");
|
||||||
|
}else{
|
||||||
|
return h("div", "未知");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -38,8 +38,14 @@
|
|||||||
clearable style="width: 280px" />
|
clearable style="width: 280px" />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem v-if="form.discountType == 'fullRateFlag'" label="优惠折扣" prop="fullRate">
|
<FormItem v-if="form.discountType == 'fullRateFlag'" label="优惠折扣" prop="fullRate">
|
||||||
<Input :disabled="form.promotionStatus != 'NEW'" type="text" v-model="form.fullRate" placeholder="优惠折扣"
|
<InputNumber :disabled="form.promotionStatus != 'NEW'"
|
||||||
clearable style="width: 280px" />
|
placeholder="优惠折扣"
|
||||||
|
:max="9.9"
|
||||||
|
:min="0.1"
|
||||||
|
:step="0.1"
|
||||||
|
precision="1"
|
||||||
|
v-model="form.fullRate"
|
||||||
|
style="width: 260px"/>
|
||||||
<span class="describe">优惠折扣为0-10之间数字,可有一位小数</span>
|
<span class="describe">优惠折扣为0-10之间数字,可有一位小数</span>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="额外赠送">
|
<FormItem label="额外赠送">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user