当前位置:网站首页>Applet setting button sharing function
Applet setting button sharing function
2022-06-26 17:47:00 【My hair is still there.】
General applet sharing can be done through the sharing function in the upper right corner , If you want to set the button in the page . It can be set like this :
design sketch :

WXML in :
Definition button Button to trigger the sharing event , stay button The label says open-type='share’ attribute
<button open-type='share'> Share with friends </button>WXCSS in :
Need to get rid of it. button Some styles of
button::after {
border: none;
}
button {
background-color: #fff;
}JS in :
onShareAppMessage() {
return {
title: ' The sharing title displayed when sharing pops up '
path: '/page/user?id=123' // route , Pass parameters to the specified page .
imgUrl: '', // Custom image path , It can be a local file path 、 Code package file path or network image path , the
a PNG And JPG, Don't pass in imageUrl Use the default screenshot . The aspect ratio of the display image is 5:4
}
},Share with friends
example :
// Users click on the upper right corner to share an example of a circle of friends
// onShareTimeline: function () {
// return {
// title: '',
// query: {
// key: value
// },
// imageUrl: ''
// }
// },Page({
// Custom function
// Users click on the upper right corner to share with friends , First set it up in the sharing friends menus Two parameters of , To share a circle of friends
onShareAppMessage: function() {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
},
// Share with friends
onShareTimeline () {
return {
title: this.current_viewing.name,
query: '/pages/home/view/artdetail?storeId=' + this.storeId + '&id=' +
this.current_viewing.id + '&customerId=' + this.customerId + '&genre=' +
this.current_viewing.genre,
}
}
// Life cycle function -- Monitor page loading
onLoad: function(options) {
},
})边栏推荐
- 链游系统开发技术方案设计丨NFT链游系统开发流程及源码
- QPushButton 样式使用示例(以及按钮setmenu添加下拉菜单的方法)
- 9、智慧交通项目(2)
- 在国金证券开户怎么样?开户安全吗?
- 物联网协议的王者:MQTT
- wechat_微信小程序中解决navigator进行页面跳转并传递参数问题
- How to add an application to the deviceidle whitelist?
- Detailed contract quantification system development scheme and technical description of quantitative contract system development
- #26class中get和set设置
- Cloud native 02: Alibaba cloud cloud efficient flow pipeline
猜你喜欢
![[buuctf.reverse] 126-130](/img/df/e35633d85caeff1dece62a66cb7804.png)
[buuctf.reverse] 126-130

wechat_微信小程序中解决navigator进行页面跳转并传递参数问题

Number of solutions for knapsack problem

关于FlowUs这一款国民好笔记

LeetCode——226. 翻转二叉树(BFS)

Rich professional product lines, and Jiangling Ford Lingrui · Jijing version is listed

Troubleshooting ideas that can solve 80% of faults!

sql中ROUND和TRUNCATE的区别(四舍五入还是截取小数点后几位)

SIGIR 2022 | 港大等提出超图对比学习在推荐系统中的应用
![[code Capriccio - dynamic planning] t583. Deleting two strings](/img/01/fd9ff51ea1d70188e372e925d8a1c7.png)
[code Capriccio - dynamic planning] t583. Deleting two strings
随机推荐
pycharm的plt.show()如何保持不关闭
Strength and appearance Coexist -- an exclusive interview with Liu Yu, a member of Apache pulsar PMC
Vscode usage - Remote SSH configuration description
Army chat -- registration of Registration Center
Several key points in divorce agreement
When I was in the library, I thought of the yuan sharing mode
陈强:阿里千亿级大规模数字商业知识图谱助力业务增长
Today, I met a "migrant worker" who took out 38K from Tencent, which let me see the ceiling of the foundation
Viteconfigure project path alias
Necessary decorator mode for 3 years' work
Basic requirements: 7 problems in singleton mode
无需人工先验!港大&同济&LunarAI&旷视提出基于语义分组的自监督视觉表征学习,显著提升目标检测、实例分割和语义分割任务!
Viewing the task arrangement ability of monorepo tool from turborepo
Cache breakdown! Don't even know how to write code???
类型多样的石膏PBR多通道贴图素材,速来收藏!
vutils.make_grid()与黑白图像有关的一个小体会
Jouer avec Linux et installer et configurer MySQL facilement
Redis' 43 serial cannons, try how many you can carry
ZCMU--1367: Data Structure
Here comes the hero League full skin Downloader