index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  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. function getItemImage(item) {
  246. if (Number(item?.id ?? item?.cuisineId) === -1) return '/static/utensilFee.png';
  247. const raw = item?.image ?? item?.cuisineImage ?? item?.imageUrl ?? '';
  248. if (typeof raw === 'string' && (raw.startsWith('http') || raw.startsWith('//'))) return raw;
  249. return getFileUrl(raw || 'img/icon/shop.png');
  250. }
  251. // 将 tags 统一为 [{ text, type }] 格式
  252. function normalizeTags(raw) {
  253. if (raw == null) return [];
  254. let arr = [];
  255. if (Array.isArray(raw)) arr = raw;
  256. else if (typeof raw === 'string') {
  257. const t = raw.trim();
  258. if (t.startsWith('[')) { try { arr = JSON.parse(t); if (!Array.isArray(arr)) arr = []; } catch { arr = t ? [t] : []; } }
  259. else arr = t ? t.split(/[,,、\s]+/).map(s => s.trim()).filter(Boolean) : [];
  260. } else if (raw && typeof raw === 'object') arr = Array.isArray(raw.list) ? raw.list : Array.isArray(raw.items) ? raw.items : [];
  261. return arr.map((it) => {
  262. if (it == null) return { text: '', type: '' };
  263. if (typeof it === 'string') return { text: it, type: '' };
  264. if (typeof it === 'number') return { text: String(it), type: '' };
  265. return { text: it.text ?? it.tagName ?? it.name ?? it.label ?? it.title ?? '', type: it.type ?? it.tagType ?? '' };
  266. }).filter((t) => t.text !== '' && t.text != null);
  267. }
  268. function normalizeOrderItem(item) {
  269. const rawTags = item?.tags ?? item?.tagList ?? item?.tagNames ?? item?.labels ?? item?.tag;
  270. const images = item?.images ?? item?.image;
  271. const imageUrl = Array.isArray(images) ? images[0] : images;
  272. return {
  273. id: item?.id ?? item?.cuisineId,
  274. name: item?.cuisineName ?? item?.name ?? '',
  275. price: item?.totalPrice ?? item?.unitPrice ?? item?.price ?? 0,
  276. image: imageUrl ?? item?.image ?? item?.cuisineImage ?? '',
  277. quantity: item?.quantity ?? 1,
  278. tags: normalizeTags(rawTags)
  279. };
  280. }
  281. const fetchOrderDetail = async () => {
  282. const id = orderId.value || '';
  283. if (!id) return;
  284. try {
  285. const res = await diningApi.GetOrderInfo(id);
  286. const raw = res?.data ?? res ?? {};
  287. orderInfo.value.orderNo = raw?.orderNo ?? raw?.orderId ?? '';
  288. orderInfo.value.storeId = raw?.storeId ?? raw?.store_id ?? '';
  289. orderInfo.value.tableId = raw?.tableId ?? raw?.tableNumber ?? '';
  290. orderInfo.value.tableNumber = raw?.tableNumber ?? raw?.tableNo ?? '';
  291. orderInfo.value.diners = raw?.dinerCount ?? '';
  292. orderInfo.value.contactPhone = raw?.contactPhone ?? raw?.phone ?? '';
  293. orderInfo.value.remark = raw?.remark ?? '';
  294. const total = Number(raw?.totalAmount ?? raw?.orderAmount ?? raw?.foodAmount ?? 0) || 0;
  295. orderInfo.value.totalAmount = total;
  296. orderInfo.value.dishTotal = raw?.dishTotal != null ? Number(raw.dishTotal) : null;
  297. orderInfo.value.utensilFee = Number(raw?.tablewareFee ?? raw?.tablewareAmount ?? 0) || 0;
  298. orderInfo.value.couponId = raw?.couponId ?? null;
  299. orderInfo.value.couponName = raw?.couponName ?? '';
  300. orderInfo.value.couponType = raw?.couponType ?? null;
  301. const rawRate = raw?.discountRate;
  302. orderInfo.value.discountRate = rawRate != null && rawRate !== '' ? (Number(rawRate) || 0) / 10 : null;
  303. orderInfo.value.nominalValue = raw?.nominalValue ?? null;
  304. orderInfo.value.discountAmount = Number(raw?.discountAmount ?? raw?.couponAmount ?? raw?.couponDiscount ?? 0) || 0;
  305. orderInfo.value.payAmount = Number(raw?.payAmount ?? raw?.totalAmount ?? raw?.totalPrice ?? 0) || 0;
  306. const list = raw?.orderItemList ?? raw?.orderItems ?? raw?.items ?? raw?.detailList ?? [];
  307. foodList.value = (Array.isArray(list) ? list : []).map(normalizeOrderItem);
  308. selectedCouponId.value = orderInfo.value.couponId != null && orderInfo.value.couponId !== '' ? String(orderInfo.value.couponId) : null;
  309. } catch (err) {
  310. console.error('获取订单详情失败:', err);
  311. uni.showToast({ title: '加载失败', icon: 'none' });
  312. }
  313. };
  314. const handleConfirmPay = async () => {
  315. const id = orderId.value || '';
  316. if (!id) {
  317. uni.showToast({ title: '缺少订单ID', icon: 'none' });
  318. return;
  319. }
  320. const userStore = useUserStore();
  321. const openid = userStore.getOpenId || '';
  322. if (!openid) {
  323. uni.showToast({ title: '请先登录', icon: 'none' });
  324. return;
  325. }
  326. const priceAmount = Number(orderInfo.value.payAmount ?? 0) || 0;
  327. if (priceAmount <= 0) {
  328. uni.showToast({ title: '订单金额异常', icon: 'none' });
  329. return;
  330. }
  331. const orderNo = orderInfo.value.orderNo || '';
  332. if (!orderNo) {
  333. uni.showToast({ title: '缺少订单号', icon: 'none' });
  334. return;
  335. }
  336. const price = Math.round(priceAmount * 100);
  337. uni.showLoading({ title: '拉起支付...' });
  338. try {
  339. const storeId = orderInfo.value.storeId || uni.getStorageSync('currentStoreId') || '';
  340. const res = await diningApi.PostOrderPay({
  341. orderNo,
  342. payer: openid,
  343. price,
  344. subject: '订单支付',
  345. storeId: storeId || undefined
  346. });
  347. uni.hideLoading();
  348. uni.requestPayment({
  349. provider: 'wxpay',
  350. timeStamp: res.timestamp,
  351. nonceStr: res.nonce,
  352. package: res.prepayId,
  353. signType: res.signType,
  354. paySign: res.sign,
  355. success: () => {
  356. uni.showToast({ title: '支付成功', icon: 'success' });
  357. const oid = orderId.value || '';
  358. if (oid) {
  359. diningApi.PostOrderSettlementUnlock({ orderId: oid }).catch((e) => console.warn('解锁订单失败:', e));
  360. }
  361. const payType = 'wechatPayMininProgram';
  362. const transactionId = orderNo;
  363. const sid = orderInfo.value.storeId || uni.getStorageSync('currentStoreId') || '';
  364. const q = [`id=${encodeURIComponent(oid)}`, `payType=${encodeURIComponent(payType)}`, `transactionId=${encodeURIComponent(transactionId)}`];
  365. if (sid) q.push(`storeId=${encodeURIComponent(sid)}`);
  366. setTimeout(() => go(`/pages/paymentSuccess/index?${q.join('&')}`), 1500);
  367. },
  368. fail: (err) => {
  369. const msg = err?.errMsg ?? err?.message ?? '支付失败';
  370. if (String(msg).includes('cancel')) {
  371. uni.showToast({ title: '已取消支付', icon: 'none' });
  372. } else {
  373. uni.showToast({ title: msg || '支付失败', icon: 'none' });
  374. }
  375. }
  376. });
  377. } catch (e) {
  378. uni.hideLoading();
  379. uni.showToast({ title: e?.message || '获取支付参数失败', icon: 'none' });
  380. }
  381. };
  382. onLoad(async (options) => {
  383. const id = options?.orderId ?? options?.id ?? '';
  384. orderId.value = id;
  385. if (options?.orderNo) orderInfo.value.orderNo = options.orderNo;
  386. if (options?.tableId) orderInfo.value.tableId = options.tableId;
  387. if (options?.tableNumber) orderInfo.value.tableNumber = options.tableNumber;
  388. if (options?.diners) orderInfo.value.diners = options.diners;
  389. if (options?.remark != null && options?.remark !== '') orderInfo.value.remark = decodeURIComponent(options.remark);
  390. if (options?.totalAmount != null && options?.totalAmount !== '') {
  391. orderInfo.value.payAmount = Number(options.totalAmount) || 0;
  392. }
  393. if (id) {
  394. await fetchOrderDetail();
  395. }
  396. });
  397. onShow(() => {
  398. const id = orderId.value || '';
  399. if (id) {
  400. diningApi.PostOrderSettlementLock({ orderId: id }).catch((e) => console.warn('锁定订单失败:', e));
  401. }
  402. });
  403. onUnload(() => {
  404. const id = orderId.value || '';
  405. if (id) {
  406. diningApi.PostOrderSettlementUnlock({ orderId: id }).catch((e) => console.warn('解锁订单失败:', e));
  407. }
  408. });
  409. </script>
  410. <style lang="scss" scoped>
  411. .content {
  412. padding: 0 30rpx 300rpx;
  413. }
  414. .card {
  415. background-color: #fff;
  416. border-radius: 24rpx;
  417. padding: 30rpx 0;
  418. margin-top: 20rpx;
  419. .card-header {
  420. display: flex;
  421. align-items: center;
  422. padding: 0 30rpx;
  423. height: 40rpx;
  424. position: relative;
  425. font-size: 27rpx;
  426. color: #151515;
  427. font-weight: bold;
  428. }
  429. .tag {
  430. width: 10rpx;
  431. height: 42rpx;
  432. background: linear-gradient(35deg, #FCB73F 0%, #FC733D 100%);
  433. border-radius: 0;
  434. position: absolute;
  435. left: 0;
  436. top: 0;
  437. }
  438. .card-content {
  439. padding: 0 30rpx;
  440. }
  441. .info-item {
  442. display: flex;
  443. justify-content: space-between;
  444. align-items: center;
  445. margin-top: 20rpx;
  446. font-size: 27rpx;
  447. .info-item-label {
  448. color: #666666;
  449. }
  450. .info-item-value {
  451. color: #151515;
  452. &.remark-text {
  453. flex: 1;
  454. text-align: right;
  455. word-break: break-all;
  456. }
  457. }
  458. &--coupon .coupon-value {
  459. display: flex;
  460. align-items: center;
  461. gap: 8rpx;
  462. }
  463. .coupon-amount {
  464. color: #E61F19;
  465. }
  466. .coupon-placeholder {
  467. color: #999999;
  468. }
  469. .coupon-arrow {
  470. color: #999;
  471. margin-left: 4rpx;
  472. }
  473. &--clickable {
  474. cursor: pointer;
  475. }
  476. }
  477. .price-line {
  478. display: flex;
  479. justify-content: space-between;
  480. align-items: center;
  481. margin-top: 24rpx;
  482. padding-top: 24rpx;
  483. border-top: 1rpx solid #f0f0f0;
  484. font-size: 28rpx;
  485. font-weight: bold;
  486. .price-line-label {
  487. color: #151515;
  488. }
  489. .price-line-value {
  490. color: #E61F19;
  491. }
  492. }
  493. .info-food {
  494. .food-item {
  495. display: flex;
  496. align-items: center;
  497. padding: 20rpx 0;
  498. border-bottom: 1rpx solid #f5f5f5;
  499. &:last-child {
  500. border-bottom: none;
  501. }
  502. &__image {
  503. width: 120rpx;
  504. height: 120rpx;
  505. border-radius: 12rpx;
  506. flex-shrink: 0;
  507. background: #f5f5f5;
  508. }
  509. &__info {
  510. flex: 1;
  511. margin-left: 24rpx;
  512. min-width: 0;
  513. }
  514. &__name {
  515. font-size: 28rpx;
  516. color: #151515;
  517. font-weight: 500;
  518. }
  519. &__desc {
  520. font-size: 22rpx;
  521. color: #999;
  522. margin-top: 6rpx;
  523. }
  524. &__tag {
  525. margin-right: 4rpx;
  526. &.signature {
  527. color: #FC793D;
  528. }
  529. &.spicy {
  530. color: #2E2E2E;
  531. }
  532. }
  533. &__right {
  534. flex-shrink: 0;
  535. text-align: right;
  536. }
  537. &__price .price-main {
  538. font-size: 28rpx;
  539. color: #151515;
  540. font-weight: 600;
  541. }
  542. &__quantity {
  543. font-size: 24rpx;
  544. color: #999;
  545. margin-top: 6rpx;
  546. }
  547. }
  548. }
  549. }
  550. .bottom-button {
  551. position: fixed;
  552. left: 0;
  553. right: 0;
  554. bottom: 0;
  555. padding: 20rpx 30rpx;
  556. padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  557. background: #fff;
  558. box-shadow: 0 -2rpx 12rpx rgba(0, 0, 0, 0.06);
  559. .bottom-button-text {
  560. height: 88rpx;
  561. line-height: 88rpx;
  562. text-align: center;
  563. background: linear-gradient(90deg, #FCB73F 0%, #FC733D 100%);
  564. color: #fff;
  565. font-size: 32rpx;
  566. font-weight: bold;
  567. border-radius: 44rpx;
  568. }
  569. .hover-active {
  570. opacity: 0.9;
  571. }
  572. }
  573. .coupon-modal-wrapper {
  574. position: relative;
  575. z-index: 99999;
  576. :deep(.uni-popup) {
  577. z-index: 99999 !important;
  578. top: 0 !important;
  579. left: 0 !important;
  580. right: 0 !important;
  581. bottom: 0 !important;
  582. }
  583. :deep(.uni-popup__wrapper) {
  584. z-index: 99999 !important;
  585. }
  586. :deep(.select-coupon-modal__list) {
  587. padding-bottom: calc(60rpx + env(safe-area-inset-bottom));
  588. }
  589. :deep(.select-coupon-modal__empty) {
  590. margin-bottom: 60rpx;
  591. }
  592. }
  593. </style>