You need to sign in or sign up before continuing.
Commit 0bba6b9b authored by raca's avatar raca

feat: 更新引导页 积分兑换 显示数量

parent 366c0f2d
...@@ -67,6 +67,8 @@ export type SettintType = { ...@@ -67,6 +67,8 @@ export type SettintType = {
joinGroupPoint?: number; joinGroupPoint?: number;
personalPkLosePoint?: number; personalPkLosePoint?: number;
personalPkWinPoint?: number; personalPkWinPoint?: number;
newUserPoint?: number;
createNamePoint?: number;
} }
export function getSetting () { export function getSetting () {
......
import { View, RootPortal, Image, Text } from '@tarojs/components' import { View, RootPortal, Image, Text } from '@tarojs/components'
import { useEffect } from 'react' import { useEffect } from 'react'
import { useDidShow } from '@tarojs/taro'
import tutorialAssets from '@/assets/oss/assets-tutorial' import tutorialAssets from '@/assets/oss/assets-tutorial'
import classNames from 'classnames' import classNames from 'classnames'
import { useStoreState, useStoreActions } from '@/store/hooks' import { useStoreState, useStoreActions } from '@/store/hooks'
...@@ -13,6 +14,12 @@ const ModalAuthPhoneBefore = (props: ModalAuthPhoneBeforeProps) => { ...@@ -13,6 +14,12 @@ const ModalAuthPhoneBefore = (props: ModalAuthPhoneBeforeProps) => {
const { onConfirm } = props const { onConfirm } = props
const userInfo = useStoreState(state => state.userModel.userInfo) const userInfo = useStoreState(state => state.userModel.userInfo)
const nextStoreGuide = useStoreActions(actions => actions.guideModel.nextStoreGuide) const nextStoreGuide = useStoreActions(actions => actions.guideModel.nextStoreGuide)
const getSetting = useStoreActions(actions => actions.userModel.getSetting)
const setting = useStoreState((state) => state.userModel.setting)
useDidShow(() => {
getSetting()
})
useEffect(() => { useEffect(() => {
if (userInfo.authPhone === 'Y') { if (userInfo.authPhone === 'Y') {
...@@ -35,7 +42,7 @@ const ModalAuthPhoneBefore = (props: ModalAuthPhoneBeforeProps) => { ...@@ -35,7 +42,7 @@ const ModalAuthPhoneBefore = (props: ModalAuthPhoneBeforeProps) => {
为了让阿喵老师能给你发放礼品,需要你进行授权哦。 为了让阿喵老师能给你发放礼品,需要你进行授权哦。
<View> <View>
<Text className={styles.em}>授权成功后,</Text>还可以 <Text className={styles.em}>授权成功后,</Text>还可以
<Text className={styles.em}>获得20水晶</Text>奖励哦! <Text className={styles.em}>获得{setting.newUserPoint}水晶</Text>奖励哦!
</View> </View>
</View> </View>
<View className={styles.continue}> <View className={styles.continue}>
......
import { View, RootPortal, Image, Button, CommonEventFunction, ButtonProps } from '@tarojs/components' import { View, RootPortal, Image, Button, CommonEventFunction, ButtonProps } from '@tarojs/components'
import { showToast } from '@tarojs/taro' import { showToast, useDidShow } from '@tarojs/taro'
import { useBoolean } from '@/hooks' import { useBoolean } from '@/hooks'
import { receivePoint } from '@/api' import { receivePoint } from '@/api'
import { useStoreState, useStoreActions } from '@/store/hooks' import { useStoreState, useStoreActions } from '@/store/hooks'
...@@ -19,6 +19,8 @@ const ModalReceivePoint = (props: ReceivePointProps) => { ...@@ -19,6 +19,8 @@ const ModalReceivePoint = (props: ReceivePointProps) => {
const completeStoreGuide = useStoreActions(actions => actions.guideModel.completeStoreGuide) const completeStoreGuide = useStoreActions(actions => actions.guideModel.completeStoreGuide)
const updateNickNameAndPhone = useStoreActions(actions => actions.userModel.updateNickNameAndPhone) const updateNickNameAndPhone = useStoreActions(actions => actions.userModel.updateNickNameAndPhone)
const [fail, failActions] = useBoolean(false) const [fail, failActions] = useBoolean(false)
const getSetting = useStoreActions((state) => state.userModel.getSetting)
const setting = useStoreState((state) => state.userModel.setting)
const updatePhoneAndReceive = async (code: string) => { const updatePhoneAndReceive = async (code: string) => {
if (loading) return if (loading) return
...@@ -66,6 +68,10 @@ const ModalReceivePoint = (props: ReceivePointProps) => { ...@@ -66,6 +68,10 @@ const ModalReceivePoint = (props: ReceivePointProps) => {
completeStoreGuide() completeStoreGuide()
} }
useDidShow(() => {
getSetting()
})
const renderModal = () => { const renderModal = () => {
if (fail) { if (fail) {
return ( return (
...@@ -98,7 +104,7 @@ const ModalReceivePoint = (props: ReceivePointProps) => { ...@@ -98,7 +104,7 @@ const ModalReceivePoint = (props: ReceivePointProps) => {
return ( return (
<View className={styles.modal} catchMove> <View className={styles.modal} catchMove>
<Image src={giftAssets['point-receive.png'].u} className={styles.icon}></Image> <Image src={giftAssets['point-receive.png'].u} className={styles.icon}></Image>
<View className={styles.count}>水晶 +20</View> <View className={styles.count}>水晶 +{setting.newUserPoint}</View>
<View className={styles.tips}>阿喵老师的奖励,继续加油哦~</View> <View className={styles.tips}>阿喵老师的奖励,继续加油哦~</View>
{useInfo.authPhone === 'Y' {useInfo.authPhone === 'Y'
? ( ? (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment