Commit 91cbecf7 by 匡雅琴

分享bug修复

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