diff --git a/miniprogram/app.json b/miniprogram/app.json index 56e765a..cd6f43d 100644 --- a/miniprogram/app.json +++ b/miniprogram/app.json @@ -1,33 +1,72 @@ { - "pages": [ - "pages/supplementPersonal/supplementPersonal", - "pages/login/login" - ], - "window": {}, - "style": "v2", - "rendererOptions": { - "skyline": { - "defaultDisplayBlock": true, - "disableABTest": true, - "sdkVersionBegin": "3.0.0", - "sdkVersionEnd": "15.255.255" - } - }, - "componentFramework": "glass-easel", - "sitemapLocation": "sitemap.json", - "lazyCodeLoading": "requiredComponents", - "plugins": { - "ppScale-plugin": { - "version": "0.0.31", - "provider": "wx0826af4e4908f524" - } - }, - "permission": { - "scope.userLocation": { - "desc": "您的位置信息将用于发现附近的蓝牙设备,以便连接蓝牙秤。" - } - }, - "requiredPrivateInfos": [ - "getLocation" - ] + "pages": [ + "pages/home/home", + "pages/login/login", + "pages/supplementPersonal/supplementPersonal", + "pages/equipment/equipment", + "pages/data/data", + "pages/my/my" + ], + "usingComponents": { + "empty-data": "/components/emptyData/emptyData" + }, + "window": {}, + "tabBar": { + "color": "#999999", + "selectedColor": "#000000", + "backgroundColor": "#ffffff", + "borderStyle": "black", + "list": [ + { + "pagePath": "pages/home/home", + "text": "首页", + "iconPath": "images/tabBar/home_default.png", + "selectedIconPath": "images/tabBar/home.png" + }, + { + "pagePath": "pages/equipment/equipment", + "text": "设备", + "iconPath": "images/tabBar/equipment_default.png", + "selectedIconPath": "images/tabBar/equipment.png" + }, + { + "pagePath": "pages/data/data", + "text": "数据", + "iconPath": "images/tabBar/data_default.png", + "selectedIconPath": "images/tabBar/data.png" + }, + { + "pagePath": "pages/my/my", + "text": "我的", + "iconPath": "images/tabBar/my_default.png", + "selectedIconPath": "images/tabBar/my.png" + } + ] + }, + "style": "v2", + "rendererOptions": { + "skyline": { + "defaultDisplayBlock": true, + "disableABTest": true, + "sdkVersionBegin": "3.0.0", + "sdkVersionEnd": "15.255.255" + } + }, + "componentFramework": "glass-easel", + "sitemapLocation": "sitemap.json", + "lazyCodeLoading": "requiredComponents", + "plugins": { + "ppScale-plugin": { + "version": "0.0.31", + "provider": "wx0826af4e4908f524" + } + }, + "permission": { + "scope.userLocation": { + "desc": "您的位置信息将用于发现附近的蓝牙设备,以便连接蓝牙秤。" + } + }, + "requiredPrivateInfos": [ + "getLocation" + ] } \ No newline at end of file diff --git a/miniprogram/components/emptyData/emptyData.json b/miniprogram/components/emptyData/emptyData.json new file mode 100644 index 0000000..ac28323 --- /dev/null +++ b/miniprogram/components/emptyData/emptyData.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/miniprogram/components/emptyData/emptyData.less b/miniprogram/components/emptyData/emptyData.less new file mode 100644 index 0000000..c18626b --- /dev/null +++ b/miniprogram/components/emptyData/emptyData.less @@ -0,0 +1,18 @@ +.empty { + display: flex; + flex-direction: column; + align-items: center; + padding-top: 80rpx; + + .empty-icon { + width: 193rpx; + height: 138rpx; + margin-bottom: 30rpx; + } + + .empty-text { + color: #808080; + font-size: 28rpx; + line-height: 28rpx; + } +} diff --git a/miniprogram/components/emptyData/emptyData.ts b/miniprogram/components/emptyData/emptyData.ts new file mode 100644 index 0000000..46e9c36 --- /dev/null +++ b/miniprogram/components/emptyData/emptyData.ts @@ -0,0 +1,21 @@ +// emptyData.ts +Component({ + properties: { + text: { + type: String, + value: '暂无数据' + }, + iconSrc: { + type: String, + value: '/images/emptyData.png' + }, + containerStyle: { + type: String, + value: '' + }, + textStyle: { + type: String, + value: '' + } + } +}) diff --git a/miniprogram/components/emptyData/emptyData.wxml b/miniprogram/components/emptyData/emptyData.wxml new file mode 100644 index 0000000..a701fd4 --- /dev/null +++ b/miniprogram/components/emptyData/emptyData.wxml @@ -0,0 +1,6 @@ + + + + + {{text}} + diff --git a/miniprogram/images/emptyData.png b/miniprogram/images/emptyData.png new file mode 100644 index 0000000..9a7fab2 Binary files /dev/null and b/miniprogram/images/emptyData.png differ diff --git a/miniprogram/images/home/header.jpg b/miniprogram/images/home/header.jpg new file mode 100644 index 0000000..a6138b3 Binary files /dev/null and b/miniprogram/images/home/header.jpg differ diff --git a/miniprogram/images/home/lianjie.png b/miniprogram/images/home/lianjie.png new file mode 100644 index 0000000..7f68b2e Binary files /dev/null and b/miniprogram/images/home/lianjie.png differ diff --git a/miniprogram/images/tabBar/data.png b/miniprogram/images/tabBar/data.png new file mode 100644 index 0000000..c203668 Binary files /dev/null and b/miniprogram/images/tabBar/data.png differ diff --git a/miniprogram/images/tabBar/data_default.png b/miniprogram/images/tabBar/data_default.png new file mode 100644 index 0000000..a837ba7 Binary files /dev/null and b/miniprogram/images/tabBar/data_default.png differ diff --git a/miniprogram/images/tabBar/equipment.png b/miniprogram/images/tabBar/equipment.png new file mode 100644 index 0000000..d0002ff Binary files /dev/null and b/miniprogram/images/tabBar/equipment.png differ diff --git a/miniprogram/images/tabBar/equipment_default.png b/miniprogram/images/tabBar/equipment_default.png new file mode 100644 index 0000000..779f3b6 Binary files /dev/null and b/miniprogram/images/tabBar/equipment_default.png differ diff --git a/miniprogram/images/tabBar/home.png b/miniprogram/images/tabBar/home.png new file mode 100644 index 0000000..70d8fb1 Binary files /dev/null and b/miniprogram/images/tabBar/home.png differ diff --git a/miniprogram/images/tabBar/home_default.png b/miniprogram/images/tabBar/home_default.png new file mode 100644 index 0000000..5f52e32 Binary files /dev/null and b/miniprogram/images/tabBar/home_default.png differ diff --git a/miniprogram/images/tabBar/my.png b/miniprogram/images/tabBar/my.png new file mode 100644 index 0000000..54b2ec9 Binary files /dev/null and b/miniprogram/images/tabBar/my.png differ diff --git a/miniprogram/images/tabBar/my_default.png b/miniprogram/images/tabBar/my_default.png new file mode 100644 index 0000000..8825219 Binary files /dev/null and b/miniprogram/images/tabBar/my_default.png differ diff --git a/miniprogram/pages/data/data.json b/miniprogram/pages/data/data.json new file mode 100644 index 0000000..8583a1b --- /dev/null +++ b/miniprogram/pages/data/data.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "black" , + "navigationBarBackgroundColor": "#FFFFFF" +} \ No newline at end of file diff --git a/miniprogram/pages/data/data.less b/miniprogram/pages/data/data.less new file mode 100644 index 0000000..0fc8a7a --- /dev/null +++ b/miniprogram/pages/data/data.less @@ -0,0 +1 @@ +/* pages/data/data.wxss */ \ No newline at end of file diff --git a/miniprogram/pages/data/data.ts b/miniprogram/pages/data/data.ts new file mode 100644 index 0000000..00b3760 --- /dev/null +++ b/miniprogram/pages/data/data.ts @@ -0,0 +1,66 @@ +// pages/data/data.ts +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad() { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/miniprogram/pages/data/data.wxml b/miniprogram/pages/data/data.wxml new file mode 100644 index 0000000..417d32e --- /dev/null +++ b/miniprogram/pages/data/data.wxml @@ -0,0 +1,2 @@ + +pages/data/data.wxml \ No newline at end of file diff --git a/miniprogram/pages/equipment/equipment.json b/miniprogram/pages/equipment/equipment.json new file mode 100644 index 0000000..326bb13 --- /dev/null +++ b/miniprogram/pages/equipment/equipment.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "black" , + "navigationBarBackgroundColor": "#FFFFFF" +} \ No newline at end of file diff --git a/miniprogram/pages/equipment/equipment.less b/miniprogram/pages/equipment/equipment.less new file mode 100644 index 0000000..3382fb4 --- /dev/null +++ b/miniprogram/pages/equipment/equipment.less @@ -0,0 +1 @@ +/* pages/equipment/equipment.wxss */ \ No newline at end of file diff --git a/miniprogram/pages/equipment/equipment.ts b/miniprogram/pages/equipment/equipment.ts new file mode 100644 index 0000000..0cb72be --- /dev/null +++ b/miniprogram/pages/equipment/equipment.ts @@ -0,0 +1,66 @@ +// pages/equipment/equipment.ts +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad() { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/miniprogram/pages/equipment/equipment.wxml b/miniprogram/pages/equipment/equipment.wxml new file mode 100644 index 0000000..9d50783 --- /dev/null +++ b/miniprogram/pages/equipment/equipment.wxml @@ -0,0 +1,2 @@ + +pages/equipment/equipment.wxml \ No newline at end of file diff --git a/miniprogram/pages/home/home.json b/miniprogram/pages/home/home.json new file mode 100644 index 0000000..d2a12c7 --- /dev/null +++ b/miniprogram/pages/home/home.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationStyle": "custom" +} \ No newline at end of file diff --git a/miniprogram/pages/home/home.less b/miniprogram/pages/home/home.less new file mode 100644 index 0000000..4466927 --- /dev/null +++ b/miniprogram/pages/home/home.less @@ -0,0 +1,496 @@ +.header { + width: 100%; + position: relative; + height: 450rpx; + margin-bottom: 25rpx; + + .bg { + width: 100%; + height: 450rpx; + } + + .device { + position: absolute; + z-index: 2; + top: 285rpx; + left: 60rpx; + right: 60rpx; + bottom: 0; + display: flex; + align-items: center; + + .device-icon { + width: 90rpx; + height: 90rpx; + overflow: hidden; + border-radius: 24rpx; + margin-right: 24rpx; + } + + .device-info { + flex: 1; + + .device-name { + color: #FFFFFF; + font-size: 32rpx; + font-weight: 700; + line-height: 36rpx; + margin-bottom: 14rpx; + } + + .device-status { + display: flex; + align-items: center; + + .status-dot { + width: 12rpx; + height: 12rpx; + border-radius: 50%; + margin-right: 10rpx; + } + + .dot-on { + background-color: #FFFFFF; + } + + .dot-off { + background-color: rgba(255, 255, 255, 0.5); + } + + .status-text { + color: #FFFFFF; + font-size: 28rpx; + line-height: 28rpx; + } + } + } + + .device-switch { + color: #FFFFFF; + height: 48rpx; + padding: 0 20rpx; + font-size: 24rpx; + font-weight: 500; + line-height: 44rpx; + border-radius: 8rpx; + box-sizing: border-box; + border: 2rpx solid #FFFFFF; + } + } +} + +.scrollViewContent { + width: 100%; + padding: 0 30rpx; + box-sizing: border-box; + + /* ===== 最近测量卡 ===== */ + .weight-card { + width: 100%; + position: relative; + margin-bottom: 24rpx; + padding: 2rpx 2rpx 50rpx; + border-radius: 24rpx; + box-sizing: border-box; + background-color: #FFFFFF; + + /* 卡头(带渐变背景) */ + .card-header { + width: 100%; + height: 88rpx; + padding-left: 30rpx; + padding-right: 10rpx; + box-sizing: border-box; + display: flex; + align-items: center; + margin-bottom: 18rpx; + justify-content: space-between; + background: linear-gradient(180deg, rgba(211, 233, 255, 0.6) 0%, rgba(252, 251, 253, 0.6) 100%); + + .card-header-left { + display: flex; + align-items: center; + + .card-title-bar { + width: 6rpx; + height: 24rpx; + border-radius: 3rpx; + background-color: #1385FA; + margin-right: 14rpx; + } + + .card-title { + color: #252535; + font-size: 30rpx; + font-weight: 700; + line-height: 30rpx; + } + } + + .card-header-right { + display: flex; + align-items: center; + + .link-text { + color: #77849E; + font-size: 24rpx; + line-height: 24rpx; + } + + .arrow { + padding-right: 40rpx; + box-sizing: border-box; + } + } + } + + .card-content { + width: 100%; + padding: 0 30rpx; + box-sizing: border-box; + + /* ===== 最近测量:体重主数据行 ===== */ + .weight-row { + display: flex; + align-items: flex-end; + margin-bottom: 30rpx; + + .weight-main { + flex: 1; + display: flex; + flex-direction: column; + + .weight-num-wrap { + height: 96rpx; + display: flex; + margin-bottom: 20rpx; + align-items: baseline; + + .weight-int { + color: #252535; + height: 96rpx; + font-size: 96rpx; + font-weight: bold; + line-height: 96rpx; + } + + .weight-dec { + color: #252535; + font-size: 56rpx; + font-weight: bold; + line-height: 56rpx; + margin-right: 6rpx; + } + + .weight-unit { + color: #808080; + font-size: 28rpx; + font-weight: bold; + line-height: 28rpx; + } + } + + .weight-date { + color: #B6B6B6; + height: 24rpx; + font-size: 24rpx; + line-height: 24rpx; + } + } + + /* 右侧变化量 */ + .weight-diff { + width: 250rpx; + display: flex; + flex-direction: column; + align-items: flex-start; + + .diff-num-wrap { + display: flex; + align-items: flex-end; + margin-bottom: 14rpx; + + .diff-num { + height: 48rpx; + font-size: 48rpx; + font-weight: bold; + line-height: 48rpx; + margin-right: 6rpx; + } + + .diff-unit { + position: relative; + color: #808080; + height: 28rpx; + font-weight: bold; + font-size: 28rpx; + line-height: 28rpx; + + text { + position: absolute; + left: 0; + bottom: 42rpx; + } + } + + /* 向下箭头(减轻) */ + .arrow-down { + border-left: 10rpx solid transparent; + border-right: 10rpx solid transparent; + border-top: 16rpx solid #2AC79F; + } + + /* 向上箭头(增重) */ + .arrow-up { + border-left: 10rpx solid transparent; + border-right: 10rpx solid transparent; + border-bottom: 16rpx solid #FF4D4F; + } + + .diff-down { + color: #2AC79F; + } + + .diff-up { + color: #FF4D4F; + } + + .diff-neutral { + color: #000000; + } + } + + .diff-label { + color: #B6B6B6; + font-size: 24rpx; + line-height: 28rpx; + margin-top: 8rpx; + } + } + } + + /* 分割线 */ + .card-divider { + width: 100%; + height: 2rpx; + background-color: #EAECF1; + margin-bottom: 35rpx; + } + + /* 身高 / BMI / 标准体重 指标行 */ + .metrics-row { + display: flex; + padding: 0 10rpx; + justify-content: space-between; + + .metric-col { + display: flex; + flex-direction: column; + + .metric-label { + color: #808080; + height: 30rpx; + display: flex; + font-size: 26rpx; + line-height: 30rpx; + margin-bottom: 20rpx; + + .metric-label-text { + color: #808080; + height: 30rpx; + font-size: 26rpx; + line-height: 30rpx; + margin-right: 6rpx; + } + + .metric-label-value { + color: #FFFFFF; + height: 30rpx; + padding: 0 6rpx; + font-size: 18rpx; + line-height: 30rpx; + background-color: #2AC79F; + border-radius: 8rpx; + } + } + + /* BMI 行(标签 + badge 并排) */ + .metric-label-row { + height: 30rpx; + display: flex; + align-items: center; + margin-bottom: 20rpx; + + .metric-label { + margin-bottom: 0; + } + + /* BMI 标准/偏高 badge */ + .bmi-badge { + height: 30rpx; + padding: 0 10rpx; + margin-left: 10rpx; + font-size: 18rpx; + line-height: 30rpx; + border-radius: 8rpx; + color: #FFFFFF; + background-color: #2AC79F; + } + } + + .metric-value-row { + display: flex; + align-items: baseline; + + .metric-value { + color: #252535; + height: 44rpx; + font-size: 44rpx; + font-weight: 700; + line-height: 44rpx; + margin-right: 6rpx; + } + + .metric-unit { + color: #252535; + height: 26rpx; + font-size: 26rpx; + font-weight: bold; + line-height: 26rpx; + } + } + } + } + } + + .card-lianjie { + position: absolute; + right: 24rpx; + width: 32rpx; + height: 84rpx; + bottom: -55rpx; + } + } + + /* ===== 详细数据卡 ===== */ + .detail-card { + width: 100%; + margin-bottom: 24rpx; + padding: 2rpx 2rpx 30rpx; + border-radius: 24rpx; + box-sizing: border-box; + background-color: #FFFFFF; + + /* 卡头(带渐变背景) */ + .card-header { + width: 100%; + height: 88rpx; + padding-left: 30rpx; + padding-right: 50rpx; + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: space-between; + + .card-header-left { + display: flex; + align-items: center; + + .card-title-bar { + width: 6rpx; + height: 24rpx; + border-radius: 3rpx; + background-color: #1385FA; + margin-right: 14rpx; + } + + .card-title { + color: #252535; + font-size: 30rpx; + font-weight: 700; + line-height: 30rpx; + } + } + + .card-header-right { + display: flex; + align-items: center; + + .link-text { + color: #77849E; + height: 24rpx; + font-size: 24rpx; + line-height: 24rpx; + } + } + } + + /* ===== 详细数据:三格 ===== */ + .detail-grid { + display: flex; + padding: 0 30rpx; + justify-content: space-between; + + .detail-item { + width: 195rpx; + padding: 24rpx; + box-sizing: border-box; + border-radius: 16rpx; + background-color: #F3F4F6; + display: flex; + flex-direction: column; + + .detail-label { + color: #808080; + font-size: 24rpx; + line-height: 24rpx; + margin-bottom: 30rpx; + } + + .detail-value-row { + display: flex; + align-items: baseline; + + .detail-value { + color: #252535; + height: 44rpx; + font-size: 44rpx; + font-weight: bold; + line-height: 44rpx; + margin-right: 2rpx; + } + + .detail-unit { + color: #252535; + height: 26rpx; + font-size: 26rpx; + line-height: 26rpx; + } + } + } + } + } + + /* ===== 空态 ===== */ + .empty-state { + width: 100%; + display: flex; + flex-direction: column; + align-items: center; + padding-top: 280rpx; + + .empty-icon { + width: 193rpx; + height: 138rpx; + margin-bottom: 40rpx; + border-radius: 20rpx; + } + + .empty-text { + color: #808080; + height: 30rpx; + font-size: 30rpx; + line-height: 30rpx; + } + } +} diff --git a/miniprogram/pages/home/home.ts b/miniprogram/pages/home/home.ts new file mode 100644 index 0000000..e7c888e --- /dev/null +++ b/miniprogram/pages/home/home.ts @@ -0,0 +1,36 @@ +import { get } from '../../utils/request/index' + +/** 将体重数字拆成整数 + 小数字符串 */ +const splitWeight = (weight: number): { int: number; decimal: string } => { + const str = weight.toFixed(2) + const [intPart, decPart] = str.split('.') + return { int: Number(intPart), decimal: `.${decPart}` } +} + +Page({ + data: { + record: null, + }, + + onShow() { + + }, + + onShareAppMessage(): WechatMiniprogram.Page.ICustomShareContent { + return { + title: '智能蓝牙秤', + path: '/pages/home/home', + imageUrl: '/images/share/share.jpg', + } + }, + + /** 跳转历史数据页 */ + onTapHistory() { + wx.switchTab({ url: '/pages/data/data' }) + }, + + /** 跳转设备列表页 */ + onTapSwitchDevice() { + wx.switchTab({ url: '/pages/equipment/equipment' }) + }, +}) diff --git a/miniprogram/pages/home/home.wxml b/miniprogram/pages/home/home.wxml new file mode 100644 index 0000000..da4a84e --- /dev/null +++ b/miniprogram/pages/home/home.wxml @@ -0,0 +1,143 @@ + + + + + + + + + + {{ device.name }} + + + {{ device.connected ? '设备已连接' : '未连接' }} + + + 切换设备 + + + + + + + + + + + + + + 最近测量 + + + 查看历史 + + + + + + + + + + {{ record.weight }} + {{ record.weightDecimal }} + kg + + {{ record.date }} + + + + {{ record.diff < 0 ? -record.diff : record.diff }} + + kg + + + + {{ record.diff < 0 ? '体重较上次减轻' : (record.diff > 0 ? '体重较上次增加' : '与上次持平') }} + + + + + + + + + + + 身高 + + + {{ record.height }} + cm + + + + + BMI + {{ record.bmiLabel }} + + + {{ record.bmi }} + + + + + 标准体重 + + + {{ record.stdWeight }} + kg + + + + + + + + + + + + + + + + + 详细数据 + + + + + + + 体脂率 + + {{ record.bodyFat }} + % + + + + 体脂肪 + + {{ record.bodyFatMass }} + kg + + + + 基础代谢 + + {{ record.bmr }} + kcal + + + + + + + + + + + + diff --git a/miniprogram/pages/my/my.json b/miniprogram/pages/my/my.json new file mode 100644 index 0000000..d2a12c7 --- /dev/null +++ b/miniprogram/pages/my/my.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationStyle": "custom" +} \ No newline at end of file diff --git a/miniprogram/pages/my/my.less b/miniprogram/pages/my/my.less new file mode 100644 index 0000000..1c3fe88 --- /dev/null +++ b/miniprogram/pages/my/my.less @@ -0,0 +1 @@ +/* pages/my/my.wxss */ \ No newline at end of file diff --git a/miniprogram/pages/my/my.ts b/miniprogram/pages/my/my.ts new file mode 100644 index 0000000..9177157 --- /dev/null +++ b/miniprogram/pages/my/my.ts @@ -0,0 +1,66 @@ +// pages/my/my.ts +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad() { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/miniprogram/pages/my/my.wxml b/miniprogram/pages/my/my.wxml new file mode 100644 index 0000000..19fb6c7 --- /dev/null +++ b/miniprogram/pages/my/my.wxml @@ -0,0 +1,2 @@ + +pages/my/my.wxml \ No newline at end of file diff --git a/miniprogram/pages/supplementPersonal/supplementPersonal.json b/miniprogram/pages/supplementPersonal/supplementPersonal.json index cbb6109..40e0f04 100644 --- a/miniprogram/pages/supplementPersonal/supplementPersonal.json +++ b/miniprogram/pages/supplementPersonal/supplementPersonal.json @@ -1,4 +1,6 @@ { "usingComponents": {}, + "navigationBarTextStyle": "black", + "navigationBarBackgroundColor": "#FFFFFF", "navigationBarTitleText": "完善个人信息" } diff --git a/miniprogram/pages/supplementPersonal/supplementPersonal.less b/miniprogram/pages/supplementPersonal/supplementPersonal.less index de168f8..2876455 100644 --- a/miniprogram/pages/supplementPersonal/supplementPersonal.less +++ b/miniprogram/pages/supplementPersonal/supplementPersonal.less @@ -163,7 +163,7 @@ /* 底部提交按钮 */ .submit-btn { color: #FFFFFF; - width: 580rpx; + width: 685rpx; height: 88rpx; font-size: 32rpx; font-weight: bold; diff --git a/miniprogram/pages/supplementPersonal/supplementPersonal.ts b/miniprogram/pages/supplementPersonal/supplementPersonal.ts index 856ff1e..26e02ec 100644 --- a/miniprogram/pages/supplementPersonal/supplementPersonal.ts +++ b/miniprogram/pages/supplementPersonal/supplementPersonal.ts @@ -63,10 +63,22 @@ Page({ const heightNum = parseFloat(height) const weightNum = parseFloat(weight) - if (!name) return wx.showToast({ title: '请填写姓名', icon: 'none' }) - if (!gender) return wx.showToast({ title: '请填写正确的身份证号', icon: 'none' }) - if (!height || isNaN(heightNum) || heightNum <= 0) return wx.showToast({ title: '请填写身高', icon: 'none' }) - if (!serverResult) return wx.showToast({ title: '请先验证姓名与身份证号', icon: 'none' }) + if (!name) { + wx.showToast({ title: '请填写姓名', icon: 'none' }) + return + } + if (!gender) { + wx.showToast({ title: '请填写正确的身份证号', icon: 'none' }) + return + } + if (!height || isNaN(heightNum) || heightNum <= 0) { + wx.showToast({ title: '请填写身高', icon: 'none' }) + return + } + if (!serverResult) { + wx.showToast({ title: '请先验证姓名与身份证号', icon: 'none' }) + return + } const parsed = parseIdCard(idCard) diff --git a/miniprogram/pages/supplementPersonal/supplementPersonal.wxml b/miniprogram/pages/supplementPersonal/supplementPersonal.wxml index b8fb934..207e07d 100644 --- a/miniprogram/pages/supplementPersonal/supplementPersonal.wxml +++ b/miniprogram/pages/supplementPersonal/supplementPersonal.wxml @@ -102,5 +102,5 @@ - 完成 + 完成并进入首页