hookehuyr

✨ feat: 活动详情页新增分享选择弹框

1 +.activity-detail-page {
2 + background-color: #FFFFFF;
3 + .share-wrapper {
4 + position: relative;
5 + .share-button {
6 + position: absolute;
7 + top: 1rem;
8 + right: 0;
9 + background-color: #199A74;
10 + border-top-left-radius: 1rem;
11 + border-bottom-left-radius: 1rem;
12 + padding: 0.5rem;
13 + color: #FFFFFF;
14 + }
15 + }
16 + .title {
17 + border-bottom: 1px solid #F6F6F6;
18 + padding: 1rem;
19 + font-size: 1.15rem;
20 + }
21 +}
1 .bg-gradient { 22 .bg-gradient {
2 background: linear-gradient(#B3DDC9, #B3DDC9) no-repeat; 23 background: linear-gradient(#B3DDC9, #B3DDC9) no-repeat;
3 /*调整下划线的宽度占百分之百 高度是3px */ 24 /*调整下划线的宽度占百分之百 高度是3px */
......
1 <!-- 1 <!--
2 * @Date: 2022-09-26 14:36:57 2 * @Date: 2022-09-26 14:36:57
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-09-26 16:54:36 4 + * @LastEditTime: 2022-09-26 17:37:54
5 * @FilePath: /swx/src/pages/activityDetail/index.vue 5 * @FilePath: /swx/src/pages/activityDetail/index.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
8 <template> 8 <template>
9 - <view style="background-color: #FFFFFF;"> 9 + <view class="activity-detail-page">
10 - <view style="position: relative;"> 10 + <view class="share-wrapper">
11 <van-image 11 <van-image
12 width="100%" 12 width="100%"
13 height="15rem" 13 height="15rem"
14 fit="cover" 14 fit="cover"
15 :src="img_demo" 15 :src="img_demo"
16 /> 16 />
17 - <view style="position: absolute; top: 1rem; right: 0; background-color: #199A74; border-top-left-radius: 1rem;border-bottom-left-radius: 1rem; padding: 0.5rem; color: #FFFFFF;"> 17 + <view @tap="shareActivity" class="share-button">
18 <van-icon name="share-o" /> 18 <van-icon name="share-o" />
19 <text>分享</text> 19 <text>分享</text>
20 </view> 20 </view>
21 </view> 21 </view>
22 - <view style="border-bottom: 1px solid #F6F6F6; padding: 1rem; font-size: 1.15rem;">八段锦</view> 22 + <view class="title">八段锦</view>
23 <view class="activity-title"> 23 <view class="activity-title">
24 <view class="box"> 24 <view class="box">
25 <text class="bg-gradient" style="font-size: 1.25rem;">活动信息</text> 25 <text class="bg-gradient" style="font-size: 1.25rem;">活动信息</text>
...@@ -120,6 +120,14 @@ ...@@ -120,6 +120,14 @@
120 </view> 120 </view>
121 <view style="height: 6rem;"></view> 121 <view style="height: 6rem;"></view>
122 <activity-bar /> 122 <activity-bar />
123 +
124 + <van-action-sheet
125 + :show="show_share"
126 + :actions="actions_share"
127 + cancel-text="取消"
128 + @cancel="onCancelShare"
129 + @select="onSelectShare"
130 + />
123 </template> 131 </template>
124 132
125 <script setup> 133 <script setup>
...@@ -128,7 +136,24 @@ import img_demo1 from '@/images/demo@2x-1.png' ...@@ -128,7 +136,24 @@ import img_demo1 from '@/images/demo@2x-1.png'
128 import activityBar from '@/components/activity-bar.vue' 136 import activityBar from '@/components/activity-bar.vue'
129 137
130 import { ref } from "vue"; 138 import { ref } from "vue";
131 -const str = ref('demo') 139 +
140 +const show_share = ref(false);
141 +const actions_share = ref([{
142 + name: '分享朋友'
143 +}, {
144 + name: '生成海报'
145 +}]);
146 +const shareActivity = () => {
147 + show_share.value = true;
148 +}
149 +const onCancelShare = () => {
150 + show_share.value = false;
151 +}
152 +const onSelectShare = (event) => {
153 + // TODO: 需要完善 分享朋友和生成海报功能
154 + console.warn(event.detail);
155 + show_share.value = false;
156 +}
132 </script> 157 </script>
133 158
134 <script> 159 <script>
......