1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- @extends('app.rcstfwlt.module.layouts.main')
- @section('content')
- <div>
- <van-nav-bar @if($back == 1) left-text="返回" @click-left="onClickLeft" @endif title="晋江人才生态服务链条"></van-nav-bar>
- <form action="/">
- <van-search
- v-model="value"
- placeholder="请输入搜索关键词"
- show-action
- @search="onSearch"
- @cancel="onCancel"
- ></van-search>
- </form>
- <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
- <van-cell v-for="item in list" :key="item.id" :title="item.title" is-link :url="'{{route('rcstfwlt.detail')}}?id='+item.id" ></van-cell>
- </van-list>
- </div>
- @endsection
- @section('script')
- <script>
- new Vue({
- el: '#app',
- data: {
- list: [],
- loading: false,
- finished: false,
- value:'',
- page:1
- },
- methods: {
- onLoad() {
- this.getData();
- },
- getData(){
- let keyword = this.value,page = this.page,that = this;
- axios.post('/mobile/active/rcg/getChainList',{id:{{$id}},keyword: keyword,page:page}).then( res => {
- that.loading = false;
- if(res.data.status == 'ok'){
- let list = [],arr = res.data.data,that = this;
- for (let i = 0,len = arr.length;i < len;i++){
- let item = new Array()
- item['title'] = arr[i].title
- item['id'] = arr[i].id
- this.list.push(item)
- }
- if(res.data.count <= (this.page * 20)){
- this.finished = true;
- }else{
- this.page++
- }
- }
- });
- },
- onSearch(){
- this.page = 1;
- this.list = [];
- this.getData();
- },
- onCancel(){
- this.page = 1;
- this.list = [];
- this.getData();
- },
- onClickLeft(){
- history.back();
- }
- }
- });
- </script>
- @endsection
|