123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <template>
- <view>
- <view class="wrapper" @click="handlePersonalInfo">
- <text class="text">个人信息</text>
- <up-icon name="arrow-right" class="icon"></up-icon>
- <up-divider></up-divider>
- </view>
- <!-- <view class="wrapper">
- <text class="text">绑定</text>
- <up-icon name="arrow-right" class="icon"></up-icon>
- <up-divider></up-divider>
- </view> -->
- <!-- <view class="wrapper" @click="handlServiceAddress">
- <text class="text">被服务地址</text>
- <up-icon name="arrow-right" class="icon"></up-icon>
- <up-divider></up-divider>
- </view> -->
- <view class="wrapper" @click="handelAuthentication">
- <text class="text">实名认证</text>
- <up-icon name="arrow-right" class="icon"></up-icon>
- <up-divider></up-divider>
- </view>
- <view class="wrapper" @click="logoOut">
- <text class="text">退出登陆</text>
- <up-icon name="arrow-right" class="icon"></up-icon>
- <up-divider></up-divider>
- </view>
- </view>
- </template>
- <script setup>
- import {
- ref
- } from 'vue'
- import { showConfirm } from '@/utils/common'
- import store from '@/store'
- import { onLoad, onShow } from '@dcloudio/uni-app'
- import { startEid, initEid } from '../mp_ecard_sdk/main'
- import { getEidToken,getEidResult } from '@/api/face'
- const eidToken = ref('2C4B0550-55F0-47E2-AF8D-0E359C9EBC74');
- const handlServiceAddress = () => {
- uni.navigateTo({
- url: '/pages_mine/pages/setupUser/Address'
- })
- }
- const handlePersonalInfo = () => {
- uni.navigateTo({
- url: '/pages_mine/pages/setupUser/personalInfo'
- })
- }
- const logoOut = () => {
- showConfirm('确认退出登陆吗?').then((res) => {
- if (res.confirm) {
- store.dispatch('LogOut').then((res) => {
- uni.reLaunch({
- url: '/pages/index',
- })
- })
- }
- })
- }
- const handelAuthentication = () => {
- getEidToken().then(res => {
- eidToken.value = res.data;
- const param = {
- data: {
- token: eidToken.value,
- },
- verifyDoneCallback(res) {
- console.log('收到核身完成的res', res);
- getEidResult({eidToken: res.token,verifyDone:res.verifyDone}).then(result=>{
- console.log("TCL: verifyDoneCallback -> result", result)
- if(result.code === 200){
- uni.showToast({
- title: '您已完成实名认证!',
- icon: 'success',
- })
- }
- })
- },
- };
- eidToken.value && startEid(param);
- })
- }
- onLoad(() => {
- //初始化
- initEid();
- })
- </script>
- <style scoped>
- .wrapper {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 24rpx 32rpx;
- }
- .text {
- flex: 1;
- /* 文字占据剩余空间 */
- font-size: 28rpx;
- color: #333;
- }
- .icon {
- margin-left: 16rpx;
- /* 图标与文字的间距 */
- color: #999;
- /* 图标颜色 */
- font-size: 28rpx;
- /* 与文字大小匹配 */
- }
- /* 分隔线样式调整 */
- .up-divider {
- margin: 0 32rpx;
- /* 与内容对齐 */
- }
- </style>
|