补充图片
This commit is contained in:
+15
-9
@@ -76,17 +76,23 @@ Page({
|
||||
|
||||
// 添加设备
|
||||
openSearchDevice() {
|
||||
let token = this.data.token;
|
||||
let userInfo = this.data.userInfo;
|
||||
if (token && userInfo) {
|
||||
// let token = this.data.token;
|
||||
// let userInfo = this.data.userInfo;
|
||||
// if (token && userInfo) {
|
||||
wx.navigateTo({
|
||||
url: "/pages/searchDevice/searchDevice"
|
||||
})
|
||||
} else {
|
||||
wx.showToast({
|
||||
icon: "none",
|
||||
title: "请先登录"
|
||||
})
|
||||
}
|
||||
// } else {
|
||||
// wx.showToast({
|
||||
// icon: "none",
|
||||
// title: "请先登录"
|
||||
// })
|
||||
// }
|
||||
},
|
||||
|
||||
openDeviceInfo() {
|
||||
wx.navigateTo({
|
||||
url: "/pages/deviceInfo/deviceInfo"
|
||||
})
|
||||
}
|
||||
})
|
||||
+21
-16
@@ -6,12 +6,7 @@
|
||||
<view class="title">
|
||||
<view>
|
||||
<view>
|
||||
<block wx:if="{{userInfo && userInfo.avatar}}">
|
||||
<image src="{{userInfo.avatar}}" />
|
||||
</block>
|
||||
<block wx:else>
|
||||
<image src="/images/home/user.png" />
|
||||
</block>
|
||||
<image src="/images/home/user.png" />
|
||||
</view>
|
||||
<block wx:if="{{userInfo && token}}">
|
||||
<view>{{userInfo.realname}}</view>
|
||||
@@ -24,14 +19,24 @@
|
||||
<view>注重更好的健康生活品质</view>
|
||||
<view></view>
|
||||
</view>
|
||||
<view class="device">
|
||||
<view>请添加设备</view>
|
||||
<view>添加设备后,解锁更多体验</view>
|
||||
<block wx:if="{{userInfo && token}}">
|
||||
<view bind:tap="openSearchDevice">添加设备</view>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<view bind:tap="openLoginOrReg">登录/注册</view>
|
||||
</block>
|
||||
</view>
|
||||
<block wx:if="{{deviceList && deviceList.length}}">
|
||||
<view class="device" bind:tap="openDeviceInfo">
|
||||
<view>
|
||||
<image src="/images/devices/{{deviceList[0].type}}.png" />
|
||||
</view>
|
||||
<view>设备名称:{{deviceList[0].equipmentName}}</view>
|
||||
</view>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<view class="addDevice">
|
||||
<view>请添加设备</view>
|
||||
<view>添加设备后,解锁更多体验</view>
|
||||
<!-- <block wx:if="{{userInfo && token}}"> -->
|
||||
<view bind:tap="openSearchDevice">添加设备</view>
|
||||
<!-- </block>
|
||||
<block wx:else>
|
||||
<view bind:tap="openLoginOrReg">登录/注册</view>
|
||||
</block> -->
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
+23
-3
@@ -80,11 +80,31 @@
|
||||
}
|
||||
|
||||
.device {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.device>view:nth-of-type(1) {
|
||||
width: 500rpx;
|
||||
height: 500rpx;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.device>view:nth-of-type(2) {
|
||||
color: #ffffff;
|
||||
width: 100%;
|
||||
height: 32rpx;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
line-height: 32rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.addDevice {
|
||||
width: 580rpx;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.device>view:nth-of-type(1) {
|
||||
.addDevice>view:nth-of-type(1) {
|
||||
color: #FFFFFF;
|
||||
width: 100%;
|
||||
height: 36rpx;
|
||||
@@ -95,7 +115,7 @@
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.device>view:nth-of-type(2) {
|
||||
.addDevice>view:nth-of-type(2) {
|
||||
color: #FFFFFF;
|
||||
width: 100%;
|
||||
height: 30rpx;
|
||||
@@ -105,7 +125,7 @@
|
||||
margin-bottom: 80rpx;
|
||||
}
|
||||
|
||||
.device>view:nth-of-type(3) {
|
||||
.addDevice>view:nth-of-type(3) {
|
||||
color: #FFFFFF;
|
||||
width: 100%;
|
||||
height: 106rpx;
|
||||
|
||||
Reference in New Issue
Block a user