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 @@
}
.scroll-view-item {
display: inline-block;
width: 100rpx;
min-width: 60rpx;
/* width: 100rpx; */
font-size: 25rpx;
text-align: center;
font-family: PingFangSC-Medium;
padding: 0 10rpx;
}
.scroll-view-right {
width: 18%;
......
......@@ -280,6 +280,7 @@ wxService.page({
var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId;
console.log(path)
return {
title: this.data.cardTitle,
path: path,
imageUrl: this.data.cardUrl, // 可以更换分享的图片
}
......
......@@ -337,6 +337,7 @@ wxService.page({
var path = 'pages/productDetail/productDetail?i=' + id + '&t=' + tentacleId;
console.log(path)
return {
title: this.data.productInfo.productName,
path: path,
imageUrl: this.data.productInfo.indexUrl
}
......@@ -351,6 +352,7 @@ wxService.page({
path = `pages/productDetail/productDetail?i=${contentId}&m=${m}`;
}
return {
title: this.data.productInfo.productName,
path: path,
imageUrl: this.data.productInfo.indexUrl
}
......
......@@ -16,6 +16,7 @@ wxService.page({
pageNo:1,
pageSize:100,
proList:[],
showCardModal: false,
currentShareContent: null,
pagePath:'',
......@@ -28,7 +29,6 @@ wxService.page({
*/
onLoad(options) {
if (options && options.id){
console.log(options.id)
this.setData({
id: options.id
})
......@@ -106,7 +106,6 @@ wxService.page({
//跳转商品详情
onTapToGoodsInfo(e){
console.log(e)
let item = e.currentTarget.dataset.item;
let productId = e.currentTarget.dataset.productid;
//组装一个临时触点信息对象到本地
......@@ -130,14 +129,14 @@ wxService.page({
// 分享
onTapShare() {
console.log('00000',this.data.contentInfo)
const { memberId, member } = wx.getStorageSync('_baseUserInfo')
let content = {
title: this.data.contentInfo.headline,
id: this.data.contentInfo.id,
article: this.data.contentInfo.article,
url: this.data.contentInfo.shareShowPictureRESDTOList[0].url
url: this.getImageInShareShowPictureRESDTOList()
}
let tentacleInfo = {
content: JSON.stringify(content),
contentId: this.data.contentInfo.id,
......@@ -158,7 +157,7 @@ wxService.page({
this.setData({
showCardModal: true,
cardTitle: this.data.contentInfo.headline,
cardUrl: this.data.contentInfo.shareShowPictureRESDTOList[0].url,
cardUrl: this.getImageInShareShowPictureRESDTOList(),
pagePath: path,
scene: scene
});
......@@ -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(){
const { memberId, member } = wx.getStorageSync('_baseUserInfo')
......@@ -272,19 +286,20 @@ wxService.page({
var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId;
return {
path: path,
title: this.data.cardTitle,
imageUrl: this.data.cardUrl, // 可以更换分享的图片
}
}else{
//修改为参数memberId
var path = `pages/wantToBuyDetail/wantToBuyDetail`;
const { memberId, member } = wx.getStorageSync('_baseUserInfo')
console.log('--------------------memberId-=---', memberId)
if (memberId) {
let m = Integer.digit(memberId, 10, 64);
let contentId = Integer.digit(this.data.contentInfo.id, 10, 64);
path = `pages/wantToBuyDetail/wantToBuyDetail?i=${contentId}&m=${m}`;
}
return {
title: this.data.cardTitle,
path: path,
imageUrl: this.data.cardUrl
}
......
......@@ -283,6 +283,7 @@ wxService.page({
var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId;
console.log(path)
return {
title: this.data.cardTitle,
path: path,
imageUrl: this.data.cardUrl // 可以更换分享的图片
}
......
......@@ -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(){
const { memberId, member } = wx.getStorageSync('_baseUserInfo')
......@@ -69,7 +84,7 @@ wxService.page({
title: this.data.contentInfo.headline,
id: this.data.contentInfo.id,
article: this.data.contentInfo.article,
url: this.data.contentInfo.sspList[0].url
url: this.getImageInSspList()
}
let tentacleInfo = {
content: JSON.stringify(content),
......@@ -92,7 +107,7 @@ wxService.page({
this.setData({
showCardModal: true,
cardTitle: this.data.contentInfo.headline,
cardUrl: this.data.contentInfo.sspList[0].url,
cardUrl: this.getImageInSspList(),
pagePath:path,
scene: scene
});
......@@ -308,6 +323,7 @@ wxService.page({
var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId;
console.log(path)
return {
title: this.data.cardTitle,
path: path,
imageUrl: this.data.contentInfo.sspList[0].url
}
......@@ -322,6 +338,7 @@ wxService.page({
path = `pages/wantToBuyDetail/wantToBuyDetail?i=${contentId}&m=${m}`;
}
return {
title: this.data.cardTitle,
path: path,
imageUrl: this.data.contentInfo.sspList[0].url
}
......
......@@ -73,7 +73,7 @@ wxService.page({
wx.getSystemInfo({
success: function (system) {
wx.getImageInfo({
src: this.data.currentPosterImg,
src: _this.data.currentPosterImg,
success: function (res) {
let posterImgWidth = res.width,
posterImgHeight = res.height;
......@@ -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