Skip to content

Commit

Permalink
Merge pull request #6 from chengdujs/develop
Browse files Browse the repository at this point in the history
update from develop
  • Loading branch information
MrTreasure authored Jan 24, 2017
2 parents 2a016cb + 90f3fd2 commit cb756be
Show file tree
Hide file tree
Showing 16 changed files with 4,955 additions and 14 deletions.
37 changes: 37 additions & 0 deletions src/components/filterSearch/filter-item.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<template>
<div class="weui-cell y-filter__item" >
<div class="weui-cell__hd">
<span class="y-filter__item" v-text="option.name"></span>
</div>
<div class="weui-cell__bd">
<a :class="{'y-filter__item--title':true,'chosen':curIndex == $index}"
href="javascript:;" v-for="(details,$index) in option.items"
@click="detailAction(option.id,$index)">{{details.label}}
</a>
</div>
</div>
</template>
<script>
export default{
props: {
option: Object,
index: Number
},
data() {
return {
curIndex: 0
}
},
created() {
this.curIndex = this.index;
},
methods: {
detailAction(id, index) {
this.curIndex = index;
this.$emit('changeIndex', id, index)
}
},
components: {
}
}
</script>
100 changes: 100 additions & 0 deletions src/components/filterSearch/filter-search.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<template>
<div class="weui-cells y-filter__wrapper">
<filter-item :index=0 :option="opt" v-for="(opt,index) in filterData" @changeIndex="changed"></filter-item>
</div>
</template>
<script>
import filterItem from './filter-item'
export default{
data() {
return {
filterData: [],
activeObj: {},
curRowId: ''
}
},
props: {
optionData: {
type: Array,
default() {
return []
}
}
},
create() {
},
watch: {
optionData: {
handler(newVal) {
if (newVal && newVal.length) {
this.filterData = newVal;
this.initActiveObj(newVal);
}
}
}
},
computed: {
},
methods: {
initActiveObj(data) {
data.forEach(({id}) => {
this.$set(this.activeObj, id, 0);
})
},
changed(id, index) {
this.activeObj[id] = index;
},
getValue() {
let result = [];
for (let id in this.activeObj) {
let value = this.activeObj[id]
result.push({
id,
value
})
}
return result
}
},
components: {
filterItem
}
}
</script>
<style>
.y-filter__item {
padding: 6px 16px;
color: #555;
font-size :14px;
}
.y-filter__item span {
font-weight: 600;
margin-right: -5px;
}
.y-filter__item--title, .y-filter__wrapper a {
float: left;
margin-right: 5px;
padding: 5px 8px;
height: 14px;
line-height: 14px;
}
.y-filter__wrapper a {
color: #555;
text-decoration: none;
font-size : 12px;
}
.y-filter__wrapper a:hover{
background-color: #00b38a;
color: #fff;
}
.y-filter__wrapper .chosen{
background-color: #00b38a;
color: #fff;
}
</style>
41 changes: 41 additions & 0 deletions src/components/filterSearch/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* Created by yelingfeng on 17/1/16.
*
* 数据格式
const filterData = [
{
name: '工作经验',
items: [
{label: '应届毕业生', value: '001'},
{label: '3年以下', value: '002'},
{label: '3-5年', value: '003'},
{label: '5-10年', value: '004'},
{label: '10年以上', value: '005'}
]
},
{
name: '学历要求',
items: [
{label: '大专', value: '001'},
{label: '本科', value: '002'},
{label: '硕士', value: '003'},
{label: '博士', value: '004'}
]
},
{
name: '行业领域',
items: [
{label: '移动互联网', value: '001'},
{label: '电子商务', value: '002'},
{label: '金融', value: '003'},
{label: '教育', value: '004'}
]
}
]**
*
*/
import filterSearch from './filter-search'

