添加买家端注释

master
mabo 2021-06-03 16:17:11 +08:00
parent 33ec809e73
commit e1c14af914
18 changed files with 56 additions and 372 deletions

View File

@ -151,8 +151,6 @@ export default {
]
};
},
components: {},
mounted () {},
methods: {
getCartList () { //
this.loading = true

View File

@ -44,12 +44,12 @@ export default {
}
},
methods: {
showCartNum (item) {
showCartNum (item) { //
if (this.userInfo && item.title === '购物车') {
this.getCartList()
}
},
clickBar (val) {
clickBar (val) { // tabbar
if (!this.userInfo) {
this.$Modal.confirm({
title: '请登录',
@ -83,7 +83,7 @@ export default {
}
}
},
openBlank (path) {
openBlank (path) { //
let routerUrl = this.$router.resolve({
path: path
})

View File

@ -13,11 +13,6 @@
<script>
export default {
name: 'Main',
data () {
return {
};
},
props: {
_Title: { //
type: null,

View File

@ -62,7 +62,7 @@ export default {
};
},
methods: {
goArticle () { //
goArticle () { //
let routeUrl = this.$router.resolve({
path: '/article'
})

View File

@ -19,7 +19,7 @@ export default {
time: { //
default: 1718977559428
},
type: {
type: { //
default: 'goodsDetail', // goodsDetailcart
type: String
}
@ -37,7 +37,7 @@ export default {
this.init()
},
methods: {
countDown (val) {
countDown (val) { //
function addZero (i) {
return i < 10 ? '0' + i : i + '';
}
@ -58,8 +58,8 @@ export default {
clearInterval(this.interval)
}
},
init () {
this.interval = setInterval((item) => {
init () { //
this.interval = setInterval(() => {
this.countDown(this.time);
}, 1000);
}

View File

@ -119,10 +119,14 @@
<span class="inventory"> {{skuDetail.weight}}kg</span>
</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="warning" :loading="loading1" :disabled="skuDetail.quantity === 0" @click="buyNow"></Button>
</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 () { //
if (this.isCollected) {
let cancel = await cancelCollect('GOODS', this.skuDetail.id)
@ -311,6 +331,7 @@ export default {
}
},
mounted () {
//
if (this.Cookies.getItem('userInfo')) {
isCollection('GOODS', this.skuDetail.id).then(res => {
if (res.success && res.result) {

View File

@ -38,10 +38,10 @@
</div>
</div>
<div class="remarks-bar">
<span @click="searchByGrade('')" :class="{selectedBar: commentParams.grade === ''}">全部({{commentTypeNum.all}})</span>
<span @click="searchByGrade('GOOD')" :class="{selectedBar: commentParams.grade === 'GOOD'}">好评({{commentTypeNum.good}})</span>
<span @click="searchByGrade('MODERATE')" :class="{selectedBar: commentParams.grade === 'MODERATE'}">中评({{commentTypeNum.moderate}})</span>
<span @click="searchByGrade('WORSE')" :class="{selectedBar: commentParams.grade === 'WORSE'}">差评({{commentTypeNum.worse}})</span>
<span @click="viewByGrade('')" :class="{selectedBar: commentParams.grade === ''}">全部({{commentTypeNum.all}})</span>
<span @click="viewByGrade('GOOD')" :class="{selectedBar: commentParams.grade === 'GOOD'}">好评({{commentTypeNum.good}})</span>
<span @click="viewByGrade('MODERATE')" :class="{selectedBar: commentParams.grade === 'MODERATE'}">中评({{commentTypeNum.moderate}})</span>
<span @click="viewByGrade('WORSE')" :class="{selectedBar: commentParams.grade === 'WORSE'}">差评({{commentTypeNum.worse}})</span>
</div>
<div style="text-align: center;margin-top: 20px;" v-if="commentList.length === 0">
暂无评价数据
@ -86,9 +86,6 @@
</div>
</div>
</TabPane>
<!-- <TabPane label="商品问答">
<ShowGoodsQuestion/>
</TabPane> -->
</Tabs>
</div>
</div>
@ -97,7 +94,6 @@
</template>
<script>
import ShowGoodsQuestion from '@/components/goodsDetail/ShowGoodsQuestion';
import { goodsComment, goodsCommentNum } from '@/api/member.js';
export default {
name: 'ShowGoodsDetail',
@ -122,21 +118,21 @@ export default {
};
},
computed: {
skuDetail () {
skuDetail () { // skuId
return this.detail.data;
}
},
methods: {
changeHeight (name) {
changeHeight (name) { //
let heightCss = window.getComputedStyle(this.$refs[name]).height;
heightCss = parseInt(heightCss.substr(0, heightCss.length - 2)) + 89;
this.$refs.itemIntroDetail.style.height = heightCss + 'px';
},
changePageNum (val) {
changePageNum (val) { //
this.commentParams.pageNumber = val;
this.getList();
},
changePageSize (val) {
changePageSize (val) { //
this.commentParams.pageNumber = 1;
this.commentParams.pageSize = val;
this.getList();
@ -155,12 +151,12 @@ export default {
}
});
},
searchByGrade (grade) {
viewByGrade (grade) { //
this.$set(this.commentParams, 'grade', grade);
this.commentParams.pageNumber = 1;
this.getList();
},
tabClick (name) {
tabClick (name) { // tab
if (name === 0) {
this.$nextTick(() => {
this.changeHeight('itemIntroGoods')
@ -198,7 +194,7 @@ export default {
}
}
},
handleScroll () {
handleScroll () { //
if (this.onceFlag) {
this.$nextTick(() => {
this.changeHeight('itemIntroGoods')
@ -208,15 +204,12 @@ export default {
}
},
mounted () {
this.$nextTick(() => {
this.$nextTick(() => { //
setTimeout(this.changeHeight('itemIntroGoods'), 2000);
});
window.addEventListener('scroll', this.handleScroll)
this.getList();
},
components: {
ShowGoodsQuestion
}
};
</script>
@ -283,14 +276,12 @@ export default {
}
.item-intro-detail{
margin: 0 30px;
// min-height: 1500px;
width: 100%;
}
.item-intro-nav{
width: 100%;
height: 38px;
background-color: #F7F7F7;
// border-bottom: 1px solid $theme_color;
}
.item-intro-nav ul{
margin: 0px;
@ -329,8 +320,6 @@ export default {
width: 240px;
height: 36px;
font-size: 14px;
/* text-align: center; */
/* background-color: #ccc; */
}
.item-param-title {
color: #232323;

View File

@ -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>

View File

@ -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>

View File

@ -25,7 +25,6 @@
</li>
</ul>
<ul class="detail">
<!-- <li class="first hover-pointer" @click="handleClickTheme()"></li> -->
<li class="first" v-show="!userInfo.username">
<router-link :to="`/login?rePath=${$route.path}&query=${JSON.stringify($route.query)}`">
<span style="border:none" class="tipsLogin">请登录</span>
@ -148,31 +147,22 @@ export default {
}
},
methods: {
handleClickTheme () {
this.themeType === 'light'
? (this.themeType = 'dark')
: (this.themeType = 'light');
window.document.documentElement.setAttribute(
'data-theme',
this.themeType
);
},
changeCity (city) {
changeCity (city) { //
this.city = city;
},
goToPay () {
goToPay () { //
let url = this.$router.resolve({
path: '/cart'
})
window.open(url.href, '_blank')
},
myInfo () {
myInfo () { //
let url = this.$router.resolve({
path: '/home'
})
window.open(url.href, '_blank')
},
signOutFun () {
signOutFun () { // 退
storage.removeItem('accessToken');
storage.removeItem('refreshToken');
storage.removeItem('userInfo');

View File

@ -20,7 +20,7 @@ export default {
}
},
computed: {
storeDetail () {
storeDetail () { //
return this.detail;
}
}

View File

@ -23,7 +23,7 @@ export default {
}
},
methods: {
goCartList () {
goCartList () { //
let routerUrl = this.$router.resolve({
path: '/cart'
})

View File

@ -67,14 +67,14 @@ export default {
};
},
methods: {
getArticleList () {
getArticleList () { //
articleList(this.params).then(res => {
if (res.success) {
this.articleList = res.result.records
}
})
},
goArticle (id) {
goArticle (id) { //
let routeUrl = this.$router.resolve({
path: '/article',
query: {id}

View File

@ -32,7 +32,6 @@ export default {
options: this.data.options //
};
},
methods: {}
};
</script>
<style lang="scss" scoped>

View File

@ -50,9 +50,8 @@ export default {
this.$emit('content', val);
}
},
mounted () {},
methods: {
changeCurr (index) {
changeCurr (index) { //
this.currentIndex = index;
}
}

View File

@ -71,7 +71,7 @@ export default {
};
},
watch: {
diffSeconds (val) {
diffSeconds (val) { //
const hours = Math.floor(val / 3600);
// / 60
// 3600 / 60 = 60

View File

@ -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) => { // 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

@ -63,7 +63,8 @@ export default {
pageNumber: 1,
pageSize: 20,
pointsGoodsCategoryId: ''
}
},
total: 0 //
}
},
mounted () {
@ -76,6 +77,7 @@ export default {
pointGoods(this.params).then(res => {
if (res.success) {
this.goodsList = res.result.records
this.total = res.result.total
}
})
},
@ -94,7 +96,7 @@ export default {
goGoodsDetail (skuId, goodsId) { //
let routerUrl = this.$router.resolve({
path: '/goodsDetail',
query: {skuId, goodsId}
query: {skuId, goodsId, way: 'POINT'}
})
window.open(routerUrl.href, '_blank')
},