小程序现在默认所有页面全部开启分享好友功能吗?
问题:小程序突然变得所有页面全部可以分享,而且代码中未编写分享相关功能。
经排查后,代码应该没有问题:
- 测试环境正常,未配置分享页面不可分享;
- 生产环境异常,未配置分享页面亦可转发好友.
如果有人遇到过此类问题,希望告知下原因,谢谢。
4 回复
const app = getApp()
Page({
data: {
active: 0,
question: '/static/image/icons/question.png',
used: '/static/image/icons/used.png'
},
onShow() {
this.getGiftCardList()
},
getGiftCardList(pageNo = 1) {
wx.showLoading({ title: '加载中...' })
const { active, cardInfo } = this.data
const card = cardInfo[active]
app.API.request({
url: app.API.urls.getGiftCardList,
data: {
useStatus: active === 0 ? 2 : 3,
pageNo
},
success: res => {
if (pageNo == 1) {
card.list = res.data.list
card.pageCount = res.data.pageCount
card.count = res.data.count
} else {
card.list = card.list.concat(res.data.list)
}
card.pageNo = pageNo
this.setData({
cardInfo
})
wx.hideLoading()
},
fail: err => {
wx.hideLoading()
}
})
},
tabChange(e) {
this.setData({ active: e.detail.index })
const card = this.data.cardInfo[this.data.active]
if (card.pageCount == 0) return this.getGiftCardList()
},
showTip() {
wx.showModal({
title: '使用说明',
content: '请在有效期内使用',
showCancel: false,
confirmColor: '#994539'
})
},
goBind() {
wx.navigateTo({
url: '/subPages/mine/wallet/giftcard/bind/index'
})
},
touchBottom() {
const card = this.data.cardInfo[this.data.active]
if (card.pageNo >= card.pageCount) return
this.getGiftCardList(card.pageNo + 1)
}
})