当前位置:首页 > 小程序 > 正文内容

小程序分享功能

tigon4年前 (2021-08-18)小程序2941

小程序分享功能

/**
   * 用户点击右上角分享
   */
   onShareAppMessage: function () {
    return {
      title: this.data.goodsInfo.goods_name,
      path: `/pages/goodsDetail/goodsDetail?goodsId=${this.data.goodsId}`,
      success(res) {
        // 转发成功
        wx.showToast({
          title: '分享成功',
          icon: 'none',
        })
      },
      fail(res) {
        // 转发失败
        wx.showToast({
          title: '分享失败,稍后重试',
          icon: 'none',
        })
      },
    }
  }

版权声明:本文由Web学习之路发布,如需转载请注明出处。

本文链接:https://webge.net/?id=130

“小程序分享功能” 的相关文章

小程序-- wx.switchTab({url}) 跳转页面

wx.switchTab({url}) 传页面page地址 注意,页面会刷新,那下面导航如何选中呢? 1,在app.js里定义全局变量 globalData: { selected: 0, }, 2,每个页面引入全局变量 getApp().globalData.se...

小程序自定义下拉刷新

<scroll-view style='height:100%' scroll-y='{{!isindrag}}' bindscroll='scorll'> <view class='column' bindtouc...

小程序列表展开收起功能

小程序列表展开收起功能

index.wxml <block wx:for-items="{{list}}" wx:key="{{item.id}}"> <view class="kind-list-item"> <...

小程序多层展示收起

小程序多层展示收起

<view class='list_box' wx:for='{{list}}' wx:key='this' wx:for-item='parentItem' wx:for-index='parentIndex'...

小程序页面开启下拉刷新不回弹问题

onPullDownRefresh: function () { // 停止下拉动作 wx.stopPullDownRefresh(); //添加这句就可以了 if(this.data.searchContent){ this.setSearchListDataFn(th...

小程序验证插件的使用 WxValidate

整个文件可以到git下载 import WxValidate from ‘../../utils/WxValidate’;地址自己根据目录正确引入 我的需求是所有数据都是动态后台返回的以下是使用 onload:function(){ this.initValidate()//验证规则...