You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
apply-assistant-v3/root/detail/user.vue

173 lines
3.9 KiB
Vue

6 months ago
<template>
4 months ago
<div class="g_bg_page g_text_c">
<div class="g_fs_20 g_pt_24 g_fw_600">
{{ agencyInfo.inviteAgencyFullName }}
5 months ago
</div>
4 months ago
<div class="">
<div class="g_mt_24 g_mb_24">
请输入尾号为<span class="g_c_f40">{{ agencyInfo.newTel }}</span
>的手机号以获取验证码
5 months ago
</div>
4 months ago
<g-panel-form-slot
:list="[
{
icon: '',
label: '手机号',
result: '',
path: '',
value: info.tel,
tip: 'slot-mobile',
placeholder: '请输入联系电话',
type: 'slot',
pColumn: 8,
require: false,
},
{
icon: '',
label: '验证码',
result: '',
path: '',
value: info.code,
tel: info.tel,
verifyTel: agencyInfo.contactsTel,
tip: 'slot-code',
placeholder: '请输入验证码',
type: 'slot',
pColumn: 8,
require: false,
},
]"
@changeMobile="(val) => (info.tel = val)"
@changeCode="(val) => (info.code = val)"
>
</g-panel-form-slot>
<div class="" style="margin-top: 48px">
<quickLogin @successLogin="successLogin" v-if="!isLogin">
<g-button btnText="绑定代理" type="primary" class></g-button>
</quickLogin>
<g-button v-else btnText="绑定代理" type="primary" @clickBtn="bindAgency" />
5 months ago
</div>
</div>
</div>
6 months ago
</template>
<script>
4 months ago
import quickLogin from "../../components/quickLogin.vue";
6 months ago
export default {
4 months ago
// 组件名称
name: "",
// 局部注册的组件
components: {
quickLogin,
6 months ago
},
4 months ago
// 组件参数 接收来自父组件的数据
props: {},
// 组件状态值
6 months ago
data() {
return {
info: {
4 months ago
tel: "",
code: "",
6 months ago
},
4 months ago
agencyInfo: {},
scene: {
agencyId: "",
providerId: "",
},
isLogin: false,
6 months ago
};
},
onLoad(options) {
4 months ago
console.log(options);
if (options.scene) {
var sceneStr = decodeURIComponent(options.scene);
var sceneJson = this.G.sceneToJson(sceneStr);
this.scene.providerId = sceneJson.id.split("_")[1]; //被关注团队的邀请人id
this.scene.agencyId = sceneJson.id.split("_")[0]; // 被关注团队的id
console.log(this.scene);
6 months ago
}
5 months ago
this.getDetail();
6 months ago
},
onShow() {
4 months ago
this.isLogin = uni.getStorageSync("apply-token") ? true : false; // uni.getStorageSync("apply-token");
6 months ago
},
4 months ago
// 计算属性
computed: {},
// 侦听器
watch: {},
created() {},
mounted() {},
// 组件方法
6 months ago
methods: {
4 months ago
successLogin(e) {
6 months ago
let that = this;
4 months ago
this.isLogin = uni.getStorageSync("apply-token") ? true : false;
if (!that.info.tel || !that.info.code) {
uni.showToast({
title: "请输入手机号和验证码",
icon: "none",
});
6 months ago
} else {
4 months ago
this.bindAgency();
6 months ago
}
},
4 months ago
bindAgency() {
6 months ago
let that = this;
4 months ago
if (!that.info.tel || !that.info.code) {
uni.showToast({
title: "请输入手机号和验证码",
icon: "none",
});
return;
6 months ago
}
4 months ago
that.G.handleConfirm({
content: "绑定后将关注该代理, 是否确认?",
success: (res) => {
if (res.confirm) {
6 months ago
that.G.Post(
4 months ago
"/yishoudan/store/provider/downAgencyBindUpAgency",
6 months ago
{
4 months ago
providerId: that.scene.providerId,
upAgencyId: that.scene.agencyId,
tel: that.info.tel,
code: that.info.code,
6 months ago
},
(res) => {
4 months ago
console.log(res);
that.G.handleConfirm({
content: "绑定成功, 请回到首页",
showCancel: false,
success: (res) => {
if (res.confirm) {
uni.switchTab({
url: '/pages/home/index',
});
}
},
6 months ago
});
}
);
}
},
});
},
4 months ago
getDetail() {
6 months ago
let that = this;
4 months ago
that.G.Get(
"/yishoudan/store/provider/getInviteRelationDetails",
{
providerId: that.scene.providerId,
},
(res) => {
console.log(res);
res.newTel = res.contactsTel.slice(-4);
that.agencyInfo = res;
6 months ago
}
4 months ago
);
6 months ago
},
},
};
</script>
4 months ago
<style scoped lang="less"></style>