|
|
@@ -671,7 +671,7 @@
|
|
|
* 进入页仅用 querySecondGoodsDetailWithOutJWT 判断商品是否存在(不用其 data 渲染页面):
|
|
|
* POST {API_BASE_SECOND}/recommend/querySecondGoodsDetailWithOutJWT
|
|
|
* body:goodsId、longitude、latitude、phoneId
|
|
|
- * 不存在/已下架/删除 → shareUndefined;存在 → applyFromUrl(分享链参数)+ 留言列表
|
|
|
+ * 不存在/已下架/删除或 msg=暂无承载数据 → shareUndefined;存在 → applyFromUrl + 留言
|
|
|
*/
|
|
|
/**
|
|
|
* 唤起 App 落地:二手商品详情(与 pages.json 路径一致)
|
|
|
@@ -1444,9 +1444,17 @@
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ /** 与店铺 getClientStoreDetail 一致:无商品时 code 仍可能为 200 */
|
|
|
+ function isNoCarryingDataMsg(res) {
|
|
|
+ if (!res || typeof res !== 'object') return false;
|
|
|
+ var msg = res.msg != null ? String(res.msg).trim() : '';
|
|
|
+ return msg === '暂无承载数据';
|
|
|
+ }
|
|
|
+
|
|
|
function isMsgIndicateGoodsGone(msg) {
|
|
|
msg = String(msg || '').trim();
|
|
|
if (!msg) return false;
|
|
|
+ if (msg === '暂无承载数据') return true;
|
|
|
return /已删除|已下架|已卖出|商品不存在|不存在该|查无此商品|找不到该商品|商品不可用/.test(
|
|
|
msg
|
|
|
);
|
|
|
@@ -1827,11 +1835,14 @@
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 存在性接口只判断「有没有商品数据」,不用 goodsStatus(在售也可能是 2)。
|
|
|
- * 仅 deleteFlag/明确删除文案/无 data 且接口失败 时视为不可用。
|
|
|
+ * 存在性接口:msg 为「暂无承载数据」即无商品(即使 code=200);
|
|
|
+ * 有有效 data 再看 deleteFlag;不用 goodsStatus 数值。
|
|
|
*/
|
|
|
function isDetailResponseGoodsUnavailable(res) {
|
|
|
if (!res || typeof res !== 'object') return true;
|
|
|
+ if (isNoCarryingDataMsg(res)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
var d = pickSecondGoodsDetailData(res);
|
|
|
if (hasSecondGoodsDetailPayload(d)) {
|
|
|
return isDetailDataExplicitlyDeleted(d);
|
|
|
@@ -1932,8 +1943,13 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ /** 分享卡片常用 sourceId;与留言 sourceId 一致 */
|
|
|
+ function getShareGoodsId() {
|
|
|
+ return (q('goodsId') || q('id') || q('sourceId') || '').trim();
|
|
|
+ }
|
|
|
+
|
|
|
function run() {
|
|
|
- var goodsId = (q('goodsId') || q('id') || '').trim();
|
|
|
+ var goodsId = getShareGoodsId();
|
|
|
var userId = (q('userId') || '').trim();
|
|
|
var phoneId = (q('phoneId') || q('phone_id') || '').trim();
|
|
|
var lon = (q('longitude') || q('lon') || q('jingdu') || '').trim();
|