积分商城,站内信

master
mabo 2021-05-31 18:03:48 +08:00
parent 78bd4021a6
commit 411f36150b
14 changed files with 358 additions and 69 deletions

View File

@ -441,3 +441,39 @@ export function memberPointHistory (params) {
params
});
}
/**
* 分页获取会员站内信
* @param {Object} params 请求参数包括pageNumberpageSizestatus
*/
export function memberMsgList (params) {
return request({
url: `/buyer/member/message`,
method: Method.GET,
needToken: true,
params
});
}
/**
* 设置消息为已读
* @param {String} messageId 消息id
*/
export function readMemberMsg (params) {
return request({
url: `/buyer/member/message`,
method: Method.PUT,
needToken: true,
params
});
}
/**
* 删除会员消息
* @param {String} messageId 消息id
*/
export function delMemberMsg (params) {
return request({
url: `/buyer/member/message`,
method: Method.DELETE,
needToken: true,
params
});
}

View File

@ -20,7 +20,6 @@
<div class="goodsConfig mt_10">
<span @click="collect" ><Icon type="ios-heart" :color="isCollected ? '#ed3f14' : '#666'" />{{isCollected?'已收藏':'收藏'}}</span>
</div>
</div>
<!-- 右侧商品信息活动信息操作展示 -->

View File

