Commit 633191d2 by 程智春

组件

parent e53352a8
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
regionName : item.regionName, regionName : item.regionName,
regionType : item.regionType, regionType : item.regionType,
systemRegionId : item.systemRegionId, systemRegionId : item.systemRegionId,
areaGroupId : item.groupId, areaGroupId : item.areaGroupId,
outId : item.outId outId : item.outId
})) }))
} }
......
...@@ -76,6 +76,16 @@ Component({ ...@@ -76,6 +76,16 @@ Component({
}) })
} }
if(!wx.getStorageSync('location')){
_this.setData({
'designateAreaObj.id': _this.data.positionCity.operatingAreaAreaId,
'designateAreaObj.regionName': _this.data.positionCity.regionName,
'designateAreaObj.regionType': _this.data.positionCity.regionType,
'designateAreaObj.systemRegionId': _this.data.positionCity.systemRegionId,
'designateAreaObj.outId': _this.data.positionCity.outId,
})
}
console.log(_this.data.positionCity, '定位城市信息') console.log(_this.data.positionCity, '定位城市信息')
console.log(_this.data.designateAreaObj, '组件信息') console.log(_this.data.designateAreaObj, '组件信息')
...@@ -85,11 +95,12 @@ Component({ ...@@ -85,11 +95,12 @@ Component({
regionType: _this.data.positionCity.regionType, regionType: _this.data.positionCity.regionType,
systemRegionId: _this.data.positionCity.systemRegionId, systemRegionId: _this.data.positionCity.systemRegionId,
outId: _this.data.positionCity.outId, outId: _this.data.positionCity.outId,
areaGroupId: _this.data.positionCity.areaGroupId, areaGroupId: _this.data.designateAreaObj.areaGroupId,
}) })
console.log(str, 'str.......') console.log(str, 'str.......')
wx.setStorageSync('location', str) wx.setStorageSync('location', str)
if (_this.data.positionCity.operatingAreaAreaId == _this.data.designateAreaObj.id) { if (_this.data.positionCity.operatingAreaAreaId == _this.data.designateAreaObj.id) {
_this.setData({ _this.setData({
positionName: _this.data.positionCity.regionName positionName: _this.data.positionCity.regionName
...@@ -280,7 +291,7 @@ Component({ ...@@ -280,7 +291,7 @@ Component({
changeOtherCity(){ changeOtherCity(){
console.log(getCurrentPages()) console.log(getCurrentPages())
wx.navigateTo({ wx.navigateTo({
url: '/pages/changeAdr/main?areaGroupId=' + this.data.datas.componentData.designateAreaObj.areaGroupId, url: '/pages/changeAdr/main?areaGroupId=' + this.data.designateAreaObj.areaGroupId,
}) })
}, },
toSearchPage(){ toSearchPage(){
......
...@@ -39,6 +39,10 @@ Component({ ...@@ -39,6 +39,10 @@ Component({
let _this = this; let _this = this;
let columnWidthArr = ['100%', '50%', '33.3%', '25%', '20%', '16.6%'] let columnWidthArr = ['100%', '50%', '33.3%', '25%', '20%', '16.6%']
this.data.datas.componentData.imgList.forEach(item => {
item.imageUrl = item.imageUrl ? app.DFSImg(item.imageUrl,400,400) : ''
})
this.setData({ this.setData({
imgList: this.data.datas.componentData.imgList.filter(item => item.visible == undefined || item.visible == 1), imgList: this.data.datas.componentData.imgList.filter(item => item.visible == undefined || item.visible == 1),
getColumnWidth: columnWidthArr[this.data.datas.componentData.columnNum - 1], getColumnWidth: columnWidthArr[this.data.datas.componentData.columnNum - 1],
...@@ -65,26 +69,26 @@ Component({ ...@@ -65,26 +69,26 @@ Component({
if (res) { if (res) {
if (_this.data.datas.componentData.rowNum == 1){ if (_this.data.datas.componentData.rowNum == 1){
_this.setData({ _this.setData({
cube3H: res.height * 2 * _this.data.datas.componentData.rowNum cube3H: res.height * _this.data.datas.componentData.rowNum
}) })
} else if (_this.data.datas.componentData.rowNum == 2){ } else if (_this.data.datas.componentData.rowNum == 2){
if(_this.data.imgList.length / _this.data.datas.componentData.columnNum > 1){ if(_this.data.imgList.length / _this.data.datas.componentData.columnNum > 1){
_this.setData({ _this.setData({
cube3H: res.height * 2 * _this.data.datas.componentData.rowNum cube3H: res.height * _this.data.datas.componentData.rowNum
}) })
}else{ }else{
_this.setData({ _this.setData({
cube3H: res.height * 2 * 1 cube3H: res.height * 1
}) })
} }
} else if (_this.data.datas.componentData.rowNum == 3){ } else if (_this.data.datas.componentData.rowNum == 3){
if (_this.data.datas.componentData.columnNum == 1){ if (_this.data.datas.componentData.columnNum == 1){
_this.setData({ _this.setData({
cube3H: res.height * 2 * (_this.data.imgList / _this.data.datas.componentData.rowNum) cube3H: res.height * (_this.data.imgList / _this.data.datas.componentData.rowNum)
}) })
}else{ }else{
_this.setData({ _this.setData({
cube3H: res.height * 2 * (Math.ceil(_this.data.imgList.length / _this.data.datas.componentData.columnNum)) cube3H: res.height * (Math.ceil(_this.data.imgList.length / _this.data.datas.componentData.columnNum))
}) })
} }
...@@ -128,9 +132,11 @@ Component({ ...@@ -128,9 +132,11 @@ Component({
wArr[_this.data.datas.componentData.columnNum - 1] wArr[_this.data.datas.componentData.columnNum - 1]
}) })
} }
_this.setData({ _this.setData({
w: wArr[_this.data.datas.componentData.columnNum - 1] w: wArr[_this.data.datas.componentData.columnNum - 1]
}) })
console.log(_this.data.w)
if (_this.data.wrapW > cube2W) { if (_this.data.wrapW > cube2W) {
_this.setData({ _this.setData({
navShow: true navShow: true
......
...@@ -7,20 +7,20 @@ ...@@ -7,20 +7,20 @@
<image wx:if="{{item.imageUrl}}" src="{{item.imageUrl}}"></image> <image wx:if="{{item.imageUrl}}" src="{{item.imageUrl}}"></image>
</view> </view>
</view> </view>
<view class="item-title" style="font-size:{{datas.componentData.textSize * 2}}rpx;color:{{datas.componentData.fontColor}};height:{{datas.componentData.textSize / 12}}em;line-hieght:{{datas.componentData.textSize / 12}}em">{{ item.title }}</view> <view class="item-title" style="font-size:{{datas.componentData.textSize * 2}}rpx;color:{{datas.componentData.fontColor}};height:{{datas.componentData.textSize / 12}}em;line-height:{{datas.componentData.textSize / 12}}em">{{ item.title }}</view>
</view> </view>
</view> </view>
<view wx:if="{{datas.componentData.layoutType == 1}}" style="position:relative;background-color:{{datas.componentData.backgroundColor || ''}};border-radius:{{datas.componentData.moduleRadius * 2}}rpx;padding-bottom:{{navShow ? '20rpx' : '0'}}"> <view wx:if="{{datas.componentData.layoutType == 1}}" style="position:relative;background-color:{{datas.componentData.backgroundColor || ''}};border-radius:{{datas.componentData.moduleRadius}}px;padding-bottom:{{navShow ? '10px' : '0'}}">
<view class="cube2 clearfix" style="overflow-x:auto;overflow-y:hidden" bindtouchmove="touchmove"> <view class="cube2 clearfix" style="overflow-x:auto;overflow-y:hidden" bindtouchmove="touchmove">
<view class="clearfix" style="width:{{wrapW * 2}}rpx" id="wrapW"> <view class="clearfix" style="width:{{wrapW}}px" id="wrapW">
<view class="cube-item" wx:for="{{imgList}}" style="padding-top:{{datas.componentData.lineHeight * 2}}rpx;padding-bottom:{{datas.componentData.lineHeight *2}}rpx;width:{{w * 2}}rpx;position:relative" bindtap="onclickHandle" data-item="{{item}}"> <view class="cube-item" wx:for="{{imgList}}" style="padding-top:{{datas.componentData.lineHeight}}px;padding-bottom:{{datas.componentData.lineHeight}}px;width:{{w}}px;position:relative" bindtap="onclickHandle" data-item="{{item}}">
<view style="padding-left:{{getImgSize}}%;padding-right:{{getImgSize}}%"> <view style="padding-left:{{getImgSize}}%;padding-right:{{getImgSize}}%">
<view class="item-img {{item.imageUrl == '' ? 'item-bg' : ''}}"> <view class="item-img {{item.imageUrl == '' ? 'item-bg' : ''}}">
<image wx:if="{{item.imageUrl}}" src="{{item.imageUrl}}"></image> <image wx:if="{{item.imageUrl}}" src="{{item.imageUrl}}"></image>
</view> </view>
</view> </view>
<view class="item-title" style="font-size:{{datas.componentData.textSize * 2}}rpx;color:{{datas.componentData.fontColor}};height:{{datas.componentData.textSize / 12}}em;line-hieght:{{datas.componentData.textSize / 12}}em">{{item.title}} <view class="item-title" style="font-size:{{datas.componentData.textSize}}px;color:{{datas.componentData.fontColor}}">{{item.title}}
</view> </view>
</view> </view>
</view> </view>
...@@ -33,16 +33,16 @@ ...@@ -33,16 +33,16 @@
</view> </view>
<view class="cube3 clearfix" wx:if="{{datas.componentData.layoutType == 2}}" style="background-color:{{datas.componentData.backgroundColor || ''}};border-radius:{{datas.componentData.moduleRadius * 2}}rpx;"> <view class="cube3 clearfix" wx:if="{{datas.componentData.layoutType == 2}}" style="background-color:{{datas.componentData.backgroundColor || ''}};border-radius:{{datas.componentData.moduleRadius}}px;">
<swiper indicator-dots="{{true}}" style="height:{{cube3H}}rpx"> <swiper indicator-dots="{{true}}" style="height:{{cube3H}}px">
<swiper-item wx:for="{{swiperList}}" style="width:{{swiperItemW*2}}rpx"> <swiper-item wx:for="{{swiperList}}" style="width:{{swiperItemW}}px">
<view class="cube-item" style="padding-top:{{datas.componentData.lineHeight * 2}}rpx;padding-bottom:{{datas.componentData.lineHeight * 2}}rpx;width:{{getColumnWidth}};position:relative" wx:for-item="item1" wx:for="{{item}}" data-item="{{item1}}" bindtap="onclickHandle"> <view class="cube-item" style="padding-top:{{datas.componentData.lineHeight}}px;padding-bottom:{{datas.componentData.lineHeight}}px;width:{{getColumnWidth}};position:relative" wx:for-item="item1" wx:for="{{item}}" data-item="{{item1}}" bindtap="onclickHandle">
<view style="padding-left:{{getImgSize}}%;padding-right:{{getImgSize}}%"> <view style="padding-left:{{getImgSize}}%;padding-right:{{getImgSize}}%">
<view class="item-img {{item1.imageUrl == '' ? 'item-bg' : ''}}"> <view class="item-img {{item1.imageUrl == '' ? 'item-bg' : ''}}">
<image wx:if="{{item1.imageUrl}}" src="{{item1.imageUrl}}"></image> <image wx:if="{{item1.imageUrl}}" src="{{item1.imageUrl}}"></image>
</view> </view>
</view> </view>
<view class="item-title" style="font-size:{{datas.componentData.textSize * 2}}rpx;color:{{datas.componentData.fontColor}};height:{{textSize / 12}}em;line-hieght:{{textSize / 12}}em">{{item1.title}} <view class="item-title" style="font-size:{{datas.componentData.textSize}}px;color:{{datas.componentData.fontColor}}">{{item1.title}}
</view> </view>
</view> </view>
</swiper-item> </swiper-item>
......
<!--static/nativeComponents/FloatButton/index.wxml--> <!--static/nativeComponents/FloatButton/index.wxml-->
<movable-area class="float-botton"> <movable-area class="float-botton">
<movable-view class="movable-view {{datas.componentData.style==0 ? 'icon-class':'img-class'}}" direction="all" style="width:{{datas.componentData['sizeInfo']['width']/12}}em;height:{{datas.componentData['sizeInfo']['width']/12}}em;top:{{datas.componentData['position']['y']}}em;left:{{datas.componentData['position']['y']}}em;background-color:{{datas.componentData.style==0?datas.componentData['backgroundColor']:'transparent'}};box-shadow:{{(datas.componentData.style==0 && datas.componentData.boxShadow)?'rgba(0, 0, 0, 0.5) 0px 0px 10rpx':'none'}}" bindtap="clickHandler"> <movable-view class="movable-view {{datas.componentData.style==0 ? 'icon-class':'img-class'}}" direction="all" style="width:{{datas.componentData['sizeInfo']['width'] * 2}}rpx;height:{{datas.componentData['sizeInfo']['width'] *2}}rpx;top:{{datas.componentData['position']['y'] * 12 * 2}}rpx;left:{{datas.componentData['position']['x'] * 12 * 2}}rpx;background-color:{{datas.componentData.style==0?datas.componentData['backgroundColor']:'transparent'}};box-shadow:{{(datas.componentData.style==0 && datas.componentData.boxShadow)?'rgba(0, 0, 0, 0.5) 0px 0px 10rpx':'none'}}" bindtap="clickHandler">
<view wx:if="{{datas.componentData.style==0}}" class="content"> <view wx:if="{{datas.componentData.style==0}}" class="content">
<view wx:if="{{datas.componentData.icon.type==1}}"> <view wx:if="{{datas.componentData.icon.type==1}}">
<i <i
......
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