<template>
	<view class="g-new">
		<view class="g_flex_row_start" style="position: relative">
			<view class="g_flex_1 g_flex_row_between">
				<view class="g_flex_1">
					<view class="g_flex_column_center">
						<view class="g_flex_row_start g_position_rela" v-if="from == 'bill'">
							<view class="new-obj g_position_abso" v-if="info.isToday">
								<view class="g_fs_12 g_c_f wors">新</view>
							</view>
							<view class="g_fs_18 g_c_0 g_fw_600 g_flex_none g_ell_1" style="max-width: 360rpx">{{ info.title }}</view>
							<!-- <view class="g_fs_14 g_flex_1 g_flex_column_center g_ml_4" style="color: rgba(0, 0, 0, 0.45)">
								<view class="g_ell_1" v-if="item.teamType == 2"> {{ item.creatorName }} </view>
							</view> -->
						</view>
						<view class="g_flex_row_start g_position_rela" v-if="from == 'default' || from == 'home' || from == 'user' || from == 'record'">
							<view class="new-obj g_position_abso" v-if="info.isToday">
								<view class="g_fs_12 g_c_f wors">新</view>
							</view>
							<view class="g_fs_18 g_c_0 g_fw_600 g_ell_1" style="max-width: 420rpx">{{ info.title }}</view>
						</view>
					</view>
					<!-- {{corpUserFlag}} -->
					<!-- 123 -->
					<view class="g_fs_14 g_mt_12 g_h_27 g_flex_column_center" v-if="item.classify == 1" style="color: rgba(0, 0, 0, 0.45)">
						<view class="g_ell_1">{{ info.address }}</view>
					</view>
					<view class="g_fs_12 g_mt_16 g_flex_column_center" style="background-color: rgba(255, 77, 79, 0.1); color: #ff4d4f; display: inline-block; padding: 0 4px; border-radius: 2px" v-if="item.classify == 2 && corpUserFlag">
						<view class="g_ell_1">{{ info.supplier }}</view>
					</view>
				</view>
				<view class="g_flex_none g_ml_12">
					<view class="g_fs_18 g_c_f40 g_fw_600 g_ml_8 g_ell_1 g_text_r" v-if="item.policyClassify == 1">{{ info.price || "-" }}</view>
					<view class="g_fs_18 g_c_f40 g_fw_600 g_ml_8 g_ell_1 g_text_r" v-else>
						<text v-if="info.totalPrice"> {{ info.totalPrice / 100 }}元/月 </text>
						<text v-else> - </text>
					</view>
					<view class="g_fs_14 g_c_f40 g_ml_8 g_text_r g_flex_row_end g_mt_10">
						<!-- 工价+服务费 --> 
						<g-panel-server v-if="item.policyClassify == 1" :str="(recordStatus == 3 || recordStatus == 4 || recordStatus == 5) && !isSelf ? '关注查看' : info.serverPrice" verson="new" />
						<!-- 总价 -->
						<g-panel-server v-else :str="(recordStatus == 3 || recordStatus == 4 || recordStatus == 5) && !isSelf ? '关注查看' : '总价'" verson="new" />
					</view>

					<view class="g_flex_row_start g_fs_12 g_pr_4 g_h_20 g_fw_400" 
								style="background: linear-gradient(138deg, #fde0ad 22%, #fac474); border-radius: 2px; color: #754300; line-height: 20px"
					>
						<view class>
							<image class="g_mr_4" 
											style="width: 20px; height: 20px; display: block" 
											src="https://bocai-cms.oss-cn-beijing.aliyuncs.com/web-resource/1shoudan/fee.svg" 
											mode="aspecFill" 
											lazy-load="false"
							></image>
						</view>
						<view class="g_fs_13" v-if="isfensi == 2">{{ info.fuWuFei || "详询客服" }}</view>
						<view class="biggerSize2 g_fs_13" v-else>{{ "仅代理可见" }}</view>
					</view>
				</view>
			</view>

			<image v-if="info.recruitmentImage == 2" :src="localBaseImg + 'stop.svg'" class="g_w_82 g_h_65" style="position: absolute; left: 50%; top: 0; transform: translateX(-50%)"> </image>
		</view>
		<view class="g_ell_1 g_fs_14 g_mt_8" style="color: rgba(0, 0, 0, 0.45)" v-if="item.classify == 2">
			{{ info.jobInfo || "-" }}
		</view>
	</view>
</template>

<script>
/* 职位列表 - 上方面板
 * @params item 对象
 */
export default {
	data() {
		return {
			isfensi:uni.getStorageSync("apply-userinfo") && uni.getStorageSync("apply-userinfo").isfensi,
			localBaseImg: this.G.store().localBaseImg,
			info: {},
			corpUserFlag: false,
		};
	},
	props: {
		item: {
			type: Object,
			dafault: () => {
				return {};
			},
		},
		isSelf: {
			type: Boolean,
			default: () => {
				return false;
			},
		},
		from: {
			type: String,
			default: () => {
				return "default";
			},
		},
		recordStatus: {
			default: () => {
				return 1;
			},
		},
	},
	watch: {
		item(val) {
			this.info = val;
			this.$forceUpdate();
		},
	},
	mounted() {
		this.info = this.item;
		this.corpUserFlag = uni.getStorageSync("apply-userinfo").corpUserFlag;
		// console.log(uni.getStorageSync("apply-userinfo").corpUserFlag);
	},
};
</script>

<style lang="scss">
.g-new {
	.new-obj {
		top: -16px; /* 调整位置 */
		left: -16px; /* 调整位置 */
		border-top: 16px solid #ff4d4f;
		border-bottom: 16px solid transparent;
		border-left: 16px solid #ff4d4f;
		border-right: 16px solid transparent;
		border-top-left-radius: 8px;
		.wors {
			position: absolute;
			left: -12px;
			top: -13px;
		}
	}
}
</style>
