|
|
@@ -1,29 +1,16 @@
|
|
|
<template>
|
|
|
<div class="user-content mobile-content">
|
|
|
- <div class="user-name">
|
|
|
- <img src="/images/component/default.png"/>
|
|
|
- <div class="user-info">
|
|
|
- <p v-text="userInfo.data.userName"></p>
|
|
|
- <p>
|
|
|
- <span class="en-name">{{enterpriseInfo.enName}}</span>
|
|
|
- <a @click="setShowEnterpriseToggle(!showEnterpriseToggle, $event)">切换</a>
|
|
|
- <span class="vir">|</span>
|
|
|
- <a class="exit" @click="showLogout = true">退出</a>
|
|
|
- </p>
|
|
|
- <ul class="en-list" v-show="showEnterpriseToggle">
|
|
|
- <li class="menu-item"
|
|
|
- v-for="en in sortEnterprises"
|
|
|
- v-if="en.uu != enterpriseInfo.uu"
|
|
|
- v-bind:key="en.uu">
|
|
|
- <a @click="switchEnterprise(en)">{{ en.enName }}</a>
|
|
|
- </li>
|
|
|
- <li class="menu-item" v-if="enterpriseInfo.uu">
|
|
|
- <a @click="switchEnterprise({uu: 0})"><span v-text="userInfo.data.userName"></span>(个人账户)</a>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
- <a v-if="isVendor" v-text="userType === 'saler' ? '切换至买家中心' : '切换至卖家中心'" @click="switchType"></a>
|
|
|
+ <user-header @switchEnAction="onSwitchEn" :isShow="false"></user-header>
|
|
|
+
|
|
|
+ <div class="seek-area" v-if="userType != 'saler'">
|
|
|
+ <img src="/images/mobile/@2x/banner.jpg" alt="">
|
|
|
+ <p class="sa-title inline-block">我要求购 <span>满足你所需</span>
|
|
|
+ <br/>
|
|
|
+ <span class="sa-text">让订单飞起来</span>
|
|
|
+ </p>
|
|
|
+ <a class="sa-pub" @click="goSayPrice">发布求购</a>
|
|
|
</div>
|
|
|
+
|
|
|
<ul class="switch-list" v-if="userType !== 'saler'">
|
|
|
<li :class="{active: activeType == 'seek'}" @click="activeType = 'seek'" v-text="userType === 'saler' ? '求购询价' : '我的求购'"></li>
|
|
|
<li :class="{active: activeType == 'comp'}" @click="activeType = 'comp'">器件收藏</li>
|
|
|
@@ -53,7 +40,11 @@
|
|
|
<i class="iconfont icon-sousuo"></i>
|
|
|
</span>
|
|
|
</div>
|
|
|
- <seek-list :userType="userType" :seekType="seekType" :purchaseManList="purchaseManListData" :isDataChange="isDataChange"></seek-list>
|
|
|
+ <seek-list v-if="!(userType == 'saler' && seekType == 'wait' && !purchaseManListData.length)" :userType="userType" :seekType="seekType" :purchaseManList="purchaseManListData" :isDataChange="isDataChange"></seek-list>
|
|
|
+ <div class="com-none-state" v-else>
|
|
|
+ <img src="/images/mobile/@2x/car@2x.png">
|
|
|
+ <p>上传物料至个人物料库,可获得更多的商机哦!</p>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<!-- /end 买家中心 我的求购 -->
|
|
|
|
|
|
@@ -82,6 +73,7 @@
|
|
|
<p>品牌:<span>{{item.componentinfo.brand.nameCn}}</span></p>
|
|
|
<p>产品描述:<span>{{item.componentinfo.kind.nameCn}}</span></p>
|
|
|
<i class="iconfont icon-shoucang" @click="cancelFocus('product', item, $event)"></i>
|
|
|
+ <a class="sa-pub" @click="compInquiry(item, $event)">立即询价</a>
|
|
|
</div>
|
|
|
</a>
|
|
|
</div>
|
|
|
@@ -358,13 +350,16 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- /end 企业产品库 查看信息 -->
|
|
|
+ <publish-seek :showSayPriceBox="showSayPriceBox" @cancelAction="showSayPriceBox = false" @reloadAction="onPublishFinish" @remindAction="onRemind"></publish-seek>
|
|
|
+ <publish-supplier-seek :product="componentSeekObj" :showPublishBox="showPublishBox" @cancelAction="showPublishBox = false" @remindAction="onRemind"></publish-supplier-seek>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import SeekList from '~components/mobile/applyPurchase/SeekList.vue'
|
|
|
- import {RemindBox, Loading} from '~components/mobile/common'
|
|
|
+ import {RemindBox, Loading, userHeader} from '~components/mobile/common'
|
|
|
import PageLoading from '~components/common/loading/PageLoading.vue'
|
|
|
+ import { PublishSeek, PublishSupplierSeek } from '~components/mobile/applyPurchase'
|
|
|
export default {
|
|
|
layout: 'mobile',
|
|
|
middleware: 'authenticated',
|
|
|
@@ -388,7 +383,6 @@
|
|
|
seekSize: 10,
|
|
|
purchaseManListData: [],
|
|
|
isDataChange: false,
|
|
|
- showEnterpriseToggle: false,
|
|
|
providerType: 'enterprise',
|
|
|
GetEnterpriseListData: [],
|
|
|
isUploadpro: 1, // 是否存在已上架信息
|
|
|
@@ -397,14 +391,26 @@
|
|
|
vendorlist: [], // 查看更多信息
|
|
|
showMoreinfn: false, // 是否打开更多信息
|
|
|
chooseItem: {},
|
|
|
- showLogout: false // 退出登录提示框
|
|
|
+ showLogout: false, // 退出登录提示框,
|
|
|
+ showSayPriceBox: false, // 发布求购框
|
|
|
+ componentSeekObj: {
|
|
|
+ standard: 1,
|
|
|
+ cmpCode: '',
|
|
|
+ pbranden: '',
|
|
|
+ spec: null,
|
|
|
+ kind: ''
|
|
|
+ },
|
|
|
+ showPublishBox: false
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
RemindBox,
|
|
|
SeekList,
|
|
|
PageLoading,
|
|
|
- Loading
|
|
|
+ Loading,
|
|
|
+ userHeader,
|
|
|
+ PublishSeek,
|
|
|
+ PublishSupplierSeek
|
|
|
},
|
|
|
fetch ({ store, route }) {
|
|
|
let user = store.state.option.user.data
|
|
|
@@ -427,15 +433,18 @@
|
|
|
return Promise.all([
|
|
|
store.dispatch('product/saveStores', { count: 100, page: 1, type: 'component' }),
|
|
|
store.dispatch('shop/StoreFocusPage', { count: 100, page: 1 }),
|
|
|
- store.dispatch(route.query.type === 'saler' ? 'applyPurchase/loadVendorPushList' : 'applyPurchase/loadBuyerUnSayPricePurchaseManList', params),
|
|
|
- store.dispatch('loadStoreStatus', { op: 'check' })
|
|
|
+ store.dispatch(route.query.type === 'saler' ? 'applyPurchase/loadVendorPushList' : 'applyPurchase/loadBuyerUnSayPricePurchaseManList', params)
|
|
|
])
|
|
|
},
|
|
|
watch: {
|
|
|
'$route.query': {
|
|
|
handler: function (val, old) {
|
|
|
this.switchSeek('wait')
|
|
|
- }
|
|
|
+ if (val.type === 'saler' && !this.shopuuid.uuid) {
|
|
|
+ this.$store.dispatch('loadStoreStatus', { op: 'check' })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
},
|
|
|
'activeType': {
|
|
|
handler: function (val, old) {
|
|
|
@@ -454,32 +463,17 @@
|
|
|
mounted: function () {
|
|
|
this.$nextTick(() => {
|
|
|
window.addEventListener('scroll', this.scroll, false)
|
|
|
- document.body.addEventListener('click', () => {
|
|
|
- this.setShowEnterpriseToggle(false)
|
|
|
- }, false)
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
- // 切换当前企业
|
|
|
- switchEnterprise (en) {
|
|
|
- this.showEnterpriseToggle = false
|
|
|
- this.$http.get(`/user/authentication/${en.uu}`).then(() => {
|
|
|
+ onSwitchEn: function () {
|
|
|
+ if (this.$route.query.type === 'saler' && !this.user.data.enterprise.uu) {
|
|
|
+ this.$router.push('/')
|
|
|
+ } else {
|
|
|
this.isChange = true
|
|
|
- this.$store.dispatch('loadUserInfo').then(() => {
|
|
|
- if (this.userType === 'saler') {
|
|
|
- this.$router.push('/mobile/user?type=buyer')
|
|
|
- } else {
|
|
|
- this.reloadData()
|
|
|
- }
|
|
|
- })
|
|
|
+ this.reloadData()
|
|
|
this.$store.dispatch('loadStoreStatus', { op: 'check' })
|
|
|
- })
|
|
|
- },
|
|
|
- setShowEnterpriseToggle (flag, e) {
|
|
|
- if (e) {
|
|
|
- e.stopPropagation()
|
|
|
}
|
|
|
- this.showEnterpriseToggle = flag
|
|
|
},
|
|
|
cancelFocus: function (type, item, event) {
|
|
|
event.stopPropagation()
|
|
|
@@ -757,6 +751,33 @@
|
|
|
window.location.href = response.data.logoutUrl + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+ goSayPrice: function () {
|
|
|
+ if (this.user.logged) {
|
|
|
+ this.showSayPriceBox = true
|
|
|
+ } else {
|
|
|
+ this.showLoginBox = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onRemind: function (str) {
|
|
|
+ this.collectResult = str
|
|
|
+ this.timeoutCount ++
|
|
|
+ },
|
|
|
+ onPublishFinish: function () {
|
|
|
+ this.isChange = true
|
|
|
+ this.seekPage = 1
|
|
|
+ this.reloadData()
|
|
|
+ },
|
|
|
+ compInquiry: function (item, e) {
|
|
|
+ if (e) {
|
|
|
+ e.stopPropagation()
|
|
|
+ }
|
|
|
+ this.componentSeekObj.cmpCode = item.componentinfo.code
|
|
|
+ this.componentSeekObj.pbranden = item.componentinfo.brand.nameCn
|
|
|
+ this.componentSeekObj.spec = null
|
|
|
+ this.componentSeekObj.kind = item.componentinfo.kind.nameCn
|
|
|
+ this.componentSeekObj = JSON.parse(JSON.stringify(this.componentSeekObj))
|
|
|
+ this.showPublishBox = true
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -866,6 +887,16 @@
|
|
|
<style scoped lang="scss">
|
|
|
.user-content{
|
|
|
margin-bottom: .98rem;
|
|
|
+ .sa-pub {
|
|
|
+ display: inline-block;
|
|
|
+ width: 1.41rem;
|
|
|
+ height: .47rem;
|
|
|
+ line-height: .47rem;
|
|
|
+ text-align: center;
|
|
|
+ color: #fff;
|
|
|
+ background: #3f84f6;
|
|
|
+ border-radius: .14rem;
|
|
|
+ }
|
|
|
.none-state{
|
|
|
text-align: center;
|
|
|
padding:1.5rem 0;
|
|
|
@@ -1082,7 +1113,7 @@
|
|
|
display:block;
|
|
|
position:absolute;
|
|
|
top:.2rem;
|
|
|
- right:.1rem;
|
|
|
+ right:.4rem;
|
|
|
font-size:.5rem;
|
|
|
color:#ff7800;
|
|
|
width: .6rem;
|
|
|
@@ -1090,6 +1121,11 @@
|
|
|
line-height: .6rem;
|
|
|
text-align: center;
|
|
|
}
|
|
|
+ .sa-pub {
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ bottom: .2rem;
|
|
|
+ }
|
|
|
}
|
|
|
div.active{
|
|
|
background: #d4d;
|
|
|
@@ -1175,6 +1211,39 @@
|
|
|
line-height: .46rem;
|
|
|
}
|
|
|
}
|
|
|
+ .seek-area {
|
|
|
+ height: 1.26rem;
|
|
|
+ line-height: 1.26rem;
|
|
|
+ border-top: .19rem solid #f6f5f5;
|
|
|
+ border-bottom: .19rem solid #f6f5f5;
|
|
|
+ overflow: hidden;
|
|
|
+ /*padding: .32rem 0;*/
|
|
|
+ img {
|
|
|
+ height: .78rem;
|
|
|
+ margin-right: .2rem;
|
|
|
+ vertical-align: top;
|
|
|
+ margin-top: .1rem;
|
|
|
+ }
|
|
|
+ .sa-title {
|
|
|
+ font-size: .38rem;
|
|
|
+ color: #3f84f6;
|
|
|
+ line-height: .32rem;
|
|
|
+ vertical-align: top;
|
|
|
+ margin-top: .1rem;
|
|
|
+ span {
|
|
|
+ color: #494949;
|
|
|
+ }
|
|
|
+ .sa-text {
|
|
|
+ font-size: .26rem;
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .sa-pub {
|
|
|
+ margin-left: .86rem;
|
|
|
+ vertical-align: top;
|
|
|
+ margin-top: .23rem;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
.providerList {
|
|
|
border-top: 1px solid #e0e0e4;
|
|
|
@@ -1217,7 +1286,7 @@
|
|
|
}
|
|
|
}
|
|
|
.person-flag {
|
|
|
- width: .55rem;
|
|
|
+ width: .75rem;
|
|
|
position: absolute;
|
|
|
right: 0;
|
|
|
}
|