Commit a66e0558 authored by chaiwei's avatar chaiwei

提交代码

parent 8f7c0374
Pipeline #5762 canceled with stages
......@@ -5,13 +5,13 @@
## Build Setup
``` bash
# install dependencies
# install dependencies 安装项目依赖
yarn install
# serve with hot reload at localhost:8080
# serve with hot reload at localhost:8080 运行项目命令
yarn run dev
# build for production with minification
# build for production with minification 打包命令
yarn run build
# build for production and view the bundle analyzer report
......
......@@ -16,7 +16,7 @@ spinner.start()
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, function (err, stats) {
webpack(webpackConfig, function(err, stats) {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
......
......@@ -7,7 +7,7 @@ module.exports = merge(prodEnv, {
CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV),
debug: true,
isMobilePlatform: false,
appCode:'"HLS_APP"',
appCode: '"HLS_APP"',
clearTable: true,
//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=",
......@@ -16,13 +16,15 @@ module.exports = merge(prodEnv, {
//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&",
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="',
basePath: '"http://hlsapp.hand-china.com/core/r/api?sysName=HLS_APP&apiName="',
rootPath: '"http://hlsapp.hand-china.com/core/r/api"',
file_url: '"http://hlsapp.hand-china.com/file/"',
loginPathRl: '"http://sign.hitachics.com/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password="',
basePath: '"http://sign.hitachics.com/core/r/api?sysName=HCL_UPLOAD_FILE&apiName="',
basePathRl: '"http://sign.hitachics.com/core/r/api?sysName=wxgzh_hitachics&apiName="',
rootPath: '"http://sign.hitachics.com/core/r/api"',
file_url: '"http://sign.hitachics.com/file/"',
domainUrl: "http://sign.hitachics.com",
appId: '"com.hls.easy.car"',
currentVersion: '"1.0.0"',
wxCode:"'hlsWx'",
uploadSysName:"'HLS_APP'",
uploadApiName:"'attachment_upload'"
wxCode: "'hlsWx'",
uploadSysName: "'HLS_APP'",
uploadApiName: "'attachment_upload'"
});
\ No newline at end of file
......@@ -4,16 +4,17 @@ module.exports = {
CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV),
debug: false,
isMobilePlatform: false,
appCode:'"HLS_APP"',
appCode: '"HLS_APP"',
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=" ',
loginPathRl: '"http://101.133.225.167:8096/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="',
rootPath: '"http://hlsapp.hand-china.com/core/r/api"',
file_url: '"http://hlsapp.hand-china.com/file/"',
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://sign.hitachics.com/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password="',
basePath: '"http://sign.hitachics.com/core/r/api?sysName=HCL_UPLOAD_FILE&apiName="',
basePathRl: '"http://sign.hitachics.com/core/r/api?sysName=wxgzh_hitachics&apiName="',
rootPath: '"http://sign.hitachics.com/core/r/api"',
file_url: '"http://sign.hitachics.com/file/"',
appId: '"com.hls.easy.car"',
currentVersion: '"1.0.0"',
wxCode:"'hlsWx'",
uploadSysName:"'HLS_APP'",
uploadApiName:"'attachment_upload'"
wxCode: "'hlsWx'",
uploadSysName: "'HLS_APP'",
uploadApiName: "'attachment_upload'"
}
\ No newline at end of file
......@@ -4,16 +4,17 @@ module.exports = {
CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV),
debug: true,
isMobilePlatform: false,
appCode:'"HLS_APP"',
appCode: '"HLS_APP"',
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=" ',
loginPathRl: '"http://101.133.225.167:8096/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="',
rootPath: '"http://hlsapp.hand-china.com/core/r/api"',
file_url: '"http://hlsapp.hand-china.com/file/"',
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://sign.hitachics.com/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password="',
basePath: '"http://sign.hitachics.com/core/r/api?sysName=HCL_UPLOAD_FILE&apiName="',
basePathRl: '"http://sign.hitachics.com/core/r/api?sysName=wxgzh_hitachics&apiName="',
rootPath: '"http://sign.hitachics.com/core/r/api"',
file_url: '"http://sign.hitachics.com/file/"',
appId: '"com.hls.easy.car"',
currentVersion: '"1.0.0"',
wxCode:"'hlsWx'",
uploadSysName:"'HLS_APP'",
uploadApiName:"'attachment_upload'"
wxCode: "'hlsWx'",
uploadSysName: "'HLS_APP'",
uploadApiName: "'attachment_upload'"
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, width=device-width, viewport-fit=cover">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, width=device-width, viewport-fit=cover">
<meta name="format-detection" content="telephone=no">
<meta name="format-detection" content="email=no">
<!-- safari私有meta标签 允许全屏模式浏览 指定safari顶部状态栏样式(黑色) -->
......@@ -18,10 +18,12 @@
<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/rmsportal/NjNldKHIVQRozfbAOJUW.js"></script>
<title>车租易</title>
<title></title>
</head>
<body>
<div id="app-box"></div>
<!-- built files will be auto injected -->
<div id="app-box"></div>
<!-- built files will be auto injected -->
</body>
</html>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<div id="app">
<transition :name="transitionName">
<keep-alive>
<router-view v-if="$route.meta.keepAlive"/>
<router-view v-if="$route.meta.keepAlive" />
</keep-alive>
</transition>
<transition :name="transitionName">
......
......@@ -7,7 +7,7 @@ import router from './router/index'
import flexible from './common/ydui.flexible'
import components from './components/component'
import {componentInstall, appStyle} from 'hls-easy-ui'
import { componentInstall, appStyle } from 'hls-easy-ui'
/**
* 指令
*/
......@@ -21,6 +21,11 @@ import {
import './scripts/prototype'
import './scripts/vuePlatform'
import {
Toast
} from 'vux'
Vue.component('toast', Toast)
/**
......@@ -31,21 +36,23 @@ import hlsPopup from './scripts/hlsPopup'
/**
* http
*/
import {post, get} from './scripts/hlsHttp'
import { post, get } from './scripts/hlsHttp'
/** 全局函数hlsUtil**/
import hlsUtil from './scripts/hlsUtil'
if (process.env.CONFIG_ENV === 'uat') {
const VConsole = require('vconsole')
new VConsole() // eslint-disable-line
}
// if (process.env.CONFIG_ENV === 'uat') {
const VConsole = require('vconsole')
new VConsole() // eslint-disable-line
// }
Vue.use(directives)
Vue.use(filter)
//
import axios from 'axios'
Vue.prototype.$api = axios;
/**
* 组件
*/
......@@ -75,7 +82,7 @@ Vue.prototype.hlsUtil = window.hlsUtil = hlsUtil
* 全局返回上一页面
* @param index
*/
let routeGo = function (index) {
let routeGo = function(index) {
if (!index) {
index = -1
}
......@@ -87,13 +94,13 @@ Vue.prototype.$routeGo = routeGo
Vue.config.productionTip = false
vum.$vumPlatform.ready(function () {
vum.$vumPlatform.ready(function() {
})
/* eslint-disable no-new */
new Vue({
data () {
data() {
return {
pathList: [],
transitionName: null,
......@@ -101,7 +108,7 @@ new Vue({
},
router,
watch: { // 监听路由变化
$route (to, from) {
$route(to, from) {
document.body.scrollTop = 0
document.documentElement.scrollTop = 0
},
......
<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 {
bannerList: [
{
bannerList: [{
pictureUrl: require('../assets/image/home/bannerWrap@2x.png'),
},
{
pictureUrl: require('../assets/image/home/bannerWrap2@2x.png'),
},
],
recommendList: [// 为你推荐图片数组
recommendList: [ // 为你推荐图片数组
{
recommendUrl: require('../assets/image/home/recommendOne@2x.png'),
},
......@@ -16,143 +15,141 @@ export default {
},
],
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,
'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',
},
],
},
// {
// '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',
// },
// ],
// },
{
'moduleId': 4,
'moduleCode': 'PERSONAL',
......@@ -162,32 +159,32 @@ export default {
'roleCode': 'ADMIN',
'roleName': '管理员',
'functions': [
{
'functionId': 8,
'functionCode': '160',
'functionName': '工作流',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/workflow@2x.png',
'functionState': 'WorkflowList',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
},
{
'functionId': 9,
'functionCode': '170',
'functionName': 'OCR',
'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/ocr.png',
'functionState': 'OcrIdentify',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
},
// {
// 'functionId': 8,
// 'functionCode': '160',
// 'functionName': '工作流',
// 'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/workflow@2x.png',
// 'functionState': 'WorkflowList',
// 'prodFlag': 'Y',
// 'enableFlag': 'Y',
// 'functionType': 'local',
// 'target': null,
// 'applicationFlag': 'N',
// 'appCode': 'HLS_APP',
// },
// {
// 'functionId': 9,
// 'functionCode': '170',
// 'functionName': 'OCR',
// 'functionIcon': 'http://hlsapp.hand-china.com/file/hel_dev/function/ocr.png',
// 'functionState': 'OcrIdentify',
// 'prodFlag': 'Y',
// 'enableFlag': 'Y',
// 'functionType': 'local',
// 'target': null,
// 'applicationFlag': 'N',
// 'appCode': 'HLS_APP',
// },
/* {
'functionId': 43,
'functionCode': '220',
......@@ -201,25 +198,64 @@ export default {
'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': 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',
'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',
......@@ -228,11 +264,11 @@ export default {
'appCode': 'HLS_APP',
},
{
'functionId': 47,
'functionCode': '260',
'functionName': '风报',
'functionIcon': require('@/assets/home-manager/riskTorm.jpg'),
'functionState': 'RiskHome',
'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',
......@@ -241,18 +277,18 @@ export default {
'appCode': 'HLS_APP',
},
{
'functionId': 48,
'functionCode': '270',
'functionName': '小易',
'functionIcon': require('@/assets/home-manager/robot.png'),
'functionState': 'Robot',
'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',
},
}
],
},
/* {
......
......@@ -418,7 +418,7 @@ export default {
hlsPopup.showSuccess('操作成功')
},
showError () {
hlsPopup.showError('操作失败')
// hlsPopup.showError('操作失败')
},
showConfirm () {
hlsPopup.showConfirm({
......
<template>
<h-view id="home" class="public-style" title="车租易">
<h-view id="home" class="public-style" title="电子签">
<h-content class="content scroll-content">
<div class="top-box">
<header class="header">
<!-- <header class="header">
<input v-model="searchInput" placeholder="请输入功能名">
<img src="../assets/image/home/functionList@2x.png" @click="search">
</header>
<swipe :interval="5000" :showIndicators="false" class="swipe">
</header> -->
<!-- <swipe :interval="5000" :showIndicators="false" class="swipe">
<swipe-item v-for="img in imgList" :key="img.pictureUrl">
<img :src="img.pictureUrl">
</swipe-item>
</swipe>
<div class="function">
</swipe> -->
<!-- <div class="function">
<function-item
v-for="item in moduleSeparateList.slice(0,4)" :key="item.moduleId" :functionIcon="item.moduleIcon"
:functionName="item.moduleName"
:data="item" @clickFunction="goModuleFunction"/>
:data="item" @clickFunction="goModuleFunction"/> -->
<!--<function-item :functionIcon="require('../assets/image/home/allFunction@2x.png')" :functionName="'全部'" @clickFunction="goAllFunction"/>-->
</div>
<!-- </div> -->
</div>
<div class="middle-box">
<header>常用应用</header>
<div class="function">
<function-item
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"/>
<!-- <div class="function-item" @click="goAllFunction">
<img src="../assets/image/home/functionMore@2x.png">
</div>-->
</div>
</div>
<div class="important-message">
<!-- <div class="important-message">
<div class="important-message-title">重要消息</div>
<div class="important-message-title-icon">
<img src="../assets/image/home/messageIcon@2x.png">
......@@ -42,15 +42,15 @@
</ul>
<ul id="p2"/>
</div>
</div>
<div class="middle-box bottom-box">
</div> -->
<!-- <div class="middle-box bottom-box">
<header>为您推荐<span @click="moreRecommend">更多</span></header>
<div class="function">
<div v-for="item in recommendList" class="recommend">
<img :src="item.recommendUrl">
</div>
</div>
</div>
</div> -->
</h-content>
</h-view>
</template>
......@@ -76,121 +76,147 @@ export default {
beforeCreate: function () {
},
created: function () {
debugger;
this.goToken()
window.localStorage.setItem('user_id', 2009)
this.imgList = [...functionState.bannerList]
this.recommendList = [...functionState.recommendList]
this.wxConfig();
// debugger;
// window.localStorage.setItem('user_id', 2009)
// this.imgList = [...functionState.bannerList]
// this.recommendList = [...functionState.recommendList]
this.moduleSeparateList = [...functionState.moduleSeparateList]
this.moduleSeparateList.forEach(item => {
this.functionList = this.functionList.concat(item.functions)
})
this.hlsSupportToken().then(res => {
this.noticeQuery()
this.getToken().then(res => {
// this.noticeQuery()
// 注意,此处用户个人信息是写死的user_id 后续项目实施中根据以下代码实时获取企业通讯录个人信息
/* var code = getUrlParam('code')
this.getWxUserId(code) */
this.wxConfig()
var code = getUrlParam('code');
// code = '111';
if(code){
this.getOpenId(code);
}
})
},
updated: function () {
},
methods: {
// 获取中台token
hlsSupportToken () {
let vm = this
let url = process.env.loginPath + 'appadmin'
let param = {}
return vm.hlsHttp.post(url, param).then(function (res) {
window.localStorage.setItem('access_token', res.access_token)
})
},
noticeQuery () {
let vm = this
let url = process.env.basePath + 'home_msg_query'
// hlsSupportToken () {
// let vm = this
// let url = process.env.loginPath + 'appadmin'
// let param = {}
// return vm.hlsHttp.post(url, param).then(function (res) {
// window.localStorage.setItem('access_token', res.access_token)
// })
// },
// noticeQuery () {
// let vm = this
// let url = process.env.basePath + 'home_msg_query'
// let param = {
// '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;
}
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 = {
'offsize': 1,
}
vm.$post(url, param).then(function (res) {
vm.messageList = res.notice_msg_list
})
},
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('没有此功能')
}
},
goModuleFunction (data) {
this.$router.push({
name: 'ModuleFunction',
params: {
moduleFunctionList: data,
},
})
},
goToken () {
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)
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();
})
/*let vm = this
this.$router.push({
name: 'HomeManager',
params: {
moduleSeparateList: vm.moduleSeparateList,
});
},
})*/
// 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('没有此功能')
// }
// },
// goModuleFunction (data) {
// 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) {
this.$router.push({
name: data.functionState,
})
},
moreRecommend () {
console.log('go moreRecommend')
},
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) {
// moreRecommend () {
// console.log('go moreRecommend')
// },
getOpenId (code) {
let vm = this
let url = process.env.rootPath + '/wechat/user/get?code=' + code + '&wxCode=' + $config.wxCode
vm.hlsHttp.get(url).then(function (res) {
// vm.employee_code = res.userId;
// alert('res ' + JSON.stringify(res))
let url = process.env.basePathRl + "getOpenId";
let param = {
"apiKey":"handexinxi",
"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 {
#home {
.top-box {
height: 264px;
// height: 264px;
width: 100%;
overflow: hidden;
position: relative;
......
......@@ -21,72 +21,188 @@ import PersonAccount from '@/pages/applications/esign/PersonAccount'
import SignPdf from '@/pages/applications/esign/SignPdf'
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)
// 电子签约
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) {
debugger
let key = true
if (bool === undefined) {
key = true
} else if (bool === true || bool === false) {
key = bool
}
this.currentRoute.meta.nextReload = key
this.push(param)
Router.prototype.pushPage = function(param, bool) {
debugger
let key = true
if (bool === undefined) {
key = true
} else if (bool === true || bool === false) {
key = bool
}
this.currentRoute.meta.nextReload = key
this.push(param)
}
export default new Router({
routes: [
{
path: '/',
redirect: to => {
return { name: 'Home' }
},
},
{ path: '/home', component: Home, name: 'Home', meta: { keepAlive: true, nextReload: true} },
{ path: '/ModuleFunction', component: ModuleFunction, name: 'ModuleFunction', meta: { keepAlive: true } },
// test工具类
{ path: '/hls-popup', component: HlsPopup, name: 'HlsPopup', meta: { keepAlive: false, nextReload: '' } },
// 合同维护与签约
{
path: '/ContractMaintenList',
component: ContractMaintenList,
name: 'ContractMaintenList',
meta: { keepAlive: false, nextReload: '' },
},
{
path: '/ContractMainten',
component: ContractMainten,
name: 'ContractMainten',
meta: { keepAlive: false, nextReload: '' },
},
{
path: '/ContractSignList',
component: ContractSignList,
name: 'ContractSignList',
meta: { keepAlive: false, nextReload: '' },
},
{
path: '/ContractSign',
component: ContractSign,
name: 'ContractSign',
meta: { keepAlive: false, nextReload: '' },
},
{path: '/EsignPicture', component: EsignPicture, name: 'EsignPicture', meta: {keepAlive: false}},
{path: '/Esign', component: Esign, name: 'Esign', meta: {keepAlive: false}},
{path: '/BankVerified', component: BankVerified, name: 'BankVerified', meta: {keepAlive: true}},
{path: '/PersonAccount', component: PersonAccount, name: 'PersonAccount', meta: {keepAlive: true}},
{path: '/SignPdf', component: SignPdf, name: 'SignPdf', meta: {keepAlive: true}},
{path: '/ViewPicture', component: ViewPicture, name: 'ViewPicture', meta: {keepAlive: true}},
],
scrollBehavior (to, from, savedPosition) {
if (to.hash) {
return {
selector: to.hash,
}
}
},
routes: [{
path: '/',
redirect: to => {
return { name: 'Home' }
},
},
{ path: '/home', component: Home, name: 'Home', meta: { keepAlive: false, nextReload: true } },
{ path: '/ModuleFunction', component: ModuleFunction, name: 'ModuleFunction', meta: { keepAlive: true } },
// test工具类
{ path: '/hls-popup', component: HlsPopup, name: 'HlsPopup', meta: { keepAlive: false, nextReload: '' } },
// 合同维护与签约
{
path: '/ContractMaintenList',
component: ContractMaintenList,
name: 'ContractMaintenList',
meta: { keepAlive: false, nextReload: '' },
},
{
path: '/ContractMainten',
component: ContractMainten,
name: 'ContractMainten',
meta: { keepAlive: false, nextReload: '' },
},
{
path: '/ContractSignList',
component: ContractSignList,
name: 'ContractSignList',
meta: { keepAlive: false, nextReload: '' },
},
{
path: '/ContractSign',
component: ContractSign,
name: 'ContractSign',
meta: { keepAlive: false, nextReload: '' },
},
{ path: '/EsignPicture', component: EsignPicture, name: 'EsignPicture', meta: { keepAlive: false } },
{ path: '/Esign', component: Esign, name: 'Esign', meta: { keepAlive: false } },
{ path: '/BankVerified', component: BankVerified, name: 'BankVerified', meta: { keepAlive: true } },
{ path: '/PersonAccount', component: PersonAccount, name: 'PersonAccount', meta: { keepAlive: true } },
{ path: '/SignPdf', component: SignPdf, name: 'SignPdf', meta: { keepAlive: true } },
{ path: '/ViewPicture', component: ViewPicture, name: 'ViewPicture', meta: { keepAlive: true } },
{
path: '/UserRegister',
component: UserRegister,
name: 'UserRegister',
meta: {
keepAlive: false
}
},
{
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,23 +4,23 @@ import hlsPopup from './hlsPopup'
let promiseArr = {}
let cancel = {}
const CancelToken = axios.CancelToken
// 请求拦截器
// 请求拦截器
axios.interceptors.request.use(config => {
// 发起请求时,取消掉当前正在进行的相同请求
config.cancelToken = new CancelToken(c => {
cancel = c
})
if (promiseArr[config.url]) {
promiseArr[config.url]('操作取消')
promiseArr[config.url]()
promiseArr[config.url] = cancel
} else {
promiseArr[config.url] = cancel
}
return config
}, error => {
}, error => {
return Promise.reject(error)
})
// 响应拦截器即异常处理
})
// 响应拦截器即异常处理
axios.interceptors.response.use(response => {
if ($config.debug) {
let postName = 'post'
......@@ -98,8 +98,8 @@ axios.interceptors.response.use(response => {
})
axios.defaults.baseURL = ''
axios.defaults.timeout = 100000
// get请求
export function get (url) {
// get请求
export function get(url) {
let param = {}
let headers = {}
if (window.localStorage.access_token) {
......@@ -131,14 +131,14 @@ export function get (url) {
})
}
// post请求
export function post (url, param) {
param.user_id = window.localStorage.user_id
param.access_token = window.localStorage.access_token
export function post(url, param) {
// param.user_id = window.localStorage.user_id
// param.access_token = window.localStorage.access_token_rl
let headers = {}
if (window.localStorage.access_token) {
if (window.localStorage.access_token_rl) {
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + window.localStorage.access_token,
'Authorization': 'Bearer ' + window.localStorage.access_token_rl,
}
} else {
headers = {
......@@ -147,9 +147,9 @@ export function post (url, param) {
}
if ($config.debug) {
let postName = 'POST'
console.log(postName + ' Start!')
console.log(postName + ' url ' + url)
console.log(postName + ' parameter ' + JSON.stringify(param, '', 2))
// console.log(postName + ' Start!')
// console.log(postName + ' url ' + url)
// console.log(postName + ' parameter ' + JSON.stringify(param, '', 2))
}
return new Promise((resolve, reject) => {
axios({
......
import Vue from 'vue'
import {ToastPlugin, AlertPlugin, ConfirmPlugin, LoadingPlugin, DatetimePlugin} from 'vux'
import {ActionSheetPlugin, ShowPicturePlugin, SelectPlugin, NotifyPlugin, NumberKeyboardPlugin} from 'hls-easy-ui'
import { ToastPlugin, AlertPlugin, ConfirmPlugin, LoadingPlugin, DatetimePlugin } from 'vux'
import { ActionSheetPlugin, ShowPicturePlugin, SelectPlugin, NotifyPlugin, NumberKeyboardPlugin } from 'hls-easy-ui'
Vue.use(ToastPlugin)
Vue.use(AlertPlugin)
Vue.use(ConfirmPlugin)
......@@ -22,7 +22,7 @@ export default {
* 自动截屏成弹出错误提示框
* @param content 锁屏内容
*/
showLoading: function (content) {
showLoading: function(content) {
let vm = this
Vue.$vux.loading.show({
text: content || 'Loading',
......@@ -39,7 +39,7 @@ export default {
/**
* 隐藏
*/
hideLoading: function () {
hideLoading: function() {
Vue.$vux.loading.hide()
this.isLoading = false
},
......@@ -48,7 +48,7 @@ export default {
* 长时间顶部提示toast
* @param content
*/
showLongTop: function (content) {
showLongTop: function(content) {
let vm = this
let text = content || '操作失败'
Vue.$vux.toast.show({
......@@ -64,7 +64,7 @@ export default {
* 长时间中部提示toast
* @param content
*/
showLongCenter: function (content) {
showLongCenter: function(content) {
let vm = this
let text = content || '操作失败'
Vue.$vux.toast.show({
......@@ -79,7 +79,7 @@ export default {
* 长时间中部提示toast
* @param content
*/
showLongBottom: function (content) {
showLongBottom: function(content) {
let vm = this
let text = content || '操作失败'
Vue.$vux.toast.show({
......@@ -94,7 +94,7 @@ export default {
* 成功提示框
* @param content
*/
showSuccess: function (content) {
showSuccess: function(content) {
let vm = this
Vue.$vux.toast.show({
text: content || '操作成功',
......@@ -108,7 +108,7 @@ export default {
* 成功提示框
* @param content
*/
showError: function (content) {
showError: function(content) {
let vm = this
Vue.$vux.toast.show({
text: content || '操作失败',
......@@ -124,7 +124,7 @@ export default {
* @param confirmObject.content 内容
* @param confirmObject.onConfirm 确定函数
*/
showConfirm: function (confirmObject) {
showConfirm: function(confirmObject) {
let def = {
title: confirmObject.title || '提示',
content: confirmObject.content || '',
......@@ -146,7 +146,7 @@ export default {
* @param confirmObject.onConfirm 确定函数
*
*/
showPopup: function (confirmObject) {
showPopup: function(confirmObject) {
let def = {
title: confirmObject.title || '提示',
content: confirmObject.content || '',
......@@ -180,7 +180,7 @@ export default {
* }
*
*/
showActionSheet: function (actionObject) {
showActionSheet: function(actionObject) {
if (typeof actionObject === 'object') {
let buttons = []
for (let i = 0; i < actionObject.buttonArray.length; i++) {
......@@ -211,7 +211,7 @@ export default {
* @param timeObject.callback 点击确定的回调函数
*
*/
showTime: function (timeObject) {
showTime: function(timeObject) {
let date = new Date().format('yyyy-MM-dd')
let format = 'YYYY-MM-DD'
if (timeObject.nowDate) {
......@@ -227,7 +227,7 @@ export default {
maxYear: '2200',
format: format,
value: date,
onConfirm (val) {
onConfirm(val) {
timeObject.callback(val)
},
})
......@@ -236,7 +236,7 @@ export default {
* 图片放大预览
* @param imgObject.imgUrl
*/
showBigPicture: function (imgObject) {
showBigPicture: function(imgObject) {
if (typeof imgObject === 'object') {
ShowPicturePlugin.show({
imgUrl: imgObject.imgUrl,
......@@ -269,11 +269,11 @@ export default {
* })
*
*/
selectList: function (selectOption) {
selectList: function(selectOption) {
if (typeof selectOption === 'object') {
let list = []
let length = selectOption.list.length
vum.forEach(selectOption.list, function (date, index, array) {
vum.forEach(selectOption.list, function(date, index, array) {
list.push({
value: date.code,
name: date.code_name,
......@@ -297,16 +297,16 @@ export default {
* @param keyboardObject.keyDown 普通按键按下去事件
* @param keyboardObject.keyDelete 删除按键按下去事件
*/
showNumberKeyborad: function (keyboardObject) {
showNumberKeyborad: function(keyboardObject) {
if (typeof keyboardObject === 'object') {
NumberKeyboardPlugin.show({
title: keyboardObject.title,
closeButtonText: keyboardObject.closeButtonText,
extraKey: keyboardObject.extraKey || '.',
keyDown: function (text) {
keyDown: function(text) {
keyboardObject.keyDown(text)
},
keyDelete: function () {
keyDelete: function() {
keyboardObject.keyDelete()
// console.log('delete')
},
......@@ -320,7 +320,7 @@ export default {
* @param notifyObject.time 显示时长
* @param notifyObject.type 类型 success warning default
*/
showNotify: function (notifyObject) {
showNotify: function(notifyObject) {
if (typeof notifyObject === 'object') {
NotifyPlugin.show({
show: true,
......
......@@ -7,7 +7,7 @@ import axios from 'axios'
import { getUrlParam } from './utils'
// 模拟登录
export function analogLogin () {
export function analogLogin() {
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`
axios.post(url).then(res => {
......@@ -24,7 +24,7 @@ export function analogLogin () {
}
// 授权码登录
export async function authorizedLogin () {
export async function authorizedLogin() {
return new Promise((resolve, reject) => {
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)}`
......@@ -44,10 +44,10 @@ export async function authorizedLogin () {
}
// 桥登录
export function bridgeLogin () {
export function bridgeLogin() {
return new Promise((resolve, reject) => {
// 登录成功回调
window.bridgeLoginSuccess = function (str) {
window.bridgeLoginSuccess = function(str) {
const res = JSON.parse(str)
window.localStorage.setItem('token', res.token)
const data = {
......@@ -62,7 +62,7 @@ export function bridgeLogin () {
resolve(data)
}
// 登录失败回调
window.bridgeLoginFailure = function (res) {
window.bridgeLoginFailure = function(res) {
console.error(res)
reject(res)
}
......@@ -77,7 +77,7 @@ export function bridgeLogin () {
}
// 获取用户详细信息
export function getUserInfo (userId) {
export function getUserInfo(userId) {
const url = `${$config.hmapUrl}/i/api/staff/customDetail`
const data = {
userId,
......@@ -104,7 +104,7 @@ export function getUserInfo (userId) {
* 获取中台的token
* @returns {Promise<*>}
*/
export async function getSupportToken () {
export async function getSupportToken() {
const url = `${$config.loginPath}appadmin`
const res = await axios.post(url)
return res
......@@ -114,7 +114,7 @@ export async function getSupportToken () {
* 获取业务系统个人信息
* @returns {Promise<*>}
*/
export async function getLeasingUserInfo (account, mobile) {
export async function getLeasingUserInfo(account, mobile) {
window.localStorage.setItem('account', account)
const url = `${$config.basePath}hmap_app_login`
const data = {
......@@ -142,7 +142,7 @@ export async function getLeasingUserInfo (account, mobile) {
* @param {Boolean} [needInfo] 是否需要获取用户详细信息
* @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 // 环境
try {
let result = {}
......@@ -176,7 +176,7 @@ export async function login (type = 'online', needInfo = true) { // 登录
* @param needInfo
* @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 // 环境
return new Promise((resolve, reject) => {
try {
......@@ -187,7 +187,7 @@ export default function hmapLogin (type = 'local', needInfo = true) {
result = res
window.localStorage.setItem('mobile', res.mobile)
})
}// 在线子应用
} // 在线子应用
if (type === 'local') {
result = bridgeLogin().then(res => {
result = res
......
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