This commit is contained in:
Aiden 2023-10-07 18:08:22 +08:00
parent 8615940d86
commit 9a4b91910e
19 changed files with 247 additions and 117 deletions

View File

@ -65,7 +65,9 @@
"root": "pagesFace",
"name": "pagesFace",
"pages": [
"pages/middle/middle"
"pages/index/index",
"pages/webview/webview",
"pages/middle/middle"
]
}
]

View File

@ -152,16 +152,6 @@
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path": "pagesFace/pages/middle/middle",
"style": {
"navigationBarTitleText": "人脸识别认证",
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": false //
}
}
}
],

View File

@ -93,8 +93,8 @@ import http from "@/http/api";
export default {
data() {
return {
name: "许旻轶",
num: "320504199809164033",
name: "",
num: "",
checked: [],
fileList: [],
fileList2: [],

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -16,8 +16,7 @@
"pages/mine/set-up",
"pages/consignment-painting/index",
"pages/paySuccess/paySuccess",
"pages/payError/payError",
"pagesFace/pages/middle/middle"
"pages/payError/payError"
],
"subPackages": [],
"window": {
@ -53,6 +52,8 @@
"root": "pagesFace",
"name": "pagesFace",
"pages": [
"pages/index/index",
"pages/webview/webview",
"pages/middle/middle"
]
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,43 @@
const app = getApp();
Page({
data: {
url: ''
},
inputUrl(e) {
this.setData({
url: e.detail.value,
})
},
goScanCode() {
wx.scanCode({
onlyFromCamera: true,
success: ({result = ''}) => {
if(!result) {
wx.showToast({
title: '扫码失败',
icon: 'error'
})
}
this.setData({
url: result
}, this.goUrl)
}
})
},
goUrl() {
const url = this.data.url
wx.navigateTo({
url: '/pagesFace/pages/webview/webview?url=' + encodeURIComponent(url),
})
},
clearUrl() {
this.setData({
url: '',
})
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "人脸识别认证"
}

View File

@ -0,0 +1,13 @@
<view class="container">
<view class="container box1">
<view class="title">
在当前小程序内打开实名/签署页面,刷脸跳转到公证签小程序
</view>
<input class="weui-input" maxlength="-1" placeholder="输入链接" value="{{url}}" bindinput="inputUrl"/>
<view class="btn-box">
<button class="weui-btn my-btn" type="primary" bindtap="goScanCode">扫描二维码</button>
<button class="weui-btn my-btn" type="primary" bindtap="goUrl">跳转</button>
<button class="weui-btn my-btn" bindtap="clearUrl">清空</button>
</view>
</view>
</view>

View File

@ -0,0 +1,33 @@
.container {
padding-top: 20rpx !important;
}
.box1 {
margin-bottom: 100rpx;
padding-bottom: 130rpx;
}
.title {
margin-bottom: 20px;
text-align: left;
width: 100%;
font-weight: bold;
}
.weui-input {
width: 100%;
border-bottom: 1px solid #ccc;
margin-bottom: 50rpx;
}
.btn-box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.weui-btn {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 50rpx;
}
.my-btn {
margin-top: 0 !important;
}

View File

@ -1,2 +1,81 @@
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesFace/pages/middle/middle"],{335:function(e,n,t){"use strict";(function(e,n){var r=t(4);t(26);r(t(25));var o=r(t(336));e.__webpack_require_UNI_MP_PLUGIN__=t,n(o.default)}).call(this,t(1)["default"],t(2)["createPage"])},336:function(e,n,t){"use strict";t.r(n);var r=t(337),o=t(339);for(var a in o)["default"].indexOf(a)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(a);t(341);var i,c=t(33),d=Object(c["default"])(o["default"],r["render"],r["staticRenderFns"],!1,null,"7c5cb050",null,!1,r["components"],i);d.options.__file="pagesFace/pages/middle/middle.vue",n["default"]=d.exports},337:function(e,n,t){"use strict";t.r(n);var r=t(338);t.d(n,"render",(function(){return r["render"]})),t.d(n,"staticRenderFns",(function(){return r["staticRenderFns"]})),t.d(n,"recyclableRender",(function(){return r["recyclableRender"]})),t.d(n,"components",(function(){return r["components"]}))},338:function(e,n,t){"use strict";var r;t.r(n),t.d(n,"render",(function(){return o})),t.d(n,"staticRenderFns",(function(){return i})),t.d(n,"recyclableRender",(function(){return a})),t.d(n,"components",(function(){return r}));var o=function(){var e=this,n=e.$createElement;e._self._c},a=!1,i=[];o._withStripped=!0},339:function(e,n,t){"use strict";t.r(n);var r=t(340),o=t.n(r);for(var a in r)["default"].indexOf(a)<0&&function(e){t.d(n,e,(function(){return r[e]}))}(a);n["default"]=o.a},340:function(e,n,t){"use strict";(function(e){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var t={data:function(){return{bizToken:"",miniProgramAppId:"",miniProgramPath:"",miniProgramCallBackUrl:"",goFaceDone:!1}},onLoad:function(e){var n=e.bizToken,t=void 0===n?"":n,r=e.miniProgramAppId,o=void 0===r?"":r,a=e.miniProgramPath,i=void 0===a?"":a,c=e.miniProgramCallBackUrl,d=void 0===c?"":c;this.bizToken=decodeURIComponent(t),this.miniProgramAppId=decodeURIComponent(o),this.miniProgramPath=decodeURIComponent(i),this.miniProgramCallBackUrl=decodeURIComponent(d)},onShow:function(){if(console.log("---middle onShow"),this.goFaceDone){this.goFaceDone=!1;var n=getCurrentPages(),t=n[n.length-2];t.$vm.reloadPage(this.miniProgramCallBackUrl.replace(" https://realnameverify-test.fadada.com"," https://realnameverify-test07.fadada.com")),e.navigateBack({delta:1})}}};n.default=t}).call(this,t(2)["default"])},341:function(e,n,t){"use strict";t.r(n);var r=t(342),o=t.n(r);for(var a in r)["default"].indexOf(a)<0&&function(e){t.d(n,e,(function(){return r[e]}))}(a);n["default"]=o.a},342:function(e,n,t){}},[[335,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pagesFace/pages/middle/middle.js.map
Page({
data: {
/** 刷脸token */
bizToken: "",
/** 认证小程序appId */
miniProgramAppId: "",
/** 认证小程序跳转页地址 */
miniProgramPath: "",
/** 刷脸结束回调地址 */
miniProgramCallBackUrl: "",
/** 是否已跳转认证小程序 */
goFaceDone: false,
},
/** 点击前往认证 */
onJump() {
const { bizToken, miniProgramAppId, miniProgramPath } = this.data;
wx.navigateToMiniProgram({
appId: miniProgramAppId,
path: miniProgramPath + "?bizToken=" + bizToken,
success: (res) => {
this.setData({
goFaceDone: true,
});
},
});
},
/** 生命周期函数--监听页面加载 */
onLoad: function ({
bizToken = "",
miniProgramAppId = "",
miniProgramPath = "",
miniProgramCallBackUrl = "",
}) {
console.log("---middle onLoad");
this.setData({
bizToken: decodeURIComponent(bizToken),
miniProgramAppId: decodeURIComponent(miniProgramAppId),
miniProgramPath: decodeURIComponent(miniProgramPath),
miniProgramCallBackUrl: decodeURIComponent(miniProgramCallBackUrl),
});
},
/** 生命周期函数--监听页面显示 */
onShow: function () {
console.log("---middle onShow");
const { goFaceDone, miniProgramCallBackUrl } = this.data;
/** 防止从认证进入后直接返回 */
if (!goFaceDone) return;
/** 已跳转认证小程序,重置 */
this.setData({
goFaceDone: false,
});
/** getEnterOptionsSync 基础库 2.9.4 开始支持,低版本需做兼容处理 */
const options = wx.getEnterOptionsSync();
console.log("---app onShow options", options);
/** 从认证小程序返回 */
if (
options.scene === 1038 &&
options.referrerInfo.extraData &&
options.referrerInfo.extraData.faceResult
) {
const pages = getCurrentPages();
const previous = pages[pages.length - 2];
/** 重新加载认证页面 */
previous.$vm.reloadPage(
miniProgramCallBackUrl.replace(
"https://realnameverify-test.fadada.com",
"https://realnameverify-test07.fadada.com"
)
);
wx.navigateBack({
delta: 1,
});
}
},
});

View File

@ -0,0 +1,22 @@
Page({
data: {
url: '',
},
/** 初始打开实名认证页面 */
onLoad(options) {
console.log('---wevbiew onload', options)
this.setData({
url: decodeURIComponent(options.url),
})
},
/** 刷脸完成后重新加载实名认证页面 */
reloadPage(url) {
console.log('---webview reloadPage', url)
this.setData({
url,
})
},
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "人脸识别认证"
}

View File

@ -0,0 +1 @@
<web-view src="{{url}}"></web-view>

View File

@ -0,0 +1,28 @@
{
"appid": "wx1e155fd041eda3be",
"compileType": "miniprogram",
"libVersion": "3.1.2",
"packOptions": {
"ignore": [],
"include": []
},
"setting": {
"coverView": true,
"es6": true,
"postcss": true,
"minified": true,
"enhance": true,
"showShadowRootInWxmlPanel": true,
"packNpmRelationList": [],
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 4
}
}

View File

@ -0,0 +1,7 @@
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "pages",
"setting": {
"compileHotReLoad": true
}
}