Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
swx_weapp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2022-10-21 10:32:48 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
19361481cf9adb2051987d5868dc4936f93301e2
19361481
1 parent
f618c248
✨ feat(活动详情): 分享朋友功能逻辑调整
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
13 deletions
project.config.json
project.tt.json
src/pages/activityDetail/index.vue
src/pages/joinSuccess/index.vue
vantComponentConf.js
project.config.json
View file @
1936148
...
...
@@ -2,7 +2,7 @@
"miniprogramRoot"
:
"./dist"
,
"projectname"
:
"swx-weapp"
,
"description"
:
"胜文轩小程序"
,
"appid"
:
"wx
a2e50e76487d1d7b
"
,
"appid"
:
"wx
bd679e213af89c38
"
,
"setting"
:
{
"urlCheck"
:
true
,
"es6"
:
false
,
...
...
@@ -10,5 +10,7 @@
"minified"
:
false
,
"checkSiteMap"
:
false
},
"compileType"
:
"miniprogram"
"compileType"
:
"miniprogram"
,
"ignoreDevUnusedFiles"
:
false
,
"ignoreUploadUnusedFiles"
:
false
}
...
...
project.tt.json
View file @
1936148
...
...
@@ -2,12 +2,14 @@
"miniprogramRoot"
:
"./"
,
"projectname"
:
"swx-weapp"
,
"description"
:
"胜文轩小程序"
,
"appid"
:
"wx
a2e50e76487d1d7b
"
,
"appid"
:
"wx
bd679e213af89c38
"
,
"setting"
:
{
"urlCheck"
:
true
,
"es6"
:
false
,
"postcss"
:
false
,
"minified"
:
false
},
"compileType"
:
"miniprogram"
"compileType"
:
"miniprogram"
,
"ignoreDevUnusedFiles"
:
false
,
"ignoreUploadUnusedFiles"
:
false
}
...
...
src/pages/activityDetail/index.vue
View file @
1936148
<!--
* @Date: 2022-09-26 14:36:57
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-2
0 16:13:03
* @LastEditTime: 2022-10-2
1 10:27:19
* @FilePath: /swx/src/pages/activityDetail/index.vue
* @Description: 活动详情页
-->
...
...
@@ -108,7 +108,7 @@
<view style="height: 6rem;"></view>
<activity-bar :user-type="userType" :reg-id="reg_id" :member-role="member_role" />
<van-action-sheet
<
!-- <
van-action-sheet
:z-index="10"
:show="show_share"
:actions="actions_share"
...
...
@@ -116,6 +116,13 @@
:overlay="true"
@cancel="onCancelShare"
@select="onSelectShare"
/> -->
<van-share-sheet
:show="show_share"
title="立即分享给好友"
:options="share_options"
@select="onSelectShare"
@close="onCancelShare"
/>
<van-overlay :show="show_post" :z-index="1">
...
...
@@ -150,11 +157,10 @@ const formatDate = (date) => {
}
const show_share = ref(false);
const actions_share = ref([{
name: '分享朋友'
}, {
name: '生成海报'
}]);
const share_options = [
{ name: '微信', icon: 'wechat', openType: 'share' },
{ name: '生成海报', icon: 'poster' },
]
const shareActivity = () => {
show_share.value = true;
}
...
...
@@ -509,6 +515,40 @@ export default {
}
return status
}
},
onShareAppMessage(options) {
// 设置菜单中的转发按钮触发转发事件时的转发内容
var shareObj = {
title: this.activity.name + "-活动报名", // 默认是小程序的名称(可以写slogan等)
path: 'pages/activityDetail/index?id=' + this.activity.id, // 默认是当前页面,必须是以‘/'开头的完整路径
imageUrl: this.activity.cover, //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
success: function (res) {
// 转发成功之后的回调
if (res.errMsg == 'shareAppMessage:ok') {
//
}
},
fail: function () {
// 转发失败之后的回调
if (res.errMsg == 'shareAppMessage:fail cancel') {
// 用户取消转发
} else if (res.errMsg == 'shareAppMessage:fail') {
// 转发失败,其中 detail message 为详细失败信息
}
},
complete: function () {
// 转发结束之后的回调(转发成不成功都会执行)
}
}
// 来自页面内的按钮的转发
// if (options.from == 'button') {
// var eData = options.target.dataset;
// console.warn(eData); // shareBtn
// // 此处可以修改 shareObj 中的内容
// // shareObj.path = '/pages/goods/goods?goodId=' + eData.id;
// }
// 返回shareObj
return shareObj;
}
};
</script>
...
...
src/pages/joinSuccess/index.vue
View file @
1936148
...
...
@@ -50,7 +50,6 @@ export default {
cover: ''
}
},
// TODO:分享内容待设置
onShareAppMessage(options) {
// 设置菜单中的转发按钮触发转发事件时的转发内容
var shareObj = {
...
...
vantComponentConf.js
View file @
1936148
/*
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-
09-28 23:23:22
* @LastEditTime: 2022-
10-21 10:05:55
* @FilePath: /swx/vantComponentConf.js
* @Description: 文件描述
*/
...
...
@@ -29,6 +29,7 @@ const vantComponentNames = [
"stepper"
,
"dialog"
,
"action-sheet"
,
"share-sheet"
,
"checkbox"
,
"transition"
,
"uploader"
,
...
...
Please
register
or
login
to post a comment