收藏
回答

小程序分享白屏?

小程序生成海报分享都是成功的 但是分享链接就失败了 点链接进入小程序直接白屏
if (!uni.getStorageSync('shareData')) {
				const scene = decodeURIComponent(options.scene) //拿到扫码进入小程序得参数
				const sceneData = options.sceneData //分享微信好友
				if (scene != 'undefined') { //扫码
					let data = await this.$Request.get('/share/shareGet/' + scene.split(',')[0]) //获取分享参数
					if (data.code == 200) {
						//console.log(data, '扫码')
						let goods = JSON.parse(data.object)
						uni.setStorageSync('goodsData', {
							goodsId: goods.goodsId,
							goodsType: goods.goodsType
						})
						uni.setStorageSync('invitePeoplePhone', goods.invitePeoplePhone)
					}
					this.$showToast("none", 2000, scene.split(',')[0])
				}
				if (options.sceneData) { //分享链接
					this.$showToast("none", 2000, options.sceneData + '分享链接2')
					console.log(options.sceneData + '分享链接2')
					let data = await this.$Request.get('/share/shareGet/' + options.sceneData)
					if (data.code == 200) {
						let goods = JSON.parse(data.object)
						uni.setStorageSync('goodsData', {
							goodsId: goods.goodsId,
							goodsType: goods.goodsType
						})
						uni.setStorageSync('invitePeoplePhone', goods.invitePeoplePhone)
					}
				}
				this.goodsDetails = uni.getStorageSync('goodsData')
				if (uni.getStorageSync('invitePeoplePhone')) {
					this.createOrderData.invitePeoplePhone = uni.getStorageSync('invitePeoplePhone')
				}
				this.getInfo()
				this.getSearchForBuyerInfo()
				this.getSpecifications()
回答关注问题邀请回答
收藏
登录 后发表内容