zhaoxiaoqiang
2021-04-16 e32b1699230ef3d1ed9a477553769de757e9f714
身份证验证规则
2 files modified
288 ■■■■ changed files
package-lock.json 61 ●●●● patch | view | raw | blame | history
src/views/old/store/wx-pay-score.vue 227 ●●●● patch | view | raw | blame | history
package-lock.json
@@ -1519,7 +1519,8 @@
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
      "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
      "dev": true
      "dev": true,
      "optional": true
    },
    "assign-symbols": {
      "version": "1.0.0",
@@ -1860,6 +1861,7 @@
      "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz",
      "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=",
      "dev": true,
      "optional": true,
      "requires": {
        "hoek": "2.x.x"
      }
@@ -2430,6 +2432,7 @@
      "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
      "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
      "dev": true,
      "optional": true,
      "requires": {
        "delayed-stream": "~1.0.0"
      }
@@ -3113,7 +3116,8 @@
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
      "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
      "dev": true
      "dev": true,
      "optional": true
    },
    "depd": {
      "version": "1.1.2",
@@ -3828,7 +3832,8 @@
      "version": "1.3.0",
      "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
      "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=",
      "dev": true
      "dev": true,
      "optional": true
    },
    "fast-deep-equal": {
      "version": "2.0.1",
@@ -4097,7 +4102,8 @@
        "ansi-regex": {
          "version": "2.1.1",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        },
        "aproba": {
          "version": "1.2.0",
@@ -4118,12 +4124,14 @@
        "balanced-match": {
          "version": "1.0.0",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        },
        "brace-expansion": {
          "version": "1.1.11",
          "bundled": true,
          "dev": true,
          "optional": true,
          "requires": {
            "balanced-match": "^1.0.0",
            "concat-map": "0.0.1"
@@ -4138,17 +4146,20 @@
        "code-point-at": {
          "version": "1.1.0",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        },
        "concat-map": {
          "version": "0.0.1",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        },
        "console-control-strings": {
          "version": "1.1.0",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        },
        "core-util-is": {
          "version": "1.0.2",
@@ -4265,7 +4276,8 @@
        "inherits": {
          "version": "2.0.4",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        },
        "ini": {
          "version": "1.3.5",
@@ -4277,6 +4289,7 @@
          "version": "1.0.0",
          "bundled": true,
          "dev": true,
          "optional": true,
          "requires": {
            "number-is-nan": "^1.0.0"
          }
@@ -4291,6 +4304,7 @@
          "version": "3.0.4",
          "bundled": true,
          "dev": true,
          "optional": true,
          "requires": {
            "brace-expansion": "^1.1.7"
          }
@@ -4298,12 +4312,14 @@
        "minimist": {
          "version": "0.0.8",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        },
        "minipass": {
          "version": "2.9.0",
          "bundled": true,
          "dev": true,
          "optional": true,
          "requires": {
            "safe-buffer": "^5.1.2",
            "yallist": "^3.0.0"
@@ -4322,6 +4338,7 @@
          "version": "0.5.1",
          "bundled": true,
          "dev": true,
          "optional": true,
          "requires": {
            "minimist": "0.0.8"
          }
@@ -4411,7 +4428,8 @@
        "number-is-nan": {
          "version": "1.0.1",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        },
        "object-assign": {
          "version": "4.1.1",
@@ -4423,6 +4441,7 @@
          "version": "1.4.0",
          "bundled": true,
          "dev": true,
          "optional": true,
          "requires": {
            "wrappy": "1"
          }
@@ -4508,7 +4527,8 @@
        "safe-buffer": {
          "version": "5.1.2",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        },
        "safer-buffer": {
          "version": "2.1.2",
@@ -4544,6 +4564,7 @@
          "version": "1.0.2",
          "bundled": true,
          "dev": true,
          "optional": true,
          "requires": {
            "code-point-at": "^1.0.0",
            "is-fullwidth-code-point": "^1.0.0",
@@ -4563,6 +4584,7 @@
          "version": "3.0.1",
          "bundled": true,
          "dev": true,
          "optional": true,
          "requires": {
            "ansi-regex": "^2.0.0"
          }
@@ -4606,12 +4628,14 @@
        "wrappy": {
          "version": "1.0.2",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        },
        "yallist": {
          "version": "3.1.1",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        }
      }
    },
@@ -4930,7 +4954,8 @@
      "version": "2.16.3",
      "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz",
      "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=",
      "dev": true
      "dev": true,
      "optional": true
    },
    "homedir-polyfill": {
      "version": "1.0.3",
@@ -5695,7 +5720,8 @@
      "version": "0.1.1",
      "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
      "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
      "dev": true
      "dev": true,
      "optional": true
    },
    "jsesc": {
      "version": "2.5.2",
@@ -9809,7 +9835,8 @@
      "version": "0.14.5",
      "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
      "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=",
      "dev": true
      "dev": true,
      "optional": true
    },
    "type-check": {
      "version": "0.3.2",
src/views/old/store/wx-pay-score.vue
@@ -12,49 +12,123 @@
            <tab-item v-for="(item, index) in tabList" :key="index" :selected="activeTab === index"
                @on-item-click="handleTabChange(index)">{{ item }}</tab-item>
        </tab> -->
    <van-nav-bar title="和微分" left-text="返回" left-arrow @click-left="onClickLeft" style="line-height: 43px;">
        <i class="iconfont iconzuojiantou" slot="left" style="font-size: 25px;"></i>
        <van-nav-bar
            title="和微分"
            left-text="返回"
            left-arrow
            @click-left="onClickLeft"
            style="line-height: 43px;"
        >
            <i
                class="iconfont iconzuojiantou"
                slot="left"
                style="font-size: 25px;"
            ></i>
    </van-nav-bar>
        <div class="search">
            <selector title='活动编码' placeholder='请选择' @on-change='handleContIdChange' v-model="contSendCode"
                  :options='form.cmccWxpayContList' :value-map="['contCode','contName']" direction='rtl'></selector>
            <selector
                title="活动编码"
                placeholder="请选择"
                @on-change="handleContIdChange"
                v-model="contSendCode"
                :options="form.cmccWxpayContList"
                :value-map="['contCode', 'contName']"
                direction="rtl"
            ></selector>
        </div>
        <group  class="group-content">
            <div class="title">
                <span class="line" :style="{background:$store.state.defaultBgColor}"></span>
                <span
                    class="line"
                    :style="{ background: $store.state.defaultBgColor }"
                ></span>
                活动信息
            </div>
                <div class="form-content">
                <x-input title='活动ID' v-model.trim="contSendCode" readonly text-align='right'></x-input>
                <x-input title='活动名称' v-model.trim="contName" readonly text-align='right'></x-input>
                <x-input title='合约期' v-model.trim="term" readonly text-align='right'></x-input>
                <x-input title='担保金额' v-model.trim="guaranteedAmt" readonly text-align='right'></x-input>
                <x-input
                    title="活动ID"
                    v-model.trim="contSendCode"
                    readonly
                    text-align="right"
                ></x-input>
                <x-input
                    title="活动名称"
                    v-model.trim="contName"
                    readonly
                    text-align="right"
                ></x-input>
                <x-input
                    title="合约期"
                    v-model.trim="term"
                    readonly
                    text-align="right"
                ></x-input>
                <x-input
                    title="担保金额"
                    v-model.trim="guaranteedAmt"
                    readonly
                    text-align="right"
                ></x-input>
            </div>
             <div style="height: 10px; background: #f5f5f5;"></div>
            <div class="title" style="border-radius:6px;">
                <span class="line" :style="{background:$store.state.defaultBgColor}"></span>
                <span
                    class="line"
                    :style="{ background: $store.state.defaultBgColor }"
                ></span>
                用户信息
            </div>
            <div class="form-content">
                <x-input title='用户姓名' v-model.trim="userName" placeholder='请输入' text-align='right' />
                <selector title='归属地' placeholder='请选择' @on-change='handleRegionChange' v-model="regionCode"
                          :options='form.regionList' :value-map="['code','name']" direction='rtl'></selector>
                <x-input title='身份证号码' :max="18" v-model.trim="idCardNo" placeholder='请输入' text-align='right' />
                <x-input
                    title="用户姓名"
                    v-model.trim="userName"
                    placeholder="请输入"
                    text-align="right"
                />
                <selector
                    title="归属地"
                    placeholder="请选择"
                    @on-change="handleRegionChange"
                    v-model="regionCode"
                    :options="form.regionList"
                    :value-map="['code', 'name']"
                    direction="rtl"
                ></selector>
                <x-input
                    title="身份证号码"
                    :max="18"
                    v-model.trim="idCardNo"
                    placeholder="请输入"
                    text-align="right"
                />
                <van-field
                        v-model="mblNo"
                        clearable
                        maxlength='11'
                    maxlength="11"
                        type="number"
                        placeholder="手机号码"
                >
                    <van-button v-if="mblNoType==0||mblNoType==1" class="mgs-btn" slot="button" size="small" @click="mblVertify" >可用查询</van-button>
                    <van-button
                        v-if="mblNoType == 0 || mblNoType == 1"
                        class="mgs-btn"
                        slot="button"
                        type="warning"
                        size="small"
                        @click="mblVertify"
                        >可用查询</van-button
                    >
                </van-field>
            </div>
        </group>
        <div class="btn-box">
            <van-button round :color="$store.state.backColor" class="btn2" @click="wxScoreOrderCreate">生成二维码</van-button>
            <van-button
                round
                :color="$store.state.backColor"
                class="btn2"
                @click="wxScoreOrderCreate"
                >生成二维码</van-button
            >
        </div>
        <Vdialog @cancel="cancel" :show="showDia"></Vdialog>
  </div>
@@ -63,19 +137,14 @@
<script>
    import QRCode from 'qrcode';
    import FConfirmSimple from '@/components/old/FConfirmSimple.vue';
    import Vdialog from "@/components/common/v-dialog.vue";
    import {
        mapState,
        mapActions
    } from 'vuex';
    import {
        Datetime,
        XAddress,
    } from 'vux';
import Vdialog from '@/components/common/v-dialog.vue';
import { mapState, mapActions } from 'vuex';
import { Datetime, XAddress } from 'vux';
    export default {
        name: 'wx-pay-score',
        components: {
            FConfirmSimple,Vdialog
        FConfirmSimple,
        Vdialog,
        },
        data() {
            return {
@@ -99,32 +168,34 @@
                        type: Array,
                        default: () => {
                            return [];
                        }
                    },
                    },
                    mblNoTypeList: {
                        type: Array,
                        default: () => {
                            return [];
                        }
                    },
                    },
                    regionList: {
                        type: Array,
                        default: () => {
                            return [];
                        }
                    }
                }
                    },
                },
            },
            isClick:false
            };
        },
        computed:{
        },
    computed: {},
        created(){
            this.mblNoType = this.$route.query.mblNoType;
            this.$api.wxScoreInit({type:this.mblNoType}).then(res => {
        this.$api.wxScoreInit({ type: this.mblNoType }).then(
            (res) => {
                this.form = res.body || {};
                var arr = res.body.terms;
            }, err => err);
            },
            (err) => err
        );
        },
        methods: {
            //顶部tabbar返回按钮
@@ -133,7 +204,9 @@
            },
            // 套餐类型
            handleContIdChange(val) {
                let currentEle=JSON.parse(JSON.stringify(this.form.cmccWxpayContList)).find(item=>item.contCode===val)
            let currentEle = JSON.parse(
                JSON.stringify(this.form.cmccWxpayContList)
            ).find((item) => item.contCode === val);
                this.contId = currentEle.contId;
                this.contSendCode = currentEle.contCode;
                this.contName = currentEle.contName;
@@ -143,8 +216,10 @@
            },
            // 市区
            handleRegionChange(val) {
                let currentEle = JSON.parse(JSON.stringify(this.form.regionList)).find((item) => {
                    return item.code = val;
            let currentEle = JSON.parse(
                JSON.stringify(this.form.regionList)
            ).find((item) => {
                return (item.code = val);
                });
            },
            // 账号类型
@@ -170,6 +245,10 @@
                    v.toast('请输入用户身份证号');
                    return false;
                }
            if(!v.checkIDCard(this.idCardNo)){
                v.toast('身份证号格式不正确');
                return false;
            }
                if (v.checkValEmpty(this.mblNo)) {
                    v.toast('请输入用户手机号');
                    return false;
@@ -178,15 +257,19 @@
                    v.toast('请输入正确的用户手机号');
                    return false;
                }
                this.$api.wxScoreVertify({
            this.$api
                .wxScoreVertify({
                    cardNo: this.idCardNo,
                    contCode:this.contSendCode,
                    mblNo: this.mblNo,
                    mblNoType: this.mblNoType,
                    regionCode: this.regionCode
                }).then(res => {
                    this.creditId = res.body.creditId
                    this.vertifyStatus = res.body.status
                    regionCode: this.regionCode,
                })
                .then(
                    (res) => {
                        this.isClick =true;
                        this.creditId = res.body.creditId;
                        this.vertifyStatus = res.body.status;
                    if(this.vertifyStatus == 0){
                        v.toast('号码不可用');
                        return false;
@@ -194,7 +277,10 @@
                        v.toast('号码可用');
                        return false;
                    }
                }, err => err);
                    },
                    (err) => err
                );
            },
            // 提交订单
            wxScoreOrderCreate(val) {
@@ -219,6 +305,10 @@
                    v.toast('请输入用户身份证号');
                    return false;
                }
            if(!v.checkIDCard(this.idCardNo)){
                v.toast('身份证号格式不正确');
                return false;
            }
                if (v.checkValEmpty(this.mblNo)) {
                    v.toast('请输入用户手机号');
                    return false;
@@ -229,12 +319,19 @@
                }
                if(this.mblNoType == 2){
                    this.vertifyStatus = 1;
            }else{
                if(!this.isClick){
                    v.toast('请先点击可用查询后生成二维码');
                    return false;
                }
            }
            // console.log('ces', this.vertifyStatus + '你');
                if(this.vertifyStatus == 0){
                    v.toast('号码不可用');
                    return false;
                }
                this.$api.wxScoreCreate({
            this.$api
                .wxScoreCreate({
                    mblNoType:this.mblNoType,
                    creditId: this.creditId,
                    contId: this.contId,
@@ -242,14 +339,18 @@
                    mblNo: this.mblNo,
                    contCode: this.contSendCode,
                    regionCode: this.regionCode,
                    userName: this.userName
                }).then(res => {
                    this.qrCode = res.body.qrCode
                    this.orderId = res.body.orderId
                    userName: this.userName,
                })
                .then(
                    (res) => {
                        this.qrCode = res.body.qrCode;
                        this.orderId = res.body.orderId;
                    if (this.qrCode) {
                        this.createdQRCode();
                    }
                }, err => err);
                    },
                    (err) => err
                );
            },
            // 生成二维码
            createdQRCode() {
@@ -260,17 +361,16 @@
                    term: this.term,
                    guaranteedAmt: this.guaranteedAmt,
                    monGiftAmt: this.monGiftAmt,
                }
            };
                this.$router.push({
                    path: "/wx-getWxQRCode",
                    query: queryObj
                })
                path: '/wx-getWxQRCode',
                query: queryObj,
            });
            },
        },
    };
</script>
<style lang='less' scoped >
<style lang="less" scoped>
    // /deep/.myDisableIpt{
    //     color: #999999;
    // }
@@ -298,7 +398,11 @@
    .mer{
        width: 100%;
        height: 150px;
        background: linear-gradient(-45deg,rgba(104,98,133,1),rgba(76,69,113,1));
    background: linear-gradient(
        -45deg,
        rgba(104, 98, 133, 1),
        rgba(76, 69, 113, 1)
    );
        overflow: hidden;
        &-head{
            width: 96%;
@@ -351,7 +455,7 @@
    }
    .hb-credit-installment {
        background-color: #F5F5F7;
    background-color: #f5f5f7;
        // padding-top: 54px;
        min-height: 100%;
        .title {
@@ -409,5 +513,4 @@
            width: 80%;
        }
    }
</style>