From 9a30b0efded7987cd7c05b6fd015de54018accd5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A4=A7=E5=96=B5=E5=92=AA?= <15233722133@163.com>
Date: Wed, 12 Aug 2026 13:15:50 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=82=AC=E4=B8=80?=
=?UTF-8?q?=E5=82=AC=E6=8C=89=E9=92=AE=E3=80=81=E5=BA=94=E7=94=A8=E5=AE=9D?=
=?UTF-8?q?=E8=B7=B3=E8=BD=AC=E9=85=8D=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 256 ++++++++++++++++++++-
components/card_orderBan/card_orderBan.vue | 63 ++++-
components/orderItem/AiOrderActionBar.vue | 87 ++++++-
components/orderItem/orderItem.vue | 14 ++
manifest.json | 7 +-
pages/order/detail.vue | 114 ++++++++-
pages/order/pickUpVerify.vue | 210 ++++++++++++++---
pages/order/stockProgress.vue | 9 +-
pages/user/goods_details_store/index.vue | 25 +-
sheep/api/trade/orderStore.js | 13 ++
10 files changed, 744 insertions(+), 54 deletions(-)
diff --git a/App.vue b/App.vue
index a4101a7..2461fae 100644
--- a/App.vue
+++ b/App.vue
@@ -15,6 +15,214 @@
import {
ShoproInit
} from './sheep';
+
+ const SCHEME_TAG = '[Scheme]';
+ const HOME_PATH = '/pages/index/index';
+ const SCHEME_PROTOCOL = 'yougou://';
+
+ const schemeState = {
+ lastScheme: '',
+ lastHandleAt: 0,
+ launching: false,
+ schemeHandledInLaunch: false,
+ };
+
+ const isSameSchemeDebounce = (scheme) => {
+ const now = Date.now();
+ const same = schemeState.lastScheme === scheme && now - schemeState.lastHandleAt < 800;
+ schemeState.lastScheme = scheme;
+ schemeState.lastHandleAt = now;
+ return same;
+ };
+
+ const parseSchemeQuery = (query = {}) => {
+ try {
+ const result = {};
+ Object.keys(query || {}).forEach((k) => {
+ const v = query[k];
+ if (v === undefined || v === null) return;
+ if (typeof v === 'string' && v.length > 512) {
+ result[k] = v.slice(0, 512);
+ return;
+ }
+ result[k] = v;
+ });
+ return result;
+ } catch (e) {
+ console.warn(SCHEME_TAG, 'parseSchemeQuery error', e);
+ return {};
+ }
+ };
+
+ const resolveTargetPath = (scheme = '', query = {}) => {
+ try {
+ const url = String(scheme || '').trim();
+ if (!url) return { path: HOME_PATH, query: parseSchemeQuery(query) };
+ const withoutProtocol = url.replace(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//, '');
+ if (!withoutProtocol) return { path: HOME_PATH, query: parseSchemeQuery(query) };
+ const [pathRaw = '', queryRaw = ''] = withoutProtocol.split('?');
+ const cleanPath = pathRaw.replace(/^\/+/, '/').trim();
+ const path = cleanPath.startsWith('/pages/') ? cleanPath : HOME_PATH;
+ const merged = { ...parseSchemeQuery(query) };
+ if (queryRaw) {
+ queryRaw.split('&').forEach((pair) => {
+ const [k, v] = pair.split('=');
+ if (!k) return;
+ try { merged[decodeURIComponent(k)] = v === undefined ? '' : decodeURIComponent(v); } catch (_) {}
+ });
+ }
+ return { path, query: merged };
+ } catch (e) {
+ console.warn(SCHEME_TAG, 'resolveTargetPath error, fallback to home', e);
+ return { path: HOME_PATH, query: parseSchemeQuery(query) };
+ }
+ };
+
+ const buildUrl = (path, query) => {
+ try {
+ const q = query || {};
+ const keys = Object.keys(q).filter((k) => q[k] !== undefined && q[k] !== null && q[k] !== '');
+ if (!keys.length) return path;
+ const qs = keys
+ .map((k) => `${encodeURIComponent(k)}=${encodeURIComponent(String(q[k]))}`)
+ .join('&');
+ return `${path}${path.includes('?') ? '&' : '?'}${qs}`;
+ } catch (e) {
+ return path;
+ }
+ };
+
+ const safeReLaunch = (path, query, source) => {
+ const finalUrl = buildUrl(path, query);
+ console.log(SCHEME_TAG, `${source} → reLaunch`, finalUrl);
+ try {
+ uni.reLaunch({
+ url: finalUrl,
+ fail: (err) => {
+ console.warn(SCHEME_TAG, 'reLaunch fail, fallback to switchTab/home', err);
+ if (path === HOME_PATH) {
+ try {
+ uni.switchTab({
+ url: HOME_PATH,
+ fail: (err2) => {
+ console.warn(SCHEME_TAG, 'switchTab also fail', err2);
+ uni.navigateTo({ url: HOME_PATH, fail: () => {} });
+ },
+ });
+ } catch (e) {
+ console.warn(SCHEME_TAG, 'switchTab catch', e);
+ }
+ } else {
+ uni.navigateTo({ url: finalUrl, fail: () => uni.reLaunch({ url: HOME_PATH }) });
+ }
+ },
+ });
+ } catch (e) {
+ console.error(SCHEME_TAG, 'safeReLaunch catch error', e);
+ try { uni.reLaunch({ url: HOME_PATH }); } catch (_) {}
+ }
+ };
+
+ const isSchemeTrigger = (options) => {
+ if (!options) return false;
+ if (String(options?.path || '').toLowerCase() === 'scheme') return true;
+ const scheme = String(options?.scheme || options?.argv?.scheme || '');
+ if (scheme.startsWith(SCHEME_PROTOCOL)) return true;
+ const referrer = String(options?.referrer || '');
+ if (referrer.startsWith(SCHEME_PROTOCOL)) return true;
+ return false;
+ };
+
+ const handleSchemeByOptions = (options, source) => {
+ const scheme = String(options?.scheme || options?.argv?.scheme || options?.referrer || '');
+ if (isSameSchemeDebounce(scheme)) {
+ console.log(SCHEME_TAG, `${source} 防抖跳过`, scheme);
+ return;
+ }
+ console.log(SCHEME_TAG, `${source} 触发`, options);
+ const query = { ...(options?.query || {}), ...(options?.argv?.query || {}) };
+ const { path, query: resolvedQuery } = resolveTargetPath(scheme, query);
+ safeReLaunch(path, resolvedQuery, source);
+ };
+
+ let schemeEventListenerRegistered = false;
+ const registerSchemeEventListener = () => {
+ if (schemeEventListenerRegistered) return;
+ if (typeof plus === 'undefined' || !plus?.globalEvent) return;
+ try {
+ plus.globalEvent.addEventListener('newintent', (e) => {
+ const intent = e?.intent || e;
+ let scheme = '';
+ let query = {};
+ try {
+ if (typeof plus?.runtime?.arguments === 'function' || typeof plus?.runtime?.arguments !== 'undefined') {
+ const args = plus.runtime.arguments;
+ if (args && typeof args === 'object') {
+ scheme = String(args.scheme || args.url || args.action || '');
+ query = args.query || {};
+ } else if (typeof args === 'string') {
+ scheme = args;
+ }
+ }
+ if (!scheme && intent?.data) {
+ const data = String(intent.data || '');
+ scheme = data;
+ const i = data.indexOf('?');
+ if (i > -1) {
+ data.slice(i + 1).split('&').forEach((pair) => {
+ const [k, v] = pair.split('=');
+ if (!k) return;
+ try { query[decodeURIComponent(k)] = v === undefined ? '' : decodeURIComponent(v); } catch (_) {}
+ });
+ }
+ }
+ if (!scheme && intent?.extras) {
+ scheme = String(intent.extras.scheme || intent.extras.url || intent.extras['android.intent.extra.TEXT'] || '');
+ }
+ } catch (err) {
+ console.warn(SCHEME_TAG, 'newintent parse error', err);
+ }
+ if (!scheme) return;
+ if (isSameSchemeDebounce(scheme)) {
+ console.log(SCHEME_TAG, 'newintent 防抖跳过', scheme);
+ return;
+ }
+ console.log(SCHEME_TAG, 'newintent(plus.globalEvent) 触发', { scheme, query, intent });
+ const { path, query: resolvedQuery } = resolveTargetPath(scheme, query);
+ safeReLaunch(path, resolvedQuery, 'newintent后台唤起');
+ });
+ schemeEventListenerRegistered = true;
+ console.log(SCHEME_TAG, 'plus.globalEvent newintent 监听已注册');
+ } catch (e) {
+ console.warn(SCHEME_TAG, 'registerSchemeEventListener catch', e);
+ }
+ };
+
+ const registerSchemeRuntimeArguments = () => {
+ if (typeof plus === 'undefined' || !plus?.runtime) return;
+ try {
+ const args = plus.runtime.arguments;
+ let scheme = '';
+ let query = {};
+ if (args && typeof args === 'object') {
+ scheme = String(args.scheme || args.url || '');
+ query = args.query || {};
+ } else if (typeof args === 'string' && args) {
+ scheme = args;
+ }
+ if (!scheme) return;
+ if (isSameSchemeDebounce(scheme)) {
+ console.log(SCHEME_TAG, 'runtime.arguments 防抖跳过', scheme);
+ return;
+ }
+ console.log(SCHEME_TAG, 'plus.runtime.arguments 读取', { scheme, query });
+ const { path, query: resolvedQuery } = resolveTargetPath(scheme, query);
+ safeReLaunch(path, resolvedQuery, 'plus.runtime.arguments冷启动');
+ } catch (e) {
+ console.warn(SCHEME_TAG, 'registerSchemeRuntimeArguments catch', e);
+ }
+ };
+
let globalData = ref({
statusBarHeight: 0, // 状态导航栏高度
navHeight: 0, // 总体高度
@@ -194,7 +402,7 @@
ensureGlobalHotUpdateChecked();
// socket()
});
- onLaunch(() => {
+ onLaunch((options = {}) => {
try {
uni.hideTabBar({
fail: () => {},
@@ -219,20 +427,54 @@
uni.setStorageSync('globalData', globalData.value);
// 加载Shopro底层依赖
ShoproInit();
+
+ console.log(SCHEME_TAG, 'onLaunch', options);
+ schemeState.launching = true;
+ schemeState.schemeHandledInLaunch = false;
+ // #ifdef APP-PLUS
+ const boot = () => {
+ registerSchemeEventListener();
+ const optionsHit = isSchemeTrigger(options);
+ if (optionsHit) {
+ schemeState.schemeHandledInLaunch = true;
+ handleSchemeByOptions(options, 'onLaunch冷启动scheme');
+ } else {
+ registerSchemeRuntimeArguments();
+ }
+ };
+ if (typeof plus === 'undefined' || !plus?.runtime) {
+ const start = Date.now();
+ const t = setInterval(() => {
+ if (typeof plus !== 'undefined' && plus?.runtime) {
+ clearInterval(t);
+ boot();
+ } else if (Date.now() - start > 4000) {
+ clearInterval(t);
+ boot();
+ }
+ }, 50);
+ } else {
+ boot();
+ }
+ setTimeout(() => { schemeState.launching = false; }, 1500);
+ // #endif
});
- onShow(() => {
+ onShow((options = {}) => {
try {
uni.hideTabBar({
fail: () => {},
});
} catch (e) {}
// #ifdef APP-PLUS
- // 获取urlSchemes参数
- const args =
- typeof plus !== 'undefined' && plus?.runtime ? plus.runtime.arguments : '';
- if (args) {}
-
+ if (
+ !schemeState.launching &&
+ !schemeState.schemeHandledInLaunch &&
+ isSchemeTrigger(options)
+ ) {
+ handleSchemeByOptions(options, 'onShow兜底scheme');
+ }
+ schemeState.schemeHandledInLaunch = false;
// 获取剪贴板
uni.getClipboardData({
success: (res) => {},
diff --git a/components/card_orderBan/card_orderBan.vue b/components/card_orderBan/card_orderBan.vue
index f3248b4..9c37491 100644
--- a/components/card_orderBan/card_orderBan.vue
+++ b/components/card_orderBan/card_orderBan.vue
@@ -8,6 +8,13 @@
>
+
+ 催一催
+
+
+ 催一催
+
{
+ const status = Number(props.status);
+ return Boolean(
+ props.pickUpVerifyTime ||
+ props.verifyTime ||
+ props.completedTime ||
+ status === 30 ||
+ status === 3,
+ );
+ });
+
+ const resolveStage = () => {
+ const external = Number(props.preparationStatus);
+ const rawStatus = Number.isFinite(external) ? external : Number(props.preparationStatus ?? props.status ?? 0);
+ if (isVerifyCompleted.value) return 'done';
+ if (rawStatus === 1 || rawStatus === 2) return 'wait';
+ if (
+ props.deliveryTime ||
+ props.arriveStoreTime ||
+ props.deliveredTime ||
+ rawStatus === 20
+ ) {
+ return 'delivered';
+ }
+ return 'sorting';
+ };
+
+ const isSorting = computed(() => resolveStage() === 'sorting');
+
+ const showRemind = computed(() => {
+ return (
+ Number(props.deliveryType) === 2 &&
+ Boolean(props.payStatus) &&
+ !isVerifyCompleted.value &&
+ isSorting.value
+ );
+ });
+
+ const emit = defineEmits(['delay', 'now', 'view', 'confirm', 'pay', 'cancel', 'express', 'remind']);
+
+
diff --git a/components/orderItem/orderItem.vue b/components/orderItem/orderItem.vue
index 9dd6706..f9c37f9 100644
--- a/components/orderItem/orderItem.vue
+++ b/components/orderItem/orderItem.vue
@@ -5,9 +5,11 @@
订单编号: {{ props.data.no }}
+
+ 自提
@@ -778,6 +780,18 @@
}
}
+ .pickup-tag {
+ margin-left: 16rpx;
+ padding: 4rpx 16rpx;
+ line-height: 1.6;
+ font-size: 22rpx;
+ color: #2556ec;
+ background: rgba(37, 86, 236, 0.08);
+ border: 2rpx solid rgba(37, 86, 236, 0.18);
+ border-radius: 8rpx;
+ flex-shrink: 0;
+ }
+
.con_item {
margin-bottom: 24rpx;
diff --git a/manifest.json b/manifest.json
index 5cdd11d..8e3d725 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,8 +2,8 @@
"name" : "优购商城",
"appid" : "__UNI__8B19741",
"description" : "",
- "versionName" : "1.7.0",
- "versionCode" : 170,
+ "versionName" : "1.7.1",
+ "versionCode" : 171,
"transformPx" : false,
"app-plus" : {
"privacy" : {
@@ -29,7 +29,7 @@
},
"distribute" : {
"android" : {
- "schemes" : [ "weixin" ],
+ "schemes" : [ "yougou" ],
"permissions" : [
"",
"",
@@ -47,6 +47,7 @@
"minSdkVersion" : 21
},
"ios" : {
+ "schemes" : [ "yougou" ],
"privacyDescription" : {
"NSPhotoLibraryUsageDescription" : "需要同意访问您的相册选取图片才能完善该条目",
"NSPhotoLibraryAddUsageDescription" : ""
diff --git a/pages/order/detail.vue b/pages/order/detail.vue
index d56b03a..e3581be 100644
--- a/pages/order/detail.vue
+++ b/pages/order/detail.vue
@@ -116,17 +116,27 @@
:logisticsNo="state.orderInfo.logisticsNo"
:deliveryTime="state.orderInfo.deliveryTime"
:hasLogistics="hasLogistics"
+ :deliveryType="state.orderInfo.deliveryType"
+ :payStatus="state.orderInfo.payStatus"
+ :preparationStatus="state.orderInfo.preparationStatus"
+ :pickUpVerifyTime="state.orderInfo.pickUpVerifyTime"
+ :verifyTime="state.orderInfo.verifyTime"
+ :completedTime="state.orderInfo.completedTime"
+ :arriveStoreTime="state.orderInfo.arriveStoreTime"
+ :deliveredTime="state.orderInfo.deliveredTime"
@delay="delayShipment"
@now="nowShipment"
@confirm="confirmReceiveOrder"
@pay="goPay"
@cancel="cancelAiOrder"
@express="goExpressLog"
+ @remind="handleRemind"
/>
@@ -193,6 +203,7 @@
aiReceiveItem,
} from '@/sheep/api/ai';
import StoreApi from '@/sheep/api/trade/store';
+ import OrderStoreApi from '@/sheep/api/trade/orderStore';
import card_order from '@/components/orderItem/card_order.vue';
import AiOrderActionBar from '@/components/orderItem/AiOrderActionBar.vue';
import ShipmentPopup from '@/components/orderItem/ShipmentPopup.vue';
@@ -228,6 +239,53 @@
};
const pickUpVerifyRef = ref();
+ const remindLock = ref(false);
+
+ const resolvePickUpStoreIdForRemind = () => {
+ const data = state.orderInfo || {};
+ return Number(
+ data?.pickUpStoreId ||
+ data?.pickUpStore?.id ||
+ data?.pickUpStore?.storeId ||
+ data?.pickUpStoreVO?.id ||
+ data?.pickUpStoreVO?.storeId ||
+ data?.store?.id ||
+ data?.store?.storeId ||
+ systemStore.value?.id ||
+ systemStore.value?.storeId ||
+ data?.storeId ||
+ 0,
+ );
+ };
+
+ const handleRemind = async () => {
+ return sheep.$helper.toast('已通知门店备货');
+ if (remindLock.value) {
+ sheep.$helper.toast('操作太频繁,请稍后再试');
+ return;
+ }
+ const pickUpStoreId = resolvePickUpStoreIdForRemind();
+ const orderId = state.orderInfo?.id || state.orderInfo?.orderId;
+ if (!orderId || !(pickUpStoreId > 0)) {
+ sheep.$helper.toast('订单信息异常');
+ return;
+ }
+ remindLock.value = true;
+ try {
+ const res = await OrderStoreApi.remindStore(pickUpStoreId, orderId);
+ if (res?.code === 0) {
+ sheep.$helper.toast(res?.msg || '已通知门店备货');
+ } else {
+ sheep.$helper.toast(res?.msg || '催一催失败,请稍后重试');
+ }
+ } catch (e) {
+ sheep.$helper.toast('催一催失败,请稍后重试');
+ } finally {
+ setTimeout(() => {
+ remindLock.value = false;
+ }, 5000);
+ }
+ };
const isAiActionOrder = computed(() => {
const orderType = Number(state.orderInfo?.type ?? state.orderType ?? 0);
@@ -319,6 +377,30 @@
return false;
});
+ const resolvePickUpStage = () => {
+ const data = state.orderInfo || {};
+ const external = Number(data?.preparationStatus);
+ const rawStatus = Number.isFinite(external) ? external : Number(data?.preparationStatus ?? data?.status ?? 0);
+ const isVerifyCompleted = Boolean(
+ data?.pickUpVerifyTime ||
+ data?.verifyTime ||
+ data?.completedTime ||
+ rawStatus === 30 ||
+ rawStatus === 3,
+ );
+ if (isVerifyCompleted) return 'done';
+ if (rawStatus === 1 || rawStatus === 2) return 'wait';
+ if (
+ data?.deliveryTime ||
+ data?.arriveStoreTime ||
+ data?.deliveredTime ||
+ rawStatus === 20
+ ) {
+ return 'delivered';
+ }
+ return 'sorting';
+ };
+
const showBottomBar = computed(() => {
if (!isAiActionOrder.value) return true;
const status = Number(state.orderInfo?.status);
@@ -326,7 +408,11 @@
if (hasLogistics.value) return true;
if ([0, 15, 20, 30].includes(status)) return true;
if (!isAiStoreOrder.value) return hasLogistics.value;
- if (isPickUpOrder.value) return false;
+ // AI 店铺自提订单:分拣中/已送达门店时显示底部栏(展示催一催按钮);待取货/已核销后隐藏
+ if (isPickUpOrder.value) {
+ const stage = resolvePickUpStage();
+ return stage === 'sorting' || stage === 'delivered';
+ }
if (hasDelayedItems.value) return true;
return [10, 15, 50, 70].includes(status);
});
@@ -660,6 +746,32 @@
} else {
systemStore.value = {};
}
+ // 自提订单:同步备货进度(用于核销区是否展示二维码、门店卡片是否展示、状态 Tag 同步)
+ if (isPickUp && (state.orderInfo.deliveryType === 2 || pickUpStoreId > 0) && state.orderInfo.payStatus) {
+ try {
+ const prepRes = await OrderStoreApi.getPreparationStatus(pickUpStoreId, state.orderInfo.id || state.orderInfo.orderId);
+ if (prepRes?.code === 0) {
+ const raw = prepRes.data;
+ if (raw !== null && typeof raw === 'object') {
+ const merged = raw?.orderInfo || raw;
+ state.orderInfo = {
+ ...state.orderInfo,
+ ...(merged || {}),
+ };
+ const nextStatus = Number(merged?.preparationStatus ?? merged?.status);
+ if (Number.isFinite(nextStatus)) {
+ state.orderInfo.preparationStatus = nextStatus;
+ }
+ } else {
+ const nextStatus = Number(raw);
+ if (Number.isFinite(nextStatus)) {
+ state.orderInfo.preparationStatus = nextStatus;
+ }
+ }
+ }
+ } catch (e) {
+ }
+ }
if (state.orderInfo.deliveryType === 2 && state.orderInfo.payStatus) {
pickUpVerifyRef.value && pickUpVerifyRef.value.markCode(res.data.pickUpVerifyCode);
}
diff --git a/pages/order/pickUpVerify.vue b/pages/order/pickUpVerify.vue
index a959b32..e1abc47 100644
--- a/pages/order/pickUpVerify.vue
+++ b/pages/order/pickUpVerify.vue
@@ -3,34 +3,54 @@
- 核销信息
+
+ 核销信息
+ {{ statusTagText }}
+
备货进度
-
-
-
-
-
-
-
- 已核销
+
+
+ 📦
+ 门店正快马加鞭备货中
+
+ 分拣完成后将生成取货码并发送通知,请耐心等待~
-
-
-
-
-
- 该商品券已完成核销
-
-
- {{ orderInfo.pickUpVerifyCode }}
-
+
+ 该商品券已完成核销
+
+
+ — 待备货完成后解锁 —
+
+
+
+
+
+
+
+
+
+
+ 已核销
+
+
+
+
+
+
+
+ 该商品券已完成核销
+
+
+ {{ orderInfo.pickUpVerifyCode }}
+
+
核销时间
@@ -44,12 +64,12 @@
使用说明
- 可将二维码出示给店员扫描或提供数字核销码
+ {{ isSorting ? '分拣完成后将生成核销码,出示给店员扫描即可' : '可将二维码出示给店员扫描或提供数字核销码' }}
@@ -102,9 +122,6 @@
default: 'order',
},
});
- const state = reactive({
- qrcodeSize: 145,
- });
const resolvePickUpStoreId = () => {
return Number(
@@ -208,6 +225,46 @@
);
});
+ const resolveStage = () => {
+ const data = props.orderInfo || {};
+ const external = Number(data?.preparationStatus);
+ const rawStatus = Number.isFinite(external) ? external : Number(data?.preparationStatus ?? data?.status ?? 0);
+ if (isVerifyCompleted.value) return 'done';
+ if (rawStatus === 1 || rawStatus === 2) return 'wait';
+ if (
+ data?.deliveryTime ||
+ data?.arriveStoreTime ||
+ data?.deliveredTime ||
+ rawStatus === 20
+ ) {
+ return 'delivered';
+ }
+ return 'sorting';
+ };
+
+ const isSorting = computed(() => resolveStage() === 'sorting');
+
+ const state = reactive({
+ qrcodeSize: 145,
+ });
+
+ const statusTagText = computed(() => {
+ const s = resolveStage();
+ if (s === 'sorting') return '分拣中';
+ if (s === 'delivered') return '已送达门店';
+ if (s === 'wait') return '待取货';
+ if (s === 'done') return isVerifyCompleted.value ? '已核销' : '已完成';
+ return '';
+ });
+
+ const statusTagClass = computed(() => {
+ const s = resolveStage();
+ if (s === 'sorting') return 'status-tag--sorting';
+ if (s === 'delivered') return 'status-tag--delivered';
+ if (s === 'wait') return 'status-tag--wait';
+ return 'status-tag--done';
+ });
+
const addressText = computed(() => {
const s = props.systemStore || {};
const province = s.province || '';
@@ -237,19 +294,30 @@
const painterRef = ref(); // 海报画板
const painterImageUrl = ref(); // 海报 url
const showPainter = ref(true);
+ const lastMarkCodeText = ref('');
// 渲染海报
const renderPoster = async (poster) => {
+ if (!painterRef.value) return;
await painterRef.value.render(poster);
};
// 获得生成的图片
const setPainterImageUrl = (path) => {
painterImageUrl.value = path;
- showPainter.value = false;
};
/**
* 生成核销二维码
*/
- const markCode = (text) => {
+ const markCode = async (text) => {
+ const code = String(text || '').trim();
+ if (!code) return;
+ // 相同取货码无需重复生成,避免重复触发海报组件销毁/重建的空指针
+ if (lastMarkCodeText.value === code && painterImageUrl.value) return;
+ lastMarkCodeText.value = code;
+ // 如果 painterRef 已被销毁(showPainter=false 时 v-if 销毁了组件),先重建组件,等下一个 tick 再渲染
+ if (!painterRef.value) {
+ showPainter.value = true;
+ await new Promise((resolve) => setTimeout(resolve, 0));
+ }
renderPoster({
css: {
width: `${state.qrcodeSize}px`,
@@ -258,7 +326,7 @@
views: [
{
type: 'qrcode',
- text: text,
+ text: code,
css: {
width: `${state.qrcodeSize}px`,
height: `${state.qrcodeSize}px`,
@@ -284,6 +352,7 @@
border-radius: 10rpx;
margin: 0 20rpx 20rpx 20rpx;
}
+
.order-details .writeOff {
background-color: #fff;
margin-top: 15rpx;
@@ -303,6 +372,11 @@
box-sizing: border-box;
}
+ .order-details .writeOff .title-left {
+ gap: 16rpx;
+ min-width: 0;
+ }
+
.order-details .writeOff .title {
font-size: 30rpx;
color: #282828;
@@ -310,6 +384,36 @@
line-height: 87rpx;
}
+ .order-details .writeOff .status-tag {
+ flex-shrink: 0;
+ height: 44rpx;
+ line-height: 44rpx;
+ padding: 0 16rpx;
+ border-radius: 22rpx;
+ font-size: 22rpx;
+ font-weight: 500;
+ }
+
+ .order-details .writeOff .status-tag--sorting {
+ color: #e8852f;
+ background: rgba(232, 133, 47, 0.12);
+ }
+
+ .order-details .writeOff .status-tag--delivered {
+ color: #2556ec;
+ background: rgba(37, 86, 236, 0.1);
+ }
+
+ .order-details .writeOff .status-tag--wait {
+ color: #12a06a;
+ background: rgba(18, 160, 106, 0.1);
+ }
+
+ .order-details .writeOff .status-tag--done {
+ color: #86909c;
+ background: rgba(134, 144, 156, 0.12);
+ }
+
.order-details .writeOff .progress-btn {
height: 52rpx;
line-height: 52rpx;
@@ -320,6 +424,48 @@
background: rgba(91, 78, 255, 0.12);
}
+ .preparation-placeholder {
+ width: 590rpx;
+ min-height: 384rpx;
+ margin: 50rpx auto 0 auto;
+ border-radius: 20rpx 20rpx 0 0;
+ background: linear-gradient(180deg, #fff7ea 0%, #ffe9c8 100%);
+ padding: 72rpx 48rpx 56rpx;
+ box-sizing: border-box;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+
+ &__emoji {
+ font-size: 84rpx;
+ line-height: 1;
+ margin-bottom: 28rpx;
+ }
+
+ &__title {
+ font-size: 32rpx;
+ font-weight: 600;
+ color: #7a4a00;
+ line-height: 1.5;
+ margin-bottom: 14rpx;
+ }
+
+ &__desc {
+ font-size: 24rpx;
+ color: #a36d1a;
+ line-height: 1.7;
+ text-align: center;
+ }
+ }
+
+ .order-details .writeOff .num .num--pending {
+ background: #f7f8fa;
+ color: #98a2b3;
+ font-size: 26rpx;
+ letter-spacing: 2rpx;
+ }
+
.order-details .writeOff .grayBg {
background-color: #f2f5f7;
width: 590rpx;
diff --git a/pages/order/stockProgress.vue b/pages/order/stockProgress.vue
index 5c2d446..1e4bed7 100644
--- a/pages/order/stockProgress.vue
+++ b/pages/order/stockProgress.vue
@@ -105,10 +105,6 @@
return sheep.$helper.timeFormat(t, 'yyyy-mm-dd hh:MM:ss');
};
- const hasVerifyCode = computed(() => {
- return Boolean(state.orderInfo?.pickUpVerifyCode) && Boolean(state.orderInfo?.payStatus);
- });
-
const resolvePickUpStoreId = (data = {}) => {
return Number(
data?.pickUpStoreId ||
@@ -145,6 +141,11 @@
return resolveStage(state.orderInfo, state.preparationStatus);
});
+ const hasVerifyCode = computed(() => {
+ if (stage.value === 'sorting') return false;
+ return Boolean(state.orderInfo?.pickUpVerifyCode) && Boolean(state.orderInfo?.payStatus);
+ });
+
const steps = computed(() => {
const createTime = formatTime(state.orderInfo?.createTime);
const s = stage.value;
diff --git a/pages/user/goods_details_store/index.vue b/pages/user/goods_details_store/index.vue
index 64b32ec..82ca5dc 100644
--- a/pages/user/goods_details_store/index.vue
+++ b/pages/user/goods_details_store/index.vue
@@ -235,14 +235,29 @@
const getStoreStatusLevel = (status) => STORE_STATUS_LEVEL[Number(status)] || 'closed';
const isStoreOpen = (item) => Number(item?.status) === 1;
+ const sortStoreList = (list = []) => {
+ const STATUS_WEIGHT = { 1: 0, 2: 1, 3: 2 };
+ return [...list].sort((a, b) => {
+ const wa = STATUS_WEIGHT[Number(a?.status)] ?? 99;
+ const wb = STATUS_WEIGHT[Number(b?.status)] ?? 99;
+ if (wa !== wb) return wa - wb;
+ const da = Number(a?.distance);
+ const db = Number(b?.distance);
+ if (da >= 0 && db >= 0) return da - db;
+ return 0;
+ });
+ };
+
const filteredStoreList = computed(() => {
const list = Array.isArray(state.storeList) ? state.storeList : [];
const kw = String(state.keyword || '').trim();
- if (!kw) return list;
- return list.filter((item) => {
- const s = `${item?.name || ''} ${formatAddress(item)}`.toLowerCase();
- return s.includes(kw.toLowerCase());
- });
+ const raw = !kw
+ ? list
+ : list.filter((item) => {
+ const s = `${item?.name || ''} ${formatAddress(item)}`.toLowerCase();
+ return s.includes(kw.toLowerCase());
+ });
+ return sortStoreList(raw);
});
const selectedStore = computed(() => {
diff --git a/sheep/api/trade/orderStore.js b/sheep/api/trade/orderStore.js
index 60b7edf..1a32c81 100644
--- a/sheep/api/trade/orderStore.js
+++ b/sheep/api/trade/orderStore.js
@@ -59,6 +59,19 @@ const OrderStoreApi = {
},
});
},
+ remindStore: (pickUpStoreId, orderId) => {
+ return request({
+ url: '/trade/order-store/remind',
+ method: 'POST',
+ params: {
+ pickUpStoreId,
+ orderId,
+ },
+ custom: {
+ showLoading: false,
+ },
+ });
+ },
markSorted: (ids) => {
const idText = Array.isArray(ids) ? ids.filter(Boolean).join(',') : String(ids || '');
return request({