-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from chengdujs/develop
update from develop
- Loading branch information
Showing
16 changed files
with
4,955 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.