123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854 |
- <!DOCTYPE html>
- <html class="">
- <!--STATUS OK-->
- <head>
- <meta name="referrer" content="always" />
- <meta charset='utf-8' />
- <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
- <meta http-equiv="x-dns-prefetch-control" content="on">
- <meta name="description" content="">
- <meta name="format-detection" content="telephone=no" />
- <link rel="stylesheet" type="text/css" href="css/vant-ui.css" />
- <link rel="stylesheet" type="text/css" href="css/iconfont.css">
- <link rel="stylesheet" type="text/css" href="css/main.css" />
- <link rel="stylesheet" type="text/css" href="css/style.css" />
- <script src="js/vue.js"></script>
- <script src="js/vant-ui.js"></script>
- <script src="js/main.js"></script>
- <title></title>
- </head>
- <style>
- #app {
- background: linear-gradient(180deg, rgba(0, 160, 234, 1), rgba(0, 95, 163, 1)) !important;
- }
- .login {
- padding-bottom: 0rem;
- height: auto;
- padding-top: .01rem;
- background: none;
- }
- .login .loginFix {
- position: absolute;
- }
- .login .loginBox {
- width: 90%;
- height: auto;
- padding: 10px;
- padding-bottom: 1rem;
- }
- .pull-right {
- width: .15rem !important;
- height: .3rem !important;
- }
- .brandList {
- display: flex;
- width: 100%;
- flex-wrap: wrap;
- margin-top: .8rem;
- }
- .brandList .brandItem,
- .brandList .choose {
- width: 40%;
- margin: .1rem .3rem;
- }
- .brandItem {
- height: .6rem;
- }
- .anniu>input {
- width: 90%;
- height: .86rem;
- background: rgba(0, 160, 234, 1);
- border-radius: 5rem;
- color: #fff;
- font-size: .31rem;
- margin-top: .5rem;
- }
- .getCodeBtn {
- width: 150px;
- background-color: #00a0ea;
- padding: 5px;
- color: #fff;
- border-radius: 8px 5px;
- text-align: center;
- }
- .dontSend {
- background-color: #ccc !important;
- color: #999 !important;
- }
- .hasClick {
- border: 1px solid#ccc;
- padding: 0.05rem;
- }
- .noclick {
- padding: 0.05rem;
- }
- </style>
- <body>
- <div id="app" style="overflow-y: scroll" v-cloak>
- <!-- 附件上传 -->
- <div class="login">
- <div class="loginBox">
- <div class="biaoti" style="margin-top: 0.4rem;"><img src="image/xiantiao.png" alt=""><span
- style="margin-top:-0.175rem">附件上传</span><img src="image/xiantiao1.png" alt="">
- </div>
- <div class="brandList" style="text-align: center">
- <div class="choose">
- <p>
- 营业执照
- </p>
- <input accept="image/x-png,image/gif,image/jpeg,image/bmp" class="change" id="files1"
- type="file" multiple="multiple" style="width: 6.78rem;opacity: 0"
- onchange="changePhoto(event,1)" />
- <img :src="urldata1 == '' ? './image/biankuang.png' : urldata1" style="margin: .3rem auto;"
- v-on:click="choosePhoto(1)" />
- </div>
- <div class="choose">
- <p>
- 门头照片
- </p>
- <input accept="image/x-png,image/gif,image/jpeg,image/bmp" class="change" id="files2"
- type="file" multiple="multiple" style="width: 6.78rem;opacity: 0"
- onchange="changePhoto(event,2)" />
- <img :src="urldata2 == '' ? './image/biankuang.png' : urldata2" style="margin: .3rem auto;"
- v-on:click="choosePhoto(2)" />
- </div>
- </div>
- </div>
- </div>
- <div class="login" id="aui-header">
- <div class="loginBox">
- <div class="labelTitle flex a-center" style="margin-top: 0;">
- <b class="i1"></b> 公司名称
- </div>
- <div class="labelValue flex a-center">
- <input type="text" placeholder="请输入公司名称" v-model="companyName" v-on:change="check2" readonly />
- </div>
- <div class="labelTitle flex a-center" style="margin-top: 0;">
- <b class="i1"></b> 门店名称
- </div>
- <div class="labelValue flex a-center">
- <input type="text" placeholder="请输入门店名称" v-model="userName" v-on:change="check2" />
- </div>
- <div class="labelTitle flex a-center" style="margin-top: 0.3rem;">
- <b class="i2"></b> 法人
- </div>
- <div class="labelValue flex a-center">
- <input type="text" placeholder="请输入法人" v-model="legalPerson" v-on:change="check" readonly />
- </div>
- <div class="labelTitle flex a-center" style="margin-top: 0.3rem;">
- <b class="i2"></b> 联系人
- </div>
- <div class="labelValue flex a-center">
- <input type="text" placeholder="请输入联系人" v-model="userPerson" v-on:change="check" />
- </div>
- <div class="labelTitle flex a-center" style="margin-top: 0.3rem;">
- <b class="i2"></b> 联系电话
- </div>
- <div class="labelValue flex a-center">
- <input placeholder="请输入联系电话" v-model="userPhone" />
- </div>
- <div class="labelTitle flex a-center" style="margin-top: 0.3rem;">
- <b class="i2"></b> 验证码
- </div>
- <div class="labelValue flex a-center">
- <input placeholder="请输入验证码" v-model="userCode" />
- <div class="getCodeBtn" v-bind:class="wait < 60 ? 'dontSend' : ''" v-on:click="sendRegistCode">
- {{ wait == 60 ? '获取验证码' : (wait + "s 后重发") }}
- </div>
- </div>
- <div class="labelTitle flex a-center" style="margin-top: 0.3rem;">
- <b class="i2"></b> 选择地址
- </div>
- <div class="labelValue flex a-center">
- <input placeholder="点击选择地区" v-model="userDistrct" readonly="readonly" v-on:click="goMap" />
- </div>
- <div class="labelTitle flex a-center" style="margin-top: 0.3rem;">
- <b class="i2"></b> 详细地址
- </div>
- <div class="labelValue flex a-center">
- <input placeholder="请输入详细地址" v-model="userAddress" readonly="readonly" v-on:click="goMap" />
- </div>
- </div>
- <!-- 合作经销商 -->
- <div class="login">
- <div class="loginBox">
- <div class="labelTitle flex a-center" style="margin-top: 0;">
- <b class="i1"></b> 合作供应商
- </div>
- <div class="labelValue flex a-center">
- <input placeholder="请选择合作经销商" readonly="readonly" v-on:click="choosePosterM"
- v-model="choosePoster.name" />
- <img src="./image/009.png" class="pull-right" />
- </div>
- <div class="labelValue flex a-center">
- <input placeholder="请选择签约任务" readonly="readonly" v-model="chooseLv.name"
- v-on:click="choosesignLv" />
- <img src="./image/009.png" class="pull-right" />
- </div>
- <div class="biaoti" style="margin-top: 0.4rem;"><img src="image/xiantiao.png" alt=""><span
- style="margin-top: -0.175rem">合作品牌</span><img src="image/xiantiao1.png" alt="">
- </div>
- <div class="brandList">
- <img v-for="(brand,index) in choosePoster.meberArr" class="brandItem" :src="brand.url" alt=""
- v-bind:class="chooseBrands == index ? 'hasClick' : 'noclick'"
- v-on:click="chooseBrand(index)">
- <!--<img class="brandItem" src="image/015.png" alt="">
- <img class="brandItem" src="image/016.png" alt="">
- <img class="brandItem" src="image/017.png" alt="">-->
- </div>
- </div>
- </div>
- </div>
- <div class="login">
- <div class="loginBox">
- <div class="flex a-center checkedXieyi" style="padding-left:0.3rem">
- <van-checkbox v-model="xyChecked">
- </van-checkbox>
- <p style="margin-left:5px" v-on:click="lookPdf(0)">同意用户协议</p>
- </div>
- <div class="flex a-center checkedXieyi" style="padding-left:0.3rem">
- <van-checkbox v-model="zcChecked">
- </van-checkbox>
- <p style="margin-left:5px" v-on:click="lookPdf(1)">同意隐私政策</p>
- </div>
- <div class="anniu" v-if="inclick">
- <input type="submit" value="提交审批" v-on:click="startRegizeUser">
- </div>
- <div class="anniu" v-if="!inclick">
- <input type="submit" value="提交审批" style="background:#ccc">
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
- <script type="text/javascript" src="../script/aui_compress.min.js"></script>
- <script type="text/javascript" src="../script/jquery-1.11.0.min.js"></script>
- <script type="text/javascript" src="../script/api.js"></script>
- <script type="text/javascript" src="../script/httpRequest.js"></script>
- <script type="text/javascript" src="../script/vue_plugins.js"></script>
- <script type="text/javascript">
- var vm;
- apiready = function () {
- vm = new Vue({
- el: '#app',
- data: {
- // 选择省市区
- UIActionSelector: '',
- map: '', // 百度地图SDK
- // 选择省市区的文件
- file: 'widget://res/city.json',
- companyName: '',//公司名称
- userName: '', // 门店名称
- userPerson: '', // 用户联系人
- userPhone: '', // 用户手机号
- userCode: '', // 手机号验证码
- userDistrct: '', // 点击选择地址
- userAddress: '', // 用户地址
- distrctArr: [], // 保存的地址
- userLicense: '', // 营业执照
- userDoorway: '', // 门头照片
- userLat: '', // 纬度
- userLon: '', // 经度
- posterList: [], // 经销商列表
- choosePoster: {}, // 选择的经销商
- chooseLv: {
- name: '点击选择签约任务'
- }, // 签约任务
- signList: [], // 签约任务lsit
- wait: 60,
- chooseBrands: 100, // 选择的品牌
- xyChecked: false,
- zcChecked: false,
- ptfurl0: 'widget://res/xy.pdf',
- ptfurl1: 'widget://res/zc.pdf',
- pdfReader: '',
- urldata1: '',
- urldata2: '',
- inclick: true,
- tishi1: 0,
- tishi2: 0,
- },
- methods: {
- getBrandNum: function (index) {
- return this.chooseBrands.indexOf(index) >= 0;
- },
- // 初始化数据
- init: function () {
- var _this = this;
- this.pdfReader = api.require('pdfReader');
- this.UIActionSelector = api.require('UIActionSelector');
- this.map = api.require('bMap');
- if (api.systemType == 'ios') {
- this.map.initMapSDK(function (ret) {
- if (ret.status) { }
- });
- }
- this.getSignLv();
- this.addEvent('chooseDistict', function (ret) {
- if (ret) {
- _this.userDistrct = ret.value.p + ret.value.c + ret.value.d;
- _this.distrctArr = [ret.value.p, ret.value.c, ret.value.d];
- _this.userAddress = ret.value.a;
- _this.userLat = ret.value.lat;
- _this.userlon = ret.value.lon;
- }
- _this.getPosterByDistrict();
- api.closeWin({
- name: 'map_win'
- });
- })
- },
- // 点击获取用户地址
- getUserDistrict: function () {
- var _this = this;
- this.chooseRegion(this.UIActionSelector, 3, this.file, function (ret) {
- if (ret.eventType == 'ok') {
- _this.userDistrct = ret.level1 + ' ' + ret.level2 + ' ' + ret.level3;
- _this.distrctArr = [ret.level1, ret.level2, ret.level3];
- _this.getPosterByDistrict();
- }
- })
- },
- // 根据地理位置获取经纬度
- getLatLotByAddress: function (c) {
- var _this = this;
- this.map.getCoordsFromName({
- city: this.distrctArr[0],
- address: this.userAddress
- }, function (ret, err) {
- if (ret.status) {
- _this.userLat = ret.lat;
- _this.userlon = ret.lon;
- c(true);
- } else {
- c(false);
- }
- });
- },
- goMap: function () {
- this.goWin('map_win', 'map_win.html', {
- d: this.distrctArr[2]
- });
- },
- // 根据用户选择的省市区获取对应的经销商和品牌
- getPosterByDistrict: function () {
- var data = {
- "province": this.distrctArr[0],
- "city": this.distrctArr[1],
- "area": this.distrctArr[2],
- url: 'json',
- type: 'body'
- },
- _this = this;
- this.choosePoster = {};
- this.$post('getUpuserByProvideUrl', data, function (ret) {
- console.log(JSON.stringify(ret));
- if (ret.code == 0 || ret.code == '0') {
- // 对数据进行处理
- ret.Data.data.map(function (meber, index) {
- var meberArr = new Array();
- meber.regionBrandList.map(function (brand, brandIndex) {
- if (meber.brandAndUrl != null) {
- var url = eval('meber.brandAndUrl.' + brand);
- meberArr.push({
- name: brand,
- url: url
- })
- } else {
- meberArr.push({
- name: brand,
- url: './image/logo1.png'
- })
- }
- })
- meber.meberArr = meberArr
- })
- _this.posterList = ret.Data.data;
- }
- })
- },
- // 获取签约级别
- getSignLv: function () {
- var url = "getSignLvU",
- _this = this;
- this.$post(url, {
- url: "json",
- type: 'body'
- }, function (ret) {
- if (ret.code == 0 || ret.code == '0') {
- ret.date.map(function (n, index) {
- n.name = n.signLv;
- })
- _this.signList = ret.date;
- }
- })
- },
- // 选择签约级别
- choosesignLv: function () {
- var _this = this;
- this.chooseRegion(this.UIActionSelector, 1, this.signList, function (ret) {
- if (ret.eventType == 'ok') {
- _this.chooseLv = ret.selectedInfo[0];
- }
- })
- },
- // 选择合作经销商
- choosePosterM: function () {
- var data = this.posterList,
- _this = this;
- if (data.length == 0) {
- api.toast({
- msg: '该地区暂未维护经销商'
- });
- return;
- }
- this.chooseRegion(this.UIActionSelector, 1, data, function (ret) {
- if (ret.eventType == 'ok') {
- _this.choosePoster = ret.selectedInfo[0];
- if (_this.choosePoster.meberArr.length == 1) {
- _this.chooseBrands = 0;
- } else {
- _this.chooseBrands = 100;
- }
- }
- })
- },
- // 点击选择附件
- choosePhoto: function (type) {
- var _this = this;
- if (type == 1) {
- api.confirm({
- title: '温馨提示',
- msg: '此操作需要上传正规的营业执照照片 ,并确保系统识别出来的信息与营业执照一致,是否同意?',
- buttons: ['同意', '不同意']
- }, function (ret, err) {
- if (ret.buttonIndex == 1) {
- // 判断是不是有权限,如果没有则需要开启
- _this.ifHasPrme('storage', function (ret) {
- if (ret == true) {
- _this.ifHasPrme('camera', function (res) {
- if (res == true) {
- _this.chooseImage(function (ret) {
- uploadFile(ret, type);
- //
- if (type == 1) {
- vm.urldata1 = _this.localImage;
- } else {
- vm.urldata2 = _this.localImage;
- }
- })
- }
- })
- }
- })
- }
- });
- } else {
- _this.ifHasPrme('storage', function (ret) {
- if (ret == true) {
- _this.ifHasPrme('camera', function (res) {
- if (res == true) {
- _this.chooseImage(function (ret) {
- uploadFile(ret, type);
- //
- if (type == 1) {
- vm.urldata1 = _this.localImage;
- } else {
- vm.urldata2 = _this.localImage;
- }
- })
- }
- })
- }
- })
- }
- // $('#files' + ).click();
- },
- // 选择品牌
- chooseBrand: function (index) {
- this.chooseBrands = index;
- },
- // 使用搞得api获取经纬度
- getLocationByAmap: function (c) {
- var url = "http://restapi.amap.com/v3/geocode/geo?key=389880a06e3f893ea46036f030c94700&s=rsv3&city=35&address=" + this.distrctArr[0] + this.distrctArr[1] + this.distrctArr[2] + this.userAddress;
- console.log(url);
- var _this = this;
- api.ajax({
- url: url,
- method: 'get',
- data: ''
- }, function (ret, err) {
- if (ret) {
- if (ret.status == 1 || ret.status == '1') {
- if (ret.geocodes[0].location.indexOf(',') >= 0) {
- var latlon = ret.geocodes[0].location.split(',');
- _this.userlon = latlon[0];
- _this.userLat = latlon[1];
- c(true);
- } else {
- c(false)
- }
- } else {
- c(false)
- }
- } else {
- c(false)
- }
- });
- },
- //获取照片信息
- licenseDiscern: function () {
- var url = "licenseDiscern",
- _this = this;
- this.$postuser(url, {
- "url": "json",
- "type": 'body',
- "fileBox": _this.userLicense
- }, function (ret) {
- if (ret.code == 0 || ret.code == '0') {
- api.alert({
- title: '温馨提示',
- msg: '如果店名和联系人与营业执照不一致,请重新上传清晰度更高的营业执照',
- }, function (ret, err) {
- });
- _this.userName = ret.data.wordsResultQuery.company.words;
- _this.userPerson = ret.data.wordsResultQuery.person.words;
- _this.companyName = ret.data.wordsResultQuery.company.words;
- _this.legalPerson = ret.data.wordsResultQuery.person.words;
- } else {
- api.toast({
- msg: ret.msg,
- });
- _this.userName = "";
- _this.userPerson = "";
- _this.companyName = "";
- _this.legalPerson = "";
- }
- })
- },
- // 点击注册提交
- startRegizeUser: function () {
- var _this = this;
- if (this.xyChecked == false) {
- api.toast({
- msg: '请勾选同意用户协议',
- });
- return;
- }
- if (this.zcChecked == false) {
- api.toast({
- msg: '请勾选同意隐私政策',
- });
- return;
- }
- var _this = this;
- if (_this.companyName == '') {
- api.toast({
- msg: '请完善公司名称'
- });
- return;
- }
- if (_this.userName == '') {
- api.toast({
- msg: '请完善门店名称'
- });
- return;
- }
- if (_this.userPerson == '') {
- api.toast({
- msg: '请完善门店联系人'
- });
- return;
- }
- if (_this.userPhone == '') {
- api.toast({
- msg: '请完善门店联系电话'
- });
- return;
- }
- if (!(/^1[3456789]\d{9}$/.test(_this.userPhone))) {
- api.toast({
- msg: '联系电话格式有误'
- });
- return;
- }
- if (_this.userCode == '') {
- api.toast({
- msg: '请完善验证码'
- });
- return;
- }
- if (_this.distrctArr.length == 0) {
- api.toast({
- msg: '请完善地址'
- });
- return;
- }
- if (_this.userAddress == '') {
- api.toast({
- msg: '请完善详细地址'
- });
- return;
- }
- if (_this.choosePoster.name == '') {
- api.toast({
- msg: '请完善合作供应商'
- });
- return;
- }
- if (_this.chooseLv.name == '点击选择签约任务') {
- api.toast({
- msg: '请完善签约等级'
- });
- return;
- }
- if (_this.chooseBrands == 100) {
- api.toast({
- msg: '请选择轮胎品牌'
- });
- return;
- }
- if (_this.userLicense == '') {
- api.toast({
- msg: '请完善营业执照'
- });
- return;
- }
- if (_this.userDoorway == '') {
- api.toast({
- msg: '请完善门头照片'
- });
- return;
- }
- if (_this.userName == '无' && _this.tishi1 == 0) {
- api.alert({
- title: '温馨提示',
- msg: '请正确输入门店名称',
- }, function (ret, err) {
- _this.tishi1 = 1
- });
- return;
- }
- if (_this.userPerson == '无' && _this.tishi2 == 0) {
- api.alert({
- title: '温馨提示',
- msg: '请正确输入联系人',
- }, function (ret, err) {
- _this.tishi2 = 1
- });
- return;
- }
- // 先去访问根据地址获取经纬度的接口
- // this.getLocationByAmap(function(status) {
- // if (status == false) {
- // api.toast({
- // msg: '请填写真实地址'
- // });
- // return;
- // }
- var data = {
- "companyName": _this.companyName,
- "storeName": _this.userName,
- "contactName": _this.userPerson,
- "legalPerson": _this.legalPerson,
- "storePhone": _this.userPhone,
- "mobileCode": _this.userCode,
- "province": _this.distrctArr[0],
- "city": _this.distrctArr[1],
- "district": _this.distrctArr[2],
- "addressInfo": _this.userAddress,
- "jd": _this.userlon,
- "wd": _this.userLat,
- "name": _this.choosePoster.name,
- "brandList": [_this.choosePoster.meberArr[_this.chooseBrands].name],
- "spart": _this.choosePoster.spart,
- "kunnr": _this.choosePoster.kunnr,
- "vkorg": _this.choosePoster.vkorg,
- "vtweg": _this.choosePoster.vtweg,
- "signLv": _this.chooseLv.name, // 这是签约等级
- "numTask": _this.chooseLv.numTask,
- "licenseUrl": _this.userLicense,
- "storeImageUrl": _this.userDoorway,
- "version": parseFloat(api.appVersion),
- "url": 'json',
- "type": 'body'
- }
- _this.inclick = false;
- _this.$postuser("regizeUrl", data, function (ret) {
- if (ret.code == 0 || ret.code == "0") {
- setTimeout(_this.showAlert("注册成功,请等待经销商审核", function () {
- api.closeWin({});
- }), 5000);
- } else {
- setTimeout(function () {
- api.toast({
- msg: ret.msg
- });
- _this.inclick = true;
- }, 1000);
- }
- })
- },
- sendRegistCode: function () {
- if (this.userName != this.userName.replace(/[^\u4e00-\u9fa5\w]/g, '')) {
- api.toast({
- msg: '只能输入汉字、字母、数字'
- });
- this.userName = "";
- }
- if (this.userPerson != this.userPerson.replace(/[^\u4e00-\u9fa5\w]/g, '')) {
- api.toast({
- msg: '只能输入汉字、字母、数字'
- });
- this.userPerson = "";
- }
- if (this.wait < 60) {
- return;
- }
- var _this = this;
- var mobile = _this.userPhone;
- if (mobile == null || mobile == '') {
- _this.showAlert("请输入手机号", function () { });
- return;
- };
- if (!(/^1[3456789]\d{9}$/.test(_this.userPhone))) {
- api.toast({
- msg: '联系电话格式有误'
- });
- return;
- }
- var params = {
- mobile: mobile,
- validType: "2",
- url: 'json',
- type: 'body'
- };
- _this.$post("getPhoneCode", params, function (ret) {
- if (ret.code == 0 || ret.code == "0") {
- api.toast({
- msg: '验证码发送成功'
- });
- _this.startResod();
- }
- });
- },
- // 开始倒计时
- startResod: function () {
- var _this = this;
- if (this.wait == 0) {
- this.wait = 60;
- } else {
- this.wait--;
- setTimeout(function () {
- _this.startResod();
- }, 1000)
- }
- },
- check: function () {
- if (this.userPerson != this.userPerson.replace(/[^\u4e00-\u9fa5\w]/g, '')) {
- api.toast({
- msg: '只能输入汉字、字母、数字'
- });
- this.userPerson = ""
- }
- },
- check2: function () {
- if (this.userName != this.userName.replace(/[^\u4e00-\u9fa5\w]/g, '')) {
- api.toast({
- msg: '只能输入汉字、字母、数字'
- });
- this.userName = ""
- }
- },
- // 查看pdf
- lookPdf: function (index) {
- this.pdfReader.open({
- path: index == 0 ? this.ptfurl0 : this.ptfurl1,
- hidden: {
- print: true,
- export: true,
- bookmark: true,
- email: true
- },
- backBtn: {
- size: { //JSON对象;左上角按钮的大小配置
- w: 20, //数字类型;左上角按钮的宽;默认:60
- h: 20 //数字类型;左上角按钮的高;默认:40
- },
- title: { //JSON对象;按钮标题配置
- text: "返回", //字符串类型;标题文本;默认:‘’
- },
- corner: 5 //数字类型;左上角按钮圆角大小;默认值:5.0
- }
- });
- }
- },
- filters: {},
- mounted: function () {
- this.init();
- }
- })
- }
- function changePhoto(event, type) {
- uploadFile(event.target.files[0], type);
- }
- // jq 的上传文件
- function uploadFile(file, type) {
- var formdata = new FormData();
- formdata.append('file', file);
- // api.showProgress({});
- $.ajax({
- url: "http://b2bcnapi.sailuntire.com/api/test/web/file/upload",
- type: "POST",
- data: formdata,
- processData: false, // 告诉jQuery不要去处理发送的数据
- contentType: false, // 告诉jQuery不要去设置Content-Type请求头
- success: function (ret, status, xhr) {
- // api.hideProgress();
- if (ret.code == 0 || ret.code == '0') {
- api.toast({
- msg: '上传成功'
- });
- if (type == 1) {
- vm.userLicense = ret.data;
- vm.licenseDiscern()
- } else {
- vm.userDoorway = ret.data;
- }
- } else {
- api.toast({
- msg: '上传失败'
- });
- }
- }
- });
- }
- </script>
- </html>
|