浏览代码

Merge branch 'master' of https://git.citupro.com/zhengnaiwen_citu/menduner-uniapp

lifanagju_citu 3 月之前
父节点
当前提交
878f7bf2cd

+ 1 - 1
components/PositionList/index.vue

@@ -27,7 +27,7 @@
           </view>
           <!-- 薪酬、工作地、学历、工作经验 -->
           <view class="d-flex align-center justify-space-between">
-            <view class="font-size-13 ellipsis" style="max-width: 56%;">
+            <view class="font-size-13 ellipsis" :style="{'max-width': !item.job?.payFrom && !item.job?.payTo ? '78%' : '56%'}">
               <span class="tag-gap" style="color: #808080;">
                 <span>{{item.job?.area?.str ?? '全国' }}</span>
                 <span class="divider-mx" v-if="item.job?.eduName">|</span>

+ 44 - 5
pagesA/seenMe/index.vue

@@ -1,6 +1,6 @@
 <template>
-  <view class="defaultBgc ss-p-x-20" style="height: 100vh;">
-    <scroll-view class="scrollBox" scroll-y="true" @scrolltolower="loadingMore">
+  <view class="defaultBgc ss-p-x-20" style="height: 100vh; position: relative;">
+    <scroll-view v-if="showList" class="scrollBox" scroll-y="true" @scrolltolower="loadingMore">
       <view v-if="list.length > 0">
         <view v-for="(item, index) in list" :key="index" class="ss-m-t-20" @click="jumpToEnterpriseDetail(item.enterprise.id)">
           <view class="sub-li-bottom">
@@ -49,22 +49,36 @@
         <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
       </view>
     </scroll-view>
+	<view v-else class="noviewlist">
+		<view v-if="userInfo?.vipExpireDate > Date.now() && !userInfo?.entitlement?.viewersList">
+			当前会员套餐的权益不包含谁关注我,<span class="text-line" @tap.stop="handleToBuyVip">点击去升级</span>
+		</view>
+		<view v-if="!userInfo?.vipExpireDate || (userInfo?.vipExpireDate && userInfo?.vipExpireDate < Date.now())">
+			谁关注我为会员权益内容,<span class="text-line" @tap.stop="handleToBuyVip">点击去开通</span>
+		</view>
+	</view>
   </view>
 </template>
 
 <script setup>
-import { ref } from 'vue'
+import { ref, computed } from 'vue'
 import { getInterestedMePage } from '@/api/user'
 import { dealDictObjData, jumpToEnterpriseDetail } from '@/utils/position'
 import { getUserAvatar } from '@/utils/avatar'
 import { timesTampChange } from '@/utils/date'
 import { formatName } from '@/utils/getText'
+import { userStore } from '@/store/user'
+import { onShow } from '@dcloudio/uni-app'
 
 const status = ref('more')
 const queryParams = ref({
   pageNo: 1,
   pageSize: 10
 })
