Commit 71c9a4bf9f77b3d09d683fd82e3e0e855c0cbf49

Authored by vking
1 parent eab7458d

boost + mapmenu

... ... @@ -117,6 +117,7 @@
"downloadFile": 10000
},
"tabBar": {
"custom": true,
"color": "#999999",
"selectedColor": "#C0A369",
"backgroundColor": "#262628",
... ...
... ... @@ -52,6 +52,10 @@ Component({
type: Boolean,
value: false,
},
hasActivityRed:{//红包活动 tags
type: Boolean,
value: false,
},
},
/**
... ... @@ -78,13 +82,24 @@ Component({
init() {
let seller = this.data.seller
seller.label_cstr=''
seller.label_carr=[]
if (seller && seller.label_c && seller.label_c.length > 0) {
let label_cstr = [];
let label_cstr = []
seller.label_c.forEach(l => {
label_cstr.push(l.name)
seller.label_carr.push({type:1,name:l.name})
})
seller.label_cstr = label_cstr.join(' | ')
}
if(seller.is_discount>0){
seller.label_carr.unshift({type:0,name:'商家补贴'})
}
if(seller.isopen_md==1){
seller.label_carr.unshift({type:0,name:'瓜分百万'})
}
if(seller.label_carr.length>3){
seller.label_carr=seller.label_carr.slice(0,3)
}
this.setData({
se: seller,
})
... ...
... ... @@ -11,12 +11,12 @@
<view style="max-width: 100%;width: 100%;">
<view class="name Semibold flex-ll">
<view class="sellername">{{seller.sellername}}</view>
<view class="ActivityShort" wx:if="{{hasActivityShort && seller.is_discount>0}}"></view>
<view class="isopen_md" wx:if="{{hasActivityShort && seller.isopen_md==1}}">买单</view>
<!--<view class="ActivityShort" wx:if="{{hasActivityShort && seller.is_discount>0}}"></view>-->
<view class="isopen_md flex-vc" wx:if="{{hasActivityShort && seller.isopen_md==1}}">在线买单</view>
</view>
<view wx:if="{{hasSlogan && seller.slogan}}" class="slogan">“{{seller.slogan}}”</view>
<view class="text flex-ll" wx:if="{{seller.cate.length>0}}">
<view class="text-item" wx:for="{{seller.cate}}" wx:key="seller.cate.key" wx:if="{{index<3}}">{{item.name}}</view>
<view class="text-item" wx:for="{{seller.cate}}" wx:key="sellercatekey" wx:if="{{index<3}}">{{item.name}}</view>
</view>
<view class="text flex-ll">
<view class="text-item" wx:if="{{seller.room_num>0}}">{{seller.room_num}}个包间</view>
... ... @@ -36,7 +36,7 @@
vertical
circular
>
<block wx:for="{{seller.activity}}" wx:key="seller.activity.key" >
<block wx:for="{{seller.activity}}" wx:key="selleractivitykey" >
<swiper-item>
<view class="activity-item">
{{item.title}}
... ... @@ -48,16 +48,20 @@
<view class="activity-mask"></view>
</view>
<view wx:if="{{hasActivityTags && seller.activity.length>0}}" class="activity flex-ll">
<text wx:for="{{seller.activity}}" class="activity-item" wx:key="seller.activity.key" wx:if="{{index<3}}">{{['','满减','满赠','折扣','代金券','会员价'][item.type]}}</text>
<text wx:for="{{seller.activity}}" class="activity-item" wx:key="selleractivitykey" wx:if="{{index<3}}">{{['','满减','满赠','折扣','代金券','会员价'][item.type]}}</text>
</view>
<view wx:if="{{hasActivityTese && se.label_cstr}}" class="activity hasActivityTese flex-ll">
<text class="activity-item">{{se.label_cstr}}</text>
</view>
<view wx:if="{{hasActivityRed && se.label_carr.length>0}}" class="activity flex-ll">
<view wx:for="{{se.label_carr}}" class="activity-item flex-vc" wx:key="selleractivitykey">{{item.name}}</view>
</view>
</view>
<view class="price flex-lr">
<view class="number Semibold">
<block wx:if="{{seller.average>0 && hasAverage}}">¥{{seller.average}}元/人</block>
</view>
<!--
<view class="phone flex-cc" id="reserve-button" catchtap="tapButton" data-type="oncall">
<block wx:if="{{se.is_online_reserve==1}}">
<view class="reserve-icon"></view>
... ... @@ -65,6 +69,10 @@
</block>
<text class="reserve-text" wx:else="">联系餐厅</text>
</view>
-->
<view class="reserve-button flex-vc" id="reserve-button" catchtap="tapButton">
订包间
</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -128,20 +128,16 @@
line-height: 34rpx;
}
.activity .activity-item{
font-size: 24rpx;
height: 24rpx;
padding: 0 10rpx 0;
line-height: 24rpx;
overflow: hidden;
max-height: 36rpx;
border-radius: 6rpx;
height:36rpx;
border-radius:6rpx;
border:2rpx solid #F98E47;
margin-left: 10rpx;
text-align: center;
overflow: hidden;
white-space:nowrap;
background: linear-gradient(to right, #F98E47, #F05522);
text-shadow:0 2rpx 6rpx #C51B41;
color:#F8E6C4;
font-size:22rpx;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:500;
color:rgba(240,85,34,1);
padding: 0 10rpx;
}
.activity .activity-item:first-child{
margin-left: 0;
... ... @@ -221,6 +217,7 @@
background-color: #FFF5EB;
margin-left: 0;
border-radius: 0;
border-width: 0;
}
.sellername{
overflow: hidden;
... ... @@ -235,15 +232,27 @@
margin-right: 10rpx;
}
.isopen_md{
width:52rpx;
width:92rpx;
height:32rpx;
background:rgba(255,243,240,1);
border-radius:4rpx;
border:2rpx solid rgba(146,231,61,1);
font-size:20rpx;
font-family:PingFangSC-Semibold,PingFang SC;
font-weight:600;
color:rgba(125,199,66,1);
color:rgba(254,142,103,1);
line-height:32rpx;
text-align: center;
margin-left: 6rpx;
margin-left: 20rpx;
}
.reserve-button{
width:130rpx;
height:62rpx;
background:linear-gradient(360deg,rgba(249,142,71,1) 0%,rgba(240,85,34,1) 100%);
border-radius:31rpx;
font-size:30rpx;
font-family:PingFangSC-Semibold,PingFang SC;
font-weight:600;
color:rgba(255,255,255,1);
}
\ No newline at end of file
... ...
<!--components/tips/boost.wxml-->
<view class="mask" bindtap="hide" wx:if="{{disp}}">
<view class="mask" bindtap="hide" wx:if="{{disp}}" style="z-index: 99999">
<view class="boost" catchtap="catchtap">
<view class="header flex-lr" bindtap="hide">
<view> </view>
... ...
// components/book/tabBar/tabBar.js
import util from '../utils/util'
Component({
/**
* 组件的属性列表
*/
properties: {},
/**
* 组件的初始数据
*/
data: {
pi: 0,
dot:0,
list: [
{
"pagePath": "pages/reserve/index",
"text": "订座",
"iconPath": "pages/image/tabicon1.png",
"selectedIconPath": "pages/image/tabicon1.active.png"
},
{
"pagePath": "pages/me/follow",
"text": "关注",
"iconPath": "pages/image/follow.png",
"selectedIconPath": "pages/image/follow.active.png"
},
{
"pagePath": "pages/customer/list",
"text": "日程",
"iconPath": "pages/image/tabicon3.png",
"selectedIconPath": "pages/image/tabicon3.active.png"
},
{
"pagePath": "pages/me/index",
"text": "我的",
"iconPath": "pages/image/tabicon4.png",
"selectedIconPath": "pages/image/tabicon4.active.png"
}
]
},
lifetimes: {
ready(){
console.log('custom-tab-bar.ready')
},
attached: function() {
// 在组件实例进入页面节点树时执行
console.log('custom-tab-bar.attached')
},
detached: function() {
// 在组件实例被从页面节点树移除时执行
console.log('custom-tab-bar.detached')
},
moved:function() {
console.log('custom-tab-bar.moved')
},
},
/**
* 组件的方法列表
*/
methods: {
redirectTo(e){
let url = util.attr(e, 'url');
let pages = getCurrentPages();
let p = pages[pages.length - 1];
if (url.indexOf(p.route) < 0) {
wx.switchTab({
url: '/'+url,
})
}
},
}
})
... ...
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
... ...
<!--components/book/tabBar/tabBar.wxml-->
<view class="tabBar flex-cc" >
<block wx:for="{{list}}" wx:key="list">
<view class="item flex-vc" bindtap="redirectTo" data-url="{{item.pagePath}}">
<view class="flex-tb {{(selected==index)?'checked':''}}" style="height: 82rpx;">
<view class="icon tabicon{{index+1}}"></view>
<view class="text">{{item.text}}</view>
</view>
</view>
</block>
</view>
... ...
/* components/book/tabBar/tabBar.wxss */
@import "../app.wxss";
.tabBar{
height: 98rpx;
background:rgba(249,249,249,1);
box-shadow:0rpx 0rpx 8rpx 0rpx rgba(224,224,224,1);
width:100%;
position: fixed;
bottom: 0;
z-index: 9;
box-sizing: border-box;
padding: 8rpx 0;
}
.tabBar .text{
height:32rpx;
font-size:22rpx;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:500;
color:rgba(102,102,102,1);
line-height:32rpx;
}
.tabBar .checked .text{
color: #C28C56;
}
.tabBar .item{
width: 33%;
min-width: 20%;
}
.dot{
position: absolute;
width: 16rpx;
height: 16rpx;
background-color: #F05522;
border-radius: 50%;
right:-14rpx;
top:-8rpx;
}
.tabBar .icon{
width: 48rpx;
height: 48rpx;
background-size: 100%;
position: relative;
}
.tabBar .icon image{
width: 100%;
height: 100%;
}
.tabBar .tabicon1{
width: 46rpx;
height: 46rpx;
background-image: url("http://nosqn.colorcun.com/mapmenu/tabicon1.png");
}
.tabBar .checked .tabicon1{
background-image: url("http://nosqn.colorcun.com/mapmenu/tabicon1.active.png");
}
.tabBar .tabicon2{
width:40rpx;
height:38rpx;
background-image: url("http://nosqn.colorcun.com/mapmenu/tabicon2.png");
}
.tabBar .checked .tabicon2{
background-image: url("http://nosqn.colorcun.com/mapmenu/tabicon2.active.png");
}
.tabBar .tabicon3{
width:44rpx;
height:40rpx;
background-image: url("http://nosqn.colorcun.com/mapmenu/tabicon3.png");
}
.tabBar .checked .tabicon3{
background-image: url("http://nosqn.colorcun.com/mapmenu/tabicon3.active.png");
}
.tabBar .tabicon4{
width:40rpx;
height:40rpx;
background-image: url("http://nosqn.colorcun.com/mapmenu/tabicon4.png");
}
.tabBar .checked .tabicon4{
background-image: url("http://nosqn.colorcun.com/mapmenu/tabicon4.active.png");
}
... ...
... ... @@ -38,6 +38,12 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
this.getTabBar().setData({
selected: 2
})
}
if(this.options.hasRelaTip){
this.selectComponent("#showModal").show({
... ...
... ... @@ -3,6 +3,7 @@
width: 90%;
margin: 30rpx 5% 0;
color:#353535;
padding-bottom: 98rpx;
}
.card{
... ...
... ... @@ -59,6 +59,12 @@ Page({
*/
hasOnShow:true,
onShow: function () {
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
this.getTabBar().setData({
selected: 1
})
}
if(this.data.sellers.length==0){
wx.showLoading({
title: '加载中',
... ...
... ... @@ -3,6 +3,7 @@
width: 90%;
margin: 0 auto;
font-size: 30rpx;
padding-bottom: 98rpx;
}
.empty{margin-top: 230rpx;}
.empty image{
... ...
... ... @@ -48,6 +48,12 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
this.getTabBar().setData({
selected:3
})
}
App.User.GetBalance().then(res=>{
this.setData({
user:res.data
... ...
... ... @@ -6,6 +6,7 @@ page{
width: calc(100% - 40rpx);
margin: -24rpx 20rpx 40rpx;
color:#353535;
padding-bottom: 98rpx;
}
image{
width:100%;
... ...
... ... @@ -148,6 +148,12 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: async function (e) {
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
this.getTabBar().setData({
selected: 0
})
}
console.log({
'this.hasGetLocation':this.hasGetLocation,
'this.hasOnLoad':this.hasOnLoad,
... ...
... ... @@ -77,7 +77,7 @@
<sb-tr seller="{{item.seller}}"
hasActivityTags="{{false}}"
hasActivityShort="{{true}}"
hasBrand="true" hasActivityTese="true"
hasBrand="true" hasActivityRed="true"
hasSuggestion="{{hasSuggestion}}"
hasSlogan="{{false}}"></sb-tr>
</view>
... ...
/* pages/reservr/index.wxss */
page{
background-color: #efefef;
--barHeight:98rpx;
}
.pages{
width: 100%;
... ... @@ -19,7 +21,7 @@ page{
}
.moveToLocation{
position: fixed;
bottom: 520rpx;
bottom: calc(520rpx + var(--barHeight));
right: 20rpx;
width: 62rpx;
height: 62rpx;
... ... @@ -292,7 +294,7 @@ page{
.seller-view{
height: 470rpx;
position:fixed;
bottom: 0;
bottom: calc(0rpx + var(--barHeight));
width: 100%;
background-color: #fefefe;
border-radius: 20rpx 20rpx 0 0;
... ... @@ -338,7 +340,7 @@ page{
background-color: #000;
width: calc(100% - 272rpx);
position: fixed;
bottom:490rpx;
bottom:calc(490rpx + var(--barHeight));
color: #fefefe;
height:60rpx;
font-size:26rpx;
... ... @@ -352,7 +354,7 @@ page{
background-color: #000;
width: calc(100% - 72rpx);
position: fixed;
bottom:430rpx;
bottom:calc(430rpx + var(--barHeight));
color: #fefefe;
height:60rpx;
font-size:26rpx;
... ...
... ... @@ -55,7 +55,7 @@
<sb-tr seller="{{item}}"
hasActivityTags="{{false}}"
hasActivityShort="{{true}}"
hasBrand="true" hasActivityTese="true"
hasBrand="true" hasActivityRed="true"
hasSlogan="{{false}}"
hasSuggestion="{{hasSuggestion}}"
sellerStyle="noborder noshadow noradius"></sb-tr>
... ...