Commit de675b1a by 赵雅纹

Merge branch 'fixbug-ZYW' into 'dev_7.1.0'

Fixbug zyw

See merge request !169
parents a3980ee0 e7105ba3
...@@ -12,10 +12,12 @@ ...@@ -12,10 +12,12 @@
} }
.scroll-view-item { .scroll-view-item {
display: inline-block; display: inline-block;
width: 100rpx; min-width: 60rpx;
/* width: 100rpx; */
font-size: 25rpx; font-size: 25rpx;
text-align: center; text-align: center;
font-family: PingFangSC-Medium; font-family: PingFangSC-Medium;
padding: 0 10rpx;
} }
.scroll-view-right { .scroll-view-right {
width: 18%; width: 18%;
......
...@@ -280,6 +280,7 @@ wxService.page({ ...@@ -280,6 +280,7 @@ wxService.page({
var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId; var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId;
console.log(path) console.log(path)
return { return {
title: this.data.cardTitle,
path: path, path: path,
imageUrl: this.data.cardUrl, // 可以更换分享的图片 imageUrl: this.data.cardUrl, // 可以更换分享的图片
} }
......
...@@ -337,6 +337,7 @@ wxService.page({ ...@@ -337,6 +337,7 @@ wxService.page({
var path = 'pages/productDetail/productDetail?i=' + id + '&t=' + tentacleId; var path = 'pages/productDetail/productDetail?i=' + id + '&t=' + tentacleId;
console.log(path) console.log(path)
return { return {
title: this.data.productInfo.productName,
path: path, path: path,
imageUrl: this.data.productInfo.indexUrl imageUrl: this.data.productInfo.indexUrl
} }
...@@ -351,6 +352,7 @@ wxService.page({ ...@@ -351,6 +352,7 @@ wxService.page({
path = `pages/productDetail/productDetail?i=${contentId}&m=${m}`; path = `pages/productDetail/productDetail?i=${contentId}&m=${m}`;
} }
return { return {
title: this.data.productInfo.productName,
path: path, path: path,
imageUrl: this.data.productInfo.indexUrl imageUrl: this.data.productInfo.indexUrl
} }
......
...@@ -16,6 +16,7 @@ wxService.page({ ...@@ -16,6 +16,7 @@ wxService.page({
pageNo:1, pageNo:1,
pageSize:100, pageSize:100,
proList:[], proList:[],
showCardModal: false, showCardModal: false,
currentShareContent: null, currentShareContent: null,
pagePath:'', pagePath:'',
...@@ -28,7 +29,6 @@ wxService.page({ ...@@ -28,7 +29,6 @@ wxService.page({
*/ */
onLoad(options) { onLoad(options) {
if (options && options.id){ if (options && options.id){
console.log(options.id)
this.setData({ this.setData({
id: options.id id: options.id
}) })
...@@ -106,7 +106,6 @@ wxService.page({ ...@@ -106,7 +106,6 @@ wxService.page({
//跳转商品详情 //跳转商品详情
onTapToGoodsInfo(e){ onTapToGoodsInfo(e){
console.log(e)
let item = e.currentTarget.dataset.item; let item = e.currentTarget.dataset.item;
let productId = e.currentTarget.dataset.productid; let productId = e.currentTarget.dataset.productid;
//组装一个临时触点信息对象到本地 //组装一个临时触点信息对象到本地
...@@ -130,14 +129,14 @@ wxService.page({ ...@@ -130,14 +129,14 @@ wxService.page({
// 分享 // 分享
onTapShare() { onTapShare() {
console.log('00000',this.data.contentInfo)
const { memberId, member } = wx.getStorageSync('_baseUserInfo') const { memberId, member } = wx.getStorageSync('_baseUserInfo')
let content = { let content = {
title: this.data.contentInfo.headline, title: this.data.contentInfo.headline,
id: this.data.contentInfo.id, id: this.data.contentInfo.id,
article: this.data.contentInfo.article, article: this.data.contentInfo.article,
url: this.data.contentInfo.shareShowPictureRESDTOList[0].url url: this.getImageInShareShowPictureRESDTOList()
} }
let tentacleInfo = { let tentacleInfo = {
content: JSON.stringify(content), content: JSON.stringify(content),
contentId: this.data.contentInfo.id, contentId: this.data.contentInfo.id,
...@@ -158,7 +157,7 @@ wxService.page({ ...@@ -158,7 +157,7 @@ wxService.page({
this.setData({ this.setData({
showCardModal: true, showCardModal: true,
cardTitle: this.data.contentInfo.headline, cardTitle: this.data.contentInfo.headline,
cardUrl: this.data.contentInfo.shareShowPictureRESDTOList[0].url, cardUrl: this.getImageInShareShowPictureRESDTOList(),
pagePath: path, pagePath: path,
scene: scene scene: scene
}); });
...@@ -172,6 +171,21 @@ wxService.page({ ...@@ -172,6 +171,21 @@ wxService.page({
}) })
}, },
//获取内容第一个图片
getImageInShareShowPictureRESDTOList(){
let arr = this.data.contentInfo.shareShowPictureRESDTOList;
let reg = /^http.*(gif|png|jpeg|jpg|PNG|JPEG|JPG?g)$/,
url = '';
for (let i = 0; i < arr.length ; i ++){
if (reg.test(arr[i].url)){
url = arr[i].url;
break;
}
}
return url;
},
// 获取内容详情 // 获取内容详情
getContentDetail(){ getContentDetail(){
const { memberId, member } = wx.getStorageSync('_baseUserInfo') const { memberId, member } = wx.getStorageSync('_baseUserInfo')
...@@ -272,19 +286,20 @@ wxService.page({ ...@@ -272,19 +286,20 @@ wxService.page({
var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId; var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId;
return { return {
path: path, path: path,
title: this.data.cardTitle,
imageUrl: this.data.cardUrl, // 可以更换分享的图片 imageUrl: this.data.cardUrl, // 可以更换分享的图片
} }
}else{ }else{
//修改为参数memberId //修改为参数memberId
var path = `pages/wantToBuyDetail/wantToBuyDetail`; var path = `pages/wantToBuyDetail/wantToBuyDetail`;
const { memberId, member } = wx.getStorageSync('_baseUserInfo') const { memberId, member } = wx.getStorageSync('_baseUserInfo')
console.log('--------------------memberId-=---', memberId)
if (memberId) { if (memberId) {
let m = Integer.digit(memberId, 10, 64); let m = Integer.digit(memberId, 10, 64);
let contentId = Integer.digit(this.data.contentInfo.id, 10, 64); let contentId = Integer.digit(this.data.contentInfo.id, 10, 64);
path = `pages/wantToBuyDetail/wantToBuyDetail?i=${contentId}&m=${m}`; path = `pages/wantToBuyDetail/wantToBuyDetail?i=${contentId}&m=${m}`;
} }
return { return {
title: this.data.cardTitle,
path: path, path: path,
imageUrl: this.data.cardUrl imageUrl: this.data.cardUrl
} }
......
...@@ -283,6 +283,7 @@ wxService.page({ ...@@ -283,6 +283,7 @@ wxService.page({
var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId; var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId;
console.log(path) console.log(path)
return { return {
title: this.data.cardTitle,
path: path, path: path,
imageUrl: this.data.cardUrl // 可以更换分享的图片 imageUrl: this.data.cardUrl // 可以更换分享的图片
} }
......
...@@ -62,6 +62,21 @@ wxService.page({ ...@@ -62,6 +62,21 @@ wxService.page({
}) })
}, },
//获取内容第一个图片
getImageInSspList() {
let arr = this.data.contentInfo.sspList;
let reg = /^http.*(gif|png|jpeg|jpg|PNG|JPEG|JPG?g)$/,
url = '';
for (let i = 0; i < arr.length; i++) {
if (reg.test(arr[i].url)) {
url = arr[i].url;
break;
}
}
return url;
},
// 分享 // 分享
onTapShare(){ onTapShare(){
const { memberId, member } = wx.getStorageSync('_baseUserInfo') const { memberId, member } = wx.getStorageSync('_baseUserInfo')
...@@ -69,7 +84,7 @@ wxService.page({ ...@@ -69,7 +84,7 @@ wxService.page({
title: this.data.contentInfo.headline, title: this.data.contentInfo.headline,
id: this.data.contentInfo.id, id: this.data.contentInfo.id,
article: this.data.contentInfo.article, article: this.data.contentInfo.article,
url: this.data.contentInfo.sspList[0].url url: this.getImageInSspList()
} }
let tentacleInfo = { let tentacleInfo = {
content: JSON.stringify(content), content: JSON.stringify(content),
...@@ -92,7 +107,7 @@ wxService.page({ ...@@ -92,7 +107,7 @@ wxService.page({
this.setData({ this.setData({
showCardModal: true, showCardModal: true,
cardTitle: this.data.contentInfo.headline, cardTitle: this.data.contentInfo.headline,
cardUrl: this.data.contentInfo.sspList[0].url, cardUrl: this.getImageInSspList(),
pagePath:path, pagePath:path,
scene: scene scene: scene
}); });
...@@ -308,6 +323,7 @@ wxService.page({ ...@@ -308,6 +323,7 @@ wxService.page({
var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId; var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId;
console.log(path) console.log(path)
return { return {
title: this.data.cardTitle,
path: path, path: path,
imageUrl: this.data.contentInfo.sspList[0].url imageUrl: this.data.contentInfo.sspList[0].url
} }
...@@ -322,6 +338,7 @@ wxService.page({ ...@@ -322,6 +338,7 @@ wxService.page({
path = `pages/wantToBuyDetail/wantToBuyDetail?i=${contentId}&m=${m}`; path = `pages/wantToBuyDetail/wantToBuyDetail?i=${contentId}&m=${m}`;
} }
return { return {
title: this.data.cardTitle,
path: path, path: path,
imageUrl: this.data.contentInfo.sspList[0].url imageUrl: this.data.contentInfo.sspList[0].url
} }
......
...@@ -73,7 +73,7 @@ wxService.page({ ...@@ -73,7 +73,7 @@ wxService.page({
wx.getSystemInfo({ wx.getSystemInfo({
success: function (system) { success: function (system) {
wx.getImageInfo({ wx.getImageInfo({
src: this.data.currentPosterImg, src: _this.data.currentPosterImg,
success: function (res) { success: function (res) {
let posterImgWidth = res.width, let posterImgWidth = res.width,
posterImgHeight = res.height; posterImgHeight = res.height;
...@@ -92,9 +92,6 @@ wxService.page({ ...@@ -92,9 +92,6 @@ wxService.page({
}) })
} }
}); });
}, },
// 获取海报图片 // 获取海报图片
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment