114 lines
3.6 KiB
JavaScript
114 lines
3.6 KiB
JavaScript
"use strict";
|
|
const utils_util = require("../../../utils/util.js");
|
|
const common_vendor = require("../../../common/vendor.js");
|
|
const common_assets = require("../../../common/assets.js");
|
|
const _sfc_main = {
|
|
name: "news-view",
|
|
data() {
|
|
return {
|
|
showType: 0,
|
|
keywords: "",
|
|
//搜索关键字
|
|
getChgRateStr: utils_util.getChgRateStr,
|
|
getRateUpOrDown: utils_util.getRateUpOrDown,
|
|
getLocalDate: utils_util.getLocalDate
|
|
};
|
|
},
|
|
props: {
|
|
// 0 新闻动态 1 公司公告
|
|
type: Number,
|
|
newsList: Array,
|
|
//新闻动态数组
|
|
announcementList: Array
|
|
//公司公告数组
|
|
},
|
|
watch: {
|
|
type: {
|
|
handler(newVal) {
|
|
this.showType = newVal;
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
/**
|
|
* 点击搜索
|
|
*/
|
|
clickSearch() {
|
|
this.$emit("search", this.keywords);
|
|
},
|
|
/**
|
|
* 点击查看新闻动态
|
|
* @param {Object} item
|
|
*/
|
|
clickNewsItem(item) {
|
|
this.$emit("newsDetails", item);
|
|
},
|
|
/**
|
|
* 点击查看公司公告
|
|
* @param {Object} item
|
|
*/
|
|
clickAnnouncementItem(item) {
|
|
this.$emit("announcementDetails", item);
|
|
}
|
|
}
|
|
};
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return common_vendor.e({
|
|
a: $data.showType == 0
|
|
}, $data.showType == 0 ? {
|
|
b: common_assets._imports_0$9,
|
|
c: common_vendor.o(($event) => $options.clickSearch()),
|
|
d: $data.keywords,
|
|
e: common_vendor.o(($event) => $data.keywords = $event.detail.value),
|
|
f: common_vendor.f($props.newsList, (item, index, i0) => {
|
|
return common_vendor.e({
|
|
a: common_vendor.t(item.title),
|
|
b: common_vendor.t($data.getLocalDate(item.created_at)),
|
|
c: common_vendor.t(item.view_count),
|
|
d: common_vendor.t(item.hot_score),
|
|
e: common_vendor.t(item.event_type),
|
|
f: common_vendor.t(item.invest_score),
|
|
g: common_vendor.f(item.keywords, (kitem, kindex, i1) => {
|
|
return {
|
|
a: common_vendor.t(kitem),
|
|
b: kindex
|
|
};
|
|
}),
|
|
h: common_vendor.t(item.description),
|
|
i: item.related_avg_chg
|
|
}, item.related_avg_chg ? {} : {}, {
|
|
j: item.related_avg_chg
|
|
}, item.related_avg_chg ? {
|
|
k: common_vendor.t($data.getChgRateStr(item.related_avg_chg)),
|
|
l: common_vendor.n("chg " + ($data.getRateUpOrDown(item.related_avg_chg) ? "down" : "up")),
|
|
m: common_vendor.t($data.getChgRateStr(item.related_max_chg)),
|
|
n: common_vendor.n("chg " + ($data.getRateUpOrDown(item.related_max_chg) ? "down" : "up")),
|
|
o: common_vendor.t($data.getChgRateStr(item.related_week_chg)),
|
|
p: common_vendor.n("chg " + ($data.getRateUpOrDown(item.related_week_chg) ? "down" : "up"))
|
|
} : {}, {
|
|
q: index,
|
|
r: common_vendor.o(($event) => $options.clickNewsItem(item), index)
|
|
});
|
|
}),
|
|
g: common_assets._imports_1$16,
|
|
h: common_assets._imports_2$15,
|
|
i: common_assets._imports_3$13
|
|
} : {}, {
|
|
j: $data.showType == 1
|
|
}, $data.showType == 1 ? {
|
|
k: common_vendor.f($props.announcementList, (item, index, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.title),
|
|
b: common_vendor.t(item.announce_date),
|
|
c: common_vendor.t(item.format),
|
|
d: common_vendor.t(item.file_size),
|
|
e: index,
|
|
f: common_vendor.o(($event) => $options.clickAnnouncementItem(item), index)
|
|
};
|
|
})
|
|
} : {});
|
|
}
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pagesStock/components/news-view/news-view.js.map
|