Browse Source

首页联调

dev
kola-web 3 days ago
parent
commit
04e39b9eb0
  1. BIN
      src/images/bg12.png
  2. 17
      src/pages/drugMap/index.scss
  3. 3
      src/pages/drugMap/index.ts
  4. 11
      src/pages/drugMap/index.wxml
  5. 20
      src/pages/health/index.ts
  6. 18
      src/pages/index/index.scss
  7. 22
      src/pages/index/index.ts
  8. 17
      src/pages/index/index.wxml

BIN
src/images/bg12.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

17
src/pages/drugMap/index.scss

@ -2,22 +2,23 @@ page { @@ -2,22 +2,23 @@ page {
background: #f7fafc;
}
.page-title {
width: 266rpx;
height: 58rpx;
font-size: 36rpx;
color: rgba(51, 51, 51, 1);
padding-right: 100rpx;
}
.page {
.logo {
margin: 436rpx auto 0;
margin: 294rpx auto 0;
display: block;
width: 204rpx;
height: 264rpx;
width: 700rpx;
height: 450rpx;
}
.content {
margin-top: 34rpx;
text-align: center;
font-size: 40rpx;
color: rgba(30, 41, 59, 1);
line-height: 64rpx;
font-size: 36rpx;
color: rgba(148, 163, 184, 1);
line-height: 60rpx;
}
}

3
src/pages/drugMap/index.ts

@ -3,6 +3,9 @@ const _app = getApp<IAppOption>(); @@ -3,6 +3,9 @@ const _app = getApp<IAppOption>();
Page({
data: {},
onLoad() {},
handleBack() {
wx.navigateBack()
},
});
export {}

11
src/pages/drugMap/index.wxml

@ -1,9 +1,14 @@ @@ -1,9 +1,14 @@
<navbar fixed custom-style="background:{{background}}" back>
<image class="page-title" slot="left" src="{{imageUrl}}logo2.png?t={{Timestamp}}"></image>
<view class="page-title" slot="left" bind:tap="handleBack">
<van-icon name="arrow-left" />
</view>
</navbar>
<view class="page" style="background: url('{{imageUrl}}bg6.png?t={{Timestamp}}') no-repeat top center/100%;padding-top: {{pageTop}}rpx;">
<image class="logo" src="{{imageUrl}}bg5.png?t={{Timestamp}}"></image>
<view
class="page"
style="background: url('{{imageUrl}}bg6.png?t={{Timestamp}}') no-repeat top center/100%;padding-top: {{pageTop}}rpx;"
>
<image class="logo" src="/images/bg12.png"></image>
<view class="content">
我们正在全力打造购药地图服务
<view></view>

20
src/pages/health/index.ts

@ -50,6 +50,26 @@ Page({ @@ -50,6 +50,26 @@ Page({
this.setData({ offsetTop: statusBarHeight + navBarHeight })
},
onShow() {
const tabBarParams = app.globalData.tabBarParams || {}
const params = tabBarParams['pages/health/index']
if (params) {
delete tabBarParams['pages/health/index']
app.globalData.tabBarParams = tabBarParams
const query: Record<string, string> = {}
params.split('&').forEach((kv: string) => {
const [k, v] = kv.split('=')
if (k) query[k] = v
})
if (query.tab !== undefined) {
const tab = Number(query.tab)
this.setData({ tab })
if (tab === 2) {
this.getRevisitList()
this.getLastRevisit()
}
return
}
}
if (this._loaded && this.data.tab === 2) {
this.getRevisitList()
this.getLastRevisit()

18
src/pages/index/index.scss

@ -10,6 +10,7 @@ page { @@ -10,6 +10,7 @@ page {
.page {
padding-bottom: 230rpx;
.user {
position: relative;
margin: 32rpx 30rpx 0;
padding-top: 16rpx;
display: flex;
@ -35,6 +36,13 @@ page { @@ -35,6 +36,13 @@ page {
color: #94a3b8;
}
}
.characters {
position: absolute;
right: 0;
bottom: -90rpx;
width: 169rpx;
height: 216rpx;
}
}
.new-gift {
margin: 48rpx 30rpx 0;
@ -58,6 +66,16 @@ page { @@ -58,6 +66,16 @@ page {
margin: 32rpx 30rpx 0;
height: 176rpx;
}
.swiper1 {
margin: 32rpx 30rpx 0;
height: 200rpx;
.s-img {
display: block;
width: 100%;
height: 200rpx;
border-radius: 32rpx;
}
}
.swiper2 {
margin: 32rpx 30rpx 0;
height: 160rpx;

22
src/pages/index/index.ts

@ -240,6 +240,22 @@ Page({ @@ -240,6 +240,22 @@ Page({
url: `/pages/videoDetail/index?id=${Id}&index=${index}`,
})
},
handleBannerTap(e) {
const { linkurl } = e.currentTarget.dataset
if (!linkurl) return
const tabBarPages = ['pages/index/index', 'pages/wall/index', 'pages/health/index', 'pages/my/index']
const [path, query] = linkurl.split('?')
if (tabBarPages.some((p) => path === p || path === `/${p}`)) {
// tabBar 页面:通过 globalData 传参,switchTab 不支持 query
if (query) {
app.globalData.tabBarParams = app.globalData.tabBarParams || {}
app.globalData.tabBarParams[path.replace(/^\//, '')] = query
}
wx.switchTab({ url: path.startsWith('/') ? path : `/${path}` })
} else {
wx.navigateTo({ url: linkurl })
}
},
handlePicTextDetail(e) {
const { index } = e.currentTarget.dataset
const { picTextList } = this.data
@ -254,12 +270,6 @@ Page({ @@ -254,12 +270,6 @@ Page({
})
}
},
handleGift() {
wx.showToast({
title: '功能开发中,敬请期待',
icon: 'none',
})
},
})
export {}

17
src/pages/index/index.wxml

@ -12,17 +12,24 @@ @@ -12,17 +12,24 @@
<view class="name">Hi, {{userInfo.nickName || '用户'}}</view>
<view class="content">星动守护您的第 {{days}} 天~</view>
</view>
</view>
<view class="new-gift" bind:tap="handleGift">
<image class="characters" src="{{imageUrl}}bg5.png?t={{Timestamp}}"></image>
<image class="n-img" src="{{imageUrl}}bg4.png?t={{Timestamp}}"></image>
</view>
<!-- <view class="new-gift" bind:tap="handleGift"> -->
<!-- <image class="characters" src="{{imageUrl}}bg5.png?t={{Timestamp}}"></image> -->
<!-- <image class="n-img" src="{{imageUrl}}bg4.png?t={{Timestamp}}"></image> -->
<!-- </view> -->
<!-- 动态模块:顺序由接口控制 -->
<block wx:for="{{sectionList}}" wx:key="code">
<!-- code: health 健康动态 -->
<view class="kkd" wx:if="{{item.code==='health' && item.visible}}"></view>
<!-- code: spread1 首页banner -->
<view class="banner" wx:if="{{item.code==='spread1' && item.visible}}"></view>
<view class="banner" wx:if="{{item.code==='spread1' && item.visible}}">
<swiper class="swiper1">
<swiper-item wx:for="{{item.subList}}" wx:key="subIndex" wx:for-item="subItem" wx:for-index="subIndex" data-linkurl="{{subItem.linkUrl}}" bind:tap="handleBannerTap">
<image class="s-img" mode="aspectFill" src="{{subItem.img}}"></image>
</swiper-item>
</swiper>
</view>
<!-- code: video-big 大咖说 -->
<view class="video-list" wx:if="{{item.code==='video-big' && item.visible}}">
<view class="v-header">
@ -44,7 +51,7 @@ @@ -44,7 +51,7 @@
<!-- code: spread2 banner2模块 -->
<view class="banner" wx:if="{{item.code==='spread2' && item.visible}}">
<swiper class="swiper2">
<swiper-item wx:for="{{item.subList}}" wx:key="subIndex" wx:for-item="subItem" wx:for-index="subIndex">
<swiper-item wx:for="{{item.subList}}" wx:key="subIndex" wx:for-item="subItem" wx:for-index="subIndex" data-linkurl="{{subItem.linkUrl}}" bind:tap="handleBannerTap">
<image class="s-img" mode="aspectFill" src="{{subItem.img}}"></image>
</swiper-item>
</swiper>

Loading…
Cancel
Save