From a582c5e508d4e171fbf633aace6c2dc975ac28bf Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq,com> Date: Fri, 22 Mar 2024 17:14:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E8=AE=AF=E4=B8=AD=E5=BF=83=E5=BC=80?= =?UTF-8?q?=E5=8F=91=EF=BC=8C=E5=88=86=E7=B1=BB=E5=85=A8=E9=83=A8=E6=A0=87?= =?UTF-8?q?=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/category/index.js | 38 ++- core/app.js | 7 +- pages.json | 18 +- pages/category/consulting/detail.vue | 269 ++++++++++++++++++++ pages/category/consulting/list.vue | 344 +++++++++++++++++++++++++ pages/category/index.vue | 359 +++++++++++++++------------ 6 files changed, 875 insertions(+), 160 deletions(-) create mode 100644 pages/category/consulting/detail.vue create mode 100644 pages/category/consulting/list.vue diff --git a/api/category/index.js b/api/category/index.js index 7198be0..7cc810e 100644 --- a/api/category/index.js +++ b/api/category/index.js @@ -2,10 +2,46 @@ import request from '@/utils/request' // api地址 const api = { - list: 'category/list' + list: 'category/list', + consultingContextList: 'AgencyAddress/ConsultingContext/getList', + consultingContextSelection: 'AgencyAddress/ConsultingContext/getSelection', + consultingContextInfo: 'AgencyAddress/ConsultingContext/getInfo', } // 页面数据 export function list() { return request.get(api.list) } + +// 资讯中心列表 +export function consultingContextList(param) { + let paramArr = []; + for (let key in param) { + paramArr.push(key + '=' + param[key]) + } + let paramStr = '?' + paramArr.join('&') + return request.get(api.consultingContextList + paramStr) +} + +// 资讯信息详情 +export function consultingContextInfo(contextId) { + return request.get(api.consultingContextInfo + '?contextId=' + contextId) +} + +// 获取资讯中心列表分类 +export function consultingContextSelection() { + return request.get(api.consultingContextSelection) +} + +/** + * 加载更多列表数据 + * @param {Object} resList 新列表数据 + * @param {Object} oldList 旧列表数据 + * @param {int} pageNo 当前页码 + */ +export const getMoreListData = (resList, oldList, pageNo) => { + // 如果是第一页需手动制空列表 + if (pageNo == 1) oldList = [] + // 合并新数据 + return oldList.concat(resList) +} \ No newline at end of file diff --git a/core/app.js b/core/app.js index a1b0bc3..d6d5f94 100644 --- a/core/app.js +++ b/core/app.js @@ -105,7 +105,12 @@ export const navTo = (url, query = {}, modo = 'navigateTo') => { return true } // 生成query参数 - const queryStr = !util.isEmpty(query) ? '?' + util.urlEncode(query) : '' + let queryArr = []; + for (let key in query) { + queryArr.push(key + '=' + query[key]) + } + let paramStr = queryArr.join('&') + const queryStr = !util.isEmpty(query) ? '?' + paramStr : '' // 普通页面, 使用navigateTo modo === 'navigateTo' && uni.navigateTo({ url: `/${url}${queryStr}` diff --git a/pages.json b/pages.json index 7404a85..82cae8c 100644 --- a/pages.json +++ b/pages.json @@ -37,7 +37,23 @@ { "path": "pages/category/index", "style": { - "navigationBarTitleText": "全部分类" + "navigationBarTitleText": "全部分类", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#1c223b" + } + }, + { + "path": "pages/category/consulting/list", + "style": { + "navigationBarTitleText": "资讯中心", + "enablePullDownRefresh" : false + } + }, + { + "path": "pages/category/consulting/detail", + "style": { + "navigationBarTitleText": "阅读全文", + "enablePullDownRefresh" : false } }, { diff --git a/pages/category/consulting/detail.vue b/pages/category/consulting/detail.vue new file mode 100644 index 0000000..b52d988 --- /dev/null +++ b/pages/category/consulting/detail.vue @@ -0,0 +1,269 @@ + + + + + + diff --git a/pages/category/consulting/list.vue b/pages/category/consulting/list.vue new file mode 100644 index 0000000..ee39b9e --- /dev/null +++ b/pages/category/consulting/list.vue @@ -0,0 +1,344 @@ + + + + + + diff --git a/pages/category/index.vue b/pages/category/index.vue index 61177da..e6799c5 100644 --- a/pages/category/index.vue +++ b/pages/category/index.vue @@ -1,44 +1,60 @@