Browse Source

避高峰·

master
jiazhipeng 11 months ago
parent
commit
913363f0d1
  1. 4
      pages/index/index.wxml
  2. 11
      pages/pbService/sceneComfort/index.js
  3. 73
      pages/pbService/sceneComfort/index.wxml
  4. 126
      pages/pbService/sceneComfort/index.wxss

4
pages/index/index.wxml

@ -86,7 +86,9 @@
<image lazy-load bindtap="gotoUrl" data-event="comfort_click" data-title="ai伴你游" <image lazy-load bindtap="gotoUrl" data-event="comfort_click" data-title="ai伴你游"
data-url="https://m.cloud.sz-trip.com/aiPlay" class="gfyj" data-url="https://m.cloud.sz-trip.com/aiPlay" class="gfyj"
src="https://static.ticket.sz-trip.com/uploads/20250429/4bb075515851ae9a760e60a736a40b5b.png" mode=""/> src="https://static.ticket.sz-trip.com/uploads/20250429/4bb075515851ae9a760e60a736a40b5b.png" mode=""/>
<image lazy-load bindtap="gotoUrls" data-event="xlqc" class="sslk" <!-- <image lazy-load bindtap="gotoUrls" data-event="xlqc" class="sslk"
src="https://static.ticket.sz-trip.com/uploads/20250429/81596463b9f18a3a8d3998a1dd222e7a.png" mode=""/> -->
<image lazy-load class="sslk" bindtap="gotoPath" data-path="/pages/pbService/sceneComfort/index"
src="https://static.ticket.sz-trip.com/uploads/20250429/81596463b9f18a3a8d3998a1dd222e7a.png" mode=""/> src="https://static.ticket.sz-trip.com/uploads/20250429/81596463b9f18a3a8d3998a1dd222e7a.png" mode=""/>
</view> </view>
<!-- 下面几大板块 --> <!-- 下面几大板块 -->

11
pages/pbService/sceneComfort/index.js

