Commit 24b6e311 by 李伟康

删除无用

1 parent bbd5a1dc
// packageEquity/pages/serviceApply/util/components/areaSelect.js
Component({
/**
* 组件的属性列表
*/
properties: {
provinceShow:Boolean,
provinceList:{
type:Array,
observer: function(val) {
this.setData({
provinceList: val
})
}
}
},
/**
* 组件的初始数据
*/
data: {
region: [0, 0, 0],//地址每列的index
regionCode: [],
provinceList: []
},
/**
* 组件的方法列表
*/
methods: {
emitHideRegion(){},
// 省市切换
bindChange(e) {
// 用于对比滑动的是哪一列数据
const val = e.detail.value
if(this.data.region[0] !== val[0]) {
// 如果滑动的是第一列数据,让二三列恢复到0
this.setData({
region: [val[0], 0, 0]
})
} else if(this.data.region[1] !== val[1]) {
// 滑动的是第二列数据
this.setData({
region: [val[0], val[1], 0]
})
} else {
this.setData({
region: e.detail.value
})
}
},
// 确定提交
comfirm() {
const {provinceList, region} = this.data
// 省市code
const provinceCode = provinceList[region[0]].addressCode
const cityCode = provinceList[region[0]].children[region[1]].addressCode
const townCode = provinceList[region[0]].children[region[1]].children[region[2]].addressCode
const codeData = [provinceCode,cityCode,townCode]
// 省市名称
const provinceName = provinceList[region[0]].addressName
const cityName = provinceList[region[0]].children[region[1]].addressName
const townName = provinceList[region[0]].children[region[1]].children[region[2]].addressName
const provinceNameData = [provinceName,cityName,townName]
this.triggerEvent('getProvinceCode',{codeData,provinceNameData})
this.triggerEvent('cancelProvince')
},
// 取消
cancel() {
this.triggerEvent('cancelProvince')
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
.dialog_mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 10;
background: rgba(0, 0, 0, 0.5);
}
.dialog_container {
position: absolute;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 70%;
background: white;
border-radius: 40rpx 40rpx 0 0;
box-shadow: 0px -2rpx 4rpx 0px rgba(0, 0, 0, 0.06);
z-index: 9999;
}
.header {
height: 112rpx;
box-sizing: border-box;
padding: 0 32rpx;
}
.header .cancle {
font-size: 28rpx;
font-weight: 500;
color: #969799;
}
.header .title {
font-size: 32rpx;
font-weight: 500;
color: #323233;
}
.header .comfirm {
font-size: 28rpx;
font-weight: 500;
color: #8A303A;
}
.main{
height: calc(100% - 112rpx);
box-sizing: border-box;
padding: 0 32rpx;
}
.flex_scb {
display: flex;
align-items: center;
justify-content: space-between;
}
\ No newline at end of file \ No newline at end of file
<view wx:if="{{provinceShow}}" class="dialog_mask {{provinceShow?'dialog_show':''}}">
<view class="dialog_mask" bindtap="cancel"></view>
<view class="dialog_container">
<view class="header flex_scb">
<view class="cancle" bindtap="cancel">取消</view>
<view class="title">城市地区</view>
<view class="comfirm" bindtap="comfirm">确定</view>
</view>
<view class="main">
<picker-view indicator-style="height: 50px;" style="width: 100%; height: 100%;" value="{{region}}" bindchange="bindChange">
<picker-view-column>
<view wx:for="{{provinceList}}" wx:key="{{item.addressCode}}" style="line-height: 50px; text-align: center;">
{{item.addressName}}
</view>
</picker-view-column>
<picker-view-column>
<view wx:for="{{provinceList[region[0]].children}}" wx:key="{{item.addressCode}}" style="line-height: 50px; text-align: center;">
{{item.addressName}}
</view>
</picker-view-column>
<picker-view-column>
<view wx:for="{{provinceList[region[0]].children[region[1]].children}}" wx:key="{{item.addressCode}}" style="line-height: 50px; text-align: center;">
{{item.addressName}}
</view>
</picker-view-column>
</picker-view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
{ {
"navigationBarTitleText": "新建收货地址", "navigationBarTitleText": "新建收货地址",
"usingComponents":{ "usingComponents":{
"area-select":"./components/AreaSelect/index",
"gl-textarea": "/components/GlTextarea/GlTextarea" "gl-textarea": "/components/GlTextarea/GlTextarea"
} }
} }
\ No newline at end of file \ No newline at end of file
{ {
"navigationBarTitleText": "卡券详情", "navigationBarTitleText": "卡券详情",
"usingComponents": { "usingComponents": {
"coupon-item": "../components/CouponsItem/element"
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!