加入员工微信认证功能

This commit is contained in:
java110 2020-12-11 00:32:38 +08:00
parent 9ef5b191b9
commit 53f738768a
5 changed files with 215 additions and 4 deletions

8
app.js
View File

@ -36,11 +36,11 @@ let opts = {
//app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts));
//app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts));
//app.use('/app',proxy('http://api.demo.winqi.cn:8012',opts));
app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts));
app.use('/app',proxy('http://api.demo.winqi.cn:8012',opts));
app.use('/callComponent',proxy('http://127.0.0.1:8012',opts));
app.use('/app',proxy('http://127.0.0.1:8012',opts));
//app.use('/callComponent',proxy('http://127.0.0.1:8012',opts));
//app.use('/app',proxy('http://127.0.0.1:8012',opts));
//app.use('/callComponent',proxy('http://192.168.1.16:8012',opts));
//app.use('/app',proxy('http://192.168.1.16:8012',opts));

View File

@ -0,0 +1,42 @@
<div id="addStaffAppAuthModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-body">
<h3 class="m-t-none m-b ">开始认证</h3>
<div class="ibox-content">
<div>
<div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">认证方式</label>
<div class="col-sm-10">
<select class="custom-select" v-model="addStaffAppAuthInfo.appType"
@change="_changeAppType">
<option selected disabled value="">必填,请选择认证方式</option>
<option value="WECHAT">微信</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">二维码</label>
<div class="col-sm-4">
<div id="qrcode" style="width:200px; height:200px; "></div>
</div>
<div class="col-sm-6">
<span>请用微信扫一扫二维码认证</span>
</div>
</div>
<div class="ibox-content">
<button class="btn btn-primary float-right" type="button"
v-on:click="_finishScanQrCode()"><i class="fa fa-check"></i>&nbsp;扫码完成</button>
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
data-dismiss="modal">取消</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,63 @@
(function (vc) {
vc.extends({
propTypes: {
callBackListener: vc.propTypes.string, //父组件名称
callBackFunction: vc.propTypes.string //父组件监听方法
},
data: {
addStaffAppAuthInfo: {
auId: '',
appType: 'WECHAT',
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on('addStaffAppAuth', 'openAddStaffAppAuthModal', function () {
$('#addStaffAppAuthModel').modal('show');
$that._changeAppType()
});
},
methods: {
_changeAppType: function () {
//判断是否支付
var param = {
params: {
communityId: vc.getCurrentCommunity().communityId,
appType: $that.addStaffAppAuthInfo.appType
}
};
//发送get请求
vc.http.apiGet('/staff/generatorQrCode',
param,
function (json, res) {
let _info = JSON.parse(json);
$that._viewQr(_info.data)
}, function (errInfo, error) {
console.log('请求失败处理');
}
);
},
_viewQr: function (_url) {
document.getElementById("qrcode").innerHTML = "";
let qrcode = new QRCode(document.getElementById("qrcode"), {
text: "员工认证", //你想要填写的文本
width: 200, //生成的二维码的宽度
height: 200, //生成的二维码的高度
colorDark: "#000000", // 生成的二维码的深色部分
colorLight: "#ffffff", //生成二维码的浅色部分
correctLevel: QRCode.CorrectLevel.H
});
qrcode.makeCode(_url);
},
_finishScanQrCode: function () {
vc.emit('staffAppAuthManage', 'listStaffAppAuth', {});
$('#addStaffAppAuthModel').modal('hide');
}
}
});
})(window.vc);

View File

@ -0,0 +1,52 @@
<div>
<div class="row">
<div class="col-lg-12">
<div class="ibox">
<div class="ibox-title">
<h5>认证信息</h5>
<div class="ibox-tools" style="top:10px;">
</div>
</div>
<div class="ibox-content">
<table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
<thead>
<tr>
<th class="text-center">员工名称</th>
<th class="text-center">认证方式</th>
<th class="text-center">认证ID</th>
<th class="text-center">认证状态</th>
<th class="text-center">认证时间</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-center">{{staffAppAuthManageInfo.staffName}}</td>
<td class="text-center">{{staffAppAuthManageInfo.appType}}</td>
<td class="text-center">{{staffAppAuthManageInfo.openId}}</td>
<td class="text-center">{{staffAppAuthManageInfo.stateName}}</td>
<td class="text-center">{{staffAppAuthManageInfo.createTime}}</td>
<td class="text-center">
<div class="btn-group">
<button class="btn-white btn btn-xs"
v-on:click="_openAddStaffAppAuthModal()">认证</button>
</div>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="7">
<ul class="pagination float-right"></ul>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<vc:create path="property/addStaffAppAuth" callBackListener="" callBackFunction=""></vc:create>
</div>

View File

@ -0,0 +1,54 @@
/**
入驻小区
**/
(function (vc) {
var DEFAULT_PAGE = 1;
var DEFAULT_ROWS = 10;
vc.extends({
data: {
staffAppAuthManageInfo: {
staffName: '',
appType: '',
stateName: '',
auId: '',
openId: '',
}
},
_initMethod: function () {
vc.component._listStaffAppAuths(DEFAULT_PAGE, DEFAULT_ROWS);
},
_initEvent: function () {
vc.on('staffAppAuthManage', 'listStaffAppAuth', function (_param) {
vc.component._listStaffAppAuths(DEFAULT_PAGE, DEFAULT_ROWS);
});
},
methods: {
_listStaffAppAuths: function (_page, _rows) {
var param = {
params: {
page: 1,
row: 1
}
};
//发送get请求
vc.http.apiGet('/staff/queryStaffAppAuth',
param,
function (json, res) {
let _staffAppAuthManageInfo = JSON.parse(json);
vc.copyObject(_staffAppAuthManageInfo.data, $that.staffAppAuthManageInfo);
}, function (errInfo, error) {
console.log('请求失败处理');
}
);
},
_openAddStaffAppAuthModal: function () {
vc.emit('addStaffAppAuth', 'openAddStaffAppAuthModal', {});
},
_queryStaffAppAuthMethod: function () {
vc.component._listStaffAppAuths(DEFAULT_PAGE, DEFAULT_ROWS);
}
}
});
})(window.vc);