mirror of
https://github.com/ThisIsBenny/iOS-Widgets.git
synced 2025-06-07 05:57:41 +00:00
show status
Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
This commit is contained in:
parent
1e262afc20
commit
ccd52633d5
1 changed files with 16 additions and 8 deletions
|
@ -1,7 +1,7 @@
|
||||||
// Variables used by Scriptable.
|
// Variables used by Scriptable.
|
||||||
// These must be at the very top of the file. Do not edit.
|
// These must be at the very top of the file. Do not edit.
|
||||||
// icon-color: deep-blue; icon-glyph: shopping-cart;
|
// icon-color: deep-blue; icon-glyph: shopping-cart;
|
||||||
// Version 1.0.5
|
// Version 1.0.6
|
||||||
|
|
||||||
const cacheMinutes = 60 * 2
|
const cacheMinutes = 60 * 2
|
||||||
const today = new Date()
|
const today = new Date()
|
||||||
|
@ -236,6 +236,7 @@ if (!orderDetails) {
|
||||||
|
|
||||||
const itemPosition = orderDetails['orderDetail']['orderItems']['c'][(widgetInput[2] - 1) || 0]
|
const itemPosition = orderDetails['orderDetail']['orderItems']['c'][(widgetInput[2] - 1) || 0]
|
||||||
const itemDetails = orderDetails['orderDetail']['orderItems'][itemPosition]['orderItemDetails']
|
const itemDetails = orderDetails['orderDetail']['orderItems'][itemPosition]['orderItemDetails']
|
||||||
|
const itemStatusTracker = orderDetails['orderDetail']['orderItems'][itemPosition]['orderItemStatusTracker']
|
||||||
const orderDate = parseLongDate(orderDetails['orderDetail']['orderHeader']['d']['orderPlacedDate'])
|
const orderDate = parseLongDate(orderDetails['orderDetail']['orderHeader']['d']['orderPlacedDate'])
|
||||||
let deliveryDate = null
|
let deliveryDate = null
|
||||||
try {
|
try {
|
||||||
|
@ -257,13 +258,13 @@ if (!orderDetails) {
|
||||||
headlineText.textColor = Color.black()
|
headlineText.textColor = Color.black()
|
||||||
headlineText.centerAlignText()
|
headlineText.centerAlignText()
|
||||||
|
|
||||||
widget.addSpacer()
|
widget.addSpacer(5)
|
||||||
|
|
||||||
const productStack = widget.addStack()
|
const productStack = widget.addStack()
|
||||||
productStack.layoutHorizontally()
|
productStack.layoutHorizontally()
|
||||||
|
|
||||||
itemImageElement = productStack.addImage(itemImage)
|
itemImageElement = productStack.addImage(itemImage)
|
||||||
itemImageElement.imageSize = new Size(35, 35)
|
itemImageElement.imageSize = new Size(30, 30)
|
||||||
itemImageElement.applyFillingContentMode()
|
itemImageElement.applyFillingContentMode()
|
||||||
|
|
||||||
productStack.addSpacer(20)
|
productStack.addSpacer(20)
|
||||||
|
@ -286,9 +287,10 @@ if (!orderDetails) {
|
||||||
let postFix = (remainingDays === 1) ? t[0] : t[1]
|
let postFix = (remainingDays === 1) ? t[0] : t[1]
|
||||||
|
|
||||||
const remainingDayText = widget.addText(remainingDays + ' ' + postFix)
|
const remainingDayText = widget.addText(remainingDays + ' ' + postFix)
|
||||||
remainingDayText.font = Font.regularSystemFont(28)
|
remainingDayText.font = Font.regularSystemFont(26)
|
||||||
remainingDayText.textColor = Color.black()
|
remainingDayText.textColor = Color.black()
|
||||||
remainingDayText.centerAlignText()
|
remainingDayText.centerAlignText()
|
||||||
|
remainingDayText.minimumScaleFactor = 0.5
|
||||||
|
|
||||||
widget.addSpacer()
|
widget.addSpacer()
|
||||||
|
|
||||||
|
@ -297,23 +299,29 @@ if (!orderDetails) {
|
||||||
|
|
||||||
const progressStack = widget.addStack()
|
const progressStack = widget.addStack()
|
||||||
progressStack.layoutVertically()
|
progressStack.layoutVertically()
|
||||||
progressStack.addImage(creatProgress(total, daysGone))
|
progressStack.spacing = 3
|
||||||
|
|
||||||
progressStack.spacing = 2
|
if (itemStatusTracker['d']['currentStatus']) {
|
||||||
|
const statusText = progressStack.addText(`STATUS: ${itemStatusTracker['d']['currentStatus']}`)
|
||||||
|
statusText.textColor = Color.black()
|
||||||
|
statusText.font = Font.regularSystemFont(8)
|
||||||
|
}
|
||||||
|
|
||||||
|
progressStack.addImage(creatProgress(total, daysGone))
|
||||||
|
|
||||||
const footerStack = progressStack.addStack()
|
const footerStack = progressStack.addStack()
|
||||||
footerStack.layoutHorizontally()
|
footerStack.layoutHorizontally()
|
||||||
|
|
||||||
const orderDateText = footerStack.addText(orderDate.toLocaleDateString())
|
const orderDateText = footerStack.addText(orderDate.toLocaleDateString())
|
||||||
orderDateText.textColor = Color.black()
|
orderDateText.textColor = Color.black()
|
||||||
orderDateText.font = Font.regularSystemFont(10)
|
orderDateText.font = Font.regularSystemFont(8)
|
||||||
orderDateText.lineLimit = 1
|
orderDateText.lineLimit = 1
|
||||||
|
|
||||||
footerStack.addSpacer()
|
footerStack.addSpacer()
|
||||||
|
|
||||||
const deliveryDateText = footerStack.addText(deliveryDate.toLocaleDateString())
|
const deliveryDateText = footerStack.addText(deliveryDate.toLocaleDateString())
|
||||||
deliveryDateText.textColor = Color.black()
|
deliveryDateText.textColor = Color.black()
|
||||||
deliveryDateText.font = Font.regularSystemFont(10)
|
deliveryDateText.font = Font.regularSystemFont(8)
|
||||||
deliveryDateText.lineLimit = 1
|
deliveryDateText.lineLimit = 1
|
||||||
} else {
|
} else {
|
||||||
widget.addSpacer()
|
widget.addSpacer()
|
||||||
|
|
Loading…
Add table
Reference in a new issue