Commit b3a6044e by shibukun

商品列表

parent 1f55765a
{ {
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{ {
"path" : "pages/home/home", "path": "pages/home/home",
"style" : "style": {
{
"navigationBarTitleText": "懒人企业福利社", "navigationBarTitleText": "懒人企业福利社",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }, {
,{ "path": "pages/order/order",
"path" : "pages/order/order", "style": {
"style" :
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }, {
,{ "path": "pages/mine/mine",
"path" : "pages/mine/mine", "style": {
"style" :
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "custom", "navigationStyle": "custom",
"backgroundColor":"#F5F5F5" "backgroundColor": "#F5F5F5"
} }
} }
], ],
"subPackages": [{ "subPackages": [{
"root":"pagesA", "root": "pagesA",
"pages":[ "pages": [{
{
"path": "login/login", "path": "login/login",
"style": { "style": {
"navigationBarTitleText": "登录", "navigationBarTitleText": "登录",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},{ }, {
"path" : "integral/integral", "path": "integral/integral",
"style" : "style": {
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, {
"path": "selectAccount/selectAccount",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
} }
,{
"path" : "selectAccount/selectAccount", },
"style" :
{ {
"path": "GoodSkuList/GoodSkuList",
"style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }]
]
}], }],
"preloadRule":{ "preloadRule": {
"pagesA/login/login": { "pagesA/login/login": {
"network": "all", "network": "all",
"packages": ["__APP__"] "packages": ["__APP__"]
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<view class="header-top"> <view class="header-top">
<text v-if="isLogin" class="header-name">你好,{{ name }}</text> <text v-if="isLogin" class="header-name">你好,{{ name }}</text>
<text v-else class="header-login" @click="goLogin()">请登录</text> <text v-else class="header-login" @click="goLogin()">请登录</text>
<view class="integral-detail">积分明细 ></view> <view class="integral-detail" @click="goIntegralDetail">积分明细 ></view>
</view> </view>
<view class="header-center"> <view class="header-center">
<view class="header-integral">{{ integralCount }}</view> <view class="header-integral">{{ integralCount }}</view>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</view> </view>
</view> </view>
<view class="list"> <view class="list">
<view class="item" v-for="(item, index) in brandList" :key="index"> <view class="item" v-for="(item, index) in brandList" :key="index" @click="goToGoodDetail(item.brandNo)">
<view class="item-layout"> <view class="item-layout">
<image class="icon" mode="aspectFill" :src="item.imgPath"></image> <image class="icon" mode="aspectFill" :src="item.imgPath"></image>
<view class="item-right"> <view class="item-right">
...@@ -72,6 +72,7 @@ export default { ...@@ -72,6 +72,7 @@ export default {
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
this.brandList = this.brandList.concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list); this.brandList = this.brandList.concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list);
this.page += 1
} }
this.loadingType = res.data.list.length < this.pageSize ? 'noMore' : 'more'; this.loadingType = res.data.list.length < this.pageSize ? 'noMore' : 'more';
console.log(this.loadingType) console.log(this.loadingType)
...@@ -79,12 +80,24 @@ export default { ...@@ -79,12 +80,24 @@ export default {
.catch(err => { .catch(err => {
console.log(err); console.log(err);
}); });
},
goToGoodDetail(brandNo) {
if (!this.isLogin) {
this.goLogin()
}
this.$router.push('GoodSkuList', {brandNo: brandNo})
},
goIntegralDetail() {
if (!this.isLogin) {
this.goLogin()
} }
} }
}
}; };
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.layout { .layout {
width: 100%; width: 100%;
height: 100%; height: 100%;
......
...@@ -5,7 +5,8 @@ const routers = { ...@@ -5,7 +5,8 @@ const routers = {
'Home': '/pages/home/home', 'Home': '/pages/home/home',
'Order': '/pages/order/order', 'Order': '/pages/order/order',
'Mine': '/pages/mine/mine', 'Mine': '/pages/mine/mine',
'SelectAccount': '/pagesA/selectAccount/selectAccount' 'SelectAccount': '/pagesA/selectAccount/selectAccount',
'GoodSkuList': '/pagesA/GoodSkuList/GoodSkuList'
} }
export function push(routerName, params, events) { export function push(routerName, params, events) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment