|
|
@@ -40,7 +40,7 @@
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<div class="tui-title">店长姓名</div>
|
|
|
<input
|
|
|
- v-model="form.name"
|
|
|
+ v-model="form.adminName"
|
|
|
placeholder-class="phcolor"
|
|
|
placeholder-style="color:#CCCCCC"
|
|
|
class="tui-input"
|
|
|
@@ -48,61 +48,66 @@
|
|
|
placeholder="请输入店长姓名"
|
|
|
/>
|
|
|
</tui-list-cell>
|
|
|
- <tui-list-cell class="line-cell code-wrap" :hover="false">
|
|
|
- <div class="tui-title">我的昵称</div>
|
|
|
- <div class="tui-code" style="width:260rpx;">{{nickName}}</div>
|
|
|
- <button
|
|
|
- class="admin-button-com blue mini-btn"
|
|
|
- open-type="getUserInfo"
|
|
|
- @getuserinfo="getWxAvatar"
|
|
|
- >帮我填</button>
|
|
|
- </tui-list-cell>
|
|
|
- <tui-list-cell class="line-cell code-wrap" :hover="false">
|
|
|
- <div class="tui-title">我的手机号</div>
|
|
|
- <div class="tui-code" style="width:260rpx;">{{form.mobile}}</div>
|
|
|
- <button
|
|
|
- class="admin-button-com blue mini-btn"
|
|
|
- open-type="getPhoneNumber"
|
|
|
- @getphonenumber="getWxMobile"
|
|
|
- >帮我填</button>
|
|
|
- </tui-list-cell>
|
|
|
+ <AppBindInfo
|
|
|
+ @bindInfo="bindInfo"
|
|
|
+ nameTetx="我的昵称">
|
|
|
+ </AppBindInfo>
|
|
|
</div>
|
|
|
<!-- 手机号 -->
|
|
|
<div class="module-com">
|
|
|
- <tui-list-cell class="line-cell code-wrap" :hover="false">
|
|
|
- <div class="tui-title">主营业务</div>
|
|
|
+ <!-- <tui-list-cell
|
|
|
+ class="line-cell code-wrap" :hover="false">
|
|
|
+ <div class="tui-title">商家类型</div>
|
|
|
<div>
|
|
|
<button class="admin-button-com blue mini-btn">
|
|
|
零售
|
|
|
</button>
|
|
|
<button style="margin-left:10px;" class="admin-button-com default mini-btn">
|
|
|
+ 供货商
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </tui-list-cell> -->
|
|
|
+ <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:10px;" :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>
|
|
|
- <app-uploader ref="appUploader" :imgList.sync="form.shopImg" :isMain="true" :num="4" />
|
|
|
- <!-- <input
|
|
|
- v-model="form.name"
|
|
|
+ <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>
|
|
|
- <input
|
|
|
+ <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.name"
|
|
|
placeholder-class="phcolor"
|
|
|
placeholder-style="color:#CCCCCC"
|
|
|
class="tui-input"
|
|
|
name="name"
|
|
|
placeholder="请输入营业执照编号"
|
|
|
- />
|
|
|
+ /> -->
|
|
|
</tui-list-cell>
|
|
|
+
|
|
|
</div>
|
|
|
<!-- 推荐人 -->
|
|
|
<div class="module-com recommend-wrap" v-if="!$util.isEmpty(merchantData)">
|
|
|
@@ -138,6 +143,7 @@ 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");
|
|
|
// api
|
|
|
import {
|
|
|
@@ -154,7 +160,8 @@ export default {
|
|
|
AppAreaSel,
|
|
|
SimpleAddress,
|
|
|
AppAvatarModule,
|
|
|
- AppUploader
|
|
|
+ AppUploader,
|
|
|
+ AppBindInfo
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -166,10 +173,15 @@ export default {
|
|
|
city: "",
|
|
|
dist: "",
|
|
|
address: "",
|
|
|
- floor: "",
|
|
|
+ adminName:'',
|
|
|
+ nickName:'',
|
|
|
+ main: 1,
|
|
|
+ licenseNo: "",
|
|
|
+ license: "",
|
|
|
+ // floor: "",
|
|
|
longitude: "",
|
|
|
latitude: "",
|
|
|
- adminId: ""
|
|
|
+
|
|
|
},
|
|
|
showRegion: false,
|
|
|
// 省市联动
|
|
|
@@ -183,6 +195,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
onLoad() {
|
|
|
+ // form 来源 introMerchantId 推荐ID style 供货商 | 零售
|
|
|
// if (!this.$util.isLogin()) {
|
|
|
// // getShopUser()
|
|
|
// return false
|
|
|
@@ -190,14 +203,23 @@ export default {
|
|
|
// this.init()
|
|
|
},
|
|
|
methods: {
|
|
|
+ //图片地址
|
|
|
+ resultData(val){
|
|
|
+ this.form.license = val.smallUrl
|
|
|
+ },
|
|
|
+ changeMain(val){
|
|
|
+ this.form.main = val
|
|
|
+ },
|
|
|
+ bindInfo(val){
|
|
|
+ this.form.nickName = val.nickName;
|
|
|
+ this.form.mobile = val.mobile
|
|
|
+ },
|
|
|
init() {
|
|
|
this.$util.getCheckLogin().then(res => {
|
|
|
if (res) {
|
|
|
- let id = uni.getStorageSync("introMerchantId");
|
|
|
- if (id > 0) {
|
|
|
- this._getMerchantDet();
|
|
|
- }
|
|
|
- // this._regionTree();
|
|
|
+ if(this.option.introMerchantId) {
|
|
|
+ this._getMerchantDet();
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
@@ -207,21 +229,22 @@ export default {
|
|
|
// });
|
|
|
// },
|
|
|
_getMerchantDet() {
|
|
|
- let id = uni.getStorageSync("introMerchantId");
|
|
|
- getIntroduce({ id: id }).then(res => {
|
|
|
+ // let id = uni.getStorageSync("introMerchantId");
|
|
|
+ getIntroduce({ id: this.option.introMerchantId || 0 }).then(res => {
|
|
|
this.merchantData = res.data;
|
|
|
});
|
|
|
},
|
|
|
// ==============
|
|
|
confirmFn() {
|
|
|
- let id = uni.getStorageSync("introMerchantId");
|
|
|
+ // let id = uni.getStorageSync("introMerchantId");
|
|
|
applyRegister({
|
|
|
- introMerchantId: id || 0,
|
|
|
- ...this.form
|
|
|
+ introSjId: this.option.introMerchantId || 0,
|
|
|
+ ...this.form,
|
|
|
+ style: this.option.style || 0,
|
|
|
+ from: this.option.from || 0
|
|
|
}).then(res => {
|
|
|
- uni.setStorageSync("officialApply", res.data);
|
|
|
this.$util.pageTo({
|
|
|
- url: "/pagesClient/official/callback",
|
|
|
+ url: "/pagesClient/official/result",
|
|
|
type: 2,
|
|
|
query: {
|
|
|
pagestatus: 3
|
|
|
@@ -229,76 +252,6 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
- // 验证码
|
|
|
- getCode() {
|
|
|
- if (!this.form.mobile || !this.$util.checkMobile(this.form.mobile)) {
|
|
|
- this.$msg("请输入正确的手机号!");
|
|
|
- return false;
|
|
|
- }
|
|
|
- this.isSend = 1;
|
|
|
- sendSmsW({
|
|
|
- type: 1,
|
|
|
- mobile: this.form.mobile
|
|
|
- })
|
|
|
- .then(res => {
|
|
|
- this.beginCountDown();
|
|
|
- this.$msg("发送成功!");
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.isSend = 0;
|
|
|
- this.$msg("发送失败!");
|
|
|
- });
|
|
|
- },
|
|
|
- // 获取微信手机号
|
|
|
- getWxMobile(e) {
|
|
|
- console.log(e);
|
|
|
- if (e.detail.errMsg === "getPhoneNumber:ok") {
|
|
|
- getWxPhone({
|
|
|
- iv: e.detail.iv,
|
|
|
- encryptedData: e.detail.encryptedData
|
|
|
- }).then(res => {
|
|
|
- this.form.mobile = res.data.mobile;
|
|
|
- uni.showToast({
|
|
|
- icon: "success"
|
|
|
- });
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$msg("获取信息失败!");
|
|
|
- }
|
|
|
- },
|
|
|
- // 获取微信信息
|
|
|
- getWxAvatar() {
|
|
|
- uni.getUserInfo({
|
|
|
- provider: "weixin",
|
|
|
- success: res => {
|
|
|
- console.log("res", res);
|
|
|
- getWxInfo({ iv: res.iv, encryptedData: res.encryptedData }).then(
|
|
|
- subRes => {
|
|
|
- this.form.adminId = subRes.data.id;
|
|
|
- this.nickName = subRes.data.nickName;
|
|
|
- uni.showToast({
|
|
|
- icon: "success"
|
|
|
- });
|
|
|
- }
|
|
|
- );
|
|
|
- },
|
|
|
- fail: () => {
|
|
|
- // this.loading = false
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- // 倒计时
|
|
|
- beginCountDown() {
|
|
|
- this.countDown = 119;
|
|
|
- this.timer = setInterval(() => {
|
|
|
- if (this.countDown === 0) {
|
|
|
- clearInterval(this.timer);
|
|
|
- this.isSend = 0;
|
|
|
- return;
|
|
|
- }
|
|
|
- this.countDown -= 1;
|
|
|
- }, 1000);
|
|
|
- },
|
|
|
// 选择地址
|
|
|
selRegionFn() {
|
|
|
if (!this.form.city) {
|
|
|
@@ -324,6 +277,7 @@ export default {
|
|
|
this.form.address = e.address;
|
|
|
this.form.latitude = e.location.lat;
|
|
|
this.form.longitude = e.location.lng;
|
|
|
+ this.form.dist = e.district
|
|
|
},
|
|
|
// -----
|
|
|
// 省市联动
|
|
|
@@ -341,7 +295,7 @@ export default {
|
|
|
// 表单规则
|
|
|
let rules = [
|
|
|
{
|
|
|
- name: "adminId",
|
|
|
+ name: "name",
|
|
|
rule: ["required"],
|
|
|
msg: ["请填写昵称"]
|
|
|
}
|
|
|
@@ -349,22 +303,28 @@ export default {
|
|
|
// 进行表单检查
|
|
|
let formData = this.form;
|
|
|
let checkRes = form.validation(formData, rules);
|
|
|
- this.$util.pageTo({
|
|
|
- url: "/pagesClient/official/callback",
|
|
|
- type: 2,
|
|
|
- query: {
|
|
|
- pagestatus: 1
|
|
|
- }
|
|
|
- });
|
|
|
+ // this.$util.pageTo({
|
|
|
+ // url: "/pagesClient/official/callback",
|
|
|
+ // type: 2,
|
|
|
+ // query: {
|
|
|
+ // pagestatus: 1
|
|
|
+ // }
|
|
|
+ // });
|
|
|
// 验证通过!
|
|
|
- // if (!checkRes) {
|
|
|
- // setTimeout(() => {
|
|
|
- // this.confirmFn();
|
|
|
- // });
|
|
|
- // } else {
|
|
|
- // this.$msg(checkRes);
|
|
|
- // }
|
|
|
+ if (!checkRes) {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.confirmFn();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$msg(checkRes);
|
|
|
+ }
|
|
|
}
|
|
|
+ },
|
|
|
+ watch:{
|
|
|
+ // imageList(val){
|
|
|
+ // this.form.
|
|
|
+ // console.log(val)
|
|
|
+ // }
|
|
|
}
|
|
|
};
|
|
|
</script>
|