12.12 页面风格改版,增加事件详情相关概念网页跳转,增加绑定手机号功能

This commit is contained in:
尚政杰
2025-12-12 19:35:08 +08:00
parent 44842120da
commit 13c783a0ad
256 changed files with 4046 additions and 2986 deletions

View File

@@ -0,0 +1,328 @@
"use strict";
const common_vendor = require("../../../common/vendor.js");
const request_api = require("../../../request/api.js");
const common_assets = require("../../../common/assets.js");
const _sfc_main = {
data() {
return {
navH: common_vendor.inject("navHeight"),
listTop: "",
conceptId: "",
//概念id
conceptName: "",
//概念名称
weekList: ["一", "二", "三", "四", "五", "六", "日"],
monthDateList: [],
selectMonthIndex: 0,
//选中月份下标
selectMonth: "",
//选中年月
selectDateStr: "",
//交易日期选中日期
quickTimeList: ["今天", "昨天", "一周前", "一月前"],
stockList: []
//个股列表
};
},
onLoad(e) {
this.listTop = this.navH + (46 + 22) / 750 * common_vendor.inject("windowWidth");
let currentDate = /* @__PURE__ */ new Date();
let currentYear = currentDate.getFullYear();
let currentMonth = currentDate.getMonth() + 1;
let currentDay = currentDate.getDate();
this.selectMonthIndex = 20 * 12 + currentMonth - 1;
this.selectMonth = currentYear + "年" + currentMonth + "月";
this.selectDateStr = currentYear + "-" + (currentMonth > 9 ? currentMonth : "0" + currentMonth) + "-" + (currentDay > 9 ? currentDay : "0" + currentDay);
this.generateMonthDateListData();
if (e.id) {
this.conceptId = e.id;
this.getConceptHotStockData();
}
},
methods: {
/**
* 生成日历数据
*/
generateMonthDateListData() {
let currentDate = /* @__PURE__ */ new Date();
let currentYear = currentDate.getFullYear();
let currentMonth = currentDate.getMonth() + 1;
let currentDay = currentDate.getDate();
let monthDateList = [];
for (var i = currentYear - 20; i < currentYear + 20; i++) {
for (var j = 0; j < 12; j++) {
let date = new Date(i, j + 1, 0);
let firstDayOfMonth = new Date(i, j + 1, 0);
firstDayOfMonth.setDate(1);
let currentMonthDay = date.getDate();
let firstDayWeek = firstDayOfMonth.getDay() || 7;
let daysOfMonth = [];
for (var k = 1; k <= currentMonthDay; k++) {
let newDate = new Date(i, j + 1, 0);
newDate.setDate(k);
let newMonth = newDate.getMonth() + 1;
let newDay = newDate.getDate();
let time = newDate.getTime();
let date2 = i + "-" + (newMonth > 9 ? newMonth : "0" + newMonth) + "-" + (newDay > 9 ? newDay : "0" + newDay);
daysOfMonth.push({ date: date2, year: i, month: newMonth, day: newDay, isToday: i == currentYear && newMonth == currentMonth && newDay == currentDay ? true : false, isCurrentMonth: true, timestamp: time });
}
for (var k = 0; k < firstDayWeek - 1; k++) {
let year = i;
let month = j;
if (j < 1) {
year = i - 1;
month = 12;
}
let lastMonthDay = new Date(year, month, 0).getDate();
let newDate = new Date(year, month - 1, lastMonthDay - k);
let newMonth = newDate.getMonth() + 1;
let newDay = newDate.getDate();
let time = newDate.getTime();
let date2 = year + "-" + (newMonth > 9 ? newMonth : "0" + newMonth) + "-" + (newDay > 9 ? newDay : "0" + newDay);
daysOfMonth.unshift({ date: date2, year, month: newMonth, day: newDay, isToday: false, isCurrentMonth: false, timestamp: time });
}
let nextMonthFirstDay = new Date(i, j + 1, 1);
let lastDayOfMonth = new Date(nextMonthFirstDay - 24 * 60 * 60 * 1e3);
let lastDayWeek = lastDayOfMonth.getDay() || 7;
for (var k = 1; k < 8 - lastDayWeek; k++) {
let year = i;
let month = j;
if (month > 11) {
month = 0;
year++;
}
let newDate = new Date(year, month + 1, k);
let newMonth = newDate.getMonth() + 1;
let newDay = newDate.getDate();
let time = newDate.getTime();
let date2 = year + "-" + (newMonth > 9 ? newMonth : "0" + newMonth) + "-" + (newDay > 9 ? newDay : "0" + newDay);
daysOfMonth.push({ date: date2, year, month: newMonth, day: newDay, isToday: false, isCurrentMonth: false, timestamp: time });
}
monthDateList.push(daysOfMonth);
}
}
this.monthDateList = monthDateList;
},
/**
* 点击时间筛选
*/
clickDateScreen() {
this.$refs["datePopup"].open();
},
/**
* 点击展开或收起
* @param {Object} index
*/
clickExpandOrRetract(index) {
this.stockList[index].isExpand = !this.stockList[index].isExpand;
},
/**
* 点击取消
*/
clickCancel() {
this.$refs["datePopup"].close();
},
/**
* 点击确认
*/
clickConfirm() {
this.clickCancel();
this.getConceptHotStockData();
},
/**
* 点击上个月
*/
clickPreMonth() {
if (this.selectMonthIndex > 0) {
this.selectMonthIndex--;
let monthList = this.monthDateList[this.selectMonthIndex];
let year = "";
let month = "";
for (let item of monthList) {
if (item.isCurrentMonth) {
year = item.year;
month = item.month;
break;
}
}
this.selectMonth = year + "年" + month + "月";
}
},
/**
* 点击下个月
*/
clickNextMonth() {
if (this.selectMonthIndex < this.monthDateList.length - 1) {
this.selectMonthIndex++;
let monthList = this.monthDateList[this.selectMonthIndex];
let year = "";
let month = "";
for (let item of monthList) {
if (item.isCurrentMonth) {
year = item.year;
month = item.month;
break;
}
}
this.selectMonth = year + "年" + month + "月";
}
},
monthChange(e) {
let currentDate = /* @__PURE__ */ new Date();
let currentYear = currentDate.getFullYear();
let yearMonth = e.detail.value;
let selectYear = parseInt(yearMonth.split("-")[0]);
let selectMonth = parseInt(yearMonth.split("-")[1]);
this.selectMonthIndex = (selectYear - (currentYear - 20)) * 12 + selectMonth - 1;
this.selectMonth = selectYear + "年" + selectMonth + "月";
},
/**
* 点击选择开始日期和结束日期
* @param {Object} item
*/
clickSelectDate(item) {
if (this.selectDateStr != item.date) {
this.selectDateStr = item.date;
}
},
/**
* 点击快捷时间选择
*/
clickQuickTimeItem(index) {
let currentDate = /* @__PURE__ */ new Date();
let currentYear = currentDate.getFullYear();
if (index == 0) {
let currentMonth = currentDate.getMonth() + 1;
let currentDay = currentDate.getDate();
this.selectMonthIndex = 20 * 12 + currentMonth - 1;
this.selectMonth = currentYear + "年" + currentMonth + "月";
this.selectDateStr = currentYear + "-" + (currentMonth > 9 ? currentMonth : "0" + currentMonth) + "-" + (currentDay > 9 ? currentDay : "0" + currentDay);
} else if (index == 1) {
let yesterday = new Date(currentDate);
yesterday.setDate(yesterday.getDate() - 1);
let yesterdayYear = yesterday.getFullYear();
let yesterdayMonth = yesterday.getMonth() + 1;
let yesterdayDay = yesterday.getDate();
this.selectMonthIndex = (20 - (currentYear - yesterdayYear)) * 12 + yesterdayMonth - 1;
this.selectMonth = yesterdayYear + "年" + yesterdayMonth + "月";
this.selectDateStr = yesterdayYear + "-" + (yesterdayMonth > 9 ? yesterdayMonth : "0" + yesterdayMonth) + "-" + (yesterdayDay > 9 ? yesterdayDay : "0" + yesterdayDay);
} else if (index == 2) {
let weekAgo = new Date(currentDate);
weekAgo.setDate(weekAgo.getDate() - 7);
let weekAgoYear = weekAgo.getFullYear();
let weekAgoMonth = weekAgo.getMonth() + 1;
let weekAgoDay = weekAgo.getDate();
this.selectMonthIndex = (20 - (currentYear - weekAgoYear)) * 12 + weekAgoMonth - 1;
this.selectMonth = weekAgoYear + "年" + weekAgoMonth + "月";
this.selectDateStr = weekAgoYear + "-" + (weekAgoMonth > 9 ? weekAgoMonth : "0" + weekAgoMonth) + "-" + (weekAgoDay > 9 ? weekAgoDay : "0" + weekAgoDay);
} else {
let monthAgo = new Date(currentDate);
monthAgo.setDate(monthAgo.getDate() - 30);
let monthAgoYear = monthAgo.getFullYear();
let monthAgoMonth = monthAgo.getMonth() + 1;
let monthAgoDay = monthAgo.getDate();
this.selectMonthIndex = (20 - (currentYear - monthAgoYear)) * 12 + monthAgoMonth - 1;
this.selectMonth = monthAgoYear + "年" + monthAgoMonth + "月";
this.selectDateStr = monthAgoYear + "-" + (monthAgoMonth > 9 ? monthAgoMonth : "0" + monthAgoMonth) + "-" + (monthAgoDay > 9 ? monthAgoDay : "0" + monthAgoDay);
}
},
/**
* 获取概念相关个股数据
*/
getConceptHotStockData() {
let params = { trade_date: this.selectDateStr };
request_api.conceptDetails(this.conceptId, params).then((res) => {
this.conceptName = res.concept;
this.stockList = res.stocks;
}).catch((error) => {
});
}
}
};
if (!Array) {
const _easycom_navBar2 = common_vendor.resolveComponent("navBar");
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
(_easycom_navBar2 + _easycom_uni_popup2)();
}
const _easycom_navBar = () => "../../../components/navBar/navBar.js";
const _easycom_uni_popup = () => "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
if (!Math) {
(_easycom_navBar + _easycom_uni_popup)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.p({
leftText: "热门个股",
hideNavBg: true
}),
b: common_assets._imports_0,
c: common_vendor.t($data.conceptName),
d: common_assets._imports_1$8,
e: common_vendor.o(($event) => $options.clickDateScreen()),
f: common_vendor.s("top:" + $data.navH + "px;"),
g: common_vendor.f($data.stockList, (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.stock_name),
b: common_vendor.t(item.stock_code),
c: item.isExpand
}, item.isExpand ? {
d: common_assets._imports_2$7
} : {
e: common_assets._imports_3$7
}, {
f: common_vendor.o(($event) => $options.clickExpandOrRetract(index), index),
g: item.isExpand
}, item.isExpand ? {
h: common_vendor.t(item.reason)
} : {}, {
i: index
});
}),
h: common_vendor.s("top:" + $data.listTop + "px;"),
i: common_vendor.o(($event) => $options.clickCancel()),
j: common_vendor.o(($event) => $options.clickConfirm()),
k: common_assets._imports_4$2,
l: common_vendor.o(($event) => $options.clickPreMonth()),
m: common_vendor.t($data.selectMonth),
n: common_vendor.o((...args) => $options.monthChange && $options.monthChange(...args)),
o: common_assets._imports_5$1,
p: common_vendor.o(($event) => $options.clickNextMonth()),
q: common_vendor.f($data.weekList, (item, index, i0) => {
return {
a: common_vendor.t(item),
b: index
};
}),
r: common_vendor.f($data.monthDateList[$data.selectMonthIndex], (item, index, i0) => {
return common_vendor.e({
a: item.date == $data.selectDateStr
}, item.date == $data.selectDateStr ? {
b: common_vendor.t(item.day)
} : common_vendor.e({
c: !item.isCurrentMonth
}, !item.isCurrentMonth ? {
d: common_vendor.t(item.day)
} : {
e: common_vendor.t(item.day)
}), {
f: index,
g: common_vendor.o(($event) => $options.clickSelectDate(item), index)
});
}),
s: common_vendor.f($data.quickTimeList, (item, index, i0) => {
return {
a: common_vendor.t(item),
b: index,
c: common_vendor.o(($event) => $options.clickQuickTimeItem(index), index)
};
}),
t: common_vendor.sr("datePopup", "0dffb7e7-1"),
v: common_vendor.p({
type: "bottom",
safeArea: false
})
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/concept/hotStock/hotStock.js.map

