hookehuyr

✨ feat(我的模块): 新增儿童时,未实名认证提示

......@@ -49,7 +49,7 @@
</div>
<div>
<my-button v-if="userInfo.status === 'enable'" type="custom" :custom-style="styleObject2" @on-click="handleUser('ADD')">新增儿童</my-button>
<my-button v-else type="custom" :custom-style="styleObject4">新增儿童</my-button>
<my-button v-else type="custom" :custom-style="styleObject4" @on-click="showNotice = true">新增儿童</my-button>
</div>
</div>
......@@ -67,6 +67,14 @@
</div>
<van-action-sheet v-model:show="show" :actions="actions" @select="onSelect" />
<!-- 如果没有实名认证,新增儿童提示弹框 -->
<notice-overlay :show="showNotice" text="前往认证" @on-submit="onSubmit" @on-close="onClose">
<div style="color: #333333;">
<p>您还没有实名认证</p>
<p>请前往个人中心进行实名认证</p>
</div>
</notice-overlay>
</template>
<script setup>
......@@ -75,6 +83,7 @@ import { mainStore } from '@/store'
import icon_avatar from '@images/que-touxiang@2x.png'
import MyButton from '@/components/MyButton/index.vue'
import NoticeOverlay from '@/components/NoticeOverlay/index.vue'
import { ref, reactive, onMounted } from 'vue'
import { onBeforeRouteLeave, useRoute, useRouter } from 'vue-router'
......@@ -247,6 +256,19 @@ const goTo = (path) => {
}
})
}
// 未实名认证提示
const showNotice = ref(false)
const onClose = () => { // 关闭提示框回调
showNotice.value = false;
}
// 跳转个人中心
const onSubmit = () => {
$router.push({
path: '/me/verifyUser'
});
}
// 新增/编辑儿童信息
const handleUser = (type) => {
if (type === 'ADD') {
......