Browse Source

分享修改

tanxue 1 week ago
parent
commit
ac627a6594
2 changed files with 39 additions and 2 deletions
  1. 37 1
      pages/admin/Jiazheng/index.vue
  2. 2 1
      pages/admin/haibao/haibaoInfo.vue

+ 37 - 1
pages/admin/Jiazheng/index.vue

@@ -88,7 +88,8 @@
 				@reset-search="dialogSearchReset"></search-dialog>
 				@reset-search="dialogSearchReset"></search-dialog>
 		</view>
 		</view>
 		<customTabbarAdminVue :current-tab="1"></customTabbarAdminVue>
 		<customTabbarAdminVue :current-tab="1"></customTabbarAdminVue>
-		<share-popup ref="sharePopupRef" title="简历" desc="请点击查看简历详情" :link=jianliUrl type="0" @success="onShareSuccess" />
+		<share-popup ref="sharePopupRef" :title="shareTitle" :desc="shareDesc" 
+		:link=jianliUrl type="0" :image="shareImage" @success="onShareSuccess"/>
 	</view>
 	</view>
 </template>
 </template>
 
 
@@ -162,6 +163,9 @@
 	let endDate = ref(null)
 	let endDate = ref(null)
 	let from = ref(null)
 	let from = ref(null)
 	let jzId = ref(null)
 	let jzId = ref(null)
+	let shareTitle = ref('简历')
+	let shareDesc = ref('请点击查看简历详情')
+	let shareImage = ref('')
 
 
 	function updateTimeClick() {
 	function updateTimeClick() {
 		data.sortType = 1
 		data.sortType = 1
@@ -193,7 +197,39 @@
 	function onShareSuccess(e){
 	function onShareSuccess(e){
 		 console.log('分享成功', e.scene)
 		 console.log('分享成功', e.scene)
 	}
 	}
+	function generateShareTitle(data) {
+		console.log(data,'data');
+	    // 1. 姓名 [姓名]
+	    const name = (data.realName && data.realName.trim()) || '未知';
+	    const namePart = name ? `${name}` : '';
+	
+	    // 2. 职业(取 zyNames 第一个)
+	    const jobPart = Array.isArray(data.zyNames) && data.zyNames.length > 0
+	        ? ','+data.zyNames.join(',')
+	        : '';
+	
+	    /* // 3. 籍贯(省+市,如果相同只显示省)
+	    const province = data.jiguanShengName;
+	    const city = data.jiguanShiName;
+	    const originPart = province === city ? `,${province}人` : `,${province}${city}人`; */
+	
+	    // 4. 经验
+	    // const experience = data.jingyan ? `,${data.jingyan}年经验` : '';
+	
+	    // 5. 机构名 【机构】
+		const agency= (data.jzName && data.jzName.trim()) || '';
+	    const agencyPart = agency ? `[${agency}]` : '';
+	
+	    // 拼接最终 title ${originPart}${experience}
+	    return `${namePart}${agencyPart}${jobPart}`;
+	}
+	
 	function getUUid(data){
 	function getUUid(data){
+		// 使用封装的方法生成标题
+		shareTitle.value = generateShareTitle(data);
+		shareDesc.value = data.jingli ? data.jingli : '请点击查看简历详情';
+		shareImage.value = data.icon;
+		
 		jiazhengShare({
 		jiazhengShare({
 			id: data.id
 			id: data.id
 		}).then(res => {
 		}).then(res => {

+ 2 - 1
pages/admin/haibao/haibaoInfo.vue

@@ -78,12 +78,13 @@
 		httpApi.haibaoShare({
 		httpApi.haibaoShare({
 			id: data.id
 			id: data.id
 		}).then(res => {
 		}).then(res => {
+			console.log(res,'res');
 			if (res.code == 0) {
 			if (res.code == 0) {
 				uni.share({
 				uni.share({
 					provider: "weixin",
 					provider: "weixin",
 					scene: "WXSceneTimeline",
 					scene: "WXSceneTimeline",
 					type: 2,
 					type: 2,
-					imageUrl: "https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni@2x.png",
+					imageUrl: res.data,
 					success: function(res) {
 					success: function(res) {
 						console.log("success:" + JSON.stringify(res));
 						console.log("success:" + JSON.stringify(res));
 					},
 					},