From ffb1545314e4c468db0e5c51cd3e4bf18c5ac423 Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Thu, 11 Jan 2024 09:34:53 +0800 Subject: [PATCH] . --- src/app.config.ts | 2 + src/components/calendar/index.tsx | 1 - src/pages/index/index.tsx | 3 +- src/pages/message/message.tsx | 67 +-- src/pages/recording/recording.less | 473 ++++++++++++++++++++ src/pages/recording/recording.tsx | 67 ++- src/pages/register/register.tsx | 27 +- src/pages/template/template.tsx | 10 +- src/pages/user/user.tsx | 2 + src/pages/userInfo/userInfo.tsx | 15 +- src/pages/userInfoDetail/userInfoDetail.tsx | 16 +- src/pages/userPolicy/userPolicy.config.js | 3 + src/pages/userPolicy/userPolicy.less | 17 + src/pages/userPolicy/userPolicy.tsx | 57 +++ src/store/features/userInfo.js | 3 +- src/utils/traoAPI.js | 1 + 16 files changed, 679 insertions(+), 85 deletions(-) create mode 100644 src/pages/userPolicy/userPolicy.config.js create mode 100644 src/pages/userPolicy/userPolicy.less create mode 100644 src/pages/userPolicy/userPolicy.tsx diff --git a/src/app.config.ts b/src/app.config.ts index 8523904..c35997a 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -14,10 +14,12 @@ export default defineAppConfig({ "pages/register/register", 'pages/instrument/instrument', 'pages/privacyPolicy/privacyPolicy', + 'pages/userPolicy/userPolicy', 'pages/about/about', 'pages/message/message', 'pages/consultant/consultant', 'pages/integral_list/integral_list', + "pages/recording/recording", 'pages/template/template', ], "tabBar": { diff --git a/src/components/calendar/index.tsx b/src/components/calendar/index.tsx index 752b2c2..fd8cebe 100644 --- a/src/components/calendar/index.tsx +++ b/src/components/calendar/index.tsx @@ -3,7 +3,6 @@ import dayjs, { Dayjs } from "dayjs"; import React from "react"; import Taro from "@tarojs/taro"; import { View } from "@tarojs/components"; -import { BaseEventOrig } from "@tarojs/components/types/common"; import { AtCalendarDefaultProps, AtCalendarProps, diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 0d2dffb..ea135ea 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -187,7 +187,8 @@ class Index extends Component { toNursingRecords = () => { if (this.isRegister()) { // todo - this.setState({ isDev: true }); + // this.setState({ isDev: true }); + go("/pages/recording/recording"); } }; diff --git a/src/pages/message/message.tsx b/src/pages/message/message.tsx index 3a83004..4672f1d 100644 --- a/src/pages/message/message.tsx +++ b/src/pages/message/message.tsx @@ -180,44 +180,7 @@ export default class Message extends Component { let { total, list, dargState } = this.state; return ( - - {/* */} - {/* 0} onRefresh={this.onRefresh}> - - - {new Array(20).fill(1).map((_, index) => ( - - {index} - - ))} - - - - - - {dargState === 0 ? ( - "上拉加载更多" - ) : ( - 加载中... - )} - - */} + { 已到底部 )} - {/* - - {list.map((item: any) => { - return ( - - - - - - - 系统通知 - - {item.createTime} - - - - - [花至官方旗舰店]: {item.content ? item.content : ""} - - - - - ); - })} - */} diff --git a/src/pages/recording/recording.less b/src/pages/recording/recording.less index e69de29..4b3a3ae 100644 --- a/src/pages/recording/recording.less +++ b/src/pages/recording/recording.less @@ -0,0 +1,473 @@ +/*.products_list, .main_wrapper_one { + padding-bottom: 160rpx; +}*/ + +.tabs { + display: flex; + align-items: center; + height: 110rpx; + background: #fff; + font-size: 30rpx; + font-weight: 500; + color: #666; + padding: 0 32rpx; +} + +.tab { + margin-right: 72rpx; +} + +.tab_active { + position: relative; + font-size: 36rpx; + font-weight: 800; + color: #000; +} + +.tabs .tab_active::after { + position: absolute; + left: 50%; + transform: translateX(-50%); + bottom: -12rpx; + content: ""; + width: 80rpx; + height: 4rpx; + background: linear-gradient(-90deg, #ffe9c7, #eecda1); + border-radius: 2rpx; +} + +.main { + width: 100%; + background: #f8f8f8; + min-height: calc(100vh - 244rpx - env(safe-area-inset-bottom)); + text-align: center; +} +.main_wrapper_one { + min-height: calc(100vh - 244rpx - env(safe-area-inset-bottom)); + /* height:calc(100vh - 156px - env(safe-area-inset-bottom)) */ + height: calc(100vh - 156px - calc(env(safe-area-inset-bottom))); + padding-bottom: calc(env(safe-area-inset-bottom)); +} +.main_wrapper_two { + min-height: calc(100vh - 110rpx - env(safe-area-inset-bottom)); + height: calc(100vh - 32px - env(safe-area-inset-bottom)); +} +.m-x-30 { + margin: 0 30rpx; +} + +.instrument_list { + padding-bottom: 200rpx; +} + +.products_list { + width: 100%; + height: 80rpx; + white-space: nowrap; + background: #f8f8f8; + padding-top: 25rpx; + padding-bottom: 29rpx; +} + +.all { + display: inline-block; + width: 120rpx; + height: 70rpx; + background: #eaeaea; + border-radius: 35rpx; + text-align: center; + line-height: 70rpx; + margin-left: 30rpx; + color: #000000; + font-size: 26rpx; + font-weight: 500; +} + +.products_item { + position: relative; + display: inline-block; + height: 70rpx; + line-height: 70rpx; + background: #eaeaea; + border-radius: 35rpx; + font-size: 26rpx; + font-weight: 500; + color: #000; + padding-right: 23rpx; + padding-left: 82rpx; + margin-left: 40rpx; +} + +.products_item_active { + background: linear-gradient(90deg, #efdcc2, #fff2df); +} + +.products_item:last-child { + margin-right: 30rpx; +} + +.products_cover { + position: absolute; + z-index: 2; + left: -17rpx; + top: -5rpx; + width: 80rpx; + height: 80rpx; + background: #fff; + border-radius: 50%; + object-fit: cover; +} + +.statistic { + position: relative; + display: flex; + align-items: center; + /*height: 200rpx;*/ + background: #fff; + border-radius: 30rpx; +} + +/*.statistic::after {*/ +/* position: absolute;*/ +/* left: 50%;*/ +/* transform: translateX(-50%);*/ +/* content: '';*/ +/* width: 1rpx;*/ +/* height: 90rpx;*/ +/* background: #DDDDDD;*/ +/*}*/ + +.statistic_item { + flex: 1; +} + +.border { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + width: 1rpx; + height: 90rpx; + background: #dddddd; +} + +.statistic_num { + font-size: 48rpx; + font-weight: 600; + color: #000; + margin-bottom: 26rpx; +} + +.statistic_desc { + font-size: 26rpx; + font-weight: 500; + color: #999; +} + +.instrument_item { + margin-top: 20rpx; + background: #ffffff; + border-radius: 30rpx; + padding: 46rpx 36rpx; +} + +.time { + font-size: 28rpx; + font-weight: bold; + color: #000; + margin-right: 23rpx; +} + +.tag { + width: 90rpx; + height: 36rpx; + line-height: 36rpx; + background: #e5f9ee; + border-radius: 18rpx; + font-size: 24rpx; + font-weight: 500; + color: #57bc81; +} + +.tag_active { + background: #f8f8f8; + color: #999; +} + +.report_btn { + font-size: 26rpx; + font-weight: 500; + color: #666; + align-items: baseline; +} + +.arrow_icon { + width: 10rpx; + height: 20rpx; + margin-left: 14rpx; +} + +.instrument_middle { + margin-top: 40rpx; + text-align: left; +} + +.instrument_cover { + width: 140rpx; + height: 140rpx; + border-radius: 20rpx; + margin-right: 37rpx; +} + +.instrument_content { + display: flex; + flex-direction: column; + flex: 1; +} + +.instrument_title { + font-size: 28rpx; + font-weight: bold; + color: #000; + padding-top: 3rpx; +} + +.instrument_desc_box { + margin-top: 25rpx; + min-height: 73rpx; +} + +.instrument_desc { + font-size: 24rpx; + font-weight: 500; + color: #999; +} + +.instrument_bottom { + position: relative; + margin-top: 28rpx; + background: #f8f8f8; + border-radius: 20rpx; + padding: 23rpx 0 23rpx; +} + +.place_item { + flex: 1; + border-right: 1rpx solid #dddd; +} + +.place_item:last-child { + border: none; +} + +.place { + font-size: 24rpx; + font-weight: 500; + color: #666; + margin-bottom: 15rpx; +} + +.duration { + font-size: 20rpx; + font-weight: 500; + color: #000; +} + +.plan_list { + position: relative; + padding-bottom: 40rpx; +} + +.plan_reward { + margin-bottom: 10rpx; +} + +.plan_progress_bg { + width: 200rpx; + height: 14rpx; + background: #f8f8f8; + margin-right: 30rpx; + border-radius: 20rpx; + overflow: hidden; +} + +.plan_progress_bar { + width: 50%; + height: 100%; + background: linear-gradient(90deg, #efdcc2, #fff2df); +} + +.plan_middle { + text-align: left; +} + +.border-p-t { + border-top: 1rpx solid #f8f8f8; + padding-top: 30rpx; +} + +.arrow { + position: absolute; + bottom: 40rpx; + left: 50%; + display: block; + width: 40rpx; + height: 40rpx; + transition: 0.5s; + margin-left: -20rpx; +} + +.clock_in_statistics { + background: #fff; + border-radius: 30rpx; + /*margin-top: 30rpx;*/ + height: 383rpx; + padding: 46rpx 36rpx; + flex-direction: column; +} + +.clock_in_statistics_title { + height: 31rpx; + font-size: 32rpx; + font-weight: bold; + color: #000; +} + +.clock_in_statistics_date { + height: 21rpx; + font-size: 26rpx; + font-weight: 500; + color: #666; +} + +.chart { + margin-top: 44rpx; + height: 100%; + align-items: flex-end; +} + +.column { + width: 13rpx; + height: 186rpx; + background: linear-gradient(0deg, #efdcc2, #fff2df); + border-radius: 7rpx; +} + +.buoy { + font-size: 20rpx; + font-weight: 500; + color: #000; + margin-bottom: 16rpx; +} + +.month { + font-size: 20rpx; + font-weight: 500; + color: #999; + margin-top: 12rpx; +} + +.month_box { + padding-bottom: 200rpx; +} + +.month_statistics { + background: #fff; + border-radius: 30rpx; + margin-top: 30rpx; + padding: 46rpx 36rpx; +} + +.more_icon { + display: inline-block; + width: 24rpx; + height: 24rpx; + margin-left: 10rpx; +} + +.more_text { + font-size: 26rpx; + font-weight: 500; + color: #666; +} + +.month_item { + border-top: 1rpx solid #dddddd; + padding: 37rpx 0; + text-align: left; +} + +.month_item_cover { + display: inline-block; + width: 200rpx; + height: 200rpx; + border-radius: 20rpx; +} + +.month_item_date { + font-size: 28rpx; + font-weight: bold; + color: #000; +} + +.month_item_note { + font-size: 24rpx; + font-weight: 500; + color: #999; + margin-top: 31rpx; +} + +.month_image_box { + margin: 48rpx 0 50rpx; + justify-content: start; +} +.month_image_box image { + margin-right: 10rpx; +} +.month_image_box image:last-child { + margin-right: 0; +} + +.clock_button_wrap { + position: fixed; + bottom: 0; + left: 0; + display: flex; + justify-content: center; + align-items: center; + width: 100%; + height: 153rpx; + background-color: #fff; + box-shadow: 0rpx -3rpx 7rpx 1rpx rgba(173, 191, 207, 0.21); +} + +.clock_button { + width: 690rpx; + height: 90rpx; + line-height: 90rpx; + font-size: 32rpx; + color: #fff; + text-align: center; + font-weight: 500; + background: #000000; + border-radius: 45rpx; +} + +.empty { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + width: 100vw; + height: 60vh; + .empty-img { + display: block; + width: 200rpx; + height: 200rpx; + } + .empty-text { + font-size: 36rpx; + color: #666; + margin-top: 20rpx; + } +} diff --git a/src/pages/recording/recording.tsx b/src/pages/recording/recording.tsx index 46e812f..4e705fe 100644 --- a/src/pages/recording/recording.tsx +++ b/src/pages/recording/recording.tsx @@ -1,9 +1,16 @@ -import { Component, PropsWithChildren, useEffect, useState } from "react"; import Taro from "@tarojs/taro"; +import classnames from "classnames"; +import { Component, PropsWithChildren, useEffect, useState } from "react"; + import { Block, View, Text, Image, Input, Button } from "@tarojs/components"; import { Tab, Tabs } from "@antmjs/vantui"; +/** 自定义组件 **/ +import Navbar from "../../components/navbar/navbar"; +import PopupAlert from "../../components/popup/popup-alert"; +/** 自定义组件 **/ + import "./recording.less"; export default class Recording extends Component { @@ -11,6 +18,7 @@ export default class Recording extends Component { super(props); this.state = { name: "护理历程", + current: 0, }; } @@ -25,8 +33,61 @@ export default class Recording extends Component { async initData() {} + onTab = async (event) => { + const { current } = event.currentTarget.dataset; + console.log("current", current); + this.setState({ current }); + }; + render() { - let { name } = this.state; - return {name}; + let { current } = this.state; + return ( + + + + + 护理历程 + + + 打卡统计 + + + + {current === 0 && ( + + + + 暂无数据 + + + )} + {current === 1 && ( + + + + 暂无数据 + + + )} + + ); } } diff --git a/src/pages/register/register.tsx b/src/pages/register/register.tsx index 9db0f61..d3fabb6 100644 --- a/src/pages/register/register.tsx +++ b/src/pages/register/register.tsx @@ -20,8 +20,7 @@ import { MpLoginDetail, MpSplashDetail, } from "../../utils/Interface"; -import { compareVersion, formatRichText } from "../../utils/util"; -import { go, loading, msg } from "../../utils/traoAPI"; +import { go, msg } from "../../utils/traoAPI"; const app = Taro.getApp(); @@ -108,10 +107,6 @@ export default class Register extends Component { complete: (res) => {}, }); }; - onPrivacyTap = async () => { - // 打开隐私协议 - go("/pages/xieyi1/xieyi1"); - }; onClosePrivacyContentPopup = () => { this.setState({ showPrivacyContent: false, @@ -142,8 +137,12 @@ export default class Register extends Component { if (res.data) { const mobile = res.data.data; Taro.setStorageSync("mobile", mobile); - msg("注册成功"); this.changeGetPhoneNumberBtn(); + msg("注册成功"); + // 注册成功两秒后跳转个人信息完善页 + setTimeout(() => { + go("/pages/userInfo/userInfo"); + }, 2000); } } catch (error) { this.changeGetPhoneNumberBtn(); @@ -199,6 +198,16 @@ export default class Register extends Component { // } }; + onPrivacyTap = () => { + // 跳转用户隐私协议 + go("/pages/privacyPolicy/privacyPolicy"); + }; + + onUserTap = () => { + // 跳转用户协议 + go("/pages/userPolicy/userPolicy"); + }; + componentDidMount() {} componentWillUnmount() {} @@ -233,13 +242,13 @@ export default class Register extends Component { 请自行阅读花至小程序 - + 《用户协议》 - + 《隐私政策》 ,并完成注册登录 diff --git a/src/pages/template/template.tsx b/src/pages/template/template.tsx index 96a1a59..988da25 100644 --- a/src/pages/template/template.tsx +++ b/src/pages/template/template.tsx @@ -1,5 +1,7 @@ -import { Component, PropsWithChildren, useEffect, useState } from "react"; import Taro from "@tarojs/taro"; +import classnames from "classnames"; + +import { Component, PropsWithChildren, useEffect, useState } from "react"; import { Block, View, Text, Image, Input, Button } from "@tarojs/components"; import "./template.less"; @@ -25,6 +27,10 @@ export default class Index extends Component { render() { let { name } = this.state; - return {name}; + return ( + + {name} + + ); } } diff --git a/src/pages/user/user.tsx b/src/pages/user/user.tsx index 9e0868a..48eff7e 100644 --- a/src/pages/user/user.tsx +++ b/src/pages/user/user.tsx @@ -48,6 +48,8 @@ class User extends Component { componentWillUnmount() {} componentDidShow() { + this.setState({ userInfo: this.props.userInfo }); + const tabbar = Taro.getTabBar(this.pageCtx); tabbar?.setSelected(4); } diff --git a/src/pages/userInfo/userInfo.tsx b/src/pages/userInfo/userInfo.tsx index 000e312..6b256b8 100644 --- a/src/pages/userInfo/userInfo.tsx +++ b/src/pages/userInfo/userInfo.tsx @@ -176,15 +176,28 @@ class UserInfo extends Component { userInfo.provinceId = res.data.data.provinceId; userInfo.cityId = res.data.data.cityId; userInfo.areaId = res.data.data.areaId; + userInfo.nickname = res.data.data.nickname; + userInfo.headimg = res.data.data.headimg; this.props.userRefresh(userInfo); this.setState({ userInfo: userInfo }); + // if (userInfo.integralText) { + // this.setState({ isShowIntegralText: true }); + // } if (userInfo.integralText) { this.setState({ isShowIntegralText: true }); + } else { + this.goUser(); } } }; + goUser = () => { + Taro.switchTab({ + url: "/pages/user/user", + }); + }; + getChooseAvatar = (event) => { console.log("getChooseAvatar", event); @@ -376,7 +389,7 @@ class UserInfo extends Component { textAlgin="center" confirm={this.closeIntegralText} /> - + 个人信息 diff --git a/src/pages/userInfoDetail/userInfoDetail.tsx b/src/pages/userInfoDetail/userInfoDetail.tsx index d97bd11..42623c9 100644 --- a/src/pages/userInfoDetail/userInfoDetail.tsx +++ b/src/pages/userInfoDetail/userInfoDetail.tsx @@ -202,15 +202,25 @@ class UserInfoDetail extends Component { userInfo.provinceId = res.data.data.provinceId; userInfo.cityId = res.data.data.cityId; userInfo.areaId = res.data.data.areaId; + userInfo.nickname = res.data.data.nickname; + userInfo.headimg = res.data.data.headimg; this.props.userRefresh(userInfo); this.setState({ userInfo: userInfo }); if (userInfo.integralText) { this.setState({ isShowIntegralText: true }); + } else { + this.goUser(); } } }; + goUser = () => { + Taro.switchTab({ + url: "/pages/user/user", + }); + }; + getChooseAvatar = (event) => { let { userInfo } = this.state; userInfo.headimg = event.detail.avatarUrl; @@ -317,6 +327,10 @@ class UserInfoDetail extends Component { closeIntegralText = () => { this.setState({ isShowIntegralText: false }); + + setTimeout(() => { + this.goUser(); + }, 600); }; render() { @@ -341,7 +355,7 @@ class UserInfoDetail extends Component { }; return ( - + { + constructor(props) { + super(props); + this.state = { + name: "用户协议", + nodes: "", + }; + } + + async onLoad() { + this.initData(); + } + componentDidMount() {} + + componentWillUnmount() {} + + componentDidShow() {} + + componentDidHide() {} + + initData = async () => { + let res = await getUserAgreement(); + if (res.data.code === 200) { + this.setState({ nodes: res.data.data.value }); + } + }; + + render() { + let { nodes } = this.state; + return ( + + + + + " + + // nodes + + // "" + } + /> + + + ); + } +} diff --git a/src/store/features/userInfo.js b/src/store/features/userInfo.js index 1cb0d40..31c300b 100644 --- a/src/store/features/userInfo.js +++ b/src/store/features/userInfo.js @@ -1,4 +1,5 @@ import Taro from "@tarojs/taro"; +import dayjs from "dayjs"; import { createSlice } from "@reduxjs/toolkit"; const userInfoReducer = createSlice({ @@ -36,7 +37,7 @@ const userInfoReducer = createSlice({ state.mobile = payload.mobile || ""; state.nickname = payload.nickname || ""; state.headimg = payload.headimg || ""; - state.birthday = payload.birthday || new Date().getTime(); + state.birthday = payload.birthday || dayjs().format("YYYY-MM-DD"); state.province = payload.province || ""; state.provinceId = payload.provinceId || ""; state.city = payload.city || ""; diff --git a/src/utils/traoAPI.js b/src/utils/traoAPI.js index 27465d8..50900fd 100644 --- a/src/utils/traoAPI.js +++ b/src/utils/traoAPI.js @@ -55,6 +55,7 @@ export const msg = (title, mask, icon) => { title, mask, icon: icon || "none", + duration: 2000, }); };