View File

@@ -0,0 +1,7 @@
{
"navigationBarTitleText": "",
"usingComponents": {
"nav-bar": "../../../components/navBar/navBar",
"uni-popup": "../../../uni_modules/uni-popup/components/uni-popup/uni-popup"
}
}

View File

@@ -0,0 +1 @@
<view><nav-bar wx:if="{{a}}" u-i="0dffb7e7-0" bind:__l="__l" u-p="{{a}}"></nav-bar><image class="topBg absolute" src="{{b}}" mode="widthFix"></image><view class="titleScreenC fixed flex" style="{{f}}"><view class="title flex1">{{c}} - 相关个股</view><view class="screenC flex" bindtap="{{e}}"><view>时间筛选</view><image class="arrow" src="{{d}}" mode="widthFix"></image></view></view><scroll-view direction="vertical" class="stockList fixed" style="{{h}}"><view class="list"><view wx:for="{{g}}" wx:for-item="item" wx:key="i" class="item"><view class="stockInfoC flex" bindtap="{{item.f}}"><view class="titleCodeC"><view class="title">{{item.a}}</view><view class="code">{{item.b}}</view></view><view class="chg flex1">+4.04%</view><view class="industry flex1">食品行业</view><view class="reasonProjectC flex"><view>REASON/项目</view><image wx:if="{{item.c}}" class="arrow expand" src="{{item.d}}" mode="widthFix"></image><image wx:else class="arrow" src="{{item.e}}" mode="widthFix"></image></view></view><view wx:if="{{item.g}}" class="reasonProjectContentC"><view class="reasonC"><text class="title">REASON</text><text>{{item.h}}</text></view><view class="projectC"><text class="title">项目:</text><text>已进入芥末味夏威夷果仁/黑金蒜香茉莉翡翠豆两款产品</text></view></view></view></view></scroll-view><uni-popup wx:if="{{v}}" class="r" u-s="{{['d']}}" u-r="datePopup" u-i="0dffb7e7-1" bind:__l="__l" u-p="{{v}}"><view class="datePopup"><view class="btnTitleC flex"><view class="btn cancel" bindtap="{{i}}">取消</view><view class="title flex1">交易日期</view><view class="btn confirm" bindtap="{{j}}">确认</view></view><view class="yearMonthC flex"><view class="btn" bindtap="{{l}}"><image class="icon" src="{{k}}" mode="widthFix"></image></view><view class="yearMonth flex1"><picker mode="date" fields="month" bindchange="{{n}}"><view>{{m}}</view></picker></view><view class="btn" bindtap="{{p}}"><image class="icon" src="{{o}}" mode="widthFix"></image></view></view><view class="weekList flex"><view wx:for="{{q}}" wx:for-item="item" wx:key="b" class="item flex1">{{item.a}}</view></view><view class="monthDateList flexWrap"><view wx:for="{{r}}" wx:for-item="item" wx:key="f" class="item flexColumnCenter" bindtap="{{item.g}}"><block wx:if="{{item.a}}"><view class="date select">{{item.b}}</view></block><block wx:else><block wx:if="{{item.c}}"><view class="date notCurrentMonth">{{item.d}}</view></block><block wx:else><view class="date">{{item.e}}</view></block></block></view></view><view class="quickTimeC flexCenter"><view wx:for="{{s}}" wx:for-item="item" wx:key="b" class="item" bindtap="{{item.c}}">{{item.a}}</view></view></view></uni-popup></view>

