Commit 36905551 authored by Jennie Shi's avatar Jennie Shi

合并代码

parent 164b1044
......@@ -109,6 +109,5 @@
<plugin name="cordova-plugin-device" spec="2.0.2" />
<plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
<engine name="android" spec="~6.4.0" />
<plugin name="IdCardPlugin" spec="/Users/jeshi/Documents/徐工/card-plugin-test/cordova-plugin-IdCardPlugin" />
<engine name="android" spec="~6.2.0" />
</widget>
This diff is collapsed.
......@@ -13,8 +13,14 @@
"clean": "rimraf www/*"
},
"dependencies": {
"IdCardPlugin": "file:../card-plugin-test/IdCardPlugin-test",
"autosize": "^3.0.20",
"better-scroll": "^1.10.3",
"cordova-android": "^6.2.0",
"cordova-plugin-device": "2.0.2",
"cordova-plugin-splashscreen": "5.0.2",
"cordova-plugin-statusbar": "2.4.2",
"cordova-plugin-whitelist": "1.3.3",
"crypto-js": "^3.1.9-1",
"fastclick": "https://hel.hand-china.com/easyUI/fastclick.git",
"hls-easy-ui": "https://hel.hand-china.com/easyUI/hls-easy-ui.git#keyboard",
......@@ -91,7 +97,6 @@
"webpack-merge": "^4.1.0",
"yaml-loader": "^0.4.0"
},
"engines": {
"node": ">= 4.0.0",
"npm": ">= 3.0.0"
......@@ -103,6 +108,13 @@
"cordova": {
"platforms": [
"android"
]
],
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"ionic-plugin-keyboard": {}
}
}
}
\ No newline at end of file
......@@ -7,6 +7,7 @@ repositories{
dependencies {
compile(name:"qsign_facesdk_xg_dev_1.0.0",ext: 'aar')
implementation 'com.lzy.net:okgo:3.0.4'
}
android {
......
......@@ -34,9 +34,6 @@
"cordova-plugin-file-transfer": {
"PACKAGE_NAME": "com.xcmg.app.dev"
},
"cordova-plugin-hls-cloudroom": {
"PACKAGE_NAME": "com.xcmg.app.dev"
},
"cordova-plugin-hrms-faceidentify": {
"PACKAGE_NAME": "com.xcmg.app.dev"
},
......
{
"name": "cordova-plugin-hls-cloudroom",
"version": "1.0.0",
"description": "视频面签Cordova plugin定制化",
"cordova": {
"id": "cordova-plugin-hls-cloudroom",
"platforms": [
"android",
"ios"
]
},
"keywords": [
"ecosystem:cordova",
"cordova-android",
"cordova-ios"
],
"author": "Cordova中国技术交流组 群号:343034350",
"license": "Apache 2.0"
}
<?xml version='1.0' encoding='utf-8'?>
<plugin id="cordova-plugin-hls-cloudroom" version="1.0.0" xmlns="http://apache.org/cordova/ns/plugins/1.0">
<!-- metadata -->
<name>cordova-plugin-hls-cloudroom</name>
<description>视频面签Cordova plugin定制化</description>
<license>Apache 2.0</license>
<!-- javascript -->
<js-module name="CloudRoomService" src="www/hls.cordova.cloudroom.CloudRoomService.js">
<clobbers target="hls.cordova.cloudroom.CloudRoomService" />
</js-module>
<!-- android -->
<platform name="android">
<!-- config -->
<config-file target="res/xml/config.xml" parent="/*">
<feature name="CloudRoomService">
<param name="android-package" value="com.hls.cordova.cloudroom.CloudRoomService"/>
</feature>
</config-file>
<!-- source -->
<source-file src="src/android/CloudRoomService.java" target-dir="src/com/hls/cordova/cloudroom" />
</platform>
<!-- ios -->
<platform name="ios">
<!-- config -->
<config-file target="config.xml" parent="/*">
<feature name="CloudRoomService">
<param name="ios-package" value="CloudRoomService"/>
</feature>
</config-file>
<!-- source -->
<header-file src="src/ios/CloudRoomService.h" />
<source-file src="src/ios/CloudRoomService.m" />
</platform>
</plugin>
package com.hls.cordova.cloudroom;
import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
import com.app.demo.Business;
import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaPlugin;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class CloudRoomService extends CordovaPlugin {
private CallbackContext mCallbackContext;
private JSONObject obj;
private Business business;
private static final String TAG = "CloudRoomService";
// methods
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
this.mCallbackContext = callbackContext;
// Log.e(TAG, "execute: " + action + "," + webView);
String userId = "king";
JSONObject info = new JSONObject();
// if (args.length() > 0) {
// String a = args.getString(0);
// a = a.replace("\\", "");
// if (a.equals("null")) {
// obj = null;
// } else {
// obj = new JSONObject(a);
// }
// }
// 登录
if (action.equals("loginCloudRoom")) {
// if (obj.has("name")) {
// userId = obj.getString("name"); //接收js传过来的参数name password serverURL等
// }
if (business == null) {
business = new Business(webView.getContext());
}
business.doLogin(userId, callbackContext);
info.put("success", "1");
this.echo(info);
return true;
}else if (action.equals("helpYourSelf")) {
if(business == null){
Toast.makeText(webView.getContext(), "请先登录", Toast.LENGTH_SHORT).show();
}
business.helpYourSelf(callbackContext);
info.put("success", "1");
this.echo(info);
return true;
}
// default
return false;
}
private void echo(final JSONObject data) {
mCallbackContext.success(data);
}
private void echo(final String data) {
mCallbackContext.success(data);
}
}
\ No newline at end of file
#import <Foundation/Foundation.h>
#import <Cordova/CDVPlugin.h>
@interface CloudRoomService : CDVPlugin
@end
//
// CloudRoomService.h
// CloudroomDemo
//
// Created by youming on 2019/11/11.
//
#import "CloudRoomService.h"
#import "RecordHelper.h"
#import "YSProgressController.h"
#import "YouSelfController.h"
@interface CloudRoomService()<CloudroomHttpFileMgrCallBack, CloudroomVideoMgrCallBack>
/**
Cordova回调ID
*/
@property (nonatomic, copy) NSString *callbackId;
@property (nonatomic, strong) MeetInfo *meetInfo; /**< 会议信息 */
@end
@implementation CloudRoomService
#pragma mark - 登录
- (void)loginCloudRoom:(CDVInvokedUrlCommand *)command
{
[self.commandDelegate runInBackground:^{
dispatch_async(dispatch_get_main_queue(), ^{
//传递的数据参数
self.callbackId=command.callbackId;
// NSDictionary *cmdDict = (NSDictionary *)command.arguments.firstObject;
// NSLog(@"%@",cmdDict[@"msg"]);
CloudroomVideoMgr *cloudroomVideoMgr = [CloudroomVideoMgr shareInstance];
[cloudroomVideoMgr setMgrCallback:self];
RecordHelper *recordHelper = [RecordHelper shareInstance];
[recordHelper readInfo];
NSString *nickname=@"king";
if ([NSString stringCheckEmptyOrNil:nickname]) {
[HUDUtil hudShow:@"昵称不能为空!" delay:3 animated:YES];
return;
}
// 账号
NSString *account = recordHelper.account;
// 密码通过 MD5 以后(小写十六位)
NSString *pswd = recordHelper.pswd;
// 服务器地址
NSString *server = recordHelper.server;
if ([NSString stringCheckEmptyOrNil:server]) {
[HUDUtil hudShow:@"服务器地址不能为空!" delay:3 animated:YES];
return;
}
if ([NSString stringCheckEmptyOrNil:account]) {
[HUDUtil hudShow:@"账号不能为空!" delay:3 animated:YES];
return;
}
if ([NSString stringCheckEmptyOrNil:pswd]) {
[HUDUtil hudShow:@"密码不能为空!" delay:3 animated:YES];
return;
}
NSString *md5Pswd = [NSString md5:recordHelper.pswd];
RLog(@"server:%@ nickname:%@ account:%@ pswd:%@", server, nickname, account, md5Pswd);
//CloudroomVideoMgr *cloudroomVideoMgr = [CloudroomVideoMgr shareInstance];
LoginDat *loginData = [[LoginDat alloc] init];
[loginData setNickName:nickname];
[loginData setAuthAcnt:account];
[loginData setAuthPswd:md5Pswd];
[loginData setPrivAcnt:nickname];
[recordHelper writeAccount:account pswd:pswd server:server];
[recordHelper writeNickname:nickname];
// 域名转IP
/*
NSString *ip_Port;
if ([serverIP containsString:@":"]) {
NSArray <NSString *> *strs = [serverIP componentsSeparatedByString:@":"];
if ([strs count] > 1) {
NSString *hostToIP = [self _getIPFromHostName:[strs firstObject]];
ip_Port = [NSString stringWithFormat:@"%@:%@", hostToIP, strs[1]];
}
else {
ip_Port = [self _getIPFromHostName:[strs firstObject]];
}
}
else {
ip_Port = [self _getIPFromHostName:serverIP];
}
NSLog(@"IP+Port:%@", ip_Port);
*/
// 设置服务器地址
[[CloudroomVideoSDK shareInstance] setServerAddr:server];
[HUDUtil hudShowProgress:@"正在登录..." animated:YES];
// 开始上传日志
// [[CloudroomVideoSDK shareInstance] startLogReport:nickname server:@"logserver.cloudroom.com:12005"];
//
// [[CloudroomVideoSDK shareInstance] writeLog:SDK_LOG_LEVEL_INFO message:@"登录操作"];
// 发送"登录"命令
NSString *cookie = [NSString stringWithFormat:@"%f",CFAbsoluteTimeGetCurrent()];
[cloudroomVideoMgr login:loginData cookie:cookie];
});
}];
}
#pragma mark - 选择自助
- (void)helpYourSelf:(CDVInvokedUrlCommand *)command
{
[self.commandDelegate runInBackground:^{
dispatch_async(dispatch_get_main_queue(), ^{
self.callbackId=command.callbackId;
CloudroomHttpFileMgr *cloudroomHttpFileMgr = [CloudroomHttpFileMgr shareInstance];
[cloudroomHttpFileMgr setHttpFileMgrCallback:self];
CloudroomVideoMgr *cloudroomVideoMgr = [CloudroomVideoMgr shareInstance];
[cloudroomVideoMgr setMgrCallback:self];
RecordHelper *recordHelper = [RecordHelper shareInstance];
NSString *subject = [NSString stringWithFormat:@"%@的会议", [recordHelper nickname]];
NSString *cookie = [NSString stringWithFormat:@"%f", CFAbsoluteTimeGetCurrent()];
[[CloudroomVideoMgr shareInstance] createMeeting:subject createPswd:NO cookie:cookie];
// UIStoryboard *customer = [UIStoryboard storyboardWithName:@"Record" bundle:nil];
// YSProgressController *ysProgressVC = [customer instantiateViewControllerWithIdentifier:@"YSProgressController"];
// //[ysProgressVC setQueID:_queID];
// //[ysProgressVC setQueName:_queName];
// [ysProgressVC setQueID:780];
// [ysProgressVC setQueName:@"1"];
// ysProgressVC.modalPresentationStyle=UIModalPresentationFullScreen;
// if (ysProgressVC) {
// [self.viewController presentViewController:ysProgressVC animated:YES completion:nil];
// }
});
}];
}
//#pragma mark - 开始录制
//- (void)startRecord:(CDVInvokedUrlCommand *)command
//{
// [self.commandDelegate runInBackground:^{
// weakify(self)
// NSParameterAssert(self.meetInfo);
// dispatch_async(dispatch_get_main_queue(), ^{
// strongify(self)
// UIStoryboard *record = [UIStoryboard storyboardWithName:@"Record" bundle:nil];
// YouSelfController *yourselfVC = [record instantiateViewControllerWithIdentifier:@"YouSelfController"];
// [yourselfVC setMeetInfo:sSelf.meetInfo];
// yourselfVC.modalPresentationStyle=UIModalPresentationFullScreen;
// if (yourselfVC) {
// [self.viewController presentViewController:yourselfVC animated:YES completion:nil];
// }
// });
//
// }];
//
//}
#pragma mark - CloudroomVideoMgrCallBack---登录代理方法
- (void)loginSuccess:(NSString *)usrID cookie:(NSString *)cookie
{
[HUDUtil hudHiddenProgress:YES];
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:nil];
[self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
}
- (void)loginFail:(CRVIDEOSDK_ERR_DEF)sdkErr cookie:(NSString *)cookie
{
[HUDUtil hudHiddenProgress:YES];
NSString *errorMsg=@"登录失败提示信息!";
// FIXME:概率性登录卡死不回调 added by king 20161216
if (sdkErr == CRVIDEOSDK_NOSERVER_RSP) {
errorMsg=@"服务器无响应!";
}
else if (sdkErr == CRVIDEOSDK_LOGINSTATE_ERROR) {
errorMsg= @"登陆状态不对!" ;
[[CloudroomVideoMgr shareInstance] logout];
}
else if (sdkErr == CRVIDEOSDK_ANCTPSWD_ERR) {
errorMsg= @"帐号密码不正确!" ;
}
else {
errorMsg= @"登录失败!";
}
[HUDUtil hudShow:errorMsg delay:3 animated:YES];
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:nil];
[self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
}
#pragma mark - CloudroomVideoMgrCallBack
- (void)createMeetingSuccess:(MeetInfo *)meetInfo cookie:(NSString *)cookie
{
weakify(self)
self.meetInfo = meetInfo;
// NSParameterAssert(self.meetInfo);
dispatch_async(dispatch_get_main_queue(), ^{
strongify(self)
UIStoryboard *record = [UIStoryboard storyboardWithName:@"Record" bundle:nil];
YouSelfController *yourselfVC = [record instantiateViewControllerWithIdentifier:@"YouSelfController"];
[yourselfVC setMeetInfo:sSelf.meetInfo];
yourselfVC.modalPresentationStyle=UIModalPresentationFullScreen;
if (yourselfVC) {
[self.viewController presentViewController:yourselfVC animated:YES completion:^{
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:nil];
[self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];}];
}
});
}
- (void)createMeetingFail:(CRVIDEOSDK_ERR_DEF)sdkErr cookie:(NSString *)cookie
{
[HUDUtil hudShow:@"创建会议失败" delay:3 animated:YES];
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:nil];
[self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
}
// 掉线/被踢通知
- (void)lineOff:(CRVIDEOSDK_ERR_DEF)sdkErr
{
if (sdkErr == CRVIDEOSDK_USER_BEEN_KICKOUT) { // 被踢
[HUDUtil hudShow:@"您已被踢下线!" delay:3 animated:YES];
}
else { // 掉线
[HUDUtil hudShow:@"您已掉线!" delay:3 animated:YES];
}
}
- (void)dealloc
{
[[CloudroomHttpFileMgr shareInstance] stopMgr];
[[CloudroomVideoMeeting shareInstance] exitMeeting];
}
@end
cordova.define("cordova-plugin-hls-cloudroom.CloudRoomService", function(require, exports, module) {
var exec = require('cordova/exec');
function CloudRoomService(){};
CloudRoomService.prototype.loginCloudRoom=function(data,successCallback,errorCallback){
exec(successCallback,errorCallback,'CloudRoomService', 'loginCloudRoom', [data]);
}
CloudRoomService.prototype.helpYourSelf=function(data,successCallback,errorCallback){
exec(successCallback,errorCallback,'CloudRoomService', 'helpYourSelf', [data])
}
var cloudRoomPlugin=new CloudRoomService();
module.exports=cloudRoomPlugin;
});
......@@ -200,14 +200,6 @@
"is_top_level": true,
"variables": {}
},
"cordova-plugin-hls-cloudroom": {
"source": {
"type": "local",
"path": "/Volumes/work/APP/xugon/cordova-plugin-hls-cloudroom"
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-ionic-webview": {
"source": {
"type": "local",
......@@ -226,7 +218,8 @@
},
"IdCardPlugin": {
"source": {
"type": "local"
"type": "local",
"path": "/Users/jeshi/Documents/徐工/hls-xcmg-vue-app/node_modules/IdCardPlugin"
},
"is_top_level": true,
"variables": {}
......
......@@ -7,9 +7,6 @@
"files": {}
},
"installed_plugins": {
"IdCardPlugin": {
"PACKAGE_NAME": "$(PRODUCT_BUNDLE_IDENTIFIER)"
}
},
"dependent_plugins": {}
}
\ No newline at end of file
......@@ -10,10 +10,10 @@
</div>
<div class="down-content">
<span>请上传照片</span>
<div class="photo" v-if="!isReadOnly" @click="ocrShow()">
<div v-if="!isReadOnly" class="photo" @click="ocrShow()">
<img v-if="vehicleImg" :src="vehicleImg" alt="">
</div>
<div class="photo" v-if="isReadOnly">
<div v-if="isReadOnly" class="photo">
<img :src="vehicleImg" @click="showBigPicture(vehicleImg)">
</div>
<list-item :item-height="44">
......@@ -605,7 +605,7 @@ export default {
})
},
methods: {
delete_release (project_lease_item_id,index) {
delete_release (project_lease_item_id, index) {
hlsPopup.showConfirm({
title: '提示',
content: '您确认删除吗?',
......@@ -635,7 +635,7 @@ export default {
width: '100%',
})
},
resetRent() {
resetRent () {
this.rentInfo = {
project_lease_item_id: '',
project_id: window.localStorage.project_id,
......@@ -664,7 +664,7 @@ export default {
}
})
},
saveRent() {
saveRent () {
let url = process.env.basePath + 'prj_leases_info_save'
if (this.rentInfo.frame_number == '') {
hlsPopup.showLongCenter('车架号不能为空!')
......@@ -689,7 +689,7 @@ export default {
certificate_number: this.rentInfo.certificate_number,
p_departure_date: this.rentInfo.p_departure_date,
p_invoice_date: this.rentInfo.p_invoice_date,
}
},
}
this.$post(url, param).then((res) => {
this.hlsPopup.hideLoading()
......@@ -699,7 +699,7 @@ export default {
this.rentInfo.project_lease_item_id = res.master.project_lease_item_id
let ifPush = true
this.leaseList.forEach(item => {
if(item.project_lease_item_id == res.master.project_lease_item_id) {
if (item.project_lease_item_id == res.master.project_lease_item_id) {
ifPush = false
}
})
......@@ -773,13 +773,13 @@ export default {
// 合格证识别
vehicleIdentify (fileUrl) {
let vm = this
hlsPopup.showLoading('正在识别')
hlsPopup.showLoading('正在识别...')
let url
if (this.factory_ocr_type == 'NORMAL') {
if (this.factory_ocr_type === 'NORMAL') {
url = process.env.ocrPath + '/baidu/ocr/vehicle_certificate'
} else if (this.factory_ocr_type == 'CHANYUN') {
} else if (this.factory_ocr_type === 'CHANYUN') {
url = process.env.ocrPath + '/baidu/ocr/chanyun'
} else if (this.factory_ocr_type == 'DAOLU') {
} else if (this.factory_ocr_type === 'DAOLU') {
url = process.env.ocrPath + '/baidu/ocr/daolu'
}
hlsUtil.baiduOcr(fileUrl, url, function (res) {
......@@ -918,7 +918,7 @@ export default {
project_id: window.localStorage.project_id,
}
hlsPopup.showLoading('请稍候')
this.$post(url, param).then( (res) => {
this.$post(url, param).then((res) => {
this.hlsPopup.hideLoading()
if (res.result === 'S') {
this.leaseList = res.lists
......
......@@ -164,6 +164,11 @@ export default {
}
},
async access () {
// cordova.plugins.IdCardPlugin.idCardIdentify({'idNum': '341181199602016223', 'idName': '史蒙蒙', 'timeout': 10000}, function (success) {
// alert(success)
// }, function (reason) {
// alert('Failed: ' + reason)
// })
document.getElementById('passwordInput').blur()
document.getElementById('userInput').blur()
document.activeElement.blur()
......@@ -266,16 +271,6 @@ export default {
},
})
},
signLogin () {
let vm = this
var sendStr = 'xcmg'
hls.cordova.cloudroom.CloudRoomService.loginCloudRoom(sendStr, function (data) {
vm.entrySign()
}, function (fail) {
vm.hlsPopup.showLongCenter('视频面签登录失败')
})
},
entrySign () {
let vm = this
let sendStr = {
......
......@@ -32,7 +32,6 @@
<li>徐工租赁<br>微信公众号</li>
</ul>
</div>
<div @click="testPlugin()">点我试用插件</div>
</div>
</h-content>
</h-view>
......@@ -46,12 +45,7 @@ export default {
}
},
methods: {
testPlugin() {
cordova.plugins.IdCardPlugin.idCardIdentify({"idNum":"341181199602016223","idName":"史蒙蒙","timeout":10000}, function (success) {alert(success);
}, function (reason) {
alert("Failed: " + reason);
});
}
}
}
</script>
......
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,width=device-width,viewport-fit=cover"><meta name=format-detection content="telephone=no"><meta name=format-detection content="email=no"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=black><script type=text/javascript src=./static/vuePlatform.js></script><script type=text/javascript src=./static/prototype.js></script><script type=text/javascript src=./cordova.js></script><script type=text/javascript src="http://api.map.baidu.com/api?v=2.0&ak=Eoo0EtfjYCdAy7r8D19gZ0vMojdZpHqU"></script><title>徐工金服</title><link href=./static/css/app.b94a0be4bc4b7fa04af6ee487618863e.css rel=stylesheet></head><body><div id=app-box></div><script type=text/javascript src=./static/js/manifest.6a178e8d77c32e3c385d.js></script><script type=text/javascript src=./static/js/vendor.d56dec0015f4cf7e8b3b.js></script><script type=text/javascript src=./static/js/app.ce2fd7bbeb5cb3c291e5.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,width=device-width,viewport-fit=cover"><meta name=format-detection content="telephone=no"><meta name=format-detection content="email=no"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=black><script type=text/javascript src=./static/vuePlatform.js></script><script type=text/javascript src=./static/prototype.js></script><script type=text/javascript src=./cordova.js></script><script type=text/javascript src="http://api.map.baidu.com/api?v=2.0&ak=Eoo0EtfjYCdAy7r8D19gZ0vMojdZpHqU"></script><title>徐工金服</title><link href=./static/css/app.21cb7156819074159aa9d1a495e4c824.css rel=stylesheet></head><body><div id=app-box></div><script type=text/javascript src=./static/js/manifest.6a178e8d77c32e3c385d.js></script><script type=text/javascript src=./static/js/vendor.0a4e11017ea45af58444.js></script><script type=text/javascript src=./static/js/app.d68c1669329a2605172e.js></script></body></html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment