Commit 77430af8 by mamingqun

修改长图时的定位问题

parent 45b8ceab
<template>
<section class="detailWrap">
<div v-if="pictureInfo">
<div v-if="imgLock" class="imgBox">
<img :src="pictureInfo.image" alt>
<div v-if="imgLock" :class="['imgBox',top0]">
<img ref="picte" :src="pictureInfo.image" alt>
</div>
<div v-else class="loadingBox">loading</div>
<div class="userInfo">
......@@ -57,7 +57,8 @@ export default {
dianzanLock: true,
jinzhidianzan: false,
imgLock: false,
kongtuLock: false
kongtuLock: false,
top0: ''
};
},
computed: {
......@@ -125,7 +126,7 @@ export default {
: `${noSharp}?shareId=${id}`;
// alert('this.url');
// alert(this.url);
},
deactivated() {
......@@ -442,11 +443,32 @@ export default {
// WeixinJSBridge.call("showOptionMenu"); // 显示右上角的三个点的选项
});
},
},
watch: {
imgLock(newVal, oldVal) {
// 长图改变定位方式
if (newVal) {
setTimeout(() => {
var imgHeight = Number(this.$refs.picte.clientHeight);
var windowHeight = Number(document.body.clientHeight);
if (imgHeight > 1.1 * windowHeight) {
this.top0 = 'top0';
} else {
this.top0 = '';
}
});
}
}
}
};
</script>
<style lang="less" scoped>
.top0 {
top: 0 !important;
transform: translate(-50%, 0) !important;
}
.loadingBox {
color: white;
font-size: 50px;
......
// // api地址
// var server = 'http://web-comment.canskj.cn/new';
// var extra = '8';
// //包装的地址
// var wrapHref = 'http://web-comment.canskj.cn/home/contest/h5/8';
// //首页地址
// var indexHref = 'http://web-comment.iyunfish.cn/home/contest/h5/8';
// // 个人中心地址
// var userCenterHref = 'http://web-comment.iyunfish.cn/home/contest/h5/newuser/8';
// var shareImg = 'http://web-comment.iyunfish.cn/home/contest/h5/static/share1.jpg';
// api地址
var server = 'http://wd-h5.iyunfish.com/new';
var server = 'http://web-comment.canskj.cn/new';
var extra = '8';
//包装的地址
var wrapHref = 'http://wd-h5.bdideal.com/home/contest/h5/8';
var wrapHref = 'http://web-comment.canskj.cn/home/contest/h5/8';
//首页地址
var indexHref = 'http://wd-h5.iyunfish.com/home/contest/h5/8';
var indexHref = 'http://web-comment.iyunfish.cn/home/contest/h5/8';
// 个人中心地址
var userCenterHref = 'http://wd-h5.iyunfish.com/home/contest/h5/newuser/8';
var userCenterHref = 'http://web-comment.iyunfish.cn/home/contest/h5/newuser/8';
var shareImg = 'http://web-comment.iyunfish.cn/home/contest/h5/static/share1.jpg';
var shareImg = 'http://wd-h5.iyunfish.com/home/contest/h5/static/share1.jpg';
// // api地址
// var server = 'http://wanda-qj.iyunfish.com/new';
// var extra = '8';
// //包装的地址
// var wrapHref = 'http://wanda-qj.maxrocky.com/home/contest/h5/8';
// //首页地址
// var indexHref = 'http://wanda-qj.iyunfish.com/home/contest/h5/8';
// // 个人中心地址
// var userCenterHref = 'http://wanda-qj.iyunfish.com/home/contest/h5/newuser/8';
// var shareImg = 'http://wanda-qj.iyunfish.com/home/contest/h5/static/share1.jpg';
export default{
server,
extra,
......
File added
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 sign in to comment