Commit 7951f2c0 by 高淑倩

modify: 图片导航样式

parent e8f2289a
......@@ -29,7 +29,7 @@ Component({
*/
methods: {
imageLoad(e) {
var imageSize = utils.imageUtil(e)
let imageSize = utils.imageUtil(e)
this.setData({
imagewidth: imageSize.imageWidth,
imageheight: imageSize.imageHeight
......
<!--component/picNav/picNav.wxml-->
<view class="pic-nav">
<block wx:for="{{picNav}}" wx:key="{{index}}" wx:for-item="item">
<view class="pic-item"><image class="pic-img" src="http://testimg3.bigaka.com{{item.imageUrl}}" data-appid="{{item.link.appid}}" data-path="{{item.link.url}}" bindload="imageLoad" bindtap='preview' mode="widthFix"/></view>
<view class="nav-block" style="width: {{imagewidth}}px;height: {{imageheight}}px;">
<image style="width: {{imagewidth}}px;height: {{imageheight}}px;" src="http://testimg3.bigaka.com{{item.imageUrl}}" data-appid="{{item.link.appid}}" data-path="{{item.link.url}}" bindload="imageLoad" bindtap='preview' />
</view>
</block>
</view>
<authorization-modal isAuthorization='{{isAuthorization}}'/>
<!--<view class="pic-nav">
<block wx:for="{{picNav}}" wx:key="{{index}}" wx:for-item="item">
<view class="pic-item"><image style="width: {{imagewidth}}px; height: {{imageheight}}px;" src="http://testimg3.bigaka.com{{item.imageUrl}}" data-appid="{{item.link.appid}}" data-path="{{item.link.url}}" bindload="imageLoad" bindtap='preview' mode="widthFix"/></view>
</block>
</view>-->
/* component/picNav/picNav.wxss */
.pic-nav {
display: flex;
height:172.5rpx;
overflow: hidden;
padding: 0;
margin: 0;
box-sizing:content-box;
}
\ No newline at end of file
.pic-item {
flex: 1;
}
.pic-item:first-child image{
height: 100% !important;
}
.pic-img {
height: 100%;
width: 100%;
}
/* .pic-nav {
display: flex;
}
.pic-item {
flex: 1;
}
.pic-item:first-child image{
height: 100% !important;
} */
\ No newline at end of file
......@@ -88,7 +88,7 @@ wxService.page({
title: '加载中'
})
wxService.post(`/coupon/coupon/memberCouponCount`).then(res => {
const { result, data } = res && res.data
const { result, data } = res && res.data && res.data.result
if (result == 0) {
wx.hideLoading()
this.setData({
......
......@@ -58,7 +58,9 @@ function imageUtil(e) {
//获取屏幕宽高
wx.getSystemInfo({
success: function (res) {
var windowWidth = res.windowWidth/2;
// var windowWidth = res.windowWidth/2;
// var windowHeight = res.windowHeight/2;
var windowWidth = (res.windowWidth-30)/2;
var windowHeight = res.windowHeight/2;
var windowscale = windowHeight/windowWidth;//屏幕高宽比
if(originalScale < windowscale){//图片高宽比小于屏幕高宽比
......
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