功能:同步小程序流程
This commit is contained in:
@@ -1,11 +1,23 @@
|
||||
/**
|
||||
* Purpose: formatPrice supports format.js by holding or executing the format price page or API role.
|
||||
* Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
function formatPrice(value) {
|
||||
return Number(value || 0).toFixed(2)
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: getProductTitle supports format.js by holding or executing the get product title page or API role.
|
||||
* Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
function getProductTitle(product) {
|
||||
return (product && (product.title || product.name)) || '未命名作品'
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: splitCsv supports format.js by holding or executing the split csv page or API role.
|
||||
* Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
function splitCsv(value) {
|
||||
return String(value || '')
|
||||
.split(',')
|
||||
@@ -13,10 +25,18 @@ function splitCsv(value) {
|
||||
.filter(Boolean)
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: sameId supports format.js by holding or executing the same id page or API role.
|
||||
* Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
function sameId(left, right) {
|
||||
return String(left || '') === String(right || '')
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: formatDateTime supports format.js by holding or executing the format date time page or API role.
|
||||
* Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
function formatDateTime(value) {
|
||||
if (!value) {
|
||||
return ''
|
||||
@@ -24,6 +44,10 @@ function formatDateTime(value) {
|
||||
return String(value).replace('T', ' ').slice(0, 16)
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: parseAppointmentParts supports format.js by holding or executing the parse appointment parts page or API role.
|
||||
* Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
function parseAppointmentParts(value) {
|
||||
const text = formatDateTime(value)
|
||||
if (!text) {
|
||||
@@ -40,6 +64,10 @@ function parseAppointmentParts(value) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: buildAppointmentValue supports format.js by holding or executing the build appointment value page or API role.
|
||||
* Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
function buildAppointmentValue(date, clock) {
|
||||
if (!date || !clock) {
|
||||
return ''
|
||||
@@ -47,6 +75,10 @@ function buildAppointmentValue(date, clock) {
|
||||
return `${date} ${clock}:00`
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: isPastAppointment supports format.js by holding or executing the is past appointment page or API role.
|
||||
* Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
function isPastAppointment(value) {
|
||||
if (!value) {
|
||||
return false
|
||||
@@ -54,6 +86,10 @@ function isPastAppointment(value) {
|
||||
return new Date(String(value).replace(' ', 'T')).getTime() < Date.now() + 5 * 60 * 1000
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: getMinDateText supports format.js by holding or executing the get min date text page or API role.
|
||||
* Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
function getMinDateText() {
|
||||
const now = new Date()
|
||||
const year = now.getFullYear()
|
||||
@@ -62,6 +98,10 @@ function getMinDateText() {
|
||||
return `${year}-${month}-${date}`
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: getOrderStatusText supports format.js by holding or executing the get order status text page or API role.
|
||||
* Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
function getOrderStatusText(order) {
|
||||
if (order && order.statusText) {
|
||||
return order.statusText
|
||||
@@ -77,6 +117,10 @@ function getOrderStatusText(order) {
|
||||
return '已取消'
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: getOrderStatusClass supports format.js by holding or executing the get order status class page or API role.
|
||||
* Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
function getOrderStatusClass(order) {
|
||||
const status = Number(order && order.status)
|
||||
if (status === 1) {
|
||||
|
||||
Reference in New Issue
Block a user