发布通告功能

This commit is contained in:
13405411873 2025-04-18 14:00:19 +08:00
parent c168237c63
commit d10f5e9439
6 changed files with 118 additions and 13 deletions

View File

@ -11,6 +11,16 @@ export function getNoticeList(params) {
}
// 查询浏览足迹
export function getHisList(params) {
return request({
url: '/busi/notice/appFootprintList',
method: 'get',
params: params
})
}
// 订阅查询通告列表
export function getSubscribeList(params) {
return request({
@ -150,4 +160,4 @@ export function queryListByUserId(params) {
method: 'get',
params: params
})
}
}

View File

@ -280,7 +280,7 @@
/**
* 选择平台
*/
choosePlat(index) {
async choosePlat(index) {
if (index == 2) {
//
if (!this.checkIfHasRights(rightsCode.subscribeSelect)) {
@ -327,7 +327,7 @@
* @param {Object} index
* @param {Object} item
*/
itemClick(index, item) {
async itemClick(index, item) {
if ('全部' == item) {
//
this.queryParams.sortBy = ""
@ -355,7 +355,7 @@
/**
* 搜索
*/
goSeach() {
async goSeach() {
//
if (!this.checkIfHasRights(rightsCode.searchNotice)) {
return
@ -366,9 +366,10 @@
* 鉴权通用方法
* @param {Object} rigthsCode
*/
checkIfHasRights(rigthsCode) {
if (!hasRights(rigthsCode)) {
toast("请开通会员")
async checkIfHasRights(rigthsCode) {
let res = await hasRights(rigthsCode)
if (!res) {
toast('请开通会员')
return false
}
return true
@ -709,4 +710,4 @@
margin: 10rpx;
}
}
</style>
</style>

View File

@ -34,6 +34,11 @@
import {
setStrData
} from '@/utils/auth.js'
import {
toast,
hasRights
} from '@/utils/common.js'
import rightsCode from '@/utils/rightsCode'
export default {
components: {
tabBarVue,
@ -46,7 +51,7 @@
data() {
return {
//
nowUserType: null,
nowUserType: 'bz',
menus: ['全部', '最新', '高奖励', '急招', '品牌置换'],
menuIndex: 0,
dataList: ['1', '2', '2', '2'],
@ -82,6 +87,7 @@
*/
refreshUserType() {
this.nowUserType = getUserType()
console.log(this.nowUserType, 90);
},
updateParams(newVal) {
this.nowUserType = newVal;
@ -99,9 +105,26 @@
if ("fabu" == code) {
this.$tab.navigateTo('/pages/notice/public-notice')
} else {
if (code == 'dingyue') {
if (!this.checkIfHasRights(rightsCode.subscribeSelect)) {
return
}
}
this.menuCode = code
}
},
/**
* 鉴权通用方法
* @param {Object} rigthsCode
*/
async checkIfHasRights(rigthsCode) {
let res = await hasRights(rigthsCode)
if (!res) {
toast('请开通会员')
return false
}
return true
},
/**
* 上滑加载数据
*/

View File

@ -26,6 +26,12 @@
toast,
hasRights
} from '@/utils/common.js'
import {
getCatgByCode
} from '@/api/system/config.js'
import {
getHisList
} from '@/api/business/notice.js'
export default {
components: {
navigationBarVue,
@ -33,7 +39,7 @@
},
data() {
return {
dataList: ['', '', '', '', '', '', ''],
dataList: [],
queryParams: {
pageNum: 1,
pageSize: 10
@ -44,8 +50,67 @@
//
maxHisNum: 20,
}
},
mounted() {
this.initData("dl_platform", "platformList")
this.initData("dl_blogger_type", "bloggerTypeList")
this.selectDataList()
},
onLoad: function() {
},
methods: {
/**
* 初始化数据
* @param {Object} code
* @param {Object} dataObj
*/
initData(code, dataObj) {
let that = this
getCatgByCode({
code: code
}).then(res => {
if (res.code == 200) {
this[dataObj] = res.data
}
}).catch((e) => {
uni.showToast({
icon: 'error',
duration: 2000,
title: e
});
})
},
/**
* 查询数据
*/
selectDataList() {
getHisList(this.queryParams).then(res => {
this.isTriggered = false
if (res.code == 200) {
if (this.queryParams.pageNum == 1) {
this.dataList = res.data.records
} else {
this.dataList = this.dataList.concat(res.data.records)
}
this.total = res.data.total
}
}).catch((e) => {
this.isTriggered = false
uni.showToast({
icon: 'error',
duration: 2000,
title: e
});
})
},
/**
* 查看通告详情
* @param {Object} item
*/
goDetail(item) {
this.$tab.navigateTo(`/pages/notice/detail?id=${item.id}`)
},
/**
* 上滑加载数据
*/
@ -57,6 +122,7 @@
}
//+1,
this.queryParams.pageNum++
this.selectDataList()
},
/**
* 下拉刷新数据
@ -65,6 +131,8 @@
this.isTriggered = true
this.queryParams.pageNum = 1
this.total = 0
this.selectDataList()
},
/**
* 查看通告详情

View File

@ -1,6 +1,6 @@
<template>
<view class="dl-detail-box">
<navigation-bar-vue title="通告详情1" style="width: 100%;" background-color="#ffffff"
<navigation-bar-vue title="通告详情" style="width: 100%;" background-color="#ffffff"
title-color="#000000"></navigation-bar-vue>
<view class="notice-detail-last-box">
<!-- 报名列表 -->
@ -401,7 +401,7 @@
.noticeId)
},
goMemberIndex() {
this.$tab.navigateTo('/pages/mine/member/member-index?userId='+this.userDetail.userId)
this.$tab.navigateTo('/pages/mine/member/member-index?userId=' + this.userDetail.userId)
},
/**
* 去报名列表

View File

@ -57,9 +57,12 @@ export function hasRights(code) {
if (userRights.hasOwnProperty(code)) {
rtnData = userRights[code]
}
console.log(rtnData, 51);
resolve(rtnData)
})
}).catch(e => {
reject(e)
})
}
@ -76,7 +79,7 @@ export function changeUserType(value) {
* @param {Object} value 身份值
*/
export function getUserType() {
return getStrData(constant.userTypeKey)
return getStrData(constant.userTypeKey) || '02'
}
/**