Commit a66e0558 authored by chaiwei's avatar chaiwei

提交代码

parent 8f7c0374
Pipeline #5762 canceled with stages
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
## Build Setup ## Build Setup
``` bash ``` bash
# install dependencies # install dependencies 安装项目依赖
yarn install yarn install
# serve with hot reload at localhost:8080 # serve with hot reload at localhost:8080 运行项目命令
yarn run dev yarn run dev
# build for production with minification # build for production with minification 打包命令
yarn run build yarn run build
# build for production and view the bundle analyzer report # build for production and view the bundle analyzer report
......
...@@ -15,27 +15,27 @@ const spinner = ora('building for production...') ...@@ -15,27 +15,27 @@ const spinner = ora('building for production...')
spinner.start() spinner.start()
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, function (err, stats) {
spinner.stop()
if (err) throw err if (err) throw err
process.stdout.write(stats.toString({ webpack(webpackConfig, function(err, stats) {
colors: true, spinner.stop()
modules: false, if (err) throw err
children: false, process.stdout.write(stats.toString({
chunks: false, colors: true,
chunkModules: false modules: false,
}) + '\n\n') children: false,
chunks: false,
chunkModules: false
}) + '\n\n')
if (stats.hasErrors()) { if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n')) console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1) process.exit(1)
} }
console.log(chalk.cyan(' Build complete.\n')) console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow( console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' + ' Tip: built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n' ' Opening index.html over file:// won\'t work.\n'
)) ))
}) })
}) })
\ No newline at end of file
...@@ -3,26 +3,28 @@ const merge = require('webpack-merge') ...@@ -3,26 +3,28 @@ const merge = require('webpack-merge')
const prodEnv = require('./prod.env') const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, { module.exports = merge(prodEnv, {
NODE_ENV: '"development"', NODE_ENV: '"development"',
CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV), CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV),
debug: true, debug: true,
isMobilePlatform: false, isMobilePlatform: false,
appCode:'"HLS_APP"', appCode: '"HLS_APP"',
clearTable: true, clearTable: true,
//domainUrl:"http://123.125.154.135:10004/core/", //domainUrl:"http://123.125.154.135:10004/core/",
//loginPath: "http://123.125.154.135:10004/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password=", //loginPath: "http://123.125.154.135:10004/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password=",
//rootPath: "http://123.125.154.135:10004/core/r/api", //rootPath: "http://123.125.154.135:10004/core/r/api",
// basePath: "http://123.125.154.135:10004/core/r/api?sysName=dr_uat&apiName=", // basePath: "http://123.125.154.135:10004/core/r/api?sysName=dr_uat&apiName=",
//file_view:"http://123.125.154.135:10004/core/r/api/app/fileViewSvc?sysName=dr_dev&apiName=attment_view&attachment_id=", //file_view:"http://123.125.154.135:10004/core/r/api/app/fileViewSvc?sysName=dr_dev&apiName=attment_view&attachment_id=",
//filePath: "http://123.125.154.135:10004/core/r/api?sysName=dr_uat&apiName=file_view&", //filePath: "http://123.125.154.135:10004/core/r/api?sysName=dr_uat&apiName=file_view&",
loginPath: '"http://hlsapp.hand-china.com/core/oauth/token?client_id=hQGCtxTItRa34PUOgxaD0r7oSPeuEaIB&client_secret=7ee8338c-4a06-44a1-87cc-afa63f8e1bc3&grant_type=password&username=app&password=" ', loginPath: '"http://hlsapp.hand-china.com/core/oauth/token?client_id=hQGCtxTItRa34PUOgxaD0r7oSPeuEaIB&client_secret=7ee8338c-4a06-44a1-87cc-afa63f8e1bc3&grant_type=password&username=app&password=" ',
loginPathRl: '"http://101.133.225.167:8096/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password="', loginPathRl: '"http://sign.hitachics.com/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password="',
basePath: '"http://hlsapp.hand-china.com/core/r/api?sysName=HLS_APP&apiName="', basePath: '"http://sign.hitachics.com/core/r/api?sysName=HCL_UPLOAD_FILE&apiName="',
rootPath: '"http://hlsapp.hand-china.com/core/r/api"', basePathRl: '"http://sign.hitachics.com/core/r/api?sysName=wxgzh_hitachics&apiName="',
file_url: '"http://hlsapp.hand-china.com/file/"', rootPath: '"http://sign.hitachics.com/core/r/api"',
appId: '"com.hls.easy.car"', file_url: '"http://sign.hitachics.com/file/"',
currentVersion: '"1.0.0"', domainUrl: "http://sign.hitachics.com",
wxCode:"'hlsWx'", appId: '"com.hls.easy.car"',
uploadSysName:"'HLS_APP'", currentVersion: '"1.0.0"',
uploadApiName:"'attachment_upload'" wxCode: "'hlsWx'",
}); uploadSysName: "'HLS_APP'",
uploadApiName: "'attachment_upload'"
});
\ No newline at end of file
'use strict' 'use strict'
module.exports = { module.exports = {
NODE_ENV: '"production"', NODE_ENV: '"production"',
CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV), CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV),
debug: false, debug: false,
isMobilePlatform: false, isMobilePlatform: false,
appCode:'"HLS_APP"', appCode: '"HLS_APP"',
clearTable: true, clearTable: true,
loginPath: '"http://hlsapp.hand-china.com/core/oauth/token?client_id=hQGCtxTItRa34PUOgxaD0r7oSPeuEaIB&client_secret=7ee8338c-4a06-44a1-87cc-afa63f8e1bc3&grant_type=password&username=app&password=" ', loginPath: '"http://sign.hitachics.com/core/oauth/token?client_id=hQGCtxTItRa34PUOgxaD0r7oSPeuEaIB&client_secret=7ee8338c-4a06-44a1-87cc-afa63f8e1bc3&grant_type=password&username=app&password=" ',
loginPathRl: '"http://101.133.225.167:8096/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password="', loginPathRl: '"http://sign.hitachics.com/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password="',
basePath: '"http://hlsapp.hand-china.com/core/r/api?sysName=HLS_APP&apiName="', basePath: '"http://sign.hitachics.com/core/r/api?sysName=HCL_UPLOAD_FILE&apiName="',
rootPath: '"http://hlsapp.hand-china.com/core/r/api"', basePathRl: '"http://sign.hitachics.com/core/r/api?sysName=wxgzh_hitachics&apiName="',
file_url: '"http://hlsapp.hand-china.com/file/"', rootPath: '"http://sign.hitachics.com/core/r/api"',
appId: '"com.hls.easy.car"', file_url: '"http://sign.hitachics.com/file/"',
currentVersion: '"1.0.0"', appId: '"com.hls.easy.car"',
wxCode:"'hlsWx'", currentVersion: '"1.0.0"',
uploadSysName:"'HLS_APP'", wxCode: "'hlsWx'",
uploadApiName:"'attachment_upload'" uploadSysName: "'HLS_APP'",
} uploadApiName: "'attachment_upload'"
}
\ No newline at end of file
'use strict' 'use strict'
module.exports = { module.exports = {
NODE_ENV: '"production"', NODE_ENV: '"production"',
CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV), CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV),
debug: true, debug: true,
isMobilePlatform: false, isMobilePlatform: false,
appCode:'"HLS_APP"', appCode: '"HLS_APP"',
clearTable: true, clearTable: true,
loginPath: '"http://hlsapp.hand-china.com/core/oauth/token?client_id=hQGCtxTItRa34PUOgxaD0r7oSPeuEaIB&client_secret=7ee8338c-4a06-44a1-87cc-afa63f8e1bc3&grant_type=password&username=app&password=" ', loginPath: '"http://sign.hitachics.com/core/oauth/token?client_id=hQGCtxTItRa34PUOgxaD0r7oSPeuEaIB&client_secret=7ee8338c-4a06-44a1-87cc-afa63f8e1bc3&grant_type=password&username=app&password=" ',
loginPathRl: '"http://101.133.225.167:8096/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password="', loginPathRl: '"http://sign.hitachics.com/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password="',
basePath: '"http://hlsapp.hand-china.com/core/r/api?sysName=HLS_APP&apiName="', basePath: '"http://sign.hitachics.com/core/r/api?sysName=HCL_UPLOAD_FILE&apiName="',
rootPath: '"http://hlsapp.hand-china.com/core/r/api"', basePathRl: '"http://sign.hitachics.com/core/r/api?sysName=wxgzh_hitachics&apiName="',
file_url: '"http://hlsapp.hand-china.com/file/"', rootPath: '"http://sign.hitachics.com/core/r/api"',
appId: '"com.hls.easy.car"', file_url: '"http://sign.hitachics.com/file/"',
currentVersion: '"1.0.0"', appId: '"com.hls.easy.car"',
wxCode:"'hlsWx'", currentVersion: '"1.0.0"',
uploadSysName:"'HLS_APP'", wxCode: "'hlsWx'",
uploadApiName:"'attachment_upload'" uploadSysName: "'HLS_APP'",
} uploadApiName: "'attachment_upload'"
}
\ No newline at end of file
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" <meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, width=device-width, viewport-fit=cover">
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="telephone=no"> <meta name="format-detection" content="email=no">
<meta name="format-detection" content="email=no"> <!-- safari私有meta标签 允许全屏模式浏览 指定safari顶部状态栏样式(黑色) -->
<!-- safari私有meta标签 允许全屏模式浏览 指定safari顶部状态栏样式(黑色) --> <meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-status-bar-style" content="black"> <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script> <!-- <script type="text/javascript" src="../../cordova.js"></script>-->
<!-- <script type="text/javascript" src="../../cordova.js"></script>--> <script src="./static/signature-pad-min.js"></script>
<script src="./static/signature-pad-min.js"></script> <!-- <script src="./static/jquery-2-1-1.js"></script>-->
<!-- <script src="./static/jquery-2-1-1.js"></script>--> <script src="./static/jquery-touch-punch-min.js"></script>
<script src="./static/jquery-touch-punch-min.js"></script> <script src="https://gw.alipayobjects.com/os/antv/assets/f2/3.3.5/f2-all.min.js"></script>
<script src="https://gw.alipayobjects.com/os/antv/assets/f2/3.3.5/f2-all.min.js"></script> <script src="https://gw.alipayobjects.com/os/antv/assets/lib/lodash-4.17.4.min.js"></script>
<script src="https://gw.alipayobjects.com/os/antv/assets/lib/lodash-4.17.4.min.js"></script> <script src="https://gw.alipayobjects.com/os/antv/assets/lib/jquery-3.2.1.min.js"></script>
<script src="https://gw.alipayobjects.com/os/antv/assets/lib/jquery-3.2.1.min.js"></script> <script src="https://gw.alipayobjects.com/os/rmsportal/NjNldKHIVQRozfbAOJUW.js"></script>
<script src="https://gw.alipayobjects.com/os/rmsportal/NjNldKHIVQRozfbAOJUW.js"></script> <title></title>
<title>车租易</title>
</head> </head>
<body> <body>
<div id="app-box"></div> <div id="app-box"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
</html>
</html>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div id="app"> <div id="app">
<transition :name="transitionName"> <transition :name="transitionName">
<keep-alive> <keep-alive>
<router-view v-if="$route.meta.keepAlive"/> <router-view v-if="$route.meta.keepAlive" />
</keep-alive> </keep-alive>
</transition> </transition>
<transition :name="transitionName"> <transition :name="transitionName">
......
...@@ -7,7 +7,7 @@ import router from './router/index' ...@@ -7,7 +7,7 @@ import router from './router/index'
import flexible from './common/ydui.flexible' import flexible from './common/ydui.flexible'
import components from './components/component' import components from './components/component'
import {componentInstall, appStyle} from 'hls-easy-ui' import { componentInstall, appStyle } from 'hls-easy-ui'
/** /**
* 指令 * 指令
*/ */
...@@ -16,11 +16,16 @@ import directives from './scripts/directives' ...@@ -16,11 +16,16 @@ import directives from './scripts/directives'
import filter from './scripts/filter' import filter from './scripts/filter'
import { import {
Picker, Picker,
} from 'vux' } from 'vux'
import './scripts/prototype' import './scripts/prototype'
import './scripts/vuePlatform' import './scripts/vuePlatform'
import {
Toast
} from 'vux'
Vue.component('toast', Toast)
/** /**
...@@ -31,21 +36,23 @@ import hlsPopup from './scripts/hlsPopup' ...@@ -31,21 +36,23 @@ import hlsPopup from './scripts/hlsPopup'
/** /**
* http * http
*/ */
import {post, get} from './scripts/hlsHttp' import { post, get } from './scripts/hlsHttp'
/** 全局函数hlsUtil**/ /** 全局函数hlsUtil**/
import hlsUtil from './scripts/hlsUtil' import hlsUtil from './scripts/hlsUtil'
if (process.env.CONFIG_ENV === 'uat') { // if (process.env.CONFIG_ENV === 'uat') {
const VConsole = require('vconsole') const VConsole = require('vconsole')
new VConsole() // eslint-disable-line new VConsole() // eslint-disable-line
} // }
Vue.use(directives) Vue.use(directives)
Vue.use(filter) Vue.use(filter)
//
import axios from 'axios'
Vue.prototype.$api = axios;
/** /**
* 组件 * 组件
*/ */
...@@ -62,8 +69,8 @@ Vue.prototype.$devicePixelRatio = 2 ...@@ -62,8 +69,8 @@ Vue.prototype.$devicePixelRatio = 2
Vue.prototype.$post = post Vue.prototype.$post = post
Vue.prototype.$get = get Vue.prototype.$get = get
let hlsHttp = { let hlsHttp = {
get: get, get: get,
post: post, post: post,
} }
Vue.prototype.hlsHttp = window.hlsHttp = hlsHttp Vue.prototype.hlsHttp = window.hlsHttp = hlsHttp
...@@ -75,11 +82,11 @@ Vue.prototype.hlsUtil = window.hlsUtil = hlsUtil ...@@ -75,11 +82,11 @@ Vue.prototype.hlsUtil = window.hlsUtil = hlsUtil
* 全局返回上一页面 * 全局返回上一页面
* @param index * @param index
*/ */
let routeGo = function (index) { let routeGo = function(index) {
if (!index) { if (!index) {
index = -1 index = -1
} }
this.$router.go(index) this.$router.go(index)
} }
Vue.prototype.$routeGo = routeGo Vue.prototype.$routeGo = routeGo
...@@ -87,24 +94,24 @@ Vue.prototype.$routeGo = routeGo ...@@ -87,24 +94,24 @@ Vue.prototype.$routeGo = routeGo
Vue.config.productionTip = false Vue.config.productionTip = false
vum.$vumPlatform.ready(function () { vum.$vumPlatform.ready(function() {
}) })
/* eslint-disable no-new */ /* eslint-disable no-new */
new Vue({ new Vue({
data () { data() {
return { return {
pathList: [], pathList: [],
transitionName: null, transitionName: null,
} }
}, },
router, router,
watch: { // 监听路由变化 watch: { // 监听路由变化
$route (to, from) { $route(to, from) {
document.body.scrollTop = 0 document.body.scrollTop = 0
document.documentElement.scrollTop = 0 document.documentElement.scrollTop = 0
},
}, },
}, render: h => h(App),
render: h => h(App), }).$mount('#app-box')
}).$mount('#app-box') \ No newline at end of file
<template>
<h-view class="public-style contract-sign-list" title="电子签约">
<h-content style="padding-top:20px">
<div style="margin-left:20px">
合同总计数&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:red;font-weight:bold">{{count}}</span>
</div>
<div class="search">
<div class="searchInput">
<input v-model="searchCondition.input" placeholder="请输入承租人名称" />
<button
@click="detectSearchCondition()"
style="position:absolute;right:10px"
>搜索</button>
</div>
</div>
<scroll ref="scroll">
<list-item :item-height="80">
<div :key="index" :proportion="[5,1]" :show-arrow="true">
<!-- <div class="con-num">合同编号: <span style="font-weight: 600">201821023721847</span></div> -->
<item
style="margin-top:10px"
v-for="(item,index) in signData"
:key="index"
@click.native="goContractList(item)"
>
<img
slot="left-icon"
src="../../../assets/electronicContract/contract-icon.png"
class="left-icon"
/>
<div slot="name" class="text" style="font-size: 12px;">
<div
class="cont-type"
style="color: #5a5959;font-size: 14px;font-weight:bold"
>承租人:{{item.customername}}</div>
<div
class="cont-type"
style="color: #5a5959;font-size: 14px"
>经销商:{{item.dealername}}</div>
<div
class="cont-type"
style="color: #5a5959;font-size: 14px"
>产品名称:{{item.modelname}}</div>
<div class="cont-type" style="color: #5a5959;font-size: 14px">机号:{{item.serialno}}</div>
<div
class="cont-type"
style="color: #5a5959;font-size: 14px"
>租金总额:{{item.contractamt}}</div>
<div
class="cont-type"
style="color: #5a5959;font-size: 14px"
>租赁开始日:{{item.leasebgndt}}</div>
<div class="cont-type" style="color: #5a5959;font-size: 14px">合同状态:完成盖章</div>
</div>
<!-- <div class="" style="width: 30%;font-size: 12px;"> -->
<!-- <button
style="width:60px;line-height:30px;border:1px solid #eee;margin-top:10px;border-radius:8px;height: 30px;background-color:#999999"
>下载</button>-->
<!-- </div> -->
<img
slot="right-icon"
src="../../../assets/image/right-arrow@2x.png"
class="right-icon"
/>
</item>
</div>
</list-item>
</scroll>
</h-content>
</h-view>
</template>
<script>
import { getUrlParam } from "@/scripts/utils";
export default {
data() {
return {
con_list: [],
infoShow: {},
info: null,
signData: null,
searchCondition: {
input: null
},
userInfo:null,
count:""
};
},
created() {
this.wxConfig();
this.offsize = 1;
this.pagesize = 10;
this.index = [1, 0, 0];
if (window.localStorage.openId) {
this.getUserInfo(window.localStorage.openId);
}
},
mounted() {
// this._initLoad()
},
methods: {
switchTab: function(index) {
console.log(index);
let vm = this;
vm.index = [0, 0];
vm.index[index] = 1;
vm.changeData();
},
changeData: function() {
let vm = this;
// vm.infoShow = vm.info[vm.getTabName()][0]
},
getUserInfo(openId) {
let vm = this;
let url =
process.env.rootPath +
"/sign/info/hclc/query/by/openid?openId=" +
openId;
vm.hlsPopup.showLoading("请稍等");
// vm.getData();
vm.$post(url).then(function(res) {
vm.hlsPopup.hideLoading();
if (res.rows.length > 0) {
console.log(res.rows);
var results = res.rows[0];
vm.userInfo = results;
vm.getData();
}
});
},
getData() {
let vm = this;
let url = process.env.basePath + "unSignContractQuery";
let params = {
// name: "北京骏马机械有限公司",
name: vm.userInfo.name,
ctino: vm.userInfo.idNo
// ctino: ""
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, params).then(function(res) {
vm.hlsPopup.hideLoading();
if (res.success == true) {
var dataInfo = JSON.parse(res.result.json);
vm.signData = dataInfo.sign_con_list;
vm.count = dataInfo.sign_con_list.length;
console.log("skskkskssk", dataInfo.un_sign_con_list);
}
});
},
// 调用微信接口的基础配置
wxConfig() {
let clientUrl = "";
let u = navigator.userAgent;
let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; //g
let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
//这个是安卓操作系统
console.log("机型:android");
clientUrl = location.href;
}
if (isIOS) {
//这个是ios操作系统
console.log("机型:ios");
clientUrl = location.href.split("#")[0];
}
// let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
let url = process.env.basePathRl + "getSignature";
let param = {
apiKey: "handexinxi",
url: clientUrl
};
hlsHttp.post(url, param).then(function(res) {
wx.config({
beta: true,
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.result.appId, // 必填,公众号的唯一标识
timestamp: res.result.timestamp, // 必填,生成签名的时间戳
nonceStr: res.result.nonceStr, // 必填,生成签名的随机串
signature: res.result.signature, // 必填,签名,见附录1
jsApiList: [
"chooseImage",
"previewImage",
"downloadImage",
"getLocalImgData",
"uploadImage",
"hideOptionMenu"
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.ready(function() {
wx.hideOptionMenu();
});
});
},
// 去下载页
goContractList(list) {
this.$router.push({
name: "ContractDownloadList",
params: {
itemData: list
}
});
},
detectSearchCondition() {
let vm = this;
let url = process.env.basePath + "unSignContractQuery";
let params = {
// name: "北京骏马机械有限公司",
name: vm.userInfo.name,
ctino: vm.userInfo.idNo,
tenant_name: vm.searchCondition.input
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, params).then(function(res) {
vm.hlsPopup.hideLoading();
if (res.success == true) {
var dataInfo = JSON.parse(res.result.json);
vm.unSignData = dataInfo.un_sign_con_list;
vm.signData = dataInfo.sign_con_list;
vm.count = dataInfo.sign_con_list.length;
console.log("搜索后的数据", JSON.parse(res.result.json));
}
});
}
}
};
</script>
<style lang="less" rel="stylesheet">
.contract-sign-list {
.content {
overflow: hidden;
}
.hls-switch-tab .tab-content .h-tab-item .h-item {
width: 100%;
border: 1px solid #cccccc;
color: black;
border-radius: 10px;
}
.hls-switch-tab .tab-content .h-tab-item.activated .h-item {
color: white;
background-color: #b2b2b2;
border-radius: 10px;
}
.con-num {
width: 90%;
margin-left: 5%;
font-size: 15px;
color: #424242;
margin-top: 15px;
margin-bottom: 12px;
}
.hls-switch-tab .tab-content .h-tab-item {
width: 50%;
height: 0.7rem;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center;
position: relative;
}
.hls-switch-tab .tab-content .h-tab-item.activated .h-item {
background-color: #b2b2b2;
color: white;
height: 0.7rem;
border-radius: 5px;
}
.hls-switch-tab .tab-content .h-tab-item .h-item {
color: black;
height: 0.7rem;
border-radius: 5px;
border: 1px solid #cccccc;
}
.hls-switch-tab .tab-content .h-tab-item.activated .h-item .bottom-border {
border-bottom: none;
}
.hls-switch-tab {
position: relative;
}
.content {
background-color: white;
}
.hls-switch-tab {
margin-top: 10px;
}
.search {
display: flex;
//height: 50px;
background-color: #fff;
margin-top: 10px;
// margin-bottom: 10px;
position: relative;
.searchInput {
margin-left: 5%;
display: -webkit-flex;
border: 1px solid #cccccc;
/* margin: 0.14rem 0.2rem; */
width: 80%;
height: 0.56rem;
border-radius: 20px;
display: -webkit-box;
display: flex;
-webkit-box-align: center;
align-items: center;
-webkit-align-items: center;
input {
text-align: center;
width: 90%;
margin-left: 5%;
font-size: 13px;
height: 17px;
line-height: 17px;
border: none;
margin-top: 3px;
margin-bottom: 4px;
//padding-left: 11px;
}
}
}
.vue-better-scroll {
// top: 226px;
}
.vue-better-scroll__wrapper {
margin-top: 10px;
}
.hls-list-item {
margin-bottom: 0;
padding-bottom: 10px;
}
.hls-item {
padding: 0;
border-radius: 20px;
box-shadow: 0px 4px 0px 0px #cac9c9;
&:nth-child(odd) {
background-color: #f1f1f1;
}
&:nth-child(even) {
background-color: #f1f1f1;
}
.add-name {
flex: 9 1 0% !important;
}
.contents {
width: 98%;
margin-left: 1%;
}
.contents .add-name {
.left-icon {
width: 40px;
margin-right: 0;
}
.right-icon {
margin-left: 20%;
}
.text {
margin-left: 15px;
.cont {
margin-top: 5px;
font-size: 13px;
line-height: 18px;
&:first-child {
margin-top: 0;
}
}
.cont-num {
margin-top: 8px;
font-size: 15px;
line-height: 21px;
color: #5d98f6;
}
}
}
}
}
</style>
<template>
<h-view class="public-style electronic-contract-list" title="合同文本清单">
<h-content>
<div style="margin-top:20px">
<div class="contract-list-item" v-for="(item,index) in data " :key="index">
<img src="../../../assets/electronicContract/contract-list.png" alt />
<div class="contract-list-text">
<div>合同下载</div>
<p style="margin-top:3px">{{item.file_sign_name}}</p>
</div>
<button
style="float:right;margin-top:5px;background-color:#09bb07;color:#ffffff;width:50px;border-radius:3px"
@click="downloadContract(item.attachment_id)"
>下载</button>
</div>
</div>
<!-- <div class="footer" @click="createSign()">签约</div> -->
</h-content>
</h-view>
</template>
<script>
export default {
data() {
return {
isModalVisible: false,
con_list: [],
infoShow: {},
info: null,
searchCondition: {
input: null
},
data: []
};
},
components: {},
created() {
this.wxConfig();
if (this.$route.params.itemData) {
window.localStorage.SignDownloadData = JSON.stringify(
this.$route.params.itemData.sign_file_list
);
}
// console.log(JSON.parse(window.localStorage.unSignData));
this.data = JSON.parse(window.localStorage.SignDownloadData);
console.log("22222222222", this.data);
this.offsize = 1;
this.pagesize = 10;
this.index = [1, 0, 0];
},
mounted() {
// this._initLoad()
},
methods: {
// createSign() {
// let url = "http://sign.hitachics.com/core/r/api/app/fileViewSvc?attachment_id=13435&apiName=download&sysName=HCL_UPLOAD_FILE&access_token="+window.localStorage.access_token_rl
// // this.hlsPopup.showLoading("请稍等");
// window.open(url, "_self");
// },
// 合同下载
downloadContract(id) {
if (id) {
let url =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
id +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
// let url = "http://sign.hitachics.com/core/r/api/app/fileViewSvc?attachment_id=13435&apiName=download&sysName=HCL_UPLOAD_FILE&access_token="+window.localStorage.access_token_rl
window.open(url);
}else{
this.$vux.toast.text("合同id不存在,无法下载!", "middle");
}
},
// 调用微信接口的基础配置
wxConfig() {
let clientUrl = "";
let u = navigator.userAgent;
let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; //g
let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
//这个是安卓操作系统
console.log("机型:android");
clientUrl = location.href;
}
if (isIOS) {
//这个是ios操作系统
console.log("机型:ios");
clientUrl = location.href.split("#")[0];
}
// let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
let url = process.env.basePathRl + "getSignature";
let param = {
apiKey: "handexinxi",
url: clientUrl
};
hlsHttp.post(url, param).then(function(res) {
wx.config({
beta: true,
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.result.appId, // 必填,公众号的唯一标识
timestamp: res.result.timestamp, // 必填,生成签名的时间戳
nonceStr: res.result.nonceStr, // 必填,生成签名的随机串
signature: res.result.signature, // 必填,签名,见附录1
jsApiList: [
"chooseImage",
"previewImage",
"downloadImage",
"getLocalImgData",
"uploadImage",
"hideOptionMenu"
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.ready(function() {
wx.hideOptionMenu();
});
});
}
}
};
</script>
<style lang="less" rel="stylesheet">
.electronic-contract-list {
.content {
// overflow: hidden;
font-size: 14px;
.contract-list-item {
height: 60px;
margin: 10px 20px;
border: 1px solid #b2b2b2;
padding: 14px 10px 0 10px;
img {
}
.contract-list-text {
display: inline-block;
margin-left: 30px;
}
}
.footer {
width: 120px;
line-height: 30px;
background-color: #09bb07;
text-align: center;
color: #ffffff;
border-radius: 5px;
margin: 50px auto;
}
}
}
</style>
<template>
<h-view class="public-style contract-sign-list" title="电子签约">
<h-content class>
<s-tab @tabClick="switchTab">
<tab-item>待签约</tab-item>
<tab-item>已签约</tab-item>
</s-tab>
<div class="search">
<div class="searchInput">
<input v-model="searchCondition.input" placeholder="请输入承租人名称" />
<button
@click="detectSearchCondition()"
style="position:absolute;right:10px"
>搜索</button>
</div>
</div>
<scroll ref="scroll" :pullUp="true">
<!-- @pullingUp="loadMore" -->
<!-- 未签约 -->
<list-item :item-height="80" v-if="myIndex == 0">
<!-- <div :key="index" :proportion="[5,1]" :show-arrow="true"> -->
<!-- <div class="con-num">合同编号: <span style="font-weight: 600">201821023721847</span></div> -->
<item
@click.native="goContractList(item)"
style="margin-top:10px"
v-for="(item,index) in unSignData"
:key="index"
>
<img
slot="left-icon"
src="../../../assets/electronicContract/contract-icon.png"
class="left-icon"
/>
<div slot="name" class="text" style="width: 70%;font-size: 12px;">
<div
class="cont-type"
style="color: #5a5959;font-size: 14px"
>承租人:{{item.customername}}</div>
<div class="cont-type" style="color: #5a5959;font-size: 14px">经销商:{{item.dealername}}</div>
<div class="cont-type" style="color: #5a5959;font-size: 14px">产品名称:{{item.modelname}}</div>
<div class="cont-type" style="color: #5a5959;font-size: 14px">机号:{{item.serialno}}</div>
<div
class="cont-type"
style="color: #5a5959;font-size: 14px"
>租金总额:{{item.contractamt}}</div>
<div
class="cont-type"
style="color: #5a5959;font-size: 14px"
>租赁开始日:{{item.leasebgndt}}</div>
</div>
<img
slot="right-icon"
src="../../../assets/image/right-arrow@2x.png"
class="right-icon"
/>
</item>
<!-- </div> -->
</list-item>
<!-- 已签约 -->
<list-item :item-height="80" v-if="myIndex == 1">
<!-- <div :key="index" :proportion="[5,1]" :show-arrow="true"> -->
<item style="margin-top:10px" v-for="(item,index) in signData" :key="index">
<img
slot="left-icon"
src="../../../assets/electronicContract/contract-icon.png"
class="left-icon"
/>
<div slot="name" class="text" style="width: 70%;font-size: 12px;">
<div
class="cont-type"
style="color: #5a5959;font-size: 14px"
>承租人:{{item.customername}}</div>
<div class="cont-type" style="color: #5a5959;font-size: 14px">经销商:{{item.dealername}}</div>
<div class="cont-type" style="color: #5a5959;font-size: 14px">产品名称:{{item.modelname}}</div>
<div class="cont-type" style="color: #5a5959;font-size: 14px">机号:{{item.serialno}}</div>
<div
class="cont-type"
style="color: #5a5959;font-size: 14px"
>租金总额:{{item.contractamt}}</div>
<div
class="cont-type"
style="color: #5a5959;font-size: 14px"
>租赁开始日:{{item.leasebgndt}}</div>
</div>
<img
slot="right-icon"
src="../../../assets/image/right-arrow@2x.png"
class="right-icon"
/>
</item>
<!-- </div> -->
</list-item>
</scroll>
</h-content>
</h-view>
</template>
<script>
import { getUrlParam } from "@/scripts/utils";
export default {
data() {
return {
userInfo: [], //用户信息
// con_list: [],
// infoShow: {},
// info: null,
searchCondition: {
input: null
},
unSignData: null,
signData: null,
myIndex: 0
};
},
created() {
this.wxConfig();
// code = "111";
// console.log('sjsjsjsjsjsjsjsj',code);
if (window.localStorage.openId) {
this.getUserInfo(window.localStorage.openId);
}
this.offsize = 1;
this.pagesize = 10;
this.index = [1, 0, 0];
},
mounted() {
// this.getData();
},
methods: {
getUserInfo(openId) {
let vm = this;
let url =
process.env.rootPath +
"/sign/info/hclc/query/by/openid?openId=" +
openId;
vm.hlsPopup.showLoading("请稍等");
// vm.getData();
vm.$post(url).then(function(res) {
vm.hlsPopup.hideLoading();
if (res.rows.length > 0) {
// console.log('22222222',res.rows);
var results = res.rows[0];
vm.userInfo = results;
vm.getData();
}
});
},
getData() {
let vm = this;
let url = process.env.basePath + "unSignContractQuery";
let params = {
// name: "北京骏马机械有限公司",
name: vm.userInfo.name,
ctino: vm.userInfo.idNo
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, params).then(function(res) {
vm.hlsPopup.hideLoading();
if (res.success == true) {
var dataInfo = JSON.parse(res.result.json);
vm.unSignData = dataInfo.un_sign_con_list;
vm.signData = dataInfo.sign_con_list;
console.log("skskkskssk", dataInfo.un_sign_con_list);
}
});
},
detectSearchCondition() {
let vm = this;
let url = process.env.basePath + "unSignContractQuery";
let params = {
// name: "北京骏马机械有限公司",
name: vm.userInfo.name,
ctino: vm.userInfo.idNo,
tenant_name: vm.searchCondition.input
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, params).then(function(res) {
vm.hlsPopup.hideLoading();
if (res.success == true) {
var dataInfo = JSON.parse(res.result.json);
vm.unSignData = dataInfo.un_sign_con_list;
vm.signData = dataInfo.sign_con_list;
console.log('搜索后的数据',JSON.parse(res.result.json))
}
});
},
switchTab: function(index) {
let vm = this;
vm.myIndex = index;
// vm.index = [0, 0];
// vm.index[index] = 1;
console.log(vm.index);
vm.getData();
},
// 跳转详情页
goContractList(list) {
// console.log('slslslslsl',list)
this.$router.push({
name: "ElectronicContractList",
params: {
itemData: list
}
});
},
// 调用微信接口的基础配置
wxConfig() {
let clientUrl = "";
let u = navigator.userAgent;
let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; //g
let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
//这个是安卓操作系统
console.log("机型:android");
clientUrl = location.href;
}
if (isIOS) {
//这个是ios操作系统
console.log("机型:ios");
clientUrl = location.href.split("#")[0];
}
// let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
let url = process.env.basePathRl + "getSignature";
let param = {
apiKey: "handexinxi",
url: clientUrl
};
hlsHttp.post(url, param).then(function(res) {
wx.config({
beta: true,
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.result.appId, // 必填,公众号的唯一标识
timestamp: res.result.timestamp, // 必填,生成签名的时间戳
nonceStr: res.result.nonceStr, // 必填,生成签名的随机串
signature: res.result.signature, // 必填,签名,见附录1
jsApiList: [
"chooseImage",
"previewImage",
"downloadImage",
"getLocalImgData",
"uploadImage",
"hideOptionMenu"
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.ready(function() {
wx.hideOptionMenu();
});
});
}
},
activated() {
// this.getData();
}
};
</script>
<style lang="less" rel="stylesheet">
.contract-sign-list {
.content {
overflow: hidden;
}
.hls-switch-tab .tab-content .h-tab-item .h-item {
width: 100%;
border: 1px solid #cccccc;
color: black;
border-radius: 10px;
}
.hls-switch-tab .tab-content .h-tab-item.activated .h-item {
color: white;
background-color: #b2b2b2;
border-radius: 10px;
}
.hls-switch-tab .tab-content {
width: 90%;
margin-left: 5%;
}
.con-num {
width: 90%;
margin-left: 5%;
font-size: 15px;
color: #424242;
margin-top: 15px;
margin-bottom: 12px;
}
.hls-switch-tab .tab-content .h-tab-item {
width: 50%;
height: 0.7rem;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center;
position: relative;
}
.hls-switch-tab .tab-content .h-tab-item.activated .h-item {
background-color: #b2b2b2;
color: white;
height: 0.7rem;
border-radius: 5px;
}
.hls-switch-tab .tab-content .h-tab-item .h-item {
color: black;
height: 0.7rem;
border-radius: 5px;
border: 1px solid #cccccc;
}
.hls-switch-tab .tab-content .h-tab-item.activated .h-item .bottom-border {
border-bottom: none;
}
.hls-switch-tab {
position: relative;
}
.content {
background-color: white;
}
.hls-switch-tab {
margin-top: 10px;
}
.search {
display: flex;
//height: 50px;
background-color: #fff;
margin-top: 10px;
// margin-bottom: 10px;
position: relative;
.searchInput {
margin-left: 5%;
display: -webkit-flex;
border: 1px solid #cccccc;
/* margin: 0.14rem 0.2rem; */
width: 80%;
height: 0.56rem;
border-radius: 20px;
display: -webkit-box;
display: flex;
-webkit-box-align: center;
align-items: center;
-webkit-align-items: center;
input {
text-align: center;
width: 90%;
margin-left: 5%;
font-size: 13px;
height: 17px;
line-height: 17px;
border: none;
margin-top: 3px;
margin-bottom: 4px;
//padding-left: 11px;
}
}
}
.vue-better-scroll {
// top: 226px;
}
.vue-better-scroll__wrapper {
margin-top: 10px;
}
.hls-list-item {
margin-bottom: 0;
padding-bottom: 10px;
}
.hls-item {
padding: 0;
border-radius: 20px;
box-shadow: 0px 4px 0px 0px #cac9c9;
&:nth-child(odd) {
background-color: #f1f1f1;
}
&:nth-child(even) {
background-color: #f1f1f1;
}
.add-name {
flex: 9 1 0% !important;
}
.contents {
width: 98%;
margin-left: 1%;
}
.contents .add-name {
.left-icon {
width: 40px;
margin-right: 0;
}
.right-icon {
margin-left: 20%;
}
.text {
margin-left: 15px;
.cont {
margin-top: 5px;
font-size: 13px;
line-height: 18px;
&:first-child {
margin-top: 0;
}
}
.cont-num {
margin-top: 8px;
font-size: 15px;
line-height: 21px;
color: #5d98f6;
}
}
}
}
}
</style>
<template>
<h-view class="public-style electronic-contract-list" title="合同文本清单">
<h-content>
<div style="margin-top:20px">
<div class="contract-list-item" v-for="(item,index) in data" :key="index">
<img src="../../../assets/electronicContract/contract-list.png" alt />
<div class="contract-list-text">
<div>{{item.file_sign_name}}</div>
<p style="color:red;margin-top:3px"></p>
</div>
</div>
</div>
<div class="footer" @click="createSign()">签约</div>
</h-content>
</h-view>
</template>
<script>
export default {
data() {
return {
isModalVisible: false,
con_list: [],
infoShow: {},
info: null,
searchCondition: {
input: null
},
data: []
};
},
components: {},
created() {
this.wxConfig();
if(this.$route.params.itemData){
window.localStorage.unSignData = JSON.stringify(this.$route.params.itemData.un_sign_file_list);
}
// console.log(JSON.parse(window.localStorage.unSignData));
this.data = JSON.parse(window.localStorage.unSignData);
console.log("22222222222", this.data);
this.offsize = 1;
this.pagesize = 10;
this.index = [1, 0, 0];
},
mounted() {
// this._initLoad()
},
methods: {
createSign() {
let goUrl = this.data[0].sign_url
if (goUrl) {
//
this.hlsPopup.showLoading("请稍等");
window.open(goUrl, "_self");
// let url = window.open('http://www.baidu.com','_self');
// if(url == null){
// }
}
else{
this.$vux.toast.text('跳转链接不存在!', "middle");
}
// 打开模态框
},
load_count: function() {
let vm = this;
let url = process.env.basePath + "contract_count";
let param = {};
// hlsPopup.showLoadingWithoutBackdrop();
vm.$post(url, param).then(function(res) {
vm.info = res;
vm.changeData();
});
},
loadMore: function() {
let vm = this;
vm.offsize = vm.offsize + 1;
let url = process.env.basePath + "app_get_contract_selected";
let param = {
offsize: vm.offsize,
searchInput: vm.searchCondition.input
};
vm.$post(url, param).then(function(res) {
let returnData = [];
returnData = res.getContract_list;
if (returnData.length === 0) {
vm.$refs.scroll.update(true);
} else if (returnData.length > 0 && returnData.length < vm.pagesize) {
vum.forEach(returnData, function(data, index, array) {
vm.con_list.push(array[index]);
});
vm.$refs.scroll.update(true);
} else if (returnData.length === vm.pagesize) {
vum.forEach(returnData, function(data, index, array) {
vm.con_list.push(array[index]);
});
vm.$refs.scroll.update(false);
}
});
},
// goContractMainten: function (list) {
// this.$router.push({
// name: 'ContractSign',
// params: {
// contract_id: list.contract_id,
// cdd_list_id: list.cdd_list_id,
// },
// })
// },
// 调用微信接口的基础配置
wxConfig() {
let clientUrl = "";
let u = navigator.userAgent;
let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; //g
let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
//这个是安卓操作系统
console.log("机型:android");
clientUrl = location.href;
}
if (isIOS) {
//这个是ios操作系统
console.log("机型:ios");
clientUrl = location.href.split("#")[0];
}
// let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
let url = process.env.basePathRl + "getSignature";
let param = {
apiKey: "handexinxi",
url: clientUrl
};
hlsHttp.post(url, param).then(function(res) {
wx.config({
beta: true,
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.result.appId, // 必填,公众号的唯一标识
timestamp: res.result.timestamp, // 必填,生成签名的时间戳
nonceStr: res.result.nonceStr, // 必填,生成签名的随机串
signature: res.result.signature, // 必填,签名,见附录1
jsApiList: [
"chooseImage",
"previewImage",
"downloadImage",
"getLocalImgData",
"uploadImage",
"hideOptionMenu"
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.ready(function() {
wx.hideOptionMenu();
});
});
}
}
};
</script>
<style lang="less" rel="stylesheet">
.electronic-contract-list {
.content {
// overflow: hidden;
font-size: 14px;
.contract-list-item {
height: 60px;
margin: 10px 20px;
border: 1px solid #b2b2b2;
padding: 14px 10px 0 10px;
img {
}
.contract-list-text {
display: inline-block;
margin-left: 30px;
}
}
.footer {
width: 120px;
line-height: 30px;
background-color: #09bb07;
text-align: center;
color: #ffffff;
border-radius: 5px;
margin: 50px auto;
}
}
}
</style>
<template>
<h-view class="public-style companyRegister" title="企业用户注册">
<h-content v-if="status != '成功'">
<list-item class="reg-content">
<div class="repre-type" v-if="faceAuthStatus != 'SUCCESS'">
<input type="radio" name="agent" v-model="agentType" @change="isAgent" value="Y" />
代理店
<input
style="margin-left:32px"
type="radio"
name="agent"
v-model="agentType"
@change="isAgent"
value="N"
/>非代理店
</div>
<div class="repre-type" v-if="faceAuthStatus == 'SUCCESS'">
代理店
<input type="radio" name="agent" v-model="agentType" @change="isAgent" value="Y" disabled/>
非代理店
<input
type="radio"
name="agent"
v-model="agentType"
@change="isAgent"
value="N"
disabled
/>
</div>
<div class="repre-type" v-if="faceAuthStatus != 'SUCCESS' && agentType == 'Y'">
<span>经办人类型:</span>
<input
type="radio"
name="peopleType"
v-model="staffType"
@change="getRadioVal"
value="组织其他员工"
/>组织其他员工
<input
type="radio"
name="peopleType"
v-model="staffType"
@change="getRadioVal"
value="法定代表人"
/>法定代表人
</div>
<div class="repre-type" v-if="faceAuthStatus == 'SUCCESS' && agentType == 'Y'">
<span>经办人类型:</span>
<input
type="radio"
name="peopleType"
v-model="staffType"
@change="getRadioVal"
value="组织其他员工"
disabled
/>组织其他员工
<input
type="radio"
name="peopleType"
v-model="staffType"
@change="getRadioVal"
value="法定代表人"
disabled
/>法定代表人
</div>
<!-- 法定代表人 -->
<div v-if="staffType == '法定代表人'">
<div class="info_list" v-if="orgAuthStatus =='SUCCESS'">
<div class="list_left" style="width:39%;">
<img
src="../../../assets/userRegister/company.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
组织机构名称:
</div>
<div class="list_right" style="width:61%;">
<input type="text" class="edit" v-model="organizationName" @blur="goTop()" />
</div>
</div>
<div class="info_list" v-if="orgAuthStatus !='SUCCESS'">
<div class="list_left" style="width:39%;">
<img
src="../../../assets/userRegister/company.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
组织机构名称:
</div>
<div class="list_right" style="width:61%;">
<input type="text" class="edit" v-model="organizationName" readonly />
</div>
</div>
<div class="info_list" v-if="orgAuthStatus =='SUCCESS'">
<div class="list_left" style="width:48%;">
<img
src="../../../assets/userRegister/idCard.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
统一社会信用代码:
</div>
<div class="list_right" style="width:52%;">
<input type="text" class="edit" v-model="socialCode" @blur="goTop()" />
</div>
</div>
<div class="info_list" v-if="orgAuthStatus !='SUCCESS'">
<div class="list_left" style="width:48%;">
<img
src="../../../assets/userRegister/idCard.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
统一社会信用代码:
</div>
<div class="list_right" style="width:52%;">
<input type="text" class="edit" v-model="socialCode" readonly />
</div>
</div>
<div class="info_list" style="border-bottom:none;">
<div class="list_left2">请上传营业执照照片</div>
</div>
<div class="bus-license">
<img :src="busLic" alt class="pic" @click="uploadBusLic()" />
</div>
<div class="info_list" v-if="faceAuthStatus =='SUCCESS'">
<div class="list_left" style="width:43%;">
<img
src="../../../assets/userRegister/people.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
法定代表人姓名:
</div>
<div class="list_right" style="width:57%;">
<input type="text" class="edit" v-model="legalRepresentativeName" @blur="goTop()" />
</div>
</div>
<div class="info_list" v-if="faceAuthStatus !='SUCCESS'">
<div class="list_left" style="width:43%;">
<img
src="../../../assets/userRegister/people.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
法定代表人姓名:
</div>
<div class="list_right" style="width:57%;">
<input type="text" class="edit" v-model="legalRepresentativeName" readonly />
</div>
</div>
<div class="info_list" v-if="faceAuthStatus =='SUCCESS'">
<div class="list_left" style="width:54%;">
<img
src="../../../assets/userRegister/idCard.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
法定代表人身份证号码:
</div>
<div class="list_right" style="width:46%;">
<input
type="text"
class="edit"
v-model="legalRepresentativeCardNumber"
@blur="goTop()"
/>
</div>
</div>
<div class="info_list" v-if="faceAuthStatus !='SUCCESS'">
<div class="list_left" style="width:54%;">
<img
src="../../../assets/userRegister/idCard.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
法定代表人身份证号码:
</div>
<div class="list_right" style="width:46%;">
<input type="text" class="edit" v-model="legalRepresentativeCardNumber" readonly />
</div>
</div>
<div class="info_list">
<div class="list_left" style="width:30%;">
<img
src="../../../assets/userRegister/phone.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
手机号码:
</div>
<div class="list_right" style="width:70%;">
<input
type="text"
class="edit"
v-model="legalPhoneNumber"
placeholder="请输入手机号码"
@blur="goTop()"
/>
</div>
</div>
<div style="margin: 10px 0 0 14px;color:#636363">
<p>请上传身份证照片</p>
</div>
<div style="height:100px;margin-top:30px">
<div
style="border:1px solid #b2b2b2;width:140px;height:100px;margin:0 auto;border-radius:5px;position:relative;"
>
<img :src="cardUp" alt class="pic" @click="uploadUpImg()" />
</div>
</div>
<!-- <div style="height:100px;margin-top:30px" v-if="faceAuthStatus =='SUCCESS'">
<div
style="border:1px solid #b2b2b2;width:140px;height:100px;margin:0 auto;border-radius:5px;position:relative;"
>
<img :src="cardUp" alt class="pic" @click="previewImage(authAttachmentId)" />
</div>
</div>-->
<p style="margin-top:10px;text-align:center;color:#636363">正面</p>
<button
style="width: 120px;height: 30px;border-radius: 15px;
background-color:#09bb07;color: #ffffff;
cursor: pointer;
margin: 100px 0 0 -60px;
position: relative;
left: 50%;"
@click="next_step()"
>下一步</button>
</div>
<!-- 组织其他员工 -->
<div v-if="staffType ==='组织其他员工'">
<div class="info_list" v-if="faceAuthStatus =='SUCCESS'">
<div class="list_left" style="width:39%;">
<img
src="../../../assets/userRegister/people.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
经办人姓名:
</div>
<div class="list_right" style="width:61%;">
<input type="text" class="edit" v-model="jbName" @blur="goTop()" />
</div>
</div>
<div class="info_list" v-if="faceAuthStatus !='SUCCESS'">
<div class="list_left" style="width:39%;">
<img
src="../../../assets/userRegister/people.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
经办人姓名:
</div>
<div class="list_right" style="width:61%;">
<input type="text" class="edit" v-model="jbName" readonly />
</div>
</div>
<div class="info_list">
<div class="list_left" style="width:30%;">
<img
src="../../../assets/userRegister/phone.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
手机号码:
</div>
<div class="list_right" style="width:70%;">
<input
type="text"
class="edit"
v-model="jbPhoneNumber"
@blur="goTop()"
placeholder="请输入手机号码"
/>
</div>
</div>
<div class="info_list" v-if="faceAuthStatus =='SUCCESS'">
<div class="list_left" style="width:41%;">
<img
src="../../../assets/userRegister/idCard.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
经办人身份证号:
</div>
<div class="list_right" style="width:59%;">
<input type="text" class="edit" v-model="jbIdNumber" @blur="goTop()" />
</div>
</div>
<div class="info_list" v-if="faceAuthStatus !='SUCCESS'">
<div class="list_left" style="width:41%;">
<img
src="../../../assets/userRegister/idCard.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
经办人身份证号:
</div>
<div class="list_right" style="width:59%;">
<input type="text" class="edit" v-model="jbIdNumber" readonly />
</div>
</div>
<div style="margin: 10px 0 0 14px;color:#636363">
<p>请上传身份证照片</p>
</div>
<div style="height:100px;margin-top:30px">
<div
style="border:1px solid #b2b2b2;width:140px;height:100px;margin:0 auto;border-radius:5px;position:relative;"
>
<img :src="cardUp1" alt class="pic" @click="uploadUpImg1()" />
</div>
</div>
<!-- <div style="height:100px;margin-top:30px" v-if="faceAuthStatus =='SUCCESS'">
<div
style="border:1px solid #b2b2b2;width:140px;height:100px;margin:0 auto;border-radius:5px;position:relative;"
>
<img :src="cardUp1" alt class="pic" @click="previewImage(authAttachmentId)" />
</div>
</div>-->
<p style="margin-top:10px;text-align:center;color:#636363">正面</p>
<div class="info_list" v-if="orgAuthStatus =='SUCCESS'">
<div class="list_left" style="width:39%;">
<img
src="../../../assets/userRegister/company.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
组织机构名称:
</div>
<div class="list_right" style="width:61%;">
<input type="text" class="edit" v-model="organizationName1" @blur="goTop()" />
</div>
</div>
<div class="info_list" v-if="orgAuthStatus !='SUCCESS'">
<div class="list_left" style="width:39%;">
<img
src="../../../assets/userRegister/company.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
组织机构名称:
</div>
<div class="list_right" style="width:61%;">
<input type="text" class="edit" v-model="organizationName1" readonly />
</div>
</div>
<div class="info_list" v-if="orgAuthStatus =='SUCCESS'">
<div class="list_left" style="width:48%;">
<img
src="../../../assets/userRegister/idCard.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
统一社会信用代码:
</div>
<div class="list_right" style="width:52%;">
<input type="text" class="edit" v-model="socialCode1" @blur="goTop()" />
</div>
</div>
<div class="info_list" v-if="orgAuthStatus !='SUCCESS'">
<div class="list_left" style="width:48%;">
<img
src="../../../assets/userRegister/idCard.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
统一社会信用代码:
</div>
<div class="list_right" style="width:52%;">
<input type="text" class="edit" v-model="socialCode1" readonly />
</div>
</div>
<div class="info_list" style="border-bottom:none;">
<div class="list_left2">请上传营业执照照片</div>
</div>
<div class="bus-license">
<img :src="busLic1" alt class="pic" @click="uploadBusLic1()" />
</div>
<div class="info_list">
<div class="list_left" style="width:43%;">
<img
src="../../../assets/userRegister/people.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
法定代表人姓名:
</div>
<div class="list_right" style="width:57%;">
<input
type="text"
class="edit"
v-model="legalRepresentativeName1"
@blur="goTop()"
placeholder="请输入姓名"
/>
</div>
</div>
<div class="info_list">
<div class="list_left" style="width:54%;">
<img
src="../../../assets/userRegister/idCard.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
法定代表人身份证号码:
</div>
<div class="list_right" style="width:46%;">
<input
type="text"
class="edit"
v-model="legalRepresentativeCardNumber1"
@blur="goTop()"
placeholder="请输入身份证号码"
/>
</div>
</div>
<button class="next-step" @click="next_step_oth()">下一步</button>
</div>
</list-item>
</h-content>
<h-content v-if="status == '成功'">
<list-item class="reg-content">
<div class="repre-type">
<input
type="radio"
name="agent"
v-model="agentType"
@change="isAgent"
value="Y"
disabled
/>代理店
<input
style="margin-left:36px"
type="radio"
name="agent"
v-model="agentType"
@change="isAgent"
value="N"
disabled
/>非代理店
</div>
<div class="repre-type" v-if="agentType == 'Y'">
<span>经办人类型:</span>
<input
type="radio"
name="peopleType"
v-model="staffType"
@change="getRadioVal"
value="组织其他员工"
disabled
/>组织其他员工
<input
type="radio"
name="peopleType"
v-model="staffType"
@change="getRadioVal"
value="法定代表人"
disabled
/>法定代表人
</div>
<!-- 法定代表人 -->
<div v-if="staffType == '法定代表人'">
<div class="info_list">
<div class="list_left" style="width:39%;">
<img
src="../../../assets/userRegister/company.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
组织机构名称:
</div>
<div class="list_right" style="width:61%;">
<input type="text" class="edit" v-model="organizationName" readonly />
</div>
</div>
<div class="info_list">
<div class="list_left" style="width:48%;">
<img
src="../../../assets/userRegister/idCard.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
统一社会信用代码:
</div>
<div class="list_right" style="width:52%;">
<input type="text" class="edit" v-model="socialCode" readonly />
</div>
</div>
<!-- <div class="info_list" style="border-bottom:none;">
<div class="list_left2">请上传营业执照照片</div>
</div>-->
<div class="bus-license">
<!-- <input
type="file"
name="avatar"
id="uppic"
accept="image/gif, image/jpeg, image/jpg, image/png"
ref="avatarInput"
class="uppic"
disabled
/>-->
<img :src="busLic2" alt class="pic" @click="previewImage(authOrgAttachmentId)" />
</div>
<div class="info_list">
<div class="list_left" style="width:43%;">
<img
src="../../../assets/userRegister/people.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
法定代表人姓名:
</div>
<div class="list_right" style="width:57%;">
<input type="text" class="edit" v-model="legalRepresentativeName" readonly />
</div>
</div>
<div class="info_list">
<div class="list_left" style="width:54%;">
<img
src="../../../assets/userRegister/idCard.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
法定代表人身份证号码:
</div>
<div class="list_right" style="width:46%;">
<input type="text" class="edit" v-model="legalRepresentativeCardNumber" readonly />
</div>
</div>
<div class="info_list">
<div class="list_left" style="width:30%;">
<img
src="../../../assets/userRegister/phone.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
手机号码:
</div>
<div class="list_right" style="width:70%;">
<input type="text" class="edit" v-model="legalPhoneNumber" readonly />
</div>
</div>
<!-- <div style="margin: 10px 0 0 14px;color:#636363">
<p>请上传身份证照片</p>
</div>-->
<div style="height:100px;margin-top:30px">
<div
style="border:1px solid #b2b2b2;width:140px;height:100px;margin:0 auto;border-radius:5px;position:relative;"
>
<!-- <input
type="file"
name="avatar"
id="uppic"
accept="image/gif, image/jpeg, image/jpg, image/png"
ref="avatarInput"
class="uppic"
disabled
/>-->
<img :src="cardUp2" alt class="pic" @click="previewImage(authAttachmentId)" />
</div>
</div>
<p style="margin-top:10px;text-align:center;color:#636363">正面</p>
<button
class="next_step"
style="width:120px;height:30px;border-radius:15px;background-color:#09bb07;color:#FFFFFF;margin:100px 0 0 -60px;position:relative;left:50%;"
@click="logout()"
>注销</button>
</div>
<!-- 组织其他员工 -->
<div v-if="staffType ==='组织其他员工'">
<div class="info_list">
<div class="list_left" style="width:39%;">
<img
src="../../../assets/userRegister/people.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
经办人姓名:
</div>
<div class="list_right" style="width:61%;">
<input type="text" class="edit" v-model="jbName" readonly />
</div>
</div>
<div class="info_list">
<div class="list_left" style="width:30%;">
<img
src="../../../assets/userRegister/phone.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
手机号码:
</div>
<div class="list_right" style="width:70%;">
<input type="text" class="edit" v-model="jbPhoneNumber" readonly />
</div>
</div>
<div class="info_list">
<div class="list_left" style="width:48%;">
<img
src="../../../assets/userRegister/idCard.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
经办人身份证号:
</div>
<div class="list_right" style="width:52%;">
<input type="text" class="edit" v-model="jbIdNumber" readonly />
</div>
</div>
<!-- <div style="margin: 10px 0 0 14px;color:#636363">
<p>请上传身份证照片</p>
</div>-->
<div style="height:100px;margin-top:30px">
<div
style="border:1px solid #b2b2b2;width:140px;height:100px;margin:0 auto;border-radius:5px;position:relative;"
>
<!-- <input
type="file"
name="avatar"
id="uppic"
accept="image/gif, image/jpeg, image/jpg, image/png"
ref="avatarInput"
class="uppic"
disabled
/>-->
<img :src="cardUp3" alt class="pic" @click="previewImage(authAttachmentId)" />
</div>
</div>
<p style="margin-top:10px;text-align:center;color:#636363">正面</p>
<div class="info_list">
<div class="list_left" style="width:39%;">
<img
src="../../../assets/userRegister/company.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
组织机构名称:
</div>
<div class="list_right" style="width:61%;">
<input type="text" class="edit" v-model="organizationName1" readonly />
</div>
</div>
<div class="info_list">
<div class="list_left" style="width:48%;">
<img
src="../../../assets/userRegister/idCard.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
统一社会信用代码:
</div>
<div class="list_right" style="width:52%;">
<input type="text" class="edit" v-model="socialCode1" readonly />
</div>
</div>
<!-- <div class="info_list" style="border-bottom:none;">
<div class="list_left2">请上传营业执照照片</div>
</div>-->
<div class="bus-license">
<!-- <input
type="file"
name="avatar"
id="uppic"
accept="image/gif, image/jpeg, image/jpg, image/png"
ref="avatarInput"
class="uppic"
disabled
/>-->
<img :src="busLic3" alt class="pic" @click="previewImage(authOrgAttachmentId)" />
</div>
<div class="info_list">
<div class="list_left" style="width:43%;">
<img
src="../../../assets/userRegister/people.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
法定代表人姓名:
</div>
<div class="list_right" style="width:57%;">
<input type="text" class="edit" v-model="legalRepresentativeName1" readonly />
</div>
</div>
<div class="info_list">
<div class="list_left" style="width:54%;">
<img
src="../../../assets/userRegister/idCard.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
法定代表人身份证号码:
</div>
<div class="list_right" style="width:46%;">
<input type="text" class="edit" v-model="legalRepresentativeCardNumber1" readonly />
</div>
</div>
<button
class="next_step"
style="width:120px;height:30px;border-radius:15px;background-color:#09bb07;color:#FFFFFF;margin:100px 0 0 -60px;position:relative;left:50%;"
@click="logout()"
>注销</button>
</div>
</list-item>
</h-content>
</h-view>
</template>
<script>
// import { Grid, GridItem } from "vux";
import { getUrlParam } from "@/scripts/utils";
export default {
data() {
return {
agentType: "Y",
staffType: "法定代表人",
cardUp: require("../../../assets/userRegister/camear.png"), //身份证照片url
busLic: require("../../../assets/userRegister/camear.png"), //营业执照照片url
organizationName: "", //组织机构名称
socialCode: "", //统一社会信用代码
legalRepresentativeName: "", //法定代表人姓名
legalRepresentativeCardNumber: "", //法定代表人身份证号码
legalPhoneNumber: "", //法定代表人电话号码
jbName: "", //经办人姓名
jbPhoneNumber: "", //经办人手机号码
jbIdNumber: "", //经办人身份证号码
status: "",
cardUp1: require("../../../assets/userRegister/camear.png"), //身份证照片url
busLic1: require("../../../assets/userRegister/camear.png"), //营业执照照片url
organizationName1: "", //组织机构名称
socialCode1: "", //统一社会信用代码
legalRepresentativeName1: "", //法定代表人姓名
legalRepresentativeCardNumber1: "", //法定代表人身份证号码
//认证成功后
cardUp2: "", //身份证照片url
busLic2: "", //营业执照照片url
organizationName2: "", //组织机构名称
socialCode2: "", //统一社会信用代码
legalRepresentativeName2: "", //法定代表人姓名
legalRepresentativeCardNumber2: "", //法定代表人身份证号码
jbName2: "", //经办人姓名
jbPhoneNumber2: "", //经办人手机号码
jbIdNumber2: "", //经办人身份证号码
cardUp3: "", //身份证照片url
busLic3: "", //营业执照照片url
organizationName3: "", //组织机构名称
socialCode3: "", //统一社会信用代码
legalRepresentativeName3: "", //法定代表人姓名
legalRepresentativeCardNumber3: "", //法定代表人身份证号码
legalPhoneNumber2: "",
// 11111
attachmentId: "",
attachmentId1: "",
attachmentId2: "",
attachmentId3: "",
// 用户信息
userInfo: null,
faceAuthStatus: "",
orgAuthStatus: "",
authAttachmentId: "",
authOrgAttachmentId: ""
};
},
created() {
this.wxConfig();
this.getUserInfo();
},
activated: function() {
this.status = ""; //判断请求是否成功的状态
},
mounted() {},
updated: function() {},
methods: {
// 是否是代理店
isAgent() {
console.log(this.agentType);
// window.localStorage.agentType = this.agentType;
if (this.agentType == "N") {
this.staffType = "法定代表人";
}
},
// 调用微信接口的基础配置
wxConfig() {
let clientUrl = "";
let u = navigator.userAgent;
let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; //g
let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
//这个是安卓操作系统
console.log("机型:android");
clientUrl = location.href;
}
if (isIOS) {
//这个是ios操作系统
console.log("机型:ios");
clientUrl = location.href.split("#")[0];
}
// let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
let url = process.env.basePathRl + "getSignature";
let param = {
apiKey: "handexinxi",
url: clientUrl
};
hlsHttp.post(url, param).then(function(res) {
wx.config({
beta: true,
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.result.appId, // 必填,公众号的唯一标识
timestamp: res.result.timestamp, // 必填,生成签名的时间戳
nonceStr: res.result.nonceStr, // 必填,生成签名的随机串
signature: res.result.signature, // 必填,签名,见附录1
jsApiList: [
"chooseImage",
"previewImage",
"downloadImage",
"getLocalImgData",
"uploadImage",
"hideOptionMenu"
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.ready(function () {
wx.hideOptionMenu();
})
});
},
// 法人和其他人切换状态
getRadioVal() {
console.log(this.staffType);
},
// 图片上传
uploadUpImg() {
//身份证正面
let self = this;
wx.chooseImage({
count: 1, //张数, 默认9
sizeType: ["compressed"], //建议压缩图
sourceType: ["album", "camera"], // 来源是相册、相机
success: function(res) {
self.cardUp = res.localIds[0];
self.uploadToWeixinServer(res.localIds[0], "cardUp");
}
});
},
uploadUpImg1() {
//身份证正面
let self = this;
wx.chooseImage({
count: 1, //张数, 默认9
sizeType: ["compressed"], //建议压缩图
sourceType: ["album", "camera"], // 来源是相册、相机
success: function(res) {
self.cardUp1 = res.localIds[0];
self.uploadToWeixinServer(res.localIds[0], "cardUp1");
}
});
},
uploadBusLic() {
let self = this;
wx.chooseImage({
count: 1, //张数, 默认9
sizeType: ["compressed"], //建议压缩图
sourceType: ["album", "camera"], // 来源是相册、相机
success: function(res) {
self.busLic = res.localIds[0];
self.uploadToWeixinServer(res.localIds[0], "busLic");
}
});
},
uploadBusLic1() {
//上传营业执照
let self = this;
wx.chooseImage({
count: 1, //张数, 默认9
sizeType: ["compressed"], //建议压缩图
sourceType: ["album", "camera"], // 来源是相册、相机
success: function(res) {
self.busLic1 = res.localIds[0];
self.uploadToWeixinServer(res.localIds[0], "busLic1");
}
});
},
// 上传到微信服务器
uploadToWeixinServer(localId, type) {
let self = this;
wx.uploadImage({
localId: localId,
isShowProgressTips: 1, // 默认为1,显示进度提示
success: function(res) {
if (type == "cardUp") {
self.uploadCardToserver(res.serverId);
} else if (type == "cardUp1") {
self.uploadCard1Toserver(res.serverId);
} else if (type == "busLic") {
self.uploadBusLicToserver(res.serverId);
} else if (type == "busLic1") {
self.uploadBusLic1Toserver(res.serverId);
}
}
});
},
// 上传到业务系统并且进行ocr识别
uploadCardToserver(serverId) {
console.log("mediaId", serverId);
let vm = this;
let url = process.env.rootPath + "/auth/upload/image/hls/from/wx";
let param = {
openId: window.localStorage.openId,
mediaId: serverId,
sourceType: "app_file_id_card",
fileName: new Date().getTime() + ".jpg"
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, param).then(function(res) {
vm.hlsPopup.hideLoading();
vm.legalRepresentativeName = res["姓名"];
vm.legalRepresentativeCardNumber = res["公民身份号码"];
vm.attachmentId = res["attchmentId"];
window.sessionStorage.cardUp2_leg =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
vm.attachmentId +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
});
},
uploadCard1Toserver(serverId) {
let vm = this;
let url = process.env.rootPath + "/auth/upload/image/hls/from/wx";
let param = {
openId: window.localStorage.openId,
mediaId: serverId,
sourceType: "app_file_id_card",
fileName: new Date().getTime() + ".jpg"
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, param).then(function(res) {
vm.hlsPopup.hideLoading();
vm.jbName = res["姓名"];
vm.jbIdNumber = res["公民身份号码"];
vm.attachmentId1 = res["attchmentId"];
window.sessionStorage.cardUp3_oth =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
vm.attachmentId1 +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
});
},
uploadBusLicToserver(serverId) {
let vm = this;
let url = process.env.rootPath + "/auth/upload/image/hls/from/wx";
let param = {
openId: window.localStorage.openId,
mediaId: serverId,
sourceType: "app_file_bus_lic",
fileName: new Date().getTime() + ".jpg"
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, param).then(function(res) {
vm.hlsPopup.hideLoading();
vm.socialCode = res["社会信用代码"];
vm.organizationName = res["单位名称"];
vm.attachmentId2 = res["attchmentId"];
window.sessionStorage.busLic2_leg =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
vm.attachmentId2 +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
});
},
uploadBusLic1Toserver(serverId) {
let vm = this;
let url = process.env.rootPath + "/auth/upload/image/hls/from/wx";
let param = {
openId: window.localStorage.openId,
mediaId: serverId,
sourceType: "app_file_bus_lic",
fileName: new Date().getTime() + ".jpg"
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, param).then(function(res) {
vm.hlsPopup.hideLoading();
vm.socialCode1 = res["社会信用代码"];
vm.organizationName1 = res["单位名称"];
vm.attachmentId3 = res["attchmentId"];
window.sessionStorage.busLic3_oth =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
vm.attachmentId3 +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
});
},
//预览图片
previewImage(id) {
let vm = this;
var preview_url =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
id +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
// window.open(url,"_self");
hlsPopup.showBigPicture({
imgUrl: preview_url
});
},
// 下一步
next_step() {
let vm = this;
if (
!vm.organizationName ||
!vm.socialCode ||
!vm.legalRepresentativeName ||
!vm.legalRepresentativeCardNumber ||
!vm.legalPhoneNumber
// ||
// !vm.cardUp ||
// !vm.busLic
) {
vm.hlsPopup.showLongCenter("必输字端不能为空!");
return;
}
if (vm.hlsUtil.isCardID(vm.legalRepresentativeCardNumber)) {
vm.hlsPopup.showLongCenter("法定代表人身份证号有误");
return;
} else {
sessionStorage.setItem("organizationName_leg", vm.organizationName);
sessionStorage.setItem("cardUp_leg", vm.cardUp);
sessionStorage.setItem("busLic_leg", vm.busLic);
sessionStorage.setItem("socialCode_leg", vm.socialCode);
sessionStorage.setItem(
"legalRepresentativeName_leg",
vm.legalRepresentativeName
);
sessionStorage.setItem(
"legalRepresentativeCardNumber_leg",
vm.legalRepresentativeCardNumber
);
sessionStorage.setItem("legalPhoneNumber_leg", vm.legalPhoneNumber);
// alert("验证通过");
// let url = 'http://101.133.225.167:8096/core/r/api?sysName=HLS_APP&apiName=' + 'getOpenId';//获取openId的接口
let url = process.env.rootPath + "/auth/api/individual/face/Organ";
let param = {
openId: window.localStorage.openId,
idNo: vm.socialCode,
name: vm.organizationName,
agentIdNo: vm.legalRepresentativeCardNumber,
agentName: vm.legalRepresentativeName,
mobile: vm.legalPhoneNumber,
legalName: vm.legalRepresentativeName,
legalIdNo: vm.legalRepresentativeCardNumber,
agentType: "1",
dealerFlag: vm.agentType,
redirectUrl:
"http://sign.hitachics.com/www/#/UserRegister/CompanyRegister?Regstatus=1"
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, param).then(function(res) {
vm.hlsPopup.hideLoading();
if (res.code == 0) {
vm.$vux.toast.text(res.message, "middle");
if (res.url) {
window.open(res.url, "_self");
}
} else {
vm.$vux.toast.text(res.message, "middle");
}
});
}
},
next_step_oth() {
let vm = this;
if (
!vm.organizationName1 ||
!vm.socialCode1 ||
!vm.legalRepresentativeName1 ||
!vm.legalRepresentativeCardNumber1 ||
!vm.jbName ||
!vm.jbPhoneNumber ||
!vm.jbIdNumber
// !vm.cardUp1 ||
// !vm.busLic1
) {
vm.hlsPopup.showLongCenter("必输字端不能为空!");
return;
}
if (vm.hlsUtil.isCardID(vm.legalRepresentativeCardNumber1)) {
vm.hlsPopup.showLongCenter("身份证号有误");
return;
} else {
sessionStorage.setItem("organizationName_oth", vm.organizationName1);
sessionStorage.setItem("cardUp_oth", vm.cardUp1);
sessionStorage.setItem("busLic_oth", vm.busLic1);
sessionStorage.setItem("socialCode_oth", vm.socialCode1);
sessionStorage.setItem(
"legalRepresentativeName_oth",
vm.legalRepresentativeName1
);
sessionStorage.setItem(
"legalRepresentativeCardNumber_oth",
vm.legalRepresentativeCardNumber1
);
sessionStorage.setItem("jbName_oth", vm.jbName);
sessionStorage.setItem("jbPhoneNumber_oth", vm.jbPhoneNumber);
sessionStorage.setItem("jbIdNumber_oth", vm.jbIdNumber);
// let url = 'http://101.133.225.167:8096/core/r/api?sysName=HLS_APP&apiName=' + 'getOpenId';//获取openId的接口
let url = process.env.rootPath + "/auth/api/individual/face/Organ";
let param = {
openId: window.localStorage.openId,
idNo: vm.socialCode1,
agentIdNo: vm.jbIdNumber,
agentName: vm.jbName,
mobile: vm.jbPhoneNumber,
name: vm.organizationName1,
legalName: vm.legalRepresentativeName1,
legalIdNo: vm.legalRepresentativeCardNumber1,
agentType: "2",
dealerFlag: vm.agentType,
redirectUrl:
"http://sign.hitachics.com/www/#/UserRegister/CompanyRegister?Regstatus=2"
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, param).then(function(res) {
vm.hlsPopup.hideLoading();
if (res.code == 0) {
vm.$vux.toast.text(res.message, "middle");
if (res.url) {
window.open(res.url, "_self");
}
} else {
vm.$vux.toast.text(res.message, "middle");
}
});
}
},
UrlSearch() {
var name, value;
var str = window.location.href; //取得整个地址栏
var num = str.indexOf("?");
str = str.substr(num + 1); //取得所有参数 stringvar.substr(start [, length ]
var arr = str.split("&"); //各个参数放到数组里
for (var i = 0; i < arr.length; i++) {
num = arr[i].indexOf("=");
if (num > 0) {
name = arr[i].substring(0, num);
value = arr[i].substr(num + 1);
this[name] = value;
}
}
},
logout() {
let vm = this;
let url = process.env.rootPath + "/organizations/outerOrgans/delete";
let param = {
openId: window.localStorage.openId
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, param).then(function(res) {
vm.hlsPopup.hideLoading();
if (res.code == 0) {
vm.$vux.toast.text(res.message, "middle");
window.open("http://sign.hitachics.com/www/#/UserRegister", "_self");
} else {
vm.$vux.toast.text(res.message, "middle");
}
});
},
// 认证结果返回给接口
authResult(id, code, suc) {
let vm = this;
let url = "http://sign.hitachics.com/core/api/public/listen/auth/result";
let param = {
contextId: id,
verifycode: code,
success: suc
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, param).then(function(res) {
vm.hlsPopup.hideLoading();
});
},
// 键盘消失,页面返回顶部
goTop() {
setTimeout(function() {
var scrollHeight =
document.documentElement.scrollTop || document.body.scrollTop || 0;
console.log(scrollHeight);
window.scrollTo(0, Math.max(scrollHeight, 0));
}, 100);
},
// 查询用户信息
getUserInfo() {
var Request = new this.UrlSearch(); //实例化
var status = Request.Regstatus;
var contextId = Request.contextId;
var verifycode = Request.verifycode;
var success = Request.passed;
// console.log('wwwwww',status)
let vm = this;
let url =
process.env.rootPath +
"/sign/info/hclc/query/by/openid?openId=" +
window.localStorage.openId;
// let url =
// process.env.rootPath +
// "/sign/info/hclc/query/by/openid?openId=" +
// // "oBdoRwFp6UN_KzchaPIEPynR9poM"
// "oBdoRwI9gj9Brbe9iqlDCg5G2dDc";
vm.hlsPopup.showLoading("请稍等");
vm.$post(url).then(function(res) {
vm.hlsPopup.hideLoading();
// console.log(res.rows.length);
if (res.rows) {
if (res.rows.length > 0) {
var data = res.rows[0];
vm.userInfo = data;
vm.faceAuthStatus = data.faceAuthStatus;
vm.orgAuthStatus = data.orgAuthStatus;
vm.agentType = data.dealerFlag ? data.dealerFlag : "Y";
if (data.ctitype == 2) {
if (data.agentType == 1) {
//法定代表人
vm.organizationName = data.name;
vm.socialCode = data.idNo;
vm.legalRepresentativeName = data.legalName;
vm.legalRepresentativeCardNumber = data.legalIdNo;
vm.legalPhoneNumber = data.mobile;
vm.authAttachmentId = data.attachmentId;
vm.authOrgAttachmentId = data.orgAttachmentId;
vm.cardUp =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
data.attachmentId +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
vm.cardUp2 =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
data.attachmentId +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
vm.busLic =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
data.orgAttachmentId +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
vm.busLic2 =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
data.orgAttachmentId +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
if (
data.faceAuthStatus == "SUCCESS" &&
data.orgAuthStatus == "SUCCESS"
) {
vm.status = "成功";
vm.authResult(contextId, verifycode, success);
// 跳转到注销页面
}
} else if (data.agentType == 2) {
//组织机构其他员工
vm.staffType = "组织其他员工";
vm.jbName = data.agentName;
vm.jbPhoneNumber = data.mobile;
vm.jbIdNumber = data.agentIdNo;
vm.organizationName1 = data.name;
vm.socialCode1 = data.idNo;
vm.legalRepresentativeName1 = data.legalName;
vm.legalRepresentativeCardNumber1 = data.legalIdNo;
vm.authAttachmentId = data.attachmentId;
vm.authOrgAttachmentId = data.orgAttachmentId;
vm.cardUp1 =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
data.attachmentId +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
vm.busLic1 =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
data.orgAttachmentId +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
vm.cardUp3 =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
data.attachmentId +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
vm.busLic3 =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
data.orgAttachmentId +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
if (
data.faceAuthStatus == "SUCCESS" &&
data.orgAuthStatus == "SUCCESS"
) {
vm.status = "成功";
vm.authResult(contextId, verifycode, success);
// 跳转到注销页面
}
}
}
}
}
});
}
}
};
</script>
<style lang="less" type="text/less" scoped>
@import "../../../styles/vue-1px.less";
.companyRegister {
.reg-content {
padding: 20px 10px;
font-size: 14px;
.repre-type {
padding: 10px;
border-bottom: 1px solid #d0d0d0;
color: #11111187;
font-size: 16px;
font-weight: 700;
}
.info_list {
width: 100%;
// height: 48px;
// border-bottom: 1px solid #f2f2f2;
border-bottom: 1px solid #d0d0d0;
display: flex;
display: -webkit-flex;
.list_left {
width: 35%;
// margin-left: 3%;
height: 50px;
font-family: "微软雅黑";
font-size: 14px;
color: #636363;
line-height: 50px;
// float: left;
}
.list_right {
// width: auto;
// margin-right: 3%;
height: 50px;
color: #636363;
line-height: 50px;
// float: right;
}
.edit {
width: 100%;
color: #898989;
font-family: "微软雅黑";
font-size: 14px;
border: none;
}
.list_left2 {
width: 97%;
margin-left: 3%;
height: 50px;
font-family: "微软雅黑";
font-size: 14px;
color: #636363;
line-height: 50px;
// float: left;
}
}
.uppic {
height: 100%;
width: 100%;
margin: 0 auto;
opacity: 0;
z-index: 1000;
position: absolute;
}
.pic {
width: 100%;
height: 100%;
position: absolute;
}
.bus-license {
width: 140px;
height: 100px;
margin: 10px auto;
border: 1px solid #b2b2b2;
border-radius: 8px;
position: relative;
}
.next-step {
width: 120px;
height: 30px;
border-radius: 15px;
background-color: #09bb07;
color: #ffffff;
cursor: pointer;
margin: 100px 0 0 -60px;
position: relative;
left: 50%;
}
}
}
// iPhoneX适配
@media (device-width: 375px) and (device-height: 812px) and (-webkit-min-device-pixel-ratio: 3) {
.platform-ios {
#home {
}
}
}
// iPhoneX Max适配
@media (device-width: 414px) and (device-height: 896px) {
.platform-ios {
.platform-ios {
#home {
}
}
}
}
</style>
<template>
<h-view class="public-style personalRegister" title="个人用户注册">
<h-content v-if="status!= 1">
<list-item class="personalInf" style="padding:20px;height:100%">
<div style="height:40px;border-bottom:1px solid #d0d0d0">
<div
class="personalInf-text"
style=" width: 150px;line-height: 30px;text-align: center;
border-radius: 5px;
background-color: #ddd;font-size:16px;font-weight:700;color:#11111187"
>个人信息</div>
</div>
<item style="border-bottom:1px solid #d0d0d0;font-size:12px">
<section slot="name" style="font-size:14px">
<img
src="../../../assets/userRegister/people-name.png"
style="float:left;width:20px;height:20px;margin: 2px 5px 0 0;"
/>姓名:
</section>
<input slot="content" v-model="personName" style="text-align: left;font-size:12px" readonly/>
</item>
<item style="border-bottom:1px solid #d0d0d0">
<section slot="name" style="font-size:14px">
<img
src="../../../assets/userRegister/idCard.png"
style="float:left;width:20px;height:20px;margin: 2px 5px 0 0;"
/>身份证号:
</section>
<input
slot="content"
v-model="identificationNumber"
style="text-align: left;font-size:14px"
readonly
/>
</item>
<item style="border-bottom:1px solid #d0d0d0">
<section slot="name" style="font-size:14px">
<img
src="../../../assets/userRegister/phone.png"
style="float:left;width:20px;height:20px;margin: 2px 5px 0 0;"
/>手机号码:
</section>
<input
slot="content"
v-model="phoneNumber"
style="text-align: left;font-size:14px"
placeholder="请输入电话号码"
@blur = "goTop()"
/>
</item>
<div style="margin: 40px 0 0 14px;color:#333333;font-size:14px">
<p>请上传身份证照片</p>
</div>
<div style="height:100px;margin-top:30px">
<div
style="border:1px solid #b2b2b2;width:140px;height:100%;margin:0 auto;border-radius:5px;position:relative;"
>
<!-- <input
type="file"
name="avatar"
id="uppic"
accept="image/gif, image/jpeg, image/jpg, image/png"
@change="uploadUpImg($event)"
ref="avatarInput"
class="uppic"
/> -->
<img :src="cardUp" alt class="pic" @click="addCardImage()" />
</div>
<!-- <div style="border:1px solid #b2b2b2;width:50%;border-radius:5px;position:relative;">
<input
type="file"
name="avatar"
id="uppic"
accept="image/gif, image/jpeg, image/jpg, image/png"
@change="uploadDownImg($event)"
ref="avatarInput"
class="uppic"
/>
<img :src="cardDown" alt class="pic" />
</div>-->
</div>
<p style="margin-top:10px;text-align:center;font-size:14px">
正面
<!-- <span style="float:right;margin-right:21%;margin-top:10px">反面</span> -->
</p>
<button
@click="next_step()"
style="width:120px;height:30px;border-radius:15px;background-color:#09bb07;color:#FFFFFF;margin:70px 0 0 -60px;position:relative;left:50%;"
>下一步</button>
</list-item>
</h-content>
<h-content v-else-if="status == 1">
<list-item class="personalInf" style="padding:20px;height:100%">
<div style="height:40px;border-bottom:1px solid #d0d0d0">
<div class="personalInf-text" style=" width: 150px;line-height: 30px;text-align: center;border-radius: 5px;background-color: #ddd;font-size:16px;font-weight:700;color:#11111187">
个人信息
</div>
</div>
<item style="border-bottom:1px solid #d0d0d0">
<section slot="name" style="font-size:14px">
<img
src="../../../assets/userRegister/people-name.png"
style="float:left;width:20px;height:20px;margin: 2px 5px 0 0;"
/>姓名:
</section>
<input
slot="content"
v-model="personName1"
style="text-align: left;font-size:14px"
readonly
/>
</item>
<item style="border-bottom:1px solid #d0d0d0">
<section slot="name" style="font-size:14px">
<img
src="../../../assets/userRegister/idCard.png"
style="float:left;width:20px;height:20px;margin: 2px 5px 0 0;"
/>身份证号:
</section>
<input
slot="content"
v-model="identificationNumber1"
style="text-align: left;font-size:14px"
readonly
/>
</item>
<item style="border-bottom:1px solid #d0d0d0">
<section slot="name" style="font-size:14px">
<img
src="../../../assets/userRegister/phone.png"
style="float:left;width:20px;height:20px;margin: 2px 5px 0 0;"
/>手机号码:
</section>
<input
slot="content"
v-model="phoneNumber1"
style="text-align: left;font-size:14px"
readonly
/>
</item>
<div style="margin: 40px 0 0 14px;color:#333333">
<p>请上传身份证照片</p>
</div>
<div style="height:100px;margin-top:30px">
<div
style="border:1px solid #b2b2b2;width:140px;height:100%;margin:0 auto;border-radius:5px;position:relative;"
>
<!-- <input
type="file"
name="avatar"
id="uppic"
accept="image/gif, image/jpeg, image/jpg, image/png"
ref="avatarInput"
class="uppic"
disabled
/>-->
<img :src="cardUp1" alt class="pic" @click="previewImage()"/>
</div>
<!-- <div style="border:1px solid #b2b2b2;width:50%;border-radius:5px;position:relative;">
<input
type="file"
name="avatar"
id="uppic"
accept="image/gif, image/jpeg, image/jpg, image/png"
@change="uploadDownImg($event)"
ref="avatarInput"
class="uppic"
/>
<img :src="cardDown" alt class="pic" />
</div>-->
</div>
<p style="margin-top:10px;text-align:center;">
正面
<!-- <span style="float:right;margin-right:21%;margin-top:10px">反面</span> -->
</p>
<button
@click="logout()"
style="width:120px;height:30px;border-radius:15px;background-color:#09bb07;color:#FFFFFF;margin:70px 0 0 -60px;position:relative;left:50%;"
>注销</button>
</list-item>
</h-content>
</h-view>
</template>
<script>
import {getUrlParam} from '@/scripts/utils'
export default {
data() {
return {
cardUp:require("../../../assets/userRegister/camear.png") , //身份证正面url
identificationNumber: "",
phoneNumber: "",
personName: "",
cardUp1: "", //身份证正面url
identificationNumber1: "",
phoneNumber1: "",
personName1: "",
status: "",
serverId:"",
preview_url:"",//图片预览地址
attchmentId:"",//附件预览id
};
},
components: {},
activated: function() {
this.status = this.$route.params.status;
this.cardUp1 = sessionStorage.cardUp1 ? sessionStorage.cardUp1 : "";
this.identificationNumber1 = sessionStorage.identificationNumber
? sessionStorage.identificationNumber
: "";
this.phoneNumber1 = sessionStorage.phoneNumber
? sessionStorage.phoneNumber
: "";
this.personName1 = sessionStorage.personName
? sessionStorage.personName
: "";
// console.log(this.getUrlParams('Regstatus'));
var Request = new this.UrlSearch(); //实例化
this.status = Request.Regstatus;
},
updated: function() {},
methods: {
// 调用微信接口的基础配置
wxConfig() {
let clientUrl = '';
let u = navigator.userAgent;
let isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
//这个是安卓操作系统
console.log('机型:android');
clientUrl = location.href
}
if (isIOS) {
  //这个是ios操作系统
console.log('机型:ios');
clientUrl = location.href.split('#')[0];
}
// let clientUrl = encodeURIComponent(location.href)
// let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
let url = process.env.basePathRl + "getSignature";
let param = {
apiKey: "handexinxi",
url: clientUrl
};
hlsHttp.post(url, param).then(function(res) {
wx.config({
beta: true,
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.result.appId, // 必填,公众号的唯一标识
timestamp: res.result.timestamp, // 必填,生成签名的时间戳
nonceStr: res.result.nonceStr, // 必填,生成签名的随机串
signature: res.result.signature, // 必填,签名,见附录1
jsApiList: [
"chooseImage",
"previewImage",
"downloadImage",
"getLocalImgData",
"uploadImage",
"hideOptionMenu"
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.ready(function () {
wx.hideOptionMenu();
})
});
},
addCardImage: function() {
console.log("11111111");
let self = this;
// if(!self.cardUp){
wx.chooseImage({
count: 1, //张数, 默认9
sizeType: ["compressed"], //建议压缩图
sourceType: ["album", "camera"], // 来源是相册、相机
success: function(res) {
self.cardUp = res.localIds[0];
self.uploadToWeixinServer(res.localIds[0]);
}
});
// }else{
// if(self.attchmentId){
// this.previewImage();
// }
// }
},
//预览图片
previewImage() {
hlsPopup.showBigPicture({
imgUrl: window.sessionStorage.cardUp1
})
},
uploadToWeixinServer(localId) {
let self = this;
wx.uploadImage({
localId: localId,
isShowProgressTips: 1, // 默认为1,显示进度提示
success: function(res) {
//res.serverId 返回图片的微信服务器端ID
console.log("上传图片后返回的信息", res);
self.serverId = res.serverId;
self.uploadToserver(res.serverId);
}
});
},
uploadToserver(serverId){
console.log('mediaId',serverId);
let vm = this;
let url = process.env.rootPath + "/auth/upload/image/hls/from/wx";
let param = {
openId: window.localStorage.openId,
mediaId: serverId,
sourceType: "app_file_id_card",
fileName: new Date().getTime() + '.jpg'
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, param).then(function(res) {
vm.hlsPopup.hideLoading();
vm.personName = res['姓名'];
vm.identificationNumber = res['公民身份号码'];
vm.attchmentId = res["attchmentId"];
window.sessionStorage.cardUp1 = process.env.rootPath + "/app/fileViewSvc?attachment_id=" + vm.attchmentId + "&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" + window.localStorage.access_token_rl;
});
},
// 下一步
next_step() {
let vm = this;
if (
!vm.personName ||
!vm.identificationNumber ||
!vm.phoneNumber ||
!vm.cardUp
) {
vm.hlsPopup.showLongCenter("必输字端不能为空!");
return;
}
else if(vm.hlsUtil.isCardID(vm.identificationNumber)) {
vm.hlsPopup.showLongCenter("身份证号有误");
return;
}
else if(!vm.hlsUtil.phoneNumber(vm.phoneNumber)) {
vm.hlsPopup.showLongCenter("手机号码有误!");
return;
}
else {
sessionStorage.setItem("personName", vm.personName);
sessionStorage.setItem("identificationNumber", vm.identificationNumber);
sessionStorage.setItem("phoneNumber", vm.phoneNumber);
// alert("验证通过");
let url = process.env.rootPath + "/auth/api/individual/face";
let param = {
openId: window.localStorage.openId,
idNo: vm.identificationNumber,
name: vm.personName,
mobile: vm.phoneNumber,
redirectUrl:"http://sign.hitachics.com/www/#/UserRegister/PersonalRegister?Regstatus=1"
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, param).then(function(res) {
vm.hlsPopup.hideLoading();
if(res.code == 0){
vm.$vux.toast.text(res.message, "middle");
if (res.url) {
window.open(res.url, "_self");
}
}else{
vm.$vux.toast.text(res.message, "middle");
}
});
}
},
// 获取url地址参数
UrlSearch() {
var name, value;
// var str="http://sign.hitachics.com/www/#/UserRegister/PersonalRegister?Regstatus=1&status=true&serviceId=1151815015435601748&verifycode=4accf0d2106f9c7361be72093e1fb793&contextId=10074&passed=true"; //取得整个地址栏
var str = window.location.href; //取得整个地址栏
// alert(str)
var num = str.indexOf("?");
str = str.substr(num + 1); //取得所有参数 stringvar.substr(start [, length ]
var arr = str.split("&"); //各个参数放到数组里
for (var i = 0; i < arr.length; i++) {
num = arr[i].indexOf("=");
if (num > 0) {
name = arr[i].substring(0, num);
value = arr[i].substr(num + 1);
this[name] = value;
}
}
},
// 认证结果返回给接口
authResult(id,code,suc){
let vm = this;
let url = "http://sign.hitachics.com/core/api/public/listen/auth/result";
let param = {
"contextId": id,
"verifycode": code,
"success":suc
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, param).then(function(res) {
vm.hlsPopup.hideLoading();
});
},
// 注销
logout(){
let vm = this;
let url = process.env.rootPath + "/accounts/outerAccounts/delete";
let param = {
openId: window.localStorage.openId,
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, param).then(function(res) {
vm.hlsPopup.hideLoading();
if(res.code == 0){
vm.$vux.toast.text(res.message, 'middle')
window.open("http://sign.hitachics.com/www/#/UserRegister", "_self");
}else{
vm.$vux.toast.text(res.message, 'middle')
}
});
},
// 键盘消失,页面回到顶部
goTop(){
setTimeout(function() {
var scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0;
console.log(scrollHeight);
window.scrollTo(0, Math.max(scrollHeight, 0));
}, 100);
}
},
created(){
this.wxConfig();
// wx.hideOptionMenu();
var Request = new this.UrlSearch(); //实例化
this.status = Request.Regstatus;
var contextId = Request.contextId;
var verifycode = Request.verifycode;
var success = Request.passed;
if(this.status == 1){
this.authResult(contextId,verifycode,success);
}
var data = this.$route.params.userInfo;
if(data){
this.cardUp = process.env.rootPath + "/app/fileViewSvc?attachment_id=" + data.attachmentId + "&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" + window.localStorage.access_token_rl;
this.identificationNumber = data.idNo;
this.phoneNumber = data.mobile;
this.personName = data.name;
}
}
};
</script>
<style lang="less" type="text/less" scoped>
@import "../../../styles/vue-1px.less";
.personalRegister {
font-size: 12px !important;
.personalInfo {
width: 100%;
height: 100% !important;
}
.uppic {
height: 100%;
width: 100%;
margin: 0 auto;
opacity: 0;
z-index: 1000;
position: absolute;
}
.pic {
width: 100%;
height: 100%;
position: absolute;
}
}
// iPhoneX适配
@media (device-width: 375px) and (device-height: 812px) and (-webkit-min-device-pixel-ratio: 3) {
.platform-ios {
#home {
}
}
}
// iPhoneX Max适配
@media (device-width: 414px) and (device-height: 896px) {
.platform-ios {
.platform-ios {
#home {
}
}
}
}
</style>
<template>
<h-view class="public-style companyRegister" title="企业用户注册">
<h-content>
<list-item class="reg-content">
<div class="repre-type">
代理店
<input
type="radio"
name="agent"
v-model="agentType"
value="Y"
disabled
/>
非代理店
<input
type="radio"
name="agent"
v-model="agentType"
value="N"
disabled
/>
</div>
<div class="repre-type" v-if="agentType == 'Y'">
<span>经办人类型:</span>
<input
type="radio"
name="peopleType"
v-model="staffType"
@change="getRadioVal"
value="组织其他员工"
disabled
/>组织其他员工
<input
type="radio"
name="peopleType"
v-model="staffType"
@change="getRadioVal"
value="法定代表人"
disabled
/>法定代表人
</div>
<!-- 法定代表人 -->
<div v-if="staffType == '法定代表人'">
<div class="info_list">
<div class="list_left" style="width:39%;">
<img
src="../../../assets/userRegister/company.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
组织机构名称:
</div>
<div class="list_right" style="width:61%;">
<input type="text" class="edit" v-model="organizationName" readonly />
</div>
</div>
<div class="info_list">
<div class="list_left" style="width:48%;">
<img
src="../../../assets/userRegister/idCard.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
统一社会信用代码:
</div>
<div class="list_right" style="width:52%;">
<input type="text" class="edit" v-model="socialCode" readonly />
</div>
</div>
<!-- <div class="info_list" style="border-bottom:none;">
<div class="list_left2">请上传营业执照照片</div>
</div>-->
<div class="bus-license">
<img :src="busLic" alt class="pic" @click="previewImage(orgAttachmentId)" />
</div>
<div class="info_list">
<div class="list_left" style="width:43%;">
<img
src="../../../assets/userRegister/people.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
法定代表人姓名:
</div>
<div class="list_right" style="width:57%;">
<input type="text" class="edit" v-model="legalRepresentativeName" readonly />
</div>
</div>
<div class="info_list">
<div class="list_left" style="width:54%;">
<img
src="../../../assets/userRegister/idCard.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
法定代表人身份证号码:
</div>
<div class="list_right" style="width:46%;">
<input type="text" class="edit" v-model="legalRepresentativeCardNumber" readonly />
</div>
</div>
<div class="info_list">
<div class="list_left" style="width:30%;">
<img
src="../../../assets/userRegister/phone.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
手机号码:
</div>
<div class="list_right" style="width:70%;">
<input type="text" class="edit" v-model="legalPhoneNumber" readonly />
</div>
</div>
<!-- <div style="margin: 10px 0 0 14px;">
<p>请上传身份证照片</p>
</div>-->
<div style="height:100px;margin-top:30px">
<div
style="border:1px solid #b2b2b2;width:140px;height:100px;margin:0 auto;border-radius:5px;position:relative;"
>
<img :src="cardUp" alt class="pic" @click="previewImage(attachmentId)" />
</div>
</div>
<p style="margin-top:10px;text-align:center;">正面</p>
<button
class="next_step"
style="width:120px;height:30px;border-radius:15px;background-color:#09bb07;color:#FFFFFF;margin:100px 0 0 -60px;position:relative;left:50%;"
@click="logout()"
>注销</button>
</div>
<!-- 组织其他员工 -->
<div v-if="staffType ==='组织其他员工'">
<div class="info_list">
<div class="list_left" style="width:39%;">
<img
src="../../../assets/userRegister/people.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
经办人姓名:
</div>
<div class="list_right" style="width:61%;">
<input type="text" class="edit" v-model="jbName" readonly />
</div>
</div>
<div class="info_list">
<div class="list_left" style="width:30%;">
<img
src="../../../assets/userRegister/phone.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
手机号码:
</div>
<div class="list_right" style="width:70%;">
<input type="text" class="edit" v-model="jbPhoneNumber" readonly />
</div>
</div>
<div class="info_list">
<div class="list_left" style="width:48%;">
<img
src="../../../assets/userRegister/idCard.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
经办人身份证号:
</div>
<div class="list_right" style="width:52%;">
<input type="text" class="edit" v-model="jbIdNumber" readonly />
</div>
</div>
<!-- <div style="margin: 10px 0 0 14px;">
<p>请上传身份证照片</p>
</div>-->
<div style="height:100px;margin-top:30px">
<div
style="border:1px solid #b2b2b2;width:140px;height:100px;margin:0 auto;border-radius:5px;position:relative;"
>
<!-- <input
type="file"
name="avatar"
id="uppic"
accept="image/gif, image/jpeg, image/jpg, image/png"
ref="avatarInput"
class="uppic"
disabled
/>-->
<img :src="cardUp1" alt class="pic" @click="previewImage(attachmentId1)" />
</div>
</div>
<p style="margin-top:10px;text-align:center;">正面</p>
<div class="info_list">
<div class="list_left" style="width:39%;">
<img
src="../../../assets/userRegister/company.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
组织机构名称:
</div>
<div class="list_right" style="width:61%;">
<input type="text" class="edit" v-model="organizationName1" readonly />
</div>
</div>
<div class="info_list">
<div class="list_left" style="width:48%;">
<img
src="../../../assets/userRegister/idCard.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
统一社会信用代码:
</div>
<div class="list_right" style="width:52%;">
<input type="text" class="edit" v-model="socialCode1" readonly />
</div>
</div>
<!-- <div class="info_list" style="border-bottom:none;">
<div class="list_left2">请上传营业执照照片</div>
</div>-->
<div class="bus-license">
<!-- <input
type="file"
name="avatar"
id="uppic"
accept="image/gif, image/jpeg, image/jpg, image/png"
ref="avatarInput"
class="uppic"
disabled
/>-->
<img :src="busLic1" alt class="pic" @click="previewImage(orgAttachmentId1)" />
</div>
<div class="info_list">
<div class="list_left" style="width:43%;">
<img
src="../../../assets/userRegister/people.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
法定代表人姓名:
</div>
<div class="list_right" style="width:57%;">
<input type="text" class="edit" v-model="legalRepresentativeName1" readonly />
</div>
</div>
<div class="info_list">
<div class="list_left" style="width:54%;">
<img
src="../../../assets/userRegister/idCard.png"
alt
style="width:16px;height:16px;margin-right:5px;"
/>
法定代表人身份证号码:
</div>
<div class="list_right" style="width:46%;">
<input type="text" class="edit" v-model="legalRepresentativeCardNumber1" readonly />
</div>
</div>
<button
class="next_step"
style="width:120px;height:30px;border-radius:15px;background-color:#09bb07;color:#FFFFFF;margin:100px 0 0 -60px;position:relative;left:50%;"
@click="logout()"
>注销</button>
</div>
</list-item>
</h-content>
</h-view>
</template>
<script>
// import { Grid, GridItem } from "vux";
import { getUrlParam } from "@/scripts/utils";
export default {
data() {
return {
staffType: "法定代表人",
cardUp: "", //身份证照片url
busLic: "", //营业执照照片url
organizationName: "", //组织机构名称
socialCode: "", //统一社会信用代码
legalRepresentativeName: "", //法定代表人姓名
legalRepresentativeCardNumber: "", //法定代表人身份证号码
jbName: "", //经办人姓名
jbPhoneNumber: "", //经办人手机号码
jbIdNumber: "", //经办人身份证号码
cardUp1: "", //身份证照片url
busLic1: "", //营业执照照片url
organizationName1: "", //组织机构名称
socialCode1: "", //统一社会信用代码
legalRepresentativeName1: "", //法定代表人姓名
legalRepresentativeCardNumber1: "", //法定代表人身份证号码
// 11111
attachmentId: "",
orgAttachmentId: "",
attachmentId1: "",
orgAttachmentId1: "",
agentType: ""
};
},
components: {
// Grid,
// GridItem
},
activated: function() {},
updated: function() {},
methods: {
// 法人和其他人切换状态
getRadioVal() {
console.log(this.staffType);
},
//预览图片
previewImage(id) {
let vm = this;
var preview_url =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
id +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
// window.open(url,"_self");
hlsPopup.showBigPicture({
imgUrl: preview_url
});
},
UrlSearch() {
var name, value;
var str = window.location.href; //取得整个地址栏
var num = str.indexOf("?");
str = str.substr(num + 1); //取得所有参数 stringvar.substr(start [, length ]
var arr = str.split("&"); //各个参数放到数组里
for (var i = 0; i < arr.length; i++) {
num = arr[i].indexOf("=");
if (num > 0) {
name = arr[i].substring(0, num);
value = arr[i].substr(num + 1);
this[name] = value;
}
}
},
logout() {
let vm = this;
let url = process.env.rootPath + "/organizations/outerOrgans/delete";
let param = {
openId: window.localStorage.openId
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, param).then(function(res) {
vm.hlsPopup.hideLoading();
if (res.code == 0) {
vm.$vux.toast.text(res.message, "middle");
window.open("http://sign.hitachics.com/www/#/UserRegister", "_self");
} else {
vm.$vux.toast.text(res.message, "middle");
}
});
},
// 调用微信接口的基础配置
wxConfig() {
let clientUrl = "";
let u = navigator.userAgent;
let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; //g
let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
//这个是安卓操作系统
console.log("机型:android");
clientUrl = location.href;
}
if (isIOS) {
//这个是ios操作系统
console.log("机型:ios");
clientUrl = location.href.split("#")[0];
}
// let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
let url = process.env.basePathRl + "getSignature";
let param = {
apiKey: "handexinxi",
url: clientUrl
};
hlsHttp.post(url, param).then(function(res) {
wx.config({
beta: true,
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.result.appId, // 必填,公众号的唯一标识
timestamp: res.result.timestamp, // 必填,生成签名的时间戳
nonceStr: res.result.nonceStr, // 必填,生成签名的随机串
signature: res.result.signature, // 必填,签名,见附录1
jsApiList: [
"chooseImage",
"previewImage",
"downloadImage",
"getLocalImgData",
"uploadImage",
"hideOptionMenu"
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.ready(function () {
wx.hideOptionMenu();
})
});
},
},
created() {
this.wxConfig();
var data = this.$route.params.userInfo;
var agentType = data.agentType;
console.log(data);
if (agentType == 1) {
this.agentType = data.dealerFlag;
this.organizationName = data.name;
this.socialCode = data.idNo;
this.legalRepresentativeName = data.legalName;
this.legalRepresentativeCardNumber = data.legalIdNo;
this.legalPhoneNumber = data.mobile;
this.attachmentId = data.attachmentId;
this.orgAttachmentId = data.orgAttachmentId;
this.cardUp =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
data.attachmentId +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
this.busLic =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
data.orgAttachmentId +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
} else if (agentType == 2) {
this.agentType = data.dealerFlag;
this.staffType = "组织其他员工";
this.jbName = data.agentName;
this.jbPhoneNumber = data.mobile;
this.jbIdNumber = data.agentIdNo;
this.organizationName1 = data.name;
this.socialCode1 = data.idNo;
this.legalRepresentativeName1 = data.legalName;
this.legalRepresentativeCardNumber1 = data.legalIdNo;
this.attachmentId1 = data.attachmentId;
this.orgAttachmentId1 = data.orgAttachmentId;
this.cardUp1 =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
data.attachmentId +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
this.busLic1 =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
data.orgAttachmentId +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
}
}
};
</script>
<style lang="less" type="text/less" scoped>
@import "../../../styles/vue-1px.less";
.companyRegister {
.reg-content {
padding: 20px;
font-size: 14px;
.repre-type {
padding: 10px;
border-bottom: 1px solid #d0d0d0;
color: #11111187;
font-size: 16px;
font-weight: 700;
}
.info_list {
width: 100%;
// height: 50px;
// border-bottom: 1px solid #f2f2f2;
font-size: 14px;
border-bottom: 1px solid #d0d0d0;
display: flex;
display: -webkit-flex;
.list_left {
width: 35%;
// margin-left: 3%;
height: 50px;
font-family: "微软雅黑";
font-size: 14px;
color: #636363;
line-height: 50px;
// float: left;
}
.list_right {
// width: auto;
// margin-right: 3%;
height: 50px;
color: #636363;
line-height: 50px;
// float: right;
}
.edit {
width: 100%;
// height: 50px;
color: #898989;
font-family: "微软雅黑";
font-size: 14px;
border: none;
}
.list_left2 {
width: 97%;
margin-left: 3%;
height: 50px;
font-family: "微软雅黑";
font-size: 14px;
color: #636363;
line-height: 50px;
// float: left;
}
}
.uppic {
height: 100%;
width: 100%;
margin: 0 auto;
opacity: 0;
z-index: 1000;
position: absolute;
}
.pic {
width: 100%;
height: 100%;
position: absolute;
}
.bus-license {
width: 140px;
height: 100px;
margin: 10px auto;
border: 1px solid #b2b2b2;
border-radius: 8px;
position: relative;
}
.next_step {
width: 120px;
height: 30px;
border-radius: 15px;
background-color: #999999;
color: #ffffff;
margin-top: 50px;
}
}
}
// iPhoneX适配
@media (device-width: 375px) and (device-height: 812px) and (-webkit-min-device-pixel-ratio: 3) {
.platform-ios {
#home {
}
}
}
// iPhoneX Max适配
@media (device-width: 414px) and (device-height: 896px) {
.platform-ios {
.platform-ios {
#home {
}
}
}
}
</style>
<template>
<h-view class="public-style personalRegister" title="个人用户注册">
<h-content>
<list-item class="personalInf" style="padding:20px;height:100%">
<div style="height:40px;border-bottom:1px solid #d0d0d0">
<div
class="personalInf-text"
style=" width: 150px;line-height: 30px;text-align: center;border-radius: 5px;background-color: #ddd;"
>个人信息</div>
</div>
<item style="border-bottom:1px solid #d0d0d0">
<section slot="name">
<img
src="../../../assets/userRegister/people-name.png"
style="float:left;width:20px;height:20px;margin: 2px 5px 0 0;"
/>姓名
</section>
<input
slot="content"
v-model="personName"
style="text-align: left;"
readonly
/>
</item>
<item style="border-bottom:1px solid #d0d0d0">
<section slot="name">
<img
src="../../../assets/userRegister/idCard.png"
style="float:left;width:20px;height:20px;margin: 2px 5px 0 0;"
/>身份证号
</section>
<input
slot="content"
v-model="identificationNumber"
style="text-align: left;"
readonly
/>
</item>
<item style="border-bottom:1px solid #d0d0d0">
<section slot="name">
<img
src="../../../assets/userRegister/phone.png"
style="float:left;width:20px;height:20px;margin: 2px 5px 0 0;"
/>手机号码
</section>
<input
slot="content"
v-model="phoneNumber"
style="text-align: left;"
readonly
/>
</item>
<!-- <div style="margin: 40px 0 0 14px;">
<p>请上传身份证照片</p>
</div> -->
<div style="height:100px;margin-top:30px">
<div
style="border:1px solid #b2b2b2;width:140px;height:100%;margin:0 auto;border-radius:5px;position:relative;"
>
<img :src="cardUp" alt class="pic" @click="previewImage()" />
</div>
</div>
<p style="margin-top:10px;text-align:center;">正面</p>
<button
@click="logout()"
style="width:120px;height:30px;border-radius:15px;background-color:#09bb07;color:#FFFFFF;margin:70px 0 0 -60px;position:relative;left:50%;"
>注销</button>
</list-item>
</h-content>
</h-view>
</template>
<script>
import { getUrlParam } from "@/scripts/utils";
export default {
data() {
return {
cardUp: "../../../assets/userRegister/camear.png", //身份证正面url
identificationNumber: "",
phoneNumber: "",
personName: "",
attchmentId: "" //附件预览id
};
},
components: {},
activated: function() {},
updated: function() {},
methods: {
//预览图片
previewImage() {
let vm = this;
hlsPopup.showBigPicture({
imgUrl: vm.cardUp
});
},
logout() {
let vm = this;
let url = process.env.rootPath + "/accounts/outerAccounts/delete";
let param = {
openId: window.localStorage.openId
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, param).then(function(res) {
vm.hlsPopup.hideLoading();
if (res.code == 0) {
vm.$vux.toast.text(res.message, "middle");
window.open(
"http://sign.hitachics.com/www/#/UserRegister",
"_self"
);
} else {
vm.$vux.toast.text(res.message, "middle");
}
// vm.$vux.toast.text(res.message, "middle");
});
},
// 调用微信接口的基础配置
wxConfig() {
let clientUrl = "";
let u = navigator.userAgent;
let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; //g
let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
//这个是安卓操作系统
console.log("机型:android");
clientUrl = location.href;
}
if (isIOS) {
//这个是ios操作系统
console.log("机型:ios");
clientUrl = location.href.split("#")[0];
}
// let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
let url = process.env.basePathRl + "getSignature";
let param = {
apiKey: "handexinxi",
url: clientUrl
};
hlsHttp.post(url, param).then(function(res) {
wx.config({
beta: true,
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.result.appId, // 必填,公众号的唯一标识
timestamp: res.result.timestamp, // 必填,生成签名的时间戳
nonceStr: res.result.nonceStr, // 必填,生成签名的随机串
signature: res.result.signature, // 必填,签名,见附录1
jsApiList: [
"chooseImage",
"previewImage",
"downloadImage",
"getLocalImgData",
"uploadImage",
"hideOptionMenu"
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.ready(function () {
wx.hideOptionMenu();
})
});
},
},
created() {
this.wxConfig();
var data = this.$route.params.userInfo;
this.personName = data.name;
this.cardUp =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
data.attachmentId +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
this.phoneNumber = data.mobile;
this.identificationNumber = data.idNo;
}
};
</script>
<style lang="less" type="text/less" scoped>
@import "../../../styles/vue-1px.less";
.personalRegister {
font-size: 14px;
.personalInfo {
width: 100%;
height: 100% !important;
}
.uppic {
height: 100%;
width: 100%;
margin: 0 auto;
opacity: 0;
z-index: 1000;
position: absolute;
}
.pic {
width: 100%;
height: 100%;
position: absolute;
}
}
// iPhoneX适配
@media (device-width: 375px) and (device-height: 812px) and (-webkit-min-device-pixel-ratio: 3) {
.platform-ios {
#home {
}
}
}
// iPhoneX Max适配
@media (device-width: 414px) and (device-height: 896px) {
.platform-ios {
.platform-ios {
#home {
}
}
}
}
</style>
<template>
<div class="uploadCont">
<ul class="showImage">
<li @click="chooseImage">
<img src />
</li>
<li
@click="previewImage(saveImages.previewImageList[index])"
v-for="(item,index) in saveImages.previewThumbList"
:key="index"
>
<img :src="item" />
<button @click.stop @click="remove(index)"></button>
</li>
</ul>
</div>
</template>
<script>
export default {
data() {
return {
userCode: localStorage.userCode || "", //用户code
images: {
localId: [], //已选择的本地图片
serverId: [] //微信服务器返回的mediaId
},
saveImages: {
previewImageList: [], //预览大图数组,
previewThumbList: [], //预览缩略图数组
saveImageList: [] //预览大图数组//保存图片
},
uploadPath: "" //图片上传的路径:为空时,默认下载到当前项目的/mcupload路径下
};
},
methods: {
/**
* 选择图片
*/
chooseImage() {
let _this = this;
wx.chooseImage({
success: function(res) {
//res.localIds 是一个数组 保存了用户一次性选择的所有图片的信息
_this.images.localId = res.localIds; //把图片的路径保存在images[localId]中--图片本地的id信息,用于上传图片到微信浏览器时使用
//alert('已选择 ' + res.localIds.length + '张图片 ');
//===上传
let length = res.localIds.length;
if (length == 0) {
_this.$alert("请选择图片");
return;
}
var i = 0;
_this.images.serverId = [];
function upload() {
wx.uploadImage({
localId: _this.images.localId[i],
success: function(res) {
i++;
_this.images.serverId.push(res.serverId);
//下载刚刚上传的图片
JssdkService.getMediaByUser(
res.serverId,
_this.uploadPath,
_this.userCode,
function(res) {
// alert(res.substr(45));
var path = res.responseParam1.split("mecwish")[1];
var path_thumb = path.replace(
"/mcupload/",
"/mcupload/_thumb/"
);
if (path != null && path.length != 0) {
_this.saveImages.saveImageList.push(path);
_this.saveImages.previewImageList.push(
window.location.protocol +
"//" +
window.location.host +
"/mecwish" +
path
); //将图片上传的位置
_this.saveImages.previewThumbList.push(
window.location.protocol +
"//" +
window.location.host +
"/mecwish" +
path_thumb
); //将缩略图上传的位置
}
}
);
if (i < length) {
upload();
}
},
fail: function(res) {
alert(JSON.stringify(res));
}
});
_this.$emit("saveImages", _this.saveImages.saveImageList);
}
upload();
}
});
},
//预览图片
previewImage(currentImg) {
let _this = this;
wx.previewImage({
current: currentImg, //当前图片
urls: _this.saveImages.previewImageList
});
},
//删除图片,数据库里没删除
remove(index) {
this.$emit("removed", index);
this.saveImages.saveImageList.splice(index, 1);
this.saveImages.previewImageList.splice(index, 1);
this.saveImages.previewThumbList.splice(index, 1);
}
},
created() {
let _this = this;
let clientUrl = location.href;
// let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
let url = process.env.basePathRl + "getSignature";
let param = {
apiKey: "handexinxi",
url: clientUrl
};
hlsHttp.post(url, param).then(function(res) {
wx.config({
beta: true,
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.result.appId, // 必填,公众号的唯一标识
timestamp: res.result.timestamp, // 必填,生成签名的时间戳
nonceStr: res.result.nonceStr, // 必填,生成签名的随机串
signature: res.result.signature, // 必填,签名,见附录1
jsApiList: [
"chooseImage",
"previewImage",
"downloadImage",
"getLocalImgData",
"uploadImage"
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.error(function(res) {
this.$alert(res.errMsg);
});
});
}
};
</script>
<style scoped>
.uploadCont .showImage {
display: flex;
list-style: none;
flex-wrap: wrap;
margin: 7px 0 5px 10px;
}
.uploadCont .showImage li {
position: relative;
width: 28vw;
height: 28vw;
list-style: none;
/*background: #f00;*/
margin: 5px 2vw 7px 0;
}
.uploadCont .showImage .remove {
z-index: 11;
position: absolute;
top: -14px;
right: -20px;
font-size: 26px;
}
.uploadCont .showImage img {
width: 28vw;
height: 28vw;
}
</style>
\ No newline at end of file
<template>
<div>
<h1>图片上传</h1>
<img :src="imgURL" style="width: 90px;height: 90px" @click="addVipImage()" alt="点击上传图片"/>
</div>
</template>
<script>
export default {
data() {
return {
URL: "",
serverPrefix: "后台获取微信参数的接口地址?url=",
imgURL: "",
defaultUrl:"../../../assets/userRegister/people-name.png",
serverId:""
};
},
methods: {
wxConfig() {
let clientUrl = '';
// let ua = navigator.userAgent.toLowerCase();
let u = navigator.userAgent;
let isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
//这个是安卓操作系统
console.log('机型:android');
clientUrl = location.href
}
if (isIOS) {
  //这个是ios操作系统
console.log('机型:ios');
clientUrl = encodeURIComponent(location.href.split('#')[0]);
}
// let clientUrl = encodeURIComponent(location.href);
// let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
let url = process.env.basePathRl + "getSignature";
let param = {
apiKey: "handexinxi",
url: clientUrl
};
hlsHttp.post(url, param).then(function(res) {
wx.config({
beta: true,
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.result.appId, // 必填,公众号的唯一标识
timestamp: res.result.timestamp, // 必填,生成签名的时间戳
nonceStr: res.result.nonceStr, // 必填,生成签名的随机串
signature: res.result.signature, // 必填,签名,见附录1
jsApiList: [
"chooseImage",
"previewImage",
"downloadImage",
"getLocalImgData",
"uploadImage"
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
});
},
addVipImage: function() {
console.log("11111111");
let self = this;
wx.chooseImage({
count: 1, //张数, 默认9
sizeType: ["compressed"], //建议压缩图
sourceType: ["album", "camera"], // 来源是相册、相机
success: function(res) {
self.imgURL = res.localIds[0];
self.uploadToWeixinServer(res.localIds[0]);
}
});
},
//预览图片
previewImage(currentImg) {
let _this = this;
wx.previewImage({
current: currentImg, //当前图片
urls: _this.saveImages.previewImageList
});
},
//删除图片,数据库里没删除
// remove(index) {
// this.$emit("removed", index);
// this.saveImages.saveImageList.splice(index, 1);
// this.saveImages.previewImageList.splice(index, 1);
// this.saveImages.previewThumbList.splice(index, 1);
// },
uploadToWeixinServer(localId) {
let self = this;
wx.uploadImage({
localId: localId,
isShowProgressTips: 1, // 默认为1,显示进度提示
success: function(res) {
//res.serverId 返回图片的微信服务器端ID
console.log('上传图片后返回的信息',res)
self.serverId = res.serverId;
}
});
}
},
created() {
this.wxConfig();
}
};
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<h-view class="public-style userRegister" title="用户注册">
<h-content>
<list-item class="reg-content">
<div class="reg-entry">
<div
style="margin-right:10px"
:class="['item-entry',{'add-bg-color':isClick1}]"
@click="goPersonalPage()"
>
<img src="../../../assets/userRegister/people.png" v-show="isHighLight" />
<img src="../../../assets/userRegister/people-light.png" v-show="!isHighLight" />
<span class="text-entry">个人</span>
</div>
<div :class="['item-entry',{'add-bg-color':isClick2}]" @click="goCompanyPage()">
<img src="../../../assets/userRegister/company.png" v-show="isHighLight1" />
<img src="../../../assets/userRegister/company-light.png" v-show="!isHighLight1" />
<span class="text-entry">企业</span>
</div>
</div>
<div class="tips">
<p class="tips-item">
<img src="../../../assets/userRegister/tips.png" alt />
<span>温馨提示:</span>
</p>
<p class="tips-item">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您可选择用户类型进行用户信息注册及实名认证。</p>
</div>
</list-item>
<!-- <div @click="goJump()">测试跳转</div> -->
</h-content>
</h-view>
</template>
<script>
import { getUrlParam } from "@/scripts/utils";
export default {
data() {
return {
isClick1: false,
isClick2: false,
isHighLight: true,
isHighLight1: true,
isReadOnlyPersonal: true,
isReadOnlyCompany: false,
userInfo: null,
userInfo1: null,
ctitype: ""
};
},
components: {},
activated: function() {
// console.log(1111111111111111111111)
// if (window.localStorage.openId) {
// this.getUserInfo('1111');
// };
},
created() {
this.wxConfig();
if (window.localStorage.openId) {
this.getUserInfo();
}
},
updated: function() {},
methods: {
// 获取token
// getToken() {
// let vm = this;
// let url = process.env.loginPathRl + "admin";
// let param = {};
// return vm.hlsHttp.post(url, param).then(function(res) {
// window.localStorage.setItem("access_token_rl", res.access_token);
// });
// },
// 获取openId
// getOpenId(code) {
// let vm = this;
// let url = process.env.basePathRl + "getOpenId";
// let param = {
// apiKey: "handexinxi",
// code: code
// };
// vm.hlsHttp.post(url, param).then(function(res) {
// // console.log(1111111)
// // window.localStorage.openId = "oBdoRwI9gj9Brbe9iqlDCg5G2dDc";
// // window.localStorage.openId = "oBdoRwFp6UN_KzchaPIEPynR9poM"
// // if(window.localStorage.openId){
// // vm.getUserInfo();
// // }
// if (res.resultCode == "00") {
// window.localStorage.openId = res.result;
// if (window.localStorage.openId) {
// vm.getUserInfo();
// }
// } else {
// return;
// }
// });
// },
goPersonalPage() {
this.isClick1 = true;
this.isClick2 = false;
this.isHighLight = false;
this.isHighLight1 = true;
// console.log('hddhhshshshsh',this.isReadOnlyPersonal)
if (this.ctitype) {
if (this.ctitype == 1) {
if (this.isReadOnlyPersonal) {
this.$router.push({
name: "ReadonlyPersonalReg",
params: {
userInfo: this.userInfo
}
});
} else {
this.$router.push({
name: "PersonalRegister",
params: {
userInfo: this.userInfo
}
});
}
} else if (this.ctitype == null) {
this.$router.push({
name: "PersonalRegister",
params: {
userInfo: this.userInfo
}
});
} else {
return;
}
} else {
this.$router.push({
name: "PersonalRegister"
});
}
},
goCompanyPage() {
this.isClick2 = true;
this.isClick1 = false;
this.isHighLight1 = false;
this.isHighLight = true;
if (this.ctitype) {
if (this.ctitype == 2) {
if (this.isReadOnlyCompany) {
this.$router.push({
name: "ReadonlyCompanyReg",
params: {
userInfo: this.userInfo1
}
});
} else {
this.$router.push({
name: "CompanyRegister"
});
}
} else if (this.ctitype == null) {
this.$router.push({
name: "CompanyRegister"
});
} else {
return;
}
} else {
this.$router.push({
name: "CompanyRegister"
});
}
},
getUserInfo() {
let vm = this;
let url =
process.env.rootPath +
"/sign/info/hclc/query/by/openid?openId=" +
window.localStorage.openId;
vm.hlsPopup.showLoading("请稍等");
vm.$post(url).then(function(res) {
vm.hlsPopup.hideLoading();
if (res.rows) {
if (res.rows.length > 0) {
console.log(res.rows);
var results = res.rows[0];
vm.ctitype = results.ctitype;
if (results.ctitype == 1) {
vm.userInfo = results;
} else if (results.ctitype == 2) {
vm.userInfo1 = results;
}
if (results.ctitype == 1 && results.faceAuthStatus == "SUCCESS") {
vm.isReadOnlyPersonal = true;
} else if (
results.ctitype == 2 &&
results.faceAuthStatus == "SUCCESS" &&
results.orgAuthStatus == "SUCCESS"
) {
vm.isReadOnlyCompany = true;
} else {
return;
}
}
}
});
},
// 调用微信接口的基础配置
wxConfig() {
let clientUrl = "";
let u = navigator.userAgent;
let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; //g
let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
//这个是安卓操作系统
console.log("机型:android");
clientUrl = location.href;
}
if (isIOS) {
//这个是ios操作系统
console.log("机型:ios");
clientUrl = location.href.split("#")[0];
}
// let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
let url = process.env.basePathRl + "getSignature";
let param = {
apiKey: "handexinxi",
url: clientUrl
};
hlsHttp.post(url, param).then(function(res) {
wx.config({
beta: true,
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.result.appId, // 必填,公众号的唯一标识
timestamp: res.result.timestamp, // 必填,生成签名的时间戳
nonceStr: res.result.nonceStr, // 必填,生成签名的随机串
signature: res.result.signature, // 必填,签名,见附录1
jsApiList: [
"chooseImage",
"previewImage",
"downloadImage",
"getLocalImgData",
"uploadImage",
"hideOptionMenu"
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.ready(function() {
wx.hideOptionMenu();
});
});
}
}
};
</script>
<style lang="less" type="text/less">
@import "../../../styles/vue-1px.less";
.userRegister {
.reg-content {
padding: 20px;
padding-top: 150px;
.reg-entry {
display: -webkit-flex;
display: flex;
.add-bg-color {
background-color: #999999;
color: #fffff !important;
}
.item-entry {
width: 50%;
border: 1px solid #ddd;
position: relative;
border-radius: 5px;
img {
width: 50px;
height: 50px;
margin: 10px;
}
.text-entry {
position: absolute;
top: 30px;
right: 30%;
}
}
}
.tips {
margin-top: 70px;
margin-left: 30px;
color: #999999;
font-size: 12px;
.tips-item {
line-height: 24px;
}
img {
width: 22px;
height: 22px;
margin-right: 15px;
}
}
}
}
// iPhoneX适配
@media (device-width: 375px) and (device-height: 812px) and (-webkit-min-device-pixel-ratio: 3) {
.platform-ios {
#home {
}
}
}
// iPhoneX Max适配
@media (device-width: 414px) and (device-height: 896px) {
.platform-ios {
.platform-ios {
#home {
}
}
}
}
</style>
export default { export default {
bannerList: [ bannerList: [{
{ pictureUrl: require('../assets/image/home/bannerWrap@2x.png'),
pictureUrl: require('../assets/image/home/bannerWrap@2x.png'),
},
{
pictureUrl: require('../assets/image/home/bannerWrap2@2x.png'),
},
],
recommendList: [// 为你推荐图片数组
{
recommendUrl: require('../assets/image/home/recommendOne@2x.png'),
},
{
recommendUrl: require('../assets/image/home/recommendTwo@2x.png'),
},
],
moduleSeparateList: [
{
'moduleId': 1,
'moduleCode': 'PARTNER',
'moduleName': '商业伙伴',
'moduleIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/partner@2x.png',
'roleId': 1,
'roleCode': 'ADMIN',
'roleName': '管理员',
'functions': [
{
'functionId': 1,
'functionCode': '110',
'functionName': '客户创建',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/customerCreate@2x.png',
'functionState': 'PartnerCreate',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
},
{
'functionId': 2,
'functionCode': '120',
'functionName': '客户维护',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/customerMaintain@2x.png',
'functionState': 'PartnerList',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
},
],
},
{
'moduleId': 2,
'moduleCode': 'PROJECT',
'moduleName': '项目申请',
'moduleIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/project@2x.png',
'roleId': 1,
'roleCode': 'ADMIN',
'roleName': '管理员',
'functions': [
{
'functionId': 3,
'functionCode': '210',
'functionName': '融资试算',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/finaning-main@2x.png',
'functionState': 'CalculationEnter',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
},
{
'functionId': 4,
'functionCode': '100',
'functionName': '租赁申请',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/applyCreate@2x.png',
'functionState': 'PrjCreate',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
}, },
{ {
'functionId': 5, pictureUrl: require('../assets/image/home/bannerWrap2@2x.png'),
'functionCode': '130',
'functionName': '申请维护',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/applyMaintain@2x.png',
'functionState': 'PrjMaintenList',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
}, },
], ],
}, recommendList: [ // 为你推荐图片数组
{
'moduleId': 3,
'moduleCode': 'CONTRACT',
'moduleName': '合同模块',
'moduleIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/contract@2x.png',
'roleId': 1,
'roleCode': 'ADMIN',
'roleName': '管理员',
'functions': [
{ {
'functionId': 6, recommendUrl: require('../assets/image/home/recommendOne@2x.png'),
'functionCode': '400',
'functionName': '合同维护',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/contractMaintain@2x.png',
'functionState': 'ContractMaintenList',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
}, },
{ {
'functionId': 7, recommendUrl: require('../assets/image/home/recommendTwo@2x.png'),
'functionCode': '410',
'functionName': '合同签约',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/contractSign@2x.png',
'functionState': 'ContractSignList',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
}, },
],
moduleSeparateList: [
// {
// 'moduleId': 1,
// 'moduleCode': 'PARTNER',
// 'moduleName': '商业伙伴',
// 'moduleIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/partner@2x.png',
// 'roleId': 1,
// 'roleCode': 'ADMIN',
// 'roleName': '管理员',
// 'functions': [{
// 'functionId': 1,
// 'functionCode': '110',
// 'functionName': '客户创建',
// 'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/customerCreate@2x.png',
// 'functionState': 'UploadImg',
// 'prodFlag': 'Y',
// 'enableFlag': 'Y',
// 'functionType': 'local',
// 'target': null,
// 'applicationFlag': 'N',
// 'appCode': 'HLS_APP',
// },
// {
// 'functionId': 2,
// 'functionCode': '120',
// 'functionName': '客户维护',
// 'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/customerMaintain@2x.png',
// 'functionState': 'UploadImage',
// 'prodFlag': 'Y',
// 'enableFlag': 'Y',
// 'functionType': 'local',
// 'target': null,
// 'applicationFlag': 'N',
// 'appCode': 'HLS_APP',
// },
// ],
// },
// {
// 'moduleId': 2,
// 'moduleCode': 'PROJECT',
// 'moduleName': '项目申请',
// 'moduleIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/project@2x.png',
// 'roleId': 1,
// 'roleCode': 'ADMIN',
// 'roleName': '管理员',
// 'functions': [{
// 'functionId': 3,
// 'functionCode': '210',
// 'functionName': '融资试算',
// 'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/finaning-main@2x.png',
// 'functionState': 'CalculationEnter',
// 'prodFlag': 'Y',
// 'enableFlag': 'Y',
// 'functionType': 'local',
// 'target': null,
// 'applicationFlag': 'N',
// 'appCode': 'HLS_APP',
// },
// {
// 'functionId': 4,
// 'functionCode': '100',
// 'functionName': '租赁申请',
// 'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/applyCreate@2x.png',
// 'functionState': 'PrjCreate',
// 'prodFlag': 'Y',
// 'enableFlag': 'Y',
// 'functionType': 'local',
// 'target': null,
// 'applicationFlag': 'N',
// 'appCode': 'HLS_APP',
// },
// {
// 'functionId': 5,
// 'functionCode': '130',
// 'functionName': '申请维护',
// 'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/applyMaintain@2x.png',
// 'functionState': 'PrjMaintenList',
// 'prodFlag': 'Y',
// 'enableFlag': 'Y',
// 'functionType': 'local',
// 'target': null,
// 'applicationFlag': 'N',
// 'appCode': 'HLS_APP',
// },
// ],
// },
// {
// 'moduleId': 3,
// 'moduleCode': 'CONTRACT',
// 'moduleName': '合同模块',
// 'moduleIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/contract@2x.png',
// 'roleId': 1,
// 'roleCode': 'ADMIN',
// 'roleName': '管理员',
// 'functions': [{
// 'functionId': 6,
// 'functionCode': '400',
// 'functionName': '合同维护',
// 'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/contractMaintain@2x.png',
// 'functionState': 'ContractMaintenList',
// 'prodFlag': 'Y',
// 'enableFlag': 'Y',
// 'functionType': 'local',
// 'target': null,
// 'applicationFlag': 'N',
// 'appCode': 'HLS_APP',
// },
// {
// 'functionId': 7,
// 'functionCode': '410',
// 'functionName': '合同签约',
// 'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/contractSign@2x.png',
// 'functionState': 'ContractSignList',
// 'prodFlag': 'Y',
// 'enableFlag': 'Y',
// 'functionType': 'local',
// 'target': null,
// 'applicationFlag': 'N',
// 'appCode': 'HLS_APP',
// },
// {
// 'functionId': 44,
// 'functionCode': '420',
// 'functionName': '电子签章',
// 'functionIcon': require('@/assets/home-manager/esign.jpg'),
// 'functionState': 'Esign',
// 'prodFlag': 'Y',
// 'enableFlag': 'Y',
// 'functionType': 'local',
// 'target': null,
// 'applicationFlag': 'N',
// 'appCode': 'HLS_APP',
// },
// ],
// },
{ {
'functionId': 44, 'moduleId': 4,
'functionCode': '420', 'moduleCode': 'PERSONAL',
'functionName': '电子签章', 'moduleName': '个人办公',
'functionIcon': require('@/assets/home-manager/esign.jpg'), 'moduleIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/personWork@2x.png',
'functionState': 'Esign', 'roleId': 1,
'prodFlag': 'Y', 'roleCode': 'ADMIN',
'enableFlag': 'Y', 'roleName': '管理员',
'functionType': 'local', 'functions': [
'target': null, // {
'applicationFlag': 'N', // 'functionId': 8,
'appCode': 'HLS_APP', // 'functionCode': '160',
}, // 'functionName': '工作流',
], // 'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/workflow@2x.png',
}, // 'functionState': 'WorkflowList',
{ // 'prodFlag': 'Y',
'moduleId': 4, // 'enableFlag': 'Y',
'moduleCode': 'PERSONAL', // 'functionType': 'local',
'moduleName': '个人办公', // 'target': null,
'moduleIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/personWork@2x.png', // 'applicationFlag': 'N',
'roleId': 1, // 'appCode': 'HLS_APP',
'roleCode': 'ADMIN', // },
'roleName': '管理员', // {
'functions': [ // 'functionId': 9,
{ // 'functionCode': '170',
'functionId': 8, // 'functionName': 'OCR',
'functionCode': '160', // 'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/ocr.png',
'functionName': '工作流', // 'functionState': 'OcrIdentify',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/workflow@2x.png', // 'prodFlag': 'Y',
'functionState': 'WorkflowList', // 'enableFlag': 'Y',
'prodFlag': 'Y', // 'functionType': 'local',
'enableFlag': 'Y', // 'target': null,
'functionType': 'local', // 'applicationFlag': 'N',
'target': null, // 'appCode': 'HLS_APP',
'applicationFlag': 'N', // },
'appCode': 'HLS_APP', /* {
}, 'functionId': 43,
{ 'functionCode': '220',
'functionId': 9, 'functionName': 'Time',
'functionCode': '170', 'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/time@2x.png',
'functionName': 'OCR', 'functionState': 'tab.time-task',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/ocr.png', 'prodFlag': 'Y',
'functionState': 'OcrIdentify', 'enableFlag': 'Y',
'prodFlag': 'Y', 'functionType': 'local',
'enableFlag': 'Y', 'target': null,
'functionType': 'local', 'applicationFlag': 'N',
'target': null, 'appCode': 'HLS_APP',
'applicationFlag': 'N', }, */
'appCode': 'HLS_APP', // {
// 'functionId': 45,
// 'functionCode': '240',
// 'functionName': '报表',
// 'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/chats@2x.png',
// 'functionState': 'Reports',
// 'prodFlag': 'Y',
// 'enableFlag': 'Y',
// 'functionType': 'local',
// 'target': null,
// 'applicationFlag': 'N',
// 'appCode': 'HLS_APP',
// },
// {
// 'functionId': 46,
// 'functionCode': '250',
// 'functionName': '启信宝',
// 'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/qixinbao.png',
// 'functionState': 'QiXinBao',
// 'prodFlag': 'Y',
// 'enableFlag': 'Y',
// 'functionType': 'local',
// 'target': null,
// 'applicationFlag': 'N',
// 'appCode': 'HLS_APP',
// },
// {
// 'functionId': 47,
// 'functionCode': '260',
// 'functionName': '风报',
// 'functionIcon': require('@/assets/home-manager/riskTorm.jpg'),
// 'functionState': 'RiskHome',
// 'prodFlag': 'Y',
// 'enableFlag': 'Y',
// 'functionType': 'local',
// 'target': null,
// 'applicationFlag': 'N',
// 'appCode': 'HLS_APP',
// },
// {
// 'functionId': 48,
// 'functionCode': '270',
// 'functionName': '小易',
// 'functionIcon': require('@/assets/home-manager/robot.png'),
// 'functionState': 'Robot',
// 'prodFlag': 'Y',
// 'enableFlag': 'Y',
// 'functionType': 'local',
// 'target': null,
// 'applicationFlag': 'N',
// 'appCode': 'HLS_APP',
// },
{
'functionId': 49,
'functionCode': '430',
'functionName': '用户注册',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/customerMaintain@2x.png',
'functionState': 'UserRegister',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
},
{
'functionId': 50,
'functionCode': '450',
'functionName': '电子签约',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/contractSign@2x.png',
'functionState': 'ElectronicContract',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
},
{
'functionId': 55,
'functionCode': '460',
'functionName': '电子合同下载',
'functionIcon': require('@/assets/home-manager/esign.jpg'),
'functionState': 'ContractDownload',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
}
],
}, },
/* { /* {
'functionId': 43, 'moduleId': 5,
'functionCode': '220', 'moduleCode': 'PAYMENT',
'functionName': 'Time', 'moduleName': '付款管理',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/time@2x.png', 'moduleIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/payment@2x.png',
'functionState': 'tab.time-task', 'roleId': 1,
'prodFlag': 'Y', 'roleCode': 'ADMIN',
'enableFlag': 'Y', 'roleName': '管理员',
'functionType': 'local', 'functions': [
'target': null, {
'applicationFlag': 'N', 'functionId': 10,
'appCode': 'HLS_APP', 'functionCode': '180',
'functionName': '付款创建',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/payment-create@2x.png',
'functionState': 'tab.payment-apply',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
},
{
'functionId': 11,
'functionCode': '190',
'functionName': '付款维护',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/payment-modify@2x.png',
'functionState': 'tab.payment-modify',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
},
{
'functionId': 12,
'functionCode': '200',
'functionName': '付款支付',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/payment-pay@2x.png',
'functionState': 'tab.payment-pay',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
},
],
}, */ }, */
{ ],
'functionId': 45, }
'functionCode': '240', \ No newline at end of file
'functionName': '报表',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/chats@2x.png',
'functionState': 'Reports',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
},
{
'functionId': 46,
'functionCode': '250',
'functionName': '启信宝',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/qixinbao.png',
'functionState': 'QiXinBao',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
},
{
'functionId': 47,
'functionCode': '260',
'functionName': '风报',
'functionIcon': require('@/assets/home-manager/riskTorm.jpg'),
'functionState': 'RiskHome',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
},
{
'functionId': 48,
'functionCode': '270',
'functionName': '小易',
'functionIcon': require('@/assets/home-manager/robot.png'),
'functionState': 'Robot',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
},
],
},
/* {
'moduleId': 5,
'moduleCode': 'PAYMENT',
'moduleName': '付款管理',
'moduleIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/payment@2x.png',
'roleId': 1,
'roleCode': 'ADMIN',
'roleName': '管理员',
'functions': [
{
'functionId': 10,
'functionCode': '180',
'functionName': '付款创建',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/payment-create@2x.png',
'functionState': 'tab.payment-apply',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
},
{
'functionId': 11,
'functionCode': '190',
'functionName': '付款维护',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/payment-modify@2x.png',
'functionState': 'tab.payment-modify',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
},
{
'functionId': 12,
'functionCode': '200',
'functionName': '付款支付',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/payment-pay@2x.png',
'functionState': 'tab.payment-pay',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
},
],
}, */
],
}
...@@ -418,7 +418,7 @@ export default { ...@@ -418,7 +418,7 @@ export default {
hlsPopup.showSuccess('操作成功') hlsPopup.showSuccess('操作成功')
}, },
showError () { showError () {
hlsPopup.showError('操作失败') // hlsPopup.showError('操作失败')
}, },
showConfirm () { showConfirm () {
hlsPopup.showConfirm({ hlsPopup.showConfirm({
......
<template> <template>
<h-view id="home" class="public-style" title="车租易"> <h-view id="home" class="public-style" title="电子签">
<h-content class="content scroll-content"> <h-content class="content scroll-content">
<div class="top-box"> <div class="top-box">
<header class="header"> <!-- <header class="header">
<input v-model="searchInput" placeholder="请输入功能名"> <input v-model="searchInput" placeholder="请输入功能名">
<img src="../assets/image/home/functionList@2x.png" @click="search"> <img src="../assets/image/home/functionList@2x.png" @click="search">
</header> </header> -->
<swipe :interval="5000" :showIndicators="false" class="swipe"> <!-- <swipe :interval="5000" :showIndicators="false" class="swipe">
<swipe-item v-for="img in imgList" :key="img.pictureUrl"> <swipe-item v-for="img in imgList" :key="img.pictureUrl">
<img :src="img.pictureUrl"> <img :src="img.pictureUrl">
</swipe-item> </swipe-item>
</swipe> </swipe> -->
<div class="function"> <!-- <div class="function">
<function-item <function-item
v-for="item in moduleSeparateList.slice(0,4)" :key="item.moduleId" :functionIcon="item.moduleIcon" v-for="item in moduleSeparateList.slice(0,4)" :key="item.moduleId" :functionIcon="item.moduleIcon"
:functionName="item.moduleName" :functionName="item.moduleName"
:data="item" @clickFunction="goModuleFunction"/> :data="item" @clickFunction="goModuleFunction"/> -->
<!--<function-item :functionIcon="require('../assets/image/home/allFunction@2x.png')" :functionName="'全部'" @clickFunction="goAllFunction"/>--> <!--<function-item :functionIcon="require('../assets/image/home/allFunction@2x.png')" :functionName="'全部'" @clickFunction="goAllFunction"/>-->
</div> <!-- </div> -->
</div> </div>
<div class="middle-box"> <div class="middle-box">
<header>常用应用</header> <header>常用应用</header>
<div class="function"> <div class="function">
<function-item <function-item
v-for="item in functionList" :key="item.functionId" :functionIcon="item.functionIcon" v-for="item in functionList" :key="item.functionId" :functionIcon="item.functionIcon"
:functionName="item.functionName" :functionName="item.functionName" style="width:33.3%"
:data="item" class="function-item vue-1px" @clickFunction="goFunctionHome"/> :data="item" class="function-item vue-1px" @clickFunction="goFunctionHome"/>
<!-- <div class="function-item" @click="goAllFunction"> <!-- <div class="function-item" @click="goAllFunction">
<img src="../assets/image/home/functionMore@2x.png"> <img src="../assets/image/home/functionMore@2x.png">
</div>--> </div>-->
</div> </div>
</div> </div>
<div class="important-message"> <!-- <div class="important-message">
<div class="important-message-title">重要消息</div> <div class="important-message-title">重要消息</div>
<div class="important-message-title-icon"> <div class="important-message-title-icon">
<img src="../assets/image/home/messageIcon@2x.png"> <img src="../assets/image/home/messageIcon@2x.png">
...@@ -42,15 +42,15 @@ ...@@ -42,15 +42,15 @@
</ul> </ul>
<ul id="p2"/> <ul id="p2"/>
</div> </div>
</div> </div> -->
<div class="middle-box bottom-box"> <!-- <div class="middle-box bottom-box">
<header>为您推荐<span @click="moreRecommend">更多</span></header> <header>为您推荐<span @click="moreRecommend">更多</span></header>
<div class="function"> <div class="function">
<div v-for="item in recommendList" class="recommend"> <div v-for="item in recommendList" class="recommend">
<img :src="item.recommendUrl"> <img :src="item.recommendUrl">
</div> </div>
</div> </div>
</div> </div> -->
</h-content> </h-content>
</h-view> </h-view>
</template> </template>
...@@ -76,121 +76,147 @@ export default { ...@@ -76,121 +76,147 @@ export default {
beforeCreate: function () { beforeCreate: function () {
}, },
created: function () { created: function () {
debugger; this.wxConfig();
this.goToken() // debugger;
window.localStorage.setItem('user_id', 2009) // window.localStorage.setItem('user_id', 2009)
this.imgList = [...functionState.bannerList] // this.imgList = [...functionState.bannerList]
this.recommendList = [...functionState.recommendList] // this.recommendList = [...functionState.recommendList]
this.moduleSeparateList = [...functionState.moduleSeparateList] this.moduleSeparateList = [...functionState.moduleSeparateList]
this.moduleSeparateList.forEach(item => { this.moduleSeparateList.forEach(item => {
this.functionList = this.functionList.concat(item.functions) this.functionList = this.functionList.concat(item.functions)
}) })
this.hlsSupportToken().then(res => { this.getToken().then(res => {
this.noticeQuery() // this.noticeQuery()
// 注意,此处用户个人信息是写死的user_id 后续项目实施中根据以下代码实时获取企业通讯录个人信息 // 注意,此处用户个人信息是写死的user_id 后续项目实施中根据以下代码实时获取企业通讯录个人信息
/* var code = getUrlParam('code') var code = getUrlParam('code');
this.getWxUserId(code) */ // code = '111';
this.wxConfig() if(code){
this.getOpenId(code);
}
}) })
}, },
updated: function () { updated: function () {
}, },
methods: { methods: {
// 获取中台token // 获取中台token
hlsSupportToken () { // hlsSupportToken () {
let vm = this // let vm = this
let url = process.env.loginPath + 'appadmin' // let url = process.env.loginPath + 'appadmin'
let param = {} // let param = {}
return vm.hlsHttp.post(url, param).then(function (res) { // return vm.hlsHttp.post(url, param).then(function (res) {
window.localStorage.setItem('access_token', res.access_token) // window.localStorage.setItem('access_token', res.access_token)
}) // })
}, // },
noticeQuery () { // noticeQuery () {
let vm = this // let vm = this
let url = process.env.basePath + 'home_msg_query' // let url = process.env.basePath + 'home_msg_query'
let param = { // let param = {
'offsize': 1, // 'offsize': 1,
// }
// vm.$post(url, param).then(function (res) {
// vm.messageList = res.notice_msg_list
// })
// },
// 调用微信接口的基础配置
wxConfig() {
let clientUrl = "";
let u = navigator.userAgent;
let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; //g
let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
//这个是安卓操作系统
console.log("机型:android");
clientUrl = location.href;
} }
vm.$post(url, param).then(function (res) { if (isIOS) {
vm.messageList = res.notice_msg_list //这个是ios操作系统
}) console.log("机型:ios");
}, clientUrl = location.href.split("#")[0];
search () {
let vm = this
let flag = 'N'
if (vm.searchInput) {
for (let i of vm.allFunctionList) {
if (vm.searchInput === i.functionName) {
vm.$router.push({
name: i.functionState,
})
flag = 'Y'
break
}
}
} else {
vm.hlsPopup.showLongCenter('请输入功能名称')
}
if (flag === 'N') {
vm.hlsPopup.showLongCenter('没有此功能')
} }
// let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
let url = process.env.basePathRl + "getSignature";
let param = {
apiKey: "handexinxi",
url: clientUrl
};
hlsHttp.post(url, param).then(function(res) {
wx.config({
beta: true,
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.result.appId, // 必填,公众号的唯一标识
timestamp: res.result.timestamp, // 必填,生成签名的时间戳
nonceStr: res.result.nonceStr, // 必填,生成签名的随机串
signature: res.result.signature, // 必填,签名,见附录1
jsApiList: [
"chooseImage",
"previewImage",
"downloadImage",
"getLocalImgData",
"uploadImage",
"hideOptionMenu"
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.ready(function () {
wx.hideOptionMenu();
})
});
}, },
goModuleFunction (data) { // search () {
this.$router.push({ // let vm = this
name: 'ModuleFunction', // let flag = 'N'
params: { // if (vm.searchInput) {
moduleFunctionList: data, // for (let i of vm.allFunctionList) {
}, // if (vm.searchInput === i.functionName) {
}) // vm.$router.push({
}, // name: i.functionState,
goToken () { // })
// flag = 'Y'
// break
let vm = this // }
let url = process.env.loginPathRl + 'admin' // }
let param = {} // } else {
return vm.hlsHttp.post(url, param).then(function (res) { // vm.hlsPopup.showLongCenter('请输入功能名称')
window.localStorage.setItem('access_token_rl', res.access_token) // }
}) // if (flag === 'N') {
/*let vm = this // vm.hlsPopup.showLongCenter('没有此功能')
this.$router.push({ // }
name: 'HomeManager', // },
params: { // goModuleFunction (data) {
moduleSeparateList: vm.moduleSeparateList, // this.$router.push({
}, // name: 'ModuleFunction',
})*/ // params: {
// moduleFunctionList: data,
// },
// })
// },
getToken () {
let vm = this;
let url = process.env.loginPathRl + "admin";
let param = {};
return vm.hlsHttp.post(url, param).then(function(res) {
window.localStorage.setItem("access_token_rl", res.access_token);
});
}, },
goFunctionHome (data) { goFunctionHome (data) {
this.$router.push({ this.$router.push({
name: data.functionState, name: data.functionState,
}) })
}, },
moreRecommend () { // moreRecommend () {
console.log('go moreRecommend') // console.log('go moreRecommend')
}, // },
getOpenId (code) {
wxConfig () {
let clientUrl = encodeURIComponent(location.href.split('#')[0])
let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
let param = {}
hlsHttp.post(url, param).then(function (res) {
wx.config({
beta: true,
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.appId, // 必填,公众号的唯一标识
timestamp: res.timestamp, // 必填,生成签名的时间戳
nonceStr: res.nonceStr, // 必填,生成签名的随机串
signature: res.signature, // 必填,签名,见附录1
jsApiList: ['chooseImage', 'previewImage', 'downloadImage', 'getLocalImgData', 'uploadImage'], // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
})
})
},
getWxUserId (code) {
let vm = this let vm = this
let url = process.env.rootPath + '/wechat/user/get?code=' + code + '&wxCode=' + $config.wxCode let url = process.env.basePathRl + "getOpenId";
vm.hlsHttp.get(url).then(function (res) { let param = {
// vm.employee_code = res.userId; "apiKey":"handexinxi",
// alert('res ' + JSON.stringify(res)) "code": code
}
// window.localStorage.openId = "1234567"
vm.hlsHttp.post(url,param).then(function (res) {
if (res.resultCode == "00") {
window.localStorage.openId = res.result;
}
}) })
}, },
}, },
...@@ -201,7 +227,7 @@ export default { ...@@ -201,7 +227,7 @@ export default {
#home { #home {
.top-box { .top-box {
height: 264px; // height: 264px;
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
......
...@@ -21,72 +21,188 @@ import PersonAccount from '@/pages/applications/esign/PersonAccount' ...@@ -21,72 +21,188 @@ import PersonAccount from '@/pages/applications/esign/PersonAccount'
import SignPdf from '@/pages/applications/esign/SignPdf' import SignPdf from '@/pages/applications/esign/SignPdf'
import ViewPicture from '@/pages/applications/esign/ViewPicture' import ViewPicture from '@/pages/applications/esign/ViewPicture'
// 用户注册
import UserRegister from '@/pages/applications/userRegisters/userRegister'
// 企业注册
import CompanyRegister from '@/pages/applications/userRegisters/companyRegister'
import ReadonlyCompanyReg from '@/pages/applications/userRegisters/readonlyCompanyReg'
// 个人注册
import PersonalRegister from '@/pages/applications/userRegisters/personalRegister'
import ReadonlyPersonalReg from '@/pages/applications/userRegisters/readonlyPersonalReg'
Vue.use(Router) Vue.use(Router)
// 电子签约
import ElectronicContract from '@/pages/applications/electronicContract/electronicContract'
import ElectronicContractList from '@/pages/applications/electronicContract/electronicContractList'
// 电子合同下载
import ContractDownload from '@/pages/applications/contractDownload/contractDownload'
import ContractDownloadList from '@/pages/applications/contractDownload/contractDownloadList'
// 图片上传微信服务器
import UploadImg from '@/pages/applications/userRegisters/uploadImg'
import UploadImage from '@/pages/applications/userRegisters/uploadImage'
// 全局跳转路由方法 // 全局跳转路由方法
Router.prototype.pushPage = function (param, bool) { Router.prototype.pushPage = function(param, bool) {
debugger debugger
let key = true let key = true
if (bool === undefined) { if (bool === undefined) {
key = true key = true
} else if (bool === true || bool === false) { } else if (bool === true || bool === false) {
key = bool key = bool
} }
this.currentRoute.meta.nextReload = key this.currentRoute.meta.nextReload = key
this.push(param) this.push(param)
} }
export default new Router({ export default new Router({
routes: [ routes: [{
{ path: '/',
path: '/', redirect: to => {
redirect: to => { return { name: 'Home' }
return { name: 'Home' } },
}, },
}, { path: '/home', component: Home, name: 'Home', meta: { keepAlive: false, nextReload: true } },
{ path: '/home', component: Home, name: 'Home', meta: { keepAlive: true, nextReload: true} }, { path: '/ModuleFunction', component: ModuleFunction, name: 'ModuleFunction', meta: { keepAlive: true } },
{ path: '/ModuleFunction', component: ModuleFunction, name: 'ModuleFunction', meta: { keepAlive: true } }, // test工具类
// test工具类 { path: '/hls-popup', component: HlsPopup, name: 'HlsPopup', meta: { keepAlive: false, nextReload: '' } },
{ path: '/hls-popup', component: HlsPopup, name: 'HlsPopup', meta: { keepAlive: false, nextReload: '' } },
// 合同维护与签约
// 合同维护与签约 {
{ path: '/ContractMaintenList',
path: '/ContractMaintenList', component: ContractMaintenList,
component: ContractMaintenList, name: 'ContractMaintenList',
name: 'ContractMaintenList', meta: { keepAlive: false, nextReload: '' },
meta: { keepAlive: false, nextReload: '' }, },
}, {
{ path: '/ContractMainten',
path: '/ContractMainten', component: ContractMainten,
component: ContractMainten, name: 'ContractMainten',
name: 'ContractMainten', meta: { keepAlive: false, nextReload: '' },
meta: { keepAlive: false, nextReload: '' }, },
}, {
{ path: '/ContractSignList',
path: '/ContractSignList', component: ContractSignList,
component: ContractSignList, name: 'ContractSignList',
name: 'ContractSignList', meta: { keepAlive: false, nextReload: '' },
meta: { keepAlive: false, nextReload: '' }, },
}, {
{ path: '/ContractSign',
path: '/ContractSign', component: ContractSign,
component: ContractSign, name: 'ContractSign',
name: 'ContractSign', meta: { keepAlive: false, nextReload: '' },
meta: { keepAlive: false, nextReload: '' }, },
}, { path: '/EsignPicture', component: EsignPicture, name: 'EsignPicture', meta: { keepAlive: false } },
{path: '/EsignPicture', component: EsignPicture, name: 'EsignPicture', meta: {keepAlive: false}}, { path: '/Esign', component: Esign, name: 'Esign', meta: { keepAlive: false } },
{path: '/Esign', component: Esign, name: 'Esign', meta: {keepAlive: false}}, { path: '/BankVerified', component: BankVerified, name: 'BankVerified', meta: { keepAlive: true } },
{path: '/BankVerified', component: BankVerified, name: 'BankVerified', meta: {keepAlive: true}}, { path: '/PersonAccount', component: PersonAccount, name: 'PersonAccount', meta: { keepAlive: true } },
{path: '/PersonAccount', component: PersonAccount, name: 'PersonAccount', meta: {keepAlive: true}}, { path: '/SignPdf', component: SignPdf, name: 'SignPdf', meta: { keepAlive: true } },
{path: '/SignPdf', component: SignPdf, name: 'SignPdf', meta: {keepAlive: true}}, { path: '/ViewPicture', component: ViewPicture, name: 'ViewPicture', meta: { keepAlive: true } },
{path: '/ViewPicture', component: ViewPicture, name: 'ViewPicture', meta: {keepAlive: true}}, {
path: '/UserRegister',
], component: UserRegister,
scrollBehavior (to, from, savedPosition) { name: 'UserRegister',
if (to.hash) { meta: {
return { keepAlive: false
selector: to.hash, }
} },
} {
}, path: '/UserRegister/PersonalRegister',
}) component: PersonalRegister,
name: 'PersonalRegister',
meta: {
keepAlive: false
},
},
{
path: '/UserRegister/ReadonlyPersonalReg',
component: ReadonlyPersonalReg,
name: 'ReadonlyPersonalReg',
meta: {
keepAlive: true
},
},
{
path: '/UserRegister/CompanyRegister',
component: CompanyRegister,
name: 'CompanyRegister',
meta: {
keepAlive: false
},
},
{
path: '/UserRegister/ReadonlyCompanyReg',
component: ReadonlyCompanyReg,
name: 'ReadonlyCompanyReg',
meta: {
keepAlive: true
},
},
// 微信上传图片
{
path: '/UploadImg',
component: UploadImg,
name: 'UploadImg',
meta: {
keepAlive: true
},
},
{
path: '/UploadImage',
component: UploadImage,
name: 'UploadImage',
meta: {
keepAlive: true
},
},
// 电子签约
{
path: '/ElectronicContract',
component: ElectronicContract,
name: 'ElectronicContract',
meta: {
keepAlive: false
},
},
{
path: '/ElectronicContract/ElectronicContractList',
component: ElectronicContractList,
name: 'ElectronicContractList',
meta: {
keepAlive: true
},
},
// 电子合同下载
{
path: '/ContractDownload',
component: ContractDownload,
name: 'ContractDownload',
meta: {
keepAlive: false
},
},
// 电子合同下载
{
path: '/ContractDownload/ContractDownloadList',
component: ContractDownloadList,
name: 'ContractDownloadList',
meta: {
keepAlive: false
},
},
],
scrollBehavior(to, from, savedPosition) {
if (to.hash) {
return {
selector: to.hash,
}
}
},
})
\ No newline at end of file
...@@ -4,163 +4,163 @@ import hlsPopup from './hlsPopup' ...@@ -4,163 +4,163 @@ import hlsPopup from './hlsPopup'
let promiseArr = {} let promiseArr = {}
let cancel = {} let cancel = {}
const CancelToken = axios.CancelToken const CancelToken = axios.CancelToken
// 请求拦截器 // 请求拦截器
axios.interceptors.request.use(config => { axios.interceptors.request.use(config => {
// 发起请求时,取消掉当前正在进行的相同请求 // 发起请求时,取消掉当前正在进行的相同请求
config.cancelToken = new CancelToken(c => { config.cancelToken = new CancelToken(c => {
cancel = c cancel = c
}) })
if (promiseArr[config.url]) { if (promiseArr[config.url]) {
promiseArr[config.url]('操作取消') promiseArr[config.url]()
promiseArr[config.url] = cancel promiseArr[config.url] = cancel
} else { } else {
promiseArr[config.url] = cancel promiseArr[config.url] = cancel
} }
return config return config
}, error => { }, error => {
return Promise.reject(error) return Promise.reject(error)
}) })
// 响应拦截器即异常处理 // 响应拦截器即异常处理
axios.interceptors.response.use(response => { axios.interceptors.response.use(response => {
if ($config.debug) { if ($config.debug) {
let postName = 'post' let postName = 'post'
console.log(postName + ' success') console.log(postName + ' success')
console.log(postName + ' response ' + JSON.stringify(response.data, '', 2)) console.log(postName + ' response ' + JSON.stringify(response.data, '', 2))
console.log(postName + ' End!') console.log(postName + ' End!')
} }
if (response.data.result === 'E' || response.data.code === 'E') { if (response.data.result === 'E' || response.data.code === 'E') {
hlsPopup.hideLoading() hlsPopup.hideLoading()
const err = {} const err = {}
err.message = response.data.message err.message = response.data.message
hlsPopup.showError(err.message) hlsPopup.showError(err.message)
return Promise.resolve(err) return Promise.resolve(err)
} else { } else {
return response.data return response.data
} }
}, err => { }, err => {
if (err && err.response) { if (err && err.response) {
switch (err.response.status) { switch (err.response.status) {
case 400: case 400:
err.message = '错误请求' err.message = '错误请求'
break break
case 401: case 401:
err.message = '登录已失效,请重新登录' err.message = '登录已失效,请重新登录'
break break
case 403: case 403:
err.message = '拒绝访问' err.message = '拒绝访问'
break break
case 404: case 404:
err.message = '请求错误,未找到该资源' err.message = '请求错误,未找到该资源'
break break
case 405: case 405:
err.message = '不支持的请求类型' err.message = '不支持的请求类型'
break break
case 408: case 408:
err.message = '请求超时' err.message = '请求超时'
break break
case 500: case 500:
err.message = '服务器端出错' err.message = '服务器端出错'
break break
case 501: case 501:
err.message = '网络未实现' err.message = '网络未实现'
break break
case 502: case 502:
err.message = '网络错误' err.message = '网络错误'
break break
case 503: case 503:
err.message = '服务不可用' err.message = '服务不可用'
break break
case 504: case 504:
err.message = '网络超时' err.message = '网络超时'
break break
case 505: case 505:
err.message = 'http版本不支持该请求' err.message = 'http版本不支持该请求'
break break
default: default:
err.message = `连接错误${err.response.status}` err.message = `连接错误${err.response.status}`
}
} else {
err.message = '连接到服务器失败'
} }
} else { if (err.response && err.response.status === 401) {
err.message = '连接到服务器失败' hlsPopup.hideLoading()
} hlsPopup.showPopup({
if (err.response && err.response.status === 401) { title: '登录失效,重新登录',
hlsPopup.hideLoading() onConfirm: () => {
hlsPopup.showPopup({
title: '登录失效,重新登录',
onConfirm: () => {
}, },
}) })
} else { } else {
hlsPopup.hideLoading() hlsPopup.hideLoading()
hlsPopup.showError(err.message) hlsPopup.showError(err.message)
} }
return Promise.resolve(err) return Promise.resolve(err)
}) })
axios.defaults.baseURL = '' axios.defaults.baseURL = ''
axios.defaults.timeout = 100000 axios.defaults.timeout = 100000
// get请求 // get请求
export function get (url) { export function get(url) {
let param = {} let param = {}
let headers = {} let headers = {}
if (window.localStorage.access_token) { if (window.localStorage.access_token) {
headers = { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Authorization': 'Bearer ' + window.localStorage.access_token, 'Authorization': 'Bearer ' + window.localStorage.access_token,
}
} else {
headers = {
'Content-Type': 'application/json',
}
} }
} else { if ($config.debug) {
headers = { let postName = 'GET'
'Content-Type': 'application/json', console.log(postName + ' Start!')
console.log(postName + ' url ' + url)
} }
} return new Promise((resolve, reject) => {
if ($config.debug) { axios({
let postName = 'GET' method: 'get',
console.log(postName + ' Start!') url,
console.log(postName + ' url ' + url) headers: headers,
} params: param,
return new Promise((resolve, reject) => { }).then(res => {
axios({ resolve(res)
method: 'get', }).catch(err => {
url, reject(err)
headers: headers, })
params: param,
}).then(res => {
resolve(res)
}).catch(err => {
reject(err)
}) })
})
} }
// post请求 // post请求
export function post (url, param) { export function post(url, param) {
param.user_id = window.localStorage.user_id // param.user_id = window.localStorage.user_id
param.access_token = window.localStorage.access_token // param.access_token = window.localStorage.access_token_rl
let headers = {} let headers = {}
if (window.localStorage.access_token) { if (window.localStorage.access_token_rl) {
headers = { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Authorization': 'Bearer ' + window.localStorage.access_token, 'Authorization': 'Bearer ' + window.localStorage.access_token_rl,
}
} else {
headers = {
'Content-Type': 'application/json',
}
} }
} else { if ($config.debug) {
headers = { let postName = 'POST'
'Content-Type': 'application/json', // console.log(postName + ' Start!')
// console.log(postName + ' url ' + url)
// console.log(postName + ' parameter ' + JSON.stringify(param, '', 2))
} }
} return new Promise((resolve, reject) => {
if ($config.debug) { axios({
let postName = 'POST' method: 'post',
console.log(postName + ' Start!') headers: headers,
console.log(postName + ' url ' + url) url,
console.log(postName + ' parameter ' + JSON.stringify(param, '', 2)) data: param,
} }).then(res => {
return new Promise((resolve, reject) => { resolve(res)
axios({ }).catch(err => {
method: 'post', reject(err)
headers: headers, })
url,
data: param,
}).then(res => {
resolve(res)
}).catch(err => {
reject(err)
}) })
}) }
} \ No newline at end of file
import Vue from 'vue' import Vue from 'vue'
import {ToastPlugin, AlertPlugin, ConfirmPlugin, LoadingPlugin, DatetimePlugin} from 'vux' import { ToastPlugin, AlertPlugin, ConfirmPlugin, LoadingPlugin, DatetimePlugin } from 'vux'
import {ActionSheetPlugin, ShowPicturePlugin, SelectPlugin, NotifyPlugin, NumberKeyboardPlugin} from 'hls-easy-ui' import { ActionSheetPlugin, ShowPicturePlugin, SelectPlugin, NotifyPlugin, NumberKeyboardPlugin } from 'hls-easy-ui'
Vue.use(ToastPlugin) Vue.use(ToastPlugin)
Vue.use(AlertPlugin) Vue.use(AlertPlugin)
Vue.use(ConfirmPlugin) Vue.use(ConfirmPlugin)
...@@ -14,321 +14,321 @@ Vue.use(NotifyPlugin) ...@@ -14,321 +14,321 @@ Vue.use(NotifyPlugin)
export default { export default {
isLoading: false, isLoading: false,
SHOW_TIMES: 2000, SHOW_TIMES: 2000,
IS_SHOW_MASK: true, IS_SHOW_MASK: true,
/** /**
* 锁屏函数 超过10s后自动解屏用于防止屏幕锁死 * 锁屏函数 超过10s后自动解屏用于防止屏幕锁死
* 自动截屏成弹出错误提示框 * 自动截屏成弹出错误提示框
* @param content 锁屏内容 * @param content 锁屏内容
*/ */
showLoading: function (content) { showLoading: function(content) {
let vm = this let vm = this
Vue.$vux.loading.show({ Vue.$vux.loading.show({
text: content || 'Loading', text: content || 'Loading',
}) })
this.isLoading = true this.isLoading = true
// 10s后自动解屏用于防止屏幕锁死 // 10s后自动解屏用于防止屏幕锁死
setTimeout(() => { setTimeout(() => {
if (vm.isLoading) { if (vm.isLoading) {
Vue.$vux.loading.hide()
vm.isLoading = false
}
}, 40000)
},
/**
* 隐藏
*/
hideLoading: function() {
Vue.$vux.loading.hide() Vue.$vux.loading.hide()
vm.isLoading = false this.isLoading = false
} },
}, 40000)
},
/**
* 隐藏
*/
hideLoading: function () {
Vue.$vux.loading.hide()
this.isLoading = false
},
/** /**
* 长时间顶部提示toast * 长时间顶部提示toast
* @param content * @param content
*/ */
showLongTop: function (content) { showLongTop: function(content) {
let vm = this let vm = this
let text = content || '操作失败' let text = content || '操作失败'
Vue.$vux.toast.show({ Vue.$vux.toast.show({
text: text, text: text,
type: 'text', type: 'text',
time: vm.SHOW_TIMES, time: vm.SHOW_TIMES,
isShowMask: vm.IS_SHOW_MASK, isShowMask: vm.IS_SHOW_MASK,
position: 'top', position: 'top',
}) })
}, },
/** /**
* 长时间中部提示toast * 长时间中部提示toast
* @param content * @param content
*/ */
showLongCenter: function (content) { showLongCenter: function(content) {
let vm = this let vm = this
let text = content || '操作失败' let text = content || '操作失败'
Vue.$vux.toast.show({ Vue.$vux.toast.show({
text: text, text: text,
type: 'text', type: 'text',
time: vm.SHOW_TIMES, time: vm.SHOW_TIMES,
isShowMask: vm.IS_SHOW_MASK, isShowMask: vm.IS_SHOW_MASK,
position: 'middle', position: 'middle',
}) })
}, },
/** /**
* 长时间中部提示toast * 长时间中部提示toast
* @param content * @param content
*/ */
showLongBottom: function (content) { showLongBottom: function(content) {
let vm = this let vm = this
let text = content || '操作失败' let text = content || '操作失败'
Vue.$vux.toast.show({ Vue.$vux.toast.show({
text: text, text: text,
time: vm.SHOW_TIMES, time: vm.SHOW_TIMES,
type: 'text', type: 'text',
isShowMask: vm.IS_SHOW_MASK, isShowMask: vm.IS_SHOW_MASK,
position: 'bottom', position: 'bottom',
}) })
}, },
/** /**
* 成功提示框 * 成功提示框
* @param content * @param content
*/ */
showSuccess: function (content) { showSuccess: function(content) {
let vm = this let vm = this
Vue.$vux.toast.show({ Vue.$vux.toast.show({
text: content || '操作成功', text: content || '操作成功',
time: vm.SHOW_TIMES, time: vm.SHOW_TIMES,
isShowMask: vm.IS_SHOW_MASK, isShowMask: vm.IS_SHOW_MASK,
type: 'success', type: 'success',
position: 'middle', position: 'middle',
}) })
}, },
/** /**
* 成功提示框 * 成功提示框
* @param content * @param content
*/ */
showError: function (content) { showError: function(content) {
let vm = this let vm = this
Vue.$vux.toast.show({ Vue.$vux.toast.show({
text: content || '操作失败', text: content || '操作失败',
type: 'warn', type: 'warn',
isShowMask: vm.IS_SHOW_MASK, isShowMask: vm.IS_SHOW_MASK,
time: vm.SHOW_TIMES, time: vm.SHOW_TIMES,
position: 'middle', position: 'middle',
}) })
}, },
/** /**
* 弹出是否确认的窗口 * 弹出是否确认的窗口
* @param confirmObject.title 标题 * @param confirmObject.title 标题
* @param confirmObject.content 内容 * @param confirmObject.content 内容
* @param confirmObject.onConfirm 确定函数 * @param confirmObject.onConfirm 确定函数
*/ */
showConfirm: function (confirmObject) { showConfirm: function(confirmObject) {
let def = { let def = {
title: confirmObject.title || '提示', title: confirmObject.title || '提示',
content: confirmObject.content || '', content: confirmObject.content || '',
confirmText: '确定', confirmText: '确定',
cancelText: '取消', cancelText: '取消',
onConfirm: () => { onConfirm: () => {
confirmObject.onConfirm(1) confirmObject.onConfirm(1)
}, },
onCancel: () => { onCancel: () => {
confirmObject.onConfirm(0) confirmObject.onConfirm(0)
}, },
}
Vue.$vux.confirm.show(def)
},
/*
* 弹出确认的窗口
* @param confirmObject.title 标题
* @param confirmObject.content 内容
* @param confirmObject.onConfirm 确定函数
*
*/
showPopup: function (confirmObject) {
let def = {
title: confirmObject.title || '提示',
content: confirmObject.content || '',
confirmText: '确定',
showCancelButton: false,
onConfirm: () => {
confirmObject.onConfirm()
},
}
Vue.$vux.confirm.show(def)
},
/**
* @param actionObject.titleText 弹出框的标题可空
* @param actionObject.callback 点击按钮的回调函数 回传buttonArray数组下标
* @param actionObject.buttonArray 按钮数组支持[string,string],[object,object],
* 当为后一种是 object为{text:'拍照',type:'primary'},type支持 primary,warn,disabled
*
* {
* titleText: '照片',
* buttonArray: [{text:'拍照',type:'warn'}, {text:'从相册取',type:'primary'}],
* callback: (index) => {
* alert(index);
* }
* }
*
* {
* buttonArray: ['拍照','从相册取'],
* callback: (index) => {
* alert(index);
* }
* }
*
*/
showActionSheet: function (actionObject) {
if (typeof actionObject === 'object') {
let buttons = []
for (let i = 0; i < actionObject.buttonArray.length; i++) {
if (typeof actionObject.buttonArray[i] === 'object') {
buttons.push({
text: actionObject.buttonArray[i].text,
type: actionObject.buttonArray[i].type,
callback: actionObject.callback,
})
} else {
buttons.push({
text: actionObject.buttonArray[i],
callback: actionObject.callback,
})
} }
} Vue.$vux.confirm.show(def)
ActionSheetPlugin.show({ },
title: actionObject.titleText || '', /*
buttons: buttons, * 弹出确认的窗口
}) * @param confirmObject.title 标题
} * @param confirmObject.content 内容
}, * @param confirmObject.onConfirm 确定函数
*
/** */
* 时间选择函数 showPopup: function(confirmObject) {
* @param timeObject.nowDate 当前展示的时间 可不填 let def = {
* @param timeObject.format 时间格式支持不支持秒 title: confirmObject.title || '提示',
* @param timeObject.callback 点击确定的回调函数 content: confirmObject.content || '',
* confirmText: '确定',
*/ showCancelButton: false,
showTime: function (timeObject) { onConfirm: () => {
let date = new Date().format('yyyy-MM-dd') confirmObject.onConfirm()
let format = 'YYYY-MM-DD' },
if (timeObject.nowDate) { }
date = timeObject.nowDate Vue.$vux.confirm.show(def)
} },
if (timeObject.format) { /**
format = timeObject.format * @param actionObject.titleText 弹出框的标题可空
} * @param actionObject.callback 点击按钮的回调函数 回传buttonArray数组下标
Vue.$vux.datetime.show({ * @param actionObject.buttonArray 按钮数组支持[string,string],[object,object],
cancelText: '取消', * 当为后一种是 object为{text:'拍照',type:'primary'},type支持 primary,warn,disabled
confirmText: '确定', *
minYear: '1900', * {
maxYear: '2200', * titleText: '照片',
format: format, * buttonArray: [{text:'拍照',type:'warn'}, {text:'从相册取',type:'primary'}],
value: date, * callback: (index) => {
onConfirm (val) { * alert(index);
timeObject.callback(val) * }
}, * }
}) *
}, * {
/** * buttonArray: ['拍照','从相册取'],
* 图片放大预览 * callback: (index) => {
* @param imgObject.imgUrl * alert(index);
*/ * }
showBigPicture: function (imgObject) { * }
if (typeof imgObject === 'object') { *
ShowPicturePlugin.show({ */
imgUrl: imgObject.imgUrl, showActionSheet: function(actionObject) {
width: imgObject.width, if (typeof actionObject === 'object') {
}) let buttons = []
} for (let i = 0; i < actionObject.buttonArray.length; i++) {
}, if (typeof actionObject.buttonArray[i] === 'object') {
buttons.push({
text: actionObject.buttonArray[i].text,
type: actionObject.buttonArray[i].type,
callback: actionObject.callback,
})
} else {
buttons.push({
text: actionObject.buttonArray[i],
callback: actionObject.callback,
})
}
}
ActionSheetPlugin.show({
title: actionObject.titleText || '',
buttons: buttons,
})
}
},
/** /**
* 下拉框 支持级联操作 需指定 parent 属性 * 时间选择函数
* @param selectOption.list Array [{"code": "NP","code_name": "个人"}] * @param timeObject.nowDate 当前展示的时间 可不填
* @param selectOption.code String "bp_type" * @param timeObject.format 时间格式支持不支持秒
* @param selectOption.object Object 当前数据对象 * @param timeObject.callback 点击确定的回调函数
* @param selectOption.returnItem function 回调函数返回index与object *
* var bp_class_list = [ */
* { showTime: function(timeObject) {
* "code": "NP", let date = new Date().format('yyyy-MM-dd')
* "code_name": "个人" let format = 'YYYY-MM-DD'
* },{ if (timeObject.nowDate) {
* "code": "NP1", date = timeObject.nowDate
* "code_name": "个人1" }
* }]; if (timeObject.format) {
* hlsPopup.selectList({ format = timeObject.format
* list: bp_class_list, }
* code: 'bp_type', Vue.$vux.datetime.show({
* object: {}, cancelText: '取消',
* returnItem: function (index, obj) { confirmText: '确定',
* console.log(obj) minYear: '1900',
* } maxYear: '2200',
* }) format: format,
* value: date,
*/ onConfirm(val) {
selectList: function (selectOption) { timeObject.callback(val)
if (typeof selectOption === 'object') { },
let list = []
let length = selectOption.list.length
vum.forEach(selectOption.list, function (date, index, array) {
list.push({
value: date.code,
name: date.code_name,
parent: date.parent,
}) })
if (index === (length - 1)) { },
SelectPlugin.show({ /**
list: list, * 图片放大预览
callBack: selectOption.returnItem, * @param imgObject.imgUrl
code: selectOption.code, */
object: selectOption.object, showBigPicture: function(imgObject) {
}) if (typeof imgObject === 'object') {
ShowPicturePlugin.show({
imgUrl: imgObject.imgUrl,
width: imgObject.width,
})
}
},
/**
* 下拉框 支持级联操作 需指定 parent 属性
* @param selectOption.list Array [{"code": "NP","code_name": "个人"}]
* @param selectOption.code String "bp_type"
* @param selectOption.object Object 当前数据对象
* @param selectOption.returnItem function 回调函数返回index与object
* var bp_class_list = [
* {
* "code": "NP",
* "code_name": "个人"
* },{
* "code": "NP1",
* "code_name": "个人1"
* }];
* hlsPopup.selectList({
* list: bp_class_list,
* code: 'bp_type',
* object: {},
* returnItem: function (index, obj) {
* console.log(obj)
* }
* })
*
*/
selectList: function(selectOption) {
if (typeof selectOption === 'object') {
let list = []
let length = selectOption.list.length
vum.forEach(selectOption.list, function(date, index, array) {
list.push({
value: date.code,
name: date.code_name,
parent: date.parent,
})
if (index === (length - 1)) {
SelectPlugin.show({
list: list,
callBack: selectOption.returnItem,
code: selectOption.code,
object: selectOption.object,
})
}
})
}
},
/**
* 弹出数字键盘
* @param keyboardObject.title 键盘的title
* @param keyboardObject.closeButtonText 键盘的关闭按钮文字
* @param keyboardObject.keyDown 普通按键按下去事件
* @param keyboardObject.keyDelete 删除按键按下去事件
*/
showNumberKeyborad: function(keyboardObject) {
if (typeof keyboardObject === 'object') {
NumberKeyboardPlugin.show({
title: keyboardObject.title,
closeButtonText: keyboardObject.closeButtonText,
extraKey: keyboardObject.extraKey || '.',
keyDown: function(text) {
keyboardObject.keyDown(text)
},
keyDelete: function() {
keyboardObject.keyDelete()
// console.log('delete')
},
})
}
},
/**
* 弹出Notify
* @param notifyObject.content 内容
* @param notifyObject.position 位置
* @param notifyObject.time 显示时长
* @param notifyObject.type 类型 success warning default
*/
showNotify: function(notifyObject) {
if (typeof notifyObject === 'object') {
NotifyPlugin.show({
show: true,
content: notifyObject.content,
position: notifyObject.position || 'top',
time: notifyObject.time || 3000,
type: notifyObject.type || 'default',
})
} }
}) },
} }
}, \ No newline at end of file
/**
* 弹出数字键盘
* @param keyboardObject.title 键盘的title
* @param keyboardObject.closeButtonText 键盘的关闭按钮文字
* @param keyboardObject.keyDown 普通按键按下去事件
* @param keyboardObject.keyDelete 删除按键按下去事件
*/
showNumberKeyborad: function (keyboardObject) {
if (typeof keyboardObject === 'object') {
NumberKeyboardPlugin.show({
title: keyboardObject.title,
closeButtonText: keyboardObject.closeButtonText,
extraKey: keyboardObject.extraKey || '.',
keyDown: function (text) {
keyboardObject.keyDown(text)
},
keyDelete: function () {
keyboardObject.keyDelete()
// console.log('delete')
},
})
}
},
/**
* 弹出Notify
* @param notifyObject.content 内容
* @param notifyObject.position 位置
* @param notifyObject.time 显示时长
* @param notifyObject.type 类型 success warning default
*/
showNotify: function (notifyObject) {
if (typeof notifyObject === 'object') {
NotifyPlugin.show({
show: true,
content: notifyObject.content,
position: notifyObject.position || 'top',
time: notifyObject.time || 3000,
type: notifyObject.type || 'default',
})
}
},
}
...@@ -7,133 +7,133 @@ import axios from 'axios' ...@@ -7,133 +7,133 @@ import axios from 'axios'
import { getUrlParam } from './utils' import { getUrlParam } from './utils'
// 模拟登录 // 模拟登录
export function analogLogin () { export function analogLogin() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const url = `${$config.hmapUrl}/oauth/token?client_id=18f58010-2831-11e8-b467-0ed5f89f718b&client_secret=2fe58f36-2831-11e8-b467-0ed5f89f718b&grant_type=password&username=%2B8618325379820&password=jingchaowu520&authType=TEL` const url = `${$config.hmapUrl}/oauth/token?client_id=18f58010-2831-11e8-b467-0ed5f89f718b&client_secret=2fe58f36-2831-11e8-b467-0ed5f89f718b&grant_type=password&username=%2B8618325379820&password=jingchaowu520&authType=TEL`
axios.post(url).then(res => { axios.post(url).then(res => {
window.localStorage.setItem('token', res.access_token) window.localStorage.setItem('token', res.access_token)
resolve({ resolve({
token: res.access_token, token: res.access_token,
tokenType: res.token_type, tokenType: res.token_type,
expires: res.expires_in, expires: res.expires_in,
userId: res.userId, userId: res.userId,
organizationId: res.organizationId, organizationId: res.organizationId,
}) })
})
}) })
})
} }
// 授权码登录 // 授权码登录
export async function authorizedLogin () { export async function authorizedLogin() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const code = getUrlParam('code') const code = getUrlParam('code')
const url = `${$config.hmapUrl}/oauth/token?client_id=18f58010-2831-11e8-b467-0ed5f89f718b&client_secret=2fe58f36-2831-11e8-b467-0ed5f89f718b&grant_type=authorization_code&code=${encodeURIComponent(code)}` const url = `${$config.hmapUrl}/oauth/token?client_id=18f58010-2831-11e8-b467-0ed5f89f718b&client_secret=2fe58f36-2831-11e8-b467-0ed5f89f718b&grant_type=authorization_code&code=${encodeURIComponent(code)}`
axios.post(url).then(res => { axios.post(url).then(res => {
window.localStorage.setItem('token', res.access_token) window.localStorage.setItem('token', res.access_token)
resolve({ resolve({
token: res.access_token, token: res.access_token,
tokenType: res.token_type, tokenType: res.token_type,
expires: res.expires_in, expires: res.expires_in,
userId: res.userId, userId: res.userId,
organizationId: res.organizationId, organizationId: res.organizationId,
account: res.account, account: res.account,
mobile: res.phoneNumber, mobile: res.phoneNumber,
}) })
})
}) })
})
} }
// 桥登录 // 桥登录
export function bridgeLogin () { export function bridgeLogin() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// 登录成功回调 // 登录成功回调
window.bridgeLoginSuccess = function (str) { window.bridgeLoginSuccess = function(str) {
const res = JSON.parse(str) const res = JSON.parse(str)
window.localStorage.setItem('token', res.token) window.localStorage.setItem('token', res.token)
const data = { const data = {
token: res.token, token: res.token,
tokenType: res.tokenType, tokenType: res.tokenType,
expires: res.expiresIn, expires: res.expiresIn,
userId: res.userId, userId: res.userId,
organizationId: res.organizationId, organizationId: res.organizationId,
account: res.account, account: res.account,
mobile: res.phoneNumber, mobile: res.phoneNumber,
} }
resolve(data) resolve(data)
} }
// 登录失败回调 // 登录失败回调
window.bridgeLoginFailure = function (res) { window.bridgeLoginFailure = function(res) {
console.error(res) console.error(res)
reject(res) reject(res)
} }
const dict = { const dict = {
'className': 'BaseBridge', 'className': 'BaseBridge',
'function': 'getBaseInfo', 'function': 'getBaseInfo',
'successCallBack': 'bridgeLoginSuccess', 'successCallBack': 'bridgeLoginSuccess',
'failureCallBack': 'bridgeLoginFailure', 'failureCallBack': 'bridgeLoginFailure',
} }
HandBridge.postMessage(JSON.stringify(dict)) HandBridge.postMessage(JSON.stringify(dict))
}) })
} }
// 获取用户详细信息 // 获取用户详细信息
export function getUserInfo (userId) { export function getUserInfo(userId) {
const url = `${$config.hmapUrl}/i/api/staff/customDetail` const url = `${$config.hmapUrl}/i/api/staff/customDetail`
const data = { const data = {
userId, userId,
} }
const options = { const options = {
headers: { headers: {
Authorization: `Bearer ${window.localStorage.token}`, Authorization: `Bearer ${window.localStorage.token}`,
}, },
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.post(url, data, options).then(res => { axios.post(url, data, options).then(res => {
resolve({ resolve({
account: res.accountNumber, account: res.accountNumber,
mobile: res.mobile, mobile: res.mobile,
userId: res.userId, userId: res.userId,
organizationId: res.organizationId, organizationId: res.organizationId,
email: res.email, email: res.email,
}) })
})
}) })
})
} }
/** /**
* 获取中台的token * 获取中台的token
* @returns {Promise<*>} * @returns {Promise<*>}
*/ */
export async function getSupportToken () { export async function getSupportToken() {
const url = `${$config.loginPath}appadmin` const url = `${$config.loginPath}appadmin`
const res = await axios.post(url) const res = await axios.post(url)
return res return res
} }
/** /**
* 获取业务系统个人信息 * 获取业务系统个人信息
* @returns {Promise<*>} * @returns {Promise<*>}
*/ */
export async function getLeasingUserInfo (account, mobile) { export async function getLeasingUserInfo(account, mobile) {
window.localStorage.setItem('account', account) window.localStorage.setItem('account', account)
const url = `${$config.basePath}hmap_app_login` const url = `${$config.basePath}hmap_app_login`
const data = { const data = {
'user_name': account, 'user_name': account,
'mobile': mobile, 'mobile': mobile,
} }
const options = { const options = {
headers: { headers: {
Authorization: `Bearer ${window.localStorage.access_token}`, Authorization: `Bearer ${window.localStorage.access_token}`,
}, },
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.post(url, data, options).then(res => { axios.post(url, data, options).then(res => {
// console.log('leasingInfo:' + JSON.stringify(res)) // console.log('leasingInfo:' + JSON.stringify(res))
if (res.result === 'S') { if (res.result === 'S') {
resolve(res.user_info[0]) resolve(res.user_info[0])
} }
})
}) })
})
} }
/** /**
...@@ -142,32 +142,32 @@ export async function getLeasingUserInfo (account, mobile) { ...@@ -142,32 +142,32 @@ export async function getLeasingUserInfo (account, mobile) {
* @param {Boolean} [needInfo] 是否需要获取用户详细信息 * @param {Boolean} [needInfo] 是否需要获取用户详细信息
* @return {Object.Promise} 若登录成功PromiseValue为数据对象/登录失败PromiseValue 为 false * @return {Object.Promise} 若登录成功PromiseValue为数据对象/登录失败PromiseValue 为 false
*/ */
export async function login (type = 'online', needInfo = true) { // 登录 export async function login(type = 'online', needInfo = true) { // 登录
const env = process.env.CONFIG_ENV // 环境 const env = process.env.CONFIG_ENV // 环境
try { try {
let result = {} let result = {}
let tokenInfo = {} let tokenInfo = {}
tokenInfo = await getSupportToken() tokenInfo = await getSupportToken()
window.localStorage.setItem('access_token', tokenInfo.access_token) window.localStorage.setItem('access_token', tokenInfo.access_token)
if (env === 'prod' || env === 'uat') { // 真机 if (env === 'prod' || env === 'uat') { // 真机
if (type === 'online') result = await authorizedLogin() // 在线子应用 if (type === 'online') result = await authorizedLogin() // 在线子应用
if (type === 'local') result = await bridgeLogin() // 本地子应用 if (type === 'local') result = await bridgeLogin() // 本地子应用
window.localStorage.setItem('mobile', result.mobile) window.localStorage.setItem('mobile', result.mobile)
result.userInfo = await getLeasingUserInfo(result.account, result.mobile) result.userInfo = await getLeasingUserInfo(result.account, result.mobile)
} else { } else {
result = await analogLogin() result = await analogLogin()
result.hmapUserInfo = await getUserInfo(result.userId) result.hmapUserInfo = await getUserInfo(result.userId)
window.localStorage.setItem('mobile', result.hmapUserInfo.mobile) window.localStorage.setItem('mobile', result.hmapUserInfo.mobile)
result.userInfo = await getLeasingUserInfo(result.hmapUserInfo.account, result.hmapUserInfo.mobile) result.userInfo = await getLeasingUserInfo(result.hmapUserInfo.account, result.hmapUserInfo.mobile)
} }
window.localStorage.setItem('user_id', result.userInfo.user_id) window.localStorage.setItem('user_id', result.userInfo.user_id)
return result return result
} catch (e) { } catch (e) {
// console.error(e) // console.error(e)
return false return false
} }
} }
/** /**
...@@ -176,51 +176,51 @@ export async function login (type = 'online', needInfo = true) { // 登录 ...@@ -176,51 +176,51 @@ export async function login (type = 'online', needInfo = true) { // 登录
* @param needInfo * @param needInfo
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
export default function hmapLogin (type = 'local', needInfo = true) { export default function hmapLogin(type = 'local', needInfo = true) {
const env = process.env.CONFIG_ENV // 环境 const env = process.env.CONFIG_ENV // 环境
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
try { try {
let result = {} let result = {}
if (env === 'prod' || env === 'uat') { // 真机 if (env === 'prod' || env === 'uat') { // 真机
if (type === 'online') { if (type === 'online') {
authorizedLogin().then(res => { authorizedLogin().then(res => {
result = res result = res
window.localStorage.setItem('mobile', res.mobile) window.localStorage.setItem('mobile', res.mobile)
}) })
}// 在线子应用 } // 在线子应用
if (type === 'local') { if (type === 'local') {
result = bridgeLogin().then(res => { result = bridgeLogin().then(res => {
result = res result = res
window.localStorage.setItem('mobile', res.mobile) window.localStorage.setItem('mobile', res.mobile)
}) })
}
getSupportToken().then(res => {
window.localStorage.setItem('access_token', res.access_token)
getLeasingUserInfo(result.account, result.mobile).then(res => {
result.userInfo = res
window.localStorage.setItem('user_id', res.user_id)
resolve(result)
})
})
} else {
analogLogin().then(res => {
result = res
getUserInfo(res.userId).then(info => {
result.hmapUserInfo = info
window.localStorage.setItem('mobile', info.mobile)
getSupportToken().then(support => {
window.localStorage.setItem('access_token', support.access_token)
getLeasingUserInfo(info.account, info.mobile).then(res => {
result.userInfo = res
window.localStorage.setItem('user_id', res.user_id)
resolve(result)
})
})
})
})
}
} catch (e) {
reject(e)
} }
getSupportToken().then(res => { })
window.localStorage.setItem('access_token', res.access_token) }
getLeasingUserInfo(result.account, result.mobile).then(res => { \ No newline at end of file
result.userInfo = res
window.localStorage.setItem('user_id', res.user_id)
resolve(result)
})
})
} else {
analogLogin().then(res => {
result = res
getUserInfo(res.userId).then(info => {
result.hmapUserInfo = info
window.localStorage.setItem('mobile', info.mobile)
getSupportToken().then(support => {
window.localStorage.setItem('access_token', support.access_token)
getLeasingUserInfo(info.account, info.mobile).then(res => {
result.userInfo = res
window.localStorage.setItem('user_id', res.user_id)
resolve(result)
})
})
})
})
}
} catch (e) {
reject(e)
}
})
}
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