Commit 91cbecf7 by 匡雅琴

分享bug修复

1 parent ac9f9b55
......@@ -88,6 +88,12 @@ App({
case 'SHARE_D':
wx.$storage.set('scene', wx.$trackData)
break
case 'SHARE_PRO':
wx.$storage.set('scene', wx.$trackData)
break
case 'SHARE_VIDEO':
wx.$storage.set('scene', wx.$trackData)
break
default:
if (wx.$trackData.cardId) {
wx.$storage.set('scene', wx.$trackData)
......
......@@ -16,6 +16,10 @@ Component({
proDetail: {
type: Object,
value: {}
},
cardInfo: {
type: Object,
value: {}
}
},
......
......@@ -81,11 +81,11 @@ Page({
//接受跳转的路由参数(小程序页面跳转)
async onRoute(options) {
console.log(options);
if (!options || utils.isEmptyObj(options)) return;
let { hasPhoneNumber, id } = options;
let proData = await this.getProductDetail(id);
if (!proData) {
// proData?.status 1-上架 2-下架
if (!proData || proData?.status == 2) {
this.setData({
isLoadding: false,
hasProduct: false
......@@ -163,7 +163,8 @@ Page({
wx.$storage.set("scene", options);
const { id } = options;
let proData = await this.getProductDetail(id);
if (!proData) {
// proData?.status 1-上架 2-下架
if (!proData || proData?.status == 2) {
this.setData({
isLoadding: false,
hasProduct: false
......
......@@ -21,10 +21,11 @@ Page({
* 生命周期函数--监听页面加载
*/
async onLoad(options) {
if (!options && options.cardId) return
if (!options?.cardId && !options?.shareType) return
const { id } = options;
let videoData = await this.getDetailWithLike(id);
if (!videoData) {
// videoData?.status 1-上架 2-下架
if (!videoData || videoData?.status == 2) {
this.setData({
isLoadding: false,
hasProduct: false
......@@ -37,7 +38,7 @@ Page({
isLoadding: false
});
setTimeout(() => {
utils.setNavigationBarTitle(videoData.title)
utils.setNavigationBarTitle(videoData.proName)
},100)
getApp()
.login()
......@@ -54,7 +55,8 @@ Page({
if (!options || utils.isEmptyObj(options)) return;
let { id } = options;
let videoData = await this.getDetailWithLike(id);
if (!videoData) {
// videoData?.status 1-上架 2-下架
if (!videoData || videoData?.status == 2) {
this.setData({
isLoadding: false,
hasProduct: false
......@@ -67,7 +69,7 @@ Page({
videoId: id
});
setTimeout(() => {
utils.setNavigationBarTitle(videoData.title)
utils.setNavigationBarTitle(videoData.proName)
},100)
},
......@@ -88,7 +90,6 @@ Page({
const _this = this
let {videoId} = this.data
const {vedioUrl} = this.data.videoData.likeList.find(item => item.id == videoId)
console.log(vedioUrl, '000');
wx.getSetting({
success: (res)=> {
if(res.authSetting['scope.writePhotosAlbum']===false){
......@@ -124,12 +125,12 @@ Page({
// 点击猜你喜欢视频
chooseVideo(e) {
const {title, id} = e.detail
const {proName, id} = e.detail
this.setData({
videoId: id
})
setTimeout(() => {
utils.setNavigationBarTitle(title)
utils.setNavigationBarTitle(proName)
},100)
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!