Commit 7951f2c0 by 高淑倩

modify: 图片导航样式

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