添加新品页面
This commit is contained in:
parent
68383c9beb
commit
2941176f64
30
pages.json
30
pages.json
@ -39,6 +39,17 @@
|
||||
"navigationBarTitleText": "店铺街"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/new_goods/index",
|
||||
"name": "new_goods",
|
||||
"meta": {
|
||||
"auth": false,
|
||||
"keepScroll": true
|
||||
},
|
||||
"style": {
|
||||
"navigationBarTitleText": "新品"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/community/community",
|
||||
"name": "community",
|
||||
@ -85,6 +96,7 @@
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/login/login",
|
||||
"meta": {
|
||||
@ -1207,18 +1219,24 @@
|
||||
"selectedIconPath": "/static/images/tab_home_s.png",
|
||||
"text": "首页"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/goods_cate/goods_cate",
|
||||
"iconPath": "/static/images/tab_sort.png",
|
||||
"selectedIconPath": "/static/images/tab_sort_s.png",
|
||||
"text": "分类"
|
||||
},
|
||||
// {
|
||||
// "pagePath": "pages/goods_cate/goods_cate",
|
||||
// "iconPath": "/static/images/tab_sort.png",
|
||||
// "selectedIconPath": "/static/images/tab_sort_s.png",
|
||||
// "text": "分类"
|
||||
// },
|
||||
// {
|
||||
// "pagePath": "pages/community/community",
|
||||
// "iconPath": "/static/images/tab-community.png",
|
||||
// "selectedIconPath": "/static/images/tab-community_s.png",
|
||||
// "text": "种草"
|
||||
// },
|
||||
{
|
||||
"pagePath": "pages/new_goods/index",
|
||||
"iconPath": "/static/images/tab_new.png",
|
||||
"selectedIconPath": "/static/images/tab_new_s.png",
|
||||
"text": "新品"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/shop_cart/shop_cart",
|
||||
"iconPath": "/static/images/tab_shoppingcar.png",
|
||||
|
||||
70
pages/new_goods/index.vue
Normal file
70
pages/new_goods/index.vue
Normal file
@ -0,0 +1,70 @@
|
||||
|
||||
|
||||
<template>
|
||||
<view class="hot-list">
|
||||
<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback">
|
||||
<view class="main">
|
||||
<goods-list :list="goodsList" type="double" :price-type="price_type"></goods-list>
|
||||
</view>
|
||||
</mescroll-body>
|
||||
<tabbar></tabbar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getNewGoods
|
||||
} from '@/api/store';
|
||||
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins";
|
||||
export default {
|
||||
mixins: [MescrollMixin],
|
||||
data() {
|
||||
return {
|
||||
upOption: {
|
||||
empty: {
|
||||
icon: "https://zjeloong.oss-cn-hangzhou.aliyuncs.com/uniapp/goods_null.png",
|
||||
tip: "暂无商品~"
|
||||
}
|
||||
},
|
||||
hotList: [],
|
||||
goodsList: [],
|
||||
type: '',
|
||||
price_type: 0
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
upCallback(page) {
|
||||
let pageNum = page.num;
|
||||
let pageSize = page.size;
|
||||
const params = {
|
||||
page_no: pageNum,
|
||||
page_size: pageSize,
|
||||
p_id: this.$store.getters.hasPid,
|
||||
set: this.$store.getters.hasSetId
|
||||
}
|
||||
|
||||
params.type = 'all'
|
||||
getNewGoods(params).then(res => {
|
||||
if (res.code == 1) {
|
||||
this.price_type = 0;
|
||||
let curPageData = res.data.lists;
|
||||
let curPageLen = curPageData.length;
|
||||
let hasNext = !!res.data.more;
|
||||
if (page.num == 1) {
|
||||
this.goodsList = [];
|
||||
}
|
||||
this.goodsList = this.goodsList.concat(curPageData);
|
||||
this.mescroll.endSuccess(curPageLen, hasNext);
|
||||
}
|
||||
}).catch(err => {
|
||||
this.mescroll.endErr()
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.list-title {
|
||||
margin: 27rpx 0 30rpx;
|
||||
}
|
||||
</style>
|
||||
BIN
static/images/tab_new.png
Normal file
BIN
static/images/tab_new.png
Normal file
Binary file not shown.
BIN
static/images/tab_new_s.png
Normal file
BIN
static/images/tab_new_s.png
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user