diff --git a/api/business/notice.js b/api/business/notice.js index c0a8375..1dd31a2 100644 --- a/api/business/notice.js +++ b/api/business/notice.js @@ -115,3 +115,31 @@ export function feedbackList(params) { params: params }) } + +// 通告查询报名列表 +export function reportList(params) { + return request({ + url: '/busi/notice/reportList', + method: 'get', + params: params + }) +} + + +// 选中当前名片 +export function chooseSign(params) { + return request({ + url: '/busi/sign/chooseSign', + method: 'post', + params: params + }) +} + +// 获取报名数量 +export function getSignNum(params) { + return request({ + url: '/busi/notice/reportNum', + method: '', + params: params + }) +} \ No newline at end of file diff --git a/pages/components/my-notice-tg.vue b/pages/components/my-notice-tg.vue index e553336..9329a2b 100644 --- a/pages/components/my-notice-tg.vue +++ b/pages/components/my-notice-tg.vue @@ -15,7 +15,7 @@ + @goDetail="goDetail"> @@ -221,4 +221,4 @@ } } } - + \ No newline at end of file diff --git a/pages/notice/card-item.vue b/pages/notice/card-item.vue index c9e84a1..43ab243 100644 --- a/pages/notice/card-item.vue +++ b/pages/notice/card-item.vue @@ -2,9 +2,9 @@ - + + :localdata="checkboxArray" @change="chooseItem()" /> @@ -18,7 +18,7 @@ --> 待定 - 合适 + 合适 @@ -40,7 +40,7 @@ --> 主页 - {{item.ifChecked?"待定":"合适"}} + {{"合适"}} @@ -58,9 +58,14 @@ type: Array, default: [] }, + ifChoose: { type: Boolean, default: false + }, + + status: { + default: 0 } }, data() { @@ -72,6 +77,13 @@ } }, methods: { + chooseItem() { + console.log(this.dataList, "dataList") + this.$emit("updateList", this.dataList) + }, + chooseOk() { + + }, formatNumberWithUnits(num) { return formatNumberWithUnits(num) }, @@ -85,6 +97,7 @@ * 将名片置为合适或不合适 */ chooseCardVal(value) { + this.$emit("chooseCardVal", value) } } diff --git a/pages/notice/detail.vue b/pages/notice/detail.vue index fa07f24..2bc0c95 100644 --- a/pages/notice/detail.vue +++ b/pages/notice/detail.vue @@ -5,14 +5,19 @@ - 已报名:{{imageArray.length||0}}人 + 已报名:{{allImgNum||0}}人 + :style="{height:(imageArray.length*(imageWidth*2))+'rpx'}"> - + + + @@ -168,14 +173,14 @@ - 关闭 + 审核中 已关闭 - 关闭 - + @@ -392,7 +397,8 @@ }) }, goReportForm() { - this.$tab.navigateTo('/pages/mine/set/report-form?userId='+this.userDetail.userId+'¬iceId='+this.noticeId) + this.$tab.navigateTo('/pages/mine/set/report-form?userId=' + this.userDetail.userId + '¬iceId=' + this + .noticeId) }, goMemberIndex() { this.$tab.navigateTo('/pages/mine/member/member-index') @@ -401,7 +407,7 @@ * 去报名列表 */ goReportList() { - this.$tab.navigateTo('/pages/notice/report-list') + this.$tab.navigateTo('/pages/notice/report-list?noticeId=' + this.noticeId) }, /** * 查通告详情 @@ -539,6 +545,7 @@ * 计算头像显示区域高度 */ calculateImagesPerRow(imgs) { + this.imageArray = [] let tempImg = [] imgs.forEach(it => { tempImg.push(this.imageUrl + it) @@ -944,4 +951,4 @@ } } } - + \ No newline at end of file diff --git a/pages/notice/report-list.vue b/pages/notice/report-list.vue index 482037b..eb75ee3 100644 --- a/pages/notice/report-list.vue +++ b/pages/notice/report-list.vue @@ -8,7 +8,7 @@ - {{item}}({{0==menuIndex?waitingTotal:checkedTotal}}) + {{item}}({{0==index?waitingTotal:checkedTotal}}) @@ -16,8 +16,8 @@ - + @@ -27,8 +27,8 @@ - + @@ -38,11 +38,10 @@ - + 可在“合适”列表导出名单 - 已选择{{getChooseNum}}人 划为合适 导出名单 @@ -57,6 +56,12 @@ toast, hasRights } from '@/utils/common.js' + import { + reportList, + chooseSign, + getSignNum + } from '@/api/business/notice'; + import config from '@/config'; export default { components: { navigationBarVue, @@ -64,6 +69,7 @@ }, data() { return { + baseUrl: config.baseUrl, chooseAll: [{ text: '全选', value: true @@ -71,68 +77,129 @@ globalConfig: getApp().globalData.config, menus: ['待定', '合适'], menuIndex: 0, - queryParams: { + waitingParams: { + pageNum: 1, + pageSize: 10 + }, + checkedParams: { pageNum: 1, pageSize: 10 }, //待定的数组 - waitingList: [{ - id: "", - //是否选中 - choosed: [], - //是否合适 - ifChecked: false, - platformCode: "xiaohongshu", - platformName: "小红书", - accountName: "mark", - fansNum: 1000 - }, { - id: "", - //是否选中 - choosed: [], - //是否合适 - ifChecked: false, - platformCode: "xiaohongshu", - platformName: "小红书", - accountName: "mark", - fansNum: 1000 - }], + waitingList: [], // 合适的数组 - checkedList: [{ - id: "", - //是否选中 - choosed: [], - //是否合适 - ifChecked: true, - platformCode: "xiaohongshu", - platformName: "小红书", - accountName: "mark", - fansNum: 1000 - }, { - id: "", - //是否选中 - choosed: [], - //是否合适 - ifChecked: true, - platformCode: "xiaohongshu", - platformName: "小红书", - accountName: "mark", - fansNum: 1000 - }], + checkedList: [], //待定的总数 waitingTotal: 0, //合适的总数 checkedTotal: 0, //下来刷新状态 isTriggered: false, + noticeId: null } }, computed: { getChooseNum() { - return this.checkedList.filter((item) => item.choosed.length > 0).length + return this.checkedList.filter((item) => item.choosed && item.choosed.length > 0).length } }, + onLoad(param) { + this.noticeId = param.noticeId + }, + onShow() { + this.waitingList = [] + this.checkedList = [] + this.menuIndex = 0 + this.waitingParams.pageNum = 1 + this.checkedParams.pageNum = 1 + this.selectDataList() + }, methods: { + updateListWaiting(list) { + this.waitingList = list + console.log(this.waitingList, "waitingList") + }, + updateListChecked(list) { + this.checkedList = list + console.log(this.checkedList, "checkedList") + }, + chooseOk() { + console.log(this.waitingList, 119); + let tempList = this.waitingList.filter((item) => item.choosed.length > 0) + if (tempList.length == 0) { + uni.showToast({ + title: '请勾选合适的卡片', + icon: 'none', + duration: 800 + }) + return + } + let ids = [] + tempList.forEach(it => { + ids.push(it.id) + }) + chooseSign({ + signIds: ids.join(",") + }).then(res => { + uni.showToast({ + title: '成功', + icon: 'none', + duration: 800 + }) + this.selectDataList() + }) + }, + getNum() { + let queryData = {} + queryData.noticeId = this.noticeId + getSignNum(queryData).then(res => { + if (res.code == 200) { + + this.waitingTotal = res.data.waitNum + this.checkedTotal = res.data.checkedNum + + } + }) + }, + selectDataList() { + let queryData = {} + if (this.menuIndex == 0) { + queryData.status = '01' + queryData.pageNum = this.waitingParams.pageNum + queryData.pageSize = this.waitingParams.pageSize + } else if (this.menuIndex == 1) { + queryData.status = '02' + queryData.pageNum = this.checkedParams.pageNum + queryData.pageSize = this.checkedParams.pageSize + } + queryData.noticeId = this.noticeId + reportList(queryData).then(res => { + if (res.code == 200) { + this.isTriggered = false + res.data.records.map((item) => { + item.choosed = [] + }) + if (this.menuIndex == 0) { + if (queryData.pageNum == 1) { + this.waitingList = res.data.records + } else { + this.waitingList = this.waitingList.concat(res.data.records) + } + this.waitingTotal = res.data.total + } else if (this.menuIndex == 1) { + if (queryData.pageNum == 1) { + this.checkedList = res.data.records + } else { + this.checkedList = this.checkedList.concat(res.data.records) + } + this.checkedTotal = res.data.total + + } + console.log(this.checkedTotal, this.waitingTotal, this.waitingList); + } + }) + this.getNum() + }, /** * 菜单点击 * @param {Object} index @@ -140,32 +207,47 @@ */ itemClick(index, item) { this.menuIndex = index + this.selectDataList() }, /** * 上滑加载数据 */ onReachBottomCus() { + let quertData = {} + if (this.menuIndex == 0) { + queryData = this.waitingParams + } else if (this.menuIndex == 1) { + queryData = this.checkedParams + } //判断 如果页码*页容量大于等于总条数,提示该页数据加载完毕 let total = (0 == this.menuIndex ? this.waitingTotal : this.checkedTotal) - if (this.queryParams.pageNum * this.queryParams.pageSize >= total) { + if (queryData.pageNum * queryData.pageSize >= total) { toast("没有更多数据了") return } //页码+1,调用获取数据的方法获取第二页数据 - this.queryParams.pageNum++ + queryData.pageNum++ + this.selectDataList() }, /** * 下拉刷新数据 */ onRefresherrefresh() { + let quertData = {} + if (this.menuIndex == 0) { + queryData = this.waitingParams + } else if (this.menuIndex == 1) { + queryData = this.checkedParams + } this.isTriggered = true - this.queryParams.pageNum = 1 + quertData.pageNum = 1 if (0 == this.menuIndex) { this.waitingTotal = 0 } else { this.checkedTotal = 0 } + this.selectDataList() }, /** * 全选 @@ -195,24 +277,51 @@ } } }, - /** - * 批量划为合适 - */ - chooseOk() {}, /** * 导出名单 */ - exportList() {}, + exportList() { + let exportUrl = this.baseUrl + "/busi/sign/export?noticeId=" + this.noticeId + uni.setClipboardData({ + data: exportUrl, + success: function() { + uni.showToast({ + title: '名单复制成功,请到浏览器下载', + icon: 'icon', + duration: 2000 + }); + }, + fail: function() { + uni.showToast({ + title: '复制失败', + icon: 'none', + duration: 2000 + }); + } + }); + }, /** * 去名片所有者主页 */ goIndex(item) { - this.$tab.navigateTo('/pages/mine/member/member-index') - }, + console.log(item); + + }, /** * 将名片置为合适或不合适 */ - chooseCardVal(value) {} + chooseCardVal(value) { + chooseSign({ + signIds: value + }).then(res => { + uni.showToast({ + title: '成功', + icon: 'none', + duration: 800 + }) + this.selectDataList() + }) + } } } @@ -302,7 +411,7 @@ .left-radio { text-align: left; - width: 30%; + } .right-button { @@ -329,4 +438,8 @@ } } } - + + .checklist-box { + margin-right: 5rpx !important; + } + \ No newline at end of file