优化代码

This commit is contained in:
java110 2020-10-26 18:23:18 +08:00
parent 74b2dedce8
commit 343f7f507e
7 changed files with 140 additions and 3 deletions

View File

@ -0,0 +1,96 @@
<template>
<scroll-view @scrolltolower="lower" class="scroll-restaurants-list" scroll-y="true" style="height:100%">
<swiper class="categoryList padding-top-xs margin-top-sm bg-white" indicator-dots="true" indicator-color="rgba(228,228,228,1)"
indicator-active-color="#FECA49">
<block v-for="(item, index) in categoryList" :key="index">
<swiper-item>
<block v-for="(item, index2) in item" :key="index2">
<view class="category-info" v-if="item.href != 'callProperty'">
<navigator @tap="toPage(item.href)">
<image :src="item.src" class="category-image"></image>
<view class="category-text">{{item.name}}</view>
</navigator>
</view>
<view class="category-info" v-if="item.href == 'callProperty'">
<view @tap="callPropertyTel()">
<image :src="item.src" class="category-image"></image>
<view class="category-text">{{item.name}}</view>
</view>
</view>
</block>
</swiper-item>
</block>
</swiper>
</scroll-view>
</template>
<script>
export default {
data() {
return {
categoryList: {}
}
},
mounted() {
this.getCategorys();
},
methods: {
toPage: function(pageUrl) {
uni.navigateTo({
url:pageUrl
})
},
getCategorys: function() {
this.categoryList = {
pageone: [{
name: "跳蚤市场",
src: "/static/images/mall_market.png",
href: "/pages/market/market"
}, {
name: "品质拼团",
src: "/static/images/mall_groupBuy.png",
href: "/pages/payParkingFeeList/payParkingFeeList"
}, {
name: "限时秒杀",
src: "/static/images/mall_secKill.png",
href: "/pages/complaint/complaint"
}, {
name: "家政服务",
src: "/static/images/mall_secKill.png",
href: "/pages/complaint/complaint"
}]
};
}
}
}
</script>
<style>
.categoryList {
width: 100%;
height: 360upx;
border-bottom: 20rpx solid #f4f4f4;
}
.category-image {
width: 80rpx;
height: 80rpx;
}
.category-text {
font-size: 25rpx;
width: 100%;
/* line-height: 30rpx */
}
.category-info {
display: inline-block;
text-align: center;
position: relative;
margin-top: 20rpx;
height: 130rpx;
width: 25%;
}
</style>

View File

@ -359,6 +359,12 @@
"navigationBarTitleText": "租房预约"
}
}
,{
"path" : "pages/mall/mall",
"style" : {
"navigationBarTitleText": "商圈"
}
}
],
"tabBar": {
"color": "#272636",
@ -378,8 +384,8 @@
"selectedIconPath": "static/images/rent-selected.png"
},
{
"pagePath": "pages/market/market",
"text": "市场",
"pagePath": "pages/mall/mall",
"text": "商圈",
"iconPath": "static/images/market.png",
"selectedIconPath": "static/images/market-selected.png"
},

35
pages/mall/mall.vue Normal file
View File

@ -0,0 +1,35 @@
<template>
<view>
<view class="cu-bar search bg-white">
<view class="search-form round">
<text class="cuIcon-search"></text>
<input :adjust-position="false" v-model="communityName" type="text" placeholder="请输入商品名" confirm-type="search"></input>
</view>
</view>
<vc-category></vc-category>
</view>
</template>
<script>
import vcCategory from '@/components/vc-category/vc-category.vue'
export default {
data() {
return {
}
},
components:{
vcCategory
},
methods: {
}
}
</script>
<style>
</style>

View File

@ -35,7 +35,7 @@
};
},
components:{jyfParser}
components:{jyfParser},
onLoad: function(options) {
context.onLoad(options);

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB