新增页面

This commit is contained in:
2023-10-19 23:23:22 +08:00
parent aa47166ae7
commit 12c2e7667e
47 changed files with 1716 additions and 54 deletions

View File

@@ -0,0 +1,38 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
require("../../store/index.js");
const api_index = require("../../api/index.js");
require("../../api/request.js");
require("../../config/index.js");
const _sfc_main = {
__name: "detail",
setup(__props) {
common_vendor.onLoad((e) => {
console.log(e);
a_info.value = JSON.parse(decodeURIComponent(e.info));
if (!e.id) {
common_vendor.index.showToast({
icon: "error",
title: "错误",
duration: 2e3
});
a_info.value = null;
return;
}
getDetail(e.id);
});
const a_info = common_vendor.ref(null);
async function getDetail(id) {
await api_index.API.getArticleDetail({ id });
}
return (_ctx, _cache) => {
var _a, _b;
return {
a: common_vendor.t((_a = a_info.value) == null ? void 0 : _a.title),
b: (_b = a_info.value) == null ? void 0 : _b.content
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-6ba0469a"], ["__file", "F:/项目2023/视力表/vision-record/pages/wikipedia/detail.vue"]]);
wx.createPage(MiniProgramPage);

View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "文章详情",
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="detailBox data-v-6ba0469a"><view class="title data-v-6ba0469a">{{a}}</view><view class="more-info small-text data-v-6ba0469a">2023-10-5</view><view class="d-content data-v-6ba0469a"><rich-text class="data-v-6ba0469a" nodes="{{b}}"/></view></view>

View File

@@ -0,0 +1,41 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.detailBox.data-v-6ba0469a {
padding: 40rpx;
}
.detailBox .more-info.data-v-6ba0469a {
text-align: right;
margin-bottom: 10rpx;
}
.detailBox .title.data-v-6ba0469a {
font-size: 32rpx;
font-weight: 900;
margin-bottom: 20rpx;
text-align: center;
}
.detailBox .d-content.data-v-6ba0469a {
line-height: 50rpx;
}

View File

@@ -1,8 +1,77 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {};
function _sfc_render(_ctx, _cache) {
return {};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "F:/项目2023/视力表/vision-record/pages/wikipedia/index.vue"]]);
require("../../store/index.js");
const api_index = require("../../api/index.js");
require("../../api/request.js");
require("../../config/index.js");
const _sfc_main = {
__name: "index",
setup(__props) {
common_vendor.onLoad(() => {
getList();
});
common_vendor.onPullDownRefresh(() => {
init();
getList();
});
common_vendor.onReachBottom(() => {
queryParams.value.page++;
getList();
});
const queryParams = common_vendor.ref({
page: 1,
pageSize: 10
});
const list = common_vendor.ref([
{
id: 1,
cover_img: "https://gwjxb.oss-cn-chengdu.aliyuncs.com/logo.png",
title: "金秋相逢 共叙合作",
reading_num: 100,
content: `
新华社北京10月18日电 金秋时节,北京再迎盛会:第三届“一带一路”国际合作高峰论坛隆重举行。
春发其华,秋收其实。
共建“一带一路”走过了第一个蓬勃十年,正值风华正茂,务当昂扬奋进,奔向下一个金色十年!
`
},
{
id: 2,
cover_img: "https://ms.bdimg.com/pacific/0/pic/1083217647_-478899572.png?x=0&y=0&h=340&w=510&vh=340.00&vw=510.00&oh=340.00&ow=510.00",
title: "金秋相逢 共叙合作",
reading_num: 100,
content: `
新华社北京10月18日电 金秋时节,北京再迎盛会:第三届“一带一路”国际合作高峰论坛隆重举行。
春发其华,秋收其实。
共建“一带一路”走过了第一个蓬勃十年,正值风华正茂,务当昂扬奋进,奔向下一个金色十年!
`
}
]);
function init() {
queryParams.page = 1;
queryParams.pageSize = 10;
}
async function getList() {
await api_index.API.getArticleList(queryParams.value);
}
function toDetail(item) {
let info = encodeURIComponent(JSON.stringify(item));
common_vendor.index.navigateTo({
url: "./detail?info=" + info + "&id=" + item.id
});
}
return (_ctx, _cache) => {
return {
a: common_vendor.f(list.value, (item, i, i0) => {
return {
a: item.cover_img,
b: common_vendor.t(item.title),
c: common_vendor.t(item.content),
d: common_vendor.o(($event) => toDetail(item))
};
})
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-e5c3f72c"], ["__file", "F:/项目2023/视力表/vision-record/pages/wikipedia/index.vue"]]);
wx.createPage(MiniProgramPage);

View File

@@ -1,4 +1,5 @@
{
"navigationBarTitleText": "百科",
"enablePullDownRefresh": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="articleBox page-box data-v-e5c3f72c"><view class="userInfoBox data-v-e5c3f72c"></view><view class="list-box data-v-e5c3f72c"><view wx:for="{{a}}" wx:for-item="item" class="lb-card data-v-e5c3f72c" bindtap="{{item.d}}"><view class="lb-left data-v-e5c3f72c"><image class="data-v-e5c3f72c" src="{{item.a}}" mode="aspectFill"></image></view><view class="lb-right data-v-e5c3f72c"><view class="lb-title data-v-e5c3f72c">{{item.b}}</view><view class="lb-content text-ellipsis-1 small-text data-v-e5c3f72c">{{item.c}}</view></view></view></view></view>

View File

@@ -0,0 +1,46 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.articleBox .list-box .lb-card.data-v-e5c3f72c {
display: flex;
align-items: center;
padding: 20rpx;
border-bottom: 2rpx solid #eaeaea;
}
.articleBox .list-box .lb-card .lb-left image.data-v-e5c3f72c {
width: 120rpx;
height: 120rpx;
margin-right: 20rpx;
}
.articleBox .list-box .lb-card .lb-right.data-v-e5c3f72c {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.articleBox .list-box .lb-card .lb-right .lb-title.data-v-e5c3f72c {
font-weight: 900;
font-size: 32rpx;
margin-bottom: 20rpx;
}