no message

cyl/master-apply
jscyl13849007907 2 months ago
parent 3db3ee6104
commit 323b5036f6

@ -1,395 +1,11 @@
<template>
<view class="p-root-detail-fellow g_w_all g_bg_page g_kuaishou">
<view style="padding-bottom: 200rpx">
<rh-ai-super-input class @outputInfo="getTownsManInfo" />
<view class="g_h_10"></view>
<rh-form-slot
:list="[
{
icon: '',
label: '工友电话',
result: '',
path: '',
value: info.tel,
tip: 'slot-mobile',
placeholder: '请输入联系电话',
type: 'slot',
pColumn: 8,
require: false,
},
]"
@changeMobile="handleClickMobile"
></rh-form-slot>
<view class="g_h_10"></view>
<rh-form-slot
:list="[
{
icon: '',
label: '姓名',
result: '',
value: info.name,
path: '',
tip: 'slot-name',
img: info.idCardImageUrl,
placeholder: '请输入姓名',
type: 'slot',
pColumn: 8,
require: true,
},
{
icon: '',
label: '身份证号',
result: '',
value: info.idCard,
path: '',
tip: 'slot-code-idcard',
placeholder: '请输入身份证号',
type: 'slot',
pColumn: 8,
require: false,
},
{
icon: '',
label: '性别',
result: '',
value: info.sex,
path: '',
tip: 'slot-sex',
type: 'slot',
pColumn: 12,
require: false,
customRequire: true,
},
{
icon: '',
label: '年龄',
result: '',
value: info.age,
path: '',
tip: 'slot-age',
placeholder: '请输入年龄',
type: 'slot',
pColumn: 8,
require: false,
},
{
icon: '',
label: '民族',
result: '',
value: info.nation,
nationIndex: nationIndex,
path: '',
tip: 'slot-nation',
pColumn: 12,
require: false,
type: 'slot',
customRequire: true,
},
{
icon: '',
label: '家庭住址',
result: '',
value: info.address,
placeholder: '请输入家庭住址',
path: '',
tip: 'slot-address',
type: 'slot',
pColumn: 8,
},
]"
@changeName="handleClickName"
@changeSex="handleClickSex"
@changeAge="handleClickAge"
@changeNation="handleClickNation"
@changeIDcard="handleClickIDcard"
@changeAddress="handleClickAddress"
@updateFile="updateFile"
@updateIDInfo="handlerIDInfo"
></rh-form-slot>
<view class="g_h_10"></view>
<rh-form-slot
:list="[
{
icon: '',
label: '上传附件',
result: '',
path: '',
type: 'slot',
tip: 'slot-update-file',
pColumn: 16,
},
]"
@updateFile="updateFile"
>
<template v-slot:after>
<view class="g_flex_row_start g_p_10" v-if="imgList.length > 0">
<view v-for="(item, index) in imgList" class="g_position_rela" :class="index <= 2 ? 'g_mr_18' : ''" :key="index">
<i class="iconfont icon-guanbi img-close" @click="delImg(index)"></i>
<image :src="item" class="g_w_56 g_h_56 g_radius_8" />
</view>
</view>
</template>
</rh-form-slot>
<rh-fixed>
<slot>
<view class="g_flex_row_center">
<rh-button primaryColor='#00b666' btnText="取消" class="g_mr_16" size="small" type="default" @clickBtn="goReturn"></rh-button>
<rh-button primaryColor='#00b666' btnText="确定" class @clickBtn="handleSubmit" size="small" type="primary"></rh-button>
</view>
</slot>
</rh-fixed>
</view>
</view>
<rh-edit-user-form :dataoptions='options'></rh-edit-user-form>
</template>
<script>
import { nationlist } from "../../utils/nation.js";
export default {
onReady() {
this.G.setNavStyle();
},
onShareAppMessage() {
return this.G.shareFun();
},
data() {
return {
cdnBaseImg: this.G.store().cdnBaseImg,
info: {
nation: "汉族",
},
nation: nationlist.map((item, index) => {
return item.name;
}),
nationIndex: 0,
imgList: [],
};
},
watch: {
"info.idCard"() {
console.log("this.info.idCard", this.info.idCard);
if (this.info.idCard && (this.info.idCard.length == 15 || this.info.idCard.length == 18)) {
let info = this.G.getInfoByIDcard(this.info.idCard);
console.log("info info info ", info);
this.info.age = info.age;
this.info.sex = info.sex ? (info.sex == "男" ? 1 : 2) : "";
}
},
},
onLoad(options) {
let that = this;
console.log("快速报名:", options);
if (options) {
if (options.sex) {
options.sex = Number(options.sex);
} else {
options.sex = 1;
}
if (options.nation) {
options.nation = options.nation.indexOf("族") > -1 ? options.nation : options.nation + "族";
} else {
options.nation = "汉族";
}
this.info = options;
//
that.nation.forEach((item, index) => {
if (item == that.info.nation) {
that.nationIndex = index;
}
});
if (this.info.imgs) {
this.imgList = this.info.imgs.split(",");
}
export default{
onLoad(options) {
this.options = options
}
console.log("获取工友信息:", options);
},
onShow() {
let that = this;
// that.nation.forEach((item, index) => {
// if (item == that.info.nation) {
// console.log(that.info.nation);
// console.log(index);
// that.nationIndex = index;
// }
// });
// that.speed = 0;
// setTimeout(() => {
// }, 300);
},
created() {
let that = this;
},
methods: {
getTownsManInfo(info) {
let that = this;
console.log("info", info);
that.info = {
...info,
index: that.info.index,
nation: info.nation + "族",
};
},
handleClickName(e) {
this.info.name = this.info.userName = e;
},
handleClickSex(e) {
this.info.sex = e;
},
handleClickAge(e) {
this.info.age = e;
},
handleClickMobile(e) {
this.info.tel = e;
},
handleClickNation(e) {
let that = this;
console.log(e.name);
this.info.nation = e.name;
that.nation.forEach((item, index) => {
if (item == e.name) {
// console.log(that.info.nation)
// console.log(index)
that.nationIndex = index;
}
});
},
/**
* 获取上传的身份信息
*/
handlerIDInfo(res) {
console.log("res", res);
let that = this;
that.info.name = res.info.name;
that.info.sex = res.info.sex ? (res.info.sex == "男" ? 1 : 2) : "";
that.info.age = res.info.age;
that.info.nation = res.info.nationality + "族";
that.info.idCard = res.info.num;
that.info.idCardImageUrl = res.image;
that.info.userName = res.info.name;
that.info.address = res.info.address;
that.nation.forEach((item, index) => {
console.log("item1", item);
console.log('that.info.nation + "族"', that.info.nation + "族");
if (item == that.info.nation) {
console.log("item2", item);
that.nationIndex = index;
}
});
console.log("that.info", that.info);
console.log("that.nationIndex", that.nationIndex);
that.$forceUpdate();
},
//
delImg(ind) {
this.imgList.splice(
this.imgList.findIndex((item, index) => index == ind),
1
);
},
//
updateFile(e) {
let that = this;
if (that.imgList.length < 4) {
that.imgList.push(e);
uni.hideLoading();
} else {
uni.showToast({
title: "最多只能上传4张",
icon: "none",
});
}
},
handleClickIDcard(e) {
this.info.idCard = e;
console.log("eeeeee", this.info.idCard);
// console.log(this.G.getInfoByIDcard(this.info.idCard));
},
handleClickAddress(e) {
this.info.address = e;
},
goReturn() {
uni.navigateBack();
},
handleSubmit() {
let that = this;
console.log("that.info.imgs", that.info.imgs);
console.log("that.imgList", that.imgList);
if (!that.info.name) {
uni.showToast({
icon: "none",
title: "请输入姓名",
});
return false;
}
if (!that.info.tel && !that.info.idCard) {
uni.showToast({
icon: "none",
title: "请至少输入手机号或者身份证号",
});
return false;
}
if (that.info.tel && !that.G.setReg(that.info.tel, "tel")) {
uni.showToast({
icon: "none",
title: "请输入正确的手机号",
});
return false;
}
if (that.info.idCard && !that.G.isValidIdCard(that.info.idCard)) {
uni.showToast({
icon: "none",
title: "请输入正确的身份证号",
});
return false;
}
console.log(that.info);
if (that.imgList.length > 0) {
that.info.imgs = that.imgList;
}
console.log("that.info.imgs", that.info.imgs);
uni.$emit("getTownsman", { info: that.info });
uni.navigateBack();
},
handleClickInfo() {
let that = this;
that.G.uploadImg((res) => {
console.log("res", res);
that.info.name = res.info.name || "";
that.info.sex = res.info.sex ? (res.info.sex == "男" ? 1 : 2) : "";
that.info.age = res.info.age || "";
that.info.nation = res.info.nationality || "";
that.info.idCard = res.info.num || "";
that.info.idCardImageUrl = res.image || "";
that.info.userName = res.info.name || "";
that.info.address = res.info.address || "";
that.nation.forEach((item, index) => {
if (item == that.info.nation) {
that.nationIndex = index;
}
});
that.$forceUpdate();
}, "idcard");
},
},
};
}
</script>
<style>
.img-close {
position: absolute;
width: 18px;
height: 18px;
right: -6px;
top: -6px;
z-index: 99;
background-color: #666;
color: #fff;
font-size: 8px;
text-align: center;
line-height: 18px;
border-radius: 50%;
}
</style>
<style></style>

@ -1,3 +1,5 @@
## 1.0.9222026-01-15
迭代
## 1.0.9212026-01-15
迭代
## 1.0.9202026-01-15

@ -1,5 +1,5 @@
<template>
<div class="g-rh-ai-super-input g_p_10 g_position_rela">
<div data-remark='AI' class="g-rh-ai-super-input g_p_10 g_position_rela">
<div class="g_bg_f g_p_10 g_radius_8">
<u-line-progress class="g_position_abso" v-if="ailoading" style="position: fixed; width: 100%; top: -2px; left: 0px; z-index: 99999" active-color="#3578f6" :percent="defaultPercent" :round="false" height="8" :show-percent="false" inactiveColor="#f5f5f5"></u-line-progress>
<gao-ChatSSEClient ref="sseTest" @onOpen="openCore" @onError="errorCore" @onMessage="messageCore" @onFinish="finishCore" />

@ -1,5 +1,5 @@
<template>
<view class="g-rh-apply g_w_all g_bg_f_5 g_kuaishou">
<view data-remark='' class="g-rh-apply g_w_all g_bg_f_5 g_kuaishou">
<rh-ai-super-input class="" @outputInfo="getTownsManInfo" ref="AiApplyRef" />
<view class="">
<view class="card-tip g_pt_12 g_pb_8 g_pl_20 g_c_6">工友信息</view>
@ -112,12 +112,12 @@ import dateUtil from "../../libs/utils/dateUtil.js";
import rhJS from '../../libs/utils/base.js';
export default {
onReady() {
this.G.setNavStyle();
rhJS.setNavStyle();
let that = this;
uni.$on("getTownsman", (data) => {
//
if (data.info.idCard && (data.info.idCard.length == 15 || data.info.idCard.length == 18)) {
let infoByIDcard = this.G.getInfoByIDcard(data.info.idCard);
let infoByIDcard = rhJS.getInfoByIDcard(data.info.idCard);
data.info.age = infoByIDcard.age;
}
@ -154,7 +154,7 @@ export default {
});
},
onShareAppMessage() {
return this.G.shareFun();
return rhJS.shareFun();
},
props:{
dataoptions:{
@ -217,7 +217,7 @@ export default {
jobType: 2,
isFans: 2,
currentJobInfo: {},
cdnBaseImg: this.G.store().cdnBaseImg,
cdnBaseImg: 'https://bocai-cms.oss-cn-beijing.aliyuncs.com/web-resource/dailibaoming/',
nation: nationlist.map((item, index) => {
return item.name;
}),

@ -1,5 +1,5 @@
<template>
<view class="g-rh-button g-components-button">
<view data-remark='' class="g-rh-button g-components-button">
<button class="bocai-btn" :class="['bocai_btn_size_' + size, 'bocai_btn_mode_' + mode, 'bocai_btn_type_' + type, 'g_w_' + width, 'g_h_' + height, customBgColor ? 'customBgColor' : '']" :style="{ ...buttonStyle, lineHeight: customLH }" :hover-stop-propagation="true" hover-class="thover" @click="handleClick" :form-type="formType" :open-type="openType" @getphonenumber="getphonenumber">
<view class="g_flex_row_center">
<view class="g_flex_column_center g_mr_4" v-if="loading">

@ -0,0 +1,366 @@
<template>
<view data-remark='' class="g-rh-edit-user-form p-root-detail-fellow g_w_all g_bg_page g_kuaishou">
<view style="padding-bottom: 200rpx">
<rh-ai-super-input class @outputInfo="getTownsManInfo" />
<view class="g_h_10"></view>
<rh-form-slot
:list="[
{
icon: '',
label: '工友电话',
result: '',
path: '',
value: info.tel,
tip: 'slot-mobile',
placeholder: '请输入联系电话',
type: 'slot',
pColumn: 8,
require: false,
},
]"
@changeMobile="handleClickMobile"
></rh-form-slot>
<view class="g_h_10"></view>
<rh-form-slot
:list="[
{
icon: '',
label: '姓名',
result: '',
value: info.name,
path: '',
tip: 'slot-name',
img: info.idCardImageUrl,
placeholder: '请输入姓名',
type: 'slot',
pColumn: 8,
require: true,
},
{
icon: '',
label: '身份证号',
result: '',
value: info.idCard,
path: '',
tip: 'slot-code-idcard',
placeholder: '请输入身份证号',
type: 'slot',
pColumn: 8,
require: false,
},
{
icon: '',
label: '性别',
result: '',
value: info.sex,
path: '',
tip: 'slot-sex',
type: 'slot',
pColumn: 12,
require: false,
customRequire: true,
},
{
icon: '',
label: '年龄',
result: '',
value: info.age,
path: '',
tip: 'slot-age',
placeholder: '请输入年龄',
type: 'slot',
pColumn: 8,
require: false,
},
{
icon: '',
label: '民族',
result: '',
value: info.nation,
nationIndex: nationIndex,
path: '',
tip: 'slot-nation',
pColumn: 12,
require: false,
type: 'slot',
customRequire: true,
},
{
icon: '',
label: '家庭住址',
result: '',
value: info.address,
placeholder: '请输入家庭住址',
path: '',
tip: 'slot-address',
type: 'slot',
pColumn: 8,
},
]"
@changeName="handleClickName"
@changeSex="handleClickSex"
@changeAge="handleClickAge"
@changeNation="handleClickNation"
@changeIDcard="handleClickIDcard"
@changeAddress="handleClickAddress"
@updateFile="updateFile"
@updateIDInfo="handlerIDInfo"
></rh-form-slot>
<view class="g_h_10"></view>
<rh-form-slot
:list="[
{
icon: '',
label: '上传附件',
result: '',
path: '',
type: 'slot',
tip: 'slot-update-file',
pColumn: 16,
},
]"
@updateFile="updateFile"
>
<template v-slot:after>
<view class="g_flex_row_start g_p_10" v-if="imgList.length > 0">
<view v-for="(item, index) in imgList" class="g_position_rela" :class="index <= 2 ? 'g_mr_18' : ''" :key="index">
<i class="iconfont icon-guanbi img-close" @click="delImg(index)"></i>
<image :src="item" class="g_w_56 g_h_56 g_radius_8" />
</view>
</view>
</template>
</rh-form-slot>
<rh-fixed>
<slot>
<view class="g_flex_row_center">
<rh-button btnText="取消" class="g_mr_16" size="small" type="default" @clickBtn="goReturn"></rh-button>
<rh-button btnText="确定" class @clickBtn="handleSubmit" size="small" type="primary"></rh-button>
</view>
</slot>
</rh-fixed>
</view>
</view>
</template>
<script>
import { nationlist } from "../../libs/utils/nation.js";
import rhJS from '../../libs/utils/base.js';
export default {
onReady() {
rhJS.setNavStyle();
},
onShareAppMessage() {
return rhJS.shareFun();
},
data() {
return {
cdnBaseImg: 'https://bocai-cms.oss-cn-beijing.aliyuncs.com/web-resource/dailibaoming/',
info: {
nation: "汉族",
},
nation: nationlist.map((item, index) => {
return item.name;
}),
nationIndex: 0,
imgList: [],
};
},
watch: {
"info.idCard"() {
console.log("this.info.idCard", this.info.idCard);
if (this.info.idCard && (this.info.idCard.length == 15 || this.info.idCard.length == 18)) {
let info = rhJS.getInfoByIDcard(this.info.idCard);
console.log("info info info ", info);
this.info.age = info.age;
this.info.sex = info.sex ? (info.sex == "男" ? 1 : 2) : "";
}
},
},
props:{
dataoptions:{
default:()=>{
return {}
}
},
},
mounted() {
let that = this;
let options = this.dataoptions;
if (options) {
if (options.sex) {
options.sex = Number(options.sex);
} else {
options.sex = 1;
}
if (options.nation) {
options.nation = options.nation.indexOf("族") > -1 ? options.nation : options.nation + "族";
} else {
options.nation = "汉族";
}
this.info = options;
//
that.nation.forEach((item, index) => {
if (item == that.info.nation) {
that.nationIndex = index;
}
});
if (this.info.imgs) {
this.imgList = this.info.imgs.split(",");
}
}
},
methods: {
getTownsManInfo(info) {
let that = this;
that.info = {
...info,
index: that.info.index,
nation: info.nation + "族",
};
},
handleClickName(e) {
this.info.name = this.info.userName = e;
},
handleClickSex(e) {
this.info.sex = e;
},
handleClickAge(e) {
this.info.age = e;
},
handleClickMobile(e) {
this.info.tel = e;
},
handleClickNation(e) {
let that = this;
this.info.nation = e.name;
that.nation.forEach((item, index) => {
if (item == e.name) {
that.nationIndex = index;
}
});
},
/**
* 获取上传的身份信息
*/
handlerIDInfo(res) {
let that = this;
that.info.name = res.info.name;
that.info.sex = res.info.sex ? (res.info.sex == "男" ? 1 : 2) : "";
that.info.age = res.info.age;
that.info.nation = res.info.nationality + "族";
that.info.idCard = res.info.num;
that.info.idCardImageUrl = res.image;
that.info.userName = res.info.name;
that.info.address = res.info.address;
that.nation.forEach((item, index) => {
if (item == that.info.nation) {
that.nationIndex = index;
}
});
that.$forceUpdate();
},
//
delImg(ind) {
this.imgList.splice(
this.imgList.findIndex((item, index) => index == ind),
1
);
},
//
updateFile(e) {
let that = this;
if (that.imgList.length < 4) {
that.imgList.push(e);
uni.hideLoading();
} else {
uni.showToast({
title: "最多只能上传4张",
icon: "none",
});
}
},
handleClickIDcard(e) {
this.info.idCard = e;
},
handleClickAddress(e) {
this.info.address = e;
},
goReturn() {
uni.navigateBack();
},
handleSubmit() {
let that = this;
if (!that.info.name) {
uni.showToast({
icon: "none",
title: "请输入姓名",
});
return false;
}
if (!that.info.tel && !that.info.idCard) {
uni.showToast({
icon: "none",
title: "请至少输入手机号或者身份证号",
});
return false;
}
if (that.info.tel && !rhJS.setReg(that.info.tel, "tel")) {
uni.showToast({
icon: "none",
title: "请输入正确的手机号",
});
return false;
}
if (that.info.idCard && !rhJS.isValidIdCard(that.info.idCard)) {
uni.showToast({
icon: "none",
title: "请输入正确的身份证号",
});
return false;
}
if (that.imgList.length > 0) {
that.info.imgs = that.imgList;
}
uni.$emit("getTownsman", { info: that.info });
uni.navigateBack();
},
handleClickInfo() {
let that = this;
that.G.uploadImg((res) => {
that.info.name = res.info.name || "";
that.info.sex = res.info.sex ? (res.info.sex == "男" ? 1 : 2) : "";
that.info.age = res.info.age || "";
that.info.nation = res.info.nationality || "";
that.info.idCard = res.info.num || "";
that.info.idCardImageUrl = res.image || "";
that.info.userName = res.info.name || "";
that.info.address = res.info.address || "";
that.nation.forEach((item, index) => {
if (item == that.info.nation) {
that.nationIndex = index;
}
});
that.$forceUpdate();
}, "idcard");
},
},
};
</script>
<style>
.img-close {
position: absolute;
width: 18px;
height: 18px;
right: -6px;
top: -6px;
z-index: 99;
background-color: #666;
color: #fff;
font-size: 8px;
text-align: center;
line-height: 18px;
border-radius: 50%;
}
</style>

@ -1,5 +1,5 @@
<template>
<view class="g-rh-empty g-components-empty g_flex_column_center" style="min-height: 69px;">
<view data-remark='' class="g-rh-empty g-components-empty g_flex_column_center" style="min-height: 69px;">
<view class="btn" style="padding: 0 24px;line-height:1.3" @click="goLogin">
<u-empty
:text="text"

@ -1,5 +1,5 @@
<template>
<view class="g-rh-fixed g-components-panel-fixed" :style="{ backgroundColor }" :class="[border ? 'g_border_e_t' : '']">
<view data-remark='' class="g-rh-fixed g-components-panel-fixed" :style="{ backgroundColor }" :class="[border ? 'g_border_e_t' : '']">
<slot></slot>
</view>
</template>

@ -1,5 +1,5 @@
<template>
<div class="g-rh-form-slot g-components-item">
<div data-remark='' class="g-rh-form-slot g-components-item">
<div class="m-set g_bg_f g_radius_8" :style="{ overflow: 'hidden' }">
<block v-for="(item, index) in list" :key="index">
<div
@ -238,13 +238,13 @@
</div>
</div>
</scroll-view>
<rh-fixed>
<g-panel-fixed>
<slot>
<div class="g_flex_row_center">
<rh-button primaryColor="#00b666" btnText="确定" type="primary" @clickBtn="submitZhengce" />
</div>
</slot>
</rh-fixed>
</g-panel-fixed>
</u-popup>
</div>
</template>

@ -1,5 +1,5 @@
<template>
<view
<view data-remark=''
class="g-rh-image"
:style="{
'padding':pad + 'px',

@ -1,5 +1,5 @@
<template>
<view
<view data-remark=''
class="g-rh-loading g-components-loading g_w_all g_h_all g_flex_c"
:style="{
'min-height': minHeight ? minHeight + 'rpx' : '0rpx',

@ -1,5 +1,5 @@
<template>
<div class="g-rh-login-false-list">
<div data-remark='' class="g-rh-login-false-list" >
<div style="height: 130px;"></div>
<rh-empty :text="emptyText" :image='image' />
<div style="margin-top: 32px;"></div>

@ -1,5 +1,5 @@
<template>
<div class="g-rh-rh-quickconfirm">
<div data-remark='' class="g-rh-rh-quickconfirm">
<div class="choice_more c6">
<slot name="title"></slot>
<div class="dropdown_box" @touchmove="modalMove" v-if="dropdownShow">

@ -1,6 +1,6 @@
<template>
<!-- #ifdef MP-WEIXIN -->
<button open-type="getPhoneNumber" @getphonenumber="onGetPhoneNumber" class="no_style">
<button data-remark='' open-type="getPhoneNumber" @getphonenumber="onGetPhoneNumber" class="no_style">
<span class="biggerSize" >
<slot></slot>
</span>

@ -1,5 +1,5 @@
<template>
<div class="g-rh-rh-serverpopup">
<div data-remark='' class="g-rh-rh-serverpopup">
<u-popup v-model="showModal" mode="center" :mask-close-able="true" :closeable="true" @close="showModal = false" border-radius="30">
<view style="padding: 0 64px 32px">
<view style="text-align: center; font-size: 16px; color: #333; font-weight: 500; margin-bottom: 32px; padding-top: 32px">添加微信</view>

@ -1,5 +1,5 @@
<template>
<div class="g-rh-rh-unlogininfo">
<div data-remark='' class="g-rh-rh-unlogininfo">
<view class="g_flex_column_between g_flex_1" style="background-color: #ededed; height: 100%; padding-top: 100px">
<view class="g_flex_column_start flex_center">
<view class="iconfont icon-info-circle-fill g_c_027" style="font-size: 80px"> </view>
@ -23,6 +23,7 @@
</template>
<script>
import rhJS from '../../libs/utils/base.js'
export default {
data() {
return {
@ -68,8 +69,8 @@ export default {
});
},
goPage(url) {
this.G.isLogin();
if (this.G.isLogin()) {
rhJS.isLogin();
if (rhJS.isLogin()) {
uni.navigateTo({
url,
});

@ -54,6 +54,87 @@ let data = {
}
return str;
},
isLogin() {
let that = this;
if (!uni.getStorageSync("apply-token")) {
uni.reLaunch({
url: '/root/person/loginIndex?path=/' + that.getPath().path + '&level=' + that.getPath().level
});
return false;
} else {
return true;
}
},
setNavStyle($form = 'default') {
if ($form == 'home') {
uni.setNavigationBarColor({
backgroundColor: "#fff",
frontColor: "#000000"
})
}
},
getInfoByIDcard(idCard) {
let info = {}
let birthday
if (idCard.length !== 15 && idCard.length !== 18) {
return {
sex: '',
age: '',
}
}
// 获取性别
if (idCard.length === 15) {
info.sex = ['女', '男'][idCard.substr(14, 1) % 2]
birthday = [idCard.substr(6, 2), idCard.substr(8, 2), idCard.substr(10, 2)].join('-')
} else if (idCard.length === 18) {
info.sex = ['女', '男'][idCard.substr(16, 1) % 2]
birthday = [idCard.substr(6, 4), idCard.substr(10, 2), idCard.substr(12, 2)].join('-')
}
// 获取年龄
let currentYear = new Date().getFullYear() //当前的年份
let calculationYear = new Date(birthday).getFullYear() //计算的年份
const wholeTime = currentYear + birthday.substring(4) //周岁时间
const calculationAge = currentYear - calculationYear //按照年份计算的年龄
//判断是否过了生日
if (new Date().getTime() > new Date(wholeTime).getTime()) {
info.age = calculationAge
} else {
info.age = calculationAge - 1
}
// console.log('info', info);
return info
},
shareFun(
path = "/pages/home/index",
image = "",
title = "报名助手"
) {
let params = {
path: path,
// imageUrl: this.store().localBaseImg + 'share.png', // image ? image :
imageUrl: image,
title: title
};
// console.log('分享数据:', params)
return params;
},
isValidIdCard(idCard) {
const idCardRegex = /^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}[\dXx]$/;
if (!idCardRegex.test(idCard)) {
return false;
}
const factors = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
const checkCodeList = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'];
let sum = 0;
for (let i = 0; i < 17; i++) {
sum += parseInt(idCard[i]) * factors[i];
}
const checkCode = checkCodeList[sum % 11];
return checkCode === idCard[17].toUpperCase();
},
}
export default data;

@ -1,7 +1,7 @@
{
"id": "rh-ui",
"displayName": "rh-ui",
"version": "1.0.921",
"version": "1.0.922",
"description": "公司内部UI框架",
"keywords": [
"ui框架"
@ -61,11 +61,11 @@
},
"nvue": "-",
"android": {
"extVersion": "1.0.921",
"extVersion": "1.0.922",
"minVersion": "19"
},
"ios": {
"extVersion": "1.0.921",
"extVersion": "1.0.922",
"minVersion": "12"
},
"harmony": "-"

Loading…
Cancel
Save