mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 19:13:26 +08:00
【调整】代理功能移除申请表单信息,改为直接提交申请。防止出现小程序提交审核被拒绝的问题。
This commit is contained in:
@@ -18,33 +18,20 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 表单 -->
|
<!-- 表单 -->
|
||||||
<view class="coreshop-bg-white coreshop-border-radius-10 coreshop-padding-15 coreshop-margin-10">
|
<view class="coreshop-bg-white coreshop-border-radius-10 coreshop-padding-15 coreshop-margin-10">
|
||||||
<u--form :model="form" :rules="rules" ref="uForm" errorType="message" labelPosition="left" labelWidth="80">
|
<view class="u-content">
|
||||||
<u-form-item label="姓名" prop="name" borderBottom>
|
<u-parse :content="agentAgreement" :selectable="true"></u-parse>
|
||||||
<u--input type="text" placeholder='请填您的姓名' v-model="form.name" />
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item label="微信" prop="weixin" borderBottom>
|
|
||||||
<u--input type="text" placeholder='请填您的微信' v-model="form.weixin" />
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item label="QQ" prop="qq" borderBottom>
|
|
||||||
<u--input type="number" placeholder='请填您的QQ' v-model="form.qq" />
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item label="手机" prop="mobile" borderBottom>
|
|
||||||
<u--input type="number" placeholder='请填写您的手机号码' v-model="form.mobile" />
|
|
||||||
</u-form-item>
|
|
||||||
<view class="coreshop-padding-15 flex coreshop-flex-nowrap">
|
|
||||||
<u-checkbox-group>
|
|
||||||
<u-checkbox v-model="form.checked" @change="checkboxChange">我已经阅读并接受</u-checkbox>
|
|
||||||
<text class="coreshop-text-orange coreshop-padding-left-10 coreshop-padding-right-10 coreshop-font-15 coreshop-vertical-align-sub" @click="goAgreement()">"代理协议"</text>
|
|
||||||
</u-checkbox-group>
|
|
||||||
</view>
|
|
||||||
</u--form>
|
|
||||||
<view class="coreshop-padding-15">
|
|
||||||
<u-button type="primary" size="normal" @click="submit()">申请成为代理商</u-button>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="coreshop-bg-white coreshop-footer-fixed coreshop-foot-padding-bottom">
|
||||||
|
<u-button type="primary" size="normal" @click="submit()">申请成为代理商</u-button>
|
||||||
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import { mapState } from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -53,92 +40,44 @@
|
|||||||
weixin: '',
|
weixin: '',
|
||||||
qq: '',
|
qq: '',
|
||||||
mobile: '',
|
mobile: '',
|
||||||
checked: false,
|
|
||||||
isAgreement: 'off'
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
name: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请输入姓名',
|
|
||||||
trigger: ['blur', 'change']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
min: 2,
|
|
||||||
max: 4,
|
|
||||||
message: '长度在2-4个字符之间'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
weixin: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请输入微信',
|
|
||||||
trigger: ['blur', 'change']
|
|
||||||
}
|
|
||||||
],
|
|
||||||
qq: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请输入QQ',
|
|
||||||
trigger: ['blur', 'change']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: "number",
|
|
||||||
message: 'QQ必须为数字',
|
|
||||||
trigger: ['change', 'blur']
|
|
||||||
},
|
|
||||||
],
|
|
||||||
mobile: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请输入手机号码',
|
|
||||||
trigger: ['blur', 'change']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
validator: (rule, value, callback) => {
|
|
||||||
return this.$u.test.mobile(value);
|
|
||||||
},
|
|
||||||
message: '手机号码不正确',
|
|
||||||
trigger: ['change', 'blur'],
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onReady() {
|
computed: {
|
||||||
this.$refs.uForm.setRules(this.rules);
|
...mapState({
|
||||||
|
hasLogin: state => state.hasLogin,
|
||||||
|
userInfo: state => state.userInfo,
|
||||||
|
}),
|
||||||
|
agentAgreement() {
|
||||||
|
return this.$store.state.config.agentAgreement
|
||||||
|
},
|
||||||
|
userInfo: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.userInfo;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit('userInfo', val);
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
checkboxChange(n) {
|
|
||||||
this.form.checked = n;
|
|
||||||
console.log('change', n);
|
|
||||||
},
|
|
||||||
submit() {
|
submit() {
|
||||||
this.$refs.uForm.validate().then(res => {
|
// 提交审核
|
||||||
if (this.form.checked == false) {
|
let data = {
|
||||||
this.$u.toast('请勾选代理协议')
|
name: this.userInfo.nickName,
|
||||||
return false;
|
weixin: this.userInfo.mobile,
|
||||||
|
qq: this.userInfo.mobile,
|
||||||
|
mobile: this.userInfo.mobile,
|
||||||
|
agreement: "on",
|
||||||
|
}
|
||||||
|
this.$u.api.applyAgent(data).then(res => {
|
||||||
|
if (res.status) {
|
||||||
|
this.$refs.uToast.show({ message: res.msg, type: 'success', url: '/pages/member/agent/applyState/applyState' })
|
||||||
|
} else {
|
||||||
|
this.$u.toast(res.msg);
|
||||||
}
|
}
|
||||||
this.form.isAgreement = "on";
|
});
|
||||||
|
|
||||||
// 提交审核
|
|
||||||
let data = {
|
|
||||||
name: this.form.name,
|
|
||||||
weixin: this.form.weixin,
|
|
||||||
qq: this.form.qq,
|
|
||||||
mobile: this.form.mobile,
|
|
||||||
agreement: this.form.isAgreement,
|
|
||||||
}
|
|
||||||
this.$u.api.applyAgent(data).then(res => {
|
|
||||||
if (res.status) {
|
|
||||||
this.$refs.uToast.show({ message: res.msg, type: 'success', url: '/pages/member/agent/applyState/applyState' })
|
|
||||||
} else {
|
|
||||||
this.$u.toast(res.msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}).catch(errors => {
|
|
||||||
uni.$u.toast('提交的数据校验失败,请输入合法信息!')
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
goAgreement() {
|
goAgreement() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|||||||
Reference in New Issue
Block a user