Commit 934b48d6 authored by lvtz's avatar lvtz

fix

parent e32737d0
<view class="topbar" style="padding-top: {{statusBarHeight}}px">
<view class="nav-contentbox">
<view class="nav-contentbox" style="height: {{titleBarHeight}}px">
<slot name="navcustom"></slot>
</view>
</view>
\ No newline at end of file
......@@ -7,8 +7,5 @@
z-index: 99;
}
.nav-contentbox{
/* width: 100%;
display: flex;
align-items: center;
justify-content: center */
width: 100%;
}
\ No newline at end of file
......@@ -9,7 +9,7 @@
</view>
<view class="address-box" >
<view class="content" >
<image class="map-icon" src="{{imageRoot}}2c/websiteindex/map-icon.png" lazy-load="false" binderror="" bindload=""></image>
<image class="map-icon" src="{{localImageRoot}}2c/websiteindex/map-icon2.png" lazy-load="false" binderror="" bindload=""></image>
<view class="address-box-text" >
<text wx:if="{{latitude&&longitude}}" class="distance" selectable="false" space="false" decode="false">距离{{schoolInfo.distance}}公里</text>{{schoolInfo.location_address?schoolInfo.location_address:schoolDetail.address}}</view>
</view>
......
......@@ -131,27 +131,27 @@ Page({
this.clockListGet();
const myLocation = LocalStorage.getItem('myLocation');
const that = this;
if (myLocation) {
this.setData({
latitude: Number(myLocation.split('-')[0]),
longitude: Number(myLocation.split('-')[1]),
})
} else {
wx.getLocation({
type: 'wgs84',
success(res) {
const {
latitude,
longitude
} = res;
LocalStorage.setItem('myLocation', latitude + '-' + longitude)
that.setData({
latitude: latitude,
longitude: longitude,
})
}
})
}
// if (myLocation) {
// this.setData({
// latitude: Number(myLocation.split('-')[0]),
// longitude: Number(myLocation.split('-')[1]),
// })
// } else {
// wx.getLocation({
// type: 'wgs84',
// success(res) {
// const {
// latitude,
// longitude
// } = res;
// LocalStorage.setItem('myLocation', latitude + '-' + longitude)
// that.setData({
// latitude: latitude,
// longitude: longitude,
// })
// }
// })
// }
wx.login({
success(res) {
......@@ -592,29 +592,29 @@ Page({
if (data) {
const myLocation = LocalStorage.getItem('myLocation');
const that = this;
if (myLocation) {
this.setData({
latitude: Number(myLocation.split('-')[0]),
longitude: Number(myLocation.split('-')[1]),
})
data.distance = getFlatternDistance(this.data.latitude, this.data.longitude, Number(data.latitude), Number(data.longitude))
} else {
wx.getLocation({
type: 'wgs84',
success(res) {
const {
latitude,
longitude
} = res;
LocalStorage.setItem('myLocation', latitude + '-' + longitude)
that.setData({
latitude: latitude,
longitude: longitude,
'schoolInfo.distance': getFlatternDistance(latitude,longitude, Number(data.latitude), Number(data.longitude))
})
}
})
}
// if (myLocation) {
// this.setData({
// latitude: Number(myLocation.split('-')[0]),
// longitude: Number(myLocation.split('-')[1]),
// })
// data.distance = getFlatternDistance(this.data.latitude, this.data.longitude, Number(data.latitude), Number(data.longitude))
// } else {
// wx.getLocation({
// type: 'wgs84',
// success(res) {
// const {
// latitude,
// longitude
// } = res;
// LocalStorage.setItem('myLocation', latitude + '-' + longitude)
// that.setData({
// latitude: latitude,
// longitude: longitude,
// 'schoolInfo.distance': getFlatternDistance(latitude,longitude, Number(data.latitude), Number(data.longitude))
// })
// }
// })
// }
data.banner = data.banner ? JSON.parse(data.banner) : '';
// 排序处理,体验课放在第三位
let dataSort = '';
......
<wxs src="../../../filter/index.wxs" module="filter" />
<view class="scroll-container-box" >
<view class="nav-custombox" style="padding-top: {{statusBarHeight}}px">
<view class="nav-title-box" style="height: {{titleBarHeight}}px">
<custom-header>
<view class="nav-custombox" slot="navcustom">
<view class="title">{{schoolInfo.title?schoolInfo.title:schoolDetail.title}}</view>
<view class="num-box">{{schoolInfo.join_count?schoolInfo.join_count:500}}人想学</view>
</view>
<view class="address-box">
<image class="map-icon" src="{{imageRoot}}2c/websiteindex/map-icon.png?{{imageVersion}}"></image>
<view class="distance-box">
<text wx:if="{{latitude&&longitude&&schoolInfo}}" class="distance" >距离{{schoolInfo.distance}}公里</text>
<text class="name" >{{schoolInfo.location_address?schoolInfo.location_address:schoolDetail.address}}</text>
</view>
</view>
</view>
<view class="container" bindtouchmove="touchStart" bindtouchend="touchEnd" style="padding-bottom: {{websiteCourses.switch==1? '105rpx': '0'}}">
</custom-header>
<view class="container" bindtouchmove="touchStart" bindtouchend="touchEnd" style="padding-bottom: {{websiteCourses.switch==1? '105rpx': '0'}};padding-top: {{navH!=0?navH:40}}px">
<view class="share-btn-wrapper" style="top:{{titleBarHeight+statusBarHeight+50}}px" >
<view class="share-btn {{shareBtnShow==1?'share-btn-hide':''}} {{shareBtnShow==2?'share-btn-show':''}}" >
<button open-type="share"></button>
......
......@@ -30,15 +30,14 @@ page{
margin-top: 24rpx;
}
.nav-custombox{
background: #fff;
}
.nav-title-box{
width: 100%;
height: 100%;
display: flex;
align-items: center;
padding: 0 224rpx 0 24rpx;
position: relative;
padding: 0 24rpx;
/* min-height: 88rpx; */
}
.nav-title-box .title{
.nav-custombox .title{
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
......@@ -47,6 +46,18 @@ page{
font-size: 32rpx;
color: #000;
}
.nav-custombox .num-box{
padding: 0 10rpx;
display: inline-block;
height:30rpx;
line-height: 30rpx;
background:rgba(255,209,70,1);
border-radius:15rpx;
font-size:22rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(0,0,0,1);
}
.top-bar{
width: 100%;
position: fixed;
......@@ -116,60 +127,8 @@ page{
.share-btn-hide {
animation: btnHide .5s forwards;
}
.nav-custombox .nav-title-box .num-box{
/* position: absolute; */
left: 22rpx;
bottom: -15rpx;
padding: 0 10rpx;
display: inline-block;
height:30rpx;
line-height: 30rpx;
background:rgba(255,209,70,1);
border-radius:15rpx;
font-size:22rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(0,0,0,1);
}
.nav-custombox .address-box{
/* padding-top: 30rpx; */
padding-right: 24rpx;
padding-left: 24rpx;
font-size:20rpx;
line-height: 1;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(255,255,255,.94);
display: flex;
align-items: center;
padding-top: 4rpx;
}
.nav-custombox .address-box .map-icon{
width:20rpx;
height:23rpx;
margin-right: 22rpx;
}
.distance-box{
flex: 1;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 20rpx;
}
.nav-custombox .address-box .distance{
font-size:20rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(255,255,255,.94);
padding-right: 20rpx;
}
.nav-custombox .address-box .name{
font-size:20rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(255,255,255,.94);
}
.banner-box{
padding: 0 24rpx;
background: #fff;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment