Browse Source

天气客服

master
jiazhipeng 9 months ago
parent
commit
6fbd39d453
  1. 15
      pages/index/index.js
  2. 11
      pages/index/index.wxml
  3. 20
      pages/index/index.wxss

15
pages/index/index.js

@ -445,7 +445,7 @@ Page({
this.getList() // 回购榜
this.getRepurchaseList()
// this.getWeather() // 2025-5-26首页改版不需要天气了
this.getWeather() // 2025-5-26首页改版不需要天气了
// this.getFourProduct() // 活动日历
wx.getLocation({
@ -475,6 +475,17 @@ Page({
}
},
gotoPath(e) {
if (e.currentTarget.dataset.path){
wx.navigateTo({
url: e.currentTarget.dataset.path,
})
return
}
},
// 获取系统信息
getHeight() {
let systemInfo = wx.getSystemInfoSync(),
@ -577,6 +588,8 @@ Page({
})
},
// --------------------banner 相关---------------------------
// 获取banner 和开屏广告
getBanner: function() {

11
pages/index/index.wxml

@ -17,10 +17,17 @@
<view class="dot{{index===activeBannerIndex?' active':''}}" wx:for="{{banner}}" wx:key="index"></view>
</view> -->
<view class="top-box" style="top: {{systemStyle.padHeight}}px;right:{{systemStyle.right+20}}px">
<view class="top-box" style="top: {{systemStyle.padHeight}}px;right:{{systemStyle.right+10}}px">
<view wx:if="{{weather}}" style="display: flex;flex-shrink: 0;">
<image lazy-load src="{{weather.icon2}}" style="margin-left:0" mode="aspectFill"></image>
<view class="weather-num">{{weather.max_temp}}°</view>
<view class="weather">{{weather.weather}}</view>
<image style="margin: 0 30rpx;" lazy-load bindtap="gotoPath" data-path="/pages/user/service/index"
src="https://static.ticket.sz-trip.com/uploads/20250714/1f3ac6a7144c6e6849edad89289061cc.png" mode="aspectFill"></image>
</view>
<navigator url="/pages/search/index" catchtap="pagePoint" data-event="search_click" class="search-box textOver">
<image src="https://static.ticket.sz-trip.com/uploads/20250526/f7cbe782688db5e39d30a24e4a2724b6.png" class="iconfont" style="width: 26rpx;height: 26rpx;"></image>
<view class="textOver" >搜一搜您想要的</view>
<view class="textOver" style="color:#000000">搜索您想要的</view>
</navigator>
</view>

20
pages/index/index.wxss

@ -38,7 +38,7 @@
flex: 1;
width: 100%;
height: 64rpx;
border-radius: 27rpx;
border-radius: 36rpx;
color: #666666;
display: flex;
align-items: center;
@ -925,4 +925,20 @@
border-radius: 13rpx;
padding: 15rpx 10rpx;
box-sizing: border-box;
}
}
.top-box .weather-num,.top-box .weather {
flex-shrink: 0;
color: #333;
}
.top-box .weather-num {
font-size: 29rpx;
margin-bottom: 10rpx;
margin-left: 4rpx;
}
.top-box .weather {
font-size: 19rpx;
margin-top: 20rpx;
margin-left: -6rpx;
margin-right: 0rpx;
}
Loading…
Cancel
Save