Просмотр исходного кода

修改: 登录页不要那个一键登录协议;轮播图详情可以分享

littleblue55 1 неделя назад
Родитель
Сommit
f0cfb7aad6
2 измененных файлов с 26 добавлено и 5 удалено
  1. 3 3
      pages/initial/initial.vue
  2. 23 2
      pages/swiperDetail/swiperDetail.vue

+ 3 - 3
pages/initial/initial.vue

@@ -23,11 +23,11 @@
 					其他手机号/账号登录
 				</view>
 			</view>
-			<view class="app-user-book  mb-30">
+			<!-- <view class="app-user-book  mb-30">
 				<u-checkbox-group style="display: flex;justify-content: center;">
 					<u-checkbox v-model="userBook" name="yes" shape="circle">我已阅读&#x300A;运营商一键登录服务协议&#x300B;</u-checkbox>
 				</u-checkbox-group>
-			</view>
+			</view> -->
 		</view>
 		<u-modal v-model="userBookModal" mask-close-able class="modal" show-cancel-button
 			:title-style="{fontWeight: 'bold'}" @confirm="confirmModal">
@@ -53,7 +53,7 @@
 		me
 	} from '@/api/user.js'
 	const authStore = useAuthStore()
-	const userBook = ref(false)
+	const userBook = ref(true)
 	const userBookModal = ref(false)
 	function toLogin() {
 		uni.navigateTo({

+ 23 - 2
pages/swiperDetail/swiperDetail.vue

@@ -13,11 +13,13 @@
 		ref
 	} from 'vue'
 	import {
-		onLoad
+		onLoad, onShareAppMessage, onShareTimeline
 	} from '@dcloudio/uni-app'
 	import {
 		getSwiperDetail
 	} from '@/api/home.js'
+	const currentId = ref(null);
+	const currentTitle = ref(null);
 	const announcement = ref({
 		title: "",
 		content: "", // 假设这是后端返回的内容
@@ -37,6 +39,9 @@
 		getSwiperDetail(id).then(res => {
 			if (res?.data) {
 				announcement.value = res.data
+				uni.setNavigationBarTitle({
+					title: announcement.value.title
+				});
 			}
 		})
 	}
@@ -44,8 +49,24 @@
 		const {
 			id
 		} = option
+		currentId.value = id
 		init(id)
 	})
+	
+	onShareAppMessage(async (res) => {
+		return {
+			title: announcement.value.title,
+			path: `/pages/swiperDetail/swiperDetail?id=${currentId.value}`
+		};
+	})
+	
+	onShareTimeline(async () => {
+		// console.log(imgurl.value)&title=${currentTitle.value}
+		return {
+			title: announcement.value.title,
+			query: `id=${currentId.value}`
+		};
+	})
 </script>
 
 <style scoped>
@@ -94,7 +115,7 @@
 	.date {
 		font-size: 14px;
 		color: #999;
-		text-align: right;
+		text-align: center;
 		/* 时间右对齐 */
 		margin-top: 10px;
 		/* 与内容分离 */