bug修复,及体验优化

This commit is contained in:
Dev
2026-10-09 16:59:09 +08:00
parent a35f78e03b
commit 8a9102ab47
11 changed files with 93 additions and 10 deletions
@@ -104,6 +104,17 @@ var isDelivered = function (demandInfo) {
!!getDelivery(demandInfo);
}
// 是否开发者视角(决定按钮区渲染开发者操作还是需求方操作)
// 列表页会带 opType(quote=开发者视角,view=需求方视角);
// 站内消息等入口跳转不带 opType,此时按身份判断:需求发布者为需求方视角,其余为开发者视角
var isDevView = function (demandInfo, opType) {
if (opType === 'view') return false;
if (opType === 'quote') return true;
// 数据未加载前先不渲染按钮,避免短暂闪成错误视角
if (!demandInfo) return false;
return !demandInfo.isMy;
}
// 数值拼接单位,空值时不显示单位
var withUnit = function (value, unit) {
if (value === undefined || value === null || value === '') {
@@ -125,5 +136,6 @@ module.exports = {
getDelivery: getDelivery,
canDeliverGoods: canDeliverGoods,
isDelivered: isDelivered,
isDevView: isDevView,
withUnit: withUnit,
};