diff --git a/api/activityInfo/info.js b/api/activityInfo/info.js new file mode 100644 index 0000000..d1e0d7e --- /dev/null +++ b/api/activityInfo/info.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询活动详情列表 +export function listInfo(query) { + return request({ + url: '/activityInfo/info/list', + method: 'get', + params: query + }) +} + +// 查询活动详情详细 +export function getInfo(id) { + return request({ + url: '/activityInfo/info/' + id, + method: 'get' + }) +} + +// 新增活动详情 +export function addInfo(data) { + return request({ + url: '/activityInfo/info', + method: 'post', + data: data + }) +} + +// 修改活动详情 +export function updateInfo(data) { + return request({ + url: '/activityInfo/info', + method: 'put', + data: data + }) +} + +// 删除活动详情 +export function delInfo(id) { + return request({ + url: '/activityInfo/info/' + id, + method: 'delete' + }) +} diff --git a/main.js b/main.js index 3ff3274..fcae548 100644 --- a/main.js +++ b/main.js @@ -6,10 +6,16 @@ import './permission.js' // permission import iconConfig from './utils/icon/icon.js' // main.js import uviewPlus from 'uview-plus' - +import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi' export function createApp() { const app = createSSRApp(App) app.config.globalProperties.iconConfig = iconConfig + app.config.globalProperties.parseTime = parseTime + app.config.globalProperties.resetForm = resetForm +app.config.globalProperties.handleTree = handleTree +app.config.globalProperties.addDateRange = addDateRange +app.config.globalProperties.selectDictLabel = selectDictLabel +app.config.globalProperties.selectDictLabels = selectDictLabels app.use(uviewPlus) app.use(store) diff --git a/pages/activity/index.vue b/pages/activity/index.vue index b9f5e53..038c2fd 100644 --- a/pages/activity/index.vue +++ b/pages/activity/index.vue @@ -48,10 +48,11 @@ - \ No newline at end of file diff --git a/pages/common/activityList/index.vue b/pages/common/activityList/index.vue index 05f81c7..7216e40 100644 --- a/pages/common/activityList/index.vue +++ b/pages/common/activityList/index.vue @@ -5,7 +5,7 @@ - {{ item.title }} + {{ item.acTitle }} @@ -17,16 +17,16 @@ - 活动地点:{{ item.addrs }} + 活动地点:{{ item.addres }} - + + {{ getDictLabelByValue(item.state).dictLabel }} - + @@ -42,7 +42,7 @@ import { ref, reactive, getCurrentInstance } from 'vue' import { useStore } from 'vuex'; const emit = defineEmits(['scrolltolower']); const { proxy } = getCurrentInstance(); - +const activityState = ref([])//字典 const iconConfig = proxy.iconConfig; const tu21 = iconConfig.tu21; const tu22 = iconConfig.tu22; @@ -60,6 +60,21 @@ const scrolltolower = () => { const toInfo = (item) => { proxy.$tab.navigateTo(`/pages/activity/info?id=${item.id}`); } +const getDictLabelByValue = (state) => { + const dict = activityState.value.find((dict) => dict.dictValue === state); + return dict ? dict : '未知状态'; +}; +onLoad((options) => { + getDicts('activity_state').then(e => { + activityState.value = e.data + console.log(activityState.value); + }) + +}) + +onShow(() => { + console.log('Page onShow') +}) \ No newline at end of file diff --git a/pages/common/talkState/auditFailure.vue b/pages/common/talkState/auditFailure.vue index 91ad993..c646b4b 100644 --- a/pages/common/talkState/auditFailure.vue +++ b/pages/common/talkState/auditFailure.vue @@ -1,6 +1,28 @@ \ No newline at end of file diff --git a/pages/common/talkState/publish.vue b/pages/common/talkState/publish.vue index 1e6d523..05c9713 100644 --- a/pages/common/talkState/publish.vue +++ b/pages/common/talkState/publish.vue @@ -11,10 +11,10 @@ - + - + 待审核 @@ -33,8 +33,8 @@ const emit = defineEmits(['scrolltolower']); const { proxy } = getCurrentInstance(); const iconConfig = proxy.iconConfig; -const sh2x1 = iconConfig.sh2x1; -const sh2x = iconConfig.sh2x; +const cg2x21 = iconConfig.cg2x21; +const cg2x22 = iconConfig.cg2x21; const bgColor = ref(''); bgColor.value = 'rgba(170, 0, 0, 0)' diff --git a/pages/work/index.vue b/pages/work/index.vue index ef3b22d..394f26a 100644 --- a/pages/work/index.vue +++ b/pages/work/index.vue @@ -18,6 +18,8 @@ + + @@ -56,9 +58,17 @@ const fileList1 = ref([]) function clickBannerItem(item) { - if (item === 1) { + if(item === 1){ + proxy.$tab.navigateTo('/pages/common/talkState/audit') + } + if(item === 2){ proxy.$tab.navigateTo('/pages/common/talkState/publish') } + if(item === 3){ + proxy.$tab.navigateTo('/pages/common/talkState/auditFailure') + } + + } function changeSwiper(e) { diff --git a/static/logo200.png b/static/logo200.png deleted file mode 100644 index ffa9988..0000000 Binary files a/static/logo200.png and /dev/null differ diff --git a/utils/icon/icon.js b/utils/icon/icon.js index 5caef50..6545ad8 100644 --- a/utils/icon/icon.js +++ b/utils/icon/icon.js @@ -5,9 +5,17 @@ import store from '@/store' const QNDomain = store.state.user.QNDomain const tu21 = ref(QNDomain + "home/icon/image/png/tu2-1_20240531153239639.png") const tu22 = ref(QNDomain + "home/icon/image/png/tu2-2_20240531163115818.png") +//定位 const tu51 = ref(QNDomain + "home/icon/image/png/tu5-1_20240601124004353.png") +const tu512 = ref(QNDomain + "home/icon/image/png/tu5-1-2_20240605120128566.png") +//开始 const tu52 = ref(QNDomain + "home/icon/image/png/tu5-2_20240601124010403.png") +const tu522 = ref(QNDomain + "home/icon/image/png/tu5-2-2_20240605120128561.png") +//结束 const tu53 = ref(QNDomain + "home/icon/image/png/tu5-3_20240601124016641.png") +const tu532 = ref(QNDomain + "home/icon/image/png/tu5-3-2_20240605120128565.png") + + const tu23 = ref(QNDomain + "home/icon/image/png/tu2-3_20240602093303793.png") //文件上传 const tu2x = ref(QNDomain + "home/icon/image/png/添加图片@2x_20240603101717136.png") @@ -15,8 +23,16 @@ const tu2x = ref(QNDomain + "home/icon/image/png/添加图片@2x_202406031017171 //话题发布-等待审核 const sh2x = ref(QNDomain + "home/icon/image/png/等待审核@2x_20240604202431502.png") const sh2x1 = ref(QNDomain + "home/icon/image/png/等待审核@2x1_20240604202431492.png") +//话题-发布话题 发布成功 +const cg2x21 = ref(QNDomain + "home/icon/image/png/成功@2x2 (1)_20240605100256727.png"); +const cg2x22 = ref(QNDomain + "home/icon/image/png/成功@2x2 (2)_20240605100300398.png"); +//话题-发布话题 审核失败 +const sb2x = ref(QNDomain + "home/icon/image/png/审核失败@2x_20240605101107230.png"); +const sb2x1 = ref(QNDomain + "home/icon/image/png/审核失败@2x1_20240605101107230.png"); export default { tu21,tu22,tu23,tu2x, - tu51,tu52,tu53, - sh2x,sh2x1 + tu51,tu52,tu53,tu512,tu522,tu532, + sh2x,sh2x1, + cg2x21,cg2x22, + sb2x,sb2x1, } \ No newline at end of file diff --git a/utils/request.js b/utils/request.js index 5857329..0215042 100644 --- a/utils/request.js +++ b/utils/request.js @@ -37,7 +37,7 @@ const request = config => { showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => { if (res.confirm) { store.dispatch('LogOut').then(res => { - uni.reLaunch({ url: '/pages/login' }) + uni.reLaunch({ url: '/pages/loginInfo/login' }) }) } }) diff --git a/utils/ruoyi.js b/utils/ruoyi.js new file mode 100644 index 0000000..4efca08 --- /dev/null +++ b/utils/ruoyi.js @@ -0,0 +1,246 @@ + + +/** + * 通用js方法封装处理 + * Copyright (c) 2019 ruoyi + */ + +// 日期格式化 +export function parseTime(time, pattern) { + if (arguments.length === 0 || !time) { + return null + } + const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}' + let date + if (typeof time === 'object') { + date = time + } else { + if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { + time = parseInt(time) + } else if (typeof time === 'string') { + time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), ''); + } + if ((typeof time === 'number') && (time.toString().length === 10)) { + time = time * 1000 + } + date = new Date(time) + } + const formatObj = { + y: date.getFullYear(), + m: date.getMonth() + 1, + d: date.getDate(), + h: date.getHours(), + i: date.getMinutes(), + s: date.getSeconds(), + a: date.getDay() + } + const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { + let value = formatObj[key] + // Note: getDay() returns 0 on Sunday + if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] } + if (result.length > 0 && value < 10) { + value = '0' + value + } + return value || 0 + }) + return time_str +} + +// 表单重置 +export function resetForm(refName) { + if (this.$refs[refName]) { + this.$refs[refName].resetFields(); + } +} + +// 添加日期范围 +export function addDateRange(params, dateRange, propName) { + let search = params; + search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {}; + dateRange = Array.isArray(dateRange) ? dateRange : []; + if (typeof (propName) === 'undefined') { + search.params['beginTime'] = dateRange[0]; + search.params['endTime'] = dateRange[1]; + } else { + search.params['begin' + propName] = dateRange[0]; + search.params['end' + propName] = dateRange[1]; + } + return search; +} + +// 回显数据字典 +export function selectDictLabel(datas, value) { + if (value === undefined) { + return ""; + } + var actions = []; + Object.keys(datas).some((key) => { + if (datas[key].value == ('' + value)) { + actions.push(datas[key].label); + return true; + } + }) + if (actions.length === 0) { + actions.push(value); + } + return actions.join(''); +} + +// 回显数据字典(字符串数组) +export function selectDictLabels(datas, value, separator) { + if (value === undefined || value.length ===0) { + return ""; + } + if (Array.isArray(value)) { + value = value.join(","); + } + var actions = []; + var currentSeparator = undefined === separator ? "," : separator; + var temp = value.split(currentSeparator); + Object.keys(value.split(currentSeparator)).some((val) => { + var match = false; + Object.keys(datas).some((key) => { + if (datas[key].value == ('' + temp[val])) { + actions.push(datas[key].label + currentSeparator); + match = true; + } + }) + if (!match) { + actions.push(temp[val] + currentSeparator); + } + }) + return actions.join('').substring(0, actions.join('').length - 1); +} + +// 字符串格式化(%s ) +export function sprintf(str) { + var args = arguments, flag = true, i = 1; + str = str.replace(/%s/g, function () { + var arg = args[i++]; + if (typeof arg === 'undefined') { + flag = false; + return ''; + } + return arg; + }); + return flag ? str : ''; +} + +// 转换字符串,undefined,null等转化为"" +export function parseStrEmpty(str) { + if (!str || str == "undefined" || str == "null") { + return ""; + } + return str; +} + +// 数据合并 +export function mergeRecursive(source, target) { + for (var p in target) { + try { + if (target[p].constructor == Object) { + source[p] = mergeRecursive(source[p], target[p]); + } else { + source[p] = target[p]; + } + } catch (e) { + source[p] = target[p]; + } + } + return source; +}; + +/** + * 构造树型结构数据 + * @param {*} data 数据源 + * @param {*} id id字段 默认 'id' + * @param {*} parentId 父节点字段 默认 'parentId' + * @param {*} children 孩子节点字段 默认 'children' + */ +export function handleTree(data, id, parentId, children) { + let config = { + id: id || 'id', + parentId: parentId || 'parentId', + childrenList: children || 'children' + }; + + var childrenListMap = {}; + var nodeIds = {}; + var tree = []; + + for (let d of data) { + let parentId = d[config.parentId]; + if (childrenListMap[parentId] == null) { + childrenListMap[parentId] = []; + } + nodeIds[d[config.id]] = d; + childrenListMap[parentId].push(d); + } + + for (let d of data) { + let parentId = d[config.parentId]; + if (nodeIds[parentId] == null) { + tree.push(d); + } + } + + for (let t of tree) { + adaptToChildrenList(t); + } + + function adaptToChildrenList(o) { + if (childrenListMap[o[config.id]] !== null) { + o[config.childrenList] = childrenListMap[o[config.id]]; + } + if (o[config.childrenList]) { + for (let c of o[config.childrenList]) { + adaptToChildrenList(c); + } + } + } + return tree; +} + +/** +* 参数处理 +* @param {*} params 参数 +*/ +export function tansParams(params) { + let result = '' + for (const propName of Object.keys(params)) { + const value = params[propName]; + var part = encodeURIComponent(propName) + "="; + if (value !== null && value !== "" && typeof (value) !== "undefined") { + if (typeof value === 'object') { + for (const key of Object.keys(value)) { + if (value[key] !== null && value[key] !== "" && typeof (value[key]) !== 'undefined') { + let params = propName + '[' + key + ']'; + var subPart = encodeURIComponent(params) + "="; + result += subPart + encodeURIComponent(value[key]) + "&"; + } + } + } else { + result += part + encodeURIComponent(value) + "&"; + } + } + } + return result +} + + +// 返回项目路径 +export function getNormalPath(p) { + if (p.length === 0 || !p || p == 'undefined') { + return p + }; + let res = p.replace('//', '/') + if (res[res.length - 1] === '/') { + return res.slice(0, res.length - 1) + } + return res; +} + +// 验证是否为blob格式 +export function blobValidate(data) { + return data.type !== 'application/json' +} diff --git a/utils/upload.js b/utils/upload.js index 09f4a2c..04c2423 100644 --- a/utils/upload.js +++ b/utils/upload.js @@ -38,7 +38,7 @@ export default function upload(config) { showConfirm("登录状态已过期,您可以继续留在该页面,或者重新登录?").then(res => { if (res.confirm) { store.dispatch('LogOut').then(res => { - uni.reLaunch({ url: '/pages/login/login' }) + uni.reLaunch({ url: '/pages/loginInfo/login' }) }) } })