|
|
@@ -1,180 +1,63 @@
|
|
|
<template>
|
|
|
<div class="app-content">
|
|
|
<form @submit="formSubmit">
|
|
|
- <div class="module-com">
|
|
|
- <tui-list-cell
|
|
|
- class="line-cell"
|
|
|
- :hover="false"
|
|
|
- >
|
|
|
+ <view class="module-com">
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" >
|
|
|
<div class="tui-title">花店名称</div>
|
|
|
- <input
|
|
|
- v-model="form.name"
|
|
|
- placeholder-class="phcolor"
|
|
|
- placeholder-style="color:#CCCCCC"
|
|
|
- class="tui-input"
|
|
|
- name="name"
|
|
|
- placeholder="请输入名称"
|
|
|
- />
|
|
|
+ <input v-model="form.name" type="text" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="name" placeholder="请输入名称" />
|
|
|
</tui-list-cell>
|
|
|
- <tui-list-cell
|
|
|
- class="line-cell"
|
|
|
- :hover="false"
|
|
|
- :arrow="true"
|
|
|
- @click="openAddres"
|
|
|
- >
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="openAddres" >
|
|
|
<div class="tui-title">所在城市</div>
|
|
|
- <div
|
|
|
- class="tui-input"
|
|
|
- v-if="form.province"
|
|
|
- >{{ form.province + '-' + form.city }}</div>
|
|
|
- <div
|
|
|
- class="tui-placeholder"
|
|
|
- v-else
|
|
|
- >请选择</div>
|
|
|
+ <div class="tui-input" v-if="form.province" >{{ form.province + '-' + form.city }}</div>
|
|
|
+ <div class="tui-placeholder" v-else >请选择</div>
|
|
|
</tui-list-cell>
|
|
|
- <tui-list-cell
|
|
|
- class="line-cell"
|
|
|
- :hover="false"
|
|
|
- :arrow="true"
|
|
|
- @click="selRegionFn"
|
|
|
- >
|
|
|
- <div class="tui-title">详细地址</div>
|
|
|
- <div
|
|
|
- class="tui-input"
|
|
|
- v-if="form.address"
|
|
|
- >{{ form.address }}</div>
|
|
|
- <div
|
|
|
- class="tui-placeholder"
|
|
|
- v-else
|
|
|
- >请填写详细地址</div>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selRegionFn" >
|
|
|
+ <div class="tui-title">所在地址</div>
|
|
|
+ <div class="tui-input" v-if="form.address" >{{ form.address }}</div>
|
|
|
+ <div class="tui-placeholder" v-else >详细地址</div>
|
|
|
</tui-list-cell>
|
|
|
- <tui-list-cell
|
|
|
- class="line-cell"
|
|
|
- :hover="false"
|
|
|
- >
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" >
|
|
|
<div class="tui-title">楼号门牌</div>
|
|
|
- <input
|
|
|
- v-model="form.floor"
|
|
|
- placeholder-class="phcolor"
|
|
|
- placeholder-style="color:#CCCCCC"
|
|
|
- class="tui-input"
|
|
|
- name="floor"
|
|
|
- placeholder="选填"
|
|
|
- />
|
|
|
+ <input v-model="form.floor" type="text" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="floor" placeholder="选填" />
|
|
|
</tui-list-cell>
|
|
|
-<!--
|
|
|
- <tui-list-cell
|
|
|
- class="line-cell"
|
|
|
- :hover="false"
|
|
|
- >
|
|
|
- <div class="tui-title">花店头像</div>
|
|
|
- <app-uploader
|
|
|
- @resultData="_resultData"
|
|
|
- :num="1"
|
|
|
- />
|
|
|
- </tui-list-cell>
|
|
|
--->
|
|
|
- </div>
|
|
|
- <!-- 店长昵称 -->
|
|
|
- <div class="module-com">
|
|
|
- <AppBindInfo
|
|
|
- @bindInfo="bindInfo"
|
|
|
- nameTetx="昵称"
|
|
|
- >
|
|
|
- </AppBindInfo>
|
|
|
- </div>
|
|
|
- <!-- 手机号 -->
|
|
|
- <!--
|
|
|
- <div class="module-com">
|
|
|
- <tui-list-cell
|
|
|
- v-if="option.style == 1"
|
|
|
- class="line-cell code-wrap"
|
|
|
- :hover="false"
|
|
|
- >
|
|
|
- <div class="tui-title">主营业务</div>
|
|
|
- <div>
|
|
|
- <button
|
|
|
- @click="changeMain(1)"
|
|
|
- :class="['admin-button-com','mini-btn',form.main==1?'blue':'default']"
|
|
|
- >
|
|
|
- 零售
|
|
|
- </button>
|
|
|
- <button
|
|
|
- @click="changeMain(2)"
|
|
|
- style="margin-left:10upx;"
|
|
|
- :class="['admin-button-com','mini-btn',form.main==2?'blue':'default']"
|
|
|
- >
|
|
|
- 培训
|
|
|
- </button>
|
|
|
- </div>
|
|
|
- </tui-list-cell>
|
|
|
- <tui-list-cell
|
|
|
- class="line-cell"
|
|
|
- :hover="false"
|
|
|
- >
|
|
|
+ </view>
|
|
|
+ <view class="module-com">
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <div class="tui-title required">姓名</div>
|
|
|
+ <input v-model="form.adminName" type="text" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="adminName" placeholder="申请人姓名" />
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <div class="tui-title required">手机号</div>
|
|
|
+ <input v-model="form.mobile" type="number" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="mobile" placeholder="申请人手机号" />
|
|
|
+ </tui-list-cell>
|
|
|
|
|
|
- <div class="tui-title">营业执照编号</div>
|
|
|
- <input
|
|
|
- v-model="form.licenseNo"
|
|
|
- placeholder-class="phcolor"
|
|
|
- placeholder-style="color:#CCCCCC"
|
|
|
- class="tui-input"
|
|
|
- name="name"
|
|
|
- placeholder="请输入营业执照编号"
|
|
|
- />
|
|
|
- </tui-list-cell>
|
|
|
- <tui-list-cell
|
|
|
- class="line-cell"
|
|
|
- :hover="false"
|
|
|
- >
|
|
|
- <div class="tui-title">营业执照</div>
|
|
|
- <app-uploader
|
|
|
- @resultData="resultData"
|
|
|
- ref="appUploader"
|
|
|
- :num="1"
|
|
|
- />
|
|
|
- </tui-list-cell>
|
|
|
-
|
|
|
- </div>
|
|
|
--->
|
|
|
- <!-- 推荐人 -->
|
|
|
- <div
|
|
|
- class="module-com recommend-wrap"
|
|
|
- v-if="!$util.isEmpty(merchantData)"
|
|
|
- >
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <div class="tui-title required">验证码</div>
|
|
|
+ <input v-model="form.authCode" style="width:330upx;" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="authCode" placeholder="请填写验证码" />
|
|
|
+ <button v-if="hasGet == false" class="admin-button-com blue middle" @click="requestAuthCode()">获取</button>
|
|
|
+ <button v-else class="admin-button-com default middle" >{{count}}</button>
|
|
|
+ </tui-list-cell>
|
|
|
+ </view>
|
|
|
+ <view class="module-com recommend-wrap" v-if="!$util.isEmpty(merchantData)" >
|
|
|
<div class="recommend-tag">推荐人</div>
|
|
|
<div class="recommend-det">
|
|
|
- <image
|
|
|
- style="width:90upx;height:90upx;border-radius:42upx;"
|
|
|
- mode="scaleToFill"
|
|
|
- :src="merchantData.logoUrl"
|
|
|
- @error="imageError"
|
|
|
- />
|
|
|
+ <image style="width:90upx;height:90upx;border-radius:42upx;" mode="scaleToFill" :src="merchantData.logoUrl" @error="imageError" />
|
|
|
<div class="recommend-info">
|
|
|
<div class="app-size-32">{{ merchantData.name }}</div>
|
|
|
<div class="app-color-2"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </view>
|
|
|
|
|
|
<div class="btn-wrap">
|
|
|
- <button
|
|
|
- class="admin-button-com blue big"
|
|
|
- formType="submit"
|
|
|
- >确认</button>
|
|
|
+ <button class="admin-button-com blue big" formType="submit" >确认</button>
|
|
|
</div>
|
|
|
+
|
|
|
<!-- 选择地区 -->
|
|
|
- <app-area-sel
|
|
|
- :show.sync="showRegion"
|
|
|
- @change="changeAreaFn"
|
|
|
- :city="form.city"
|
|
|
- />
|
|
|
+ <app-area-sel :show.sync="showRegion" @change="changeAreaFn" :city="form.city" />
|
|
|
<!-- 省市联动 -->
|
|
|
- <simple-address
|
|
|
- ref="simpleAddress"
|
|
|
- :pickerValueDefault="cityPickerValueDefault"
|
|
|
- @onConfirm="onCityConfirm"
|
|
|
- ></simple-address>
|
|
|
+ <simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onCityConfirm" ></simple-address>
|
|
|
+
|
|
|
</form>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -184,14 +67,12 @@ import TuiListCell from "@/components/plugin/list-cell";
|
|
|
import AppAreaSel from "@/components/app-area-sel";
|
|
|
import SimpleAddress from "@/components/plugin/simple-address";
|
|
|
import AppAvatarModule from "@/components/module/app-avatar";
|
|
|
-// import { getWxInfo, getWxPhone } from "@/api/mini";
|
|
|
import AppUploader from "@/components/app-uploader";
|
|
|
-import AppBindInfo from "@/components/app-bind-info";
|
|
|
const form = require("@/utils/formValidation.js");
|
|
|
import {getIntroduce,applyRegister} from "@/api/official";
|
|
|
+import {getAuthCode} from "@/api/apply";
|
|
|
import { mapResolve } from "@/api/map";
|
|
|
import util from '@/utils/util';
|
|
|
-
|
|
|
export default {
|
|
|
name: "apply-data",
|
|
|
components: {
|
|
|
@@ -199,8 +80,7 @@ export default {
|
|
|
AppAreaSel,
|
|
|
SimpleAddress,
|
|
|
AppAvatarModule,
|
|
|
- AppUploader,
|
|
|
- AppBindInfo
|
|
|
+ AppUploader
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
@@ -219,51 +99,71 @@ export default {
|
|
|
// floor: "",
|
|
|
longitude: "",
|
|
|
latitude: "",
|
|
|
- showAddress:""
|
|
|
+ showAddress:"",
|
|
|
+ authCode:""
|
|
|
},
|
|
|
showRegion: false,
|
|
|
// 省市联动
|
|
|
regionData: [],
|
|
|
cityPickerValueDefault: [0, 0],
|
|
|
- // 验证码
|
|
|
- isSend: 0,
|
|
|
- countDown: 119,
|
|
|
- timer: null,
|
|
|
adminName: "",
|
|
|
- logo: ''
|
|
|
+ logo: '',
|
|
|
+ hasGet:false,
|
|
|
+ count:120,
|
|
|
+ INT:false
|
|
|
};
|
|
|
},
|
|
|
onLoad () {
|
|
|
+ },
|
|
|
+ onUnload(){
|
|
|
+ clearInterval(this.INT)
|
|
|
},
|
|
|
onShow() {
|
|
|
- let self = this
|
|
|
- uni.getLocation({
|
|
|
- type: 'wgs84',
|
|
|
- success: function (res) {
|
|
|
- mapResolve({lat:res.latitude,long:res.longitude}).then((obj) => {
|
|
|
- if(!util.isEmpty(obj.data)){
|
|
|
- console.log(obj)
|
|
|
- self.form.longitude=res.longitude,
|
|
|
- self.form.latitude=res.latitude,
|
|
|
- self.form.province = obj.data.province
|
|
|
- self.form.city = obj.data.city
|
|
|
- self.form.address = obj.data.address
|
|
|
- self.form.showAddress = obj.data.showAddress
|
|
|
+
|
|
|
+ // let self = this
|
|
|
+ // uni.getLocation({
|
|
|
+ // type: 'wgs84',
|
|
|
+ // success: function (res) {
|
|
|
+ // mapResolve({lat:res.latitude,long:res.longitude}).then((obj) => {
|
|
|
+ // if(!util.isEmpty(obj.data)){
|
|
|
+ // console.log(obj)
|
|
|
+ // self.form.longitude=res.longitude,
|
|
|
+ // self.form.latitude=res.latitude,
|
|
|
+ // self.form.province = obj.data.province
|
|
|
+ // self.form.city = obj.data.city
|
|
|
+ // self.form.address = obj.data.address
|
|
|
+ // self.form.showAddress = obj.data.showAddress
|
|
|
+ // uni.showToast({ title: '已自动填写地址', duration: 2500 })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
|
|
|
- uni.showToast({
|
|
|
- title: '已自动填写地址',
|
|
|
- duration: 2500
|
|
|
- });
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
- // console.log('当前位置的经度:' + res.longitude);
|
|
|
- // console.log('当前位置的纬度:' + res.latitude);
|
|
|
- }
|
|
|
- });
|
|
|
},
|
|
|
methods: {
|
|
|
- //图片地址
|
|
|
+ requestAuthCode(){
|
|
|
+ let that = this
|
|
|
+ let mobile = this.form.mobile
|
|
|
+ if(this.$util.checkMobile(mobile) == false){
|
|
|
+ this.$msg('请输入正确手机号')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ getAuthCode({mobile}).then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ that.hasGet = true
|
|
|
+ that.count = 120
|
|
|
+ that.INT = setInterval(function(){
|
|
|
+ if(that.count <= 0){
|
|
|
+ clearInterval(that.INT)
|
|
|
+ that.hasGet = false
|
|
|
+ that.count = 120
|
|
|
+ return
|
|
|
+ }
|
|
|
+ that.count--
|
|
|
+ },1000)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
resultData (val) {
|
|
|
this.form.license = val.shortUrl
|
|
|
},
|
|
|
@@ -279,7 +179,6 @@ export default {
|
|
|
},
|
|
|
init () {
|
|
|
this._getMerchantDet()
|
|
|
-
|
|
|
},
|
|
|
_getMerchantDet () {
|
|
|
getIntroduce(this.option).then(res => {
|
|
|
@@ -306,13 +205,12 @@ export default {
|
|
|
// 选择地址
|
|
|
selRegionFn () {
|
|
|
if (!this.form.city) {
|
|
|
- this.$msg("请先选择城市!");
|
|
|
+ this.$msg("请先选择城市");
|
|
|
return false;
|
|
|
}
|
|
|
this.showRegion = true;
|
|
|
},
|
|
|
changeAreaFn (e) {
|
|
|
- console.log("changeAreaFn", e);
|
|
|
this.form.address = e.title;
|
|
|
this.form.showAddress = e.address;
|
|
|
this.form.latitude = e.location.lat;
|
|
|
@@ -329,36 +227,16 @@ export default {
|
|
|
},
|
|
|
formSubmit (e) {
|
|
|
let rules = [
|
|
|
- {
|
|
|
- name: "name",
|
|
|
- rule: ["required"],
|
|
|
- msg: ["请填写花店名称"]
|
|
|
- },
|
|
|
- {
|
|
|
- name: "city",
|
|
|
- rule: ["required"],
|
|
|
- msg: ["请选择城市"]
|
|
|
- },
|
|
|
- {
|
|
|
- name: "address",
|
|
|
- rule: ["required"],
|
|
|
- msg: ["请填写地址"]
|
|
|
- },
|
|
|
- {
|
|
|
- name: "adminName",
|
|
|
- rule: ["required"],
|
|
|
- msg: ["请填写昵称"]
|
|
|
- },
|
|
|
- {
|
|
|
- name: "mobile",
|
|
|
- rule: ["required"],
|
|
|
- msg: ["请填写手机号"]
|
|
|
- }
|
|
|
+ { name: "name", rule: ["required"], msg: ["请填写花店名称"] },
|
|
|
+ { name: "city", rule: ["required"], msg: ["请选择城市"] },
|
|
|
+ { name: "address", rule: ["required"], msg: ["请填写地址"] },
|
|
|
+ { name: "adminName", rule: ["required"], msg: ["请填写姓名"] },
|
|
|
+ { name: "mobile", rule: ["required"], msg: ["请填写手机号"] }
|
|
|
];
|
|
|
let formData = this.form;
|
|
|
let checkRes = form.validation(formData, rules);
|
|
|
if (!checkRes) {
|
|
|
- uni.showLoading({title: '加载中',mask:true})
|
|
|
+ uni.showLoading({mask:true})
|
|
|
setTimeout(() => {
|
|
|
this.confirmFn()
|
|
|
})
|
|
|
@@ -372,7 +250,6 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
-
|
|
|
<style lang="scss" scoped>
|
|
|
.module-com {
|
|
|
margin-bottom: 20upx;
|
|
|
@@ -443,4 +320,4 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|