index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683
  1. <template>
  2. <!-- 确认支付页面:订单信息、菜品清单、价格明细、确认支付 -->
  3. <view class="content">
  4. <view class="card">
  5. <view class="card-header">
  6. <view class="tag"></view>
  7. <view class="card-header-title">订单信息</view>
  8. </view>
  9. <view class="card-content">
  10. <view class="info-item">
  11. <view class="info-item-label">就餐桌号</view>
  12. <view class="info-item-value">{{ orderInfo.tableNumber || orderInfo.tableId || '—' }}</view>
  13. </view>
  14. <view class="info-item">
  15. <view class="info-item-label">用餐人数</view>
  16. <view class="info-item-value">{{ orderInfo.diners || '—' }}人</view>
  17. </view>
  18. <view class="info-item">
  19. <view class="info-item-label">联系电话</view>
  20. <view class="info-item-value">{{ orderInfo.contactPhone || '—' }}</view>
  21. </view>
  22. <view class="info-item">
  23. <view class="info-item-label">备注信息</view>
  24. <view class="info-item-value remark-text">{{ orderInfo.remark || '—' }}</view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="card" v-if="displayFoodList.length > 0">
  29. <view class="card-header">
  30. <view class="tag"></view>
  31. <view class="card-header-title">菜品清单</view>
  32. </view>
  33. <view class="card-content">
  34. <view class="info-food">
  35. <view v-for="(item, index) in displayFoodList" :key="item.id || index" class="food-item">
  36. <image :src="getItemImage(item)" mode="aspectFill" class="food-item__image"></image>
  37. <view class="food-item__info">
  38. <view class="food-item__name">{{ item.name }}</view>
  39. <view class="food-item__desc" v-if="item.tags && item.tags.length > 0">
  40. <text v-for="(tag, tagIndex) in item.tags" :key="tagIndex" class="food-item__tag"
  41. :class="tag.type">{{ tag.text }}<text v-if="tagIndex < item.tags.length - 1">,</text>
  42. </text>
  43. </view>
  44. </view>
  45. <view class="food-item__right">
  46. <view class="food-item__price">
  47. <text class="price-main">¥{{ formatPrice(item.price) }}</text>
  48. </view>
  49. <view class="food-item__quantity">{{ item.quantity || 1 }}份</view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="card">
  56. <view class="card-header">
  57. <view class="tag"></view>
  58. <view class="card-header-title">价格明细</view>
  59. </view>
  60. <view class="card-content">
  61. <view class="info-item">
  62. <view class="info-item-label">菜品总价</view>
  63. <view class="info-item-value">¥{{ formatPrice(dishTotal) }}</view>
  64. </view>
  65. <view class="info-item">
  66. <view class="info-item-label">餐具费</view>
  67. <view class="info-item-value">¥{{ formatPrice(orderInfo.utensilFee ?? 0) }}</view>
  68. </view>
  69. <view class="info-item info-item--coupon info-item--clickable" @click="onCouponRowClick">
  70. <view class="info-item-label">优惠券</view>
  71. <view class="info-item-value coupon-value">
  72. <text v-if="(orderInfo.discountAmount ?? 0) > 0" class="coupon-amount">{{ couponDisplayText }}</text>
  73. <text v-else class="coupon-placeholder">请选择</text>
  74. <text class="coupon-arrow">›</text>
  75. </view>
  76. </view>
  77. <view v-if="(orderInfo.discountAmount ?? 0) > 0" class="info-item info-item--coupon">
  78. <view class="info-item-label">优惠金额</view>
  79. <view class="info-item-value coupon-value">
  80. <text class="coupon-amount">-¥{{ formatPrice(orderInfo.discountAmount) }}</text>
  81. </view>
  82. </view>
  83. <view class="price-line">
  84. <view class="price-line-label">应付金额</view>
  85. <view class="price-line-value">¥{{ formatPrice(orderInfo.payAmount ?? 0) }}</view>
  86. </view>
  87. </view>
  88. </view>
  89. <view class="bottom-button">
  90. <view class="bottom-button-text" hover-class="hover-active" @click="handleConfirmPay">确认支付 ¥{{ formatPrice(orderInfo.payAmount ?? 0) }}</view>
  91. </view>
  92. <!-- 选择优惠券弹窗 -->
  93. <view class="coupon-modal-wrapper">
  94. <SelectCouponModal
  95. v-model:open="couponModalOpen"
  96. :coupon-list="couponList"
  97. :selected-coupon-id="selectedCouponId"
  98. :view-only="false"
  99. @select="handleCouponSelect"
  100. @close="couponModalOpen = false"
  101. />
  102. </view>
  103. </view>
  104. </template>
  105. <script setup>
  106. import { onLoad, onShow, onUnload } from '@dcloudio/uni-app';
  107. import { ref, computed } from 'vue';
  108. import { go } from '@/utils/utils.js';
  109. import { getFileUrl } from '@/utils/file.js';
  110. import { useUserStore } from '@/store/user.js';
  111. import * as diningApi from '@/api/dining.js';
  112. import SelectCouponModal from '@/pages/orderFood/components/SelectCouponModal.vue';
  113. const orderId = ref('');
  114. const orderInfo = ref({
  115. orderNo: '',
  116. storeId: '',
  117. tableId: '',
  118. tableNumber: '',
  119. diners: '',
  120. contactPhone: '',
  121. remark: '',
  122. totalAmount: 0,
  123. dishTotal: null,
  124. utensilFee: 0,
  125. couponId: null,
  126. couponName: '',
  127. couponType: null, // 1 满减 2 折扣
  128. discountRate: null, // 折扣券力度,如 5.5 表示 5.5折
  129. nominalValue: null, // 满减券面额
  130. discountAmount: 0,
  131. payAmount: 0
  132. });
  133. const foodList = ref([]);
  134. // 优惠券选择(结算页)
  135. const couponModalOpen = ref(false);
  136. const couponList = ref([]);
  137. const selectedCouponId = ref(null);
  138. // 菜品清单展示:包含所有项(含餐具 id/cuisineId === -1)
  139. const displayFoodList = computed(() => foodList.value ?? []);
  140. // 菜品总价:绑定 totalAmount
  141. const dishTotal = computed(() => {
  142. const total = Number(orderInfo.value.totalAmount) || 0;
  143. return Math.max(0, total);
  144. });
  145. // 优惠券展示:满减券显示 nominalValue+元,折扣券显示 discountRate+折,否则显示 couponName 或 已使用优惠券
  146. const couponDisplayText = computed(() => {
  147. const o = orderInfo.value;
  148. if ((o.discountAmount ?? 0) <= 0) return '';
  149. const type = Number(o.couponType);
  150. if (type === 1 && (o.nominalValue != null && o.nominalValue !== '')) {
  151. const val = Number(o.nominalValue);
  152. return Number.isNaN(val) ? (o.couponName || '已使用优惠券') : val + '元';
  153. }
  154. if (type === 2 && (o.discountRate != null && o.discountRate !== '')) {
  155. const rate = Number(o.discountRate);
  156. return Number.isNaN(rate) ? (o.couponName || '已使用优惠券') : rate + '折';
  157. }
  158. return o.couponName || '已使用优惠券';
  159. });
  160. // 规范化优惠券项(供 SelectCouponModal 使用)
  161. function normalizeCouponItem(item) {
  162. if (!item || typeof item !== 'object') return null;
  163. const raw = item;
  164. const couponType = Number(raw.couponType) || 0;
  165. const nominalValue = Number(raw.nominalValue ?? raw.amount ?? 0) || 0;
  166. const discountRate = ((Number(raw.discountRate) || 0) / 10) || 0;
  167. const minAmount = Number(raw.minimumSpendingAmount ?? raw.minAmount ?? 0) || 0;
  168. let amountDisplay = nominalValue + '元';
  169. if (couponType === 1) amountDisplay = nominalValue + '元';
  170. else if (couponType === 2 && discountRate > 0) amountDisplay = (discountRate % 1 === 0 ? discountRate : discountRate.toFixed(1)) + '折';
  171. return {
  172. id: raw.userCouponId ?? raw.id ?? raw.couponId ?? '',
  173. couponId: raw.couponId ?? raw.id ?? raw.userCouponId ?? '',
  174. amount: nominalValue,
  175. minAmount,
  176. name: raw.name ?? raw.title ?? raw.couponName ?? '',
  177. expireDate: raw.expirationTime ?? raw.endGetDate ?? raw.expireDate ?? '',
  178. couponType,
  179. discountRate,
  180. amountDisplay
  181. };
  182. }
  183. // 点击优惠券行:打开选择弹窗
  184. const onCouponRowClick = () => {
  185. openCouponModal();
  186. };
  187. // 打开优惠券弹窗并拉取用户可用券
  188. const openCouponModal = async () => {
  189. const storeId = orderInfo.value.storeId || uni.getStorageSync('currentStoreId') || '';
  190. couponModalOpen.value = false;
  191. if (!storeId) {
  192. uni.showToast({ title: '暂无门店信息', icon: 'none' });
  193. return;
  194. }
  195. try {
  196. const res = await diningApi.GetUserOwnedCouponList({ storeId });
  197. const list = Array.isArray(res) ? res : (res?.data ?? res?.records ?? res?.list ?? []);
  198. const normalized = (Array.isArray(list) ? list : []).map(normalizeCouponItem).filter(Boolean);
  199. couponList.value = normalized;
  200. couponModalOpen.value = true;
  201. } catch (err) {
  202. console.error('获取优惠券失败:', err);
  203. uni.showToast({ title: '获取优惠券失败', icon: 'none' });
  204. }
  205. };
  206. // 选择优惠券后更新订单优惠与应付金额
  207. const handleCouponSelect = ({ coupon, selectedId }) => {
  208. const hasSelected = selectedId != null && selectedId !== '';
  209. selectedCouponId.value = hasSelected ? String(selectedId) : null;
  210. orderInfo.value.couponId = hasSelected ? (coupon?.couponId ?? coupon?.id ?? selectedCouponId.value) : null;
  211. if (!hasSelected) {
  212. orderInfo.value.discountAmount = 0;
  213. orderInfo.value.couponName = '';
  214. orderInfo.value.couponType = null;
  215. orderInfo.value.discountRate = null;
  216. orderInfo.value.nominalValue = null;
  217. } else if (coupon) {
  218. orderInfo.value.couponName = coupon.name ?? '';
  219. orderInfo.value.couponType = Number(coupon.couponType) ?? null;
  220. orderInfo.value.discountRate = coupon.discountRate != null ? coupon.discountRate : null;
  221. orderInfo.value.nominalValue = coupon.amount != null ? coupon.amount : null;
  222. const total = Number(orderInfo.value.totalAmount) || 0;
  223. const couponType = Number(coupon.couponType) || 0;
  224. if (couponType === 2 && coupon.discountRate != null && total > 0) {
  225. const rate = Number(coupon.discountRate) || 0;
  226. orderInfo.value.discountAmount = Math.round(total * (1 - rate / 10) * 100) / 100;
  227. } else {
  228. orderInfo.value.discountAmount = Number(coupon.amount) || 0;
  229. }
  230. }
  231. updateCheckoutPayAmount();
  232. couponModalOpen.value = false;
  233. };
  234. // 根据菜品总价、餐具费、优惠额计算应付金额
  235. const updateCheckoutPayAmount = () => {
  236. const total = Number(orderInfo.value.totalAmount) || 0;
  237. const utensil = Number(orderInfo.value.utensilFee) || 0;
  238. const discount = Number(orderInfo.value.discountAmount) || 0;
  239. orderInfo.value.payAmount = Math.max(0, total + utensil - discount);
  240. };
  241. function formatPrice(price) {
  242. const num = Number(price);
  243. return Number.isNaN(num) ? '0.00' : num.toFixed(2);
  244. }
  245. // 取第一张图:逗号分隔取首段,数组取首项,对象取 url/path/src(与 orderDetail 一致)
  246. function firstImage(val) {
  247. if (val == null || val === '') return '';
  248. if (Array.isArray(val)) {
  249. const first = val[0];
  250. if (first != null && first !== '') {
  251. if (typeof first === 'object' && first !== null) return first.url ?? first.path ?? first.src ?? first.link ?? '';
  252. return String(first).split(/[,,]/)[0].trim();
  253. }
  254. return '';
  255. }
  256. if (typeof val === 'object') return val.url ?? val.path ?? val.src ?? val.link ?? '';
  257. const str = String(val).trim();
  258. return str ? str.split(/[,,]/)[0].trim() : '';
  259. }
  260. function getItemImage(item) {
  261. if (Number(item?.id ?? item?.cuisineId) === -1) return '/static/utensilFee.png';
  262. const raw = item?.image ?? item?.cuisineImage ?? item?.imageUrl ?? item?.images ?? item?.pic ?? item?.cover ?? '';
  263. const url = firstImage(raw) || (typeof raw === 'string' ? raw.split(/[,,]/)[0]?.trim() : '');
  264. if (url && typeof url === 'string' && (url.startsWith('http') || url.startsWith('//'))) return url;
  265. return getFileUrl(url || 'img/icon/shop.png');
  266. }
  267. // 将 tags 统一为 [{ text, type }] 格式
  268. function normalizeTags(raw) {
  269. if (raw == null) return [];
  270. let arr = [];
  271. if (Array.isArray(raw)) arr = raw;
  272. else if (typeof raw === 'string') {
  273. const t = raw.trim();
  274. if (t.startsWith('[')) { try { arr = JSON.parse(t); if (!Array.isArray(arr)) arr = []; } catch { arr = t ? [t] : []; } }
  275. else arr = t ? t.split(/[,,、\s]+/).map(s => s.trim()).filter(Boolean) : [];
  276. } else if (raw && typeof raw === 'object') arr = Array.isArray(raw.list) ? raw.list : Array.isArray(raw.items) ? raw.items : [];
  277. return arr.map((it) => {
  278. if (it == null) return { text: '', type: '' };
  279. if (typeof it === 'string') return { text: it, type: '' };
  280. if (typeof it === 'number') return { text: String(it), type: '' };
  281. return { text: it.text ?? it.tagName ?? it.name ?? it.label ?? it.title ?? '', type: it.type ?? it.tagType ?? '' };
  282. }).filter((t) => t.text !== '' && t.text != null);
  283. }
  284. // 接口订单项转列表项:图片取首张(逗号/数组/对象与 orderDetail 一致)
  285. function normalizeOrderItem(item) {
  286. const rawTags = item?.tags ?? item?.tagList ?? item?.tagNames ?? item?.labels ?? item?.tag;
  287. const rawImg = item?.images ?? item?.image ?? item?.cuisineImage ?? item?.imageUrl ?? item?.pic ?? item?.cover ?? '';
  288. const imageUrl = firstImage(rawImg) || (typeof rawImg === 'string' ? rawImg.split(/[,,]/)[0]?.trim() : '') || 'img/icon/shop.png';
  289. return {
  290. id: item?.id ?? item?.cuisineId,
  291. name: item?.cuisineName ?? item?.name ?? '',
  292. price: item?.totalPrice ?? item?.unitPrice ?? item?.price ?? 0,
  293. image: imageUrl,
  294. quantity: item?.quantity ?? 1,
  295. tags: normalizeTags(rawTags)
  296. };
  297. }
  298. const fetchOrderDetail = async () => {
  299. const id = orderId.value || '';
  300. if (!id) return;
  301. try {
  302. const res = await diningApi.GetOrderInfo(id);
  303. const raw = res?.data ?? res ?? {};
  304. orderInfo.value.orderNo = raw?.orderNo ?? raw?.orderId ?? '';
  305. orderInfo.value.storeId = raw?.storeId ?? raw?.store_id ?? '';
  306. orderInfo.value.tableId = raw?.tableId ?? raw?.tableNumber ?? '';
  307. orderInfo.value.tableNumber = raw?.tableNumber ?? raw?.tableNo ?? '';
  308. orderInfo.value.diners = raw?.dinerCount ?? '';
  309. orderInfo.value.contactPhone = raw?.contactPhone ?? raw?.phone ?? '';
  310. orderInfo.value.remark = raw?.remark ?? '';
  311. const total = Number(raw?.totalAmount ?? raw?.orderAmount ?? raw?.foodAmount ?? 0) || 0;
  312. orderInfo.value.totalAmount = total;
  313. orderInfo.value.dishTotal = raw?.dishTotal != null ? Number(raw.dishTotal) : null;
  314. orderInfo.value.utensilFee = Number(raw?.tablewareFee ?? raw?.tablewareAmount ?? 0) || 0;
  315. orderInfo.value.couponId = raw?.couponId ?? null;
  316. orderInfo.value.couponName = raw?.couponName ?? '';
  317. orderInfo.value.couponType = raw?.couponType ?? null;
  318. const rawRate = raw?.discountRate;
  319. orderInfo.value.discountRate = rawRate != null && rawRate !== '' ? (Number(rawRate) || 0) / 10 : null;
  320. orderInfo.value.nominalValue = raw?.nominalValue ?? null;
  321. orderInfo.value.discountAmount = Number(raw?.discountAmount ?? raw?.couponAmount ?? raw?.couponDiscount ?? 0) || 0;
  322. orderInfo.value.payAmount = Number(raw?.payAmount ?? raw?.totalAmount ?? raw?.totalPrice ?? 0) || 0;
  323. const list = raw?.orderItemList ?? raw?.orderItems ?? raw?.items ?? raw?.detailList ?? [];
  324. foodList.value = (Array.isArray(list) ? list : []).map(normalizeOrderItem);
  325. selectedCouponId.value = orderInfo.value.couponId != null && orderInfo.value.couponId !== '' ? String(orderInfo.value.couponId) : null;
  326. } catch (err) {
  327. console.error('获取订单详情失败:', err);
  328. uni.showToast({ title: '加载失败', icon: 'none' });
  329. }
  330. };
  331. const handleConfirmPay = async () => {
  332. const id = orderId.value || '';
  333. if (!id) {
  334. uni.showToast({ title: '缺少订单ID', icon: 'none' });
  335. return;
  336. }
  337. const userStore = useUserStore();
  338. const openid = userStore.getOpenId || '';
  339. if (!openid) {
  340. uni.showToast({ title: '请先登录', icon: 'none' });
  341. return;
  342. }
  343. const payAmountVal = Math.round((Number(orderInfo.value.payAmount ?? 0) || 0) * 100) / 100;
  344. if (payAmountVal <= 0) {
  345. uni.showToast({ title: '订单金额异常', icon: 'none' });
  346. return;
  347. }
  348. const orderNo = orderInfo.value.orderNo || '';
  349. if (!orderNo) {
  350. uni.showToast({ title: '缺少订单号', icon: 'none' });
  351. return;
  352. }
  353. const price = Math.round(payAmountVal * 100);
  354. uni.showLoading({ title: '拉起支付...' });
  355. try {
  356. const storeId = orderInfo.value.storeId || uni.getStorageSync('currentStoreId') || '';
  357. const u = userStore.getUserInfo || {};
  358. const payerId = u.id ?? u.userId ?? u.user_id ?? '';
  359. const couponIdVal =
  360. orderInfo.value.couponId != null && orderInfo.value.couponId !== ''
  361. ? String(orderInfo.value.couponId)
  362. : selectedCouponId.value != null && selectedCouponId.value !== ''
  363. ? String(selectedCouponId.value)
  364. : '';
  365. const tablewareFeeVal = Number(orderInfo.value.utensilFee) || 0;
  366. const discountAmountVal = Number(orderInfo.value.discountAmount) || 0;
  367. const res = await diningApi.PostOrderPay({
  368. orderNo,
  369. payer: openid,
  370. price,
  371. subject: '订单支付',
  372. storeId: storeId || undefined,
  373. couponId: couponIdVal || undefined,
  374. payerId: payerId ? String(payerId) : undefined,
  375. tablewareFee: tablewareFeeVal,
  376. discountAmount: discountAmountVal,
  377. payAmount: payAmountVal
  378. });
  379. uni.hideLoading();
  380. uni.requestPayment({
  381. provider: 'wxpay',
  382. timeStamp: res.timestamp,
  383. nonceStr: res.nonce,
  384. package: res.prepayId,
  385. signType: res.signType,
  386. paySign: res.sign,
  387. success: () => {
  388. uni.showToast({ title: '支付成功', icon: 'success' });
  389. const oid = orderId.value || '';
  390. if (oid) {
  391. diningApi.PostOrderSettlementUnlock({ orderId: oid }).catch((e) => console.warn('解锁订单失败:', e));
  392. }
  393. const payType = 'wechatPayMininProgram';
  394. // 查询支付结果需用 prePay 返回的 transactionId,与订单号 orderNo 可能不同
  395. const prePayTid =
  396. res?.transactionId ??
  397. res?.transaction_id ??
  398. res?.outTradeNo ??
  399. orderNo;
  400. const sid = orderInfo.value.storeId || uni.getStorageSync('currentStoreId') || '';
  401. const q = [`id=${encodeURIComponent(oid)}`, `payType=${encodeURIComponent(payType)}`, `transactionId=${encodeURIComponent(String(prePayTid ?? ''))}`];
  402. if (sid) q.push(`storeId=${encodeURIComponent(sid)}`);
  403. setTimeout(() => go(`/pages/paymentSuccess/index?${q.join('&')}`), 1500);
  404. },
  405. fail: (err) => {
  406. const msg = err?.errMsg ?? err?.message ?? '支付失败';
  407. if (String(msg).includes('cancel')) {
  408. uni.showToast({ title: '已取消支付', icon: 'none' });
  409. } else {
  410. uni.showToast({ title: msg || '支付失败', icon: 'none' });
  411. }
  412. }
  413. });
  414. } catch (e) {
  415. uni.hideLoading();
  416. uni.showToast({ title: e?.message || '获取支付参数失败', icon: 'none' });
  417. }
  418. };
  419. onLoad(async (options) => {
  420. const id = options?.orderId ?? options?.id ?? '';
  421. orderId.value = id;
  422. if (options?.orderNo) orderInfo.value.orderNo = options.orderNo;
  423. if (options?.tableId) orderInfo.value.tableId = options.tableId;
  424. if (options?.tableNumber) orderInfo.value.tableNumber = options.tableNumber;
  425. if (options?.diners) orderInfo.value.diners = options.diners;
  426. if (options?.remark != null && options?.remark !== '') orderInfo.value.remark = decodeURIComponent(options.remark);
  427. if (options?.totalAmount != null && options?.totalAmount !== '') {
  428. orderInfo.value.payAmount = Number(options.totalAmount) || 0;
  429. }
  430. if (id) {
  431. await fetchOrderDetail();
  432. }
  433. });
  434. onShow(() => {
  435. const id = orderId.value || '';
  436. if (id) {
  437. diningApi.PostOrderSettlementLock({ orderId: id }).catch((e) => console.warn('锁定订单失败:', e));
  438. }
  439. });
  440. onUnload(() => {
  441. const id = orderId.value || '';
  442. if (id) {
  443. diningApi.PostOrderSettlementUnlock({ orderId: id }).catch((e) => console.warn('解锁订单失败:', e));
  444. }
  445. });
  446. </script>
  447. <style lang="scss" scoped>
  448. .content {
  449. padding: 0 30rpx 300rpx;
  450. }
  451. .card {
  452. background-color: #fff;
  453. border-radius: 24rpx;
  454. padding: 30rpx 0;
  455. margin-top: 20rpx;
  456. .card-header {
  457. display: flex;
  458. align-items: center;
  459. padding: 0 30rpx;
  460. height: 40rpx;
  461. position: relative;
  462. font-size: 27rpx;
  463. color: #151515;
  464. font-weight: bold;
  465. }
  466. .tag {
  467. width: 10rpx;
  468. height: 42rpx;
  469. background: linear-gradient(35deg, #FCB73F 0%, #FC733D 100%);
  470. border-radius: 0;
  471. position: absolute;
  472. left: 0;
  473. top: 0;
  474. }
  475. .card-content {
  476. padding: 0 30rpx;
  477. }
  478. .info-item {
  479. display: flex;
  480. justify-content: space-between;
  481. align-items: center;
  482. margin-top: 20rpx;
  483. font-size: 27rpx;
  484. .info-item-label {
  485. color: #666666;
  486. }
  487. .info-item-value {
  488. color: #151515;
  489. &.remark-text {
  490. flex: 1;
  491. text-align: right;
  492. word-break: break-all;
  493. }
  494. }
  495. &--coupon .coupon-value {
  496. display: flex;
  497. align-items: center;
  498. gap: 8rpx;
  499. }
  500. .coupon-amount {
  501. color: #E61F19;
  502. }
  503. .coupon-placeholder {
  504. color: #999999;
  505. }
  506. .coupon-arrow {
  507. color: #999;
  508. margin-left: 4rpx;
  509. }
  510. &--clickable {
  511. cursor: pointer;
  512. }
  513. }
  514. .price-line {
  515. display: flex;
  516. justify-content: space-between;
  517. align-items: center;
  518. margin-top: 24rpx;
  519. padding-top: 24rpx;
  520. border-top: 1rpx solid #f0f0f0;
  521. font-size: 28rpx;
  522. font-weight: bold;
  523. .price-line-label {
  524. color: #151515;
  525. }
  526. .price-line-value {
  527. color: #E61F19;
  528. }
  529. }
  530. .info-food {
  531. .food-item {
  532. display: flex;
  533. align-items: center;
  534. padding: 20rpx 0;
  535. border-bottom: 1rpx solid #f5f5f5;
  536. &:last-child {
  537. border-bottom: none;
  538. }
  539. &__image {
  540. width: 120rpx;
  541. height: 120rpx;
  542. border-radius: 12rpx;
  543. flex-shrink: 0;
  544. background: #f5f5f5;
  545. }
  546. &__info {
  547. flex: 1;
  548. margin-left: 24rpx;
  549. min-width: 0;
  550. }
  551. &__name {
  552. font-size: 28rpx;
  553. color: #151515;
  554. font-weight: 500;
  555. }
  556. &__desc {
  557. font-size: 22rpx;
  558. color: #999;
  559. margin-top: 6rpx;
  560. }
  561. &__tag {
  562. margin-right: 4rpx;
  563. &.signature {
  564. color: #FC793D;
  565. }
  566. &.spicy {
  567. color: #2E2E2E;
  568. }
  569. }
  570. &__right {
  571. flex-shrink: 0;
  572. text-align: right;
  573. }
  574. &__price .price-main {
  575. font-size: 28rpx;
  576. color: #151515;
  577. font-weight: 600;
  578. }
  579. &__quantity {
  580. font-size: 24rpx;
  581. color: #999;
  582. margin-top: 6rpx;
  583. }
  584. }
  585. }
  586. }
  587. .bottom-button {
  588. position: fixed;
  589. left: 0;
  590. right: 0;
  591. bottom: 0;
  592. padding: 20rpx 30rpx;
  593. padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  594. background: #fff;
  595. box-shadow: 0 -2rpx 12rpx rgba(0, 0, 0, 0.06);
  596. .bottom-button-text {
  597. height: 88rpx;
  598. line-height: 88rpx;
  599. text-align: center;
  600. background: linear-gradient(90deg, #FCB73F 0%, #FC733D 100%);
  601. color: #fff;
  602. font-size: 32rpx;
  603. font-weight: bold;
  604. border-radius: 44rpx;
  605. }
  606. .hover-active {
  607. opacity: 0.9;
  608. }
  609. }
  610. .coupon-modal-wrapper {
  611. position: relative;
  612. z-index: 99999;
  613. :deep(.uni-popup) {
  614. z-index: 99999 !important;
  615. top: 0 !important;
  616. left: 0 !important;
  617. right: 0 !important;
  618. bottom: 0 !important;
  619. }
  620. :deep(.uni-popup__wrapper) {
  621. z-index: 99999 !important;
  622. }
  623. :deep(.select-coupon-modal__list) {
  624. padding-bottom: calc(60rpx + env(safe-area-inset-bottom));
  625. }
  626. :deep(.select-coupon-modal__empty) {
  627. margin-bottom: 60rpx;
  628. }
  629. }
  630. </style>