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.json b/pages.json index fb224cb..7626c5f 100644 --- a/pages.json +++ b/pages.json @@ -7,14 +7,27 @@ "^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue" } }, - "pages": [ - // { - // "path" : "pages/common/commentArea/commentArea", - // "style" : - // { - // "navigationBarTitleText" : "评论区" - // } - // }, + "pages": [{ + "path": "pages/signln/harvestaddress", + "style": { + "navigationBarTitleText": "收货地址", + "navigationStyle": "custom" + } + }, + { + "path": "pages/signln/exdetail", + "style": { + "navigationBarTitleText": "兑换商城详情", + "navigationStyle": "custom" + } + }, + { + "path": "pages/signln/successfulexchange", + "style": { + "navigationBarTitleText": "兑换成功", + "navigationStyle": "custom" + } + }, { "path": "pages/index", "style": { @@ -24,10 +37,9 @@ } }, { - "path" : "pages/signln/signid", - "style" : - { - "navigationBarTitleText" : "签到任务", + "path": "pages/signln/signid", + "style": { + "navigationBarTitleText": "签到任务", "navigationStyle": "custom" } }, @@ -40,23 +52,12 @@ }, { - "path" : "pages/signln/exchangemall", - "style" : - { - "navigationBarTitleText" : "兑换商城", + "path": "pages/signln/exchangemall", + "style": { + "navigationBarTitleText": "兑换商城", "navigationStyle": "custom" } }, - { - "path" : "pages/signln/exdetail", - "style" : - { - "navigationBarTitleText" : "兑换商城详情", - "navigationStyle": "custom" - } - }, - - { "path": "pages/common/talkState/publish", "style": { @@ -73,18 +74,14 @@ "navigationBarTextStyle": "white" } }, - { + { "path": "pages/common/talkState/auditFailure", "style": { "navigationBarTitleText": "审核不通过", "navigationStyle": "custom", "navigationBarTextStyle": "white" } - }, - - - - + }, { "path": "pages/loginInfo/login", "style": { @@ -96,52 +93,56 @@ "style": { "navigationBarTitleText": "注册" } - } - , { + }, + { "path": "pages/activity/index", "style": { "navigationBarTitleText": "活动", "navigationStyle": "custom", "navigationBarTextStyle": "white" } - } - , { + }, + { "path": "pages/activity/info", "style": { "navigationBarTitleText": "活动详情", "navigationStyle": "custom", "navigationBarTextStyle": "white" } - } - , { + }, + { "path": "pages/activity/publish", "style": { "navigationBarTitleText": "发布活动", "navigationStyle": "custom", "navigationBarTextStyle": "white" } - } - , { + }, + { "path": "pages/work/index", "style": { "navigationBarTitleText": "工作台" } - }, { + }, + { "path": "pages/mine/index", "style": { "navigationBarTitleText": "我的" } - }, { + }, + { "path": "pages/mine/avatar/index", "style": { "navigationBarTitleText": "修改头像" } - }, { + }, + { "path": "pages/mine/info/index", "style": { "navigationBarTitleText": "个人信息" } - }, { + }, + { "path": "pages/mine/info/edit", "style": { "navigationBarTitleText": "编辑资料" @@ -158,32 +159,38 @@ "style": { "navigationBarTitleText": "修改密码" } - }, { + }, + { "path": "pages/mine/setting/index", "style": { "navigationBarTitleText": "应用设置" } - }, { + }, + { "path": "pages/mine/help/index", "style": { "navigationBarTitleText": "常见问题" } - }, { + }, + { "path": "pages/mine/about/index", "style": { "navigationBarTitleText": "关于我们" } - }, { + }, + { "path": "pages/common/webview/index", "style": { "navigationBarTitleText": "浏览网页" } - }, { + }, + { "path": "pages/common/textview/index", "style": { "navigationBarTitleText": "浏览文本" } - }, { + }, + { "path": "pages/search/index", "style": { "navigationBarTitleText": "搜索" @@ -195,29 +202,45 @@ "navigationBarTitleText": "添加好友" } }, + + { + "path": "pages/common/navbar/navbar_nead", + "style": { + "navigationBarTitleText": "navbar" + } + }, + { + "path": "pages/Friend/messagenotification", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "pages/Friend/addfruebd", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "pages/common/exchange/index", + "style": { + "navigationBarTitleText": "" + } + }, { "path" : "pages/post/postInfo/postInfo", - "style" : + "style" : { "navigationBarTitleText" : "话题详情" } }, { "path" : "pages/post/postPublish/postPublish", - "style" : + "style" : { "navigationBarTitleText" : "发布话题" } } - - // { - // "path": "pages/signln/signiddetails", - // "style": { - // "navigationBarTitleText": "签到明细", - // "navigationStyle": "custom" - // } - - // } ], "tabBar": { "color": "#000000", @@ -229,14 +252,12 @@ "iconPath": "static/images/tabbar/home.png", "selectedIconPath": "static/images/tabbar/home_.png", "text": "首页" - } - , { + }, { "pagePath": "pages/activity/index", "iconPath": "static/images/tabbar/tu1-4.png", "selectedIconPath": "static/images/tabbar/tu1-3.png", "text": "活动" - } - , { + }, { "pagePath": "pages/work/index", "iconPath": "static/images/tabbar/work.png", "selectedIconPath": "static/images/tabbar/work_.png", 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/file/fileUpload/index.vue b/pages/common/file/fileUpload/index.vue index b881eb6..cf0b6b0 100644 --- a/pages/common/file/fileUpload/index.vue +++ b/pages/common/file/fileUpload/index.vue @@ -42,7 +42,7 @@ const props = defineProps({ fileSize: { type: Number, default: 100 * 1024 * 1024, - }, + } }); const url = ref(''); @@ -82,7 +82,7 @@ const form = reactive({ // 新增图片 const afterRead = async (event) => { - console.log("event:", event); + let name = event.name; let lists = [].concat(event.file); let fileListLen = fileList1.value.length; @@ -113,7 +113,7 @@ const afterRead = async (event) => { }; const uploadFilePromise = async (fileInfo1, name) => { - console.log("fileInfo1:",fileInfo1); + // 主要目的的拼名字,大小,类型 let fileNameOld = [0, 1]; if (fileInfo1.name !== undefined) { @@ -130,7 +130,7 @@ const uploadFilePromise = async (fileInfo1, name) => { } //主要是为了拼接文件type(video/mp4),因为各端传入的type各有不同 fileInfo.type = fileInfo1.type + "/" + extension1[extension1.length-1]; - console.log("fileInfo.type:",fileInfo); + fileInfo.extension = extension1[1]; try { const tokenData = await getQNtoken(fileInfo); @@ -211,7 +211,7 @@ const deletePic = (e) => { const typeInfo = () => { store.dispatch('getPhoneType'); - console.log(store.state.user.phoneType); + }; // 对象转成指定字符串分隔 function listToString(list, separator) { diff --git a/pages/common/talkState/audit.vue b/pages/common/talkState/audit.vue index 91ad993..1e6d523 100644 --- a/pages/common/talkState/audit.vue +++ b/pages/common/talkState/audit.vue @@ -1,6 +1,27 @@ \ 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/signln/exchangemall.vue b/pages/signln/exchangemall.vue index a51550c..739d01d 100644 --- a/pages/signln/exchangemall.vue +++ b/pages/signln/exchangemall.vue @@ -1,104 +1,26 @@ \ No newline at end of file diff --git a/pages/signln/exdetail.vue b/pages/signln/exdetail.vue index 9e300d0..a30040a 100644 --- a/pages/signln/exdetail.vue +++ b/pages/signln/exdetail.vue @@ -6,6 +6,32 @@ + + + 立即兑换 + + + + + + 确认兑换 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/signln/harvestaddress.vue b/pages/signln/harvestaddress.vue new file mode 100644 index 0000000..32f5785 --- /dev/null +++ b/pages/signln/harvestaddress.vue @@ -0,0 +1,178 @@ + + + + + + \ No newline at end of file diff --git a/pages/signln/signid.vue b/pages/signln/signid.vue index c4dc29a..a7aee1b 100644 --- a/pages/signln/signid.vue +++ b/pages/signln/signid.vue @@ -50,69 +50,6 @@ text-align: center; color: #7E7E7E;">12日 -
  • - - - - 12日 -
  • - -
  • - - - - 12日 -
  • - -
  • - - - - 12日 -
  • - -
  • - - - - 12日 -
  • -
  • - - - - 12日 -
  • @@ -145,26 +82,40 @@ color: #7E7E7E;">12日 + + + + + + 兑换商城 + 更多 > + - + - + + \ No newline at end of file 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/permission.js b/permission.js index 805fa42..0de5fed 100644 --- a/permission.js +++ b/permission.js @@ -17,26 +17,27 @@ function checkWhite(url) { } // 页面跳转验证拦截器 -let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"]; -// list.forEach((item) => { +// let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"] +// list.forEach(item => { // uni.addInterceptor(item, { // invoke(to) { + // if (getToken()) { // if (to.url === loginPage) { -// console.log("to:", to); -// uni.reLaunch({ url: "/" }); +// console.log("to:",to); +// uni.reLaunch({ url: "/" }) // } -// return true; +// return true // } else { // if (checkWhite(to.url)) { -// return true; +// return true // } -// uni.reLaunch({ url: loginPage }); -// return false; +// uni.reLaunch({ url: loginPage }) +// return false // } // }, // fail(err) { -// console.log("错误信息:", err); -// }, -// }); -// }); +// console.log("错误信息:",err) +// } +// }) +// }) diff --git a/static/images/sign/兑换成功.png b/static/images/sign/兑换成功.png new file mode 100644 index 0000000..ea8eccb Binary files /dev/null and b/static/images/sign/兑换成功.png differ diff --git a/static/images/sign/关闭.png b/static/images/sign/关闭.png new file mode 100644 index 0000000..5b780a0 Binary files /dev/null and b/static/images/sign/关闭.png differ diff --git a/static/images/sign/右 (2).png b/static/images/sign/右 (2).png new file mode 100644 index 0000000..9bdb3f6 Binary files /dev/null and b/static/images/sign/右 (2).png differ diff --git a/static/images/sign/成功.png b/static/images/sign/成功.png new file mode 100644 index 0000000..48d5ab5 Binary files /dev/null and b/static/images/sign/成功.png differ diff --git a/static/images/sign/暂无地址.png b/static/images/sign/暂无地址.png new file mode 100644 index 0000000..fced0b5 Binary files /dev/null and b/static/images/sign/暂无地址.png differ diff --git a/static/images/sign/未选中.png b/static/images/sign/未选中.png new file mode 100644 index 0000000..53e8cd2 Binary files /dev/null and b/static/images/sign/未选中.png differ diff --git a/static/images/sign/选中.png b/static/images/sign/选中.png new file mode 100644 index 0000000..7698a47 Binary files /dev/null and b/static/images/sign/选中.png differ 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' }) }) } })