Commit c9cec132 by 高淑倩

modify:样式

parent 7f081ec8
......@@ -20,12 +20,20 @@ Component({
* 组件的初始数据
*/
data: {
imagewidth: 0,//缩放后的宽
imageheight: 0,//缩放后的高
},
/**
* 组件的方法列表
*/
methods: {
imageLoad(e) {
var imageSize = utils.imageUtil(e)
this.setData({
imagewidth: imageSize.imageWidth,
imageheight: imageSize.imageHeight
})
},
preview(e) {
const {appid, path} = e.currentTarget.dataset
// 获取当前帐号信息
......
<!--component/picNav/picNav.wxml-->
<view class="pic-nav">
<block wx:for="{{picNav}}" wx:key="{{index}}" wx:for-item="item" class="pic-content">
<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>
<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>
</block>
</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 @@
}
.pic-item {
flex: 1;
height: 200rpx;
/* border-radius:10rpx; */
}
.pic-item:first-child image{
height: 100% !important;
}
.pic-img {
height: 100%;
width: 100%;
}
\ No newline at end of file
}
/* .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({
wx.showLoading({
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
if(result == 0){
wx.hideLoading()
......
......@@ -5,21 +5,21 @@
<!--{{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}}" />
</view>
<!-- 个人中心 {{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}}"/>
</view>
<!-- 图片导航 {{pItem.navigation.images}}-->
<view class="images-tab pd1530" wx:if="{{pItem.type == 3}}">
<!-- 图片导航 {{pItem.navigation.images}} pd1530-->
<view class="pd1530" wx:if="{{pItem.type == 3}}">
<pic-nav pic-nav="{{pItem.navigation.images}}" />
</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">
<text class="footer-arrow" style="color:{{pItem.bottom.fontColor}}"><<</text>
<text class='footer-text' style="color:{{pItem.bottom.fontColor}}">{{pItem.bottom.title}}</text>
......
......@@ -47,6 +47,34 @@ function getAccountInfo() {
return accountInfo
}
/**
* 图片宽高比
*/
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) {
return wxService.post(`/member/minaLogin`, {
code: res[1].code,
wechatInfo: res[0],
// brandId: 2005,
brandId: 1001,
brandId: 2005,
// brandId: 1001,
})
}, (err) => {
return Promise.reject(err)
......@@ -277,5 +305,6 @@ module.exports = {
getTouchData,
getAccountInfo,
aspectRatio,
imageUtil
// 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