index.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. {extend name="public/base"/}
  2. {block name="css"}
  3. <style>
  4. .bottom-button {
  5. width: 160px;
  6. height: 40px;
  7. }
  8. .van-cell {
  9. flex-wrap:wrap;
  10. }
  11. .cell-extra {
  12. width:100%;
  13. text-align:right;
  14. }
  15. .cell-extra button {
  16. margin-right:5px;
  17. }
  18. .plus {
  19. margin-top:20px;
  20. }
  21. .plus .plus-icon {
  22. margin:0 auto;
  23. width:60px;
  24. height:60px;
  25. border-radius:50%;
  26. background:white;
  27. display:flex;
  28. justify-content:center;
  29. align-items:center;
  30. font-size:30px;
  31. }
  32. </style>
  33. {/block}
  34. {block name="body"}
  35. <van-nav-bar
  36. class="nav-theme"
  37. :fixed="true"
  38. :placeholder="true"
  39. right-text="类别说明"
  40. @click-right="onClickRight"
  41. >
  42. <template #title>
  43. <span class="text-white">信息登记</span>
  44. </template>
  45. </van-nav-bar>
  46. <div v-if="list.length > 0">
  47. <van-cell-group>
  48. <van-cell v-for="item in list" :title="item.name" :value="item.mobile" :label="item.type_text">
  49. <template #extra>
  50. <div class="cell-extra">
  51. <van-button type="primary" size="small" @click="toFollow(item.id)">跟进</van-button>
  52. <van-button type="primary" size="small" @click="toEdit(item.id)">编辑</van-button>
  53. <van-button type="danger" size="small" @click="deleteItem(item.id)">删除</van-button>
  54. </div>
  55. </template>
  56. </van-cell>
  57. </van-cell-group>
  58. <div class="plus">
  59. <div class="plus-icon" @click="toAdd">
  60. <van-icon name="plus"></van-icon>
  61. </div>
  62. </div>
  63. </div>
  64. <van-empty v-else description="暂无信息">
  65. <van-button round type="danger" @click="toAdd" class="bottom-button">
  66. 立即添加
  67. </van-button>
  68. </van-empty>
  69. <van-tabbar v-model="active" :placeholder="true">
  70. <van-tabbar-item icon="wap-home-o" url="{:url('/')}">首页</van-tabbar-item>
  71. <van-tabbar-item icon="description">信息登记</van-tabbar-item>
  72. <van-tabbar-item icon="user-circle-o" url="{:url('my/index')}">我的</van-tabbar-item>
  73. </van-tabbar>
  74. {/block}
  75. {block name="script"}
  76. <script>
  77. function v_setup() {
  78. let base = {};
  79. base.active = 1;
  80. base.list = {$list};
  81. base.onClickRight = () => {
  82. location.href = "{:url('info/type')}";
  83. };
  84. base.toAdd = () => {
  85. location.href = "{:url('info/form')}";
  86. };
  87. base.toEdit = (id) => {
  88. location.href = "{:url('info/form')}?id=" + id;
  89. };
  90. base.toFollow = (id) => {
  91. location.href = "{:url('info/follow')}?id=" + id;
  92. };
  93. base.deleteItem = id => {
  94. vant.showConfirmDialog({
  95. title: '提示',
  96. message: '确认要删除吗?',
  97. }).then(() => {
  98. postJson("{:url('info/delete')}", {id:id}).then(function ({data}) {
  99. location.reload();
  100. });
  101. }).catch(error=>{});
  102. };
  103. return base;
  104. }
  105. </script>
  106. {/block}