Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop-ui
commit
36794613cd
|
@ -1,21 +1,17 @@
|
||||||
var BASE = {
|
var BASE = {
|
||||||
/**
|
/**
|
||||||
* @description api请求基础路径
|
* @description api请求基础路径
|
||||||
*/
|
*/
|
||||||
API_DEV: {
|
API_DEV: {
|
||||||
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"
|
||||||
// common: "http://192.168.0.105:8890",
|
},
|
||||||
// buyer: "http://192.168.0.105:8888",
|
API_PROD: {
|
||||||
// seller: "http://192.168.0.105:8889",
|
common: "https://common-api.pickmall.cn",
|
||||||
// manager: "http://192.168.0.105:8887"
|
buyer: "https://buyer-api.pickmall.cn",
|
||||||
},
|
seller: "https://store-api.pickmall.cn",
|
||||||
API_PROD: {
|
manager: "https://admin-api.pickmall.cn"
|
||||||
common: "https://common-api.pickmall.cn",
|
},
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
};
|
||||||
seller: "https://store-api.pickmall.cn",
|
|
||||||
manager: "https://admin-api.pickmall.cn"
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
|
@ -5,25 +5,44 @@
|
||||||
<div>
|
<div>
|
||||||
<div class="coupon-title">
|
<div class="coupon-title">
|
||||||
<router-link to="/">
|
<router-link to="/">
|
||||||
<img src="../assets/images/logo.png" width="120" alt="">
|
<img src="../assets/images/logo.png" width="120" alt="" />
|
||||||
</router-link>
|
</router-link>
|
||||||
<p>领券中心</p>
|
<p>领券中心</p>
|
||||||
<Input search style="width:400px" @on-search='search' enter-button="搜索" placeholder="搜索优惠券" />
|
<Input
|
||||||
|
search
|
||||||
|
style="width: 400px"
|
||||||
|
@on-search="search"
|
||||||
|
enter-button="搜索"
|
||||||
|
placeholder="搜索优惠券"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="fontsize_18 recommend">推荐好券</div>
|
<div class="fontsize_18 recommend">推荐好券</div>
|
||||||
|
|
||||||
<empty v-if="list.length===0" />
|
<empty v-if="list.length === 0" />
|
||||||
<ul class="coupon-list" v-else>
|
<ul class="coupon-list" v-else>
|
||||||
<li v-for="(item, index) in list" class="coupon-item" :key="index">
|
<li v-for="(item, index) in list" class="coupon-item" :key="index">
|
||||||
<div class="c-left">
|
<div class="c-left">
|
||||||
<div>
|
<div>
|
||||||
<span v-if="item.couponType === 'PRICE'" class="fontsize_12 global_color">¥<span class="price">{{item.price | unitPrice}}</span></span>
|
<span
|
||||||
<span v-if="item.couponType === 'DISCOUNT'" class="fontsize_12 global_color"><span class="price">{{item.couponDiscount}}</span>折</span>
|
v-if="item.couponType === 'PRICE'"
|
||||||
<span class="describe">满{{item.consumeThreshold}}元可用</span>
|
class="fontsize_12 global_color"
|
||||||
|
>¥<span class="price">{{
|
||||||
|
item.price | unitPrice
|
||||||
|
}}</span></span
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
v-if="item.couponType === 'DISCOUNT'"
|
||||||
|
class="fontsize_12 global_color"
|
||||||
|
><span class="price">{{ item.couponDiscount }}</span
|
||||||
|
>折</span
|
||||||
|
>
|
||||||
|
<span class="describe"
|
||||||
|
>满{{ item.consumeThreshold }}元可用</span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<p>使用范围:{{useScope(item.scopeType, item.storeName)}}</p>
|
<p>使用范围:{{ useScope(item.scopeType, item.storeName) }}</p>
|
||||||
<p>有效期:{{item.endTime}}</p>
|
<p>有效期:{{ item.endTime }}</p>
|
||||||
</div>
|
</div>
|
||||||
<b></b>
|
<b></b>
|
||||||
<a class="c-right" @click="receive(item)">立即领取</a>
|
<a class="c-right" @click="receive(item)">立即领取</a>
|
||||||
|
@ -31,12 +50,15 @@
|
||||||
<i class="circle-bottom"></i>
|
<i class="circle-bottom"></i>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<Page :total="total" @on-change="changePageNum"
|
<Page
|
||||||
|
:total="total"
|
||||||
|
@on-change="changePageNum"
|
||||||
class="pageration"
|
class="pageration"
|
||||||
@on-page-size-change="changePageSize"
|
@on-page-size-change="changePageSize"
|
||||||
:page-size="params.pageSize"
|
:page-size="params.pageSize"
|
||||||
show-total
|
show-total
|
||||||
show-sizer>
|
show-sizer
|
||||||
|
>
|
||||||
</Page>
|
</Page>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -44,135 +66,136 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {couponList, receiveCoupon} from '@/api/member.js'
|
import { couponList, receiveCoupon } from "@/api/member.js";
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [], // 优惠券列表
|
list: [], // 优惠券列表
|
||||||
total: 0, // 优惠券总数
|
total: 0, // 优惠券总数
|
||||||
params: { // 请求参数
|
params: {
|
||||||
getType: 'FREE',
|
// 请求参数
|
||||||
|
getType: "FREE",
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 20
|
pageSize: 20,
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 搜索优惠券
|
// 搜索优惠券
|
||||||
search (item) {
|
search(item) {
|
||||||
this.params.couponName = item
|
this.params.couponName = item;
|
||||||
this.params.pageNumber = 1
|
this.params.pageNumber = 1;
|
||||||
this.getList()
|
this.getList();
|
||||||
},
|
},
|
||||||
// 获取优惠券列表
|
// 获取优惠券列表
|
||||||
getList () {
|
getList() {
|
||||||
this.$Spin.show()
|
this.$Spin.show();
|
||||||
couponList(this.params).then(res => {
|
couponList(this.params)
|
||||||
this.$Spin.hide()
|
.then((res) => {
|
||||||
this.loading = false
|
this.$Spin.hide();
|
||||||
if (res.success) {
|
this.loading = false;
|
||||||
this.list = res.result.records
|
if (res.success) {
|
||||||
this.total = res.result.total
|
this.list = res.result.records;
|
||||||
}
|
this.total = res.result.total;
|
||||||
}).catch(() => { this.$Spin.hide() })
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$Spin.hide();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 分页 改变页码
|
// 分页 改变页码
|
||||||
changePageNum (val) {
|
changePageNum(val) {
|
||||||
this.params.pageNumber = val;
|
this.params.pageNumber = val;
|
||||||
this.getList()
|
this.getList();
|
||||||
},
|
},
|
||||||
// 分页 改变每页数
|
// 分页 改变每页数
|
||||||
changePageSize (val) {
|
changePageSize(val) {
|
||||||
this.params.pageNumber = 1;
|
this.params.pageNumber = 1;
|
||||||
this.params.pageSize = val;
|
this.params.pageSize = val;
|
||||||
this.getList()
|
this.getList();
|
||||||
},
|
},
|
||||||
// 领取优惠券
|
// 领取优惠券
|
||||||
receive (item) {
|
receive(item) {
|
||||||
receiveCoupon(item.id).then(res => {
|
receiveCoupon(item.id).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
console.log(item);
|
||||||
this.$Modal.confirm({
|
this.$Modal.confirm({
|
||||||
title: '领取优惠券',
|
title: "领取优惠券",
|
||||||
content: '<p>优惠券领取成功,可到我的优惠券页面查看</p>',
|
content: "<p>优惠券领取成功,可到我的优惠券页面查看</p>",
|
||||||
okText: '我的优惠券',
|
okText: "我的优惠券",
|
||||||
cancelText: '立即使用',
|
cancelText: "立即使用",
|
||||||
closable: true,
|
closable: true,
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
this.$router.push('/home/Coupons')
|
this.$router.push("/home/Coupons");
|
||||||
},
|
},
|
||||||
onCancel: () => {
|
onCancel: () => {
|
||||||
if (item.storeId !== '0') {
|
this.$router.push({
|
||||||
this.$router.push({path: '/merchant', query: {id: item.storeId}})
|
path: "/goodsList",
|
||||||
} else {
|
query: { promotionsId: item.id, promotionType: "COUPON" },
|
||||||
if (item.scopeType === 'PORTION_GOODS_CATEGORY') {
|
});
|
||||||
this.$router.push({path: '/goodsList', query: {categoryId: item.scopeId}})
|
},
|
||||||
} else {
|
|
||||||
this.$router.push({path: '/goodsList'})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
// 优惠券可用范围
|
// 优惠券可用范围
|
||||||
useScope (type, storeName) {
|
useScope(type, storeName) {
|
||||||
let shop = '平台';
|
let shop = "平台";
|
||||||
let goods = '全部商品'
|
let goods = "全部商品";
|
||||||
if (storeName !== 'platform') shop = storeName
|
if (storeName !== "platform") shop = storeName;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'ALL':
|
case "ALL":
|
||||||
goods = '全部商品'
|
goods = "全部商品";
|
||||||
break;
|
break;
|
||||||
case 'PORTION_GOODS':
|
case "PORTION_GOODS":
|
||||||
goods = '部分商品'
|
goods = "部分商品";
|
||||||
break;
|
break;
|
||||||
case 'PORTION_GOODS_CATEGORY':
|
case "PORTION_GOODS_CATEGORY":
|
||||||
goods = '部分分类商品'
|
goods = "部分分类商品";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return `${shop}${goods}可用`
|
return `${shop}${goods}可用`;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted() {
|
||||||
this.getList()
|
this.getList();
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import '../assets/styles/coupon.scss';
|
@import "../assets/styles/coupon.scss";
|
||||||
.content{
|
.content {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
|
||||||
> div {
|
> div {
|
||||||
margin: 10px auto;
|
margin: 10px auto;
|
||||||
width: 1200px;
|
width: 1200px;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.coupon-title {
|
}
|
||||||
display: flex;
|
.coupon-title {
|
||||||
align-items: center;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
p{
|
p {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
margin-right: 500px;
|
margin-right: 500px;
|
||||||
}
|
|
||||||
border-bottom: 2px solid $theme_color;
|
|
||||||
}
|
}
|
||||||
.recommend {
|
border-bottom: 2px solid $theme_color;
|
||||||
margin: 20px auto;
|
}
|
||||||
font-weight: bold;
|
.recommend {
|
||||||
width: 200px;
|
margin: 20px auto;
|
||||||
text-align: center;
|
font-weight: bold;
|
||||||
}
|
width: 200px;
|
||||||
.coupon-item {
|
text-align: center;
|
||||||
b{
|
}
|
||||||
background: url('../assets/images/small-circle.png') top left repeat-y;
|
.coupon-item {
|
||||||
}
|
b {
|
||||||
}
|
background: url("../assets/images/small-circle.png") top left repeat-y;
|
||||||
.pageration {
|
|
||||||
text-align: right;
|
|
||||||
padding-bottom: 10px;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
.pageration {
|
||||||
|
text-align: right;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
<div class="store-collect">
|
<div class="store-collect">
|
||||||
<span class="mr_10" v-if="goodsMsg.data">
|
<span class="mr_10" v-if="goodsMsg.data">
|
||||||
<router-link :to="'Merchant?id=' + goodsMsg.data.storeId">{{
|
<router-link :to="'Merchant?id=' + goodsMsg.data.storeId">{{
|
||||||
goodsMsg.data.storeName
|
goodsMsg.data.storeName
|
||||||
}}</router-link>
|
}}</router-link>
|
||||||
</span>
|
</span>
|
||||||
<span @click="collect">
|
<span @click="collect">
|
||||||
<Icon type="ios-heart" :color="storeCollected ? '#ed3f14' : '#666'" />
|
<Icon type="ios-heart" :color="storeCollected ? '#ed3f14' : '#666'" />
|
||||||
{{ storeCollected ? "已收藏店铺" : "收藏店铺" }}
|
{{ storeCollected? "已收藏店铺": "收藏店铺" }}
|
||||||
</span>
|
</span>
|
||||||
<span class="ml_10" @click="IMService()">联系客服</span>
|
<span class="ml_10" @click="IMService()">联系客服</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -92,6 +92,17 @@ export default {
|
||||||
"&skuId=" +
|
"&skuId=" +
|
||||||
this.goodsMsg.data.id
|
this.goodsMsg.data.id
|
||||||
);
|
);
|
||||||
|
// window.open(
|
||||||
|
// 'http://192.168.0.139:8000/' +
|
||||||
|
// "?token=" +
|
||||||
|
// accessToken +
|
||||||
|
// "&id=" +
|
||||||
|
// this.goodsMsg.data.storeId +
|
||||||
|
// "&goodsId=" +
|
||||||
|
// this.goodsMsg.data.goodsId +
|
||||||
|
// "&skuId=" +
|
||||||
|
// this.goodsMsg.data.id
|
||||||
|
// );
|
||||||
},
|
},
|
||||||
// 获取im信息
|
// 获取im信息
|
||||||
async getIMDetailMethods () {
|
async getIMDetailMethods () {
|
||||||
|
|
|
@ -82,20 +82,24 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="goods-show-right">
|
<div class="goods-show-right">
|
||||||
<Tag class="goods-show-tag" color="red" v-if="item.content.selfOperated">
|
<Tag
|
||||||
|
class="goods-show-tag"
|
||||||
|
color="red"
|
||||||
|
v-if="item.content.selfOperated"
|
||||||
|
>
|
||||||
自营
|
自营
|
||||||
</Tag>
|
</Tag>
|
||||||
<Tag
|
<Tag
|
||||||
class="goods-show-tag" color="blue"
|
class="goods-show-tag"
|
||||||
|
color="blue"
|
||||||
v-if="item.content.goodsType == 'VIRTUAL_GOODS'"
|
v-if="item.content.goodsType == 'VIRTUAL_GOODS'"
|
||||||
>
|
>
|
||||||
虚拟
|
虚拟
|
||||||
</Tag>
|
</Tag>
|
||||||
<Tag
|
<Tag
|
||||||
class="goods-show-tag" color="blue"
|
class="goods-show-tag"
|
||||||
v-else-if="
|
color="blue"
|
||||||
item.content.goodsType == 'PHYSICAL_GOODS'
|
v-else-if="item.content.goodsType == 'PHYSICAL_GOODS'"
|
||||||
"
|
|
||||||
>
|
>
|
||||||
实物
|
实物
|
||||||
</Tag>
|
</Tag>
|
||||||
|
@ -155,13 +159,21 @@ export default {
|
||||||
watch: {
|
watch: {
|
||||||
$route() {
|
$route() {
|
||||||
const keyword = this.$route.query.keyword;
|
const keyword = this.$route.query.keyword;
|
||||||
this.handleSearch(keyword);
|
if (keyword) {
|
||||||
|
this.handleSearch(keyword);
|
||||||
|
}
|
||||||
if (this.$route.query.categoryId) {
|
if (this.$route.query.categoryId) {
|
||||||
let cateId = this.$route.query.categoryId.split(",");
|
let cateId = this.$route.query.categoryId.split(",");
|
||||||
Object.assign(this.params, this.$route.query);
|
Object.assign(this.params, this.$route.query);
|
||||||
this.params.categoryId = cateId[cateId.length - 1];
|
this.params.categoryId = cateId[cateId.length - 1];
|
||||||
this.getGoodsList();
|
|
||||||
}
|
}
|
||||||
|
if (this.$route.query.promotionType) {
|
||||||
|
this.params.promotionType = this.$route.query.promotionType;
|
||||||
|
}
|
||||||
|
if (this.$route.query.promotionsId) {
|
||||||
|
this.params.promotionsId = this.$route.query.promotionsId;
|
||||||
|
}
|
||||||
|
this.getGoodsList();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -301,7 +313,6 @@ export default {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.goods-show-self {
|
.goods-show-self {
|
||||||
float: left;
|
float: left;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
|
|
|
@ -1,136 +1,155 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<card _Title="优惠券列表" :_Tabs="statusNameList" @_Change="change" />
|
<card _Title="优惠券列表" :_Tabs="statusNameList" @_Change="change" />
|
||||||
<empty v-if="list.length==0" />
|
<empty v-if="list.length == 0" />
|
||||||
<ul class="coupon-list" v-else>
|
<ul class="coupon-list" v-else>
|
||||||
<li v-for="(item, index) in list" class="coupon-item" :key="index">
|
<li v-for="(item, index) in list" class="coupon-item" :key="index">
|
||||||
<div class="c-left">
|
<div class="c-left">
|
||||||
<div>
|
<div>
|
||||||
<span v-if="item.couponType === 'PRICE'" class="fontsize_12 global_color">¥<span class="price">{{item.price | unitPrice}}</span></span>
|
<span
|
||||||
<span v-if="item.couponType === 'DISCOUNT'" class="fontsize_12 global_color"><span class="price">{{item.discount}}</span>折</span>
|
v-if="item.couponType === 'PRICE'"
|
||||||
<span class="describe">满{{item.consumeThreshold}}元可用</span>
|
class="fontsize_12 global_color"
|
||||||
|
>¥<span class="price">{{ item.price | unitPrice }}</span></span
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
v-if="item.couponType === 'DISCOUNT'"
|
||||||
|
class="fontsize_12 global_color"
|
||||||
|
><span class="price">{{ item.discount }}</span
|
||||||
|
>折</span
|
||||||
|
>
|
||||||
|
<span class="describe">满{{ item.consumeThreshold }}元可用</span>
|
||||||
</div>
|
</div>
|
||||||
<p>使用范围:{{useScope(item.scopeType, item.storeName)}}</p>
|
<p>使用范围:{{ useScope(item.scopeType, item.storeName) }}</p>
|
||||||
<p>有效期:{{item.endTime}}</p>
|
<p>有效期:{{ item.endTime }}</p>
|
||||||
</div>
|
</div>
|
||||||
<b></b>
|
<b></b>
|
||||||
<a class="c-right" :class="{'canot-use':params.memberCouponStatus !== 'NEW'}" @click="go(item)">立即使用</a>
|
<a
|
||||||
|
class="c-right"
|
||||||
|
:class="{ 'canot-use': params.memberCouponStatus !== 'NEW' }"
|
||||||
|
@click="go(item)"
|
||||||
|
>立即使用</a
|
||||||
|
>
|
||||||
<i class="circle-top"></i>
|
<i class="circle-top"></i>
|
||||||
<i class="circle-bottom"></i>
|
<i class="circle-bottom"></i>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<Page :total="total" @on-change="changePageNum"
|
<Page
|
||||||
|
:total="total"
|
||||||
|
@on-change="changePageNum"
|
||||||
class="pageration"
|
class="pageration"
|
||||||
@on-page-size-change="changePageSize"
|
@on-page-size-change="changePageSize"
|
||||||
:page-size="params.pageSize"
|
:page-size="params.pageSize"
|
||||||
show-total
|
show-total
|
||||||
show-sizer>
|
show-sizer
|
||||||
|
>
|
||||||
</Page>
|
</Page>
|
||||||
<Spin v-if="loading" fix></Spin>
|
<Spin v-if="loading" fix></Spin>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { memberCouponList } from '@/api/member.js';
|
import { memberCouponList } from "@/api/member.js";
|
||||||
export default {
|
export default {
|
||||||
name: 'Coupons',
|
name: "Coupons",
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
statusNameList: [ // 优惠券状态
|
statusNameList: [
|
||||||
'未使用',
|
// 优惠券状态
|
||||||
'已使用',
|
"未使用",
|
||||||
'已过期'
|
"已使用",
|
||||||
|
"已过期",
|
||||||
],
|
],
|
||||||
statusList: ['NEW', 'USED', 'EXPIRE'], // 优惠券状态
|
statusList: ["NEW", "USED", "EXPIRE"], // 优惠券状态
|
||||||
loading: false, // 列表加载状态
|
loading: false, // 列表加载状态
|
||||||
params: { // 请求参数
|
params: {
|
||||||
|
// 请求参数
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
memberCouponStatus: 'NEW'
|
memberCouponStatus: "NEW",
|
||||||
},
|
},
|
||||||
total: 0, // 优惠券总数
|
total: 0, // 优惠券总数
|
||||||
list: [] // 优惠券列表
|
list: [], // 优惠券列表
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getList () { // 获取优惠券列表
|
getList() {
|
||||||
this.loading = true
|
// 获取优惠券列表
|
||||||
memberCouponList(this.params).then(res => {
|
this.loading = true;
|
||||||
this.loading = false
|
memberCouponList(this.params).then((res) => {
|
||||||
|
this.loading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.list = res.result.records
|
this.list = res.result.records;
|
||||||
this.total = res.result.total
|
this.total = res.result.total;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
// 切换优惠券状态
|
// 切换优惠券状态
|
||||||
change (index) {
|
change(index) {
|
||||||
this.params.memberCouponStatus = this.statusList[index]
|
this.params.memberCouponStatus = this.statusList[index];
|
||||||
this.params.pageNumber = 1;
|
this.params.pageNumber = 1;
|
||||||
this.getList()
|
this.getList();
|
||||||
},
|
},
|
||||||
go (item) { // 根据使用条件跳转商品列表页面
|
go(item) {
|
||||||
if (this.params.memberCouponStatus !== 'NEW') return;
|
// 根据使用条件跳转商品列表页面
|
||||||
|
if (this.params.memberCouponStatus !== "NEW") return;
|
||||||
|
|
||||||
if (item.storeId !== '0') {
|
this.$router.push({
|
||||||
this.$router.push({path: '/merchant', query: {id: item.storeId}})
|
path: "/goodsList",
|
||||||
} else {
|
query: { promotionsId: item.couponId, promotionType: "COUPON" },
|
||||||
if (item.scopeType === 'PORTION_GOODS_CATEGORY') {
|
});
|
||||||
this.$router.push({path: '/goodsList', query: {categoryId: item.scopeId}})
|
|
||||||
} else {
|
|
||||||
this.$router.push({path: '/goodsList'})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
changePageNum (val) { // 分页改变页码
|
changePageNum(val) {
|
||||||
|
// 分页改变页码
|
||||||
this.params.pageNumber = val;
|
this.params.pageNumber = val;
|
||||||
this.getList()
|
this.getList();
|
||||||
},
|
},
|
||||||
|
|
||||||
changePageSize (val) { // 分页改变页数
|
changePageSize(val) {
|
||||||
|
// 分页改变页数
|
||||||
this.params.pageNumber = 1;
|
this.params.pageNumber = 1;
|
||||||
this.params.pageSize = val;
|
this.params.pageSize = val;
|
||||||
this.getList()
|
this.getList();
|
||||||
},
|
},
|
||||||
|
|
||||||
useScope (type, storeName) { // 根据字段返回 优惠券适用范围
|
useScope(type, storeName) {
|
||||||
let shop = '平台';
|
// 根据字段返回 优惠券适用范围
|
||||||
let goods = '全部商品'
|
let shop = "平台";
|
||||||
if (storeName !== 'platform') shop = storeName
|
let goods = "全部商品";
|
||||||
|
if (storeName !== "platform") shop = storeName;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'ALL':
|
case "ALL":
|
||||||
goods = '全部商品'
|
goods = "全部商品";
|
||||||
break;
|
break;
|
||||||
case 'PORTION_GOODS':
|
case "PORTION_GOODS":
|
||||||
goods = '部分商品'
|
goods = "部分商品";
|
||||||
break;
|
break;
|
||||||
case 'PORTION_GOODS_CATEGORY':
|
case "PORTION_GOODS_CATEGORY":
|
||||||
goods = '部分分类商品'
|
goods = "部分分类商品";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return `${shop}${goods}可用`
|
return `${shop}${goods}可用`;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted() {
|
||||||
this.getList()
|
this.getList();
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import '../../../assets/styles/coupon.scss';
|
@import "../../../assets/styles/coupon.scss";
|
||||||
.coupon-item{
|
.coupon-item {
|
||||||
height: 125px;
|
height: 125px;
|
||||||
.c-left{
|
.c-left {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
}
|
}
|
||||||
.c-right{
|
.c-right {
|
||||||
padding: 20px 16px;
|
padding: 20px 16px;
|
||||||
width: 43px;
|
width: 43px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
.canot-use{
|
.canot-use {
|
||||||
color: #999;
|
color: #999;
|
||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,9 @@ export default {
|
||||||
tracksList(this.params).then((res) => {
|
tracksList(this.params).then((res) => {
|
||||||
this.spinShow = false;
|
this.spinShow = false;
|
||||||
if (res.success && res.result.records.length) {
|
if (res.success && res.result.records.length) {
|
||||||
this.list = res.result.records;
|
this.list = res.result.records.filter(item =>{
|
||||||
|
return item != null
|
||||||
|
});
|
||||||
this.total = res.result.total
|
this.total = res.result.total
|
||||||
} else {
|
} else {
|
||||||
this.list = [];
|
this.list = [];
|
||||||
|
|
5
im/.env
5
im/.env
|
@ -3,5 +3,8 @@ VUE_APP_PREVIEW=false
|
||||||
VUE_APP_API_BASE_URL=https://im-api.pickmall.cn
|
VUE_APP_API_BASE_URL=https://im-api.pickmall.cn
|
||||||
VUE_APP_WEB_SOCKET_URL=wss://im-api.pickmall.cn/lili/webSocket
|
VUE_APP_WEB_SOCKET_URL=wss://im-api.pickmall.cn/lili/webSocket
|
||||||
VUE_APP_COMMON=https://common-api.pickmall.cn
|
VUE_APP_COMMON=https://common-api.pickmall.cn
|
||||||
|
VUE_APP_BUYER=https://buyer-api.pickmall.cn
|
||||||
|
VUE_APP_SELLER=https://seller-api.pickmall.cn
|
||||||
VUE_APP_WEBSITE_NAME="LiLi IM"
|
VUE_APP_WEBSITE_NAME="LiLi IM"
|
||||||
VUE_APP_PC_ORDER_URL=https://store-b2b2c.pickmall.cn
|
VUE_APP_PC_URL=https://pc-b2b2c.pickmall.cn/
|
||||||
|
VUE_APP_PC_STORE=https://store-b2b2c.pickmall.cn/
|
|
@ -1,7 +1,10 @@
|
||||||
NODE_ENV=development
|
NODE_ENV=development
|
||||||
VUE_APP_PREVIEW=true
|
VUE_APP_PREVIEW=false
|
||||||
VUE_APP_API_BASE_URL=http://192.168.0.113:8885
|
VUE_APP_API_BASE_URL=https://im-api.pickmall.cn
|
||||||
VUE_APP_WEB_SOCKET_URL=ws://192.168.0.113:8885/lili/webSocket
|
VUE_APP_WEB_SOCKET_URL=wss://im-api.pickmall.cn/lili/webSocket
|
||||||
VUE_APP_COMMON=http://192.168.0.113:8890
|
VUE_APP_COMMON=https://common-api.pickmall.cn
|
||||||
VUE_APP_PC_URL="http://192.168.0.113:10001"
|
VUE_APP_BUYER=https://buyer-api.pickmall.cn
|
||||||
|
VUE_APP_SELLER=https://seller-api.pickmall.cn
|
||||||
VUE_APP_WEBSITE_NAME="LiLi IM"
|
VUE_APP_WEBSITE_NAME="LiLi IM"
|
||||||
|
VUE_APP_PC_URL=https://pc-b2b2c.pickmall.cn/
|
||||||
|
VUE_APP_PC_STORE=https://store-b2b2c.pickmall.cn/
|
|
@ -1,30 +1,47 @@
|
||||||
import { get } from "@/utils/request";
|
import { get } from "@/utils/request";
|
||||||
|
import config from "@/config/config";
|
||||||
|
|
||||||
// 获取用户相关设置信息
|
// 获取用户相关设置信息
|
||||||
export const ServeGetUserSetting = () => {
|
export const ServeGetUserSetting = () => {
|
||||||
return get("/im/user");
|
return get(`${config.BASE_BUYER}/buyer/passport/member`);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取店铺相关设置信息
|
// 获取店铺相关设置信息
|
||||||
export const ServeGetStoreSetting = () => {
|
export const ServeGetStoreSetting = () => {
|
||||||
return get("/im/user/store");
|
return get(`${config.BASE_SELLER}/store/member/user`);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取用户相关设置信息
|
// 获取用户相关设置信息
|
||||||
export const ServeGetUserDetail = (memberId) => {
|
export const ServeGetUserDetail = (memberId) => {
|
||||||
return get(`/im/user/${memberId}`);
|
return get(`${config.BASE_SELLER}/store/passport/member/${memberId}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取店铺相关设置信息
|
// 获取店铺相关设置信息
|
||||||
export const ServeGetStoreDetail = (storeId) => {
|
export const ServeGetStoreDetail = (storeId) => {
|
||||||
return get(`/im/user/store/${storeId}`);
|
return get(`${config.BASE_BUYER}/buyer/store/store/store/${storeId}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取店铺相关设置信息
|
// 获取用户历史足迹
|
||||||
export const ServeGetFootPrint = (params) => {
|
export const ServeGetFootPrint = (params) => {
|
||||||
return get(`/im/user/history`,params);
|
return get(`${config.BASE_BUYER}/buyer/member/footprint`,params);
|
||||||
};
|
};
|
||||||
// 获取订单列表信息
|
|
||||||
|
// 商家获取用户历史足迹
|
||||||
|
export const ServeStoreGetFootPrint = (params) => {
|
||||||
|
return get(`${config.BASE_SELLER}/store/member/footprint`,params);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 获取用户订单列表信息
|
||||||
export const ServeGetOrderPrint = (params) => {
|
export const ServeGetOrderPrint = (params) => {
|
||||||
return get(`/im/orders/orders`,params);
|
return get(`${config.BASE_BUYER}/buyer/order/order`,params);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 商家获取用户订单列表信息
|
||||||
|
export const ServeStoreGetOrderPrint = (params) => {
|
||||||
|
return get(`${config.BASE_SELLER}/store/order/order`,params);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 获取商品信息
|
||||||
|
export const ServeGetGoodsDetail = (data) => {
|
||||||
|
return get(`${config.BASE_BUYER}/buyer/goods/goods/sku/${data.goodsId}/${data.skuId}`);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div class="text-message" :class="{
|
||||||
class="text-message"
|
left: float == 'left',
|
||||||
:class="{
|
right: float == 'right',
|
||||||
left: float == 'left',
|
'max-width': !fullWidth,
|
||||||
right: float == 'right',
|
}">
|
||||||
'max-width': !fullWidth,
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<div v-if="arrow" class="arrow"></div>
|
<div v-if="arrow" class="arrow"></div>
|
||||||
<pre v-html="html" />
|
<pre v-html="html" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -35,12 +32,12 @@ export default {
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data () {
|
||||||
return {
|
return {
|
||||||
html: "",
|
html: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created () {
|
||||||
const text = textReplaceLink(
|
const text = textReplaceLink(
|
||||||
this.content,
|
this.content,
|
||||||
this.float == "right" ? "#ffffff" : "rgb(9 149 208)"
|
this.float == "right" ? "#ffffff" : "rgb(9 149 208)"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<el-tabs v-model="activeName" @tab-click="handleClick" type="card" :stretch=true>
|
<el-tabs v-model="activeName" @tab-click="handleClick" type="card" :stretch=true>
|
||||||
<el-tab-pane :label="toUser.storeFlag ? '正在咨询' : '他的足迹'" name="history">
|
<el-tab-pane :label="toUser.storeFlag ? '正在咨询' : '他的足迹'" name="history">
|
||||||
<div style="margin-left: 12px;" v-if="toUser.storeFlag">
|
<div style="margin-left: 12px;">
|
||||||
<GoodsLink :goodsDetail="goodsDetail" v-if="toUser.userId === goodsDetail.storeId"
|
<GoodsLink :goodsDetail="goodsDetail" v-if="toUser.userId === goodsDetail.storeId"
|
||||||
@sendMessage="submitSendMessage" />
|
@sendMessage="submitSendMessage" />
|
||||||
<FootPrint :list="footPrintList" @loadMore="loadMoreFootPrint()" :orderList="orderPrintList"
|
<FootPrint :list="footPrintList" @loadMore="loadMoreFootPrint()" :orderList="orderPrintList"
|
||||||
|
@ -18,8 +18,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Tabs, TabPane } from 'element-ui'
|
import { Tabs, TabPane } from 'element-ui'
|
||||||
import { ServeGetStoreDetail, ServeGetUserDetail, ServeGetFootPrint, ServeGetOrderPrint } from '@/api/user'
|
import { ServeGetStoreDetail, ServeGetUserDetail, ServeGetFootPrint, ServeGetOrderPrint, ServeGetGoodsDetail, ServeStoreGetFootPrint,ServeStoreGetOrderPrint } from '@/api/user'
|
||||||
import { ServeGetGoodsDetail } from '@/api/goods'
|
|
||||||
import StoreDetail from "@/components/chat/panel/template/storeDetail.vue";
|
import StoreDetail from "@/components/chat/panel/template/storeDetail.vue";
|
||||||
import FootPrint from "@/components/chat/panel/template/footPrint.vue";
|
import FootPrint from "@/components/chat/panel/template/footPrint.vue";
|
||||||
import GoodsLink from "@/components/chat/panel/template/goodsLink.vue";
|
import GoodsLink from "@/components/chat/panel/template/goodsLink.vue";
|
||||||
|
@ -53,6 +52,23 @@ export default {
|
||||||
index_name: (state) => state.dialogue.index_name,
|
index_name: (state) => state.dialogue.index_name,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
watch:{
|
||||||
|
toUser(){
|
||||||
|
localStorage.setItem('storeFlag', this.toUser.storeFlag)
|
||||||
|
this.footPrintList = []
|
||||||
|
this.orderPrintList = []
|
||||||
|
if (this.toUser.storeFlag) {
|
||||||
|
this.getStoreDetail()
|
||||||
|
}
|
||||||
|
// else {
|
||||||
|
// this.getMemberDetail()
|
||||||
|
// }
|
||||||
|
this.getFootPrint()
|
||||||
|
if (this.goodsParams && this.toUser.storeFlag == true) {
|
||||||
|
this.getGoodsDetail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
activeName: 'history',
|
activeName: 'history',
|
||||||
|
@ -70,13 +86,15 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
localStorage.setItem('storeFlag', this.toUser.storeFlag)
|
||||||
if (this.toUser.storeFlag) {
|
if (this.toUser.storeFlag) {
|
||||||
this.getStoreDetail()
|
this.getStoreDetail()
|
||||||
} else {
|
}
|
||||||
this.getMemberDetail()
|
// else {
|
||||||
}
|
// this.getMemberDetail()
|
||||||
|
// }
|
||||||
this.getFootPrint()
|
this.getFootPrint()
|
||||||
if (this.goodsParams) {
|
if (this.goodsParams && this.toUser.storeFlag == true) {
|
||||||
this.getGoodsDetail()
|
this.getGoodsDetail()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -94,53 +112,78 @@ export default {
|
||||||
this.getFootPrint()
|
this.getFootPrint()
|
||||||
},
|
},
|
||||||
handleClick () { },
|
handleClick () { },
|
||||||
getMemberDetail () {
|
// getMemberDetail () {
|
||||||
ServeGetUserDetail(this.toUser.userId).then(res => {
|
// ServeGetUserDetail(this.toUser.userId).then(res => {
|
||||||
if (res.success) {
|
// if (res.success) {
|
||||||
this.memberInfo = res.result
|
// this.memberInfo = res.result
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
},
|
// },
|
||||||
getGoodsDetail () {
|
getGoodsDetail () {
|
||||||
ServeGetGoodsDetail(this.goodsParams).then(res => {
|
if(this.toUser.storeFlag){
|
||||||
if (res.success) {
|
ServeGetGoodsDetail(this.goodsParams).then(res => {
|
||||||
this.goodsDetail = res.result.data
|
if (res.success) {
|
||||||
}
|
this.goodsDetail = res.result.data
|
||||||
})
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
getFootPrint () {
|
getFootPrint() {
|
||||||
if (this.toUser.storeFlag) {
|
if (this.toUser.storeFlag) {
|
||||||
this.footPrintParams.memberId = this.id
|
this.footPrintParams.memberId = this.id
|
||||||
this.footPrintParams.storeId = this.toUser.userId
|
this.footPrintParams.storeId = this.toUser.userId
|
||||||
|
ServeGetFootPrint(this.footPrintParams).then(res => {
|
||||||
|
res.result.records.forEach((item, index) => {
|
||||||
|
if (localStorage.getItem(item.goodsId)) {
|
||||||
|
item.btnHide = 0
|
||||||
|
} else {
|
||||||
|
item.btnHide = 1
|
||||||
|
}
|
||||||
|
if (item.goodsId === this.goodsParams.goodsId) {
|
||||||
|
res.result.records.splice(index, 1)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.footPrintList.push(...res.result.records)
|
||||||
|
})
|
||||||
|
|
||||||
|
// 订单列表
|
||||||
|
ServeGetOrderPrint(this.footPrintParams).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
res.result.records.forEach((item) => {
|
||||||
|
this.orderPrintList.push({
|
||||||
|
...item,
|
||||||
|
btnHide: 1
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.footPrintParams.memberId = this.toUser.userId
|
this.footPrintParams.memberId = this.toUser.userId
|
||||||
this.footPrintParams.storeId = this.id
|
this.footPrintParams.storeId = this.id
|
||||||
}
|
ServeStoreGetFootPrint(this.footPrintParams).then(res => {
|
||||||
ServeGetFootPrint(this.footPrintParams).then(res => {
|
res.result.records.forEach((item, index) => {
|
||||||
res.result.records.forEach((item, index) => {
|
if (localStorage.getItem(item.goodsId)) {
|
||||||
if (localStorage.getItem(item.goodsId)) {
|
item.btnHide = 0
|
||||||
item.btnHide = 0
|
} else {
|
||||||
} else {
|
item.btnHide = 1
|
||||||
item.btnHide = 1
|
}
|
||||||
}
|
if (item.goodsId === this.goodsParams.goodsId) {
|
||||||
if (item.goodsId === this.goodsParams.goodsId) {
|
res.result.records.splice(index, 1)
|
||||||
res.result.records.splice(index, 1)
|
}
|
||||||
}
|
});
|
||||||
});
|
this.footPrintList.push(...res.result.records)
|
||||||
this.footPrintList.push(...res.result.records)
|
})
|
||||||
})
|
ServeStoreGetOrderPrint(this.footPrintParams).then((res) => {
|
||||||
// 订单列表
|
if (res.code == 200) {
|
||||||
ServeGetOrderPrint(this.footPrintParams).then((res) => {
|
res.result.records.forEach((item) => {
|
||||||
if (res.code == 200) {
|
this.orderPrintList.push({
|
||||||
res.result.records.forEach((item) => {
|
...item,
|
||||||
this.orderPrintList.push({
|
btnHide: 1
|
||||||
...item,
|
})
|
||||||
btnHide: 1
|
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
// this.orderPrintList.push(...res.result.records)
|
})
|
||||||
}
|
}
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 发送消息回调事件
|
// 发送消息回调事件
|
||||||
|
|
|
@ -35,9 +35,9 @@
|
||||||
|
|
||||||
<!-- 其它对话消息 -->
|
<!-- 其它对话消息 -->
|
||||||
<div v-else class="message-box record-box" :class="{
|
<div v-else class="message-box record-box" :class="{
|
||||||
'direction-rt': item.float == 'right',
|
'direction-rt': item.float == 'right',
|
||||||
'checkbox-border': multiSelect.isOpen === true,
|
'checkbox-border': multiSelect.isOpen === true,
|
||||||
}">
|
}">
|
||||||
<aside v-show="multiSelect.isOpen" class="checkbox-column">
|
<aside v-show="multiSelect.isOpen" class="checkbox-column">
|
||||||
<i class="el-icon-success" :class="{ selected: verifyMultiSelect(item.id) }"
|
<i class="el-icon-success" :class="{ selected: verifyMultiSelect(item.id) }"
|
||||||
@click="triggerMultiSelect(item.id)" />
|
@click="triggerMultiSelect(item.id)" />
|
||||||
|
@ -59,48 +59,63 @@
|
||||||
{{ unixToDate(item.createTime, "MM月dd日 hh:mm") }}
|
{{ unixToDate(item.createTime, "MM月dd日 hh:mm") }}
|
||||||
</span>
|
</span>
|
||||||
<!-- 文本消息 -->
|
<!-- 文本消息 -->
|
||||||
<div v-if="item.messageType == 'MESSAGE'" class="text-message" :class="{
|
<div v-if="item.messageType == 'MESSAGE'" style="background-color: #d0e9ff;color: black;"
|
||||||
left: item.float == 'left',
|
class="text-message" :class="{
|
||||||
right: item.float == 'right',
|
left: item.float == 'left',
|
||||||
}">
|
right: item.float == 'right',
|
||||||
|
}">
|
||||||
<div class="arrow"></div>
|
<div class="arrow"></div>
|
||||||
|
<pre v-if="!emojistwo.includes(item.text)" v-html="item.text" />
|
||||||
<pre v-html="item.text" />
|
<pre v-if="emojistwo.includes(item.text)" v-html="textReplaceEmoji(item.text)" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="item.messageType == 'GOODS' && item.text != null" class="text-message" :class="{
|
<div v-if="item.messageType == 'GOODS' && item.text != null" class="goodsStyle " :class="{
|
||||||
left: item.float == 'left',
|
left: item.float == 'left',
|
||||||
right: item.float == 'right',
|
right: item.float == 'right',
|
||||||
}">
|
}">
|
||||||
<div class="base" @click="linkToGoods(item.text.goodsId, item.text.id)">
|
<div class="base" @click="linkToGoods(item.text.goodsId, item.text.id)">
|
||||||
<div>
|
<div>
|
||||||
<img :src="item.text.thumbnail" class="image" />
|
<img :src="item.text.thumbnail" class="image" />
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-left: 13px">
|
<div>
|
||||||
<a> {{ item.text.goodsName }} </a>
|
<div class="goods_name">
|
||||||
<div>
|
<el-tooltip class="item" effect="dark" :content="item.text.goodsName" placement="top-start">
|
||||||
<span style="color: red;">¥{{ item.text.price }}</span>
|
<a> {{ item.text.goodsName }} </a>
|
||||||
|
</el-tooltip>
|
||||||
|
</div>
|
||||||
|
<div class="price">
|
||||||
|
<span>¥{{ item.text.price }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="item.messageType == 'ORDER' && item.text != null" class="text-message" :class="{
|
<div v-if="item.messageType == 'ORDER' && item.text != null" class="oderStyle" :class="{
|
||||||
left: item.float == 'left',
|
left: item.float == 'left',
|
||||||
right: item.float == 'right',
|
right: item.float == 'right',
|
||||||
}">
|
}">
|
||||||
<a> 订单号:{{ item.text.sn }} </a>
|
<div class="oedersn">
|
||||||
|
<el-tooltip class="item" effect="dark" :content="item.text.sn" placement="top-start">
|
||||||
|
<a> 订单号:{{ item.text.sn }} </a>
|
||||||
|
</el-tooltip>
|
||||||
|
</div>
|
||||||
<div class="baseTwo">
|
<div class="baseTwo">
|
||||||
<img :src="item.text.groupImages" style="height: 100px;width: 100px;margin-top: 10px;" />
|
<img :src="item.text.groupImages" style="height: 100px;width: 100px;margin-top: 10px;" />
|
||||||
<span class="orderGoodsName" @click="linkToOrders(item.text.sn)">{{ item.text.groupName }}</span>
|
<span class="orderGoodsName" @click="linkToOrders(item.text.sn)">{{ item.text.groupName }}</span>
|
||||||
<span class="orderGoodsTime">{{ item.text.paymentTime }}</span>
|
<span class="orderGoodsTime">{{ item.text.paymentTime }}</span>
|
||||||
|
<span class="orderFlowPrice">
|
||||||
|
订单金额:¥{{ item.text.flowPrice }}
|
||||||
|
</span>
|
||||||
|
<span class="order_status"
|
||||||
|
:style="{ 'color': item.text.orderStatus == 'CANCELLED' || item.text.orderStatus == 'UNPAID' || item.text.orderStatus == ' TAKE' ? '#5a606b' : '#f23030' }">{{
|
||||||
|
item.text.orderStatus == 'CANCELLED' ? '已取消' : item.text.orderStatus == 'UNPAID' ? '未付款' :
|
||||||
|
item.text.orderStatus ==
|
||||||
|
'PAID' ? '已付款' : item.text.orderStatus == 'UNDELIVERED' ? '待发货' : item.text.orderStatus ==
|
||||||
|
'DELIVERED'
|
||||||
|
? '已发货' : item.text.orderStatus == ' COMPLETED' ? '已完成' : item.text.orderStatus == ' TAKE' ?
|
||||||
|
'待校验' : ''
|
||||||
|
}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 图片消息 -->
|
|
||||||
<!-- <image-message
|
|
||||||
v-else-if="item.messageType == 2 && item.file.file_type == 1"
|
|
||||||
:src="item.file.file_url"
|
|
||||||
@contextmenu.native="onCopy(idx, item, $event)"
|
|
||||||
/> -->
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
@ -149,19 +164,19 @@
|
||||||
<!-- 消息管理器 -->
|
<!-- 消息管理器 -->
|
||||||
<transition name="el-fade-in-linear">
|
<transition name="el-fade-in-linear">
|
||||||
<TalkSearchRecord v-if="findChatRecord" :params="{
|
<TalkSearchRecord v-if="findChatRecord" :params="{
|
||||||
talk_type: params.talk_type,
|
talk_type: params.talk_type,
|
||||||
receiver_id: params.receiver_id,
|
receiver_id: params.receiver_id,
|
||||||
title: params.nickname,
|
title: params.nickname,
|
||||||
}" @close="findChatRecord = false" />
|
}" @close="findChatRecord = false" />
|
||||||
</transition>
|
</transition>
|
||||||
|
|
||||||
<!-- 链接信息 -->
|
<!-- 链接信息 -->
|
||||||
<OtherLink :toUser="toUser" :id="id" :goodsParams="goodsParams" class="flex-4" />
|
<OtherLink :toUser="toUser" :id="id" :goodsParams="goodsParams" class="flex-4" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { textReplaceLink } from "@/utils/functions";
|
import { textReplaceLink } from "@/utils/functions";
|
||||||
import { textReplaceEmoji } from "@/utils/emojis";
|
import { textReplaceEmoji, emojistwo } from "@/utils/emojis";
|
||||||
import OtherLink from "@/components/chat/panel/OtherLink.vue";
|
import OtherLink from "@/components/chat/panel/OtherLink.vue";
|
||||||
import { mapState, mapGetters } from "vuex";
|
import { mapState, mapGetters } from "vuex";
|
||||||
import TalkSearchRecord from "@/components/chat/TalkSearchRecord";
|
import TalkSearchRecord from "@/components/chat/TalkSearchRecord";
|
||||||
|
@ -218,6 +233,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
// 记录加载相关参数
|
// 记录加载相关参数
|
||||||
textReplaceEmoji,
|
textReplaceEmoji,
|
||||||
|
emojistwo,
|
||||||
textReplaceLink,
|
textReplaceLink,
|
||||||
loadRecord: {
|
loadRecord: {
|
||||||
status: 0,
|
status: 0,
|
||||||
|
@ -277,6 +293,7 @@ export default {
|
||||||
mode: 0,
|
mode: 0,
|
||||||
};
|
};
|
||||||
this.loadChatRecords();
|
this.loadChatRecords();
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
@ -372,7 +389,6 @@ export default {
|
||||||
|
|
||||||
// 回车键发送消息回调事件
|
// 回车键发送消息回调事件
|
||||||
submitSendMessage (content) {
|
submitSendMessage (content) {
|
||||||
console.log("发送", content);
|
|
||||||
const record = {
|
const record = {
|
||||||
operation_type: "MESSAGE",
|
operation_type: "MESSAGE",
|
||||||
to: this.params.receiver_id,
|
to: this.params.receiver_id,
|
||||||
|
@ -381,6 +397,9 @@ export default {
|
||||||
context: content,
|
context: content,
|
||||||
talk_id: this.params.talkId,
|
talk_id: this.params.talkId,
|
||||||
};
|
};
|
||||||
|
// if (record.messageType == 'MESSAGE"') {
|
||||||
|
// record.text = this.textReplaceEmoji(record.content)
|
||||||
|
// }
|
||||||
SocketInstance.emit("event_talk", record);
|
SocketInstance.emit("event_talk", record);
|
||||||
|
|
||||||
this.$store.commit("UPDATE_TALK_ITEM", {
|
this.$store.commit("UPDATE_TALK_ITEM", {
|
||||||
|
@ -400,8 +419,6 @@ export default {
|
||||||
text: content,
|
text: content,
|
||||||
float: "right",
|
float: "right",
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("insterChat", insterChat);
|
|
||||||
// console.log("插入对话记录",'')
|
// console.log("插入对话记录",'')
|
||||||
// 插入对话记录
|
// 插入对话记录
|
||||||
this.$store.commit("PUSH_DIALOGUE", insterChat);
|
this.$store.commit("PUSH_DIALOGUE", insterChat);
|
||||||
|
@ -457,7 +474,6 @@ export default {
|
||||||
|
|
||||||
// 加载用户聊天详情信息
|
// 加载用户聊天详情信息
|
||||||
loadChatRecords () {
|
loadChatRecords () {
|
||||||
console.log(this.records.length, 'this.records.length ')
|
|
||||||
if (this.loadRecord.pageNumber === 0 || this.params.clickFlag) {
|
if (this.loadRecord.pageNumber === 0 || this.params.clickFlag) {
|
||||||
this.loadRecord.pageNumber = 1
|
this.loadRecord.pageNumber = 1
|
||||||
this.params.clickFlag = false
|
this.params.clickFlag = false
|
||||||
|
@ -486,6 +502,9 @@ export default {
|
||||||
if (item.messageType == 'GOODS') {
|
if (item.messageType == 'GOODS') {
|
||||||
item.text = JSON.parse(item.text)
|
item.text = JSON.parse(item.text)
|
||||||
}
|
}
|
||||||
|
// if (item.messageType == 'MESSAGE"') {
|
||||||
|
// item.text = this.textReplaceEmoji(item.text)
|
||||||
|
// }
|
||||||
if (item.messageType == 'ORDER') {
|
if (item.messageType == 'ORDER') {
|
||||||
item.text = JSON.parse(item.text)
|
item.text = JSON.parse(item.text)
|
||||||
}
|
}
|
||||||
|
@ -496,7 +515,8 @@ export default {
|
||||||
? (this.loadRecord.status = 1)
|
? (this.loadRecord.status = 1)
|
||||||
: (this.loadRecord.status = 2);
|
: (this.loadRecord.status = 2);
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (data.record_id == 0 || !data.record_id) {
|
// if (data.record_id == 0 || !data.record_id) {
|
||||||
|
if (data.record_id == 0 || data.pageNumber == 1) {
|
||||||
el.scrollTop = el.scrollHeight
|
el.scrollTop = el.scrollHeight
|
||||||
} else {
|
} else {
|
||||||
el.scrollTop = el.scrollHeight - scrollHeight
|
el.scrollTop = el.scrollHeight - scrollHeight
|
||||||
|
@ -820,6 +840,67 @@ export default {
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
.order_status {
|
||||||
|
height: 30px;
|
||||||
|
width: 60px;
|
||||||
|
background: #ffeded;
|
||||||
|
margin-right: 20px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 25px;
|
||||||
|
margin-left: 15px;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.oderStyle {
|
||||||
|
border: 1px solid #f2f2f2;
|
||||||
|
width: 330px;
|
||||||
|
border-radius: 4px;
|
||||||
|
|
||||||
|
.oedersn {
|
||||||
|
margin: 10px 0 10px 5px;
|
||||||
|
width: 300px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.goodsStyle {
|
||||||
|
border: 1px solid #f2f2f2;
|
||||||
|
width: 300px;
|
||||||
|
height: 120px;
|
||||||
|
display: flex;
|
||||||
|
border-radius: 4px;
|
||||||
|
|
||||||
|
.goods_name {
|
||||||
|
color: black;
|
||||||
|
width: 150px;
|
||||||
|
font-size: 15px;
|
||||||
|
color: #333333;
|
||||||
|
margin-top: 30px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
height: 70px;
|
||||||
|
margin-top: 3px;
|
||||||
|
width: 70px;
|
||||||
|
background-size: cover;
|
||||||
|
margin: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.price {
|
||||||
|
color: #999;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.base {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.orderSn {
|
.orderSn {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
@ -830,7 +911,7 @@ export default {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
// white-space: nowrap;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
|
@ -838,9 +919,14 @@ export default {
|
||||||
|
|
||||||
.orderGoodsTime {
|
.orderGoodsTime {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
color: red;
|
color: #999;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin-top: 35px;
|
margin-top: 70px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.orderFlowPrice {
|
||||||
|
color: #999;
|
||||||
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-box {
|
.main-box {
|
||||||
|
@ -904,26 +990,26 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.base {
|
// .base {
|
||||||
margin-top: 5px;
|
// margin-top: 5px;
|
||||||
height: 120px;
|
// height: 120px;
|
||||||
display: flex;
|
// display: flex;
|
||||||
|
|
||||||
div {
|
// div {
|
||||||
width: 100px;
|
// width: 100px;
|
||||||
overflow: hidden;
|
// // overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
// // text-overflow: ellipsis;
|
||||||
margin-top: 8px;
|
// margin-top: 8px;
|
||||||
white-space: nowrap;
|
// // white-space: nowrap;
|
||||||
}
|
// }
|
||||||
|
|
||||||
.image {
|
// .image {
|
||||||
height: 100px;
|
// height: 100px;
|
||||||
margin-top: 3px;
|
// margin-top: 3px;
|
||||||
width: 100px
|
// width: 100px
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
.talk-bubble {
|
.talk-bubble {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -1101,7 +1187,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bg-left-color: #f5f5f5;
|
@bg-left-color: #f5f5f5;
|
||||||
@bg-right-color: #1ebafc;
|
@bg-right-color: #ffffff;
|
||||||
|
|
||||||
.text-message {
|
.text-message {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
|
@ -7,37 +7,60 @@
|
||||||
<dd v-for="item in list" v-infinite-scroll="loadMore">
|
<dd v-for="item in list" v-infinite-scroll="loadMore">
|
||||||
<div class="base">
|
<div class="base">
|
||||||
<div>
|
<div>
|
||||||
<img :src="item.thumbnail" class="image" />
|
<img style="width: 60px; height: 60px;margin-left: 40px;box-sizing: border-box;" :src="item.thumbnail"
|
||||||
|
class="image" />
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-left: 13px">
|
<div class="recent_views">
|
||||||
<a class="goods_name" @click="linkToGoods(item.goodsId, item.id)">{{ item.goodsName }}</a>
|
<el-tooltip class="item" effect="dark" :content="item.goodsName" placement="top-start">
|
||||||
<div style="margin-top: 8px;">
|
<a class="goods_name" @click="linkToGoods(item.goodsId, item.id)">{{ item.goodsName }}</a>
|
||||||
<span style="color: red;">¥{{ item.price }}</span>
|
</el-tooltip>
|
||||||
</div>
|
|
||||||
<div>
|
<div style="display: flex;">
|
||||||
<el-button class="store-button" type="danger" v-if="item.btnHide == 1" size="mini"
|
<div style="margin-top: 20px;">
|
||||||
@click="submitSendGoodsMessage(item)" plain>发送</el-button>
|
<span style="color: red;">¥{{ item.price }}</span>
|
||||||
|
<div class="goods_store_button">
|
||||||
|
<el-button type="danger" v-if="item.btnHide == 1 && toUser.storeFlag" size="mini"
|
||||||
|
@click="submitSendGoodsMessage(item)" plain>发送</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="Underline"></div>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
</dl>
|
</dl>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="订单列表" name="orders">
|
<el-tab-pane label="订单列表" name="orders">
|
||||||
<dl>
|
<dl>
|
||||||
<dd v-for="(item, index) in orderList" v-infinite-scroll="loadMore" :key="index">
|
<dd v-for="(item, index) in orderList" v-infinite-scroll="loadMore" :key="index">
|
||||||
<div style="margin-bottom: 20px;">
|
<div class="orderlist">
|
||||||
<span class="orderSn">订单号:{{ item.sn }}</span>
|
<div class="order_top">
|
||||||
<img :src="item.groupImages" alt=""
|
<span class="order_sn">订单号:{{ item.sn }}</span>
|
||||||
style="height: 100px; width: 100px;margin-top: 10px; vertical-align: middle; ">
|
</div>
|
||||||
<span class="orderGoodsName" @click="linkToOrders(item.sn)"> {{ item.groupName }}</span>
|
<div class="order_section">
|
||||||
<span style="margin-left: 10px; color: red;">{{ item.paymentTime }}</span>
|
<img :src="item.groupImages" alt="">
|
||||||
<div class="orderBtn">
|
<el-tooltip class="item" effect="dark" :content="item.groupName" placement="top-start">
|
||||||
<el-button type="danger" class="store-button" v-if="item.btnHide == 1" size="mini"
|
<span class="orderGoodsName" @click="linkToOrders(item.sn)"> {{ item.groupName }}</span>
|
||||||
@click="submitSendOrderMessage(item, index)" plain>发送</el-button>
|
</el-tooltip>
|
||||||
|
<div class="orderBtn">
|
||||||
|
<el-button type="danger" class="store-button" v-if="item.btnHide == 1 && toUser.storeFlag"
|
||||||
|
size="mini" @click="submitSendOrderMessage(item, index)" plain>发送</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="order_footer">
|
||||||
|
<span> 订单金额: <span style="color: red;">¥{{ item.orderItems[0].goodsPrice }}</span></span>
|
||||||
|
<span class="order_status" v-if="item.orderStatus"
|
||||||
|
:style="{ 'color': item.orderStatus == 'CANCELLED' || item.orderStatus == 'UNPAID' || item.orderStatus == 'TAKE' ? '#5a606b' : '#f23030' }">{{
|
||||||
|
item.orderStatus == 'CANCELLED' ? '已取消' : item.orderStatus == 'UNPAID' ? '未付款' : item.orderStatus ==
|
||||||
|
'PAID' ? '已付款' : item.orderStatus == 'UNDELIVERED' ? '待发货' : item.orderStatus == 'DELIVERED'
|
||||||
|
? '已发货' : item.orderStatus == 'COMPLETED' ? '已完成' : item.orderStatus == 'TAKE' ? '待校验' : ''
|
||||||
|
}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="Underline"></div>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
@ -53,7 +76,7 @@ export default {
|
||||||
directives: {
|
directives: {
|
||||||
"infinite-scroll": InfiniteScroll,
|
"infinite-scroll": InfiniteScroll,
|
||||||
},
|
},
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeName: 'goods',
|
activeName: 'goods',
|
||||||
btnHide: undefined,
|
btnHide: undefined,
|
||||||
|
@ -64,7 +87,6 @@ export default {
|
||||||
...mapGetters(["talkItems"]),
|
...mapGetters(["talkItems"]),
|
||||||
...mapState({
|
...mapState({
|
||||||
id: (state) => state.user.id,
|
id: (state) => state.user.id,
|
||||||
|
|
||||||
toUser: (state) => state.user.toUser,
|
toUser: (state) => state.user.toUser,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
@ -77,17 +99,17 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
//跳转订单列表
|
//跳转订单列表
|
||||||
|
|
||||||
scrollBottom (e) {
|
scrollBottom(e) {
|
||||||
const { scrollTop, scrollHeight, clientHeight } = e.srcElement
|
const { scrollTop, scrollHeight, clientHeight } = e.srcElement
|
||||||
if (scrollTop + clientHeight >= scrollHeight) {
|
if (scrollTop + clientHeight >= scrollHeight) {
|
||||||
this.$emit('loadMore')
|
this.$emit('loadMore')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
loadMore () {
|
loadMore() {
|
||||||
|
|
||||||
},
|
},
|
||||||
// 发送消息回调事件
|
// 发送消息回调事件
|
||||||
submitSendGoodsMessage (item) {
|
submitSendGoodsMessage(item) {
|
||||||
const context = {
|
const context = {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
goodsId: item.goodsId,
|
goodsId: item.goodsId,
|
||||||
|
@ -108,12 +130,15 @@ export default {
|
||||||
item.btnHide = 0
|
item.btnHide = 0
|
||||||
},
|
},
|
||||||
// 发送订单列表
|
// 发送订单列表
|
||||||
submitSendOrderMessage (item, index) {
|
submitSendOrderMessage(item, index) {
|
||||||
|
console.log(item, 'item');
|
||||||
const context = {
|
const context = {
|
||||||
sn: item.sn,
|
sn: item.sn,
|
||||||
groupImages: item.groupImages,
|
groupImages: item.groupImages,
|
||||||
paymentTime: item.paymentTime,
|
paymentTime: item.paymentTime,
|
||||||
groupName: item.groupName,
|
groupName: item.groupName,
|
||||||
|
flowPrice: item.flowPrice,
|
||||||
|
orderStatus: item.orderStatus
|
||||||
}
|
}
|
||||||
const record = {
|
const record = {
|
||||||
operation_type: "MESSAGE",
|
operation_type: "MESSAGE",
|
||||||
|
@ -127,7 +152,7 @@ export default {
|
||||||
localStorage.setItem(item.goodsId, 0)
|
localStorage.setItem(item.goodsId, 0)
|
||||||
item.btnHide = 0
|
item.btnHide = 0
|
||||||
},
|
},
|
||||||
handleClick (tab, event) {
|
handleClick(tab, event) {
|
||||||
console.log(tab, event);
|
console.log(tab, event);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -139,10 +164,11 @@ export default {
|
||||||
orderList: {
|
orderList: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: []
|
default: []
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted() {
|
||||||
console.log(this.orderList, 'orderList');
|
// state.user.toUser
|
||||||
|
console.log(this.orderList, ' this.$store.state.user.toUser this.$store.state.user.toUser this.$store.state.user.toUser');
|
||||||
this.btnHide = localStorage.getItem('btnHide')
|
this.btnHide = localStorage.getItem('btnHide')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,6 +176,94 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
|
.order_status {
|
||||||
|
height: 25px;
|
||||||
|
width: 60px;
|
||||||
|
background: #ffeded;
|
||||||
|
margin-right: 20px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Underline {
|
||||||
|
border: 1px solid silver;
|
||||||
|
width: 90%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recent_views {
|
||||||
|
margin-left: 13px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
width: 260px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box {
|
||||||
|
width: 400px;
|
||||||
|
|
||||||
|
.top {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left {
|
||||||
|
float: left;
|
||||||
|
width: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
float: right;
|
||||||
|
width: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom {
|
||||||
|
clear: both;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
margin: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left .el-tooltip__popper,
|
||||||
|
.right .el-tooltip__popper {
|
||||||
|
padding: 8px 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.Underline {
|
||||||
|
// border: 5px solid red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.orderlist {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
background: #fff;
|
||||||
|
color: #5a606b;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order_top {
|
||||||
|
border-bottom: 1px solid #f2f2f2;
|
||||||
|
|
||||||
|
.order_sn {}
|
||||||
|
}
|
||||||
|
|
||||||
|
.order_section {
|
||||||
|
border-bottom: 1px solid #f2f2f2;
|
||||||
|
height: 100px;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.order_footer {
|
||||||
|
border-bottom: 1px solid #f2f2f2;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
.orderGoodsName {
|
.orderGoodsName {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@ -158,6 +272,7 @@ export default {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.orderSn {
|
.orderSn {
|
||||||
|
@ -171,18 +286,13 @@ export default {
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
position: relative;
|
position: relative;
|
||||||
bottom: 30px;
|
bottom: 55px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods_name {
|
.goods_name {
|
||||||
text-overflow: -o-ellipsis-lastline;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
display: -webkit-box;
|
white-space: nowrap
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
line-clamp: 2;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .el-tabs__item.is-top:last-child {
|
/deep/ .el-tabs__item.is-top:last-child {
|
||||||
|
@ -215,9 +325,17 @@ export default {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.goods_store_button {
|
||||||
|
display: inline;
|
||||||
|
background-color: white;
|
||||||
|
border-color: #F56C6C;
|
||||||
|
position: absolute;
|
||||||
|
left: 70%;
|
||||||
|
}
|
||||||
|
|
||||||
.base {
|
.base {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
height: 120px;
|
height: 80px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
.price {
|
.price {
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<span style="color: red;">¥{{ goodsDetail.price }}</span>
|
<span style="color: red;">¥{{ goodsDetail.price }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="hide">
|
<div v-if="hide">
|
||||||
<el-button class="store-button" type="danger" v-if="!sendFlag && btnHide == 1" size="mini"
|
<el-button class="store-button" type="danger" v-if="btnHide == 1 && toUser.storeFlag" size="mini"
|
||||||
@click="submitSendMessage()" plain>发送</el-button>
|
@click="submitSendMessage()" plain>发送</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -27,7 +27,6 @@ import SocketInstance from "@/im-server/socket-instance";
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
sendFlag: false,
|
|
||||||
btnHide: undefined,
|
btnHide: undefined,
|
||||||
hide: true
|
hide: true
|
||||||
}
|
}
|
||||||
|
@ -169,7 +168,7 @@ export default {
|
||||||
.image {
|
.image {
|
||||||
height: 100px;
|
height: 100px;
|
||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
width: 100px
|
width: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,11 +6,11 @@
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-left: 13px">
|
<div style="margin-left: 13px">
|
||||||
<div class="div-zoom">
|
<div class="div-zoom">
|
||||||
{{ storeInfo.storeName }}
|
<span class="title_left_name"> 店铺名称:</span> <span class="title_right_name">{{ storeInfo.storeName }}</span>
|
||||||
<el-tag type="danger" v-if="storeInfo.selfOperated" size="mini">自营</el-tag>
|
<el-tag style="margin-left: 10px;" type="danger" v-if="storeInfo.selfOperated" size="mini">自营</el-tag>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
联系方式: {{ storeInfo.memberName }}
|
<span class="title_left_name"> 联系方式:</span> <span class="title_right_name">{{ storeInfo.memberName }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button class="store-button" type="danger" @click="linkToStore(storeInfo.id)" size="mini"
|
<el-button class="store-button" type="danger" @click="linkToStore(storeInfo.id)" size="mini"
|
||||||
|
@ -19,22 +19,32 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr class="separate" />
|
<hr class="separate" />
|
||||||
<div class="separate">店铺评分: <span>{{ storeInfo.serviceScore }}</span></div>
|
|
||||||
<div class="separate">服务评分: <span>{{ storeInfo.descriptionScore }}</span></div>
|
<div class="separate">店铺评分: <el-rate v-model="storeInfo.serviceScore" disabled show-score text-color="#ff9900"
|
||||||
<div class="separate">物流评分: <span>{{ storeInfo.deliveryScore }}</span></div>
|
score-template="{value}">
|
||||||
|
</el-rate></div>
|
||||||
|
<div class="separate">服务评分: <el-rate v-model="storeInfo.descriptionScore" disabled show-score text-color="#ff9900"
|
||||||
|
score-template="{value}">
|
||||||
|
</el-rate></div>
|
||||||
|
<div class="separate">物流评分: <el-rate v-model="storeInfo.deliveryScore" disabled show-score text-color="#ff9900"
|
||||||
|
score-template="{value}">
|
||||||
|
</el-rate></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Tag, button } from 'element-ui'
|
import { Tag, button, rate } from 'element-ui'
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
value: null,
|
||||||
|
colors: ['#99A9BF', '#F7BA2A', '#FF9900']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
"el-tag": Tag,
|
"el-tag": Tag,
|
||||||
"el-button": button,
|
"el-button": button,
|
||||||
|
"el-rate": rate
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
},
|
},
|
||||||
|
@ -49,6 +59,16 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
|
.title_left_name {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #a1a6af;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title_right_name {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #343036;
|
||||||
|
}
|
||||||
|
|
||||||
.store-button {
|
.store-button {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
border-color: #F56C6C;
|
border-color: #F56C6C;
|
||||||
|
@ -73,5 +93,9 @@ export default {
|
||||||
|
|
||||||
.separate {
|
.separate {
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
|
// display: inline;
|
||||||
|
display: flex;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #a1a6af;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
|
@ -33,99 +33,66 @@
|
||||||
<p class="tip-title">发起投票</p>
|
<p class="tip-title">发起投票</p>
|
||||||
</li> -->
|
</li> -->
|
||||||
|
|
||||||
<!-- <p class="text-tips no-select">-->
|
<!-- <p class="text-tips no-select">-->
|
||||||
<!-- <span>按Enter发送 / Shift+Enter 换行</span>-->
|
<!-- <span>按Enter发送 / Shift+Enter 换行</span>-->
|
||||||
<!-- <el-popover placement="top-end" width="600" trigger="click">-->
|
<!-- <el-popover placement="top-end" width="600" trigger="click">-->
|
||||||
<!-- <div class="editor-books">-->
|
<!-- <div class="editor-books">-->
|
||||||
<!-- <div class="books-title">编辑说明:</div>-->
|
<!-- <div class="books-title">编辑说明:</div>-->
|
||||||
<!-- <p>-->
|
<!-- <p>-->
|
||||||
<!-- 1.-->
|
<!-- 1.-->
|
||||||
<!-- 支持上传QQ及微信截图,在QQ或微信中截图后使用Ctrl+v上传图片。-->
|
<!-- 支持上传QQ及微信截图,在QQ或微信中截图后使用Ctrl+v上传图片。-->
|
||||||
<!-- </p>-->
|
<!-- </p>-->
|
||||||
<!-- <p>-->
|
<!-- <p>-->
|
||||||
<!-- 2.-->
|
<!-- 2.-->
|
||||||
<!-- 支持浏览器及Word文档中的图片复制上传、复制后使用Ctrl+v上传图片。-->
|
<!-- 支持浏览器及Word文档中的图片复制上传、复制后使用Ctrl+v上传图片。-->
|
||||||
<!-- </p>-->
|
<!-- </p>-->
|
||||||
<!-- <p>3. 支持图片拖拽上传。</p>-->
|
<!-- <p>3. 支持图片拖拽上传。</p>-->
|
||||||
<!-- <p>4. 支持文件上传 ( 文件小于100M ) 。</p>-->
|
<!-- <p>4. 支持文件上传 ( 文件小于100M ) 。</p>-->
|
||||||
<!-- <p>5. 按Enter发送 / Shift+Enter 换行。</p>-->
|
<!-- <p>5. 按Enter发送 / Shift+Enter 换行。</p>-->
|
||||||
<!-- <p>-->
|
<!-- <p>-->
|
||||||
<!-- 6.-->
|
<!-- 6.-->
|
||||||
<!-- 注意:当文件正在上传时,请勿关闭网页或离开当前对话框,否则将导致文件停止上传或上传失败。-->
|
<!-- 注意:当文件正在上传时,请勿关闭网页或离开当前对话框,否则将导致文件停止上传或上传失败。-->
|
||||||
<!-- </p>-->
|
<!-- </p>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<!-- <i class="el-icon-info" slot="reference" />-->
|
<!-- <i class="el-icon-info" slot="reference" />-->
|
||||||
<!-- </el-popover>-->
|
<!-- </el-popover>-->
|
||||||
<!-- </p>-->
|
<!-- </p>-->
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<el-popover
|
<el-popover ref="popoverEmoticon" placement="top-start" trigger="click" width="300"
|
||||||
ref="popoverEmoticon"
|
popper-class="no-padding el-popover-em">
|
||||||
placement="top-start"
|
|
||||||
trigger="click"
|
|
||||||
width="300"
|
|
||||||
popper-class="no-padding el-popover-em"
|
|
||||||
>
|
|
||||||
<MeEditorEmoticon ref="editorEmoticon" @selected="selecteEmoticon" />
|
<MeEditorEmoticon ref="editorEmoticon" @selected="selecteEmoticon" />
|
||||||
</el-popover>
|
</el-popover>
|
||||||
|
|
||||||
<form
|
<form enctype="multipart/form-data" style="display: none" ref="fileFrom">
|
||||||
enctype="multipart/form-data"
|
<input type="file" ref="restFile" accept="image/*" @change="uploadImageChange" />
|
||||||
style="display: none"
|
|
||||||
ref="fileFrom"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
type="file"
|
|
||||||
ref="restFile"
|
|
||||||
accept="image/*"
|
|
||||||
@change="uploadImageChange"
|
|
||||||
/>
|
|
||||||
<input type="file" ref="restFile2" @change="uploadFileChange" />
|
<input type="file" ref="restFile2" @change="uploadFileChange" />
|
||||||
</form>
|
</form>
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-main class="no-padding textarea">
|
<el-main class="no-padding textarea">
|
||||||
<textarea
|
<textarea ref="textarea" v-paste="pasteImage" v-drag="dragPasteImage" v-model.trim="editorText" rows="6"
|
||||||
ref="textarea"
|
placeholder="你想要的聊点什么呢 ..." @keydown="keydownEvent($event)" @input="inputEvent($event)" />
|
||||||
v-paste="pasteImage"
|
|
||||||
v-drag="dragPasteImage"
|
|
||||||
v-model.trim="editorText"
|
|
||||||
rows="6"
|
|
||||||
placeholder="你想要的聊点什么呢 ..."
|
|
||||||
@keydown="keydownEvent($event)"
|
|
||||||
@input="inputEvent($event)"
|
|
||||||
/>
|
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
|
|
||||||
<!-- 图片查看器 -->
|
<!-- 图片查看器 -->
|
||||||
<MeEditorImageView
|
<MeEditorImageView ref="imageViewer" v-model="imageViewer.isShow" :file="imageViewer.file"
|
||||||
ref="imageViewer"
|
@confirm="confirmUploadImage" />
|
||||||
v-model="imageViewer.isShow"
|
|
||||||
:file="imageViewer.file"
|
|
||||||
@confirm="confirmUploadImage"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<MeEditorRecorder v-if="recorder" @close="recorder = false" />
|
<MeEditorRecorder v-if="recorder" @close="recorder = false" />
|
||||||
|
|
||||||
<!-- 代码块编辑器 -->
|
<!-- 代码块编辑器 -->
|
||||||
<TalkCodeBlock
|
<TalkCodeBlock v-if="codeBlock.isShow" :edit-mode="codeBlock.editMode" @close="codeBlock.isShow = false"
|
||||||
v-if="codeBlock.isShow"
|
@confirm="confirmCodeBlock" />
|
||||||
:edit-mode="codeBlock.editMode"
|
|
||||||
@close="codeBlock.isShow = false"
|
|
||||||
@confirm="confirmCodeBlock"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 文件上传管理器 -->
|
<!-- 文件上传管理器 -->
|
||||||
<MeEditorFileManage ref="filesManager" v-model="filesManager.isShow" />
|
<MeEditorFileManage ref="filesManager" v-model="filesManager.isShow" />
|
||||||
|
|
||||||
<MeEditorVote
|
<MeEditorVote v-if="vote.isShow" @close="
|
||||||
v-if="vote.isShow"
|
() => {
|
||||||
@close="
|
this.vote.isShow = false;
|
||||||
() => {
|
}
|
||||||
this.vote.isShow = false;
|
" />
|
||||||
}
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -156,20 +123,20 @@ export default {
|
||||||
MeEditorVote,
|
MeEditorVote,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
talkUser() {
|
talkUser () {
|
||||||
return this.$store.state.dialogue.index_name;
|
return this.$store.state.dialogue.index_name;
|
||||||
},
|
},
|
||||||
isGroupTalk() {
|
isGroupTalk () {
|
||||||
return this.$store.state.dialogue.talk_type == 2;
|
return this.$store.state.dialogue.talk_type == 2;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
talkUser(n_index_name) {
|
talkUser (n_index_name) {
|
||||||
this.$refs.filesManager.clear();
|
this.$refs.filesManager.clear();
|
||||||
this.editorText = this.getDraftText(n_index_name);
|
this.editorText = this.getDraftText(n_index_name);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data () {
|
||||||
return {
|
return {
|
||||||
// 当前编辑的内容
|
// 当前编辑的内容
|
||||||
editorText: "",
|
editorText: "",
|
||||||
|
@ -205,13 +172,13 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 读取对话编辑草稿信息 并赋值给当前富文本
|
// 读取对话编辑草稿信息 并赋值给当前富文本
|
||||||
getDraftText(index_name) {
|
getDraftText (index_name) {
|
||||||
console.log("findTalk(index_name)", findTalk(index_name));
|
console.log("findTalk(index_name)", findTalk(index_name));
|
||||||
return findTalk(index_name)?.draft_text || "";
|
return findTalk(index_name)?.draft_text || "";
|
||||||
},
|
},
|
||||||
|
|
||||||
//复制粘贴图片回调方法
|
//复制粘贴图片回调方法
|
||||||
pasteImage(e) {
|
pasteImage (e) {
|
||||||
let files = getPasteImgs(e);
|
let files = getPasteImgs(e);
|
||||||
if (files.length == 0) return;
|
if (files.length == 0) return;
|
||||||
|
|
||||||
|
@ -219,19 +186,19 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
//拖拽上传图片回调方法
|
//拖拽上传图片回调方法
|
||||||
dragPasteImage(e) {
|
dragPasteImage (e) {
|
||||||
let files = getDragPasteImg(e);
|
let files = getDragPasteImg(e);
|
||||||
if (files.length == 0) return;
|
if (files.length == 0) return;
|
||||||
|
|
||||||
this.openImageViewer(files[0]);
|
this.openImageViewer(files[0]);
|
||||||
},
|
},
|
||||||
|
|
||||||
inputEvent(e) {
|
inputEvent (e) {
|
||||||
this.$emit("keyboard-event", e.target.value);
|
this.$emit("keyboard-event", e.target.value);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 键盘按下监听事件
|
// 键盘按下监听事件
|
||||||
keydownEvent(e) {
|
keydownEvent (e) {
|
||||||
if (e.keyCode == 13 && this.editorText == "") {
|
if (e.keyCode == 13 && this.editorText == "") {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
|
@ -256,13 +223,13 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
// 选择图片文件后回调方法
|
// 选择图片文件后回调方法
|
||||||
uploadImageChange(e) {
|
uploadImageChange (e) {
|
||||||
this.openImageViewer(e.target.files[0]);
|
this.openImageViewer(e.target.files[0]);
|
||||||
this.$refs.restFile.value = null;
|
this.$refs.restFile.value = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 选择文件回调事件
|
// 选择文件回调事件
|
||||||
uploadFileChange(e) {
|
uploadFileChange (e) {
|
||||||
let maxsize = 100 * 1024 * 1024;
|
let maxsize = 100 * 1024 * 1024;
|
||||||
if (e.target.files.length == 0) {
|
if (e.target.files.length == 0) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -288,13 +255,13 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
// 打开图片查看器
|
// 打开图片查看器
|
||||||
openImageViewer(file) {
|
openImageViewer (file) {
|
||||||
this.imageViewer.isShow = true;
|
this.imageViewer.isShow = true;
|
||||||
this.imageViewer.file = file;
|
this.imageViewer.file = file;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 代码块编辑器确认完成回调事件
|
// 代码块编辑器确认完成回调事件
|
||||||
confirmCodeBlock(data) {
|
confirmCodeBlock (data) {
|
||||||
const { talk_type, receiver_id } = this.$store.state.dialogue;
|
const { talk_type, receiver_id } = this.$store.state.dialogue;
|
||||||
ServeSendTalkCodeBlock({
|
ServeSendTalkCodeBlock({
|
||||||
talk_type,
|
talk_type,
|
||||||
|
@ -315,7 +282,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
// 确认上传图片消息回调事件
|
// 确认上传图片消息回调事件
|
||||||
confirmUploadImage() {
|
confirmUploadImage () {
|
||||||
let fileData = new FormData();
|
let fileData = new FormData();
|
||||||
fileData.append("file", this.imageViewer.file);
|
fileData.append("file", this.imageViewer.file);
|
||||||
|
|
||||||
|
@ -340,7 +307,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
// 选中表情包回调事件
|
// 选中表情包回调事件
|
||||||
selecteEmoticon(data) {
|
selecteEmoticon (data) {
|
||||||
if (data.type == 1) {
|
if (data.type == 1) {
|
||||||
let value = this.editorText;
|
let value = this.editorText;
|
||||||
let el = this.$refs.textarea;
|
let el = this.$refs.textarea;
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
<div class="welcome-box">
|
<div class="welcome-box">
|
||||||
<div class="famous-box">
|
<div class="famous-box">
|
||||||
<img src="~@/assets/image/chat.png" width="300" />
|
<img src="~@/assets/image/chat.png" width="300" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -10,10 +9,10 @@
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
components: {},
|
components: {},
|
||||||
data() {
|
data () {
|
||||||
return {}
|
return {}
|
||||||
},
|
},
|
||||||
created() {},
|
created () { },
|
||||||
methods: {},
|
methods: {},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -3,6 +3,8 @@ export default {
|
||||||
BASE_API_URL: process.env.VUE_APP_API_BASE_URL || "",
|
BASE_API_URL: process.env.VUE_APP_API_BASE_URL || "",
|
||||||
BASE_WS_URL: process.env.VUE_APP_WEB_SOCKET_URL || "",
|
BASE_WS_URL: process.env.VUE_APP_WEB_SOCKET_URL || "",
|
||||||
BASE_COMMON: process.env.VUE_APP_COMMON || "",
|
BASE_COMMON: process.env.VUE_APP_COMMON || "",
|
||||||
PC_URL: process.env.VUE_APP_PC_URL || "",
|
BASE_BUYER: process.env.VUE_APP_BUYER || "",
|
||||||
STORE_URL:process.env.VUE_APP_PC_ORDER_URL || "http://192.168.0.139:10002",
|
BASE_SELLER: process.env.VUE_APP_SELLER || "",
|
||||||
|
PC_URL: process.env.VUE_APP_PC_URL || "https://pc-b2b2c.pickmall.cn",
|
||||||
|
PC_STORE: process.env.VUE_APP_PC_STORE || 'https://store-b2b2c.pickmall.cn',
|
||||||
};
|
};
|
||||||
|
|
|
@ -46,9 +46,9 @@ class Talk extends Base {
|
||||||
this.resource = resource;
|
this.resource = resource;
|
||||||
|
|
||||||
// 判断发送者消息是否在当前用户列表中
|
// 判断发送者消息是否在当前用户列表中
|
||||||
if(this.sender_id && !vm.$store.state.talks.items.find(item=>{
|
if (this.sender_id && !vm.$store.state.talks.items.find(item => {
|
||||||
return item.userId == this.sender_id
|
return item.userId == this.sender_id
|
||||||
})){
|
})) {
|
||||||
// 没有当前用户,未在当前列表 进行重新加载
|
// 没有当前用户,未在当前列表 进行重新加载
|
||||||
vm.loadUserSetting('update')
|
vm.loadUserSetting('update')
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ class Talk extends Base {
|
||||||
* 判断消息发送者是否来自于我
|
* 判断消息发送者是否来自于我
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
isCurrSender() {
|
isCurrSender () {
|
||||||
// console.log("sender_id", this.sender_id);
|
// console.log("sender_id", this.sender_id);
|
||||||
return this.sender_id == this.getAccountId();
|
return this.sender_id == this.getAccountId();
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ class Talk extends Base {
|
||||||
*
|
*
|
||||||
* @return String
|
* @return String
|
||||||
*/
|
*/
|
||||||
getIndexName() {
|
getIndexName () {
|
||||||
if (this.talk_type == 2) {
|
if (this.talk_type == 2) {
|
||||||
return `${this.talk_type}_${this.receiver_id}`;
|
return `${this.talk_type}_${this.receiver_id}`;
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ class Talk extends Base {
|
||||||
*
|
*
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
getFloatType() {
|
getFloatType () {
|
||||||
let userId = this.resource.userId;
|
let userId = this.resource.userId;
|
||||||
|
|
||||||
if (userId == 0) return "center";
|
if (userId == 0) return "center";
|
||||||
|
@ -94,18 +94,21 @@ class Talk extends Base {
|
||||||
/**
|
/**
|
||||||
* 获取聊天列表左侧的对话信息
|
* 获取聊天列表左侧的对话信息
|
||||||
*/
|
*/
|
||||||
getTalkText() {
|
getTalkText () {
|
||||||
let text = this.resource.content || this.resource.text;
|
let text = this.resource.content || this.resource.text;
|
||||||
switch (this.resource.msg_type) {
|
switch (this.resource.msg_type) {
|
||||||
case 'GOODS':
|
case 'GOODS':
|
||||||
text = "[商品链接]";
|
text = "[商品链接]";
|
||||||
break;
|
break;
|
||||||
|
case 'ORDERS':
|
||||||
|
text = "[订单链接]";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
handle() {
|
handle () {
|
||||||
let store = this.getStoreInstance();
|
let store = this.getStoreInstance();
|
||||||
// console.log("触发handle");
|
// console.log("触发handle");
|
||||||
// 判断当前是否在聊天页面
|
// 判断当前是否在聊天页面
|
||||||
|
@ -131,7 +134,7 @@ class Talk extends Base {
|
||||||
* 显示消息提示
|
* 显示消息提示
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
showMessageNocice() {
|
showMessageNocice () {
|
||||||
let avatar = this.resource.avatar;
|
let avatar = this.resource.avatar;
|
||||||
let nickname = this.resource.nickname;
|
let nickname = this.resource.nickname;
|
||||||
let talk_type = this.resource.talk_type;
|
let talk_type = this.resource.talk_type;
|
||||||
|
@ -167,7 +170,7 @@ class Talk extends Base {
|
||||||
/**
|
/**
|
||||||
* 加载对接节点
|
* 加载对接节点
|
||||||
*/
|
*/
|
||||||
addTalkItem() {
|
addTalkItem () {
|
||||||
let receiver_id = this.sender_id;
|
let receiver_id = this.sender_id;
|
||||||
let talk_type = this.talk_type;
|
let talk_type = this.talk_type;
|
||||||
|
|
||||||
|
@ -188,7 +191,7 @@ class Talk extends Base {
|
||||||
/**
|
/**
|
||||||
* 插入对话记录
|
* 插入对话记录
|
||||||
*/
|
*/
|
||||||
insertTalkRecord() {
|
insertTalkRecord () {
|
||||||
let store = this.getStoreInstance();
|
let store = this.getStoreInstance();
|
||||||
let record = this.resource;
|
let record = this.resource;
|
||||||
// console.log("插入谈话记录", record);
|
// console.log("插入谈话记录", record);
|
||||||
|
@ -238,7 +241,7 @@ class Talk extends Base {
|
||||||
/**
|
/**
|
||||||
* 更新对话列表记录
|
* 更新对话列表记录
|
||||||
*/
|
*/
|
||||||
updateTalkItem() {
|
updateTalkItem () {
|
||||||
let store = this.getStoreInstance();
|
let store = this.getStoreInstance();
|
||||||
|
|
||||||
store.commit("INCR_UNREAD_NUM");
|
store.commit("INCR_UNREAD_NUM");
|
||||||
|
|
|
@ -25,17 +25,27 @@ Vue.component('face', face)
|
||||||
Vue.component('face-null', faceNull)
|
Vue.component('face-null', faceNull)
|
||||||
|
|
||||||
Vue.prototype.linkToGoods = function (goodsId, skuId) { // 跳转买家端商品
|
Vue.prototype.linkToGoods = function (goodsId, skuId) { // 跳转买家端商品
|
||||||
console.log(`${config.PC_URL}/goodsDetail?skuId=${skuId}&goodsId=${goodsId}`)
|
if (localStorage.getItem('storeFlag') == 'false') {
|
||||||
window.open(`${config.PC_URL}/goodsDetail?skuId=${skuId}&goodsId=${goodsId}`, '_blank')
|
window.open(`${config.PC_STORE}goods-operation-edit?id=${goodsId}`, '_blank')
|
||||||
|
} else {
|
||||||
|
window.open(`${config.PC_URL}/goodsDetail?skuId=${skuId}&goodsId=${goodsId}`, '_blank')
|
||||||
|
}
|
||||||
};
|
};
|
||||||
Vue.prototype.linkToStore = function (storeId) { // 跳转买家端商品
|
Vue.prototype.linkToStore = function (storeId) { // 跳转商家端商品
|
||||||
console.log(`${config.PC_URL}/Merchant?id=${storeId}`)
|
console.log(`${config.PC_URL}/Merchant?id=${storeId}`)
|
||||||
window.open(`${config.PC_URL}/Merchant?id=${storeId}`, '_blank')
|
window.open(`${config.PC_URL}/Merchant?id=${storeId}`, '_blank')
|
||||||
};
|
};
|
||||||
// 订单跳转商家订单页面
|
// 订单跳转商家订单页面
|
||||||
Vue.prototype.linkToOrders = function (sn) { // 跳转买家端订单
|
Vue.prototype.linkToOrders = function (sn) {
|
||||||
window.open(`${config.STORE_URL}/order-detail?sn=${sn}`, '_blank')
|
if (localStorage.getItem('storeFlag') == 'false') {
|
||||||
|
// 商家
|
||||||
|
window.open(`${config.PC_STORE}order-detail?sn=${sn}`, '_blank')
|
||||||
|
} else {
|
||||||
|
// 用户
|
||||||
|
window.open(`${config.PC_URL}/OrderDetail?sn=${sn}`, '_blank')
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const Instance = new Vue({
|
const Instance = new Vue({
|
||||||
router,
|
router,
|
||||||
store,
|
store,
|
||||||
|
|
|
@ -65,7 +65,6 @@ class WsSocket {
|
||||||
*/
|
*/
|
||||||
on (event, callBack) {
|
on (event, callBack) {
|
||||||
// 对应 socket-instance.js
|
// 对应 socket-instance.js
|
||||||
console.log("事件绑定", event, callBack);
|
|
||||||
this.onCallBacks[event] = callBack;
|
this.onCallBacks[event] = callBack;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,6 @@ const Talk = {
|
||||||
getters: {
|
getters: {
|
||||||
// 过滤所有置顶对话列表
|
// 过滤所有置顶对话列表
|
||||||
topItems: (state) => {
|
topItems: (state) => {
|
||||||
console.log(state.items, 'state.items');
|
|
||||||
return state.items.filter((item) => item.is_top == 1);
|
return state.items.filter((item) => item.is_top == 1);
|
||||||
},
|
},
|
||||||
talkItems: (state) => {
|
talkItems: (state) => {
|
||||||
|
@ -40,7 +39,6 @@ const Talk = {
|
||||||
mutations: {
|
mutations: {
|
||||||
// 设置对话列表
|
// 设置对话列表
|
||||||
SET_TALK_ITEMS (state, resource) {
|
SET_TALK_ITEMS (state, resource) {
|
||||||
console.log("设置对话列表", resource.items);
|
|
||||||
Vue.set(state, 'items', resource.items)
|
Vue.set(state, 'items', resource.items)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -2,143 +2,142 @@
|
||||||
* 动态表情
|
* 动态表情
|
||||||
*/
|
*/
|
||||||
const emojis = {
|
const emojis = {
|
||||||
"[微笑]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/0.gif'>",
|
"[微笑]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/0.gif'>",
|
||||||
"[撇嘴]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/1.gif'>",
|
"[撇嘴]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/1.gif'>",
|
||||||
"[色]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/2.gif'>",
|
"[色]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/2.gif'>",
|
||||||
"[发呆]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/3.gif'>",
|
"[发呆]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/3.gif'>",
|
||||||
"[得意]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/4.gif'>",
|
"[得意]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/4.gif'>",
|
||||||
"[流泪]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/5.gif'>",
|
"[流泪]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/5.gif'>",
|
||||||
"[害羞]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/6.gif'>",
|
"[害羞]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/6.gif'>",
|
||||||
"[闭嘴]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/7.gif'>",
|
"[闭嘴]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/7.gif'>",
|
||||||
"[睡]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/8.gif'>",
|
"[睡]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/8.gif'>",
|
||||||
"[大哭]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/9.gif'>",
|
"[大哭]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/9.gif'>",
|
||||||
"[尴尬]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/10.gif'>",
|
"[尴尬]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/10.gif'>",
|
||||||
"[发怒]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/11.gif'>",
|
"[发怒]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/11.gif'>",
|
||||||
"[调皮]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/12.gif'>",
|
"[调皮]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/12.gif'>",
|
||||||
"[呲牙]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/13.gif'>",
|
"[呲牙]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/13.gif'>",
|
||||||
"[惊讶]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/14.gif'>",
|
"[惊讶]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/14.gif'>",
|
||||||
"[难过]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/15.gif'>",
|
"[难过]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/15.gif'>",
|
||||||
"[酷]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/16.gif'>",
|
"[酷]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/16.gif'>",
|
||||||
"[冷汗]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/17.gif'>",
|
"[冷汗]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/17.gif'>",
|
||||||
"[抓狂]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/18.gif'>",
|
"[抓狂]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/18.gif'>",
|
||||||
"[吐]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/19.gif'>",
|
"[吐]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/19.gif'>",
|
||||||
"[偷笑]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/20.gif'>",
|
"[偷笑]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/20.gif'>",
|
||||||
"[可爱]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/21.gif'>",
|
"[可爱]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/21.gif'>",
|
||||||
"[白眼]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/22.gif'>",
|
"[白眼]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/22.gif'>",
|
||||||
"[傲慢]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/23.gif'>",
|
"[傲慢]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/23.gif'>",
|
||||||
"[饥饿]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/24.gif'>",
|
"[饥饿]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/24.gif'>",
|
||||||
"[困]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/25.gif'>",
|
"[困]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/25.gif'>",
|
||||||
"[惊恐]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/26.gif'>",
|
"[惊恐]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/26.gif'>",
|
||||||
"[流汗]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/27.gif'>",
|
"[流汗]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/27.gif'>",
|
||||||
"[憨笑]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/28.gif'>",
|
"[憨笑]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/28.gif'>",
|
||||||
"[大兵]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/29.gif'>",
|
"[大兵]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/29.gif'>",
|
||||||
"[奋斗]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/30.gif'>",
|
"[奋斗]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/30.gif'>",
|
||||||
"[咒骂]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/31.gif'>",
|
"[咒骂]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/31.gif'>",
|
||||||
"[疑问]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/32.gif'>",
|
"[疑问]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/32.gif'>",
|
||||||
"[嘘]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/33.gif'>",
|
"[嘘]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/33.gif'>",
|
||||||
"[晕]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/34.gif'>",
|
"[晕]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/34.gif'>",
|
||||||
"[折磨]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/35.gif'>",
|
"[折磨]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/35.gif'>",
|
||||||
"[衰]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/36.gif'>",
|
"[衰]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/36.gif'>",
|
||||||
"[骷髅]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/37.gif'>",
|
"[骷髅]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/37.gif'>",
|
||||||
"[敲打]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/38.gif'>",
|
"[敲打]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/38.gif'>",
|
||||||
"[再见]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/39.gif'>",
|
"[再见]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/39.gif'>",
|
||||||
"[擦汗]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/40.gif'>",
|
"[擦汗]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/40.gif'>",
|
||||||
"[抠鼻]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/41.gif'>",
|
"[抠鼻]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/41.gif'>",
|
||||||
"[鼓掌]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/42.gif'>",
|
"[鼓掌]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/42.gif'>",
|
||||||
"[糗大了]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/43.gif'>",
|
"[糗大了]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/43.gif'>",
|
||||||
"[坏笑]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/44.gif'>",
|
"[坏笑]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/44.gif'>",
|
||||||
"[左哼哼]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/45.gif'>",
|
"[左哼哼]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/45.gif'>",
|
||||||
"[右哼哼]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/46.gif'>",
|
"[右哼哼]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/46.gif'>",
|
||||||
"[哈欠]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/47.gif'>",
|
"[哈欠]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/47.gif'>",
|
||||||
"[鄙视]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/48.gif'>",
|
"[鄙视]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/48.gif'>",
|
||||||
"[委屈]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/49.gif'>",
|
"[委屈]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/49.gif'>",
|
||||||
"[快哭了]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/50.gif'>",
|
"[快哭了]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/50.gif'>",
|
||||||
"[阴险]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/51.gif'>",
|
"[阴险]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/51.gif'>",
|
||||||
"[亲亲]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/52.gif'>",
|
"[亲亲]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/52.gif'>",
|
||||||
"[吓]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/53.gif'>",
|
"[吓]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/53.gif'>",
|
||||||
"[可怜]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/54.gif'>",
|
"[可怜]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/54.gif'>",
|
||||||
"[菜刀]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/55.gif'>",
|
"[菜刀]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/55.gif'>",
|
||||||
"[西瓜]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/56.gif'>",
|
"[西瓜]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/56.gif'>",
|
||||||
"[啤酒]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/57.gif'>",
|
"[啤酒]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/57.gif'>",
|
||||||
"[篮球]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/58.gif'>",
|
"[篮球]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/58.gif'>",
|
||||||
"[乒乓]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/59.gif'>",
|
"[乒乓]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/59.gif'>",
|
||||||
"[咖啡]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/60.gif'>",
|
"[咖啡]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/60.gif'>",
|
||||||
"[饭]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/61.gif'>",
|
"[饭]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/61.gif'>",
|
||||||
"[猪头]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/62.gif'>",
|
"[猪头]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/62.gif'>",
|
||||||
"[玫瑰]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/63.gif'>",
|
"[玫瑰]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/63.gif'>",
|
||||||
"[凋谢]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/64.gif'>",
|
"[凋谢]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/64.gif'>",
|
||||||
"[示爱]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/65.gif'>",
|
"[示爱]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/65.gif'>",
|
||||||
"[爱心]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/66.gif'>",
|
"[爱心]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/66.gif'>",
|
||||||
"[心碎]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/67.gif'>",
|
"[心碎]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/67.gif'>",
|
||||||
"[蛋糕]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/68.gif'>",
|
"[蛋糕]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/68.gif'>",
|
||||||
"[闪电]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/69.gif'>",
|
"[闪电]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/69.gif'>",
|
||||||
"[炸弹]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/70.gif'>",
|
"[炸弹]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/70.gif'>",
|
||||||
"[刀]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/71.gif'>",
|
"[刀]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/71.gif'>",
|
||||||
"[足球]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/72.gif'>",
|
"[足球]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/72.gif'>",
|
||||||
"[瓢虫]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/73.gif'>",
|
"[瓢虫]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/73.gif'>",
|
||||||
"[便便]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/74.gif'>",
|
"[便便]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/74.gif'>",
|
||||||
"[月亮]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/75.gif'>",
|
"[月亮]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/75.gif'>",
|
||||||
"[太阳]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/76.gif'>",
|
"[太阳]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/76.gif'>",
|
||||||
"[礼物]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/77.gif'>",
|
"[礼物]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/77.gif'>",
|
||||||
"[拥抱]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/78.gif'>",
|
"[拥抱]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/78.gif'>",
|
||||||
"[强]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/79.gif'>",
|
"[强]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/79.gif'>",
|
||||||
"[弱]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/80.gif'>",
|
"[弱]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/80.gif'>",
|
||||||
"[握手]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/81.gif'>",
|
"[握手]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/81.gif'>",
|
||||||
"[胜利]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/82.gif'>",
|
"[胜利]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/82.gif'>",
|
||||||
"[抱拳]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/83.gif'>",
|
"[抱拳]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/83.gif'>",
|
||||||
"[勾引]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/84.gif'>",
|
"[勾引]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/84.gif'>",
|
||||||
"[拳头]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/85.gif'>",
|
"[拳头]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/85.gif'>",
|
||||||
"[差劲]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/86.gif'>",
|
"[差劲]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/86.gif'>",
|
||||||
"[爱你]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/87.gif'>",
|
"[爱你]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/87.gif'>",
|
||||||
"[NO]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/88.gif'>",
|
"[NO]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/88.gif'>",
|
||||||
"[OK]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/89.gif'>",
|
"[OK]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/89.gif'>",
|
||||||
"[爱情]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/90.gif'>",
|
"[爱情]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/90.gif'>",
|
||||||
"[飞吻]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/91.gif'>",
|
"[飞吻]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/91.gif'>",
|
||||||
"[跳跳]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/92.gif'>",
|
"[跳跳]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/92.gif'>",
|
||||||
"[发抖]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/93.gif'>",
|
"[发抖]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/93.gif'>",
|
||||||
"[怄火]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/94.gif'>",
|
"[怄火]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/94.gif'>",
|
||||||
"[转圈]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/95.gif'>",
|
"[转圈]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/95.gif'>",
|
||||||
"[磕头]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/96.gif'>",
|
"[磕头]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/96.gif'>",
|
||||||
"[回头]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/97.gif'>",
|
"[回头]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/97.gif'>",
|
||||||
"[跳绳]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/98.gif'>",
|
"[跳绳]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/98.gif'>",
|
||||||
"[挥手]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/99.gif'>",
|
"[挥手]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/99.gif'>",
|
||||||
"[激动]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/100.gif'>",
|
"[激动]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/100.gif'>",
|
||||||
"[街舞]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/101.gif'>",
|
"[街舞]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/101.gif'>",
|
||||||
"[献吻]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/102.gif'>",
|
"[献吻]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/102.gif'>",
|
||||||
"[左太极]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/103.gif'>",
|
"[左太极]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/103.gif'>",
|
||||||
"[右太极]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/104.gif'>",
|
"[右太极]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/104.gif'>",
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 符号表情
|
* 符号表情
|
||||||
*/
|
*/
|
||||||
const symbol = [
|
const symbol = [
|
||||||
"😠", "😩", "😲", "😞", "😵", "😰", "😒", "😍", "😤", "😜", "😝", "😋", "😘", "😚", "😷",
|
"😠", "😩", "😲", "😞", "😵", "😰", "😒", "😍", "😤", "😜", "😝", "😋", "😘", "😚", "😷",
|
||||||
"😳", "😃", "😅", "😆", "😁", "😂", "😊", "☺", "😄", "😢",
|
"😳", "😃", "😅", "😆", "😁", "😂", "😊", "☺", "😄", "😢",
|
||||||
"😭", "😨", "😣", "😡", "😌", "😖", "😔", "😱", "😪", "😏", "😓", "😥", "😫", "😉",
|
"😭", "😨", "😣", "😡", "😌", "😖", "😔", "😱", "😪", "😏", "😓", "😥", "😫", "😉",
|
||||||
"✊", "✋", "✌", "👊", "👍", "☝", "👆", "👇", "👈", "👉",
|
"✊", "✋", "✌", "👊", "👍", "☝", "👆", "👇", "👈", "👉",
|
||||||
"👋", "👏", "👌", "👎"
|
"👋", "👏", "👌", "👎"
|
||||||
];
|
];
|
||||||
|
|
||||||
const emojisKeys = Object.keys(emojis);
|
const emojisKeys = Object.keys(emojis);
|
||||||
|
|
||||||
export const emojiList = {
|
export const emojiList = {
|
||||||
symbol,
|
symbol,
|
||||||
emojis
|
emojis
|
||||||
}
|
}
|
||||||
|
|
||||||
const regEmoji = emojisKeys.map((value) => '|\\' + value).join('').replace('|', '')
|
const regEmoji = emojisKeys.map((value) => '|\\' + value).join('').replace('|', '')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 替换表情文字
|
* 替换表情文字
|
||||||
*
|
*
|
||||||
* @param {String} content 需要替换的字符串
|
* @param {String} content 需要替换的字符串
|
||||||
*/
|
*/
|
||||||
export function textReplaceEmoji(content) {
|
export function textReplaceEmoji (content) {
|
||||||
if(!content){
|
if (!content) {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
return content.replace(new RegExp(`(${regEmoji})`, 'gi'), ($0, $1) => {
|
return content.replace(new RegExp(`(${regEmoji})`, 'gi'), ($0, $1) => {
|
||||||
return emojis[$1];
|
return emojis[$1];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
export const emojistwo = Object.keys(emojis)
|
|
@ -7,7 +7,7 @@ import config from "@/config/config";
|
||||||
*
|
*
|
||||||
* @param {Object} datetime
|
* @param {Object} datetime
|
||||||
*/
|
*/
|
||||||
export function formatTime(datetime) {
|
export function formatTime (datetime) {
|
||||||
if (datetime == null) return "";
|
if (datetime == null) return "";
|
||||||
|
|
||||||
datetime = datetime.replace(/-/g, "/");
|
datetime = datetime.replace(/-/g, "/");
|
||||||
|
@ -60,7 +60,7 @@ export function formatTime(datetime) {
|
||||||
*
|
*
|
||||||
* @param {String} value 文件大小(字节)
|
* @param {String} value 文件大小(字节)
|
||||||
*/
|
*/
|
||||||
export function formatSize(value) {
|
export function formatSize (value) {
|
||||||
if (null == value || value == "") {
|
if (null == value || value == "") {
|
||||||
return "0";
|
return "0";
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ export function formatSize(value) {
|
||||||
*
|
*
|
||||||
* @param {String} fileName
|
* @param {String} fileName
|
||||||
*/
|
*/
|
||||||
export function getFileExt(fileName) {
|
export function getFileExt (fileName) {
|
||||||
let ext = fileName.split(".");
|
let ext = fileName.split(".");
|
||||||
ext = ext[ext.length - 1]; // 获取文件后缀名
|
ext = ext[ext.length - 1]; // 获取文件后缀名
|
||||||
return ext;
|
return ext;
|
||||||
|
@ -88,7 +88,7 @@ export function getFileExt(fileName) {
|
||||||
* @param {String} imgsrc
|
* @param {String} imgsrc
|
||||||
* @param {String} name
|
* @param {String} name
|
||||||
*/
|
*/
|
||||||
export function downloadIamge(imgsrc, name) {
|
export function downloadIamge (imgsrc, name) {
|
||||||
//下载图片地址和图片名
|
//下载图片地址和图片名
|
||||||
let image = new Image();
|
let image = new Image();
|
||||||
// 解决跨域 Canvas 污染问题
|
// 解决跨域 Canvas 污染问题
|
||||||
|
@ -114,7 +114,7 @@ export function downloadIamge(imgsrc, name) {
|
||||||
*
|
*
|
||||||
* @param {String} imgsrc 例如图片名: D8x5f13a53dbc4b9_350x345.png
|
* @param {String} imgsrc 例如图片名: D8x5f13a53dbc4b9_350x345.png
|
||||||
*/
|
*/
|
||||||
export function getImageInfo(imgsrc) {
|
export function getImageInfo (imgsrc) {
|
||||||
let data = {
|
let data = {
|
||||||
width: 0,
|
width: 0,
|
||||||
height: 0,
|
height: 0,
|
||||||
|
@ -138,14 +138,14 @@ export function getImageInfo(imgsrc) {
|
||||||
*
|
*
|
||||||
* @param {Number} cr_id
|
* @param {Number} cr_id
|
||||||
*/
|
*/
|
||||||
export function download(cr_id) {
|
export function download (cr_id) {
|
||||||
let api = config.BASE_API_URL;
|
let api = config.BASE_API_URL;
|
||||||
let token = getToken();
|
let token = getToken();
|
||||||
try {
|
try {
|
||||||
let link = document.createElement("a");
|
let link = document.createElement("a");
|
||||||
link.href = `${api}/download/user-chat-file?cr_id=${cr_id}&token=${token}`;
|
link.href = `${api}/download/user-chat-file?cr_id=${cr_id}&token=${token}`;
|
||||||
link.click();
|
link.click();
|
||||||
} catch (e) {}
|
} catch (e) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -155,7 +155,7 @@ export function download(cr_id) {
|
||||||
* @param {String} cFormat
|
* @param {String} cFormat
|
||||||
* @returns {String | null}
|
* @returns {String | null}
|
||||||
*/
|
*/
|
||||||
export function parseTime(time, cFormat) {
|
export function parseTime (time, cFormat) {
|
||||||
if (arguments.length === 0) {
|
if (arguments.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -205,7 +205,7 @@ export function parseTime(time, cFormat) {
|
||||||
*
|
*
|
||||||
* @param {String} str
|
* @param {String} str
|
||||||
*/
|
*/
|
||||||
export function trim(str, type = null) {
|
export function trim (str, type = null) {
|
||||||
if (type) {
|
if (type) {
|
||||||
return str.replace(/(^\s*)|(\s*$)/g, "");
|
return str.replace(/(^\s*)|(\s*$)/g, "");
|
||||||
} else if (type == "l") {
|
} else if (type == "l") {
|
||||||
|
@ -221,19 +221,19 @@ export function trim(str, type = null) {
|
||||||
* @param {String} url
|
* @param {String} url
|
||||||
* @returns {Object}
|
* @returns {Object}
|
||||||
*/
|
*/
|
||||||
export function param2Obj(url) {
|
export function param2Obj (url) {
|
||||||
const search = url.split("?")[1];
|
const search = url.split("?")[1];
|
||||||
|
|
||||||
if (!search) return {};
|
if (!search) return {};
|
||||||
|
|
||||||
return JSON.parse(
|
return JSON.parse(
|
||||||
'{"' +
|
'{"' +
|
||||||
decodeURIComponent(search)
|
decodeURIComponent(search)
|
||||||
.replace(/"/g, '\\"')
|
.replace(/"/g, '\\"')
|
||||||
.replace(/&/g, '","')
|
.replace(/&/g, '","')
|
||||||
.replace(/=/g, '":"')
|
.replace(/=/g, '":"')
|
||||||
.replace(/\+/g, " ") +
|
.replace(/\+/g, " ") +
|
||||||
'"}'
|
'"}'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ export function param2Obj(url) {
|
||||||
* @param {Object} json
|
* @param {Object} json
|
||||||
* @returns {Array}
|
* @returns {Array}
|
||||||
*/
|
*/
|
||||||
export function param(json) {
|
export function param (json) {
|
||||||
if (!json) return "";
|
if (!json) return "";
|
||||||
return cleanArray(
|
return cleanArray(
|
||||||
Object.keys(json).map((key) => {
|
Object.keys(json).map((key) => {
|
||||||
|
@ -256,7 +256,7 @@ export function param(json) {
|
||||||
* @param {Array} actual
|
* @param {Array} actual
|
||||||
* @returns {Array}
|
* @returns {Array}
|
||||||
*/
|
*/
|
||||||
export function cleanArray(actual) {
|
export function cleanArray (actual) {
|
||||||
const newArray = [];
|
const newArray = [];
|
||||||
for (let i = 0; i < actual.length; i++) {
|
for (let i = 0; i < actual.length; i++) {
|
||||||
if (actual[i]) {
|
if (actual[i]) {
|
||||||
|
@ -271,7 +271,7 @@ export function cleanArray(actual) {
|
||||||
* @param {HTMLElement} element
|
* @param {HTMLElement} element
|
||||||
* @param {String} className
|
* @param {String} className
|
||||||
*/
|
*/
|
||||||
export function toggleClass(element, className) {
|
export function toggleClass (element, className) {
|
||||||
if (!element || !className) {
|
if (!element || !className) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -295,7 +295,7 @@ export function toggleClass(element, className) {
|
||||||
* @param {String} cls
|
* @param {String} cls
|
||||||
* @returns {Boolean}
|
* @returns {Boolean}
|
||||||
*/
|
*/
|
||||||
export function hasClass(ele, cls) {
|
export function hasClass (ele, cls) {
|
||||||
return !!ele.className.match(new RegExp("(\\s|^)" + cls + "(\\s|$)"));
|
return !!ele.className.match(new RegExp("(\\s|^)" + cls + "(\\s|$)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,7 +305,7 @@ export function hasClass(ele, cls) {
|
||||||
* @param {HTMLElement} elm
|
* @param {HTMLElement} elm
|
||||||
* @param {String} cls
|
* @param {String} cls
|
||||||
*/
|
*/
|
||||||
export function addClass(ele, cls) {
|
export function addClass (ele, cls) {
|
||||||
if (!hasClass(ele, cls)) ele.className += " " + cls;
|
if (!hasClass(ele, cls)) ele.className += " " + cls;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,7 +315,7 @@ export function addClass(ele, cls) {
|
||||||
* @param {HTMLElement} elm
|
* @param {HTMLElement} elm
|
||||||
* @param {String} cls
|
* @param {String} cls
|
||||||
*/
|
*/
|
||||||
export function removeClass(ele, cls) {
|
export function removeClass (ele, cls) {
|
||||||
if (hasClass(ele, cls)) {
|
if (hasClass(ele, cls)) {
|
||||||
const reg = new RegExp("(\\s|^)" + cls + "(\\s|$)");
|
const reg = new RegExp("(\\s|^)" + cls + "(\\s|$)");
|
||||||
ele.className = ele.className.replace(reg, " ");
|
ele.className = ele.className.replace(reg, " ");
|
||||||
|
@ -328,7 +328,7 @@ export function removeClass(ele, cls) {
|
||||||
* @param {String} src
|
* @param {String} src
|
||||||
* @param {Number} width
|
* @param {Number} width
|
||||||
*/
|
*/
|
||||||
export function imgZoom(src, width = 200) {
|
export function imgZoom (src, width = 200) {
|
||||||
const info = getImageInfo(src);
|
const info = getImageInfo(src);
|
||||||
|
|
||||||
if (info.width < width) {
|
if (info.width < width) {
|
||||||
|
@ -350,7 +350,7 @@ export function imgZoom(src, width = 200) {
|
||||||
* @export
|
* @export
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function getSelection() {
|
export function getSelection () {
|
||||||
return window.getSelection
|
return window.getSelection
|
||||||
? window.getSelection().toString()
|
? window.getSelection().toString()
|
||||||
: document.selection.createRange().text;
|
: document.selection.createRange().text;
|
||||||
|
@ -386,7 +386,7 @@ export const copyTextToClipboard = (value, callback) => {
|
||||||
*
|
*
|
||||||
* @param {String} phone 手机号
|
* @param {String} phone 手机号
|
||||||
*/
|
*/
|
||||||
export function hidePhone(phone) {
|
export function hidePhone (phone) {
|
||||||
return phone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
|
return phone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,7 +395,7 @@ export function hidePhone(phone) {
|
||||||
*
|
*
|
||||||
* @param {Object} datetime
|
* @param {Object} datetime
|
||||||
*/
|
*/
|
||||||
export function beautifyTime(datetime = "") {
|
export function beautifyTime (datetime = "") {
|
||||||
if (datetime == null) {
|
if (datetime == null) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
@ -446,7 +446,7 @@ export function beautifyTime(datetime = "") {
|
||||||
return `${minutes}分钟前`;
|
return `${minutes}分钟前`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getSort(fn) {
|
export function getSort (fn) {
|
||||||
return function (a, b) {
|
return function (a, b) {
|
||||||
let ret = 0;
|
let ret = 0;
|
||||||
|
|
||||||
|
@ -465,7 +465,7 @@ export function getSort(fn) {
|
||||||
*
|
*
|
||||||
* @param {*} arr
|
* @param {*} arr
|
||||||
*/
|
*/
|
||||||
export function getMutipSort(arr) {
|
export function getMutipSort (arr) {
|
||||||
return function (a, b) {
|
return function (a, b) {
|
||||||
let tmp;
|
let tmp;
|
||||||
let i = 0;
|
let i = 0;
|
||||||
|
@ -484,7 +484,7 @@ export function getMutipSort(arr) {
|
||||||
* @param {String} text 文本
|
* @param {String} text 文本
|
||||||
* @param {String} color 超链接颜色
|
* @param {String} color 超链接颜色
|
||||||
*/
|
*/
|
||||||
export function textReplaceLink(text, color = "#409eff") {
|
export function textReplaceLink (text, color = "#409eff") {
|
||||||
let exp =
|
let exp =
|
||||||
/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi;
|
/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi;
|
||||||
return text.replace(
|
return text.replace(
|
||||||
|
@ -501,7 +501,7 @@ export function textReplaceLink(text, color = "#409eff") {
|
||||||
* @param {*} immediate
|
* @param {*} immediate
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function debounce(func, wait, immediate) {
|
export function debounce (func, wait, immediate) {
|
||||||
let timeout;
|
let timeout;
|
||||||
|
|
||||||
return function () {
|
return function () {
|
||||||
|
|
|
@ -10,7 +10,7 @@ const KEY_INDEX_NAME = "send_message_index_name";
|
||||||
*
|
*
|
||||||
* @param {String} index_name
|
* @param {String} index_name
|
||||||
*/
|
*/
|
||||||
export function findTalkIndex(index_name) {
|
export function findTalkIndex (index_name) {
|
||||||
return store.state.talks.items.findIndex(
|
return store.state.talks.items.findIndex(
|
||||||
(item) => item.index_name == index_name
|
(item) => item.index_name == index_name
|
||||||
);
|
);
|
||||||
|
@ -21,7 +21,7 @@ export function findTalkIndex(index_name) {
|
||||||
*
|
*
|
||||||
* @param {String} index_name
|
* @param {String} index_name
|
||||||
*/
|
*/
|
||||||
export function findTalk(index_name) {
|
export function findTalk (index_name) {
|
||||||
return store.state.talks.items.find((item) => item.index_name == index_name);
|
return store.state.talks.items.find((item) => item.index_name == index_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,8 +30,7 @@ export function findTalk(index_name) {
|
||||||
*
|
*
|
||||||
* @param {Object} params
|
* @param {Object} params
|
||||||
*/
|
*/
|
||||||
export function formatTalkItem(params) {
|
export function formatTalkItem (params) {
|
||||||
console.log(params);
|
|
||||||
let options = {
|
let options = {
|
||||||
id: "",
|
id: "",
|
||||||
disable: false,
|
disable: false,
|
||||||
|
@ -58,7 +57,7 @@ export function formatTalkItem(params) {
|
||||||
* @param {Integer} talk_type 对话类型[1:私聊;2:群聊;]
|
* @param {Integer} talk_type 对话类型[1:私聊;2:群聊;]
|
||||||
* @param {Integer} receiver_id 接收者ID
|
* @param {Integer} receiver_id 接收者ID
|
||||||
*/
|
*/
|
||||||
export function toTalk(talk_type, receiver_id) {
|
export function toTalk (talk_type, receiver_id) {
|
||||||
ServeCreateTalkList(receiver_id).then(({ code, data }) => {
|
ServeCreateTalkList(receiver_id).then(({ code, data }) => {
|
||||||
console.log("ServeCreateTalkList", data);
|
console.log("ServeCreateTalkList", data);
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
|
@ -78,7 +77,7 @@ export function toTalk(talk_type, receiver_id) {
|
||||||
*
|
*
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function getCacheIndexName() {
|
export function getCacheIndexName () {
|
||||||
let index_name = sessionStorage.getItem(KEY_INDEX_NAME);
|
let index_name = sessionStorage.getItem(KEY_INDEX_NAME);
|
||||||
if (index_name) {
|
if (index_name) {
|
||||||
sessionStorage.removeItem(KEY_INDEX_NAME);
|
sessionStorage.removeItem(KEY_INDEX_NAME);
|
||||||
|
|
|
@ -72,17 +72,17 @@ export default {
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
unreadNum(n, o) {
|
unreadNum (n, o) {
|
||||||
if (n > 0 && n > o && this.notifyCueTone) {
|
if (n > 0 && n > o && this.notifyCueTone) {
|
||||||
this.play();
|
this.play();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created () {
|
||||||
this.setApplyNum();
|
this.setApplyNum();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
play() {
|
play () {
|
||||||
document
|
document
|
||||||
.querySelector("#audio")
|
.querySelector("#audio")
|
||||||
.play()
|
.play()
|
||||||
|
@ -90,10 +90,10 @@ export default {
|
||||||
console.error("消息提示音播放异常");
|
console.error("消息提示音播放异常");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
logout() {
|
logout () {
|
||||||
this.$store.dispatch("ACT_USER_LOGOUT");
|
this.$store.dispatch("ACT_USER_LOGOUT");
|
||||||
},
|
},
|
||||||
setApplyNum() {
|
setApplyNum () {
|
||||||
// TODO 暂且return
|
// TODO 暂且return
|
||||||
return;
|
return;
|
||||||
ServeFindFriendApplyNum().then((res) => {
|
ServeFindFriendApplyNum().then((res) => {
|
||||||
|
@ -108,7 +108,7 @@ export default {
|
||||||
<style lang="less" >
|
<style lang="less" >
|
||||||
.main-layout {
|
.main-layout {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
width: 75%;
|
width: 80%;
|
||||||
height: 80%;
|
height: 80%;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
@ -120,7 +120,7 @@ export default {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
|
||||||
&.full-mode {
|
&.full-mode {
|
||||||
width: 70%;
|
width: 1200px;
|
||||||
height: 85%;
|
height: 85%;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,8 +80,8 @@
|
||||||
<div class="card-name">
|
<div class="card-name">
|
||||||
<p class="nickname">
|
<p class="nickname">
|
||||||
{{
|
{{
|
||||||
item.remark_name ? item.remark_name : item.name
|
item.remark_name ? item.remark_name : item.name
|
||||||
}}
|
}}
|
||||||
</p>
|
</p>
|
||||||
<div v-show="item.unread" class="larkc-tag">
|
<div v-show="item.unread" class="larkc-tag">
|
||||||
{{ item.unread }}条未读
|
{{ item.unread }}条未读
|
||||||
|
@ -112,8 +112,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<template v-if="
|
<template v-if="
|
||||||
index_name != item.index_name && item.draft_text
|
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>
|
||||||
|
@ -424,7 +424,6 @@ export default {
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (id == this.index_name.split("_")[1]) {
|
if (id == this.index_name.split("_")[1]) {
|
||||||
console.log("已读");
|
|
||||||
this.$store.commit("UPDATE_TALK_ITEM", {
|
this.$store.commit("UPDATE_TALK_ITEM", {
|
||||||
userId: id,
|
userId: id,
|
||||||
index_name: "MESSAGE_" + this.index_name.split("_")[1],
|
index_name: "MESSAGE_" + this.index_name.split("_")[1],
|
||||||
|
|
|
@ -3,10 +3,10 @@ var BASE = {
|
||||||
* @description api请求基础路径
|
* @description api请求基础路径
|
||||||
*/
|
*/
|
||||||
API_DEV: {
|
API_DEV: {
|
||||||
common: "http://192.168.0.113:8890",
|
common: "https://common-api.pickmall.cn",
|
||||||
buyer: "http://192.168.0.113:8888",
|
buyer: "https://buyer-api.pickmall.cn",
|
||||||
seller: "http://192.168.0.113:8889",
|
seller: "https://store-api.pickmall.cn",
|
||||||
manager: "http://192.168.0.113:8887"
|
manager: "https://admin-api.pickmall.cn"
|
||||||
},
|
},
|
||||||
API_PROD: {
|
API_PROD: {
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "https://common-api.pickmall.cn",
|
||||||
|
|
|
@ -400,7 +400,7 @@ export const getChildRegion = (id) => {
|
||||||
|
|
||||||
// 重置用户密码
|
// 重置用户密码
|
||||||
export const resetPassword = (params) => {
|
export const resetPassword = (params) => {
|
||||||
return postRequest(`/passport/user/resetPassword/${params}"`);
|
return postRequest(`/passport/user/resetPassword/${params}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 初始化商品索引
|
// 初始化商品索引
|
||||||
|
|
|
@ -209,28 +209,34 @@ export const auditApplySeckill = params => {
|
||||||
export const getFullDiscountList = params => {
|
export const getFullDiscountList = params => {
|
||||||
return getRequest(`/promotion/fullDiscount`, params);
|
return getRequest(`/promotion/fullDiscount`, params);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 满优惠列表
|
// 满优惠列表
|
||||||
export const getFullDiscountById = id => {
|
export const getFullDiscountById = id => {
|
||||||
return getRequest(`/promotion/fullDiscount/${id}`);
|
return getRequest(`/promotion/fullDiscount/${id}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 开启、关闭满额活动
|
// 开启、关闭满额活动
|
||||||
export const updateFullDiscount = (id, promotionStatus) => {
|
export const updateFullDiscount = (id, promotionStatus) => {
|
||||||
return putRequest(`/promotion/fullDiscount/status/${id}`)
|
return putRequest(`/promotion/fullDiscount/status/${id}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 积分商品列表
|
// 积分商品列表
|
||||||
export const getPointsGoodsList = params => {
|
export const getPointsGoodsList = params => {
|
||||||
return getRequest(`/promotion/pointsGoods`, params);
|
return getRequest(`/promotion/pointsGoods`, params);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 积分商品详情
|
// 积分商品详情
|
||||||
export const getPointsGoodsById = id => {
|
export const getPointsGoodsById = id => {
|
||||||
return getRequest(`/promotion/pointsGoods/${id}`);
|
return getRequest(`/promotion/pointsGoods/${id}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 添加积分商品
|
// 添加积分商品
|
||||||
export const addPointsGoods = params => {
|
export const addPointsGoods = params => {
|
||||||
return postRequest(`/promotion/pointsGoods`, params, {
|
return postRequest(`/promotion/pointsGoods`, params, {
|
||||||
"Content-type": "application/json"
|
"Content-type": "application/json"
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 修改积分商品
|
// 修改积分商品
|
||||||
export const updatePointsGoods = params => {
|
export const updatePointsGoods = params => {
|
||||||
return putRequest(`/promotion/pointsGoods`, params, {
|
return putRequest(`/promotion/pointsGoods`, params, {
|
||||||
|
@ -250,19 +256,28 @@ export const deletePointsGoodsStatus = id => {
|
||||||
export const getPointsGoodsCategoryList = params => {
|
export const getPointsGoodsCategoryList = params => {
|
||||||
return getRequest(`/promotion/pointsGoodsCategory`, params);
|
return getRequest(`/promotion/pointsGoodsCategory`, params);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 积分商品分类详情
|
// 积分商品分类详情
|
||||||
export const getPointsGoodsCategoryById = id => {
|
export const getPointsGoodsCategoryById = id => {
|
||||||
return getRequest(`/promotion/pointsGoodsCategory/${id}`);
|
return getRequest(`/promotion/pointsGoodsCategory/${id}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 添加积分商品分类
|
// 添加积分商品分类
|
||||||
export const addPointsGoodsCategory = params => {
|
export const addPointsGoodsCategory = params => {
|
||||||
return postRequest(`/promotion/pointsGoodsCategory`, params);
|
return postRequest(`/promotion/pointsGoodsCategory`, params);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 更新积分商品分类
|
// 更新积分商品分类
|
||||||
export const updatePointsGoodsCategory = params => {
|
export const updatePointsGoodsCategory = params => {
|
||||||
return putRequest(`/promotion/pointsGoodsCategory`, params);
|
return putRequest(`/promotion/pointsGoodsCategory`, params);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 删除积分商品分类
|
// 删除积分商品分类
|
||||||
export const deletePointsGoodsCategoryById = id => {
|
export const deletePointsGoodsCategoryById = id => {
|
||||||
return deleteRequest(`/promotion/pointsGoodsCategory/${id}`);
|
return deleteRequest(`/promotion/pointsGoodsCategory/${id}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 获取优惠券领取记录
|
||||||
|
export const getCouponReceiveList = (params) => {
|
||||||
|
return getRequest("/promotion/coupon/received", params);
|
||||||
|
};
|
|
@ -193,6 +193,12 @@ export const otherRouter = {
|
||||||
name: "manager-coupon",
|
name: "manager-coupon",
|
||||||
component: () => import("@/views/promotions/coupon/coupon.vue")
|
component: () => import("@/views/promotions/coupon/coupon.vue")
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "promotions/coupon-receive",
|
||||||
|
title: "优惠券领取记录",
|
||||||
|
name: "coupon-receive",
|
||||||
|
component: () => import("@/views/promotions/coupon/coupon-receive.vue"),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "promotions/add-platform-coupon",
|
path: "promotions/add-platform-coupon",
|
||||||
title: "添加平台优惠券",
|
title: "添加平台优惠券",
|
||||||
|
|
|
@ -57,4 +57,31 @@ export function promotionsScopeTypeRender(h, params) {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function memberPromotionsStatusRender(h, status) {
|
||||||
|
let text = "未知",
|
||||||
|
color = "red";
|
||||||
|
if (status == "NEW") {
|
||||||
|
text = "已领取";
|
||||||
|
color = "geekblue";
|
||||||
|
} else if (status == "USED") {
|
||||||
|
text = "已使用";
|
||||||
|
color = "green";
|
||||||
|
} else if (status == "EXPIRE") {
|
||||||
|
text = "已过期";
|
||||||
|
color = "red";
|
||||||
|
} else if (status == "CLOSED") {
|
||||||
|
text = "已作废";
|
||||||
|
color = "red";
|
||||||
|
}
|
||||||
|
return h("div", [
|
||||||
|
h(
|
||||||
|
"Tag",
|
||||||
|
{
|
||||||
|
props: {
|
||||||
|
color: color,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
text
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,321 @@
|
||||||
|
<template>
|
||||||
|
<div class="search">
|
||||||
|
<Card>
|
||||||
|
<Button style="margin-bottom: 10px" @click="back()">返回</Button>
|
||||||
|
<Form
|
||||||
|
ref="searchForm"
|
||||||
|
:model="searchForm"
|
||||||
|
inline
|
||||||
|
:label-width="75"
|
||||||
|
class="search-form mb_10"
|
||||||
|
>
|
||||||
|
<Form-item label="优惠券名称" prop="couponName">
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
v-model="searchForm.couponName"
|
||||||
|
placeholder="请输入优惠券名称"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
/>
|
||||||
|
</Form-item>
|
||||||
|
<Form-item label="会员名称" prop="memberName">
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
v-model="searchForm.memberName"
|
||||||
|
placeholder="请输入会员名称"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
/>
|
||||||
|
</Form-item>
|
||||||
|
<Form-item label="获取方式" prop="getType">
|
||||||
|
<Select
|
||||||
|
v-model="searchForm.getType"
|
||||||
|
placeholder="请选择"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
>
|
||||||
|
<Option value="FREE">免费获取</Option>
|
||||||
|
<Option value="ACTIVITY">活动获取</Option>
|
||||||
|
</Select>
|
||||||
|
</Form-item>
|
||||||
|
<Form-item label="优惠券状态" prop="memberCouponStatus">
|
||||||
|
<Select
|
||||||
|
v-model="searchForm.memberCouponStatus"
|
||||||
|
placeholder="请选择"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
>
|
||||||
|
<Option value="NEW">已领取</Option>
|
||||||
|
<Option value="USED">已使用</Option>
|
||||||
|
<Option value="EXPIRE">已过期</Option>
|
||||||
|
<Option value="CLOSED">已作废</Option>
|
||||||
|
</Select>
|
||||||
|
</Form-item>
|
||||||
|
<Form-item label="活动时间">
|
||||||
|
<DatePicker
|
||||||
|
v-model="selectDate"
|
||||||
|
type="daterange"
|
||||||
|
clearable
|
||||||
|
placeholder="选择起始时间"
|
||||||
|
style="width: 200px"
|
||||||
|
></DatePicker>
|
||||||
|
</Form-item>
|
||||||
|
<Button
|
||||||
|
@click="handleSearch"
|
||||||
|
type="primary"
|
||||||
|
icon="ios-search"
|
||||||
|
class="search-btn"
|
||||||
|
>搜索</Button
|
||||||
|
>
|
||||||
|
</Form>
|
||||||
|
<Table
|
||||||
|
v-if="refreshTable"
|
||||||
|
:loading="loading"
|
||||||
|
border
|
||||||
|
:columns="columns"
|
||||||
|
:data="data"
|
||||||
|
ref="table"
|
||||||
|
class="mt_10"
|
||||||
|
@on-selection-change="changeSelect"
|
||||||
|
>
|
||||||
|
</Table>
|
||||||
|
<Row type="flex" justify="end" class="mt_10">
|
||||||
|
<Page
|
||||||
|
:current="searchForm.pageNumber"
|
||||||
|
:total="total"
|
||||||
|
:page-size="searchForm.pageSize"
|
||||||
|
@on-change="changePage"
|
||||||
|
@on-page-size-change="changePageSize"
|
||||||
|
:page-size-opts="[10, 20, 50]"
|
||||||
|
size="small"
|
||||||
|
show-total
|
||||||
|
show-elevator
|
||||||
|
show-sizer
|
||||||
|
></Page>
|
||||||
|
</Row>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getCouponReceiveList } from "@/api/promotion";
|
||||||
|
import {
|
||||||
|
memberPromotionsStatusRender,
|
||||||
|
promotionsScopeTypeRender,
|
||||||
|
} from "@/utils/promotions";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "coupon-recevie",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: true, // 表单加载状态
|
||||||
|
searchForm: {
|
||||||
|
// 搜索框初始化对象
|
||||||
|
pageNumber: 1, // 当前页数
|
||||||
|
pageSize: 10, // 页面大小
|
||||||
|
sort: "create_time", // 默认排序字段
|
||||||
|
order: "desc", // 默认排序方式
|
||||||
|
getType: "", // 默认排序方式
|
||||||
|
couponId: this.$route.query.couponId, // 优惠券id
|
||||||
|
},
|
||||||
|
selectList: [], // 多选数据
|
||||||
|
selectCount: 0, // 多选计数
|
||||||
|
columns: [
|
||||||
|
// 表头
|
||||||
|
{
|
||||||
|
title: "会员名称",
|
||||||
|
key: "memberName",
|
||||||
|
minWidth: 130,
|
||||||
|
fixed: "left",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "优惠券名称",
|
||||||
|
key: "couponName",
|
||||||
|
minWidth: 100,
|
||||||
|
tooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "发布店铺",
|
||||||
|
key: "storeName",
|
||||||
|
minWidth: 100,
|
||||||
|
render: (h, params) => {
|
||||||
|
return h("div", (params.row.storeName === 'platform' && "平台") || params.row.storeName);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "面额/折扣",
|
||||||
|
key: "price",
|
||||||
|
width: 100,
|
||||||
|
render: (h, params) => {
|
||||||
|
if (params.row.price) {
|
||||||
|
return h(
|
||||||
|
"div",
|
||||||
|
this.$options.filters.unitPrice(params.row.price, "¥")
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return h("div", params.row.discount + "折");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
title: "使用门槛",
|
||||||
|
key: "consumeThreshold",
|
||||||
|
width: 130,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "获取方式",
|
||||||
|
width: 120,
|
||||||
|
key: "getType",
|
||||||
|
render: (h, params) => {
|
||||||
|
if (params.row.getType === "FREE") {
|
||||||
|
return h("Tag", { props: { color: "red" } }, "免费获取");
|
||||||
|
} else if (params.row.getType === "ACTIVITY") {
|
||||||
|
return h("Tag", { props: { color: "volcano" } }, "活动获取");
|
||||||
|
} else if (params.row.getType === "INSIDE") {
|
||||||
|
return h("Tag", { props: { color: "lime" } }, "内购");
|
||||||
|
} else {
|
||||||
|
return h("Tag", { props: { color: "purple" } }, "未知");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "会员优惠券状态",
|
||||||
|
width: 130,
|
||||||
|
key: "memberCouponStatus",
|
||||||
|
render: (h, params) => {
|
||||||
|
return memberPromotionsStatusRender(
|
||||||
|
h,
|
||||||
|
params.row.memberCouponStatus
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "优惠券类型",
|
||||||
|
key: "couponType",
|
||||||
|
width: 120,
|
||||||
|
render: (h, params) => {
|
||||||
|
if (params.row.couponType === "DISCOUNT") {
|
||||||
|
return h("Tag", { props: { color: "orange" } }, "打折");
|
||||||
|
} else if (params.row.couponType === "PRICE") {
|
||||||
|
return h("Tag", { props: { color: "magenta" } }, "减免现金");
|
||||||
|
} else {
|
||||||
|
return h("Tag", { props: { color: "purple" } }, "未知");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "品类描述",
|
||||||
|
key: "scopeType",
|
||||||
|
width: 120,
|
||||||
|
render: (h, params) => {
|
||||||
|
return promotionsScopeTypeRender(h, params);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "有效时间",
|
||||||
|
width: 150,
|
||||||
|
render: (h, params) => {
|
||||||
|
if (
|
||||||
|
params?.row?.getType === "ACTIVITY" &&
|
||||||
|
params?.row?.rangeDayType === "DYNAMICTIME"
|
||||||
|
) {
|
||||||
|
return h("div", "长期有效");
|
||||||
|
} else if (params?.row?.startTime && params?.row?.endTime) {
|
||||||
|
return h("div", {
|
||||||
|
domProps: {
|
||||||
|
innerHTML:
|
||||||
|
params.row.startTime + "<br/>" + params.row.endTime,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
data: [], // 表单数据
|
||||||
|
total: 0, // 表单数据总数
|
||||||
|
refreshTable: true, // 修改选中状态后刷新表格
|
||||||
|
selectDate: [], //选中的信息
|
||||||
|
};
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
promotionStatus: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
$route(e) {
|
||||||
|
// 监听路由,参数变化调取接口
|
||||||
|
this.searchForm.couponId = e.query.couponId;
|
||||||
|
if (this.couponId) {
|
||||||
|
this.getDataList();
|
||||||
|
} else {
|
||||||
|
this.$refs.form.resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back() {
|
||||||
|
this.$store.commit("removeTag", "coupon-receive");
|
||||||
|
this.$router.go(-1);
|
||||||
|
},
|
||||||
|
check() {
|
||||||
|
// 选中的优惠券
|
||||||
|
this.$emit("selected", this.selectList);
|
||||||
|
},
|
||||||
|
// 初始化数据
|
||||||
|
init() {
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
changePage(v) {
|
||||||
|
// 改变页码
|
||||||
|
this.searchForm.pageNumber = v;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
changePageSize(v) {
|
||||||
|
// 改变页数
|
||||||
|
this.searchForm.pageNumber = 1;
|
||||||
|
this.searchForm.pageSize = v;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
handleSearch() {
|
||||||
|
// 搜索
|
||||||
|
this.searchForm.pageNumber = 1;
|
||||||
|
this.searchForm.pageSize = 10;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 选择优惠券
|
||||||
|
*/
|
||||||
|
changeSelect(e) {
|
||||||
|
this.selectList = e;
|
||||||
|
this.selectCount = e.length;
|
||||||
|
if (this.getType === "ACTIVITY") this.check();
|
||||||
|
},
|
||||||
|
getDataList() {
|
||||||
|
// 获取数据
|
||||||
|
this.loading = true;
|
||||||
|
if (this.selectDate && this.selectDate[0] && this.selectDate[1]) {
|
||||||
|
this.searchForm.startTime = this.selectDate[0].getTime();
|
||||||
|
this.searchForm.endTime = this.selectDate[1].getTime();
|
||||||
|
} else {
|
||||||
|
this.searchForm.startTime = null;
|
||||||
|
this.searchForm.endTime = null;
|
||||||
|
}
|
||||||
|
getCouponReceiveList(this.searchForm).then((res) => {
|
||||||
|
this.loading = false;
|
||||||
|
if (res.success) {
|
||||||
|
console.log(res);
|
||||||
|
this.data = res.result.records;
|
||||||
|
this.total = res.result.total;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.total = this.data.length;
|
||||||
|
this.loading = false;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -17,6 +17,17 @@
|
||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
/>
|
/>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
|
<Form-item label="获取方式" prop="getType">
|
||||||
|
<Select
|
||||||
|
v-model="searchForm.getType"
|
||||||
|
placeholder="请选择"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
>
|
||||||
|
<Option value="FREE">免费获取</Option>
|
||||||
|
<Option value="ACTIVITY">活动获取</Option>
|
||||||
|
</Select>
|
||||||
|
</Form-item>
|
||||||
<Form-item label="活动状态" prop="promotionStatus">
|
<Form-item label="活动状态" prop="promotionStatus">
|
||||||
<Select
|
<Select
|
||||||
v-model="searchForm.promotionStatus"
|
v-model="searchForm.promotionStatus"
|
||||||
|
@ -50,6 +61,7 @@
|
||||||
<Row class="operation padding-row" v-if="getType !== 'ACTIVITY'">
|
<Row class="operation padding-row" v-if="getType !== 'ACTIVITY'">
|
||||||
<Button @click="add" type="primary">添加优惠券</Button>
|
<Button @click="add" type="primary">添加优惠券</Button>
|
||||||
<Button @click="delAll">批量关闭</Button>
|
<Button @click="delAll">批量关闭</Button>
|
||||||
|
<Button @click="receivePage()" type="info">优惠券领取记录</Button>
|
||||||
</Row>
|
</Row>
|
||||||
<Table
|
<Table
|
||||||
v-if="refreshTable"
|
v-if="refreshTable"
|
||||||
|
@ -97,6 +109,13 @@
|
||||||
@click="remove(row)"
|
@click="remove(row)"
|
||||||
>删除
|
>删除
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
style="margin: 5px"
|
||||||
|
type="info"
|
||||||
|
size="small"
|
||||||
|
@click="receivePage(row.id)"
|
||||||
|
>领取记录
|
||||||
|
</Button>
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
<Row type="flex" justify="end" class="mt_10">
|
<Row type="flex" justify="end" class="mt_10">
|
||||||
|
@ -150,12 +169,6 @@ export default {
|
||||||
align: "center",
|
align: "center",
|
||||||
fixed: "left",
|
fixed: "left",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "活动名称",
|
|
||||||
key: "promotionName",
|
|
||||||
width: 180,
|
|
||||||
fixed: "left",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "优惠券名称",
|
title: "优惠券名称",
|
||||||
key: "couponName",
|
key: "couponName",
|
||||||
|
@ -200,6 +213,24 @@ export default {
|
||||||
return h("div", params.row.usedNum + "/" + params.row.receivedNum);
|
return h("div", params.row.usedNum + "/" + params.row.receivedNum);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "获取方式",
|
||||||
|
width: 120,
|
||||||
|
key: "getType",
|
||||||
|
render: (h, params) => {
|
||||||
|
if (params.row.getType === "FREE") {
|
||||||
|
return h("Tag", { props: { color: "red" } }, "免费获取");
|
||||||
|
} else if (params.row.getType === "ACTIVITY") {
|
||||||
|
return h("Tag", { props: { color: "volcano" } }, "活动获取");
|
||||||
|
} else if (params.row.getType === "INSIDE") {
|
||||||
|
return h("Tag", { props: { color: "lime" } }, "内购");
|
||||||
|
} else if (params.row.getType === "IGAME") {
|
||||||
|
return h("Tag", { props: { color: "lime" } }, "游戏人生");
|
||||||
|
} else {
|
||||||
|
return h("Tag", { props: { color: "purple" } }, "未知");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "优惠券类型",
|
title: "优惠券类型",
|
||||||
key: "couponType",
|
key: "couponType",
|
||||||
|
@ -324,6 +355,13 @@ export default {
|
||||||
// 选中的优惠券
|
// 选中的优惠券
|
||||||
this.$emit("selected", this.selectList);
|
this.$emit("selected", this.selectList);
|
||||||
},
|
},
|
||||||
|
receivePage(id) {
|
||||||
|
if (id) {
|
||||||
|
this.$router.push({ name: "coupon-receive", query: { couponId: id } });
|
||||||
|
} else {
|
||||||
|
this.$router.push({ name: "coupon-receive" });
|
||||||
|
}
|
||||||
|
},
|
||||||
// 初始化数据
|
// 初始化数据
|
||||||
init() {
|
init() {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
|
|
|
@ -33,11 +33,7 @@
|
||||||
<Select
|
<Select
|
||||||
v-model="form.pointsGoodsCategoryId"
|
v-model="form.pointsGoodsCategoryId"
|
||||||
:label-in-value="true"
|
:label-in-value="true"
|
||||||
@on-change="
|
@on-change="changeCategory"
|
||||||
(val) => {
|
|
||||||
changeCategory(val, index);
|
|
||||||
}
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<Option v-for="item in categoryList" :value="item.id" :key="item.id">{{
|
<Option v-for="item in categoryList" :value="item.id" :key="item.id">{{
|
||||||
item.name
|
item.name
|
||||||
|
@ -97,7 +93,10 @@ export default {
|
||||||
name: "editPointsGoods",
|
name: "editPointsGoods",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
pointsGoodsCategoryId:'',
|
||||||
|
pointsGoodsCategoryName:'',
|
||||||
form: {
|
form: {
|
||||||
|
|
||||||
/** 活动名称 */
|
/** 活动名称 */
|
||||||
promotionName: "",
|
promotionName: "",
|
||||||
/** 报名截止时间 */
|
/** 报名截止时间 */
|
||||||
|
@ -110,6 +109,7 @@ export default {
|
||||||
seckillRule: "",
|
seckillRule: "",
|
||||||
goodsSku: {},
|
goodsSku: {},
|
||||||
promotionStatus: "NEW",
|
promotionStatus: "NEW",
|
||||||
|
|
||||||
},
|
},
|
||||||
categoryList: [], // 分类列表
|
categoryList: [], // 分类列表
|
||||||
id: this.$route.query.id, // 活动id
|
id: this.$route.query.id, // 活动id
|
||||||
|
@ -134,6 +134,12 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 分类
|
||||||
|
changeCategory(v){
|
||||||
|
console.log(v);
|
||||||
|
this.pointsGoodsCategoryId=v.value
|
||||||
|
this.pointsGoodsCategoryName=v.label
|
||||||
|
},
|
||||||
// 关闭当前页面
|
// 关闭当前页面
|
||||||
closeCurrentPage() {
|
closeCurrentPage() {
|
||||||
this.$store.commit("removeTag", "edit-points-goods");
|
this.$store.commit("removeTag", "edit-points-goods");
|
||||||
|
@ -167,7 +173,12 @@ export default {
|
||||||
this.form.startTime = start;
|
this.form.startTime = start;
|
||||||
this.form.endTime = end;
|
this.form.endTime = end;
|
||||||
this.submitLoading = true;
|
this.submitLoading = true;
|
||||||
updatePointsGoods(this.form).then((res) => {
|
let params={
|
||||||
|
...this.form,
|
||||||
|
pointsGoodsCategoryId: this.pointsGoodsCategoryId,
|
||||||
|
pointsGoodsCategoryName:this.pointsGoodsCategoryName
|
||||||
|
}
|
||||||
|
updatePointsGoods(params).then((res) => {
|
||||||
this.submitLoading = false;
|
this.submitLoading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success("积分商品修改成功");
|
this.$Message.success("积分商品修改成功");
|
||||||
|
|
|
@ -3,16 +3,16 @@ var BASE = {
|
||||||
* @description api请求基础路径
|
* @description api请求基础路径
|
||||||
*/
|
*/
|
||||||
API_DEV: {
|
API_DEV: {
|
||||||
common: "http://192.168.0.113:8890",
|
common: "https://common-api.pickmall.cn",
|
||||||
buyer: "http://192.168.0.113:8888",
|
buyer: "https://buyer-api.pickmall.cn",
|
||||||
seller: "http://192.168.0.113:8889",
|
seller: "https://store-api.pickmall.cn",
|
||||||
manager: "http://192.168.0.113:8887"
|
manager: "https://admin-api.pickmall.cn",
|
||||||
},
|
},
|
||||||
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端
|
||||||
|
@ -25,5 +25,5 @@ var BASE = {
|
||||||
/**
|
/**
|
||||||
* @description api请求基础路径前缀
|
* @description api请求基础路径前缀
|
||||||
*/
|
*/
|
||||||
PREFIX: "/store"
|
PREFIX: "/store",
|
||||||
};
|
};
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -4,47 +4,47 @@ import { getRequest, postRequest, postRequestWithNoForm, putRequest, deleteReque
|
||||||
|
|
||||||
// 获取店铺直播间列表
|
// 获取店铺直播间列表
|
||||||
export const getLiveList = (params) => {
|
export const getLiveList = (params) => {
|
||||||
return getRequest('/broadcast/studio', params)
|
return getRequest('/broadcast/studio', params)
|
||||||
}
|
}
|
||||||
// 添加直播间
|
// 添加直播间
|
||||||
export const addLive = (params) => {
|
export const addLive = (params) => {
|
||||||
return postRequest('/broadcast/studio', params)
|
return postRequest('/broadcast/studio', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取直播间详情
|
// 获取直播间详情
|
||||||
export const getLiveInfo = (studioId) => {
|
export const getLiveInfo = (studioId) => {
|
||||||
return getRequest(`/broadcast/studio/studioInfo/${studioId}`)
|
return getRequest(`/broadcast/studio/studioInfo/${studioId}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改直播间
|
// 修改直播间
|
||||||
export const editLive = (params) => {
|
export const editLive = (params) => {
|
||||||
return putRequest('/broadcast/studio/edit', params)
|
return putRequest('/broadcast/studio/edit', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取店铺直播商品
|
// 获取店铺直播商品
|
||||||
export const getLiveGoods = (params) => {
|
export const getLiveGoods = (params) => {
|
||||||
return getRequest('/broadcast/commodity', params)
|
return getRequest('/broadcast/commodity', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 店铺直播间删除商品
|
// 店铺直播间删除商品
|
||||||
export const delLiveGoods = (goodsId) => {
|
export const delLiveGoods = (goodsId) => {
|
||||||
return deleteRequest(`/broadcast/commodity/${goodsId}`)
|
return deleteRequest(`/broadcast/commodity/${goodsId}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 直播间删除商品
|
// 直播间删除商品
|
||||||
export const delRoomLiveGoods = (roomId,liveGoodsId) => {
|
export const delRoomLiveGoods = (roomId, liveGoodsId) => {
|
||||||
return deleteRequest(`/broadcast/studio/deleteInRoom/${roomId}/${liveGoodsId}`)
|
return deleteRequest(`/broadcast/studio/deleteInRoom/${roomId}/${liveGoodsId}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加店铺直播商品
|
// 添加店铺直播商品
|
||||||
export const addLiveStoreGoods = (params) => {
|
export const addLiveStoreGoods = (params) => {
|
||||||
return postRequestWithNoForm('/broadcast/commodity', params)
|
return postRequestWithNoForm('/broadcast/commodity', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 店铺直播间添加
|
// 店铺直播间添加
|
||||||
export const addLiveGoods = (params) => {
|
export const addLiveGoods = (params) => {
|
||||||
|
|
||||||
return putRequest(`/broadcast/studio/push/${params.roomId}/${params.liveGoodsId}`, {goodsId: params.goodsId})
|
return putRequest(`/broadcast/studio/push/${params.roomId}/${params.liveGoodsId}`, { goodsId: params.goodsId })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取拼团列表
|
// 获取拼团列表
|
||||||
|
@ -53,11 +53,11 @@ export const getPintuanList = (params) => {
|
||||||
}
|
}
|
||||||
// 新建 拼团
|
// 新建 拼团
|
||||||
export const savePintuan = (params) => {
|
export const savePintuan = (params) => {
|
||||||
return postRequest('/promotion/pintuan', params,{'Content-type': 'application/json'})
|
return postRequest('/promotion/pintuan', params, { 'Content-type': 'application/json' })
|
||||||
}
|
}
|
||||||
// 编辑 拼团
|
// 编辑 拼团
|
||||||
export const editPintuan = (params) => {
|
export const editPintuan = (params) => {
|
||||||
return putRequest('/promotion/pintuan', params,{'Content-type': 'application/json'})
|
return putRequest('/promotion/pintuan', params, { 'Content-type': 'application/json' })
|
||||||
}
|
}
|
||||||
// 手动开启拼团活动
|
// 手动开启拼团活动
|
||||||
export const editPintuanStatus = (pintuanId, params) => {
|
export const editPintuanStatus = (pintuanId, params) => {
|
||||||
|
@ -76,17 +76,17 @@ export const getPintuanDetail = (id) => {
|
||||||
|
|
||||||
// 获取拼团商品列表
|
// 获取拼团商品列表
|
||||||
export const getPintuanGoodsList = (params) => {
|
export const getPintuanGoodsList = (params) => {
|
||||||
return getRequest(`/promotion/pintuan/goods/${params.pintuanId}`,params)
|
return getRequest(`/promotion/pintuan/goods/${params.pintuanId}`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增优惠券
|
// 新增优惠券
|
||||||
export const saveShopCoupon = (params) => {
|
export const saveShopCoupon = (params) => {
|
||||||
return postRequest('/promotion/coupon', params,{'Content-type': 'application/json'})
|
return postRequest('/promotion/coupon', params, { 'Content-type': 'application/json' })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改优惠券
|
// 修改优惠券
|
||||||
export const editShopCoupon = (params) => {
|
export const editShopCoupon = (params) => {
|
||||||
return putRequest('/promotion/coupon', params,{'Content-type': 'application/json'})
|
return putRequest('/promotion/coupon', params, { 'Content-type': 'application/json' })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取优惠券列表
|
// 获取优惠券列表
|
||||||
|
@ -95,7 +95,7 @@ export const getShopCouponList = (params) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新优惠券状态
|
// 更新优惠券状态
|
||||||
export const updateCouponStatus = ( params) => {
|
export const updateCouponStatus = (params) => {
|
||||||
return putRequest(`/promotion/coupon/status`, params)
|
return putRequest(`/promotion/coupon/status`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,17 +123,17 @@ export const deleteMemberReceiveCoupon = (ids, params) => {
|
||||||
|
|
||||||
// 限时秒杀活动列表
|
// 限时秒杀活动列表
|
||||||
export const seckillList = (params) => {
|
export const seckillList = (params) => {
|
||||||
return getRequest(`/promotion/seckill`,params)
|
return getRequest(`/promotion/seckill`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 限时秒杀活动商品
|
// 限时秒杀活动商品
|
||||||
export const seckillGoodsList = (params) => {
|
export const seckillGoodsList = (params) => {
|
||||||
return getRequest(`/promotion/seckill/apply`,params)
|
return getRequest(`/promotion/seckill/apply`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加限时抢购 商品
|
// 添加限时抢购 商品
|
||||||
export const setSeckillGoods = (params) => {
|
export const setSeckillGoods = (params) => {
|
||||||
return postRequest(`/promotion/seckill/apply/${params.seckillId}`,params.applyVos,{'Content-type': 'application/json'})
|
return postRequest(`/promotion/seckill/apply/${params.seckillId}`, params.applyVos, { 'Content-type': 'application/json' })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加限时抢购 商品
|
// 添加限时抢购 商品
|
||||||
|
@ -148,20 +148,20 @@ export const seckillDetail = (seckillId) => {
|
||||||
// 删除秒杀商品
|
// 删除秒杀商品
|
||||||
export const delSeckillGoods = params => {
|
export const delSeckillGoods = params => {
|
||||||
return deleteRequest(`/promotion/seckill/apply/${params.seckillId}/${params.id}`);
|
return deleteRequest(`/promotion/seckill/apply/${params.seckillId}/${params.id}`);
|
||||||
};
|
};
|
||||||
// 满减满赠活动列表
|
// 满减满赠活动列表
|
||||||
export const getFullDiscountList = (params) => {
|
export const getFullDiscountList = (params) => {
|
||||||
return getRequest(`/promotion/fullDiscount`,params)
|
return getRequest(`/promotion/fullDiscount`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增满减活动
|
// 新增满减活动
|
||||||
export const newFullDiscount = (params) => {
|
export const newFullDiscount = (params) => {
|
||||||
return postRequest(`/promotion/fullDiscount`,params,{'Content-type': 'application/json'})
|
return postRequest(`/promotion/fullDiscount`, params, { 'Content-type': 'application/json' })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑满减活动
|
// 编辑满减活动
|
||||||
export const editFullDiscount = (params) => {
|
export const editFullDiscount = (params) => {
|
||||||
return putRequest(`/promotion/fullDiscount`,params,{'Content-type': 'application/json'})
|
return putRequest(`/promotion/fullDiscount`, params, { 'Content-type': 'application/json' })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 通过id获取满减活动
|
// 通过id获取满减活动
|
||||||
|
@ -177,3 +177,8 @@ export const delFullDiscount = (id) => {
|
||||||
export const updateFullDiscount = (id, params) => {
|
export const updateFullDiscount = (id, params) => {
|
||||||
return putRequest(`/promotion/fullDiscount/status/${id}`, params)
|
return putRequest(`/promotion/fullDiscount/status/${id}`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取优惠券领取记录
|
||||||
|
export const getCouponReceiveList = (params) => {
|
||||||
|
return getRequest("/promotion/coupon/received", params);
|
||||||
|
};
|
||||||
|
|
|
@ -158,6 +158,12 @@ export const otherRouter = {
|
||||||
name: "renovation",
|
name: "renovation",
|
||||||
component: () => import("@/views/shop/renovation.vue")
|
component: () => import("@/views/shop/renovation.vue")
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "promotions/coupon-receive",
|
||||||
|
title: "优惠券领取记录",
|
||||||
|
name: "coupon-receive",
|
||||||
|
component: () => import("@/views/promotion/coupon/coupon-receive.vue"),
|
||||||
|
},
|
||||||
// {
|
// {
|
||||||
// path: "/*",
|
// path: "/*",
|
||||||
// name: "error-404",
|
// name: "error-404",
|
||||||
|
|
|
@ -57,4 +57,31 @@ export function promotionsScopeTypeRender(h, params) {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function memberPromotionsStatusRender(h, status) {
|
||||||
|
let text = "未知",
|
||||||
|
color = "red";
|
||||||
|
if (status == "NEW") {
|
||||||
|
text = "已领取";
|
||||||
|
color = "geekblue";
|
||||||
|
} else if (status == "USED") {
|
||||||
|
text = "已使用";
|
||||||
|
color = "green";
|
||||||
|
} else if (status == "EXPIRE") {
|
||||||
|
text = "已过期";
|
||||||
|
color = "red";
|
||||||
|
} else if (status == "CLOSED") {
|
||||||
|
text = "已作废";
|
||||||
|
color = "red";
|
||||||
|
}
|
||||||
|
return h("div", [
|
||||||
|
h(
|
||||||
|
"Tag",
|
||||||
|
{
|
||||||
|
props: {
|
||||||
|
color: color,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
text
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
|
@ -1383,6 +1383,10 @@ export default {
|
||||||
this.$Message.error("已存在相同规格值!");
|
this.$Message.error("已存在相同规格值!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (val.value === '') {
|
||||||
|
this.$Message.error("规格值不能为空!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
let curVal = this.currentSkuVal;
|
let curVal = this.currentSkuVal;
|
||||||
this.skuTableData = this.skuTableData.map((e) => {
|
this.skuTableData = this.skuTableData.map((e) => {
|
||||||
if (e[val.name] === curVal) {
|
if (e[val.name] === curVal) {
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
</template>
|
</template>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span="12">
|
<Col span="12">
|
||||||
<div class="div-item">
|
<div class="div-item" v-if="orderInfo.order.deliveryMethod != 'SELF_PICK_UP'">
|
||||||
<div class="div-item-left">收货信息:</div>
|
<div class="div-item-left">收货信息:</div>
|
||||||
<div class="div-item-right">
|
<div class="div-item-right">
|
||||||
{{ orderInfo.order.consigneeName }}
|
{{ orderInfo.order.consigneeName }}
|
||||||
|
@ -126,6 +126,13 @@
|
||||||
{{ orderInfo.order.consigneeDetail }}
|
{{ orderInfo.order.consigneeDetail }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="div-item" v-if="orderInfo.order.deliveryMethod == 'SELF_PICK_UP'">
|
||||||
|
<div class="div-item-left">自提信息:</div>
|
||||||
|
<div class="div-item-right">
|
||||||
|
{{ orderInfo.order.storeAddressPath }}
|
||||||
|
{{ orderInfo.order.storeAddressMobile }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="div-item">
|
<div class="div-item">
|
||||||
<div class="div-item-left">支付方式:</div>
|
<div class="div-item-left">支付方式:</div>
|
||||||
<div class="div-item-right">
|
<div class="div-item-right">
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
<Option value="DELIVERED">已发货</Option>
|
<Option value="DELIVERED">已发货</Option>
|
||||||
<Option value="COMPLETED">已完成</Option>
|
<Option value="COMPLETED">已完成</Option>
|
||||||
<Option value="CANCELLED">已取消</Option>
|
<Option value="CANCELLED">已取消</Option>
|
||||||
|
<Option value="STAY_PICKED_UP">待自提</Option>
|
||||||
</Select>
|
</Select>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Form-item label="订单类型" prop="orderType">
|
<Form-item label="订单类型" prop="orderType">
|
||||||
|
@ -225,6 +226,10 @@ export default {
|
||||||
return h("div", [
|
return h("div", [
|
||||||
h("tag", { props: { color: "geekblue" } }, "待发货"),
|
h("tag", { props: { color: "geekblue" } }, "待发货"),
|
||||||
]);
|
]);
|
||||||
|
}else if (params.row.orderStatus == "STAY_PICKED_UP") {
|
||||||
|
return h("div", [
|
||||||
|
h("tag", { props: { color: "geekblue" } }, "待自提"),
|
||||||
|
]);
|
||||||
} else if (params.row.orderStatus == "DELIVERED") {
|
} else if (params.row.orderStatus == "DELIVERED") {
|
||||||
return h("div", [
|
return h("div", [
|
||||||
h("tag", { props: { color: "cyan" } }, "已发货"),
|
h("tag", { props: { color: "cyan" } }, "已发货"),
|
||||||
|
|
|
@ -0,0 +1,285 @@
|
||||||
|
<template>
|
||||||
|
<div class="search">
|
||||||
|
<Card>
|
||||||
|
<Button style="margin-bottom: 10px" @click="back()">返回</Button>
|
||||||
|
<Form
|
||||||
|
ref="searchForm"
|
||||||
|
:model="searchForm"
|
||||||
|
inline
|
||||||
|
:label-width="75"
|
||||||
|
class="search-form mb_10"
|
||||||
|
>
|
||||||
|
<Form-item label="优惠券名称" prop="couponName">
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
v-model="searchForm.couponName"
|
||||||
|
placeholder="请输入优惠券名称"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
/>
|
||||||
|
</Form-item>
|
||||||
|
<Form-item label="会员名称" prop="memberName">
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
v-model="searchForm.memberName"
|
||||||
|
placeholder="请输入会员名称"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
/>
|
||||||
|
</Form-item>
|
||||||
|
<Form-item label="优惠券状态" prop="memberCouponStatus">
|
||||||
|
<Select
|
||||||
|
v-model="searchForm.memberCouponStatus"
|
||||||
|
placeholder="请选择"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
>
|
||||||
|
<Option value="NEW">已领取</Option>
|
||||||
|
<Option value="USED">已使用</Option>
|
||||||
|
<Option value="EXPIRE">已过期</Option>
|
||||||
|
<Option value="CLOSED">已作废</Option>
|
||||||
|
</Select>
|
||||||
|
</Form-item>
|
||||||
|
<Form-item label="活动时间">
|
||||||
|
<DatePicker
|
||||||
|
v-model="selectDate"
|
||||||
|
type="daterange"
|
||||||
|
clearable
|
||||||
|
placeholder="选择起始时间"
|
||||||
|
style="width: 200px"
|
||||||
|
></DatePicker>
|
||||||
|
</Form-item>
|
||||||
|
<Button
|
||||||
|
@click="handleSearch"
|
||||||
|
type="primary"
|
||||||
|
icon="ios-search"
|
||||||
|
class="search-btn"
|
||||||
|
>搜索</Button
|
||||||
|
>
|
||||||
|
</Form>
|
||||||
|
<Table
|
||||||
|
v-if="refreshTable"
|
||||||
|
:loading="loading"
|
||||||
|
border
|
||||||
|
:columns="columns"
|
||||||
|
:data="data"
|
||||||
|
ref="table"
|
||||||
|
class="mt_10"
|
||||||
|
@on-selection-change="changeSelect"
|
||||||
|
>
|
||||||
|
</Table>
|
||||||
|
<Row type="flex" justify="end" class="mt_10">
|
||||||
|
<Page
|
||||||
|
:current="searchForm.pageNumber"
|
||||||
|
:total="total"
|
||||||
|
:page-size="searchForm.pageSize"
|
||||||
|
@on-change="changePage"
|
||||||
|
@on-page-size-change="changePageSize"
|
||||||
|
:page-size-opts="[10, 20, 50]"
|
||||||
|
size="small"
|
||||||
|
show-total
|
||||||
|
show-elevator
|
||||||
|
show-sizer
|
||||||
|
></Page>
|
||||||
|
</Row>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getCouponReceiveList } from "@/api/promotion";
|
||||||
|
import {
|
||||||
|
memberPromotionsStatusRender,
|
||||||
|
promotionsScopeTypeRender,
|
||||||
|
} from "@/utils/promotions";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "coupon-recevie",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: true, // 表单加载状态
|
||||||
|
searchForm: {
|
||||||
|
// 搜索框初始化对象
|
||||||
|
pageNumber: 1, // 当前页数
|
||||||
|
pageSize: 10, // 页面大小
|
||||||
|
sort: "create_time", // 默认排序字段
|
||||||
|
order: "desc", // 默认排序方式
|
||||||
|
getType: "", // 默认排序方式
|
||||||
|
couponId: this.$route.query.couponId, // 优惠券id
|
||||||
|
},
|
||||||
|
selectList: [], // 多选数据
|
||||||
|
selectCount: 0, // 多选计数
|
||||||
|
columns: [
|
||||||
|
// 表头
|
||||||
|
{
|
||||||
|
title: "会员名称",
|
||||||
|
key: "memberName",
|
||||||
|
fixed: "left",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "优惠券名称",
|
||||||
|
key: "couponName",
|
||||||
|
minWidth: 100,
|
||||||
|
tooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "面额/折扣",
|
||||||
|
key: "price",
|
||||||
|
width: 100,
|
||||||
|
render: (h, params) => {
|
||||||
|
if (params.row.price) {
|
||||||
|
return h(
|
||||||
|
"div",
|
||||||
|
this.$options.filters.unitPrice(params.row.price, "¥")
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return h("div", params.row.discount + "折");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
title: "使用门槛",
|
||||||
|
key: "consumeThreshold",
|
||||||
|
width: 130,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "会员优惠券状态",
|
||||||
|
width: 130,
|
||||||
|
key: "memberCouponStatus",
|
||||||
|
render: (h, params) => {
|
||||||
|
return memberPromotionsStatusRender(
|
||||||
|
h,
|
||||||
|
params.row.memberCouponStatus
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "优惠券类型",
|
||||||
|
key: "couponType",
|
||||||
|
width: 120,
|
||||||
|
render: (h, params) => {
|
||||||
|
if (params.row.couponType === "DISCOUNT") {
|
||||||
|
return h("Tag", { props: { color: "orange" } }, "打折");
|
||||||
|
} else if (params.row.couponType === "PRICE") {
|
||||||
|
return h("Tag", { props: { color: "magenta" } }, "减免现金");
|
||||||
|
} else {
|
||||||
|
return h("Tag", { props: { color: "purple" } }, "未知");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "品类描述",
|
||||||
|
key: "scopeType",
|
||||||
|
width: 120,
|
||||||
|
render: (h, params) => {
|
||||||
|
return promotionsScopeTypeRender(h, params);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "有效时间",
|
||||||
|
width: 150,
|
||||||
|
render: (h, params) => {
|
||||||
|
if (
|
||||||
|
params?.row?.getType === "ACTIVITY" &&
|
||||||
|
params?.row?.rangeDayType === "DYNAMICTIME"
|
||||||
|
) {
|
||||||
|
return h("div", "长期有效");
|
||||||
|
} else if (params?.row?.startTime && params?.row?.endTime) {
|
||||||
|
return h("div", {
|
||||||
|
domProps: {
|
||||||
|
innerHTML:
|
||||||
|
params.row.startTime + "<br/>" + params.row.endTime,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
data: [], // 表单数据
|
||||||
|
total: 0, // 表单数据总数
|
||||||
|
refreshTable: true, // 修改选中状态后刷新表格
|
||||||
|
selectDate: [], //选中的信息
|
||||||
|
};
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
promotionStatus: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
$route(e) {
|
||||||
|
// 监听路由,参数变化调取接口
|
||||||
|
this.searchForm.couponId = e.query.couponId;
|
||||||
|
if (this.couponId) {
|
||||||
|
this.getDataList();
|
||||||
|
} else {
|
||||||
|
this.$refs.form.resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back() {
|
||||||
|
this.$store.commit("removeTag", "coupon-receive");
|
||||||
|
this.$router.go(-1);
|
||||||
|
},
|
||||||
|
check() {
|
||||||
|
// 选中的优惠券
|
||||||
|
this.$emit("selected", this.selectList);
|
||||||
|
},
|
||||||
|
// 初始化数据
|
||||||
|
init() {
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
changePage(v) {
|
||||||
|
// 改变页码
|
||||||
|
this.searchForm.pageNumber = v;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
changePageSize(v) {
|
||||||
|
// 改变页数
|
||||||
|
this.searchForm.pageNumber = 1;
|
||||||
|
this.searchForm.pageSize = v;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
handleSearch() {
|
||||||
|
// 搜索
|
||||||
|
this.searchForm.pageNumber = 1;
|
||||||
|
this.searchForm.pageSize = 10;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 选择优惠券
|
||||||
|
*/
|
||||||
|
changeSelect(e) {
|
||||||
|
this.selectList = e;
|
||||||
|
this.selectCount = e.length;
|
||||||
|
if (this.getType === "ACTIVITY") this.check();
|
||||||
|
},
|
||||||
|
getDataList() {
|
||||||
|
// 获取数据
|
||||||
|
this.loading = true;
|
||||||
|
if (this.selectDate && this.selectDate[0] && this.selectDate[1]) {
|
||||||
|
this.searchForm.startTime = this.selectDate[0].getTime();
|
||||||
|
this.searchForm.endTime = this.selectDate[1].getTime();
|
||||||
|
} else {
|
||||||
|
this.searchForm.startTime = null;
|
||||||
|
this.searchForm.endTime = null;
|
||||||
|
}
|
||||||
|
getCouponReceiveList(this.searchForm).then((res) => {
|
||||||
|
this.loading = false;
|
||||||
|
if (res.success) {
|
||||||
|
console.log(res);
|
||||||
|
this.data = res.result.records;
|
||||||
|
this.total = res.result.total;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.total = this.data.length;
|
||||||
|
this.loading = false;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -53,6 +53,7 @@
|
||||||
<Row class="operator padding-row">
|
<Row class="operator padding-row">
|
||||||
<Button @click="add" type="primary">添加</Button>
|
<Button @click="add" type="primary">添加</Button>
|
||||||
<Button @click="delAll" class="ml_10">批量关闭</Button>
|
<Button @click="delAll" class="ml_10">批量关闭</Button>
|
||||||
|
<Button @click="receivePage()" class="ml_10" type="info">优惠券领取记录</Button>
|
||||||
</Row>
|
</Row>
|
||||||
<Table
|
<Table
|
||||||
class="mt_10"
|
class="mt_10"
|
||||||
|
@ -86,6 +87,13 @@
|
||||||
@click="remove(row)"
|
@click="remove(row)"
|
||||||
>关闭</Button
|
>关闭</Button
|
||||||
>
|
>
|
||||||
|
<Button
|
||||||
|
style="margin: 5px"
|
||||||
|
type="info"
|
||||||
|
size="small"
|
||||||
|
@click="receivePage(row.id)"
|
||||||
|
>领取记录
|
||||||
|
</Button>
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
<Row type="flex" justify="end" class="mt_10">
|
<Row type="flex" justify="end" class="mt_10">
|
||||||
|
@ -136,11 +144,6 @@ export default {
|
||||||
align: "center",
|
align: "center",
|
||||||
fixed: "left",
|
fixed: "left",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "活动名称",
|
|
||||||
key: "promotionName",
|
|
||||||
fixed: "left",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "优惠券名称",
|
title: "优惠券名称",
|
||||||
key: "couponName",
|
key: "couponName",
|
||||||
|
@ -204,7 +207,7 @@ export default {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "活动时间",
|
title: "活动时间",
|
||||||
|
width: 150,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (
|
if (
|
||||||
params?.row?.getType === "ACTIVITY" &&
|
params?.row?.getType === "ACTIVITY" &&
|
||||||
|
@ -246,6 +249,13 @@ export default {
|
||||||
init() {
|
init() {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
|
receivePage(id) {
|
||||||
|
if (id) {
|
||||||
|
this.$router.push({ name: "coupon-receive", query: { couponId: id } });
|
||||||
|
} else {
|
||||||
|
this.$router.push({ name: "coupon-receive" });
|
||||||
|
}
|
||||||
|
},
|
||||||
add() {
|
add() {
|
||||||
this.$router.push({ name: "add-coupon" });
|
this.$router.push({ name: "add-coupon" });
|
||||||
},
|
},
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
ref="table"
|
ref="table"
|
||||||
></Table>
|
></Table>
|
||||||
</Card>
|
</Card>
|
||||||
<Modal v-model="openModal" :title="openModalTitle" @on-ok="submit">
|
<Modal v-model="openModal" :title="openModalTitle" @on-ok="submit" @on-cancel="cancelModal">
|
||||||
<h3 style="color: #ff3c2a; margin-bottom: 10px">是否需要电子面单</h3>
|
<h3 style="color: #ff3c2a; margin-bottom: 10px">是否需要电子面单</h3>
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
v-model="faceSheetForm.faceSheetFlag"
|
v-model="faceSheetForm.faceSheetFlag"
|
||||||
|
@ -245,6 +245,10 @@ export default {
|
||||||
});
|
});
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
|
cancelModal(){
|
||||||
|
this.faceSheetFlag = false;
|
||||||
|
this.faceSheetForm.faceSheetFlag = false;
|
||||||
|
},
|
||||||
// 开启
|
// 开启
|
||||||
open(v) {
|
open(v) {
|
||||||
this.row = v;
|
this.row = v;
|
||||||
|
@ -284,7 +288,7 @@ export default {
|
||||||
var a = document.createElement("a"); //创建一个<a></a>标签
|
var a = document.createElement("a"); //创建一个<a></a>标签
|
||||||
//根据点击按钮来下载不同文件
|
//根据点击按钮来下载不同文件
|
||||||
if (val === 'use') {
|
if (val === 'use') {
|
||||||
a.href = "static/open.xlsx"; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
|
a.href = "static/instructions.xlsx"; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
|
||||||
a.download = "使用说明.xlsx"; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可
|
a.download = "使用说明.xlsx"; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可
|
||||||
} else if (val === 'type') {
|
} else if (val === 'type') {
|
||||||
a.href = "static/logisticsType.xlsx"; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
|
a.href = "static/logisticsType.xlsx"; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
|
||||||
|
|
Loading…
Reference in New Issue