leon 1 år sedan
förälder
incheckning
c8aab0dfd2

+ 1 - 1
config/env.ts

@@ -1,4 +1,4 @@
 
 export const APP_VERSION = '1.0.2'
 export const ANDROID_VERSION = '1.0.0'
-export const WX_VERSION = '1.5.8'
+export const WX_VERSION = '1.5.9'

+ 9 - 6
src/_health/pages/log_time.tsx

@@ -809,7 +809,7 @@ export default function LogTime() {
     }
 
     function moreOption(isNew: boolean) {
-        const { window,join_id } = router.params
+        const { window, join_id } = router.params
         showActionSheet({
             title: '更多选项',
             itemList: isNew ? ['开始新的打卡'] : [window == 'FAST' ? '添加断食结束' : '添加起床'],
@@ -819,8 +819,11 @@ export default function LogTime() {
                         cancelAlert()
                     }
                     else {
-                        //jumpPage(`/_health/pages/log_time?type=home&index=${health.mode == 'FAST' ? 3 : 2}&single=${sceniaro.status == 'OG' ? 1 : 0}&is_start=0&window=${health.mode}&op_page=${health.mode == 'FAST' ? 'HOME_FAST' : 'HOME_SLEEP'}`)
-                        jumpPage(`./log_time?hide_more=1&join_id=${join_id}&type=home&index=${window == 'FAST' ? 3 : 2}&single=0&is_start=0&window=${window}&op_page=${window == 'FAST' ? 'HOME_FAST' : 'HOME_SLEEP'}`)
+                        var url = `./log_time?hide_more=1&join_id=${join_id}&type=home&index=${window == 'FAST' ? 3 : 2}&single=0&is_start=0&window=${window}&op_page=${window == 'FAST' ? 'HOME_FAST' : 'HOME_SLEEP'}`
+                        // jumpPage()
+                        Taro.redirectTo({
+                            url: url
+                        })
                     }
                 }
             }
@@ -838,13 +841,13 @@ export default function LogTime() {
                 console.log('cancel')
             },
             confirm: () => {
-                const { window,join_id } = router.params
+                const { window, join_id } = router.params
 
                 delRecord({ ids: [getScenario(health.windows, window).window_id] }).then(res => {
                     Taro.eventCenter.trigger('refreshMoments', '')
                     global.refreshWindow()
                     Taro.redirectTo({
-                        url:`./log_time?hide_more=1&join_id=${join_id}&index=${window == 'FAST' ? 0 : 1}&single=1&is_start=1&window=${window}&op_page=${window == 'FAST' ? 'HOME_FAST' : 'HOME_SLEEP'}`
+                        url: `./log_time?hide_more=1&join_id=${join_id}&index=${window == 'FAST' ? 0 : 1}&single=1&is_start=1&window=${window}&op_page=${window == 'FAST' ? 'HOME_FAST' : 'HOME_SLEEP'}`
                     })
                 })
                 console.log('confirm')
@@ -1266,7 +1269,7 @@ export default function LogTime() {
             }}>{expectText()}</View>
         }
         {
-            router.params.join_id && <FollowInfo user={long.follow}/>//<LongCard join={long.join} link={{}} hideJoin={true}/>//<FollowInfo />
+            router.params.join_id && <FollowInfo user={long.follow} />//<LongCard join={long.join} link={{}} hideJoin={true}/>//<FollowInfo />
         }
 
 

+ 6 - 4
src/_health/pages/timeline_detail.tsx

