diff --git a/pages/article/detail/index.js b/pages/article/detail/index.js index 84ee633..657c4ea 100644 --- a/pages/article/detail/index.js +++ b/pages/article/detail/index.js @@ -30,7 +30,7 @@ Page({ let _this = this; App._get('article/detail', { article_id - }, function(result) { + }, function (result) { let detail = result.data.detail; // 富文本转码 if (detail.article_content.length > 0) { @@ -47,7 +47,7 @@ Page({ */ onShareAppMessage() { // 构建页面参数 - let params = App.getShareUrlParams({ + const params = App.getShareUrlParams({ 'article_id': this.data.detail.article_id }); return { @@ -56,4 +56,20 @@ Page({ }; }, + /** + * 分享到朋友圈 + * 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta) + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html + */ + onShareTimeline() { + // 构建页面参数 + const params = App.getShareUrlParams({ + 'article_id': this.data.detail.article_id + }); + return { + // title: this.data.detail.article_title, + path: "/pages/article/detail/index?" + params + }; + } + }) \ No newline at end of file diff --git a/pages/article/index.js b/pages/article/index.js index 5cb5cdc..5f3f521 100644 --- a/pages/article/index.js +++ b/pages/article/index.js @@ -96,16 +96,6 @@ Page({ }); }, - /** - * 分享当前页面 - */ - onShareAppMessage() { - return { - title: '文章首页', - path: "/pages/article/index?" + App.getShareUrlParams() - }; - }, - /** * 下拉到底加载数据 */ @@ -136,4 +126,27 @@ Page({ scrollHeight }); }, + + /** + * 分享当前页面 + */ + onShareAppMessage() { + return { + title: '文章首页', + path: "/pages/article/index?" + App.getShareUrlParams() + }; + }, + + /** + * 分享到朋友圈 + * 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta) + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html + */ + onShareTimeline() { + return { + title: '文章首页', + path: "/pages/article/index?" + App.getShareUrlParams() + }; + }, + }) \ No newline at end of file diff --git a/pages/bargain/goods/index.js b/pages/bargain/goods/index.js index 0f7193c..87e7c1a 100644 --- a/pages/bargain/goods/index.js +++ b/pages/bargain/goods/index.js @@ -510,12 +510,29 @@ Page({ }, /** - * 用户点击右上角分享 + * 分享当前页面 */ onShareAppMessage() { - let _this = this; + const _this = this; // 构建页面参数 - let params = App.getShareUrlParams({ + const params = App.getShareUrlParams({ + active_id: _this.data.active.active_id + }); + return { + title: _this.data.detail.goods_name, + path: `/pages/bargain/goods/index?${params}` + }; + }, + + /** + * 分享到朋友圈 + * 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta) + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html + */ + onShareTimeline() { + const _this = this; + // 构建页面参数 + const params = App.getShareUrlParams({ active_id: _this.data.active.active_id }); return { diff --git a/pages/bargain/index/index.js b/pages/bargain/index/index.js index ec3a829..f6ccfff 100644 --- a/pages/bargain/index/index.js +++ b/pages/bargain/index/index.js @@ -235,12 +235,27 @@ Page({ }, /** - * 用户点击右上角分享 + * 分享当前页面 */ onShareAppMessage() { - let _this = this; + const _this = this; // 构建页面参数 - let params = App.getShareUrlParams(); + const params = App.getShareUrlParams(); + return { + title: '砍价专区', + path: `/pages/bargain/index/index?${params}` + }; + }, + + /** + * 分享到朋友圈 + * 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta) + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html + */ + onShareTimeline() { + const _this = this; + // 构建页面参数 + const params = App.getShareUrlParams(); return { title: '砍价专区', path: `/pages/bargain/index/index?${params}` diff --git a/pages/bargain/task/index.js b/pages/bargain/task/index.js index c0cc8e6..7b91650 100644 --- a/pages/bargain/task/index.js +++ b/pages/bargain/task/index.js @@ -216,12 +216,29 @@ Page({ }, /** - * 用户点击右上角分享 + * 分享当前页面 */ onShareAppMessage() { - let _this = this; + const _this = this; // 构建页面参数 - let params = App.getShareUrlParams({ + const params = App.getShareUrlParams({ + task_id: _this.data.task_id + }); + return { + title: _this.data.active.share_title, + path: `/pages/bargain/task/index?${params}` + }; + }, + + /** + * 分享到朋友圈 + * 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta) + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html + */ + onShareTimeline() { + const _this = this; + // 构建页面参数 + const params = App.getShareUrlParams({ task_id: _this.data.task_id }); return { diff --git a/pages/category/index.js b/pages/category/index.js index cb428c1..dbee921 100644 --- a/pages/category/index.js +++ b/pages/category/index.js @@ -78,11 +78,24 @@ Page({ * 设置分享内容 */ onShareAppMessage() { - let _this = this; + const _this = this; return { title: _this.data.templet.share_title, path: '/pages/category/index?' + App.getShareUrlParams() }; - } + }, + + /** + * 分享到朋友圈 + * 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta) + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html + */ + onShareTimeline() { + const _this = this; + return { + title: _this.data.templet.share_title, + path: '/pages/category/index?' + App.getShareUrlParams() + }; + }, }); \ No newline at end of file diff --git a/pages/category/list.js b/pages/category/list.js index 1114977..a650987 100644 --- a/pages/category/list.js +++ b/pages/category/list.js @@ -137,17 +137,6 @@ Page({ this.getGoodsList(true, ++this.data.page); }, - /** - * 设置分享内容 - */ - onShareAppMessage() { - // 构建分享参数 - return { - title: "全部分类", - path: "/pages/category/index?" + App.getShareUrlParams() - }; - }, - /** * 商品搜索 */ @@ -165,4 +154,28 @@ Page({ }) }, + /** + * 设置分享内容 + */ + onShareAppMessage() { + // 构建分享参数 + return { + title: "全部分类", + path: "/pages/category/index?" + App.getShareUrlParams() + }; + }, + + /** + * 分享到朋友圈 + * 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta) + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html + */ + onShareTimeline() { + // 构建分享参数 + return { + title: "全部分类", + path: "/pages/category/index?" + App.getShareUrlParams() + }; + }, + }); \ No newline at end of file diff --git a/pages/custom/index.js b/pages/custom/index.js index c16da7e..1fbd29a 100644 --- a/pages/custom/index.js +++ b/pages/custom/index.js @@ -52,13 +52,23 @@ Page({ }) }, + /** + * 下拉刷新 + */ + onPullDownRefresh: function() { + // 获取首页数据 + this.getPageData(function() { + wx.stopPullDownRefresh(); + }); + }, + /** * 分享当前页面 */ onShareAppMessage: function() { - let _this = this; + const _this = this; // 构建页面参数 - let params = App.getShareUrlParams({ + const params = App.getShareUrlParams({ 'page_id': _this.data.page_id }); return { @@ -68,13 +78,20 @@ Page({ }, /** - * 下拉刷新 + * 分享到朋友圈 + * 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta) + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html */ - onPullDownRefresh: function() { - // 获取首页数据 - this.getPageData(function() { - wx.stopPullDownRefresh(); + onShareTimeline: function() { + const _this = this; + // 构建页面参数 + const params = App.getShareUrlParams({ + 'page_id': _this.data.page_id }); - } + return { + title: _this.data.page.params.share_title, + path: "/pages/custom/index?" + params + }; + }, }); \ No newline at end of file diff --git a/pages/goods/index.js b/pages/goods/index.js index fdf6c94..916be6c 100644 --- a/pages/goods/index.js +++ b/pages/goods/index.js @@ -346,21 +346,6 @@ Page({ }) }, - /** - * 分享当前页面 - */ - onShareAppMessage() { - let _this = this; - // 构建页面参数 - let params = App.getShareUrlParams({ - 'goods_id': _this.data.goods_id - }); - return { - title: _this.data.detail.goods_name, - path: "/pages/goods/index?" + params - }; - }, - /** * 显示分享选项 */ @@ -487,4 +472,36 @@ Page({ }); }, + /** + * 分享当前页面 + */ + onShareAppMessage() { + const _this = this; + // 构建页面参数 + const params = App.getShareUrlParams({ + 'goods_id': _this.data.goods_id + }); + return { + title: _this.data.detail.goods_name, + path: "/pages/goods/index?" + params + }; + }, + + /** + * 分享到朋友圈 + * 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta) + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html + */ + onShareTimeline() { + const _this = this; + // 构建页面参数 + const params = App.getShareUrlParams({ + 'goods_id': _this.data.goods_id + }); + return { + title: _this.data.detail.goods_name, + path: "/pages/goods/index?" + params + }; + }, + }) \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index fd0d702..6d85568 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -13,7 +13,7 @@ Page({ /** * 生命周期函数--监听页面加载 */ - onLoad: function(options) { + onLoad(options) { // 当前页面参数 this.setData({ options @@ -25,11 +25,11 @@ Page({ /** * 加载页面数据 */ - getPageData: function(callback) { + getPageData(callback) { let _this = this; App._get('page/index', { page_id: _this.data.options.page_id || 0 - }, function(result) { + }, result => { // 设置顶部导航栏栏 _this.setPageBar(result.data.page); _this.setData(result.data); @@ -41,7 +41,7 @@ Page({ /** * 设置顶部导航栏 */ - setPageBar: function(page) { + setPageBar(page) { // 设置页面标题 wx.setNavigationBarTitle({ title: page.params.title @@ -53,11 +53,21 @@ Page({ }) }, + /** + * 下拉刷新 + */ + onPullDownRefresh() { + // 获取首页数据 + this.getPageData(function () { + wx.stopPullDownRefresh(); + }); + }, + /** * 分享当前页面 */ onShareAppMessage() { - let _this = this; + const _this = this; return { title: _this.data.page.params.share_title, path: "/pages/index/index?" + App.getShareUrlParams() @@ -65,32 +75,16 @@ Page({ }, /** - * 下拉刷新 + * 分享到朋友圈 + * 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta) + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html */ - onPullDownRefresh: function() { - // 获取首页数据 - this.getPageData(function() { - wx.stopPullDownRefresh(); - }); + onShareTimeline() { + const _this = this; + return { + title: _this.data.page.params.share_title, + path: "/pages/index/index?" + App.getShareUrlParams() + }; } - // /** - // * 返回顶部 - // */ - // goTop: function(t) { - // this.setData({ - // scrollTop: 0 - // }); - // }, - - // scroll: function(t) { - // this.setData({ - // indexSearch: t.detail.scrollTop - // }), t.detail.scrollTop > 300 ? this.setData({ - // floorstatus: !0 - // }) : this.setData({ - // floorstatus: !1 - // }); - // }, - }); \ No newline at end of file diff --git a/pages/live/index.js b/pages/live/index.js index fad1426..8aacada 100644 --- a/pages/live/index.js +++ b/pages/live/index.js @@ -206,7 +206,7 @@ Page({ }, /** - * 用户点击右上角分享 + * 分享当前页面 */ onShareAppMessage() { return { @@ -215,4 +215,16 @@ Page({ }; }, + /** + * 分享到朋友圈 + * 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta) + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html + */ + onShareTimeline() { + return { + title: '直播列表', + path: "/pages/live/index?" + App.getShareUrlParams() + }; + }, + }) \ No newline at end of file diff --git a/pages/sharing/active/index.js b/pages/sharing/active/index.js index c0ca5f4..918aac6 100644 --- a/pages/sharing/active/index.js +++ b/pages/sharing/active/index.js @@ -400,21 +400,6 @@ Page({ }) }, - /** - * 分享当前页面 - */ - onShareAppMessage() { - let _this = this; - // 构建页面参数 - let params = App.getShareUrlParams({ - 'active_id': _this.data.detail.active_id - }); - return { - title: _this.data.goods.goods_name, - path: "/pages/sharing/active/index?" + params - }; - }, - /** * 确认购买弹窗 */ @@ -441,4 +426,36 @@ Page({ }) }, + /** + * 分享当前页面 + */ + onShareAppMessage() { + const _this = this; + // 构建页面参数 + const params = App.getShareUrlParams({ + 'active_id': _this.data.detail.active_id + }); + return { + title: _this.data.goods.goods_name, + path: "/pages/sharing/active/index?" + params + }; + }, + + /** + * 分享到朋友圈 + * 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta) + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html + */ + onShareTimeline() { + const _this = this; + // 构建页面参数 + const params = App.getShareUrlParams({ + 'active_id': _this.data.detail.active_id + }); + return { + title: _this.data.goods.goods_name, + path: "/pages/sharing/active/index?" + params + }; + }, + }) \ No newline at end of file diff --git a/pages/sharing/goods/index.js b/pages/sharing/goods/index.js index c54998a..916cdc2 100644 --- a/pages/sharing/goods/index.js +++ b/pages/sharing/goods/index.js @@ -361,21 +361,6 @@ Page({ }) }, - /** - * 分享当前页面 - */ - onShareAppMessage() { - let _this = this; - // 构建页面参数 - let params = App.getShareUrlParams({ - 'goods_id': _this.data.goods_id - }); - return { - title: _this.data.detail.goods_name, - path: "/pages/sharing/goods/index?" + params - }; - }, - /** * 显示分享选项 */ @@ -605,4 +590,37 @@ Page({ url: '../active/index?active_id=' + e.currentTarget.dataset.id, }) }, + + /** + * 分享当前页面 + */ + onShareAppMessage() { + const _this = this; + // 构建页面参数 + const params = App.getShareUrlParams({ + 'goods_id': _this.data.goods_id + }); + return { + title: _this.data.detail.goods_name, + path: "/pages/sharing/goods/index?" + params + }; + }, + + /** + * 分享到朋友圈 + * 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta) + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html + */ + onShareTimeline() { + const _this = this; + // 构建页面参数 + const params = App.getShareUrlParams({ + 'goods_id': _this.data.goods_id + }); + return { + title: _this.data.detail.goods_name, + path: "/pages/sharing/goods/index?" + params + }; + }, + }) \ No newline at end of file diff --git a/pages/sharing/index/index.js b/pages/sharing/index/index.js index 206c5b7..0c75215 100644 --- a/pages/sharing/index/index.js +++ b/pages/sharing/index/index.js @@ -22,7 +22,7 @@ Page({ /** * 生命周期函数--监听页面加载 */ - onLoad: function(options) { + onLoad(options) { let _this = this; // Api:获取拼团首页 _this.setListHeight(); @@ -35,7 +35,7 @@ Page({ getIndexData() { let _this = this; // 获取拼团首页 - App._get('sharing.index/index', {}, function(result) { + App._get('sharing.index/index', {}, result => { _this.setData({ categoryList: result.data.categoryList }); @@ -47,7 +47,7 @@ Page({ /** * Api:切换导航栏 */ - onSwitchTab: function(e) { + onSwitchTab(e) { let _this = this; // 第一步:切换当前的分类id _this.setData({ @@ -69,8 +69,7 @@ Page({ App._get('sharing.goods/lists', { page: page || 1, category_id: _this.data.category_id - }, function(result) { - console.log(result) + }, result => { let resList = result.data.list, dataList = _this.data.goodsList; if (isPage == true) { @@ -96,20 +95,10 @@ Page({ }); }, - /** - * 分享当前页面 - */ - onShareAppMessage: function() { - return { - title: '拼团首页', - path: "/pages/sharing/index/index?" + App.getShareUrlParams() - }; - }, - /** * 下拉到底加载数据 */ - bindDownLoad: function() { + bindDownLoad() { // 已经是最后一页 if (this.data.page >= this.data.goodsList.last_page) { this.setData({ @@ -124,7 +113,7 @@ Page({ /** * 设置商品列表高度 */ - setListHeight: function() { + setListHeight() { let systemInfo = wx.getSystemInfoSync(), rpx = systemInfo.windowWidth / 750, // 计算rpx tapHeight = Math.floor(rpx * 98), // tap高度 @@ -136,4 +125,27 @@ Page({ scrollHeight }); }, + + /** + * 分享当前页面 + */ + onShareAppMessage() { + return { + title: '拼团首页', + path: "/pages/sharing/index/index?" + App.getShareUrlParams() + }; + }, + + /** + * 分享到朋友圈 + * 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta) + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html + */ + onShareTimeline() { + return { + title: '拼团首页', + path: "/pages/sharing/index/index?" + App.getShareUrlParams() + }; + }, + }) \ No newline at end of file diff --git a/pages/sharp/goods/index.js b/pages/sharp/goods/index.js index 44c73a9..9843b7e 100644 --- a/pages/sharp/goods/index.js +++ b/pages/sharp/goods/index.js @@ -502,12 +502,30 @@ Page({ }, /** - * 用户点击右上角分享 + * 分享当前页面 */ onShareAppMessage() { - let _this = this; + const _this = this; // 构建页面参数 - let params = App.getShareUrlParams({ + const params = App.getShareUrlParams({ + active_time_id: _this.data.active_time_id, + sharp_goods_id: _this.data.sharp_goods_id, + }); + return { + title: _this.data.goods.goods_name, + path: `/pages/sharp/goods/index?${params}` + }; + }, + + /** + * 分享到朋友圈 + * 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta) + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html + */ + onShareTimeline() { + const _this = this; + // 构建页面参数 + const params = App.getShareUrlParams({ active_time_id: _this.data.active_time_id, sharp_goods_id: _this.data.sharp_goods_id, }); diff --git a/pages/sharp/index/index.js b/pages/sharp/index/index.js index 96cb527..444392d 100644 --- a/pages/sharp/index/index.js +++ b/pages/sharp/index/index.js @@ -168,12 +168,27 @@ Page({ }, /** - * 用户点击右上角分享 + * 分享当前页面 */ onShareAppMessage() { - let _this = this; + const _this = this; // 构建页面参数 - let params = App.getShareUrlParams(); + const params = App.getShareUrlParams(); + return { + title: '整点秒杀', + path: `/pages/sharp/index/index?${params}` + }; + }, + + /** + * 分享到朋友圈 + * 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta) + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html + */ + onShareTimeline() { + const _this = this; + // 构建页面参数 + const params = App.getShareUrlParams(); return { title: '整点秒杀', path: `/pages/sharp/index/index?${params}` diff --git a/pages/shop/detail/index.js b/pages/shop/detail/index.js index c6cf6fd..856aa16 100644 --- a/pages/shop/detail/index.js +++ b/pages/shop/detail/index.js @@ -34,21 +34,6 @@ Page({ }); }, - /** - * 分享当前页面 - */ - onShareAppMessage() { - let _this = this; - // 构建页面参数 - let params = App.getShareUrlParams({ - 'shop_id': _this.data.detail.shop_id - }); - return { - title: _this.data.detail.article_title, - path: "/pages/shop/detail/index?" + params - }; - }, - /** * 拨打电话 */ @@ -74,4 +59,36 @@ Page({ }); }, + /** + * 分享当前页面 + */ + onShareAppMessage() { + const _this = this; + // 构建页面参数 + const params = App.getShareUrlParams({ + 'shop_id': _this.data.detail.shop_id + }); + return { + title: _this.data.detail.article_title, + path: "/pages/shop/detail/index?" + params + }; + }, + + /** + * 分享到朋友圈 + * 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta) + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html + */ + onShareTimeline() { + const _this = this; + // 构建页面参数 + const params = App.getShareUrlParams({ + 'shop_id': _this.data.detail.shop_id + }); + return { + title: _this.data.detail.article_title, + path: "/pages/shop/detail/index?" + params + }; + }, + }) \ No newline at end of file diff --git a/version.json b/version.json index 4fd7b00..7842f40 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "1.1.43" + "version": "1.1.44" } diff --git a/wxParse/wxParse.wxss b/wxParse/wxParse.wxss index 86d87b5..ee87e6e 100644 --- a/wxParse/wxParse.wxss +++ b/wxParse/wxParse.wxss @@ -146,7 +146,8 @@ .wxParse-video-video { width: 100%; - /* height: 100%; */ + height: 100%; + min-height: 225px; } .wxParse-img {