View File

@@ -0,0 +1,205 @@
page {
background-color: #070707;
}
.topBg {
top: 0;
left: 0;
width: 100%;
height: auto;
}
.titleScreenC {
background-color: #FFF9F5;
left: 0;
right: 0;
margin: 0 25rpx;
padding: 22rpx 25rpx 0;
border-radius: 10rpx 10rpx 0 0;
}
.titleScreenC .title {
font-size: 28rpx;
font-weight: bold;
color: #2B2B2B;
}
.titleScreenC .screenC {
padding: 0 20rpx;
line-height: 42rpx;
border-radius: 23rpx;
border: solid 2rpx #F3C368;
font-size: 22rpx;
color: #E3AA3D;
}
.titleScreenC .screenC .arrow {
margin-left: 7rpx;
width: 12rpx;
height: auto;
}
.stockList {
background-color: #FFF9F5;
left: 0;
width: calc(100% - 50rpx);
bottom: 62rpx;
margin: 0 25rpx;
border-radius: 0 0 10rpx 10rpx ;
}
.stockList .list {
padding: 16rpx 25rpx;
}
.stockList .list .item {
background-color: white;
box-shadow: 0 5rpx 10rpx 0 rgba(127, 127, 127, 0.08);
margin-bottom: 20rpx;
padding: 0 20rpx;
border-radius: 10rpx;
}
.stockList .list .item .stockInfoC {
padding: 16rpx 0;
}
.stockList .list .item .stockInfoC .titleCodeC .title {
font-size: 26rpx;
font-weight: bold;
color: #222;
}
.stockList .list .item .stockInfoC .titleCodeC .code {
font-size: 20rpx;
font-weight: 500;
color: #888;
}
.stockList .list .item .stockInfoC .chg {
font-size: 24rpx;
font-weight: bold;
text-align: center;
}
.stockList .list .item .stockInfoC .chg.up {
color: #EC3440;
}
.stockList .list .item .stockInfoC .chg.down {
color: #38A169;
}
.stockList .list .item .stockInfoC .industry {
font-size: 24rpx;
font-weight: 500;
color: #333;
text-align: center;
}
.stockList .list .item .stockInfoC .reasonProjectC {
font-size: 24rpx;
font-weight: 500;
color: #DA9000;
}
.stockList .list .item .stockInfoC .reasonProjectC .arrow {
margin-left: 10rpx;
width: 10rpx;
height: auto;
}
.stockList .list .item .stockInfoC .reasonProjectC .arrow.expand {
margin-left: 6rpx;
width: 14rpx;
height: auto;
}
.stockList .list .item .reasonProjectContentC {
margin: 0 5rpx;
border-top: solid 1rpx #F0F0F0;
padding: 12rpx 9rpx 22rpx;
font-size: 24rpx;
font-weight: 500;
color: #666;
}
.stockList .list .item .reasonProjectContentC .title {
color: #DA9000;
}
.stockList .list .item .reasonProjectContentC .projectC {
margin-top: 6rpx;
}
.datePopup {
background-color: white;
padding-bottom: env(safe-area-inset-bottom);
border-radius: 20rpx 20rpx 0 0;
}
.datePopup .btnTitleC .btn {
padding: 20rpx 26rpx;
font-size: 28rpx;
font-weight: 500;
}
.datePopup .btnTitleC .btn.cancel {
color: #727A8E;
}
.datePopup .btnTitleC .btn.confirm {
color: #D79412;
}
.datePopup .btnTitleC .title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
}
.datePopup .yearMonthC {
background-color: #F7F7F7;
margin: 0 25rpx;
height: 70rpx;
border-radius: 35rpx;
}
.datePopup .yearMonthC .btn {
padding: 0 52rpx;
}
.datePopup .yearMonthC .btn .icon {
width: 13rpx;
height: auto;
}
.datePopup .yearMonthC .yearMonth {
font-size: 32rpx;
font-weight: 500;
color: #070707;
text-align: center;
}
.datePopup .weekList {
padding: 0 38rpx;
}
.datePopup .weekList .item {
margin-right: 13rpx;
line-height: 72rpx;
font-size: 26rpx;
font-weight: 500;
color: #A7A7A7;
text-align: center;
}
.datePopup .monthDateList {
padding: 0 38rpx;
}
.datePopup .monthDateList .item {
margin-bottom: 12rpx;
width: calc(100%/7);
}
.datePopup .monthDateList .item .date {
background-color: #f8f8f8;
width: calc(100% - 10rpx);
line-height: 64rpx;
border-radius: 15rpx;
font-size: 24rpx;
font-weight: bold;
color: #2A2A2A;
text-align: center;
}
.datePopup .monthDateList .item .date.select {
background-color: #F2C367;
color: white;
}
.datePopup .monthDateList .item .date.notCurrentMonth {
background-color: #FCFCFC;
color: #999;
}
.datePopup .quickTimeC {
margin-top: 16rpx;
}
.datePopup .quickTimeC .item {
margin-right: 25rpx;
width: 120rpx;
line-height: 56rpx;
border-radius: 30rpx;
border: solid 2rpx #4E4E4E;
font-size: 24rpx;
font-weight: 500;
color: #4E4E4E;
text-align: center;
}
.datePopup .quickTimeC .item:last-child {
margin-right: 0;
}