|
@@ -88,10 +88,28 @@ Page({
|
|
path = path + "&shareUid=" + userInfo.userCode;
|
|
path = path + "&shareUid=" + userInfo.userCode;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ let coverImgUrl = "";
|
|
|
|
+ if (detailData.coverImgUrl) {
|
|
|
|
+ coverImgUrl = detailData.coverImgUrl;
|
|
|
|
+ } else if (detailData.imgsUrl.length) {
|
|
|
|
+ coverImgUrl = detailData.imgsUrl[0];
|
|
|
|
+ } else {
|
|
|
|
+ coverImgUrl = "https://static.hoolihome.com/weapp/daily/poster-cover.png";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ let title = "留学daily";
|
|
|
|
+ if (detailData.title) {
|
|
|
|
+ title = detailData.title;
|
|
|
|
+ } else if (detailData.content) {
|
|
|
|
+ title = detailData.content;
|
|
|
|
+ } else {
|
|
|
|
+ title = "留学daily";
|
|
|
|
+ }
|
|
|
|
+
|
|
return {
|
|
return {
|
|
- title: detailData.title,
|
|
|
|
|
|
+ title: title,
|
|
path: path,
|
|
path: path,
|
|
- imageUrl: detailData.coverImgUrl,
|
|
|
|
|
|
+ imageUrl: coverImgUrl,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
|
|
@@ -428,9 +446,9 @@ Page({
|
|
if (data.qrImg && data.qrImg.length) {
|
|
if (data.qrImg && data.qrImg.length) {
|
|
this.setData(
|
|
this.setData(
|
|
{
|
|
{
|
|
|
|
+ isShowQRPoster: true,
|
|
postImgSrc: data.qrImg,
|
|
postImgSrc: data.qrImg,
|
|
extendObj: extendObj,
|
|
extendObj: extendObj,
|
|
- isShowQRPoster: true,
|
|
|
|
},
|
|
},
|
|
() => {
|
|
() => {
|
|
wx.showLoading({
|
|
wx.showLoading({
|
|
@@ -462,9 +480,10 @@ Page({
|
|
|
|
|
|
posterCallack: function (arr) {
|
|
posterCallack: function (arr) {
|
|
if (!arr) return;
|
|
if (!arr) return;
|
|
|
|
+ let isFirstTop = 0;
|
|
arr.forEach((v, i, a) => {
|
|
arr.forEach((v, i, a) => {
|
|
- let { id, dataset } = v;
|
|
|
|
- if (id.indexOf("img") !== -1) {
|
|
|
|
|
|
+ let { id, dataset, top } = v;
|
|
|
|
+ if (id.indexOf("image") !== -1) {
|
|
wx.getImageInfo({
|
|
wx.getImageInfo({
|
|
src: dataset.what,
|
|
src: dataset.what,
|
|
success: (res) => {
|
|
success: (res) => {
|
|
@@ -472,6 +491,16 @@ Page({
|
|
},
|
|
},
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ if (i == 0 && top < 0) {
|
|
|
|
+ isFirstTop = Math.abs(top);
|
|
|
|
+ v.top = 0;
|
|
|
|
+ } else if (isFirstTop) {
|
|
|
|
+ v.top += isFirstTop;
|
|
|
|
+ }
|
|
|
|
+ // 圈子显示三行是,css 设置了top:2000px;所以需要减去2000
|
|
|
|
+ if (top >= 2000) {
|
|
|
|
+ v.top -= 2000;
|
|
|
|
+ }
|
|
});
|
|
});
|
|
if (Array.isArray(arr) && arr.length) {
|
|
if (Array.isArray(arr) && arr.length) {
|
|
this.setData(
|
|
this.setData(
|
|
@@ -528,7 +557,7 @@ Page({
|
|
success: function (res) {
|
|
success: function (res) {
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
wx.openSetting({
|
|
wx.openSetting({
|
|
- success(res) { },
|
|
|
|
|
|
+ success(res) {},
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|