更换版本
This commit is contained in:
52
packageA/pages/caresgz/selectCity/selectCity.js
Normal file
52
packageA/pages/caresgz/selectCity/selectCity.js
Normal file
@@ -0,0 +1,52 @@
|
||||
var t;
|
||||
(t = getApp()),
|
||||
Page({
|
||||
data: {
|
||||
winHeight: 0,
|
||||
tHeight: 0,
|
||||
bHeight: 0,
|
||||
startPageY: 0,
|
||||
scrollTop: 0,
|
||||
two_none: "none",
|
||||
hasback: "none",
|
||||
prov_list: [],
|
||||
city_list: [],
|
||||
},
|
||||
onLoad: function () {
|
||||
var a = this;
|
||||
wx.showLoading({ title: "请求中" }),
|
||||
t.getdata("", "carcity").then((t) => {
|
||||
var e = t.data;
|
||||
console.log("回调数据汽车:", e),
|
||||
(e = JSON.parse(e)),
|
||||
a.setData({ prov_list: e.data });
|
||||
});
|
||||
var e = wx.getSystemInfoSync().windowHeight;
|
||||
a.setData({ winHeight: e });
|
||||
},
|
||||
btn_pinpai: function (a) {
|
||||
var e = this,
|
||||
n = a.currentTarget.dataset.item;
|
||||
wx.setStorageSync("carprov", n);
|
||||
var o = { provinceId: n.id };
|
||||
t.getdata(o, "carprovinceId").then((t) => {
|
||||
var a = t.data;
|
||||
console.log("回调数据汽车:", a),
|
||||
(a = JSON.parse(a)),
|
||||
e.setData({ two_none: "block", hasback: "block", city_list: a.data });
|
||||
});
|
||||
},
|
||||
btn_sel_name: function (t) {
|
||||
var a = t.currentTarget.dataset.item;
|
||||
console.log(a),
|
||||
wx.setStorageSync("carcity", a),
|
||||
wx.navigateBack({ delta: 1 });
|
||||
},
|
||||
goback: function () {
|
||||
"block" == this.data.three_none
|
||||
? this.setData({ three_none: "none" })
|
||||
: "block" == this.data.two_none
|
||||
? this.setData({ two_none: "none", hasback: "none" })
|
||||
: this.setData({ hasback: "none" });
|
||||
},
|
||||
});
|
||||
3
packageA/pages/caresgz/selectCity/selectCity.json
Normal file
3
packageA/pages/caresgz/selectCity/selectCity.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
15
packageA/pages/caresgz/selectCity/selectCity.wxml
Normal file
15
packageA/pages/caresgz/selectCity/selectCity.wxml
Normal file
@@ -0,0 +1,15 @@
|
||||
<view>
|
||||
<scroll-view scrollY="true" style="height:{{winHeight}}px">
|
||||
<view class="selection" wx:for="{{prov_list}}" wx:key="index">
|
||||
<view bindtap="btn_pinpai" class="item_city" data-item="{{item}}"> {{item.name}} </view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<scroll-view class="scoll_car_service" scrollY="true" style="height:{{car_type_hight}};display:{{two_none}}">
|
||||
<view class="selection" wx:for="{{city_list}}" wx:key="index">
|
||||
<label bindtap="btn_sel_name" class="tab2" data-item="{{item}}"> {{item.name}} </label>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view bindtap="goback" class="goback" style="display:{{hasback}}">
|
||||
<text class="arrow"></text>
|
||||
</view>
|
||||
125
packageA/pages/caresgz/selectCity/selectCity.wxss
Normal file
125
packageA/pages/caresgz/selectCity/selectCity.wxss
Normal file
@@ -0,0 +1,125 @@
|
||||
.searchLetter {
|
||||
color: #666;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
justify-content: center;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
text-align: center;
|
||||
width: 40px;
|
||||
z-index: 1;
|
||||
}
|
||||
.tab2 {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
width: 560rpx;
|
||||
}
|
||||
.tab2,
|
||||
.tab3 {
|
||||
border-bottom: 1px solid #eaeaea;
|
||||
color: #2a2a2a;
|
||||
font-size: 30rpx;
|
||||
padding-left: 30rpx;
|
||||
}
|
||||
.tab3 {
|
||||
word-wrap: break-word;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
padding-bottom: 20rpx;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
.scoll_car_service {
|
||||
left: 25%;
|
||||
width: 75%;
|
||||
z-index: 5;
|
||||
}
|
||||
.scoll_car_service,
|
||||
.scoll_vender_service {
|
||||
background-color: #f5f5f5;
|
||||
box-shadow: 0 0 3px 3px #999;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 1px;
|
||||
}
|
||||
.scoll_vender_service {
|
||||
left: 50%;
|
||||
width: 50%;
|
||||
z-index: 10;
|
||||
}
|
||||
.searchLetter view {
|
||||
height: 70rpx;
|
||||
}
|
||||
.touchClass {
|
||||
color: #a56e0a;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.showSlectedLetter {
|
||||
align-items: center;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
border-radius: 10px;
|
||||
color: #fff;
|
||||
font-size: 26px;
|
||||
height: 100px;
|
||||
justify-content: center;
|
||||
left: 50%;
|
||||
margin: -50px;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
width: 100px;
|
||||
z-index: 1;
|
||||
}
|
||||
.selection,
|
||||
.showSlectedLetter {
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
}
|
||||
.selection {
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
}
|
||||
.item_letter {
|
||||
align-items: center;
|
||||
background-color: #f8f8f8;
|
||||
color: #896a0d;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
font-size: 26rpx;
|
||||
height: 30px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.item_city {
|
||||
background-color: #f5f5f5;
|
||||
border-bottom: 1px solid #eaeaea;
|
||||
color: #2a2a2a;
|
||||
font-size: 30rpx;
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.car_img {
|
||||
height: 80rpx;
|
||||
width: 100rpx;
|
||||
}
|
||||
.goback {
|
||||
border: 2rpx solid #aaa;
|
||||
border-radius: 50%;
|
||||
bottom: 60rpx;
|
||||
height: 80rpx;
|
||||
position: fixed;
|
||||
right: 40rpx;
|
||||
width: 80rpx;
|
||||
z-index: 99;
|
||||
}
|
||||
.arrow {
|
||||
border-bottom: 3px solid #999;
|
||||
border-left: 3px solid #999;
|
||||
display: block;
|
||||
height: 14px;
|
||||
margin: 24rpx 30rpx;
|
||||
transform: rotate(45deg);
|
||||
width: 14px;
|
||||
}
|
||||
Reference in New Issue
Block a user