78 lines
2.6 KiB
JavaScript
78 lines
2.6 KiB
JavaScript
"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: "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);
|