|
@@ -26,7 +26,7 @@ export class appPush{
|
|
//弹窗容器宽度
|
|
//弹窗容器宽度
|
|
this.popupViewWidth = this.propotation * 710;
|
|
this.popupViewWidth = this.propotation * 710;
|
|
// 弹窗容器高度
|
|
// 弹窗容器高度
|
|
- this.popupViewHeight = this.propotation * 192;
|
|
|
|
|
|
+ this.popupViewHeight = this.propotation * 152;
|
|
// 弹窗容器的Padding
|
|
// 弹窗容器的Padding
|
|
this.viewContentPadding = this.propotation * 30;
|
|
this.viewContentPadding = this.propotation * 30;
|
|
// 弹框容器的宽度
|
|
// 弹框容器的宽度
|
|
@@ -36,7 +36,7 @@ export class appPush{
|
|
// 过度时间
|
|
// 过度时间
|
|
this.duration = 200
|
|
this.duration = 200
|
|
// 关闭时间
|
|
// 关闭时间
|
|
- this.closeTime = 5000
|
|
|
|
|
|
+ this.closeTime = 10000
|
|
|
|
|
|
console.log(this.inApp, this.voice, this.vibration)
|
|
console.log(this.inApp, this.voice, this.vibration)
|
|
|
|
|
|
@@ -69,67 +69,67 @@ export class appPush{
|
|
})
|
|
})
|
|
// 绘制白色背景
|
|
// 绘制白色背景
|
|
view.drawRect({
|
|
view.drawRect({
|
|
- color:"#fff",
|
|
|
|
|
|
+ color:"#626262",
|
|
radius:"10px"
|
|
radius:"10px"
|
|
})
|
|
})
|
|
let viewContentList = [
|
|
let viewContentList = [
|
|
- {
|
|
|
|
- src: '/static/push/message-icon.png',
|
|
|
|
- id: 'icon',
|
|
|
|
- tag: 'img',
|
|
|
|
- position: {
|
|
|
|
- top: this.viewContentPadding + "px",
|
|
|
|
- left: this.viewContentPadding + "px",
|
|
|
|
- width: (this.propotation * 24) + 'px',
|
|
|
|
- height: (this.propotation * 24) + 'px',
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- tag: 'font',
|
|
|
|
- id: 'pop-title',
|
|
|
|
- text: this.messageType,
|
|
|
|
- textStyles: {
|
|
|
|
- size: (this.propotation * 24) + 'px',
|
|
|
|
- align: "left",
|
|
|
|
- color: "#4F555B"
|
|
|
|
- },
|
|
|
|
- position: {
|
|
|
|
- top: this.viewContentPadding + "px",
|
|
|
|
- left: (this.propotation * 64) + 'px',
|
|
|
|
- height: (this.propotation * 24) + 'px',
|
|
|
|
- width: this.viewContentWidth + "px",
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- tag: 'font',
|
|
|
|
- id: 'time',
|
|
|
|
- text: this.messageTime,
|
|
|
|
- textStyles: {
|
|
|
|
- size: (this.propotation * 24) + 'px',
|
|
|
|
- align: "right",
|
|
|
|
- color: "#4F555B"
|
|
|
|
- },
|
|
|
|
- position: {
|
|
|
|
- top: this.viewContentPadding + "px",
|
|
|
|
- left: this.viewContentPadding + "px",
|
|
|
|
- height: (this.propotation * 24) + 'px',
|
|
|
|
- width: this.viewContentWidth + "px",
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
|
|
+ // {
|
|
|
|
+ // src: '/static/push/message-icon.png',
|
|
|
|
+ // id: 'icon',
|
|
|
|
+ // tag: 'img',
|
|
|
|
+ // position: {
|
|
|
|
+ // top: this.viewContentPadding + "px",
|
|
|
|
+ // left: this.viewContentPadding + "px",
|
|
|
|
+ // width: (this.propotation * 24) + 'px',
|
|
|
|
+ // height: (this.propotation * 24) + 'px',
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // tag: 'font',
|
|
|
|
+ // id: 'pop-title',
|
|
|
|
+ // text: this.messageType,
|
|
|
|
+ // textStyles: {
|
|
|
|
+ // size: (this.propotation * 24) + 'px',
|
|
|
|
+ // align: "left",
|
|
|
|
+ // color: "#4F555B"
|
|
|
|
+ // },
|
|
|
|
+ // position: {
|
|
|
|
+ // top: this.viewContentPadding + "px",
|
|
|
|
+ // left: (this.propotation * 64) + 'px',
|
|
|
|
+ // height: (this.propotation * 24) + 'px',
|
|
|
|
+ // width: this.viewContentWidth + "px",
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // tag: 'font',
|
|
|
|
+ // id: 'time',
|
|
|
|
+ // text: this.messageTime,
|
|
|
|
+ // textStyles: {
|
|
|
|
+ // size: (this.propotation * 24) + 'px',
|
|
|
|
+ // align: "right",
|
|
|
|
+ // color: "#4F555B"
|
|
|
|
+ // },
|
|
|
|
+ // position: {
|
|
|
|
+ // top: this.viewContentPadding + "px",
|
|
|
|
+ // left: this.viewContentPadding + "px",
|
|
|
|
+ // height: (this.propotation * 24) + 'px',
|
|
|
|
+ // width: this.viewContentWidth + "px",
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
{
|
|
{
|
|
tag: 'font',
|
|
tag: 'font',
|
|
id: 'push-title',
|
|
id: 'push-title',
|
|
text: this.messageTitle,
|
|
text: this.messageTitle,
|
|
textStyles: {
|
|
textStyles: {
|
|
- size: (this.propotation * 30) + 'px',
|
|
|
|
|
|
+ size: (this.propotation * 35) + 'px',
|
|
align: "left",
|
|
align: "left",
|
|
- color: "#202123",
|
|
|
|
|
|
+ color: "#f7f7f7",
|
|
overflow: "ellipsis"
|
|
overflow: "ellipsis"
|
|
},
|
|
},
|
|
position: {
|
|
position: {
|
|
- top: (this.propotation * 82) + 'px',
|
|
|
|
|
|
+ top: this.viewContentPadding + 'px',
|
|
left: (this.propotation * 30) + 'px',
|
|
left: (this.propotation * 30) + 'px',
|
|
- height: (this.propotation * 30) + 'px',
|
|
|
|
|
|
+ height: (this.propotation * 35) + 'px',
|
|
width: (this.propotation * 505) + 'px',
|
|
width: (this.propotation * 505) + 'px',
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -138,42 +138,42 @@ export class appPush{
|
|
id: 'push-content',
|
|
id: 'push-content',
|
|
text: this.messageContent,
|
|
text: this.messageContent,
|
|
textStyles: {
|
|
textStyles: {
|
|
- size: (this.propotation * 24) + 'px',
|
|
|
|
|
|
+ size: (this.propotation * 28) + 'px',
|
|
align: "left",
|
|
align: "left",
|
|
- color: "#4F555B",
|
|
|
|
|
|
+ color: "#f7f7f7",
|
|
overflow: "ellipsis"
|
|
overflow: "ellipsis"
|
|
},
|
|
},
|
|
position: {
|
|
position: {
|
|
- top: (this.propotation * 130) + 'px',
|
|
|
|
|
|
+ top: (this.propotation * 90) + 'px',
|
|
left: (this.propotation * 30) + 'px',
|
|
left: (this.propotation * 30) + 'px',
|
|
- height: (this.propotation * 24) + 'px',
|
|
|
|
- width: (this.propotation * 505) + 'px',
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- src: this.messageImage,
|
|
|
|
- id: 'image',
|
|
|
|
- tag: 'img',
|
|
|
|
- position: {
|
|
|
|
- top: (this.propotation * 68) + 'px',
|
|
|
|
- // right: "0px",
|
|
|
|
- left: (this.propotation * 586) + 'px',
|
|
|
|
- width: (this.propotation * 100) + 'px',
|
|
|
|
- height: (this.propotation * 100) + 'px',
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- src: '/static/push/img-bg.png',
|
|
|
|
- id: 'img-bg',
|
|
|
|
- tag: 'img',
|
|
|
|
- position: {
|
|
|
|
- top: (this.propotation * 68) + 'px',
|
|
|
|
- // right: "0px",
|
|
|
|
- left: (this.propotation * 586) + 'px',
|
|
|
|
- width: (this.propotation * 100) + 'px',
|
|
|
|
- height: (this.propotation * 100) + 'px',
|
|
|
|
|
|
+ height: (this.propotation * 28) + 'px',
|
|
|
|
+ width: (this.propotation * 655) + 'px',
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // {
|
|
|
|
+ // src: this.messageImage,
|
|
|
|
+ // id: 'image',
|
|
|
|
+ // tag: 'img',
|
|
|
|
+ // position: {
|
|
|
|
+ // top: (this.propotation * 68) + 'px',
|
|
|
|
+ // // right: "0px",
|
|
|
|
+ // left: (this.propotation * 586) + 'px',
|
|
|
|
+ // width: (this.propotation * 100) + 'px',
|
|
|
|
+ // height: (this.propotation * 100) + 'px',
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // src: '/static/push/img-bg.png',
|
|
|
|
+ // id: 'img-bg',
|
|
|
|
+ // tag: 'img',
|
|
|
|
+ // position: {
|
|
|
|
+ // top: (this.propotation * 68) + 'px',
|
|
|
|
+ // // right: "0px",
|
|
|
|
+ // left: (this.propotation * 586) + 'px',
|
|
|
|
+ // width: (this.propotation * 100) + 'px',
|
|
|
|
+ // height: (this.propotation * 100) + 'px',
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
]
|
|
]
|
|
view.draw(viewContentList)
|
|
view.draw(viewContentList)
|
|
// view.addEventListener("click",(e)=>{
|
|
// view.addEventListener("click",(e)=>{
|