Commit 5a49aea7 authored by wangxuelai's avatar wangxuelai

Merge remote-tracking branch 'origin/20190918_lvtz' into wxl-develop

parents 7a47f1d1 9de74c09
......@@ -54,27 +54,25 @@ Page({
this.analyzeclasshourGet(1);
this.analyzeclasshourGet(2);
this.analyzeclasscourseGet();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
const {
chartData,
allcount,
count1,
count2,
count3
} = this.data;
try {
var res = wx.getSystemInfoSync();
this.data.windowWidth = res.windowWidth;
this.setData({
windowWidth: res.windowWidth
})
} catch (e) {
console.error('getSystemInfoSync failed!');
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
......@@ -235,6 +233,7 @@ Page({
});
},
initRingChart(index,data){
let canvasWidth = this.data.windowWidth/3 || 125;
this.data.ringChart[index] = new wxCharts({
animation: true,
canvasId: `ringCanvas${index}`,
......@@ -242,31 +241,30 @@ Page({
extra: {
ringWidth: 14,
pie: {
offsetAngle: -90
}
},
title: {
name: `${data.course_time_rate}%`,
name: `${(data.course_time_rate*100).toFixed(2)}%`,
color: '#000000',
fontSize: 12
},
series: [{
name: '成交量1',
data: data.course_time_rate,
name: '已完成',
data: data.course_time_rate*100,
stroke: false,
color: '#FFB97A',
}, {
name: '成交量2',
data: 100 - data.course_time_rate,
name: '除去已完成',
data: 100 - data.course_time_rate*100,
stroke: false,
color: '#FFEBD9',
}],
disablePieStroke: true,
width: 140,
height: 140,
width: canvasWidth,
height: canvasWidth,
dataLabel: false,
legend: false,
background: '#f5f5f5',
padding: 0
});
}
......
......@@ -28,21 +28,21 @@
<view class="chart-box" wx:if="{{classCours.length>0}}">
<view class="chart-item" wx:if="{{classCours[0]}}">
<view class="canvas-box" >
<canvas canvas-id="ringCanvas1" class="ringcanvas"></canvas>
<canvas canvas-id="ringCanvas1" class="ringcanvas" style="width: {{windowWidth? windowWidth/3: 125}}px;height: {{windowWidth? windowWidth/3: 125}}px;"></canvas>
</view>
<view class="name" >{{classCours[0].title}}</view>
<view class="count" >{{classCours[0].course_time}}课时</view>
</view>
<view class="chart-item" wx:if="{{classCours[1]}}">
<view class="canvas-box" >
<canvas canvas-id="ringCanvas2" class="ringcanvas"></canvas>
<canvas canvas-id="ringCanvas2" class="ringcanvas" style="width: {{windowWidth? windowWidth/3: 125}}px;height: {{windowWidth? windowWidth/3: 125}}px;"></canvas>
</view>
<view class="name" >{{classCours[1].title}}</view>
<view class="count" >{{classCours[1].course_time}}课时</view>
</view>
<view class="chart-item" wx:if="{{classCours[2]}}">
<view class="canvas-box" >
<canvas canvas-id="ringCanvas3" class="ringcanvas"></canvas>
<canvas canvas-id="ringCanvas3" class="ringcanvas" style="width: {{windowWidth? windowWidth/3: 125}}px;height: {{windowWidth? windowWidth/3: 125}}px;" ></canvas>
</view>
<view class="name" >{{classCours[2].title}}</view>
<view class="count" >{{classCours[2].course_time}}课时</view>
......
......@@ -4,10 +4,12 @@
height: 200px;
}
.ringcanvas{
width:100%;
height: 140px;
width: 250rpx;
height: 250rpx;
}
.container{
padding-bottom: 120rpx;
}
.container{}
.column-chart-box{
padding: 0 24rpx;
}
......@@ -93,10 +95,25 @@
.ring-chart-box .chart-box{
display: flex;
position: relative;
left: -18rpx;
}
.ring-chart-box .chart-box .chart-item{
width: 33%;
flex: 1;
overflow: hidden;
max-width: 33.33%;
}
.ring-chart-box .chart-box .chart-item .canvas-box{
position: relative;
}
.ring-chart-box .chart-box .chart-item .canvas-box::after{
content: '';
width: 180rpx;
height: 180rpx;
border: 1px solid rgba(255,185,122,1);
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.ring-chart-box .chart-box .chart-item .name{
font-size:24rpx;
......
<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="{{imageRoot}}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;
......@@ -226,6 +185,7 @@ page{
justify-content: center;
position: relative;
margin: 0 auto;
overflow: hidden;
}
.booking-box .text{
font-size: 30rpx;
......
......@@ -309,7 +309,7 @@ Page({
school_id: this.data.sid, //机构维度
type: 6,
page: this.data.page,
perPage: 999
perPage: 100
}).then((res) => {
const {
code,
......
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