日历bug修复,状态管理开发,个人信息开发

master
blak-kong 3 years ago
parent e4ab393441
commit 0c10eb610c

@ -1,6 +1,7 @@
export default defineAppConfig({
pages: [
'pages/index/index',
'pages/login/login',
'pages/initiate/initiate',
'pages/entry/entry',
'pages/activity/activity',
@ -8,6 +9,7 @@ export default defineAppConfig({
"pages/shop/shop",
"pages/user/user",
"pages/userInfo/userInfo",
'pages/userInfoDetail/userInfoDetail',
"pages/register/register",
'pages/instrument/instrument',
'pages/privacyPolicy/privacyPolicy',

@ -117,6 +117,6 @@ page {
.van-overlay {
z-index: 10000 !important;
}
.van-popup--center {
.van-popup {
z-index: 10001 !important;
}

@ -1,9 +1,9 @@
import { Component, PropsWithChildren } from "react";
import "./app.less";
// html4
import "@tarojs/taro/html.css";
// html5
import "@tarojs/taro/html5.css";
// // html4
// import "@tarojs/taro/html.css";
// // html5
// import "@tarojs/taro/html5.css";
import Taro from "@tarojs/taro";
import { go } from "./utils/traoAPI";
@ -20,7 +20,7 @@ class App extends Component<PropsWithChildren> {
// 对应 onLaunch
onLaunch(options) {
console.log("onLaunch", options);
// console.log("onLaunch", options);
if (options.scene == 1007 || options.scene == 1008) {
return;
}

@ -36,13 +36,10 @@ const defaultProps: Partial<AtCalendarBodyProps> = {
// const events = new Events();
export default class AtCalendarBody extends React.Component<
AtCalendarBodyProps,
Readonly<AtCalendarBodyState>
> {
export default class AtCalendarBody extends React.Component<any, any> {
static defaultProps: Partial<AtCalendarBodyProps> = defaultProps;
public constructor(props: AtCalendarBodyProps) {
public constructor(props: any) {
super(props);
const {
validDates,
@ -53,6 +50,7 @@ export default class AtCalendarBody extends React.Component<
generateDate,
selectedDate,
selectedDates,
currentDate,
} = props;
this.generateFunc = generateCalendarGroup({
@ -63,8 +61,8 @@ export default class AtCalendarBody extends React.Component<
marks,
selectedDates,
});
const listGroup = this.getGroups(generateDate, selectedDate);
// const listGroup = this.getGroups(generateDate, selectedDate);
const listGroup = this.getGroups(currentDate, selectedDate);
this.state = {
listGroup,
offsetSize: 0,
@ -269,6 +267,7 @@ export default class AtCalendarBody extends React.Component<
: clientX - this.swipeStartPoint > 0;
};
// 收起展开改变界面
private onChangeFoldingCalendar = () => {
let { isFolding, listGroup } = this.state;
isFolding = !isFolding;
@ -324,23 +323,22 @@ export default class AtCalendarBody extends React.Component<
this.props.onDayClick(item);
}
// 修改日历-重新渲染
onSelectDataChange(value: any) {
let { temporaryCalendar } = this.state;
let oldValueItem = temporaryCalendar.findIndex((ele) => ele.isSelected);
let newValueItem = temporaryCalendar.findIndex(
(ele) => ele.value === value
);
temporaryCalendar[oldValueItem].isSelected = false;
temporaryCalendar[oldValueItem].isSelectedHead = false;
temporaryCalendar[oldValueItem].isSelectedTail = false;
temporaryCalendar[newValueItem].isSelected = true;
temporaryCalendar[newValueItem].isSelectedHead = true;
temporaryCalendar[newValueItem].isSelectedTail = true;
let newDateValue = dayjs(value).valueOf();
const listGroup = this.getGroups(newDateValue, {
start: newDateValue,
end: newDateValue,
});
temporaryCalendar = JSON.parse(JSON.stringify(listGroup[1].list));
this.setState({ listGroup, temporaryCalendar, isFolding: false });
this.setState({ temporaryCalendar });
this.props.onDayClick(temporaryCalendar[newValueItem]);
let newValueItemIndex = temporaryCalendar.findIndex(
(ele) => ele.value === value
);
this.props.onDayClick(temporaryCalendar[newValueItemIndex]);
}
public render(): JSX.Element {
@ -374,6 +372,7 @@ export default class AtCalendarBody extends React.Component<
onClick={this.onDayClick.bind(this)}
onLongClick={this.props.onLongClick}
/> */}
{/* 仅关注此处定制数据即可 */}
<AtCalendarDateList list={temporaryCalendar} />
</View>
</View>

@ -0,0 +1,49 @@
.toolbar {
// position: absolute;
// left: 0;
// right: 0;
background: #fff;
padding: 20rpx 30rpx;
z-index: 999;
}
.toolbar .toolbar_title {
font-size: 36rpx;
font-weight: 600;
text-align: center;
}
.toolbar .select_box .text {
color: #cccccc;
font-size: 24rpx;
margin-bottom: 20rpx;
margin-top: 40rpx;
}
.toolbar .select_box .date {
color: #000;
font-size: 28rpx;
font-weight: 500;
}
.btn_confirm {
height: 90rpx;
background: #000;
color: #fff;
text-align: center;
line-height: 90rpx;
font-size: 32rpx;
font-weight: 700;
margin: 0 30rpx 40rpx;
border-radius: 50rpx;
}
.van-picker__toolbar {
display: none;
}
.popup-date-close {
position: absolute;
right: 50rpx;
top: 50rpx;
}

@ -1,20 +1,58 @@
import classnames from "classnames";
import dayjs, { Dayjs } from "dayjs";
import React from "react";
import { Picker, Text, View } from "@tarojs/components";
import { Text, View, Block } from "@tarojs/components";
import { DatetimePicker, Popup } from "@antmjs/vantui";
import {
AtCalendarControllerProps,
AtCalendarControllerState,
} from "../../../../types/calendar";
export default class AtCalendarController extends React.Component<
AtCalendarControllerProps,
AtCalendarControllerState
> {
import "./index.less";
export default class AtCalendarController extends React.Component<any, any> {
public constructor(props: any) {
super(props);
this.state = {
showDatePicker: false,
selectDate: 0,
curDate: 0,
};
}
onChangeDate = (e) => {
e.stopPropagation();
};
onInput = (e) => {
this.setState({ curDate: e.detail });
};
onClickStop = (e) => {
e.stopPropagation();
};
onSelectDate = () => {
let { curDate } = this.state;
this.props.onSelectDate(curDate);
this.onPopupClose();
};
onPopupClose = () => {
this.setState({ showDatePicker: false });
};
public render(): JSX.Element {
const { generateDate, minDate, maxDate, monthFormat, hideArrow } =
this.props;
const {
generateDate,
minDate,
maxDate,
monthFormat,
hideArrow,
currentDate,
} = this.props;
const dayjsDate: Dayjs = dayjs(generateDate);
const dayjsMinDate: Dayjs | boolean = !!minDate && dayjs(minDate);
const dayjsMaxDate: Dayjs | boolean = !!maxDate && dayjs(maxDate);
@ -32,49 +70,71 @@ export default class AtCalendarController extends React.Component<
? dayjsMaxDate.format("YYYY-MM")
: "";
let { showDatePicker, selectDate, curDate } = this.state;
return (
<View className="at-calendar__controller controller flex-justify-sb">
{hideArrow ? null : (
<Block>
<View className="at-calendar__controller controller flex-justify-sb">
{hideArrow ? null : (
<View
className={classnames(
"controller__arrow controller__arrow--left",
{
"controller__arrow--disabled": isMinMonth,
}
)}
onClick={this.props.onPreMonth.bind(this, isMinMonth)}
/>
)}
<View
className={classnames("controller__arrow controller__arrow--left", {
"controller__arrow--disabled": isMinMonth,
})}
onClick={this.props.onPreMonth.bind(this, isMinMonth)}
/>
)}
<View style="display: flex;align-items: center;">
<Picker
mode="date"
fields="day"
end={maxDateValue}
start={minDateValue}
onChange={this.props.onSelectDate}
value={dayjsDate.format("YYYY-MM-DD")}
style="display: flex;align-items: center;"
onClick={() => this.setState({ showDatePicker: true })}
>
{/* <Text className="controller__info"></Text> */}
{/* <Text>{dayjsDate.format(monthFormat)}</Text> */}
<Text style={{ fontSize: "38rpx", fontWeight: "400" }}>
{dayjsDate.format("YYYY.MM.DD")}
</Text>
</Picker>
<View
style="margin-left: 20rpx;color:#666;font-size: 34rpx"
className="at-icon at-icon-calendar"
></View>
<View
style="margin-left: 20rpx;color:#666;font-size: 34rpx"
className="at-icon at-icon-calendar"
></View>
</View>
<View></View>
</View>
<View></View>
{/* {hideArrow ? null : (
<View
className={classnames(
"controller__arrow controller__arrow--right",
{
"controller__arrow--disabled": isMaxMonth,
}
)}
onClick={this.props.onNextMonth.bind(this, isMaxMonth)}
<Popup
show={showDatePicker}
position="bottom"
// close-icon="/img/fr200/close.png"
round
onClick={this.onClickStop}
onClose={this.onPopupClose}
>
<View className="toolbar">
<View className="toolbar_title">
<Text></Text>
<View
style="margin-left: 20rpx;color:#666;font-size: 34rpx"
className="at-icon at-icon-close popup-date-close"
></View>
</View>
<View className="select_box">
<View className="text"></View>
<View className="date">{currentDate}</View>
</View>
</View>
<DatetimePicker
type="date"
value={dayjs(currentDate).valueOf()}
maxDate={maxDate}
onInput={this.onInput}
/>
)} */}
</View>
<View className="btn_confirm" onClick={this.onSelectDate}>
</View>
</Popup>
</Block>
);
}
}

@ -1,4 +1,4 @@
.flex-justify-sb {
display: flex;
justify-content: space-between;
justify-content: space-between !important;
}

@ -67,7 +67,6 @@ export default class AtCalendar extends React.Component<
private getSingleSelectdState = (value: Dayjs): Partial<AtCalendarState> => {
const { generateDate } = this.state;
console.log("generateDate", generateDate);
const stateValue: Partial<AtCalendarState> = {
selectedDate: this.getSelectedDate(value.valueOf()),
};
@ -152,7 +151,6 @@ export default class AtCalendar extends React.Component<
end = cEnd ? dayjs(cEnd).startOf("day").valueOf() : start;
} else {
const dayjsStart = dayjs(currentDate as Calendar.DateArg);
start = dayjsStart.startOf("day").valueOf();
// generateDateValue = dayjsStart.startOf("month").valueOf(); // 初始化选择器时间为每月第一天
generateDateValue = dayjsStart.startOf("day").valueOf();
@ -213,8 +211,8 @@ export default class AtCalendar extends React.Component<
};
// picker 选择时间改变时触发
private handleSelectDate = (e: BaseEventOrig<{ value: string }>): void => {
const { value } = e.detail;
private handleSelectDate = (e: any): void => {
const value = e;
const _generateDate: Dayjs = dayjs(value);
const _generateDateValue: number = _generateDate.valueOf();
@ -226,16 +224,13 @@ export default class AtCalendar extends React.Component<
generateDate: _generateDateValue,
});
Taro.eventCenter.trigger(
"onSelectDataChange",
dayjs(_generateDateValue).format("YYYY-MM-DD")
);
let newValue = dayjs(_generateDateValue).format("YYYY-MM-DD");
Taro.eventCenter.trigger("onSelectDataChange", newValue);
console.log("this.state", this.state);
this.props.onTimeChange(newValue);
};
private handleDayClick = (item: Calendar.Item): void => {
console.log("handleDayClick", item);
const { isMultiSelect } = this.props;
const { isDisabled, value } = item;
@ -297,8 +292,8 @@ export default class AtCalendar extends React.Component<
isVertical,
monthFormat,
selectedDates,
currentDate,
} = this.props as AtCalendarPropsWithDefaults;
return (
<View className={classnames("at-calendar", className)}>
<AtCalendarController
@ -307,6 +302,7 @@ export default class AtCalendar extends React.Component<
hideArrow={hideArrow}
monthFormat={monthFormat}
generateDate={generateDate}
currentDate={currentDate}
onPreMonth={this.handleClickPreMonth}
onNextMonth={this.handleClickNextMonth}
onSelectDate={this.handleSelectDate}
@ -319,6 +315,7 @@ export default class AtCalendar extends React.Component<
maxDate={maxDate}
isSwiper={isSwiper}
isVertical={isVertical}
currentDate={currentDate}
selectedDate={selectedDate}
selectedDates={selectedDates}
generateDate={generateDate}

@ -1,71 +1,71 @@
import classnames from 'classnames'
import React from 'react'
import { Text, View } from '@tarojs/components'
import { Calendar } from '../../../../../types/calendar'
import * as constant from '../../common/constant'
import classnames from "classnames";
import React from "react";
import { Text, View } from "@tarojs/components";
import { Calendar } from "../../../../../types/calendar";
import * as constant from "../../common/constant";
const MAP: { [key: number]: string } = {
[constant.TYPE_PRE_MONTH]: 'pre',
[constant.TYPE_NOW_MONTH]: 'now',
[constant.TYPE_NEXT_MONTH]: 'next'
}
[constant.TYPE_PRE_MONTH]: "pre",
[constant.TYPE_NOW_MONTH]: "now",
[constant.TYPE_NEXT_MONTH]: "next",
};
export interface Props {
list: Calendar.List<Calendar.Item>
list: Calendar.List<Calendar.Item>;
onClick?: (item: Calendar.Item) => void
onClick?: (item: Calendar.Item) => void;
onLongClick?: (item: Calendar.Item) => void
onLongClick?: (item: Calendar.Item) => void;
}
export default class AtCalendarList extends React.Component<Props> {
private handleClick = (item: Calendar.Item): void => {
if (typeof this.props.onClick === 'function') {
this.props.onClick(item)
if (typeof this.props.onClick === "function") {
this.props.onClick(item);
}
}
};
private handleLongClick = (item: Calendar.Item): void => {
if (typeof this.props.onLongClick === 'function') {
this.props.onLongClick(item)
if (typeof this.props.onLongClick === "function") {
this.props.onLongClick(item);
}
}
};
public render(): JSX.Element | null {
const { list } = this.props
if (!list || list.length === 0) return null
const { list } = this.props;
if (!list || list.length === 0) return null;
return (
<View className='at-calendar__list flex'>
<View className="at-calendar__list flex">
{list.map((item: Calendar.Item) => (
<View
key={`list-item-${item.value}`}
onClick={this.handleClick.bind(this, item)}
onLongPress={this.handleLongClick.bind(this, item)}
className={classnames(
'flex__item',
"flex__item",
`flex__item--${MAP[item.type]}`,
{
'flex__item--today': item.isToday,
'flex__item--active': item.isActive,
'flex__item--selected': item.isSelected,
'flex__item--selected-head': item.isSelectedHead,
'flex__item--selected-tail': item.isSelectedTail,
'flex__item--blur':
"flex__item--today": item.isToday,
"flex__item--active": item.isActive,
"flex__item--selected": item.isSelected,
"flex__item--selected-head": item.isSelectedHead,
"flex__item--selected-tail": item.isSelectedTail,
"flex__item--blur":
item.isDisabled ||
item.type === constant.TYPE_PRE_MONTH ||
item.type === constant.TYPE_NEXT_MONTH
item.type === constant.TYPE_NEXT_MONTH,
}
)}
>
<View className='flex__item-container'>
<View className='container-text'>{item.text}</View>
<View className="flex__item-container">
<View className="container-text">{item.text}</View>
</View>
<View className='flex__item-extra extra'>
<View className="flex__item-extra extra">
{item.marks && item.marks.length > 0 ? (
<View className='extra-marks'>
<View className="extra-marks">
{item.marks.map((mark, key) => (
<Text key={key} className='mark'>
<Text key={key} className="mark">
{mark.value}
</Text>
))}
@ -75,6 +75,6 @@ export default class AtCalendarList extends React.Component<Props> {
</View>
))}
</View>
)
);
}
}

@ -0,0 +1,334 @@
.infobox1 {
position: relative;
background: #fff;
border-radius: 0 0 30rpx 30rpx;
padding: 19rpx 29rpx 44rpx 29rpx;
box-shadow: -2.6rpx 0 11rpx 0.5rpx rgba(129, 129, 129, 0.05);
transition: all 0.3s;
}
.infobox1 .selectbox {
margin-top: 38rpx;
}
.infobox1 .selectbox .block {
position: relative;
}
.infobox1 .selectbox .block picker,
.infobox1 .selectbox .block picker view {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
z-index: 99;
opacity: 0;
}
.infobox1 .selectbox .block .title {
font-size: 36rpx;
font-weight: 500;
color: #000000;
font-family: Poppins;
}
.infobox1 .selectbox .block .icon {
width: 30rpx;
height: 30rpx;
margin-left: 35rpx;
}
.right_icon {
width: 10rpx;
height: 20rpx;
margin-left: 14rpx;
}
.calendar_view {
margin-top: 44rpx;
font-size: 24rpx;
font-weight: 500;
color: #666666;
justify-content: center;
}
.calendar_views {
font-size: 24rpx;
font-weight: 500;
color: #000;
justify-content: center;
}
.calendar_view > view,
.calendar_views > view {
text-align: center;
color: #666666;
font-size: 24rpx;
font-weight: 500;
width: 98rpx;
height: 60rpx;
position: relative;
}
.calendar_views .block {
text-align: center;
width: 49rpx;
height: 49rpx;
border-radius: 50%;
color: #000000;
font-weight: 500;
font-size: 24rpx;
line-height: 49rpx;
}
.calendar_views .blockstatus1 {
width: 6rpx;
height: 6rpx;
background: #e9cd9e;
border-radius: 50%;
position: absolute;
left: 50%;
bottom: 14rpx;
margin-left: -3rpx;
}
.statubox {
justify-content: flex-end;
padding: 0 0 14rpx 0;
border-bottom: 1rpx solid rgba(105, 100, 96, 0.1);
}
.statubox .status1 {
}
.statubox .status1 .block {
width: 18rpx;
height: 18rpx;
border-radius: 50%;
background: #f1ece6;
}
.statubox .status1 .title {
font-size: 22rpx;
color: #202020;
margin-left: 12rpx;
}
.statubox .status2 {
margin-left: 26rpx;
}
.statubox .status2 .block {
width: 6rpx;
height: 6rpx;
border-radius: 50%;
background: #e9cd9e;
}
.statubox .status2 .title {
font-size: 22rpx;
color: #202020;
margin-left: 12rpx;
display: flex;
align-items: center;
justify-content: center;
}
.calendar_views .status1 {
border: 2rpx solid #eecda1;
border-radius: 50%;
}
.calendar_views .cur_day {
background: linear-gradient(0deg, #fff0da, #ffe4c0);
border-radius: 50%;
}
.calendar_views .status4 {
border: 2rpx solid #f2f2f2;
border-radius: 50%;
}
.calendar_views .no_cur_month {
color: #cccccc;
}
.menubox {
color: #202020;
font-size: 24rpx;
font-weight: bold;
margin-top: 44rpx;
}
.menubox .record {
background: #e2c6a3;
border-radius: 22rpx;
color: #202020;
font-size: 24rpx;
height: 44rpx;
line-height: 44rpx;
width: 120rpx;
text-align: center;
}
.van-tabs__scroll--line {
background: transparent !important;
}
image {
width: 100%;
height: 100%;
display: flex;
border-radius: 0;
}
.color {
color: #f1ab15;
}
.ellipsis2 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.nodata {
color: #666666;
text-align: center;
margin-top: 50rpx;
font-size: 28rpx;
}
.MT30 {
margin-top: 30rpx;
}
.submitbtn {
position: absolute;
bottom: 100rpx;
width: 400rpx;
left: 50%;
margin-left: -200rpx;
}
.submitbtn .btn {
position: absolute;
top: 20rpx;
color: #fff;
font-weight: bold;
font-size: 32rpx;
text-align: center;
width: 100%;
bottom: 0;
}
.avatar-wrapper {
position: absolute;
bottom: 0;
width: 100%;
height: 100%;
left: 0;
right: 0;
top: 0;
z-index: 99;
opacity: 0;
}
.flex {
display: flex;
}
.aitems {
align-items: center;
}
.jcenter {
justify-content: center;
}
.sb {
justify-content: space-between;
}
.sa {
justify-content: space-around;
}
.wrap {
flex-wrap: wrap;
}
.echartsboxs {
font-size: 24rpx;
font-weight: 500;
color: #666;
display: flex;
justify-content: center;
}
.echartsboxs .blockbox {
width: 98rpx;
height: 60rpx;
}
.echartsboxs .blockbox .title {
font-weight: 500;
text-align: center;
color: #000000;
font-size: 24rpx;
margin: 20rpx auto 0;
width: 49rpx;
height: 49rpx;
line-height: 49rpx;
border-radius: 50%;
}
.echartsboxs .blockbox .cur_day {
background: linear-gradient(0deg, #fff0da, #ffe4c0);
}
.echartsboxs .blockbox .status1 {
border: 2rpx solid #eecda1;
}
.echartsboxs .blockbox .status4 {
border: 2rpx solid #f2f2f2;
}
.arrow_box {
position: absolute;
left: 50%;
bottom: 0;
transform: translate(-50%);
/*width: 100%;*/
height: 13rpx;
padding: 40rpx 80rpx 14rpx;
}
.arrow {
transform: rotate(180deg);
transition-property: all;
transition-duration: 0.5s;
width: 24rpx;
height: 100%;
margin: 0 auto;
}
.toolbar {
padding: 30rpx;
}
.toolbar .toolbar_title {
font-size: 36rpx;
font-weight: 600;
text-align: center;
}
.toolbar .select_box .text {
color: #cccccc;
font-size: 24rpx;
margin-bottom: 20rpx;
margin-top: 40rpx;
}
.toolbar .select_box .date {
color: #000;
font-size: 28rpx;
font-weight: 500;
}
.btn_confirm {
height: 90rpx;
background: #000;
color: #fff;
text-align: center;
line-height: 90rpx;
font-size: 32rpx;
font-weight: 700;
margin: 0 30rpx 40rpx;
border-radius: 50rpx;
}

@ -0,0 +1,355 @@
import { Component } from "react";
import Taro from "@tarojs/taro";
import classnames from "classnames";
import { go } from "../../utils/traoAPI";
import { date, getdates } from "../../utils/util";
import { PunchingCardListIOT } from "../../utils/Interface";
import "./calendar2.less";
import { Block, View, Image } from "@tarojs/components";
import { DatetimePicker, Popup } from "@antmjs/vantui";
export default class Calendar2 extends Component<any, any> {
constructor(props) {
super(props);
this.state = {
name: "时间组件",
days: [],
weeklist: [],
year: new Date().getFullYear(),
month: String(new Date().getMonth() + 1).padStart(2, "0"),
day: String(new Date().getDate()).padStart(2, "0"),
consyear: new Date().getFullYear(),
consmonth: String(new Date().getMonth() + 1).padStart(2, "0"),
constday: String(new Date().getDate()).padStart(2, "0"),
week: "",
monthtext: new Date().getMonth() + 1 + "月",
selectlist: [
{
name: "每月",
id: 2,
},
{
name: "每周",
id: 1,
},
],
selectlistindex: 1,
curMonthDate:
String(new Date().getFullYear()) +
"-" +
String(new Date().getMonth() + 1).padStart(2, "0"),
curDate: new Date().getTime(),
selectDate: date(),
temDate: null,
today: date().replace(/\-/g, "."),
maxDate: new Date().getTime(),
yearlist: [],
monthlist: [],
totalcount: 0,
showDatePicker: false,
};
}
async onLoad() {
// // 状态栏高度
}
componentDidMount() {}
componentWillUnmount() {}
componentDidShow() {}
componentDidHide() {}
onChangeDate = async (event) => {
const { showDatePicker, curDate, temDate } = this.state;
if (showDatePicker && event.type !== "close") {
if (curDate !== temDate) {
this.setState({
selectDate: getdates(temDate),
curDate: temDate,
curMonthDate: getdates(temDate).slice(0, 7),
});
await this.PunchingCardListIOT();
}
}
// this.getTabBar().setState({
// showBar: showDatePicker
// })
this.setState({ showDatePicker: !showDatePicker });
};
onInput = (event) => {
this.setState({ temDate: event.detail });
};
gourl = (e) => {
const { url } = e.currentTarget.dataset;
if (!this.state.userInfo.mobile) {
//未注册授权
// showModal({
// t2: '暂未授权注册,请点击注册',
// btn1show: false
// }).then(res => {
// Taro.navigateTo({
// url: '/pages/register/register',
// })
// })
return false;
}
go(url);
};
onChangeCalendar = () => {
const { selectlistindex } = this.state;
if (!selectlistindex) {
this.setState({ selectlistindex: 1 });
} else {
this.setState({ selectlistindex: 0 });
}
this.PunchingCardListIOT();
console.log(this.state.curMonthDate);
};
PunchingCardListIOT = async () => {
Taro.showLoading({
title: "加载中",
});
let { data } = await PunchingCardListIOT({
type: this.state.selectlist[this.state.selectlistindex].id,
times: this.state.selectDate + " 00:00:01",
});
if (data.code === 200) {
if (this.state.selectlist[this.state.selectlistindex].id === 2) {
data.data.list = data.data.list.map((item) => ({
...item,
date: parseInt(item.addtime.slice(-2)),
month: item.addtime.slice(0, 7),
curDate: item.addtime.replace(/-/g, "."),
}));
this.setState({
days: data.data.list,
});
}
if (this.state.selectlist[this.state.selectlistindex].id === 1) {
let totalcount = 0;
let week: any = new Date().getDay();
if (week === 1) week = "周一";
else if (week === 2) week = "周二";
else if (week === 3) week = "周三";
else if (week === 4) week = "周四";
else if (week === 5) week = "周五";
else if (week === 6) week = "周六";
else week = "周日";
let now = Date.now();
data.data.list.map((item, index) => {
item.week2 = week;
item.day = parseInt(item.addtime.substring(8, 10));
item.curDate = item.addtime.replace(/-/g, ".");
if (item.times) {
item.fen = item.times.substring(0, item.times.indexOf(":"));
item.miao = item.times.substring(
item.times.indexOf(":") + 1,
item.times.length
);
item.total =
Number(item.fen * 60) + Number(item.miao) > 980
? 980
: Number(item.fen * 60) + Number(item.miao);
item.totals = Number(item.fen * 60) + Number(item.miao);
let yu = 3.4;
item.height = item.total / yu;
if (now > new Date(item.addtime.replace(/-/g, "/")).getTime()) {
item.bgcolor = "#E8D3B1";
item.textcolor = "";
totalcount += item.totals;
} else {
if (item.c_status) {
item.bgcolor = "#F2F2F2";
item.textcolor = "#202020";
}
}
if (Number(item.fen) > 1440) {
item.times = "1440:00";
}
} else {
item.height = 0;
}
});
this.setState({
weeklist: data.data.list,
atotalcount: this.s_to_hs(totalcount),
});
}
}
Taro.hideLoading();
};
s_to_hs = (s) => {
//计算分钟
//算法将秒数除以60然后下舍入既得到分钟数
let h;
h = Math.floor(s / 60);
//计算秒
//算法:取得秒%60的余数既得到秒数
s = s % 60;
//将变量转换为字符串
h += "";
s += "";
//如果只有一位数前面增加一个0
h = h.length === 1 ? "0" + h : h;
s = s.length === 1 ? "0" + s : s;
return h + "分" + s + "秒";
};
render() {
let {
selectlist,
selectlistindex,
today,
days,
curMonthDate,
weeklist,
showDatePicker,
selectDate,
curDate,
maxDate,
} = this.state;
return (
<Block>
<View
className="infobox1"
style={{
height: selectlist[selectlistindex].id === 1 ? 260 : "550rpx",
}}
>
<View className="selectbox flex sb">
<View className="Block flex aitems" onClick={this.onChangeDate}>
<View className="title">{today}</View>
<View className="icon">
<Image
src={require("../../img/index/calendar.png")}
mode="aspectFill"
/>
</View>
</View>
<View
className="flex aitems"
onClick={this.gourl}
style="font-size: 26rpx; font-weight: 500; color: #666"
data-url="/pages/recording/recording"
>
<View></View>
<Image
className="right_icon"
src={require("../../img/right.png")}
mode="aspectFill"
></Image>
</View>
</View>
{selectlist[selectlistindex].id === 2 && (
<Block>
<View className="calendar_View flex">
<View></View>
<View></View>
<View></View>
<View></View>
<View></View>
<View></View>
<View></View>
</View>
<View className="calendar_Views flex aitems wrap">
{days.map((item, index) => {
return (
<View className="flex jcenter aitems" key={"days_" + index}>
{/* {{item.curDate === today ? 'cur_day' : item.status === 1 || item.status === 2 ? 'status1' : item.month !== curMonthDate ? 'no_cur_month' : item.status === 4 ? 'status4' : ''}} */}
<View
className={classnames("Block", {
cur_day: item.curDate === today,
status1: item.status === 1 || item.status === 2,
no_cur_month: item.month !== curMonthDate,
status4: item.status === 4,
})}
>
{item.date}
</View>
</View>
);
})}
</View>
</Block>
)}
{selectlist[selectlistindex].id === 1 && (
<Block>
<View className="calendar_View flex">
<View></View>
<View></View>
<View></View>
<View></View>
<View></View>
<View></View>
<View></View>
</View>
<View className="echartsboxs flex">
{weeklist.map((item, index) => {
return (
<View className="Blockbox" key={"weeklist_" + index}>
<View
className={classnames("title", {
cur_day: item.curDate === today,
status1: item.status === 1 || item.status === 2,
status4: item.status === 4,
})}
>
<View>{item.day}</View>
</View>
</View>
);
})}
</View>
</Block>
)}
<View className="arrow_box" onClick={this.onChangeCalendar}>
<Image
className="arrow"
style={{
transform:
"rotate(" + !selectlistindex ? "-180deg" : "0deg" + ")",
}}
src={require("../../img/index/arrow-down.png")}
mode="aspectFill"
/>
</View>
</View>
<Popup
show={showDatePicker}
position="bottom"
closeable
// close-icon="/img/fr200/close.png"
round
onClick={this.onChangeDate}
>
<View className="toolbar">
<View className="toolbar_title"></View>
<View className="select_box">
<View className="text"></View>
<View className="date">{selectDate}</View>
</View>
</View>
<DatetimePicker
type="date"
value={curDate}
maxDate={maxDate}
onInput={this.onInput}
/>
<View className="btn_confirm" onClick={this.onChangeDate}>
</View>
</Popup>
</Block>
);
}
}

@ -1,3 +0,0 @@
export default {
component: true,
};

@ -1 +0,0 @@
@import "~taro-ui/dist/style/components/modal.scss";

@ -1,13 +0,0 @@
import { AtModal, AtModalHeader, AtModalContent, AtModalAction } from "taro-ui";
{
/* <AtModal isOpened>
<AtModalHeader></AtModalHeader>
<AtModalContent>
</AtModalContent>
<AtModalAction> <Button></Button> <Button></Button> </AtModalAction>
</AtModal> */
}

@ -0,0 +1,95 @@
import { Component } from "react";
import { Dialog } from "@antmjs/vantui";
const Dialog_ = Dialog.createOnlyDialog();
/*** redux ***/
import { connect } from "react-redux";
import { setColor, resetColor } from "../../../store/features/navigation";
import { userRefresh } from "../../../store/features/userInfo";
/*** redux end ***/
import "./registerModal.less";
import { Block } from "@tarojs/components";
import { go } from "../../../utils/traoAPI";
class RegisterModal extends Component<any, any> {
constructor(props) {
super(props);
this.state = {
name: "导航组件",
statusBarHeight: 40, // 状态栏高度
navigationBarHeight: 0, // 导航栏高度
navHeight: 40,
};
this.initData();
}
async onLoad() {
// // 状态栏高度
}
componentDidMount() {}
componentWillUnmount() {}
componentDidShow() {}
componentDidHide() {}
async initData() {
this.alertRegister();
}
public alertRegister = () => {
if (!this.props.mobile) {
this.setColor("#4C4C4C");
setTimeout(() => {
Dialog_.alert({
title: "提示",
message: "暂未授权注册,请点击注册",
}).then((value) => {
this.resetColor();
this.goRegister();
});
}, 300);
} else {
go("/pages/instrument/instrument");
}
};
setColor = (color) => {
this.props.setColor(color);
};
resetColor = () => {
this.props.resetColor();
};
goRegister() {
go("/pages/register/register");
}
render() {
return (
<Block>
<Dialog_ />
</Block>
);
}
}
const mapStateToProps = (state) => ({
mobile: state.userInfo.mobile,
});
const mapDispatchToProps = (dispatch) => ({
setColor(color) {
dispatch(setColor(color));
},
resetColor() {
dispatch(resetColor());
},
userRefresh(data) {
dispatch(userRefresh(data));
},
});
export default connect(mapStateToProps, mapDispatchToProps)(RegisterModal);

@ -16,12 +16,21 @@
// }
.nav_box {
position: fixed;
top: 0;
left: 0;
right: 0;
display: flex;
justify-content: center;
background: #fff;
z-index: 99;
.logo {
display: inline-flex;
align-items: center;
width: 220rpx;
}
}
.nav_top_padding {
position: relative;
}

@ -13,11 +13,29 @@ export default class Navbar extends Component<any, any> {
name: "导航组件",
statusBarHeight: 40, // 状态栏高度
navigationBarHeight: 0, // 导航栏高度
navHeight: 40,
};
this.initData();
}
async onLoad() {
// // 状态栏高度
}
componentDidMount() {}
componentWillUnmount() {}
componentDidShow() {}
componentDidHide() {}
async initData() {
this.setStatusBar();
}
const that = this;
setStatusBar() {
Taro.getSystemInfoAsync({
success(res) {
success: (res) => {
const statusBarHeight = res.statusBarHeight || 0;
// 获取微信胶囊的位置信息 width,height,top,right,left,bottom
const custom = Taro.getMenuButtonBoundingClientRect();
@ -25,33 +43,22 @@ export default class Navbar extends Component<any, any> {
const navigationBarHeight =
custom.height + (custom.top - statusBarHeight) * 2;
// 总体高度 = 状态栏高度 + 导航栏高度
// const navHeight = navigationBarHeight + statusBarHeight;
const navHeight = navigationBarHeight + statusBarHeight;
that.setState({
this.setState({
statusBarHeight,
navigationBarHeight,
navHeight,
});
},
});
}
async onLoad() {
// // 状态栏高度
}
componentDidMount() {}
componentWillUnmount() {}
componentDidShow() {}
componentDidHide() {}
async initData() {}
render() {
let { statusBarHeight, navigationBarHeight } = this.state;
let { statusBarHeight, navigationBarHeight, navHeight } = this.state;
const statusBarHeightRpx = statusBarHeight * 2;
const navigationBarHeightRpx = navigationBarHeight * 2;
const navHeightRpx = navHeight * 2;
return (
<Block>
<View
@ -66,6 +73,10 @@ export default class Navbar extends Component<any, any> {
<Image src="https://oss.flossom.com/logo2.png" mode="widthFix" />
</View>
</View>
<View
className="nav_top_padding"
style={{ paddingBottom: navHeightRpx + "rpx" }}
></View>
{/* <View style="background:#fff;" className="nav">
<View className="nav_box">
<View className="logo">

@ -35,7 +35,7 @@ export default class PopupPrivacy extends Component<any, any> {
componentWillUnmount() {}
componentDidShow() {
console.log("isShowPrivacyPopup show", this.state);
// console.log("isShowPrivacyPopup show", this.state);
// 是否已授权隐私
// if (Taro.getStorageSync("isPrivacyPopup") !== "true") {
// // this.setState({
@ -75,6 +75,10 @@ export default class PopupPrivacy extends Component<any, any> {
this.props.closePrivacy();
};
onClickStop = (e) => {
e.stopPropagation();
};
render() {
// let { isShowPrivacyPopup } = this.state;
return (
@ -87,6 +91,7 @@ export default class PopupPrivacy extends Component<any, any> {
round
overlayStyle="width: 100vw;padding: 0;"
onClose={this.onClose}
onClick={this.onClickStop}
>
<View className="privacy-box">
<View className="privacy-popup-title"></View>

@ -1,3 +1,4 @@
export default {
component: true,
lazyCodeLoading: "requiredComponents",
};

@ -55,7 +55,6 @@ export default class Index extends Component {
}
setSelected(idx: number) {
console.log("setSelected", idx);
this.setState({
selected: idx,
});

@ -26,9 +26,7 @@ export default class Activity extends Component<any, any> {
};
}
async onLoad() {
console.log("app", app);
}
async onLoad() {}
componentDidMount() {}
componentWillUnmount() {}

@ -26,9 +26,7 @@ export default class Detect extends Component<any, any> {
};
}
async onLoad() {
console.log("app", app);
}
async onLoad() {}
componentDidMount() {}
componentWillUnmount() {}

File diff suppressed because one or more lines are too long

@ -24,9 +24,7 @@ export default class Index extends Component<any, any> {
};
}
async onLoad() {
console.log("app", app);
}
async onLoad() {}
componentDidMount() {}
componentWillUnmount() {}

@ -5,12 +5,9 @@ import { Component, PropsWithChildren } from "react";
import { Block, View, Text, Image, PageMeta, Button } from "@tarojs/components";
/*** redux ***/
// import { connect } from "react-redux";
// import navigation from "../../store/features/navigation";
import { setColor, resetColor } from "../../store/features/navigation";
import { connect } from "react-redux";
import { addNumber } from "../../store/features/counter";
import { setColor, resetColor } from "../../store/features/navigation";
import { userRefresh } from "../../store/features/userInfo";
/*** redux end ***/
/** 自定义组件 **/
@ -23,7 +20,7 @@ import Navbar from "../../components/navbar/navbar";
import { Dialog } from "@antmjs/vantui";
const Dialog_ = Dialog.createOnlyDialog();
import { UserInfo, GetUserMobile } from "../../utils/Interface";
import { GetUserMobile, RefreshWxUserInfo } from "../../utils/Interface";
import { setGlobalData } from "../../utils/global";
// css引入
@ -31,8 +28,6 @@ import "taro-ui/rn/style/components/calendar.scss";
import "./index.less";
import { go } from "../../utils/traoAPI";
const app = Taro.getApp();
// PropsWithChildren
class Index extends Component<any, any> {
pageCtx = Taro.getCurrentInstance().page;
@ -42,7 +37,9 @@ class Index extends Component<any, any> {
this.state = {
isShowPrivacyPopup: false,
// imgUrl: this.app.globalData.imgUrl,
userinfo: {},
userinfo: {
mobile: this.props.mobile,
},
connectInstrument: {},
yiqiinfo: {},
titleHeight: "",
@ -58,7 +55,7 @@ class Index extends Component<any, any> {
versioninfo: {}, //仪器版本号,
info: {}, // 护理推荐点击参与活动的信息
weekinfo: undefined,
today: dayjs().format("YYYY-MM-DD"),
currentDate: dayjs().format("YYYY-MM-DD"),
};
}
@ -66,12 +63,13 @@ class Index extends Component<any, any> {
const menu = Taro.getMenuButtonBoundingClientRect();
this.setState({ menu });
console.log("this.props", this);
const isFirst = Taro.getStorageSync("isWelcome");
if (isFirst) {
this.RefreshWxUserInfo();
}
}
componentDidMount() {
console.log("app", app);
}
componentDidMount() {}
componentWillUnmount() {}
@ -82,6 +80,15 @@ class Index extends Component<any, any> {
componentDidHide() {}
getUserInfo() {}
RefreshWxUserInfo = async () => {
let res = await RefreshWxUserInfo();
if (res.data.code === 200) {
this.props.userRefresh(res.data.data);
}
};
setColor = (color) => {
this.props.setColor(color);
};
@ -89,71 +96,50 @@ class Index extends Component<any, any> {
this.props.resetColor();
};
/****获取用户数据****/
UserInfo = async (code: string) => {
// this.showPrivacy();
let { data } = await GetUserMobile({ code });
console.log("data", data);
// let that = this;
// let { data } = await UserInfo();
// if (data.code == 200) {
// setGlobalData("userinfo", data.data);
// // app.globalData.userinfo = data.data;
// this.setState({
// userinfo: data.data,
// });
// Taro.downloadFile({
// url: data.data.headimg,
// success: function (res) {
// that.setState({
// headimg: res.tempFilePath,
// });
// },
// });
// }
};
/****获取用户数据 END****/
goRegister() {
console.log("gourl");
go("/pages/register/register");
}
addNewDevice = () => {
console.log("addNewDevice");
let mobile = Taro.getStorageSync("mobile");
console.log("mobile", mobile);
if (!mobile) {
console.log("未登录注册!");
this.alertRegister();
}
};
showPrivacy = () => {
console.log("showPrivacy");
this.setState({ isShowPrivacyPopup: true });
};
closePrivacy = () => {
console.log("closePrivacy");
this.setState({ isShowPrivacyPopup: false });
};
public alertRegister = () => {
this.setColor("#4C4C4C");
setTimeout(() => {
Dialog_.alert({
title: "提示",
message: "暂未授权注册,请点击注册",
}).then((value) => {
this.resetColor();
this.goRegister();
console.log("dialog result", value);
});
}, 300);
if (!this.props.mobile) {
this.setColor("#4C4C4C");
setTimeout(() => {
Dialog_.alert({
title: "提示",
message: "暂未授权注册,请点击注册",
}).then((value) => {
this.resetColor();
this.goRegister();
});
}, 300);
} else {
go("/pages/instrument/instrument");
}
};
onTimeChange = (value) => {
console.log("onTimeChange", value);
this.setState({ currentDate: value });
};
render() {
let { today, isShowPrivacyPopup } = this.state;
let { currentDate, isShowPrivacyPopup } = this.state;
return (
<Block>
<Dialog_ />
@ -168,7 +154,14 @@ class Index extends Component<any, any> {
<View className="at-icon at-icon-chevron-right"></View>
</View>
<View className="bg-while">
<AtCalendar hideArrow={true} isSwiper={false} currentDate={today} />
{/* <Calendar2 userInfo={userInfo}></Calendar2> */}
<AtCalendar
hideArrow={true}
isSwiper={false}
currentDate={currentDate}
maxDate={Date.now()}
onTimeChange={this.onTimeChange}
/>
</View>
</View>
<View className="infobox5">
@ -207,6 +200,7 @@ class Index extends Component<any, any> {
const mapStateToProps = (state) => ({
background: state.navigation.background,
mobile: state.userInfo.mobile,
});
const mapDispatchToProps = (dispatch) => ({
setColor(color) {
@ -215,5 +209,8 @@ const mapDispatchToProps = (dispatch) => ({
resetColor() {
dispatch(resetColor());
},
userRefresh(data) {
dispatch(userRefresh(data));
},
});
export default connect(mapStateToProps, mapDispatchToProps)(Index);

@ -12,15 +12,18 @@ import {
SwiperItem,
} from "@tarojs/components";
/*** redux ***/
import { connect } from "react-redux";
import { setMobile } from "../../store/features/userInfo";
/*** redux end ***/
import "taro-ui/dist/style/components/button.scss"; // 按需引入
import "./initiate.less";
import { go } from "../../utils/traoAPI";
import { getGlobalData, setGlobalData } from "../../utils/global";
const app = Taro.getApp();
export default class Index extends Component<any, any> {
class Initiate extends Component<any, any> {
constructor(props) {
super(props);
this.state = {
@ -45,16 +48,19 @@ export default class Index extends Component<any, any> {
},
});
console.log("app", app);
if (!getGlobalData("token")) await this.WCUserLogin();
const menu = Taro.getMenuButtonBoundingClientRect();
this.setState({ menu });
Taro.setStorageSync("isWelcome", true);
await this.intData();
}
componentDidMount() {
console.log("this.state", this.state);
if (!getGlobalData("token")) {
await this.WCUserLogin();
Taro.setStorageSync("isWelcome", true);
await this.initData();
} else {
// this.setBg();
go("/pages/entry/entry");
}
}
componentDidMount() {}
componentWillUnmount() {}
@ -62,47 +68,52 @@ export default class Index extends Component<any, any> {
componentDidHide() {}
async intData() {
async initData() {
const { data } = await MpSplashDetail({
pageNum: 1,
pageSize: 5,
type: 1,
});
console.log("data", data);
if (data.code === 200) {
let url = "";
if (data.rows.length) {
url = data.rows[0].fileUrl;
Taro.setStorageSync("MpSplashDetail_type1", JSON.stringify(data.rows));
}
let bgObj = data.rows.find((item: any) => item.fileSuffix === "video");
if (bgObj) {
url = bgObj.filePath;
this.setState({ url });
}
this.setState({ url });
}
}
setBg() {
let bgData = Taro.getStorageSync("MpSplashDetail_type1");
bgData = JSON.parse(bgData);
let bgObj = bgData.find((item: any) => item.fileSuffix === "video");
if (bgObj) {
this.setState({ url: bgObj.filePath });
}
}
async WCUserLogin() {
const { code } = await Taro.login();
console.log("code", typeof code);
const { data } = await WCUserLogin({ code });
if (data.code === 200) {
setGlobalData("token", data.data.token);
// Taro.setStorageSync("mobile", data.data.mobile);
this.props.setMobile(data.data.mobile);
}
}
touchstart(event) {
console.log("touchstart", event);
const { clientX, clientY } = event.changedTouches[0];
this.setState({ touchX: clientX, touchY: clientY });
}
touchend(event) {
console.log("touchstart", event);
const { clientX, clientY } = event.changedTouches[0];
const { touchX, touchY } = this.state;
console.log("clientX - touchX", clientX - touchX, clientX, touchX);
console.log(
"clientX - touchX < -30 && Math.abs(clientY - touchY) > 30",
clientX - touchX < -30,
Math.abs(clientY - touchY) < 30,
Math.abs(clientY - touchY)
);
if (clientX - touchX < -30 && Math.abs(clientY - touchY) < 30) {
this.onEnded();
}
@ -116,7 +127,7 @@ export default class Index extends Component<any, any> {
};
render() {
let { menu } = this.state;
let { menu, url } = this.state;
return (
<Block>
<View
@ -154,7 +165,7 @@ export default class Index extends Component<any, any> {
<View className="bg">
<Video
className="bg_item"
src=""
src={url}
initialTime={0}
controls={true}
autoplay={true}
@ -175,3 +186,13 @@ export default class Index extends Component<any, any> {
);
}
}
const mapStateToProps = (state) => ({
mobile: state.userInfo.mobile,
});
const mapDispatchToProps = (dispatch) => ({
setMobile(value) {
dispatch(setMobile(value));
},
});
export default connect(mapStateToProps, mapDispatchToProps)(Initiate);

@ -30,7 +30,7 @@ import {
UserInfo,
WCUserLogin,
} from "../../utils/Interface";
import { go, loading, msg, showModal } from "../../utils/traoAPI";
import { go, back, loading, msg, showModal } from "../../utils/traoAPI";
import { isVideo } from "../../utils/util";
import utilHtml from "../../utils/utilhtml";
const log = require("../../utils/log");
@ -64,9 +64,7 @@ export default class Instrument extends Component<any, any> {
};
}
async onLoad() {
console.log("app", app);
}
async onLoad() {}
componentDidMount() {}
componentWillUnmount() {}
@ -96,7 +94,6 @@ export default class Instrument extends Component<any, any> {
};
onTabTap = (e) => {
console.log(e);
const { type } = e.currentTarget.dataset;
this.setState({
inputType: type,
@ -104,7 +101,6 @@ export default class Instrument extends Component<any, any> {
};
onScanTap = () => {
const that = this;
/*
// 本地测试
const result = decodeURIComponent('https%3A%2F%2Fi.flossom.com%2Fa%3Ffr200test12');
@ -116,14 +112,13 @@ export default class Instrument extends Component<any, any> {
return*/
Taro.scanCode({
scanType: ["barCode", "qrCode"],
success(res) {
console.log(res);
success: (res) => {
const result = decodeURIComponent(res.result);
const bindCode = result.split("?")[1];
that.setState({
this.setState({
bindCode,
});
that.getBindCodeInfo();
this.getBindCodeInfo();
},
fail(err) {},
complete(res) {},
@ -218,8 +213,6 @@ export default class Instrument extends Component<any, any> {
};
onCancelBind2Tap = () => {
console.log("onCancelBind2Tap");
console.log("onCancelBind2Tap");
this.setState({
bindPopup: "",
bindCode: "",
@ -300,10 +293,7 @@ export default class Instrument extends Component<any, any> {
}
public back = () => {
Toast.show({
content: "点击了返回区域",
duration: 1000,
});
back();
};
render() {

@ -0,0 +1,3 @@
export default definePageConfig({
navigationBarTitleText: "重新登录",
});

@ -0,0 +1,74 @@
import { WCUserLogin } from "../../utils/Interface";
import { Component, PropsWithChildren, useEffect, useState } from "react";
import Taro from "@tarojs/taro";
// 引入 Swiper, SwiperItem 组件
import { Block, View, Text, Image, Input, Button } from "@tarojs/components";
/*** redux ***/
import { connect } from "react-redux";
import { setMobile } from "../../store/features/userInfo";
/*** redux end ***/
import { go } from "../../utils/traoAPI";
import "taro-ui/dist/style/components/button.scss"; // 按需引入
import "./login.less";
class Login extends Component<any, any> {
constructor(props) {
super(props);
this.state = {
name: "重新登录",
};
}
async onLoad() {}
componentDidMount() {}
componentWillUnmount() {}
componentDidShow() {}
componentDidHide() {}
async initData() {}
WCUserLogin = async () => {
const { code } = await Taro.login();
const { data } = await WCUserLogin({ code });
if (data.code === 200) {
Taro.setStorageSync("token", data.data.token);
this.props.setMobile(data.data.mobile);
go("/pages/index/index");
}
};
render() {
let { name } = this.state;
return (
<Block>
<Image
src="https://oss.flossom.com/miniapp/img/logo.png"
mode="widthFix"
></Image>
<View className="submitbtn" onClick={this.WCUserLogin}>
<Image
src="https://oss.flossom.com/miniapp/img/btn_bg.png"
mode="widthFix"
></Image>
<View className="btn"></View>
</View>
</Block>
);
}
}
const mapStateToProps = (state) => ({
mobile: state.userInfo.mobile,
});
const mapDispatchToProps = (dispatch) => ({
setMobile(value) {
dispatch(setMobile(value));
},
});
export default connect(mapStateToProps, mapDispatchToProps)(Login);

@ -26,7 +26,6 @@ export default class PrivacyPolicy extends Component<any, any> {
}
async onLoad() {
console.log("app", app);
}
componentDidMount() {}

@ -3,7 +3,6 @@ import { Component, PropsWithChildren, useEffect, useState } from "react";
import Taro from "@tarojs/taro";
// 引入 Swiper, SwiperItem 组件
import { Block, View, Text, Image, Button } from "@tarojs/components";
import { AtCheckbox } from "taro-ui";
import "taro-ui/dist/style/components/button.scss"; // 按需引入
import "./register.less";
@ -19,6 +18,7 @@ import {
GetUserMobile,
UserInfoRegister,
MpLoginDetail,
MpSplashDetail,
} from "../../utils/Interface";
import { compareVersion, formatRichText } from "../../utils/util";
import { go, loading, msg } from "../../utils/traoAPI";
@ -43,7 +43,7 @@ export default class Register extends Component<any, any> {
bg: "",
showPrivacyPopup: false,
showPrivacyContent: false,
isRead: true,
// isRead: true,
fromUrl: "",
};
}
@ -66,11 +66,8 @@ export default class Register extends Component<any, any> {
// if (!app.globalData.token) {
// await this.WCUserLogin();
// }
// that = this;
// const menu = wx.getMenuButtonBoundingClientRect();
// const titleHeight = 'height:' + (Number(menu.top) + Number(menu.height) + 10) + 'px;';
// this.setData({titleHeight, menu});
// await this.getBg()
this.initData();
}
onSkip = () => {
@ -86,13 +83,12 @@ export default class Register extends Component<any, any> {
checkPrivacy = () => {
const res = compareVersion("2.32.3");
const that = this;
if (res >= 0) {
// 弹出弹窗
Taro.getPrivacySetting({
success: (res) => {
if (res.needAuthorization) {
that.setState({
this.setState({
showPrivacyPopup: true,
});
app.globalData.needAuthorization = true;
@ -128,12 +124,12 @@ export default class Register extends Component<any, any> {
app.globalData.needAuthorization = false;
};
getBg = async () => {
const { data } = await MpLoginDetail();
if (data.code === 200) {
this.setState({ bg: data.data.data.image });
}
};
// getBg = async () => {
// const { data } = await MpLoginDetail();
// if (data.code === 200) {
// this.setState({ bg: data.data.data.image });
// }
// };
onCheck = () => {
const { isChecked } = this.state;
@ -141,33 +137,27 @@ export default class Register extends Component<any, any> {
};
onSubmit = async (event) => {
console.log("event", event);
if (event.detail.errMsg !== "getPhoneNumber:ok") {
this.changeGetPhoneNumberBtn();
return msg("获取失败");
}
const { code } = event.detail;
let res = await GetUserMobile({ code });
console.log("res", res);
if (res.data) {
const mobile = res.data;
}
// const { encryptedData, iv } = event.detail;
// Taro.login({
// success: ({ code }) => {
// this.onUpdateMobile({ encryptedData, iv, code });
// },
// });
try {
let res = await GetUserMobile({ code });
if (res.data) {
const mobile = res.data.data;
Taro.setStorageSync("mobile", mobile);
msg("获取成功");
this.changeGetPhoneNumberBtn();
}
} catch (error) {
this.changeGetPhoneNumberBtn();
}
};
// getPhoneNumber = (event) => {
// if (event.detail.errMsg === "getPhoneNumber:ok") {
// // this.UserInfo(event.detail.code);
// }
// };
// 防止重复获取手机号
changeGetPhoneNumberBtn = () => {
let { isButtonDisabled } = this.state;
this.setState({
@ -175,22 +165,6 @@ export default class Register extends Component<any, any> {
});
};
onUpdateMobile = (data) => {
// GetUserMobile(data).then((res) => {
// msg("授权成功");
// const mobile = res.data.data.list.phoneNumber;
// loading("注册中");
// UserInfoRegister({ mobile }).then((res) => {
// if (res.data.code === 200) {
// this.setState({ isRegister: true });
// setTimeout(() => {
// this.onCloseRegister();
// }, 2000);
// }
// });
// });
};
onCloseRegister = () => {
if (!this.state.isRegister) return;
this.setState({ isRegister: false });
@ -213,22 +187,23 @@ export default class Register extends Component<any, any> {
onPopup = async (event) => {
const { type } = event.target.dataset;
const request =
type === "agreement"
? await getUserAgreement()
: await getPrivacyAgreement();
const { data } = request;
if (data.code === 200) {
this.setState({
userAgreement: data.data.data?.user_agreement?.value
? formatRichText(data.data.data?.user_agreement?.value)
: null,
policy: data.data.data?.user_privacy_agreement?.value
? formatRichText(data.data.data?.user_privacy_agreement?.value)
: null,
isShow: true,
});
}
console.log("onPopup", event, type);
// const request =
// type === "agreement"
// ? await getUserAgreement()
// : await getPrivacyAgreement();
// const { data } = request;
// if (data.code === 200) {
// this.setState({
// userAgreement: data.data.data?.user_agreement?.value
// ? formatRichText(data.data.data?.user_agreement?.value)
// : null,
// policy: data.data.data?.user_privacy_agreement?.value
// ? formatRichText(data.data.data?.user_privacy_agreement?.value)
// : null,
// isShow: true,
// });
// }
};
componentDidMount() {}
@ -239,11 +214,19 @@ export default class Register extends Component<any, any> {
componentDidHide() {}
async initData() {}
async initData() {
const { data } = await MpSplashDetail({
pageNum: 1,
pageSize: 5,
type: 2,
});
if (data.code === 200) {
this.setState({ bg: data.rows[0].filePath });
}
}
render() {
let { name, isChecked, isRead, isButtonDisabled } = this.state;
let bg = "";
let { isChecked, bg, isButtonDisabled } = this.state;
return (
<Block>
<View>

@ -26,9 +26,7 @@ export default class Shop extends Component<any, any> {
};
}
async onLoad() {
console.log("app", app);
}
async onLoad() {}
componentDidMount() {}
componentWillUnmount() {}

@ -17,9 +17,7 @@ export default class Index extends Component<any, any> {
};
}
async onLoad() {
console.log("app", app);
}
async onLoad() {}
componentDidMount() {}
componentWillUnmount() {}

@ -0,0 +1,190 @@
page {
background: #ffffff;
}
.nav_bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 400rpx;
z-index: 1;
}
.info_box {
position: relative;
z-index: 9;
background: #ffffff;
border-radius: 50rpx 50rpx 0rpx 0rpx;
padding: 0 0 150rpx;
}
.infobox1 {
border-radius: 20rpx;
margin-top: 140rpx;
/*height: 490rpx;*/
}
.infobox1 .info1 {
/*padding: 70rpx 48rpx 0;*/
}
.infobox1 .img {
position: absolute;
top: -83rpx;
left: 0;
right: 0;
margin: 0 auto;
width: 140rpx;
height: 140rpx;
border-radius: 50%;
overflow: hidden;
}
.infobox1 .info1 .tipbox {
flex-direction: column;
width: 100%;
margin-top: 85rpx;
}
.infobox1 .info1 .tipbox .tip1 .name {
font-size: 44rpx;
font-weight: bold;
color: #000000;
line-height: 1;
}
.infobox1 .info1 .tipbox .tip1 .level {
color: #ffffff;
font-size: 30rpx;
background: #e1c5a2;
height: 32rpx;
line-height: 32rpx;
padding: 0 4rpx;
border-radius: 6rpx;
margin-left: 10rpx;
}
.infobox1 .info1 .tipbox .tip2 {
font-size: 24rpx;
font-weight: 500;
color: #999999;
line-height: 1;
margin-top: 25rpx;
}
.infobox1 .info2 {
border-radius: 20rpx;
height: 200rpx;
margin: 40rpx 28rpx 0;
}
.infobox1 .info3 {
margin: 22rpx 30rpx 0;
height: 60rpx;
line-height: 60rpx;
background: #f8f8f8;
border-radius: 30rpx;
font-size: 24rpx;
font-weight: 500;
color: #999999;
text-align: center;
}
.infobox1 .info2 .block {
position: relative;
flex: 1;
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 36rpx 0 26rpx 36rpx;
box-sizing: border-box;
}
.infobox1 .info2 .block .bg_img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
border-radius: 30rpx;
}
.infobox1 .info2 .block:first-child {
margin-right: 23rpx;
}
.infobox1 .info2 .block .num {
font-size: 48rpx;
font-weight: 600;
color: #000000;
}
.infobox1 .info2 .block .txt {
font-size: 22rpx;
font-weight: 500;
color: #a58e6d;
}
.infobox1 .info2 .block .tip .tip1 {
font-size: 26rpx;
font-weight: 500;
color: #000000;
margin-right: 20rpx;
}
.infobox1 .info2 .block .tip .right image {
width: 10rpx;
height: 20rpx;
}
.infobox1 .info2 .border {
width: 2px;
height: 86rpx;
}
.infobox2 {
margin: 64rpx 34rpx 0;
background: #fff;
border-radius: 20rpx;
}
.infobox2 .title {
font-size: 32rpx;
line-height: 1;
font-weight: bold;
color: #030000;
}
.infobox2 .info {
margin-top: 56rpx;
flex-wrap: wrap;
}
.infobox2 .info .block {
width: 25%;
flex-direction: column;
position: relative;
}
.infobox2 .info .block .img image {
width: 40rpx;
height: 40rpx;
}
.infobox2 .info .block .num {
position: absolute;
top: -5rpx;
right: -15rpx;
border-radius: 50%;
width: 12rpx;
height: 12rpx;
background: #eb5858;
border-radius: 50%;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 20rpx;
}
.infobox2 .info .block .img {
position: relative;
/*width: 64rpx;*/
/*height: 70rpx;*/
/*margin: auto;*/
}
.infobox2 .info .block .tip1 {
margin-top: 36rpx;
font-size: 26rpx;
font-weight: 500;
color: #000000;
}

@ -2,33 +2,40 @@ import { MpSplashDetail, WCUserLogin } from "../../utils/Interface";
import { Component, PropsWithChildren, useEffect, useState } from "react";
import Taro from "@tarojs/taro";
// 引入 Swiper, SwiperItem 组件
import {
View,
Text,
Image,
Video,
Swiper,
SwiperItem,
} from "@tarojs/components";
import { View, Block, Text, Image } from "@tarojs/components";
/*** redux ***/
import { connect } from "react-redux";
import { userRefresh } from "../../store/features/userInfo";
/*** redux end ***/
import "taro-ui/dist/style/components/button.scss"; // 按需引入
import "./user.less";
const app = Taro.getApp();
import type CustomTabBar from "../../custom-tab-bar";
export default class User extends Component<any, any> {
import Navbar from "../../components/navbar/navbar";
import RegisterModal from "../../components/modal/registerModal/registerModal";
class User extends Component<any, any> {
pageCtx = Taro.getCurrentInstance().page;
constructor(props) {
super(props);
this.state = {
name: "user",
userinfo: {
mobile: this.props.mobile,
nickname: this.props.nickname,
headimg: this.props.headimg,
},
MerchMobile: "",
count: 0,
year: new Date().getFullYear(),
lastDay: "",
messagecount: 0,
isNotRegister: false, // 是否未注册
};
}
async onLoad() {
console.log("app", app);
}
async onLoad() {}
componentDidMount() {}
componentWillUnmount() {}
@ -42,8 +49,230 @@ export default class User extends Component<any, any> {
async initData() {}
gourl = (e) => {
let { userinfo } = this.state;
if (!userinfo.mobile) {
this.setState({ isNotRegister: true }); // 打开弹窗
return;
}
let url = e.currentTarget.dataset.url;
if (url == "/pages/integral_list/integral_list") {
// this.CreditSubscribe(url);
return false;
}
Taro.navigateTo({
url,
});
};
gourls = (e) => {
let url = e.currentTarget.dataset.url;
if (url === "/pages/register/register" && this.state.userinfo.mobile) {
url = "/pages/userInfoDetail/userInfoDetail";
}
Taro.navigateTo({
url,
});
};
gominiapp() {
Taro.navigateToMiniProgram({
appId: "wx438760012de48d74",
path: "/pages/home/home",
envVersion: "release",
success(res) {
// 打开成功
},
});
}
render() {
let { name } = this.state;
return <View>{name}</View>;
let { userinfo, count, lastDay, num, messagecount, isNotRegister } =
this.state;
return (
<Block>
{isNotRegister ? <RegisterModal /> : ""}
<Navbar></Navbar>
<View className="info_box">
<View className="infobox1">
<View className="img">
<Image src={userinfo.headimg} mode="widthFix" />
</View>
<View
className="info1 flex aitems"
data-url="/pages/userInfoDetail/userInfoDetail"
>
<View className="tipbox flex aitems">
<View className="tip1 flex aitems">
<View className="name">
{userinfo.nickname
? userinfo.nickname
: "用户" + (userinfo.id || "")}
</View>
</View>
{userinfo.id ? (
<View className="tip2"> :{userinfo.id}</View>
) : (
""
)}
</View>
</View>
<View className="info2 flex aitems sa">
<View
className="block"
data-url="/pages/instrument_manage/instrument_manage?isback=1"
onClick={this.gourl}
>
<Image
className="bg_img"
src={require("../../img/device_bg.png")}
mode="aspectFill"
></Image>
<View className="tip flex aitems">
<View className="tip1"></View>
<View className="right">
<Image src="/img/my_right.png" mode="aspectFill" />
</View>
</View>
<View className="num">{count}</View>
<View className="txt"></View>
</View>
<View
className="block"
onClick={this.gourl}
data-url="/pages/integral_list/integral_list"
>
<Image
className="bg_img"
src={require("../../img/point_bg.png")}
mode="aspectFill"
></Image>
<View className="tip flex aitems">
<View className="tip1"></View>
<View className="right">
<Image
src={require("../../img/my_right.png")}
mode="aspectFill"
/>
</View>
</View>
<View className="num">{userinfo.credit2}</View>
<View className="txt">{lastDay}</View>
</View>
</View>
<View className="info3">
{lastDay}: {num}
</View>
</View>
<View className="infobox2">
<View className="title"></View>
<View className="info flex aitems">
<View
className="block flex aitems"
data-url="/pages/userInfoDetail/userInfoDetail"
onClick={this.gourl}
>
<View className="img">
<Image src={require("../../img/1.png")} mode="aspectFill" />
</View>
<View className="tip1"></View>
</View>
<View className="block flex aitems" onClick={this.gominiapp}>
<View className="img">
<Image src={require("../../img/2.png")} mode="aspectFill" />
</View>
<View className="tip1"></View>
</View>
<View
className="block flex aitems"
onClick={this.gourl}
data-url="/pages/integral_list/integral_list"
>
<View className="img">
<Image src={require("../../img/3.png")} mode="aspectFill" />
</View>
<View className="tip1"></View>
</View>
<View
className="block flex aitems"
data-url="/pages/message/message"
onClick={this.gourls}
>
<View className="img">
<Image src={require("../../img/4.png")} mode="aspectFill" />
{messagecount > 0 ? <View className="num"></View> : ""}
</View>
<View className="tip1"></View>
</View>
</View>
<View className="title" style="margin-top: 82rpx;">
</View>
<View className="info flex aitems">
<View
className="block flex aitems"
data-url="/pages/consultant/consultant"
onClick={this.gourls}
>
<View className="img">
<Image src={require("../../img/5.png")} mode="aspectFill" />
</View>
<View className="tip1"></View>
</View>
<View
className="block flex aitems"
data-url="/pages/teasing/teasing"
onClick={this.gourls}
>
<View className="img">
<Image src={require("../../img/6.png")} mode="aspectFill" />
</View>
<View className="tip1"></View>
</View>
<View
className="block flex aitems"
data-url="/pages/about/about"
onClick={this.gourls}
>
<View className="img">
<Image src={require("../../img/7.png")} mode="aspectFill" />
</View>
<View className="tip1"></View>
</View>
<View
className="block flex aitems"
data-url="/pages/xieyi1/xieyi1"
onClick={this.gourls}
>
<View className="img">
<Image src={require("../../img/8.png")} mode="aspectFill" />
</View>
<View className="tip1"></View>
</View>
</View>
</View>
</View>
{/* <View className="logo">
<Image
src="https://oss.flossom.com/miniapp/img/logo2.jpg"
mode="widthFix"
/>
</View> */}
</Block>
);
}
}
const mapStateToProps = (state) => ({
mobile: state.userInfo.mobile,
nickname: state.userInfo.nickname,
headimg: state.userInfo.headimg,
});
const mapDispatchToProps = (dispatch) => ({
userRefresh(data) {
dispatch(userRefresh(data));
},
});
export default connect(mapStateToProps, mapDispatchToProps)(User);

@ -1,22 +1,39 @@
import dayjs from "dayjs";
import {
MpSplashDetail,
UpUserNick,
UserInfoUp,
// MpSplashDetail,
// UpUserNick,
// UserInfoUp,
WCUserLogin,
UpdateUser,
GetProvince,
GetAreaListByPid,
} from "../../utils/Interface";
import { Component, PropsWithChildren, useEffect, useState } from "react";
import Taro from "@tarojs/taro";
// 引入 Swiper, SwiperItem 组件
import { Block, View, Text, Image, Input, Button } from "@tarojs/components";
import {
Block,
View,
Text,
Image,
Input,
Button,
// Picker,
} from "@tarojs/components";
import { Toast, Picker, Popup, DatetimePicker } from "@antmjs/vantui";
import "taro-ui/dist/style/components/button.scss"; // 按需引入
import "./userInfo.less";
/** 自定义组件 **/
import Navbar from "../../components/navbar/navbar";
/** 自定义组件 **/
import { getGlobalData, setGlobalData } from "../../utils/global";
import { loading, msg } from "../../utils/traoAPI";
import FormData from "../../utils/wx-formdata/formData";
const app = Taro.getApp();
export default class UserInfo extends Component<any, any> {
constructor(props) {
super(props);
@ -28,8 +45,10 @@ export default class UserInfo extends Component<any, any> {
userInfo: {
headimg: "",
nickname: "",
birthday: new Date().getTime(),
},
cityShow: false,
timeShow: false,
columns: [
{
values: [],
@ -52,31 +71,19 @@ export default class UserInfo extends Component<any, any> {
leve3region: [],
loading: true,
form: {
province: "",
provinceId: null,
city: "",
cityId: null,
area: "",
areaId: null,
},
formatter(type, value) {
if (type === "year") {
return `${value}`;
}
if (type === "month") {
return `${value}`;
}
return `${value}`;
nickname: "", // 昵称
provinceId: "", // 省份
cityId: "", // 市
areaId: "", // 县区
file: null,
},
dateShow: false,
maxDate: new Date().getTime(),
// maxDate: new Date().getTime(),
// minDate: new Date("1949-10-01").getTime(),
minDate: new Date("1949-10-01").getTime(),
birthday: "",
};
}
async onLoad() {
console.log("app", app);
if (!getGlobalData("token")) {
// await this.WCUserLogin();
}
@ -84,6 +91,8 @@ export default class UserInfo extends Component<any, any> {
const titleHeight =
"height:" + (Number(menu.top) + Number(menu.height) + 10) + "px;";
this.setState({ titleHeight, menu });
this.initData();
}
componentDidMount() {}
@ -93,69 +102,217 @@ export default class UserInfo extends Component<any, any> {
componentDidHide() {}
async initData() {}
async initData() {
await this.getProvince();
}
getProvince = async () => {
let res = await GetProvince();
if (res.data.code === 200) {
let { columns } = this.state;
let values = res.data.data.map((item: any) => item.name);
columns[0].values = values;
this.setState({ leve1region: res.data.data, columns });
onChooseAvatar = (event) => {
console.log("onChooseAvatar", event);
this.GetAreaListByPid_level2(res.data.data[0].id);
}
};
onNicknameChange = (event) => {
this.setState({ "userInfo.nickname": event.detail.value });
GetAreaListByPid_level2 = async (level2) => {
let res = await GetAreaListByPid({ pid: level2 });
if (res.data.code === 200) {
let { columns } = this.state;
let values = res.data.data.map((item: any) => item.name);
columns[1].values = values;
this.setState({ leve2region: res.data.data, columns });
this.GetAreaListByPid_level3(res.data.data[0].id);
}
};
GetAreaListByPid_level3 = async (level3) => {
let res = await GetAreaListByPid({ pid: level3 });
if (res.data.code === 200) {
let { columns } = this.state;
let values = res.data.data.map((item: any) => item.name);
columns[2].values = values;
this.setState({ leve3region: res.data.data, columns });
}
};
onSubmit() {
const { userInfo, form, birthday } = this.state;
console.log(userInfo, form, birthday);
UpdateUser = async () => {
let { form, userInfo } = this.state;
let formData = new FormData();
formData.append("provinceId", form.provinceId);
formData.append("cityId", form.cityId);
formData.append("areaId", form.areaId);
formData.append("birthday", userInfo.birthday);
formData.append("nickname", userInfo.nickname);
formData.appendFile("file", userInfo.headimg, "avatar.png");
console.log("form userInfo", form, userInfo);
// console.log("formData",formData.)
let data = formData.getData();
let res = await UpdateUser(data);
console.log("UpdateUser", res);
};
getChooseAvatar = (event) => {
console.log("getChooseAvatar", event);
let { userInfo } = this.state;
userInfo.headimg = event.detail.avatarUrl;
this.setState({ userInfo });
console.log(this.state.userInfo);
};
onSubmit = async () => {
const { userInfo, form } = this.state;
if (!userInfo.headimg) return msg("请点击授权头像");
if (!userInfo.nickname) return msg("请输入昵称");
if (!form.provinceId) return msg("请选择您所在的地区");
if (!birthday) return msg("请选择您的生日");
if (!userInfo.birthday) return msg("请选择您的生日");
loading("提交中");
// @ts-ignore
UpUserNick({
headimg: userInfo.headimg,
nickname: userInfo.nickname,
}).then((res) => {
loading("请稍等");
const data = {
birthday,
province: form.provinceId,
city: form.cityId,
area: form.areaId,
};
// @ts-ignore
UserInfoUp(data).then((res) => {
msg(res.data.msg);
this.onSkip();
});
});
}
await this.UpdateUser();
// // @ts-ignore
// UpUserNick({
// headimg: userInfo.headimg,
// nickname: userInfo.nickname,
// }).then((res) => {
// loading("请稍等");
// const data = {
// birthday,
// province: form.provinceId,
// city: form.cityId,
// area: form.areaId,
// };
// // @ts-ignore
// UserInfoUp(data).then((res) => {
// msg(res.data.msg);
// this.onSkip();
// });
// });
};
onSkip = () => {};
pickerChange = (event) => {
console.log("pickerChange", event);
};
onPickerColumnChange = (event) => {
console.log("onPickerColumnChange", event);
};
onCityChange = async (picker) => {
console.log("onCityChange", picker);
if (picker.detail.index === 0) {
this.setState({ loading: true });
let { leve1region } = this.state;
let obj = leve1region.find(
(item: any) => item.name === picker.detail.value[0]
);
await this.GetAreaListByPid_level2(obj.id);
this.setState({ loading: false });
return false;
}
if (picker.detail.index === 1) {
this.setState({ loading: true });
let { leve2region } = this.state;
let obj = leve2region.find(
(item: any) => item.name === picker.detail.value[1]
);
await this.GetAreaListByPid_level3(obj.id);
this.setState({ loading: false });
}
};
onCityConfirm = (picker) => {
const index = picker.detail.index;
let { form } = this.state;
form.province = picker.detail.value[0];
form.provinceId = this.state.leve1region[index[0]].id;
form.city = picker.detail.value[1];
form.cityId = this.state.leve2region[index[1]].id;
form.area = picker.detail.value[2];
form.areaId = this.state.leve3region[index[2]].id;
this.setState({ form });
this.onCityCancel();
};
onCityCancel = () => {
this.setState({ cityShow: false });
};
onCityShow = () => {
this.setState({ cityShow: true });
};
closeShow = () => {
this.setState({ cityShow: false });
};
onDateShow = () => {
this.setState({ dateShow: true });
onTimeShow = () => {
this.setState({ timeShow: true });
};
closeTime = () => {
this.setState({ timeShow: false });
};
onInputTimePicker = (event) => {
console.log("onInputDateTimePicker", event);
};
onTimePickerCancel = () => {
console.log("onTimePickerCancel");
this.closeTime();
};
onTimePickerConfirm = (picker) => {
let { userInfo } = this.state;
userInfo.birthday = dayjs(picker.detail.value).format("YYYY-MM-DD");
if (picker.detail.value) {
this.setState({ userInfo });
}
this.closeTime();
};
onNicknameChange = (event) => {
console.log("onNicknameChange", event);
let { userInfo } = this.state;
userInfo.nickname = event.detail.value;
this.setState({ userInfo });
};
onNickNameReview = (event) => {
console.log("onNickNameReview", event);
console.log(this.state.userInfo);
// let { userInfo } = this.state;
// userInfo.nickname = event.detail.value;
// this.setState({ userInfo });
};
render() {
let { titleHeight, style, birthday, userInfo, form, menu } = this.state;
let {
titleHeight,
style,
userInfo,
columns,
cityShow,
timeShow,
form,
minDate,
} = this.state;
const formatter = (type, value) => {
if (type === "year") {
return `${value}`;
}
if (type === "month") {
return `${value}`;
}
return `${value}`;
};
return (
<Block>
<View style={"background:#fff;" + titleHeight} className="nav">
<View
className="nav_box"
style={"top:" + menu.top + "px;height:" + menu.height + "px"}
>
<View className="logo">
<Image src="https://oss.flossom.com/logo2.png" mode="widthFix" />
</View>
</View>
</View>
<Navbar></Navbar>
<View style={titleHeight}></View>
<View className="main">
<View className="title"></View>
@ -164,7 +321,7 @@ export default class UserInfo extends Component<any, any> {
<Button
className="avatar_box"
open-type="chooseAvatar"
onChooseAvatar={this.onChooseAvatar}
onChooseAvatar={this.getChooseAvatar}
>
{!userInfo.headimg ? (
<Block>
@ -183,11 +340,12 @@ export default class UserInfo extends Component<any, any> {
<View className="label"></View>
<Input
type="nickname"
className="ipt"
className="ipt nickname"
placeholder="请填写您的昵称"
placeholder-style={style}
value={userInfo.nickname}
onInput={this.onNicknameChange}
onNickNameReview={this.onNickNameReview}
></Input>
</View>
<View className="form_item">
@ -197,7 +355,6 @@ export default class UserInfo extends Component<any, any> {
disabled
className="ipt"
placeholder="请选择您所在的地区/省市区"
placeholder-style="{{ style }}"
value={form.province + form.city + form.area}
></Input>
<Image
@ -208,12 +365,12 @@ export default class UserInfo extends Component<any, any> {
<View className="form_item">
<View className="label"></View>
<Input
onClick={this.onDateShow}
onClick={this.onTimeShow}
disabled
className="ipt"
placeholder="请选择您的生日"
placeholder-style="{{ style }}"
value={birthday}
placeholder-style={style}
value={userInfo.birthday}
></Input>
<Image
className="arrow"
@ -227,9 +384,33 @@ export default class UserInfo extends Component<any, any> {
</View>
<View className="text" onClick={this.onSkip}>
{" "}
</View>
</View>
<Popup show={cityShow} position={"bottom"} onClose={this.closeShow}>
<Picker
showToolbar
title="请选择您所在的地区"
defaultIndex={0}
columns={columns}
onChange={this.onCityChange}
onCancel={this.onCityCancel}
onConfirm={this.onCityConfirm}
/>
</Popup>
<Popup show={timeShow} position={"bottom"} onClose={this.closeTime}>
<DatetimePicker
type="date"
value={dayjs(userInfo.birthday).valueOf()}
minDate={minDate}
maxDate={Date.now()}
onInput={this.onInputTimePicker}
onCancel={this.onTimePickerCancel}
onConfirm={this.onTimePickerConfirm}
/>
</Popup>
</Block>
);
}

@ -0,0 +1,179 @@
page {
background: #f8f8f8;
}
image {
width: 100%;
height: 100%;
}
.infobox1 {
margin: 30rpx;
border-radius: 30rpx;
/*box-shadow: 0px 1px 8px #E5E5E5;*/
display: flex;
align-items: center;
padding: 20rpx 34rpx;
background: #fff;
}
/* 去掉背景色和内外边距 */
button {
margin: 0;
padding: 0;
background-color: inherit;
position: static;
}
button:after {
content: none;
}
/* 去掉边框 */
button::after {
border: none;
}
.infobox1 .avatar_box {
width: max-content;
}
.infobox1 .avatar_box .headimg {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
}
.nickname {
margin-left: 32rpx;
font-size: 28rpx;
font-weight: bold;
color: #000000;
}
.infobox2 {
margin: 30rpx;
border-radius: 30rpx;
/*box-shadow: 0px 1px 8px #E5E5E5;*/
background: #fff;
}
.infobox2 > .title {
padding: 39rpx 34rpx 62rpx;
font-size: 32rpx;
font-weight: bold;
color: #000000;
line-height: 1;
}
.infobox2 > .block_list {
display: flex;
align-items: center;
padding: 0 34rpx 60rpx;
font-size: 28rpx;
color: #000000;
font-weight: 500;
}
.infobox2 > .block_list > .label {
/*color: #3D3E3E;*/
}
.infobox2 > .block_list > .label > text {
color: #eb5858;
margin-left: 6rpx;
}
.infobox2 > .block_list > .value {
margin-left: 45rpx;
/*color: #666666;*/
position: relative;
}
.infobox2 > .block_list > .getmobile {
background: #d3bc8d;
font-size: 24rpx;
color: #fff;
padding: 14rpx 28rpx;
border-radius: 30rpx;
margin-left: 50rpx;
position: relative;
}
.infobox2 > .block_list > .getmobile > .mobilebtn {
position: absolute;
width: 100%;
top: 0;
bottom: 0;
left: 0;
z-index: 99;
opacity: 0;
}
.infobox3 {
margin: 30rpx;
border-radius: 30rpx;
/*box-shadow: 0px 1px 8px #E5E5E5;*/
background: #fff;
}
.infobox3 > .title {
padding: 39rpx 33rpx 62rpx;
font-size: 32rpx;
font-weight: bold;
color: #000000;
line-height: 1;
}
.infobox3 > .block_list {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 30rpx 35rpx;
font-size: 28rpx;
}
.infobox3 > .block_list > .label {
color: #030000;
}
.infobox3 > .block_list > .label > text {
color: #eb5858;
margin-left: 6rpx;
}
.infobox3 > .block_list > .value {
color: #000000;
display: flex;
align-items: center;
position: relative;
}
.infobox3 > .block_list > .value > .picker {
position: absolute;
width: 100%;
top: 0;
bottom: 0;
left: 0;
z-index: 99;
opacity: 0;
}
.infobox3 > .block_list > .value > .input input {
text-align: right;
}
.infobox3 > .block_list > .value > .righticon {
width: 10rpx;
height: 20rpx;
margin-left: 22rpx;
}
.submitbtn {
position: absolute;
bottom: 100rpx;
width: 400rpx;
left: 50%;
margin-left: -200rpx;
}
.btn_box {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 153rpx;
background: #ffffff;
box-shadow: 0rpx -3rpx 7rpx 1rpx rgba(173, 191, 207, 0.21);
padding-bottom: 21rpx;
}
.btn_box .btn {
width: 690rpx;
height: 90rpx;
line-height: 90rpx;
background: #000000;
border-radius: 45rpx;
text-align: center;
font-size: 32rpx;
font-weight: bold;
color: #ffffff;
}

@ -0,0 +1,402 @@
import dayjs from "dayjs";
import {
UpdateUser,
GetProvince,
GetAreaListByPid,
} from "../../utils/Interface";
import { Component } from "react";
import Taro from "@tarojs/taro";
// 引入 Swiper, SwiperItem 组件
import {
Block,
View,
Text,
Image,
Input,
Button,
// Picker,
} from "@tarojs/components";
import { Toast, Picker, Popup, DatetimePicker } from "@antmjs/vantui";
import "./userInfoDetail.less";
/*** redux ***/
import { connect } from "react-redux";
import { userRefresh } from "../../store/features/userInfo";
/*** redux end ***/
/** 自定义组件 **/
import Navbar from "../../components/navbar/navbar";
/** 自定义组件 **/
import { getGlobalData, setGlobalData } from "../../utils/global";
import { loading, msg } from "../../utils/traoAPI";
import FormData from "../../utils/wx-formdata/formData";
class UserInfoDetail extends Component<any, any> {
constructor(props) {
super(props);
this.state = {
name: "用户信息",
menu: {},
titleHeight: "",
style: "font-size: 26rpx; font-weight: 500; color: #ccc",
userInfo: {
mobile: this.props.mobile,
nickname: this.props.nickname,
headimg: this.props.headimg,
birthday: this.props.birthday,
},
cityShow: false,
timeShow: false,
columns: [
{
values: [],
classNameName: "column1",
defaultIndex: 0,
},
{
values: [],
classNameName: "column2",
defaultIndex: 0,
},
{
values: [],
classNameName: "column3",
defaultIndex: 0,
},
],
leve1region: [],
leve2region: [],
leve3region: [],
loading: true,
form: {
nickname: "", // 昵称
provinceId: "", // 省份
cityId: "", // 市
areaId: "", // 县区
file: null,
},
// maxDate: new Date().getTime(),
// minDate: new Date("1949-10-01").getTime(),
currentDate: new Date().getTime(),
minDate: new Date("1949-10-01").getTime(),
};
}
async onLoad() {
if (!getGlobalData("token")) {
// await this.WCUserLogin();
}
const menu = Taro.getMenuButtonBoundingClientRect();
const titleHeight =
"height:" + (Number(menu.top) + Number(menu.height) + 10) + "px;";
this.setState({ titleHeight, menu });
this.initData();
}
componentDidMount() {}
componentWillUnmount() {}
componentDidShow() {
console.log("this.props", this.props);
}
componentDidHide() {}
async initData() {
await this.getProvince();
}
getProvince = async () => {
let res = await GetProvince();
if (res.data.code === 200) {
let { columns } = this.state;
let values = res.data.data.map((item: any) => item.name);
columns[0].values = values;
this.setState({ leve1region: res.data.data, columns });
this.GetAreaListByPid_level2(res.data.data[0].id);
}
};
GetAreaListByPid_level2 = async (level2) => {
let res = await GetAreaListByPid({ pid: level2 });
if (res.data.code === 200) {
let { columns } = this.state;
let values = res.data.data.map((item: any) => item.name);
columns[1].values = values;
this.setState({ leve2region: res.data.data, columns });
this.GetAreaListByPid_level3(res.data.data[0].id);
}
};
GetAreaListByPid_level3 = async (level3) => {
let res = await GetAreaListByPid({ pid: level3 });
if (res.data.code === 200) {
let { columns } = this.state;
let values = res.data.data.map((item: any) => item.name);
columns[2].values = values;
this.setState({ leve3region: res.data.data, columns });
}
};
UpdateUser = async () => {
let { form, userInfo } = this.state;
let formData = new FormData();
formData.append("provinceId", form.provinceId);
formData.append("cityId", form.cityId);
formData.append("areaId", form.areaId);
formData.append("birthday", userInfo.birthday);
formData.append("nickname", userInfo.nickname);
// formData.appendFile("file", userInfo.headimg, "avatar.png");
console.log("form userInfo", form, userInfo);
// console.log("formData",formData.)
let data = formData.getData();
console.log("data", data.contentType);
let res = await UpdateUser(data);
console.log("UpdateUser", res);
};
getChooseAvatar = (event) => {
let { userInfo } = this.state;
userInfo.headimg = event.detail.avatarUrl;
this.setState({ userInfo });
};
onSubmit = async () => {
const { userInfo, form } = this.state;
console.log(userInfo, form);
if (!userInfo.headimg) return msg("请点击授权头像");
if (!userInfo.nickname) return msg("请输入昵称");
if (!form.provinceId) return msg("请选择您所在的地区");
if (!userInfo.birthday) return msg("请选择您的生日");
loading("提交中");
// @ts-ignore
await this.UpdateUser();
};
onSkip = () => {};
pickerChange = (event) => {
console.log("pickerChange", event);
};
onPickerColumnChange = (event) => {
console.log("onPickerColumnChange", event);
};
onCityChange = async (picker) => {
if (picker.detail.index === 0) {
this.setState({ loading: true });
let { leve1region } = this.state;
let obj = leve1region.find(
(item: any) => item.name === picker.detail.value[0]
);
await this.GetAreaListByPid_level2(obj.id);
this.setState({ loading: false });
return false;
}
if (picker.detail.index === 1) {
this.setState({ loading: true });
let { leve2region } = this.state;
let obj = leve2region.find(
(item: any) => item.name === picker.detail.value[1]
);
await this.GetAreaListByPid_level3(obj.id);
this.setState({ loading: false });
}
};
onCityConfirm = (picker) => {
const index = picker.detail.index;
let { form } = this.state;
form.province = picker.detail.value[0];
form.provinceId = this.state.leve1region[index[0]].id;
form.city = picker.detail.value[1];
form.cityId = this.state.leve2region[index[1]].id;
form.area = picker.detail.value[2];
form.areaId = this.state.leve3region[index[2]].id;
this.setState({ form });
this.onCityCancel();
};
onCityCancel = () => {
this.setState({ cityShow: false });
};
onCityShow = () => {
this.setState({ cityShow: true });
};
closeShow = () => {
this.setState({ cityShow: false });
};
onTimeShow = () => {
this.setState({ timeShow: true });
};
closeTime = () => {
this.setState({ timeShow: false });
};
onTimePickerCancel = () => {
console.log("onTimePickerCancel");
this.closeTime();
};
onTimePickerConfirm = (picker) => {
let { userInfo } = this.state;
userInfo.birthday = dayjs(picker.detail.value).format("YYYY-MM-DD");
if (picker.detail.value) {
this.setState({ userInfo });
}
this.closeTime();
};
onNicknameChange = (event) => {
console.log("onNicknameChange", event);
let { userInfo } = this.state;
userInfo.nickname = event.detail.value;
this.setState({ userInfo });
};
onNickNameReView = (event) => {
console.log("onNickNameReView", event);
};
render() {
let { userInfo, columns, cityShow, timeShow, form, minDate } = this.state;
console.log("userInfo", userInfo);
const formatter = (type, value) => {
if (type === "year") {
return `${value}`;
}
if (type === "month") {
return `${value}`;
}
return `${value}`;
};
return (
<Block>
<Navbar></Navbar>
<View className="infobox1">
<Button
className="avatar_box"
open-type="chooseAvatar"
onChooseAvatar={this.getChooseAvatar}
hover-className="none"
>
{userInfo.headimg ? (
<Image className="headimg" src={userInfo.headimg}></Image>
) : (
<Image
className="headimg"
src={require("../../img/welcome/avatar.png")}
></Image>
)}
</Button>
<Input
type="nickname"
className="nickname"
placeholder="请填写您的昵称"
value={userInfo.nickname}
onInput={this.onNicknameChange}
></Input>
</View>
<View className="infobox2">
<View className="title border"></View>
<View className="block_list flex aitems sb">
<View className="label">
<text>*</text>
</View>
<View className="value">{userInfo.mobile}</View>
</View>
</View>
<View className="infobox3">
<View className="title border"></View>
<View className="block_list" onClick={this.onCityShow}>
<View className="label">
()<text>*</text>
</View>
<View className="value">
<View>
{form.province}
{form.city}
{form.area}
</View>
<View className="righticon">
<Image
src={require("../../img/user/right.png")}
mode="aspectFill"
></Image>
</View>
</View>
</View>
<View className="block_list" onClick={this.onTimeShow}>
<View className="label">
<text>*</text>
</View>
<View className="value">
{/* <picker className="picker" mode="date" bindchange="bindbirthdayPickerChange" end="{{dateend}}" value="{{ageindex}}" range="{{age}}">picker</picker> */}
<View>{userInfo.birthday}</View>
<View className="righticon">
<Image
src={require("../../img/user/right.png")}
mode="aspectFill"
></Image>
</View>
</View>
</View>
</View>
<View className="btn_box flex aitems jcenter">
<View className="btn" onClick={this.onSubmit}>
</View>
</View>
<Popup show={cityShow} position={"bottom"} onClose={this.closeShow}>
<Picker
showToolbar
title="请选择您所在的地区"
defaultIndex={0}
columns={columns}
onChange={this.onCityChange}
onCancel={this.onCityCancel}
onConfirm={this.onCityConfirm}
/>
</Popup>
<Popup show={timeShow} position={"bottom"} onClose={this.closeTime}>
<DatetimePicker
type="date"
value={dayjs(userInfo.birthday).valueOf()}
minDate={minDate}
maxDate={Date.now()}
onCancel={this.onTimePickerCancel}
onConfirm={this.onTimePickerConfirm}
/>
</Popup>
</Block>
);
}
}
const mapStateToProps = (state) => ({
mobile: state.userInfo.mobile,
nickname: state.userInfo.nickname,
headimg: state.userInfo.headimg,
birthday: state.userInfo.birthday,
});
const mapDispatchToProps = (dispatch) => ({
userRefresh(data) {
dispatch(userRefresh(data));
},
});
export default connect(mapStateToProps, mapDispatchToProps)(UserInfoDetail);

@ -8,7 +8,6 @@ const navigationReducer = createSlice({
},
reducers: {
setColor(state, { payload }) {
console.log("payload", payload);
state.background = payload;
Taro.setNavigationBarColor({
@ -22,8 +21,6 @@ const navigationReducer = createSlice({
},
resetColor(state) {
state.background = "#fff";
console.log("state.background", state.background);
Taro.setNavigationBarColor({
frontColor: "#000000",
backgroundColor: "#ffffff",

@ -0,0 +1,37 @@
import Taro from "@tarojs/taro";
import { createSlice } from "@reduxjs/toolkit";
import { RefreshWxUserInfo } from "../../utils/Interface";
const userInfoReducer = createSlice({
name: "userInfo", // store的名字
initialState: {
mobile: "",
nickname: "",
headimg: "",
birthday: "",
},
reducers: {
setMobile(state, { payload }) {
state.mobile = payload;
},
setNickname(state, { payload }) {
state.nickname = payload;
},
setHeadimg(state, { payload }) {
state.headimg = payload;
},
userRefresh(state, { payload }) {
console.log("userRefresh payload", payload);
state.mobile = payload.mobile || "";
state.nickname = payload.nickname || "";
state.headimg = payload.headimg || "";
state.birthday = payload.birthday || "";
},
},
});
export const { setMobile, setNickname, setHeadimg, userRefresh } =
userInfoReducer.actions;
export default userInfoReducer.reducer;

@ -2,12 +2,14 @@ import { configureStore } from "@reduxjs/toolkit";
// 导入counter模块下的reducer函数
import counterReducer from "./features/counter";
import navigationReducer from "./features/navigation";
import userInfoReducer from "./features/userInfo";
const store = configureStore({
reducer: {
// 每个reducer都可以理解成一个子仓库
counter: counterReducer,
navigation: navigationReducer,
userInfo: userInfoReducer,
},
});

@ -1,4 +1,4 @@
import { Ajax, AjaxuploadFile } from "./request";
import { Ajax, AjaxuploadFile, AjaxFormData } from "./request";
import Taro from "@tarojs/taro";
// params转换url参数
@ -16,14 +16,51 @@ export const WCUserLogin = (data) => {
});
};
export const UserInfo = (data) => {
export const GetAboutUs = (data) => {
//获取用户信息接口
return Ajax({
url: "/Api/UserInfo",
url: "/hzwx/setting/getAboutUs",
data,
method: "get",
});
};
export const UpdateUser = (data) => {
// 更新用户信息
return AjaxFormData({
url: "/hzwx/user/updateUser",
data,
method: "post",
});
};
export const RefreshWxUserInfo = (data) => {
// 刷新用户信息
return Ajax({
url: "/hzwx/user/refreshWxUserInfo",
data,
method: "get",
});
};
export const GetProvince = (data) => {
// 获取全部省份
return Ajax({
url: "/hzwx/region/getProvince",
data,
method: "get",
});
};
export const GetAreaListByPid = (data) => {
// 获取全部省份 ?pid=xxx
return Ajax({
url: "/hzwx/region/getAreaListByPid" + paramsToUrlQueryString(data),
data,
method: "get",
});
};
/**
* 用户注册手机号
* @param data
@ -168,7 +205,6 @@ export const ActiveInfonoroot = (data) => {
};
export const GetUserMobile = (data = { code: "" }) => {
console.log("data", data);
if (!data.code) {
data.code = Taro.getStorageSync("token") || "";
}

@ -3,10 +3,12 @@ import { WCUserLogin } from "./Interface";
import { getGlobalData, setGlobalData } from "./global";
import Taro from "@tarojs/taro";
import formdata from "./wx-formdata/formData";
export const Ajax = (params) => {
const app = Taro.getApp();
const domain = getGlobalData("domain") || "http://192.168.10.147:80";
console.log("Ajaxdomain", app, domain);
// console.log("Ajaxdomain", app, domain);
// Taro.showLoading({
// title: '请求中...',
// mask: true
@ -32,7 +34,6 @@ export const Ajax = (params) => {
},
data: params.data,
success(res) {
console.log("res", res);
if (res.statusCode !== 200) {
if (res.statusCode == 403) {
showModal({
@ -101,7 +102,6 @@ export const Ajax = (params) => {
requestUrlList.indexOf(params.url),
1
);
console.log("newRequestUrlList", newRequestUrlList);
},
});
});
@ -110,10 +110,10 @@ export const Ajax = (params) => {
export const AjaxuploadFile = (params) => {
const app = getApp();
const domain = getGlobalData("domain");
Taro.showLoading({
title: "请求中...",
mask: true,
});
// Taro.showLoading({
// title: "请求中...",
// mask: true,
// });
return new Promise((reslove, reject) => {
Taro.uploadFile({
filePath: params.filePath,
@ -158,3 +158,96 @@ export const AjaxuploadFile = (params) => {
});
});
};
export const AjaxFormData = (params) => {
const app = Taro.getApp();
const domain = getGlobalData("domain");
// 防止多次点击
const requestUrlList = getGlobalData("requestUrlList") || [];
const whiteList = ["/Api/MessageList"];
if (
requestUrlList.indexOf(params.url) > -1 &&
whiteList.indexOf(params.url) < 0
) {
return;
} else {
requestUrlList.push(params.url);
}
return new Promise((reslove, reject) => {
Taro.request({
url: domain + params.url,
method: params.method || "GET",
header: {
Authorization: "Bearer " + getGlobalData("token") || "",
...params.header,
"content-type": params.data.contentType,
},
data: params.data.buffer,
success(res) {
if (res.statusCode !== 200) {
if (res.statusCode == 403) {
showModal({
t2: "登录已过期,请重新登录",
btn1show: false,
}).then((res) => {
setGlobalData("token", null);
Taro.reLaunch({
url: "/pages/initiate/initiate",
});
});
return;
}
showModal({
t2: String("错误码:" + res.statusCode),
btn1show: false,
});
return false;
}
if (res.data.code !== 200) {
let msg =
typeof res.data.msg == "string" ? res.data.msg : "没内容提示";
if (msg == "请不要操作太快哦") {
reject(res);
return false;
}
const noTipsCodes = [5001, 5002, 5003];
if (noTipsCodes.indexOf(res.data.code) == -1) {
showModal({
t2: msg,
btn1show: false,
}).then(() => {
reject(res);
if (res.data.code == 403 || res.data.msg === "登录状态已过期") {
setGlobalData("token", null);
Taro.reLaunch({
url: "/pages/initiate/initiate",
});
}
});
} else {
reject(res);
}
return false;
}
reslove(res);
},
fail(err) {
console.log(err);
Taro.showModal({
title: "提示",
content: "请检查网络是否连接",
showCancel: false,
});
},
complete() {
Taro.hideLoading();
const requestUrlList = getGlobalData("requestUrlList");
const newRequestUrlList = requestUrlList.splice(
requestUrlList.indexOf(params.url),
1
);
},
});
});
};

@ -0,0 +1 @@
Subproject commit e2aefc2d1059cb09b17c3dc9a132b0db92cdcdfb

@ -112,6 +112,8 @@ export interface AtCalendarPropsBase {
onDayLongClick?: (item: { value: string }) => void
onMonthChange?: (value: string) => void
onTimeChange: (value: any) => void
}
export interface AtCalendarSingleSelectedProps extends AtCalendarPropsBase {
@ -213,6 +215,8 @@ export interface AtCalendarBodyProps {
onSwipeMonth: (vectorCount: number) => void
onLongClick: (item: Calendar.Item) => void
onTimeChange: (value: any) => void
}
export interface AtCalendarBodyState {

Loading…
Cancel
Save