浏览代码

实名认证

chenjj 3 月之前
父节点
当前提交
8205be4d41

+ 42 - 0
pages.json

@@ -252,6 +252,47 @@
 						"navigationBarTitleText": "个人信息"
 					}
 				},
+				{
+					"path": "pages/authentication/index",
+					"style": {
+						"navigationBarTitleText": "实名认证"
+					}
+				},
+
+				{
+					"path": "pages/mp_ecard_sdk/index/index",
+					"style": {
+						"navigationBarTitleText": "腾讯云E证通授权"
+					}
+				},
+				{
+					"path": "pages/mp_ecard_sdk/protocol/eid/eid",
+					"style": {
+						"navigationBarTitleText": "eID数字身份⼩程序服务协议",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "pages/mp_ecard_sdk/protocol/privacy/privacy",
+					"style": {
+						"navigationBarTitleText": "腾讯隐私政策",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "pages/mp_ecard_sdk/protocol/service/service",
+					"style": {
+						"navigationBarTitleText": "腾讯云E证通服务协议",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "pages/mp_ecard_sdk/protocol/userAccredit/userAccredit",
+					"style": {
+						"navigationBarTitleText": "⽤户授权协议",
+						"enablePullDownRefresh": false
+					}
+				},	
         {
           "path": "pages/integral/index",
           "style": {
@@ -363,6 +404,7 @@
 				}
 			]
 		}
+		
 	],
 	"tabBar": {
 		"custom": true,

+ 39 - 9
pages/mine/index.vue

@@ -190,6 +190,15 @@ const priceList = computed(() => {
 const userType = uni.getStorageSync('userType') //读取本地存储
 
 const adminList = [
+{
+    name: '实名认证',
+    img: '/static/serverImg/mine/adress.png',
+    key: 'map',
+    text: '前往实名认证',
+    operate: () => {
+      hanldeAuthentication()
+    },
+  },
   {
     name: '我的地址',
     img: '/static/serverImg/mine/adress.png',
@@ -246,6 +255,15 @@ const adminList = [
 
 ]
 const userList = [
+  {
+    name: '实名认证',
+    img: '/static/serverImg/mine/adress.png',
+    key: 'map',
+    text: '前往实名认证',
+    operate: () => {
+      hanldeAuthentication()
+    },
+  },
   {
     name: '我的地址',
     img: '/static/serverImg/mine/adress.png',
@@ -273,15 +291,7 @@ const userList = [
       show.value = true
     },
   },
-  // {
-  //     name: '修改个人信息',
-  //     img: '/static/serverImg/mine/xg.png',
-  //     key: 'map',
-  //     text: '去实名认证',
-  //     operate: () => {
-  //         handLsetTing();
-  //     },
-  // },
+
   {
     name: '用户',
     img: '/static/serverImg/mine/sf.png',
@@ -294,6 +304,26 @@ const userList = [
 ]
 
 
+// 实名认证
+const hanldeAuthentication = () => {
+  // wx.startFacialRecognitionVerify({
+  //   name: '陈建均',
+  //   idCardNumber:'500230200006011928',
+  //   checkAliveType:'2',
+  //   success: (result) => {
+  //     console.log("TCL: hanldeAuthentication -> result", result)
+  //     if (result.verifyResult)  {
+  //       // 认证成功,提交服务端校验 
+  //     }
+  //   },
+  //   fail: (err) => {
+  //     console.log("TCL: hanldeAuthentication -> err", err)
+  //   },
+  // })
+//   uni.navigateTo({
+//         url: `/pages_mine/pages/authentication/index`
+//  })
+}
 const switchUserType = (userType) => {
   uni.setStorageSync('userType', userType)
   store.dispatch('GetInfo').then((res) => {

+ 79 - 0
pages_mine/pages/authentication/index.vue

@@ -0,0 +1,79 @@
+<template>
+  <view class="token-input">
+
+    <view class="title">
+      请输入EID token
+    </view>
+
+    <view style="margin-bottom: 60rpx">
+      <input @input="bindTokenInput" placeholder="请输入token" :value="token" />
+    </view>
+
+    <view>
+      <button @click='onConfirm'>跳转到eID小程序</button>
+    </view>
+
+  </view>
+</template>
+
+<script>
+import { startEid, initEid } from '../mp_ecard_sdk/main'
+export default {
+  data() {
+    return {
+      token: '',
+    }
+  },
+  onLaunch: function () {
+    //初始化
+    initEid();
+  },
+  methods: {
+    bindTokenInput(e) {
+      console.log('dd', e)
+      this.token = e.detail.value;
+    },
+    onConfirm() {
+      console.log('startEid', startEid)
+      const param = {
+        data: {
+          token: this.token,
+        },
+        verifyDoneCallback(res) {
+          console.log('收到核身完成的res', res);
+        },
+      };
+      this.token && startEid(param);
+    },
+  }
+}
+</script>
+
+
+<style>
+.token-input {
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  /* justify-content: center; */
+}
+
+input {
+  margin-bottom: 40rpx;
+  border: 1px solid #ccc;
+  width: 600rpx;
+  height: 80rpx;
+}
+
+button {
+  width: 622rpx !important;
+  height: 96rpx !important;
+  background-color: #198eea;
+  color: #FFFFFF;
+  border: 2rpx solid #DDDDDD;
+  font-size: 32rpx;
+  font-weight: normal !important;
+  line-height: 96rpx !important;
+}
+</style>

+ 1 - 0
pages_mine/pages/mp_ecard_sdk/constants/log.js

@@ -0,0 +1 @@
+const Log={SourceType:"mp_sdk_uni",version:"1.0.0",initSdk:"INIT_SDK",getConfig:"GET_CONFIG",getConfigRetry:"GET_CONFIG_BY_RETRY",webViewResult:"WEBVIEW_RESULT",webViewError:"WEBVIEW_ERROR",navigateToEid:"NAVIGATE_TO_EID",navigateBackFromEid:"NAVIGATE_BACK_FROM_EID",navigateBackFromEidFail:"NAVIGATE_BACK_FROM_EID_FAIL",startEid:"START_EID",startEidFail:"START_EID_FAIL",eidVerifyDone:"EID_VERIFY_DONE",requestFail:"REQUEST_FAIL",requestCatch:"REQUEST_CATCH"};export default Log;

+ 1 - 0
pages_mine/pages/mp_ecard_sdk/globalConfig.js

@@ -0,0 +1 @@
+export default{normalPath:"/pages_mine/pages"};

+ 183 - 0
pages_mine/pages/mp_ecard_sdk/index.css

@@ -0,0 +1,183 @@
+.auth {
+    align-items: center;
+    display: flex;
+    flex-direction: column;
+    margin-top: 128rpx
+}
+
+.auth-logo {
+    height: 200rpx;
+    width: 200rpx
+}
+
+.auth-logo image {
+    height: 100%;
+    width: 100%
+}
+
+.title {
+    font-size: 36rpx;
+    line-height: 56rpx;
+    margin-top: 20rpx
+}
+
+.merchant-name {
+    display: inline;
+    font-weight: 700
+}
+
+.sub-title {
+    font-size: 34rpx;
+    line-height: 52rpx;
+    margin-top: 8rpx
+}
+
+.agreement {
+    color: #888;
+    display: flex;
+    font-size: 28rpx;
+    justify-content: center;
+    line-height: 40rpx;
+    margin-top: 96rpx
+}
+
+checkbox .wx-checkbox-input {
+    border-radius: 50%;
+    height: 24rpx;
+    width: 24rpx
+}
+
+checkbox .wx-checkbox-input.wx-checkbox-input-checked {
+    background: #006eff
+}
+
+checkbox .wx-checkbox-input.wx-checkbox-input-checked:before {
+    background: transparent;
+    color: #fff;
+    font-size: 22rpx;
+    height: 28rpx;
+    line-height: 28rpx;
+    text-align: center;
+    width: 28rpx
+}
+
+navigator {
+    color: #006dff;
+    display: inline
+}
+
+.button-area {
+    margin-top: 48rpx
+}
+
+button {
+    background: #fff;
+    border: 2rpx solid #ddd;
+    font-size: 32rpx;
+    font-weight: 400;
+    height: 96rpx;
+    line-height: 96rpx;
+    width: 622rpx
+}
+
+.redirect {
+    align-items: center;
+    display: flex;
+    flex-direction: column;
+    margin-top: 272rpx
+}
+
+.loading {
+    height: 160rpx;
+    margin-bottom: 32rpx;
+    width: 160rpx
+}
+
+.loading image {
+    height: 100%;
+    width: 100%
+}
+
+.title {
+    font-size: 34rpx;
+    line-height: 52rpx
+}
+
+.protocol {
+    position: relative
+}
+
+.protocol .main {
+    background: #f8f9fa;
+    color: #3c3c3c;
+    font-size: 24rpx;
+    padding: 40rpx 40rpx 140rpx
+}
+
+.protocol .main view {
+    margin: 20rpx 0
+}
+
+.protocol .main .h1 {
+    font-size: 36rpx;
+    font-weight: 700;
+    line-height: 2;
+    margin: 0 0 20rpx;
+    text-align: center
+}
+
+.protocol .main .p {
+    margin: 4rpx 0;
+    text-indent: 2em
+}
+
+.protocol .main .strong {
+    font-weight: 700
+}
+
+.protocol .main .dl {
+    margin-top: 40rpx
+}
+
+.protocol .main .dt {
+    margin-bottom: 20rpx
+}
+
+.protocol .main .h2 {
+    font-size: 28rpx;
+    font-weight: 700
+}
+
+.protocol .main .dd {
+    margin-bottom: 20rpx
+}
+
+.protocol .main .dd view {
+    padding-left: 2em
+}
+
+.protocol .pop-btn-line {
+    background: #f8f9fa;
+    bottom: 0;
+    box-sizing: border-box;
+    left: 0;
+    padding: 30rpx;
+    position: fixed;
+    width: 100%
+}
+
+.protocol .pop-btn {
+    background: transparent;
+    background-color: #2787f3;
+    border: none;
+    border-radius: 6rpx;
+    color: #00a5e0;
+    color: #fff;
+    display: block;
+    font-size: 34rpx;
+    height: 90rpx;
+    line-height: 90rpx;
+    min-width: 5.6rem;
+    outline: none;
+    text-align: center
+}

+ 1 - 0
pages_mine/pages/mp_ecard_sdk/index.js

@@ -0,0 +1 @@
+export const a="dasd";

文件差异内容过多而无法显示
+ 1 - 0
pages_mine/pages/mp_ecard_sdk/index/index.js


+ 44 - 0
pages_mine/pages/mp_ecard_sdk/index/index.vue

@@ -0,0 +1,44 @@
+<template>
+	<view v-if="showWebView">
+		<web-view :src="redirectUri" @load="handleWebViewLoad" @error="handleWebViewError"></web-view>
+	</view>
+
+	<view class="auth" v-else>
+		<view class="auth-logo">
+			<image src="https://faceid-ecard-1254418846.cos.ap-chengdu.myqcloud.com/eidLogo.png" />
+		</view>
+		<view class="title">
+			您正在授权
+			<view class="merchant-name">{{' '+ appName}}</view>
+		</view>
+		<view class="sub-title">通过腾讯云E证通核验并获取您的身份信息</view>
+		<view class="agreement">
+			<checkbox-group @change="changeAgree">
+				<checkbox :value="agreement" :checked="isAgree" />
+			</checkbox-group>
+			<view>
+				<view>
+					<view @click="changeAgree" style="display:inline">已阅读并同意</view>
+					<navigator url="/mp_ecard_sdk/protocol/service/service">《腾讯云E证通服务使用协议》</navigator>和
+				</view>
+				<view>
+					<navigator url="/mp_ecard_sdk/protocol/eid/eid">《eID数字身份小程序服务协议》</navigator>
+				</view>
+			</view>
+		</view>
+		<view class="button-area">
+			<button @click='navigateToEid' :disabled="!isAgree || isNavigating">
+				确认授权
+			</button>
+		</view>
+	</view>
+</template>
+
+<script>
+import index from "./index";
+export default index;
+</script>
+
+<style>
+@import url('../index.css');
+</style>

文件差异内容过多而无法显示
+ 25 - 0
pages_mine/pages/mp_ecard_sdk/main.js


文件差异内容过多而无法显示
+ 113 - 0
pages_mine/pages/mp_ecard_sdk/protocol/eid/eid.vue


文件差异内容过多而无法显示
+ 195 - 0
pages_mine/pages/mp_ecard_sdk/protocol/privacy/privacy.vue


文件差异内容过多而无法显示
+ 173 - 0
pages_mine/pages/mp_ecard_sdk/protocol/service/service.vue


文件差异内容过多而无法显示
+ 47 - 0
pages_mine/pages/mp_ecard_sdk/protocol/userAccredit/userAccredit.vue


+ 1 - 0
pages_mine/pages/mp_ecard_sdk/utils/getParameterByName.js

@@ -0,0 +1 @@
+const getParameterByName=function(e,t){e=e.replace(/[\[\]]/g,"\\$&");const a=new RegExp(`[?&]${e}(=([^&#]*)|&|#|$)`).exec(t);return a?a[2]?decodeURIComponent(a[2].replace(/\+/g," ")):"":null};export default getParameterByName;

文件差异内容过多而无法显示
+ 1 - 0
pages_mine/pages/mp_ecard_sdk/utils/http.js


+ 1 - 0
pages_mine/pages/mp_ecard_sdk/utils/validate.js

@@ -0,0 +1 @@
+function isValidateToken(e){return/^[a-zA-Z0-9-]{36}$/.test(e)}export default{isValidateToken:isValidateToken};

+ 0 - 1
utils/shareMixin.js

@@ -13,7 +13,6 @@ export default {
       }
     }
   },
- 
   onLaunch:function () { 
     uni.showShareMenu({
       withShareTicket: true,