|
|
|
@ -15,8 +15,8 @@
|
|
|
|
<u-input v-model="userInfo.userName" height="88" placeholder="请输入你的姓名"></u-input>
|
|
|
|
<u-input v-model="userInfo.userName" height="88" placeholder="请输入你的姓名"></u-input>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="g_mt_84">
|
|
|
|
<div class="g_mt_84">
|
|
|
|
<g-button v-if="applying" btnText="已申请" type="disabled" class=""></g-button>
|
|
|
|
<g-button v-if="!applying && agencyInfo.agencyName" btnText="申请加入团队" type="primary" class="" @clickBtn="applyAdd"></g-button>
|
|
|
|
<g-button v-else btnText="申请加入团队" type="primary" class="" @clickBtn="applyAdd"></g-button>
|
|
|
|
<g-button v-else btnText="已申请" type="disabled" class=""></g-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
@ -36,28 +36,33 @@ export default {
|
|
|
|
applying: false,
|
|
|
|
applying: false,
|
|
|
|
inviteUserId: "",
|
|
|
|
inviteUserId: "",
|
|
|
|
uid: "",
|
|
|
|
uid: "",
|
|
|
|
|
|
|
|
ing: false,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onLoad(options) {
|
|
|
|
onLoad(options) {
|
|
|
|
console.log(options);
|
|
|
|
console.log(options);
|
|
|
|
options.scene = "id=3087_101125";
|
|
|
|
// options.scene = "id=3087_101125";
|
|
|
|
if (options.scene) {
|
|
|
|
if (uni.getStorageSync("scene") || options.scene) {
|
|
|
|
console.log("XXXXXXXXXXXX");
|
|
|
|
console.log("XXXXXXXXXXXX");
|
|
|
|
//扫小程序码携带参数
|
|
|
|
//扫小程序码携带参数
|
|
|
|
var sceneStr = decodeURIComponent(options.scene);
|
|
|
|
|
|
|
|
|
|
|
|
var sceneStr = uni.getStorageSync("scene") ? decodeURIComponent(uni.getStorageSync("scene")) : decodeURIComponent(options.scene);
|
|
|
|
var sceneJson = this.G.sceneToJson(sceneStr);
|
|
|
|
var sceneJson = this.G.sceneToJson(sceneStr);
|
|
|
|
console.log("sceneJson===", sceneJson);
|
|
|
|
console.log("sceneJson===", sceneJson);
|
|
|
|
this.inviteUserId = sceneJson.id.split("_")[1];
|
|
|
|
this.inviteUserId = sceneJson.id.split("_")[1];
|
|
|
|
this.uid = sceneJson.id.split("_")[0];
|
|
|
|
this.uid = sceneJson.id.split("_")[0];
|
|
|
|
this.G.checkToken().then((info) => {
|
|
|
|
this.G.checkToken().then((info) => {
|
|
|
|
console.log("info", info);
|
|
|
|
console.log("info11", info);
|
|
|
|
if (info) {
|
|
|
|
if (!info.msg) {
|
|
|
|
|
|
|
|
this.userInfo = uni.getStorageSync("apply-userinfo");
|
|
|
|
this.getAgencyById();
|
|
|
|
this.getAgencyById();
|
|
|
|
this.checkHasApply();
|
|
|
|
this.checkHasApply();
|
|
|
|
|
|
|
|
uni.removeStorageSync("scene");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
uni.reLaunch({
|
|
|
|
// uni.reLaunch({
|
|
|
|
url: "/pages/login/index?path=/pages/person/memberApplyAdd&scene=" + options.scene,
|
|
|
|
// url: `/pages/login/index?path='/root1/person/memberApplyAdd'&scene=${options.scene}`,
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
|
|
|
|
uni.setStorageSync("scene", options.scene);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
@ -69,7 +74,24 @@ export default {
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
applyAdd() {
|
|
|
|
applyAdd() {
|
|
|
|
let that = this;
|
|
|
|
let that = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!this.userInfo.userName) {
|
|
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
|
|
title: "请输入你的姓名",
|
|
|
|
|
|
|
|
icon: "none",
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.ing) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
that.ing = true;
|
|
|
|
this.G.Post(this.api.order_addApply, { agencyId: that.uid, username: this.userInfo.userName, inviteUserId: this.inviteUserId }, (res) => {
|
|
|
|
this.G.Post(this.api.order_addApply, { agencyId: that.uid, username: this.userInfo.userName, inviteUserId: this.inviteUserId }, (res) => {
|
|
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
|
|
title: "申请成功",
|
|
|
|
|
|
|
|
icon: "none",
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
that.checkHasApply();
|
|
|
|
console.log(res);
|
|
|
|
console.log(res);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
@ -82,13 +104,13 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
checkHasApply() {
|
|
|
|
checkHasApply() {
|
|
|
|
let that = this;
|
|
|
|
let that = this;
|
|
|
|
this.G.Post(this.api.order_checkHasApply, { agencyId: that.uid, userId: this.inviteUserId }, (res) => {
|
|
|
|
this.G.Post(this.api.order_checkHasApply, { agencyId: that.uid, userId: this.userInfo.id }, (res) => {
|
|
|
|
if (res.length > 0) {
|
|
|
|
if (res.length > 0) {
|
|
|
|
that.applying = true;
|
|
|
|
that.applying = true;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
that.applying = false;
|
|
|
|
that.applying = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
that.ing = false;
|
|
|
|
console.log(res);
|
|
|
|
console.log(res);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|