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

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

parent 04e8acf2
......@@ -16,12 +16,16 @@
},
{
"path": "pages/settle/age",
"style": {
"navigationBarTitleText": "选择电工工龄"
}
"path": "pages/settle/age",
"style": {
"navigationBarTitleText": "选择电工工龄"
}
},
},
{
"path": "pages/settle/city",
......
<template>
<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>
</template>
......@@ -8,25 +21,48 @@
export default {
data() {
return {
protocolContent:''
ageList:[],
selected_index:999,
selected_age:'',
}
},
onLoad(e) {
if(e && e.activeService && e.activeService.length>0){
//console.log(e.activeService)
this.activeService = e.activeService
}
this.getAgeData()
},
methods: {
//拨打客服 点击
phoneCallClick: function (phone) {
uni.makePhoneCall({
phoneNumber: phone
});
getAgeData: function () {
this.ageList = [
{'title':'1年'},
{'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 @@
display: flex;
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>
......@@ -38,7 +38,11 @@
</view>
<view class="item_view margin_top_60" @click="ageClick()">
<text class="left_title">电工工龄</text>
<image class="arrow" :src="icon_arrow" mode=""></image>
<view class="click_right_view">
<image class="arrow" :src="icon_arrow" mode=""></image>
<text class="click_right_text">{{age}}</text>
</view>
</view>
<view class="notice_view">
<text class="notice_text">(必选项)选择你从事电工工作的工龄</text>
......@@ -55,9 +59,10 @@
export default {
data() {
return {
icon_arrow:'https://qn-static.banshouhui.com/arrow_right.png',
name:'',
phone:'',
icon_arrow:'https://qn-static.banshouhui.com/arrow_right.png',
age:'',
}
},
onLoad(e) {
......@@ -67,6 +72,11 @@
this.activeService = e.activeService
}
},
onShow() {
this.checkPast()
},
methods: {
//姓名 监听
......@@ -93,8 +103,23 @@
uni.navigateTo({
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 @@
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>
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