添加买家端注释
parent
33ec809e73
commit
e1c14af914
|
@ -151,8 +151,6 @@ export default {
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {},
|
|
||||||
mounted () {},
|
|
||||||
methods: {
|
methods: {
|
||||||
getCartList () { // 获取购物车列表
|
getCartList () { // 获取购物车列表
|
||||||
this.loading = true
|
this.loading = true
|
||||||
|
|
|
@ -44,12 +44,12 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showCartNum (item) {
|
showCartNum (item) { // 获取购物车数量
|
||||||
if (this.userInfo && item.title === '购物车') {
|
if (this.userInfo && item.title === '购物车') {
|
||||||
this.getCartList()
|
this.getCartList()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
clickBar (val) {
|
clickBar (val) { // tabbar点击操作
|
||||||
if (!this.userInfo) {
|
if (!this.userInfo) {
|
||||||
this.$Modal.confirm({
|
this.$Modal.confirm({
|
||||||
title: '请登录',
|
title: '请登录',
|
||||||
|
@ -83,7 +83,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
openBlank (path) {
|
openBlank (path) { // 新页面打开地址
|
||||||
let routerUrl = this.$router.resolve({
|
let routerUrl = this.$router.resolve({
|
||||||
path: path
|
path: path
|
||||||
})
|
})
|
||||||
|
|
|
@ -13,11 +13,6 @@
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'Main',
|
name: 'Main',
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
|
|
||||||
};
|
|
||||||
},
|
|
||||||
props: {
|
props: {
|
||||||
_Title: { // 描述内容
|
_Title: { // 描述内容
|
||||||
type: null,
|
type: null,
|
||||||
|
|
|
@ -62,7 +62,7 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
goArticle () { // 跳转
|
goArticle () { // 跳转文章页
|
||||||
let routeUrl = this.$router.resolve({
|
let routeUrl = this.$router.resolve({
|
||||||
path: '/article'
|
path: '/article'
|
||||||
})
|
})
|
||||||
|
|
|
@ -19,7 +19,7 @@ export default {
|
||||||
time: { // 传入的初始时间
|
time: { // 传入的初始时间
|
||||||
default: 1718977559428
|
default: 1718977559428
|
||||||
},
|
},
|
||||||
type: {
|
type: { // 区分是在详情还是购物车调用
|
||||||
default: 'goodsDetail', // 设置两个值,goodsDetail和cart,样式不同
|
default: 'goodsDetail', // 设置两个值,goodsDetail和cart,样式不同
|
||||||
type: String
|
type: String
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ export default {
|
||||||
this.init()
|
this.init()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
countDown (val) {
|
countDown (val) { // 倒计时方法
|
||||||
function addZero (i) {
|
function addZero (i) {
|
||||||
return i < 10 ? '0' + i : i + '';
|
return i < 10 ? '0' + i : i + '';
|
||||||
}
|
}
|
||||||
|
@ -58,8 +58,8 @@ export default {
|
||||||
clearInterval(this.interval)
|
clearInterval(this.interval)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init () {
|
init () { // 初始化
|
||||||
this.interval = setInterval((item) => {
|
this.interval = setInterval(() => {
|
||||||
this.countDown(this.time);
|
this.countDown(this.time);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,10 +119,14 @@
|
||||||
<span class="inventory"> {{skuDetail.weight}}kg</span>
|
<span class="inventory"> {{skuDetail.weight}}kg</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="add-buy-car">
|
<div class="add-buy-car" v-if="$route.query.way === 'POINT'">
|
||||||
|
<Button type="error" :loading="loading" :disabled="skuDetail.quantity === 0" @click="pointPay">积分购买</Button>
|
||||||
|
</div>
|
||||||
|
<div class="add-buy-car" v-else>
|
||||||
<Button type="error" :loading="loading" :disabled="skuDetail.quantity === 0" @click="addShoppingCartBtn">加入购物车</Button>
|
<Button type="error" :loading="loading" :disabled="skuDetail.quantity === 0" @click="addShoppingCartBtn">加入购物车</Button>
|
||||||
<Button type="warning" :loading="loading1" :disabled="skuDetail.quantity === 0" @click="buyNow">立即购买</Button>
|
<Button type="warning" :loading="loading1" :disabled="skuDetail.quantity === 0" @click="buyNow">立即购买</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -220,6 +224,22 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
pointPay () { // 积分购买
|
||||||
|
const params = {
|
||||||
|
num: this.count,
|
||||||
|
skuId: this.skuDetail.id,
|
||||||
|
cartType: 'BUY_NOW'
|
||||||
|
};
|
||||||
|
this.loading1 = true;
|
||||||
|
addCartGoods(params).then(res => {
|
||||||
|
this.loading1 = false;
|
||||||
|
if (res.success) {
|
||||||
|
this.$router.push({path: '/pay', query: {way: 'POINT'}});
|
||||||
|
} else {
|
||||||
|
this.$Message.warning(res.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
async collect () { // 收藏商品
|
async collect () { // 收藏商品
|
||||||
if (this.isCollected) {
|
if (this.isCollected) {
|
||||||
let cancel = await cancelCollect('GOODS', this.skuDetail.id)
|
let cancel = await cancelCollect('GOODS', this.skuDetail.id)
|
||||||
|
@ -311,6 +331,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
// 用户登录才会判断是否收藏
|
||||||
if (this.Cookies.getItem('userInfo')) {
|
if (this.Cookies.getItem('userInfo')) {
|
||||||
isCollection('GOODS', this.skuDetail.id).then(res => {
|
isCollection('GOODS', this.skuDetail.id).then(res => {
|
||||||
if (res.success && res.result) {
|
if (res.success && res.result) {
|
||||||
|
|
|
@ -38,10 +38,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="remarks-bar">
|
<div class="remarks-bar">
|
||||||
<span @click="searchByGrade('')" :class="{selectedBar: commentParams.grade === ''}">全部({{commentTypeNum.all}})</span>
|
<span @click="viewByGrade('')" :class="{selectedBar: commentParams.grade === ''}">全部({{commentTypeNum.all}})</span>
|
||||||
<span @click="searchByGrade('GOOD')" :class="{selectedBar: commentParams.grade === 'GOOD'}">好评({{commentTypeNum.good}})</span>
|
<span @click="viewByGrade('GOOD')" :class="{selectedBar: commentParams.grade === 'GOOD'}">好评({{commentTypeNum.good}})</span>
|
||||||
<span @click="searchByGrade('MODERATE')" :class="{selectedBar: commentParams.grade === 'MODERATE'}">中评({{commentTypeNum.moderate}})</span>
|
<span @click="viewByGrade('MODERATE')" :class="{selectedBar: commentParams.grade === 'MODERATE'}">中评({{commentTypeNum.moderate}})</span>
|
||||||
<span @click="searchByGrade('WORSE')" :class="{selectedBar: commentParams.grade === 'WORSE'}">差评({{commentTypeNum.worse}})</span>
|
<span @click="viewByGrade('WORSE')" :class="{selectedBar: commentParams.grade === 'WORSE'}">差评({{commentTypeNum.worse}})</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="text-align: center;margin-top: 20px;" v-if="commentList.length === 0">
|
<div style="text-align: center;margin-top: 20px;" v-if="commentList.length === 0">
|
||||||
暂无评价数据
|
暂无评价数据
|
||||||
|
@ -86,9 +86,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</TabPane>
|
</TabPane>
|
||||||
<!-- <TabPane label="商品问答">
|
|
||||||
<ShowGoodsQuestion/>
|
|
||||||
</TabPane> -->
|
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -97,7 +94,6 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ShowGoodsQuestion from '@/components/goodsDetail/ShowGoodsQuestion';
|
|
||||||
import { goodsComment, goodsCommentNum } from '@/api/member.js';
|
import { goodsComment, goodsCommentNum } from '@/api/member.js';
|
||||||
export default {
|
export default {
|
||||||
name: 'ShowGoodsDetail',
|
name: 'ShowGoodsDetail',
|
||||||
|
@ -122,21 +118,21 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
skuDetail () {
|
skuDetail () { // skuId
|
||||||
return this.detail.data;
|
return this.detail.data;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeHeight (name) {
|
changeHeight (name) { // 设置商品详情高度
|
||||||
let heightCss = window.getComputedStyle(this.$refs[name]).height;
|
let heightCss = window.getComputedStyle(this.$refs[name]).height;
|
||||||
heightCss = parseInt(heightCss.substr(0, heightCss.length - 2)) + 89;
|
heightCss = parseInt(heightCss.substr(0, heightCss.length - 2)) + 89;
|
||||||
this.$refs.itemIntroDetail.style.height = heightCss + 'px';
|
this.$refs.itemIntroDetail.style.height = heightCss + 'px';
|
||||||
},
|
},
|
||||||
changePageNum (val) {
|
changePageNum (val) { // 修改评论页码
|
||||||
this.commentParams.pageNumber = val;
|
this.commentParams.pageNumber = val;
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
changePageSize (val) {
|
changePageSize (val) { // 修改评论页数
|
||||||
this.commentParams.pageNumber = 1;
|
this.commentParams.pageNumber = 1;
|
||||||
this.commentParams.pageSize = val;
|
this.commentParams.pageSize = val;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
@ -155,12 +151,12 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
searchByGrade (grade) {
|
viewByGrade (grade) { // 好中差评切换
|
||||||
this.$set(this.commentParams, 'grade', grade);
|
this.$set(this.commentParams, 'grade', grade);
|
||||||
this.commentParams.pageNumber = 1;
|
this.commentParams.pageNumber = 1;
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
tabClick (name) {
|
tabClick (name) { // 商品详情和评价之间的tab切换
|
||||||
if (name === 0) {
|
if (name === 0) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.changeHeight('itemIntroGoods')
|
this.changeHeight('itemIntroGoods')
|
||||||
|
@ -198,7 +194,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleScroll () {
|
handleScroll () { // 监听页面滚动
|
||||||
if (this.onceFlag) {
|
if (this.onceFlag) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.changeHeight('itemIntroGoods')
|
this.changeHeight('itemIntroGoods')
|
||||||
|
@ -208,15 +204,12 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => { // 手动设置详情高度,解决无法撑开问题
|
||||||
setTimeout(this.changeHeight('itemIntroGoods'), 2000);
|
setTimeout(this.changeHeight('itemIntroGoods'), 2000);
|
||||||
});
|
});
|
||||||
window.addEventListener('scroll', this.handleScroll)
|
window.addEventListener('scroll', this.handleScroll)
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
components: {
|
|
||||||
ShowGoodsQuestion
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -283,14 +276,12 @@ export default {
|
||||||
}
|
}
|
||||||
.item-intro-detail{
|
.item-intro-detail{
|
||||||
margin: 0 30px;
|
margin: 0 30px;
|
||||||
// min-height: 1500px;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.item-intro-nav{
|
.item-intro-nav{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 38px;
|
height: 38px;
|
||||||
background-color: #F7F7F7;
|
background-color: #F7F7F7;
|
||||||
// border-bottom: 1px solid $theme_color;
|
|
||||||
}
|
}
|
||||||
.item-intro-nav ul{
|
.item-intro-nav ul{
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
|
@ -329,8 +320,6 @@ export default {
|
||||||
width: 240px;
|
width: 240px;
|
||||||
height: 36px;
|
height: 36px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
/* text-align: center; */
|
|
||||||
/* background-color: #ccc; */
|
|
||||||
}
|
}
|
||||||
.item-param-title {
|
.item-param-title {
|
||||||
color: #232323;
|
color: #232323;
|
||||||
|
|
|
@ -1,53 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="wrapper">
|
|
||||||
<div v-if="true" class="question-list">
|
|
||||||
<div class="-item" v-for="index in 6" :key="index">
|
|
||||||
<!-- 提问 -->
|
|
||||||
<div class="-item-put -item-div">
|
|
||||||
<div class="-item-div-l blod">
|
|
||||||
<Tag color="warning">问</Tag>
|
|
||||||
有屏幕调节亮度吗
|
|
||||||
</div>
|
|
||||||
<div class="-item-div-r">2020年10月21日17:03:35</div>
|
|
||||||
</div>
|
|
||||||
<!-- 解答 -->
|
|
||||||
<div class="-item-reply -item-div">
|
|
||||||
<div class="-item-div-l">
|
|
||||||
<Tag color="success">答</Tag>
|
|
||||||
能调节,点屏幕上方有一条调整带,可正负2调整。
|
|
||||||
</div>
|
|
||||||
<div class="-item-div-r">2020年10月21日17:03:35</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div v-else class="question-empty">
|
|
||||||
<empty></empty>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {};
|
|
||||||
</script>
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.-item-div {
|
|
||||||
padding: 10px 0;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin: 10px 0;
|
|
||||||
}
|
|
||||||
.-item-div-l {
|
|
||||||
display: flex;
|
|
||||||
@include content_color($light_content_color);
|
|
||||||
}
|
|
||||||
.-item-div-r {
|
|
||||||
@include sub_color($light_content_color);
|
|
||||||
}
|
|
||||||
.blod {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.-item {
|
|
||||||
margin: 10px 0;
|
|
||||||
border-bottom: 1px solid $border_color;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,85 +0,0 @@
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<div class="remarks-title">
|
|
||||||
<span>售后保障</span>
|
|
||||||
</div>
|
|
||||||
<div class="item-protect-container">
|
|
||||||
<div class="item-protect-box">
|
|
||||||
<p class="item-protect-title-box">
|
|
||||||
<Avatar style="background-color: #e4393c" icon="ribbon-a" />
|
|
||||||
<span class="item-protect-title">卖家服务</span>
|
|
||||||
</p>
|
|
||||||
<p class="item-protect-detail">
|
|
||||||
高品质敢承诺:7天无理由退货,30天免费换新,质量问题商家承担来回运费换新;如需发票,请在确认收货无误后联系商家开出。(注*发票不随货品一同发出)
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="item-protect-box">
|
|
||||||
<p class="item-protect-title-box">
|
|
||||||
<Avatar style="background-color: #e4393c" icon="cash" />
|
|
||||||
<span class="item-protect-title">平台承诺</span>
|
|
||||||
</p>
|
|
||||||
<p class="item-protect-detail">
|
|
||||||
平台卖家销售并发货的商品,由平台卖家提供发票和相应的售后服务。请您放心购买!<br> 注:因厂家会在没有任何提前通知的情况下更改产品包装、产地或者一些附件,本司不能确保客户收到的货物与商城图片、产地、附件说明完全一致。只能确保为原厂正货!并且保证与当时市场上同样主流新品一致。若本商城没有及时更新,请大家谅解!
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="item-protect-box">
|
|
||||||
<p class="item-protect-title-box">
|
|
||||||
<Avatar style="background-color: #e4393c" icon="locked" />
|
|
||||||
<span class="item-protect-title">正品行货</span>
|
|
||||||
</p>
|
|
||||||
<p class="item-protect-detail">
|
|
||||||
BIT商城向您保证所售商品均为正品行货,BIT自营商品开具机打发票或电子发票。
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="item-protect-box">
|
|
||||||
<p class="item-protect-title-box">
|
|
||||||
<Avatar style="background-color: #e4393c" icon="settings" />
|
|
||||||
<span class="item-protect-title">全国联保</span>
|
|
||||||
</p>
|
|
||||||
<p class="item-protect-detail">
|
|
||||||
凭质保证书及BIT商城发票,可享受全国联保服务(奢侈品、钟表除外;奢侈品、钟表由BIT联系保修,享受法定三包售后服务),与您亲临商场选购的商品享受相同的质量保证。BIT商城还为您提供具有竞争力的商品价格和运费政策,请您放心购买!<br><br> 注:因厂家会在没有任何提前通知的情况下更改产品包装、产地或者一些附件,本司不能确保客户收到的货物与商城图片、产地、附件说明完全一致。只能确保为原厂正货!并且保证与当时市场上同样主流新品一致。若本商城没有及时更新,请大家谅解!
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'ShowProductWarranty'
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.remarks-title {
|
|
||||||
padding-left: 15px;
|
|
||||||
height: 36px;
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: bolder;
|
|
||||||
line-height: 36px;
|
|
||||||
color: #666666;
|
|
||||||
background-color: #F7F7F7;
|
|
||||||
}
|
|
||||||
.item-protect-container {
|
|
||||||
padding: 15px;
|
|
||||||
}
|
|
||||||
.item-protect-box {
|
|
||||||
margin-bottom: 30px;
|
|
||||||
}
|
|
||||||
.item-protect-title-box {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.item-protect-title {
|
|
||||||
padding-left: 15px;
|
|
||||||
font-size: 20px;
|
|
||||||
font-weight: bolder;
|
|
||||||
color: $theme_color;
|
|
||||||
}
|
|
||||||
.item-protect-detail {
|
|
||||||
padding-top: 5px;
|
|
||||||
padding-left: 46px;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -25,7 +25,6 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="detail">
|
<ul class="detail">
|
||||||
<!-- <li class="first hover-pointer" @click="handleClickTheme()">切换主题</li> -->
|
|
||||||
<li class="first" v-show="!userInfo.username">
|
<li class="first" v-show="!userInfo.username">
|
||||||
<router-link :to="`/login?rePath=${$route.path}&query=${JSON.stringify($route.query)}`">
|
<router-link :to="`/login?rePath=${$route.path}&query=${JSON.stringify($route.query)}`">
|
||||||
<span style="border:none" class="tipsLogin">请登录</span>
|
<span style="border:none" class="tipsLogin">请登录</span>
|
||||||
|
@ -148,31 +147,22 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleClickTheme () {
|
changeCity (city) { // 选择所在城市
|
||||||
this.themeType === 'light'
|
|
||||||
? (this.themeType = 'dark')
|
|
||||||
: (this.themeType = 'light');
|
|
||||||
window.document.documentElement.setAttribute(
|
|
||||||
'data-theme',
|
|
||||||
this.themeType
|
|
||||||
);
|
|
||||||
},
|
|
||||||
changeCity (city) {
|
|
||||||
this.city = city;
|
this.city = city;
|
||||||
},
|
},
|
||||||
goToPay () {
|
goToPay () { // 跳转购物车
|
||||||
let url = this.$router.resolve({
|
let url = this.$router.resolve({
|
||||||
path: '/cart'
|
path: '/cart'
|
||||||
})
|
})
|
||||||
window.open(url.href, '_blank')
|
window.open(url.href, '_blank')
|
||||||
},
|
},
|
||||||
myInfo () {
|
myInfo () { // 跳转会员中心
|
||||||
let url = this.$router.resolve({
|
let url = this.$router.resolve({
|
||||||
path: '/home'
|
path: '/home'
|
||||||
})
|
})
|
||||||
window.open(url.href, '_blank')
|
window.open(url.href, '_blank')
|
||||||
},
|
},
|
||||||
signOutFun () {
|
signOutFun () { // 退出登录
|
||||||
storage.removeItem('accessToken');
|
storage.removeItem('accessToken');
|
||||||
storage.removeItem('refreshToken');
|
storage.removeItem('refreshToken');
|
||||||
storage.removeItem('userInfo');
|
storage.removeItem('userInfo');
|
||||||
|
|
|
@ -20,7 +20,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
storeDetail () {
|
storeDetail () { // 店铺详情
|
||||||
return this.detail;
|
return this.detail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
goCartList () {
|
goCartList () { // 跳转购物车页面
|
||||||
let routerUrl = this.$router.resolve({
|
let routerUrl = this.$router.resolve({
|
||||||
path: '/cart'
|
path: '/cart'
|
||||||
})
|
})
|
||||||
|
|
|
@ -67,14 +67,14 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getArticleList () {
|
getArticleList () { // 获取常见问题列表
|
||||||
articleList(this.params).then(res => {
|
articleList(this.params).then(res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.articleList = res.result.records
|
this.articleList = res.result.records
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goArticle (id) {
|
goArticle (id) { // 跳转文章详情
|
||||||
let routeUrl = this.$router.resolve({
|
let routeUrl = this.$router.resolve({
|
||||||
path: '/article',
|
path: '/article',
|
||||||
query: {id}
|
query: {id}
|
||||||
|
|
|
@ -32,7 +32,6 @@ export default {
|
||||||
options: this.data.options // 装修数据
|
options: this.data.options // 装修数据
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -50,9 +50,8 @@ export default {
|
||||||
this.$emit('content', val);
|
this.$emit('content', val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {},
|
|
||||||
methods: {
|
methods: {
|
||||||
changeCurr (index) {
|
changeCurr (index) { // 选择分类
|
||||||
this.currentIndex = index;
|
this.currentIndex = index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
diffSeconds (val) {
|
diffSeconds (val) { // 秒杀倒计时
|
||||||
const hours = Math.floor(val / 3600);
|
const hours = Math.floor(val / 3600);
|
||||||
// 当前秒数 / 60,向下取整
|
// 当前秒数 / 60,向下取整
|
||||||
// 获取到所有分钟数 3600 / 60 = 60分钟
|
// 获取到所有分钟数 3600 / 60 = 60分钟
|
||||||
|
|
|
@ -1,171 +0,0 @@
|
||||||
<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) => { // 插入分类id和name
|
|
||||||
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>
|
|
|
@ -63,7 +63,8 @@ export default {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
pointsGoodsCategoryId: ''
|
pointsGoodsCategoryId: ''
|
||||||
}
|
},
|
||||||
|
total: 0 // 商品总数
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
@ -76,6 +77,7 @@ export default {
|
||||||
pointGoods(this.params).then(res => {
|
pointGoods(this.params).then(res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.goodsList = res.result.records
|
this.goodsList = res.result.records
|
||||||
|
this.total = res.result.total
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -94,7 +96,7 @@ export default {
|
||||||
goGoodsDetail (skuId, goodsId) { // 跳转商品详情
|
goGoodsDetail (skuId, goodsId) { // 跳转商品详情
|
||||||
let routerUrl = this.$router.resolve({
|
let routerUrl = this.$router.resolve({
|
||||||
path: '/goodsDetail',
|
path: '/goodsDetail',
|
||||||
query: {skuId, goodsId}
|
query: {skuId, goodsId, way: 'POINT'}
|
||||||
})
|
})
|
||||||
window.open(routerUrl.href, '_blank')
|
window.open(routerUrl.href, '_blank')
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue