hookehuyr

refactor(分享功能): 移除分享到朋友圈功能并删除测试页面

移除多个页面的enableShareTimeline配置项
删除ShareButtonTest测试页面及相关配置
/*
* @Date: 2025-06-28 10:33:00
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-09-06 22:11:14
* @LastEditTime: 2025-09-17 19:58:26
* @FilePath: /lls_program/src/app.config.js
* @Description: 文件描述
*/
......@@ -35,7 +35,6 @@ export default {
'pages/FamilyRank/index',
'pages/PosterCheckin/index',
'pages/CheckinList/index',
'pages/ShareButtonTest/index',
],
window: {
backgroundTextStyle: 'light',
......
/*
* @Date: 2025-08-28 14:50:55
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-09-04 12:07:53
* @LastEditTime: 2025-09-17 19:57:17
* @FilePath: /lls_program/src/pages/ActivitiesCover/index.config.js
* @Description: 文件描述
*/
export default {
navigationBarTitleText: '活动海报',
enableShareAppMessage: true,
enableShareTimeline: true,
// enableShareTimeline: true,
usingComponents: {
},
}
......
......@@ -8,5 +8,5 @@
export default {
navigationBarTitleText: '首页',
enableShareAppMessage: true,
enableShareTimeline: true
// enableShareTimeline: true
}
......
......@@ -8,5 +8,5 @@
export default {
navigationBarTitleText: '兑换券详情',
enableShareAppMessage: true,
enableShareTimeline: true
// enableShareTimeline: true
}
......
export default definePageConfig({
navigationBarTitleText: 'ShareButton测试',
enableShareAppMessage: true,
enableShareTimeline: true
})
\ No newline at end of file
<template>
<view class="test-page">
<view class="test-header">
<text class="test-title">ShareButton组件分享功能测试</text>
</view>
<view class="test-content">
<!-- 测试数据展示 -->
<view class="test-section">
<text class="section-title">测试数据:</text>
<view class="data-display">
<text>活动标题:{{ testActivityData.title }}</text>
<text>活动描述:{{ testActivityData.description }}</text>
<text>分享标题:{{ testShareConfig.title }}</text>
<text>分享路径:{{ testShareConfig.path }}</text>
</view>
</view>
<!-- ShareButton组件测试 -->
<view class="test-section">
<text class="section-title">ShareButton组件:</text>
<ShareButton
:activity-data="testActivityData"
:share-config="testShareConfig"
@share-activity="onShareActivity"
@share-poster="onSharePoster"
/>
</view>
<!-- 分享日志显示 -->
<view class="test-section">
<text class="section-title">分享日志:</text>
<view class="log-display">
<text v-for="(log, index) in shareLogs" :key="index" class="log-item">
{{ log }}
</text>
</view>
</view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import Taro from '@tarojs/taro'
import ShareButton from '@/components/ShareButton/index.vue'
/**
* ShareButton组件分享功能测试页面
*/
// 测试用的活动数据
const testActivityData = ref({
id: 'test-activity-001',
title: '测试活动 - 南京路商圈时尚Citywalk',
description: '这是一个用于测试ShareButton组件分享功能的测试活动',
banner: 'https://img.yzcdn.cn/vant/cat.jpeg',
dateRange: '2024年1月15日 - 2024年1月31日'
})
// 测试用的分享配置
const testShareConfig = ref({
title: '精彩活动等你参与 - 测试分享',
path: '/pages/ShareButtonTest/index',
imageUrl: 'https://img.yzcdn.cn/vant/cat.jpeg'
})
// 分享日志
const shareLogs = ref([
'页面初始化完成',
'ShareButton组件已加载'
])
/**
* 处理分享活动事件
* @param {Object} data - 分享数据
*/
const onShareActivity = (data) => {
console.log('=== 测试页面收到分享活动事件 ===')
console.log('分享数据:', data)
const logMessage = `[${new Date().toLocaleTimeString()}] 分享活动事件触发 - 标题: ${data.shareData?.title || '未知'}`
shareLogs.value.push(logMessage)
Taro.showToast({
title: '分享活动事件已触发',
icon: 'success',
duration: 2000
})
}
/**
* 处理分享海报事件
* @param {Object} data - 活动数据
*/
const onSharePoster = (data) => {
console.log('=== 测试页面收到分享海报事件 ===')
console.log('活动数据:', data)
const logMessage = `[${new Date().toLocaleTimeString()}] 分享海报事件触发 - 活动: ${data.title || '未知'}`
shareLogs.value.push(logMessage)
Taro.showToast({
title: '分享海报事件已触发',
icon: 'success',
duration: 2000
})
}
/**
* 页面分享配置(用于测试页面本身的分享)
*/
const onShareAppMessage = () => {
const logMessage = `[${new Date().toLocaleTimeString()}] 页面分享函数被调用`
shareLogs.value.push(logMessage)
return {
title: 'ShareButton组件测试页面',
path: '/pages/ShareButtonTest/index'
}
}
// 导出分享方法供Taro使用
defineExpose({
onShareAppMessage
})
</script>
<style lang="less" scoped>
.test-page {
min-height: 100vh;
background: #f5f5f5;
padding: 40rpx;
}
.test-header {
text-align: center;
margin-bottom: 60rpx;
}
.test-title {
font-size: 36rpx;
font-weight: bold;
color: #333;
}
.test-content {
display: flex;
flex-direction: column;
gap: 40rpx;
}
.test-section {
background: white;
border-radius: 16rpx;
padding: 30rpx;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
}
.section-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
margin-bottom: 20rpx;
display: block;
}
.data-display {
display: flex;
flex-direction: column;
gap: 16rpx;
}
.data-display text {
font-size: 28rpx;
color: #666;
padding: 12rpx;
background: #f8f9fa;
border-radius: 8rpx;
}
.log-display {
max-height: 400rpx;
overflow-y: auto;
background: #f8f9fa;
border-radius: 8rpx;
padding: 20rpx;
}
.log-item {
display: block;
font-size: 24rpx;
color: #666;
margin-bottom: 8rpx;
padding: 8rpx;
background: white;
border-radius: 4rpx;
border-left: 4rpx solid #007aff;
}
</style>
\ No newline at end of file
/*
* @Date: 2025-08-27 18:25:54
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-08-27 19:58:26
* @LastEditTime: 2025-09-17 19:58:30
* @FilePath: /lls_program/src/pages/Welcome/index.config.js
* @Description: 文件描述
*/
......@@ -10,5 +10,5 @@ export default {
navigationBarBackgroundColor: '#fff',
navigationBarTextStyle: 'black',
enableShareAppMessage: true,
enableShareTimeline: true
// enableShareTimeline: true
}
......