1.修改分类的界面样式

yj-dev
杨杰 2 years ago
parent ab5302d11c
commit 7f395169f8
  1. 618
      pages/tabBar/category/category.vue

@ -1,177 +1,441 @@
<template> <template>
<view class="content"> <view class="map-container">
<map style="width: 100%; height: 90vh;" :style="{height:mapheight}" :show-location='true' :latitude="latitude" <map style="width: 100%; height: 10vh;" :style="{height:mapheight}" :show-location='true' :latitude="latitude"
:longitude="longitude" :markers="marker" :scale="scale" @markertap="markertap" @callouttap='callouttap'> :longitude="longitude" :markers="marker" :scale="scale" @markertap="markertap" @callouttap='callouttap'>
</map> <!-- <cover-view class="cover-view-loca" :style='{bottom:coverbottom}' @click="onControltap">
</view> <cover-image class="cover-image" @click="play" src="../../../static/img/adresw.png"></cover-image>
</template> <cover-view>
定位
<script> </cover-view>
export default { </cover-view> -->
data() { <!-- 一级分类 -->
return { <view class="width100 cover-views mart15">
latitude: 23.106574, // <scroll-view class="width90 cover-view-cont" scroll-x="true">
longitude: 113.324587, // <view class="cover-view-head font14" :class="[typeid == item.id ? 'onclick' : '']"
scale: 13, // v-for="(item,index) in marker" :key="index" @click="changeType(item)">全部全部{{index}}</view>
bottomData: false, </scroll-view>
marker: [{ <!-- 二级分类 -->
id: 0, <view class="width100 mart15 backcorfff cover-viewchage alijus fotct" style="border-radius: 22px;">
latitude: 23.13065, // <view class="font14 width30w" :class="[selectFirst == 1? 'onchange' : '']"
longitude: 113.3274, // @click="changeChilerType()">全部
iconPath: '../../../static/img/user/user5.png', // <image mode="widthFix" class="margle" style="width: 8px;" :src="imagewxUrl+imgadres2"></image>
rotate: 0, // </view>
width: 20, // <view class="font14 width30w" :class="[selectFirst == 1? 'onchange' : '']">全部
height: 20, // <image mode="widthFix" class="margle" style="width: 8px;" :src="imagewxUrl+imgadres2"></image>
// title:'',// </view>
alpha: 0.9, // <view class="font14 width30w">
callout: { // <!-- 全部
content: '天宝大厦', // <image mode="widthFix" class="margle" style="width: 8px;" :src="imagewxUrl+imgadres2"></image> -->
color: '#ffffff', // </view>
fontSize: 14, // </view>
borderRadius: 22, // </view>
borderWidth: '10', <!-- // -->
bgColor: '#e51860', // <view class="change-cont" v-if="selectChiler == 1">
display: 'ALWAYS', // <view class="width100 backcorfff"></view>
}, </view>
}, <!-- // -->
{ <view class="change-optiac paddbotm20" v-if="selectChiler == 1">
id: 1234597, <scroll-view scroll-y="true" class="width100 height260">
latitude: 23.106574, // <view class="width90 bor-botm1 paddtop15 paddbotm15 alijusstart">
longitude: 113.324587, // <view class="width90w" :class="[selectFirst == 1? 'onchange' : '']">发生地方是发生地方</view>
iconPath: '../../../static/img/user/user5.png', // <image class="icon12" src="../../../static/img/jt.png" mode="widthFix"></image>
rotate: 0, // </view>
width: 20, // <view class="width90 bor-botm1 paddtop15 paddbotm15 alijusstart">
height: 20, // <view class="width90w">发生地方是发生地方</view>
// title:'',// <image class="icon12" src="../../../static/img/jt.png" mode="widthFix"></image>
alpha: 0.9, // </view>
// label:{// //H5 <view class="width90 bor-botm1 paddtop15 paddbotm15 alijusstart">
// color:'red',// <view class="width90w">发生地方是发生地方</view>
// }, <image class="icon12" src="../../../static/img/jt.png" mode="widthFix"></image>
callout: { // </view>
content: '广州塔', // <view class="width90 bor-botm1 paddtop15 paddbotm15 alijusstart">
color: '#ffffff', // <view class="width90w">发生地方是发生地方</view>
fontSize: 14, // <image class="icon12" src="../../../static/img/jt.png" mode="widthFix"></image>
borderRadius: 22, // </view>
borderWidth: '10', <view class="width90 bor-botm1 paddtop15 paddbotm15 alijusstart">
bgColor: '#e51860', // <view class="width90w">发生地方是发生地方</view>
display: 'ALWAYS', // <image class="icon12" src="../../../static/img/jt.png" mode="widthFix"></image>
}, </view>
}, <view class="width90 bor-botm1 paddtop15 paddbotm15 alijusstart">
{ <view class="width90w">发生地方是发生地方</view>
id: 2, <image class="icon12" src="../../../static/img/jt.png" mode="widthFix"></image>
latitude: 23.1338, // </view>
longitude: 113.33052, // <view class="width90 bor-botm1 paddtop15 paddbotm15 alijusstart">
iconPath: '../../../static/img/user/user5.png', // <view class="width90w">发生地方是发生地方</view>
rotate: 0, // <image class="icon12" src="../../../static/img/jt.png" mode="widthFix"></image>
width: 20, // </view>
height: 20, // </scroll-view>
alpha: 0.9, // </view>
callout: { //
content: '德隆大厦', // <!-- 未打开筛选前 -->
color: '#ffffff', // <view class="cover-view-foot" @click="updateSelected(2)" v-if="isSelected == 1">
fontSize: 14, // <view class="line-view"></view>
borderRadius: 22, // <view class="mart10 fcor666 font13 width100">发现更多商户</view>
borderWidth: '10', <view class="input-box">
bgColor: '#e51860', // <input placeholder="搜索商品" v-model="couponName" placeholder-style="color:#c0c0c0;"
display: 'ALWAYS', // @input="toSearch()" />
}, </view>
}, </view>
{
id: 3, <!-- 打开筛选后 -->
latitude: 23.136455, // <view class="cover-view-foot-behind" @click="updateSelected(1)" v-if="isSelected == 2">
longitude: 113.329002, // <view class="line-view"></view>
iconPath: '../../../static/img/user/user5.png', // <view class="mart10 fcor666 font13 width100">发现更多商户</view>
rotate: 0, // <view class="input-box">
width: 20, // <input placeholder="搜索商品" v-model="couponName" placeholder-style="color:#c0c0c0;"
height: 20, // @input="toSearch()" />
alpha: 0.9, // </view>
callout: { // <scroll-view class="scoroll-cont mart10" scroll-y="true">
content: '羊城国际商贸中心', // <view class="height45 width100" @click.stop="updateSelected(1)">收到粉丝都是短发舒服</view>
color: '#ffffff', //
fontSize: 14, // </scroll-view>
borderRadius: 22, // </view>
borderWidth: '10',
bgColor: '#e51860', // </map>
display: 'ALWAYS', // </view>
}, </template>
}, <script>
{ let app = getApp();
id: 4, export default {
latitude: 23.224781, // data() {
longitude: 113.293911, // return {
iconPath: '../../../static/img/user/user5.png', // latitude: 23.106574, //
rotate: 0, // longitude: 113.324587, //
width: 20, // scale: 13, //
height: 20, // bottomData: false,
alpha: 0.9, // imagewxUrl: app.globalData.imageWxImg,
callout: { // imgadres2: 'xiala.png',
content: '天瑞广场A座', // marker: [{
color: '#ffffff', // id: 0,
fontSize: 16, // latitude: 23.13065, //
borderRadius: 22, // longitude: 113.3274, //
borderWidth: '12', iconPath: '../../../static/img/user/user5.png', //
bgColor: '#e51860', // rotate: 0, //
display: 'ALWAYS', // width: 20, //
}, height: 30, //
}, // title:'',//
{ alpha: 0.5, //
id: 5, callout: { //
latitude: 23.072726, // content: '天宝大厦', //
longitude: 113.277921, // color: '#ffffff', //
iconPath: '../../../static/img/user/user5.png', // fontSize: 14, //
rotate: 0, // borderRadius: 15, //
width: 20, // borderWidth: '10',
height: 20, // bgColor: '#e51860', //
alpha: 0.9, // display: 'ALWAYS', //
callout: { // },
content: '大米和小米儿童康复(广州盈丰)中心', // },
color: '#ffffff', // {
fontSize: 14, // id: 1234597,
borderRadius: 22, // latitude: 23.106574, //
borderWidth: '8', longitude: 113.324587, //
bgColor: '#e51860', // iconPath: '../../../static/img/user/user5.png', //
display: 'ALWAYS', // rotate: 0, //
}, width: 20, //
}, height: 30, //
], // title:'',//
} alpha: 0.5, //
}, // label:{// //H5
onLoad() { // color:'red',//
// },
}, callout: { //
computed: { content: '广州塔', //
mapheight() { color: '#ffffff', //
let data = '' fontSize: 14, //
if (this.bottomData) { borderRadius: 15, //
if (this.upTop) { borderWidth: '10',
data = '50px' bgColor: '#e51860', //
} else { display: 'ALWAYS', //
data = '200px' },
} },
} else { {
data = '90vh' id: 2,
} latitude: 23.1338, //
return data longitude: 113.33052, //
}, iconPath: '../../../static/img/user/user5.png', //
coverbottom() { rotate: 0, //
let data = '' width: 20, //
if (this.bottomData) { height: 30, //
data = '20rpx' alpha: 0.5, //
} else { callout: { //
data = '100rpx' content: '德隆大厦', //
} color: '#ffffff', //
return data fontSize: 14, //
} borderRadius: 15, //
}, borderWidth: '10',
methods: { bgColor: '#e51860', //
// display: 'ALWAYS', //
markertap(e) { },
console.log("===你点击了标记点===", e) },
}, {
// id: 3,
callouttap(e) { latitude: 23.136455, //
console.log('地图点击事件', e) longitude: 113.329002, //
} iconPath: '../../../static/img/user/user5.png', //
} rotate: 0, //
} width: 20, //
</script> height: 30, //
alpha: 0.5, //
callout: { //
content: '羊城国际商贸中心', //
color: '#ffffff', //
fontSize: 14, //
borderRadius: 15, //
borderWidth: '10',
bgColor: '#e51860', //
display: 'ALWAYS', //
},
},
{
id: 4,
latitude: 23.224781, //
longitude: 113.293911, //
iconPath: '../../../static/img/user/user5.png', //
rotate: 0, //
width: 20, //
height: 30, //
alpha: 0.5, //
callout: { //
content: '天瑞广场A座', //
color: '#ffffff', //
fontSize: 16, //
borderRadius: 15, //
borderWidth: '12',
bgColor: '#e51860', //
display: 'ALWAYS', //
},
},
{
id: 5,
latitude: 23.072726, //
longitude: 113.277921, //
iconPath: '../../../static/img/user/user5.png', //
rotate: 0, //
width: 20, //
height: 30, //
alpha: 0.5, //
callout: { //
content: '大米和小米儿童康复(广州盈丰)中心', //
color: '#ffffff', //
fontSize: 14, //
borderRadius: 15, //
borderWidth: '8',
bgColor: '#e51860', //
display: 'ALWAYS', //
},
},
],
typeid: 0, //
isSelected: 1, //
selectFirst: 1, //
selectChiler: 1, //
}
},
onLoad() {
},
computed: {
mapheight() {
let data = ''
if (this.bottomData) {
if (this.upTop) {
data = '50px'
} else {
data = '200px'
}
} else {
data = '100vh'
}
return data
},
coverbottom() {
let data = ''
if (this.bottomData) {
data = '20rpx'
} else {
data = '200rpx'
}
return data
}
},
methods: {
//
markertap(e) {},
//
callouttap(e) {
console.log('地图点击事件', e)
},
//
onControltap() {
},
//
changeType(item) {
this.typeid = item.id;
},
//
changeChilerType() {
if (this.selectChiler == 1) {
this.selectChiler = 2;
} else {
this.selectChiler = 1;
}
},
//
updateSelected(item) {
this.isSelected = item;
}
}
}
</script>
<style lang='less' scoped>
.map-container {
position: relative;
overflow: hidden;
.cover-views {
position: absolute;
z-index: 99999;
}
.cover-view-cont {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
white-space: nowrap;
}
.cover-view-head {
height: 35px;
line-height: 35px;
background-color: #fff;
display: inline-table;
flex-direction: column;
text-align: center;
position: relative;
margin-right: 15px;
border-radius: 22px;
padding: 0 10px;
}
.cover-viewchage {
height: 35px;
}
.onchange {
color: #089bf5;
}
.onclick {
background-color: #089bf5;
color: #fff;
}
.cover-view-loca {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
color: #484848;
background-color: #fff;
background-size: 60px 60px;
background-position: center center;
position: absolute;
bottom: 100px;
right: 16px;
}
.cover-image {
display: inline-block;
width: 15px;
height: 15px;
}
.cover-view-foot {
text-align: center;
height: 200rpx;
background-color: #fff;
position: absolute;
bottom: 0px;
width: 100%;
border-radius: 18px 18px 0 0;
}
.change-cont {
position: absolute;
z-index: 99999999;
top: 100px;
background-color: #333;
width: 100%;
opacity: 0.8;
height: calc(100% - 100px);
}
.change-optiac {
position: absolute;
z-index: 99999999;
top: 100px;
width: 100%;
background-color: #fff;
height: 260px;
}
.cover-view-foot-behind {
text-align: center;
height: calc(100% - 110px);
background-color: #fff;
position: absolute;
z-index: 999999;
bottom: 0px;
width: 100%;
border-radius: 18px 18px 0 0;
}
}
.scoroll-cont {
height: calc(100% - 80px);
}
.line-view {
width: 10%;
margin-left: 45%;
height: 5px;
border-radius: 12px;
margin-top: 10px;
background-color: #f0f0f0;
}
.input-box {
width: 90%;
margin-left: 5%;
margin-top: 5px;
text-align: left;
height: 70rpx;
background-color: #f0f0f0;
border-radius: 22px;
position: relative;
align-items: center;
display: flex;
input {
padding-left: 12px;
padding-right: 12px;
height: 30px;
color: #666;
font-size: 14px;
width: 100%;
}
}
.onclick {
background-color: #089bf5;
color: #fff;
}
</style>
Loading…
Cancel
Save