Commit 1cedf6a1 authored by 5359's avatar 5359

增加用户注册校验和注册信息清除

parent 6fc060d8
Pipeline #6288 canceled with stages
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
<h-content v-if="status != '成功'"> <h-content v-if="status != '成功'">
<list-item class="reg-content"> <list-item class="reg-content">
<!-- <div class="repre-type" v-if="faceAuthStatus != 'SUCCESS'"> <!-- <div class="repre-type" v-if="faceAuthStatus != 'SUCCESS'">
<input type="radio" name="agent" v-model="agentType" @change="isAgent" value="Y" /> <input type="radio" name="agent" v-model="agentType" @change="isAgent" value="Y" />
代理店 代理店
<input <input
style="margin-left:32px" style="margin-left:32px"
type="radio" type="radio"
...@@ -230,6 +230,13 @@ ...@@ -230,6 +230,13 @@
left: 50%;" left: 50%;"
@click="next_step()" @click="next_step()"
>下一步</button> >下一步</button>
<p/>
<button v-if="showStatus== 1"
@click="go_forword()"
class="next-step"
style="margin-top:20px"
>退出
</button>
</div> </div>
<!-- 组织其他员工 --> <!-- 组织其他员工 -->
...@@ -421,6 +428,13 @@ ...@@ -421,6 +428,13 @@
</div> </div>
</div> </div>
<button class="next-step" @click="next_step_oth()">下一步</button> <button class="next-step" @click="next_step_oth()">下一步</button>
<p/>
<button v-if="showStatus== 1"
@click="go_forword()"
class="next-step"
style="margin-top:20px"
>退出
</button>
</div> </div>
</list-item> </list-item>
</h-content> </h-content>
...@@ -766,7 +780,8 @@ export default { ...@@ -766,7 +780,8 @@ export default {
faceAuthStatus: "", faceAuthStatus: "",
orgAuthStatus: "", orgAuthStatus: "",
authAttachmentId: "", authAttachmentId: "",
authOrgAttachmentId: "" authOrgAttachmentId: "",
showStatus: "",
}; };
}, },
...@@ -1190,6 +1205,27 @@ export default { ...@@ -1190,6 +1205,27 @@ export default {
} }
}); });
}, },
// 退出
go_forword() {
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://lease.hitachics.com/www/#/UserRegister",
"_self"
);
} else {
vm.$vux.toast.text(res.message, "middle");
}
});
},
// 认证结果返回给接口 // 认证结果返回给接口
authResult(id, code, suc) { authResult(id, code, suc) {
let vm = this; let vm = this;
...@@ -1242,6 +1278,7 @@ export default { ...@@ -1242,6 +1278,7 @@ export default {
vm.faceAuthStatus = data.faceAuthStatus; vm.faceAuthStatus = data.faceAuthStatus;
vm.orgAuthStatus = data.orgAuthStatus; vm.orgAuthStatus = data.orgAuthStatus;
vm.agentType = data.dealerFlag ? data.dealerFlag : "Y"; vm.agentType = data.dealerFlag ? data.dealerFlag : "Y";
vm.showStatus = "1";
if (data.ctitype == 2) { if (data.ctitype == 2) {
if (data.agentType == 1) { if (data.agentType == 1) {
//法定代表人 //法定代表人
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
style=" width: 150px;line-height: 30px;text-align: center; style=" width: 150px;line-height: 30px;text-align: center;
border-radius: 5px; border-radius: 5px;
background-color: #ddd;font-size:16px;font-weight:700;color:#11111187" background-color: #ddd;font-size:16px;font-weight:700;color:#11111187"
>个人信息</div> >个人信息
</div>
</div> </div>
<item style="border-bottom:1px solid #d0d0d0;font-size:12px"> <item style="border-bottom:1px solid #d0d0d0;font-size:12px">
<section slot="name" style="font-size:14px"> <section slot="name" style="font-size:14px">
...@@ -69,7 +70,7 @@ ...@@ -69,7 +70,7 @@
ref="avatarInput" ref="avatarInput"
class="uppic" class="uppic"
/>--> />-->
<img :src="cardUp" alt class="pic" @click="addCardImage()" /> <img :src="cardUp" alt class="pic" @click="addCardImage()"/>
</div> </div>
<!-- <div style="border:1px solid #b2b2b2;width:50%;border-radius:5px;position:relative;"> <!-- <div style="border:1px solid #b2b2b2;width:50%;border-radius:5px;position:relative;">
...@@ -92,7 +93,14 @@ ...@@ -92,7 +93,14 @@
<button <button
@click="next_step()" @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%;" style="width:120px;height:30px;border-radius:15px;background-color:#09bb07;color:#FFFFFF;margin:70px 0 0 -60px;position:relative;left:50%;"
>下一步</button> >下一步
</button>
<p/>
<button v-if="showStatus== 1"
@click="go_forword()"
style="width:120px;height:30px;border-radius:15px;background-color:#09bb07;color:#FFFFFF;margin:20px 0 0 -60px;position:relative;left:50%;"
>退出
</button>
</list-item> </list-item>
</h-content> </h-content>
...@@ -102,7 +110,8 @@ ...@@ -102,7 +110,8 @@
<div <div
class="personalInf-text" 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" 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>
</div> </div>
<item style="border-bottom:1px solid #d0d0d0"> <item style="border-bottom:1px solid #d0d0d0">
<section slot="name" style="font-size:14px"> <section slot="name" style="font-size:14px">
...@@ -162,7 +171,7 @@ ...@@ -162,7 +171,7 @@
class="uppic" class="uppic"
disabled disabled
/>--> />-->
<img :src="cardUp" alt class="pic" @click="previewImage()" /> <img :src="cardUp" alt class="pic" @click="previewImage()"/>
</div> </div>
<!-- <div style="border:1px solid #b2b2b2;width:50%;border-radius:5px;position:relative;"> <!-- <div style="border:1px solid #b2b2b2;width:50%;border-radius:5px;position:relative;">
...@@ -185,344 +194,370 @@ ...@@ -185,344 +194,370 @@
<button <button
@click="logout()" @click="logout()"
style="width:120px;height:30px;border-radius:15px;background-color:#09bb07;color:#FFFFFF;margin:70px 0 0 -60px;position:relative;left:50%;" style="width:120px;height:30px;border-radius:15px;background-color:#09bb07;color:#FFFFFF;margin:70px 0 0 -60px;position:relative;left:50%;"
>注销</button> >注销
</button>
</list-item> </list-item>
</h-content> </h-content>
</h-view> </h-view>
</template> </template>
<script> <script>
import { getUrlParam } from "@/scripts/utils"; import {getUrlParam} from "@/scripts/utils";
export default {
data() { export default {
return { data() {
cardUp: require("../../../assets/userRegister/camear.png"), //身份证正面url return {
identificationNumber: "", cardUp: require("../../../assets/userRegister/camear.png"), //身份证正面url
phoneNumber: "", identificationNumber: "",
personName: "", phoneNumber: "",
cardUp1: "", //身份证正面url personName: "",
identificationNumber1: "", cardUp1: "", //身份证正面url
phoneNumber1: "", identificationNumber1: "",
personName1: "", phoneNumber1: "",
status: "", personName1: "",
serverId: "", status: "",
preview_url: "", //图片预览地址 showStatus: "",
attchmentId: "" //附件预览id serverId: "",
}; preview_url: "", //图片预览地址
}, attchmentId: "" //附件预览id
components: {},
activated: function() {
// this.getUserInfo();
},
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() { components: {},
console.log("11111111"); activated: function () {
let self = this; // this.getUserInfo();
// 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();
// }
// }
}, },
//预览图片 updated: function () {
previewImage() {
hlsPopup.showBigPicture({
imgUrl: vm.cardUp
});
}, },
uploadToWeixinServer(localId) { methods: {
let self = this; // 调用微信接口的基础配置
wx.uploadImage({ wxConfig() {
localId: localId, let clientUrl = "";
isShowProgressTips: 1, // 默认为1,显示进度提示 let u = navigator.userAgent;
success: function(res) { let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; //g
//res.serverId 返回图片的微信服务器端ID let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
console.log("上传图片后返回的信息", res); if (isAndroid) {
self.serverId = res.serverId; //这个是安卓操作系统
self.uploadToserver(res.serverId); console.log("机型:android");
clientUrl = location.href;
} }
}); if (isIOS) {
}, //这个是ios操作系统
uploadToserver(serverId) { console.log("机型:ios");
console.log("mediaId", serverId); clientUrl = location.href.split("#")[0];
let vm = this; }
let url = process.env.rootPath + "/auth/upload/image/hls/from/wx"; // let clientUrl = encodeURIComponent(location.href)
let param = { // let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
openId: window.localStorage.openId, let url = process.env.basePathRl + "getSignature";
mediaId: serverId, let param = {
sourceType: "app_file_id_card", apiKey: "handexinxi",
fileName: new Date().getTime() + ".jpg" url: clientUrl
}; };
vm.hlsPopup.showLoading("请稍等"); hlsHttp.post(url, param).then(function (res) {
vm.$post(url, param).then(function(res) { wx.config({
vm.hlsPopup.hideLoading(); beta: true,
vm.personName = res["姓名"]; debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
vm.identificationNumber = res["公民身份号码"]; appId: res.result.appId, // 必填,公众号的唯一标识
vm.attchmentId = res["attchmentId"]; timestamp: res.result.timestamp, // 必填,生成签名的时间戳
vm.cardUp = nonceStr: res.result.nonceStr, // 必填,生成签名的随机串
process.env.rootPath + signature: res.result.signature, // 必填,签名,见附录1
"/app/fileViewSvc?attachment_id=" + jsApiList: [
vm.attchmentId + "chooseImage",
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" + "previewImage",
window.localStorage.access_token_rl; "downloadImage",
}); "getLocalImgData",
}, "uploadImage",
// 下一步 "hideOptionMenu"
next_step() { ] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
let vm = this; });
if ( wx.ready(function () {
!vm.personName || wx.hideOptionMenu();
!vm.identificationNumber || });
!vm.phoneNumber || });
!vm.cardUp },
) { addCardImage: function () {
vm.hlsPopup.showLongCenter("必输字端不能为空!"); console.log("11111111");
return; let self = this;
} else if (vm.hlsUtil.isCardID(vm.identificationNumber)) { // if(!self.cardUp){
vm.hlsPopup.showLongCenter("身份证号有误"); wx.chooseImage({
return; count: 1, //张数, 默认9
} else if (!vm.hlsUtil.phoneNumber(vm.phoneNumber)) { sizeType: ["compressed"], //建议压缩图
vm.hlsPopup.showLongCenter("手机号码有误!"); sourceType: ["album", "camera"], // 来源是相册、相机
return; success: function (res) {
} else { self.cardUp = res.localIds[0];
// alert("验证通过"); self.uploadToWeixinServer(res.localIds[0]);
let url = process.env.rootPath + "/auth/api/individual/face"; }
});
// }else{
// if(self.attchmentId){
// this.previewImage();
// }
// }
},
//预览图片
previewImage() {
hlsPopup.showBigPicture({
imgUrl: vm.cardUp
});
},
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 = { let param = {
openId: window.localStorage.openId, openId: window.localStorage.openId,
idNo: vm.identificationNumber, mediaId: serverId,
name: vm.personName, sourceType: "app_file_id_card",
mobile: vm.phoneNumber, fileName: new Date().getTime() + ".jpg"
redirectUrl:
"http://lease.hitachics.com/www/#/UserRegister/PersonalRegister?Regstatus=1"
}; };
vm.hlsPopup.showLoading("请稍等"); vm.hlsPopup.showLoading("请稍等");
vm.$post(url, param).then(function(res) { vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading();
vm.personName = res["姓名"];
vm.identificationNumber = res["公民身份号码"];
vm.attchmentId = res["attchmentId"];
vm.cardUp =
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 {
// 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://lease.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://lease.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://lease.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;
hlsPopup.showConfirm({
title: "签名成功",
content: "请确认合同是否都已下载完成,注销后无法下载,请知悉,谢谢!",
onConfirm: function (index) {
if (index === 1) {
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://lease.hitachics.com/www/#/UserRegister",
"_self"
);
} else {
vm.$vux.toast.text(res.message, "middle");
}
});
}
}
});
},
// 退出
go_forword() {
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(); vm.hlsPopup.hideLoading();
if (res.code == 0) { if (res.code == 0) {
vm.$vux.toast.text(res.message, "middle"); vm.$vux.toast.text(res.message, "middle");
if (res.url) { window.open(
window.open(res.url, "_self"); "http://lease.hitachics.com/www/#/UserRegister",
} "_self"
);
} else { } else {
vm.$vux.toast.text(res.message, "middle"); vm.$vux.toast.text(res.message, "middle");
} }
}); });
} },
}, // 键盘消失,页面回到顶部
// 获取url地址参数 goTop() {
UrlSearch() { setTimeout(function () {
var name, value; var scrollHeight =
// var str="http://lease.hitachics.com/www/#/UserRegister/PersonalRegister?Regstatus=1&status=true&serviceId=1151815015435601748&verifycode=4accf0d2106f9c7361be72093e1fb793&contextId=10074&passed=true"; //取得整个地址栏 document.documentElement.scrollTop || document.body.scrollTop || 0;
var str = window.location.href; //取得整个地址栏 console.log(scrollHeight);
// alert(str) window.scrollTo(0, Math.max(scrollHeight, 0));
var num = str.indexOf("?"); }, 100);
str = str.substr(num + 1); //取得所有参数 stringvar.substr(start [, length ] },
// 获取用户信息
var arr = str.split("&"); //各个参数放到数组里 getUserInfo() {
for (var i = 0; i < arr.length; i++) { var Request = new this.UrlSearch(); //实例化
num = arr[i].indexOf("="); this.status = Request.Regstatus;
if (num > 0) { var contextId = Request.contextId;
name = arr[i].substring(0, num); var verifycode = Request.verifycode;
value = arr[i].substr(num + 1); var success = Request.passed;
this[name] = value; if (this.status == 1) {
this.authResult(contextId, verifycode, success);
} }
} let vm = this;
}, let url =
// 认证结果返回给接口 process.env.rootPath +
authResult(id, code, suc) { "/sign/info/hclc/query/by/openid?openId=" +
let vm = this; window.localStorage.openId;
let url = "http://lease.hitachics.com/core/api/public/listen/auth/result"; vm.hlsPopup.showLoading("请稍等");
let param = { vm.$post(url).then(function (res) {
contextId: id, vm.hlsPopup.hideLoading();
verifycode: code, if (res.rows) {
success: suc if (res.rows.length > 0) {
}; var data = res.rows[0];
vm.hlsPopup.showLoading("请稍等"); vm.cardUp =
vm.$post(url, param).then(function(res) { process.env.rootPath +
vm.hlsPopup.hideLoading(); "/app/fileViewSvc?attachment_id=" +
}); data.attachmentId +
}, "&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
// 注销 window.localStorage.access_token_rl;
logout() { vm.identificationNumber = data.idNo;
let vm = this; vm.phoneNumber = data.mobile;
hlsPopup.showConfirm({ vm.personName = data.name;
title: "签名成功", // vm.identificationNumber = '22222222222222222';
content: "请确认合同是否都已下载完成,注销后无法下载,请知悉,谢谢!", // vm.phoneNumber = '18230982828';
onConfirm: function(index) { // vm.personName = 'chaiwei';
if (index === 1) { vm.showStatus = "1";
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://lease.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);
},
// 获取用户信息
getUserInfo() {
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);
} }
let vm = this; },
let url = created() {
process.env.rootPath + this.wxConfig();
"/sign/info/hclc/query/by/openid?openId=" + // wx.hideOptionMenu();
window.localStorage.openId;
vm.hlsPopup.showLoading("请稍等");
vm.$post(url).then(function(res) {
vm.hlsPopup.hideLoading();
if (res.rows) {
if (res.rows.length > 0) {
var data = res.rows[0];
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.identificationNumber = data.idNo;
vm.phoneNumber = data.mobile;
vm.personName = data.name;
// vm.identificationNumber = '22222222222222222';
// vm.phoneNumber = '18230982828';
// vm.personName = 'chaiwei';
}
}
});
}
},
created() {
this.wxConfig();
// wx.hideOptionMenu();
// var data = this.$route.params.userInfo; // var data = this.$route.params.userInfo;
this.getUserInfo(); this.getUserInfo();
} }
}; };
</script> </script>
<style lang="less" type="text/less" scoped> <style lang="less" type="text/less" scoped>
@import "../../../styles/vue-1px.less"; @import "../../../styles/vue-1px.less";
.personalRegister { .personalRegister {
font-size: 12px !important; font-size: 12px !important;
.personalInfo { .personalInfo {
width: 100%; width: 100%;
height: 100% !important; height: 100% !important;
} }
.uppic { .uppic {
height: 100%; height: 100%;
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;
opacity: 0; opacity: 0;
z-index: 1000; z-index: 1000;
position: absolute; position: absolute;
} }
.pic { .pic {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: absolute; position: absolute;
}
} }
}
// iPhoneX适配 // iPhoneX适配
@media (device-width: 375px) and (device-height: 812px) and (-webkit-min-device-pixel-ratio: 3) { @media (device-width: 375px) and (device-height: 812px) and (-webkit-min-device-pixel-ratio: 3) {
.platform-ios { .platform-ios {
#home { #home {
}
} }
} }
}
// iPhoneX Max适配 // iPhoneX Max适配
@media (device-width: 414px) and (device-height: 896px) { @media (device-width: 414px) and (device-height: 896px) {
.platform-ios {
.platform-ios { .platform-ios {
#home { .platform-ios {
#home {
}
} }
} }
} }
}
</style> </style>
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
isClick2: false, isClick2: false,
isHighLight: true, isHighLight: true,
isHighLight1: true, isHighLight1: true,
isReadOnlyPersonal: true, isReadOnlyPersonal: false,
isReadOnlyCompany: false, isReadOnlyCompany: false,
userInfo: null, userInfo: null,
userInfo1: null, userInfo1: null,
......
...@@ -62,415 +62,443 @@ ...@@ -62,415 +62,443 @@
</template> </template>
<script> <script>
import functionState from "./functionState"; import functionState from "./functionState";
import { getUrlParam } from "@/scripts/utils"; import {getUrlParam} from "@/scripts/utils";
export default { export default {
data() { data() {
return { return {
imgList: [], imgList: [],
recommendList: [], recommendList: [],
moduleSeparateList: [], moduleSeparateList: [],
functionList: [], // 全部应用 functionList: [], // 全部应用
messageList: [], messageList: [],
area: {}, area: {},
box1: {}, box1: {},
box2: {}, box2: {},
searchInput: "", searchInput: "",
subscribe: false subscribe: false
};
},
beforeCreate: function() {},
created: function() {
// 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.getToken().then(res => {
this.wxConfig();
// if (window.localStorage.openId) {
// this.getWxUserInfo(window.localStorage.openId);
// }
// this.noticeQuery()
// 注意,此处用户个人信息是写死的user_id 后续项目实施中根据以下代码实时获取企业通讯录个人信息
var code = getUrlParam("code");
// code = "111";
if (code) {
this.getOpenId(code);
}
this.subscribe = window.localStorage.subscribe;
});
},
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 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();
});
});
}, },
// search () { beforeCreate: function () {
// let vm = this },
// let flag = 'N' created: function () {
// if (vm.searchInput) { // debugger;
// for (let i of vm.allFunctionList) { // window.localStorage.setItem('user_id', 2009)
// if (vm.searchInput === i.functionName) { // this.imgList = [...functionState.bannerList]
// vm.$router.push({ // this.recommendList = [...functionState.recommendList]
// name: i.functionState, this.moduleSeparateList = [...functionState.moduleSeparateList];
// }) this.moduleSeparateList.forEach(item => {
// flag = 'Y' this.functionList = this.functionList.concat(item.functions);
// break });
// } this.getToken().then(res => {
// } this.wxConfig();
// } else { // if (window.localStorage.openId) {
// vm.hlsPopup.showLongCenter('请输入功能名称') // this.getWxUserInfo(window.localStorage.openId);
// } // }
// if (flag === 'N') { // this.noticeQuery()
// vm.hlsPopup.showLongCenter('没有此功能') // 注意,此处用户个人信息是写死的user_id 后续项目实施中根据以下代码实时获取企业通讯录个人信息
// } var code = getUrlParam("code");
// }, // code = "111";
// goModuleFunction (data) { if (code) {
// this.$router.push({ this.getOpenId(code);
// name: 'ModuleFunction',
// params: { }
// moduleFunctionList: data, this.subscribe = window.localStorage.subscribe;
// },
// })
// },
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) { updated: function () {
if (this.subscribe) { },
this.$router.push({ methods: {
name: data.functionState // 调用微信接口的基础配置
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();
});
}); });
} else { },
hlsPopup.showPopup({ // search () {
title: "提示", // let vm = this
content: "未关注公众号,请先关注后再进入!", // let flag = 'N'
onConfirm() {} // 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) {
// moreRecommend () { // if (this.subscribe) {
// console.log('go moreRecommend') // this.$router.push({
// }, // name: data.functionState
getOpenId(code) { // });
let vm = this; // } else {
let url = process.env.basePathRl + "getOpenId"; // hlsPopup.showPopup({
let param = { // title: "提示",
apiKey: "handexinxi", // content: "未关注公众号,请先关注后再进入!",
code: code // onConfirm() {}
}; // });
// window.localStorage.openId = "oBdoRwI9gj9Brbe9iqlDCg5G2dDc"; // }
// vm.getWxUserInfo(window.localStorage.openId); if (!this.subscribe) {
vm.hlsHttp.post(url, param).then(function(res) { hlsPopup.showPopup({
if (res.resultCode == "00") { title: "提示",
window.localStorage.openId = res.result; content: "未关注公众号,请先关注后再进入!",
if (window.localStorage.openId) { onConfirm: function () {
vm.getWxUserInfo(window.localStorage.openId); }
} })
} else {
"Y" == window.localStorage.authFlag || "UserRegister" == data.functionState ? this.$router.push({name: data.functionState}) : hlsPopup.showPopup({
title: "提示",
content: "当前用户未完成注册,请先注册!",
onConfirm: function () {
}
})
} }
}); },
}, // moreRecommend () {
getWxUserInfo(id) { // console.log('go moreRecommend')
let vm = this; // },
let url = process.env.basePathRl + "getWxUserInfo"; getOpenId(code) {
let params = { let vm = this;
apiKey: "handexinxi", let url = process.env.basePathRl + "getOpenId";
openid: id let param = {
// openid: "oBdoRwI9gj9Brbe9iqlDCg5G2dDc" apiKey: "handexinxi",
}; code: code
};
// window.localStorage.openId = "oBdoRwP0WSbegPOoe9WTEMPkKsWQ";
// vm.getWxUserInfo(window.localStorage.openId);
vm.hlsHttp.post(url, param).then(function (res) {
if (res.resultCode == "00") {
window.localStorage.openId = res.result;
if (window.localStorage.openId) {
vm.getWxUserInfo(window.localStorage.openId);
vm.getUserInfo(window.localStorage.openId)
}
}
});
},
getWxUserInfo(id) {
let vm = this;
let url = process.env.basePathRl + "getWxUserInfo";
let params = {
apiKey: "handexinxi",
openid: id
// openid: "oBdoRwI9gj9Brbe9iqlDCg5G2dDc"
};
// window.localStorage.openId = "1234567" // window.localStorage.openId = "1234567"
vm.hlsHttp.post(url, params).then(function(res) { vm.hlsHttp.post(url, params).then(function (res) {
if (res.resultCode == "00") { if (res.resultCode == "00") {
vm.subscribe = window.localStorage.subscribe = res.result.subscribe; vm.subscribe = window.localStorage.subscribe = res.result.subscribe;
// console.log("vvvv", res.result.subscribe); // console.log("vvvv", res.result.subscribe);
} }
}); });
},
getUserInfo: function (openId) {
let vm = this,
url = process.env.rootPath + "/sign/info/hclc/query/by/openid?openId=" + openId;
vm.$post(url).then(function (res) {
if (res.rows.length > 0) {
var results = res.rows[0];
vm.authFlag = window.localStorage.authFlag = results.authFlag;
}
})
}
} }
} };
};
</script> </script>
<style lang="less" scoped type="text/less"> <style lang="less" scoped type="text/less">
@import "../styles/vue-1px"; @import "../styles/vue-1px";
#home { #home {
.top-box { .top-box {
// height: 264px; // height: 264px;
width: 100%;
overflow: hidden;
position: relative;
.header {
width: 100%; width: 100%;
height: 40px; overflow: hidden;
position: absolute; position: relative;
top: 0;
z-index: 100;
input {
width: calc(~"100% - 53px");
height: 26px;
margin: 10px 0 0 10px;
background: white;
// border: 1px solid white;
border-radius: 15px;
text-align: center;
color: #b6b6b6;
font-size: 12px;
}
img { .header {
width: 21px; width: 100%;
height: 21px; height: 40px;
position: absolute; position: absolute;
top: 12px; top: 0;
right: 10px; z-index: 100;
}
}
.hls-swipe { input {
height: 175px; width: calc(~"100% - 53px");
width: 100%; height: 26px;
overflow: hidden; margin: 10px 0 0 10px;
} background: white;
// border: 1px solid white;
.function { border-radius: 15px;
height: 117px; text-align: center;
width: 100%; color: #b6b6b6;
position: absolute; font-size: 12px;
bottom: 0; }
background: url("../assets/image/home/moduleBg@2x.png");
background-size: 100%;
padding-top: 43px;
display: flex;
justify-content: space-between;
&:before { img {
content: ""; width: 21px;
height: 21px;
position: absolute;
top: 12px;
right: 10px;
}
} }
&:after { .hls-swipe {
content: ""; height: 175px;
width: 100%;
overflow: hidden;
} }
.function-item { .function {
text-align: center; height: 117px;
} width: 100%;
} position: absolute;
} bottom: 0;
background: url("../assets/image/home/moduleBg@2x.png");
background-size: 100%;
padding-top: 43px;
display: flex;
justify-content: space-between;
.middle-box { &:before {
margin-top: 8px; content: "";
background: white; }
header { &:after {
height: 33px; content: "";
display: flex; }
align-items: center;
line-height: 100%;
color: #5d98f6;
position: relative;
&:before { .function-item {
content: ""; text-align: center;
width: 4px; }
height: 15px;
margin-right: 9px;
margin-left: 10px;
background-image: linear-gradient(-180deg, #5d98f6 0%, #76bcee 100%);
border-radius: 2px;
} }
}
&:after { .middle-box {
.setBottomLine(); margin-top: 8px;
} background: white;
span { header {
font-size: 12px; height: 33px;
color: #878a8d; display: flex;
position: absolute; align-items: center;
right: 15px; line-height: 100%;
} color: #5d98f6;
} position: relative;
.function {
display: flex;
flex-wrap: wrap;
.function-item { &:before {
width: 25%; content: "";
height: 89px; width: 4px;
font-size: 12px; height: 15px;
// border: 1px solid rgba(169,169,169,0.1); /*no*/ margin-right: 9px;
/deep/ img { margin-left: 10px;
height: 30px; background-image: linear-gradient(-180deg, #5d98f6 0%, #76bcee 100%);
width: 30px; border-radius: 2px;
margin: 23px 28px 9px 33px;
} }
&:before { &:after {
.setBottomLine(); .setBottomLine();
} }
&:after { span {
.setRightLine(); font-size: 12px;
color: #878a8d;
position: absolute;
right: 15px;
} }
} }
.function {
display: flex;
flex-wrap: wrap;
/*.function-item:last-child{ .function-item {
/deep/ img{ width: 25%;
height: 27px; height: 89px;
width: 27px; font-size: 12px;
margin: 31px 34px; // border: 1px solid rgba(169,169,169,0.1); /*no*/
/deep/ img {
height: 30px;
width: 30px;
margin: 23px 28px 9px 33px;
} }
}*/
}
}
.important-message { &:before {
width: 100%; .setBottomLine();
height: 42px; }
margin-top: 8px;
background-color: #ffffff;
display: flex;
justify-content: flex-start;
align-items: center;
.important-message-title {
-webkit-flex: 0 0 20%;
flex: 0 0 20%;
max-width: 20%;
color: #e84a55;
font-size: 14px;
//margin-left: 3.2%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.important-message-title-icon { &:after {
height: 100%; .setRightLine();
margin-left: 1%; }
display: flex; }
justify-content: flex-start;
align-items: center;
img {
width: 13px;
height: 12px;
}
}
#scroll { /*.function-item:last-child{
height: 42px; /deep/ img{
overflow: hidden; height: 27px;
margin-left: 5%; width: 27px;
margin: 31px 34px;
}
}*/
}
} }
#scroll li { .important-message {
width: 100%;
height: 42px; height: 42px;
color: #565656; margin-top: 8px;
font-size: 13px; background-color: #ffffff;
line-height: 18px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
/*word-wrap: break-word;
word-break: break-all;
white-space: normal;*/
display: flex; display: flex;
justify-content: flex-start;
align-items: center; align-items: center;
margin-right: 10px; .important-message-title {
} -webkit-flex: 0 0 20%;
} flex: 0 0 20%;
max-width: 20%;
/*.message-box{ color: #e84a55;
margin-top: 16px; font-size: 14px;
height: 42px; //margin-left: 3.2%;
line-height: 42px; height: 100%;
display: -webkit-flex; display: flex;
display: flex; justify-content: center;
background: white; align-items: center;
.title{
font-size: @font-size-small;
margin-left: 12px;
color: #E84A55;
}
img{
height: 13px;
width: auto;
margin: 15px 20px 15px 3px;
} }
#scrollBox{
.important-message-title-icon {
height: 100%; height: 100%;
margin-left: 1%;
display: flex;
justify-content: flex-start;
align-items: center;
img {
width: 13px;
height: 12px;
}
}
#scroll {
height: 42px;
overflow: hidden; overflow: hidden;
margin-left: 5%;
}
#scroll li {
height: 42px;
color: #565656;
font-size: 13px; font-size: 13px;
color: #E84A55; line-height: 18px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
/*word-wrap: break-word;
word-break: break-all;
white-space: normal;*/
display: flex;
align-items: center;
margin-right: 10px;
} }
}*/ }
/*.message-box{
margin-top: 16px;
height: 42px;
line-height: 42px;
display: -webkit-flex;
display: flex;
background: white;
.title{
font-size: @font-size-small;
margin-left: 12px;
color: #E84A55;
}
img{
height: 13px;
width: auto;
margin: 15px 20px 15px 3px;
}
#scrollBox{
height: 100%;
overflow: hidden;
font-size: 13px;
color: #E84A55;
}
}*/
.bottom-box { .bottom-box {
.recommend { .recommend {
flex: 1; flex: 1;
border: 1px solid rgba(169, 169, 169, 0.1); /*no*/ border: 1px solid rgba(169, 169, 169, 0.1); /*no*/
border-top: none; border-top: none;
img { img {
height: 100%; height: 100%;
width: 100%; width: 100%;
margin: 0; margin: 0;
}
} }
} }
} }
}
</style> </style>
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