+const useUserStore = userStore()
+const userInfo = computed(() => useUserStore?.userInfo)
+// 当前会员套餐是否可查看此模块
+const showList = computed(() => (new Date().getTime() < useUserStore?.userInfo?.vipExpireDate) && useUserStore?.userInfo?.entitlement?.viewersList)
 
 const list = ref([])
 const getList = async () => {
@@ -79,14 +93,24 @@ const getList = async () => {
   status.value = list.value?.length === +res.data.total ? 'noMore' : 'more'
 }
 
-getList()
+onShow(() => {
+	// 有会员权益能查看才请求接口
+	if (showList.value) getList()
+})
 
-// 加载跟多
+// 加载
 const loadingMore = () => { 
   status.value = 'loading'
   queryParams.value.pageNo++
   getList()
 }
+
+// 跳转会员套餐
+const handleToBuyVip = () => {
+	uni.navigateTo({
+		url: '/pagesA/vipPackage/index'
+	})
+}
 </script>
 
 <style scoped lang="scss">
@@ -109,4 +133,19 @@ const loadingMore = () => {
   width: 70vw;
   max-width: 70vw;
 }
+.noviewlist {
+	position: absolute;
+	top: 50%;
+	left: 50%;
+	width: 98%;
+	text-align: center;
+	transform: translate(-50%, -50%);
+	color: #666;
+}
+.text-line {
+	color: #00897b;
+	font-weight: bold;
+	padding-bottom: 2px;
+	border-bottom: 1px solid #00897b;
+}
 </style>

+ 9 - 7
pagesB/positionDetail/index.vue

@@ -11,8 +11,8 @@
             <span v-else class="salary w-600">{{ info.payFrom }}-{{ info.payTo }}/{{ positionInfo.payName }}</span>
           </view>
           <!-- 职位地区 收藏职位 -->
-          <view class="d-flex justify-space-between mt-5 align-baseline">
-            <view style="font-size: 14px;">
+          <view class="d-flex justify-space-between mt-5 align-center">
+            <view style="font-size: 14px; flex: 1; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; margin-right: 30px;">
               <span>
                 <span>{{positionInfo?.area?.str ?? '全国' }}</span>
                 <span class="viewider-mx" v-if="positionInfo?.eduName">|</span>
@@ -22,7 +22,7 @@
               </span>
             </view>
             <!-- 收藏职位 -->
-            <view @click="handleCollection">
+            <view @click="handleCollection" style="width: 36px;">
               <uni-icons
                 :type="isCollection ? 'heart-filled' : 'heart'"
                 color="#fc6d5e"
@@ -304,9 +304,11 @@ const getImageTempRatio = (url) => {
   maxLine:最多绘制的行数
 **/
 //处理文字多出省略号显示
+const enterpriseNameLines = ref(0)
 const dealWords = (ctx, fontSize, text, maxWidth, x, y, maxLine, isEnterpriseName) => {
   ctx.setFontSize(fontSize);//设置字体大小
   var allRow = Math.ceil(ctx.measureText(text).width / maxWidth);//实际总共能分多少行
+  enterpriseNameLines.value = allRow
   var count = allRow >= maxLine ? maxLine : allRow;//实际能分多少行与设置的最大显示行数比,谁小就用谁做循环次数
   var endPos = 0;//当前字符串的截断点
   for (var j = 0; j < count; j++) {
@@ -327,7 +329,7 @@ const dealWords = (ctx, fontSize, text, maxWidth, x, y, maxLine, isEnterpriseNam
       }
     } else {
       //如果当前的字符串宽度小于最大宽度就直接输出
-      ctx.fillText(nowStr.slice(0), x, (isEnterpriseName ? y + 20 : y) + (j + 1) * 30);
+      ctx.fillText(nowStr.slice(0), x, (isEnterpriseName ? y + 2 : y) + (j + 1) * 30);
     }
   }
 }
@@ -348,10 +350,9 @@ const createPoster = async () => {
 
   // 工作地区、工作经验、学历要求
   context.setFillStyle('#6c6e7b')
-  context.setFontSize(20)
   const area = areaName.value + ' | '
   const combinationText = area + (positionInfo.value.expName || '') + (positionInfo.value.eduName ? ' | ' + positionInfo.value.eduName : '')
-  context.fillText(combinationText, 40, 130)
+  dealWords(context, 20, combinationText, 350, 40, 100, 1) // 上下文、字号、文本、最大宽度、x、y、行数
 
   // 薪资
   context.setFontSize(22)
@@ -380,7 +381,8 @@ const createPoster = async () => {
   // 企业行业类型、规模
   context.setFontSize(20)
   let industry = industryName && industryName.length > 6 ? `${industryName.slice(0, 7)}...` : industryName
-  context.fillText(`${industry || ''}${scaleName ? ' | ' + scaleName : ''}`, 150, 310)
+  context.setFillStyle('#6c6e7b')
+  context.fillText(`${industry || ''}${scaleName ? ' | ' + scaleName : ''}`, 150, enterpriseNameLines.value === 1 ? 280 : 310)
 
   context.draw(false, () =>{
     wx.canvasToTempFilePath({ 

+ 12 - 6
pagesB/preferredGroup/index.vue

@@ -29,8 +29,8 @@
 				:interval="3000"
 				:duration="500"
 				indicator-active-color="#fff"
-				style="height: 240px;"
-				class="ss-m-t-30"
+				:style="{'height': preferred?.introduce?.thumbnail.length > 1 ? '240px' : '160px'}"
+				class="ss-m-t-50"
 			>
 				<swiper-item v-for="(item, index) in preferred.introduce?.thumbnail" :key="index">
 					<image :src="item" style="width: 100%; height: 100%" :lazy-load="true" :fade-show="true"></image>
@@ -75,7 +75,7 @@
 
 <script setup>
 import { ref } from 'vue'
-import { onLoad, onShareAppMessage } from '@dcloudio/uni-app'
+import { onLoad, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
 import { getJobAdvertisedSearch } from '@/api/position'
 import { dealDictObjData } from '@/utils/position'
 import { getWebContent } from '@/api/common'
@@ -103,15 +103,21 @@ onLoad(async (options) => {
 })
 
 onShareAppMessage(() => {
-  if(!title.value){
-		setTimeout(() => {},1000)
-	}
+  if(!title.value) setTimeout(() => {},1000)
   return {
     title: title.value || '门墩儿 专注顶尖招聘',
     path: '/pagesB/preferredGroup/index?id=' + enterpriseId.value
   }
 })
 
+onShareTimeline(() =>{
+	if (!title.value) setTimeout(() => {}, 1000)
+	return {
+	  title: title.value || '门墩儿 专注顶尖招聘',
+	  path: '/pagesB/preferredGroup/index?id=' + enterpriseId.value
+	}
+})
+
 const current = ref(0)
 const swiperDotIndex = ref(0)
 const change = (e) => {

+ 2 - 3
pagesB/recommendEnterprise/index.vue

@@ -29,7 +29,7 @@
           <view>
             <view class="list-shape" v-for="(k, i) in val.jobList" :key="k.id" @click="handleToPosition(k)" :style="{'padding-bottom': i !== val.jobList.length - 1 ? '10px' : ''}">
               <view class="titleBox my-5">
-                <view class="job-name">{{ formatName(k.name) }}</view>
+                <view class="job-name" :style="{'max-width': !k.payFrom && !k.payTo ? '65vw' : '50vw'}">{{ formatName(k.name) }}</view>
                 <span v-if="!k.payFrom && !k.payTo" class="salary-text">面议</span>
                 <span v-else class="salary-text">{{ k.payFrom }}-{{ k.payTo }}{{ k.payName ? '/' + k.payName : '' }}</span>
               </view>
@@ -131,10 +131,9 @@ const handleToPosition = (k) => {
   font-weight: 700;
 }
 .job-name {
-  font-size: 16px;
+  font-size: 30rpx;
   font-weight: 700;
   color: #345768;
-  max-width: 50vw;
   overflow: hidden;
   white-space: nowrap;
   text-overflow: ellipsis;

+ 2 - 2
utils/position.js

@@ -58,7 +58,7 @@ export const dealDictArrayData = (res, list) => {
       const valueKey = data.nameKey ? data.nameKey : 'label'
       const idKey = data.valueKey ? data.valueKey : 'value'
       if (!dictObj[data.value] || !Object.keys(dictObj[data.value]).length) return
-      const result = dictObj[data.value].find(val => val[idKey] === item[e])
+      const result = ['expType', 'eduType'].includes(e) && !item[e] ? { label: `${e === 'expType' ? '工作经验' : '学历'}不限` } : dictObj[data.value].find(val => val[idKey] === item[e])
       if (!result) return
       item[data.label] = result[valueKey] || ''
     })
@@ -79,7 +79,7 @@ export const dealDictObjData = (res, obj) => {
     }
     const valueKey = data.nameKey ? data.nameKey : 'label'
     const idKey = data.valueKey ? data.valueKey : 'value'
-    const result = dictObj[data.value]?.find(val => val[idKey] === obj[e])
+    const result = ['expType', 'eduType'].includes(e) && !obj[e] ? { label: `${e === 'expType' ? '工作经验' : '学历'}不限` } : dictObj[data.value]?.find(val => val[idKey] === obj[e])
     if (!result) return
     res[data.label] = result[valueKey]
     res = { ...obj, ...res }