|
|
@@ -0,0 +1,365 @@
|
|
|
+<template>
|
|
|
+ <div class="app-content">
|
|
|
+ <form @submit="formSubmit">
|
|
|
+
|
|
|
+ <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">
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" >
|
|
|
+ <div class="tui-title">花店名称</div>
|
|
|
+ <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" >
|
|
|
+ <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>
|
|
|
+ </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>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" >
|
|
|
+ <div class="tui-title">楼号门牌</div>
|
|
|
+ <input v-model="form.floor" type="text" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="floor" placeholder="选填" />
|
|
|
+ </tui-list-cell>
|
|
|
+ </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="80"
|
|
|
+ @uploadSuccess="imgUploadSuccess" @imgDelete="imgDeleteFn" :action="uploadImgUrl">
|
|
|
+ </htz-image-upload>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view style="color:#999999;font-size:25upx;margin-top:30upx;margin-left:50upx;">
|
|
|
+ <radio-group @change="agreeItem">
|
|
|
+ <label>
|
|
|
+ <radio value="1" style="width:6upx;transform:scale(0.6)" checked />
|
|
|
+ <text style="margin-left:38upx;">领取免费商城</text>
|
|
|
+ </label>
|
|
|
+ </radio-group>
|
|
|
+ </view>
|
|
|
+ <div class="btn-wrap">
|
|
|
+ <button class="admin-button-com blue big" formType="submit" >提交</button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 选择地区 -->
|
|
|
+ <app-area-sel :show.sync="showRegion" @change="changeAreaFn" :city="form.city" />
|
|
|
+ <!-- 省市联动 -->
|
|
|
+ <simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onCityConfirm" ></simple-address>
|
|
|
+
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+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 AppUploader from "@/components/app-uploader";
|
|
|
+const form = require("@/utils/formValidation.js");
|
|
|
+import {applyLjh} from "@/api/ljh";
|
|
|
+import {getAuthCode} from "@/api/apply";
|
|
|
+import { replaceClientId } from '@/api/admin'
|
|
|
+import { mapGetters,mapActions } from "vuex"
|
|
|
+import htzImageUpload from '@/components/htz-image-upload/htz-image-upload.vue'
|
|
|
+import { APIHOST } from '@/config'
|
|
|
+import { getShopInfo} from "@/utils/auth";
|
|
|
+import { getDictionaries } from '@/api/mini'
|
|
|
+export default {
|
|
|
+ name: "confirm",
|
|
|
+ components: {
|
|
|
+ TuiListCell,
|
|
|
+ AppAreaSel,
|
|
|
+ SimpleAddress,
|
|
|
+ AppAvatarModule,
|
|
|
+ AppUploader,
|
|
|
+ htzImageUpload
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ agree:0,
|
|
|
+ form: {
|
|
|
+ name: "",
|
|
|
+ mobile: "",
|
|
|
+ province: "",
|
|
|
+ city: "",
|
|
|
+ dist: "",
|
|
|
+ address: "",
|
|
|
+ adminName: '',
|
|
|
+ main: 1,
|
|
|
+ licenseNo: "",
|
|
|
+ license: "",
|
|
|
+ floor: "",
|
|
|
+ longitude: "",
|
|
|
+ latitude: "",
|
|
|
+ showAddress:"",
|
|
|
+ authCode:"",
|
|
|
+ cover:''
|
|
|
+ },
|
|
|
+ showRegion: false,
|
|
|
+ regionData: [],
|
|
|
+ cityPickerValueDefault: [0, 0],
|
|
|
+ adminName: "",
|
|
|
+ logo: '',
|
|
|
+ hasGet:false,
|
|
|
+ count:120,
|
|
|
+ INT:false,
|
|
|
+ headers:{token:''},
|
|
|
+ currentImgData: [],
|
|
|
+ uploadImgUrl:APIHOST+'/upload/save-file'
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ ...mapGetters(["getLoginInfo"])
|
|
|
+ },
|
|
|
+ onLoad () {
|
|
|
+ const token = uni.getStorageSync('token')
|
|
|
+ this.headers.token = token
|
|
|
+ },
|
|
|
+ onUnload(){
|
|
|
+ clearInterval(this.INT)
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...mapActions(['setUserShopAll']),
|
|
|
+ agreeItem(e){
|
|
|
+ this.agree = e.target.value
|
|
|
+ },
|
|
|
+ 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
|
|
|
+ },
|
|
|
+ _resultData (val) {
|
|
|
+ this.form.logo = val.shortUrl
|
|
|
+ },
|
|
|
+ changeMain (val) {
|
|
|
+ this.form.main = val
|
|
|
+ },
|
|
|
+ bindInfo (val) {
|
|
|
+ this.form.adminName = val.name;
|
|
|
+ this.form.mobile = val.mobile
|
|
|
+ },
|
|
|
+ init () {
|
|
|
+
|
|
|
+ },
|
|
|
+ selRegionFn () {
|
|
|
+ if (!this.form.city) {
|
|
|
+ this.$msg("请先选择城市");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ this.showRegion = true;
|
|
|
+ },
|
|
|
+ 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
|
|
|
+ },
|
|
|
+ // 省市联动
|
|
|
+ openAddres () {
|
|
|
+ this.$refs.simpleAddress.open();
|
|
|
+ },
|
|
|
+ onCityConfirm (e) {
|
|
|
+ this.form.province = e.provinceName;
|
|
|
+ this.form.city = e.cityName;
|
|
|
+ },
|
|
|
+ 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){
|
|
|
+ this.form.cover=''
|
|
|
+ },
|
|
|
+ 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: ["请填写手机号"] }
|
|
|
+ ];
|
|
|
+ let formData = this.form;
|
|
|
+ let checkRes = form.validation(formData, rules)
|
|
|
+ if (!checkRes) {
|
|
|
+ if(this.$util.isEmpty(this.form.cover)){
|
|
|
+ this.$msg('请上传本人正面照')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ uni.showLoading({mask:true})
|
|
|
+ setTimeout(() => {
|
|
|
+ this.confirmFn()
|
|
|
+ })
|
|
|
+ uni.hideLoading()
|
|
|
+ } else {
|
|
|
+ this.$msg(checkRes);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ confirmFn () {
|
|
|
+ uni.showLoading({mask:true})
|
|
|
+ let currentMiniOpenId = uni.getStorageSync('currentMiniOpenId')
|
|
|
+ let style = this.option.style || 0
|
|
|
+ let from = this.option.from || 0
|
|
|
+ let that = this
|
|
|
+ uni.showLoading({mask:true})
|
|
|
+ applyLjh({hdShopAdminId:this.option.hdShopAdminId,ghsShopAdminId:this.option.ghsShopAdminId,...this.form,style:style,from:from,miniOpenId:currentMiniOpenId}).then(subRes => {
|
|
|
+ uni.hideLoading()
|
|
|
+ let token = subRes.data.token || ''
|
|
|
+ uni.hideLoading()
|
|
|
+ if (that.$util.isEmpty(token)) {
|
|
|
+ that.$msg('出错了')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ //有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
|
|
|
+ if(subRes.code == 1){
|
|
|
+ if (that.$util.isEmpty(subRes)) {
|
|
|
+ that.$msg('出错了')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ uni.setStorageSync('token', subRes.data.token)
|
|
|
+ uni.setStorageSync('shopId', subRes.data.admin.currentShopId)
|
|
|
+ getDictionaries({ token: subRes.data.token }).then(res => {
|
|
|
+ if (that.$util.isEmpty(res)) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ that.$store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
|
|
|
+ that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
|
|
|
+ })
|
|
|
+ that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
|
|
|
+ getShopInfo(true).then(res => {
|
|
|
+ uni.setNavigationBarTitle({ title: res.name })
|
|
|
+ })
|
|
|
+ that.setUserShopAll()
|
|
|
+ // #ifdef APP-PLUS
|
|
|
+ //保存安卓的clientId
|
|
|
+ let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
|
|
|
+ const clientInfo = plus.push.getClientInfo()
|
|
|
+ let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
|
|
|
+ if(hasClientId == '' || hasClientId != currentClientId){
|
|
|
+ replaceClientId({id:currentClientId})
|
|
|
+ }
|
|
|
+ // #endif
|
|
|
+ }
|
|
|
+ this.$util.pageTo({url: "/admin/ljh/applyResult", type:2})
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.module-com {
|
|
|
+ margin-bottom: 20upx;
|
|
|
+ background-color: #fff;
|
|
|
+ .module-tit {
|
|
|
+ padding: 20upx 18upx;
|
|
|
+ font-size: 28upx;
|
|
|
+ font-weight: 600;
|
|
|
+ border-bottom: 1upx solid $borderColor;
|
|
|
+ }
|
|
|
+ .module-det {
|
|
|
+ padding: 0 30upx;
|
|
|
+ }
|
|
|
+}
|
|
|
+// 公共
|
|
|
+.line-cell {
|
|
|
+ .tui-title {
|
|
|
+ width: 210upx;
|
|
|
+ color: $fontColor2;
|
|
|
+ }
|
|
|
+ .tui-input {
|
|
|
+ width: calc(100% - 210upx);
|
|
|
+ font-size: 28upx;
|
|
|
+ }
|
|
|
+ .tui-placeholder {
|
|
|
+ color: #ccc;
|
|
|
+ }
|
|
|
+ .phcolor {
|
|
|
+ color: #ccc;
|
|
|
+ }
|
|
|
+}
|
|
|
+.btn-wrap {
|
|
|
+ width: 90%;
|
|
|
+ margin:30upx auto;
|
|
|
+ .admin-button-com {
|
|
|
+ width: 100%;
|
|
|
+ margin: 0 auto;
|
|
|
+ }
|
|
|
+}
|
|
|
+// 验证码
|
|
|
+.code-wrap {
|
|
|
+ .tui-input {
|
|
|
+ width: calc(100% - 410upx);
|
|
|
+ font-size: 28upx;
|
|
|
+ }
|
|
|
+ .tui-code {
|
|
|
+ width: 200upx;
|
|
|
+ text-align: center;
|
|
|
+ border-left: 1upx solid $borderColor;
|
|
|
+ color: $mainColor;
|
|
|
+ }
|
|
|
+}
|
|
|
+// 推荐人
|
|
|
+.recommend-wrap {
|
|
|
+ padding: 30upx 45upx;
|
|
|
+ .recommend-tag {
|
|
|
+ font-size: 28upx;
|
|
|
+ color: $fontColor2;
|
|
|
+ margin-bottom: 24upx;
|
|
|
+ }
|
|
|
+ .recommend-det {
|
|
|
+ @include disFlex(center, flex-start);
|
|
|
+ .recommend-info {
|
|
|
+ margin-left: 20upx;
|
|
|
+ .app-size-32 {
|
|
|
+ margin-bottom: 4upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|