Compare commits
2 Commits
626b4bc998
...
57c0135413
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57c0135413 | ||
|
|
ff19b35f7b |
12
App.vue
12
App.vue
@ -19,7 +19,6 @@ export default {
|
|||||||
...data.data,
|
...data.data,
|
||||||
ip: data.ip,
|
ip: data.ip,
|
||||||
};
|
};
|
||||||
console.log("obj", obj);
|
|
||||||
uni.setStorageSync("userInfo", obj);
|
uni.setStorageSync("userInfo", obj);
|
||||||
},
|
},
|
||||||
fail(error) {
|
fail(error) {
|
||||||
@ -28,7 +27,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onLaunch: function (options) {
|
onLaunch: async function (options) {
|
||||||
uni.getSystemInfo({
|
uni.getSystemInfo({
|
||||||
success: function (e) {
|
success: function (e) {
|
||||||
// #ifndef MP
|
// #ifndef MP
|
||||||
@ -54,9 +53,10 @@ export default {
|
|||||||
|
|
||||||
let _this = this;
|
let _this = this;
|
||||||
if (this.user.WeChat_MiniProToken) {
|
if (this.user.WeChat_MiniProToken) {
|
||||||
this.memberLogin();
|
await this.memberLogin()
|
||||||
|
// await this.memberLogin();
|
||||||
} else {
|
} else {
|
||||||
this.getLoginCode();
|
await this.getLoginCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setVisitChannels(options.scene);
|
this.setVisitChannels(options.scene);
|
||||||
@ -106,6 +106,7 @@ export default {
|
|||||||
|
|
||||||
<style>
|
<style>
|
||||||
@import url("./common/uni.css");
|
@import url("./common/uni.css");
|
||||||
|
|
||||||
/*每个页面公共css */
|
/*每个页面公共css */
|
||||||
page {
|
page {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
@ -128,10 +129,12 @@ page {
|
|||||||
.process-box.uni-active {
|
.process-box.uni-active {
|
||||||
padding-bottom: 30rpx;
|
padding-bottom: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.process-box process-unit:nth-last-child(1) .prosess-unit::before {
|
.process-box process-unit:nth-last-child(1) .prosess-unit::before {
|
||||||
content: "";
|
content: "";
|
||||||
width: 0rpx;
|
width: 0rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ico,
|
.ico,
|
||||||
.ico-s {
|
.ico-s {
|
||||||
display: block;
|
display: block;
|
||||||
@ -203,6 +206,7 @@ checkbox .wx-checkbox-input.wx-checkbox-input-checked {
|
|||||||
checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
|
checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* #endif */
|
/* #endif */
|
||||||
button::after {
|
button::after {
|
||||||
border: none;
|
border: none;
|
||||||
|
|||||||
@ -199,7 +199,7 @@ function addUserBehavior(obj) {
|
|||||||
userName: userDate.UserName,
|
userName: userDate.UserName,
|
||||||
phoneNumber: userDate.Membership_Phone,
|
phoneNumber: userDate.Membership_Phone,
|
||||||
userId: userDate.UserId ? userDate.UserId : '',
|
userId: userDate.UserId ? userDate.UserId : '',
|
||||||
wechatAppId: 'wxa99ef047735c031e',
|
wechatAppId: 'wx6e28691bea93c6ec',
|
||||||
intoRoute: obj.intoRoute,
|
intoRoute: obj.intoRoute,
|
||||||
outtoRoute: obj.outtoRoute,
|
outtoRoute: obj.outtoRoute,
|
||||||
visitChannels: obj.visitChannels,
|
visitChannels: obj.visitChannels,
|
||||||
@ -235,7 +235,7 @@ function addUserBehaviorNew(obj) {
|
|||||||
userName: userDate.UserName,
|
userName: userDate.UserName,
|
||||||
phoneNumber: userDate.Membership_Phone,
|
phoneNumber: userDate.Membership_Phone,
|
||||||
userId: userDate.UserId ? userDate.UserId : '',
|
userId: userDate.UserId ? userDate.UserId : '',
|
||||||
wechatAppId: 'wxa99ef047735c031e',
|
wechatAppId: 'wx6e28691bea93c6ec',
|
||||||
intoRoute: obj.intoRoute,
|
intoRoute: obj.intoRoute,
|
||||||
outtoRoute: obj.outtoRoute,
|
outtoRoute: obj.outtoRoute,
|
||||||
visitChannels: obj.visitChannels,
|
visitChannels: obj.visitChannels,
|
||||||
|
|||||||
@ -59,7 +59,7 @@
|
|||||||
"optimization": {
|
"optimization": {
|
||||||
"subPackages": true
|
"subPackages": true
|
||||||
},
|
},
|
||||||
"appid": "wxa99ef047735c031e",
|
"appid": "wx6e28691bea93c6ec",
|
||||||
"setting": {
|
"setting": {
|
||||||
"urlCheck": false,
|
"urlCheck": false,
|
||||||
"es6": true,
|
"es6": true,
|
||||||
|
|||||||
148
pages.json
148
pages.json
@ -29,9 +29,38 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"subPackages": [ //分包加载配置
|
"subPackages": [ //分包加载配置
|
||||||
|
{
|
||||||
|
"root": "pages/attendanceStatus",
|
||||||
|
"pages": [
|
||||||
|
{
|
||||||
|
"path": "index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "出勤情况",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "emergencyEvents",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "应急事件",
|
||||||
|
"enablePullDownRefresh": true,
|
||||||
|
"navigationBarBackgroundColor": "#ffffff"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "emergencyEventsDetail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"enablePullDownRefresh": true,
|
||||||
|
"navigationBarBackgroundColor": "#F5F6F7"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/authorityApproval",
|
"root": "pages/authorityApproval",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "权限审批",
|
"navigationBarTitleText": "权限审批",
|
||||||
@ -49,7 +78,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/merchantAccount",
|
"root": "pages/merchantAccount",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
@ -67,7 +97,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/settlementApproval",
|
"root": "pages/settlementApproval",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
@ -90,7 +121,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/auditingPop",
|
"root": "pages/auditingPop",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "jointlySign",
|
"path": "jointlySign",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "会签"
|
"navigationBarTitleText": "会签"
|
||||||
@ -116,10 +148,10 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"root": "pages/nationalPage",
|
"root": "pages/nationalPage",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
@ -176,7 +208,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/earlyWarning",
|
"root": "pages/earlyWarning",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
@ -214,7 +247,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/revenue",
|
"root": "pages/revenue",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
@ -239,7 +273,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/revenueStatistics",
|
"root": "pages/revenueStatistics",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
@ -264,17 +299,20 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/newamine",
|
"root": "pages/newamine",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
}]
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/commercialBINew",
|
"root": "pages/commercialBINew",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "flowAnalysis",
|
"path": "flowAnalysis",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
@ -293,19 +331,19 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/summaryOfPortraits",
|
"root": "pages/summaryOfPortraits",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
}]
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
{ // 商业BI
|
{ // 商业BI
|
||||||
"root": "pages/commercialBI",
|
"root": "pages/commercialBI",
|
||||||
"pages": [
|
"pages": [
|
||||||
|
|
||||||
{
|
{
|
||||||
"path": "guestPortrait",
|
"path": "guestPortrait",
|
||||||
"style": {
|
"style": {
|
||||||
@ -415,19 +453,19 @@
|
|||||||
{
|
{
|
||||||
// 项目分润报表
|
// 项目分润报表
|
||||||
"root": "pages/projectProfitSharing",
|
"root": "pages/projectProfitSharing",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
}]
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"root": "pages/plan",
|
"root": "pages/plan",
|
||||||
"pages": [
|
"pages": [
|
||||||
|
|
||||||
{
|
{
|
||||||
"path": "areaPlanMonth",
|
"path": "areaPlanMonth",
|
||||||
"style": {
|
"style": {
|
||||||
@ -447,7 +485,8 @@
|
|||||||
// 考核考评
|
// 考核考评
|
||||||
{
|
{
|
||||||
"root": "pages/examine",
|
"root": "pages/examine",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
@ -466,7 +505,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/projectWarning",
|
"root": "pages/projectWarning",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "分润比例切换"
|
"navigationBarTitleText": "分润比例切换"
|
||||||
@ -483,17 +523,20 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/robot",
|
"root": "pages/robot",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "数智助手",
|
"navigationBarTitleText": "数智助手",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
}]
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/map",
|
"root": "pages/map",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
@ -517,7 +560,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/operatingStatements",
|
"root": "pages/operatingStatements",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "经营报表",
|
"navigationBarTitleText": "经营报表",
|
||||||
@ -548,7 +592,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/tender",
|
"root": "pages/tender",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "tender",
|
"path": "tender",
|
||||||
"style": {
|
"style": {
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
@ -584,7 +629,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/serviceAreaReimbursement",
|
"root": "pages/serviceAreaReimbursement",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "serviceAreaReimbursement",
|
"path": "serviceAreaReimbursement",
|
||||||
"style": {
|
"style": {
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
@ -602,7 +648,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/dataSummary",
|
"root": "pages/dataSummary",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "dataSummary",
|
"path": "dataSummary",
|
||||||
"style": {
|
"style": {
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
@ -626,7 +673,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/businessApproval",
|
"root": "pages/businessApproval",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "businessApproval",
|
"path": "businessApproval",
|
||||||
"style": {
|
"style": {
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
@ -643,7 +691,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/everdayRenven",
|
"root": "pages/everdayRenven",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": false,
|
||||||
@ -689,7 +738,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/suggestion",
|
"root": "pages/suggestion",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "suggestion",
|
"path": "suggestion",
|
||||||
"style": {
|
"style": {
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
@ -706,7 +756,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/contract",
|
"root": "pages/contract",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "contract",
|
"path": "contract",
|
||||||
"style": {
|
"style": {
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
@ -723,7 +774,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/cashAudit",
|
"root": "pages/cashAudit",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "list",
|
"path": "list",
|
||||||
"style": {
|
"style": {
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
@ -746,7 +798,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/investment",
|
"root": "pages/investment",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "investment",
|
"path": "investment",
|
||||||
"style": {
|
"style": {
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
@ -763,7 +816,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/expenseApproval",
|
"root": "pages/expenseApproval",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "expenseApproval",
|
"path": "expenseApproval",
|
||||||
"style": {
|
"style": {
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
@ -781,7 +835,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/commodity_temp",
|
"root": "pages/commodity_temp",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
@ -799,27 +854,32 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/testPage",
|
"root": "pages/testPage",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "测试页面"
|
"navigationBarTitleText": "测试页面"
|
||||||
}
|
}
|
||||||
}]
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/billOfLading",
|
"root": "pages/billOfLading",
|
||||||
"pages": [{
|
"pages": [
|
||||||
|
{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "提单"
|
"navigationBarTitleText": "提单"
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"path": "detail",
|
"path": "detail",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
}]
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
@ -833,13 +893,13 @@
|
|||||||
"selectedColor": "#3295f9",
|
"selectedColor": "#3295f9",
|
||||||
"borderStyle": "black",
|
"borderStyle": "black",
|
||||||
"backgroundColor": "#ffffff",
|
"backgroundColor": "#ffffff",
|
||||||
"list": [{
|
"list": [
|
||||||
|
{
|
||||||
"pagePath": "pages/index/index",
|
"pagePath": "pages/index/index",
|
||||||
"iconPath": "static/images/tab/home.png",
|
"iconPath": "static/images/tab/home.png",
|
||||||
"selectedIconPath": "static/images/tab/homeActive.png",
|
"selectedIconPath": "static/images/tab/homeActive.png",
|
||||||
"text": ""
|
"text": ""
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"pagePath": "pages/userCenter/userCenter",
|
"pagePath": "pages/userCenter/userCenter",
|
||||||
"iconPath": "static/images/tab/user.png",
|
"iconPath": "static/images/tab/user.png",
|
||||||
|
|||||||
651
pages/attendanceStatus/emergencyEvents.vue
Normal file
651
pages/attendanceStatus/emergencyEvents.vue
Normal file
@ -0,0 +1,651 @@
|
|||||||
|
<!-- 应急事件 -->
|
||||||
|
<template>
|
||||||
|
<view class="main">
|
||||||
|
<view class="emergencyList pad15">
|
||||||
|
<view class="emergencyItem" v-for="(item, index) in showList" :key="index" @click="handleShowDetail(item)"
|
||||||
|
:style="{
|
||||||
|
marginBottom: index + 1 === showList.length ? '0' : '',
|
||||||
|
border: item.status === 1 ? '2rpx solid #f4db9c' : item.status === 2 ? '2rpx solid #d3d3d3' : ''
|
||||||
|
}">
|
||||||
|
<view class="emergencyItemTitle">
|
||||||
|
<view class="emergencyItemTitleLeft">
|
||||||
|
{{ type === 1 ? item.title || "" : type === 2 ? item.service || "" : "" }}
|
||||||
|
</view>
|
||||||
|
<view class="emergencyItemTitleRight">
|
||||||
|
<view class="emergencyItemStatus" :style="{
|
||||||
|
background: item.status === 1 ? '#ecbd44' : item.status === 2 ? '#d3d3d3' : '',
|
||||||
|
color: item.status === 1 ? '#fff' : item.status === 2 ? '#fff' : ''
|
||||||
|
}">
|
||||||
|
{{ item.status === 1 ? '已完成' : item.status ===
|
||||||
|
2 ? '处理中' : '' }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="emergencyDesc">{{ item.desc || "" }}</view>
|
||||||
|
|
||||||
|
<view class="line"></view>
|
||||||
|
|
||||||
|
<view class="otherMessageRow">
|
||||||
|
<image class="otherMessageIcon" src="https://eshangtech.com/cyy_DIB/personIcon.png" />
|
||||||
|
<view class="otherMessageValue">{{ item.person }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="otherMessageRow">
|
||||||
|
<image class="otherMessageIcon" src="https://eshangtech.com/cyy_DIB/phoneLabelIcon.png" />
|
||||||
|
<view class="otherMessageValue">{{ item.phone }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="otherMessageRow" style="margin-bottom: 0;">
|
||||||
|
<image class="otherMessageIcon" src="https://eshangtech.com/cyy_DIB/timeIcon.png" />
|
||||||
|
<view class="otherMessageValue">{{ item.time }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <view :class="item.status === 1 ? 'event-item left-ok' : item.status === 2 ? 'event-item' : ''"
|
||||||
|
v-for="(item, index) in showList" :key="index" @click="handleShowDetail(item)">
|
||||||
|
<view class="event-header">
|
||||||
|
<view class="event-title">{{ type === 1 ? item.title || "" : type === 2 ? item.service || "" : "" }}
|
||||||
|
</view>
|
||||||
|
<view class="event-meta">
|
||||||
|
<view class="event-time">
|
||||||
|
<text>🕐</text><text>{{ item.time || "" }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="event-priority priority-high" :style="{
|
||||||
|
background: item.status === 1 ? '#E7F8EE' : item.status === 2 ? '#f9dfe2' : '',
|
||||||
|
color: item.status === 1 ? '#3DC272' : item.status === 2 ? '#ff4757' : ''
|
||||||
|
}">
|
||||||
|
{{ item.status === 1 ? '已完成' : item.status ===
|
||||||
|
2 ? '处理中' : '' }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="event-content">
|
||||||
|
<view class="event-description">
|
||||||
|
<text class="line">{{ item.desc || "" }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 应急事件详情 -->
|
||||||
|
<uni-popup ref="popup" border-radius="10px 10px 0 0" @change="handlePopupChange">
|
||||||
|
<!-- 应急事件的 -->
|
||||||
|
<view class="eventsPopupBox" v-if="eventsDetail && type === 1">
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsHaveImgLabel">
|
||||||
|
<image class="eventsHaveImg" src="https://eshangtech.com/cyy_DIB/personIcon.png" />
|
||||||
|
<view class="eventsHaveLabel">联系人:</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.person || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsHaveImgLabel">
|
||||||
|
<image class="eventsHaveImg" src="https://eshangtech.com/cyy_DIB/phoneLabelIcon.png" />
|
||||||
|
<view class="eventsHaveLabel">联系电话:</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.phone || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsHaveImgLabel">
|
||||||
|
<image class="eventsHaveImg" src="https://eshangtech.com/cyy_DIB/timeIcon.png" />
|
||||||
|
<view class="eventsHaveLabel">处理用时:</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.haveTime || "" }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="line"></view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">标题:</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.title || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">事件片区:</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.area || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">事件服务区:</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.service || "" }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">死亡人数:</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.diePerson || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">事件概况:</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.desc || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">事件损失情况:</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.lossDesc || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">处理结果:</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.res || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItemPic">
|
||||||
|
<view class="eventsLabel">事件现场照片:</view>
|
||||||
|
<view class="eventsPic" v-if="eventsDetail.imgList && eventsDetail.imgList.length > 0">
|
||||||
|
<view class="eventsPicItem" v-for="(item, index) in eventsDetail.imgList" :key="index"
|
||||||
|
@click="showImg(eventsDetail.imgList, index)">
|
||||||
|
<image class="eventsPicImg" :src="item.url" />
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 日常问题 -->
|
||||||
|
<view class="eventsPopupBox" v-if="eventsDetail && type === 2">
|
||||||
|
<!-- <view class="eventsItem">
|
||||||
|
<view class="eventsLabel">处理状态:</view>
|
||||||
|
<view class="eventsValue"></view>
|
||||||
|
</view> -->
|
||||||
|
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsHaveImgLabel">
|
||||||
|
<image class="eventsHaveImg" src="https://eshangtech.com/cyy_DIB/personIcon.png" />
|
||||||
|
<view class="eventsHaveLabel">联系人:</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.person || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsHaveImgLabel">
|
||||||
|
<image class="eventsHaveImg" src="https://eshangtech.com/cyy_DIB/phoneLabelIcon.png" />
|
||||||
|
<view class="eventsHaveLabel">联系电话:</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.phone || "" }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="line"></view>
|
||||||
|
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">事件片区:</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.area || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">事件服务区:</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.service || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">类型:</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.type || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">问题描述:</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.desc || "" }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="eventsSmallTitle">协调处理情况</view>
|
||||||
|
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">协调处理结果:</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.startRes || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">办理人:</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.startPerson || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">办理完成时间:</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.startTime || "" }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="eventsSmallTitle">经营公司协调处理情况</view>
|
||||||
|
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">协调处理结果:</view>
|
||||||
|
<view class="eventsPic">{{ eventsDetail.endRes || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">办理人:</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.endPerson || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">办理完成时间:</view>
|
||||||
|
<view class="eventsValue">{{ eventsDetail.endTime || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItemPic">
|
||||||
|
<view class="eventsLabel">事件现场照片:</view>
|
||||||
|
<view class="eventsPic" v-if="eventsDetail.imgList && eventsDetail.imgList.length > 0">
|
||||||
|
<view class="eventsPicItem" v-for="(item, index) in eventsDetail.imgList" :key="index"
|
||||||
|
@click="showImg(eventsDetail.imgList, index)">
|
||||||
|
<image class="eventsPicImg" :src="item.url" />
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dataList: [
|
||||||
|
{
|
||||||
|
title: "中和停车区下行停水",
|
||||||
|
time: "2023-09-26 13:30:38",
|
||||||
|
area: "昭通片区管理补",// 片区
|
||||||
|
service: "中和加油站-上行",// 事件服务区
|
||||||
|
eventType: "事件类型1",// 事件类型
|
||||||
|
person: "徐琴",// 联系人
|
||||||
|
phone: "13408871099",//联系电话
|
||||||
|
theInjured: "",// 受伤人数
|
||||||
|
haveTime: "待定",// 处理用时
|
||||||
|
diePerson: "0",//死亡人数
|
||||||
|
desc: "水泵房故障,导致停水,急需处理",//事件现场概况
|
||||||
|
lossDesc: "因突发情况 卫生间卫生无法保障",// 事件损失情况
|
||||||
|
res: "已联系施工方,未处理",//处理结果
|
||||||
|
imgList: [{ url: "https://eshangtech.com/cyy_DIB/1695785143848.jpg" }],// 事件现场照片
|
||||||
|
status: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "楼坝服务区停水",
|
||||||
|
time: "2023-08-02 13:57:27",
|
||||||
|
area: "昭通片区管理补",// 片区
|
||||||
|
service: "楼坝服务区-下行",// 事件服务区
|
||||||
|
eventType: "事件类型1",// 事件类型
|
||||||
|
person: "孔令婷",// 联系人
|
||||||
|
phone: "19987196597",//联系电话
|
||||||
|
theInjured: "",// 受伤人数
|
||||||
|
haveTime: "7小时",// 处理用时
|
||||||
|
diePerson: "0",//死亡人数
|
||||||
|
desc: "楼坝街道主水管道被路面改造施工的挖机挖断,目前正在抢修中,预计7小时后可正常供水,服务区现用水箱里的储水进行供水。",//事件现场概况
|
||||||
|
lossDesc: "无",// 事件损失情况
|
||||||
|
res: "正在进行抢修,预计7小时后可正常供水,服务区现用水箱里的储水进行供水。",//处理结果
|
||||||
|
imgList: null,// 事件现场照片
|
||||||
|
status: 2,
|
||||||
|
} // status 1 已完成 2 处理中
|
||||||
|
],
|
||||||
|
everyDayList: [
|
||||||
|
{
|
||||||
|
area: "版纳片区管理部", // 事件片区:
|
||||||
|
service: "小勐养服务区-上行", // 事件服务区:
|
||||||
|
time: "2024-09-12 09:14:47",
|
||||||
|
type: "其他", // 类型:
|
||||||
|
desc: "小勐养服务区上行卫生间5号蹲坑隔板底座损坏,已修复。",// 问题描述:
|
||||||
|
person: "杨杰",// 联系人:
|
||||||
|
phone: "13628710377",// 联系电话:
|
||||||
|
startRes: "修复完毕,建议结束流程",// 协调处理结果:
|
||||||
|
startPerson: "刀天华",// 办理人:
|
||||||
|
startTime: "2024-09-12 09:43:53",// 办理完成时间:
|
||||||
|
endRes: "",// 协调处理结果:
|
||||||
|
endPerson: "",// 办理人:
|
||||||
|
endTime: "流转后自动显示",// 办理完成时间:
|
||||||
|
imgList: [
|
||||||
|
{ url: "https://eshangtech.com/cyy_DIB/1726104387683_mmexport1726104287279.jpg" },
|
||||||
|
{ url: "https://eshangtech.com/cyy_DIB/1726104504808_IMG_20240912_091809.jpg" }
|
||||||
|
],// 事件现场照片
|
||||||
|
status: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
area: "昆东片区管理部", // 事件片区:
|
||||||
|
service: "阳宗服务区-上行", // 事件服务区:
|
||||||
|
time: "2024-08-08 13:45:25",
|
||||||
|
type: "维修上报", // 类型:
|
||||||
|
desc: "关于昆东片区管理部阳宗服务区上行更换入口车辆引导标识牌的请示",// 问题描述:
|
||||||
|
person: "唐林波",// 联系人:
|
||||||
|
phone: "15287959258",// 联系电话:
|
||||||
|
startRes: "按照公司相关流程进行更换标识牌审批事宜",// 协调处理结果:
|
||||||
|
startPerson: "申锐娟",// 办理人:
|
||||||
|
startTime: "流转后自动显示",// 办理完成时间:
|
||||||
|
endRes: "",// 协调处理结果:
|
||||||
|
endPerson: "",// 办理人:
|
||||||
|
endTime: "流转后自动显示",// 办理完成时间:
|
||||||
|
imgList: null,// 事件现场照片
|
||||||
|
status: 2,
|
||||||
|
}
|
||||||
|
],
|
||||||
|
showList: [],
|
||||||
|
eventsDetail: null,
|
||||||
|
type: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(query) {
|
||||||
|
if (query.type) {
|
||||||
|
this.type = Number(query.type)
|
||||||
|
if (this.type === 1) {
|
||||||
|
this.showList = this.dataList
|
||||||
|
} else {
|
||||||
|
this.showList = this.everyDayList
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title: '日常问题'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleShowDetail(obj) {
|
||||||
|
// this.$refs.popup.open('center')
|
||||||
|
// this.eventsDetail = obj
|
||||||
|
this.$util.toNextRoute("navigateTo", `/pages/attendanceStatus/emergencyEventsDetail?detail=${JSON.stringify(obj)}&type=${this.type}`);
|
||||||
|
|
||||||
|
},
|
||||||
|
handlePopupChange(e) {
|
||||||
|
this.showPopup = e.show
|
||||||
|
console.log('e', e);
|
||||||
|
if (!e.show) {
|
||||||
|
this.userDetail = null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 图片预览
|
||||||
|
showImg(list, index) {
|
||||||
|
console.log('list', list);
|
||||||
|
console.log('indexindex', index);
|
||||||
|
let urls = []
|
||||||
|
list.forEach((item) => {
|
||||||
|
urls.push(item.url)
|
||||||
|
})
|
||||||
|
|
||||||
|
uni.previewImage({
|
||||||
|
urls: urls,
|
||||||
|
current: list[index].url,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
@bg: #f8f9fa;
|
||||||
|
@muted: #666;
|
||||||
|
@card: #fff;
|
||||||
|
@shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||||
|
@primary: #27B25F;
|
||||||
|
@primary2: #4CCC7F;
|
||||||
|
@ok: #2ed573;
|
||||||
|
@warn: #ff9f43;
|
||||||
|
@danger: #ff4757;
|
||||||
|
|
||||||
|
/* 抽屉页(特情/设施) */
|
||||||
|
.main {
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
|
||||||
|
.emergency-details-header {
|
||||||
|
background: linear-gradient(135deg, @danger, #ff3838);
|
||||||
|
color: #fff;
|
||||||
|
padding: 40rpx;
|
||||||
|
position: relative;
|
||||||
|
box-shadow: @shadow;
|
||||||
|
|
||||||
|
&.facilities-theme {
|
||||||
|
background: linear-gradient(135deg, #20bf6b, #0fb9b1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.emergency-back-btn {
|
||||||
|
position: absolute;
|
||||||
|
left: 30rpx;
|
||||||
|
top: 30rpx;
|
||||||
|
background: rgba(255, 255, 255, .2);
|
||||||
|
border: none;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 36rpx;
|
||||||
|
width: 80rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.h1 {
|
||||||
|
text-align: center;
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 6rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.current-area {
|
||||||
|
text-align: center;
|
||||||
|
display: block;
|
||||||
|
opacity: .9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.emergencyList {
|
||||||
|
padding: 30rpx;
|
||||||
|
|
||||||
|
.emergencyItem {
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: @shadow;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 24rpx;
|
||||||
|
margin-bottom: 24rpx;
|
||||||
|
|
||||||
|
.emergencyItemTitle {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 24rpx;
|
||||||
|
|
||||||
|
.emergencyItemTitleLeft {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
display: inline-block;
|
||||||
|
width: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.emergencyItemStatus {
|
||||||
|
font-size: 24rpx;
|
||||||
|
padding: 4rpx 16rpx;
|
||||||
|
border-radius: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.emergencyDesc {
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line {
|
||||||
|
width: 100%;
|
||||||
|
height: 2rpx;
|
||||||
|
background-color: #dad9d3;
|
||||||
|
margin: 24rpx 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.otherMessageRow {
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 8rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
|
||||||
|
.otherMessageIcon {
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
margin-right: 16rpx;
|
||||||
|
margin-top: 6rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.otherMessageValue {
|
||||||
|
font-size: 24rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.add-event-btn {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 160rpx;
|
||||||
|
right: 40rpx;
|
||||||
|
width: 96rpx;
|
||||||
|
height: 96rpx;
|
||||||
|
background: linear-gradient(135deg, @primary, @primary2);
|
||||||
|
border-radius: 50%;
|
||||||
|
border: none;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 40rpx;
|
||||||
|
box-shadow: 0 8rpx 24rpx rgba(74, 144, 226, .4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.promo-banner {
|
||||||
|
margin: 30rpx;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: @shadow;
|
||||||
|
|
||||||
|
.promo-image {
|
||||||
|
width: 100%;
|
||||||
|
height: 240rpx;
|
||||||
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 48rpx;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.promo-content {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
background: linear-gradient(transparent, rgba(0, 0, 0, .7));
|
||||||
|
padding: 40rpx 30rpx 30rpx;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
.promo-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
margin-bottom: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.promo-subtitle {
|
||||||
|
font-size: 24rpx;
|
||||||
|
opacity: .9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.facilities-section {
|
||||||
|
margin: 30rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: @shadow;
|
||||||
|
|
||||||
|
.facilities-header {
|
||||||
|
background: linear-gradient(135deg, #20bf6b, #0fb9b1);
|
||||||
|
color: #fff;
|
||||||
|
padding: 30rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 32rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.eventsPopupBox {
|
||||||
|
width: 90vw;
|
||||||
|
height: 80vh;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 24rpx;
|
||||||
|
overflow-y: auto;
|
||||||
|
|
||||||
|
.eventsItemTitle {
|
||||||
|
width: 100%;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.eventsItem {
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
|
||||||
|
.eventsHaveImgLabel {
|
||||||
|
display: flex;
|
||||||
|
width: 200rpx;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.eventsHaveImg {
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
margin-right: 16rpx;
|
||||||
|
margin-top: 6rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.eventsHaveLabel {
|
||||||
|
width: 154rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.eventsLabel {
|
||||||
|
width: 200rpx;
|
||||||
|
text-align: left;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.eventsValue {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.line {
|
||||||
|
width: 100%;
|
||||||
|
height: 2rpx;
|
||||||
|
background-color: #dad9d3;
|
||||||
|
margin: 24rpx 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.eventsSmallTitle {
|
||||||
|
margin: 16rpx 0;
|
||||||
|
width: 100%;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.eventsItemPic {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.eventsLabel {
|
||||||
|
width: 200rpx;
|
||||||
|
text-align: left;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.eventsPic {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
|
||||||
|
.eventsPicItem {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
margin-right: 8rpx;
|
||||||
|
margin-bottom: 8rpx;
|
||||||
|
|
||||||
|
.eventsPicImg {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
405
pages/attendanceStatus/emergencyEventsDetail.vue
Normal file
405
pages/attendanceStatus/emergencyEventsDetail.vue
Normal file
@ -0,0 +1,405 @@
|
|||||||
|
<template>
|
||||||
|
<view class="main">
|
||||||
|
<view class="detailBox">
|
||||||
|
<view class="pageTitle">{{ detailObj.title || "" }}</view>
|
||||||
|
|
||||||
|
<view class="userDetailBox" :style="{ marginTop: pageType === 1 ? '' : '0' }">
|
||||||
|
<view class="userDetailBoxTop">
|
||||||
|
<view class="userDetailBoxService">{{ detailObj.service || "" }}</view>
|
||||||
|
|
||||||
|
<view class="userDetailBoxServiceRight">
|
||||||
|
<view class="userDetailBoxStatus" :style="{
|
||||||
|
background: detailObj.status === 1 ? '#ecbd44' : detailObj.status === 2 ? '#d3d3d3' : '',
|
||||||
|
color: detailObj.status === 1 ? '#fff' : detailObj.status === 2 ? '#fff' : ''
|
||||||
|
}">
|
||||||
|
{{ detailObj.status === 1 ? '已完成' : detailObj.status ===
|
||||||
|
2 ? '处理中' : '' }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="eventsItem" style="margin-top: 24rpx;">
|
||||||
|
<view class="eventsHaveImgLabel">
|
||||||
|
<image class="eventsHaveImg" src="https://eshangtech.com/cyy_DIB/personIcon.png" />
|
||||||
|
<view class="eventsHaveLabel">联系人:</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsValue">{{ detailObj.person || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsHaveImgLabel">
|
||||||
|
<image class="eventsHaveImg" src="https://eshangtech.com/cyy_DIB/phoneLabelIcon.png" />
|
||||||
|
<view class="eventsHaveLabel">联系电话:</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsValue">{{ detailObj.phone || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem" style="margin-bottom: 0;">
|
||||||
|
<view class="eventsHaveImgLabel">
|
||||||
|
<image class="eventsHaveImg" src="https://eshangtech.com/cyy_DIB/timeIcon.png" />
|
||||||
|
<view class="eventsHaveLabel">处理用时:</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsValue">{{ detailObj.haveTime || "" }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="pageText" v-if="pageType === 1">应急事件</view>
|
||||||
|
<view class="pageText" v-if="pageType === 2">日常问题</view>
|
||||||
|
|
||||||
|
<view class="detailBox" v-if="pageType === 1">
|
||||||
|
<view class="userDetailBox noBoxShow">
|
||||||
|
<!-- <view class="eventsItem">
|
||||||
|
<view class="eventsLabel">标题:</view>
|
||||||
|
<view class="eventsValue">{{ detailObj.title || "" }}</view>
|
||||||
|
</view> -->
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">事件片区:</view>
|
||||||
|
<view class="eventsValue">{{ detailObj.area || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="eventsItem">
|
||||||
|
<view class="eventsLabel">事件服务区:</view>
|
||||||
|
<view class="eventsValue">{{ detailObj.service || "" }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">死亡人数:</view>
|
||||||
|
<view class="eventsValue">{{ detailObj.diePerson || "" }}</view>
|
||||||
|
</view> -->
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">事件概况:</view>
|
||||||
|
<view class="eventsValue">{{ detailObj.desc || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">事件损失情况:</view>
|
||||||
|
<view class="eventsValue">{{ detailObj.lossDesc || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">处理结果:</view>
|
||||||
|
<view class="eventsValue">{{ detailObj.res || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItemPic">
|
||||||
|
<view class="eventsLabel">事件现场照片:</view>
|
||||||
|
<view class="eventsPic" v-if="detailObj.imgList && detailObj.imgList.length > 0">
|
||||||
|
<view class="eventsPicItem" v-for="(item, index) in detailObj.imgList" :key="index"
|
||||||
|
@click="showImg(detailObj.imgList, index)">
|
||||||
|
<image class="eventsPicImg" :src="item.url" />
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="detailBox" v-if="pageType === 2" style="padding-bottom: 24rpx;">
|
||||||
|
<view class="userDetailBox noBoxShow">
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">事件片区:</view>
|
||||||
|
<view class="eventsValue">{{ detailObj.area || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="eventsItem">
|
||||||
|
<view class="eventsLabel">事件服务区:</view>
|
||||||
|
<view class="eventsValue">{{ detailObj.service || "" }}</view>
|
||||||
|
</view> -->
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">类型:</view>
|
||||||
|
<view class="eventsValue">{{ detailObj.type || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem" style="margin-bottom: 0;">
|
||||||
|
<view class="eventsLabel">问题描述:</view>
|
||||||
|
<view class="eventsValue">{{ detailObj.desc || "" }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="pageText" v-if="pageType === 2">协调处理情况</view>
|
||||||
|
|
||||||
|
<view class="detailBox" v-if="pageType === 2" style="padding-bottom: 24rpx;">
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">协调处理结果:</view>
|
||||||
|
<view class="eventsValue">{{ detailObj.startRes || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">办理人:</view>
|
||||||
|
<view class="eventsValue">{{ detailObj.startPerson || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem" style="margin-bottom: 0;">
|
||||||
|
<view class="eventsLabel">办理完成时间:</view>
|
||||||
|
<view class="eventsValue">{{ detailObj.startTime || "" }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="pageText" v-if="pageType === 2">经营公司协调处理情况</view>
|
||||||
|
|
||||||
|
<view class="detailBox" v-if="pageType === 2" style="padding-bottom: 24rpx;">
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">协调处理结果:</view>
|
||||||
|
<view class="eventsPic">{{ detailObj.endRes || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">办理人:</view>
|
||||||
|
<view class="eventsValue">{{ detailObj.endPerson || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItem">
|
||||||
|
<view class="eventsLabel">办理完成时间:</view>
|
||||||
|
<view class="eventsValue">{{ detailObj.endTime || "" }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="eventsItemPic" style="margin-bottom: 0;">
|
||||||
|
<view class="eventsLabel">事件现场照片:</view>
|
||||||
|
<view class="eventsPic" v-if="detailObj.imgList && detailObj.imgList.length > 0">
|
||||||
|
<view class="eventsPicItem" v-for="(item, index) in detailObj.imgList" :key="index"
|
||||||
|
@click="showImg(detailObj.imgList, index)">
|
||||||
|
<image class="eventsPicImg" :src="item.url" />
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
detailObj: null,
|
||||||
|
pageType: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(query) {
|
||||||
|
if (query.detail) {
|
||||||
|
this.detailObj = JSON.parse(query.detail)
|
||||||
|
}
|
||||||
|
if (query.type) {
|
||||||
|
this.pageType = Number(query.type)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.pageType === 1) {
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title: '应急事件'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title: '日常问题'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 图片预览
|
||||||
|
showImg(list, index) {
|
||||||
|
console.log('list', list);
|
||||||
|
console.log('indexindex', index);
|
||||||
|
let urls = []
|
||||||
|
list.forEach((item) => {
|
||||||
|
urls.push(item.url)
|
||||||
|
})
|
||||||
|
|
||||||
|
uni.previewImage({
|
||||||
|
urls: urls,
|
||||||
|
current: list[index].url,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.main {
|
||||||
|
width: 100vw;
|
||||||
|
min-height: 100vh;
|
||||||
|
background-color: #f0f2f3;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-bottom: constant(safe-area-inset-bottom);
|
||||||
|
/* 兼容旧版 iOS */
|
||||||
|
padding-bottom: env(safe-area-inset-bottom);
|
||||||
|
|
||||||
|
/* 兼容新版 */
|
||||||
|
.detailBox {
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 24rpx 24rpx 48rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
|
.pageTitle {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.userDetailBox {
|
||||||
|
width: calc(100% - 32rpx);
|
||||||
|
margin-top: 24rpx;
|
||||||
|
margin-left: 16rpx;
|
||||||
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 16rpx 24rpx;
|
||||||
|
|
||||||
|
.userDetailBoxTop {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.userDetailBoxService {
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.userDetailBoxStatus {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 24rpx;
|
||||||
|
padding: 4rpx 16rpx;
|
||||||
|
border-radius: 32rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.eventsItem {
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
|
||||||
|
.eventsHaveImgLabel {
|
||||||
|
display: flex;
|
||||||
|
width: 200rpx;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.eventsHaveImg {
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
margin-right: 16rpx;
|
||||||
|
margin-top: 6rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.eventsHaveLabel {
|
||||||
|
width: 154rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.eventsLabel {
|
||||||
|
width: 200rpx;
|
||||||
|
text-align: left;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.eventsValue {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.eventsItemPic {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.eventsLabel {
|
||||||
|
width: 200rpx;
|
||||||
|
text-align: left;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.eventsPic {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
|
||||||
|
.eventsPicItem {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
margin-right: 8rpx;
|
||||||
|
margin-bottom: 8rpx;
|
||||||
|
|
||||||
|
.eventsPicImg {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.noBoxShow {
|
||||||
|
box-shadow: none;
|
||||||
|
margin-top: 0;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.eventsItem {
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
|
||||||
|
.eventsHaveImgLabel {
|
||||||
|
display: flex;
|
||||||
|
width: 200rpx;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.eventsHaveImg {
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
margin-right: 16rpx;
|
||||||
|
margin-top: 6rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.eventsHaveLabel {
|
||||||
|
width: 154rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.eventsLabel {
|
||||||
|
width: 200rpx;
|
||||||
|
text-align: left;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.eventsValue {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.eventsItemPic {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.eventsLabel {
|
||||||
|
width: 200rpx;
|
||||||
|
text-align: left;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.eventsPic {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
|
||||||
|
.eventsPicItem {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
margin-right: 8rpx;
|
||||||
|
margin-bottom: 8rpx;
|
||||||
|
|
||||||
|
.eventsPicImg {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.pageText {
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 16rpx 40rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #8d8e8e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
1638
pages/attendanceStatus/index.vue
Normal file
1638
pages/attendanceStatus/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
469
pages/attendanceStatus/serviceFacility.vue
Normal file
469
pages/attendanceStatus/serviceFacility.vue
Normal file
@ -0,0 +1,469 @@
|
|||||||
|
<!-- 服务设施管理 -->
|
||||||
|
<template>
|
||||||
|
<view class="emergency-details">
|
||||||
|
<view class="emergency-details-header facilities-theme">
|
||||||
|
<button class="emergency-back-btn" @tap="closeFacilitiesPage">←</button>
|
||||||
|
<text class="h1">🏪 服务设施管理</text>
|
||||||
|
<text class="current-area">设备状态监控与维护</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 宣传横幅 -->
|
||||||
|
<view class="promo-banner" @tap="viewServiceDetails">
|
||||||
|
<view class="promo-image">
|
||||||
|
<text>🏞️</text>
|
||||||
|
<view class="promo-content">
|
||||||
|
<view class="promo-title">阳澄湖服务区</view>
|
||||||
|
<view class="promo-subtitle">品质服务 · 舒适体验 · 安全便民</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 概览 -->
|
||||||
|
<view class="section m15">
|
||||||
|
<view class="section-header">📊 设施状态概览</view>
|
||||||
|
<view class="stats-grid p15 noMargin">
|
||||||
|
<view class="stat-card">
|
||||||
|
<view class="stat-number ok">7</view>
|
||||||
|
<view class="stat-label">正常运行</view>
|
||||||
|
</view>
|
||||||
|
<view class="stat-card">
|
||||||
|
<view class="stat-number warn">1</view>
|
||||||
|
<view class="stat-label">维护中</view>
|
||||||
|
</view>
|
||||||
|
<view class="stat-card">
|
||||||
|
<view class="stat-number danger">0</view>
|
||||||
|
<view class="stat-label">故障停用</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 设施列表 -->
|
||||||
|
<view class="facilities-section">
|
||||||
|
<view class="facilities-header">🏪 服务设施详情</view>
|
||||||
|
<view class="event-list noPad">
|
||||||
|
<!-- 加油站 -->
|
||||||
|
<view class="event-item left-ok">
|
||||||
|
<view class="event-header">
|
||||||
|
<view class="event-title">⛽ 加油站服务</view>
|
||||||
|
<view class="event-meta">
|
||||||
|
<view class="event-priority priority-low ok">运行正常</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="event-content">
|
||||||
|
<view class="event-description">
|
||||||
|
<text class="line">• 92#汽油:7.8元/升 95#汽油:8.3元/升</text>
|
||||||
|
<text class="line">• 0#柴油:7.2元/升</text>
|
||||||
|
<text class="line">• 24小时营业,支持现金、刷卡、手机支付</text>
|
||||||
|
</view>
|
||||||
|
<view class="event-actions">
|
||||||
|
<button class="event-action-btn btn-primary" @tap="checkFuelStock">库存查询</button>
|
||||||
|
<button class="event-action-btn btn-success" @tap="contactFuelStaff">联系加油员</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 充电桩 -->
|
||||||
|
<view class="event-item left-ok">
|
||||||
|
<view class="event-header">
|
||||||
|
<view class="event-title">🔌 新能源充电桩</view>
|
||||||
|
<view class="event-meta">
|
||||||
|
<view class="event-priority priority-low ok">运行正常</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="event-content">
|
||||||
|
<view class="event-description">
|
||||||
|
<text class="line">• 快充桩:8个(60kW) 慢充桩:4个(7kW)</text>
|
||||||
|
<text class="line">• 当前使用:6个桩在充电中</text>
|
||||||
|
<text class="line">• 支持国标充电接口,扫码即充</text>
|
||||||
|
</view>
|
||||||
|
<view class="event-actions">
|
||||||
|
<button class="event-action-btn btn-primary" @tap="checkChargingStatus">充电状态</button>
|
||||||
|
<button class="event-action-btn btn-warning" @tap="reportChargingIssue">故障上报</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 餐厅 -->
|
||||||
|
<view class="event-item left-ok">
|
||||||
|
<view class="event-header">
|
||||||
|
<view class="event-title">🍽️ 餐厅服务</view>
|
||||||
|
<view class="event-meta">
|
||||||
|
<view class="event-priority priority-low ok">营业中</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="event-content">
|
||||||
|
<view class="event-description">
|
||||||
|
<text class="line">• 营业时间:06:00-23:00</text>
|
||||||
|
<text class="line">• 特色:苏式小笼包、阳澄湖大闸蟹套餐</text>
|
||||||
|
<text class="line">• 座位:80个,当前客流量适中</text>
|
||||||
|
</view>
|
||||||
|
<view class="event-actions">
|
||||||
|
<button class="event-action-btn btn-primary" @tap="viewMenu">查看菜单</button>
|
||||||
|
<button class="event-action-btn btn-success" @tap="contactChef">联系厨房</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 便利店 -->
|
||||||
|
<view class="event-item left-ok">
|
||||||
|
<view class="event-header">
|
||||||
|
<view class="event-title">🛒 便利店</view>
|
||||||
|
<view class="event-meta">
|
||||||
|
<view class="event-priority priority-low ok">营业中</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="event-content">
|
||||||
|
<view class="event-description">
|
||||||
|
<text class="line">• 24小时营业</text>
|
||||||
|
<text class="line">• 商品:日用品、零食饮料、汽车用品、纪念品</text>
|
||||||
|
<text class="line">• 特色:阳澄湖特产、江南小食</text>
|
||||||
|
</view>
|
||||||
|
<view class="event-actions">
|
||||||
|
<button class="event-action-btn btn-primary" @tap="checkInventory">库存管理</button>
|
||||||
|
<button class="event-action-btn btn-success" @tap="contactCashier">联系收银</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 停车场 -->
|
||||||
|
<view class="event-item left-warn">
|
||||||
|
<view class="event-header">
|
||||||
|
<view class="event-title">🅿️ 停车场</view>
|
||||||
|
<view class="event-meta">
|
||||||
|
<view class="event-priority priority-medium">部分维护</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="event-content">
|
||||||
|
<view class="event-description">
|
||||||
|
<text class="line">• 总车位:200个 大车位:50个</text>
|
||||||
|
<text class="line">• 当前可用:180个(B区20个车位灯光维修中)</text>
|
||||||
|
<text class="line">• 免费停车,24小时开放</text>
|
||||||
|
</view>
|
||||||
|
<view class="event-actions">
|
||||||
|
<button class="event-action-btn btn-warning"
|
||||||
|
@tap="contactMaintenance('parking')">联系维修</button>
|
||||||
|
<button class="event-action-btn btn-primary" @tap="checkParkingStatus">车位状态</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 其他设施 -->
|
||||||
|
<view class="event-item left-ok">
|
||||||
|
<view class="event-header">
|
||||||
|
<view class="event-title">🏢 其他设施服务</view>
|
||||||
|
<view class="event-meta">
|
||||||
|
<view class="event-priority priority-low ok">服务正常</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="event-content">
|
||||||
|
<view class="event-description">
|
||||||
|
<text class="line">• 🚻 洗手间:24小时开放,含无障碍设施</text>
|
||||||
|
<text class="line">• 📶 免费WiFi:全区覆盖,密码:YCH888</text>
|
||||||
|
<text class="line">• 🔧 汽修服务:8:00-18:00,应急救援24小时</text>
|
||||||
|
</view>
|
||||||
|
<view class="event-actions">
|
||||||
|
<button class="event-action-btn btn-primary" @tap="viewAllServices">查看详情</button>
|
||||||
|
<button class="event-action-btn btn-success" @tap="contactService">联系服务</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
@bg: #f8f9fa;
|
||||||
|
@muted: #666;
|
||||||
|
@card: #fff;
|
||||||
|
@shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||||
|
@primary: #27B25F;
|
||||||
|
@primary2: #4CCC7F;
|
||||||
|
@ok: #2ed573;
|
||||||
|
@warn: #ff9f43;
|
||||||
|
@danger: #ff4757;
|
||||||
|
|
||||||
|
.emergency-details {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
width: 100%;
|
||||||
|
max-width: 750rpx;
|
||||||
|
height: 100%;
|
||||||
|
background: @bg;
|
||||||
|
z-index: 1000;
|
||||||
|
overflow-y: auto;
|
||||||
|
|
||||||
|
.emergency-details-header {
|
||||||
|
background: linear-gradient(135deg, @danger, #ff3838);
|
||||||
|
color: #fff;
|
||||||
|
padding: 40rpx;
|
||||||
|
position: relative;
|
||||||
|
box-shadow: @shadow;
|
||||||
|
|
||||||
|
&.facilities-theme {
|
||||||
|
background: linear-gradient(135deg, #20bf6b, #0fb9b1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.emergency-back-btn {
|
||||||
|
position: absolute;
|
||||||
|
left: 30rpx;
|
||||||
|
top: 30rpx;
|
||||||
|
background: rgba(255, 255, 255, .2);
|
||||||
|
border: none;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 36rpx;
|
||||||
|
width: 80rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.h1 {
|
||||||
|
text-align: center;
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 6rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.current-area {
|
||||||
|
text-align: center;
|
||||||
|
display: block;
|
||||||
|
opacity: .9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-list {
|
||||||
|
padding: 30rpx;
|
||||||
|
|
||||||
|
.event-item {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: @shadow;
|
||||||
|
border-left: 8rpx solid @danger;
|
||||||
|
|
||||||
|
&.warning {
|
||||||
|
border-left-color: @warn;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.resolved {
|
||||||
|
border-left-color: @ok;
|
||||||
|
opacity: .85;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.left-ok {
|
||||||
|
border-left-color: @ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.left-warn {
|
||||||
|
border-left-color: @warn;
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-header {
|
||||||
|
padding: 30rpx;
|
||||||
|
border-bottom: 1rpx solid #f1f3f4;
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
.event-title {
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 32rpx;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-meta {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: @muted;
|
||||||
|
|
||||||
|
.event-time {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-priority {
|
||||||
|
padding: 6rpx 16rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
font-size: 22rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
|
||||||
|
&.priority-high {
|
||||||
|
background: #ffe6e6;
|
||||||
|
color: #d32f2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.priority-medium {
|
||||||
|
background: #fff3e0;
|
||||||
|
color: #f57c00;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.priority-low {
|
||||||
|
background: #e8f5e8;
|
||||||
|
color: #388e3c;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.ok {
|
||||||
|
background: #e8f5e8;
|
||||||
|
color: #2e7d32;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-content {
|
||||||
|
padding: 30rpx;
|
||||||
|
|
||||||
|
.event-description {
|
||||||
|
margin-bottom: 24rpx;
|
||||||
|
line-height: 1.6;
|
||||||
|
color: #333;
|
||||||
|
|
||||||
|
.line {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-actions {
|
||||||
|
display: flex;
|
||||||
|
gap: 20rpx;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
|
||||||
|
.event-action-btn {
|
||||||
|
padding: 16rpx 24rpx;
|
||||||
|
border: none;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
&.btn-primary {
|
||||||
|
background: @primary;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.btn-success {
|
||||||
|
background: @ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.btn-warning {
|
||||||
|
background: @warn;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-status {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
padding: 16rpx 20rpx;
|
||||||
|
background: @bg;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
|
||||||
|
.status-dot {
|
||||||
|
width: 16rpx;
|
||||||
|
height: 16rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
|
||||||
|
&.status-processing {
|
||||||
|
background: @warn;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.status-resolved {
|
||||||
|
background: @ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.status-pending {
|
||||||
|
background: @danger;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.add-event-btn {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 160rpx;
|
||||||
|
right: 40rpx;
|
||||||
|
width: 96rpx;
|
||||||
|
height: 96rpx;
|
||||||
|
background: linear-gradient(135deg, @primary, @primary2);
|
||||||
|
border-radius: 50%;
|
||||||
|
border: none;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 40rpx;
|
||||||
|
box-shadow: 0 8rpx 24rpx rgba(74, 144, 226, .4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.promo-banner {
|
||||||
|
margin: 30rpx;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: @shadow;
|
||||||
|
|
||||||
|
.promo-image {
|
||||||
|
width: 100%;
|
||||||
|
height: 240rpx;
|
||||||
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 48rpx;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.promo-content {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
background: linear-gradient(transparent, rgba(0, 0, 0, .7));
|
||||||
|
padding: 40rpx 30rpx 30rpx;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
.promo-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
margin-bottom: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.promo-subtitle {
|
||||||
|
font-size: 24rpx;
|
||||||
|
opacity: .9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.facilities-section {
|
||||||
|
margin: 30rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: @shadow;
|
||||||
|
|
||||||
|
.facilities-header {
|
||||||
|
background: linear-gradient(135deg, #20bf6b, #0fb9b1);
|
||||||
|
color: #fff;
|
||||||
|
padding: 30rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 32rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -1,47 +1,66 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<image class="typeImg" src="https://eshangtech.com/ShopICO/ahyd-BID/commercial/noData.svg"></image>
|
<image class="typeImg" src="https://eshangtech.com/ShopICO/ahyd-BID/commercial/noData.svg"></image>
|
||||||
<p class="text" v-if="type==='index'">抱歉,数据为第三方接口传输,无法进行画像分析</p>
|
<p class="text" v-if="type === 'index'">抱歉,数据为第三方接口传输,无法进行画像分析</p>
|
||||||
<p class="noAuthor" v-else-if="type==='noAuthor'">抱歉,您没有权限查看数智化看板,请联系管理员进行授权</p>
|
<p class="noAuthor" v-else-if="type === 'noAuthor'">抱歉,您没有权限查看数智化看板,请联系管理员进行授权</p>
|
||||||
|
<p class="homeIndex" v-else-if="type === 'homeIndex'">抱歉,您没有权限查看数智化看板,请联系管理员进行授权</p>
|
||||||
<p class="text" v-else>抱歉,第三方数据未传,无法分析</p>
|
<p class="text" v-else>抱歉,第三方数据未传,无法分析</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
export default {
|
export default {
|
||||||
name: "noData",
|
name: "noData",
|
||||||
data(){
|
data() {
|
||||||
return {
|
return {
|
||||||
type:''
|
type: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(query){
|
computed: {
|
||||||
if (query.type){
|
...mapGetters({ user: "getUser" }),
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
user: {
|
||||||
|
handler(newValue, value) {
|
||||||
|
if (this.type === 'homeIndex') {
|
||||||
|
if (newValue && newValue.WeChat_UserId && newValue.AuthorityInfo["89a1f248-2113-4d57-84b1-c2e6edb9e8ee"] === 1) {
|
||||||
|
uni.switchTab({
|
||||||
|
url: `/pages/index/index`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(query) {
|
||||||
|
if (query.type) {
|
||||||
this.type = query.type
|
this.type = query.type
|
||||||
}
|
}
|
||||||
let userInfo = uni.getStorageSync('vuex')
|
let userInfo = uni.getStorageSync('vuex')
|
||||||
userInfo = JSON.parse(userInfo)
|
userInfo = JSON.parse(userInfo)
|
||||||
console.log('userInfo',userInfo)
|
|
||||||
console.log(userInfo.userData.AuthorityInfo['89a1f248-2113-4d57-84b1-c2e6edb9e8ee'])
|
|
||||||
if (userInfo.userData.AuthorityInfo['89a1f248-2113-4d57-84b1-c2e6edb9e8ee']===1){
|
|
||||||
setTimeout(()=>{
|
if (userInfo.userData.AuthorityInfo['89a1f248-2113-4d57-84b1-c2e6edb9e8ee'] === 1) {
|
||||||
|
setTimeout(() => {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url:`/pages/index/index`
|
url: `/pages/index/index`
|
||||||
})
|
})
|
||||||
},200)
|
}, 200)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
this.$util.addUserBehavior()
|
this.$util.addUserBehavior()
|
||||||
},
|
},
|
||||||
methods:{
|
methods: {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.main{
|
.main {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@ -49,18 +68,21 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
padding: 16px 0;
|
padding: 16px 0;
|
||||||
.img{
|
|
||||||
width:60px;
|
.img {
|
||||||
|
width: 60px;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
.typeImg{
|
|
||||||
|
.typeImg {
|
||||||
width: 80px;
|
width: 80px;
|
||||||
height: 80px;
|
height: 80px;
|
||||||
margin-top: 40vh;
|
margin-top: 40vh;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
.text{
|
|
||||||
|
.text {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-family: PingFangSC-Regular, PingFang SC;
|
font-family: PingFangSC-Regular, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|||||||
@ -1,58 +1,59 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<!-- num 是字符串,会被切成片渲染 -->
|
<!-- num 是字符串,会被切成片渲染 -->
|
||||||
<view class="l-num" :style="{width: key===',' || key==='.'?'12rpx':'28rpx'}" v-for="(key,value) in num" :key="value">
|
<view class="l-num" :style="{ width: key === ',' || key === '.' ? '12rpx' : '24rpx' }" v-for="(key, value) in num"
|
||||||
|
:key="value">
|
||||||
<template v-if="key !== '.' && key !== ','">
|
<template v-if="key !== '.' && key !== ','">
|
||||||
<view class="l-son" :style="'transform: translateY(-'+(key*52)+'rpx);'" >
|
<view class="l-son" :style="'transform: translateY(-' + (key * 52) + 'rpx);'">
|
||||||
<view class="l-num l-posi" v-for="(s,i) in range" :style="'transform: translateY('+(i*52)+'rpx);'" :key="i">
|
<view class="l-num l-posi" v-for="(s, i) in range" :style="'transform: translateY(' + (i * 52) + 'rpx);'" :key="i">
|
||||||
{{s}}
|
{{ s }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<!-- 小数点 -->
|
<!-- 小数点 -->
|
||||||
<view class="l-num l-posi" v-else>{{key}}</view>
|
<view class="l-num l-posi" v-else>{{ key }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
let range = new Array(10).fill(0).map((e,i) => i);
|
let range = new Array(10).fill(0).map((e, i) => i);
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
num:'0.00', //当前显示数字
|
num: '0.00', //当前显示数字
|
||||||
value:'', //当前数字
|
value: '', //当前数字
|
||||||
range:range,//0-9
|
range: range,//0-9
|
||||||
turnTime: 100//定时器时间 单位毫秒 可控制数字滚动快慢 数字越高滚动频率越慢
|
turnTime: 100//定时器时间 单位毫秒 可控制数字滚动快慢 数字越高滚动频率越慢
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props:{
|
props: {
|
||||||
number:{
|
number: {
|
||||||
type: String,
|
type: String,
|
||||||
default:''
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch:{
|
watch: {
|
||||||
number:{
|
number: {
|
||||||
handler(value){
|
handler(value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this._getNumber();
|
this._getNumber();
|
||||||
},
|
},
|
||||||
immediate:true,
|
immediate: true,
|
||||||
deep:true
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {},
|
onLoad() { },
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
// 这里是保留两位小数的
|
// 这里是保留两位小数的
|
||||||
_getNumber(){
|
_getNumber() {
|
||||||
let value = this.value
|
let value = this.value
|
||||||
let num = this.num;
|
let num = this.num;
|
||||||
|
|
||||||
if(num == value){
|
if (num == value) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 我的思路是把数字切成一个数组,每个字符对应一个下标
|
// 我的思路是把数字切成一个数组,每个字符对应一个下标
|
||||||
@ -61,17 +62,17 @@ export default {
|
|||||||
let newShowNumber = []
|
let newShowNumber = []
|
||||||
let newNowNumber = []
|
let newNowNumber = []
|
||||||
|
|
||||||
this.showNumber.forEach(item=>{
|
this.showNumber.forEach(item => {
|
||||||
if (item!==',' && item!=='.'){
|
if (item !== ',' && item !== '.') {
|
||||||
newShowNumber.push(Number(item))
|
newShowNumber.push(Number(item))
|
||||||
}else{
|
} else {
|
||||||
newShowNumber.push(item)
|
newShowNumber.push(item)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.nowNumber.forEach(item=>{
|
this.nowNumber.forEach(item => {
|
||||||
if (item!==',' && item!=='.'){
|
if (item !== ',' && item !== '.') {
|
||||||
newNowNumber.push(Number(item))
|
newNowNumber.push(Number(item))
|
||||||
}else{
|
} else {
|
||||||
newNowNumber.push(item)
|
newNowNumber.push(item)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -84,46 +85,46 @@ export default {
|
|||||||
let key = sl > ol ? 'nowNumber' : 'showNumber';
|
let key = sl > ol ? 'nowNumber' : 'showNumber';
|
||||||
|
|
||||||
// 这个函数是用来补位的,例如原来是1,新数字是100,那么要给位数少的补位 1 ==> 001
|
// 这个函数是用来补位的,例如原来是1,新数字是100,那么要给位数少的补位 1 ==> 001
|
||||||
this._formatNumber(key,sl,ol);
|
this._formatNumber(key, sl, ol);
|
||||||
|
|
||||||
// 这个是数字变化滚动的具体函数
|
// 这个是数字变化滚动的具体函数
|
||||||
this._turnNumber();
|
this._turnNumber();
|
||||||
},
|
},
|
||||||
|
|
||||||
_formatNumber(key,oldV,newV){
|
_formatNumber(key, oldV, newV) {
|
||||||
let length = Math.abs(oldV - newV);
|
let length = Math.abs(oldV - newV);
|
||||||
let arr = new Array(length).fill(0);
|
let arr = new Array(length).fill(0);
|
||||||
this[key] = arr.concat(this[key]);
|
this[key] = arr.concat(this[key]);
|
||||||
},
|
},
|
||||||
|
|
||||||
_turnNumber(){
|
_turnNumber() {
|
||||||
|
|
||||||
let _this = this;
|
let _this = this;
|
||||||
// 循环数字数组,
|
// 循环数字数组,
|
||||||
_this.showNumber.forEach((e,i) => {
|
_this.showNumber.forEach((e, i) => {
|
||||||
// 判断对应位数的值,如果相等就跳过
|
// 判断对应位数的值,如果相等就跳过
|
||||||
if(e == _this.nowNumber[i]) return;
|
if (e == _this.nowNumber[i]) return;
|
||||||
|
|
||||||
let inter = setInterval(() => {
|
let inter = setInterval(() => {
|
||||||
// 数值相等后清除定时器
|
// 数值相等后清除定时器
|
||||||
if(e == _this.nowNumber[_this._index(i)]){
|
if (e == _this.nowNumber[_this._index(i)]) {
|
||||||
clearInterval(inter);
|
clearInterval(inter);
|
||||||
}else{
|
} else {
|
||||||
if (e!==',' && e!=='.'){
|
if (e !== ',' && e !== '.') {
|
||||||
// 如果大于就 -- 小于就 ++
|
// 如果大于就 -- 小于就 ++
|
||||||
_this.showNumber[_this._index(i)] = e > _this.nowNumber[_this._index(i)] ? --e : ++e;
|
_this.showNumber[_this._index(i)] = e > _this.nowNumber[_this._index(i)] ? --e : ++e;
|
||||||
// 每次值变化都更新到视图上,这样看上去就像是滚动了一下。好吧,其实就是滚动了
|
// 每次值变化都更新到视图上,这样看上去就像是滚动了一下。好吧,其实就是滚动了
|
||||||
_this.num = parseFloat(_this.showNumber.join('')).toFixed(2);
|
_this.num = parseFloat(_this.showNumber.join('')).toFixed(2);
|
||||||
_this.num = _this.$util.fmoney(_this.num,2)
|
_this.num = _this.$util.fmoney(_this.num, 2)
|
||||||
}else{
|
} else {
|
||||||
clearInterval(inter);
|
clearInterval(inter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},_this.turnTime);
|
}, _this.turnTime);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 保留当前i的值
|
// 保留当前i的值
|
||||||
_index(i){
|
_index(i) {
|
||||||
return i
|
return i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -131,17 +132,17 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.content{
|
.content {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.l-input{
|
.l-input {
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.l-num{
|
.l-num {
|
||||||
font-size: 48rpx;
|
font-size: 32rpx;
|
||||||
font-family: DINAlternate-Bold, DINAlternate;
|
font-family: DINAlternate-Bold, DINAlternate;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #160002;
|
color: #160002;
|
||||||
@ -153,14 +154,14 @@ export default {
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.l-son{
|
.l-son {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100% * 10);
|
height: calc(100% * 10);
|
||||||
position: relative;
|
position: relative;
|
||||||
transition:all 0.5s;
|
transition: all 0.5s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.l-posi{
|
.l-posi {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 月份的轮播框 -->
|
<!-- 月份的轮播框 -->
|
||||||
<view class="monthListBox" :style="{ marginTop: menu.bottom + 8 + 'px' }">
|
<view class="monthListBox" :style="{ paddingTop: menu.bottom + 8 + 'px' }">
|
||||||
<swiper class="swiperBox" previous-margin="40rpx" next-margin="40rpx" :current="selectIndex"
|
<swiper class="swiperBox" previous-margin="40rpx" next-margin="40rpx" :current="selectIndex"
|
||||||
@animationfinish="handleChangeSwiper">
|
@animationfinish="handleChangeSwiper">
|
||||||
<swiper-item class="swiperItem" v-for="(item, index) in monthList" :key="index">
|
<swiper-item class="swiperItem" v-for="(item, index) in monthList" :key="index">
|
||||||
@ -211,8 +211,8 @@
|
|||||||
|
|
||||||
|
|
||||||
<!-- 即时营收 -->
|
<!-- 即时营收 -->
|
||||||
<view class="instantRevenue" style="margin-top: 24rpx">
|
<view class="instantRevenue" style="margin-top: 24rpx;">
|
||||||
<view class="revenue" @click="handlePage">
|
<view class="revenue" @click="handlePage" style="padding-bottom: 0;">
|
||||||
<view class="revenueTop">
|
<view class="revenueTop">
|
||||||
<view class="revenyeTopLeft">
|
<view class="revenyeTopLeft">
|
||||||
<image class="monthIcon"
|
<image class="monthIcon"
|
||||||
@ -233,6 +233,24 @@
|
|||||||
<text class="moneyLabel">实时对客销售/元</text>
|
<text class="moneyLabel">实时对客销售/元</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- <view class="revenue revenueOther">
|
||||||
|
<view class="otherRealDataBox">
|
||||||
|
<view class="revenueMoneyItem" v-for="(subItem, subIndex) in otherRealData"
|
||||||
|
:style="{ marginTop: subIndex >= 2 ? '24rpx' : '' }">
|
||||||
|
<view class="revenueMoneyItemLeft">
|
||||||
|
<image class="leftIcon" :src="subItem.icon" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="revenueMoneyItemRight">
|
||||||
|
<view class="moneyLabel">{{ subItem.label || "" }}</view>
|
||||||
|
<view class="moneyText">{{ subItem.value || "" }}<span class="moneyUnit">{{ subItem.unit
|
||||||
|
|| "" }}</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 实时水电、加油、尿素、充电 -->
|
<!-- 实时水电、加油、尿素、充电 -->
|
||||||
@ -247,7 +265,9 @@
|
|||||||
|
|
||||||
<view class="revenueMoneyItemRight">
|
<view class="revenueMoneyItemRight">
|
||||||
<view class="moneyLabel">{{ subItem.label || "" }}</view>
|
<view class="moneyLabel">{{ subItem.label || "" }}</view>
|
||||||
<view class="moneyText">{{ subItem.value || "" }}<span class="moneyUnit">{{ subItem.unit
|
<view class="moneyText">
|
||||||
|
<span class="money">{{ subItem.value || "" }}</span>
|
||||||
|
<span class="moneyUnit">/{{ subItem.unit
|
||||||
|| "" }}</span>
|
|| "" }}</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -272,6 +292,17 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="funItem" @click="handleGoAttendanceStatus">
|
||||||
|
<view class="funItemContent">
|
||||||
|
<view class="funIconBox">
|
||||||
|
<image class="funIcon"
|
||||||
|
src="https://eshangtech.com/ShopICO/ahyd-BID/warning/operateWarning.svg" />
|
||||||
|
</view>
|
||||||
|
<text class="funText">出勤情况</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="funItem" @click="goToRobot">
|
<view class="funItem" @click="goToRobot">
|
||||||
<view class="funItemContent">
|
<view class="funItemContent">
|
||||||
<view class="funIconBox">
|
<view class="funIconBox">
|
||||||
@ -295,10 +326,11 @@ import RateCharts from "./components/rateCharts.vue";
|
|||||||
import NumberScroll from "./components/numberScroll.vue";
|
import NumberScroll from "./components/numberScroll.vue";
|
||||||
import Tabbar from "../../components/tabbar/tabbar.vue";
|
import Tabbar from "../../components/tabbar/tabbar.vue";
|
||||||
import { timestampToTimeMonth } from "../../util/dateTime";
|
import { timestampToTimeMonth } from "../../util/dateTime";
|
||||||
|
import { mapState, mapGetters } from 'vuex'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
const lastDay = this.$util.cutDate(new Date(), 'YYYY-MM-DD', -1) // 有数据的最近日期 即昨天
|
const lastDay = this.$util.cutDate(new Date(), 'YYYY-MM-DD', -1) // 有数据的最近日期 即昨天
|
||||||
const nowDay = this.$util.cutDate(new Date(), 'YYYY-MM-DD') // 有数据的最近日期 即昨天
|
const nowDay = this.$util.cutDate(new Date(), 'YYYY-MM-DD') // 有数据的最近日期
|
||||||
return {
|
return {
|
||||||
menu: {},// 拿到微信胶囊按钮的一些定位数据
|
menu: {},// 拿到微信胶囊按钮的一些定位数据
|
||||||
startDate: "2024-01-01",// 数据开始的时间 用于判断出现几个 滚动框
|
startDate: "2024-01-01",// 数据开始的时间 用于判断出现几个 滚动框
|
||||||
@ -316,6 +348,8 @@ export default {
|
|||||||
single: "",
|
single: "",
|
||||||
ydModal: false, // 显示驿达百分比的具体值
|
ydModal: false, // 显示驿达百分比的具体值
|
||||||
modalRateList: [],// 点击圆环图出现的白色悬浮框的数据
|
modalRateList: [],// 点击圆环图出现的白色悬浮框的数据
|
||||||
|
useInfo: {},
|
||||||
|
isReturn: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@ -323,9 +357,42 @@ export default {
|
|||||||
NumberScroll,
|
NumberScroll,
|
||||||
Tabbar,
|
Tabbar,
|
||||||
},
|
},
|
||||||
async onLoad() {
|
computed: {
|
||||||
this.menu = uni.getMenuButtonBoundingClientRect();
|
...mapGetters({ user: "getUser" }),
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
user: {
|
||||||
|
handler(newValue, value) {
|
||||||
|
console.log('watchwatchwatchwatchwatch');
|
||||||
|
let _this = this
|
||||||
|
console.log('newValuenewValuenewValue', newValue);
|
||||||
|
let userInfo = JSON.parse(JSON.stringify(newValue));
|
||||||
|
_this.useInfo = JSON.parse(JSON.stringify(newValue));
|
||||||
|
|
||||||
|
if (userInfo && userInfo.WeChat_UserId && userInfo.AuthorityInfo["89a1f248-2113-4d57-84b1-c2e6edb9e8ee"] === 1) {
|
||||||
|
_this.isReturn = false;
|
||||||
|
} else if (userInfo && userInfo.WeChat_UserId && userInfo.AuthorityInfo["89a1f248-2113-4d57-84b1-c2e6edb9e8ee"] !== 1) {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: `/pages/commercialBI/noData?type=homeIndex`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
_this.topShowData = null
|
||||||
|
_this.moneyRateList = []
|
||||||
|
_this.profitSharingList = []
|
||||||
|
_this.modalRateList = []
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('userInfouserInfouserInfo', _this.useInfo);
|
||||||
|
console.log('userInfouserisReturnisReturnisReturnisReturnInfouserInfo', _this.isReturn);
|
||||||
|
if (!_this.isReturn) {
|
||||||
|
_this.handleGetOnLoad()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
let _this = this
|
||||||
|
this.menu = uni.getMenuButtonBoundingClientRect();
|
||||||
uni.getLocation({
|
uni.getLocation({
|
||||||
type: "gcj02",
|
type: "gcj02",
|
||||||
altitude: true,
|
altitude: true,
|
||||||
@ -335,14 +402,64 @@ export default {
|
|||||||
longitude: res.longitude,
|
longitude: res.longitude,
|
||||||
};
|
};
|
||||||
uni.setStorageSync("seatInfo", JSON.stringify(seatInfo));
|
uni.setStorageSync("seatInfo", JSON.stringify(seatInfo));
|
||||||
|
_this.handleGetNearService(seatInfo.latitude, seatInfo.longitude)
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
this.single = timestampToTimeMonth(new Date(this.lastDay).getTime());
|
this.single = timestampToTimeMonth(new Date(this.lastDay).getTime());
|
||||||
console.log('this.singlethis.singlethis.single', this.single);
|
console.log('this.singlethis.singlethis.single', this.single);
|
||||||
|
uni.setStorageSync("lastDay", this.lastDay);
|
||||||
|
|
||||||
|
|
||||||
|
console.log('useruseruseruser', this.user);
|
||||||
|
|
||||||
|
// 小程序进来存起来的用户信息
|
||||||
|
// let userInfo = uni.getStorageSync("vuex");
|
||||||
|
let userInfo = JSON.parse(JSON.stringify(this.user));
|
||||||
|
_this.useInfo = JSON.parse(JSON.stringify(this.user));
|
||||||
|
// console.log('userInfouserInfo', userInfo);
|
||||||
|
|
||||||
|
console.log('userInfouserInfo', userInfo);
|
||||||
|
|
||||||
|
|
||||||
|
if (userInfo && userInfo.WeChat_UserId && userInfo.AuthorityInfo["89a1f248-2113-4d57-84b1-c2e6edb9e8ee"] === 1) {
|
||||||
|
_this.isReturn = false;
|
||||||
|
} else if (userInfo && userInfo.WeChat_UserId && userInfo.AuthorityInfo["89a1f248-2113-4d57-84b1-c2e6edb9e8ee"] !== 1) {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: `/pages/commercialBI/noData?type=homeIndex`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('userInfouserInfouserInfo', _this.useInfo);
|
||||||
|
console.log('userInfouserisReturnisReturnisReturnisReturnInfouserInfo', _this.isReturn);
|
||||||
|
if (!_this.isReturn) {
|
||||||
|
_this.handleGetOnLoad()
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
// 隐藏掉小程序本身自带的 tabbar 让自定义的tabbar出现
|
||||||
|
uni.hideTabBar();
|
||||||
|
},
|
||||||
|
onPullDownRefresh: function () {
|
||||||
|
let _this = this
|
||||||
|
let userInfo = JSON.parse(JSON.stringify(this.user));
|
||||||
|
if (userInfo && userInfo.WeChat_UserId && userInfo.AuthorityInfo["89a1f248-2113-4d57-84b1-c2e6edb9e8ee"] === 1) {
|
||||||
|
_this.isReturn = false;
|
||||||
|
} else if (userInfo && userInfo.WeChat_UserId && userInfo.AuthorityInfo["89a1f248-2113-4d57-84b1-c2e6edb9e8ee"] !== 1) {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: `/pages/commercialBI/noData?type=homeIndex`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!_this.isReturn) {
|
||||||
|
_this.handleGetOnLoad()
|
||||||
|
}
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 在onLoad里面调用的 请求整个页面的数据
|
||||||
|
async handleGetOnLoad() {
|
||||||
// 拿到首页的一些基本信息
|
// 拿到首页的一些基本信息
|
||||||
this.handleGetIndexInfo()
|
this.handleGetIndexInfo()
|
||||||
|
|
||||||
@ -353,36 +470,89 @@ export default {
|
|||||||
this.handleRealRevenue()
|
this.handleRealRevenue()
|
||||||
// 云南的实时内容 油品、加水、尿素、充电
|
// 云南的实时内容 油品、加水、尿素、充电
|
||||||
this.handleGetYNRealData()
|
this.handleGetYNRealData()
|
||||||
|
|
||||||
uni.setStorageSync("lastDay", this.lastDay);
|
|
||||||
},
|
},
|
||||||
onShow() {
|
|
||||||
// 隐藏掉小程序本身自带的 tabbar 让自定义的tabbar出现
|
|
||||||
uni.hideTabBar();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleShowYDModal() {
|
handleShowYDModal() {
|
||||||
this.ydModal = !this.ydModal;
|
this.ydModal = !this.ydModal;
|
||||||
},
|
},
|
||||||
goToRobot() {
|
goToRobot() {
|
||||||
|
if (this.isReturn) {
|
||||||
|
let _this = this
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提示',
|
||||||
|
content: '请您授权登录后再操作。',
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
_this.$util.toNextRoute('redirectTo', '/pages/register/register')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
this.$util.toNextRoute("navigateTo", `/pages/robot/index`);
|
this.$util.toNextRoute("navigateTo", `/pages/robot/index`);
|
||||||
// this.$util.toNextRoute("navigateTo", `/pages/testPage/index`);
|
// this.$util.toNextRoute("navigateTo", `/pages/testPage/index`);
|
||||||
},
|
},
|
||||||
|
// 跳转去出勤情况
|
||||||
|
handleGoAttendanceStatus() {
|
||||||
|
if (this.isReturn) {
|
||||||
|
let _this = this
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提示',
|
||||||
|
content: '请您授权登录后再操作。',
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
_this.$util.toNextRoute('redirectTo', '/pages/register/register')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$util.toNextRoute(
|
||||||
|
"navigateTo",
|
||||||
|
`/pages/attendanceStatus/index`
|
||||||
|
);
|
||||||
|
},
|
||||||
// 跳转到经营报表
|
// 跳转到经营报表
|
||||||
handleGoOperate() {
|
handleGoOperate() {
|
||||||
|
if (this.isReturn) {
|
||||||
|
let _this = this
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提示',
|
||||||
|
content: '请您授权登录后再操作。',
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
_this.$util.toNextRoute('redirectTo', '/pages/register/register')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
this.$util.toNextRoute(
|
this.$util.toNextRoute(
|
||||||
"navigateTo",
|
"navigateTo",
|
||||||
`/pages/operatingStatements/index?time=${this.single}`
|
`/pages/operatingStatements/index?time=${this.single}`
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
handlePage() {
|
handlePage() {
|
||||||
|
|
||||||
this.$util.toNextRoute(
|
this.$util.toNextRoute(
|
||||||
"navigateTo",
|
"navigateTo",
|
||||||
`/pages/everdayRenven/index?time=${this.lastDay}&GroupType=1000&ProvinceCode=530000&ServerpartIds=`
|
`/pages/everdayRenven/index?time=${this.lastDay}&GroupType=1000&ProvinceCode=530000&ServerpartIds=`
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
handleGoMap() {
|
handleGoMap() {
|
||||||
|
if (this.isReturn) {
|
||||||
|
let _this = this
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提示',
|
||||||
|
content: '请您授权登录后再操作。',
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
_this.$util.toNextRoute('redirectTo', '/pages/register/register')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
this.$util.toNextRoute("navigateTo", "/pages/map/index?type=index");
|
this.$util.toNextRoute("navigateTo", "/pages/map/index?type=index");
|
||||||
},
|
},
|
||||||
// 拿到云南 油水电等数据
|
// 拿到云南 油水电等数据
|
||||||
@ -398,31 +568,31 @@ export default {
|
|||||||
list.forEach((item) => {
|
list.forEach((item) => {
|
||||||
if (item.dataType === 2000) {
|
if (item.dataType === 2000) {
|
||||||
result.push({
|
result.push({
|
||||||
label: `今日油品`,
|
label: `油品`,
|
||||||
value: this.$util.fmoney(item.totalCount),
|
value: this.$util.fmoney(item.totalCount),
|
||||||
unit: item.totalCountUnit,
|
unit: item.totalCountUnit,
|
||||||
icon: "http://saas.eshangtech.com/cyy_DIB/oilIcon.png"
|
icon: "https://eshangtech.com/cyy_DIB/oilIcon.png"
|
||||||
})
|
})
|
||||||
} else if (item.dataType === 3000) {
|
} else if (item.dataType === 3000) {
|
||||||
result.push({
|
result.push({
|
||||||
label: `今日加水`,
|
label: `加水`,
|
||||||
value: this.$util.fmoney(item.totalCount),
|
value: this.$util.fmoney(item.totalCount),
|
||||||
unit: item.totalCountUnit,
|
unit: item.totalCountUnit,
|
||||||
icon: "http://saas.eshangtech.com/cyy_DIB/addWaterIcon.png"
|
icon: "https://eshangtech.com/cyy_DIB/addWaterIcon.png"
|
||||||
})
|
})
|
||||||
} else if (item.dataType === 4000) {
|
} else if (item.dataType === 4000) {
|
||||||
result.push({
|
result.push({
|
||||||
label: `今日尿素`,
|
label: `尿素`,
|
||||||
value: this.$util.fmoney(item.totalCount),
|
value: this.$util.fmoney(item.totalCount),
|
||||||
unit: item.totalCountUnit,
|
unit: item.totalCountUnit,
|
||||||
icon: "http://saas.eshangtech.com/cyy_DIB/ureaIcon.png"
|
icon: "https://eshangtech.com/cyy_DIB/ureaIcon.png"
|
||||||
})
|
})
|
||||||
} else if (item.dataType === 5000) {
|
} else if (item.dataType === 5000) {
|
||||||
result.push({
|
result.push({
|
||||||
label: `今日充电`,
|
label: `充电`,
|
||||||
value: this.$util.fmoney(item.totalTicket),
|
value: this.$util.fmoney(item.totalTicket),
|
||||||
unit: item.totalTicketUnit,
|
unit: item.totalTicketUnit,
|
||||||
icon: "http://saas.eshangtech.com/cyy_DIB/chargeIcon.png"
|
icon: "https://eshangtech.com/cyy_DIB/chargeIcon.png"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -558,6 +728,21 @@ export default {
|
|||||||
"星期五",
|
"星期五",
|
||||||
"星期六",
|
"星期六",
|
||||||
][holiday];
|
][holiday];
|
||||||
|
},
|
||||||
|
// 拿一个最近的服务区 当默认服务区
|
||||||
|
async handleGetNearService(latitude, longitude) {
|
||||||
|
let req = {
|
||||||
|
Province_Code: "530000",
|
||||||
|
longitude: latitude,
|
||||||
|
latitude: longitude,
|
||||||
|
ShowService: true,
|
||||||
|
PageIndex: 1,
|
||||||
|
PageSize: 1
|
||||||
|
}
|
||||||
|
const data = await request.$webGet('CommercialApi/BaseInfo/GetServerpartList', req)
|
||||||
|
console.log('sdjkajdas', data);
|
||||||
|
let list = data.Result_Data.List
|
||||||
|
uni.setStorageSync('currentService', list[0])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -568,7 +753,7 @@ export default {
|
|||||||
.main {
|
.main {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
background-image: url("https://saas.eshangtech.com/minTestImg/pageBg.png");
|
background-image: url("https://eshangtech.com/minTestImg/pageBg.png");
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
|
|
||||||
@ -580,7 +765,7 @@ export default {
|
|||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
z-index: 99;
|
z-index: 99;
|
||||||
background-image: url("https://saas.eshangtech.com/minTestImg/pageBg.png");
|
background-image: url("https://eshangtech.com/minTestImg/pageBg.png");
|
||||||
|
|
||||||
.topContent {
|
.topContent {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -665,7 +850,7 @@ export default {
|
|||||||
.swiperItemContentUnit {
|
.swiperItemContentUnit {
|
||||||
font-family: 'PingFangSC';
|
font-family: 'PingFangSC';
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 28rpx;
|
font-size: 24rpx;
|
||||||
color: #A69E9F;
|
color: #A69E9F;
|
||||||
line-height: 40rpx;
|
line-height: 40rpx;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
@ -684,7 +869,7 @@ export default {
|
|||||||
.leftRevenueValue {
|
.leftRevenueValue {
|
||||||
font-family: 'DINAlternate';
|
font-family: 'DINAlternate';
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 40rpx;
|
font-size: 30rpx;
|
||||||
color: #160002;
|
color: #160002;
|
||||||
line-height: 40rpx;
|
line-height: 40rpx;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
@ -698,7 +883,7 @@ export default {
|
|||||||
.addValue {
|
.addValue {
|
||||||
font-family: 'DINAlternate';
|
font-family: 'DINAlternate';
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 30rpx;
|
font-size: 28rpx;
|
||||||
line-height: 40rpx;
|
line-height: 40rpx;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
@ -707,7 +892,7 @@ export default {
|
|||||||
.rightNav {
|
.rightNav {
|
||||||
font-family: PingFangSC, PingFang SC;
|
font-family: PingFangSC, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 28rpx;
|
font-size: 24rpx;
|
||||||
color: #A69E9F;
|
color: #A69E9F;
|
||||||
line-height: 40rpx;
|
line-height: 40rpx;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
@ -886,7 +1071,7 @@ export default {
|
|||||||
.revenueNum {
|
.revenueNum {
|
||||||
font-family: DINAlternate-Bold, DINAlternate;
|
font-family: DINAlternate-Bold, DINAlternate;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 32rpx;
|
font-size: 28rpx;
|
||||||
color: #160002;
|
color: #160002;
|
||||||
line-height: 44rpx;
|
line-height: 44rpx;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
@ -896,7 +1081,7 @@ export default {
|
|||||||
.revenueAdd {
|
.revenueAdd {
|
||||||
font-family: DINAlternate-Bold, DINAlternate;
|
font-family: DINAlternate-Bold, DINAlternate;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 32rpx;
|
font-size: 28rpx;
|
||||||
color: #e83944;
|
color: #e83944;
|
||||||
line-height: 44rpx;
|
line-height: 44rpx;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
@ -925,7 +1110,7 @@ export default {
|
|||||||
.swiperItemContentUnit {
|
.swiperItemContentUnit {
|
||||||
font-family: 'PingFangSC';
|
font-family: 'PingFangSC';
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 28rpx;
|
font-size: 24rpx;
|
||||||
color: #A69E9F;
|
color: #A69E9F;
|
||||||
line-height: 40rpx;
|
line-height: 40rpx;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
@ -958,7 +1143,7 @@ export default {
|
|||||||
.addValue {
|
.addValue {
|
||||||
font-family: 'DINAlternate';
|
font-family: 'DINAlternate';
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 30rpx;
|
font-size: 28rpx;
|
||||||
line-height: 40rpx;
|
line-height: 40rpx;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
@ -1006,7 +1191,7 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 24rpx;
|
padding: 24rpx 24rpx;
|
||||||
background: linear-gradient(180deg, #F0E4ED 0%, #F0E8F1 18%, #FFFFFF 100%);
|
background: linear-gradient(180deg, #F0E4ED 0%, #F0E8F1 18%, #FFFFFF 100%);
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -1038,7 +1223,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.day {
|
.day {
|
||||||
font-size: 28rpx;
|
font-size: 24rpx;
|
||||||
font-family: PingFangSC, PingFang SC;
|
font-family: PingFangSC, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #a69e9f;
|
color: #a69e9f;
|
||||||
@ -1060,7 +1245,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.revenueMoney {
|
.revenueMoney {
|
||||||
height: 52rpx;
|
height: 70rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@ -1068,19 +1253,21 @@ export default {
|
|||||||
|
|
||||||
.moneyText {
|
.moneyText {
|
||||||
font-size: 44rpx;
|
font-size: 44rpx;
|
||||||
font-family: DINAlternate, DINAlternate;
|
font-family: DINAlternate-Bold, DINAlternate;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #160002;
|
color: #160002;
|
||||||
line-height: 52rpx;
|
|
||||||
margin-right: 8rpx;
|
margin-right: 8rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.moneyLabel {
|
.moneyLabel {
|
||||||
font-size: 28rpx;
|
height: 100%;
|
||||||
font-family: PingFangSC, PingFang SC;
|
font-size: 24rpx;
|
||||||
|
font-family: DINAlternate-Bold, DINAlternate;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #a69e9f;
|
color: #a69e9f;
|
||||||
line-height: 40rpx;
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 12rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1117,30 +1304,41 @@ export default {
|
|||||||
width: calc(100% - 86rpx);
|
width: calc(100% - 86rpx);
|
||||||
|
|
||||||
.moneyLabel {
|
.moneyLabel {
|
||||||
font-size: 30rpx;
|
font-size: 28rpx;
|
||||||
font-family: PingFangSC, PingFang SC;
|
font-family: PingFangSC, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #a69e9f;
|
color: #000;
|
||||||
line-height: 30rpx;
|
line-height: 30rpx;
|
||||||
margin-bottom: 16rpx;
|
// margin-bottom: 16rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.moneyText {
|
.moneyText {
|
||||||
font-size: 32rpx;
|
width: 100%;
|
||||||
font-family: 'DINAlternate';
|
margin-top: 12rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.money {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-family: DINAlternate-Bold, DINAlternate;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #160002;
|
color: #160002;
|
||||||
line-height: 32rpx;
|
line-height: 32rpx;
|
||||||
margin-right: 8rpx;
|
text-align: left;
|
||||||
|
display: inline-block;
|
||||||
|
width: 110rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.moneyUnit {
|
.moneyUnit {
|
||||||
|
width: 70rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
font-family: PingFangSC, PingFang SC;
|
font-family: PingFangSC, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #a69e9f;
|
color: #a69e9f;
|
||||||
line-height: 30rpx;
|
line-height: 30rpx;
|
||||||
margin-left: 16rpx;
|
margin-left: 8rpx;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1195,7 +1393,7 @@ export default {
|
|||||||
font-family: PingFangSC, PingFang SC;
|
font-family: PingFangSC, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #160002;
|
color: #160002;
|
||||||
line-height: 40rpx;
|
line-height: 30rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -328,8 +328,11 @@ export default {
|
|||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
delta: 1
|
delta: 1
|
||||||
})
|
})
|
||||||
}
|
} else if (this.type === 'attendanceStatus') {
|
||||||
else {
|
uni.navigateBack({
|
||||||
|
delta: 1
|
||||||
|
})
|
||||||
|
} else {
|
||||||
if (this.chartType) {
|
if (this.chartType) {
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
delta: 1
|
delta: 1
|
||||||
|
|||||||
@ -159,7 +159,7 @@
|
|||||||
</p>
|
</p>
|
||||||
<p :class="item.TOILETCOUNT ? 'text' : 'unText'">潮汐厕位<text style="margin-left: 4px">{{
|
<p :class="item.TOILETCOUNT ? 'text' : 'unText'">潮汐厕位<text style="margin-left: 4px">{{
|
||||||
item.TOILETCOUNT ? '('
|
item.TOILETCOUNT ? '('
|
||||||
+ item.TOILETCOUNT + ')':'' }}</text></p>
|
+ item.TOILETCOUNT + ')' : '' }}</text></p>
|
||||||
<p :class="item.HASSHOWERROOM ? 'text' : 'unText'">车辆加水</p>
|
<p :class="item.HASSHOWERROOM ? 'text' : 'unText'">车辆加水</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -181,10 +181,10 @@
|
|||||||
<div class="item">
|
<div class="item">
|
||||||
<p :class="item.PACKING ? 'text' : 'unText'">客车车位<text style="margin-left: 4px">{{ item.PACKING ? '('
|
<p :class="item.PACKING ? 'text' : 'unText'">客车车位<text style="margin-left: 4px">{{ item.PACKING ? '('
|
||||||
+
|
+
|
||||||
item.PACKING + ')':'' }}</text></p>
|
item.PACKING + ')' : '' }}</text></p>
|
||||||
<p :class="item.DANPACKING ? 'text' : 'unText'">危化品车位<text style="margin-left: 4px">{{ item.DANPACKING
|
<p :class="item.DANPACKING ? 'text' : 'unText'">危化品车位<text style="margin-left: 4px">{{ item.DANPACKING
|
||||||
? '('
|
? '('
|
||||||
+ item.DANPACKING +')':'' }}</text></p>
|
+ item.DANPACKING + ')' : '' }}</text></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -243,6 +243,7 @@ export default {
|
|||||||
currentImg: 0,//当前选中的图片
|
currentImg: 0,//当前选中的图片
|
||||||
come: '',// 来自首页还是用户页,
|
come: '',// 来自首页还是用户页,
|
||||||
topBgRealLength: 0,// 去除添加的上一个 后一个 的真实图片长度
|
topBgRealLength: 0,// 去除添加的上一个 后一个 的真实图片长度
|
||||||
|
seatInfo: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@ -338,10 +339,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async handleSearch(seat) {
|
async handleSearch(seat) {
|
||||||
|
let currentService = uni.getStorageSync("currentService");
|
||||||
|
let seatInfo = uni.getStorageSync("seatInfo");
|
||||||
|
this.seatInfo = JSON.parse(seatInfo);
|
||||||
|
|
||||||
let reqs = {
|
let reqs = {
|
||||||
longitude: seat.longitude,
|
longitude: this.seatInfo.longitude,
|
||||||
ServerpartId: seat.Serverpart_ID,
|
ServerpartId: currentService.Serverpart_ID || currentService.SERVERPART_ID,
|
||||||
latitude: seat.latitude
|
latitude: this.seatInfo.latitude,
|
||||||
}
|
}
|
||||||
const totalData = await request.$webGet('CommercialApi/BaseInfo/GetServerpartInfo', reqs)
|
const totalData = await request.$webGet('CommercialApi/BaseInfo/GetServerpartInfo', reqs)
|
||||||
console.log('totalData', totalData)
|
console.log('totalData', totalData)
|
||||||
|
|||||||
@ -60,6 +60,10 @@ export default {
|
|||||||
lastDay: {
|
lastDay: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ""
|
default: ""
|
||||||
|
},
|
||||||
|
isReturn: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -73,6 +77,20 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 第一行的跳转
|
// 第一行的跳转
|
||||||
handleGoFirst(item) {
|
handleGoFirst(item) {
|
||||||
|
if (this.isReturn) {
|
||||||
|
let _this = this
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提示',
|
||||||
|
content: '请您授权登录后再操作。',
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
_this.$util.toNextRoute('redirectTo', '/pages/register/register')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (item.isNotice) {
|
if (item.isNotice) {
|
||||||
this.$util.toNextRoute('navigateTo', item.homeUrl)
|
this.$util.toNextRoute('navigateTo', item.homeUrl)
|
||||||
} else {
|
} else {
|
||||||
@ -81,6 +99,20 @@ export default {
|
|||||||
},
|
},
|
||||||
// 第二行的跳转
|
// 第二行的跳转
|
||||||
handleGoSecond(item) {
|
handleGoSecond(item) {
|
||||||
|
if (this.isReturn) {
|
||||||
|
let _this = this
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提示',
|
||||||
|
content: '请您授权登录后再操作。',
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
_this.$util.toNextRoute('redirectTo', '/pages/register/register')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
let version = uni.getStorageSync('version')
|
let version = uni.getStorageSync('version')
|
||||||
if (version === 1) {
|
if (version === 1) {
|
||||||
this.$util.toNextRoute('navigateTo', '/pages/summaryOfPortraits/index?index=' + item.type)
|
this.$util.toNextRoute('navigateTo', '/pages/summaryOfPortraits/index?index=' + item.type)
|
||||||
@ -90,6 +122,20 @@ export default {
|
|||||||
},
|
},
|
||||||
// 第四行的跳转
|
// 第四行的跳转
|
||||||
handleGoFourth(item) {
|
handleGoFourth(item) {
|
||||||
|
if (this.isReturn) {
|
||||||
|
let _this = this
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提示',
|
||||||
|
content: '请您授权登录后再操作。',
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
_this.$util.toNextRoute('redirectTo', '/pages/register/register')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
let version = uni.getStorageSync('version')
|
let version = uni.getStorageSync('version')
|
||||||
if (version === 1) {
|
if (version === 1) {
|
||||||
if (item.summaryOfPortraits) {
|
if (item.summaryOfPortraits) {
|
||||||
@ -104,6 +150,20 @@ export default {
|
|||||||
|
|
||||||
// 根据数组信息判断是否能跳转
|
// 根据数组信息判断是否能跳转
|
||||||
handleGo(item) {
|
handleGo(item) {
|
||||||
|
if (this.isReturn) {
|
||||||
|
let _this = this
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提示',
|
||||||
|
content: '请您授权登录后再操作。',
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
_this.$util.toNextRoute('redirectTo', '/pages/register/register')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (item.value === 2) {
|
if (item.value === 2) {
|
||||||
if (item.value === 2) {
|
if (item.value === 2) {
|
||||||
let currentService = uni.getStorageSync('currentService')
|
let currentService = uni.getStorageSync('currentService')
|
||||||
|
|||||||
@ -26,12 +26,12 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="message">
|
<view class="message">
|
||||||
<view class="people">
|
<view class="people">
|
||||||
<p class="name">{{ user.Membership_Name }}</p>
|
<p class="name">{{ user.Membership_Name || user.WeChat_UserName }}</p>
|
||||||
<!-- <view class="person"> <view class="personName">{{user.DepartmentName}}</view> </view>-->
|
<!-- <view class="person"> <view class="personName">{{user.DepartmentName}}</view> </view>-->
|
||||||
<view class="person" v-if="user.DepartmentName">{{ user.DepartmentName }}</view>
|
<view class="person" v-if="user.DepartmentName">{{ user.DepartmentName }}</view>
|
||||||
</view>
|
</view>
|
||||||
<p class="phone">{{ handleGetPhone(user.Membership_Phone) }}</p>
|
<p class="phone">{{ handleGetPhone(user.Membership_Phone) }}</p>
|
||||||
<p class="address">{{ user.OwnerUnitName }}</p>
|
<p class="address">{{ user.OwnerUnitName || "" }}</p>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-else>
|
<view v-else>
|
||||||
@ -47,7 +47,8 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="menu" :style="{ top: -(117 - menu.bottom) + 'px' }">
|
<view class="menu" :style="{ top: -(117 - menu.bottom) + 'px' }">
|
||||||
<userList v-for="(item, index) in dataList" :key="index" :item="item" :lastDay="lastDay"></userList>
|
<userList v-for="(item, index) in dataList" :key="index" :item="item" :lastDay="lastDay" :isReturn="isReturn">
|
||||||
|
</userList>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<Tabbar ref="tabbar" :page="page"></Tabbar>
|
<Tabbar ref="tabbar" :page="page"></Tabbar>
|
||||||
@ -187,6 +188,7 @@ export default {
|
|||||||
],
|
],
|
||||||
isTrue: false, //最外面一层判断是否能跳转的依据
|
isTrue: false, //最外面一层判断是否能跳转的依据
|
||||||
special: false,
|
special: false,
|
||||||
|
isReturn: true,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@ -261,6 +263,18 @@ export default {
|
|||||||
});
|
});
|
||||||
//通过权限来判断是否可以点击跳转
|
//通过权限来判断是否可以点击跳转
|
||||||
let userInfo = uni.getStorageSync("vuex");
|
let userInfo = uni.getStorageSync("vuex");
|
||||||
|
|
||||||
|
if (
|
||||||
|
userInfo.userData &&
|
||||||
|
userInfo.userData.WeChat_UserId &&
|
||||||
|
userInfo.userData.AuthorityInfo[
|
||||||
|
"89a1f248-2113-4d57-84b1-c2e6edb9e8ee"
|
||||||
|
] === 1
|
||||||
|
) {
|
||||||
|
this.isReturn = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
userInfo.userData.AuthorityInfo[
|
userInfo.userData.AuthorityInfo[
|
||||||
"89a1f248-2113-4d57-84b1-c2e6edb9e8ee"
|
"89a1f248-2113-4d57-84b1-c2e6edb9e8ee"
|
||||||
@ -337,14 +351,14 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 250px;
|
height: 250px;
|
||||||
// background: linear-gradient(315deg, #ff8d95 0%, #ffdca8 100%);
|
// background: linear-gradient(315deg, #ff8d95 0%, #ffdca8 100%);
|
||||||
background-image: url("https://saas.eshangtech.com/minTestImg/pageBg.png");
|
background-image: url("https://eshangtech.com/minTestImg/pageBg.png");
|
||||||
background-size: 100vw 100vh;
|
background-size: 100vw 100vh;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.headerTop {
|
.headerTop {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-image: url("https://saas.eshangtech.com/minTestImg/pageBg.png");
|
background-image: url("https://eshangtech.com/minTestImg/pageBg.png");
|
||||||
background-size: 100vw 100vh;
|
background-size: 100vw 100vh;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"appid": "wxa99ef047735c031e",
|
"appid": "wx6e28691bea93c6ec",
|
||||||
"compileType": "miniprogram",
|
"compileType": "miniprogram",
|
||||||
"libVersion": "2.25.3",
|
"libVersion": "2.25.3",
|
||||||
"packOptions": {
|
"packOptions": {
|
||||||
|
|||||||
BIN
static/images/home/address.png
Normal file
BIN
static/images/home/address.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 963 B |
22
static/images/home/navigationIcon.svg
Normal file
22
static/images/home/navigationIcon.svg
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>云南图标/卫生间_2</title>
|
||||||
|
<defs>
|
||||||
|
<linearGradient x1="50%" y1="100%" x2="50%" y2="1.84889275e-30%" id="linearGradient-1">
|
||||||
|
<stop stop-color="#27B25F" offset="0%"></stop>
|
||||||
|
<stop stop-color="#11BC55" offset="100%"></stop>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient x1="50%" y1="100%" x2="50%" y2="1.84889275e-30%" id="linearGradient-2">
|
||||||
|
<stop stop-color="#27B25F" offset="0%"></stop>
|
||||||
|
<stop stop-color="#4CCC7F" offset="100%"></stop>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<g id="云南小程序-切图" transform="translate(-87.000000, -37.000000)" fill-rule="nonzero">
|
||||||
|
<g id="编组" transform="translate(87.000000, 37.000000)">
|
||||||
|
<circle id="椭圆形" fill="url(#linearGradient-1)" opacity="0.100000001" cx="16" cy="16" r="16"></circle>
|
||||||
|
<path d="M21.4637385,11.8011725 L18.2390216,21.4753234 C18.0643738,21.9992667 17.4980539,22.2824267 16.9741105,22.1077789 C16.7301391,22.0264551 16.5268764,21.8542657 16.4065504,21.6269833 L14.4619849,17.9539153 C14.368178,17.7767245 14.2232755,17.631822 14.0460847,17.5380151 L10.3730167,15.5934496 C9.88491409,15.3350424 9.69870923,14.7298766 9.95711648,14.241774 C10.0774425,14.0144916 10.2807052,13.8423022 10.5246766,13.7609784 L20.1988275,10.5362615 C20.7227708,10.3616137 21.2890908,10.6447737 21.4637385,11.168717 C21.5321608,11.3739838 21.5321608,11.5959057 21.4637385,11.8011725 Z" id="三角形" fill="url(#linearGradient-2)"></path>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.8 KiB |
@ -62,6 +62,8 @@ const actions = {
|
|||||||
getLoginCode({ dispatch, state }) {
|
getLoginCode({ dispatch, state }) {
|
||||||
uni.login({ // 登录
|
uni.login({ // 登录
|
||||||
success(res) {
|
success(res) {
|
||||||
|
console.log('resresresresres', res);
|
||||||
|
|
||||||
dispatch('memberLogin', res.code) // 获取用户数据
|
dispatch('memberLogin', res.code) // 获取用户数据
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -75,17 +77,18 @@ const actions = {
|
|||||||
commit('setUserTodoList', res.Data)
|
commit('setUserTodoList', res.Data)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
memberLogin({ dispatch, state, commit }, _code) {
|
async memberLogin({ dispatch, state, commit }, _code) {
|
||||||
let _user = state.userData
|
|
||||||
request.$get('WeChat_Login', {
|
const data = await request.$get('WeChat_Login', {
|
||||||
// request.$webGet('WebAPI_Push/WeChat/Login',{
|
// request.$webGet('WebAPI_Push/WeChat/Login',{
|
||||||
WeChat_Code: _code || '',
|
WeChat_Code: _code || '',
|
||||||
|
})
|
||||||
}).then(data => {
|
|
||||||
if (data.Result_Code === 100) {
|
if (data.Result_Code === 100) {
|
||||||
let user = data.Result_Data
|
let user = data.Result_Data
|
||||||
if (user.Membership_Id) {
|
if (user.Membership_Id) {
|
||||||
dispatch('updateUser', data.Result_Data)
|
const enrichedUser = await dispatch('updateUser', data.Result_Data)
|
||||||
|
commit('setUser', enrichedUser)
|
||||||
|
return enrichedUser
|
||||||
// _this.addUserBehavior(1002) // 记录用户行为
|
// _this.addUserBehavior(1002) // 记录用户行为
|
||||||
} else {
|
} else {
|
||||||
commit('setUser', user)
|
commit('setUser', user)
|
||||||
@ -94,9 +97,7 @@ const actions = {
|
|||||||
content: '请您授权登录后再操作。',
|
content: '请您授权登录后再操作。',
|
||||||
success(res) {
|
success(res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
|
|
||||||
util.toNextRoute('redirectTo', '/pages/register/register')
|
util.toNextRoute('redirectTo', '/pages/register/register')
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -106,9 +107,6 @@ const actions = {
|
|||||||
} else {
|
} else {
|
||||||
console.log(data)
|
console.log(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
async updateUser({ dispatch, commit, state }, user) {
|
async updateUser({ dispatch, commit, state }, user) {
|
||||||
let _user = user || state.userData
|
let _user = user || state.userData
|
||||||
@ -116,11 +114,12 @@ const actions = {
|
|||||||
|
|
||||||
if (!_id) return
|
if (!_id) return
|
||||||
// console.log(_user)
|
// console.log(_user)
|
||||||
await request.$get('WeChat_GetBusinessMemberInfo', { Membership_Id: _id }).then(async res => {
|
|
||||||
// request.$webGet('WebAPI_Push/Member/GetMemberInfo',{Membership_Id:_id,memberShipId:_id}).then(res=>{
|
let res = await request.$get('WeChat_GetBusinessMemberInfo', { Membership_Id: _id })
|
||||||
if (res.Result_Code == 100) {
|
if (res.Result_Code == 100) {
|
||||||
let data = res.Result_Data
|
let data = res.Result_Data
|
||||||
console.log('datadatadatadatadata', data);
|
console.log('WeChat_GetBusinessMemberInfoWeChat_GetBusinessMemberInfo', data);
|
||||||
|
commit('setUser', data)
|
||||||
|
|
||||||
data.WeChat_MiniProToken = _user.WeChat_MiniProToken
|
data.WeChat_MiniProToken = _user.WeChat_MiniProToken
|
||||||
data.WeChat_UserId = _user.WeChat_UserId
|
data.WeChat_UserId = _user.WeChat_UserId
|
||||||
@ -139,13 +138,13 @@ const actions = {
|
|||||||
const serverPart = await request.$webGet('/EShangApiMain/BaseInfo/GetServerpartDDL', { ServerpartCodes: str })
|
const serverPart = await request.$webGet('/EShangApiMain/BaseInfo/GetServerpartDDL', { ServerpartCodes: str })
|
||||||
data.serverPartList = serverPart.Result_Data.List
|
data.serverPartList = serverPart.Result_Data.List
|
||||||
commit('setUser', data)
|
commit('setUser', data)
|
||||||
dispatch('getTodoList')
|
// dispatch('getTodoList')
|
||||||
|
return data
|
||||||
} else {
|
} else {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: `/pages/commercialBI/noData?type=noAuthor`
|
url: `/pages/commercialBI/noData?type=noAuthor`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default new Vuex.Store({
|
export default new Vuex.Store({
|
||||||
|
|||||||
30
uni_modules/uni-calendar/changelog.md
Normal file
30
uni_modules/uni-calendar/changelog.md
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
## 1.4.12(2024-09-21)
|
||||||
|
- 修复 calendar在选择日期范围后重新选择日期需要点两次的Bug
|
||||||
|
## 1.4.11(2024-01-10)
|
||||||
|
- 修复 回到今天时,月份显示不一致问题
|
||||||
|
## 1.4.10(2023-04-10)
|
||||||
|
- 修复 某些情况 monthSwitch 未触发的Bug
|
||||||
|
## 1.4.9(2023-02-02)
|
||||||
|
- 修复 某些情况切换月份错误的Bug
|
||||||
|
## 1.4.8(2023-01-30)
|
||||||
|
- 修复 某些情况切换月份错误的Bug [详情](https://ask.dcloud.net.cn/question/161964)
|
||||||
|
## 1.4.7(2022-09-16)
|
||||||
|
- 优化 支持使用 uni-scss 控制主题色
|
||||||
|
## 1.4.6(2022-09-08)
|
||||||
|
- 修复 表头年月切换,导致改变当前日期为选择月1号,且未触发change事件的Bug
|
||||||
|
## 1.4.5(2022-02-25)
|
||||||
|
- 修复 条件编译 nvue 不支持的 css 样式的Bug
|
||||||
|
## 1.4.4(2022-02-25)
|
||||||
|
- 修复 条件编译 nvue 不支持的 css 样式的Bug
|
||||||
|
## 1.4.3(2021-09-22)
|
||||||
|
- 修复 startDate、 endDate 属性失效的Bug
|
||||||
|
## 1.4.2(2021-08-24)
|
||||||
|
- 新增 支持国际化
|
||||||
|
## 1.4.1(2021-08-05)
|
||||||
|
- 修复 弹出层被 tabbar 遮盖的Bug
|
||||||
|
## 1.4.0(2021-07-30)
|
||||||
|
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
|
||||||
|
## 1.3.16(2021-05-12)
|
||||||
|
- 新增 组件示例地址
|
||||||
|
## 1.3.15(2021-02-04)
|
||||||
|
- 调整为uni_modules目录规范
|
||||||
544
uni_modules/uni-calendar/components/uni-calendar/calendar.js
Normal file
544
uni_modules/uni-calendar/components/uni-calendar/calendar.js
Normal file
@ -0,0 +1,544 @@
|
|||||||
|
/**
|
||||||
|
* @1900-2100区间内的公历、农历互转
|
||||||
|
* @charset UTF-8
|
||||||
|
* @github https://github.com/jjonline/calendar.js
|
||||||
|
* @Author Jea杨(JJonline@JJonline.Cn)
|
||||||
|
* @Time 2014-7-21
|
||||||
|
* @Time 2016-8-13 Fixed 2033hex、Attribution Annals
|
||||||
|
* @Time 2016-9-25 Fixed lunar LeapMonth Param Bug
|
||||||
|
* @Time 2017-7-24 Fixed use getTerm Func Param Error.use solar year,NOT lunar year
|
||||||
|
* @Version 1.0.3
|
||||||
|
* @公历转农历:calendar.solar2lunar(1987,11,01); //[you can ignore params of prefix 0]
|
||||||
|
* @农历转公历:calendar.lunar2solar(1987,09,10); //[you can ignore params of prefix 0]
|
||||||
|
*/
|
||||||
|
/* eslint-disable */
|
||||||
|
var calendar = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 农历1900-2100的润大小信息表
|
||||||
|
* @Array Of Property
|
||||||
|
* @return Hex
|
||||||
|
*/
|
||||||
|
lunarInfo: [0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2, // 1900-1909
|
||||||
|
0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977, // 1910-1919
|
||||||
|
0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970, // 1920-1929
|
||||||
|
0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, // 1930-1939
|
||||||
|
0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, // 1940-1949
|
||||||
|
0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5b0, 0x14573, 0x052b0, 0x0a9a8, 0x0e950, 0x06aa0, // 1950-1959
|
||||||
|
0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0, // 1960-1969
|
||||||
|
0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b6a0, 0x195a6, // 1970-1979
|
||||||
|
0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, // 1980-1989
|
||||||
|
0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x05ac0, 0x0ab60, 0x096d5, 0x092e0, // 1990-1999
|
||||||
|
0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5, // 2000-2009
|
||||||
|
0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930, // 2010-2019
|
||||||
|
0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, // 2020-2029
|
||||||
|
0x05aa0, 0x076a3, 0x096d0, 0x04afb, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, // 2030-2039
|
||||||
|
0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0, // 2040-2049
|
||||||
|
/** Add By JJonline@JJonline.Cn**/
|
||||||
|
0x14b63, 0x09370, 0x049f8, 0x04970, 0x064b0, 0x168a6, 0x0ea50, 0x06b20, 0x1a6c4, 0x0aae0, // 2050-2059
|
||||||
|
0x0a2e0, 0x0d2e3, 0x0c960, 0x0d557, 0x0d4a0, 0x0da50, 0x05d55, 0x056a0, 0x0a6d0, 0x055d4, // 2060-2069
|
||||||
|
0x052d0, 0x0a9b8, 0x0a950, 0x0b4a0, 0x0b6a6, 0x0ad50, 0x055a0, 0x0aba4, 0x0a5b0, 0x052b0, // 2070-2079
|
||||||
|
0x0b273, 0x06930, 0x07337, 0x06aa0, 0x0ad50, 0x14b55, 0x04b60, 0x0a570, 0x054e4, 0x0d160, // 2080-2089
|
||||||
|
0x0e968, 0x0d520, 0x0daa0, 0x16aa6, 0x056d0, 0x04ae0, 0x0a9d4, 0x0a2d0, 0x0d150, 0x0f252, // 2090-2099
|
||||||
|
0x0d520], // 2100
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公历每个月份的天数普通表
|
||||||
|
* @Array Of Property
|
||||||
|
* @return Number
|
||||||
|
*/
|
||||||
|
solarMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 天干地支之天干速查表
|
||||||
|
* @Array Of Property trans["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"]
|
||||||
|
* @return Cn string
|
||||||
|
*/
|
||||||
|
Gan: ['\u7532', '\u4e59', '\u4e19', '\u4e01', '\u620a', '\u5df1', '\u5e9a', '\u8f9b', '\u58ec', '\u7678'],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 天干地支之地支速查表
|
||||||
|
* @Array Of Property
|
||||||
|
* @trans["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"]
|
||||||
|
* @return Cn string
|
||||||
|
*/
|
||||||
|
Zhi: ['\u5b50', '\u4e11', '\u5bc5', '\u536f', '\u8fb0', '\u5df3', '\u5348', '\u672a', '\u7533', '\u9149', '\u620c', '\u4ea5'],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 天干地支之地支速查表<=>生肖
|
||||||
|
* @Array Of Property
|
||||||
|
* @trans["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"]
|
||||||
|
* @return Cn string
|
||||||
|
*/
|
||||||
|
Animals: ['\u9f20', '\u725b', '\u864e', '\u5154', '\u9f99', '\u86c7', '\u9a6c', '\u7f8a', '\u7334', '\u9e21', '\u72d7', '\u732a'],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 24节气速查表
|
||||||
|
* @Array Of Property
|
||||||
|
* @trans["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"]
|
||||||
|
* @return Cn string
|
||||||
|
*/
|
||||||
|
solarTerm: ['\u5c0f\u5bd2', '\u5927\u5bd2', '\u7acb\u6625', '\u96e8\u6c34', '\u60ca\u86f0', '\u6625\u5206', '\u6e05\u660e', '\u8c37\u96e8', '\u7acb\u590f', '\u5c0f\u6ee1', '\u8292\u79cd', '\u590f\u81f3', '\u5c0f\u6691', '\u5927\u6691', '\u7acb\u79cb', '\u5904\u6691', '\u767d\u9732', '\u79cb\u5206', '\u5bd2\u9732', '\u971c\u964d', '\u7acb\u51ac', '\u5c0f\u96ea', '\u5927\u96ea', '\u51ac\u81f3'],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1900-2100各年的24节气日期速查表
|
||||||
|
* @Array Of Property
|
||||||
|
* @return 0x string For splice
|
||||||
|
*/
|
||||||
|
sTermInfo: ['9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f',
|
||||||
|
'97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
|
||||||
|
'97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa',
|
||||||
|
'97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f',
|
||||||
|
'b027097bd097c36b0b6fc9274c91aa', '9778397bd19801ec9210c965cc920e', '97b6b97bd19801ec95f8c965cc920f',
|
||||||
|
'97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2', '9778397bd197c36c9210c9274c91aa',
|
||||||
|
'97b6b97bd19801ec95f8c965cc920e', '97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2',
|
||||||
|
'9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec95f8c965cc920e', '97bcf97c3598082c95f8e1cfcc920f',
|
||||||
|
'97bd097bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e',
|
||||||
|
'97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
|
||||||
|
'97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722',
|
||||||
|
'9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f',
|
||||||
|
'97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
|
||||||
|
'97bcf97c359801ec95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
|
||||||
|
'97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd097bd07f595b0b6fc920fb0722',
|
||||||
|
'9778397bd097c36b0b6fc9210c8dc2', '9778397bd19801ec9210c9274c920e', '97b6b97bd19801ec95f8c965cc920f',
|
||||||
|
'97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e',
|
||||||
|
'97b6b97bd19801ec95f8c965cc920f', '97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2',
|
||||||
|
'9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bd07f1487f595b0b0bc920fb0722',
|
||||||
|
'7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
|
||||||
|
'97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
|
||||||
|
'97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
|
||||||
|
'9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f531b0b0bb0b6fb0722',
|
||||||
|
'7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
|
||||||
|
'97bcf7f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
|
||||||
|
'97b6b97bd19801ec9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
|
||||||
|
'9778397bd097c36b0b6fc9210c91aa', '97b6b97bd197c36c9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722',
|
||||||
|
'7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e',
|
||||||
|
'97b6b7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2',
|
||||||
|
'9778397bd097c36b0b70c9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722',
|
||||||
|
'7f0e397bd097c35b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721',
|
||||||
|
'7f0e27f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
|
||||||
|
'97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
|
||||||
|
'9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
|
||||||
|
'7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721',
|
||||||
|
'7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
|
||||||
|
'97b6b7f0e47f531b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
|
||||||
|
'9778397bd097c36b0b6fc9210c91aa', '97b6b7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
|
||||||
|
'7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '977837f0e37f149b0723b0787b0721',
|
||||||
|
'7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c35b0b6fc9210c8dc2',
|
||||||
|
'977837f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722',
|
||||||
|
'7f0e397bd097c35b0b6fc9210c8dc2', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
|
||||||
|
'7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '977837f0e37f14998082b0787b06bd',
|
||||||
|
'7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
|
||||||
|
'977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
|
||||||
|
'7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
|
||||||
|
'7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd',
|
||||||
|
'7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
|
||||||
|
'977837f0e37f14998082b0723b06bd', '7f07e7f0e37f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
|
||||||
|
'7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b0721',
|
||||||
|
'7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f595b0b0bb0b6fb0722', '7f0e37f0e37f14898082b0723b02d5',
|
||||||
|
'7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f531b0b0bb0b6fb0722',
|
||||||
|
'7f0e37f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
|
||||||
|
'7f0e37f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd',
|
||||||
|
'7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35',
|
||||||
|
'7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
|
||||||
|
'7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f149b0723b0787b0721',
|
||||||
|
'7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0723b06bd',
|
||||||
|
'7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', '7f0e37f0e366aa89801eb072297c35',
|
||||||
|
'7ec967f0e37f14998082b0723b06bd', '7f07e7f0e37f14998083b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
|
||||||
|
'7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14898082b0723b02d5', '7f07e7f0e37f14998082b0787b0721',
|
||||||
|
'7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66aa89801e9808297c35', '665f67f0e37f14898082b0723b02d5',
|
||||||
|
'7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66a449801e9808297c35',
|
||||||
|
'665f67f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
|
||||||
|
'7f0e36665b66a449801e9808297c35', '665f67f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd',
|
||||||
|
'7f07e7f0e47f531b0723b0b6fb0721', '7f0e26665b66a449801e9808297c35', '665f67f0e37f1489801eb072297c35',
|
||||||
|
'7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722'],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数字转中文速查表
|
||||||
|
* @Array Of Property
|
||||||
|
* @trans ['日','一','二','三','四','五','六','七','八','九','十']
|
||||||
|
* @return Cn string
|
||||||
|
*/
|
||||||
|
nStr1: ['\u65e5', '\u4e00', '\u4e8c', '\u4e09', '\u56db', '\u4e94', '\u516d', '\u4e03', '\u516b', '\u4e5d', '\u5341'],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期转农历称呼速查表
|
||||||
|
* @Array Of Property
|
||||||
|
* @trans ['初','十','廿','卅']
|
||||||
|
* @return Cn string
|
||||||
|
*/
|
||||||
|
nStr2: ['\u521d', '\u5341', '\u5eff', '\u5345'],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 月份转农历称呼速查表
|
||||||
|
* @Array Of Property
|
||||||
|
* @trans ['正','一','二','三','四','五','六','七','八','九','十','冬','腊']
|
||||||
|
* @return Cn string
|
||||||
|
*/
|
||||||
|
nStr3: ['\u6b63', '\u4e8c', '\u4e09', '\u56db', '\u4e94', '\u516d', '\u4e03', '\u516b', '\u4e5d', '\u5341', '\u51ac', '\u814a'],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回农历y年一整年的总天数
|
||||||
|
* @param lunar Year
|
||||||
|
* @return Number
|
||||||
|
* @eg:var count = calendar.lYearDays(1987) ;//count=387
|
||||||
|
*/
|
||||||
|
lYearDays: function (y) {
|
||||||
|
var i; var sum = 348
|
||||||
|
for (i = 0x8000; i > 0x8; i >>= 1) { sum += (this.lunarInfo[y - 1900] & i) ? 1 : 0 }
|
||||||
|
return (sum + this.leapDays(y))
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回农历y年闰月是哪个月;若y年没有闰月 则返回0
|
||||||
|
* @param lunar Year
|
||||||
|
* @return Number (0-12)
|
||||||
|
* @eg:var leapMonth = calendar.leapMonth(1987) ;//leapMonth=6
|
||||||
|
*/
|
||||||
|
leapMonth: function (y) { // 闰字编码 \u95f0
|
||||||
|
return (this.lunarInfo[y - 1900] & 0xf)
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回农历y年闰月的天数 若该年没有闰月则返回0
|
||||||
|
* @param lunar Year
|
||||||
|
* @return Number (0、29、30)
|
||||||
|
* @eg:var leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29
|
||||||
|
*/
|
||||||
|
leapDays: function (y) {
|
||||||
|
if (this.leapMonth(y)) {
|
||||||
|
return ((this.lunarInfo[y - 1900] & 0x10000) ? 30 : 29)
|
||||||
|
}
|
||||||
|
return (0)
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回农历y年m月(非闰月)的总天数,计算m为闰月时的天数请使用leapDays方法
|
||||||
|
* @param lunar Year
|
||||||
|
* @return Number (-1、29、30)
|
||||||
|
* @eg:var MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29
|
||||||
|
*/
|
||||||
|
monthDays: function (y, m) {
|
||||||
|
if (m > 12 || m < 1) { return -1 }// 月份参数从1至12,参数错误返回-1
|
||||||
|
return ((this.lunarInfo[y - 1900] & (0x10000 >> m)) ? 30 : 29)
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回公历(!)y年m月的天数
|
||||||
|
* @param solar Year
|
||||||
|
* @return Number (-1、28、29、30、31)
|
||||||
|
* @eg:var solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30
|
||||||
|
*/
|
||||||
|
solarDays: function (y, m) {
|
||||||
|
if (m > 12 || m < 1) { return -1 } // 若参数错误 返回-1
|
||||||
|
var ms = m - 1
|
||||||
|
if (ms == 1) { // 2月份的闰平规律测算后确认返回28或29
|
||||||
|
return (((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0)) ? 29 : 28)
|
||||||
|
} else {
|
||||||
|
return (this.solarMonth[ms])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 农历年份转换为干支纪年
|
||||||
|
* @param lYear 农历年的年份数
|
||||||
|
* @return Cn string
|
||||||
|
*/
|
||||||
|
toGanZhiYear: function (lYear) {
|
||||||
|
var ganKey = (lYear - 3) % 10
|
||||||
|
var zhiKey = (lYear - 3) % 12
|
||||||
|
if (ganKey == 0) ganKey = 10// 如果余数为0则为最后一个天干
|
||||||
|
if (zhiKey == 0) zhiKey = 12// 如果余数为0则为最后一个地支
|
||||||
|
return this.Gan[ganKey - 1] + this.Zhi[zhiKey - 1]
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公历月、日判断所属星座
|
||||||
|
* @param cMonth [description]
|
||||||
|
* @param cDay [description]
|
||||||
|
* @return Cn string
|
||||||
|
*/
|
||||||
|
toAstro: function (cMonth, cDay) {
|
||||||
|
var s = '\u9b54\u7faf\u6c34\u74f6\u53cc\u9c7c\u767d\u7f8a\u91d1\u725b\u53cc\u5b50\u5de8\u87f9\u72ee\u5b50\u5904\u5973\u5929\u79e4\u5929\u874e\u5c04\u624b\u9b54\u7faf'
|
||||||
|
var arr = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22]
|
||||||
|
return s.substr(cMonth * 2 - (cDay < arr[cMonth - 1] ? 2 : 0), 2) + '\u5ea7'// 座
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 传入offset偏移量返回干支
|
||||||
|
* @param offset 相对甲子的偏移量
|
||||||
|
* @return Cn string
|
||||||
|
*/
|
||||||
|
toGanZhi: function (offset) {
|
||||||
|
return this.Gan[offset % 10] + this.Zhi[offset % 12]
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 传入公历(!)y年获得该年第n个节气的公历日期
|
||||||
|
* @param y公历年(1900-2100);n二十四节气中的第几个节气(1~24);从n=1(小寒)算起
|
||||||
|
* @return day Number
|
||||||
|
* @eg:var _24 = calendar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春
|
||||||
|
*/
|
||||||
|
getTerm: function (y, n) {
|
||||||
|
if (y < 1900 || y > 2100) { return -1 }
|
||||||
|
if (n < 1 || n > 24) { return -1 }
|
||||||
|
var _table = this.sTermInfo[y - 1900]
|
||||||
|
var _info = [
|
||||||
|
parseInt('0x' + _table.substr(0, 5)).toString(),
|
||||||
|
parseInt('0x' + _table.substr(5, 5)).toString(),
|
||||||
|
parseInt('0x' + _table.substr(10, 5)).toString(),
|
||||||
|
parseInt('0x' + _table.substr(15, 5)).toString(),
|
||||||
|
parseInt('0x' + _table.substr(20, 5)).toString(),
|
||||||
|
parseInt('0x' + _table.substr(25, 5)).toString()
|
||||||
|
]
|
||||||
|
var _calday = [
|
||||||
|
_info[0].substr(0, 1),
|
||||||
|
_info[0].substr(1, 2),
|
||||||
|
_info[0].substr(3, 1),
|
||||||
|
_info[0].substr(4, 2),
|
||||||
|
|
||||||
|
_info[1].substr(0, 1),
|
||||||
|
_info[1].substr(1, 2),
|
||||||
|
_info[1].substr(3, 1),
|
||||||
|
_info[1].substr(4, 2),
|
||||||
|
|
||||||
|
_info[2].substr(0, 1),
|
||||||
|
_info[2].substr(1, 2),
|
||||||
|
_info[2].substr(3, 1),
|
||||||
|
_info[2].substr(4, 2),
|
||||||
|
|
||||||
|
_info[3].substr(0, 1),
|
||||||
|
_info[3].substr(1, 2),
|
||||||
|
_info[3].substr(3, 1),
|
||||||
|
_info[3].substr(4, 2),
|
||||||
|
|
||||||
|
_info[4].substr(0, 1),
|
||||||
|
_info[4].substr(1, 2),
|
||||||
|
_info[4].substr(3, 1),
|
||||||
|
_info[4].substr(4, 2),
|
||||||
|
|
||||||
|
_info[5].substr(0, 1),
|
||||||
|
_info[5].substr(1, 2),
|
||||||
|
_info[5].substr(3, 1),
|
||||||
|
_info[5].substr(4, 2)
|
||||||
|
]
|
||||||
|
return parseInt(_calday[n - 1])
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 传入农历数字月份返回汉语通俗表示法
|
||||||
|
* @param lunar month
|
||||||
|
* @return Cn string
|
||||||
|
* @eg:var cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月'
|
||||||
|
*/
|
||||||
|
toChinaMonth: function (m) { // 月 => \u6708
|
||||||
|
if (m > 12 || m < 1) { return -1 } // 若参数错误 返回-1
|
||||||
|
var s = this.nStr3[m - 1]
|
||||||
|
s += '\u6708'// 加上月字
|
||||||
|
return s
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 传入农历日期数字返回汉字表示法
|
||||||
|
* @param lunar day
|
||||||
|
* @return Cn string
|
||||||
|
* @eg:var cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一'
|
||||||
|
*/
|
||||||
|
toChinaDay: function (d) { // 日 => \u65e5
|
||||||
|
var s
|
||||||
|
switch (d) {
|
||||||
|
case 10:
|
||||||
|
s = '\u521d\u5341'; break
|
||||||
|
case 20:
|
||||||
|
s = '\u4e8c\u5341'; break
|
||||||
|
case 30:
|
||||||
|
s = '\u4e09\u5341'; break
|
||||||
|
default :
|
||||||
|
s = this.nStr2[Math.floor(d / 10)]
|
||||||
|
s += this.nStr1[d % 10]
|
||||||
|
}
|
||||||
|
return (s)
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春”
|
||||||
|
* @param y year
|
||||||
|
* @return Cn string
|
||||||
|
* @eg:var animal = calendar.getAnimal(1987) ;//animal='兔'
|
||||||
|
*/
|
||||||
|
getAnimal: function (y) {
|
||||||
|
return this.Animals[(y - 4) % 12]
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 传入阳历年月日获得详细的公历、农历object信息 <=>JSON
|
||||||
|
* @param y solar year
|
||||||
|
* @param m solar month
|
||||||
|
* @param d solar day
|
||||||
|
* @return JSON object
|
||||||
|
* @eg:console.log(calendar.solar2lunar(1987,11,01));
|
||||||
|
*/
|
||||||
|
solar2lunar: function (y, m, d) { // 参数区间1900.1.31~2100.12.31
|
||||||
|
// 年份限定、上限
|
||||||
|
if (y < 1900 || y > 2100) {
|
||||||
|
return -1// undefined转换为数字变为NaN
|
||||||
|
}
|
||||||
|
// 公历传参最下限
|
||||||
|
if (y == 1900 && m == 1 && d < 31) {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
// 未传参 获得当天
|
||||||
|
if (!y) {
|
||||||
|
var objDate = new Date()
|
||||||
|
} else {
|
||||||
|
var objDate = new Date(y, parseInt(m) - 1, d)
|
||||||
|
}
|
||||||
|
var i; var leap = 0; var temp = 0
|
||||||
|
// 修正ymd参数
|
||||||
|
var y = objDate.getFullYear()
|
||||||
|
var m = objDate.getMonth() + 1
|
||||||
|
var d = objDate.getDate()
|
||||||
|
var offset = (Date.UTC(objDate.getFullYear(), objDate.getMonth(), objDate.getDate()) - Date.UTC(1900, 0, 31)) / 86400000
|
||||||
|
for (i = 1900; i < 2101 && offset > 0; i++) {
|
||||||
|
temp = this.lYearDays(i)
|
||||||
|
offset -= temp
|
||||||
|
}
|
||||||
|
if (offset < 0) {
|
||||||
|
offset += temp; i--
|
||||||
|
}
|
||||||
|
|
||||||
|
// 是否今天
|
||||||
|
var isTodayObj = new Date()
|
||||||
|
var isToday = false
|
||||||
|
if (isTodayObj.getFullYear() == y && isTodayObj.getMonth() + 1 == m && isTodayObj.getDate() == d) {
|
||||||
|
isToday = true
|
||||||
|
}
|
||||||
|
// 星期几
|
||||||
|
var nWeek = objDate.getDay()
|
||||||
|
var cWeek = this.nStr1[nWeek]
|
||||||
|
// 数字表示周几顺应天朝周一开始的惯例
|
||||||
|
if (nWeek == 0) {
|
||||||
|
nWeek = 7
|
||||||
|
}
|
||||||
|
// 农历年
|
||||||
|
var year = i
|
||||||
|
var leap = this.leapMonth(i) // 闰哪个月
|
||||||
|
var isLeap = false
|
||||||
|
|
||||||
|
// 效验闰月
|
||||||
|
for (i = 1; i < 13 && offset > 0; i++) {
|
||||||
|
// 闰月
|
||||||
|
if (leap > 0 && i == (leap + 1) && isLeap == false) {
|
||||||
|
--i
|
||||||
|
isLeap = true; temp = this.leapDays(year) // 计算农历闰月天数
|
||||||
|
} else {
|
||||||
|
temp = this.monthDays(year, i)// 计算农历普通月天数
|
||||||
|
}
|
||||||
|
// 解除闰月
|
||||||
|
if (isLeap == true && i == (leap + 1)) { isLeap = false }
|
||||||
|
offset -= temp
|
||||||
|
}
|
||||||
|
// 闰月导致数组下标重叠取反
|
||||||
|
if (offset == 0 && leap > 0 && i == leap + 1) {
|
||||||
|
if (isLeap) {
|
||||||
|
isLeap = false
|
||||||
|
} else {
|
||||||
|
isLeap = true; --i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (offset < 0) {
|
||||||
|
offset += temp; --i
|
||||||
|
}
|
||||||
|
// 农历月
|
||||||
|
var month = i
|
||||||
|
// 农历日
|
||||||
|
var day = offset + 1
|
||||||
|
// 天干地支处理
|
||||||
|
var sm = m - 1
|
||||||
|
var gzY = this.toGanZhiYear(year)
|
||||||
|
|
||||||
|
// 当月的两个节气
|
||||||
|
// bugfix-2017-7-24 11:03:38 use lunar Year Param `y` Not `year`
|
||||||
|
var firstNode = this.getTerm(y, (m * 2 - 1))// 返回当月「节」为几日开始
|
||||||
|
var secondNode = this.getTerm(y, (m * 2))// 返回当月「节」为几日开始
|
||||||
|
|
||||||
|
// 依据12节气修正干支月
|
||||||
|
var gzM = this.toGanZhi((y - 1900) * 12 + m + 11)
|
||||||
|
if (d >= firstNode) {
|
||||||
|
gzM = this.toGanZhi((y - 1900) * 12 + m + 12)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 传入的日期的节气与否
|
||||||
|
var isTerm = false
|
||||||
|
var Term = null
|
||||||
|
if (firstNode == d) {
|
||||||
|
isTerm = true
|
||||||
|
Term = this.solarTerm[m * 2 - 2]
|
||||||
|
}
|
||||||
|
if (secondNode == d) {
|
||||||
|
isTerm = true
|
||||||
|
Term = this.solarTerm[m * 2 - 1]
|
||||||
|
}
|
||||||
|
// 日柱 当月一日与 1900/1/1 相差天数
|
||||||
|
var dayCyclical = Date.UTC(y, sm, 1, 0, 0, 0, 0) / 86400000 + 25567 + 10
|
||||||
|
var gzD = this.toGanZhi(dayCyclical + d - 1)
|
||||||
|
// 该日期所属的星座
|
||||||
|
var astro = this.toAstro(m, d)
|
||||||
|
|
||||||
|
return { 'lYear': year, 'lMonth': month, 'lDay': day, 'Animal': this.getAnimal(year), 'IMonthCn': (isLeap ? '\u95f0' : '') + this.toChinaMonth(month), 'IDayCn': this.toChinaDay(day), 'cYear': y, 'cMonth': m, 'cDay': d, 'gzYear': gzY, 'gzMonth': gzM, 'gzDay': gzD, 'isToday': isToday, 'isLeap': isLeap, 'nWeek': nWeek, 'ncWeek': '\u661f\u671f' + cWeek, 'isTerm': isTerm, 'Term': Term, 'astro': astro }
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 传入农历年月日以及传入的月份是否闰月获得详细的公历、农历object信息 <=>JSON
|
||||||
|
* @param y lunar year
|
||||||
|
* @param m lunar month
|
||||||
|
* @param d lunar day
|
||||||
|
* @param isLeapMonth lunar month is leap or not.[如果是农历闰月第四个参数赋值true即可]
|
||||||
|
* @return JSON object
|
||||||
|
* @eg:console.log(calendar.lunar2solar(1987,9,10));
|
||||||
|
*/
|
||||||
|
lunar2solar: function (y, m, d, isLeapMonth) { // 参数区间1900.1.31~2100.12.1
|
||||||
|
var isLeapMonth = !!isLeapMonth
|
||||||
|
var leapOffset = 0
|
||||||
|
var leapMonth = this.leapMonth(y)
|
||||||
|
var leapDay = this.leapDays(y)
|
||||||
|
if (isLeapMonth && (leapMonth != m)) { return -1 }// 传参要求计算该闰月公历 但该年得出的闰月与传参的月份并不同
|
||||||
|
if (y == 2100 && m == 12 && d > 1 || y == 1900 && m == 1 && d < 31) { return -1 }// 超出了最大极限值
|
||||||
|
var day = this.monthDays(y, m)
|
||||||
|
var _day = day
|
||||||
|
// bugFix 2016-9-25
|
||||||
|
// if month is leap, _day use leapDays method
|
||||||
|
if (isLeapMonth) {
|
||||||
|
_day = this.leapDays(y, m)
|
||||||
|
}
|
||||||
|
if (y < 1900 || y > 2100 || d > _day) { return -1 }// 参数合法性效验
|
||||||
|
|
||||||
|
// 计算农历的时间差
|
||||||
|
var offset = 0
|
||||||
|
for (var i = 1900; i < y; i++) {
|
||||||
|
offset += this.lYearDays(i)
|
||||||
|
}
|
||||||
|
var leap = 0; var isAdd = false
|
||||||
|
for (var i = 1; i < m; i++) {
|
||||||
|
leap = this.leapMonth(y)
|
||||||
|
if (!isAdd) { // 处理闰月
|
||||||
|
if (leap <= i && leap > 0) {
|
||||||
|
offset += this.leapDays(y); isAdd = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
offset += this.monthDays(y, i)
|
||||||
|
}
|
||||||
|
// 转换闰月农历 需补充该年闰月的前一个月的时差
|
||||||
|
if (isLeapMonth) { offset += day }
|
||||||
|
// 1900年农历正月一日的公历时间为1900年1月30日0时0分0秒(该时间也是本农历的最开始起始点)
|
||||||
|
var stmap = Date.UTC(1900, 1, 30, 0, 0, 0)
|
||||||
|
var calObj = new Date((offset + d - 31) * 86400000 + stmap)
|
||||||
|
var cY = calObj.getUTCFullYear()
|
||||||
|
var cM = calObj.getUTCMonth() + 1
|
||||||
|
var cD = calObj.getUTCDate()
|
||||||
|
|
||||||
|
return this.solar2lunar(cY, cM, cD)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default calendar
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"uni-calender.ok": "ok",
|
||||||
|
"uni-calender.cancel": "cancel",
|
||||||
|
"uni-calender.today": "today",
|
||||||
|
"uni-calender.MON": "MON",
|
||||||
|
"uni-calender.TUE": "TUE",
|
||||||
|
"uni-calender.WED": "WED",
|
||||||
|
"uni-calender.THU": "THU",
|
||||||
|
"uni-calender.FRI": "FRI",
|
||||||
|
"uni-calender.SAT": "SAT",
|
||||||
|
"uni-calender.SUN": "SUN"
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
import en from './en.json'
|
||||||
|
import zhHans from './zh-Hans.json'
|
||||||
|
import zhHant from './zh-Hant.json'
|
||||||
|
export default {
|
||||||
|
en,
|
||||||
|
'zh-Hans': zhHans,
|
||||||
|
'zh-Hant': zhHant
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"uni-calender.ok": "确定",
|
||||||
|
"uni-calender.cancel": "取消",
|
||||||
|
"uni-calender.today": "今日",
|
||||||
|
"uni-calender.SUN": "日",
|
||||||
|
"uni-calender.MON": "一",
|
||||||
|
"uni-calender.TUE": "二",
|
||||||
|
"uni-calender.WED": "三",
|
||||||
|
"uni-calender.THU": "四",
|
||||||
|
"uni-calender.FRI": "五",
|
||||||
|
"uni-calender.SAT": "六"
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"uni-calender.ok": "確定",
|
||||||
|
"uni-calender.cancel": "取消",
|
||||||
|
"uni-calender.today": "今日",
|
||||||
|
"uni-calender.SUN": "日",
|
||||||
|
"uni-calender.MON": "一",
|
||||||
|
"uni-calender.TUE": "二",
|
||||||
|
"uni-calender.WED": "三",
|
||||||
|
"uni-calender.THU": "四",
|
||||||
|
"uni-calender.FRI": "五",
|
||||||
|
"uni-calender.SAT": "六"
|
||||||
|
}
|
||||||
@ -0,0 +1,187 @@
|
|||||||
|
<template>
|
||||||
|
<view class="uni-calendar-item__weeks-box" :class="{
|
||||||
|
'uni-calendar-item--disable':weeks.disable,
|
||||||
|
'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
|
||||||
|
'uni-calendar-item--checked':(calendar.fullDate === weeks.fullDate && !weeks.isDay) ,
|
||||||
|
'uni-calendar-item--before-checked':weeks.beforeMultiple,
|
||||||
|
'uni-calendar-item--multiple': weeks.multiple,
|
||||||
|
'uni-calendar-item--after-checked':weeks.afterMultiple,
|
||||||
|
}"
|
||||||
|
@click="choiceDate(weeks)">
|
||||||
|
<view class="uni-calendar-item__weeks-box-item">
|
||||||
|
<text v-if="selected&&weeks.extraInfo" class="uni-calendar-item__weeks-box-circle"></text>
|
||||||
|
<text class="uni-calendar-item__weeks-box-text" :class="{
|
||||||
|
'uni-calendar-item--isDay-text': weeks.isDay,
|
||||||
|
'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
|
||||||
|
'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
|
||||||
|
'uni-calendar-item--before-checked':weeks.beforeMultiple,
|
||||||
|
'uni-calendar-item--multiple': weeks.multiple,
|
||||||
|
'uni-calendar-item--after-checked':weeks.afterMultiple,
|
||||||
|
'uni-calendar-item--disable':weeks.disable,
|
||||||
|
}">{{weeks.date}}</text>
|
||||||
|
<text v-if="!lunar&&!weeks.extraInfo && weeks.isDay" class="uni-calendar-item__weeks-lunar-text" :class="{
|
||||||
|
'uni-calendar-item--isDay-text':weeks.isDay,
|
||||||
|
'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
|
||||||
|
'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
|
||||||
|
'uni-calendar-item--before-checked':weeks.beforeMultiple,
|
||||||
|
'uni-calendar-item--multiple': weeks.multiple,
|
||||||
|
'uni-calendar-item--after-checked':weeks.afterMultiple,
|
||||||
|
}">{{todayText}}</text>
|
||||||
|
<text v-if="lunar&&!weeks.extraInfo" class="uni-calendar-item__weeks-lunar-text" :class="{
|
||||||
|
'uni-calendar-item--isDay-text':weeks.isDay,
|
||||||
|
'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
|
||||||
|
'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
|
||||||
|
'uni-calendar-item--before-checked':weeks.beforeMultiple,
|
||||||
|
'uni-calendar-item--multiple': weeks.multiple,
|
||||||
|
'uni-calendar-item--after-checked':weeks.afterMultiple,
|
||||||
|
'uni-calendar-item--disable':weeks.disable,
|
||||||
|
}">{{weeks.isDay ? todayText : (weeks.lunar.IDayCn === '初一'?weeks.lunar.IMonthCn:weeks.lunar.IDayCn)}}</text>
|
||||||
|
<text v-if="weeks.extraInfo&&weeks.extraInfo.info" class="uni-calendar-item__weeks-lunar-text" :class="{
|
||||||
|
'uni-calendar-item--extra':weeks.extraInfo.info,
|
||||||
|
'uni-calendar-item--isDay-text':weeks.isDay,
|
||||||
|
'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
|
||||||
|
'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
|
||||||
|
'uni-calendar-item--before-checked':weeks.beforeMultiple,
|
||||||
|
'uni-calendar-item--multiple': weeks.multiple,
|
||||||
|
'uni-calendar-item--after-checked':weeks.afterMultiple,
|
||||||
|
'uni-calendar-item--disable':weeks.disable,
|
||||||
|
}">{{weeks.extraInfo.info}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { initVueI18n } from '@dcloudio/uni-i18n'
|
||||||
|
import i18nMessages from './i18n/index.js'
|
||||||
|
const { t } = initVueI18n(i18nMessages)
|
||||||
|
|
||||||
|
export default {
|
||||||
|
emits:['change'],
|
||||||
|
props: {
|
||||||
|
weeks: {
|
||||||
|
type: Object,
|
||||||
|
default () {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
calendar: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
selected: {
|
||||||
|
type: Array,
|
||||||
|
default: () => {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
lunar: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
todayText() {
|
||||||
|
return t("uni-calender.today")
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
choiceDate(weeks) {
|
||||||
|
this.$emit('change', weeks)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
$uni-font-size-base:14px;
|
||||||
|
$uni-text-color:#333;
|
||||||
|
$uni-font-size-sm:12px;
|
||||||
|
$uni-color-error: #e43d33;
|
||||||
|
$uni-opacity-disabled: 0.3;
|
||||||
|
$uni-text-color-disable:#c0c0c0;
|
||||||
|
$uni-primary: #2979ff !default;
|
||||||
|
.uni-calendar-item__weeks-box {
|
||||||
|
flex: 1;
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar-item__weeks-box-text {
|
||||||
|
font-size: $uni-font-size-base;
|
||||||
|
color: $uni-text-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar-item__weeks-lunar-text {
|
||||||
|
font-size: $uni-font-size-sm;
|
||||||
|
color: $uni-text-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar-item__weeks-box-item {
|
||||||
|
position: relative;
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar-item__weeks-box-circle {
|
||||||
|
position: absolute;
|
||||||
|
top: 5px;
|
||||||
|
right: 5px;
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
border-radius: 8px;
|
||||||
|
background-color: $uni-color-error;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar-item--disable {
|
||||||
|
background-color: rgba(249, 249, 249, $uni-opacity-disabled);
|
||||||
|
color: $uni-text-color-disable;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar-item--isDay-text {
|
||||||
|
color: $uni-primary;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar-item--isDay {
|
||||||
|
background-color: $uni-primary;
|
||||||
|
opacity: 0.8;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar-item--extra {
|
||||||
|
color: $uni-color-error;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar-item--checked {
|
||||||
|
background-color: $uni-primary;
|
||||||
|
color: #fff;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar-item--multiple {
|
||||||
|
background-color: $uni-primary;
|
||||||
|
color: #fff;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
.uni-calendar-item--before-checked {
|
||||||
|
background-color: #ff5a5f;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.uni-calendar-item--after-checked {
|
||||||
|
background-color: #ff5a5f;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -0,0 +1,567 @@
|
|||||||
|
<template>
|
||||||
|
<view class="uni-calendar">
|
||||||
|
<view v-if="!insert&&show" class="uni-calendar__mask" :class="{'uni-calendar--mask-show':aniMaskShow}" @click="clean"></view>
|
||||||
|
<view v-if="insert || show" class="uni-calendar__content" :class="{'uni-calendar--fixed':!insert,'uni-calendar--ani-show':aniMaskShow}">
|
||||||
|
<view v-if="!insert" class="uni-calendar__header uni-calendar--fixed-top">
|
||||||
|
<view class="uni-calendar__header-btn-box" @click="close">
|
||||||
|
<text class="uni-calendar__header-text uni-calendar--fixed-width">{{cancelText}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="uni-calendar__header-btn-box" @click="confirm">
|
||||||
|
<text class="uni-calendar__header-text uni-calendar--fixed-width">{{okText}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="uni-calendar__header">
|
||||||
|
<view class="uni-calendar__header-btn-box" @click.stop="pre">
|
||||||
|
<view class="uni-calendar__header-btn uni-calendar--left"></view>
|
||||||
|
</view>
|
||||||
|
<picker mode="date" :value="date" fields="month" @change="bindDateChange">
|
||||||
|
<text class="uni-calendar__header-text">{{ (nowDate.year||'') +' / '+( nowDate.month||'')}}</text>
|
||||||
|
</picker>
|
||||||
|
<view class="uni-calendar__header-btn-box" @click.stop="next">
|
||||||
|
<view class="uni-calendar__header-btn uni-calendar--right"></view>
|
||||||
|
</view>
|
||||||
|
<text class="uni-calendar__backtoday" @click="backToday">{{todayText}}</text>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="uni-calendar__box">
|
||||||
|
<view v-if="showMonth" class="uni-calendar__box-bg">
|
||||||
|
<text class="uni-calendar__box-bg-text">{{nowDate.month}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="uni-calendar__weeks">
|
||||||
|
<view class="uni-calendar__weeks-day">
|
||||||
|
<text class="uni-calendar__weeks-day-text">{{SUNText}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="uni-calendar__weeks-day">
|
||||||
|
<text class="uni-calendar__weeks-day-text">{{monText}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="uni-calendar__weeks-day">
|
||||||
|
<text class="uni-calendar__weeks-day-text">{{TUEText}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="uni-calendar__weeks-day">
|
||||||
|
<text class="uni-calendar__weeks-day-text">{{WEDText}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="uni-calendar__weeks-day">
|
||||||
|
<text class="uni-calendar__weeks-day-text">{{THUText}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="uni-calendar__weeks-day">
|
||||||
|
<text class="uni-calendar__weeks-day-text">{{FRIText}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="uni-calendar__weeks-day">
|
||||||
|
<text class="uni-calendar__weeks-day-text">{{SATText}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="uni-calendar__weeks" v-for="(item,weekIndex) in weeks" :key="weekIndex">
|
||||||
|
<view class="uni-calendar__weeks-item" v-for="(weeks,weeksIndex) in item" :key="weeksIndex">
|
||||||
|
<calendar-item class="uni-calendar-item--hook" :weeks="weeks" :calendar="calendar" :selected="selected" :lunar="lunar" @change="choiceDate"></calendar-item>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Calendar from './util.js';
|
||||||
|
import CalendarItem from './uni-calendar-item.vue'
|
||||||
|
|
||||||
|
import { initVueI18n } from '@dcloudio/uni-i18n'
|
||||||
|
import i18nMessages from './i18n/index.js'
|
||||||
|
const { t } = initVueI18n(i18nMessages)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calendar 日历
|
||||||
|
* @description 日历组件可以查看日期,选择任意范围内的日期,打点操作。常用场景如:酒店日期预订、火车机票选择购买日期、上下班打卡等
|
||||||
|
* @tutorial https://ext.dcloud.net.cn/plugin?id=56
|
||||||
|
* @property {String} date 自定义当前时间,默认为今天
|
||||||
|
* @property {Boolean} lunar 显示农历
|
||||||
|
* @property {String} startDate 日期选择范围-开始日期
|
||||||
|
* @property {String} endDate 日期选择范围-结束日期
|
||||||
|
* @property {Boolean} range 范围选择
|
||||||
|
* @property {Boolean} insert = [true|false] 插入模式,默认为false
|
||||||
|
* @value true 弹窗模式
|
||||||
|
* @value false 插入模式
|
||||||
|
* @property {Boolean} clearDate = [true|false] 弹窗模式是否清空上次选择内容
|
||||||
|
* @property {Array} selected 打点,期待格式[{date: '2019-06-27', info: '签到', data: { custom: '自定义信息', name: '自定义消息头',xxx:xxx... }}]
|
||||||
|
* @property {Boolean} showMonth 是否选择月份为背景
|
||||||
|
* @event {Function} change 日期改变,`insert :ture` 时生效
|
||||||
|
* @event {Function} confirm 确认选择`insert :false` 时生效
|
||||||
|
* @event {Function} monthSwitch 切换月份时触发
|
||||||
|
* @example <uni-calendar :insert="true":lunar="true" :start-date="'2019-3-2'":end-date="'2019-5-20'"@change="change" />
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
CalendarItem
|
||||||
|
},
|
||||||
|
emits:['close','confirm','change','monthSwitch'],
|
||||||
|
props: {
|
||||||
|
date: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
selected: {
|
||||||
|
type: Array,
|
||||||
|
default () {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
lunar: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
startDate: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
endDate: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
range: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
insert: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
showMonth: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
clearDate: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
show: false,
|
||||||
|
weeks: [],
|
||||||
|
calendar: {},
|
||||||
|
nowDate: '',
|
||||||
|
aniMaskShow: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed:{
|
||||||
|
/**
|
||||||
|
* for i18n
|
||||||
|
*/
|
||||||
|
|
||||||
|
okText() {
|
||||||
|
return t("uni-calender.ok")
|
||||||
|
},
|
||||||
|
cancelText() {
|
||||||
|
return t("uni-calender.cancel")
|
||||||
|
},
|
||||||
|
todayText() {
|
||||||
|
return t("uni-calender.today")
|
||||||
|
},
|
||||||
|
monText() {
|
||||||
|
return t("uni-calender.MON")
|
||||||
|
},
|
||||||
|
TUEText() {
|
||||||
|
return t("uni-calender.TUE")
|
||||||
|
},
|
||||||
|
WEDText() {
|
||||||
|
return t("uni-calender.WED")
|
||||||
|
},
|
||||||
|
THUText() {
|
||||||
|
return t("uni-calender.THU")
|
||||||
|
},
|
||||||
|
FRIText() {
|
||||||
|
return t("uni-calender.FRI")
|
||||||
|
},
|
||||||
|
SATText() {
|
||||||
|
return t("uni-calender.SAT")
|
||||||
|
},
|
||||||
|
SUNText() {
|
||||||
|
return t("uni-calender.SUN")
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
date(newVal) {
|
||||||
|
// this.cale.setDate(newVal)
|
||||||
|
this.init(newVal)
|
||||||
|
},
|
||||||
|
startDate(val){
|
||||||
|
this.cale.resetSatrtDate(val)
|
||||||
|
this.cale.setDate(this.nowDate.fullDate)
|
||||||
|
this.weeks = this.cale.weeks
|
||||||
|
},
|
||||||
|
endDate(val){
|
||||||
|
this.cale.resetEndDate(val)
|
||||||
|
this.cale.setDate(this.nowDate.fullDate)
|
||||||
|
this.weeks = this.cale.weeks
|
||||||
|
},
|
||||||
|
selected(newVal) {
|
||||||
|
this.cale.setSelectInfo(this.nowDate.fullDate, newVal)
|
||||||
|
this.weeks = this.cale.weeks
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.cale = new Calendar({
|
||||||
|
selected: this.selected,
|
||||||
|
startDate: this.startDate,
|
||||||
|
endDate: this.endDate,
|
||||||
|
range: this.range,
|
||||||
|
})
|
||||||
|
this.init(this.date)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 取消穿透
|
||||||
|
clean() {},
|
||||||
|
bindDateChange(e) {
|
||||||
|
const value = e.detail.value + '-1'
|
||||||
|
this.setDate(value)
|
||||||
|
|
||||||
|
const { year,month } = this.cale.getDate(value)
|
||||||
|
this.$emit('monthSwitch', {
|
||||||
|
year,
|
||||||
|
month
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 初始化日期显示
|
||||||
|
* @param {Object} date
|
||||||
|
*/
|
||||||
|
init(date) {
|
||||||
|
this.cale.setDate(date)
|
||||||
|
this.weeks = this.cale.weeks
|
||||||
|
this.nowDate = this.calendar = this.cale.getInfo(date)
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 打开日历弹窗
|
||||||
|
*/
|
||||||
|
open() {
|
||||||
|
// 弹窗模式并且清理数据
|
||||||
|
if (this.clearDate && !this.insert) {
|
||||||
|
this.cale.cleanMultipleStatus()
|
||||||
|
// this.cale.setDate(this.date)
|
||||||
|
this.init(this.date)
|
||||||
|
}
|
||||||
|
this.show = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.aniMaskShow = true
|
||||||
|
}, 50)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 关闭日历弹窗
|
||||||
|
*/
|
||||||
|
close() {
|
||||||
|
this.aniMaskShow = false
|
||||||
|
this.$nextTick(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.show = false
|
||||||
|
this.$emit('close')
|
||||||
|
}, 300)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 确认按钮
|
||||||
|
*/
|
||||||
|
confirm() {
|
||||||
|
this.setEmit('confirm')
|
||||||
|
this.close()
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 变化触发
|
||||||
|
*/
|
||||||
|
change() {
|
||||||
|
if (!this.insert) return
|
||||||
|
this.setEmit('change')
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 选择月份触发
|
||||||
|
*/
|
||||||
|
monthSwitch() {
|
||||||
|
let {
|
||||||
|
year,
|
||||||
|
month
|
||||||
|
} = this.nowDate
|
||||||
|
this.$emit('monthSwitch', {
|
||||||
|
year,
|
||||||
|
month: Number(month)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 派发事件
|
||||||
|
* @param {Object} name
|
||||||
|
*/
|
||||||
|
setEmit(name) {
|
||||||
|
let {
|
||||||
|
year,
|
||||||
|
month,
|
||||||
|
date,
|
||||||
|
fullDate,
|
||||||
|
lunar,
|
||||||
|
extraInfo
|
||||||
|
} = this.calendar
|
||||||
|
this.$emit(name, {
|
||||||
|
range: this.cale.multipleStatus,
|
||||||
|
year,
|
||||||
|
month,
|
||||||
|
date,
|
||||||
|
fulldate: fullDate,
|
||||||
|
lunar,
|
||||||
|
extraInfo: extraInfo || {}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 选择天触发
|
||||||
|
* @param {Object} weeks
|
||||||
|
*/
|
||||||
|
choiceDate(weeks) {
|
||||||
|
if (weeks.disable) return
|
||||||
|
this.calendar = weeks
|
||||||
|
// 设置多选
|
||||||
|
this.cale.setMultiple(this.calendar.fullDate)
|
||||||
|
this.weeks = this.cale.weeks
|
||||||
|
this.change()
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 回到今天
|
||||||
|
*/
|
||||||
|
backToday() {
|
||||||
|
const nowYearMonth = `${this.nowDate.year}-${this.nowDate.month}`
|
||||||
|
const date = this.cale.getDate(new Date())
|
||||||
|
const todayYearMonth = `${date.year}-${date.month}`
|
||||||
|
|
||||||
|
this.init(date.fullDate)
|
||||||
|
|
||||||
|
if(nowYearMonth !== todayYearMonth) {
|
||||||
|
this.monthSwitch()
|
||||||
|
}
|
||||||
|
|
||||||
|
this.change()
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 上个月
|
||||||
|
*/
|
||||||
|
pre() {
|
||||||
|
const preDate = this.cale.getDate(this.nowDate.fullDate, -1, 'month').fullDate
|
||||||
|
this.setDate(preDate)
|
||||||
|
this.monthSwitch()
|
||||||
|
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 下个月
|
||||||
|
*/
|
||||||
|
next() {
|
||||||
|
const nextDate = this.cale.getDate(this.nowDate.fullDate, +1, 'month').fullDate
|
||||||
|
this.setDate(nextDate)
|
||||||
|
this.monthSwitch()
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 设置日期
|
||||||
|
* @param {Object} date
|
||||||
|
*/
|
||||||
|
setDate(date) {
|
||||||
|
this.cale.setDate(date)
|
||||||
|
this.weeks = this.cale.weeks
|
||||||
|
this.nowDate = this.cale.getInfo(date)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
$uni-bg-color-mask: rgba($color: #000000, $alpha: 0.4);
|
||||||
|
$uni-border-color: #EDEDED;
|
||||||
|
$uni-text-color: #333;
|
||||||
|
$uni-bg-color-hover:#f1f1f1;
|
||||||
|
$uni-font-size-base:14px;
|
||||||
|
$uni-text-color-placeholder: #808080;
|
||||||
|
$uni-color-subtitle: #555555;
|
||||||
|
$uni-text-color-grey:#999;
|
||||||
|
.uni-calendar {
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar__mask {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
background-color: $uni-bg-color-mask;
|
||||||
|
transition-property: opacity;
|
||||||
|
transition-duration: 0.3s;
|
||||||
|
opacity: 0;
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
z-index: 99;
|
||||||
|
/* #endif */
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar--mask-show {
|
||||||
|
opacity: 1
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar--fixed {
|
||||||
|
position: fixed;
|
||||||
|
/* #ifdef APP-NVUE */
|
||||||
|
bottom: 0;
|
||||||
|
/* #endif */
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
transition-property: transform;
|
||||||
|
transition-duration: 0.3s;
|
||||||
|
transform: translateY(460px);
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
bottom: calc(var(--window-bottom));
|
||||||
|
z-index: 99;
|
||||||
|
/* #endif */
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar--ani-show {
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar__content {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar__header {
|
||||||
|
position: relative;
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 50px;
|
||||||
|
border-bottom-color: $uni-border-color;
|
||||||
|
border-bottom-style: solid;
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar--fixed-top {
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
border-top-color: $uni-border-color;
|
||||||
|
border-top-style: solid;
|
||||||
|
border-top-width: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar--fixed-width {
|
||||||
|
width: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar__backtoday {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 25rpx;
|
||||||
|
padding: 0 5px;
|
||||||
|
padding-left: 10px;
|
||||||
|
height: 25px;
|
||||||
|
line-height: 25px;
|
||||||
|
font-size: 12px;
|
||||||
|
border-top-left-radius: 25px;
|
||||||
|
border-bottom-left-radius: 25px;
|
||||||
|
color: $uni-text-color;
|
||||||
|
background-color: $uni-bg-color-hover;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar__header-text {
|
||||||
|
text-align: center;
|
||||||
|
width: 100px;
|
||||||
|
font-size: $uni-font-size-base;
|
||||||
|
color: $uni-text-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar__header-btn-box {
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar__header-btn {
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
border-left-color: $uni-text-color-placeholder;
|
||||||
|
border-left-style: solid;
|
||||||
|
border-left-width: 2px;
|
||||||
|
border-top-color: $uni-color-subtitle;
|
||||||
|
border-top-style: solid;
|
||||||
|
border-top-width: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar--left {
|
||||||
|
transform: rotate(-45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar--right {
|
||||||
|
transform: rotate(135deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.uni-calendar__weeks {
|
||||||
|
position: relative;
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar__weeks-item {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar__weeks-day {
|
||||||
|
flex: 1;
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 45px;
|
||||||
|
border-bottom-color: #F5F5F5;
|
||||||
|
border-bottom-style: solid;
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar__weeks-day-text {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar__box {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar__box-bg {
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-calendar__box-bg-text {
|
||||||
|
font-size: 200px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: $uni-text-color-grey;
|
||||||
|
opacity: 0.1;
|
||||||
|
text-align: center;
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
line-height: 1;
|
||||||
|
/* #endif */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
360
uni_modules/uni-calendar/components/uni-calendar/util.js
Normal file
360
uni_modules/uni-calendar/components/uni-calendar/util.js
Normal file
@ -0,0 +1,360 @@
|
|||||||
|
import CALENDAR from './calendar.js'
|
||||||
|
|
||||||
|
class Calendar {
|
||||||
|
constructor({
|
||||||
|
date,
|
||||||
|
selected,
|
||||||
|
startDate,
|
||||||
|
endDate,
|
||||||
|
range
|
||||||
|
} = {}) {
|
||||||
|
// 当前日期
|
||||||
|
this.date = this.getDate(new Date()) // 当前初入日期
|
||||||
|
// 打点信息
|
||||||
|
this.selected = selected || [];
|
||||||
|
// 范围开始
|
||||||
|
this.startDate = startDate
|
||||||
|
// 范围结束
|
||||||
|
this.endDate = endDate
|
||||||
|
this.range = range
|
||||||
|
// 多选状态
|
||||||
|
this.cleanMultipleStatus()
|
||||||
|
// 每周日期
|
||||||
|
this.weeks = {}
|
||||||
|
// this._getWeek(this.date.fullDate)
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置日期
|
||||||
|
* @param {Object} date
|
||||||
|
*/
|
||||||
|
setDate(date) {
|
||||||
|
this.selectDate = this.getDate(date)
|
||||||
|
this._getWeek(this.selectDate.fullDate)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清理多选状态
|
||||||
|
*/
|
||||||
|
cleanMultipleStatus() {
|
||||||
|
this.multipleStatus = {
|
||||||
|
before: '',
|
||||||
|
after: '',
|
||||||
|
data: []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置开始日期
|
||||||
|
*/
|
||||||
|
resetSatrtDate(startDate) {
|
||||||
|
// 范围开始
|
||||||
|
this.startDate = startDate
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置结束日期
|
||||||
|
*/
|
||||||
|
resetEndDate(endDate) {
|
||||||
|
// 范围结束
|
||||||
|
this.endDate = endDate
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取任意时间
|
||||||
|
*/
|
||||||
|
getDate(date, AddDayCount = 0, str = 'day') {
|
||||||
|
if (!date) {
|
||||||
|
date = new Date()
|
||||||
|
}
|
||||||
|
if (typeof date !== 'object') {
|
||||||
|
date = date.replace(/-/g, '/')
|
||||||
|
}
|
||||||
|
const dd = new Date(date)
|
||||||
|
switch (str) {
|
||||||
|
case 'day':
|
||||||
|
dd.setDate(dd.getDate() + AddDayCount) // 获取AddDayCount天后的日期
|
||||||
|
break
|
||||||
|
case 'month':
|
||||||
|
if (dd.getDate() === 31 && AddDayCount>0) {
|
||||||
|
dd.setDate(dd.getDate() + AddDayCount)
|
||||||
|
} else {
|
||||||
|
const preMonth = dd.getMonth()
|
||||||
|
dd.setMonth(preMonth + AddDayCount) // 获取AddDayCount天后的日期
|
||||||
|
const nextMonth = dd.getMonth()
|
||||||
|
// 处理 pre 切换月份目标月份为2月没有当前日(30 31) 切换错误问题
|
||||||
|
if(AddDayCount<0 && preMonth!==0 && nextMonth-preMonth>AddDayCount){
|
||||||
|
dd.setMonth(nextMonth+(nextMonth-preMonth+AddDayCount))
|
||||||
|
}
|
||||||
|
// 处理 next 切换月份目标月份为2月没有当前日(30 31) 切换错误问题
|
||||||
|
if(AddDayCount>0 && nextMonth-preMonth>AddDayCount){
|
||||||
|
dd.setMonth(nextMonth-(nextMonth-preMonth-AddDayCount))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case 'year':
|
||||||
|
dd.setFullYear(dd.getFullYear() + AddDayCount) // 获取AddDayCount天后的日期
|
||||||
|
break
|
||||||
|
}
|
||||||
|
const y = dd.getFullYear()
|
||||||
|
const m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1 // 获取当前月份的日期,不足10补0
|
||||||
|
const d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate() // 获取当前几号,不足10补0
|
||||||
|
return {
|
||||||
|
fullDate: y + '-' + m + '-' + d,
|
||||||
|
year: y,
|
||||||
|
month: m,
|
||||||
|
date: d,
|
||||||
|
day: dd.getDay()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取上月剩余天数
|
||||||
|
*/
|
||||||
|
_getLastMonthDays(firstDay, full) {
|
||||||
|
let dateArr = []
|
||||||
|
for (let i = firstDay; i > 0; i--) {
|
||||||
|
const beforeDate = new Date(full.year, full.month - 1, -i + 1).getDate()
|
||||||
|
dateArr.push({
|
||||||
|
date: beforeDate,
|
||||||
|
month: full.month - 1,
|
||||||
|
lunar: this.getlunar(full.year, full.month - 1, beforeDate),
|
||||||
|
disable: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return dateArr
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取本月天数
|
||||||
|
*/
|
||||||
|
_currentMonthDys(dateData, full) {
|
||||||
|
let dateArr = []
|
||||||
|
let fullDate = this.date.fullDate
|
||||||
|
for (let i = 1; i <= dateData; i++) {
|
||||||
|
let nowDate = full.year + '-' + (full.month < 10 ?
|
||||||
|
full.month : full.month) + '-' + (i < 10 ?
|
||||||
|
'0' + i : i)
|
||||||
|
// 是否今天
|
||||||
|
let isDay = fullDate === nowDate
|
||||||
|
// 获取打点信息
|
||||||
|
let info = this.selected && this.selected.find((item) => {
|
||||||
|
if (this.dateEqual(nowDate, item.date)) {
|
||||||
|
return item
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// 日期禁用
|
||||||
|
let disableBefore = true
|
||||||
|
let disableAfter = true
|
||||||
|
if (this.startDate) {
|
||||||
|
// let dateCompBefore = this.dateCompare(this.startDate, fullDate)
|
||||||
|
// disableBefore = this.dateCompare(dateCompBefore ? this.startDate : fullDate, nowDate)
|
||||||
|
disableBefore = this.dateCompare(this.startDate, nowDate)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.endDate) {
|
||||||
|
// let dateCompAfter = this.dateCompare(fullDate, this.endDate)
|
||||||
|
// disableAfter = this.dateCompare(nowDate, dateCompAfter ? this.endDate : fullDate)
|
||||||
|
disableAfter = this.dateCompare(nowDate, this.endDate)
|
||||||
|
}
|
||||||
|
let multiples = this.multipleStatus.data
|
||||||
|
let checked = false
|
||||||
|
let multiplesStatus = -1
|
||||||
|
if (this.range) {
|
||||||
|
if (multiples) {
|
||||||
|
multiplesStatus = multiples.findIndex((item) => {
|
||||||
|
return this.dateEqual(item, nowDate)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (multiplesStatus !== -1) {
|
||||||
|
checked = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let data = {
|
||||||
|
fullDate: nowDate,
|
||||||
|
year: full.year,
|
||||||
|
date: i,
|
||||||
|
multiple: this.range ? checked : false,
|
||||||
|
beforeMultiple: this.dateEqual(this.multipleStatus.before, nowDate),
|
||||||
|
afterMultiple: this.dateEqual(this.multipleStatus.after, nowDate),
|
||||||
|
month: full.month,
|
||||||
|
lunar: this.getlunar(full.year, full.month, i),
|
||||||
|
disable: !(disableBefore && disableAfter),
|
||||||
|
isDay
|
||||||
|
}
|
||||||
|
if (info) {
|
||||||
|
data.extraInfo = info
|
||||||
|
}
|
||||||
|
|
||||||
|
dateArr.push(data)
|
||||||
|
}
|
||||||
|
return dateArr
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取下月天数
|
||||||
|
*/
|
||||||
|
_getNextMonthDays(surplus, full) {
|
||||||
|
let dateArr = []
|
||||||
|
for (let i = 1; i < surplus + 1; i++) {
|
||||||
|
dateArr.push({
|
||||||
|
date: i,
|
||||||
|
month: Number(full.month) + 1,
|
||||||
|
lunar: this.getlunar(full.year, Number(full.month) + 1, i),
|
||||||
|
disable: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return dateArr
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前日期详情
|
||||||
|
* @param {Object} date
|
||||||
|
*/
|
||||||
|
getInfo(date) {
|
||||||
|
if (!date) {
|
||||||
|
date = new Date()
|
||||||
|
}
|
||||||
|
const dateInfo = this.canlender.find(item => item.fullDate === this.getDate(date).fullDate)
|
||||||
|
return dateInfo
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 比较时间大小
|
||||||
|
*/
|
||||||
|
dateCompare(startDate, endDate) {
|
||||||
|
// 计算截止时间
|
||||||
|
startDate = new Date(startDate.replace('-', '/').replace('-', '/'))
|
||||||
|
// 计算详细项的截止时间
|
||||||
|
endDate = new Date(endDate.replace('-', '/').replace('-', '/'))
|
||||||
|
if (startDate <= endDate) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 比较时间是否相等
|
||||||
|
*/
|
||||||
|
dateEqual(before, after) {
|
||||||
|
// 计算截止时间
|
||||||
|
before = new Date(before.replace('-', '/').replace('-', '/'))
|
||||||
|
// 计算详细项的截止时间
|
||||||
|
after = new Date(after.replace('-', '/').replace('-', '/'))
|
||||||
|
if (before.getTime() - after.getTime() === 0) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取日期范围内所有日期
|
||||||
|
* @param {Object} begin
|
||||||
|
* @param {Object} end
|
||||||
|
*/
|
||||||
|
geDateAll(begin, end) {
|
||||||
|
var arr = []
|
||||||
|
var ab = begin.split('-')
|
||||||
|
var ae = end.split('-')
|
||||||
|
var db = new Date()
|
||||||
|
db.setFullYear(ab[0], ab[1] - 1, ab[2])
|
||||||
|
var de = new Date()
|
||||||
|
de.setFullYear(ae[0], ae[1] - 1, ae[2])
|
||||||
|
var unixDb = db.getTime() - 24 * 60 * 60 * 1000
|
||||||
|
var unixDe = de.getTime() - 24 * 60 * 60 * 1000
|
||||||
|
for (var k = unixDb; k <= unixDe;) {
|
||||||
|
k = k + 24 * 60 * 60 * 1000
|
||||||
|
arr.push(this.getDate(new Date(parseInt(k))).fullDate)
|
||||||
|
}
|
||||||
|
return arr
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 计算阴历日期显示
|
||||||
|
*/
|
||||||
|
getlunar(year, month, date) {
|
||||||
|
return CALENDAR.solar2lunar(year, month, date)
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置打点
|
||||||
|
*/
|
||||||
|
setSelectInfo(data, value) {
|
||||||
|
this.selected = value
|
||||||
|
this._getWeek(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取多选状态
|
||||||
|
*/
|
||||||
|
setMultiple(fullDate) {
|
||||||
|
let {
|
||||||
|
before,
|
||||||
|
after
|
||||||
|
} = this.multipleStatus
|
||||||
|
|
||||||
|
if (!this.range) return
|
||||||
|
if (before && after) {
|
||||||
|
this.multipleStatus.before = fullDate
|
||||||
|
this.multipleStatus.after = ''
|
||||||
|
this.multipleStatus.data = []
|
||||||
|
} else {
|
||||||
|
if (!before) {
|
||||||
|
this.multipleStatus.before = fullDate
|
||||||
|
} else {
|
||||||
|
this.multipleStatus.after = fullDate
|
||||||
|
if (this.dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
|
||||||
|
this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
|
||||||
|
} else {
|
||||||
|
this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this._getWeek(fullDate)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取每周数据
|
||||||
|
* @param {Object} dateData
|
||||||
|
*/
|
||||||
|
_getWeek(dateData) {
|
||||||
|
const {
|
||||||
|
year,
|
||||||
|
month
|
||||||
|
} = this.getDate(dateData)
|
||||||
|
let firstDay = new Date(year, month - 1, 1).getDay()
|
||||||
|
let currentDay = new Date(year, month, 0).getDate()
|
||||||
|
let dates = {
|
||||||
|
lastMonthDays: this._getLastMonthDays(firstDay, this.getDate(dateData)), // 上个月末尾几天
|
||||||
|
currentMonthDys: this._currentMonthDys(currentDay, this.getDate(dateData)), // 本月天数
|
||||||
|
nextMonthDays: [], // 下个月开始几天
|
||||||
|
weeks: []
|
||||||
|
}
|
||||||
|
let canlender = []
|
||||||
|
const surplus = 42 - (dates.lastMonthDays.length + dates.currentMonthDys.length)
|
||||||
|
dates.nextMonthDays = this._getNextMonthDays(surplus, this.getDate(dateData))
|
||||||
|
canlender = canlender.concat(dates.lastMonthDays, dates.currentMonthDys, dates.nextMonthDays)
|
||||||
|
let weeks = {}
|
||||||
|
// 拼接数组 上个月开始几天 + 本月天数+ 下个月开始几天
|
||||||
|
for (let i = 0; i < canlender.length; i++) {
|
||||||
|
if (i % 7 === 0) {
|
||||||
|
weeks[parseInt(i / 7)] = new Array(7)
|
||||||
|
}
|
||||||
|
weeks[parseInt(i / 7)][i % 7] = canlender[i]
|
||||||
|
}
|
||||||
|
this.canlender = canlender
|
||||||
|
this.weeks = weeks
|
||||||
|
}
|
||||||
|
|
||||||
|
//静态方法
|
||||||
|
// static init(date) {
|
||||||
|
// if (!this.instance) {
|
||||||
|
// this.instance = new Calendar(date);
|
||||||
|
// }
|
||||||
|
// return this.instance;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export default Calendar
|
||||||
86
uni_modules/uni-calendar/package.json
Normal file
86
uni_modules/uni-calendar/package.json
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
{
|
||||||
|
"id": "uni-calendar",
|
||||||
|
"displayName": "uni-calendar 日历",
|
||||||
|
"version": "1.4.12",
|
||||||
|
"description": "日历组件",
|
||||||
|
"keywords": [
|
||||||
|
"uni-ui",
|
||||||
|
"uniui",
|
||||||
|
"日历",
|
||||||
|
"",
|
||||||
|
"打卡",
|
||||||
|
"日历选择"
|
||||||
|
],
|
||||||
|
"repository": "https://github.com/dcloudio/uni-ui",
|
||||||
|
"engines": {
|
||||||
|
"HBuilderX": ""
|
||||||
|
},
|
||||||
|
"directories": {
|
||||||
|
"example": "../../temps/example_temps"
|
||||||
|
},
|
||||||
|
"dcloudext": {
|
||||||
|
"sale": {
|
||||||
|
"regular": {
|
||||||
|
"price": "0.00"
|
||||||
|
},
|
||||||
|
"sourcecode": {
|
||||||
|
"price": "0.00"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"contact": {
|
||||||
|
"qq": ""
|
||||||
|
},
|
||||||
|
"declaration": {
|
||||||
|
"ads": "无",
|
||||||
|
"data": "无",
|
||||||
|
"permissions": "无"
|
||||||
|
},
|
||||||
|
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
|
||||||
|
"type": "component-vue"
|
||||||
|
},
|
||||||
|
"uni_modules": {
|
||||||
|
"dependencies": [],
|
||||||
|
"encrypt": [],
|
||||||
|
"platforms": {
|
||||||
|
"cloud": {
|
||||||
|
"tcb": "y",
|
||||||
|
"aliyun": "y",
|
||||||
|
"alipay": "n"
|
||||||
|
},
|
||||||
|
"client": {
|
||||||
|
"App": {
|
||||||
|
"app-vue": "y",
|
||||||
|
"app-nvue": "y"
|
||||||
|
},
|
||||||
|
"H5-mobile": {
|
||||||
|
"Safari": "y",
|
||||||
|
"Android Browser": "y",
|
||||||
|
"微信浏览器(Android)": "y",
|
||||||
|
"QQ浏览器(Android)": "y"
|
||||||
|
},
|
||||||
|
"H5-pc": {
|
||||||
|
"Chrome": "y",
|
||||||
|
"IE": "y",
|
||||||
|
"Edge": "y",
|
||||||
|
"Firefox": "y",
|
||||||
|
"Safari": "y"
|
||||||
|
},
|
||||||
|
"小程序": {
|
||||||
|
"微信": "y",
|
||||||
|
"阿里": "y",
|
||||||
|
"百度": "y",
|
||||||
|
"字节跳动": "y",
|
||||||
|
"QQ": "y"
|
||||||
|
},
|
||||||
|
"快应用": {
|
||||||
|
"华为": "u",
|
||||||
|
"联盟": "u"
|
||||||
|
},
|
||||||
|
"Vue": {
|
||||||
|
"vue2": "y",
|
||||||
|
"vue3": "y"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
103
uni_modules/uni-calendar/readme.md
Normal file
103
uni_modules/uni-calendar/readme.md
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
|
||||||
|
|
||||||
|
## Calendar 日历
|
||||||
|
> **组件名:uni-calendar**
|
||||||
|
> 代码块: `uCalendar`
|
||||||
|
|
||||||
|
|
||||||
|
日历组件
|
||||||
|
|
||||||
|
> **注意事项**
|
||||||
|
> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。
|
||||||
|
> - 本组件农历转换使用的js是 [@1900-2100区间内的公历、农历互转](https://github.com/jjonline/calendar.js)
|
||||||
|
> - 仅支持自定义组件模式
|
||||||
|
> - `date`属性传入的应该是一个 String ,如: 2019-06-27 ,而不是 new Date()
|
||||||
|
> - 通过 `insert` 属性来确定当前的事件是 @change 还是 @confirm 。理应合并为一个事件,但是为了区分模式,现使用两个事件,这里需要注意
|
||||||
|
> - 弹窗模式下无法阻止后面的元素滚动,如有需要阻止,请在弹窗弹出后,手动设置滚动元素为不可滚动
|
||||||
|
|
||||||
|
|
||||||
|
### 安装方式
|
||||||
|
|
||||||
|
本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
|
||||||
|
|
||||||
|
如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
|
||||||
|
|
||||||
|
### 基本用法
|
||||||
|
|
||||||
|
在 ``template`` 中使用组件
|
||||||
|
|
||||||
|
```html
|
||||||
|
<view>
|
||||||
|
<uni-calendar
|
||||||
|
:insert="true"
|
||||||
|
:lunar="true"
|
||||||
|
:start-date="'2019-3-2'"
|
||||||
|
:end-date="'2019-5-20'"
|
||||||
|
@change="change"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 通过方法打开日历
|
||||||
|
|
||||||
|
需要设置 `insert` 为 `false`
|
||||||
|
|
||||||
|
```html
|
||||||
|
<view>
|
||||||
|
<uni-calendar
|
||||||
|
ref="calendar"
|
||||||
|
:insert="false"
|
||||||
|
@confirm="confirm"
|
||||||
|
/>
|
||||||
|
<button @click="open">打开日历</button>
|
||||||
|
</view>
|
||||||
|
```
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open(){
|
||||||
|
this.$refs.calendar.open();
|
||||||
|
},
|
||||||
|
confirm(e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
### Calendar Props
|
||||||
|
|
||||||
|
| 属性名 | 类型 | 默认值| 说明 |
|
||||||
|
| - | - | - | - |
|
||||||
|
| date | String |- | 自定义当前时间,默认为今天 |
|
||||||
|
| lunar | Boolean | false | 显示农历 |
|
||||||
|
| startDate | String |- | 日期选择范围-开始日期 |
|
||||||
|
| endDate | String |- | 日期选择范围-结束日期 |
|
||||||
|
| range | Boolean | false | 范围选择 |
|
||||||
|
| insert | Boolean | false | 插入模式,可选值,ture:插入模式;false:弹窗模式;默认为插入模式 |
|
||||||
|
|clearDate |Boolean |true |弹窗模式是否清空上次选择内容 |
|
||||||
|
| selected | Array |- | 打点,期待格式[{date: '2019-06-27', info: '签到', data: { custom: '自定义信息', name: '自定义消息头',xxx:xxx... }}] |
|
||||||
|
|showMonth | Boolean | true | 是否显示月份为背景 |
|
||||||
|
|
||||||
|
### Calendar Events
|
||||||
|
|
||||||
|
| 事件名 | 说明 |返回值|
|
||||||
|
| - | - | - |
|
||||||
|
| open | 弹出日历组件,`insert :false` 时生效|- |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 组件示例
|
||||||
|
|
||||||
|
点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/calendar/calendar](https://hellouniapp.dcloud.net.cn/pages/extUI/calendar/calendar)
|
||||||
@ -29,9 +29,9 @@ export default {
|
|||||||
data.provinceCode = '530000' // 如果用户没有省份编码信息,则默认浙江省
|
data.provinceCode = '530000' // 如果用户没有省份编码信息,则默认浙江省
|
||||||
data.time = data.time || (new Date()).getTime()
|
data.time = data.time || (new Date()).getTime()
|
||||||
data = Object.assign(data, publicOptions);
|
data = Object.assign(data, publicOptions);
|
||||||
data.WeChat_AppId = 'wxa99ef047735c031e'
|
data.WeChat_AppId = 'wx6e28691bea93c6ec'
|
||||||
data.WeChat_MiniProToken = Store.state.userData.WeChat_MiniProToken || ''
|
data.WeChat_MiniProToken = Store.state.userData.WeChat_MiniProToken || ''
|
||||||
data.WeChatAppId = 'wxa99ef047735c031e'
|
data.WeChatAppId = 'wx6e28691bea93c6ec'
|
||||||
|
|
||||||
data.memberShipId = !data.memberShipId ? (Store.state.userData.Membership_Id || '') :
|
data.memberShipId = !data.memberShipId ? (Store.state.userData.Membership_Id || '') :
|
||||||
data.memberShipId // ||'3255' 1170386 1125717 //
|
data.memberShipId // ||'3255' 1170386 1125717 //
|
||||||
@ -60,7 +60,7 @@ export default {
|
|||||||
'ServerpartCodes': Store.state.userData.UserCityAuthority,
|
'ServerpartCodes': Store.state.userData.UserCityAuthority,
|
||||||
'ProvinceCode': '530000',
|
'ProvinceCode': '530000',
|
||||||
'ModuleGuid': ModuleGuid,
|
'ModuleGuid': ModuleGuid,
|
||||||
'WeChat_AppId': 'wxa99ef047735c031e',
|
'WeChat_AppId': 'wx6e28691bea93c6ec',
|
||||||
'memberShipId': !data.memberShipId ? (Store.state.userData.Membership_Id || '') : data.memberShipId,
|
'memberShipId': !data.memberShipId ? (Store.state.userData.Membership_Id || '') : data.memberShipId,
|
||||||
'SourcePlatform': 'minProgram'
|
'SourcePlatform': 'minProgram'
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ export default {
|
|||||||
'ServerpartCodes': Store.state.userData.UserCityAuthority,
|
'ServerpartCodes': Store.state.userData.UserCityAuthority,
|
||||||
'ProvinceCode': '530000',
|
'ProvinceCode': '530000',
|
||||||
'ModuleGuid': ModuleGuid,
|
'ModuleGuid': ModuleGuid,
|
||||||
'WeChat_AppId': 'wxa99ef047735c031e',
|
'WeChat_AppId': 'wx6e28691bea93c6ec',
|
||||||
'memberShipId': !data.memberShipId ? (Store.state.userData.Membership_Id || '') : data.memberShipId,
|
'memberShipId': !data.memberShipId ? (Store.state.userData.Membership_Id || '') : data.memberShipId,
|
||||||
'SourcePlatform': 'minProgram',
|
'SourcePlatform': 'minProgram',
|
||||||
"UserId": Store.state.userData.UserId,
|
"UserId": Store.state.userData.UserId,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user