修改详情页图片宽度的问题

This commit is contained in:
gaoxs
2020-07-22 17:17:14 +08:00
parent 38aa323e66
commit 951166db47
4 changed files with 13 additions and 3 deletions

View File

@ -369,6 +369,10 @@ export default {
var that = this; var that = this;
getBargainDetail(that.bargainId) getBargainDetail(that.bargainId)
.then(res => { .then(res => {
res.data.bargain = res.data.bargain.replace(
/\<img/gi,
'<img style="max-width:100%;height:auto;"'
);
that.bargain = res.data.bargain; that.bargain = res.data.bargain;
that.datatime = that.bargain.stopTime / 1000; that.datatime = that.bargain.stopTime / 1000;
that.getBargainHelpCount(); that.getBargainHelpCount();

View File

@ -242,6 +242,10 @@ export default {
let id = that.$yroute.query.id; let id = that.$yroute.query.id;
getCombinationDetail(id).then(res => { getCombinationDetail(id).then(res => {
that.userCollect = res.data.userCollect; that.userCollect = res.data.userCollect;
res.data.storeInfo.description = res.data.storeInfo.description.replace(
/\<img/gi,
'<img style="max-width:100%;height:auto;"'
);
that.$set(that, "storeInfo", res.data.storeInfo); that.$set(that, "storeInfo", res.data.storeInfo);
that.$set(that, "imgUrls", res.data.storeInfo.sliderImageArr); that.$set(that, "imgUrls", res.data.storeInfo.sliderImageArr);
that.$set(that, "itemNew", res.data.pinkOkList); that.$set(that, "itemNew", res.data.pinkOkList);

View File

@ -131,6 +131,10 @@ export default {
let id = that.$yroute.query.id; let id = that.$yroute.query.id;
that.datatime = parseInt(that.$yroute.query.time); that.datatime = parseInt(that.$yroute.query.time);
getSeckillDetail(id).then(res => { getSeckillDetail(id).then(res => {
res.data.storeInfo.description = res.data.storeInfo.description.replace(
/\<img/gi,
'<img style="max-width:100%;height:auto;"'
);
that.$set(that, "storeInfo", res.data.storeInfo); that.$set(that, "storeInfo", res.data.storeInfo);
that.$set(that, "imgUrls", res.data.storeInfo.sliderImageArr); that.$set(that, "imgUrls", res.data.storeInfo.sliderImageArr);
that.$set(that, "replyCount", res.data.replyCount); that.$set(that, "replyCount", res.data.replyCount);

View File

@ -354,12 +354,10 @@ export default {
uni.showLoading({ title: "加载中", mask: true }); uni.showLoading({ title: "加载中", mask: true });
getProductDetail(that.id, from) getProductDetail(that.id, from)
.then(res => { .then(res => {
res.data.storeInfo.description.replace( res.data.storeInfo.description = res.data.storeInfo.description.replace(
/\<img/gi, /\<img/gi,
'<img style="max-width:100%;height:auto;"' '<img style="max-width:100%;height:auto;"'
); );
console.log(res);
that.$set(that, "storeInfo", res.data.storeInfo); that.$set(that, "storeInfo", res.data.storeInfo);
// 给 attr 赋值,将请求回来的规格赋值给 attr // 给 attr 赋值,将请求回来的规格赋值给 attr
that.$set(that.attr, "productAttr", res.data.productAttr); that.$set(that.attr, "productAttr", res.data.productAttr);