|
@@ -14,6 +14,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<!-- 商品列表-end -->
|
|
<!-- 商品列表-end -->
|
|
|
|
|
+ <not-goods v-if="haveGoods" textStr="暂无商品信息"></not-goods>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
@@ -22,13 +23,15 @@ let app = getApp();
|
|
|
var appEv = app.$vm.$options;
|
|
var appEv = app.$vm.$options;
|
|
|
import { get, post } from "@/request/api.js";
|
|
import { get, post } from "@/request/api.js";
|
|
|
import uniPopup from '@/components/uni-popup/uni-popup.vue'
|
|
import uniPopup from '@/components/uni-popup/uni-popup.vue'
|
|
|
|
|
+import notGoods from "@/components/not-goods/index.vue";
|
|
|
export default {
|
|
export default {
|
|
|
- components: { uniPopup },
|
|
|
|
|
|
|
+ components: { uniPopup, notGoods },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
goods: [], // 商品列表
|
|
goods: [], // 商品列表
|
|
|
type: '',
|
|
type: '',
|
|
|
title: '',
|
|
title: '',
|
|
|
|
|
+ haveGoods: false, // 是否有商品
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onLoad(e) {
|
|
onLoad(e) {
|
|
@@ -54,7 +57,7 @@ export default {
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
let obj = res.data.data
|
|
let obj = res.data.data
|
|
|
if (page == 1) that.goods = []
|
|
if (page == 1) that.goods = []
|
|
|
- if (obj.length > 0) {
|
|
|
|
|
|
|
+ if (obj.length) {
|
|
|
obj.forEach(e => {
|
|
obj.forEach(e => {
|
|
|
that.goods.push(e)
|
|
that.goods.push(e)
|
|
|
});
|
|
});
|
|
@@ -62,8 +65,11 @@ export default {
|
|
|
page = -1;
|
|
page = -1;
|
|
|
appEv.errTips('暂无更多')
|
|
appEv.errTips('暂无更多')
|
|
|
}
|
|
}
|
|
|
|
|
+ if(page == 1 && !obj.length) this.haveGoods = true
|
|
|
|
|
+ else this.haveGoods = false
|
|
|
} else {
|
|
} else {
|
|
|
page = -1;
|
|
page = -1;
|
|
|
|
|
+ this.haveGoods = true;
|
|
|
appEv.errTips('暂无更多')
|
|
appEv.errTips('暂无更多')
|
|
|
}
|
|
}
|
|
|
|
|
|