@ -51,16 +51,16 @@
</DropdownMenu>
</Dropdown>
</li>
<li class="hover-color" @click="goUserCenter('/home/MyOrder')"><span class="nav-item">我的订单</span></li>
<li class="hover-color" @click="goUserCenter('/home/MyTracks')"><span class="nav-item">我的足迹</span></li>
<li v-if="$route.name !== 'Cart'" style="position:relative;" >
<li @click="goUserCenter('/home/MyOrder')"><span class="nav-item hover-color">我的订单</span></li>
<li @click="goUserCenter('/home/MyTracks')"><span class="nav-item hover-color">我的足迹</span></li>
<li @click="goUserCenter('/home/MsgList')"><span class="nav-item hover-color">我的消息</span></li>
<li v-if="$route.name !== 'Cart'" style="position:relative;">
<i class="cart-badge" v-show="Number(cartNum)">{{cartNum < 100 ? cartNum : '99'}}</i>
<Dropdown placement="bottom-start">
<router-link to="cart" target="_blank" >
<span @mouseenter="getCartList">
<Icon
size="18"
class="cart-icon"
type="ios-cart-outline"
></Icon>
购物车
@ -260,12 +260,12 @@ export default {
float: left;
font-size: 14px;
line-height: 35px;
margin-right: 15px;
margin-right: 10px;
font-weight: bold;
}
.nav a,.nav-item {
text-decoration: none;
padding-left: 15px;
padding-left: 10px;
border-left: 1px solid #ccc;
color: #999;
cursor: pointer;
@ -406,9 +406,7 @@ export default {
.sign-out p {
font-size: 12px;
}
.cart-icon{
padding: 0 6px;
}
.goods-title:hover {
color: $theme_color;
}

View File

@ -37,7 +37,8 @@ Vue.prototype.linkTo = function (url) {
window.open(url, '_blank')
}
}
Vue.prototype.connectCs = function (sign = '37ef9b97807d03c6741298ed4eb5b536d2d238e08a3c00fb01fe48f03a569974c99ad767e72c04b3165ef29aca2c488b505fe4ca') { // 联系客服
// 联系客服
Vue.prototype.connectCs = function (sign = '37ef9b97807d03c6741298ed4eb5b536d2d238e08a3c00fb01fe48f03a569974c99ad767e72c04b3165ef29aca2c488b505fe4ca') {
const url = 'https://yzf.qq.com/xv/web/static/chat/index.html?sign=' + sign
window.open(url, '_blank')
}

View File

@ -0,0 +1,171 @@
<template>
<div style="background:#fff;">
<BaseHeader></BaseHeader>
<Search></Search>
<drawer></drawer>
<ShopHeader :detail="storeMsg"></ShopHeader>
<div class="shop-item-path">
<div class="shop-nav-container">
<Breadcrumb>
<BreadcrumbItem to="/">首页</BreadcrumbItem>
<BreadcrumbItem v-for="(item, index) in categoryBar" :to="goGoodsList(index)" target="_blank" :key="index">{{item.name}}</BreadcrumbItem>
</Breadcrumb>
<div class="store-collect">
<span class="mr_10" v-if="goodsMsg.data"><router-link :to="'Merchant?id=' + goodsMsg.data.storeId">{{goodsMsg.data.storeName}}</router-link></span>
<span @click="collect" ><Icon type="ios-heart" :color="storeCollected ? '#ed3f14' : '#666'" />{{storeCollected?'已收藏店铺':'收藏店铺'}}</span>
<span @click="connectCs(storeMsg.yzfSign)" class="ml_10"><Icon custom="icomoon icon-customer-service" />联系客服</span>
</div>
</div>
</div>
<!-- 商品信息展示 -->
<ShowGoods v-if="goodsMsg.data" :detail="goodsMsg"></ShowGoods>
<!-- 商品详细展示 -->
<ShowGoodsDetail v-if="goodsMsg.data" :detail="goodsMsg"></ShowGoodsDetail>
<Spin size="large" fix v-if="isLoading"></Spin>
<BaseFooter></BaseFooter>
</div>
</template>
<script>
import Search from '@/components/Search';
import ShopHeader from '@/components/header/ShopHeader';
import ShowGoods from '@/components/goodsDetail/ShowGoods';
import ShowGoodsDetail from '@/components/goodsDetail/ShowGoodsDetail';
import ShowLikeGoods from '@/components/like';
import { goodsSkuDetail } from '@/api/goods';
import { cancelCollect, collectGoods, isCollection } from '@/api/member';
import {getDetailById} from '@/api/shopentry'
export default {
name: 'GoodsDetail',
beforeRouteEnter (to, from, next) {
window.scrollTo(0, 0);
next();
},
created () {
this.getGoodsDetail();
},
data () {
return {
goodsMsg: {}, //
isLoading: false, //
categoryBar: [], //
storeCollected: false, //
storeMsg: {} //
};
},
methods: {
getGoodsDetail () {
this.isLoading = true;
const params = this.$route.query
goodsSkuDetail(params).then((res) => {
this.isLoading = false;
if (res.success) {
const result = res.result;
const cateName = res.result.categoryName;
const cateId = result.data.categoryPath.split(',');
const cateArr = [];
cateId.forEach((e, index) => { // idname
cateArr.push({
id: e,
name: cateName[index]
});
});
this.categoryBar = cateArr;
this.goodsMsg = res.result;
//
if (this.Cookies.getItem('userInfo')) {
isCollection('STORE', this.goodsMsg.data.storeId).then(res => {
if (res.success && res.result) {
this.storeCollected = true;
}
})
}
//
getDetailById(this.goodsMsg.data.storeId).then(res => {
if (res.success) {
this.storeMsg = res.result
}
})
} else {
this.$Message.error(res.message)
this.$router.push('/')
}
}).catch(() => {
this.$router.push('/')
});
},
goGoodsList (currIndex) { //
const arr = []
this.categoryBar.forEach((e, index) => {
if (index <= currIndex) {
arr.push(e.id)
}
})
return location.origin + '/goodsList?categoryId=' + arr.toString()
},
async collect () { //
if (this.storeCollected) {
let cancel = await cancelCollect('STORE', this.goodsMsg.data.storeId)
if (cancel.success) {
this.$Message.success('已取消收藏')
this.storeCollected = false;
}
} else {
let collect = await collectGoods('STORE', this.goodsMsg.data.storeId);
if (collect.code === 200) {
this.storeCollected = true;
this.$Message.success('收藏店铺成功,可以前往个人中心我的收藏查看');
}
}
}
},
watch: {
'$route.query.skuId': function (val) {
location.reload();
}
},
computed: {
},
components: {
Search,
ShopHeader,
ShowGoods,
ShowGoodsDetail,
ShowLikeGoods
}
};
</script>
<style scoped lang="scss">
.shop-item-path {
height: 38px;
@include background_color($light_background_color);
line-height: 38px;
color: #2c2c2c;
}
.like {
width: 100%;
padding: 20px 0;
@include white_background_color();
}
.shop-nav-container {
width: 1200px;
margin: 0 auto;
position: relative;
.store-collect {
position: absolute;
right: 20px;
top: 0;
color: #999;
span{
&:hover{
cursor: pointer;
color: $theme_color;
}
}
}
}
</style>

View File

@ -4,7 +4,7 @@
<Search></Search>
<cateNav></cateNav>
<ul class="category">
<li @click="selectCate(cate.id)" v-for="(cate, index) in cateList" :key="index">{{cate.name}}</li>
<li @click="selectCate(cate.id)" :class="{'selected-cate': cate.id === params.pointsGoodsCategoryId}" v-for="(cate, index) in cateList" :key="index">{{cate.name}}</li>
</ul>
<h3 class="promotion-decorate">积分商品</h3>
<!-- 列表 -->
@ -39,6 +39,13 @@
</div>
</div>
</div>
<div class="page-size">
<Page :total="total" @on-change="changePageNum"
@on-page-size-change="changePageSize"
:page-size="params.pageSize"
show-sizer>
</Page>
</div>
<BaseFooter></BaseFooter>
</div>
</template>
@ -79,11 +86,27 @@ export default {
}
})
},
selectCate (id) {
selectCate (id) { //
this.params.pointsGoodsCategoryId = id
this.getList()
this.$router.push({query: {categoryId: id}})
}
},
goGoodsDetail (skuId, goodsId) { //
let routerUrl = this.$router.resolve({
path: '/goodsDetail',
query: {skuId, goodsId}
})
window.open(routerUrl.href, '_blank')
},
changePageNum (val) { //
this.params.pageNumber = val;
this.getList()
},
changePageSize (val) { //
this.pageNumber = 1;
this.params.pageSize = val;
this.getList()
},
}
}
</script>
@ -104,8 +127,19 @@ export default {
margin: 0 10px;
&:hover{
cursor: pointer;
color: $theme_color;
}
}
.selected-cate{
color: $theme_color;
}
}
.page-size {
width: 1200px;
margin: 10px auto;
display: flex;
justify-content: flex-end;
}
.promotion-decorate::before,.promotion-decorate::after{
background-image: url('../../static/sprite@2x.png');

View File

@ -34,33 +34,6 @@
</div>
</div>
</div>
<!-- <div class="other-user-buy-box">
<div class="other-user-buy-title">
<p>可以顺便看下其他商品哦 ~</p>
</div>
<div class="other-user-buy-row" v-for="(items,index1) in recommend" :key="index1">
<div class="other-user-buy-item-box" v-for="(item,index2) in items" :key="index2">
<div class="other-user-buy-item-img">
<a href="item_detail.html"><img :src="item.img" alt=""></a>
</div>
<div class="other-buy-detail-box">
<div class="other-buy-title">
<a href="item_detail.html">
<p>{{item.intro}}</p>
</a>
</div>
<div class="other-buy-price">
<p>{{item.price}}</p>
</div>
<div class="other-buy-btn-box">
<router-link to="/goodsDetail">
<button class="other-buy-btn"><Icon type="ios-cart"></Icon> 加入购物车</button>
</router-link>
</div>
</div>
</div>
</div>
</div> -->
<BaseFooter></BaseFooter>
</div>
</template>

View File

@ -112,6 +112,10 @@ export default {
</script>
<style scoped lang="scss">
.page-size {
display: flex;
justify-content: flex-end;
}
.order-img {
> img {
width: 60px;

View File

@ -0,0 +1,17 @@
<template>
<div class="msg-list">
会员消息详情
</div>
</template>
<script>
export default {
data() {
return {
detail: {}, //
}
},
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,41 @@
<template>
<div class="msg-list">
<card _Title="我的消息" :_Tabs="status" :_Size="16" />
</div>
</template>
<script>
import {memberMsgList, readMemberMsg, delMemberMsg} from '@/api/member.js'
export default {
data() {
return {
list: [], //
status: ['未读', '已读', '回收站'],
params: { //
pageNumber: 1,
pageSize: 10,
status: ''
},
}
},
methods: {
getList () { //
memberMsgList(this.params).then(res => {
if (res.success) {
this.list = res.result.records;
}
})
},
setRead (id) { //
readMemberMsg(id).then(res => {
})
}
},
mounted () {
this.getList()
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -41,6 +41,11 @@ const member = [{
title: '账户安全',
path: 'AccountSafe'
},
{
icon: '',
title: '我的消息',
path: 'MsgList'
},
{
icon: '',
title: '我的足迹',

View File

@ -47,6 +47,8 @@ const ComplainList = resolve => require(['@/pages/home/memberCenter/ComplainList
const ComplainDetail = resolve => require(['@/pages/home/memberCenter/ComplainDetail'], resolve);
const Invoice = resolve => require(['@/pages/home/memberCenter/Invoice'], resolve);
const Point = resolve => require(['@/pages/home/memberCenter/Point'], resolve);
const MsgList = resolve => require(['@/pages/home/memberCenter/memberMsg/MsgList'], resolve);
const MsgDetail = resolve => require(['@/pages/home/memberCenter/memberMsg/MsgDetail'], resolve);
/*
* 会员中心
@ -316,6 +318,18 @@ export default new Router({
name: 'AddAddress',
component: AddAddress
},
{
path: 'MsgList',
name: 'MsgList',
component: MsgList,
meta: {title: '我的消息'}
},
{
path: 'MsgDetail',
name: 'MsgDetail',
component: MsgDetail,
meta: {title: '我的消息'}
},
{
path: 'MyOrder',
name: 'MyOrder',

View File

@ -1,30 +1,30 @@
<template>
<div class="search">
<Card>
<Table
:loading="loading"
border
:columns="columns"
:data="data"
ref="table"
sortable="custom"
@on-sort-change="changeSort"
@on-selection-change="changeSelect"
>
<template slot-scope="{ row }" slot="rangeTime">
<div>{{ row.startTime }} ~ {{ row.endTime }}</div>
</template>
<template slot-scope="{ row }" slot="action">
<Button
type="error"
ghost
size="small"
:disabled="row.memberCouponStatus != 'NEW'"
@click="remove(row)"
>作废</Button
>
</template>
</Table>
<Table
:loading="loading"
border
:columns="columns"
:data="data"
ref="table"
sortable="custom"
@on-sort-change="changeSort"
@on-selection-change="changeSelect"
>
<template slot-scope="{ row }" slot="rangeTime">
<div>{{ row.startTime }} ~ {{ row.endTime }}</div>
</template>
<template slot-scope="{ row }" slot="action">
<Button
type="error"
ghost
size="small"
:disabled="row.memberCouponStatus != 'NEW'"
@click="remove(row)"
>作废</Button
>
</template>
</Table>
<Row type="flex" justify="end" class="page">
<Page
:current="searchForm.pageNumber"

View File

@ -135,10 +135,6 @@ methodItem h4 {
left: 7px;
top: 0px;
}
.ivu-tag-text {
line-height: 35px;
font-size: 14px;
}
.message-title{
background-color: #fff5eb;