@@ -749,7 +749,7 @@ export default function TimelineDetail() {
             })
         }
         else {
-            return t('health.journal_created', {
+            return t('health.log_created', {
                 date_time: global.language == 'en' ?
                     dayjs(publish.timestamp).format('MMM D HH:mm') :
                     dayjs(publish.timestamp).format('M月D日 HH:mm')
@@ -758,10 +758,12 @@ export default function TimelineDetail() {
     }
 
     function backHome() {
-
         Taro.reLaunch({
-            url: '/pages/clock/Clock'
+            url:'/pages/moment/moment'
         })
+        // Taro.reLaunch({
+        //     url: '/pages/clock/Clock'
+        // })
     }
 
     function postBtnColor() {
@@ -980,7 +982,7 @@ export default function TimelineDetail() {
                         />
                     }
                     {
-                        join && <LongCard join={join} />
+                        join && <LongCard join={join} title={detail.title}/>
                     }
 
                     {

+ 2 - 2
src/_moment/components/long_card.scss

@@ -1,6 +1,6 @@
 .long_card_bg {
     background-color: #fafafa;
-    border-radius: 12px;
+    // border-radius: 12px;
     // width: 572px;
     box-sizing: border-box;
     padding-left: 20px;
@@ -21,7 +21,7 @@
     width: 40px;
     height: 40px;
     border-radius: 20px;
-    border: solid 2px #fff;
+    border: solid 2px #f0f0f0;
     background-color: #f0f0f0;
     box-sizing: border-box;
 }

+ 40 - 13
src/_moment/components/long_card.tsx

@@ -6,11 +6,13 @@ import ShareBtn from "@/components/basic/ShareBtn";
 import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
 import { useDispatch, useSelector } from "react-redux";
 import { getScenario } from "@/features/health/hooks/health_hooks";
-import { setFollow, setJoinData } from "@/store/long";
+import { setFollow, setJoinData, setJoinTitle } from "@/store/long";
 
-export default function LongCard(props: { join?: any,  user?: any, hideJoin?: boolean,share?:any }) {
-    const { status, key, from,window } = props.join
+export default function LongCard(props: { join?: any, user?: any, hideJoin?: boolean, share?: any, title?: string }) {
+    const { status, key, from, window } = props.join
     const health = useSelector((state: any) => state.health);
+    const user = useSelector((state: any) => state.user);
+    const long = useSelector((state: any) => state.long);
     const dispatch = useDispatch()
     let type = 0
     function join(e) {
@@ -20,10 +22,17 @@ export default function LongCard(props: { join?: any,  user?: any, hideJoin?: bo
         if (props.user) {
             dispatch(setFollow(props.user))
         }
+        if (props.title) {
+            dispatch(setJoinTitle(props.title))
+        }
         dispatch(setJoinData(props.join))
+        if (!user.isLogin) {
+            jumpPage('/_account/pages/ChooseAuth')
+            return
+        }
 
         if (window == 'ACTIVE' || window == 'EAT') {
-            jumpPage(`/_health/pages/add_moment?join_id=${key}&is_temp=${true}&window=${window}`)
+            jumpPage(`/_health/pages/add_moment?join_id=${key}&is_temp=${true}&window=${window}&title=${props.title ?? long.title}`)
         }
         else {
             if (window == 'FAST') {
@@ -54,16 +63,23 @@ export default function LongCard(props: { join?: any,  user?: any, hideJoin?: bo
     }
 
     function goDetail() {
+        if (!user.isLogin) {
+            jumpPage('/_account/pages/ChooseAuth')
+            return
+        }
         if (props.user) {
             dispatch(setFollow(props.user))
         }
+        if (props.title) {
+            dispatch(setJoinTitle(props.title))
+        }
         dispatch(setJoinData(props.join))
         jumpPage(`/_moment/pages/long_detail?join_id=${key}&window=${window}`)
     }
 
     function share() {
-        global.join_id = key
-        if (props.share){
+        // global.join_id = key
+        if (props.share) {
             props.share()
         }
     }
@@ -72,7 +88,7 @@ export default function LongCard(props: { join?: any,  user?: any, hideJoin?: bo
         return <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
             {
                 props.join.users.map((item, index) => {
-                    if (index>4) return 
+                    if (index > 4) return
                     return <Image className="long_avatar" style={{
                         zIndex: 10 - index,
                         marginLeft: index == 0 ? 0 : -rpxToPx(20)
@@ -80,7 +96,7 @@ export default function LongCard(props: { join?: any,  user?: any, hideJoin?: bo
                 })
             }
             {/* <View className="long_avatar"></View> */}
-            <View className="h26" style={{ marginLeft: rpxToPx(6) }}>{props.join.users.length>5?`+${props.join.users.length-5} more `:''}跟卡</View>
+            <View className="h26" style={{ marginLeft: rpxToPx(6) }}>{props.join.users.length > 5 ? `+${props.join.users.length - 5} more ` : ''}</View>
         </View>
     }
 
@@ -92,7 +108,7 @@ export default function LongCard(props: { join?: any,  user?: any, hideJoin?: bo
         }}>
             <View className="h20 g02" style={{ marginBottom: rpxToPx(6) }}>接自</View>
             <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
-                <View className="h26">{from.nickname}</View>
+                <View className="h26" style={{ marginRight: rpxToPx(8) }}>{from.nickname}</View>
                 {
                     users()
                 }
@@ -111,7 +127,7 @@ export default function LongCard(props: { join?: any,  user?: any, hideJoin?: bo
     if (status == 'JOIN')
         return <View onClick={goDetail} className="long_card_bg long_card_begin">
             {
-                (!props.join || props.join.user_count == 0) && <View className="h26 g02">一起接龙打卡</View>
+                (!props.join || props.join.user_count == 0) && <View className="h26 g02">{props.join.user.nickname}喊我一起打卡</View>
             }
 
             {
@@ -121,10 +137,21 @@ export default function LongCard(props: { join?: any,  user?: any, hideJoin?: bo
         </View>
 
     if (status == 'SHARE') {
+        if (!props.join || props.join.user_count == 0) {
+            return <View onClick={goDetail} className="long_card_bg long_card_begin" style={{ alignItems: 'center', justifyContent: 'center' }}>
+                <ShareBtn onClick={share}>
+                    <View style={{
+                        display: 'flex', flexDirection: 'row',
+                        alignItems: 'center', justifyContent: 'center'
+                    }}>
+                        <Image src={require('@assets/_health/wechat.png')} style={{ width: rpxToPx(44), height: rpxToPx(44), marginRight: rpxToPx(6) }} />
+                        <View className="h26 bold" style={{ color: MainColorType.success }} >邀请好友加入</View>
+                    </View>
+
+                </ShareBtn>
+            </View>
+        }
         return <View onClick={goDetail} className="long_card_bg long_card_begin">
-            {
-                (!props.join || props.join.user_count == 0) && <View className="h26 g02">一起接龙打卡</View>
-            }
             {
                 props.join && props.join.user_count > 0 && users()
             }

+ 4 - 3
src/_moment/pages/long_detail.tsx

@@ -33,6 +33,7 @@ export default function LongDetail() {
         router = useRouter()
     }
     const health = useSelector((state: any) => state.health);
+    const long = useSelector((state: any) => state.long);
     const [detail, setDetail] = useState<any>(null)
     const systemInfo: any = Taro.getWindowInfo ? Taro.getWindowInfo() : Taro.getSystemInfoSync();
     const navigationBarHeight = systemInfo.statusBarHeight + 44;
@@ -54,7 +55,7 @@ export default function LongDetail() {
         const { window } = router.params
         const key = router.params.join_id
         if (window == 'ACTIVE' || window == 'EAT') {
-            jumpPage(`/_health/pages/add_moment?join_id=${key}&is_temp=${true}&window=${window}`)
+            jumpPage(`/_health/pages/add_moment?join_id=${key}&title=${long.title}&is_temp=${true}&window=${window}`)
         }
         else {
             if (window == 'FAST') {
@@ -113,7 +114,7 @@ export default function LongDetail() {
         </View>
         <Image className="main_avatar" style={{ marginTop: navigationBarHeight }} src={detail.user.avatar} />
         <View className="h34 bold">{detail.user.nickname}</View>
-        <View className="h22 g02">{detail.user.relation_desc}</View>
+        <View className="h22 g02" style={{marginTop:rpxToPx(12),marginBottom:rpxToPx(12)}}>{detail.user.relation_desc}</View>
         <View className="h26 g02">累计获得 {detail.user.joined_total} 次跟卡</View>
         {
             detail.join_count > 0 && <View className="member_group">
@@ -137,7 +138,7 @@ export default function LongDetail() {
         }
         {
             detail.join_count == 0 && <View className="join_no_data">
-                <Image src={require('@assets/_health/social2.png')} style={{width:rpxToPx(108),height:rpxToPx(108)}}/>
+                <Image src={require('@assets/_health/social2.png')} style={{ width: rpxToPx(108), height: rpxToPx(108) }} />
                 <View className="h34 g01" style={{ marginBottom: rpxToPx(12), marginTop: rpxToPx(24) }}>No joins,yet</View>
                 <View className="h26 g01">Be ths first to joins</View>
             </View>

+ 1 - 1
src/_moment/pages/long_full.scss

@@ -11,7 +11,7 @@ page {
     width: 750px;
     position: relative;
     flex-direction: row;
-    background-color: #f0f0f0;
+    background-color: #fff;
 }
 
 .full_item_avatar{

+ 22 - 14
src/context/locales/en.js

@@ -1008,6 +1008,7 @@ export default {
 
         missing_date_time: 'Missing Date or Time',
         log_updated: 'Log updated On {{date_time}}',
+        log_created: 'Log created On {{date_time}}',
         journal_created: 'Journal created on {{date_time}}',
         journal_updated: 'Journal updated on {{date_time}}',
 
@@ -1222,19 +1223,26 @@ export default {
         reminder_cancel: 'Later',
         reminder_confirm: 'Activate',
 
-        friends:'Friends',
-        moments:'Moments',
-        my_moments:'My Moments',
-        my_friends:'My Friends',
-        notification:'Notifications',
-
-        moment_share_title:'Hi, let\'s be friends!',
-
-        follow:'Follow',
-        following:'Following',
-        following2:'Following',
-        followers:'Followers',
-        friends:'Friends',
-        follow_back:'Follow back',
+        friends: 'Friends',
+        moments: 'Moments',
+        my_moments: 'My Moments',
+        my_friends: 'My Friends',
+        notification: 'Notifications',
+
+        moment_share_title: 'Hi, let\'s be friends!',
+
+        follow: 'Follow',
+        following: 'Following',
+        following2: 'Following',
+        followers: 'Followers',
+        friends: 'Friends',
+        follow_back: 'Follow back',
+
+        call_friends_join: 'Call friends to join',
+        join: 'Join',
+        call_me_join: '{{name}} calls me to join',
+        no_join_yet: 'No joins yet',
+        be_first: 'Be the first to join!',
+        join_now: 'Join now',
     }
 }

+ 26 - 17
src/context/locales/zh.js

@@ -1010,6 +1010,7 @@ export default {
         missing_date_time: '日期或时间缺失',
 
         log_updated: '记录更新于 {{date_time}}',
+        log_created: '记录创建于 {{date_time}}',
         journal_created: '日记创建于 {{date_time}}',
         journal_updated: '日记更新于 {{date_time}}',
 
@@ -1215,27 +1216,35 @@ export default {
         share_all_journal: '{{date}}日记',
         share_food_journal: '{{date}}饮食日记',
         share_activity_journal: '{{date}}活动日记',
-        uploading:'上传中',
+        uploading: '上传中',
 
-        set_reminder:'设置提醒',
+        set_reminder: '设置提醒',
 
-        reminder_alert_title:'在公众号中,激活提醒功能',
-        reminder_cancel:'稍后',
-        reminder_confirm:'前往激活',
+        reminder_alert_title: '在公众号中,激活提醒功能',
+        reminder_cancel: '稍后',
+        reminder_confirm: '前往激活',
 
-        friends:'搭子圈',
-        moments:'搭子圈',
-        my_moments:'我的主页',
-        my_friends:'我的搭子',
-        notification:'消息通知',
+        friends: '搭子圈',
+        moments: '搭子圈',
+        my_moments: '我的主页',
+        my_friends: '我的搭子',
+        notification: '消息通知',
 
-        moment_share_title:'Hi, 快来成为我的搭子!',
+        moment_share_title: 'Hi, 快来成为我的搭子!',
+
+        follow: '关注',
+        following: '关注',
+        following2: '已关注',
+        followers: '粉丝',
+        friends: '搭子',
+        follow_back: '回关',
+
+        call_friends_join:'喊好友一起打卡',
+        join:'跟卡',
+        call_me_join:'{{name}} 喊我一起打卡',
+        no_join_yet:'还没有人跟卡',
+        be_first:'成为第一个跟卡者!',
+        join_now:'立即跟卡',
 
-        follow:'关注',
-        following:'关注',
-        following2:'已关注',
-        followers:'粉丝',
-        friends:'搭子',
-        follow_back:'回关',
     }
 }

+ 4 - 4
src/pages/moment/moment.tsx

@@ -101,15 +101,15 @@ export default function Friend() {
                 var imgs = detail.moment.media
                 var imageUrl = imgs.length > 0 ? imgs[0].url : defaultImg
                 var sharePath = `/_health/pages/timeline_detail?window_id=${detail.link.window_id}&event_id=${detail.link.event_id}&uid=${detail.user.id}&disable_edit=1&enter_type=share`
-                if (global.join_id){
-                    sharePath += `&join_id=${global.join_id}`
-                }
+                // if (global.join_id){
+                //     sharePath += `&join_id=${global.join_id}`
+                // }
                 var nickname = detail.user ? detail.user.nickname : user.nickname
                 if (nickname.length > 10) {
                     nickname.substring(0, 10) + '...'
                 }
                 global.momentShareData = null
-                global.join_id = null
+                // global.join_id = null
                 return {
                     title: nickname + ': ' + title,
                     path: sharePath,

+ 25 - 1
src/pages/moment/moment_detail_share.tsx

@@ -100,7 +100,7 @@ export default function MomentShare(props: { user: any, cover?: string }) {
                 ctx.drawImage(img1, 140 * dpr, 12 * dpr, 140 * dpr, 140 * dpr);
                 ctx.restore()
                 ctx.stroke();
-                
+
 
                 Taro.canvasToTempFilePath({
                     canvas: canvas,
@@ -123,6 +123,30 @@ export default function MomentShare(props: { user: any, cover?: string }) {
         const img1 = canvas.createImage(); // 创建图像对象
         img1.src = imagePaths[0]
         img1.onload = () => {
+            const x = 64 * dpr; // 矩形左上角 x 坐标
+            const y = 212 * dpr; // 矩形左上角 y 坐标
+            const width = 292 * dpr; // 矩形宽度
+            const height = 72 * dpr; // 矩形高度
+            const radius = 18 * dpr; // 圆角半径
+
+            // 绘制带圆角的矩形
+
+            ctx.beginPath();
+            ctx.moveTo(x + radius, y); // 移动到左上角的圆角位置
+            ctx.arcTo(x + width, y, x + width, y + height, radius); // 右上角
+            ctx.arcTo(x + width, y + height, x, y + height, radius); // 右下角
+            ctx.arcTo(x, y + height, x, y, radius); // 左下角
+            ctx.arcTo(x, y, x + width, y, radius); // 左上角
+            ctx.closePath();
+            ctx.fillStyle = '#ff0000'; // 设置填充颜色为红色
+            ctx.fill(); // 填充矩形
+
+            ctx.font = `bold ${26 * dpr}px sans-serif`
+            ctx.fillStyle = '#ffffff'
+            ctx.textAlign = 'center'
+            ctx.fillText('立即跟卡', x + width / 2.0, y + height / 2.0 + 10 * dpr);
+
+
             ctx.font = `bold ${24 * dpr}px sans-serif`
             ctx.fillStyle = '#E0B152'
             ctx.textAlign = 'center'

+ 2 - 2
src/pages/moment/moment_item.tsx

@@ -133,7 +133,7 @@ export default function MomentItem(props: { data: any }) {
                 />
             }
             {
-                join && <LongCard join={join} user={user} share={tapShare} />
+                join && <LongCard join={join} user={user} share={tapShare} title={moment.title} />
             }
 
             <View style={{ padding: kSpace }} />
@@ -141,7 +141,7 @@ export default function MomentItem(props: { data: any }) {
                 <View className="h26 g02">{dayjs(moment.timestamp).fromNow()}</View>
                 {
                     link && link.scenario != 'MOVE' && <View className="item_share_bg" onClick={tapShare}>
-                        <IconShare color={MainColorType.link} width={20} />
+                        <IconShare color={MainColorType.g02} width={20} />
                         <Button className="item_share" openType="share" onClick={() => { global.momentShareData = props.data; }}></Button>
                     </View>
                 }

+ 1 - 22
src/pages/moment/moment_share.tsx

@@ -79,28 +79,7 @@ export default function MomentShare() {
                 // ctx.fillStyle = '#ff0000'
                 // ctx.fillRect(0, 0, 420 * dpr, 336 * dpr);
 
-                const x = 64 * dpr; // 矩形左上角 x 坐标
-                const y = 212 * dpr; // 矩形左上角 y 坐标
-                const width = 292 * dpr; // 矩形宽度
-                const height = 72 * dpr; // 矩形高度
-                const radius = 18 * dpr; // 圆角半径
-
-                // 绘制带圆角的矩形
-
-                ctx.beginPath();
-                ctx.moveTo(x + radius, y); // 移动到左上角的圆角位置
-                ctx.arcTo(x + width, y, x + width, y + height, radius); // 右上角
-                ctx.arcTo(x + width, y + height, x, y + height, radius); // 右下角
-                ctx.arcTo(x, y + height, x, y, radius); // 左下角
-                ctx.arcTo(x, y, x + width, y, radius); // 左上角
-                ctx.closePath();
-                ctx.fillStyle = '#ff0000'; // 设置填充颜色为红色
-                ctx.fill(); // 填充矩形
-
-                ctx.font = `bold ${26 * dpr}px sans-serif`
-                ctx.fillStyle = '#ffffff'
-                ctx.textAlign = 'center'
-                ctx.fillText('立即跟卡', x + width / 2.0, y + height / 2.0+10*dpr);
+                
 
 
 

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

@@ -1,9 +1,9 @@
-const online = process.env.TARO_ENV == 'weapp' ? false : false;
+const online = process.env.TARO_ENV == 'weapp' ? true : false;
 
 import { WX_VERSION as _WX_VERSION, APP_VERSION as _APP_VERSION, ANDROID_VERSION as _ANDROID_VERSION } from "../../../config/env";
 
 // export const baseUrl = online ? 'https://api.fast.liveplus.fun' : 'https://api.fast.dev.liveplus.fun';
-export const baseUrl = online ? process.env.TARO_ENV == 'rn' ? 'https://api.app.fast.liveplus.fun' : 'https://api.fast.liveplus.fun' : 'https://api.fast.dev.liveplus.fun';//'https://api.pre.fast.liveplus.fun'//'https://api.fast.dev.liveplus.fun';
+export const baseUrl = online ? process.env.TARO_ENV == 'rn' ? 'https://api.app.fast.liveplus.fun' : 'https://api.pre.fast.liveplus.fun' : 'https://api.fast.dev.liveplus.fun';//'https://api.pre.fast.liveplus.fun'//'https://api.fast.dev.liveplus.fun';
 
 export const APP_VERSION = _APP_VERSION
 export const WX_VERSION = _WX_VERSION

+ 8 - 3
src/store/long.tsx

@@ -5,13 +5,15 @@ import { createSlice } from "@reduxjs/toolkit";
 interface LongState {
     // scenario: null,
     join: any,
-    follow:any,
+    follow: any,
+    title: string,
 }
 
 const initialState: LongState = {
     // scenario: null,
     join: null,
-    follow:null
+    follow: null,
+    title: ''
 }
 
 const longSlice = createSlice({
@@ -25,10 +27,13 @@ const longSlice = createSlice({
         setFollow(state, action) {
             state.follow = action.payload
         },
+        setJoinTitle(state, action) {
+            state.title = action.payload
+        },
 
 
     }
 });
 
 export default longSlice.reducer;
-export const { setJoinData,setFollow } = longSlice.actions;
+export const { setJoinData, setFollow, setJoinTitle } = longSlice.actions;