Leon пре 2 година
родитељ
комит
7b8d059507

+ 2 - 2
src/app.config.ts

@@ -65,11 +65,11 @@ const appConfig = defineAppConfig({
 })
 
 process.env.TARO_ENV === 'weapp' && (appConfig.tabBar = {
-  // custom: true,
+  custom: true,
   backgroundColor:'#000',
   color:'#ffffff66',
   selectedColor:'#ffffff',
-  borderStyle:'white',
+  borderStyle:'black',
   list: [
     {
       pagePath: 'pages/clock/Clock',

+ 25 - 0
src/app.scss

@@ -59,6 +59,30 @@ page {
 
 
 
+.px1SperateWidth {
+    width: 2px;
+    background-color: #fff;
+    opacity: 0.1;
+    margin-left: 100px;
+
+    -webkit-transform: scaleX(0.5);
+    transform: scaleX(0.5);
+}
+
+.px1SeperateHeight {
+    display: flex;
+    height: 2px;
+    background-color: #fff;
+    opacity: 0.1;
+    -webkit-transform: scaleY(0.5);
+    transform: scaleY(0.5);
+    position: absolute;
+    left: 0;
+    right: 0;
+    bottom: 0;
+}
+
+
 //modal
 
 .modal_title {
@@ -146,6 +170,7 @@ page {
     padding-bottom: 120px;
     display: flex;
     flex-direction: column;
+    flex-shrink: 0;
 }
 
 

BIN
src/assets/images/avatar_empty.png


+ 3 - 4
src/components/input/LimitPickers.tsx

@@ -161,16 +161,15 @@ const Component = forwardRef((props: {
         if (process.env.TARO_ENV == 'weapp') {
             e.stopPropagation()
         }
-        // if (isDisableConfirm) {
-        //     return;
-        // }
         
         var date = new Date();
         date.setDate(today.getDate() - ((props.limitDay ? props.limitDay - 1 : 6) - values[0]));
         const year = date.getFullYear();
         const month = date.getMonth() + 1;
         const day = date.getDate();
-        const time = `${year}-${expandZero(month)}-${expandZero(day)}T${expandZero(hours[values[1]])}:${expandZero(minutes[values[2]])}:00`;
+        const time = `${year}-${expandZero(month)}-${expandZero(day)}T${expandZero(hours[values[1]])}:${expandZero(minutes[values[2]])}:${expandZero((new Date(global.set_time)).getSeconds())}`;
+        console.log(global.set_time)
+        debugger
         if (getTimestamp(time) > global.set_time) {
             Taro.showToast({
                 icon: 'none',

+ 17 - 0
src/components/input/SlidngScale.scss

@@ -43,6 +43,18 @@
     width: 750px;
     height: 300px;
     position: relative;
+    -webkit-overflow-scrolling: touch
+    // opacity: 0;
+    // animation: showScroll 0.2s linear 0.4s forwards;
+}
+
+@keyframes showScroll {
+    0% {
+        opacity: 0;
+    }
+    100% {
+        opacity: 1;
+    }
 }
 
 .scrollContent {
@@ -120,6 +132,8 @@
 .top_line {
     height: 4px;
     width: 750px;
+    // opacity: 0;
+    // animation: showScroll 0.2s linear 0.4s forwards;
 }
 
 .scroll_bg {
@@ -136,6 +150,9 @@
     top: 0;
     height: 120px;
     width: 375px;
+
+    // background-color: red;
+    // opacity: 0.4;
     background: linear-gradient(90deg, #1C1C1C 1%, rgba(28, 28, 28, 0) 100%);
     z-index: 100;
 }

+ 95 - 38
src/components/input/SlidngScale.tsx

@@ -4,17 +4,20 @@ import './SlidngScale.scss'
 import { useEffect, useRef, useState } from "react";
 import Taro from "@tarojs/taro";
 import { rpxToPx } from "@/utils/tools";
+import { throttle } from 'lodash';
 
+var timerA = null
 export default function Component(props: {
     step: number, min: number,
     max: number, default_value: number, changed: Function, unit: string
     themeColor: string
 }) {
     const scrollViewRef = useRef<any>();
-    const minNum: number = props.min;//props.step < 1 ?props.default_value-1:props.default_value-10//
-    const maxNum: number = props.max;//props.step < 1 ?props.default_value+1:props.default_value+10//
-
+    const minNum: number = props.min;//props.step < 1 ?props.default_value-2:props.default_value-20//
+    const maxNum: number = props.max;//props.step < 1 ?props.default_value+2:props.default_value+20//
 
+    const [timer, setTimer] = useState(null)
+    const [leftData, setLeftData] = useState(0)
     const stepNum: number = props.step * 10;
     const jingdu: number = props.step < 1 ? 10 : 1;
     const list: any[] = [];
@@ -23,7 +26,10 @@ export default function Component(props: {
 
     const [current, setCurrent] = useState(props.default_value)
     const [left, setLeft] = useState((props.default_value - minNum) * slidngWidth / props.step + 1);
-    const [showScrollView, setShowScrollView] = useState(true)
+    const [isDraging, setIsDraging] = useState(false)
+    const [timeoutId, setTimeoutId] = useState(null);
+
+    // const [showScrollView, setShowScrollView] = useState(false)
 
     for (var i: number = minNum; i <= maxNum; i += props.step) {
         var value: number = parseFloat(i.toFixed(1));
@@ -38,16 +44,59 @@ export default function Component(props: {
 
     }
 
+    // useEffect(() => {
+    //     setTimeout(() => {
+    //         setShowScrollView(true)
+    //     }, 200)
+    // }, [])
+
+    // const dpr = Taro.pxTransform//Taro.getSystemInfoSync().pixelRatio; 
+
     useEffect(() => {
-        // setTimeout(() => {
-        //     setShowScrollView(true)
-        // }, 50)
+        let timeoutId;
+
+
     }, [])
 
-    // const dpr = Taro.pxTransform//Taro.getSystemInfoSync().pixelRatio; 
+    function scrollContent(e) {
+        if (timerA)
+            clearTimeout(timerA);
+
+        timerA = setTimeout(() => {
+            update(e)
+        }, 90) as any
+    }
+
+    const handleScroll = throttle((e) => {
+
+
+        if (timer) {
+            clearTimeout(timer)
+            setTimer(null)
+        }
+
+        if (leftData != e.detail && !isDraging) {
+            setLeftData(e.detail)
+            var timer2 = setTimeout(() => {
+                console.log('aaa')
+                update(e)
+            }, 90)
+            setTimer(timer2 as any)
+        }
 
 
-    const handleScroll = (e) => {
+
+    });
+
+    function dragStart(e) {
+        setIsDraging(true)
+    }
+
+    function dragEnd(e) {
+        setIsDraging(false)
+    }
+
+    function update(e) {
         const { scrollLeft } = e.detail;
 
         var count = scrollLeft / slidngWidth;
@@ -73,20 +122,19 @@ export default function Component(props: {
                 data = Math.round(data);
             }
 
-            setCurrent(data);
-            // setLeft((parseFloat(data+'') - props.min) * slidngWidth / props.step + 1);
 
+
+            setCurrent(data);
             props.changed(data);
         }
-    };
+    }
 
     const scrollEnd = (e) => {
-        const { scrollLeft } = e.detail;
-        setLeft(scrollLeft)
+        console.log(e, 'end')
+        // const { scrollLeft } = e.detail;
+        // setLeft(scrollLeft)
     }
 
-    console.log(list.length)
-
     function itemContent(data) {
         var item = list[data.index]
         var index = data.index
@@ -107,30 +155,39 @@ export default function Component(props: {
             <View className="shadow_top" />
             <View className="shadow_left" />
             <View className="shadow_right" />
-            {showScrollView && <View className="top_line" style={{ backgroundColor: props.themeColor }} />}
-            {
-                showScrollView && <ScrollView style={{ zIndex: 0,position:'relative' }} ref={scrollViewRef} scrollX enhanced scrollLeft={left} className="scroll" onScroll={handleScroll} onDragEnd={scrollEnd}>
-                    <View className="scrollContent">
-                        <View className="scrollPadding" />
-                        <View className="content">
-                             {
-                                list.map((item, index) => {
-                                    return <View className={item.showBig ? 'slidng_item_big' : item.showMiddle ? 'slidng_item_middle' : 'slidng_item'} 
-                                    style={{ width: 2, marginRight: 8, backgroundColor: props.themeColor,zIndex:0 }} key={index}>
-                                        {
-                                            item.showBig ? <Text className="slidng_text">{item.value}</Text> : null
-                                        }
-                                    </View>
-                                })
-                            } 
-                            <View style={{position:'fixed',right:0,top:0,width:100,bottom:0,backgroundColor:'red',zIndex:10}}/>
-                        </View>
-                        <View className="scrollPadding" />
-                        
+            <View className="top_line" style={{ backgroundColor: props.themeColor }} />
+            <ScrollView
+                style={{ zIndex: 0, position: 'relative' }} ref={scrollViewRef}
+                scrollX scrollLeft={left} className="scroll"
+                enablePassive={true}
+                fastDeceleration={true}
+                onScrollEnd={scrollEnd}
+                onDragEnd={dragEnd}
+                onDragStart={dragStart}
+                onScroll={scrollContent}
+                enhanced
+            >
+                <View className="scrollContent">
+                    <View className="scrollPadding" />
+                    <View className="content">
+                        {
+                            list.map((item, index) => {
+                                return <View className={item.showBig ? 'slidng_item_big' : item.showMiddle ? 'slidng_item_middle' : 'slidng_item'}
+                                    style={{ width: 2, marginRight: 8, backgroundColor: props.themeColor, zIndex: 0 }} key={index}>
+                                    {
+                                        item.showBig ? <Text className="slidng_text">{item.value}</Text> : null
+                                    }
+                                </View>
+                            })
+                        }
+                        {/* <View style={{position:'fixed',right:0,top:0,width:100,bottom:0,backgroundColor:'red',zIndex:10}}/> */}
                     </View>
+                    <View className="scrollPadding" />
+
+                </View>
+
+            </ScrollView>
 
-                </ScrollView>
-            }
             {/* <VirtualList height={rpxToPx(300)} width={rpxToPx(750)} onScroll={handleScroll} layout="horizontal"
                 initialScrollOffset={left}
                 itemCount={list.length}

+ 2 - 1
src/components/layout/Modal.scss

@@ -44,12 +44,13 @@
 
 
 .modal_bottom_content{
-    padding-bottom: 120px;
+    // padding-bottom: 120px;
     width: 750px;
     background-color: #1c1c1c;
     border-top-left-radius: 36px;
     border-top-right-radius: 36px;
     display: flex;
+    flex-shrink: 0;
     flex-direction: column;
     z-index: 1000000;
 }

+ 1 - 1
src/components/layout/Modal.tsx

@@ -60,7 +60,7 @@ export default function Modal(props: {
                 props.testInfo ? props.testInfo : null
             }
         </View>
-        <View className='modal_bottom_content' onClick={onClick}>
+        <View className='modal_bottom_content' style={{flexShrink:0}} onClick={onClick}>
             {/* <Text className='modal_title' style={{ color: color }}>{props.title ? props.title : '测试标题 '}</Text> */}
             {
                 props.children

+ 2 - 0
src/context/locales/zh.js

@@ -90,6 +90,8 @@ export default {
             toast: {
                 min_value: '不能再小了',
                 max_value: '不能再大了',
+                min_metric_count:'选择至少{{count}}项',
+                max_metric_count:'高级会员可选择{{count}}项以上',
                 min_time_value: '不能再晚了',
                 max_time_value: '不能再早了',
                 update_success: '更新成功',

+ 0 - 0
src/custom-tab-bar2/index.scss → src/custom-tab-bar/index.scss


+ 0 - 0
src/custom-tab-bar2/index.tsx → src/custom-tab-bar/index.tsx


+ 15 - 2
src/features/trackSomething/components/Metric.tsx

@@ -17,6 +17,7 @@ import MetricModalChoose from "./MetricModalChoose";
 import MetricModalOrder from './MetricModalOrder';
 import MetricModalAdd from "./MetricModalAdd";
 import MetricModalTime from "./MetricModalTime";
+import Modal from "@/components/layout/Modal";
 
 let useNavigation;
 if (process.env.TARO_ENV == 'rn') {
@@ -116,6 +117,7 @@ export default function Component(props: any) {
             setOrignalGroups(JSON.parse(JSON.stringify(array)))
             setGroups(array)
             setLimits((res as any).num_options_limit)
+            setNewOrders([])
         })
     }
 
@@ -414,7 +416,18 @@ export default function Component(props: any) {
             triggered={triggered}
             titleShowStyle={NaviBarTitleShowType.scrollToShow}
         />
-        <PageContainer style={{ backgroundColor: '#1c1c1c' }}
+
+        {
+            showPageContainer && <Modal dismiss={()=>{
+                onPageContainerCancel()
+                setShowPageContainer(false)
+            }} confirm={()=>{}}>
+                {
+                metricModalContent()
+            }
+            </Modal>
+        }
+        {/* <PageContainer style={{ backgroundColor: '#1c1c1c' }}
             overlayStyle='background-color:rgba(0,0,0,0.9)'
             custom-style='background-color:#1c1c1c'
             closeOnSlideDown={false}
@@ -427,7 +440,7 @@ export default function Component(props: any) {
             {
                 metricModalContent()
             }
-        </PageContainer>
+        </PageContainer> */}
     </View>
 
 }

+ 0 - 1
src/features/trackSomething/components/MetricModalAdd.tsx

@@ -34,7 +34,6 @@ export default function Component(props: { item: any, strTime: string, showPicke
                         </View>
                     })
                 }
-                <CoverView style={{position:'absolute',left:0,width:175,top:0,bottom:0,zIndex:100000,background:'pink'}}></CoverView>
             </View>
             <View className="change_time_bg ">
                 <View className="gray1 time_bg" onClick={() => { props.showPicker(metricItem) }}>

+ 4 - 3
src/features/trackSomething/components/MetricModalChoose.scss

@@ -57,9 +57,10 @@
     display: flex;
     flex-direction: row;
     height: 80px;
-    border-bottom-color: #121212;
-    border-bottom-style: solid;
-    border-bottom-width: 2px;
+    position: relative;
+    // border-bottom-color: #999999;
+    // border-bottom-style: solid;
+    // border-bottom-width: 2px;
     align-items: center;
 }
 

+ 35 - 7
src/features/trackSomething/components/MetricModalChoose.tsx

@@ -5,13 +5,14 @@ import { useTranslation } from 'react-i18next'
 import { useEffect, useState } from 'react'
 import { IconRadio, IconRadioCheck } from '@/components/basic/Icons'
 import Taro from '@tarojs/taro'
+import { useSelector } from 'react-redux'
 
 export default function Component(props: {
     themeColor: string, cancel: Function, confirm: Function, array: any, limit: any,
     orders: any, newOrders: any
 }) {
-    debugger
     const color = props.themeColor ? props.themeColor : '#ff0000'
+    const user = useSelector((state: any) => state.user);
     const [list, setList] = useState(props.array)
     const [oldList, setOldList] = useState(props.orders)
     const [newList, setNewList] = useState(props.newOrders)
@@ -58,7 +59,7 @@ export default function Component(props: {
             if (max == count) {
                 Taro.showToast({
                     icon: 'none',
-                    title: t('feature.common.toast.max_value'),
+                    title: t('feature.common.toast.max_metric_count',{count:count}),
                 })
                 return
             }
@@ -67,7 +68,7 @@ export default function Component(props: {
             if (min == count) {
                 Taro.showToast({
                     icon: 'none',
-                    title: t('feature.common.toast.min_value'),
+                    title: t('feature.common.toast.min_metric_count',{count:count}),
                 })
                 return
             }
@@ -111,12 +112,30 @@ export default function Component(props: {
     function codeIndex(code) {
         for (var i = 0; i < oldList.length; i++) {
             if (oldList[i].code == code) {
-                return i + 1;
+                return `序号:${i + 1}`;
             }
         }
-        for (var i = 0; i < oldList.length; i++) {
+        // for (var i = 0; i < newList.length; i++) {
+        //     if (newList[i].code == code) {
+        //         return i + 1 + oldList.length;
+        //     }
+        // }
+        return ''
+    }
+
+    function codeNewIndex(code){
+        for (var i = 0; i < newList.length; i++) {
             if (newList[i].code == code) {
-                return i + 1 + oldList.length;
+                return `序号:${i + 1 + oldList.length}`;
+            }
+        }
+        return ''
+    }
+
+    function codeOldIndex(code){
+        for (var i = 0; i < oldList.length; i++) {
+            if (oldList[i].code == code) {
+                return `序号:${i + 1}`;
             }
         }
         return ''
@@ -143,7 +162,16 @@ export default function Component(props: {
 
                                         <Text className='modal_item_text' style={{ color: color, marginLeft: 10 }}>{obj.name}</Text>
                                         <View style={{ flex: 1 }} />
-                                        <Text>{obj.is_following ? '序号:' + codeIndex(obj.code) : ''}</Text>
+                                        {
+                                            user.test_user && <Text>{obj.is_following ? codeIndex(obj.code) : ''}</Text>
+                                        }
+                                         {
+                                            user.test_user && <Text style={{color:'green'}}>{obj.is_following ? codeNewIndex(obj.code) : ''}</Text>
+                                        }
+                                        {
+                                            user.test_user && <Text style={{color:'red'}}>{!obj.is_following &&  codeOldIndex(obj.code)}</Text>
+                                        }
+                                        <View className='px1SeperateHeight'/>
                                     </View>
                                 })
                             }

+ 13 - 2
src/features/trackSomething/components/MoveOrderList.scss

@@ -22,8 +22,9 @@
     width: '100%';
     align-items: center;
     justify-content: space-between;
+    // position: relative;
     // background-color: pink;
-    border-bottom: solid 2px #1c1c1c;
+    // border-bottom: solid 2px #999999;
     margin-left: 46px;
     margin-right: 46px;
     box-sizing: border-box;
@@ -36,7 +37,17 @@
     align-items: center;
     justify-content: space-between;
     // background-color: pink;
-    border-bottom: solid 2px #1c1c1c;
+    // border-bottom: solid 2px #999999;
     margin-left: 26px;
     margin-right: 26px;
+}
+
+.seperate{
+    display: flex;
+    height: 2px;
+    background-color: #fff;
+    opacity: 0.1;
+    -webkit-transform: scaleY(0.5);
+    transform: scaleY(0.5);
+    width: 100%;
 }

+ 19 - 9
src/features/trackSomething/components/MoveOrderList.tsx

@@ -5,7 +5,7 @@ import { ColorType } from '@/context/themes/color';
 import Taro from '@tarojs/taro';
 import { IconDrag } from '@/components/basic/Icons';
 
-export default function Component(props: { array: any, itemHeight: number, color?: string,update:Function }) {
+export default function Component(props: { array: any, itemHeight: number, color?: string, update: Function }) {
     const [list, setList] = useState(props.array)
     const [movaleViewY, setMovaleViewY] = useState(0)
     const [dragElement, setDragElement] = useState(null)
@@ -176,23 +176,33 @@ export default function Component(props: { array: any, itemHeight: number, color
     }
 
     console.log(list)
-    return <View id="myScrollView" ref={ref} style={{height:'100%',  overflow: canScroll?'scroll':'hidden' }} catchMove>
+    return <View id="myScrollView" ref={ref} style={{ height: '100%', overflow: canScroll ? 'scroll' : 'hidden' }} catchMove>
         <MovableArea style={{ height: list.length * props.itemHeight, width: '100vw' }}>
             {list.map((item, index) => {
                 return <View style={{ opacity: changedIndex == index && hiddenContent ? 0 : 1, height: props.itemHeight, width: '100vw' }}
                     onLongPress={(e) => longPress(e, index)}
-                    
+
                     onTouchMove={(e) => touchMove(e)}
                     onTouchEnd={(e) => touchEnd(e)}
                 >
-                    <View className='modal_order_item' style={{ height: 40}}>
-                        <Text style={{ color: props.color }}>{item.name}</Text>
-                        <IconDrag width={17} height={12} />
+                    <View className='modal_order_item' style={{ height: 40,flexDirection:'column' }}>
+                        <View style={{
+                            height: 40,
+                            display: 'flex', flexDirection: 'row',
+                            width:'100%',
+                            alignItems: 'center', justifyContent: 'space-between'
+                        }}>
+                            <Text style={{ color: props.color }}>{item.name}</Text>
+                            <IconDrag width={17} height={12} />
+                            
+                        </View>
+                        <View className='seperate' />
+
                         {/* <Image src={require('@assets/images/menu.png')} style={{width:20,height:20}}/> */}
                     </View>
                 </View>
             })}
-            <MovableView style={{ height: changedIndex>=0?props.itemHeight:0,width:'100vw' }}
+            <MovableView style={{ height: changedIndex >= 0 ? props.itemHeight : 0, width: '100vw' }}
                 direction='vertical'
                 disabled
                 animation={false}
@@ -200,8 +210,8 @@ export default function Component(props: { array: any, itemHeight: number, color
             >
                 <View className='drag_item' style={{ backgroundColor: props.color }}>
                     {
-                        dragIndex >= 0 && <View className='modal_sel_item' style={{ height: 40, border:'none' }}>
-                            <Text style={{ color: 'black',fontWeight:'bold' }}>{list[changedIndex].name}</Text>
+                        dragIndex >= 0 && <View className='modal_sel_item' style={{ height: 40, border: 'none' }}>
+                            <Text style={{ color: 'black', fontWeight: 'bold' }}>{list[changedIndex].name}</Text>
                             <IconDrag width={17} height={12} />
                         </View>
                     }

+ 9 - 11
src/features/trackTimeDuration/components/Console.tsx

@@ -1,5 +1,5 @@
 
-import { View, Text, PickerView, PageContainer } from "@tarojs/components";
+import { View, Text, PickerView,ScrollView } from "@tarojs/components";
 import { useEffect, useRef, useState } from "react";
 import { TimeFormatter } from "@/utils/time_format";
 import { useDispatch, useSelector } from "react-redux";
@@ -120,12 +120,12 @@ export default function Component(props: { isNextStep?: boolean }) {
         // }} />);
         // global.showClockModal(true, node);
         var node = layoutContent()
-        global.showClockModal(true, node);
+        global.showClockModal(true, node,testLayout());
     }
 
     function hidePicker() {
         var node = layoutContent()
-        global.showClockModal(false, node);
+        global.showClockModal(false, node,null);
         if (global.testInfotimer) {
             clearInterval(global.testInfotimer)
             global.testInfotimer = null
@@ -165,8 +165,6 @@ export default function Component(props: { isNextStep?: boolean }) {
                     isFast = true;
                 }
                 break;
-
-
         }
 
         if (props.isNextStep) {
@@ -174,20 +172,20 @@ export default function Component(props: { isNextStep?: boolean }) {
             isStart = false
         }
 
-        return <View style={{ color: '#fff', paddingTop: 30, paddingLeft: 30, display: 'flex', flexDirection: 'column' }}>
+        return <ScrollView scrollY>
+            <View style={{ color: '#fff',  paddingLeft: 30, display: 'flex', flexDirection: 'column' }}>
             <Text>check scenario:{isFast ? 'fast' : 'sleep'}</Text>
             <Text>check type:{isStart ? 'start' : 'end'}</Text>
-            <Text style={{ marginTop: 30 }}>picker restriction</Text>
+            <Text style={{ marginTop: 10 }}>picker restriction</Text>
             <Text style={{ marginLeft: 50 }}>min:{TimeFormatter.formatTimestamp(global.limit)}</Text>
             <Text style={{ marginLeft: 50 }}>pick:{TimeFormatter.formatTimestamp(global.picker_time)}</Text>
             <Text style={{ marginLeft: 50 }}>max{TimeFormatter.formatTimestamp(global.set_time)}</Text>
-
-            <Text style={{ marginTop: 30 }}>now:{TimeFormatter.formatTimestamp(new Date().getTime())}</Text>
+            <Text style={{ marginTop: 10 }}>now:{TimeFormatter.formatTimestamp(new Date().getTime())}</Text>
             <Text>elapsed:{TimeFormatter.calculateTimeDifference(global.picker_time, new Date().getTime())}</Text>
-
-            <Text style={{ marginTop: 30 }}>real start:{isStart ? '-' : TimeFormatter.formatTimestamp(isFast ? time.fast.real_start_time : time.sleep.real_start_time)}</Text>
+            <Text style={{ marginTop: 10 }}>real start:{isStart ? '-' : TimeFormatter.formatTimestamp(isFast ? time.fast.real_start_time : time.sleep.real_start_time)}</Text>
             <Text>real duration:{isStart ? '-' : TimeFormatter.calculateTimeDifference(isFast ? time.fast.real_start_time : time.sleep.real_start_time, new Date().getTime())}</Text>
         </View>
+        </ScrollView>
     }
 
 

+ 4 - 4
src/features/trackTimeDuration/components/SetSchedule.tsx

@@ -379,7 +379,7 @@ export default function Component() {
           onClick={() => start()} />
       </Footer>
 
-      <PageContainer style={{ backgroundColor: '#1c1c1c' }}
+      {/* <PageContainer style={{ backgroundColor: '#1c1c1c' }}
         overlayStyle='background-color:rgba(0,0,0,0.9)'
         custom-style='background-color:#1c1c1c'
         closeOnSlideDown={false}
@@ -389,8 +389,8 @@ export default function Component() {
         {
           isModalTimePicker?timeContent():layoutContent()
         }
-      </PageContainer>
-      {/* {
+      </PageContainer> */}
+      {
         isOpen && <Modal children={layoutContent()} dismiss={() => setIsOpen(false)} confirm={() => {
           setIsOpen(false)
           durationChange(pickerRef.current.getConfirmData())
@@ -400,7 +400,7 @@ export default function Component() {
         isTimeOpen && <Modal children={timeContent()} dismiss={() => setIsTimeOpen(false)} confirm={() => {
           setIsTimeOpen(false)
         }} />
-      } */}
+      }
 
     </View>
   }

+ 72 - 24
src/pages/account/ChooseAuth.tsx

@@ -1,4 +1,4 @@
-import { View ,Text} from "@tarojs/components";
+import { View, Text } from "@tarojs/components";
 import Buttons from '@/components/basic/Buttons'
 import Texts from '@/components/basic/Texts'
 import './ChooseAuth.scss'
@@ -12,6 +12,7 @@ import { ChooseScenarioBtn } from "@/features/common/SpecBtns";
 import { useTranslation } from "react-i18next";
 import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
 import { loginSuccess } from "@/store/user";
+import RequestType, { thirdPartRequest } from "@/services/thirdPartRequest";
 
 let useNavigation;
 if (process.env.TARO_ENV == 'rn') {
@@ -19,49 +20,96 @@ if (process.env.TARO_ENV == 'rn') {
 }
 
 export default function Page() {
-    const [btnDisable,setBtnDisable] = useState(false)
+    const [btnDisable, setBtnDisable] = useState(false)
+    const [code, setCode] = useState('')
     const dispatch = useDispatch();
-    const {t} = useTranslation()
-    var code = '';
+    const { t } = useTranslation()
 
     const user = useSelector((state: any) => state.user);
     let navigation;
-    if (useNavigation){
+    if (useNavigation) {
         navigation = useNavigation()
     }
 
     useEffect(() => {
         if (user.isLogin) {
-            if (user.scenario_select_count > 0) {
-                Taro.navigateBack({
-                    delta: 1
-                })
+            if (user.is_new_user) {
+                console.log('new user')
+                if  (user.scenario_select_count==0){
+                    console.log('new')
+                    Taro.redirectTo({
+                        url: '/pages/clock/ChooseScenario'
+                    })
+                    setTimeout(()=>{
+                        Taro.navigateTo({
+                            url:'/pages/account/ProfileSetting?newuser=1'
+                        })
+                    },100)
+                }
+                else {
+                    console.log('replace')
+                    Taro.redirectTo({
+                        url:'/pages/account/ProfileSetting?newuser=1'
+                    })
+                }
+                
+                
             }
             else {
-                Taro.redirectTo({
-                    url: '/pages/clock/ChooseScenario'
-                })
+                console.log('old user')
+                if (user.scenario_select_count > 0) {
+                    Taro.navigateBack({
+                        delta: 1
+                    })
+                }
+                else {
+                    Taro.redirectTo({
+                        url: '/pages/clock/ChooseScenario'
+                    })
+                }
             }
 
+
         }
     }, [user.isLogin])
 
     useReady(() => {
-        if (process.env.TARO_ENV === 'weapp'){
-            Taro.login().then(res => {
-                code = res.code;
-    
+        // getCode()
+
+    })
+
+    function getCode() {
+        setBtnDisable(true)
+        if (process.env.TARO_ENV === 'weapp') {
+            thirdPartRequest(RequestType.RequestTypeWXLogin).then(res => {
+                login((res as any).code)
+            }).catch(err => {
+                Taro.showToast({
+                    title: '登录失败,请稍等重试',
+                    icon: 'none'
+                })
+                setBtnDisable(false)
             })
+
+            // Taro.login().then(res => {
+            //     setCode(res.code)
+            //     login(res.code)
+            //     // setBtnDisable(false)
+            // }).catch(e => {
+            //     console.log(e)
+            //     // getCode()
+            //     setBtnDisable(false)
+            // })
         }
-        
-    })
+    }
 
-    async function login() {
+    async function login(strCode) {
         setBtnDisable(true)
-        wxLogin(code).then(res=>{
+        wxLogin(strCode).then(res => {
+            console.log(res)
             dispatch(loginSuccess(res));
             setBtnDisable(false)
-        }).catch(e=>{
+        }).catch(e => {
             setBtnDisable(false)
         })
         // dispatch(wxLogin(code) as any);
@@ -79,15 +127,15 @@ export default function Page() {
     }
 
     function createAccount1() {
-        jumpPage('/pages/account/Auth','Auth',navigation)
+        jumpPage('/pages/account/Auth', 'Auth', navigation)
     }
 
     return <View className="container choose_container">
         <Texts text='fast16cc' type={TextType.big} />
         <Text className="slogan">{t('page.choose_auth.slogan')}</Text>
         {
-            process.env.TARO_ENV=='weapp'?<ChooseScenarioBtn title={t('page.choose_auth.btn_wechat')} onClick={login} background={ColorType.fast} />:
-            <ChooseScenarioBtn disable={btnDisable} title={t('page.choose_auth.btn_signup')} onClick={createAccount1} background={ColorType.fast} />
+            process.env.TARO_ENV == 'weapp' ? <ChooseScenarioBtn disable={btnDisable} title={t('page.choose_auth.btn_wechat')} onClick={getCode} background={ColorType.fast} /> :
+                <ChooseScenarioBtn disable={btnDisable} title={t('page.choose_auth.btn_signup')} onClick={createAccount1} background={ColorType.fast} />
         }
         {/* <ChooseScenarioBtn title={t('page.choose_auth.btn_wechat')} onClick={login} background={ColorType.fast} /> */}
         {/* <View style={{ height: 100 }} /> */}

+ 9 - 7
src/pages/account/EditPage.tsx

@@ -5,7 +5,7 @@ import { ChooseScenarioBtn } from "@/features/common/SpecBtns";
 import { update } from "@/services/user";
 import { updateSuccess } from "@/store/user";
 import { Input, View, Text } from "@tarojs/components";
-import Taro from "@tarojs/taro";
+import Taro, { useRouter } from "@tarojs/taro";
 import { useEffect, useState } from "react";
 import { useTranslation } from "react-i18next";
 import { useDispatch, useSelector } from "react-redux";
@@ -17,12 +17,14 @@ export default function Page() {
     const [btnDisable, setBtnDisable] = useState(false);
     const { t } = useTranslation()
     const dispatch = useDispatch();
+    const router = useRouter();
 
-    useEffect(()=>{
-        setTimeout(()=>{
-            setValue(user.nickname)
-        },300)
-    },[])
+    useEffect(() => {
+        setTimeout(() => {
+            setValue(router.params.name as any)
+            // setValue(user.nickname)
+        }, 300)
+    }, [])
 
     const handleChange = (e) => {
         setValue(e);
@@ -47,7 +49,7 @@ export default function Page() {
 
             setTimeout(() => {
                 Taro.navigateBack()
-            }, 2000)
+            }, 300)
 
         }).catch(e => {
             setBtnDisable(false)

+ 1 - 0
src/pages/account/Profile.tsx

@@ -165,6 +165,7 @@ export default function Page() {
                     <Switch checked={switchOn} onChange={switchChanged} />
                 </TableCell>
             }
+            <View  style={{height:40}}></View>
 
             {/* <Text>未更改前的1px线</Text>
             <View style={{ marginLeft: 100 }}>

+ 27 - 22
src/pages/account/ProfileSetting.tsx

@@ -4,17 +4,23 @@ import { View, Text, Image, Button } from "@tarojs/components";
 import { useDispatch, useSelector } from "react-redux";
 import './ProfileSetting.scss'
 import Box from "@/components/layout/Box";
-import Taro from "@tarojs/taro";
-import { useEffect } from "react";
+import Taro, { useRouter } from "@tarojs/taro";
+import { useEffect, useState } from "react";
 import { useTranslation } from "react-i18next";
 import { baseUrl } from "@/services/http/api";
 import { updateSuccess } from "@/store/user";
 import TableCell from "@/components/layout/TableCell";
 import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
+import Footer from "@/components/layout/Footer";
+import { ChooseScenarioBtn } from "@/features/common/SpecBtns";
+import { ColorType } from "@/context/themes/color";
 
 export default function Page() {
     const dispatch = useDispatch();
+    const router = useRouter();
     const user = useSelector((state: any) => state.user);
+    const [name, setName] = useState(user.nickname)
+    const [header, setHeader] = useState(user.avatar)
     const { t } = useTranslation()
 
     useEffect(() => {
@@ -24,7 +30,13 @@ export default function Page() {
     }, [])
 
     function editNickname() {
-        jumpPage('/pages/account/EditPage')
+        if (router.params.newuser == '1') {
+            jumpPage('/pages/account/EditPage?name='+(name==user.nickname?'':user.nickname))
+        }
+        else {
+            jumpPage('/pages/account/EditPage?name='+user.nickname)
+        }
+
     }
 
     function chooseAvatar(e) {
@@ -77,16 +89,14 @@ export default function Page() {
     }
 
     return <View className="container">
-        {/* <View className="row">
-            <Text>头像</Text>
-            <Image src={user.avatar} className="avatar" />
-            <Button className="btn" openType="chooseAvatar" onChooseAvatar={chooseAvatar}></Button>
-        </View> */}
-
         <View className="avatar_row">
             <View className="avatar_bg">
-                <Image src={user.avatar} className="avatar" mode="aspectFill"/>
-                
+
+                {
+                    router.params.newuser == '1' && user.avatar == header ?
+                        <Image src={require('@assets/images/avatar_empty.png')} className="avatar" mode="aspectFill" /> :
+                        <Image src={user.avatar} className="avatar" mode="aspectFill" />
+                }
                 <View className="camera_bg">
                     <Image className="camera" src={require('@assets/images/camera.png')} />
                 </View>
@@ -97,20 +107,15 @@ export default function Page() {
 
         <View onClick={editNickname}>
             <TableCell title={t('page.user_profile.nickname')} showArrow={true} showMarginBottom={true}>
-                <Text style={{ opacity: 0.8 }}>{user.nickname}</Text>
+                <Text style={{ opacity: 0.8 }}>{router.params.newuser == '1' ? (user.nickname == name ? '取个名字' : user.nickname) : user.nickname}</Text>
             </TableCell>
         </View>
-        {/* <View className="row" onClick={editNickname}>
-            <Text>昵称</Text>
-            <Text>{user.nickname}</Text>
-        </View> */}
-        {/* <View className="row">
-            <Text>用户名</Text>
-            <Text>{user.username}</Text>
-        </View> */}
-        {/* <Buttons title='退出登录' onClick={logoutF} style={{ width: 289, marginBottom: 30 }} />
 
-        <Buttons title='注销账号' onClick={clearF} style={{ width: 289, marginBottom: 30 }} /> */}
+        <Footer>
+            <ChooseScenarioBtn disable={router.params.newuser == '1' && (user.avatar == header || user.nickname == name)} title='确定' onClick={() => {
+                Taro.navigateBack()
+            }} background={ColorType.fast} />
+        </Footer>
 
 
     </View>

+ 25 - 7
src/pages/clock/Clock.weapp.tsx

@@ -43,6 +43,7 @@ import { ColorType } from '@/context/themes/color'
 import { jumpPage } from '@/features/trackTimeDuration/hooks/Common'
 import { ChooseScenarioBtn } from '@/features/common/SpecBtns'
 import { rpxToPx } from '@/utils/tools'
+import Modal from '@/components/layout/Modal'
 // import TabBar from '../../components/Tabbar';
 
 // import Rings from '@components/view/Rings';
@@ -78,7 +79,8 @@ export default function IndexPage() {
   const [consoleStatus, setConsoleStatus] = useState(consoleData.status)
   const [showLogin, setShowLogin] = useState(false)
   const [showTip, setShowTip] = useState(false)
-  const [isModal1,setIsModal1] = useState(false)
+  const [isModal1, setIsModal1] = useState(false)
+  const [debugInfo,setDebugInfo] = useState(null)
 
   let navigation;
   if (useNavigation) {
@@ -368,14 +370,16 @@ export default function IndexPage() {
     return isNeed
   }
 
-  global.showClockModal = (isShow: boolean, detail: any) => {
+  global.showClockModal = (isShow: boolean, detail: any,debugNode?:any) => {
     global.showModal = isShow
     setIsModal1(true)
+    setDebugInfo(debugNode)
     setShowModal(isShow)
     setModalDetail(detail)
   }
 
   global.showClockModal2 = (isShow: boolean, detail: any) => {
+    setDebugInfo(null)
     global.showModal = isShow
     setIsModal1(false)
     setShowModal2(isShow)
@@ -495,15 +499,15 @@ export default function IndexPage() {
           <View style={{ height: 100 }} />
         </View>
 
-        <PageContainer style={{ backgroundColor: '#1c1c1c' }}
+        {/* <PageContainer style={{ backgroundColor: '#1c1c1c' }}
           overlayStyle='background-color:rgba(0,0,0,0.9)'
           custom-style='background-color:#1c1c1c'
           closeOnSlideDown={false}
-          onBeforeEnter={()=>{
+          onBeforeEnter={() => {
             dispatch(setTabbarStatus(false));
             Taro.hideTabBar();
           }}
-          onBeforeLeave={()=>{
+          onBeforeLeave={() => {
             dispatch(setTabbarStatus(true));
             Taro.showTabBar();
           }}
@@ -511,9 +515,23 @@ export default function IndexPage() {
           show={showModal || showModal2} round={true} overlay={true} position='bottom'
         >
           {
-            isModal1 ? modalDetail: modalDetail2
+            isModal1 ? modalDetail : modalDetail2
           }
-        </PageContainer>
+        </PageContainer> */}
+        {
+          (showModal || showModal2) && <Modal 
+          testInfo={debugInfo}
+          dismiss={()=>{
+            setDebugInfo(null)
+            setShowModal(false); setShowModal2(false)
+          }} 
+          confirm={()=>{}}>
+            {
+              isModal1 ? modalDetail : modalDetail2
+            }
+          </Modal>
+        }
+
 
         {/* {
           showModal && modalDetail

+ 2 - 2
src/services/http/api.js

@@ -1,5 +1,5 @@
-let online = false;
-export let baseUrl = online ? 'https://api2.fast.liveplus.fun' : 'https://api.fast.dev.liveplus.fun';
+let online = true;
+export let baseUrl = online ? 'https://api.fast.liveplus.fun' : 'https://api.fast.dev.liveplus.fun';
 export let imgUrl = online
     ? 'https://api.fast.liveplus.fun/static/image/'
     : 'https://api.fast.dev.liveplus.fun/static/image/';

+ 6 - 2
src/store/user.tsx

@@ -8,6 +8,7 @@ interface UserState {
     scenario_select_count: number |  0;
     isLogin: boolean;
     test_user:boolean;
+    is_new_user:boolean;
 }
 
 
@@ -20,6 +21,7 @@ const initialState: UserState = {
     scenario_select_count: 0,
     token: null,
     test_user:false,
+    is_new_user:false,
 }
 
 const userSlice = createSlice({
@@ -27,7 +29,7 @@ const userSlice = createSlice({
     initialState,
     reducers: {
         loginSuccess(state, action: PayloadAction<any>) {
-            const { id,nickname, avatar, token,scenario_select_count,test_user } = action.payload;
+            const { id,nickname, avatar, token,scenario_select_count,test_user,is_new_user } = action.payload;
             state.id = id;
             state.nickname = nickname;
             state.avatar = avatar;
@@ -35,11 +37,12 @@ const userSlice = createSlice({
             state.scenario_select_count = scenario_select_count;
             state.isLogin = true;
             state.test_user = test_user;
+            state.is_new_user = is_new_user;
             global.token = token;
             Taro.setStorage({ key: 'userData', data: JSON.stringify(action.payload) });
         },
         registerSuccess(state, action: PayloadAction<any>) {
-            const { id,nickname, avatar, token,scenario_select_count,test_user } = action.payload;
+            const { id,nickname, avatar, token,scenario_select_count,test_user,is_new_user } = action.payload;
             state.id = id;
             state.nickname = nickname;
             state.avatar = avatar;
@@ -47,6 +50,7 @@ const userSlice = createSlice({
             state.scenario_select_count =  scenario_select_count;
             state.isLogin = true;
             state.test_user = test_user;
+            state.is_new_user = is_new_user;
             global.token = token;
             Taro.setStorage({ key: 'userData', data: JSON.stringify(action.payload) });
         },