发布通告功能
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) {
|
export function getSubscribeList(params) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@ -280,7 +280,7 @@
|
|||||||
/**
|
/**
|
||||||
* 选择平台
|
* 选择平台
|
||||||
*/
|
*/
|
||||||
choosePlat(index) {
|
async choosePlat(index) {
|
||||||
if (index == 2) {
|
if (index == 2) {
|
||||||
//鉴权
|
//鉴权
|
||||||
if (!this.checkIfHasRights(rightsCode.subscribeSelect)) {
|
if (!this.checkIfHasRights(rightsCode.subscribeSelect)) {
|
||||||
@ -327,7 +327,7 @@
|
|||||||
* @param {Object} index
|
* @param {Object} index
|
||||||
* @param {Object} item
|
* @param {Object} item
|
||||||
*/
|
*/
|
||||||
itemClick(index, item) {
|
async itemClick(index, item) {
|
||||||
if ('全部' == item) {
|
if ('全部' == item) {
|
||||||
//全部
|
//全部
|
||||||
this.queryParams.sortBy = ""
|
this.queryParams.sortBy = ""
|
||||||
@ -355,7 +355,7 @@
|
|||||||
/**
|
/**
|
||||||
* 搜索
|
* 搜索
|
||||||
*/
|
*/
|
||||||
goSeach() {
|
async goSeach() {
|
||||||
//鉴权
|
//鉴权
|
||||||
if (!this.checkIfHasRights(rightsCode.searchNotice)) {
|
if (!this.checkIfHasRights(rightsCode.searchNotice)) {
|
||||||
return
|
return
|
||||||
@ -366,9 +366,10 @@
|
|||||||
* 鉴权通用方法
|
* 鉴权通用方法
|
||||||
* @param {Object} rigthsCode
|
* @param {Object} rigthsCode
|
||||||
*/
|
*/
|
||||||
checkIfHasRights(rigthsCode) {
|
async checkIfHasRights(rigthsCode) {
|
||||||
if (!hasRights(rigthsCode)) {
|
let res = await hasRights(rigthsCode)
|
||||||
toast("请开通会员")
|
if (!res) {
|
||||||
|
toast('请开通会员')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|||||||
@ -34,6 +34,11 @@
|
|||||||
import {
|
import {
|
||||||
setStrData
|
setStrData
|
||||||
} from '@/utils/auth.js'
|
} from '@/utils/auth.js'
|
||||||
|
import {
|
||||||
|
toast,
|
||||||
|
hasRights
|
||||||
|
} from '@/utils/common.js'
|
||||||
|
import rightsCode from '@/utils/rightsCode'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
tabBarVue,
|
tabBarVue,
|
||||||
@ -46,7 +51,7 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
//当前用户类型
|
//当前用户类型
|
||||||
nowUserType: null,
|
nowUserType: 'bz',
|
||||||
menus: ['全部', '最新', '高奖励', '急招', '品牌置换'],
|
menus: ['全部', '最新', '高奖励', '急招', '品牌置换'],
|
||||||
menuIndex: 0,
|
menuIndex: 0,
|
||||||
dataList: ['1', '2', '2', '2'],
|
dataList: ['1', '2', '2', '2'],
|
||||||
@ -82,6 +87,7 @@
|
|||||||
*/
|
*/
|
||||||
refreshUserType() {
|
refreshUserType() {
|
||||||
this.nowUserType = getUserType()
|
this.nowUserType = getUserType()
|
||||||
|
console.log(this.nowUserType, 90);
|
||||||
},
|
},
|
||||||
updateParams(newVal) {
|
updateParams(newVal) {
|
||||||
this.nowUserType = newVal;
|
this.nowUserType = newVal;
|
||||||
@ -99,9 +105,26 @@
|
|||||||
if ("fabu" == code) {
|
if ("fabu" == code) {
|
||||||
this.$tab.navigateTo('/pages/notice/public-notice')
|
this.$tab.navigateTo('/pages/notice/public-notice')
|
||||||
} else {
|
} else {
|
||||||
|
if (code == 'dingyue') {
|
||||||
|
if (!this.checkIfHasRights(rightsCode.subscribeSelect)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
this.menuCode = code
|
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,
|
toast,
|
||||||
hasRights
|
hasRights
|
||||||
} from '@/utils/common.js'
|
} from '@/utils/common.js'
|
||||||
|
import {
|
||||||
|
getCatgByCode
|
||||||
|
} from '@/api/system/config.js'
|
||||||
|
import {
|
||||||
|
getHisList
|
||||||
|
} from '@/api/business/notice.js'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
navigationBarVue,
|
navigationBarVue,
|
||||||
@ -33,7 +39,7 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dataList: ['', '', '', '', '', '', ''],
|
dataList: [],
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10
|
pageSize: 10
|
||||||
@ -44,8 +50,67 @@
|
|||||||
//当前用户权益可以看几条浏览记录
|
//当前用户权益可以看几条浏览记录
|
||||||
maxHisNum: 20,
|
maxHisNum: 20,
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.initData("dl_platform", "platformList")
|
||||||
|
this.initData("dl_blogger_type", "bloggerTypeList")
|
||||||
|
this.selectDataList()
|
||||||
|
},
|
||||||
|
onLoad: function() {
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
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,调用获取数据的方法获取第二页数据
|
//页码+1,调用获取数据的方法获取第二页数据
|
||||||
this.queryParams.pageNum++
|
this.queryParams.pageNum++
|
||||||
|
this.selectDataList()
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 下拉刷新数据
|
* 下拉刷新数据
|
||||||
@ -65,6 +131,8 @@
|
|||||||
this.isTriggered = true
|
this.isTriggered = true
|
||||||
this.queryParams.pageNum = 1
|
this.queryParams.pageNum = 1
|
||||||
this.total = 0
|
this.total = 0
|
||||||
|
|
||||||
|
this.selectDataList()
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 查看通告详情
|
* 查看通告详情
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="dl-detail-box">
|
<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>
|
title-color="#000000"></navigation-bar-vue>
|
||||||
<view class="notice-detail-last-box">
|
<view class="notice-detail-last-box">
|
||||||
<!-- 报名列表 -->
|
<!-- 报名列表 -->
|
||||||
|
|||||||
@ -57,9 +57,12 @@ export function hasRights(code) {
|
|||||||
if (userRights.hasOwnProperty(code)) {
|
if (userRights.hasOwnProperty(code)) {
|
||||||
rtnData = userRights[code]
|
rtnData = userRights[code]
|
||||||
}
|
}
|
||||||
|
console.log(rtnData, 51);
|
||||||
resolve(rtnData)
|
resolve(rtnData)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
}).catch(e => {
|
||||||
|
reject(e)
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -76,7 +79,7 @@ export function changeUserType(value) {
|
|||||||
* @param {Object} value 身份值
|
* @param {Object} value 身份值
|
||||||
*/
|
*/
|
||||||
export function getUserType() {
|
export function getUserType() {
|
||||||
return getStrData(constant.userTypeKey)
|
return getStrData(constant.userTypeKey) || '02'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user