| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- {extend name="public/base"/}
- {block name="css"}
- <style>
- .bottom-button {
- width: 160px;
- height: 40px;
- }
- .van-cell {
- flex-wrap:wrap;
- }
- .cell-extra {
- width:100%;
- text-align:right;
- }
- .cell-extra button {
- margin-right:5px;
- }
- .plus {
- margin-top:20px;
- }
- .plus .plus-icon {
- margin:0 auto;
- width:60px;
- height:60px;
- border-radius:50%;
- background:white;
- display:flex;
- justify-content:center;
- align-items:center;
- font-size:30px;
- }
- </style>
- {/block}
- {block name="body"}
- <van-nav-bar
- class="nav-theme"
- :fixed="true"
- :placeholder="true"
- right-text="类别说明"
- @click-right="onClickRight"
- >
- <template #title>
- <span class="text-white">信息登记</span>
- </template>
- </van-nav-bar>
- <div v-if="list.length > 0">
- <van-cell-group>
- <van-cell v-for="item in list" :title="item.name" :value="item.mobile" :label="item.type_text">
- <template #extra>
- <div class="cell-extra">
- <van-button type="primary" size="small" @click="toFollow(item.id)">跟进</van-button>
- <van-button type="primary" size="small" @click="toEdit(item.id)">编辑</van-button>
- <van-button type="danger" size="small" @click="deleteItem(item.id)">删除</van-button>
- </div>
- </template>
- </van-cell>
- </van-cell-group>
- <div class="plus">
- <div class="plus-icon" @click="toAdd">
- <van-icon name="plus"></van-icon>
- </div>
- </div>
- </div>
- <van-empty v-else description="暂无信息">
- <van-button round type="danger" @click="toAdd" class="bottom-button">
- 立即添加
- </van-button>
- </van-empty>
- <van-tabbar v-model="active" :placeholder="true">
- <van-tabbar-item icon="wap-home-o" url="{:url('/')}">首页</van-tabbar-item>
- <van-tabbar-item icon="description">信息登记</van-tabbar-item>
- <van-tabbar-item icon="user-circle-o" url="{:url('my/index')}">我的</van-tabbar-item>
- </van-tabbar>
- {/block}
- {block name="script"}
- <script>
- function v_setup() {
- let base = {};
- base.active = 1;
- base.list = {$list};
- base.onClickRight = () => {
- location.href = "{:url('info/type')}";
- };
- base.toAdd = () => {
- location.href = "{:url('info/form')}";
- };
- base.toEdit = (id) => {
- location.href = "{:url('info/form')}?id=" + id;
- };
- base.toFollow = (id) => {
- location.href = "{:url('info/follow')}?id=" + id;
- };
- base.deleteItem = id => {
- vant.showConfirmDialog({
- title: '提示',
- message: '确认要删除吗?',
- }).then(() => {
- postJson("{:url('info/delete')}", {id:id}).then(function ({data}) {
- location.reload();
- });
- }).catch(error=>{});
- };
- return base;
- }
- </script>
- {/block}
|