|
@@ -0,0 +1,248 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="user-index">
|
|
|
|
+ <div class="user-header">
|
|
|
|
+ <el-input class="search" v-model="input" placeholder="搜索">
|
|
|
|
+ <template #prefix>
|
|
|
|
+ <el-icon><search /></el-icon>
|
|
|
|
+ </template>
|
|
|
|
+ </el-input>
|
|
|
|
+ <div class="button" @click="handleAddClient">
|
|
|
|
+ <img src="@/assets/img/mine/firend-icon.png" alt="" />
|
|
|
|
+ 新增客户
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="list">
|
|
|
|
+ <collapse v-model="activeNames">
|
|
|
|
+ <collapse-item :name="index" v-for="(item, index) in list" :key="index" :is-link="false">
|
|
|
|
+ <template #title>
|
|
|
|
+ <el-icon class="icon"><CaretRight /></el-icon>
|
|
|
|
+ {{ item.name }}
|
|
|
|
+ <span class="span">{{ item.children.length }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ <template #value>
|
|
|
|
+ <div @click.stop="hadnleManage(item)" class="text">管理</div>
|
|
|
|
+ </template>
|
|
|
|
+ <div class="list-item" v-for="(ele, idx) in item.children" :key="idx + ele.id">
|
|
|
|
+ <div class="item-flex">
|
|
|
|
+ <img class="photo" src="" alt="" />
|
|
|
|
+ <div class="item-text">
|
|
|
|
+ <div class="name">
|
|
|
|
+ <span>农场111</span>
|
|
|
|
+ <el-icon color="#2199F8" size="16"><Edit /></el-icon>
|
|
|
|
+ </div>
|
|
|
|
+ <div>农场品种:荔枝-桂味</div>
|
|
|
|
+ <div>农场面积:190亩</div>
|
|
|
|
+ <div>农场位置:湖北省武汉市富里唱鑫园5023</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </collapse-item>
|
|
|
|
+ </collapse>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="footer">
|
|
|
|
+ <div class="btn" @click="showPopup">新建分组</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 添加分组弹窗 -->
|
|
|
|
+ <add-popup :show="showGroupPopup"></add-popup>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script setup>
|
|
|
|
+import { Collapse, CollapseItem } from "vant";
|
|
|
|
+import { ref } from "vue";
|
|
|
|
+import { useRouter } from "vue-router";
|
|
|
|
+import addPopup from "./components/addPopup.vue";
|
|
|
|
+const router = useRouter();
|
|
|
|
+
|
|
|
|
+const input = ref("");
|
|
|
|
+//新建分组
|
|
|
|
+const showGroupPopup = ref(false);
|
|
|
|
+const showPopup = () => {
|
|
|
|
+ showGroupPopup.value = !showGroupPopup.value;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+// 新增客户
|
|
|
|
+const handleAddClient = () => {
|
|
|
|
+ router.push("/create_farm?type=client");
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+// 管理
|
|
|
|
+const hadnleManage = (value) => {
|
|
|
|
+ router.push(`/manage?name=${value.name}&total=${value.children.length}&isGroup=${value.isGroup}`);
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const list = ref([
|
|
|
|
+ {
|
|
|
|
+ name: "常用列表",
|
|
|
|
+ id: "1",
|
|
|
|
+ isGroup: 0,
|
|
|
|
+ children: [
|
|
|
|
+ {
|
|
|
|
+ id: "3",
|
|
|
|
+ name: "糯米糍",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: "4",
|
|
|
|
+ name: "桂味",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: "未分组标签好友",
|
|
|
|
+ id: "2",
|
|
|
|
+ isGroup: 1,
|
|
|
|
+ children: [
|
|
|
|
+ {
|
|
|
|
+ id: "5",
|
|
|
|
+ name: "井冈红糯",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: "6",
|
|
|
|
+ name: "测试",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: "其他列表",
|
|
|
|
+ id: "3",
|
|
|
|
+ children: [],
|
|
|
|
+ },
|
|
|
|
+]);
|
|
|
|
+
|
|
|
|
+const activeNames = ref([0]);
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+.user-index {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100vh;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ padding: 10px 12px;
|
|
|
|
+ background: #f5f7fb;
|
|
|
|
+ .user-header {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ .search {
|
|
|
|
+ width: 90px;
|
|
|
|
+ margin-right: 10px;
|
|
|
|
+ --el-input-placeholder-color: rgba(0, 0, 0, 0.5);
|
|
|
|
+ ::v-deep {
|
|
|
|
+ .el-input__wrapper {
|
|
|
|
+ box-shadow: none;
|
|
|
|
+ border: 1px solid rgba(0, 0, 0, 0.5);
|
|
|
|
+ background: transparent;
|
|
|
|
+ border-radius: 20px;
|
|
|
|
+ }
|
|
|
|
+ .el-input__prefix,
|
|
|
|
+ .el-input__inner {
|
|
|
|
+ color: #000;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .button {
|
|
|
|
+ width: calc(100% - 100px);
|
|
|
|
+ background: #fff;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ padding: 8px;
|
|
|
|
+ border-radius: 20px;
|
|
|
|
+ img {
|
|
|
|
+ width: 20px;
|
|
|
|
+ height: 17px;
|
|
|
|
+ margin-right: 6px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .list {
|
|
|
|
+ width: 100%;
|
|
|
|
+ margin-top: 12px;
|
|
|
|
+ .text {
|
|
|
|
+ color: #2199F8;
|
|
|
|
+ }
|
|
|
|
+ ::v-deep {
|
|
|
|
+ .van-cell {
|
|
|
|
+ border-radius: 5px 5px 0 0;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ .van-cell__value {
|
|
|
|
+ flex: none;
|
|
|
|
+ }
|
|
|
|
+ .van-cell__title {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ .icon {
|
|
|
|
+ margin-right: 3px;
|
|
|
|
+ color: #bfbfbf;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ }
|
|
|
|
+ .span {
|
|
|
|
+ color: rgba(0, 0, 0, 0.4);
|
|
|
|
+ margin-left: 10px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .van-collapse-item__title--expanded {
|
|
|
|
+ .van-cell__title {
|
|
|
|
+ .icon {
|
|
|
|
+ transform: rotate(90deg);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .van-collapse-item + .van-collapse-item {
|
|
|
|
+ margin-top: 12px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .list-item {
|
|
|
|
+ border-radius: 12px;
|
|
|
|
+ background: #fff;
|
|
|
|
+ position: relative;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ align-items: center;
|
|
|
|
+ .item-flex {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ }
|
|
|
|
+ .photo {
|
|
|
|
+ width: 68px;
|
|
|
|
+ height: 68px;
|
|
|
|
+ border-radius: 8px;
|
|
|
|
+ margin-right: 12px;
|
|
|
|
+ background: red;
|
|
|
|
+ }
|
|
|
|
+ .item-text {
|
|
|
|
+ color: #999999;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ line-height: 1.6;
|
|
|
|
+ .name {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ span {
|
|
|
|
+ font-size: 15px;
|
|
|
|
+ color: #000;
|
|
|
|
+ font-weight: 500;
|
|
|
|
+ margin-right: 5px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .list-item + .list-item {
|
|
|
|
+ margin-top: 12px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .footer {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: center;
|
|
|
|
+ margin-top: 12px;
|
|
|
|
+ .btn {
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ color: #7f7f7f;
|
|
|
|
+ padding: 5px 45px;
|
|
|
|
+ background: rgba(201, 201, 201, 0.27);
|
|
|
|
+ border-radius: 20px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|