|
@@ -1,5 +1,5 @@
|
|
|
<script setup>
|
|
|
-import { ref } from 'vue'
|
|
|
+import { ref, computed } from 'vue'
|
|
|
import { SearchBidModel } from '../model/index'
|
|
|
import SearchSchemaFilter from '@/views/search/components/search-schema-filter.vue'
|
|
|
import SelectorWithBasePower from '@/components/filter-items/SelectorWithBasePower.vue'
|
|
@@ -9,46 +9,71 @@ import {
|
|
|
createSearchBidMoreSchema
|
|
|
} from '@/views/search/bidding/constant/search-filters'
|
|
|
|
|
|
+import { getEntSearchPower } from '@/api/modules'
|
|
|
+
|
|
|
const {
|
|
|
- isVip,
|
|
|
- isOld,
|
|
|
filterState,
|
|
|
doQuery,
|
|
|
showFilter
|
|
|
} = SearchBidModel
|
|
|
|
|
|
-const conf = ref({
|
|
|
- vipUser: isVip.value,
|
|
|
- oldUser: isOld.value
|
|
|
+
|
|
|
+// 是否是VIP
|
|
|
+const isVip = ref(false)
|
|
|
+// 是否是老用户
|
|
|
+const isOld = ref(false)
|
|
|
+
|
|
|
+const SearchBidBaseSchema = ref([])
|
|
|
+const SearchBidMoreSchema = ref([])
|
|
|
+
|
|
|
+const searchBidMoreFreeSchema = ref([])
|
|
|
+const searchBidMoreVipSchema = ref([])
|
|
|
+
|
|
|
+const conf = computed(() => {
|
|
|
+ return {
|
|
|
+ vipUser: isVip.value,
|
|
|
+ oldUser: isOld.value
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+const customMoreSchema = computed(() => {
|
|
|
+ return {
|
|
|
+ commonConf: {
|
|
|
+ showLabel: false,
|
|
|
+ styleType: 'row'
|
|
|
+ },
|
|
|
+ freeConf: {
|
|
|
+ showRowLabel: true,
|
|
|
+ rowLabelText: '更多筛选:',
|
|
|
+ schema: searchBidMoreFreeSchema.value
|
|
|
+ },
|
|
|
+ vipConf: {
|
|
|
+ schema: searchBidMoreVipSchema.value
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
-const SearchBidBaseSchema = createSearchBidBaseSchema(conf.value)
|
|
|
-const SearchBidMoreSchema = createSearchBidMoreSchema()
|
|
|
-
|
|
|
-const searchBidMoreFreeSchema = SearchBidMoreSchema.filter((s) => !s.vipMark)
|
|
|
-const searchBidMoreVipSchema = SearchBidMoreSchema.filter((s) => s.vipMark)
|
|
|
-
|
|
|
-const customMoreSchema = {
|
|
|
- commonConf: {
|
|
|
- showLabel: false,
|
|
|
- styleType: 'row'
|
|
|
- },
|
|
|
- freeConf: {
|
|
|
- showRowLabel: true,
|
|
|
- rowLabelText: '更多筛选:',
|
|
|
- schema: searchBidMoreFreeSchema
|
|
|
- },
|
|
|
- vipConf: {
|
|
|
- schema: searchBidMoreVipSchema
|
|
|
+// 获取用户信息
|
|
|
+async function getUserPowerInfo () {
|
|
|
+ const { error_code: code, data } = await getEntSearchPower()
|
|
|
+ if (code === 0 && data) {
|
|
|
+ const { entniche, member, vip, isOld: old } = data
|
|
|
+ isVip.value = entniche || member || vip > 0
|
|
|
+ isOld.value = old
|
|
|
+
|
|
|
+ SearchBidBaseSchema.value = createSearchBidBaseSchema(conf.value)
|
|
|
+ SearchBidMoreSchema.value = createSearchBidMoreSchema()
|
|
|
+
|
|
|
+ searchBidMoreFreeSchema.value = SearchBidMoreSchema.value?.filter((s) => !s.vipMark)
|
|
|
+ searchBidMoreVipSchema.value = SearchBidMoreSchema.value?.filter((s) => s.vipMark)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+getUserPowerInfo()
|
|
|
+
|
|
|
function noPower() {
|
|
|
$bus.$emit('search:filter:no-power')
|
|
|
}
|
|
|
|
|
|
-console.log(SearchBidBaseSchema)
|
|
|
-console.log(SearchBidMoreSchema)
|
|
|
-
|
|
|
function doChangeFilter() {
|
|
|
doQuery()
|
|
|
}
|
|
@@ -98,9 +123,19 @@ function doChangeFilter() {
|
|
|
</template>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+.in-app {
|
|
|
+ .search-bid-filter {
|
|
|
+ .wrap-line {
|
|
|
+ ::v-deep {
|
|
|
+ .vip-module {
|
|
|
+ margin-left: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
.search-bid-filter {
|
|
|
padding: 16px 32px;
|
|
|
-
|
|
|
.wrap-line {
|
|
|
::v-deep {
|
|
|
.vip-module {
|
|
@@ -108,6 +143,5 @@ function doChangeFilter() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
</style>
|