|
|
@@ -10,15 +10,16 @@
|
|
|
<van-sticky>
|
|
|
<div class="top">
|
|
|
<div class="tabs">
|
|
|
- <div
|
|
|
- class="tab"
|
|
|
- @click="chooseTab(item.key)"
|
|
|
- :class="{ active: type === item.key }"
|
|
|
- v-for="item in productListType"
|
|
|
- :key="item.key"
|
|
|
+ <block v-for="(item, index) in productListType" :key="index">
|
|
|
+ <div
|
|
|
+ class="tab"
|
|
|
+ v-if="!(noOwn && item.key === 'OWN_PRODUCT')"
|
|
|
+ @click="chooseTab(item.key)"
|
|
|
+ :class="{ active: type === item.key }"
|
|
|
+ >
|
|
|
+ {{ $t(item.name) }}
|
|
|
+ </div></block
|
|
|
>
|
|
|
- {{ $t(item.name) }}
|
|
|
- </div>
|
|
|
</div>
|
|
|
|
|
|
<!-- <van-button size="small" :color="$colors.warn" plain>编辑</van-button> -->
|
|
|
@@ -35,8 +36,18 @@
|
|
|
<div class="order-list">
|
|
|
<order v-for="(item, index) in list" :index="index" :key="item.id" :info="item"></order>
|
|
|
</div>
|
|
|
- <template slot="emptyButton">
|
|
|
+ <fixed-button v-if="!empty && !(isVendor && type === 'OWN_PRODUCT')">
|
|
|
<van-button block :color="$colors.warn" @click="navigateTo('/pagesMine/OrderDetail?type=' + type)">
|
|
|
+ 新增
|
|
|
+ </van-button>
|
|
|
+ </fixed-button>
|
|
|
+ <template slot="emptyButton">
|
|
|
+ <van-button
|
|
|
+ v-if="!(isVendor && type === 'OWN_PRODUCT')"
|
|
|
+ block
|
|
|
+ :color="$colors.warn"
|
|
|
+ @click="navigateTo('/pagesMine/OrderDetail?type=' + type)"
|
|
|
+ >
|
|
|
{{ $t('xin-zeng') }}
|
|
|
</van-button>
|
|
|
</template>
|
|
|
@@ -49,8 +60,9 @@ import searchList from '../mixins/searchList';
|
|
|
import SortList from '../components/SortList.vue';
|
|
|
import { mapState } from 'vuex';
|
|
|
import Order from '../components/Order.vue';
|
|
|
+import FixedButton from '../components/FixedButton.vue';
|
|
|
export default {
|
|
|
- components: { SortList, Order },
|
|
|
+ components: { SortList, Order, FixedButton },
|
|
|
data() {
|
|
|
return {
|
|
|
url: '/productList/all',
|
|
|
@@ -59,7 +71,9 @@ export default {
|
|
|
header: {
|
|
|
'Content-Type': 'application/json'
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ isVendor: false,
|
|
|
+ noOwn: false
|
|
|
};
|
|
|
},
|
|
|
mixins: [searchList],
|
|
|
@@ -77,7 +91,8 @@ export default {
|
|
|
return {
|
|
|
query: {
|
|
|
userId: this.userInfo ? this.userInfo.id : '',
|
|
|
- type: this.type
|
|
|
+ type: this.type,
|
|
|
+ del: false
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
@@ -88,9 +103,19 @@ export default {
|
|
|
onShow() {
|
|
|
const app = getApp();
|
|
|
if (app.globalData.initialize) {
|
|
|
+ if (this.$store.state.userInfo.identity !== 'BUYERS') {
|
|
|
+ this.isVendor = true;
|
|
|
+ } else {
|
|
|
+ this.isVendor = false;
|
|
|
+ }
|
|
|
this.getData();
|
|
|
} else {
|
|
|
app.globalData.initializeCallback = () => {
|
|
|
+ if (this.$store.state.userInfo.identity !== 'BUYERS') {
|
|
|
+ this.isVendor = true;
|
|
|
+ } else {
|
|
|
+ this.isVendor = false;
|
|
|
+ }
|
|
|
this.getData();
|
|
|
};
|
|
|
}
|
|
|
@@ -106,6 +131,12 @@ export default {
|
|
|
this.type = type;
|
|
|
this.refreash();
|
|
|
}
|
|
|
+ },
|
|
|
+ endLoading() {
|
|
|
+ if (this.empty && this.type === 'OWN_PRODUCT' && this.isVendor) {
|
|
|
+ this.chooseTab('REQUIRED_PRODUCT');
|
|
|
+ this.noOwn = true;
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
onReachBottom() {
|