调整首页

This commit is contained in:
wuxw 2019-11-17 10:26:53 +08:00
parent 95efa7b9bb
commit 38c2df4123
3 changed files with 42 additions and 127 deletions

View File

@ -5,62 +5,16 @@ Page({
* 页面的初始数据
*/
data: {
characteristicList: [{
text: "免配送费"
}, {
text: "0元起送"
}, {
text: "新商家"
}, {
text: "品牌商家"
}, {
text: "跨天预定"
}],
sortList: [{
sort: "综合排序",
image: "",
}, {
sort: "速度最快",
image: "",
}, {
sort: "评分最高",
image: "",
}, {
sort: "起送价最低",
image: "",
}, {
sort: "配送费最低",
image: "",
}],
discountList: [{
icon: "减",
iconColor: "#FF635B",
text: "满减优惠"
}, {
icon: "领",
iconColor: "#FF7298",
text: "进店领券"
}, {
icon: "返",
iconColor: "#FB4343",
text: "满返代金券"
}, {
icon: "折",
iconColor: "#C183E2",
text: "折扣商品"
}, {
icon: "订",
iconColor: "#6FDF64",
text: "提前下单优惠"
}, {
icon: "赠",
iconColor: "#FDC41E",
text: "满赠活动"
}, {
icon: "免",
iconColor: "#43B697",
text: "满免配送"
}],
ad:[
{
imageUrl:"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1573966727205&di=66965e182c0d2efd0818a7d9b8c2629a&imgtype=0&src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2Fcf482ffb4f3fc6d941664e1cba8ca3ca6e9c0a9443f84-AsGU9b_fw658",
url:"http://www.homecommunity.cn/"
},
{
imageUrl: "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1573966727205&di=66965e182c0d2efd0818a7d9b8c2629a&imgtype=0&src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2Fcf482ffb4f3fc6d941664e1cba8ca3ca6e9c0a9443f84-AsGU9b_fw658",
url: "http://www.homecommunity.cn/"
}
],
categoryList: {
pageone: [{
name: "物业费",
@ -83,35 +37,8 @@ Page({
}, {
name: "公告",
src: "/images/7.png"
}, {
name: "附近超时",
src: "/images/8.png"
}],
pagetwo: [{
name: "美食",
src: "/images/1.png"
}, {
name: "甜点饮品",
src: "/images/2.png"
}, {
name: "美团超市",
src: "/images/3.png"
}, {
name: "正餐精选",
src: "/images/4.png"
}, {
name: "生鲜果蔬",
src: "/images/5.png"
}, {
name: "全部商家",
src: "/images/6.png"
}, {
name: "免配送费",
src: "/images/7.png"
}, {
name: "新商家",
src: "/images/8.png"
}]
},
selected: 0,
mask1Hidden: true,

View File

@ -1,45 +1,6 @@
<import src = "../common/sort_list.wxml"/>
<view class="mask"
hidden="{{mask1Hidden}}" bindtap="mask1Cancel">
<template is="sort_list" data="{{selected,sortSelected}}"/>
<view class="overall-sort-list">
<block wx:for="{{sortList}}" wx:key="">
<view class="overall-sort" data-index="{{index}}"
bindtap="sortSelected">{{item.sort}}</view>
</block>
</view>
</view>
<view class="mask"
hidden="{{mask2Hidden}}" bindtap="mask2Cancel">
<template is="sort_list" data="{{selected,sortSelected}}"/>
<scroll-view class="filterList" scroll-y="true" >
<view class="filterList-characteristic-title">商家特色</view>
<view class="filterList-characteristic-items">
<block wx:for="{{characteristicList}}" wx:key="">
<view class="filterList-characteristic-item {{characteristicSelected[index]==true?'characteristic-selected':''}}"
catchtap="characteristicSelected" data-index="{{index}}">{{item.text}}</view>
</block>
</view>
<view class="filterList-discount-title">优惠活动(单选)</view>
<view class="filterList-discount-items">
<block wx:for="{{discountList}}" wx:key="">
<view class="filterList-discount-item {{discountSelected==index?'discount-selected':''}}"
catchtap="discountSelected" data-index="{{index}}">
<text class="filterList-discount-item-icon"
style="background:{{item.iconColor}}">{{item.icon}}</text>
{{item.text}}</view>
</block>
</view>
</scroll-view>
<view class="filterList-footer">
<view class="filterList-footer-delect"
catchtap="clearSelectedNumb">清除筛选</view>
<view class="filterList-footer-finish" bindtap="finish">完成
<view class="filterList-footer-finish-number" hidden="{{selectedNumb==0}}">{{selectedNumb}}
</view>
</view>
</view>
</view>
<scroll-view bindscrolltolower="lower"
class="scroll-restaurants-list"
scroll-y="true"
@ -72,8 +33,23 @@ style="height:100%">
</swiper-item>
</block>
</swiper>
<view class="header-title">附近商家</view>
<template is="sort_list" data="{{selected,sortSelected}}"/>
<swiper class="ad-swiper" indicator-dots="true"
indicator-color="rgba(228,228,228,1)"
indicator-active-color="#FECA49"
autoplay='true'
interval='5000'
duration='1000'
circular='true'
>
<block wx:for="{{ad}}" wx:for-index="index">
<swiper-item>
<image src="{{item.imageUrl}}"></image>
</swiper-item>
</block>
</swiper>
<view class="header-title">最新动态</view>
<view class="restaurantsList">
<block wx:for="{{restaurant}}" wx:key="">
<navigator url="/pages/menu/menu">

View File

@ -196,6 +196,7 @@ page {
line-height: 80rpx;
font-size: 31rpx;
font-weight: 600;
border: 1rpx solid #ECECEC;
}
.sort-list{
justify-content: space-around;
@ -275,3 +276,14 @@ page {
z-index:999;
background-color:rgba(15, 15, 26, 0.7);
}
.ad-swiper{
width: 100%;
height: 180rpx;
border-bottom:20rpx solid #f4f4f4;
}
.ad-swiper image{
width: 100%;
height: inherit;
}