Commit 4f66d166 by yanglang123

commit

parent d4d077ae
/*
* Eslint config file
* Documentation: https://eslint.org/docs/user-guide/configuring/
* Install the Eslint extension before using this feature.
*/
module.exports = {
env: {
es6: true,
browser: true,
node: true,
},
ecmaFeatures: {
modules: true,
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
globals: {
wx: true,
App: true,
Page: true,
getCurrentPages: true,
getApp: true,
Component: true,
requirePlugin: true,
requireMiniProgram: true,
},
// extends: 'eslint:recommended',
rules: {},
}
# Windows
[Dd]esktop.ini
Thumbs.db
$RECYCLE.BIN/
# macOS
.DS_Store
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
# Node.js
node_modules/
// app.js
App({
onLaunch() {
// 展示本地存储能力
const logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
})
},
globalData: {
userInfo: null
}
})
{
"pages": [
"pages/login/index",
"pages/home/index",
"pages/activity/index",
"pages/activity/activyDetail/index",
"pages/searchInfo/index",
"pages/mine/index",
"pages/NewsMessage/index",
"pages/changePsd/index",
"pages/h5Link/index",
"pages/mine/myLeaveMessage/index",
"pages/mine/messageBox/index",
"pages/mine/myAppeal/index",
"pages/mine/myAppeal/detail/index",
"pages/mine/myComment/index",
"pages/mine/myContribute/index",
"pages/mine/myintegral/index",
"pages/mine/myCollection/index",
"pages/mine/browsingHistory/index",
"pages/mine/userInfo/index",
"pages/mine/aboutZhdj/index",
"pages/NewsMessage/news/index",
"pages/workTask/index",
"pages/allDescribe/index",
"pages/questionnaire/index",
"pages/vote/index",
"pages/vote/theCharts/index",
"pages/vote/detail/index",
"pages/contribute/index",
"pages/trainingAndTest/index",
"pages/trainingAndTest/examDetail/index",
"pages/trainingAndTest/examHistory/index",
"pages/trainingAndTest/examQuestion/index",
"pages/trainingAndTest/examResult/index"
],
"tabBar": {
"color": "#7A7E83",
"selectedColor": "#E35B45",
"borderStyle": "black",
"backgroundColor": "#F8F8F8",
"list": [{
"pagePath": "pages/home/index",
"iconPath": "static/home.png",
"selectedIconPath": "static/home-active.png",
"text": "首页"
},
{
"pagePath": "pages/activity/index",
"iconPath": "static/activity.png",
"selectedIconPath": "static/activity-active.png",
"text": "日历"
},
{
"pagePath": "pages/mine/index",
"iconPath": "static/mine.png",
"selectedIconPath": "static/mine-active.png",
"text": "我的"
}
]
},
"window": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "机电e先锋 v1.0.3",
"navigationBarBackgroundColor": "#D23A29"
},
"style": "v2",
"componentFramework": "glass-easel",
"sitemapLocation": "sitemap.json",
"lazyCodeLoading": "requiredComponents"
}
/**app.wxss**/
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1743039921828, function(require, module, exports) {
var charenc = {
// UTF-8 encoding
utf8: {
// Convert a string to a byte array
stringToBytes: function(str) {
return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
},
// Convert a byte array to a string
bytesToString: function(bytes) {
return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
}
},
// Binary encoding
bin: {
// Convert a string to a byte array
stringToBytes: function(str) {
for (var bytes = [], i = 0; i < str.length; i++)
bytes.push(str.charCodeAt(i) & 0xFF);
return bytes;
},
// Convert a byte array to a string
bytesToString: function(bytes) {
for (var str = [], i = 0; i < bytes.length; i++)
str.push(String.fromCharCode(bytes[i]));
return str.join('');
}
}
};
module.exports = charenc;
}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1743039921828);
})()
//miniprogram-npm-outsideDeps=[]
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"sources":["charenc.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["var charenc = {\n // UTF-8 encoding\n utf8: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));\n }\n },\n\n // Binary encoding\n bin: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n for (var bytes = [], i = 0; i < str.length; i++)\n bytes.push(str.charCodeAt(i) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n for (var str = [], i = 0; i < bytes.length; i++)\n str.push(String.fromCharCode(bytes[i]));\n return str.join('');\n }\n }\n};\n\nmodule.exports = charenc;\n"]}
\ No newline at end of file
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1743039921829, function(require, module, exports) {
const { base64ToBit, checkDate } = require('./utils');
const { getSolarTerm } = require('./solar_term');
const table = [];
const heavenlyStemStr = '甲乙丙丁戊己庚辛壬癸';
const earthlyBranchStr = '子丑寅卯辰巳午未申酉戌亥';
const zodiacStr = '鼠牛虎兔龙蛇马羊猴鸡狗猪';
const lunarMonthStr = '正二三四五六七八九十冬腊';
const nubmerStr = '一二三四五六七八九十';
function decompressData() {
const base64Str = 'hLaCVwUrqpNDSYNlUaqgrUE1pJXQSuak2FJoaSrqlC1QNailtBK26TcElwpLWyWDUoNqJW1ArYJVySXgkuzJYNSg6lVtSC1oFbHJuCS58loZKhqU20oLVQVqSq2BLoSWlkrCpV7SoNlBaqqrUE2gpbNSuClcVKg6VBqpq1QVaglslK4KVwUmPpMGyrrVQVqCW1UroJWhSamk0NJY1ShaoFtTS2glbBJtKS4Ul1ZLBqUG1GraBVsEq6pLwSXBks2pQdSw1lBawKtlk2hJcGSyalQ1KDaUlqoK1PVbAl0JLVyVhUqFpSWqgrVlVqCXQUtspXBSsKk0dKg1UFapJtQS2alcFJwaTL0mDVMFqja1BLbaV0ErQpNbSWGkoapLtUC1oFbSStgk29JcKSwqlW1KDaQVtGq2CTeEl4JLgyWzUoOpQaqSrYFVwSXHkuDJZ9SoalBtKq1UFagptRS6ClsVKwqVC0prVQVqgq0lLoKWwUrOpODSbuUwaqCtVU2oJbBSuik4NFo6TBqkG1TNagVtBK5KToUWhoqWyUNUg';
const bitStr = base64ToBit(base64Str);
let solarDate = { y: 1900, m: 1, d: 31, obj: new Date(1900, 0, 31, 0, 0, 0, 0) };
let heavenlyStem = 6; // 天干
let earthlyBranch = 0; // 地支
for (let i = 0; i < bitStr.length; ) {
if (i + 16 >= bitStr.length) {
break;
}
const head = bitStr.substr(i, 4);
i += 4;
const leapMonth = +`0b${head}`;
const monthCount = leapMonth > 0 ? 13 : 12;
const months = bitStr.substr(i, monthCount).split('').map(o => +o);
i += monthCount;
table.push({
solarDate,
leapMonth,
months,
heavenlyStem,
earthlyBranch
});
const dateCount = monthCount*29 + months.filter(o => o == 1).length;
const newSolarDate = new Date(solarDate.y, solarDate.m - 1, solarDate.d + dateCount, 0, 0, 0, 0);
solarDate = {
y: newSolarDate.getFullYear(),
m: newSolarDate.getMonth() + 1,
d: newSolarDate.getDate(),
obj: newSolarDate
};
heavenlyStem = (heavenlyStem + 1) % 10;
earthlyBranch = (earthlyBranch + 1) % 12;
}
}
decompressData();
function isBefore(base, target) {
if (base.y != target.y) {
return base.y > target.y;
} else if (base.m != target.m) {
return base.m > target.m;
} else if (base.d != target.d) {
return base.d > target.d;
}
return false;
}
function getLunarStr(month, date, isLeap) {
const monthStr = `${isLeap ? '闰' : ''}${lunarMonthStr[month - 1]}月`;
if (date <= 10) {
return `${monthStr}${nubmerStr[date - 1]}`;
} else if (date < 20) {
return `${monthStr}${nubmerStr[date - 11]}`;
} else if (date == 20) {
return `${monthStr}廿十`;
} else if (date > 20) {
return `${monthStr}廿${nubmerStr[date - 21]}`;
} else {
return `${monthStr}三十`;
}
}
function getLunar(year, month, date) {
year = Math.floor(+year);
month = Math.floor(+month);
date = Math.floor(+date);
checkDate(year, month, date);
let index = year - 1900;
let row = table[index];
if (isBefore(row.solarDate, { y: year, m: month, d: date })) {
index -= 1;
row = table[index];
}
if (!row) {
throw new Error('Invalid Date');
}
const targetDate = new Date(year, month - 1, date, 0, 0, 0, 0);
let delta = Math.round((targetDate.getTime() - row.solarDate.obj.getTime()) / (24*60*60*1000));
let afterLeap = false;
for(let i = 0; i < row.months.length; i++) {
const isLeap = row.leapMonth > 0 && i == row.leapMonth;
if (isLeap) {
afterLeap = true;
}
const days = 29 + row.months[i];
if (delta < days) {
let lunarMonth = afterLeap ? i : i + 1;
return {
lunarMonth,
lunarDate: delta + 1,
isLeap,
solarTerm: getSolarTerm(year, month, date),
lunarYear: `${heavenlyStemStr[row.heavenlyStem]}${earthlyBranchStr[row.earthlyBranch]}年`,
zodiac: `${zodiacStr[row.earthlyBranch]}`,
dateStr: getLunarStr(lunarMonth, delta + 1, isLeap)
};
} else {
delta -= days;
}
}
throw new Error(`There's something wrong!`);
}
module.exports = { getLunar };
}, function(modId) {var map = {"./utils":1743039921830,"./solar_term":1743039921831}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1743039921830, function(require, module, exports) {
function base64ToBit(base64Str) {
const base64CodeMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
const result = [];
for (let i = 0; i < base64Str.length; i++) {
let n = base64CodeMap.indexOf(base64Str[i]);
result.push(n.toString(2).padStart(6, '0'));
}
return result.join('');
}
function checkDate(year, month, date) {
if (year < 1901 || year > 2100) {
throw new Error('Invalid Year');
}
if (month < 1 || month > 12) {
throw new Error('Invalid Month');
}
if (date < 1 || date > 31) {
throw new Error('Invalid Date');
}
if ([4, 6, 9, 11].indexOf(month) != -1 && date > 30) {
throw new Error('Invalid Date');
}
if (month == 2) {
if (date > 29) {
throw new Error('Invalid Date');
} else {
let isLeap = false;
if (year % 400 == 0) {
isLeap = true
} else if (year % 4 == 0 && year % 100 != 0) {
isLeap = true;
}
if (!isLeap && date > 28) {
throw new Error('Invalid Date');
}
}
}
}
module.exports = {
base64ToBit,
checkDate,
};
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1743039921831, function(require, module, exports) {
const { base64ToBit, checkDate } = require('./utils');
// 2bit代表日期 共48bit
// 48bit -> base64 8个
// 200年一共68种情况
const names = ['小寒', '大寒', '立春', '雨水', '惊蛰', '春分', '清明', '谷雨', '立夏', '小满', '芒种',
'夏至', '小暑', '大暑', '立秋', '处暑', '白露', '秋分', '寒露', '霜降', '立冬', '小雪', '大雪', '冬至'];
const baseDate = [4, 19, 3, 18, 4, 19, 4, 19, 4, 20, 4, 20, 6, 22, 6, 22, 6, 22, 7, 22, 6, 21, 6, 21];
const table = [];
function decompressData() {
const codeStr = 'ABCDAECDAECDFGHIJKHILKMILABNOABNOAENOAENOAEPQRGSTUGSTLAVTOAWXOAWXOAYXOAYZOabcdebcQUfgThijkOilXOimXOimXOimcOnocdpqcQrsgktujkvumXvumXvumcvumcvwocxyqcz0sj10s213u243um43um53wm56wq567q589s+/0s~/3u~!3u@#3um';
const groupsStr = 'paaqmqqpqaquqqqqqvruruqq6qWaWZqlqaqqqqqqlaaqmqqppaaqqqqqqrququqqqqWaWZaVlaaampqlpaaqqqqplaWampqlqaququqqqqWZWZVVlaWaWZqlqqVZWZVVlaWaWZaVlaaqmpqpqmVZVZVVVaWaWZaVlaWampqpqlVZVZVVqVVZVVVVVaWZWZVVqVVVVVVVVaVZWZVVpaaqmpqpqVFVVVVVVaVZVZVVlaWaWZalpaaampqppVFVRVVVVWVZVZVVlaWaWpqlpVFVRVVUVVVZVVVVVaWZWZaVVFVZVVVVVFVVVVVVpVFVRUVUVFFVVVVVpVFFRUVUVFFVRVVVlVBFRUVUUFFVRVVVlVBFBEVUUFFVRVVUlVBFBEVQUFFFRUVUlVBFBEFQUFBFRUVUlVBEBEFAQFBFBEVUVVBEBEFAVVVVVVVVQFBFBEVQVVBEBEAAVVAEAEAAQFBFBEFQUFBFBUVUQFBEBEFAUFBFBEVUVQAEAAAAAFBEBEFAVQAAAAAAAFBEBEAAVAAAAAAAAFBEAEAA';
const groups = [];
for (let i = 0; i < groupsStr.length; i += 8) {
const groupBitStr = base64ToBit(groupsStr.substr(i, 8));
const group = [];
for (let j = 0; j < groupBitStr.length; j += 2) {
group.push(+`0b${groupBitStr.substr(j, 2)}`);
}
groups.push(group);
}
const codeMapStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/~!@#';
for (let i = 0; i < codeStr.length; i++) {
table.push(groups[codeMapStr.indexOf(codeStr[i])]);
}
}
decompressData();
function getSolarTerm(year, month, date) {
year = Math.floor(+year);
month = Math.floor(+month);
date = Math.floor(+date);
checkDate(year, month, date);
const index = (month - 1) * 2 + (date < 15 ? 0 : 1);
const d = baseDate[index] + table[year - 1901][index];
if (date == d) {
return names[index];
} else {
return null;
}
}
module.exports = { getSolarTerm };
}, function(modId) { var map = {"./utils":1743039921830}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1743039921829);
})()
//miniprogram-npm-outsideDeps=[]
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"sources":["lunar_calendar.js","utils.js","solar_term.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA,ADGA;ADIA,AENA;AFOA,AENA;AFOA,AENA;AFOA,AENA;AFOA,AENA;AFOA,AENA;AFOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["const { base64ToBit, checkDate } = require('./utils');\nconst { getSolarTerm } = require('./solar_term');\n\nconst table = [];\nconst heavenlyStemStr = '甲乙丙丁戊己庚辛壬癸';\nconst earthlyBranchStr = '子丑寅卯辰巳午未申酉戌亥';\nconst zodiacStr = '鼠牛虎兔龙蛇马羊猴鸡狗猪';\nconst lunarMonthStr = '正二三四五六七八九十冬腊';\nconst nubmerStr = '一二三四五六七八九十';\n\nfunction decompressData() {\n const base64Str = 'hLaCVwUrqpNDSYNlUaqgrUE1pJXQSuak2FJoaSrqlC1QNailtBK26TcElwpLWyWDUoNqJW1ArYJVySXgkuzJYNSg6lVtSC1oFbHJuCS58loZKhqU20oLVQVqSq2BLoSWlkrCpV7SoNlBaqqrUE2gpbNSuClcVKg6VBqpq1QVaglslK4KVwUmPpMGyrrVQVqCW1UroJWhSamk0NJY1ShaoFtTS2glbBJtKS4Ul1ZLBqUG1GraBVsEq6pLwSXBks2pQdSw1lBawKtlk2hJcGSyalQ1KDaUlqoK1PVbAl0JLVyVhUqFpSWqgrVlVqCXQUtspXBSsKk0dKg1UFapJtQS2alcFJwaTL0mDVMFqja1BLbaV0ErQpNbSWGkoapLtUC1oFbSStgk29JcKSwqlW1KDaQVtGq2CTeEl4JLgyWzUoOpQaqSrYFVwSXHkuDJZ9SoalBtKq1UFagptRS6ClsVKwqVC0prVQVqgq0lLoKWwUrOpODSbuUwaqCtVU2oJbBSuik4NFo6TBqkG1TNagVtBK5KToUWhoqWyUNUg';\n const bitStr = base64ToBit(base64Str);\n let solarDate = { y: 1900, m: 1, d: 31, obj: new Date(1900, 0, 31, 0, 0, 0, 0) };\n let heavenlyStem = 6; // 天干\n let earthlyBranch = 0; // 地支\n for (let i = 0; i < bitStr.length; ) {\n if (i + 16 >= bitStr.length) {\n break;\n }\n const head = bitStr.substr(i, 4);\n i += 4;\n const leapMonth = +`0b${head}`;\n const monthCount = leapMonth > 0 ? 13 : 12;\n const months = bitStr.substr(i, monthCount).split('').map(o => +o);\n i += monthCount;\n\n table.push({\n solarDate,\n leapMonth,\n months,\n heavenlyStem,\n earthlyBranch\n });\n\n const dateCount = monthCount*29 + months.filter(o => o == 1).length;\n const newSolarDate = new Date(solarDate.y, solarDate.m - 1, solarDate.d + dateCount, 0, 0, 0, 0);\n solarDate = {\n y: newSolarDate.getFullYear(),\n m: newSolarDate.getMonth() + 1,\n d: newSolarDate.getDate(),\n obj: newSolarDate\n };\n heavenlyStem = (heavenlyStem + 1) % 10;\n earthlyBranch = (earthlyBranch + 1) % 12;\n }\n}\n\ndecompressData();\n\nfunction isBefore(base, target) {\n if (base.y != target.y) {\n return base.y > target.y;\n } else if (base.m != target.m) {\n return base.m > target.m;\n } else if (base.d != target.d) {\n return base.d > target.d;\n }\n return false;\n}\n\nfunction getLunarStr(month, date, isLeap) {\n const monthStr = `${isLeap ? '闰' : ''}${lunarMonthStr[month - 1]}月`;\n if (date <= 10) {\n return `${monthStr}初${nubmerStr[date - 1]}`;\n } else if (date < 20) {\n return `${monthStr}十${nubmerStr[date - 11]}`;\n } else if (date == 20) {\n return `${monthStr}廿十`;\n } else if (date > 20) {\n return `${monthStr}廿${nubmerStr[date - 21]}`;\n } else {\n return `${monthStr}三十`;\n }\n}\n\nfunction getLunar(year, month, date) {\n year = Math.floor(+year);\n month = Math.floor(+month);\n date = Math.floor(+date);\n checkDate(year, month, date);\n let index = year - 1900;\n let row = table[index];\n if (isBefore(row.solarDate, { y: year, m: month, d: date })) {\n index -= 1;\n row = table[index];\n }\n if (!row) {\n throw new Error('Invalid Date');\n }\n const targetDate = new Date(year, month - 1, date, 0, 0, 0, 0);\n let delta = Math.round((targetDate.getTime() - row.solarDate.obj.getTime()) / (24*60*60*1000));\n let afterLeap = false;\n for(let i = 0; i < row.months.length; i++) {\n const isLeap = row.leapMonth > 0 && i == row.leapMonth;\n if (isLeap) {\n afterLeap = true;\n }\n const days = 29 + row.months[i];\n if (delta < days) {\n let lunarMonth = afterLeap ? i : i + 1;\n return {\n lunarMonth,\n lunarDate: delta + 1,\n isLeap,\n solarTerm: getSolarTerm(year, month, date),\n lunarYear: `${heavenlyStemStr[row.heavenlyStem]}${earthlyBranchStr[row.earthlyBranch]}年`,\n zodiac: `${zodiacStr[row.earthlyBranch]}`,\n dateStr: getLunarStr(lunarMonth, delta + 1, isLeap)\n };\n } else {\n delta -= days;\n }\n }\n throw new Error(`There's something wrong!`);\n}\n\nmodule.exports = { getLunar };\n","function base64ToBit(base64Str) {\n const base64CodeMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n const result = [];\n for (let i = 0; i < base64Str.length; i++) {\n let n = base64CodeMap.indexOf(base64Str[i]);\n result.push(n.toString(2).padStart(6, '0'));\n }\n return result.join('');\n}\n\nfunction checkDate(year, month, date) {\n if (year < 1901 || year > 2100) {\n throw new Error('Invalid Year');\n }\n if (month < 1 || month > 12) {\n throw new Error('Invalid Month');\n }\n if (date < 1 || date > 31) {\n throw new Error('Invalid Date');\n }\n if ([4, 6, 9, 11].indexOf(month) != -1 && date > 30) {\n throw new Error('Invalid Date');\n }\n if (month == 2) {\n if (date > 29) {\n throw new Error('Invalid Date');\n } else {\n let isLeap = false;\n if (year % 400 == 0) {\n isLeap = true\n } else if (year % 4 == 0 && year % 100 != 0) {\n isLeap = true;\n }\n if (!isLeap && date > 28) {\n throw new Error('Invalid Date');\n }\n }\n }\n}\n\nmodule.exports = {\n base64ToBit,\n checkDate,\n};","const { base64ToBit, checkDate } = require('./utils');\n\n// 2bit代表日期 共48bit\n// 48bit -> base64 8个\n// 200年一共68种情况\nconst names = ['小寒', '大寒', '立春', '雨水', '惊蛰', '春分', '清明', '谷雨', '立夏', '小满', '芒种',\n '夏至', '小暑', '大暑', '立秋', '处暑', '白露', '秋分', '寒露', '霜降', '立冬', '小雪', '大雪', '冬至'];\nconst baseDate = [4, 19, 3, 18, 4, 19, 4, 19, 4, 20, 4, 20, 6, 22, 6, 22, 6, 22, 7, 22, 6, 21, 6, 21];\n\nconst table = [];\n\nfunction decompressData() {\n const codeStr = 'ABCDAECDAECDFGHIJKHILKMILABNOABNOAENOAENOAEPQRGSTUGSTLAVTOAWXOAWXOAYXOAYZOabcdebcQUfgThijkOilXOimXOimXOimcOnocdpqcQrsgktujkvumXvumXvumcvumcvwocxyqcz0sj10s213u243um43um53wm56wq567q589s+/0s~/3u~!3u@#3um';\n const groupsStr = 'paaqmqqpqaquqqqqqvruruqq6qWaWZqlqaqqqqqqlaaqmqqppaaqqqqqqrququqqqqWaWZaVlaaampqlpaaqqqqplaWampqlqaququqqqqWZWZVVlaWaWZqlqqVZWZVVlaWaWZaVlaaqmpqpqmVZVZVVVaWaWZaVlaWampqpqlVZVZVVqVVZVVVVVaWZWZVVqVVVVVVVVaVZWZVVpaaqmpqpqVFVVVVVVaVZVZVVlaWaWZalpaaampqppVFVRVVVVWVZVZVVlaWaWpqlpVFVRVVUVVVZVVVVVaWZWZaVVFVZVVVVVFVVVVVVpVFVRUVUVFFVVVVVpVFFRUVUVFFVRVVVlVBFRUVUUFFVRVVVlVBFBEVUUFFVRVVUlVBFBEVQUFFFRUVUlVBFBEFQUFBFRUVUlVBEBEFAQFBFBEVUVVBEBEFAVVVVVVVVQFBFBEVQVVBEBEAAVVAEAEAAQFBFBEFQUFBFBUVUQFBEBEFAUFBFBEVUVQAEAAAAAFBEBEFAVQAAAAAAAFBEBEAAVAAAAAAAAFBEAEAA';\n const groups = [];\n for (let i = 0; i < groupsStr.length; i += 8) {\n const groupBitStr = base64ToBit(groupsStr.substr(i, 8));\n const group = [];\n for (let j = 0; j < groupBitStr.length; j += 2) {\n group.push(+`0b${groupBitStr.substr(j, 2)}`);\n }\n groups.push(group);\n }\n const codeMapStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/~!@#';\n for (let i = 0; i < codeStr.length; i++) {\n table.push(groups[codeMapStr.indexOf(codeStr[i])]);\n }\n}\n\ndecompressData();\n\nfunction getSolarTerm(year, month, date) {\n year = Math.floor(+year);\n month = Math.floor(+month);\n date = Math.floor(+date);\n checkDate(year, month, date);\n const index = (month - 1) * 2 + (date < 15 ? 0 : 1);\n const d = baseDate[index] + table[year - 1901][index];\n if (date == d) {\n return names[index];\n } else {\n return null;\n }\n}\n\nmodule.exports = { getSolarTerm };\n"]}
\ No newline at end of file
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1743039921832, function(require, module, exports) {
(function() {
var base64map
= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
crypt = {
// Bit-wise rotation left
rotl: function(n, b) {
return (n << b) | (n >>> (32 - b));
},
// Bit-wise rotation right
rotr: function(n, b) {
return (n << (32 - b)) | (n >>> b);
},
// Swap big-endian to little-endian and vice versa
endian: function(n) {
// If number given, swap endian
if (n.constructor == Number) {
return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;
}
// Else, assume array and swap all items
for (var i = 0; i < n.length; i++)
n[i] = crypt.endian(n[i]);
return n;
},
// Generate an array of any length of random bytes
randomBytes: function(n) {
for (var bytes = []; n > 0; n--)
bytes.push(Math.floor(Math.random() * 256));
return bytes;
},
// Convert a byte array to big-endian 32-bit words
bytesToWords: function(bytes) {
for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)
words[b >>> 5] |= bytes[i] << (24 - b % 32);
return words;
},
// Convert big-endian 32-bit words to a byte array
wordsToBytes: function(words) {
for (var bytes = [], b = 0; b < words.length * 32; b += 8)
bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);
return bytes;
},
// Convert a byte array to a hex string
bytesToHex: function(bytes) {
for (var hex = [], i = 0; i < bytes.length; i++) {
hex.push((bytes[i] >>> 4).toString(16));
hex.push((bytes[i] & 0xF).toString(16));
}
return hex.join('');
},
// Convert a hex string to a byte array
hexToBytes: function(hex) {
for (var bytes = [], c = 0; c < hex.length; c += 2)
bytes.push(parseInt(hex.substr(c, 2), 16));
return bytes;
},
// Convert a byte array to a base-64 string
bytesToBase64: function(bytes) {
for (var base64 = [], i = 0; i < bytes.length; i += 3) {
var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
for (var j = 0; j < 4; j++)
if (i * 8 + j * 6 <= bytes.length * 8)
base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));
else
base64.push('=');
}
return base64.join('');
},
// Convert a base-64 string to a byte array
base64ToBytes: function(base64) {
// Remove non-base-64 characters
base64 = base64.replace(/[^A-Z0-9+\/]/ig, '');
for (var bytes = [], i = 0, imod4 = 0; i < base64.length;
imod4 = ++i % 4) {
if (imod4 == 0) continue;
bytes.push(((base64map.indexOf(base64.charAt(i - 1))
& (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))
| (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));
}
return bytes;
}
};
module.exports = crypt;
})();
}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1743039921832);
})()
//miniprogram-npm-outsideDeps=[]
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"sources":["crypt.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["(function() {\n var base64map\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n\n crypt = {\n // Bit-wise rotation left\n rotl: function(n, b) {\n return (n << b) | (n >>> (32 - b));\n },\n\n // Bit-wise rotation right\n rotr: function(n, b) {\n return (n << (32 - b)) | (n >>> b);\n },\n\n // Swap big-endian to little-endian and vice versa\n endian: function(n) {\n // If number given, swap endian\n if (n.constructor == Number) {\n return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;\n }\n\n // Else, assume array and swap all items\n for (var i = 0; i < n.length; i++)\n n[i] = crypt.endian(n[i]);\n return n;\n },\n\n // Generate an array of any length of random bytes\n randomBytes: function(n) {\n for (var bytes = []; n > 0; n--)\n bytes.push(Math.floor(Math.random() * 256));\n return bytes;\n },\n\n // Convert a byte array to big-endian 32-bit words\n bytesToWords: function(bytes) {\n for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)\n words[b >>> 5] |= bytes[i] << (24 - b % 32);\n return words;\n },\n\n // Convert big-endian 32-bit words to a byte array\n wordsToBytes: function(words) {\n for (var bytes = [], b = 0; b < words.length * 32; b += 8)\n bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a hex string\n bytesToHex: function(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n return hex.join('');\n },\n\n // Convert a hex string to a byte array\n hexToBytes: function(hex) {\n for (var bytes = [], c = 0; c < hex.length; c += 2)\n bytes.push(parseInt(hex.substr(c, 2), 16));\n return bytes;\n },\n\n // Convert a byte array to a base-64 string\n bytesToBase64: function(bytes) {\n for (var base64 = [], i = 0; i < bytes.length; i += 3) {\n var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];\n for (var j = 0; j < 4; j++)\n if (i * 8 + j * 6 <= bytes.length * 8)\n base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));\n else\n base64.push('=');\n }\n return base64.join('');\n },\n\n // Convert a base-64 string to a byte array\n base64ToBytes: function(base64) {\n // Remove non-base-64 characters\n base64 = base64.replace(/[^A-Z0-9+\\/]/ig, '');\n\n for (var bytes = [], i = 0, imod4 = 0; i < base64.length;\n imod4 = ++i % 4) {\n if (imod4 == 0) continue;\n bytes.push(((base64map.indexOf(base64.charAt(i - 1))\n & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))\n | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));\n }\n return bytes;\n }\n };\n\n module.exports = crypt;\n})();\n"]}
\ No newline at end of file
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1743039921833, function(require, module, exports) {
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1743039921833);
})()
//miniprogram-npm-outsideDeps=[]
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"sources":["dayjs.min.js"],"names":[],"mappings":";;;;;;;AAAA","file":"index.js","sourcesContent":["!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",c=\"month\",f=\"quarter\",h=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},g=\"en\",D={};D[g]=M;var p=\"$isDayjsObject\",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if(\"string\"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split(\"-\");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate(\"s\"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v=\"set\"+(this.$u?\"UTC\":\"\");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+\"Hours\",0);case u:return $(v+\"Minutes\",1);case s:return $(v+\"Seconds\",2);case i:return $(v+\"Milliseconds\",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f=\"set\"+(this.$u?\"UTC\":\"\"),l=(n={},n[a]=f+\"Date\",n[d]=f+\"Date\",n[c]=f+\"Month\",n[h]=f+\"FullYear\",n[u]=f+\"Hours\",n[s]=f+\"Minutes\",n[i]=f+\"Seconds\",n[r]=f+\"Milliseconds\",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||\"YYYY-MM-DDTHH:mm:ssZ\",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,\"0\")},$=f||function(t,e,n){var r=t<12?\"AM\":\"PM\";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case\"YY\":return String(e.$y).slice(-2);case\"YYYY\":return b.s(e.$y,4,\"0\");case\"M\":return a+1;case\"MM\":return b.s(a+1,2,\"0\");case\"MMM\":return h(n.monthsShort,a,c,3);case\"MMMM\":return h(c,a);case\"D\":return e.$D;case\"DD\":return b.s(e.$D,2,\"0\");case\"d\":return String(e.$W);case\"dd\":return h(n.weekdaysMin,e.$W,o,2);case\"ddd\":return h(n.weekdaysShort,e.$W,o,3);case\"dddd\":return o[e.$W];case\"H\":return String(s);case\"HH\":return b.s(s,2,\"0\");case\"h\":return d(1);case\"hh\":return d(2);case\"a\":return $(s,u,!0);case\"A\":return $(s,u,!1);case\"m\":return String(u);case\"mm\":return b.s(u,2,\"0\");case\"s\":return String(e.$s);case\"ss\":return b.s(e.$s,2,\"0\");case\"SSS\":return b.s(e.$ms,3,\"0\");case\"Z\":return i}return null}(t)||i.replace(\":\",\"\")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[[\"$ms\",r],[\"$s\",i],[\"$m\",s],[\"$H\",u],[\"$W\",a],[\"$M\",c],[\"$y\",h],[\"$D\",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));"]}
\ No newline at end of file
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1743039921834, function(require, module, exports) {
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
// The _isBuffer check is for Safari 5-7 support, because it's missing
// Object.prototype.constructor. Remove this eventually
module.exports = function (obj) {
return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
}
function isBuffer (obj) {
return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
}
// For Node v0.10 support. Remove this eventually.
function isSlowBuffer (obj) {
return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
}
}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1743039921834);
})()
//miniprogram-npm-outsideDeps=[]
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh <https://feross.org>\n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n"]}
\ No newline at end of file
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1743039921836, function(require, module, exports) {
(function(){
var crypt = require('crypt'),
utf8 = require('charenc').utf8,
isBuffer = require('is-buffer'),
bin = require('charenc').bin,
// The core
md5 = function (message, options) {
// Convert to byte array
if (message.constructor == String)
if (options && options.encoding === 'binary')
message = bin.stringToBytes(message);
else
message = utf8.stringToBytes(message);
else if (isBuffer(message))
message = Array.prototype.slice.call(message, 0);
else if (!Array.isArray(message) && message.constructor !== Uint8Array)
message = message.toString();
// else, assume byte array already
var m = crypt.bytesToWords(message),
l = message.length * 8,
a = 1732584193,
b = -271733879,
c = -1732584194,
d = 271733878;
// Swap endian
for (var i = 0; i < m.length; i++) {
m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |
((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;
}
// Padding
m[l >>> 5] |= 0x80 << (l % 32);
m[(((l + 64) >>> 9) << 4) + 14] = l;
// Method shortcuts
var FF = md5._ff,
GG = md5._gg,
HH = md5._hh,
II = md5._ii;
for (var i = 0; i < m.length; i += 16) {
var aa = a,
bb = b,
cc = c,
dd = d;
a = FF(a, b, c, d, m[i+ 0], 7, -680876936);
d = FF(d, a, b, c, m[i+ 1], 12, -389564586);
c = FF(c, d, a, b, m[i+ 2], 17, 606105819);
b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);
a = FF(a, b, c, d, m[i+ 4], 7, -176418897);
d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);
c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);
b = FF(b, c, d, a, m[i+ 7], 22, -45705983);
a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);
d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);
c = FF(c, d, a, b, m[i+10], 17, -42063);
b = FF(b, c, d, a, m[i+11], 22, -1990404162);
a = FF(a, b, c, d, m[i+12], 7, 1804603682);
d = FF(d, a, b, c, m[i+13], 12, -40341101);
c = FF(c, d, a, b, m[i+14], 17, -1502002290);
b = FF(b, c, d, a, m[i+15], 22, 1236535329);
a = GG(a, b, c, d, m[i+ 1], 5, -165796510);
d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);
c = GG(c, d, a, b, m[i+11], 14, 643717713);
b = GG(b, c, d, a, m[i+ 0], 20, -373897302);
a = GG(a, b, c, d, m[i+ 5], 5, -701558691);
d = GG(d, a, b, c, m[i+10], 9, 38016083);
c = GG(c, d, a, b, m[i+15], 14, -660478335);
b = GG(b, c, d, a, m[i+ 4], 20, -405537848);
a = GG(a, b, c, d, m[i+ 9], 5, 568446438);
d = GG(d, a, b, c, m[i+14], 9, -1019803690);
c = GG(c, d, a, b, m[i+ 3], 14, -187363961);
b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);
a = GG(a, b, c, d, m[i+13], 5, -1444681467);
d = GG(d, a, b, c, m[i+ 2], 9, -51403784);
c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);
b = GG(b, c, d, a, m[i+12], 20, -1926607734);
a = HH(a, b, c, d, m[i+ 5], 4, -378558);
d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);
c = HH(c, d, a, b, m[i+11], 16, 1839030562);
b = HH(b, c, d, a, m[i+14], 23, -35309556);
a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);
d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);
c = HH(c, d, a, b, m[i+ 7], 16, -155497632);
b = HH(b, c, d, a, m[i+10], 23, -1094730640);
a = HH(a, b, c, d, m[i+13], 4, 681279174);
d = HH(d, a, b, c, m[i+ 0], 11, -358537222);
c = HH(c, d, a, b, m[i+ 3], 16, -722521979);
b = HH(b, c, d, a, m[i+ 6], 23, 76029189);
a = HH(a, b, c, d, m[i+ 9], 4, -640364487);
d = HH(d, a, b, c, m[i+12], 11, -421815835);
c = HH(c, d, a, b, m[i+15], 16, 530742520);
b = HH(b, c, d, a, m[i+ 2], 23, -995338651);
a = II(a, b, c, d, m[i+ 0], 6, -198630844);
d = II(d, a, b, c, m[i+ 7], 10, 1126891415);
c = II(c, d, a, b, m[i+14], 15, -1416354905);
b = II(b, c, d, a, m[i+ 5], 21, -57434055);
a = II(a, b, c, d, m[i+12], 6, 1700485571);
d = II(d, a, b, c, m[i+ 3], 10, -1894986606);
c = II(c, d, a, b, m[i+10], 15, -1051523);
b = II(b, c, d, a, m[i+ 1], 21, -2054922799);
a = II(a, b, c, d, m[i+ 8], 6, 1873313359);
d = II(d, a, b, c, m[i+15], 10, -30611744);
c = II(c, d, a, b, m[i+ 6], 15, -1560198380);
b = II(b, c, d, a, m[i+13], 21, 1309151649);
a = II(a, b, c, d, m[i+ 4], 6, -145523070);
d = II(d, a, b, c, m[i+11], 10, -1120210379);
c = II(c, d, a, b, m[i+ 2], 15, 718787259);
b = II(b, c, d, a, m[i+ 9], 21, -343485551);
a = (a + aa) >>> 0;
b = (b + bb) >>> 0;
c = (c + cc) >>> 0;
d = (d + dd) >>> 0;
}
return crypt.endian([a, b, c, d]);
};
// Auxiliary functions
md5._ff = function (a, b, c, d, x, s, t) {
var n = a + (b & c | ~b & d) + (x >>> 0) + t;
return ((n << s) | (n >>> (32 - s))) + b;
};
md5._gg = function (a, b, c, d, x, s, t) {
var n = a + (b & d | c & ~d) + (x >>> 0) + t;
return ((n << s) | (n >>> (32 - s))) + b;
};
md5._hh = function (a, b, c, d, x, s, t) {
var n = a + (b ^ c ^ d) + (x >>> 0) + t;
return ((n << s) | (n >>> (32 - s))) + b;
};
md5._ii = function (a, b, c, d, x, s, t) {
var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
return ((n << s) | (n >>> (32 - s))) + b;
};
// Package private blocksize
md5._blocksize = 16;
md5._digestsize = 16;
module.exports = function (message, options) {
if (message === undefined || message === null)
throw new Error('Illegal argument ' + message);
var digestbytes = crypt.wordsToBytes(md5(message, options));
return options && options.asBytes ? digestbytes :
options && options.asString ? bin.bytesToString(digestbytes) :
crypt.bytesToHex(digestbytes);
};
})();
}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1743039921836);
})()
//miniprogram-npm-outsideDeps=["crypt","charenc","is-buffer"]
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"sources":["md5.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["(function(){\r\n var crypt = require('crypt'),\r\n utf8 = require('charenc').utf8,\r\n isBuffer = require('is-buffer'),\r\n bin = require('charenc').bin,\r\n\r\n // The core\r\n md5 = function (message, options) {\r\n // Convert to byte array\r\n if (message.constructor == String)\r\n if (options && options.encoding === 'binary')\r\n message = bin.stringToBytes(message);\r\n else\r\n message = utf8.stringToBytes(message);\r\n else if (isBuffer(message))\r\n message = Array.prototype.slice.call(message, 0);\r\n else if (!Array.isArray(message) && message.constructor !== Uint8Array)\r\n message = message.toString();\r\n // else, assume byte array already\r\n\r\n var m = crypt.bytesToWords(message),\r\n l = message.length * 8,\r\n a = 1732584193,\r\n b = -271733879,\r\n c = -1732584194,\r\n d = 271733878;\r\n\r\n // Swap endian\r\n for (var i = 0; i < m.length; i++) {\r\n m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |\r\n ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;\r\n }\r\n\r\n // Padding\r\n m[l >>> 5] |= 0x80 << (l % 32);\r\n m[(((l + 64) >>> 9) << 4) + 14] = l;\r\n\r\n // Method shortcuts\r\n var FF = md5._ff,\r\n GG = md5._gg,\r\n HH = md5._hh,\r\n II = md5._ii;\r\n\r\n for (var i = 0; i < m.length; i += 16) {\r\n\r\n var aa = a,\r\n bb = b,\r\n cc = c,\r\n dd = d;\r\n\r\n a = FF(a, b, c, d, m[i+ 0], 7, -680876936);\r\n d = FF(d, a, b, c, m[i+ 1], 12, -389564586);\r\n c = FF(c, d, a, b, m[i+ 2], 17, 606105819);\r\n b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);\r\n a = FF(a, b, c, d, m[i+ 4], 7, -176418897);\r\n d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);\r\n c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);\r\n b = FF(b, c, d, a, m[i+ 7], 22, -45705983);\r\n a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);\r\n d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);\r\n c = FF(c, d, a, b, m[i+10], 17, -42063);\r\n b = FF(b, c, d, a, m[i+11], 22, -1990404162);\r\n a = FF(a, b, c, d, m[i+12], 7, 1804603682);\r\n d = FF(d, a, b, c, m[i+13], 12, -40341101);\r\n c = FF(c, d, a, b, m[i+14], 17, -1502002290);\r\n b = FF(b, c, d, a, m[i+15], 22, 1236535329);\r\n\r\n a = GG(a, b, c, d, m[i+ 1], 5, -165796510);\r\n d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);\r\n c = GG(c, d, a, b, m[i+11], 14, 643717713);\r\n b = GG(b, c, d, a, m[i+ 0], 20, -373897302);\r\n a = GG(a, b, c, d, m[i+ 5], 5, -701558691);\r\n d = GG(d, a, b, c, m[i+10], 9, 38016083);\r\n c = GG(c, d, a, b, m[i+15], 14, -660478335);\r\n b = GG(b, c, d, a, m[i+ 4], 20, -405537848);\r\n a = GG(a, b, c, d, m[i+ 9], 5, 568446438);\r\n d = GG(d, a, b, c, m[i+14], 9, -1019803690);\r\n c = GG(c, d, a, b, m[i+ 3], 14, -187363961);\r\n b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);\r\n a = GG(a, b, c, d, m[i+13], 5, -1444681467);\r\n d = GG(d, a, b, c, m[i+ 2], 9, -51403784);\r\n c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);\r\n b = GG(b, c, d, a, m[i+12], 20, -1926607734);\r\n\r\n a = HH(a, b, c, d, m[i+ 5], 4, -378558);\r\n d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);\r\n c = HH(c, d, a, b, m[i+11], 16, 1839030562);\r\n b = HH(b, c, d, a, m[i+14], 23, -35309556);\r\n a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);\r\n d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);\r\n c = HH(c, d, a, b, m[i+ 7], 16, -155497632);\r\n b = HH(b, c, d, a, m[i+10], 23, -1094730640);\r\n a = HH(a, b, c, d, m[i+13], 4, 681279174);\r\n d = HH(d, a, b, c, m[i+ 0], 11, -358537222);\r\n c = HH(c, d, a, b, m[i+ 3], 16, -722521979);\r\n b = HH(b, c, d, a, m[i+ 6], 23, 76029189);\r\n a = HH(a, b, c, d, m[i+ 9], 4, -640364487);\r\n d = HH(d, a, b, c, m[i+12], 11, -421815835);\r\n c = HH(c, d, a, b, m[i+15], 16, 530742520);\r\n b = HH(b, c, d, a, m[i+ 2], 23, -995338651);\r\n\r\n a = II(a, b, c, d, m[i+ 0], 6, -198630844);\r\n d = II(d, a, b, c, m[i+ 7], 10, 1126891415);\r\n c = II(c, d, a, b, m[i+14], 15, -1416354905);\r\n b = II(b, c, d, a, m[i+ 5], 21, -57434055);\r\n a = II(a, b, c, d, m[i+12], 6, 1700485571);\r\n d = II(d, a, b, c, m[i+ 3], 10, -1894986606);\r\n c = II(c, d, a, b, m[i+10], 15, -1051523);\r\n b = II(b, c, d, a, m[i+ 1], 21, -2054922799);\r\n a = II(a, b, c, d, m[i+ 8], 6, 1873313359);\r\n d = II(d, a, b, c, m[i+15], 10, -30611744);\r\n c = II(c, d, a, b, m[i+ 6], 15, -1560198380);\r\n b = II(b, c, d, a, m[i+13], 21, 1309151649);\r\n a = II(a, b, c, d, m[i+ 4], 6, -145523070);\r\n d = II(d, a, b, c, m[i+11], 10, -1120210379);\r\n c = II(c, d, a, b, m[i+ 2], 15, 718787259);\r\n b = II(b, c, d, a, m[i+ 9], 21, -343485551);\r\n\r\n a = (a + aa) >>> 0;\r\n b = (b + bb) >>> 0;\r\n c = (c + cc) >>> 0;\r\n d = (d + dd) >>> 0;\r\n }\r\n\r\n return crypt.endian([a, b, c, d]);\r\n };\r\n\r\n // Auxiliary functions\r\n md5._ff = function (a, b, c, d, x, s, t) {\r\n var n = a + (b & c | ~b & d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._gg = function (a, b, c, d, x, s, t) {\r\n var n = a + (b & d | c & ~d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._hh = function (a, b, c, d, x, s, t) {\r\n var n = a + (b ^ c ^ d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._ii = function (a, b, c, d, x, s, t) {\r\n var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n\r\n // Package private blocksize\r\n md5._blocksize = 16;\r\n md5._digestsize = 16;\r\n\r\n module.exports = function (message, options) {\r\n if (message === undefined || message === null)\r\n throw new Error('Illegal argument ' + message);\r\n\r\n var digestbytes = crypt.wordsToBytes(md5(message, options));\r\n return options && options.asBytes ? digestbytes :\r\n options && options.asString ? bin.bytesToString(digestbytes) :\r\n crypt.bytesToHex(digestbytes);\r\n };\r\n\r\n})();\r\n"]}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "package.json",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"charenc": {
"version": "0.0.2",
"resolved": "https://registry.npmmirror.com/charenc/-/charenc-0.0.2.tgz",
"integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA=="
},
"chinese-lunar-calendar": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/chinese-lunar-calendar/-/chinese-lunar-calendar-1.0.1.tgz",
"integrity": "sha512-T5XjtA6ygOkxjwltYf8dEB1DLsPKewDKajf74fNeT6rH2g9EZPf2AHk6vAlK/SAImTYKXoUNQ3Q4JwN0BduqRA=="
},
"crypt": {
"version": "0.0.2",
"resolved": "https://registry.npmmirror.com/crypt/-/crypt-0.0.2.tgz",
"integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow=="
},
"dayjs": {
"version": "1.11.13",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz",
"integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg=="
},
"is-buffer": {
"version": "1.1.6",
"resolved": "https://registry.npmmirror.com/is-buffer/-/is-buffer-1.1.6.tgz",
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
},
"jsbn": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/jsbn/-/jsbn-1.1.0.tgz",
"integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A=="
},
"md5": {
"version": "2.3.0",
"resolved": "https://registry.npmmirror.com/md5/-/md5-2.3.0.tgz",
"integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==",
"requires": {
"charenc": "0.0.2",
"crypt": "0.0.2",
"is-buffer": "~1.1.6"
}
},
"moment": {
"version": "2.30.1",
"resolved": "https://registry.npmmirror.com/moment/-/moment-2.30.1.tgz",
"integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how=="
},
"sm-crypto": {
"version": "0.3.13",
"resolved": "https://registry.npmmirror.com/sm-crypto/-/sm-crypto-0.3.13.tgz",
"integrity": "sha512-ztNF+pZq6viCPMA1A6KKu3bgpkmYti5avykRHbcFIdSipFdkVmfUw2CnpM2kBJyppIalqvczLNM3wR8OQ0pT5w==",
"requires": {
"jsbn": "^1.1.0"
}
}
}
}
{
"name": "package.json",
"version": "1.0.0",
"description": "小程序开发",
"repository": {
"type": "git",
"url": "git+https://github.com/yourusername/your-repo-name.git"
},
"main": ".eslintrc.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"chinese-lunar-calendar": "^1.0.1",
"dayjs": "^1.11.13",
"md5": "^2.3.0",
"moment": "^2.30.1",
"sm-crypto": "^0.3.13"
},
"bugs": {
"url": "https://github.com/yourusername/your-repo-name/issues"
},
"homepage": "https://github.com/yourusername/your-repo-name#readme",
"devDependencies": {},
"keywords": []
}
const {
get,
post
} = require('../../utils/request');
import url from '../../utils/urlconfig'
const moment = require('/miniprogram_npm/moment/index.js');
Page({
data: {
relationId: '',
relationName:'',
level:'',
typeTwo:'',
typeThree:'',
navList: [],
childNavList: [],
newsList: [],
current: 0,
childCurrent: null,
branchStyle:[
{
imgUrl:'https://hqjddj.shanghaiairport.com/api/v1/buckets/wmy/objects/download/?preview=true&prefix=zbfc3.png',
name:'系统运行党支部',
personNum:"12人",
time:"2023-10-23",
detail:'支部成立于2023年,日常主要承担虹桥机场网络、离港、航显、集成、视频监控等相关信息系统的运维工作,在日常工作中勇于创新,取得多项行业专利证书。'
},
{
imgUrl:'https://hqjddj.shanghaiairport.com/api/v1/buckets/wmy/objects/download/?preview=true&prefix=zbfc4.png',
name:'机电运行党支部',
personNum:"16人",
time:"2023-10-23",
detail:'支部成立于2023年,日常主要承担虹桥机场登机桥、行李等相关机电设备的运维工作,并曾多次在民航业的登机桥技能大赛中取得好成绩。'
},
{
imgUrl:'https://hqjddj.shanghaiairport.com/api/v1/buckets/wmy/objects/download/?preview=true&prefix=zbfc2.png',
name:'安控管理党支部',
personNum:"20人",
time:"2024-04-18",
detail:'支部成立于2018年,主要负责保障部的运行指挥、协同处置以及安全、服务、舆情、应急管理等条线工作。'
},
{
imgUrl:'https://hqjddj.shanghaiairport.com/api/v1/buckets/wmy/objects/download/?preview=true&prefix=zbfc1.png',
name:'设备工程党支部',
personNum:"20人(含1名预备党员)",
time:"2024.04.11",
detail:'支部成立于2018年,2020年成为虹桥公司基层党建示范点。部室内党员比例高达50%,日常主要承担虹桥机场离港、航显、集成、视频监控、行李、登机桥等相关系统的数字化、智慧化应用和建设,以及相关设备条线的管理工作。'
},
{
imgUrl:'https://hqjddj.shanghaiairport.com/api/v1/buckets/wmy/objects/download/?preview=true&prefix=zbfc5.png',
name:'机关、业务、IT党支部',
personNum:"21人",
time:"2024-04-11",
detail:'支部成立于2018年,日常主要承担保障部综合事务、业务招标采购、合同管理、IT项目建设、网络安全以及党纪工团等条线工作。'
}
],//支部风采
},
// 生命周期函数
onLoad: function (option) {
wx.setNavigationBarTitle({
title: option.relationName,
});
this.setData({
relationId: option.id,
relationName:option.relationName
})
let params = {
level: this.data.level,
pageNo: '1',
pageSize: '50',
relationId: this.data.relationId,
terminalName: 'MOBILE',
typeName: 'news',
typeTwo:this.data.typeTwo,
}
post(url.NewsMessageApi, params).then(res => {
let childNav = res.data.classifyNews[0].childClassifyNews
let childNum = res.data.classifyNews[0].id
this.setData({
navList: res.data.classifyNews,
childNavList:childNav,
level:'2',
typeTwo:childNum
})
this.getNewsList()
})
},
getNewsList: function () {
let params = {
level: this.data.level,
pageNo: '1',
pageSize: '50',
relationId: this.data.relationId,
terminalName: 'MOBILE',
typeName: 'news',
typeTwo:this.data.typeTwo,
}
post(url.NewsMessageApi, params).then(res => {
res.data.news.map((item) => {
item.releaseTime = moment(item.releaseTime).format("YYYY-MM-DD")
})
this.setData({
newsList: res.data.news,
})
})
},
currentNav: function (e) {
let index = e.currentTarget.dataset.index;
let childNav = this.data.navList[index].childClassifyNews;
let childId = this.data.navList[index].id;
this.setData({
current: index,
childNavList:childNav,
level:'2',
typeTwo:childId,
childCurrent:null
})
this.getNewsList()
},
currentChildNav: function (e) {
let index = e.currentTarget.dataset.index;
let childId= this.data.childNavList[index].id
this.setData({
childCurrent: index,
level:'3',
typeTwo:childId
})
this.getNewsList()
},
handleTo: function (e) {
let item = e.currentTarget.dataset.item;
wx.navigateTo({
url: '/pages/NewsMessage/news/index?id='+item.id,
})
},
});
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!--pages/NewsMessage/index.wxml-->
<view>
<scroll-view scroll-x="true" enable-flex="true" enhanced="true" show-scrollbar="false" class="scroll-view_H">
<block wx:for="{{ navList }}" wx:for-index="index" wx:key="index">
<view class="nav-item {{ current==index?'current-nav':'' }}" bindtap="currentNav" data-index="{{ index }}">
{{ item.name }}
</view>
</block>
</scroll-view>
<view class="child-nav">
<block wx:for="{{ childNavList }}" wx:for-index="index" wx:key="index">
<view class="childNav-item {{ childCurrent==index?'childCurrent-navActive':'childCurrent-nav' }}" bindtap="currentChildNav" data-index="{{ index }}">
{{ item.name }}
</view>
</block>
</view>
<view class="branch-out" wx:if="{{relationName=='支部风采'}}">
<view style="color: #fff;">支部介绍</view>
<image src="{{branchStyle[current].imgUrl}}" mode="widthFix" style="width: 100%;height: 200px;margin-top: 20px;"/>
<view class="branch-tit">{{branchStyle[current].name}}</view>
<view style="display: flex;">
<view class="branch-num">党员人数 {{branchStyle[current].personNum}}</view>
<view class="branch-time">上次换届时间 {{branchStyle[current].time}}</view>
</view>
<view class="branch-detail">{{branchStyle[current].detail}}</view>
</view>
<view class="new-out">
<block wx:for="{{ newsList }}" wx:key="id" wx:for-index="index">
<view class="new-list" bindtap="handleTo" data-item="{{ item }}">
<image wx:if="{{item.logoPath}}" style="width: 40%;height:100px;" src="{{item.logoPath}}" mode="scaleToFill" />
<view class="new-item">
<view class="new-font">{{item.fileName}}</view>
<view style="color: #999;font-size: 12px;">
{{item.releaseTime}}
</view>
</view>
</view>
</block>
</view>
</view>
\ No newline at end of file
/* 一级滚动菜单 */
.scroll-view_H {
width: 100%;
display: flex;
background-color: #D23A29;
height: 40px;
line-height: 40px;
white-space: nowrap;
margin-bottom: 4px;
padding-bottom: 5px;
}
/* // 隐藏滚动条1 */
::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
}
.nav-item {
height: 35px;
margin-right: 20rpx;
margin-left: 20rpx;
color: #fff;
}
/* 添加下边界 */
.current-nav {
border-bottom: 2px solid #fff;
}
/* 二级菜单 */
.child-nav {
width: 92%;
margin: 0 auto;
display: flex;
margin-bottom: 15px;
}
.childNav-item {
padding: 4px 12px;
border-radius: 2px;
margin-right: 10px;
}
.childCurrent-nav {
background: #f7f7f7;
color: #454343;
}
.childCurrent-navActive {
background: #ffebeb;
color: #D23A29;
}
/* 新闻信息 */
.new-out {
width: 90%;
margin: 10px auto;
padding-bottom: 20px;
}
.new-list {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
}
.new-font {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
word-break: break-all;
}
.new-item {
width: 58%;
height: 95px;
display: flex;
flex-direction: column;
justify-content: space-between;
}
/* 支部风采 */
.branch-out {
width: 90%;
margin: 10px auto;
padding: 3px 10px 8px;
background-image: url('https://hqjddj.shanghaiairport.com/api/v1/buckets/wmy/objects/download/?preview=true&prefix=20250411094624.png');
background-size: 100%;
background-repeat: no-repeat;
box-sizing: border-box;
}
.branch-tit {
font-weight: bold;
margin-top: 10px;
margin-bottom: 10px;
}
.branch-num {
font-size: 12px;
padding: 2px 4px;
background: #e7f7e8;
border: 1px solid rgba(120, 193, 127, 0.10);
border-radius: 2px;
color: #53AF5C;
margin-right: 5px;
}
.branch-time {
font-size: 12px;
padding: 2px 4px;
background: #fff5ed;
border: 1px solid rgba(255, 152, 56, 0.10);
border-radius: 2px;
color: #F5912A;
}
.branch-detail{
margin-top: 10px;
font-size: 14px;
color: #333647;
}
\ No newline at end of file
const {
get,
post
} = require('../../../utils/request');
import url from '../../../utils/urlconfig'
const {
formatRichText
} = require('../../../utils/util')
const moment = require('/miniprogram_npm/moment/index.js');
Page({
data: {
newsList: {},
favoriteState: "",
formatText: '',
newsId: ''
},
// 生命周期函数
onLoad: function (option) {
let params = {
id: option.id
}
post(url.NewsResultListApi, params).then(res => {
res.data.releaseTime = moment(res.data.releaseTime).format("YYYY-MM-DD")
this.setData({
newsList: res.data,
favoriteState: res.data.favoriteState,
newsId: option.id,
formatText: formatRichText(res.data.content)
})
})
},
});
\ No newline at end of file
{
"usingComponents": {
"my-comment":"/pages/components/comment/index"
},
"navigationBarTitleText": "资讯详情"
}
\ No newline at end of file
<!--pages/NewsMessage/news/index.wxml-->
<view style="padding-bottom: 30px;">
<!-- 标题 -->
<view class="news-item2-box">
<view class="title-span">{{newsList.fileName}}</view>
<view class="title-p">
<text>来源 {{newsList.author}} | {{newsList.releaseTime}}</text>
<text>阅读 {{newsList.readCount}}</text>
</view>
</view>
<!-- //文章 -->
<view style="width: 92%;margin:0 auto;">
<rich-text nodes="{{formatText}}"></rich-text>
</view>
<!-- 评论 -->
<view>
<my-comment uploadImgStu="{{false}}" newsId="{{newsId}}" favoriteState="{{favoriteState}}" favoriteShow="{{true}}" bizType="{{1}}"></my-comment>
</view>
</view>
\ No newline at end of file
.image_class {
max-width: 100%;
margin: 4px auto;
}
.span_class {
line-height: 20px;
}
.news-item2-box {
width: 100%;
}
.title-span {
display: block;
font-size: 20px;
margin-left: 5%;
margin-top: 5%;
width: 90%;
font-weight: 500;
color: #000;
line-height: 48px;
}
.title-p {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
color: #ABABAB;
padding: 5%;
font-size: 12px;
box-sizing: border-box;
}
\ No newline at end of file
const {
get,
post
} = require('../../../utils/request');
import url from '../../../utils/urlconfig';
const moment = require('/miniprogram_npm/moment/index.js');
const {
formatRichText
} = require('../../../utils/util')
Page({
data: {
newsId: '',
activeData: {}
},
onLoad: function (options) {
this.setData({
newsId: options.id,
})
this.getActiveDetail()
},
getActiveDetail() {
post(url.getActiveDetailApi, {
id: this.options.id
}).then(res => {
let obj = res.data.introductionVo;
obj.startTime = moment(obj.startTime).format("YYYY-MM-DD HH:mm");
obj.endTime = moment(obj.endTime).format("YYYY-MM-DD HH:mm")
obj.description = formatRichText(obj.description)
this.setData({
activeData: obj
})
})
},
/**
* 操作报名与签到
*/
handleOk() {
let data = this.data.activeData
//签到
if (data.activityStateCode == "4") {
if (data.enablePosition == 0) {
let params = {
trainingProjectId: this.options.id,
signTimeId: data.signTimeId,
signType: data.signType,
};
post(url.signInApi, params).then(() => {
wx.showToast({
title: '签到成功',
type: "success",
success: () => {
this.getActiveDetail()
}
})
})
} else {
let that = this
wx.scanCode({
// onlyFromCamera: true,
success(res) {
let obj = JSON.parse(res.result)
let params = {
trainingProjectId: obj.trainingProjectId,
signTimeId: obj.signTimeId,
signType: 1,
};
post(url.signCustomInApi, params).then(() => {
wx.showToast({
title: '签到成功',
type: "success",
success: () => {
that.getActiveDetail()
}
})
})
}
})
}
} else if(data.activityStateCode == "3"){
this.signUp()
}
},
// 报名
signUp() {
let params = {
id: this.options.id,
};
post(url.signUpApi, params).then(() => {
wx.showToast({
title: '报名成功',
type: "success",
success: () => {
this.getActiveDetail()
}
})
})
},
})
\ No newline at end of file
{
"usingComponents": {
"my-comment":"/pages/components/comment/index"
},
"navigationBarTitleText": "活动详情"
}
\ No newline at end of file
.activity-out {
width: 100%;
background-color: #f5f5f5;
min-height: 100vh;
.top-out {
width: 100%;
height: 170px;
padding: 20px;
background-image: url('https://hqjddj.shanghaiairport.com/api/v1/buckets/wmy/objects/download/?preview=true&prefix=bgicon.png');
background-size: 100%;
background-repeat: no-repeat;
display: flex;
align-items: center;
box-sizing: border-box;
.tit {
color: #fff;
.line-hidden;
}
.tit-icon {
width: 80px;
background-color: #e5e6e8;
color: #a1a1a1;
text-align: center;
padding: 4px 0px;
border-radius: 4px;
margin-top: 25px;
}
.enroll {
color: #fff;
background-color: #53af5c;
}
.enrolled {
color: #fff;
background-color: #ffba19;
}
}
.line-hidden() {
margin: 0;
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
/** 对象作为伸缩盒子模型显示 **/
-webkit-box-orient: vertical;
/** 设置或检索伸缩盒对象的子元素的排列方式 **/
-webkit-line-clamp: 2;
/** 显示的行数 **/
overflow: hidden;
/** 隐藏超出的内容 **/
}
.mid-out {
transform: translateY(-12px);
width: 92%;
margin: 0 auto;
padding: 15px;
background-color: #fff;
box-sizing: border-box;
margin-bottom: 10px;
border-radius: 8px;
.image_class {
width: 86%;
margin: 12px auto;
height: auto;
}
.mid-item {
width: 100%;
display: flex;
color: #333;
margin-bottom: 5px;
font-size: 14px;
.item-font {
min-width: 72px;
color: #888;
margin-right: 10px;
}
}
.description {
text-indent: 2em;
}
}
.signup-button {
display: block;
width: 100%;
height: 45px;
line-height: 45px;
position: fixed;
bottom: 0;
font-size: 18px;
color: white;
text-align: center;
}
.btn1 {
background-color: #d23a29;
}
.btn2 {
background-color: #999999;
}
}
\ No newline at end of file
<view class="activity-out">
<!-- title -->
<view class="top-out">
<view style="width:40%;margin-right: 20px;">
<image src="{{activeData.logoImg}}" style="width: 100%;height: 105px;border-radius: 5px;" mode="aspectFill" />
</view>
<view style="width: 58%;">
<view class="tit">{{activeData.name}}</view>
<view class="tit-icon {{activeData.activityStateCode==2||activeData.activityStateCode==4||activeData.activityStateCode==5?'enrolled':'enroll'}}">{{activeData.activityStateCode==1?'待报名':activeData.activityStateCode==2?'已报名':activeData.activityStateCode==3?'报名':activeData.activityStateCode==4?'已报名':activeData.activityStateCode==5?'进行中':activeData.activityStateCode==6?'活动结束':activeData.activityStateCode==7?'未报名':'未签到'}}</view>
</view>
</view>
<!-- 规则 -->
<view class="mid-out">
<view class="mid-item">
<view class="item-font">活动时间:</view>
<view>{{activeData.startTime}} 至 {{activeData.endTime}}</view>
</view>
<view class="mid-item">
<view class="item-font">组织方:</view>
<view>{{activeData.organizer}}</view>
</view>
<view class="mid-item">
<view class="item-font">活动地点:</view>
<view>{{activeData.activityAddress}}</view>
</view>
<view class="mid-item">
<view class="item-font">活动名额:</view>
<view>{{activeData.enrollLimit}}人</view>
</view>
</view>
<!-- 介绍 -->
<view class="mid-out">
<view style="font-size: 20px;font-weight: bold;margin-bottom: 15px;">活动介绍</view>
<rich-text nodes="{{activeData.description}}" class="description" />
</view>
<view class="signup-button {{activeData.activityStateCode == 3 || activeData.activityStateCode == 4?'btn1':'btn2'}}" wx:if="{{!activeData.hasFinished}}" bind:tap="handleOk">{{activeData.activityStateName}}</view>
<!-- 评论 -->
<view wx:else>
<my-comment uploadImgStu="{{true}}" newsId="{{newsId}}" favoriteShow="{{fasle}}" bizType="{{2}}"></my-comment>
</view>
</view>
\ No newline at end of file
const {
get,
post
} = require('../../utils/request');
import url from '../../utils/urlconfig'
Page({
data: {
activityList: [],
activityNavList: [],
activityTimeList: [],
current: 0,
},
onLoad() {
get(url.getactiveNavListApi, {
bizType: 1
}).then(res => {
if (res.data.activityType.length > 0) {
res.data.activityType.unshift({
activityType: "",
activityName: "所有日程",
});
}
this.setData({
activityNavList: res.data.activityType,
activityTimeList: res.data.theDay
})
})
let params = {
bizType: 1
}
this.getActivityList(params)
},
getActivityList(params) {
post(url.getActivityListApi, params).then(res => {
this.setData({
activityList: res.data.records
})
})
},
currentNav: function (e) {
let item = e.currentTarget.dataset.item;
let index = e.currentTarget.dataset.index;
this.setData({
current: index,
})
let params = {
activityType: item.activityType,
bizType: 1,
enablePay: 0,
pageNo: 1,
pageSize: 20
}
this.getActivityList(params)
},
myevent(e){
let params = {
bizType: 1,
pageNo: 1,
pageSize: 20,
now:e.detail
}
this.getActivityList(params)
},
handleTo(e){
let item = e.currentTarget.dataset.item;
wx.navigateTo({
url: '/pages/activity/activyDetail/index?id='+item.id,
})
}
});
\ No newline at end of file
{
"usingComponents": {
"calendar": "/pages/components/calendar/index"
},
"navigationBarTitleText": "活动服务"
}
\ No newline at end of file
<view class="activity-out">
<scroll-view scroll-x="true" enable-flex="true" class="scroll-view_H" scroll-left="{{ scrollLeft }}" scroll-with-animation="true">
<block wx:for="{{ activityNavList }}" wx:for-index="index" wx:key="index">
<view class="nav-item {{ current==index?'current-nav':'' }}" bindtap="currentNav" data-item="{{ item }}" data-index="{{ index }}">
{{ item.activityName }}
</view>
</block>
</scroll-view>
<calendar bind:myevent="myevent" activityTimeList="{{activityTimeList}}"/>
<view class="new-out">
<block wx:for="{{ activityList }}" wx:key="id" wx:for-index="index">
<view class="new-list" bindtap="handleTo" data-item="{{ item }}">
<image style="width: 36%;height:100px;" src="{{item.logoImg}}" mode="scaleToFill" />
<view class="new-item">
<view class="new-font">{{item.name}}</view>
<view style="color: #999;font-size: 12px;">
{{item.startTimeString}}-{{item.endTimeString}}
</view>
</view>
</view>
</block>
</view>
</view>
\ No newline at end of file
/* 一级滚动菜单 */
.scroll-view_H {
width: 100%;
display: flex;
background-color: #D23A29;
height: 40px;
line-height: 40px;
white-space: nowrap;
margin-bottom: 4px;
padding-bottom: 5px;
}
.nav-item {
height: 35px;
margin-left: 40rpx;
color: #fff;
}
/* 添加下边界 */
.current-nav {
border-bottom: 2px solid #fff;
}
/* 活动列表信息 */
.new-out {
width: 90%;
margin: 0 auto;
}
.new-list {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
}
.new-font{
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
word-break: break-all;
}
.new-item{
width: 60%;
height: 95px;
display: flex;
flex-direction: column;
justify-content: space-between;
}
\ No newline at end of file
const {
get,
post
} = require('../../utils/request');
import url from '../../utils/urlconfig'
const moment = require('/miniprogram_npm/moment/index.js');
Page({
data: {
id: "",
bizType: "",
type: "",
list: {}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
id: options.id,
bizType: options.bizType
})
if (options.bizType == '1') {
this.setData({
type: '问卷'
})
wx.setNavigationBarTitle({
title: '工作任务'
});
} else {
this.setData({
type: '投票'
})
wx.setNavigationBarTitle({
title: '我要投票'
});
}
let params = {
researchId: options.id
}
post(url.getTaskDetailApi, params).then(res => {
for (const key in res.data) {
if (key == "startTime") {
res.data['startTime'] = moment(res.data['startTime']).format("YYYY年MM月DD日 HH:mm:ss")
}
}
this.setData({
list: res.data
})
})
},
handleTo() {
if (this.data.bizType == '2') {
wx.navigateTo({
url: '/pages/vote/index?id=' + this.data.id,
})
} else {
wx.navigateTo({
url: '/pages/questionnaire/index?id=' + this.data.id,
})
}
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
.describe-out {
padding: 20px 0;
width: 100%;
min-height: 100vh;
background: linear-gradient(0deg, #ff9286 0%, #d23a29),
linear-gradient(180deg, rgba(255, 255, 255, 0) 59%, #f5f5f5 100%),
linear-gradient(0deg, rgba(210, 58, 41, 0) 0%, #d23a29);
box-sizing: border-box;
.describe-top {
width: 92%;
margin: 0 auto;
margin-bottom: 20px;
.top-title {
width: 100%;
margin-bottom: 20px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 20px;
color: #fff;
font-weight: 500;
background: linear-gradient(90deg,
rgba(255, 151, 130, 0),
#ff9782 53%,
rgba(255, 151, 130, 0) 100%);
}
.top-img {
width: 100%;
height: 240px;
}
}
.describe-mid {
width: 92%;
margin: 0 auto;
background-color: #fff;
border-radius: 14px;
.mid-item {
padding: 10px;
.item-tit {
font-size: 20px;
font-weight: 600;
color: #353535;
margin-bottom: 5px;
}
.item-cont {
font-size: 16px;
font-weight: 500;
color: #333;
text-indent: 1em;
}
}
}
.describe-bot {
.describe-btn {
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
padding: 10px 0;
background: linear-gradient(270deg, #eb6c53 0%, #d23a29);
border-radius: 5px;
color: #fff;
font-size: 18px;
}
}
}
\ No newline at end of file
<!-- 问卷,投票详情 -->
<view class="describe-out">
<view class="describe-top">
<view class="top-title">{{list.name}}</view>
<image src="{{list.image}}" class="top-img" mode="scaleToFill" />
</view>
<view class="describe-mid">
<!-- 主题 -->
<view class="mid-item">
<view class="item-tit">{{type}}主题</view>
<view class="item-cont" style="color: #333;">
{{list.content}}
</view>
</view>
<!-- 说明 -->
<view class="mid-item">
<view class="item-tit">{{type}}说明</view>
<view class="item-cont">{{list.remark}}</view>
</view>
<!-- 时间 -->
<view class="mid-item">
<view class="item-tit">{{type}}时间</view>
<view class="item-cont">
{{list.startTime}}
</view>
</view>
</view>
<view class="describe-bot">
<view class="describe-btn" bind:tap="handleTo">
立即{{type}}
</view>
</view>
</view>
\ No newline at end of file
const md5 = require('/miniprogram_npm/md5/index.js');
const {
sm2
} = require('/miniprogram_npm/sm-crypto/index.js');
const moment = require('/miniprogram_npm/moment/index.js');
const TOKEN_KEY = 'auth_token';
const { get, post } = require('../../utils/request');
import url from '../../utils/urlconfig'
Page({
data: {
btnstatus:'false',
newPassword: "",
repeatPassword: "",
},
onLoad() {
},
passwordBindinput: function (e) {
this.setData({
newPassword: e.detail.value
})
},
newPasswordBindinput: function (e) {
this.setData({
repeatPassword: e.detail.value
})
},
generateCharacter(n) {
var chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
var res = "";
for (var i = 0; i < n; i++) {
var id = Math.ceil(Math.random() * 35);
res += chars[id];
}
return res;
},
getCurrentDay() {
let date = ""
date = moment(new Date()).format("YYYYMMDD")
return date
},
changePasswordSubmit() {
const {
newPassword,
repeatPassword
} = this.data;
if (newPassword != repeatPassword) {
wx.showToast({
title: '两次密码输入不一致!',
icon: 'none',
duration: 1200
})
return;
}
let pattern = /(^.*(?=.{8,20})(?=.*\d)(?=.*[a-zA-Z])(?=.*[~!@#$%^&*()_+[\]{}|\;:'",./<>?]).*$)|(^.*(?=.{8,20})(?=.*\d)(?=.*[a-z])(?=.*\d)(?=.*[A-Z]).*$)|(^.*(?=.{8,20})(?=.*\d)(?=.*[a-z])(?=.*[~!@#$%^&*()_+[\]{}|\;:'",./<>?]).*$)|(^.*(?=.{8,20})(?=.*\d)(?=.*[A-Z])(?=.*[~!@#$%^&*()_+[\]{}|\;:'",./<>?]).*$)|(^.*(?=.{8,20})(?=.*[A-Z])(?=.*[a-z])(?=.*[~!@#$%^&*()_+[\]{}|\;:'",./<>?]).*$)/;
if (!pattern.test(newPassword)) {
wx.showToast({
title: '密码格式不正确',
icon: 'none',
duration: 1200
})
return;
}
const public_key = '047214fe3a249b75b6ba92ee494e0a8a68c0a19893a480b3c28bf06cd5b7d621243c7f6704caa3b43ade6be15de11cabd185611a9edfdcf1b11d7a2478c67b4c1c'
const private_key = '00a2bbe941a177ca9f200d1c4d37e8f0b43b9cd2ea662304a05c064c6416e74d49'
let salt = ""
let date = ""
let key = ""
let sign = ""
let password = ""
let confirmedPassword = ""
salt = this.generateCharacter(16)
console.log("validate-salt", salt)
date = this.getCurrentDay()
console.log("validate-date1111", date)
password = sm2.doEncrypt(newPassword + salt, public_key, 1);
confirmedPassword = sm2.doEncrypt(repeatPassword + salt, public_key, 1)
password = "04" + password
confirmedPassword = "04" + confirmedPassword
if (salt && date) {
key = salt + date
console.log("validate-key", key)
}
sign = "confirmPassword=" + confirmedPassword + "&password=" + password + "&salt=" + salt + "&key=" + key
console.log("validate-sign", md5(sign))
let parms = {
confirmPassword: confirmedPassword,
password,
salt: salt,
sign: md5(sign)
}
post(url.changPsdApi,parms).then(res => {
wx.showToast({
title: '修改密码成功!',
icon: 'success',
duration: 1500,
success:()=>{
this.goBack()
}
})
})
},
goBack() {
wx.reLaunch({
url: '/pages/login/index'
});
wx.setStorageSync(TOKEN_KEY, {
token: '',
expiry: ''
});
}
});
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "修改密码"
}
\ No newline at end of file
<view style="width: 96%;margin: 0 auto;padding-top: 40px;">
<view class="changePsd-out">
<view style="margin-right: 10px;letter-spacing: 0.5em;">新密码</view>
<input class="uni-input" bindinput="passwordBindinput" placeholder="请输入新密码" placeholder-style="color:#9E9E9E;" password />
</view>
<view class="changePsd-out">
<view style="margin-right: 18px;">确认密码</view>
<input class="uni-input" bindinput="newPasswordBindinput" placeholder="请再次输入新密码" placeholder-style="color:#9E9E9E;" password />
</view>
<view style="margin-bottom: 20px;">
<button class="confirm-btn" bindtap="changePasswordSubmit">修改密码</button>
</view>
<view class="password-instructor-container">
<view style="margin-bottom: 5px;">
<text>1) 密码控制只能输入字母、数字、特殊符号</text>
</view>
<view style="margin-bottom: 5px;">
<text>2) 长度 8-20 位,必须包括大小写字母、数字、特殊符号中的3种</text>
</view>
<view>
<text>3) 密码不能包含用户名信息</text>
</view>
</view>
</view>
\ No newline at end of file
/* pages/changePsd/index.wxss */
.changePsd-out{
display: flex;
margin-bottom: 20px;
}
.confirm-btn{
width: 100%;
background-color: red;
color: #fff;
}
.password-instructor-container{
font-size: 12px;
color: #222;
margin-bottom: 20px;
}
\ No newline at end of file
const moment = require('/miniprogram_npm/moment/index.js');
Component({
properties: {
activityTimeList: {
type: Array,
value: [],
observer: 'getCommentList'
},
},
data: {
year: 0,
month: 0,
calendarDays: [],
reminders: {},
showReminderModal: false,
showAddReminderModal: false,
selectedDate: '',
reminderInput: '',
},
methods: {
getCommentList() {
const currentDate = new Date();
this.setData({
year: currentDate.getFullYear(),
month: currentDate.getMonth() + 1,
});
this.generateCalendar(this.data.year, this.data.month);
},
// 生成指定年月的日历数据
generateCalendar(year, month) {
const firstDay = new Date(year, month - 1, 1);
const firstDayOfWeek = firstDay.getDay();
const lastDay = new Date(year, month, 0);
const daysInMonth = lastDay.getDate();
const days = [];
// 填充月初的空白
for (let i = 0; i < firstDayOfWeek; i++) {
days.push({
day: null,
date: null,
hasReminder: false
});
}
// 填充日期
for (let day = 1; day <= daysInMonth; day++) {
const date = `${year}-${month.toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`;
const hasReminder = this.properties.activityTimeList.some(e => e === date)
days.push({
day,
date,
hasReminder
});
}
this.setData({
calendarDays: days
});
},
// 切换到上一月
handlePrevMonth() {
let {
year,
month
} = this.data;
if (month === 1) {
year--;
month = 12;
} else {
month--;
}
this.setData({
year,
month
});
this.generateCalendar(year, month);
},
// 切换到下一月
handleNextMonth() {
let {
year,
month
} = this.data;
if (month === 12) {
year++;
month = 1;
} else {
month++;
}
this.setData({
year,
month
});
this.generateCalendar(year, month);
},
// 处理日期点击事件
handleDayClick(e) {
const date = e.currentTarget.dataset.date;
this.triggerEvent('myevent', date + ' 00:00:00')
// if (date) {
// this.setData({
// selectedDate: date
// });
// if (this.data.reminders[date] && this.data.reminders[date].length > 0) {
// this.setData({
// showReminderModal: true
// });
// } else {
// this.setData({
// showAddReminderModal: true
// });
// }
// }
},
// 关闭提醒详情模态框
closeReminderModal() {
this.setData({
showReminderModal: false
});
},
// 处理提醒输入
handleReminderInput(e) {
this.setData({
reminderInput: e.detail.value
});
},
// 添加提醒
addReminder() {
const {
selectedDate,
reminderInput,
reminders
} = this.data;
if (reminderInput) {
if (!reminders[selectedDate]) {
reminders[selectedDate] = [];
}
reminders[selectedDate].push(reminderInput);
this.setData({
reminders,
showAddReminderModal: false,
reminderInput: ''
});
this.generateCalendar(this.data.year, this.data.month);
}
},
// 取消添加提醒
cancelAddReminder() {
this.setData({
showAddReminderModal: false,
reminderInput: ''
});
}
}
});
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
// 定义党群风格的颜色变量
@primary-color: #eb4550;
@secondary-color: #ffd700;
// 日历容器样式
.calendar-container {
padding: 5px 20px 10px;
background-color: #f9f9f9;
// 日历头部样式
.calendar-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
// 上一月和下一月按钮样式
.prev-month,
.next-month {
width: 22%;
background-color: @primary-color;
color: white;
border: none;
padding: 5px 6px;
border-radius: 4px;
font-size: 16px;
cursor: pointer;
}
// 年月显示样式
.year-month {
width: 48%;
font-size: 18px;
font-weight: bold;
text-align: center;
color: @primary-color;
}
}
// 星期几显示样式
.calendar-weekdays {
display: flex;
justify-content: space-around;
margin-bottom: 5px;
color: @primary-color;
}
// 日历日期显示区域样式
.calendar-days {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 10px;
// 有日期的格子样式
.calendar-day {
text-align: center;
padding:5px 6px;
background-color: white;
border-radius: 4px;
cursor: pointer;
position: relative;
&:hover {
background-color: @primary-color;
color: white;
}
// 提醒标记样式
.reminder-mark {
width: 8px;
margin: 0 auto;
height: 8px;
background-color: @primary-color;
border-radius: 50%;
}
}
// 空白格子样式
.calendar-day-empty {
visibility: hidden;
}
}
// 提醒详情模态框样式
.reminder-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
.reminder-modal-content {
background-color: white;
padding: 20px;
border-radius: 4px;
width: 80%;
.reminder-modal-title {
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
}
.reminder-modal-date {
color: #666;
margin-bottom: 10px;
}
.reminder-modal-reminders {
margin-bottom: 20px;
}
.reminder-modal-close {
background-color: @primary-color;
color: white;
border: none;
padding: 8px 16px;
border-radius: 4px;
cursor: pointer;
}
}
}
// 添加提醒模态框样式
.add-reminder-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
.add-reminder-modal-content {
background-color: white;
padding: 20px;
border-radius: 4px;
width: 80%;
.add-reminder-modal-title {
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
}
.add-reminder-modal-date {
color: #666;
margin-bottom: 10px;
}
.add-reminder-modal-input {
border: 1px solid #ddd;
padding: 8px;
margin-bottom: 20px;
width: 100%;
}
.add-reminder-modal-add {
width: 33%;
background-color: @primary-color;
color: white;
border: none;
padding: 8px 16px;
border-radius: 4px;
cursor: pointer;
margin-right: 10px;
}
.add-reminder-modal-cancel {
width: 33%;
background-color: #ccc;
color: white;
border: none;
padding: 8px 16px;
border-radius: 4px;
cursor: pointer;
}
}
}
}
\ No newline at end of file
<view class="calendar-container">
<!-- 日历头部,包含上一月、年月显示和下一月按钮 -->
<view class="calendar-header">
<button bindtap="handlePrevMonth" class="prev-month">上一月</button>
<view class="year-month">{{year}} 年 {{month}} 月</view>
<button bindtap="handleNextMonth" class="next-month">下一月</button>
</view>
<!-- 显示星期几 -->
<view class="calendar-weekdays">
<view>日</view>
<view>一</view>
<view>二</view>
<view>三</view>
<view>四</view>
<view>五</view>
<view>六</view>
</view>
<!-- 日历日期显示区域 -->
<view class="calendar-days">
<view wx:for="{{calendarDays}}" wx:key="index" class="{{item.day? 'calendar-day' : 'calendar-day-empty'}}" bindtap="handleDayClick" data-date="{{item.date}}">
{{item.day}}
<!-- 有提醒的日期显示提醒标记 -->
<view wx:if="{{item.hasReminder}}" class="reminder-mark"></view>
</view>
</view>
<!-- 提醒详情模态框 -->
<view wx:if="{{showReminderModal}}" class="reminder-modal">
<view class="reminder-modal-content">
<view class="reminder-modal-title">提醒详情</view>
<view class="reminder-modal-date">{{selectedDate}}</view>
<view class="reminder-modal-reminders">
<view wx:for="{{reminders[selectedDate]}}" wx:key="index">{{item}}</view>
</view>
<button bindtap="closeReminderModal" class="reminder-modal-close">关闭</button>
</view>
</view>
<!-- 添加提醒模态框 -->
<view wx:if="{{showAddReminderModal}}" class="add-reminder-modal">
<view class="add-reminder-modal-content">
<view class="add-reminder-modal-title">添加提醒</view>
<view class="add-reminder-modal-date">{{selectedDate}}</view>
<input placeholder="请输入提醒内容" bindinput="handleReminderInput" value="{{reminderInput}}" class="add-reminder-modal-input" />
<view style="display: flex;">
<button bindtap="addReminder" class="add-reminder-modal-add">添加</button>
<button bindtap="cancelAddReminder" class="add-reminder-modal-cancel">取消</button>
</view>
</view>
</view>
</view>
\ No newline at end of file
const {
get,
post
} = require('../../../utils/request');
import url from '../../../utils/urlconfig'
Component({
properties: {
// 这里定义了newsId属性,属性值可以在组件使用时指定
newsId: {
type: String,
value: '',
observer: 'getCommentList'
},
favoriteState: {
type: String,
value: '',
observer: "changefavoriteStu"
},
uploadImgStu: {
type: Boolean,
value: false
},
favoriteShow: {
type: Boolean,
value: false
},
bizType: {
type: String,
value: 2
}
},
data: {
// 这里是一些组件内部数据
commentList: [],
imageList: [],
commentReplyList: [],
showModal: false,
showMoreStatu: false,
favoriteStu: false,
replyVal: "",
commentVal: "",
tpCommentId: "",
commentTotal: "",
uploadImgs:[]
},
lifetimes: {
attached: function () {
},
ready: function () {
},
detached: function () {
// 在组件实例被从页面节点树移除时执行
},
},
methods: {
// 这里是一个自定义方法
getCommentList: function () {
get(url.getCommentListApi, {
id: this.properties.newsId,
bizType: this.properties.bizType == 1 ? '2' : '',
pageNo: 1,
pageSize: 30,
}).then(res => {
let list = []
let resultList = []
res.data.records.forEach(item => {
if (item.tpCommentReplies.length > 0) {
resultList = list.concat(item.tpCommentReplies)
}
if(item.imageUrls){
item.imageUrls = JSON.parse(item.imageUrls);
}
});
this.setData({
commentList: res.data.records,
commentTotal: res.data.total,
commentReplyList: resultList
})
})
},
//点赞
laudClick: function (e) {
let item = e.currentTarget.dataset.item
let params = {
tpCommentId: item.id,
};
if (String(item.status) === "0") {
post(url.trainReviewGoodApi, params).then(res => {
wx.showToast({
title: '点赞成功',
icon: 'success',
duration: 2000
})
this.getCommentList()
})
} else {
post(url.trainReviewBadApi, params).then(res => {
wx.showToast({
title: '取消点赞',
icon: 'success',
duration: 2000
})
this.getCommentList()
})
}
},
//回复评论input
replyValBindinput: function (e) {
this.setData({
replyVal: e.detail.value
})
},
//评论input
commentValBindinput: function (e) {
this.setData({
commentVal: e.detail.value
})
},
// 展开更多回复
showMore: function () {
this.setData({
showMoreStatu: true
})
},
//回复
reviewDetail: function (e) {
this.setData({
showModal: true,
tpCommentId: e.currentTarget.dataset.item.id
})
},
//改变收藏状态
/**
* favoriteState 1:已收藏 0:未收藏
*/
changefavoriteStu() {
if (this.data.favoriteState == '1') {
this.setData({
favoriteStu: true
})
} else {
this.setData({
favoriteStu: false
})
}
},
// 收藏
setCollection() {
if (this.data.favoriteStu) {
get(url.setCancelFavoriteApi, {
studentCaseId: this.data.newsId
}).then(res => {
wx.showToast({
title: '取消收藏',
icon: 'success',
duration: 2000,
success: () => {
this.setData({
favoriteStu: false
})
}
})
})
} else {
get(url.setFavoriteApi, {
studentCaseId: this.data.newsId
}).then(res => {
wx.showToast({
title: '收藏成功',
icon: 'success',
duration: 2000,
success: () => {
this.setData({
favoriteStu: true
})
}
})
})
}
},
//相册调用
uploadImg() {
wx.chooseImage({
count: 4,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: (res) => {
// tempFilePath可以作为img标签的src属性显示图片
const tempFilePaths = res.tempFilePaths;
if (this.data.imageList.length > 3) {
wx.showToast({
title: '最多上传四张',
icon: 'error',
duration: 2000,
})
} else {
const TOKEN_KEY = 'auth_token';
const tokenData = wx.getStorageSync(TOKEN_KEY);
wx.uploadFile({
url: 'https://hqjddj.shanghaiairport.com/aliyun/api/upload/?companyCode=zhdj&siteCode=edu', // 服务器接口地址
filePath: tempFilePaths[0], // 单张图片路径
name: 'file', // 后台接收的字段名
header: {
'content-type': 'application/json', // 默认JSON格式
'Authorization': tokenData.token,
},
success: (res) => {
const data = JSON.parse(res.data); // 解析服务器响应
this.data.uploadImgs.push(data.data)
this.setData({
imageList: [...this.data.imageList, ...tempFilePaths]
});
},
});
}
}
})
},
//图片删除
deleteImage(e) {
const index = e.currentTarget.dataset.index;
const imageList = this.data.imageList.filter((_, i) => i !== index);
this.setData({
imageList
});
},
//图片预览
previewImage(e) {
const index = e.currentTarget.dataset.index;
const imageList = this.data.imageList;
wx.previewImage({
current: imageList[index], // 当前显示图片的http链接
urls: imageList // 需要预览的图片http链接列表
});
},
// 确认按钮事件
onConfirm() {
let params = {
content: this.data.replyVal,
tpCommentId: this.data.tpCommentId,
trainingProjectId: this.properties.newsId
}
post(url.setcommentRaplyApi, params).then(res => {
wx.showToast({
title: '回复评论成功',
icon: 'success',
duration: 2000
})
this.getCommentList();
this.hideModalFunc();
})
},
setComment: function () {
let params = {
content: this.data.commentVal,
bizType: this.properties.bizType == 2 ? "" : "2",
imageUrls: JSON.stringify(this.data.uploadImgs),
trainingProjectId: this.properties.newsId
}
post(url.setcommentApi, params).then(res => {
wx.showToast({
title: '评论成功',
icon: 'success',
duration: 2000,
success: () => {
this.setData({
commentVal: "",
imageList: []
})
this.getCommentList();
}
})
})
},
// 取消按钮事件
onCancel() {
// 处理取消逻辑
this.hideModalFunc();
},
// 显示模态框
showModalFunc() {
this.setData({
showModal: true
});
},
// 隐藏模态框
hideModalFunc() {
this.setData({
showModal: false
});
},
}
})
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
<view class="comment-out">
<view class="comment-num">当前评论({{commentTotal?commentTotal:'0'}})</view>
<view class="commit-top" wx:for="{{commentList}}" wx:key="id">
<view class="comment-item">
<view>
<image class="author-image" src="{{item.userAvatar?item.userAvatar:'./../../../static/common/my.png'}}" mode="" />
</view>
<view style="width: 100%;">
<view style="margin-bottom: 5px;font-weight: bold;">{{item.commentatorName}}</view>
<view>{{item.content}}</view>
<view style="display: flex;">
<view wx:for="{{item.imageUrls}}" data-index="{{index}}" wx:key="index">
<image src="{{item}}" mode="aspectFill" style="width: 70px;height: 70px;margin-right: 15px;" />
</view>
</view>
<view class="comment-footer">
<text class="comment-time">{{item.createTime}}</text>
<view class="handle-out">
<text>{{item.replys == "0" ? "0" : item.replys}}</text>
<view data-item="{{item}}" bindtap="reviewDetail">
<image src="./../../../static/common/train-comment.png" alt="" class="handle-icon" />
</view>
</view>
<view class="handle-out">
<text>{{item.thumbsUps == "0" ? "0" : item.thumbsUps}}</text>
<view data-item="{{item}}" bindtap="laudClick">
<image src="{{item.status == '1'?'./../../../static/common/alreadyzan.png':'./../../../static/common/zan.png'}}" alt="" class="handle-icon" />
</view>
</view>
</view>
<!-- 评论回复 -->
<view wx:if="{{item.tpCommentReplies.length>0}}" class="reply-out">
<view wx:for="{{commentReplyList}}" wx:key="id" style="margin-top: 15px;display: flex;" wx:if="{{showMoreStatu}}">
<image class="author-image author-reply" src="{{item.userAvatar?item.userAvatar:'./../../../static/common/my.png'}}" mode="" />
<view>
<view class="reply-user">{{item.createByFullName}}</view>
<view>{{item.content}}</view>
</view>
</view>
<view style="margin-top: 15px;display: flex;" wx:if="{{!showMoreStatu}}">
<image class="author-image author-reply" src="{{commentReplyList[0].userAvatar?commentReplyList[0].userAvatar:'./../../../static/common/my.png'}}" mode="" />
<view>
<view class="reply-user">{{commentReplyList[0].createByFullName}}</view>
<view>{{commentReplyList[0].content}}</view>
</view>
</view>
<view wx:if="{{!showMoreStatu&&commentReplyList.length>1}}" class="show-more-reply" bind:tap="showMore">展开更多回复</view>
</view>
</view>
</view>
</view>
<!-- 评论 -->
<view class="comment-input">
<view class="train-comment-contain">
<image class="cell-left-icon" src="./../../../static/common/comment-icon.jpg" alt="" />
<input type="text" value="{{commentVal}}" placeholder="欢迎发表你的观点" class="modal-input" bindinput="commentValBindinput" style="width: 70%;margin-right: 5px;" />
<view style="display: flex;">
<view bind:tap="setComment">
<image src="./../../../static/common/send-icon.png" class="cell-left-icon" style="margin-right: 5px;" alt="" />
</view>
<view wx:if="{{uploadImgStu}}" class="upload-img" bind:tap="uploadImg">
<image src="./../../../static/common/img-upload.png" class="cell-left-icon" style="margin-left: 5px;margin-right: 5px;" mode="" />
</view>
<view wx:if="{{favoriteShow}}" bind:tap="setCollection" >
<image src="{{favoriteStu?'./../../../static/common/alreadyCollection.png':'./../../../static/common/collection.png'}}" class="cell-left-icon" alt="" />
</view>
</view>
</view>
<view class="container" wx:if="{{uploadImgStu}}">
<view class="image-item" wx:for="{{imageList}}" wx:key="index">
<image src="{{item}}" mode="aspectFill" class="img-item" bindtap="previewImage" data-index="{{index}}"></image>
<image src="./../../../static/common/delect-img.png" mode="" class="delete-btn" bindtap="deleteImage" data-index="{{index}}" />
</view>
</view>
</view>
</view>
<!-- 自定义模态框 WXML -->
<view class="custom-modal" wx:if="{{showModal}}">
<!-- 遮罩层 -->
<view class="modal-mask" bindtap="hideModalFunc"></view>
<!-- 模态内容 -->
<view class="modal-content">
<view class="modal-buttons">
<view class="modal-button cancel" bindtap="onCancel">取消</view>
<text class="modal-title">回复</text>
<view class="modal-button confirm" bindtap="onConfirm">确认</view>
</view>
<input type="text" placeholder="回复 {{name}}" class="modal-input" bindinput="replyValBindinput" />
</view>
</view>
\ No newline at end of file
.comment-out {
width: 94%;
margin: 0 auto;
padding: 10px;
background-color: #fff;
box-sizing: border-box;
}
.comment-num {
margin-bottom: 20px;
}
.commit-top{
padding-bottom: 40px;
}
.comment-item {
display: flex;
font-size: 14px;
margin-bottom: 10px;
}
.author-image {
width: 45px;
height: 45px;
border-radius: 50%;
margin-right: 10px;
}
.author-reply {
width: 30px;
height: 30px;
}
.comment-footer {
width: 100%;
display: flex;
justify-content: space-between;
margin-top: 20px;
}
.comment-time {
font-size: 12px;
}
.handle-out {
display: flex;
font-size: 14px;
}
.handle-icon {
width: 18px;
height: 18px;
margin-left: 5px;
}
.reply-out {
font-size: 12px;
padding: 10px;
}
.reply-user {
font-size: 13px;
margin-bottom: 5px;
}
.show-more-reply {
color: #4a90e2;
margin-top: 8px;
}
.comment-input {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
}
.train-comment-contain {
background-color: white;
padding: 5px 10px;
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
z-index: 100001;
box-sizing: border-box;
}
.cell-left-icon {
width: 24px;
height: 24px;
}
.comment-slider {
background: #f4f4f4;
border-radius: 23px;
width: 90%;
height: 60px;
display: flex;
align-items: center;
padding-left: 0.2rem;
font-size: 17pt;
color: #959595;
letter-spacing: 0.1px;
float: right;
}
/* 上传图片 */
.container{
background-color: #fff;
width: 100%;
padding-bottom: 20px;
margin-left: 20px;
}
.container{
display: flex;
}
.image-item{
width: 60px;
height: 60px;
position: relative;
margin-right: 10px;
margin-top: 15px;
box-sizing: border-box;
}
.img-item{
width: 60px;
height: 60px;
border-radius: 10px;
box-shadow:
5px 5px 5px #00000014,
5px -5px 5px #00000014,
-5px 5px 5px #00000014,
-5px -5px 5px #00000014;
}
.delete-btn{
width: 18px;
height: 18px;
position: absolute;
top: -5px;
right: -8px;
font-size: 10px;
}
/* 遮罩层样式 */
.modal-mask {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 1;
}
/* 模态内容样式 */
.modal-content {
background-color: #fff;
padding: 10px 4px 26px 4px;
border-radius: 10px 10px 0px 0px;
width: 100%;
position: fixed;
bottom: 0;
left: 0;
z-index: 2;
box-sizing: border-box;
}
/* 自定义模态框 WXSS */
.custom-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
}
.modal-title {
font-size: 16px;
font-weight: bold;
margin-bottom: 10px;
}
.modal-message {
font-size: 14px;
margin-bottom: 20px;
}
.modal-buttons {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
}
.modal-button {
padding: 4px 10px;
border-radius: 5px;
text-align: center;
}
.cancel {
color: #000;
}
.confirm {
color: rgb(240, 38, 38);
}
.modal-input {
width: 90%;
min-height: 35px;
margin: 0 auto;
background-color: #f4f4f4;
border-radius: 20px;
padding-left: 5px;
}
\ No newline at end of file
const {
get,
post
} = require('../../../utils/request');
import url from '../../../utils/urlconfig'
Component({
properties: {
// 这里定义了newsId属性,属性值可以在组件使用时指定
questionData: {
type: Object,
value: {},
},
answerQuestionData: {
type: Object,
value: {},
observer: 'getAnswer'
},
},
data: {
// 这里是一些组件内部数据
essayVal:"",
fileName:""
},
lifetimes: {
attached: function () {
},
ready: function () {
this.setData({
fileName:this.data.questionData?.contentAppendixUrl?.split('prefix=')[1],
})
},
},
methods: {
getAnswer(e){
console.log('箭头',e)
this.setData({
essayVal: e?.questionItems[0]?.content
})
},
triggerCustomEvent: function(newValue) {
this.setData({
essayVal: newValue
});
},
bindlinechange(e){
this.setData({
essayVal:e.detail.value
})
},
downLoad(){
wx.downloadFile({
url: this.data.questionData.contentAppendixUrl,
success: function (res) {
const filePath = res.tempFilePath;
//预览
wx.openDocument({
filePath: filePath,
success: function (res) {
console.log('打开文档成功')
}
})
// 保存文件
// wx.saveFile({
// tempFilePath: filePath,
// success: function (res) {
// const savedFilePath = res.savedFilePath;
// wx.showToast({
// title: '文件已保存',
// icon: 'success'
// });
// },
// fail: function (err) {
// console.error('保存文件失败', err);
// }
// });
},
fail: function (err) {
console.error('下载文件失败', err);
}
});
}
}
})
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
.inp{
width: 100%;
height: 80px;
border: 1px solid #999;
border-radius: 4px;
padding-left: 8px;
padding-top: 8px;
box-sizing: border-box;
font-size: 14px;
}
.file-name {
color: #1989fa;
font-size: 14px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 20px;
}
\ No newline at end of file
<!-- 问答题 -->
<view class="container">
<view style="margin-bottom: 20px;font-size: 14px;text-indent: 2em;">{{questionData.remark}}</view>
<view style="background-color: rgb(248, 248, 248);"></view>
<view style="margin-bottom: 20px;font-size: 14px;">
<text style="color: #67512c;">问答题 </text>
{{questionData.content}}
</view>
<view class="file-name" bind:tap="downLoad" wx:if="{{fileName}}">
{{fileName}}
</view>
<view>
<textarea class="inp" type="text" value="{{essayVal}}" placeholder="请输入你的回答" bindinput="bindlinechange" />
</view>
</view>
\ No newline at end of file
const {
get,
post
} = require('../../../utils/request');
import url from '../../../utils/urlconfig'
Component({
properties: {
// 这里定义了newsId属性,属性值可以在组件使用时指定
questionData: {
type: Object,
value: {},
// observer: 'getCommentList'
},
},
data: {
// 这里是一些组件内部数据
multipleVal:[],
fileName:""
},
lifetimes: {
attached: function () {
},
ready: function () {
this.setData({
fileName:this.data.questionData.contentAppendixUrl?.split('prefix=')[1]
})
},
detached: function () {
// 在组件实例被从页面节点树移除时执行
},
},
methods: {
// 这里是一个自定义方法
checkboxChange(e){
this.setData({
multipleVal:e.detail.value
})
},
downLoad(){
wx.downloadFile({
url: this.data.questionData.contentAppendixUrl,
success: function (res) {
const filePath = res.tempFilePath;
//预览
wx.openDocument({
filePath: filePath,
success: function (res) {
console.log('打开文档成功')
}
})
// 保存文件
// wx.saveFile({
// tempFilePath: filePath,
// success: function (res) {
// const savedFilePath = res.savedFilePath;
// wx.showToast({
// title: '文件已保存',
// icon: 'success'
// });
// },
// fail: function (err) {
// console.error('保存文件失败', err);
// }
// });
},
fail: function (err) {
console.error('下载文件失败', err);
}
});
}
}
})
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
.weui-cell {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.file-name {
color: #1989fa;
font-size: 14px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 20px;
}
\ No newline at end of file
<!-- 多选题 -->
<view class="container">
<view style="margin-bottom: 20px;font-size: 15px;text-indent: 2em;">{{questionData.remark}}</view>
<view style="margin-bottom: 20px;font-size: 15px;">
<text style="color: #67512c;">多选题 </text>
{{questionData.content}}
</view>
<view class="file-name" bind:tap="downLoad" wx:if="{{fileName}}">
{{fileName}}
</view>
<checkbox-group bindchange="checkboxChange">
<label class="weui-cell weui-check__label" wx:for="{{questionData.options}}" wx:key="id">
<view class="weui-cell__hd">
<checkbox value="{{item.id}}" />
</view>
<view class="weui-cell__bd">{{item.content}}</view>
</label>
</checkbox-group>
</view>
\ No newline at end of file
Component({
properties: {
questionData: {
type: Object,
value: {},
// observer: 'getCommentList'
},
},
data: {
// 这里是一些组件内部数据
radioVal: '',
checkBoxVal: [],
InputVal: '',
examAnswered: false
},
lifetimes: {
attached: function () {
},
ready: function () {
},
},
methods: {
radioChange(e) {
this.setData({
radioVal: e.detail.value
})
},
checkboxChange(e) {
this.setData({
checkBoxVal: e.detail.value
})
},
bindInputChange(e) {
this.setData({
InputVal: e.detail.value
})
},
}
})
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
.question-items{
width: 100%;
background-color: #fff;
padding: 25px;
box-sizing: border-box;
.weui-cell{
display: flex;
margin-top: 15px;
}
}
\ No newline at end of file
<view class="question-items">
<view>
<text>{{questionData.index+1}}.</text>
<text>{{questionData.type==1?'单选题':questionData.type==2?'多选题':questionData.type==3?'判断题':'问答题'}}</text>
<text>({{questionData.score}}分)</text>
</view>
<view style="margin-top: 15px;margin-left: 15px;">
<view>{{questionData.stem}}</view>
<view wx:if="{{questionData.type == 1 || questionData.type == 3}}">
<radio-group bindchange="radioChange">
<label class="weui-cell" wx:for="{{questionData.questionOptions}}" wx:key="content">
<view class="weui-cell__hd">
<radio value="{{item.optionId}}" checked="{{item.answer==1}}"/>
</view>
<view class="weui-cell__bd">{{item.content}}</view>
</label>
</radio-group>
</view>
<view wx:if="{{questionData.type == 2}}">
<checkbox-group bindchange="checkboxChange">
<label class="weui-cell" wx:for="{{questionData.questionOptions}}" wx:key="content">
<view class="weui-cell__hd">
<checkbox value="{{item.optionId}}" checked="{{item.answer==1}}"/>
</view>
<view class="weui-cell__bd">{{item.content}}</view>
</label>
</checkbox-group>
</view>
<view wx:if="{{questionData.type == 4}}">
<textarea bindinput="bindInputChange" auto-height placeholder="请输入你的回答" />
</view>
</view>
</view>
\ No newline at end of file
Component({
properties: {
questionData: {
type: Object,
value: {},
// observer: 'getCommentList'
},
},
data: {
// 这里是一些组件内部数据
scoringVal:"",
fileName:""
},
lifetimes: {
attached: function () {
},
ready: function () {
this.setData({
fileName:this.data.questionData.contentAppendixUrl?.split('prefix=')[1]
})
},
},
methods: {
sliderChange(e){
this.setData({
scoringVal:e.detail.value
})
},
// 这里是一个自定义方法
downLoad(){
wx.downloadFile({
url: this.data.questionData.contentAppendixUrl,
success: function (res) {
const filePath = res.tempFilePath;
//预览
wx.openDocument({
filePath: filePath,
success: function (res) {
console.log('打开文档成功')
}
})
// 保存文件
// wx.saveFile({
// tempFilePath: filePath,
// success: function (res) {
// const savedFilePath = res.savedFilePath;
// wx.showToast({
// title: '文件已保存',
// icon: 'success'
// });
// },
// fail: function (err) {
// console.error('保存文件失败', err);
// }
// });
},
fail: function (err) {
console.error('下载文件失败', err);
}
});
}
}
})
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
.inp{
width: 100%;
height: 30px;
border: 1px solid #999;
border-radius: 4px;
padding-left: 8px;
box-sizing: border-box;
font-size: 14px;
}
.file-name {
color: #1989fa;
font-size: 14px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 20px;
}
\ No newline at end of file
<!-- 打分题 -->
<view class="container">
<view style="margin-bottom: 20px;font-size: 14px;text-indent: 2em;">{{questionData.remark}}</view>
<view style="margin-bottom: 20px;font-size: 14px;">
<text style="color: #67512c;">打分 </text>
{{questionData.content}}
</view>
<view class="file-name" bind:tap="downLoad" wx:if="{{fileName}}">
{{fileName}}
</view>
<view>
<slider bindchange="sliderChange" min="0" max="10" show-value/>
</view>
</view>
\ No newline at end of file
const {
get,
post
} = require('../../../utils/request');
import url from '../../../utils/urlconfig'
Component({
properties: {
// 这里定义了newsId属性,属性值可以在组件使用时指定
questionData: {
type: Object,
value: {},
},
answerQuestionData: {
type: Object,
value: {},
observer: 'getAnswer'
},
},
data: {
// 这里是一些组件内部数据
singleVal: "",
fileName: ""
},
lifetimes: {
attached: function () {
},
ready: function () {
this.setData({
fileName: this.data.questionData.contentAppendixUrl?.split('prefix=')[1]
})
},
detached: function () {
// 在组件实例被从页面节点树移除时执行
},
},
methods: {
getAnswer(e){
console.log('箭头',e)
this.setData({
singleVal: e?.questionItems[0].optionId
})
},
radioChange(e) {
console.log('单选题',e.detail.value)
this.setData({
singleVal: e.detail.value
})
},
downLoad() {
wx.downloadFile({
url: this.data.questionData.contentAppendixUrl,
success: function (res) {
const filePath = res.tempFilePath;
//预览
wx.openDocument({
filePath: filePath,
success: function (res) {
console.log('打开文档成功')
}
})
// 保存文件
// wx.saveFile({
// tempFilePath: filePath,
// success: function (res) {
// const savedFilePath = res.savedFilePath;
// wx.showToast({
// title: '文件已保存',
// icon: 'success'
// });
// },
// fail: function (err) {
// console.error('保存文件失败', err);
// }
// });
},
fail: function (err) {
console.error('下载文件失败', err);
}
});
}
}
})
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
.weui-cell {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.file-name {
color: #1989fa;
font-size: 14px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 20px;
}
\ No newline at end of file
<!-- 单选题 -->
<view class="container">
<view style="margin-bottom: 20px;font-size: 15px;text-indent: 2em;">{{questionData.remark}}</view>
<view style="margin-bottom: 20px;font-size: 15px;">
<text style="color: #67512c;">单选题 </text>
{{questionData.content}}
</view>
<view class="file-name" bind:tap="downLoad" wx:if="{{fileName}}">
{{fileName}}
</view>
<radio-group bindchange="radioChange">
<label class="weui-cell" wx:for="{{questionData.options}}" wx:key="id">
<view class="weui-cell__hd">
<radio value="{{item.id}}" checked="{{item.id==singleVal}}"/>
</view>
<view class="weui-cell__bd">{{item.content}}</view>
</label>
</radio-group>
</view>
\ No newline at end of file
Component({
properties: {
},
data: {
// 这里是一些组件内部数据
imageList: [],
previewImages: [],
uploadFile: []
},
methods: {
chooseMedia() {
wx.chooseMedia({
mediaType: ['image', 'video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
success: (res) => {
console.log(res)
this.uploadImg(res.tempFiles[0].tempFilePath)
//预览数据
let previewItems = [];
let previewItem = {
url: res.tempFiles[0].tempFilePath,
type: res.tempFiles[0].fileType,
}
previewItems.push(previewItem)
let imgs = [];
imgs.push(res.tempFiles[0].tempFilePath)
this.setData({
imageList: [...this.data.imageList, ...imgs],
previewImages: [...this.data.previewImages, ...previewItems],
});
}
});
},
//图片上传
uploadImg(url) {
const TOKEN_KEY = 'auth_token';
const tokenData = wx.getStorageSync(TOKEN_KEY);
let imgs = []
wx.uploadFile({
url: 'https://hqjddj.shanghaiairport.com/aliyun/api/upload/?companyCode=zhdj&siteCode=edu', // 服务器接口地址
filePath: url, // 单张图片路径
name: 'file', // 后台接收的字段名
header: {
'content-type': 'application/json', // 默认JSON格式
'Authorization': tokenData.token,
},
success: (res) => {
const data = JSON.parse(res.data); // 解析服务器响应
this.data.uploadFile.push(data.data)
},
fail(err) {
console.error('上传失败', err);
}
});
},
//图片删除
deleteImage(e) {
const index = e.currentTarget.dataset.index;
const imageList = this.data.imageList.filter((_, i) => i !== index);
this.setData({
imageList
});
},
//图片预览1
previewImage(e) {
const index = e.currentTarget.dataset.index;
wx.previewMedia({
sources: this.data.previewImages,
current: index
});
},
},
})
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
.img-container {
background-color: #fff;
width: 100%;
padding-bottom: 20px;
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
.image-item {
width: 70px;
height: 70px;
position: relative;
margin-right: 20px;
margin-top: 15px;
box-sizing: border-box;
.img-item {
width: 70px;
height: 70px;
border-radius: 10px;
box-shadow:
5px 5px 5px #00000014,
5px -5px 5px #00000014,
-5px 5px 5px #00000014,
-5px -5px 5px #00000014;
}
.delete-btn {
width: 18px;
height: 18px;
position: absolute;
top: -5px;
right: -8px;
font-size: 10px;
}
}
}
.upload-img{
background-color: #f5f5f5;
width: 70px;
height: 70px;
border-radius: 5px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
.upload-icon{
width: 18px;
height: 18px;
margin-top: 8px;
}
.upload-font{
width: 86%;
margin: 5px auto;
font-size: 10px;
color: #999;
text-align: center;
}
}
\ No newline at end of file
<view>
<view class="img-container">
<view class="image-item" wx:for="{{imageList}}" wx:key="index">
<image src="{{item}}" mode="aspectFill" class="img-item" bindtap="previewImage" data-index="{{index}}"></image>
<image src="/static/common/delect-img.png" mode="" class="delete-btn" bindtap="deleteImage" data-index="{{index}}" />
</view>
</view>
<view class="upload-img" bind:tap="chooseMedia">
<image class="upload-icon" src="/static/upload-img.png" mode="aspectFill" />
<view class="upload-font">点击上传图片或视频</view>
</view>
</view>
\ No newline at end of file
const {
get,
post
} = require('../../utils/request');
import url from '../../utils/urlconfig'
Page({
data: {
activeId: null,
activeTwoId: null,
activeThreeId: null,
typeOne: null,
typeTwo: null,
typeThree: null,
mapList: [],
mapTwoList: [],
mapThreeList: [],
detailStu: true,
videoVisible: false,
authValue: "",
delValue: "",
titleValue: "",
contentValue: "",
previewVisible: false,
previewImage: "",
selectList: [],
selectIndex: 0
},
onLoad() {
get(url.getContributeListApi, {
id: 2
}).then(response => {
this.setData({
mapList: response.data
});
});
post(url.getSelectListApi, {}).then(response => {
this.setData({
selectList: response.data.records
});
});
},
handleClick(e) {
const {
index,
item
} = e.currentTarget.dataset;
get(url.getContributeListApi, {
id: item.id
}).then(response => {
this.setData({
mapTwoList: response.data,
mapThreeList: []
});
});
if (this.data.activeId !== index) {
this.setData({
activeId: index,
activeTwoId: null,
typeOne: item.value,
typeTwo: null,
activeThreeId: null,
typeThree: null
});
}
},
handleTwoClick(e) {
const {
index,
item
} = e.currentTarget.dataset;
get(url.getContributeListApi, {
id: item.id
}).then(response => {
this.setData({
mapThreeList: response.data,
});
});
if (this.data.activeTwoId !== index) {
this.setData({
activeTwoId: index,
activeThreeId: null,
typeTwo: item.value,
typeThree: null
});
}
},
handleThreeClick(e) {
const {
index,
item
} = e.currentTarget.dataset;
if (this.data.activeThreeId !== index) {
this.setData({
activeThreeId: index,
typeThree: item.value
});
}
},
handleTo() {
const {
typeOne,
typeTwo,
typeThree
} = this.data;
if (!typeOne) {
wx.showToast({
title: '请选择投稿类型',
icon: 'none'
});
} else {
this.setData({
detailStu:false
})
}
},
onTitleChange(e) {
this.setData({
titleValue: e.detail.value
});
},
onContentChange(e) {
this.setData({
contentValue: e.detail.value
});
},
onAuthChange(e) {
this.setData({
authValue: e.detail.value
});
},
onSelectChange(e) {
this.setData({
selectIndex: e.detail.value
});
},
showVideoModal() {
this.setData({
videoVisible: true
});
},
closeVideoModal() {
this.setData({
videoVisible: false
});
},
handleSumbit() {
const uploadData = this.selectComponent('#upload')?.data;
let params = {
fileName: this.data.titleValue,
typeOne: this.data.typeOne,
typeTwo: this.data.typeTwo,
typeThree: this.data.typeThree,
author: this.data.authValue,
content: this.data.contentValue,
ossUrl: JSON.stringify(uploadData.uploadFile),
deptName: this.data.selectList[this.data.selectIndex].name
};
if (!this.data.titleValue) {
wx.showToast({
title: '请输入标题',
icon: 'none'
});
return;
}
if (!this.data.contentValue) {
wx.showToast({
title: '请输入内容',
icon: 'none'
});
return;
}
if (!this.data.authValue) {
wx.showToast({
title: '请输入作者',
icon: 'none'
});
return;
}
if (!this.data.selectList[this.data.selectIndex]) {
wx.showToast({
title: '请选择支部和部室',
icon: 'none'
});
return;
}
post(url.commitContributeApi,params).then(res=>{
if (res.code == 1000) {
wx.showToast({
title: '提交成功',
icon: 'success',
success:()=>{
this.setData({
detailStu:true,
})
}
});
}
})
}
});
\ No newline at end of file
{
"usingComponents": {
"upload-media":"/pages/components/uploadMedia/index"
},
"navigationBarTitleText": "我要投稿"
}
\ No newline at end of file
.mycontribute-out {
background-color: #f5f5f5;
min-height: 100vh;
.mycontribute-tit {
font-size: 20px;
font-weight: bold;
padding: 20px 10px;
margin-left: 10px;
color: #333;
}
.mycontribute-box {
background-color: #fff;
width: 92%;
margin: 0 auto;
padding: 20px 10px;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.item-box {
width: 48%;
margin-bottom: 15px;
height: 50px;
line-height: 50px;
background-color: #f7f7f7;
text-align: center;
font-size: 16px;
color: #454343;
}
.item-box-active {
width: 48%;
margin-bottom: 15px;
height: 50px;
line-height: 50px;
background: rgba(253, 63, 52, 0.05);
border: 1px solid #f3ab9f;
border-radius: 4px;
text-align: center;
font-size: 16px;
color: #454343;
}
span {
width: 100%;
color: #e6624a;
}
}
.mycontribute-child-box {
background-color: #fff;
width: 92%;
margin: 0 auto;
padding: 40px 25px;
}
.mycontribute-btn {
width: 92%;
margin: 0 auto;
text-align: center;
padding: 12px 0;
background: linear-gradient(270deg, #eb6c53 0%, #d23a29);
border-radius: 5px;
color: #fff;
font-size: 18px;
}
}
//投稿详情
.contribute-detail-out {
width: 92%;
margin: 20px auto;
padding-bottom: 15px;
.contribute-detail-box {
padding: 20px 15px;
background-color: #fff;
margin-bottom: 15px;
.top-tit {
font-size: 20px;
font-weight: bold;
color: #000;
margin-bottom: 15px;
.red-star {
color: red;
font-size: 18px;
}
}
.user-tit {
color: #999999;
font-size: 16px;
}
.userinfo-box {
margin-top: 15px;
display: flex;
justify-content: space-between;
align-items: center;
.userinfo-name {
color: #666666;
font-size: 20px;
}
}
.contribute-select {
width: 50%;
border: 0 !important;
font-size: 32px !important;
height: 60px !important;
line-height: 60px !important;
}
}
.contribute-detail-btn {
display: flex;
justify-content: space-between;
.perview-btn {
width: 48%;
text-align: center;
color: #666;
font-size: 18px;
padding: 10px 0;
border: 1px solid #666;
border-radius: 4px;
}
.sumbit-btn {
width: 48%;
text-align: center;
color: #fff;
font-size: 18px;
padding: 10px 0;
border-radius: 4px;
background: linear-gradient(270deg, #eb6c53 0%, #d23a29);
}
}
}
.preview-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.preview-out {
width: 85%;
background-color: white;
padding: 20px;
border-radius: 10px;
box-sizing: border-box;
.preview-top {
width: 100%;
.preview-tit {
font-size: 20px;
color: #000;
font-weight: bold;
}
.preview-user {
display: flex;
.user-item {
color: #999;
font-size: 18px;
margin-right: 15px;
}
}
}
.preview-mid {
.preview-imgs {
img {
width: 100%;
// height: 180px;
}
}
.perview-con {
font-size: 36px;
color: #000;
}
}
}
}
\ No newline at end of file
<view class="mycontribute-out">
<view wx:if="{{detailStu}}">
<view class="mycontribute-tit">请选择投稿类型</view>
<!-- 一级分类列表 -->
<view class="mycontribute-box">
<block wx:for="{{mapList}}" wx:key="id">
<view class="{{activeId === index? 'item-box-active' : 'item-box'}}" bindtap="handleClick" data-index="{{index}}" data-item="{{item}}">
{{item.cnName}}
</view>
</block>
</view>
<!-- 二级分类列表 -->
<block wx:if="{{mapTwoList.length > 0}}">
<view class="mycontribute-box">
<block wx:for="{{mapTwoList}}" wx:key="id">
<view class="{{activeTwoId === index? 'item-box-active' : 'item-box'}}" bindtap="handleTwoClick" data-index="{{index}}" data-item="{{item}}">
{{item.cnName}}
</view>
</block>
</view>
</block>
<!-- 三级分类列表 -->
<block wx:if="{{mapThreeList.length > 0}}">
<view class="mycontribute-box">
<block wx:for="{{mapThreeList}}" wx:key="id">
<view class="{{activeThreeId === index? 'item-box-active' : 'item-box'}}" bindtap="handleThreeClick" data-index="{{index}}" data-item="{{item}}">
{{item.cnName}}
</view>
</block>
</view>
</block>
<view class="mycontribute-btn" bindtap="handleTo">写稿</view>
</view>
<view wx:else class="contribute-detail-out">
<!-- 标题输入框 -->
<view class="contribute-detail-box">
<view class="top-tit">
标题 <text class="red-star">*</text>
</view>
<input placeholder="标题需15字以内" value="{{titleValue}}" bindinput="onTitleChange" maxlength="15" style="height: 60px; line-height: 60px;" />
</view>
<!-- 正文输入框 -->
<view class="contribute-detail-box">
<view class="top-tit">
正文<text class="red-star">*</text>
</view>
<textarea value="{{contentValue}}" bindinput="onContentChange" placeholder="请输入正文" rows="8" />
</view>
<!-- 图片或视频上传 -->
<view class="contribute-detail-box">
<view class="top-tit">图片或视频上传</view>
<upload-media id="upload"></upload-media>
</view>
<!-- 用户信息 -->
<view class="contribute-detail-box">
<view class="user-tit">以下为公开信息,将会在稿件中显示</view>
<view class="userinfo-box">
<view class="userinfo-name">
作者<text style="color: red;">*</text>
</view>
<input value="{{authValue}}" bindinput="onAuthChange" placeholder="请输入" style="width: 50%; height: 60px; line-height: 60px;" />
</view>
<view class="userinfo-box">
<view class="userinfo-name">
支部和科室<text style="color: red;">*</text>
</view>
<picker mode="selector" range="{{selectList}}" range-key="name" bindchange="onSelectChange" value="{{selectIndex}}">
<view class="picker">
{{selectList[selectIndex]? selectList[selectIndex].name : '请选择'}}
</view>
</picker>
</view>
</view>
<!-- 操作按钮 -->
<view class="contribute-detail-btn">
<view class="perview-btn" bindtap="showVideoModal">
预览
</view>
<view class="sumbit-btn" bindtap="handleSumbit">
提交
</view>
</view>
<!-- 预览模态框 -->
<view class="preview-modal" hidden="{{!videoVisible}}">
<view class="preview-out">
<view class="preview-top">
<view class="preview-tit">{{titleValue}}</view>
</view>
<view class="preview-mid">
<view class="perview-con">{{contentValue}}</view>
<view class="preview-imgs">
<image src="{{item.fileUrl}}" mode="aspectFit" wx:for="{{fileList}}" wx:key="*this" />
</view>
</view>
<view class="preview-user">
<view class="user-item">{{authValue}}</view>
<view class="user-item">{{selectList[selectIndex]? selectList[selectIndex].name : ''}}</view>
</view>
</view>
<button bindtap="closeVideoModal">关闭</button>
</view>
</view>
</view>
\ No newline at end of file
Page({
data: {
},
onLoad() {
},
});
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!--pages/h5Link/index.wxml-->
<view class="webview-container">
<web-view binderror='binderror' src="https://hqjddj.shanghaiairport.com/#/zhdj/edu/login"/>
</view>
\ No newline at end of file
/* pages/h5Link/index.wxss */
\ No newline at end of file
const {
get,
post
} = require('../../utils/request');
import url from '../../utils/urlconfig'
const moment = require('/miniprogram_npm/moment/index.js');
Page({
data: {
swiperHeight: 0,
navHeight: 0,
customTop: 0,
customHeight: 0,
homeBannerList: [],
newsList: [],
navLists: []
},
onLoad() {
let custom = wx.getMenuButtonBoundingClientRect(); // 小程序右上角胶囊信息
let system = wx.getWindowInfo(); // 获取设备信息的距离
get(url.homeItemApi, {
terminalName: 'WECHAT'
}).then(res => {
res.data.newsList.map((item) => {
item.releaseTime = moment(item.releaseTime).format("YYYY-MM-DD")
})
res.data.navigateList.map((item) => {
if (item.type == 'news') {
item['path'] = '/pages/NewsMessage/index?id=' + item.relationId + `&relationName=` + item.relationFuncName
}
if (item.type == 'train') {
item['path'] = '/pages/activity/index'
}
if (item.type == 'mysurvey') {
item['path'] = '/pages/workTask/index?type=1'
}
if ( item.type == 'survey') {
item['path'] = '/pages/workTask/index?type=2'
}
if ( item.type == 'mycontribute') {
item['path'] = '/pages/contribute/index'
}
if ( item.type == 'myexam') {
item['path'] = '/pages/trainingAndTest/index?id=' + item.relationId
}
})
this.setData({
homeBannerList: res.data.imageList,
newsList: res.data.newsList,
navLists: res.data.navigateList,
navHeight: system.statusBarHeight + 44, // 导航栏的高度
customTop: custom.top, // 胶囊按钮与顶部的距离
customHeight: custom.height, // 胶囊按钮与右侧
swiperHeight: system.statusBarHeight + 44
})
})
},
handleTo(e){
let item = e.currentTarget.dataset.item
wx.navigateTo({
url: '/pages/NewsMessage/news/index?id='+item.id,
})
},
toSearch(){
wx.navigateTo({
url: '/pages/searchInfo/index',
})
},
});
\ No newline at end of file
{
"usingComponents": {
},
"navigationBarTitleText": "智慧党建",
"navigationStyle":"custom"
}
\ No newline at end of file
<!--index.wxml-->
<view class="webview-container">
<view class="navbar" style="height:{{navHeight}}px; ">
<view class="topInfo" style="margin-top:{{customTop}}px;height:{{customHeight}}px;">
<view class="joinCocelal">
<text style="font-size: 17px;">智慧党建</text>
</view>
<view class="searchCoceral">
<icon class="iconfont icon-search'}}" bindtap="changePassword"></icon>
<input class="nav-bar-input" type="text" placeholder="输入搜索关键词"
bindfocus="toSearch" placeholder-class="title_input" />
</view>
</view>
</view>
<!-- 轮播图 -->
<view style="margin-bottom: 20px;margin-top:{{swiperHeight}}px;">
<swiper autoplay="true" duration="2000" circular="true" interval="8000" style="height: 160px;">
<block wx:for="{{homeBannerList}}" wx:key="id">
<swiper-item>
<image src="{{item.bannerPath}}" class="swiper-img" mode="aspectFill"></image>
<view class="swiper-tit">{{item.imgTitle}}</view>
</swiper-item>
</block>
</swiper>
</view>
<!-- 导航 -->
<view class="mid-out">
<view class="nav-list">
<view class="nav-out" wx:for="{{navLists}}" wx:key="id">
<navigator url="{{item.path}}" open-type="{{item.type=='train'?'switchTab':'navigate'}}">
<view class="nav-item">
<image src="{{item.imgPath}}" mode="aspectFill" class="imgi"></image>
<text>{{item.showName}}</text>
</view>
</navigator>
</view>
</view>
</view>
<!-- 七个“虹” -->
<!-- <view style="width: 92%;margin: 0 auto; margin-bottom: 15px;">
<image style="width:100%;height: 110px;" src="./../../static/home/link-bg.png" mode="scaleToFill" />
</view> -->
<!-- 精选资讯 -->
<view>
<view class="new-tit">
<text class="tit"></text>
精选资讯
</view>
<view class="new-out">
<block wx:for="{{newsList}}" wx:key="id">
<view class="new-list" data-item="{{item}}" bind:tap="handleTo">
<image style="width: 40%;height:100px;" src="{{item.logoPath}}" mode="scaleToFill" />
<view class="new-item">
<view class="new-font">{{item.fileName}}</view>
<view style="color: #999;font-size: 12px;">
<text style="margin-right: 5px;">{{item.author}}</text>
{{item.releaseTime}}
</view>
</view>
</view>
</block>
</view>
</view>
</view>
\ No newline at end of file
/* 页面样式 */
page {
height: 100%;
width: 100%;
}
/* web-view容器 */
.webview-container {
width: 100%;
min-height: 100vh;
padding-bottom: 20px;
/* 或使用 flex 布局 */
}
/* 自定义顶部栏 */
.navbar {
width: 100%;
display: flex;
align-items: center;
background-color: #C02B1E;
position: fixed;
top: 0px;
left: 0;
z-index: 10001;
}
.title_input {
font-size: 12px;
color: #fff;
}
.joinCocelal {
font-size: 18px;
color: #fff;
margin-right: 20px;
}
.topInfo {
width: 100%;
display: flex;
align-items: center;
padding-bottom: 8px;
padding-left: 10px;
}
.searchCoceral {
width: 40%;
display: flex;
background-color: rgba(255, 255, 255, 0.25);
border-radius: 20px;
padding: 3px 4px;
}
@font-face {
font-family: 'iconfont';
/* Project id 4769328 */
src: url('//at.alicdn.com/t/c/font_4769328_yh81e4ynuk.woff2?t=1740103917592') format('woff2'),
url('//at.alicdn.com/t/c/font_4769328_yh81e4ynuk.woff?t=1740103917592') format('woff'),
url('//at.alicdn.com/t/c/font_4769328_yh81e4ynuk.ttf?t=1740103917592') format('truetype');
}
.iconfont {
font-family: 'iconfont';
font-size: 14px;
margin-top: -6px;
color: #FFF;
margin-left: 8px;
}
.icon-search::before {
content: '\e617';
}
/* 轮播图 */
.swiper-img {
width: 100%;
height: 100%;
}
.swiper-tit {
width: 100%;
text-align: center;
position: absolute;
bottom: 0px;
left: 0px;
color: #fff;
z-index: 10001;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
font-size: 12px;
padding: 5px 8px;
background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4) 50%, #000000 100%);
box-shadow: 2px;
box-sizing: border-box;
}
/* 导航栏 */
.mid-out {
background-color: #FFFFFF;
border-radius: 5px;
width: 98%;
margin: 0 auto;
padding-bottom: 10px;
margin-bottom: 10px;
margin-top: -15px;
}
.nav-list {
display: flex;
flex-wrap: wrap;
}
.nav-out {
width: 25%;
margin-top: 15px;
}
.nav-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-size: 13px;
}
.imgi {
width: 45px;
height: 45px;
}
/*精选资讯 */
.new-tit {
width: 92%;
margin: 0 auto;
font-size: 16px;
font-weight: 600;
margin-bottom: 15px;
}
.tit {
display: inline-block;
width: 9px;
height: 18px;
background: linear-gradient(180deg, #fe742b, #fc5b2b 100%);
border-radius: 8px;
margin-right: 5px;
}
.new-out {
width: 90%;
margin: 0 auto;
}
.new-list {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
}
.new-font {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
word-break: break-all;
}
.new-item {
width: 58%;
height: 98px;
display: flex;
flex-direction: column;
justify-content: space-between;
}
\ No newline at end of file
const TOKEN_KEY = 'auth_token';
const TOKEN_EXPIRY = 30 * 24 * 60 * 60 * 1000; // 30天有效期
const md5 = require('/miniprogram_npm/md5/index.js');
const {
sm2
} = require('/miniprogram_npm/sm-crypto/index.js');
const moment = require('/miniprogram_npm/moment/index.js');
Page({
data: {
showPassword: true,
account: '',
password: '',
captchaVal: '',
captchaKey: '',
captchaImgUrl: '',
},
// 生命周期函数 - 检查本地token
onLoad() {
this.getCaptchaKey()
const tokenData = wx.getStorageSync(TOKEN_KEY);
if (tokenData && Date.now() < tokenData.expiry) {
this.redirectToHome();
}
},
accountBindinput: function (e) {
this.setData({
account: e.detail.value
})
},
passwordBindinput: function (e) {
this.setData({
password: e.detail.value
})
},
changePassword: function () {
this.setData({
showPassword: !this.data.showPassword
})
},
captchaValBindinput: function (e) {
this.setData({
captchaVal: e.detail.value
})
},
// 获取验证码
getCaptchaKey() {
let baseUrl =
'https://hqjddj.shanghaiairport.com/system/api/public/getCaptcha?companyCode=zhdj&siteCode=edu&captchaKey=';
let num = Math.floor(Math.random() * 999999)
.toString()
.padStart(6, "0")
this.setData({
captchaKey: num,
captchaImgUrl: baseUrl + num
});
},
generateCharacter(n) {
var chars = [
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z",
];
var res = "";
for (var i = 0; i < n; i++) {
var id = Math.ceil(Math.random() * 35);
res += chars[id];
}
return res;
},
getCurrentDay() {
let date = "";
date = moment(new Date()).format("YYYYMMDD");
return date;
},
// 登录处理
async handleLogin() {
const public_key =
"047214fe3a249b75b6ba92ee494e0a8a68c0a19893a480b3c28bf06cd5b7d621243c7f6704caa3b43ade6be15de11cabd185611a9edfdcf1b11d7a2478c67b4c1c";
const private_key =
"00a2bbe941a177ca9f200d1c4d37e8f0b43b9cd2ea662304a05c064c6416e74d49";
let salt = "";
let date = "";
let key = "";
let sign = "";
let password = "";
let account = "";
salt = this.generateCharacter(16);
date = this.getCurrentDay();
password = sm2.doEncrypt(this.data.password + salt, public_key, 1);
account = sm2.doEncrypt(this.data.account + salt, public_key, 1);
password = "04" + password;
account = "04" + account;
if (salt && date) {
key = salt + date;
}
sign =
"account=" +
account +
"&password=" +
password +
"&salt=" +
salt +
"&key=" +
key;
let parms = {
account: account,
password: password,
salt: salt,
sign: md5(sign),
languageCode: 'zh-cn', //新增国际化-cwj-152
terminalType: '2',
captchaVal: this.data.captchaVal,
captchaKey: this.data.captchaKey,
};
const _this = this
wx.request({
url: 'https://hqjddj.shanghaiairport.com/system/api/loginApp?companyCode=zhdj&siteCode=edu',
method: 'POST',
data: parms,
success(res) {
if (res.data.code === "1000") {
_this.saveToken(res.data.data.Authorization);
_this.redirectToHome(res.data.data.userInfo);
} else {
let textInfo = {
"account.not.exist": "账号不存在",
"pwd.error.times": "您已连续输错5次登录密码,账号已被锁定,需5分钟后自动解锁,或联系系统管理员",
"pwd.error.times4": "密码错误!您还有1次机会",
"pwd.error.times3": "密码错误!您还有2次机会",
"pwd.error.times5": "密码错误!您还有0次机会",
"pwd.error.times2": "密码错误!您还有3次机会",
"pwd.error.times1": "密码错误!您还有4次机会",
"img.verify.code.not.correct": "校验码输入不正确",
"img.verify.code.expired": "校验码已过期",
"account.pwd.error": "用户名或密码错误",
"not.site.access.auth": "没有站点访问权限",
}
wx.showToast({
title: textInfo[res.data.subMsg],
icon: 'none',
success:()=>{
_this.getCaptchaKey()
}
});
}
}
})
},
// AES加密密码(需要配置加密密钥)
encryptPassword() {
const key = CryptoJS.enc.Utf8.parse('16位加密密钥');
const encrypted = CryptoJS.AES.encrypt(
this.data.password,
key, {
mode: CryptoJS.mode.ECB
}
);
return encrypted.toString();
},
// Token存储
saveToken(token) {
wx.setStorageSync(TOKEN_KEY, {
token: token,
expiry: Date.now() + TOKEN_EXPIRY
});
},
// 跳转到首页
redirectToHome(item) {
if (item?.firstLogin) {
wx.switchTab({
url: '/pages/changePsd/index'
});
} else {
wx.switchTab({
url: '/pages/home/index'
});
}
}
});
\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment