|
@@ -15,6 +15,11 @@
|
|
|
<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>
|
|
@@ -24,15 +29,20 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
- import {
|
|
|
- ref
|
|
|
- } from 'vue'
|
|
|
+import {
|
|
|
+ ref
|
|
|
+} from 'vue'
|
|
|
import { showConfirm } from '@/utils/common'
|
|
|
import store from '@/store'
|
|
|
- const handlServiceAddress = () => {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages_mine/pages/setupUser/Address'
|
|
|
- })
|
|
|
+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 = () => {
|
|
@@ -43,44 +53,75 @@ const handlePersonalInfo = () => {
|
|
|
|
|
|
const logoOut = () => {
|
|
|
showConfirm('确认退出登陆吗?').then((res) => {
|
|
|
- if (res.confirm) {
|
|
|
- store.dispatch('LogOut').then((res) => {
|
|
|
- uni.reLaunch({
|
|
|
- url: '/pages/index',
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ 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){
|
|
|
+ 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;
|
|
|
- }
|
|
|
+.wrapper {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ padding: 24rpx 32rpx;
|
|
|
+}
|
|
|
|
|
|
- .text {
|
|
|
- flex: 1;
|
|
|
- /* 文字占据剩余空间 */
|
|
|
- font-size: 28rpx;
|
|
|
- color: #333;
|
|
|
- }
|
|
|
+.text {
|
|
|
+ flex: 1;
|
|
|
+ /* 文字占据剩余空间 */
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #333;
|
|
|
+}
|
|
|
|
|
|
- .icon {
|
|
|
- margin-left: 16rpx;
|
|
|
- /* 图标与文字的间距 */
|
|
|
- color: #999;
|
|
|
- /* 图标颜色 */
|
|
|
- font-size: 28rpx;
|
|
|
- /* 与文字大小匹配 */
|
|
|
- }
|
|
|
+.icon {
|
|
|
+ margin-left: 16rpx;
|
|
|
+ /* 图标与文字的间距 */
|
|
|
+ color: #999;
|
|
|
+ /* 图标颜色 */
|
|
|
+ font-size: 28rpx;
|
|
|
+ /* 与文字大小匹配 */
|
|
|
+}
|
|
|
|
|
|
- /* 分隔线样式调整 */
|
|
|
- .up-divider {
|
|
|
- margin: 0 32rpx;
|
|
|
- /* 与内容对齐 */
|
|
|
- }
|
|
|
+/* 分隔线样式调整 */
|
|
|
+.up-divider {
|
|
|
+ margin: 0 32rpx;
|
|
|
+ /* 与内容对齐 */
|
|
|
+}
|
|
|
</style>
|