parent
641a27dc6d
commit
4db01a3a66
@ -1,10 +1,76 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
data: {
|
||||
imageUrl: getApp().globalData.imageUrl,
|
||||
healthCrisis:"background-image: url(" + getApp().globalData.imageUrl + "/health-crisis.png); background-color: #FF463C;height: 834rpx;"
|
||||
},
|
||||
onShow() {
|
||||
|
||||
}
|
||||
healthCrisis: "background-image: url(" + getApp().globalData.imageUrl + "/health-crisis.png);margin-top: 0px; height: 750rpx;",
|
||||
healthGood: "background-image: url(" + getApp().globalData.imageUrl + "/health-good.png);",
|
||||
healthGenerally: "background-image: url(" + getApp().globalData.imageUrl + "/health-generally.png);",
|
||||
healthMedium: "background-image: url(" + getApp().globalData.imageUrl + "/health-medium.png);",
|
||||
healthWarning: "background-image: url(" + getApp().globalData.imageUrl + "/health-warning.png);margin-top: 0px; height: 750rpx;",
|
||||
healthIndex: 100,
|
||||
healthIndexMsg: '非常健康',
|
||||
headlBrand: "",
|
||||
topBg: '',
|
||||
sBrand: '奥迪'
|
||||
},
|
||||
onShow() {
|
||||
let sTimeType = wx.getStorageSync("sTimeType") || 34;
|
||||
let sStartTime = wx.getStorageSync("sStartTime") || '';
|
||||
let sEndTime = wx.getStorageSync("sEndTime") || '';
|
||||
this.getBrand().then((res) => {
|
||||
let headlBrand = res;
|
||||
this.setData({
|
||||
headlBrand: headlBrand
|
||||
})
|
||||
this.getData(sTimeType, sStartTime, sEndTime);
|
||||
}
|
||||
)
|
||||
},
|
||||
getBrand() {
|
||||
return new Promise((resolve, reject) => {
|
||||
app.globalData.request({
|
||||
action: 'getUserMainBrand',
|
||||
token: wx.getStorageSync('token') || 't%2BrswgjvzGM='
|
||||
}).then(res => {
|
||||
this.setData({
|
||||
sBrand: res
|
||||
})
|
||||
resolve(res)
|
||||
}).catch(() => {
|
||||
reject(false)
|
||||
})
|
||||
})
|
||||
},
|
||||
getData(sTimeType, sStartTime, sEndTime) {
|
||||
let obj = {
|
||||
action: "getHealthIndex",
|
||||
sType: "BrandOverview",
|
||||
sTimeType: sTimeType,
|
||||
sBrand: this.data.sBrand,
|
||||
sStartTime: sStartTime,
|
||||
sEndTime: sEndTime,
|
||||
token: wx.getStorageSync('token') || 't%2BrswgjvzGM=',
|
||||
}
|
||||
app.globalData.request(obj).then(res => {
|
||||
let healthIndex = res.healthIndex;
|
||||
let healthIndexMsg = res.healthIndexMsg;
|
||||
let topBg = "";
|
||||
if(healthIndex >= 90) {
|
||||
topBg = '#0084FF'
|
||||
} else if(80 <= healthIndex && healthIndex < 90) {
|
||||
topBg = '#00CA2F'
|
||||
} else if(70 <= healthIndex && healthIndex < 80) {
|
||||
topBg = '#FFCC01'
|
||||
} else if(60 <= healthIndex && healthIndex < 70) {
|
||||
topBg = '#FFA419'
|
||||
} else {
|
||||
topBg = '#FF463C'
|
||||
}
|
||||
this.setData({
|
||||
healthIndex: healthIndex,
|
||||
topBg: topBg,
|
||||
healthIndexMsg: healthIndexMsg
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
@ -1,3 +1,5 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
"usingComponents": {
|
||||
"time-component": "../../components/timecomponent/index"
|
||||
}
|
||||
}
|
@ -1,8 +1,41 @@
|
||||
<view class="bc-container">
|
||||
<view class="bc-top">
|
||||
<view class="bc-top-inner" style="{{healthCrisis}}">
|
||||
<view class="bc-top-fen" style="color: #FF3A30">57.1</view>
|
||||
<view class="bc-top-btn1">严重问题</view>
|
||||
<view class="bc-top" style="background-color: {{topBg}};">
|
||||
<view class="bc-top-inner" style="{{healthCrisis}}" wx:if="{{healthIndex < 60}}">
|
||||
<view class="bc-c-j" style="margin-top: 100rpx;">健康指数</view>
|
||||
<view class="bc-top-fen" style="color: #FF3A30">{{healthIndex}}</view>
|
||||
<view class="bc-top-btn1">{{healthIndexMsg}}</view>
|
||||
<view class="bc-brand">{{headlBrand}}</view>
|
||||
</view>
|
||||
<view class="bc-top-inner" style="{{healthGood}}" wx:if="{{healthIndex >= 90}}">
|
||||
<view class="bc-c-j" style="margin-top: -60rpx;">健康指数</view>
|
||||
<view class="bc-top-fen" style="color: #0284FF">{{healthIndex}}</view>
|
||||
<view class="bc-top-btn1" style="color: #0084FF">{{healthIndexMsg}}</view>
|
||||
<view class="bc-brand">{{headlBrand}}</view>
|
||||
</view>
|
||||
<view class="bc-top-inner" style="{{healthGenerally}}" wx:if="{{80 <= healthIndex && healthIndex < 90}}">
|
||||
<view class="bc-c-j" style="margin-top: -40rpx;">健康指数</view>
|
||||
<view class="bc-top-fen" style="color: #00CA2F">{{healthIndex}}</view>
|
||||
<view class="bc-top-btn1" style="color: #00CA2F">{{healthIndexMsg}}</view>
|
||||
<view class="bc-brand">{{headlBrand}}</view>
|
||||
</view>
|
||||
<view class="bc-top-inner" style="{{healthMedium}}" wx:if="{{70 <= healthIndex && healthIndex < 80}}">
|
||||
<view class="bc-c-j" style="margin-top: 0rpx;">健康指数</view>
|
||||
<view class="bc-top-fen" style="color: #FFCC01">{{healthIndex}}</view>
|
||||
<view class="bc-top-btn1" style="color: #FFCC01">{{healthIndexMsg}}</view>
|
||||
<view class="bc-brand">{{headlBrand}}</view>
|
||||
</view>
|
||||
<view class="bc-top-inner" style="{{healthWarning}}" wx:if="{{60 <= healthIndex && healthIndex < 70}}">
|
||||
<view class="bc-c-j" style="margin-top: 90rpx;">健康指数</view>
|
||||
<view class="bc-top-fen" style="color: #FF9500">{{healthIndex}}</view>
|
||||
<view class="bc-top-btn1" style="color: #FF9500 ">{{healthIndexMsg}}</view>
|
||||
<view class="bc-brand">{{headlBrand}}</view>
|
||||
</view>
|
||||
<view class="bc-top-wj">
|
||||
<image class="bc-tt" src="{{imageUrl}}/trumpet.png"></image>
|
||||
</view>
|
||||
<view class="bc-top-bt"></view>
|
||||
</view>
|
||||
<view class="bc-cont">
|
||||
<time-component></time-component>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,30 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
imageUrl: getApp().globalData.imageUrl,
|
||||
id: ''
|
||||
},
|
||||
onLoad() {
|
||||
wx.setNavigationBarTitle({
|
||||
title: '详情'
|
||||
})
|
||||
let pages = getCurrentPages();
|
||||
let currentPage = pages[pages.length-1]
|
||||
let options = currentPage.options
|
||||
this.setData({
|
||||
id: options.id
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
this.getData()
|
||||
},
|
||||
getData() {
|
||||
app.globalData.request({
|
||||
action: 'getSwsQyQuartz',
|
||||
id: this.data.id,
|
||||
token: wx.getStorageSync('token') || 't%2BrswgjvzGM='
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
})
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,128 @@
|
||||
.d-page {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.d-top {
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
height: 430rpx;
|
||||
background: #006BFF;
|
||||
border-top: 1px solid transparent;
|
||||
}
|
||||
|
||||
.d-top-cp {
|
||||
position: relative;
|
||||
width: 83%;
|
||||
padding: 10px 13px;
|
||||
height: 300rpx;
|
||||
background: rgba(255, 255, 255, 0.2000);
|
||||
border-radius: 4px;
|
||||
border: 1px solid;
|
||||
margin-top: 10px;
|
||||
border-image: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0)) 1 1;
|
||||
}
|
||||
|
||||
.d-top-cp-d1 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.d-top-cp-d1-s1 {
|
||||
padding: 3px 7px;
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
color: #0084FF;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.dtcd1-dd2 {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.d-top-cp-d1-m1 {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
|
||||
.d-top-cp-d1-s2 {
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
color: #98CDFF;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.d-top-cp-d2 {
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.d-top-cp-d3 {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
background: linear-gradient(117deg, rgba(245, 245, 245, 0) 0%, #EEEEEE 50%, rgba(232, 232, 232, 0) 100%);
|
||||
left: 0px;
|
||||
bottom: 53px;
|
||||
}
|
||||
.d-top-cp-d4 {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 93%;
|
||||
height: 50px;
|
||||
bottom: 0px;
|
||||
}
|
||||
.d-top-cp-d4-dd1 {
|
||||
margin-top: 8px;
|
||||
}
|
||||
.b-c-top-bm {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 15px;
|
||||
background-color: #fff;
|
||||
bottom: 0px;
|
||||
left: 0px;
|
||||
border-top-left-radius: 20px;
|
||||
border-top-right-radius: 20px;
|
||||
}
|
||||
.bc-cont {
|
||||
padding: 0px 13px 10px 15px;
|
||||
}
|
||||
.bc-c-d1 {
|
||||
background-color: #fff;
|
||||
padding: 16px;
|
||||
font-size: 12px;
|
||||
color: #333333;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.bc-c-d2 {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
margin-top: 16px;
|
||||
}
|
||||
.bc-c-d3 {
|
||||
position: relative;
|
||||
background-color: #fff;
|
||||
padding: 16px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
.bc-c-d3-dd1 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.bc-c-d3-dd2 {
|
||||
color: #333333;
|
||||
margin-top: 12px;
|
||||
}
|
||||
.bc-c-d3-dd3 {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
margin-top: 12px;
|
||||
}
|
Loading…
Reference in new issue