<template>
	<view>
		<view class="g_border_e_t g_flex_row_between">
			<!-- @click="handleBotom(item)" -->
			<view class="g_flex_row_between flex_center g_flex_1 g_pl_12 g_pt_9 g_pb_9" hover-class="thover" hover-stop-propagation>
				<view class="g_flex_1 g_flex_row_start g_flex_row_between flex_center">
					<view @click="takeTel(item.tel)" class="g_fs_17 g_flex_row_start flex_center">
						<image class="g_w_30 g_h_30 g_mr_4" v-if="item.tel" src="../../../static/image/tel.svg" alt="" />
						<image class="g_w_30 g_h_30 g_mr_4" v-else src="../../../static/image/tel_gray.svg" alt="" />
						{{ item.tel }}
					</view>
					<!-- <view @click="copyWechat(item)" v-if="from == 'tob'" class="g_ml_24 g_flex_row_start flex_center g_mr_12 g_c_9 g_fs_14">
						{{ item.userId ? `#${item.userId}` : "" }}
					</view> -->
				</view>
				<!-- {{from}}
				{{item.status}} -->
				<view v-if="item.status == 1 && from != 'townsman' && isMember && hasPermission">
					<view @click="record(item)" class="g_w_56 g_h_24 g_fs_12 g_border_main g_c_main g_mr_16 g_text_c g_radius_12" style="line-height: 22px">报名</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
/* 职位列表 - 信息面板
 * @params item 对象
 * @function handleBotom 点击事件
 */
export default {
	data() {
		return {
			isMember: uni.getStorageSync("IS_MINIAPP_MEMBER"),
			hasPermission: uni.getStorageSync("HAS_PERMISSION") == 1 ? true : false, // 登陆者是否有权限查看
		};
	},
	props: {
		item: {
			type: Object,
			dafault: () => {
				return {};
			},
		},
		recordStatus: {
			default: () => {
				return 1;
			},
		},
		classify: {
			type: Number,
			default: () => {
				return 0;
			},
		},
		from: {
			type: String,
			default: () => {
				return "";
			},
		},
	},
	methods: {
		handleBotom($item) {
			this.$emit("clickBottom", $item);
		},
		handleOpenStatus($item) {
			if ((this.recordStatus == 1 || this.recordStatus == 2) && this.from != "record") {
				this.$emit("clickMore", $item);
			}
		},
		copyWechat(e) {
			console.log(e);
			if (e.userId) {
				this.G.copyText("#" + e.userId);
			}
		},
		takeTel(e) {
			console.log(e);
			if (e) {
				uni.makePhoneCall({
					phoneNumber: e,
				});
			} else {
				uni.showToast({
					icon: "none",
					title: "请补充老乡电话再重试",
				});
			}
		},
		record($item) {
			console.log("$item", $item);
			uni.navigateTo({
				url: "/root/other/quickApplication?id=" + $item.id,
				// 小程序页面间通信, 确保页面渲染完再获取简历信息
				events: {
					ceshi: function (data) {
						setTimeout(() => {
							uni.$emit("getTownsman", { info: $item });
						}, 0);
						console.log(data);
					},
				},
			});
		},
	},
};
</script>

<style></style>
