Commit 9673610c authored by 和慭琛's avatar 和慭琛

工龄选择页 页面搭建+交互 100%

parent 04e8acf2
...@@ -23,6 +23,10 @@ ...@@ -23,6 +23,10 @@
}, },
{ {
"path": "pages/settle/city", "path": "pages/settle/city",
"style": { "style": {
......
<template> <template>
<view class="back_view"> <view class="back_view">
选择电工工龄 <view class="item_view margin_top_30">
<text class="item_title">选择工龄</text>
</view>
<view
class="item_view"
v-for="(item,ikey) in ageList":key="ikey"
@click="itemClick(item,ikey)">
<text :class="selected_index == ikey ? 'item_title select_color' : 'item_title default_color' ">{{item.title}}</text>
</view>
<view class="bottom_view">
<view class="bottom_btn" @click="confirmClick()">
<text class="bottom_title">确定</text>
</view>
</view>
</view> </view>
</template> </template>
...@@ -8,25 +21,48 @@ ...@@ -8,25 +21,48 @@
export default { export default {
data() { data() {
return { return {
protocolContent:'' ageList:[],
selected_index:999,
selected_age:'',
} }
}, },
onLoad(e) { onLoad(e) {
if(e && e.activeService && e.activeService.length>0){ this.getAgeData()
//console.log(e.activeService)
this.activeService = e.activeService
}
}, },
methods: { methods: {
//拨打客服 点击 getAgeData: function () {
phoneCallClick: function (phone) { this.ageList = [
uni.makePhoneCall({ {'title':'1年'},
phoneNumber: phone {'title':'2年'},
}); {'title':'3年'},
{'title':'4年'},
{'title':'5年'},
]
}, },
itemClick: function (item, ikey) {
this.selected_age = item.title
this.selected_index = ikey
console.log(item.title)
console.log(ikey)
},
confirmClick: function () {
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2]; //上一个页面
prevPage.$vm.age = this.selected_age;
uni.navigateBack({
})
}
} }
...@@ -43,4 +79,56 @@ ...@@ -43,4 +79,56 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.item_view{
background-color: #FFFFFF;
width: 100%;
height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
border: 2rpx solid #F3F3F3;
}
.item_title{
font-size: 30rpx;
}
.default_color{
color: #333333;
}
.select_color{
color: #2272FF;
}
.margin_top_30{
margin-top: 30rpx;
}
.bottom_view{
width: 100%;
height: 170rpx;
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 0;
}
.bottom_btn{
background-color: #2272FF;
width: 600rpx;
height: 100rpx;
display: flex;
align-items: center;
justify-content: center;
border: 2rpx solid #999999;
}
.bottom_title{
font-size: 32rpx;
color: #FFFFFF;
}
</style> </style>
...@@ -38,7 +38,11 @@ ...@@ -38,7 +38,11 @@
</view> </view>
<view class="item_view margin_top_60" @click="ageClick()"> <view class="item_view margin_top_60" @click="ageClick()">
<text class="left_title">电工工龄</text> <text class="left_title">电工工龄</text>
<view class="click_right_view">
<image class="arrow" :src="icon_arrow" mode=""></image> <image class="arrow" :src="icon_arrow" mode=""></image>
<text class="click_right_text">{{age}}</text>
</view>
</view> </view>
<view class="notice_view"> <view class="notice_view">
<text class="notice_text">(必选项)选择你从事电工工作的工龄</text> <text class="notice_text">(必选项)选择你从事电工工作的工龄</text>
...@@ -55,9 +59,10 @@ ...@@ -55,9 +59,10 @@
export default { export default {
data() { data() {
return { return {
icon_arrow:'https://qn-static.banshouhui.com/arrow_right.png',
name:'', name:'',
phone:'', phone:'',
icon_arrow:'https://qn-static.banshouhui.com/arrow_right.png', age:'',
} }
}, },
onLoad(e) { onLoad(e) {
...@@ -67,6 +72,11 @@ ...@@ -67,6 +72,11 @@
this.activeService = e.activeService this.activeService = e.activeService
} }
}, },
onShow() {
this.checkPast()
},
methods: { methods: {
//姓名 监听 //姓名 监听
...@@ -93,8 +103,23 @@ ...@@ -93,8 +103,23 @@
uni.navigateTo({ uni.navigateTo({
url:'/pages/settle/age' url:'/pages/settle/age'
}) })
},
//必填选择
checkAll: function() {
},
checkPast: function() {
let pages = getCurrentPages();
let currPage = pages[pages.length-1];
console.log('传过来的值:')
console.log(currPage.data.age)
if (currPage.data.age.length > 0){
this.age = currPage.data.age
} }
},
...@@ -219,4 +244,17 @@ ...@@ -219,4 +244,17 @@
background-color: #2272FF; background-color: #2272FF;
} }
.click_right_view{
height: 50rpx;
display: flex;
flex-direction: row-reverse;
align-items: center;
}
.click_right_text{
margin-right: 30rpx;
font-size: 28rpx;
color: #333333;
}
</style> </style>
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