Commit c9cec132 by 高淑倩

modify:样式

parent 7f081ec8
...@@ -20,12 +20,20 @@ Component({ ...@@ -20,12 +20,20 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
imagewidth: 0,//缩放后的宽
imageheight: 0,//缩放后的高
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
imageLoad(e) {
var imageSize = utils.imageUtil(e)
this.setData({
imagewidth: imageSize.imageWidth,
imageheight: imageSize.imageHeight
})
},
preview(e) { preview(e) {
const {appid, path} = e.currentTarget.dataset const {appid, path} = e.currentTarget.dataset
// 获取当前帐号信息 // 获取当前帐号信息
......
<!--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" class="pic-content"> <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}}" bindtap='preview' mode="scaleToFill"/></view> <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>
</block> </block>
</view> </view>
<!--<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>-->
...@@ -4,10 +4,22 @@ ...@@ -4,10 +4,22 @@
} }
.pic-item { .pic-item {
flex: 1; flex: 1;
height: 200rpx;
/* border-radius:10rpx; */
} }
.pic-item:first-child image{
height: 100% !important;
}
.pic-img { .pic-img {
height: 100%; height: 100%;
width: 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
...@@ -44,7 +44,7 @@ wxService.page({ ...@@ -44,7 +44,7 @@ wxService.page({
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
wxService.get(`/sale/order/findByOrderNo?orderNo=${orderNo}&brandId=1002`).then(res => { wxService.get(`/sale/order/findByOrderNo?orderNo=${orderNo}&brandId=2005`).then(res => {
const {result,data} = res.data const {result,data} = res.data
if(result == 0){ if(result == 0){
wx.hideLoading() wx.hideLoading()
......
...@@ -5,21 +5,21 @@ ...@@ -5,21 +5,21 @@
<!--{{pItem.type}}--> <!--{{pItem.type}}-->
<!-- 轮播 --> <!-- 轮播 -->
<view class="images-tab pd1530" wx:if="{{pItem.type == 1}}"> <view class="pd1530" wx:if="{{pItem.type == 1}}">
<image-swiper image-data="{{pItem.rotationchart.images}}" /> <image-swiper image-data="{{pItem.rotationchart.images}}" />
</view> </view>
<!-- 个人中心 {{pItem.customer}}--> <!-- 个人中心 {{pItem.customer}}-->
<view class="images-tab pd1530" wx:if="{{pItem.type == 2}}"> <view class="pd1530" wx:if="{{pItem.type == 2}}">
<person-center person-data="{{pItem.customer}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}"/> <person-center person-data="{{pItem.customer}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}"/>
</view> </view>
<!-- 图片导航 {{pItem.navigation.images}}--> <!-- 图片导航 {{pItem.navigation.images}} pd1530-->
<view class="images-tab pd1530" wx:if="{{pItem.type == 3}}"> <view class="pd1530" wx:if="{{pItem.type == 3}}">
<pic-nav pic-nav="{{pItem.navigation.images}}" /> <pic-nav pic-nav="{{pItem.navigation.images}}" />
</view> </view>
<!-- 底部 --> <!-- 底部 -->
<view class="images-tab" wx:if="{{pItem.type == 4}}"> <view class="" wx:if="{{pItem.type == 4}}">
<view class='footer-content' style="background:{{pItem.bottom.color}};color:{{pItem.bottom.color}}" data-appid="{{pItem.bottom.link.appid}}" data-path="{{pItem.bottom.link.url}}" catchtouchstart='touchStart' catchtouchend="touchEnd"> <view class='footer-content' style="background:{{pItem.bottom.color}};color:{{pItem.bottom.color}}" data-appid="{{pItem.bottom.link.appid}}" data-path="{{pItem.bottom.link.url}}" catchtouchstart='touchStart' catchtouchend="touchEnd">
<text class="footer-arrow" style="color:{{pItem.bottom.fontColor}}"><<</text> <text class="footer-arrow" style="color:{{pItem.bottom.fontColor}}"><<</text>
<text class='footer-text' style="color:{{pItem.bottom.fontColor}}">{{pItem.bottom.title}}</text> <text class='footer-text' style="color:{{pItem.bottom.fontColor}}">{{pItem.bottom.title}}</text>
......
...@@ -48,6 +48,34 @@ function getAccountInfo() { ...@@ -48,6 +48,34 @@ function getAccountInfo() {
} }
/** /**
* 图片宽高比
*/
function imageUtil(e) {
var imageSize = {};
var originalWidth = e.detail.width;//图片原始宽
var originalHeight = e.detail.height;//图片原始高
var originalScale = originalHeight/originalWidth;//图片高宽比
//获取屏幕宽高
wx.getSystemInfo({
success: function (res) {
var windowWidth = res.windowWidth/2;
var windowHeight = res.windowHeight/2;
var windowscale = windowHeight/windowWidth;//屏幕高宽比
if(originalScale < windowscale){//图片高宽比小于屏幕高宽比
//图片缩放后的宽为屏幕宽
imageSize.imageWidth = windowWidth;
imageSize.imageHeight = (windowWidth * originalHeight) / originalWidth;
}else{//图片高宽比大于屏幕高宽比
//图片缩放后的高为屏幕高
imageSize.imageHeight = windowHeight;
imageSize.imageWidth = (windowHeight * originalWidth) / originalHeight;
}
}
})
return imageSize;
}
/**
* 判断用户滑动 * 判断用户滑动
* 左滑还是右滑 * 左滑还是右滑
*/ */
...@@ -235,8 +263,8 @@ function getUserInfoByBtn(userInfo) { ...@@ -235,8 +263,8 @@ function getUserInfoByBtn(userInfo) {
return wxService.post(`/member/minaLogin`, { return wxService.post(`/member/minaLogin`, {
code: res[1].code, code: res[1].code,
wechatInfo: res[0], wechatInfo: res[0],
// brandId: 2005, brandId: 2005,
brandId: 1001, // brandId: 1001,
}) })
}, (err) => { }, (err) => {
return Promise.reject(err) return Promise.reject(err)
...@@ -277,5 +305,6 @@ module.exports = { ...@@ -277,5 +305,6 @@ module.exports = {
getTouchData, getTouchData,
getAccountInfo, getAccountInfo,
aspectRatio, aspectRatio,
imageUtil
// checkFullSucreen // checkFullSucreen
} }
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