feat: 签约提示/赠送次数/自动划付提醒,自营支付成功弹窗,隐藏微信登录
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+65
-42
@@ -1,48 +1,71 @@
|
||||
'use strict';
|
||||
|
||||
function formatZhDateTime(vk, timestamp, fallbackText) {
|
||||
if (fallbackText) {
|
||||
const matched = String(fallbackText).match(/^(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2})/);
|
||||
if (matched) {
|
||||
return `${matched[1]}年${matched[2]}月${matched[3]}日${matched[4]}:${matched[5]}`;
|
||||
}
|
||||
}
|
||||
const date = new Date(Number(timestamp) || Date.now());
|
||||
return vk.pubfn.timeFormat(date, 'yyyy年MM月dd日hh:mm');
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* 查询当前买家 24 小时内即将自动划付的公证付款申请。
|
||||
*/
|
||||
main: async (event) => {
|
||||
const {data = {}, util} = event;
|
||||
const {uid} = data;
|
||||
const {vk, _} = util;
|
||||
const now = Date.now();
|
||||
const deadline = now + 24 * 60 * 60 * 1000;
|
||||
/**
|
||||
* 查询当前买家 24 小时内即将自动划付的公证付款申请。
|
||||
* @url client/order/kh/getExpiringNotaryPayList
|
||||
*/
|
||||
main: async (event) => {
|
||||
const { data = {}, util } = event;
|
||||
const { uid } = data;
|
||||
const { vk, _ } = util;
|
||||
const now = Date.now();
|
||||
const deadline = now + 24 * 60 * 60 * 1000;
|
||||
|
||||
const result = await vk.baseDao.select({
|
||||
dbName: 'jjx-order-pay-list',
|
||||
whereJson: _.and([
|
||||
{
|
||||
buyerUid: uid,
|
||||
isNotaryPay: true,
|
||||
isNotaryApply: true,
|
||||
hasPaid: true,
|
||||
buyerRefuse: false,
|
||||
sellerConfirm: false,
|
||||
},
|
||||
{autoTransferTimestamp: _.gte(now)},
|
||||
{autoTransferTimestamp: _.lte(deadline)},
|
||||
]),
|
||||
sortArr: [{name: 'autoTransferTimestamp', type: 'asc'}],
|
||||
pageIndex: 1,
|
||||
pageSize: 20,
|
||||
});
|
||||
const result = await vk.baseDao.select({
|
||||
dbName: 'jjx-order-pay-list',
|
||||
whereJson: _.and([
|
||||
{
|
||||
buyerUid: uid,
|
||||
isNotaryPay: true,
|
||||
isNotaryApply: true,
|
||||
hasPaid: true,
|
||||
buyerRefuse: false,
|
||||
sellerConfirm: false,
|
||||
},
|
||||
{ autoTransferTimestamp: _.gte(now) },
|
||||
{ autoTransferTimestamp: _.lte(deadline) },
|
||||
]),
|
||||
sortArr: [{ name: 'autoTransferTimestamp', type: 'asc' }],
|
||||
pageIndex: 1,
|
||||
pageSize: 20,
|
||||
});
|
||||
|
||||
return {
|
||||
code: 0,
|
||||
msg: '',
|
||||
data: {
|
||||
count: (result.rows || []).length,
|
||||
rows: (result.rows || []).map(item => ({
|
||||
orderId: item.orderId,
|
||||
type: item.type,
|
||||
amount: item.amount,
|
||||
autoTransferAt: item.autoTransferAt,
|
||||
autoTransferTimestamp: item.autoTransferTimestamp,
|
||||
})),
|
||||
},
|
||||
};
|
||||
},
|
||||
const rows = (result.rows || []).map(item => ({
|
||||
orderId: item.orderId,
|
||||
type: item.type,
|
||||
amount: item.amount,
|
||||
autoTransferAt: item.autoTransferAt,
|
||||
autoTransferTimestamp: item.autoTransferTimestamp,
|
||||
autoTransferAtText: formatZhDateTime(vk, item.autoTransferTimestamp, item.autoTransferAt),
|
||||
}));
|
||||
|
||||
const nearest = rows[0] || null;
|
||||
const autoConfirmTimeText = nearest ? nearest.autoTransferAtText : '';
|
||||
const content = autoConfirmTimeText
|
||||
? `重要提示:您在金久信公正交易项下待确认业务的系统自动确认时间为${autoConfirmTimeText},该期限即将届满;若到期未完成相关处理,系统将依据本平台交易规则自动确认收货或处理申请金额,请您及时登录平台完成对应操作,避免产生利益损失。若您已完成相关处理,可忽略本提示,如有疑问请联系客服咨询。`
|
||||
: '';
|
||||
|
||||
return {
|
||||
code: 0,
|
||||
msg: '',
|
||||
data: {
|
||||
count: rows.length,
|
||||
rows,
|
||||
autoConfirmTimeText,
|
||||
content,
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user