|
|
@@ -58,15 +58,16 @@ export default {
|
|
|
const { styleStr } = this.node;
|
|
|
const imageHeightStyle = mode === 'widthFix' ? '' : `height: ${imageheight}px;`;
|
|
|
|
|
|
- this.newStyleStr = `${styleStr}; ${imageHeightStyle}; width: ${imageWidth}px; padding: 0 ${+padding}px;`;//删除padding
|
|
|
+ //this.newStyleStr = ` padding: 0 ${+padding}px;`;//删除默认u安
|
|
|
+ this.newStyleStr = `${styleStr}; ${imageHeightStyle}; width: ${imageWidth}px; padding: 0 ${+padding}px; margin: 0 auto;`;//删除padding
|
|
|
// this.newStyleStr = `${styleStr}; ${imageHeightStyle}; width: ${imageWidth}px;`;
|
|
|
},
|
|
|
// 计算视觉优先的图片宽高
|
|
|
wxAutoImageCal(originalWidth, originalHeight) {
|
|
|
// 获取图片的原始长宽
|
|
|
- const windowWidth = this.parseWidth.value;
|
|
|
+ // const windowWidth = this.parseWidth.value;
|
|
|
+ const { windowWidth, windowHeight } = uni.getSystemInfoSync();
|
|
|
const results = {};
|
|
|
-
|
|
|
if (originalWidth < 60 || originalHeight < 60) {
|
|
|
const { src } = this.node.attr;
|
|
|
let parent = this.$parent;
|
|
|
@@ -82,6 +83,8 @@ export default {
|
|
|
// 在图片width大于手机屏幕width时候
|
|
|
results.imageWidth = windowWidth;
|
|
|
results.imageheight = windowWidth * (originalHeight / originalWidth);
|
|
|
+ // results.imageWidth = originalWidth;
|
|
|
+ // results.imageheight = originalHeight;
|
|
|
} else {
|
|
|
// 否则展示原来的数据
|
|
|
results.imageWidth = originalWidth;
|