diff --git a/pages/personalCenter/myPrayRecordList.vue b/pages/personalCenter/myPrayRecordList.vue index a1c8abd..e6d03bf 100644 --- a/pages/personalCenter/myPrayRecordList.vue +++ b/pages/personalCenter/myPrayRecordList.vue @@ -2,6 +2,27 @@ + + + + + 筛选 + + + + + {{ filterOptions.isOthers | prayerIsOthersFilter + }}{{ filterOptions.type | prayerTypeFilter }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -66,15 +123,49 @@ import { createPagination } from "../../composables/winB_Pagination"; import { getUserPrayerList } from "../../api/pray/pray"; import CommonEnum from "../../enum/common"; +import SearchBox from "../../components/search-box/search-box.vue"; export default { + components: { SearchBox }, computed: { CommonEnum() { return CommonEnum; }, }, data() { - return {}; + return { + show: false, + show1: false, + filterOptions: { + isOthers: "", + type: "", + name: "", + }, + list: [ + [ + { + value: "0", + label: "所有", + }, + { + value: "1", + label: "为他人", + }, + { + value: "2", + label: "为自己", + }, + ], + [ + { value: 0, label: "所有" }, + { value: 1, label: "学业" }, + { value: 2, label: "健康" }, + { value: 3, label: "姻缘" }, + { value: 4, label: "财运" }, + { value: 5, label: "消灾" }, + ], + ], + }; }, filters: { prayerTypeFilter(value) { @@ -85,9 +176,17 @@ export default { 4: "财运", 5: "消灾", }; - return types[value] || "其他"; + return types[value] || ""; + }, + prayerIsOthersFilter(value) { + const types = { + 1: "为他人", + 2: "为自己", + }; + return types[value] || ""; }, }, + mixins: [ createPagination({ fetchData: getUserPrayerList, @@ -101,6 +200,25 @@ export default { this.winB_GetList(); }, methods: { + onSearch() { + this.winB_UpdateParams(this.filterOptions); + }, + // 回调参数为包含多个元素的数组,每个元素分别反应每一列的选择情况 + confirm(e) { + if (e[0].value === "0") { + this.filterOptions.isOthers = ""; + } else { + this.filterOptions.isOthers = e[0].value; + } + if (e[1].value === 0) { + this.filterOptions.type = ""; + } else { + this.filterOptions.type = e[1].value; + } + + this.onSearch(); + }, + // 加载页面数据 async loadPageData() { this.loading = true; @@ -130,6 +248,8 @@ page { } .page { + display: flex; + flex-direction: column; position: relative; width: 100%; min-height: 100vh; @@ -144,6 +264,19 @@ page { padding: 0 15rpx; } +.filter-tips { + justify-content: center; + display: flex; + width: 680rpx; + margin: 0 auto; + background-color: #8b4513; // 深棕色背景 + color: #fff; + font-size: 28rpx; + font-weight: 500; + padding: 8rpx 20rpx; + border-radius: 6rpx; +} + .blessing-container { padding: 30rpx; //background-color: #faf8f5; // 浅米色背景 @@ -328,4 +461,38 @@ page { background-color: #555 !important; } } + +.search-filter-row { + width: 100%; + display: flex; + flex-direction: row; + align-items: center; + margin: 10rpx 0 10rpx 0; + padding: 0 35rpx; + + .search-filter-row search-box { + flex: 1; + } + + .filter-btn { + display: flex; + align-items: center; + margin-left: 20rpx; + //padding: 0 16rpx; + height: 70rpx; + border-radius: 10rpx; + cursor: pointer; + + .filter-icon { + width: 32rpx; + height: 32rpx; + margin-right: 8rpx; + } + + .filter-text { + color: #6b4a1b; + font-size: 28rpx; + } + } +} diff --git a/utils/request.js b/utils/request.js index aaf5b55..e760b38 100644 --- a/utils/request.js +++ b/utils/request.js @@ -6,8 +6,9 @@ import debounce from "uview-ui/libs/function/debounce"; const ENV_CONFIG = { release: { // 正式版 - baseUrl: "http://192.168.2.158:4501", + // baseUrl: "http://192.168.2.158:4501", // baseUrl: "https://tech-ape.top/prod-api", + baseUrl: "https://tech-ape.top/prod-api", appId: 1, }, };