|
@@ -19,11 +19,31 @@ import { requestToast } from '@designer-hub/app/src/core/utils/common'
|
|
|
import { ComponentExposed } from 'vue-component-type-helpers'
|
|
|
import { pick } from 'radash'
|
|
|
import { useFollowUp } from '../../composables/followUp'
|
|
|
+import SectionHeading from '@designer-hub/app/src/components/section-heading.vue'
|
|
|
+import { useMemberLevelsStore } from '../../store/member-levles'
|
|
|
+import { storeToRefs } from 'pinia'
|
|
|
+import { useUserStore } from '../../store'
|
|
|
|
|
|
+const userStore = useUserStore()
|
|
|
+const { userInfo, isAgent, isMerchant } = storeToRefs(userStore)
|
|
|
const searchText = ref('')
|
|
|
const publishState = ref(false)
|
|
|
+const filterState = ref(false)
|
|
|
const pageHelperRef = ref<ComponentExposed<typeof PageHelperEvo>>()
|
|
|
const { schema, rules } = useFollowUp()
|
|
|
+const memberLevelsStore = useMemberLevelsStore()
|
|
|
+const { memberLevels } = storeToRefs(memberLevelsStore)
|
|
|
+const filterQuery = ref<{
|
|
|
+ tags: any[]
|
|
|
+ levels: any[]
|
|
|
+ minPoints?: string
|
|
|
+ maxPoints?: string
|
|
|
+ brokerId?: string
|
|
|
+}>({
|
|
|
+ tags: [],
|
|
|
+ levels: [],
|
|
|
+ brokerId: userInfo.value.userId.toString(),
|
|
|
+})
|
|
|
const query = ref({})
|
|
|
const searchFocus = () => {
|
|
|
console.log('focus')
|
|
@@ -49,7 +69,7 @@ const callPhone = (phoneNumber) => {
|
|
|
})
|
|
|
}
|
|
|
const filterData = () => {
|
|
|
- console.log('filter')
|
|
|
+ filterState.value = true
|
|
|
}
|
|
|
const handleImportant = async (designer: Designer) => {
|
|
|
// const { code } = await requestToast(
|
|
@@ -67,6 +87,18 @@ const handleImportant = async (designer: Designer) => {
|
|
|
// await pageHelperRef.value?.refresh()
|
|
|
// }
|
|
|
}
|
|
|
+const handleSubmit = () => {
|
|
|
+ query.value = {
|
|
|
+ ...filterQuery.value,
|
|
|
+ tags: filterQuery.value.tags.join(','),
|
|
|
+ levels: filterQuery.value.levels.join(','),
|
|
|
+ }
|
|
|
+ filterState.value = false
|
|
|
+}
|
|
|
+const handleReset = () => {
|
|
|
+ filterQuery.value = { tags: [], levels: [], brokerId: userInfo.value.userId.toString() }
|
|
|
+ query.value = {}
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -224,6 +256,81 @@ const handleImportant = async (designer: Designer) => {
|
|
|
<div><wd-button block :round="false">提交</wd-button></div>
|
|
|
</view>
|
|
|
</wd-action-sheet>
|
|
|
+ <!-- 筛选action-sheet -->
|
|
|
+ <wd-action-sheet v-model="filterState" title="筛选" @close="filterState = false">
|
|
|
+ <view class="flex flex-col p-4">
|
|
|
+ <SectionHeading title="标签"></SectionHeading>
|
|
|
+ <wd-checkbox-group shape="button" v-model="filterQuery.tags">
|
|
|
+ <template
|
|
|
+ v-for="(tag, index) in [
|
|
|
+ // { label: '全部', value: '' },
|
|
|
+ { label: '重点跟进', value: '1' },
|
|
|
+ { label: '本月新增', value: '2' },
|
|
|
+ { label: '超过30天未跟进', value: '3' },
|
|
|
+ { label: '超过60天未产生积分', value: '4' },
|
|
|
+ { label: '超过60天未消耗积分', value: '5' },
|
|
|
+ { label: '未成交过', value: '6' },
|
|
|
+ ]"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <wd-checkbox custom-class="w-50%!" :model-value="tag.value">
|
|
|
+ {{ tag.label }}
|
|
|
+ </wd-checkbox>
|
|
|
+ </template>
|
|
|
+ </wd-checkbox-group>
|
|
|
+ <SectionHeading title="会员等级"></SectionHeading>
|
|
|
+ <wd-checkbox-group shape="button" v-model="filterQuery.levels">
|
|
|
+ <template
|
|
|
+ v-for="(tag, index) in memberLevels.map((it) => ({
|
|
|
+ label: it.memberLevelName,
|
|
|
+ value: it.id,
|
|
|
+ }))"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <wd-checkbox custom-class="w-50%!" :model-value="tag.value">{{ tag.label }}</wd-checkbox>
|
|
|
+ </template>
|
|
|
+ </wd-checkbox-group>
|
|
|
+ <!-- <div class="flex items-center justify-between py-4">
|
|
|
+ <template>
|
|
|
+ <div class="w-[168px] h-10 bg-[#f5f7f9] rounded-lg flex items-center justify-center">
|
|
|
+ <div class="w-7 text-black/90 text-sm font-normal font-['PingFang_SC'] leading-none">
|
|
|
+ 全部
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </div> -->
|
|
|
+
|
|
|
+ <SectionHeading title="积分区间"></SectionHeading>
|
|
|
+ <div class="flex items-center justify-between py-4">
|
|
|
+ <wd-input
|
|
|
+ v-model="filterQuery.minPoints"
|
|
|
+ custom-class="h-10 bg-[#f5f7f9]!"
|
|
|
+ no-border
|
|
|
+ ></wd-input>
|
|
|
+ <div class="w-4 h-.25 bg-black/35"></div>
|
|
|
+ <wd-input
|
|
|
+ v-model="filterQuery.maxPoints"
|
|
|
+ custom-class="h-10 bg-[#f5f7f9]!"
|
|
|
+ no-border
|
|
|
+ ></wd-input>
|
|
|
+ </div>
|
|
|
+ <div class="flex gap-4">
|
|
|
+ <div class="flex-1">
|
|
|
+ <wd-button block :round="false" @click="handleReset">重置</wd-button>
|
|
|
+ </div>
|
|
|
+ <div class="flex-1">
|
|
|
+ <wd-button block :round="false" @click="handleSubmit">提交</wd-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </view>
|
|
|
+ </wd-action-sheet>
|
|
|
</template>
|
|
|
|
|
|
-<style scoped lang="scss"></style>
|
|
|
+<style scoped lang="scss">
|
|
|
+.filter-item {
|
|
|
+ @apply w-[168px] h-10 bg-[#f5f7f9] rounded-lg flex items-center justify-center;
|
|
|
+ &-text {
|
|
|
+ @apply text-black/90 text-sm font-normal font-['PingFang_SC'] leading-none;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|