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/home/shareList.vue

262 lines
8.2 KiB
Vue

3 months ago
<template>
<view class="p-root-detail-apply g_w_all g_bg_f_5 g_kuaishou g_pt_10">
<view class="g_flex_row_between flex_center g_p_12 g_mb_12 g_bg_f" v-if="(userRole.recordStatus == 3 || userRole.recordStatus == 4 || userRole.recordStatus == 5) && from == '短链接'">
<view>关注该代理可查看其佣金, 点击直接关注</view>
<view>
<g-button type="primary" size="mini" fontSize="14" btnText="关注" @btnClick="handleSubmit"></g-button>
</view>
</view>
3 months ago
<g-list-job from="shareList" class="g_flex_1" :recordStatus="userRole.recordStatus" :list="query.list" @clickCard="goDetail" :loading="loading" :speed="speed" :query="query" :isShowLoginBtn="isLogin ? false : true" />
<applyFlow ref="applyFlow" @updateInfo="updateInfo" :userInfo="userInfo" :shareAgencyId="shareUserInfo.agencyId" :agencyInfo="agencyInfo"></applyFlow>
3 months ago
</view>
</template>
<script>
import applyFlow from "../components/applyFlow.vue";
3 months ago
export default {
components: {
applyFlow,
},
3 months ago
onReady() {
this.G.setNavStyle();
},
3 months ago
onShareAppMessage1() {
3 months ago
return this.G.shareFun();
},
data() {
return {
cdnBaseImg: this.G.store().cdnBaseImg,
agencyId: uni.getStorageSync("apply-agencyId"),
userInfo: uni.getStorageSync("apply-userinfo"),
3 months ago
isAdmin: uni.getStorageSync("apply-userinfo").admin,
agencyInfo: {},
3 months ago
userRole: {},
shareUserInfo: {},
3 months ago
isCreator: false, //管理人员判断
speed: -1,
query: {
page: 1,
size: 20,
list: [],
isFinish: -1,
ujc: 0, // 0 全部 1收藏
},
isLogin: true,
3 months ago
loading: false,
3 months ago
QRCodeId: null,
from: "",
3 months ago
};
},
onLoad(options) {
3 months ago
let that = this;
let val = uni.getLaunchOptionsSync();
console.log("value", val);
3 months ago
console.log("options", options);
if (val.scene == 1167 || val.scene == 1065) {
this.from = "短链接";
} else {
this.from = "其他";
}
3 months ago
if (options.scene) {
console.log("XXXXXXXXXXXX");
//扫小程序码携带参数
var sceneStr = decodeURIComponent(options.scene);
console.log(sceneStr);
var sceneJson = this.G.sceneToJson(sceneStr);
console.log("sceneJson===", sceneJson);
3 months ago
that.G.Get("/checkUserLogin", {}, (res) => {
console.log("checkUserLogin", res);
if (res) {
// 已登录状态
that.getAgencyInfo().then(() => {
if (sceneJson.i) {
that.sceneStoreJobId = sceneJson.i;
let u = sceneJson.u.split("_");
that.shareUserInfo = {
agencyId: u[0],
agencyUserId: u[1],
};
3 months ago
that.getUserRole().then(() => {
that.getList();
});
} else {
that.QRCodeId = sceneJson.id;
that.getId().then(() => {
that.getUserRole().then(() => {
that.getList();
});
});
}
});
3 months ago
} else {
uni.reLaunch({
url: `/root/person/loginIndex?type=shareList&path=/root/home/shareList&scene=${JSON.stringify(sceneJson)}`,
});
}
});
// this.sceneStoreJobId = sceneJson.i;
// let u = sceneJson.u.split("_");
3 months ago
// this.sceneStoreJobId = sceneJson.u;
3 months ago
uni.setStorageSync("AGENCY_USER_ID", sceneJson.u);
// app.globalData.sceneStoreJobId = sceneJson.ids
}
3 months ago
// if (uni.getStorageSync("apply-userinfo")) {
// this.isLogin = true;
// } else {
// this.isLogin = false;
// }
3 months ago
},
onShow() {},
methods: {
/**
* 获取登录人的团队信息
*/
getAgencyInfo() {
let that = this;
return new Promise((reso, reject) => {
that.G.Get(that.api.login_agencyInfo, {}, (aRes) => {
console.log("获取团队信息:", aRes);
if (aRes.agency) {
that.agencyInfo = { ...aRes.agency, fullName: aRes.agency.fullName ? aRes.agency.fullName : that.agencyInfo.fullName };
uni.setStorageSync("agencyInfo", aRes.agency);
}
setTimeout(() => {
reso();
}, 200);
});
});
},
// 组件关注后更新信息
updateInfo() {
let that = this;
that.getAgencyInfo().then(() => {
that.G.checkToken();
});
},
3 months ago
getUserRole() {
let that = this;
return new Promise((resolve, reject) => {
this.G.Get(this.api.order_getAgencyByIdForApply, { agencyId: that.shareUserInfo.agencyId, inviteUserId: this.shareUserInfo.agencyUserId }, (res) => {
console.log("resresresresresres++++++++++++++", res);
that.userRole = res;
resolve();
});
});
},
/**
* 获取二维码携带的信息
*/
3 months ago
getId() {
let that = this;
return new Promise((resolve, reject) => {
this.G.Get(this.api.common_getQRCode, { id: that.QRCodeId }, (res) => {
console.log("resresresresresres++++++++++++++", res);
let params = JSON.parse(res.params);
that.sceneStoreJobId = params.storeJobIds;
that.shareUserInfo = {
agencyId: params.agencyId,
agencyUserId: params.userId,
};
resolve();
});
});
},
3 months ago
getList($type = "init") {
let that = this;
that.G.Get(
that.api.get_sharejob_list,
{
storeJobIds: that.sceneStoreJobId,
},
(res) => {
console.log("一才职位列表:", res);
that.speed = res.list.length;
that.query.isFinish = res.list.length;
if (res.list && res.list.length > 0) {
res.list = that.G.toGetAddressv3(res.list);
res.list = that.G.toGetAge(res.list);
res.list = that.G.yijobCopy(res.list);
}
if ($type == "init") {
that.query.list = [];
that.query.list = res.list.map((item, index) => {
return {
...item,
3 months ago
title: item.jobName,
address: item.district + item.age,
price: item.salaryClassify != 7 ? that.G.getSalaryClassifyValue(item.salaryClassify, item.salaryClassifyValue) : that.G.getSalaryClassifyValue(item.salaryClassify, item.minMonthlyPay, item.maxMonthlyPay),
logo: item.agencyLogo,
time: that.G.setDeadLine(item.updateTime, "jiaofu"),
fuWuFei: that.G.setReturnFee(item.returnFee, item.returnFeeType),
gender: that.G.getGenderByMinAge(item),
leafCateId: item.id,
// serverPrice: that.tabInfo.list[that.tabInfo.active].tip == 2 ? that.G.setReturnFee(item.returnFee, item.returnFeeType) : that.G.setReturnFee(item.agencyReturnFee, item.agencyReturnFeeType),
serverPrice: that.G.setReturnFee(item.agencyReturnFee, item.agencyReturnFeeType),
recruitmentSwitch: item.recruitment == 1 ? true : false,
recruitmentImage: item.recruitment,
isToday: item.today == 0 ? false : true,
3 months ago
};
});
} else {
that.query.list = that.query.list.concat(
res.list.map((item, index) => {
return {
...item,
3 months ago
title: item.jobName,
address: item.district + item.age,
price: item.salaryClassify != 7 ? that.G.getSalaryClassifyValue(item.salaryClassify, item.salaryClassifyValue) : that.G.getSalaryClassifyValue(item.salaryClassify, item.minMonthlyPay, item.maxMonthlyPay),
logo: item.agencyLogo,
time: that.G.setDeadLine(item.updateTime, "jiaofu"),
fuWuFei: that.G.setReturnFee(item.returnFee, item.returnFeeType),
3 months ago
gender: that.G.getGenderByMinAge(item),
3 months ago
leafCateId: item.id,
// serverPrice: that.tabInfo.list[that.tabInfo.active].tip == 2 ? that.G.setReturnFee(item.returnFee, item.returnFeeType) : that.G.setReturnFee(item.agencyReturnFee, item.agencyReturnFeeType),
serverPrice: that.G.setReturnFee(item.agencyReturnFee, item.agencyReturnFeeType),
recruitmentSwitch: item.recruitment == 1 ? true : false,
recruitmentImage: item.recruitment,
isToday: item.today == 0 ? false : true,
3 months ago
};
})
);
}
}
);
},
goDetail($item) {
console.log("前往详情页", $item);
if (this.isLogin) {
uni.navigateTo({
3 months ago
// 职位id_职位创建方_分享人_分享人团队
url: `/root/detail/job?scene=id%3D${$item.id}_${$item.agencyId}_${this.shareUserInfo.agencyUserId}_${this.shareUserInfo.agencyId}`,
3 months ago
});
} else {
uni.navigateTo({
3 months ago
url: "/root/person/loginIndex",
3 months ago
});
}
},
handleSubmit() {
let that = this;
this.G.isLogin();
if (this.G.isLogin()) {
if (that.userInfo.agencyId) {
// that.submitConfirm = true;
that.$refs.applyFlow.applyFlowConfirm();
} else {
that.$refs.applyFlow.applyFlowWidthoutAgencyConfirm();
}
}
},
3 months ago
},
};
</script>
<style lang="scss">
.p-root-detail-apply {
min-height: 100%;
}
</style>