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/person/memberApplyAdd.vue

125 lines
3.5 KiB
Vue

6 months ago
<template>
6 months ago
<div class="g_bg_page g_pl_10 g_pr_10">
<div class="g_h_20"></div>
5 months ago
<div class="g_mb_10 g_fs_18 g_pl_10">{{ agencyInfo.inviteUserName || "-" }}邀请您加入他的团队</div>
6 months ago
<div class="r_box g_pt_24 g_pb_16 g_text_c">
<img class="g_h_80 g_w_80 g_radius_50" :src="agencyInfo.logo || 'https://matripe-cms.oss-cn-beijing.aliyuncs.com/dailibaoming/APP/default.svg'" alt="" />
<div class="g_fs_20 g_mt_12 g_mb_12 g_fw_600">
{{ agencyInfo.agencyName || "-" }}
</div>
<div class="g_c_9 g_fs_14">
{{ agencyInfo.desp || "-" }}
</div>
</div>
<div class="g_mt_30">
<div class="g_fs_20 g_mb_8 g_pl_12">填写个人信息:</div>
<div class="r_box g_pl_10">
<u-input v-model="userInfo.userName" height="88" placeholder="请输入你的姓名"></u-input>
</div>
<div class="g_fs_12 g_c_9 g_pl_12">该名称会在团队成员列表显示创建人可以修改</div>
6 months ago
</div>
<div class="g_mt_84">
6 months ago
<g-button v-if="!applying && agencyInfo.agencyName" btnText="申请加入团队" type="primary" class="" @clickBtn="applyAdd"></g-button>
<g-button v-else btnText="已申请" type="disabled" class=""></g-button>
6 months ago
</div>
</div>
6 months ago
</template>
<script>
export default {
6 months ago
data() {
return {
agencyInfo: {
agencyName: "",
fullName: "",
},
6 months ago
userInfo: {
userName: "",
userId: "",
},
6 months ago
applying: false,
6 months ago
inviteUserId: "",
6 months ago
uid: "",
6 months ago
ing: false,
6 months ago
};
},
onLoad(options) {
console.log(options);
6 months ago
// options.scene = "id=3087_101125";
if (uni.getStorageSync("scene") || options.scene) {
6 months ago
console.log("XXXXXXXXXXXX");
//扫小程序码携带参数
6 months ago
var sceneStr = uni.getStorageSync("scene") ? decodeURIComponent(uni.getStorageSync("scene")) : decodeURIComponent(options.scene);
6 months ago
var sceneJson = this.G.sceneToJson(sceneStr);
console.log("sceneJson===", sceneJson);
6 months ago
this.inviteUserId = sceneJson.id.split("_")[1];
this.uid = sceneJson.id.split("_")[0];
this.G.checkToken().then((info) => {
6 months ago
console.log("info11", info);
if (!info.msg) {
this.userInfo = uni.getStorageSync("apply-userinfo");
6 months ago
this.getAgencyById();
this.checkHasApply();
6 months ago
uni.removeStorageSync("scene");
6 months ago
} else {
6 months ago
// uni.reLaunch({
// url: `/pages/login/index?path='/root1/person/memberApplyAdd'&scene=${options.scene}`,
// });
uni.setStorageSync("scene", options.scene);
6 months ago
}
});
6 months ago
6 months ago
// uni.setStorageSync("AGENCY_USER_ID", this.userId);
}
},
created() {},
6 months ago
6 months ago
methods: {
applyAdd() {
let that = this;
6 months ago
if (!this.userInfo.userName) {
uni.showToast({
title: "请输入你的姓名",
icon: "none",
});
return;
}
if (this.ing) {
return;
}
that.ing = true;
6 months ago
this.G.Post(this.api.order_addApply, { agencyId: that.uid, username: this.userInfo.userName, inviteUserId: this.inviteUserId }, (res) => {
6 months ago
uni.showToast({
title: "申请成功",
icon: "none",
});
that.checkHasApply();
6 months ago
console.log(res);
});
},
getAgencyById() {
let that = this;
5 months ago
this.G.Get(this.api.order_getAgencyByIdForApply, { agencyId: that.uid, inviteUserId: this.inviteUserId }, (res) => {
6 months ago
console.log(res);
that.agencyInfo = res;
});
},
6 months ago
checkHasApply() {
6 months ago
let that = this;
6 months ago
this.G.Post(this.api.order_checkHasApply, { agencyId: that.uid, userId: this.userInfo.id }, (res) => {
6 months ago
if (res.length > 0) {
that.applying = true;
} else {
that.applying = false;
}
6 months ago
that.ing = false;
6 months ago
console.log(res);
});
6 months ago
},
6 months ago
},
};
6 months ago
</script>
6 months ago
<style></style>