发布通告功能
This commit is contained in:
parent
c168237c63
commit
d10f5e9439
@ -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
|
||||
})
|
||||
}
|
||||
}
|
@ -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>
|
@ -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
|
||||
},
|
||||
/**
|
||||
* 上滑加载数据
|
||||
*/
|
||||
|
@ -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()
|
||||
},
|
||||
/**
|
||||
* 查看通告详情
|
||||
|
@ -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)
|
||||
},
|
||||
/**
|
||||
* 去报名列表
|
||||
|
@ -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'
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user