export {
filterSearch
};
10 changes: 10 additions & 0 deletions src/css/all.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
body{
font-family: '\5FAE\8F6F\96C5\9ED1';
background:#e5e5e5;
}
a{
color:#333;
}
a:hover{
color:#f00;
}
27 changes: 25 additions & 2 deletions src/pages/TestPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,27 @@
<vw-button @click="onClick" :disabled="disabled" :mini="mini" :type="type" :plain="plain"><i class="ion-help-buoy"></i>页面操作</vw-button>
<hr>
<vw-button @click="showToast()">Toast</vw-button>
<hr> {{sv}}
<vw-slider :show-value="true" v-model="sv"></vw-slider>
<br><br>
<vw-swipe>
<vw-swipe-item>
<a href="">
<img src="http://7xr193.com1.z0.glb.clouddn.com/3.jpg" alt="">
</a>
</vw-swipe-item>
<vw-swipe-item>
<a href="">
<img src="http://7xr193.com1.z0.glb.clouddn.com/2.jpg" alt="">
</a>

</vw-swipe-item>
<vw-swipe-item>
<a href="">
<img src="http://7xr193.com1.z0.glb.clouddn.com/1.jpg" alt="">
</a>
</vw-swipe-item>
</vw-swipe>
<vw-tabbar v-model="selected">
<vw-tab-item label="首页" value="tab1">
<i slot="icon" class="ion-home">
Expand All @@ -33,7 +54,8 @@
plain: false,
disabled: false,
mini: false,
selected: 'tab1'
selected: 'tab1',
sv: 50
};
},
methods: {
Expand All @@ -42,9 +64,10 @@
console.log(e);
},
showToast() {
this.$toast.msg('已完成呵呵', { duration: 300000, icon: 'success' }, () => {
this.$toast.msg('已完成呵呵', { duration: 3000, icon: 'success' }, () => {
console.log('close');
});
this.$toptip.tip('xxxxxxxxxxxxxxxxxxx');
}
}
};
Expand Down
29 changes: 26 additions & 3 deletions src/pages/home/HomePage.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<template>
<div class="invite-hot">
<vw-actionsheet :model="isFilterSearch" @handler="handlerActionSheet">
<filterSearch ref="filter" :optionData="filterData"></filterSearch>
</vw-actionsheet>
<div class="job-header primary">
<div class="job-header__search">
<div class="job-header__search" @click="searchOnClick">
<i class="icon ion-ios-search-strong"></i>
<span class="txt">请输入职位/地址/关键字</span>
</div>
Expand All @@ -19,24 +22,44 @@
</template>
<script>
import { jobInfo, jobSplit } from 'components';
import { filterSearch } from 'components/filterSearch';
import { ajax } from 'common';
export default {
components: {
jobInfo,
jobSplit
jobSplit,
filterSearch
},
data() {
return {
jobs: []
jobs: [],
filterData: [],
isFilterSearch: false
};
},
methods: {
searchOnClick() {
this.isFilterSearch = !this.isFilterSearch;
},
handlerActionSheet(arg) {
let d = this.$refs.filter.getValue();
console.log(d)
this.isFilterSearch = false;
}
},
created() {
ajax.get(`${window.AppConf.apiHost}/recommendation_list`)
.then(data => {
if (data.state === 1) {
this.jobs = data.data;
}
});
ajax.get(`${window.AppConf.apiHost}/getFilterSearchData`)
.then(resp => {
this.filterData = resp.result;
});
}
};
</script>
Expand Down
56 changes: 55 additions & 1 deletion src/pages/my/MyPage.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,59 @@
<template>
<div class="page-my">
<h1>My</h1>
<my-info :my-info-data="myInfoData"></my-info>
<my-control :my-control-data="myControlData"></my-control>
</div>
</template>
<script>
import { ajax } from 'common';
import myInfo from './my-info';
import myControl from './my-control';
export default {
components: {
myInfo,
myControl
},
data() {
return {
myInfoData: {},
myControlData: {}
}
},
created() {
this._setData()
},
methods: {
_setData() {
ajax.get(`${window.AppConf.apiHost}/my/myInfo`)
.then(data => {
if (data.status === '1') {
this.myInfoData = data.results;
}
}, () => {
this.myInfoData = null;
});
ajax.get(`${window.AppConf.apiHost}/my/myControl`)
.then(data => {
if (data.status === '1') {
this.myControlData = data.results;
}
}, () => {
this.myControlData = null;
});
}
}
}
</script>
<style>
.my-login-status{
padding: 15px 40px;
height: 50px;
line-height: 50px;
background: #fff;
display: none;
}
</style>
Loading

0 comments on commit cb756be

Please sign in to comment.