Skip to content

Commit

Permalink
feat: share poster
Browse files Browse the repository at this point in the history
  • Loading branch information
jevantang committed Jun 10, 2024
1 parent af7fa79 commit bada347
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
17 changes: 17 additions & 0 deletions components/users/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
* Copyright 2021-Present 唐杰
* Licensed under the Apache-2.0 license
*/
import { fresnsClient } from '../../sdk/helpers/client';
import { fresnsConfig, fresnsLang } from '../../sdk/helpers/configs';
import { fresnsAuth } from '../../sdk/helpers/profiles';
import { callPageFunction } from '../../sdk/utilities/toolkit';

Component({
/** 组件的属性列表 **/
Expand Down Expand Up @@ -34,6 +36,9 @@ Component({

isMe: true,

share: '分享',
enableSharePoster: false,

showMoreSheet: false,
},

Expand Down Expand Up @@ -74,7 +79,10 @@ Component({
userFollowing: await fresnsLang('userFollowing'),
userFollowersYouKnow: await fresnsLang('userFollowersYouKnow'),
cancel: await fresnsLang('cancel'),
sharePoster: await fresnsLang('sharePoster'),
},
share: await fresnsLang('share'),
enableSharePoster: fresnsClient.enableSharePoster,
});
},
},
Expand All @@ -94,5 +102,14 @@ Component({
showMoreSheet: false,
});
},

// 分享菜单: 生成海报
onClickSharePoster: async function () {
const user = this.data.user;

// mixins/fresnsInteraction.js
callPageFunction('onSharePoster', 'user', user.uid);
},

},
});
3 changes: 2 additions & 1 deletion components/users/profile.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<view class="profile-btn">
<interaction user="{{user}}"/>

<view class="weui-btn weui-btn_mini weui-btn_default" wx:if="{{items.manages.length > 0}}" bind:tap="onShowMoreMenus">
<view class="weui-btn weui-btn_mini weui-btn_default" wx:if="{{items.manages.length > 0 || enableSharePoster}}" bind:tap="onShowMoreMenus">
<image class="weui-btn_cell__icon" src="{{buttonIcons.more}}" style="margin-right: -2rpx;"/>
</view>
</view>
Expand Down Expand Up @@ -69,6 +69,7 @@
<view class="weui-mask"></view>
<view class="weui-actionsheet weui-actionsheet_toggle">
<view class="weui-actionsheet__menu more-menus">
<view class="weui-actionsheet__cell" bind:tap="onClickSharePoster" wx:if="{{enableSharePoster}}">{{fresnsLang.sharePoster}}</view>
<!-- 扩展功能 -->
<navigator class="weui-actionsheet__cell" wx:for="{{items.manages}}" url="/sdk/extensions/webview" bind:tap="handleExtensionTap"
data-title="{{item.name}}"
Expand Down
4 changes: 2 additions & 2 deletions components/users/profile.wxss
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@
}

.weui-btn image {
height: 28rpx;
width: 28rpx;
height: 44rpx;
width: 44rpx;
margin-right: 0;
}

Expand Down

0 comments on commit bada347

Please sign in to comment.