|
|
@@ -6,7 +6,7 @@
|
|
|
<span style="line-height: 34px;">产品分类</span>
|
|
|
</div>
|
|
|
<div class="category-content">
|
|
|
- <el-tree :data="kinds" :props="defaultProps" :default-expanded-keys="[0]" node-key="level" accordion :highlight-current="true" @current-change="handlerCurrentNode"></el-tree>
|
|
|
+ <el-tree :data="kinds" :props="defaultProps" :default-expanded-keys="[0]" node-key="level" accordion :highlight-current="true" @node-expand="handlerCurrentNode" @node-collapse="onNodeCollapse"></el-tree>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 产品列表 -->
|
|
|
@@ -44,9 +44,10 @@
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody id="goodslist-content">
|
|
|
- <tr v-for="commodity in commodities.content" @click="goBatchDetail(storeInfo.uuid, commodity.batchCode)">
|
|
|
+ <tr v-for="commodity in commodities.content" @click="goBatchDetail(commodity.batchCode)">
|
|
|
<td class="brand-code">
|
|
|
<img class="sellout-store-commodity" v-if="commodity.status === 602" src="/images/search/sellout-search.png" alt="">
|
|
|
+ <img class="specific-price-tag" v-if="isSpecificPriceTag(commodity.tag) && isConsignment" src="/images/floor/specificPrice-store.png" alt="">
|
|
|
<div class="brand" v-if="commodity.brandNameEn || commodity.brandEn">
|
|
|
<a v-if="commodity.brandNameEn && commodity.branduuid" @click="goBrandDetail('/product/brand/' + commodity.branduuid, $event)" v-text="commodity.brandNameEn"></a>
|
|
|
<span v-if="commodity.brandNameEn && !commodity.branduuid" v-text="commodity.brandNameEn"></span>
|
|
|
@@ -126,10 +127,13 @@
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
- <div style="float: right;">
|
|
|
- <page :total="commodities.totalElements" :page-size="pageParams.count"
|
|
|
- :current="pageParams.page" @childEvent="handleCurrentChange"></page>
|
|
|
+ <div class="remind-area">
|
|
|
+ <img src="/images/store/store-remind.png" alt="">
|
|
|
+ 所有报价、库存信息的真实性及准确性均由店铺负责,如有疑问请点击
|
|
|
+ <a @click="goWebChat()" class="link-seller">联系卖家</a>
|
|
|
</div>
|
|
|
+ <page :total="commodities.totalElements" :page-size="pageParams.count"
|
|
|
+ :current="pageParams.page" @childEvent="handleCurrentChange"></page>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -211,9 +215,21 @@ export default {
|
|
|
},
|
|
|
storeInfo () {
|
|
|
return this.$store.state.shop.storeInfo.store.data
|
|
|
+ },
|
|
|
+ user () {
|
|
|
+ return this.$store.state.option.user
|
|
|
+ },
|
|
|
+ tab () {
|
|
|
+ return this.$store.state.chat.tab.tab.data
|
|
|
+ },
|
|
|
+ isConsignment () {
|
|
|
+ return this.storeInfo.type === 'CONSIGNMENT'
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ isSpecificPriceTag: function (tag) {
|
|
|
+ return tag && tag.indexOf('特价') !== -1
|
|
|
+ },
|
|
|
handlerCurrentNode (data, node) {
|
|
|
this.searchCode = ''
|
|
|
if (this.parentKindId === data.id) {
|
|
|
@@ -229,6 +245,9 @@ export default {
|
|
|
|
|
|
this.pageCommodity(this.pageParams, this.ids)
|
|
|
},
|
|
|
+ onNodeCollapse () {
|
|
|
+ this.parentKindId = ''
|
|
|
+ },
|
|
|
goodsSearch (keyword) {
|
|
|
this.pageParams.page = 1
|
|
|
this.pageCommodity(this.pageParams, this.ids, keyword)
|
|
|
@@ -255,12 +274,74 @@ export default {
|
|
|
this.pageParams.page = page
|
|
|
this.pageCommodity(this.pageParams, this.ids, this.searchCode)
|
|
|
},
|
|
|
- goBatchDetail (storeId, batchCode) {
|
|
|
- window.open('/store/' + storeId + '/' + batchCode)
|
|
|
+ goBatchDetail (batchCode) {
|
|
|
+ window.open('/store/productDetail/' + batchCode)
|
|
|
},
|
|
|
goBrandDetail (url, event) {
|
|
|
event.stopPropagation()
|
|
|
window.open(url)
|
|
|
+ },
|
|
|
+ goWebChat: function () {
|
|
|
+ if (!this.user.logged) {
|
|
|
+ this.$http.get('/login/page').then(response => {
|
|
|
+ if (response.data) {
|
|
|
+ this.$router.push('/auth/login')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ // 获得窗口的垂直位置
|
|
|
+ let iTop = (window.screen.availHeight - 30 - 780) / 2
|
|
|
+ // 获得窗口的水平位置
|
|
|
+ let iLeft = (window.screen.availWidth - 10 - 1030) / 2
|
|
|
+ if (this.tab.close) {
|
|
|
+ this.tab.close()
|
|
|
+ }
|
|
|
+ let newTab = window.open('', '即时对话框', 'height=750, width=1000, top=' + iTop + ', left=' + iLeft + ', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no')
|
|
|
+ newTab.close()
|
|
|
+ newTab = window.open('', '即时对话框', 'height=750, width=1000, top=' + iTop + ', left=' + iLeft + ', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no')
|
|
|
+ this.$store.dispatch('chat/setChatTab', {tab: newTab})
|
|
|
+ this.$http.get('/basic/enterprise/' + this.storeInfo.enUU + '/info')
|
|
|
+ .then(response => {
|
|
|
+ let obj = {}
|
|
|
+ obj.userPhone = this.user.data.userTel
|
|
|
+ obj.userType = 'ENTERPRISE'
|
|
|
+ this.user.data.enterprises.forEach(function (item, index) {
|
|
|
+ if (item.current) {
|
|
|
+ obj.enUU = item.uu
|
|
|
+ obj.enterprise = {enUU: item.uu, name: item.enName}
|
|
|
+ }
|
|
|
+ })
|
|
|
+ obj.otherEnUU = response.data.uu
|
|
|
+ obj.otherUserType = 'STORE'
|
|
|
+ obj.otherEnterprise = {enUU: response.data.uu, name: response.data.enName}
|
|
|
+ obj.type = 'CHAT'
|
|
|
+ if (!(/^1\d{10}$/).test(response.data.enTel)) {
|
|
|
+ this.$http.get('/basic/enterprise/' + response.data.uu + '/admin').then(response => {
|
|
|
+ console.log(response)
|
|
|
+ obj.toPhone = response.data.userTel
|
|
|
+ console.log(obj)
|
|
|
+ this.openWebChat(newTab, obj)
|
|
|
+ }, err => {
|
|
|
+ console.log(err)
|
|
|
+ this.$message.error('暂无卖家管理员手机号!')
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ obj.toPhone = response.data.enTel
|
|
|
+ console.log(obj)
|
|
|
+ this.openWebChat(newTab, obj)
|
|
|
+ }
|
|
|
+ }, err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ openWebChat: function (newTab, obj) {
|
|
|
+ this.$http.post('https://im.ubtob.com/api/chat/infos?condition=chat_info', obj)
|
|
|
+ .then(response => {
|
|
|
+ if (response.data.success) {
|
|
|
+ newTab.location.href = 'https://im.ubtob.com/chat/visit?gid=' + response.data.content
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
// goBack () {
|
|
|
// this.$router.back(-1)
|
|
|
@@ -481,6 +562,11 @@ export default {
|
|
|
position: absolute;
|
|
|
right: 0;
|
|
|
bottom: 0;
|
|
|
+ }
|
|
|
+ #goods-list-fragment .goodslist tbody>tr td.brand-code .specific-price-tag {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
}
|
|
|
#goods-list-fragment .goodslist td {
|
|
|
font-size: 12px;
|
|
|
@@ -560,7 +646,7 @@ export default {
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
.goodslist{
|
|
|
- margin-bottom: 16px;
|
|
|
+ margin-bottom: 11px;
|
|
|
}
|
|
|
|
|
|
@font-face {
|
|
|
@@ -577,4 +663,24 @@ export default {
|
|
|
border-color: #5078cb !important;
|
|
|
background-color: #5078cb !important;
|
|
|
}
|
|
|
+
|
|
|
+ .remind-area {
|
|
|
+ font-size: 12px;
|
|
|
+ color: #666;
|
|
|
+ }
|
|
|
+ .remind-area img {
|
|
|
+ margin-right: 12px;
|
|
|
+ }
|
|
|
+ .remind-area .link-seller {
|
|
|
+ font-size: 12px;
|
|
|
+ color: #fff;
|
|
|
+ line-height: 20px;
|
|
|
+ height: 20px;
|
|
|
+ padding: 0 7px;
|
|
|
+ background: #ef7f03;
|
|
|
+ border-radius: 2px;
|
|
|
+ }
|
|
|
+ #goods-list-fragment .goods-area .page-wrap {
|
|
|
+ margin-top: 18px;
|
|
|
+ }
|
|
|
</style>
|