Commit 934b48d6 authored by lvtz's avatar lvtz

fix

parent e32737d0
<view class="topbar" style="padding-top: {{statusBarHeight}}px"> <view class="topbar" style="padding-top: {{statusBarHeight}}px">
<view class="nav-contentbox"> <view class="nav-contentbox" style="height: {{titleBarHeight}}px">
<slot name="navcustom"></slot> <slot name="navcustom"></slot>
</view> </view>
</view> </view>
\ No newline at end of file
...@@ -7,8 +7,5 @@ ...@@ -7,8 +7,5 @@
z-index: 99; z-index: 99;
} }
.nav-contentbox{ .nav-contentbox{
/* width: 100%; width: 100%;
display: flex;
align-items: center;
justify-content: center */
} }
\ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</view> </view>
<view class="address-box" > <view class="address-box" >
<view class="content" > <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" > <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> <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> </view>
......
...@@ -131,27 +131,27 @@ Page({ ...@@ -131,27 +131,27 @@ Page({
this.clockListGet(); this.clockListGet();
const myLocation = LocalStorage.getItem('myLocation'); const myLocation = LocalStorage.getItem('myLocation');
const that = this; const that = this;
if (myLocation) { // if (myLocation) {
this.setData({ // this.setData({
latitude: Number(myLocation.split('-')[0]), // latitude: Number(myLocation.split('-')[0]),
longitude: Number(myLocation.split('-')[1]), // longitude: Number(myLocation.split('-')[1]),
}) // })
} else { // } else {
wx.getLocation({ // wx.getLocation({
type: 'wgs84', // type: 'wgs84',
success(res) { // success(res) {
const { // const {
latitude, // latitude,
longitude // longitude
} = res; // } = res;
LocalStorage.setItem('myLocation', latitude + '-' + longitude) // LocalStorage.setItem('myLocation', latitude + '-' + longitude)
that.setData({ // that.setData({
latitude: latitude, // latitude: latitude,
longitude: longitude, // longitude: longitude,
}) // })
} // }
}) // })
} // }
wx.login({ wx.login({
success(res) { success(res) {
...@@ -592,29 +592,29 @@ Page({ ...@@ -592,29 +592,29 @@ Page({
if (data) { if (data) {
const myLocation = LocalStorage.getItem('myLocation'); const myLocation = LocalStorage.getItem('myLocation');
const that = this; const that = this;
if (myLocation) { // if (myLocation) {
this.setData({ // this.setData({
latitude: Number(myLocation.split('-')[0]), // latitude: Number(myLocation.split('-')[0]),
longitude: Number(myLocation.split('-')[1]), // longitude: Number(myLocation.split('-')[1]),
}) // })
data.distance = getFlatternDistance(this.data.latitude, this.data.longitude, Number(data.latitude), Number(data.longitude)) // data.distance = getFlatternDistance(this.data.latitude, this.data.longitude, Number(data.latitude), Number(data.longitude))
} else { // } else {
wx.getLocation({ // wx.getLocation({
type: 'wgs84', // type: 'wgs84',
success(res) { // success(res) {
const { // const {
latitude, // latitude,
longitude // longitude
} = res; // } = res;
LocalStorage.setItem('myLocation', latitude + '-' + longitude) // LocalStorage.setItem('myLocation', latitude + '-' + longitude)
that.setData({ // that.setData({
latitude: latitude, // latitude: latitude,
longitude: longitude, // longitude: longitude,
'schoolInfo.distance': getFlatternDistance(latitude,longitude, Number(data.latitude), Number(data.longitude)) // 'schoolInfo.distance': getFlatternDistance(latitude,longitude, Number(data.latitude), Number(data.longitude))
}) // })
} // }
}) // })
} // }
data.banner = data.banner ? JSON.parse(data.banner) : ''; data.banner = data.banner ? JSON.parse(data.banner) : '';
// 排序处理,体验课放在第三位 // 排序处理,体验课放在第三位
let dataSort = ''; let dataSort = '';
......
<wxs src="../../../filter/index.wxs" module="filter" /> <wxs src="../../../filter/index.wxs" module="filter" />
<view class="scroll-container-box" > <view class="scroll-container-box" >
<view class="nav-custombox" style="padding-top: {{statusBarHeight}}px"> <custom-header>
<view class="nav-title-box" style="height: {{titleBarHeight}}px"> <view class="nav-custombox" slot="navcustom">
<view class="title">{{schoolInfo.title?schoolInfo.title:schoolDetail.title}}</view> <view class="title">{{schoolInfo.title?schoolInfo.title:schoolDetail.title}}</view>
<view class="num-box">{{schoolInfo.join_count?schoolInfo.join_count:500}}人想学</view> <view class="num-box">{{schoolInfo.join_count?schoolInfo.join_count:500}}人想学</view>
</view> </view>
<view class="address-box"> </custom-header>
<image class="map-icon" src="{{imageRoot}}2c/websiteindex/map-icon.png?{{imageVersion}}"></image>
<view class="distance-box"> <view class="container" bindtouchmove="touchStart" bindtouchend="touchEnd" style="padding-bottom: {{websiteCourses.switch==1? '105rpx': '0'}};padding-top: {{navH!=0?navH:40}}px">
<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'}}">
<view class="share-btn-wrapper" style="top:{{titleBarHeight+statusBarHeight+50}}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':''}}" > <view class="share-btn {{shareBtnShow==1?'share-btn-hide':''}} {{shareBtnShow==2?'share-btn-show':''}}" >
<button open-type="share"></button> <button open-type="share"></button>
......
...@@ -30,15 +30,14 @@ page{ ...@@ -30,15 +30,14 @@ page{
margin-top: 24rpx; margin-top: 24rpx;
} }
.nav-custombox{ .nav-custombox{
background: #fff; width: 100%;
} height: 100%;
.nav-title-box{
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 224rpx 0 24rpx; padding: 0 24rpx;
position: relative; /* min-height: 88rpx; */
} }
.nav-title-box .title{ .nav-custombox .title{
overflow: hidden; overflow: hidden;
text-overflow:ellipsis; text-overflow:ellipsis;
white-space: nowrap; white-space: nowrap;
...@@ -47,6 +46,18 @@ page{ ...@@ -47,6 +46,18 @@ page{
font-size: 32rpx; font-size: 32rpx;
color: #000; 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{ .top-bar{
width: 100%; width: 100%;
position: fixed; position: fixed;
...@@ -116,60 +127,8 @@ page{ ...@@ -116,60 +127,8 @@ page{
.share-btn-hide { .share-btn-hide {
animation: btnHide .5s forwards; 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{ .banner-box{
padding: 0 24rpx; padding: 0 24rpx;
background: #fff; 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