diff --git a/components/category-bar/category-bar.vue b/components/category-bar/category-bar.vue
index fed850b..de33579 100644
--- a/components/category-bar/category-bar.vue
+++ b/components/category-bar/category-bar.vue
@@ -63,31 +63,29 @@
金久信自营
+ :class="[currentPage.includes('spot') ? 'active' : '']">
现货市场
+ :class="[currentPage.includes('enquiry') ? 'active' : '']">
下询价单
+ :class="[currentPage.includes('process') ? 'active' : '']">
找加工
-
- 找合作
-
旧货交易
金久信黄页
-
+
金久信学堂
@@ -337,8 +335,8 @@ export default {
vk.navigateTo(url);
}
},
- watch:{
- $route({meta: {pagePath}}){
+ watch: {
+ $route({meta: {pagePath}}) {
this.currentPage = pagePath
}
}
diff --git a/pages.json b/pages.json
index 8ae8972..29f2581 100644
--- a/pages.json
+++ b/pages.json
@@ -168,6 +168,14 @@
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false
}
+ },
+ {
+ "path" : "pages/article/list",
+ "style" :
+ {
+ "navigationBarTitleText" : "金久信学堂",
+ "enablePullDownRefresh" : false
+ }
}
],
"globalStyle": {
diff --git a/pages/article/list.vue b/pages/article/list.vue
new file mode 100644
index 0000000..4c280c6
--- /dev/null
+++ b/pages/article/list.vue
@@ -0,0 +1,225 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ cateList[0].name }}
+
+
+
+ {{ cateList[1].name }}
+
+
+
+ 乐邦团
+
+
+
+ {{ cateList[2].name }}
+
+
+
+ 金久信风向标
+
+
+
+ 我的学堂
+
+
+
+
+
+
+ 搜索
+
+
+
+
+
+
+ {{ item.name }}
+
+ {{ item._add_time_str }}
+ {{ item.viewNum }}人浏览
+ {{ item.downloadNum }}次下载
+ {{ item.amount === 0 ? '免费下载' : `${item.amount}元下载` }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/admin/article/category/sys/list.js b/uniCloud-aliyun/cloudfunctions/router/service/admin/article/category/sys/list.js
index ff7e340..c73819e 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/admin/article/category/sys/list.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/admin/article/category/sys/list.js
@@ -15,6 +15,10 @@ module.exports = {
res = await vk.baseDao.getTableData({
dbName: 'jjx-article-category',
+ sortArr: [
+ { name: "sort", type: "asc" },
+ { name: "_id", type: "desc" },
+ ],
});
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/admin/article/list/sys/add.js b/uniCloud-aliyun/cloudfunctions/router/service/admin/article/list/sys/add.js
index 781150a..f70dbda 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/admin/article/list/sys/add.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/admin/article/list/sys/add.js
@@ -15,7 +15,12 @@ module.exports = {
await vk.baseDao.add({
dbName: 'jjx-article',
- dataJson: data
+ dataJson: {
+ ...data, ...{
+ viewNum: 0,
+ downloadNum: 0,
+ }
+ }
});
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/admin/article/list/sys/list.js b/uniCloud-aliyun/cloudfunctions/router/service/admin/article/list/sys/list.js
index 7417b6a..3d7b80c 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/admin/article/list/sys/list.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/admin/article/list/sys/list.js
@@ -18,7 +18,7 @@ module.exports = {
foreignDB: [
{
dbName: "jjx-article-category",
- localKey: "parent_id",
+ localKey: "parentId",
foreignKey: "_id",
as: "category",
limit: 1,
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/article/category/pub/getList.js b/uniCloud-aliyun/cloudfunctions/router/service/client/article/category/pub/getList.js
new file mode 100644
index 0000000..e78b952
--- /dev/null
+++ b/uniCloud-aliyun/cloudfunctions/router/service/client/article/category/pub/getList.js
@@ -0,0 +1,28 @@
+'use strict';
+module.exports = {
+ /**
+ * XXXnameXXX
+ * @url client/article/category/pub/getList 前端调用的url参数地址
+ * data 请求参数
+ * @param {String} params1 参数1
+ */
+ main: async (event) => {
+ let { data = {}, userInfo, util, filterResponse, originalParam } = event;
+ let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
+ let { uid } = data;
+ let res = { code: 0, msg: "" };
+ // 业务逻辑开始-----------------------------------------------------------
+
+ res = await vk.baseDao.getTableData({
+ dbName: 'jjx-article-category',
+ sortArr: [
+ { name: "sort", type: "asc" },
+ { name: "_id", type: "desc" },
+ ],
+ });
+
+
+ // 业务逻辑结束-----------------------------------------------------------
+ return res;
+ }
+}
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/article/list/pub/getList.js b/uniCloud-aliyun/cloudfunctions/router/service/client/article/list/pub/getList.js
new file mode 100644
index 0000000..e8d7f3a
--- /dev/null
+++ b/uniCloud-aliyun/cloudfunctions/router/service/client/article/list/pub/getList.js
@@ -0,0 +1,35 @@
+'use strict';
+module.exports = {
+ /**
+ * XXXnameXXX
+ * @url client/article/list/pub/getList 前端调用的url参数地址
+ * data 请求参数
+ * @param {String} params1 参数1
+ */
+ main: async (event) => {
+ let {data = {}, userInfo, util, filterResponse, originalParam} = event;
+ let {customUtil, uniID, config, pubFun, vk, db, _} = util;
+ let {uid} = data;
+ let res = {code: 0, msg: ""};
+ // 业务逻辑开始-----------------------------------------------------------
+ const {pageIndex, pageSize, parentId, keyword} = data
+ const whereJson = {parentId}
+ if (vk.pubfn.isNotNull(keyword)) {
+ whereJson.name = new RegExp(keyword)
+ }
+ res = await vk.baseDao.select({
+ dbName: 'jjx-article',
+ getCount: true,
+ pageIndex,
+ pageSize,
+ whereJson,
+ sortArr: [
+ {name: "_id", type: "desc"}
+ ],
+ });
+
+
+ // 业务逻辑结束-----------------------------------------------------------
+ return res;
+ }
+}