|
|
@@ -1,149 +1,76 @@
|
|
|
<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="选填"
|
|
|
- />
|
|
|
- </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">
|
|
|
- <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" />
|
|
|
+ <input v-model="form.floor" type="text" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="floor" placeholder="选填" />
|
|
|
</tui-list-cell>
|
|
|
- </div>
|
|
|
- -->
|
|
|
- <!-- 推荐人 -->
|
|
|
- <div
|
|
|
- class="module-com recommend-wrap"
|
|
|
- v-if="!$util.isEmpty(merchantData)"
|
|
|
- >
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="module-com">
|
|
|
+ <view class="module-tit">
|
|
|
+ <span>门店照片</span>
|
|
|
+ <span class="app-color-3">(必填)</span>
|
|
|
+ </view>
|
|
|
+ <view class="module-det">
|
|
|
+ <htz-image-upload :max="1" :compress="true" v-model="currentImgData" :headers="headers" :quality="95"
|
|
|
+ @uploadSuccess="imgUploadSuccess" @imgDelete="imgDeleteFn" :action="uploadImgUrl">
|
|
|
+ </htz-image-upload>
|
|
|
+ </view>
|
|
|
+ </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>
|
|
|
+
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <div class="tui-title required">验证码</div>
|
|
|
+ <input v-model="form.authCode" type="number" 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>
|
|
|
@@ -154,12 +81,15 @@ import AppAreaSel from "@/components/app-area-sel";
|
|
|
import SimpleAddress from "@/components/plugin/simple-address";
|
|
|
import AppAvatarModule from "@/components/module/app-avatar";
|
|
|
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 {getIntroduce,applyRegister} from "@/api/official";
|
|
|
+import {getAuthCode} from "@/api/apply";
|
|
|
+import { mapGetters } from "vuex"
|
|
|
+//图片上传插件来源:https://ext.dcloud.net.cn/plugin?id=2922 已改造,不能再升级 shish 20211228
|
|
|
+import htzImageUpload from '../components/htz-image-upload/htz-image-upload.vue'
|
|
|
import { mapResolve } from "@/api/map";
|
|
|
import util from '@/utils/util';
|
|
|
-
|
|
|
+import { APIHOST } from '@/config'
|
|
|
export default {
|
|
|
name: "apply-data",
|
|
|
components: {
|
|
|
@@ -168,9 +98,9 @@ export default {
|
|
|
SimpleAddress,
|
|
|
AppAvatarModule,
|
|
|
AppUploader,
|
|
|
- AppBindInfo,
|
|
|
+ htzImageUpload
|
|
|
},
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
merchantData: {},
|
|
|
form: {
|
|
|
@@ -180,158 +110,160 @@ export default {
|
|
|
city: "",
|
|
|
dist: "",
|
|
|
address: "",
|
|
|
- adminName: "",
|
|
|
+ adminName: '',
|
|
|
main: 1,
|
|
|
licenseNo: "",
|
|
|
license: "",
|
|
|
// floor: "",
|
|
|
longitude: "",
|
|
|
latitude: "",
|
|
|
- logo: "",
|
|
|
- showAddress:""
|
|
|
+ showAddress:"",
|
|
|
+ authCode:"",
|
|
|
+ cover:''
|
|
|
},
|
|
|
showRegion: false,
|
|
|
// 省市联动
|
|
|
regionData: [],
|
|
|
cityPickerValueDefault: [0, 0],
|
|
|
- // 验证码
|
|
|
- isSend: 0,
|
|
|
- countDown: 119,
|
|
|
- timer: null,
|
|
|
adminName: "",
|
|
|
+ logo: '',
|
|
|
+ hasGet:false,
|
|
|
+ count:120,
|
|
|
+ INT:false,
|
|
|
+ headers:{token:''},
|
|
|
+ currentImgData: [],
|
|
|
+ uploadImgUrl:APIHOST+'/upload/save-file'
|
|
|
};
|
|
|
},
|
|
|
- onLoad() {},
|
|
|
- onShow() {
|
|
|
- let self = this
|
|
|
- uni.getLocation({
|
|
|
- type: 'gcj02',
|
|
|
- isHighAccuracy:true,
|
|
|
- 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
|
|
|
- });
|
|
|
-
|
|
|
- }
|
|
|
+ computed:{
|
|
|
+ ...mapGetters(["getLoginInfo"])
|
|
|
+ },
|
|
|
+ onLoad () {
|
|
|
+ const token = uni.getStorageSync('token')
|
|
|
+ this.headers.token = token
|
|
|
+ },
|
|
|
+ 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
|
|
|
+ // uni.showToast({ title: '已自动填写地址', duration: 2500 })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
|
|
|
- })
|
|
|
- // console.log('当前位置的经度:' + res.longitude);
|
|
|
- // console.log('当前位置的纬度:' + res.latitude);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
+ },
|
|
|
methods: {
|
|
|
- //图片地址
|
|
|
- resultData(val) {
|
|
|
- this.form.license = val.shortUrl;
|
|
|
+ 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) {
|
|
|
- console.log(val);
|
|
|
- this.form.logo = val.shortUrl;
|
|
|
+ resultData (val) {
|
|
|
+ this.form.license = val.shortUrl
|
|
|
},
|
|
|
- changeMain(val) {
|
|
|
- this.form.main = val;
|
|
|
+ _resultData (val) {
|
|
|
+ this.form.logo = val.shortUrl
|
|
|
},
|
|
|
- bindInfo(val) {
|
|
|
+ changeMain (val) {
|
|
|
+ this.form.main = val
|
|
|
+ },
|
|
|
+ bindInfo (val) {
|
|
|
this.form.adminName = val.name;
|
|
|
- this.form.mobile = val.mobile;
|
|
|
+ this.form.mobile = val.mobile
|
|
|
},
|
|
|
- init() {
|
|
|
- this.getIntroduceInfo();
|
|
|
+ init () {
|
|
|
+ this._getMerchantDet()
|
|
|
},
|
|
|
- getIntroduceInfo() {
|
|
|
- getIntroduce(this.option).then((res) => {
|
|
|
+ _getMerchantDet () {
|
|
|
+ getIntroduce(this.option).then(res => {
|
|
|
this.merchantData = res.data.introduce
|
|
|
- })
|
|
|
- },
|
|
|
- confirmFn() {
|
|
|
- applyRegister({
|
|
|
- fromGhsId:this.option.fromGhsId,
|
|
|
- hdShopAdminId: this.option.hdShopAdminId,
|
|
|
- ghsShopAdminId: this.option.ghsShopAdminId,
|
|
|
- ...this.form,
|
|
|
- style: this.option.style || 0,
|
|
|
- from: this.option.from || 0,
|
|
|
- }).then((res) => {
|
|
|
- this.$util.pageTo({
|
|
|
- url: "/pagesClient/official/result",
|
|
|
- type: 2,
|
|
|
- query: {
|
|
|
- pagestatus: 3,
|
|
|
- },
|
|
|
- });
|
|
|
- }).catch(err => {});
|
|
|
+ });
|
|
|
},
|
|
|
// 选择地址
|
|
|
- selRegionFn() {
|
|
|
+ selRegionFn () {
|
|
|
if (!this.form.city) {
|
|
|
- this.$msg("请先选择城市!");
|
|
|
+ this.$msg("请先选择城市");
|
|
|
return false;
|
|
|
}
|
|
|
this.showRegion = true;
|
|
|
},
|
|
|
- changeAreaFn(e) {
|
|
|
+ changeAreaFn (e) {
|
|
|
this.form.address = e.title;
|
|
|
this.form.showAddress = e.address;
|
|
|
this.form.latitude = e.location.lat;
|
|
|
this.form.longitude = e.location.lng;
|
|
|
- this.form.dist = e.district;
|
|
|
+ this.form.dist = e.district
|
|
|
},
|
|
|
// 省市联动
|
|
|
- openAddres() {
|
|
|
+ openAddres () {
|
|
|
this.$refs.simpleAddress.open();
|
|
|
},
|
|
|
- onCityConfirm(e) {
|
|
|
+ onCityConfirm (e) {
|
|
|
this.form.province = e.provinceName;
|
|
|
this.form.city = e.cityName;
|
|
|
},
|
|
|
- // 表单验证
|
|
|
- formSubmit(e) {
|
|
|
- // 表单规则
|
|
|
+ imgUploadSuccess(res) {
|
|
|
+ var _res = JSON.parse(res.data)
|
|
|
+ if(_res.code == 1){
|
|
|
+ this.currentImgData.push(_res.data.smallUrl)
|
|
|
+ this.form.cover = _res.data.shortUrl
|
|
|
+ }
|
|
|
+ },
|
|
|
+ imgDeleteFn(res){
|
|
|
+ const index = res.index
|
|
|
+ this.form.cover.splice(index,1)
|
|
|
+ },
|
|
|
+ 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(this.$util.isEmpty(this.form.cover)){
|
|
|
+ this.$msg('请上传照片')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
if (!checkRes) {
|
|
|
- uni.showLoading({title: '加载中',mask:true})
|
|
|
+ uni.showLoading({mask:true})
|
|
|
setTimeout(() => {
|
|
|
this.confirmFn()
|
|
|
})
|
|
|
@@ -340,11 +272,28 @@ export default {
|
|
|
this.$msg(checkRes);
|
|
|
}
|
|
|
},
|
|
|
+ confirmFn () {
|
|
|
+ applyRegister({
|
|
|
+ hdShopAdminId: this.option.hdShopAdminId,
|
|
|
+ ghsShopAdminId: this.option.ghsShopAdminId,
|
|
|
+ ...this.form,
|
|
|
+ style: this.option.style || 0,
|
|
|
+ from: this.option.from || 0
|
|
|
+ }).then(res => {
|
|
|
+ this.$util.pageTo({
|
|
|
+ url: "/pagesClient/official/result",
|
|
|
+ type: 2,
|
|
|
+ query: {
|
|
|
+ pagestatus: 3
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
- watch: {},
|
|
|
+ watch: {
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
-
|
|
|
<style lang="scss" scoped>
|
|
|
.module-com {
|
|
|
margin-bottom: 20upx;
|
|
|
@@ -353,7 +302,7 @@ export default {
|
|
|
padding: 20upx 18upx;
|
|
|
font-size: 28upx;
|
|
|
font-weight: 600;
|
|
|
- border-bottom: 1px solid $borderColor;
|
|
|
+ border-bottom: 1upx solid $borderColor;
|
|
|
}
|
|
|
.module-det {
|
|
|
padding: 0 30upx;
|
|
|
@@ -393,7 +342,7 @@ export default {
|
|
|
.tui-code {
|
|
|
width: 200upx;
|
|
|
text-align: center;
|
|
|
- border-left: 1px solid $borderColor;
|
|
|
+ border-left: 1upx solid $borderColor;
|
|
|
color: $mainColor;
|
|
|
}
|
|
|
}
|
|
|
@@ -415,4 +364,4 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|