From 3de9f712ee8235fb90fc0b78c8c9b6e4833e8595 Mon Sep 17 00:00:00 2001 From: "yang.yongquan" <3395816735@qq.com> Date: Thu, 6 Jul 2023 15:26:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=A6=E6=83=85=E7=95=8C=E9=9D=A2=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=E6=8E=A5=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AicsKnowledgeBase/qml/MainWindow.qml | 6 -- AicsKnowledgeBase/qml/page/ContentPage.qml | 105 ++++++++++----------- AicsKnowledgeBase/qml/page/NotePage.qml | 3 +- 3 files changed, 49 insertions(+), 65 deletions(-) diff --git a/AicsKnowledgeBase/qml/MainWindow.qml b/AicsKnowledgeBase/qml/MainWindow.qml index 7e1eb3c..4146215 100644 --- a/AicsKnowledgeBase/qml/MainWindow.qml +++ b/AicsKnowledgeBase/qml/MainWindow.qml @@ -54,12 +54,6 @@ FluWindow { } } - StackView { - id: stack_view - Layout.fillHeight: true - Layout.fillWidth: true - - } ContentPage { Layout.fillHeight: true diff --git a/AicsKnowledgeBase/qml/page/ContentPage.qml b/AicsKnowledgeBase/qml/page/ContentPage.qml index fccba38..8fda1f2 100644 --- a/AicsKnowledgeBase/qml/page/ContentPage.qml +++ b/AicsKnowledgeBase/qml/page/ContentPage.qml @@ -9,6 +9,7 @@ import AicsKB.FileTransferManager import SignalFileOperation 1.0 import "qrc:///AicsKnowledgeBase/qml/page" import "qrc:///AicsKnowledgeBase/qml/component" +import "qrc:///AicsKnowledgeBase/qml/global" FluArea { Popup { @@ -55,6 +56,7 @@ FluArea { target: SignalFileOperation function onOpen(file) { content_area.visible = true + content_page.loadFile(file) } } @@ -66,27 +68,59 @@ FluArea { rightPadding: 10 bottomPadding: 0 - property int likeCount: 0 + property string fileId property int favoriteCount: 0 property int shareCount: 0 property int browsCount: 555 - property bool isLike: false property bool isFavorite: false property bool isDownload: false property double fileSize: 455 + property string title: "文章标题" property list tags: ["tag 1", "tag 2", "tag 3"] - property date publishTime: new Date() + property string publishTime: "2020-01-01" property string brief: "这是一个简介" + function getType(suffix) { + if(suffix === "md") + return "MD" + else if(suffix === "mp4" || suffix === "avi" + || suffix === "rmvb" || suffix === "rm" + || suffix === "wmv" || suffix === "mkv") + return "VIDEO" + else return "OTHER" + } + + function loadFile(knowledgeFileId) { + content_area.knowledgeFileId = knowledgeFileId + console.log(knowledgeFileId) + Request.get("knowledge/" + knowledgeFileId, function (response, data) { + content_page.publishTime = data.createTime + content_page.title = data.name + content_page.fileId = data.knowledgeFileAttribute.id + + content_area.type = data.knowledgeFileAttribute.suffix + + var tagString = "" + for (var j = 0; j < data.knowledgeFileAttribute.tags.length; j++) { + if (j != 0) + tagString = tagString + "," + tagString = tagString + data.knowledgeFileAttribute.tags[j].name + } + content_page.tags = tagString.split(",") + + content_page.brief = data.knowledgeFileAttribute.brief + content_page.browsCount = data.knowledgeFileAttribute.pageView + + var starers = data.knowledgeFileAttribute.starers + for(var i=0; i