mirror of
https://gitee.com/java110/WechatOwnerService.git
synced 2026-02-23 21:36:38 +08:00
优化代码
This commit is contained in:
parent
74b2dedce8
commit
343f7f507e
96
components/vc-category/vc-category.vue
Normal file
96
components/vc-category/vc-category.vue
Normal 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>
|
||||
10
pages.json
10
pages.json
@ -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
35
pages/mall/mall.vue
Normal 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>
|
||||
@ -35,7 +35,7 @@
|
||||
};
|
||||
},
|
||||
|
||||
components:{jyfParser}
|
||||
components:{jyfParser},
|
||||
|
||||
onLoad: function(options) {
|
||||
context.onLoad(options);
|
||||
|
||||
BIN
static/images/mall_groupBuy.png
Normal file
BIN
static/images/mall_groupBuy.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.0 KiB |
BIN
static/images/mall_market.png
Normal file
BIN
static/images/mall_market.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
BIN
static/images/mall_secKill.png
Normal file
BIN
static/images/mall_secKill.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.9 KiB |
Loading…
Reference in New Issue
Block a user