@ -43,6 +43,7 @@ Page({
comfortLevel:res.data, comfortLevel:res.data,
comfortObj:comfortObj comfortObj:comfortObj
}) })
this.getList();
}) })
commonApi._post('pbservice/Other/getSuzhouAreas').then(res=>{ commonApi._post('pbservice/Other/getSuzhouAreas').then(res=>{
let areaObj = {} let areaObj = {}
@ -62,7 +63,6 @@ Page({
areas:res.data, areas:res.data,
areaObj:areaObj areaObj:areaObj
}) })
this.getList();
}) })
commonApi._post("pbservice/Comfort/getSceneLevel").then(res=>{ commonApi._post("pbservice/Comfort/getSceneLevel").then(res=>{
console.log(res) console.log(res)
@ -117,6 +117,15 @@ Page({
page_num:10, page_num:10,
scene_level:this.data.sceneLevelIndex>0?this.data.sceneLevel[this.data.sceneLevelIndex].level:null scene_level:this.data.sceneLevelIndex>0?this.data.sceneLevel[this.data.sceneLevelIndex].level:null
}).then(res=>{ }).then(res=>{
let resData = res.data.rows
// 处理舒适度
resData.forEach(v=>{
v.comforLevel = this.data.comfortLevel.find(x=>x.level == v.comfort_level)
// v.comfort_level_str = comforLevel.desc
v.hourflowLeve = this.data.comfortLevel.find(x=>x.level == v.hour_flow_level)
// v.hour_flow_level_str = hourflowLeve.desc
})
this.setData({ this.setData({
list:this.data.list.concat(res.data.rows), list:this.data.list.concat(res.data.rows),
total:res.data.total total:res.data.total

73
pages/pbService/sceneComfort/index.wxml

@ -34,7 +34,7 @@
<text>舒适度:</text> <text>舒适度:</text>
<view wx:if="{{index!=0}}" style="color:{{item.color}}" wx:for="{{comfortLevel}}" class="comfort-level">{{item.desc}}</view> <view wx:if="{{index!=0}}" style="color:{{item.color}}" wx:for="{{comfortLevel}}" class="comfort-level">{{item.desc}}</view>
</view> </view>
<view style="padding-top: 25rpx;" class="comfort-levels">更新时间:2025-05-26 10:00:00</view> <view style="padding-top: 25rpx;" class="comfort-levels" wx:if="{{list[0]}}">更新时间:{{list[0].status_time}}</view>
<view class="comfort-container"> <view class="comfort-container">
<view class="comfort-head"> <view class="comfort-head">
@ -43,37 +43,54 @@
</view> </view>
<view class="comfort-content"> <view class="comfort-content">
<view class="comfort-item" wx:for="{{list}}"> <view class="ai-tip">
<view class="scene-title">{{item.third_scene_name}}</view> <image style="width: 27.67rpx;height: 27.67rpx;" src="https://static.ticket.sz-trip.com/uploads/20250527/c3513e7eb0c43ece5f47a8f044063b64.png"></image>
<view class="comfort-tip"> <text style="padding-left: 12rpx;">本预测趋势图由AI生成,内容仅供参考。</text>
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/comfort1.png" mode="widthFix"></image> </view>
<text style="margin-right:30rpx">{{areaObj[item.area]}}</text>
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/comfort2.png" mode="widthFix"></image> <view class="item-container">
<text>{{sceneLevelObj[item.scene_level]}}</text> <view class="comfort-item" wx:for="{{list}}" wx:key="index">
</view> <image class="comfort-item-img" src="{{item.img_url}}" mode="aspectFill"></image>
<!-- <view class="progress-item"> <view class="comfort-item-content">
<progress percent="{{item.in_count/item.ins_carry_capacity * 100}}" color="{{comfortObj[item.comfort_level].color}}" stroke-width="{{40 * radio}}" border-radius="{{20 * radio}}"></progress> <view class="scene-title">
<view class="progress-text">{{comfortObj[item.comfort_level].name}}/{{item.ins_carry_capacity}}人</view> <view class="textOver">{{item.third_scene_name}}</view>
</view> --> <view class="area-tag" wx:if="{{item.area}}">{{item.area}}</view>
<view class="slevel-tag" wx:if="{{(sceneLevelObj[item.scene_level])}}">{{sceneLevelObj[item.scene_level]}}</view>
<view class="'info'{{item.comfort_level==5?'shushi':''}}{{item.comfort_level==4?'jiaoshushi':''}}{{item.comfort_level==3?'yiban':''}}{{item.comfort_level==2?'jiaoyongji':''}}{{item.comfort_level==1?'yongji':''}}">
<view class="top-info">
<view class="comft">
<view>
当前舒适度:
</view> </view>
<view wx:if="{{item.comfort_level===itemY.level}}" wx:for-item="itemY" style="color:{{itemY.color}}" wx:for="{{comfortLevel}}" class="two">{{itemY.desc}}</view>
</view> <view class="top-info">
<!-- <view class="num"> <view style="flex: 1;flex-shrink: 0;">
瞬时承载量:{{item.ins_carry_capacity}}人 <view class="comft">
</view> --> <view>当前:</view>
<view class="two" style="color: {{item.comforLevel.color}};">{{item.comforLevel.desc}}</view>
</view>
<view class="progress-item">
<progress percent="{{item.ins_carry_capacity/item.max_carry_capacity * 100}}" color="{{item.comforLevel.color}}" stroke-width="{{20 * radio}}" border-radius="{{10 * radio}}"></progress>
</view>
</view>
<view style="flex: 1;flex-shrink: 0;">
<view class="comft">
<view>未来一小时:</view>
<view class="two" style="color: {{item.comforLevel.color}};">{{item.comforLevel.desc}}</view>
</view>
<view class="progress-item">
<progress percent="{{item.hour_flow/item.max_carry_capacity * 100}}" color="{{item.comforLevel.color}}" stroke-width="{{20 * radio}}" border-radius="{{10 * radio}}"></progress>
</view>
</view>
</view>
<view class="other-tip">
<text>更新时间:{{item.status_time}}</text>
</view>
</view> </view>
<view class="other-tip">
<text>更新时间:{{item.status_time}}</text>
</view>
</view>
</view> </view>
</view>
</view> </view>
</view> </view>

126
pages/pbService/sceneComfort/index.wxss

@ -1,33 +1,77 @@
/* pages/pbService/sceneComfort/index.wxss */ /* pages/pbService/sceneComfort/index.wxss */
page { page {
background: #f6f6f6; background: #EDEDED;
} }
.comfort-item { .comfort-item {
margin: 30rpx; display: flex;
background: white; width: 100%;
padding: 30rpx; padding-bottom: 24rpx;
padding-top: 10rpx; }
color: #333; .item-container{
border-radius: 20rpx; width: 100%;
background: white;
padding: 24rpx 10rpx 24rpx 24rpx;
box-sizing: border-box;
border-radius: 20rpx;
}
.comfort-item-img{
width: 172rpx;
height: 224rpx;
flex-shrink: 0;
border-radius: 16rpx;
object-fit: cover;
}
.comfort-item-content{
width: 1rpx;
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
padding:0rpx 0rpx 15rpx 15rpx;
} }
.scene-title { .scene-title {
font-size: 30rpx; font-size: 30rpx;
line-height: 48rpx; line-height: 48rpx;
}
.comfort-tip {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 26rpx; font-weight: 500;
margin-top: 10rpx; font-size: 32rpx;
margin-bottom: 27rpx; color: #000000;
}
.area-tag{
padding: 0 10rpx;
height: 31rpx;
background: rgba(204,168,25,0.4);
border-radius: 4rpx;
line-height: 31rpx;
font-weight: 400;
font-size: 22rpx;
color: #7D5B00;
margin-left: 15rpx;
flex-shrink: 0;
word-break: keep-all;
word-wrap: none;
} }
.comfort-tip image { .slevel-tag{
width: 30rpx; padding: 0 10rpx;
margin-right: 7rpx; height: 31rpx;
background: rgba(204,97,25,0.4);
border-radius: 4rpx;
line-height: 31rpx;
font-weight: 400;
font-size: 22rpx;
color: #CC6119;
margin-left: 15rpx;
flex-shrink: 0;
word-break: keep-all;
word-wrap: none;
} }
.progress-item { .progress-item {
position: relative; position: relative;
margin-top: 14rpx;
width: 176rpx;
} }
.progress-text { .progress-text {
position: absolute; position: absolute;
@ -44,7 +88,6 @@ page {
.other-tip { .other-tip {
font-size: 24rpx; font-size: 24rpx;
color: #888; color: #888;
margin-top: 33rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
@ -125,17 +168,10 @@ font-size: 26rpx;
background: #FFFFFF; background: #FFFFFF;
} }
.two { .two {
padding: 0 12rpx; padding-left: 8rpx;
border-radius: 20rpx;
line-height: 38rpx;
border: 1rpx solid;
margin-left: 10rpx;
font-size: 24rpx; font-size: 24rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #83D851;
} }
.info{ .info{
width: 630rpx; width: 630rpx;
@ -166,13 +202,12 @@ background: rgba(252, 133, 58, .08);
} }
.comft{ .comft{
display: flex; display: flex;
font-size: 24rpx;
font-family: PingFang SC;
font-size: 26rpx; font-weight: 500;
font-family: PingFang SC; color: #333333;
font-weight: 500; align-items: center;
color: #333333; word-break: keep-all;
align-items: center;
} }
.num{ .num{
border-left: 1rpx solid #D8D8D8; border-left: 1rpx solid #D8D8D8;
@ -189,6 +224,7 @@ color: #333333;
padding: 0 30rpx; padding: 0 30rpx;
width: 100%; width: 100%;
margin-top: 30rpx; margin-top: 30rpx;
box-sizing: border-box;
} }
.comfort-container .comfort-head{ .comfort-container .comfort-head{
width: 690rpx; width: 690rpx;
@ -202,4 +238,28 @@ color: #333333;
font-size: 32rpx; font-size: 32rpx;
color: #FFFFFF; color: #FFFFFF;
align-items: flex-end; align-items: flex-end;
} }
.comfort-content{
width: 100%;
background:#EFFAF4;
border-radius: 20rpx;
padding: 24rpx;
box-sizing: border-box;
position: relative;
top: -46rpx;
}
.ai-tip{
height: 67rpx;
background: rgba(255, 150, 0, 0.08);
border-radius: 10rpx;
line-height: 67rpx;
padding: 0 20rpx;
font-weight: 500;
font-size: 25rpx;
color: #FF9900;
width: fit-content;
display: flex;
align-items: center;
margin-bottom: 30rpx;
}

Loading…
Cancel
Save