| <template> | |
| 	<view class="page"> | |
| 
 | |
| 		<image :src="configList.img_4" class="page-bg" mode="aspectFill"></image> | |
| 
 | |
| 
 | |
| 		<image :src="configList.img_6" class="logo" mode="widthFix"></image> | |
| 
 | |
| 		<image :src="configList.img_9" class="page-bg" mode="widthFix"></image> | |
| 
 | |
| 		<view class="info"> | |
| 			<view class="title"> | |
| 				{{ userInfo.nickName }} | |
| 			</view> | |
| 			<view class="list"> | |
| 				欢迎来到百富门的世界 | |
| 				<br /> | |
| 				品味传承与创新交织的威士忌 | |
| 				<br /> | |
| 				艺术开启您的专属品鉴之旅 | |
| 			</view> | |
| 		</view> | |
| 
 | |
| 		<image :src="configList.img_8" class="logo" mode="widthFix"></image> | |
| 
 | |
| 		<view class="position"> | |
| 			<view class="btn" @click="next"> | |
| 				点击进入 | |
| 			</view> | |
| 			<text class="second-color">{{ configList.bg_title }}</text> | |
| 		</view> | |
| 
 | |
| 	</view> | |
| </template> | |
| 
 | |
| <script> | |
| 	import { | |
| 		mapState | |
| 	} from 'vuex' | |
| 	export default { | |
| 		data() { | |
| 			return {} | |
| 		}, | |
| 		computed: {}, | |
| 		onShow() { | |
| 			if (uni.getStorageSync('token')) { | |
| 				this.$store.commit('getUserInfo') | |
| 			} | |
| 		}, | |
| 		methods: { | |
| 			next() { | |
| 				// wx.requestSubscribeMessage({ | |
| 				// 	tmplIds: ['TEMPLATE_ID'], // 替换为你的模板ID | |
| 				// 	success(res) { | |
| 				// 		if (res['TEMPLATE_ID'] === 'accept') { | |
| 				// 			console.log('用户已同意订阅'); | |
| 				// 			// 执行后续逻辑,例如发送消息 | |
| 				// 		} else if (res['TEMPLATE_ID'] === 'reject') { | |
| 				// 			console.log('用户拒绝订阅'); | |
| 				// 			// 引导用户到设置页面开启权限 | |
| 				// 			wx.showModal({ | |
| 				// 				title: '提示', | |
| 				// 				content: '您已拒绝订阅消息,请到设置中开启权限。', | |
| 				// 				success(modalRes) { | |
| 				// 					if (modalRes.confirm) { | |
| 				// 						wx.openSetting(); | |
| 				// 					} | |
| 				// 				}, | |
| 				// 			}); | |
| 				// 		} | |
| 				// 	}, | |
| 				// }); | |
| 				uni.requestSubscribeMessage({ | |
| 					//此处填写刚才申请模板的模板ID | |
| 					tmplIds: [ | |
| 						'ZREm8r0Bgv-W0W48DHw83nUMYYOdaslI99MTlqgR0ZI', | |
| 						'0GqFy6mBu1bmoHsSugtKoQ64aFs1oQXy6sZOE1FlDcw' | |
| 					], | |
| 					success(res) { | |
| 						console.log(res) | |
| 						 | |
| 						if ( | |
| 						res['ZREm8r0Bgv-W0W48DHw83nUMYYOdaslI99MTlqgR0ZI'] === 'accept' &&  | |
| 						res['0GqFy6mBu1bmoHsSugtKoQ64aFs1oQXy6sZOE1FlDcw'] === 'accept' | |
| 						) { | |
| 							uni.navigateTo({ | |
| 								url: '/pages/index/introduce' | |
| 							}) | |
| 						}else{ | |
| 							wx.showModal({ | |
| 								title: '提示', | |
| 								content: '您已拒绝订阅消息,请到设置中开启权限。', | |
| 								success(modalRes) { | |
| 									if (modalRes.confirm) { | |
| 										wx.openSetting(); | |
| 									} | |
| 								}, | |
| 							}); | |
| 						} | |
| 						 | |
| 					}, | |
| 					fail(err) { | |
| 						if (err.errCode === 20004) { | |
| 							console.log('用户关闭了主开关'); | |
| 							wx.showModal({ | |
| 								title: '提示', | |
| 								content: '检测到您未开启订阅权限,请前往设置开启。', | |
| 								success(modalRes) { | |
| 									if (modalRes.confirm) { | |
| 										wx.openSetting(); | |
| 									} | |
| 								}, | |
| 							}); | |
| 						} else { | |
| 							console.error('订阅失败:', err); | |
| 						} | |
| 					}, | |
| 				}) | |
| 			}, | |
| 		} | |
| 	} | |
| </script> | |
| 
 | |
| <style lang="scss" scoped> | |
| 	.page { | |
| 		width: 100%; | |
| 
 | |
| 		.logo { | |
| 			width: 600rpx; | |
| 			margin: 50rpx 75rpx; | |
| 		} | |
| 
 | |
| 		.info { | |
| 			text-align: center; | |
| 
 | |
| 			.title { | |
| 				font-size: 40rpx; | |
| 				font-weight: bold; | |
| 				margin: 40rpx 0 20rpx 0; | |
| 			} | |
| 
 | |
| 			.list { | |
| 				line-height: 50rpx; | |
| 			} | |
| 		} | |
| 
 | |
| 		.position { | |
| 			position: absolute; | |
| 			bottom: 130rpx; | |
| 			left: 75rpx; | |
| 			display: flex; | |
| 			flex-direction: column; | |
| 			align-items: center; | |
| 
 | |
| 			.btn { | |
| 				border-radius: 40rpx; | |
| 				padding: 30rpx 0; | |
| 				background: $uni-color-primary; | |
| 				color: #fff; | |
| 				text-align: center; | |
| 				font-size: 28rpx; | |
| 				width: 600rpx; | |
| 			} | |
| 		} | |
| 
 | |
| 		.second-color { | |
| 			color: $uni-color-primary; | |
| 			margin-top: 20rpx; | |
| 			font-size: 26rpx; | |
| 		} | |
| 	} | |
| </style> |