Browse Source

Merge branch 'master' into dev_master

master
jiazhipeng 9 months ago
parent
commit
3380603155
  1. 15
      pages/index/index.js
  2. 11
      pages/index/index.wxml
  3. 18
      pages/index/index.wxss

15
pages/index/index.js

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

18
pages/index/index.wxss

@ -38,7 +38,7 @@
flex: 1; flex: 1;
width: 100%; width: 100%;
height: 64rpx; height: 64rpx;
border-radius: 27rpx; border-radius: 36rpx;
color: #666666; color: #666666;
display: flex; display: flex;
align-items: center; align-items: center;
@ -926,3 +926,19 @@
padding: 15rpx 10rpx; padding: 15rpx 10rpx;
box-sizing: border-box; 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