Commit a00580e1 authored by 郭志伟's avatar 郭志伟

Merge branch 'fix/goods' into 'master'

补充华贵协议;年收入问题;开启保障带参回显屏蔽;微信群问题修复

See merge request !69
parents fa5477f8 d02f1e7d
......@@ -4,7 +4,7 @@
* @Description: 华贵大麦2020定期寿险
* @Date: 2020-07-27 15:46:37
* @LastEditors: gzw
* @LastEditTime: 2020-08-20 20:28:30
* @LastEditTime: 2020-08-24 18:55:19
*/
import goodsBg from "@/assets/images/goods/detail/shouxian/bg.png";
......@@ -52,7 +52,7 @@ export default {
planCellInfo: [
{ title: "身故保险金", value: "100%基础保额(最高350万)" },
{ title: "全残保险金", value: "100%基础保额(最高350万)" },
{ title: "投保年龄%赔付)", value: "18~60周岁" },
{ title: "投保年龄", value: "18~60周岁" },
{ title: "保障期限", value: "保10年/20年/30年" },
{ title: " ", value: "保至60岁/65岁/70岁" }
],
......@@ -157,6 +157,18 @@ export default {
{
title: "人身保险投保提示书",
url: "http://mangguo-contract.qthbx.com/hua-gui-ren-shen-bao-xian-tou-bao-ti-shi-shu-v1/"
},
{
title: "税收居民身份声明",
url: "http://mangguo-contract.qthbx.com/hua-gui-shui-shou-ju-min-shen-fen-sheng-ming-v1/"
},
{
title: "风控查询授权说明书",
url: " http://mangguo-contract.qthbx.com/hua-gui-feng-kong-cha-xun-shou-quan-shuo-ming-shu-v1/"
},
{
title: "转账授权书",
url: "http://mangguo-contract.qthbx.com/hua-gui-zhuan-zhang-shou-quan-shu-v1/"
}
],
protocolData: [
......
......@@ -5,46 +5,59 @@
<svg-icon icon-class="triangle-right" slot="button" />
</div>
<cr-popup v-model="show" position="bottom" get-container="body">
<cr-date-picker
ref="datepicker"
:before="before"
:later="later"
<date-picker
v-model="pickerVal"
type="date"
:min-date="minDate"
:max-date="maxDate"
@confirm="onConfirm"
@cancel="onCancel"
:init-value="initVal"
/>
</cr-popup>
</div>
</template>
<script>
import popupPickerMixin from "../mixins/popupPicker.mixin.js";
import { parseTime } from "@/service/utils";
import DatePicker from "vant/lib/datetime-picker";
import "vant/lib/datetime-picker/style";
import { format as dateFormat } from "date-fns";
const currentYear = new Date().getFullYear();
const VALUE_CHANGE_EVENT = "input";
export default {
name: "PopupDatePicker",
mixins: [popupPickerMixin],
components: {
DatePicker
},
props: {
before: {
type: Number,
value: null,
placeholder: {
type: String,
default: "请选择"
},
pickerData: {
type: Array,
default() {
return 100;
return [];
}
},
needInit: {
type: Boolean,
default: true
minDate: {
type: Date,
default: () => new Date(currentYear - 10, 0, 1),
validator: isDate
},
later: {
type: Number,
default() {
return 60;
}
maxDate: {
type: Date,
default: () => new Date(currentYear + 10, 11, 31),
validator: isDate
}
},
data() {
return {
show: false,
pickerVal: "",
refreshed: false,
refName: "datepicker",
initVal: ""
pickerValShow: ""
};
},
watch: {
......@@ -52,18 +65,8 @@ export default {
immediate: true,
handler(val) {
if (val) {
this.initVal = val;
this.handleResult(val);
}
}
},
needInit: {
immediate: true,
handler(val) {
if (!val) {
this.initVal = "";
} else {
this.initVal = parseTime("", "{y}-{m}-{d}");
this.pickerValShow = val;
this.pickerVal = new Date(val);
}
}
}
......@@ -71,22 +74,25 @@ export default {
methods: {
handleResult(res) {
this.pickerValShow = res;
this.pickerVal = res;
if (res) {
this.pickerValShow = dateFormat(res, "yyyy-MM-dd");
this.pickerVal = new Date(res);
}
},
setDefaultVal() {
setTimeout(() => {
const $datepicker = this.$refs.datepicker;
const $picker = $datepicker.$refs.picker;
const columns = $datepicker.columns;
$datepicker.setInitValue();
$picker.setColumnIndex(0, columns[0].selectedIndex);
$picker.setColumnIndex(1, columns[1].selectedIndex);
$picker.setColumnIndex(2, columns[2].selectedIndex);
});
onCancel() {
this.show = false;
},
onConfirm() {
this.handleResult(this.pickerVal);
this.$emit(VALUE_CHANGE_EVENT, this.pickerValShow);
this.onCancel();
}
}
};
function isDate(val) {
return Object.prototype.toString.call(val) === "[object Date]" && !isNaN(val.getTime());
}
</script>
<style lang="less">
.picker-wrap {
......
......@@ -38,7 +38,7 @@
type="date"
:min-date="minDate"
:max-date="maxDate"
@change="onPickerChange('', 'birthday')"
@change="onPickerChange('', '', 'birthday')"
:show-toolbar="false"
tem-height="35"
visible-item-count="5"
......@@ -153,20 +153,13 @@
<script>
import DatePicker from "vant/lib/datetime-picker";
import "vant/lib/datetime-picker/style";
import moment from "moment";
import { subYears, format as dateFormat } from "date-fns";
import CrRadioBtn from "@/components/CrRadioBtn";
import Card from "@/components/Card";
import localStorage from "@/service/localStorage";
import areaList from "@qg/cherry-ui/src/area/demo/china";
import { subCulQus } from "@/api/consultant";
const START_YEAR = moment(new Date())
.subtract(65, "years")
.format("YYYY-MM-DD");
const END_YEAR = moment(new Date())
.subtract(18, "years")
.format("YYYY-MM-DD");
export default {
name: "ConsultantQuestion",
components: {
......@@ -190,8 +183,8 @@ export default {
relation: ""
},
formBirth: new Date("1990-01-01"),
minDate: new Date(START_YEAR),
maxDate: new Date(END_YEAR),
minDate: subYears(new Date(), 65),
maxDate: subYears(new Date(), 18),
currentStep: 0,
showSubState: false,
stepTips: [
......@@ -317,7 +310,7 @@ export default {
},
onPickerChange(picker, value, type) {
if (type === "birthday") {
value = moment(this.formBirth).format("YYYY-MM-DD");
value = dateFormat(this.formBirth, "yyyy-MM-dd");
}
if (type === "annualIncome" || type === "loan") {
value = value[0];
......
......@@ -342,7 +342,7 @@ export default {
productNo: this.goodId,
productUserInfo: {
insuredUserInfo: {
idNo,
idNo: idNoWho,
socialSecurity: socialSecurity ? !!Number(socialSecurity) : undefined,
userInfoSecId: userInfoSecId ? userInfoSecId : undefined
},
......
......@@ -105,7 +105,7 @@
*/
import DatePicker from "vant/lib/datetime-picker";
import "vant/lib/datetime-picker/style";
import moment from "moment";
import { subYears, format as dateFormat } from "date-fns";
import CrRadioBtn from "@/components/CrRadioBtn";
import Card from "@/components/Card";
import Copyright from "@/components/Copyright";
......@@ -127,12 +127,6 @@ import detailLoginMixin from "./modules/detailLogin.mixin";
import Detail from "@/api/detail.huagui.shouxian";
import { trail, list } from "@/api/product";
const START_YEAR = moment(new Date())
.subtract(60, "years")
.format("YYYY-MM-DD");
const END_YEAR = moment(new Date())
.subtract(18, "years")
.format("YYYY-MM-DD");
export default {
name: "GoodsDetail-LI",
......@@ -170,8 +164,8 @@ export default {
formData: {
payType: "1"
},
minDate: new Date(START_YEAR),
maxDate: new Date(END_YEAR),
minDate: subYears(new Date(), 60),
maxDate: subYears(new Date(), 18),
read: true,
showLayer: false,
showCalDate: false,
......@@ -223,7 +217,7 @@ export default {
},
onBirthConfirm(val) {
this.showCalDate = false;
this.$set(this.formData, "birth", moment(val).format("YYYY-MM-DD"));
this.$set(this.formData, "birth", val ? dateFormat(new Date(val), "yyyy-MM-dd") : "");
},
openIframePupop(index) {
if (index === 4) {
......
......@@ -329,7 +329,7 @@ export default {
productNo: this.goodId,
productUserInfo: {
insuredUserInfo: {
idNo,
idNo: idNoWho,
socialSecurity: socialSecurity ? !!Number(socialSecurity) : undefined,
userInfoSecId: userInfoSecId ? userInfoSecId : undefined
},
......
......@@ -58,7 +58,8 @@ const DATA_CHANGE_EVENT = "input";
import liDetail from "@/api/detail.huagui.shouxian";
import liCalFee from "./liCalFee.mixin";
const { paywayOptions, sexOptions, insuredAmountOptions, termOptions, benefitOptions } = liDetail;
import moment from "moment";
import fromNow from "date-fns/formatDistanceToNowStrict";
export default {
name: "CalInsuredFee",
mixins: [liCalFee],
......@@ -100,7 +101,11 @@ export default {
},
computed: {
age() {
const userAge = parseInt(moment(this.formData.birth).fromNow(), 10);
const userAge = this.formData.birth
? parseInt(
fromNow(new Date(this.formData.birth), { unit: "year", roundingMethod: "floor" })
)
: "";
return isNaN(userAge) ? 18 : userAge;
}
},
......
......@@ -9,7 +9,13 @@
placeholder="请输入投保人姓名"
label="姓名"
:readonly="selfInfoReadonly"
:rules="[{ required: true, message: '请输入姓名' }]"
:rules="[
{ required: true, message: '请输入姓名' },
{
validator: isChineseNameMask,
message: '请填写正确的投保人姓名,最少2个中文字符'
}
]"
@click.native="inputClick"
/>
<cr-field
......@@ -18,7 +24,13 @@
placeholder="信息保密,仅用于投保"
label="身份证号"
:readonly="selfInfoReadonly"
:rules="[{ required: true, message: '请输入身份证号' }]"
:rules="[
{ required: true, message: '请输入身份证号' },
{
validator: isIdNoMask,
message: '请填写正确的投保人身份证号'
}
]"
@click.native="inputClick"
/>
<cr-field
......@@ -27,7 +39,13 @@
placeholder="请输入您的手机号码"
label="手机号码"
:readonly="selfInfoReadonly"
:rules="[{ required: true, message: '请输入手机号码' }]"
:rules="[
{ required: true, message: '请输入手机号码' },
{
validator: isPhoneMask,
message: '请填写正确的投保人手机号'
}
]"
@click.native="inputClick"
/>
<cr-field
......@@ -145,11 +163,10 @@ import Card from "@/components/Card";
import Modal from "@/components/Modal";
import { mapState, mapActions } from "vuex";
import { getFamilyList, getCaptchaSms } from "@/api/user";
import { isPhone } from "@/service/validation";
import localStorage from "@/service/localStorage";
import CrRadioBtn from "@/components/CrRadioBtn";
import autoSaveForm from "@/mixins/autoSaveForm.mixin";
import { isIdNo, isChineseName, isPhone } from "@/service/validation";
const AUTO_SAVE_KEY = "DetailFormData";
const AUTO_SAVE_TARGET = "formData";
const DATA_CHANGE_EVENT = "input";
......@@ -268,6 +285,27 @@ export default {
methods: {
...mapActions(["setAuthXyqb"]),
...mapActions("user", ["setUserInfo"]),
isIdNoMask(str) {
if (str && str.indexOf("************") > -1) {
return true;
} else {
return isIdNo(str);
}
},
isChineseNameMask(str) {
if (str && str.indexOf("*") > -1) {
return true;
} else {
return isChineseName(str);
}
},
isPhoneMask(str) {
if (str && str.indexOf("****") > -1) {
return true;
} else {
return isPhone(str);
}
},
inputClick() {
if (this.showAuthXyqb === 1) {
this.setAuthXyqb(2);
......@@ -317,20 +355,12 @@ export default {
this.selfInfoReadonly = true;
}
});
let userArray = this.familyList.filter(
item => item.userInfoSecId === sessionStorage.getItem(this.detailType + "userInfoSecId")
);
if (!userArray.length) {
userArray = this.familyList.filter(item => item.relation === +relation);
} else {
this.formData.relation = sessionStorage.getItem(this.detailType + "relation");
}
let userArray = this.familyList.filter(item => item.relation === +relation);
let [name, idNo, userInfoSecId, socialSecurity] = ["", "", "", ""];
if (
relation ===
(localStorage.get(this.autoSaveKey) && localStorage.get(this.autoSaveKey).relation)
) {
sessionStorage.removeItem(this.detailType + "userInfoSecId");
const {
name: cachename,
idNo: cacheidNo,
......@@ -378,7 +408,6 @@ export default {
//
}
}
// sessionStorage.removeItem(this.detailType + "relation");
},
async getFamilyList() {
this.mongoToken = localStorage.get("mongoToken");
......@@ -391,9 +420,6 @@ export default {
this.getSaveInfoHandler(this.autoSaveKey, AUTO_SAVE_TARGET);
} else {
let relation = this.formData.relation;
if (sessionStorage.getItem(this.detailType + "relation")) {
relation = sessionStorage.getItem(this.detailType + "relation");
}
(this.showAuthXyqb || this.mongoToken) && this.relationChange(relation);
}
}
......
......@@ -149,8 +149,8 @@
<template #input>
<popup-date-picker
v-model="formData.holderUserInfo.validEnd"
:before="0"
:later="100"
:min-date="minDate"
:max-date="maxDate"
placeholder="请选择您的证件有效止期"
/>
</template>
......@@ -345,8 +345,8 @@
<template #input>
<popup-date-picker
v-model="formData.insuredUserInfo.validEnd"
:before="0"
:later="100"
:min-date="minDate"
:max-date="maxDate"
placeholder="请选择您的证件有效止期"
/>
</template>
......@@ -440,6 +440,22 @@
]"
/>
</cr-cell-group>
<div class="pay-protocol">
<div class="pay-protocol-link">
<a href="javascript:;" @click="openIframePupop(0)">保险条款</a>
<i></i>
<a href="javascript:;" @click="openIframePupop(2)">投保须知与声明</a>
<i></i>
<a href="javascript:;" @click="openIframePupop(3)">服务协议</a>
<i></i>
<a href="javascript:;" @click="openIframePupop(11)">转账授权书</a>
</div>
<div class="pay-protocol-link pay-protocol-link_wrap">
<a href="javascript:;" @click="openIframePupop(8)">人身保险投保提示书</a>
<a href="javascript:;" @click="openIframePupop(9)">税收居民身份证明</a>
<a href="javascript:;" @click="openIframePupop(10)">风控查询授权说明书</a>
</div>
</div>
<good-action :content="goodActionInfo" />
</cr-form>
<go-insure-dialog
......@@ -457,12 +473,12 @@
<i></i>
<a href="javascript:;" @click="openIframePupop(3)">服务协议</a>
<i></i>
<a href="javascript:;" @click="openIframePupop(1)">转账授权书</a>
<a href="javascript:;" @click="openIframePupop(11)">转账授权书</a>
</div>
<div class="pay-protocol-link pay-protocol-link_wrap">
<a href="javascript:;" @click="openIframePupop(8)">人身保险投保提示书</a>
<a href="javascript:;" @click="openIframePupop(3)">税收居民身份证明</a>
<a href="javascript:;" @click="openIframePupop(3)">风控查询授权</a>
<a href="javascript:;" @click="openIframePupop(9)">税收居民身份证明</a>
<a href="javascript:;" @click="openIframePupop(10)">风控查询授权说明</a>
</div>
</div>
</go-insure-dialog>
......@@ -499,8 +515,9 @@ import GoInsureDialog from "@/views/Goods/Detail/modules/GoInsureDialog";
import detailPayMixin from "@/views/Goods/Detail/modules/detailPay.mixin";
import autoSaveForm from "@/mixins/autoSaveForm.mixin";
import liCalFee from "@/views/Goods/Detail/modules/liCalFee.mixin";
import moment from "moment";
import _ from "lodash";
import { addDays, addYears, format as dateFormat } from "date-fns";
import debounce from "lodash/debounce";
import fromNow from "date-fns/formatDistanceToNowStrict";
import localStorage from "@/service/localStorage";
import { mapState, mapActions } from "vuex";
......@@ -550,6 +567,8 @@ export default {
popupArray,
headerInfo,
calTimer: null,
minDate: addDays(new Date(), 1),
maxDate: addYears(new Date(), 100),
clearInsured: false,
goInsureState: false,
popupShow: false,
......@@ -678,7 +697,9 @@ export default {
const currentIdNo = this.getRealIdNo();
if (!currentIdNo) return;
const birthday = this.getBirthDate(currentIdNo);
const userAge = parseInt(moment(birthday).fromNow(), 10);
const userAge = birthday
? parseInt(fromNow(new Date(birthday)), { unit: "year", roundingMethod: "floor" })
: "";
return isNaN(userAge) ? 18 : userAge;
},
pupopData() {
......@@ -779,9 +800,14 @@ export default {
this.subFormData.insuredUserInfo.longTerm = longTerm === "2" ? true : false;
this.subFormData.holderUserInfo.longTerm = longTerm === "2" ? true : false;
if (relation === "1") {
const { weight, height, socialSecurity } = this.subFormData.insuredUserInfo;
this.subFormData.holderUserInfo = {
...this.subFormData.holderUserInfo,
...this.subFormData.insuredUserInfo
...{
weight,
height,
socialSecurity
}
};
delete this.subFormData.insuredUserInfo;
}
......@@ -900,21 +926,17 @@ export default {
: currentIdNo;
return currentIdNo;
},
setEffectiveDate: _.debounce(function() {
setEffectiveDate: debounce(function() {
const currentIdNo = this.getRealIdNo();
if (!currentIdNo) return;
const birthday = this.getBirthDate(currentIdNo);
const birthdayArr = birthday.split("-");
const currentdayArr = moment()
.format("YYYY-MM-DD")
.split("-");
const currentdayArr = dateFormat(new Date(), "yyyy-MM-dd").split("-");
const nextDate =
birthdayArr[1] === currentdayArr[1] && +currentdayArr[2] === +birthdayArr[2] - 1
? moment().format("YYYY-MM-DD 00:00:00")
: moment()
.add(1, "d")
.format("YYYY-MM-DD 00:00:00");
this.formData.effectiveDate = nextDate;
? new Date()
: addDays(new Date(), 1);
this.formData.effectiveDate = dateFormat(nextDate, "yyyy-MM-dd") + " 00:00:00";
}),
resetFormItemVal(key, val) {
const currentIdNo = this.getRealIdNo();
......
......@@ -2895,6 +2895,11 @@ dashdash@^1.12.0:
dependencies:
assert-plus "^1.0.0"
date-fns@^2.15.0:
version "2.15.0"
resolved "http://npmprivate.quantgroups.com/date-fns/-/date-fns-2.15.0.tgz#424de6b3778e4e69d3ff27046ec136af58ae5d5f"
integrity sha512-ZCPzAMJZn3rNUvvQIMlXhDr4A+Ar07eLeGsGREoWU19a3Pqf5oYa+ccd+B3F6XVtQY6HANMFdOQ8A+ipFnvJdQ==
de-indent@^1.0.2:
version "1.0.2"
resolved "http://npmprivate.quantgroups.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d"
......@@ -5652,11 +5657,6 @@ mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@~0.5.1:
dependencies:
minimist "^1.2.5"
moment@^2.27.0:
version "2.27.0"
resolved "http://npmprivate.quantgroups.com/moment/-/moment-2.27.0.tgz#8bff4e3e26a236220dfe3e36de756b6ebaa0105d"
integrity sha512-al0MUK7cpIcglMv3YF13qSgdAIqxHTO7brRtaz3DlSULbqfazqkc5kEjNrLDOM7fsjshoFIihnU8snrP7zUvhQ==
move-concurrently@^1.0.1:
version "1.0.1"
resolved "http://npmprivate.quantgroups.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92"
......
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