瀏覽代碼

公众号链接分享

Xiao_123 6 月之前
父節點
當前提交
b66ae27304
共有 4 個文件被更改,包括 41 次插入24 次删除
  1. 19 19
      App.vue
  2. 19 1
      pages/addWebView/index.vue
  3. 1 2
      pages/index/crowdsourcing.vue
  4. 2 2
      pages/index/position.vue

+ 19 - 19
App.vue

@@ -1,25 +1,25 @@
 <script>
-import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
+// import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
 	export default {
 		onLaunch: function() {
-			wx.showShareMenu({
-				withShareTicket: true,
-				menus: ['shareAppMessage', 'shareTimeline']
-			})
-			onShareAppMessage(() => {
-				return {
-					title: '门墩儿 专注顶尖招聘',
-					path: '/pages/index/position',
-					imageUrl: 'https://minio.menduner.com/dev/menduner/miniProgram/share-poster.jpg'
-				}
-			})
-			onShareTimeline(() => {
-				return {
-					title: '门墩儿 专注顶尖招聘',
-					path: '/pages/index/position',
-					imageUrl: 'https://minio.menduner.com/dev/menduner/miniProgram/share-poster.jpg'
-				}
-			})
+			// wx.showShareMenu({
+			// 	withShareTicket: true,
+			// 	menus: ['shareAppMessage', 'shareTimeline']
+			// })
+			// onShareAppMessage(() => {
+			// 	return {
+			// 		title: '门墩儿 专注顶尖招聘',
+			// 		path: '/pages/index/position',
+			// 		imageUrl: 'https://minio.menduner.com/dev/menduner/miniProgram/share-poster.jpg'
+			// 	}
+			// })
+			// onShareTimeline(() => {
+			// 	return {
+			// 		title: '门墩儿 专注顶尖招聘',
+			// 		path: '/pages/index/position',
+			// 		imageUrl: 'https://minio.menduner.com/dev/menduner/miniProgram/share-poster.jpg'
+			// 	}
+			// })
 			console.log('App Launch')
 			uni.setStorageSync('firstOpen', true)
 

+ 19 - 1
pages/addWebView/index.vue

@@ -4,12 +4,30 @@
  
 <script setup>
 import { ref } from 'vue'
-import { onLoad } from '@dcloudio/uni-app'
+import { onLoad, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
 
 const url = ref('')
 
 onLoad((options) => {
   // 传入需要跳转的链接 使用web-view标签进行跳转
   url.value = decodeURIComponent(options.url)
+
+  wx.showShareMenu({
+    withShareTicket: true,
+    menus: ['shareAppMessage', 'shareTimeline']
+  })
+  onShareAppMessage(() => {
+    return {
+      title: options?.title || '门墩儿 专注顶尖招聘',
+      path: '/pages/addWebView/index?url=' + url.value
+    }
+  })
+  onShareTimeline(() => {
+    return {
+      title: options?.title || '门墩儿 专注顶尖招聘',
+      path: '/pages/addWebView/index?url=' + url.value
+    }
+  })
 })
+
 </script>

+ 1 - 2
pages/index/crowdsourcing.vue

@@ -77,12 +77,11 @@ const more = ref('more')
 
 // 跳转企业详情
 const handleToDetails = ({ id, weiXinPublicUrl }) => {
-	debugger
 	if (id) {
 		uni.navigateTo({ url: `/pagesB/companyDetail/index?id=${id}` })
 	}
 	if (weiXinPublicUrl) {
-		uni.navigateTo({ url: `/pages/addWebView/index?url=${weiXinPublicUrl}` })
+		uni.navigateTo({ url: `/pages/addWebView/index?url=${weiXinPublicUrl}&title=风尚年度榜奖项报名` })
 	}
 }
 

+ 2 - 2
pages/index/position.vue

@@ -125,7 +125,7 @@ const handleToDetails = ({ id, weiXinPublicUrl }) => {
 		uni.navigateTo({ url: `/pagesB/companyDetail/index?id=${id}` })
 	}
 	if (weiXinPublicUrl) {
-		uni.navigateTo({ url: `/pages/addWebView/index?url=${weiXinPublicUrl}` })
+		uni.navigateTo({ url: `/pages/addWebView/index?url=${weiXinPublicUrl}&title=风尚年度榜奖项报名` })
 	}
 }
 
@@ -144,7 +144,7 @@ const handleGrid = async (e) => {
       const { data } = await getMorningNewsArticle()
       if (data && Object.keys(data).length && data.url) {
         uni.navigateTo({
-          url: `/pages/addWebView/index?url=${data.url}`
+          url: `/pages/addWebView/index?url=${data.url}&title=门墩儿早报`
         })
       } else uni.showToast({ icon: 'none', title: '暂无早报资讯内容' })
     } catch (err) {