|
|
@@ -25,7 +25,7 @@
|
|
|
<i class="iconfont icon-sousuo"></i>
|
|
|
</span>
|
|
|
</div>
|
|
|
- <seek-list :userType="userType" :seekType="seekType" :purchaseManList="purchaseManList"></seek-list>
|
|
|
+ <seek-list :userType="userType" :seekType="seekType" :purchaseManList="purchaseManListData"></seek-list>
|
|
|
</div>
|
|
|
<div class="shop-list" v-if="activeType == 'store'" v-for="item in focusPage.content" @click="goStoreDetail(item.storeInfo.uuid)">
|
|
|
<h3>{{item.storeName}}</h3>
|
|
|
@@ -35,8 +35,8 @@
|
|
|
<img :src="item.storeInfo.logoUrl || '/images/component/default.png'">
|
|
|
</div>
|
|
|
<div class="list-item-phone">
|
|
|
- <p>电话:<span>{{item.storeInfo.enterprise.enTel}}</span></p>
|
|
|
- <p>传真:<span>{{item.storeInfo.enterprise.enFax}}</span></p>
|
|
|
+ <p>电话:<span>{{item.storeInfo.enterprise ? item.storeInfo.enterprise.enTel : '-'}}</span></p>
|
|
|
+ <p>传真:<span>{{item.storeInfo.enterprise ? item.storeInfo.enterprise.enFax : '-'}}</span></p>
|
|
|
<p>联系商家:<a @click="selectStoreInfo(item, $event)">点击查看</a></p>
|
|
|
<i class="iconfont icon-shoucang" @click="cancelFocus('store', item, $event)"></i>
|
|
|
</div>
|
|
|
@@ -70,13 +70,15 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<page-loading v-show="showLoading"></page-loading>
|
|
|
+ <loading v-show="isSearchSearchingMore"></loading>
|
|
|
+ <div v-if="purchaseManList && false"></div>
|
|
|
<div v-if="purchaseManListFetching && false"></div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import SeekList from '~components/mobile/applyPurchase/SeekList.vue'
|
|
|
- import {RemindBox} from '~components/mobile/common'
|
|
|
+ import {RemindBox, Loading} from '~components/mobile/common'
|
|
|
import PageLoading from '~components/common/loading/PageLoading.vue'
|
|
|
export default {
|
|
|
layout: 'mobile',
|
|
|
@@ -93,21 +95,32 @@
|
|
|
storeInfo: {},
|
|
|
seekType: 'wait',
|
|
|
showLoading: false,
|
|
|
- seekKeyword: ''
|
|
|
+ seekKeyword: '',
|
|
|
+ isSearchSearchingMore: false,
|
|
|
+ isChange: false,
|
|
|
+ seekPage: 1,
|
|
|
+ seekSize: 10,
|
|
|
+ purchaseManListData: []
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
RemindBox,
|
|
|
SeekList,
|
|
|
- PageLoading
|
|
|
+ PageLoading,
|
|
|
+ Loading
|
|
|
},
|
|
|
fetch ({ store, route }) {
|
|
|
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/loadPurchaseManList' : 'applyPurchase/loadBuyerPurchaseManList', {pageNumber: 1, pageSize: 10, enUU: store.state.option.user.data.enterprise ? store.state.option.user.data.enterprise.uu : store.state.option.user.data.userUU})
|
|
|
+ store.dispatch(route.query.type === 'saler' ? 'applyPurchase/loadPurchaseManList' : 'applyPurchase/loadBuyerUnSayPricePurchaseManList', {pageNumber: 1, pageSize: 10, enUU: store.state.option.user.data.enterprise ? store.state.option.user.data.enterprise.uu : store.state.option.user.data.userUU})
|
|
|
])
|
|
|
},
|
|
|
+ mounted: function () {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ window.addEventListener('scroll', this.scroll, false)
|
|
|
+ })
|
|
|
+ },
|
|
|
methods: {
|
|
|
cancelFocus: function (type, item, event) {
|
|
|
event.stopPropagation()
|
|
|
@@ -163,46 +176,48 @@
|
|
|
switchSeek: function (type) {
|
|
|
this.seekType = type
|
|
|
this.showLoading = true
|
|
|
- if (this.userType !== 'saler') {
|
|
|
- if (type === 'wait') {
|
|
|
- this.$store.dispatch('applyPurchase/loadBuyerPurchaseManList', {pageNumber: 1, pageSize: 10, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null})
|
|
|
- } else if (type === 'done') {
|
|
|
- this.$store.dispatch('applyPurchase/loadBuyerPurchaseManList', {pageNumber: 1, pageSize: 10, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null, _state: 'done'})
|
|
|
- } else {
|
|
|
- this.$store.dispatch('applyPurchase/loadBuyerPurchaseManList', {pageNumber: 1, pageSize: 10, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null, _state: 'done'})
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (type === 'wait') {
|
|
|
- this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: 1, pageSize: 10, enUU: this.$store.state.option.user.data.enterprise.uu})
|
|
|
- } else if (type === 'done') {
|
|
|
- this.$store.dispatch('applyPurchase/loadVendorPurchaseManList', {pageNumber: 1, pageSize: 10, _state: 'done', filter: {vendUU: this.$store.state.option.user.data.enterprise.uu, fromDate: null, endDate: null}})
|
|
|
- } else {
|
|
|
- this.$store.dispatch('applyPurchase/loadVendorPurchaseManList', {pageNumber: 1, pageSize: 10, _state: 'done', filter: {vendUU: this.$store.state.option.user.data.enterprise.uu, fromDate: null, endDate: null}})
|
|
|
- }
|
|
|
- }
|
|
|
+ this.seekKeyword = ''
|
|
|
+ this.isChange = true
|
|
|
+ this.seekPage = 1
|
|
|
+ this.reloadData()
|
|
|
},
|
|
|
switchType: function () {
|
|
|
+ this.seekType = 'wait'
|
|
|
this.$router.push('/mobile/user' + (this.userType === 'saler' ? '' : '?type=saler'))
|
|
|
},
|
|
|
searchSeek: function () {
|
|
|
+ this.reloadData()
|
|
|
+ },
|
|
|
+ reloadData: function () {
|
|
|
let type = this.seekType
|
|
|
if (this.userType !== 'saler') {
|
|
|
if (type === 'wait') {
|
|
|
- this.$store.dispatch('applyPurchase/loadBuyerPurchaseManList', {pageNumber: 1, pageSize: 10, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null, keyword: this.seekKeyword})
|
|
|
+ this.$store.dispatch('applyPurchase/loadBuyerUnSayPricePurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null, keyword: this.seekKeyword})
|
|
|
} else if (type === 'done') {
|
|
|
- this.$store.dispatch('applyPurchase/loadBuyerPurchaseManList', {pageNumber: 1, pageSize: 10, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null, _state: 'done', keyword: this.seekKeyword})
|
|
|
+ this.$store.dispatch('applyPurchase/loadBuyerPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null, _state: 'done', keyword: this.seekKeyword})
|
|
|
} else {
|
|
|
- this.$store.dispatch('applyPurchase/loadBuyerPurchaseManList', {pageNumber: 1, pageSize: 10, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null, _state: 'done', keyword: this.seekKeyword})
|
|
|
+ this.$store.dispatch('applyPurchase/loadBuyerPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null, _state: 'done', keyword: this.seekKeyword})
|
|
|
}
|
|
|
} else {
|
|
|
if (type === 'wait') {
|
|
|
- this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: 1, pageSize: 10, enUU: this.$store.state.option.user.data.enterprise.uu, keyword: this.seekKeyword})
|
|
|
+ this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, enUU: this.$store.state.option.user.data.enterprise.uu, keyword: this.seekKeyword})
|
|
|
} else if (type === 'done') {
|
|
|
- this.$store.dispatch('applyPurchase/loadVendorPurchaseManList', {pageNumber: 1, pageSize: 10, _state: 'done', filter: {vendUU: this.$store.state.option.user.data.enterprise.uu, fromDate: null, endDate: null, keyword: this.seekKeyword}})
|
|
|
+ this.$store.dispatch('applyPurchase/loadVendorPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, _state: 'done', filter: {vendUU: this.$store.state.option.user.data.enterprise.uu, fromDate: null, endDate: null, keyword: this.seekKeyword}})
|
|
|
} else {
|
|
|
- this.$store.dispatch('applyPurchase/loadVendorPurchaseManList', {pageNumber: 1, pageSize: 10, _state: 'done', filter: {vendUU: this.$store.state.option.user.data.enterprise.uu, fromDate: null, endDate: null, keyword: this.seekKeyword}})
|
|
|
+ this.$store.dispatch('applyPurchase/loadVendorPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, _state: 'done', filter: {vendUU: this.$store.state.option.user.data.enterprise.uu, fromDate: null, endDate: null, keyword: this.seekKeyword}})
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+ scroll: function () {
|
|
|
+ let scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
|
|
|
+ if (Math.ceil(scrolled + window.screen.availHeight) >= document.body.scrollHeight && !this.isSearchSearchingMore && this.seekPage < this.allPage) {
|
|
|
+ this.getMoreSearch()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getMoreSearch: function () {
|
|
|
+ this.seekPage++
|
|
|
+ this.isSearchSearchingMore = true
|
|
|
+ this.reloadData()
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -232,12 +247,28 @@
|
|
|
focusPage () {
|
|
|
return this.$store.state.shop.storeInfo.focusPage.data
|
|
|
},
|
|
|
+ purchase () {
|
|
|
+ return this.$store.state.applyPurchase.purchaseManList.purchaseManList
|
|
|
+ },
|
|
|
purchaseManList () {
|
|
|
- return this.$store.state.applyPurchase.purchaseManList.purchaseManList.data
|
|
|
+ let list = this.purchase.data.content
|
|
|
+ if (this.isChange) {
|
|
|
+ this.purchaseManListData = []
|
|
|
+ this.seekPage = 1
|
|
|
+ this.isChange = false
|
|
|
+ } else {
|
|
|
+ this.purchaseManListData = this.purchaseManListData.concat(list)
|
|
|
+ this.isSearchSearchingMore = false
|
|
|
+ }
|
|
|
+ console.log(this.purchaseManListData)
|
|
|
+ return this.purchase.data.content
|
|
|
+ },
|
|
|
+ allPage () {
|
|
|
+ return Math.floor(this.purchase.data.totalElements / this.purchase.data.size) + Math.floor(this.purchase.data.totalElements % this.purchase.data.size > 0 ? 1 : 0)
|
|
|
},
|
|
|
purchaseManListFetching () {
|
|
|
this.showLoading = false
|
|
|
- return this.$store.state.applyPurchase.purchaseManList.purchaseManList.fetching
|
|
|
+ return this.purchase.fetching
|
|
|
}
|
|
|
}
|
|
|
}
|