index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  1. <template>
  2. <!-- 下单页面 -->
  3. <view class="content">
  4. <!-- 订单卡片 -->
  5. <view class="card">
  6. <view class="card-header">
  7. <view class='tag'></view>
  8. <view class="card-header-title">订单信息</view>
  9. </view>
  10. <view class="card-content">
  11. <view class="info-item">
  12. <view class="info-item-label">就餐桌号</view>
  13. <view class="info-item-value">{{ orderInfo.tableNumber || orderInfo.tableId || '—' }}</view>
  14. </view>
  15. <view class="info-item">
  16. <view class="info-item-label">用餐人数</view>
  17. <view class="info-item-value">{{ orderInfo.diners || '—' }}人</view>
  18. </view>
  19. <view class="info-item">
  20. <view class="info-item-label">联系电话</view>
  21. <view class="info-item-value">{{ orderInfo.contactPhone || '—' }}</view>
  22. </view>
  23. <view class="info-item">
  24. <view class="info-item-label">备注信息</view>
  25. </view>
  26. <textarea
  27. v-model="orderInfo.remark"
  28. placeholder="请输入特殊需求,如少辣、不要香菜等(最多30字)"
  29. class="info-item-textarea"
  30. maxlength="30"
  31. ></textarea>
  32. </view>
  33. </view>
  34. <!-- 菜品清单 -->
  35. <view class="card">
  36. <view class="card-header">
  37. <view class='tag'></view>
  38. <view class="card-header-title">菜品清单</view>
  39. </view>
  40. <view class="card-content">
  41. <view class="info-food">
  42. <view v-for="(item, index) in foodList" :key="item.id || item.cuisineId || index" class="food-item">
  43. <!-- 菜品图片:兼容 cuisineImage/image,逗号分隔取首图 -->
  44. <image :src="getItemImage(item)" mode="aspectFill" class="food-item__image"></image>
  45. <!-- 菜品信息 -->
  46. <view class="food-item__info">
  47. <view class="food-item__name">{{ item.name || item.cuisineName }}</view>
  48. <view class="food-item__desc" v-if="item.tags && item.tags.length > 0">
  49. <text v-for="(tag, tagIndex) in item.tags" :key="tagIndex" class="food-item__tag"
  50. :class="tag.type">{{ tag.text }}<text v-if="tagIndex < item.tags.length - 1">,</text>
  51. </text>
  52. </view>
  53. </view>
  54. <!-- 价格和数量 -->
  55. <view class="food-item__right">
  56. <view class="food-item__price">
  57. <text class="price-main">¥{{ formatPrice(getItemPrice(item)) }}</text>
  58. </view>
  59. <view class="food-item__quantity">{{ item.quantity || 1 }}份</view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <!-- 总价 -->
  66. <view class="card">
  67. <view class="card-header">
  68. <view class='tag'></view>
  69. <view class="card-header-title">价格明细</view>
  70. </view>
  71. <view class="card-content">
  72. <view class="info-item">
  73. <view class="info-item-label">菜品总价</view>
  74. <view class="info-item-value">¥{{ formatPrice(dishTotal) }}</view>
  75. </view>
  76. <view class="info-item">
  77. <view class="info-item-label">餐具费</view>
  78. <view class="info-item-value">¥{{ formatPrice(orderInfo.utensilFee ?? 0) }}</view>
  79. </view>
  80. <view class="info-item info-item--coupon info-item--clickable" @click="onCouponRowClick">
  81. <view class="info-item-label">优惠券</view>
  82. <view class="info-item-value coupon-value">
  83. <text v-if="selectedCouponDisplay" class="coupon-amount">{{ selectedCouponDisplay }}</text>
  84. <text v-else class="coupon-placeholder">请选择</text>
  85. <text class="coupon-arrow">›</text>
  86. </view>
  87. </view>
  88. <view v-if="(orderInfo.discountAmount ?? 0) > 0" class="info-item info-item--coupon">
  89. <view class="info-item-label">优惠金额</view>
  90. <view class="info-item-value coupon-value">
  91. <text class="coupon-amount">-¥{{ formatPrice(orderInfo.discountAmount) }}</text>
  92. </view>
  93. </view>
  94. <view class="price-line">
  95. <view class="price-line-label">应付金额</view>
  96. <view class="price-line-value">¥{{ formatPrice(orderInfo.payAmount ?? orderInfo.totalAmount) }}</view>
  97. </view>
  98. </view>
  99. </view>
  100. <!-- 底部按钮:确认下单(去结算请走 pages/checkout/index) -->
  101. <view class="bottom-button">
  102. <view class="bottom-button-text" hover-class="hover-active" @click="handleConfirmOrder">确认下单</view>
  103. </view>
  104. <!-- 选择优惠券弹窗(需盖住底部确认订单按钮) -->
  105. <view class="coupon-modal-wrapper">
  106. <SelectCouponModal
  107. v-model:open="couponModalOpen"
  108. :coupon-list="couponList"
  109. :selected-coupon-id="selectedCouponId"
  110. :view-only="false"
  111. @select="handleCouponSelect"
  112. @close="couponModalOpen = false"
  113. />
  114. </view>
  115. </view>
  116. </template>
  117. <script setup>
  118. import { onLoad, onShow, onUnload } from "@dcloudio/uni-app";
  119. import { ref, computed } from "vue";
  120. import { go } from "@/utils/utils.js";
  121. import { getFileUrl } from "@/utils/file.js";
  122. import { useUserStore } from "@/store/user.js";
  123. import * as diningApi from "@/api/dining.js";
  124. import SelectCouponModal from "@/pages/orderFood/components/SelectCouponModal.vue";
  125. // 订单信息(从购物车带过来或 URL 参数)
  126. const orderInfo = ref({
  127. orderNo: '',
  128. tableId: '',
  129. tableNumber: '',
  130. diners: '',
  131. contactPhone: '',
  132. remark: '',
  133. totalAmount: 0,
  134. dishTotal: null,
  135. utensilFee: 0,
  136. discountAmount: 0,
  137. payAmount: 0,
  138. couponId: null
  139. });
  140. // 优惠券选择
  141. const couponModalOpen = ref(false);
  142. const selectedCouponId = ref(null);
  143. const couponList = ref([]);
  144. /** 选中券的展示文案(如 "5.5折"、"10元"),用于价格明细展示 */
  145. const selectedCouponDisplay = ref('');
  146. // 菜品列表(从购物车带过来)
  147. const foodList = ref([]);
  148. // 菜品清单展示:排除餐具(id/cuisineId === -1)
  149. const displayFoodList = computed(() => {
  150. return (foodList.value ?? []).filter((it) => Number(it?.id ?? it?.cuisineId) !== -1);
  151. });
  152. // 菜品总价(不含餐具费):仅按菜品清单中非餐具项汇总,不包含餐具费
  153. const dishTotal = computed(() => {
  154. const list = displayFoodList.value ?? [];
  155. const sum = list.reduce((s, it) => {
  156. const qty = Number(it?.quantity) || 0;
  157. const price = Number(it?.unitPrice ?? it?.price ?? it?.totalPrice ?? it?.salePrice ?? 0) || 0;
  158. return s + qty * price;
  159. }, 0);
  160. return Math.max(0, sum);
  161. });
  162. // 菜品图片:餐具(id/cuisineId=-1)固定用本地 /static/utensilFee.png,其他取接口图
  163. function getItemImage(item) {
  164. const id = item?.id ?? item?.cuisineId;
  165. if (Number(id) === -1) return '/static/utensilFee.png';
  166. const raw = item?.cuisineImage ?? item?.image ?? item?.imageUrl ?? '';
  167. const url = typeof raw === 'string' ? raw.split(',')[0].trim() : raw;
  168. return url ? getFileUrl(url) : '';
  169. }
  170. // 单品单价:列表展示用 unitPrice/price
  171. function getItemPrice(item) {
  172. const p = item?.unitPrice ?? item?.price ?? item?.totalPrice ?? item?.salePrice ?? 0;
  173. return Number(p) || 0;
  174. }
  175. function formatPrice(price) {
  176. const num = Number(price);
  177. return Number.isNaN(num) ? '0.00' : num.toFixed(2);
  178. }
  179. // 规范化优惠券项(与 orderFood 的 normalizeCouponItem 一致,供 SelectCouponModal 使用)
  180. function normalizeCouponItem(item) {
  181. if (!item || typeof item !== 'object') return null;
  182. const raw = item;
  183. const couponType = Number(raw.couponType) || 0;
  184. const nominalValue = Number(raw.nominalValue ?? raw.amount ?? 0) || 0;
  185. const discountRate = Number(raw.discountRate) || 0;
  186. const minAmount = Number(raw.minimumSpendingAmount ?? raw.minAmount ?? 0) || 0;
  187. let amountDisplay = nominalValue + '元';
  188. if (couponType === 1) amountDisplay = nominalValue + '元';
  189. else if (couponType === 2 && discountRate > 0) amountDisplay = (discountRate % 1 === 0 ? discountRate : discountRate.toFixed(1)) + '折';
  190. return {
  191. id: raw.userCouponId ?? raw.id ?? raw.couponId ?? '',
  192. amount: nominalValue,
  193. minAmount,
  194. name: raw.name ?? raw.title ?? raw.couponName ?? '',
  195. expireDate: raw.expirationTime ?? raw.endGetDate ?? raw.expireDate ?? '',
  196. couponType,
  197. discountRate,
  198. amountDisplay
  199. };
  200. }
  201. // 点击优惠券行:打开选择弹窗
  202. const onCouponRowClick = () => {
  203. openCouponModal();
  204. };
  205. // 打开优惠券弹窗并拉取用户可用券
  206. const openCouponModal = async () => {
  207. const storeId = uni.getStorageSync('currentStoreId') || '';
  208. couponModalOpen.value = false;
  209. try {
  210. const res = await diningApi.GetUserOwnedCouponList({ storeId });
  211. const list = Array.isArray(res) ? res : (res?.data ?? res?.records ?? res?.list ?? []);
  212. const normalized = (Array.isArray(list) ? list : []).map(normalizeCouponItem).filter(Boolean);
  213. couponList.value = normalized;
  214. couponModalOpen.value = true;
  215. } catch (err) {
  216. console.error('获取优惠券失败:', err);
  217. uni.showToast({ title: '获取优惠券失败', icon: 'none' });
  218. }
  219. };
  220. // 选择优惠券后更新订单优惠与应付金额(折扣券按折扣率计算优惠金额)
  221. const handleCouponSelect = ({ coupon, selectedId }) => {
  222. selectedCouponId.value = selectedId != null && selectedId !== '' ? String(selectedId) : null;
  223. orderInfo.value.couponId = selectedCouponId.value;
  224. if (!coupon) {
  225. selectedCouponDisplay.value = '';
  226. orderInfo.value.discountAmount = 0;
  227. } else {
  228. selectedCouponDisplay.value = coupon.amountDisplay || (coupon.amount ? coupon.amount + '元' : '');
  229. const total = dishTotal.value;
  230. const couponType = Number(coupon.couponType) || 0;
  231. if (couponType === 2 && coupon.discountRate != null && total > 0) {
  232. // 折扣券:优惠金额 = 菜品总价 × (1 - 折数/10),如 5.5折 即 优惠 = 总价 × 0.45
  233. const rate = Number(coupon.discountRate) || 0;
  234. orderInfo.value.discountAmount = Math.round(total * (1 - rate / 10) * 100) / 100;
  235. } else {
  236. orderInfo.value.discountAmount = Number(coupon.amount) || 0;
  237. }
  238. }
  239. updatePayAmount();
  240. couponModalOpen.value = false;
  241. };
  242. // 根据菜品总价(不含餐具)、餐具费、优惠额计算应付金额
  243. const updatePayAmount = () => {
  244. const dish = dishTotal.value;
  245. const utensil = Number(orderInfo.value.utensilFee) || 0;
  246. const discount = Number(orderInfo.value.discountAmount) || 0;
  247. orderInfo.value.payAmount = Math.max(0, dish + utensil - discount);
  248. };
  249. // 进入页面时调一次优惠券接口:默认不选中,显示请选择
  250. const fetchCouponsOnEnter = async () => {
  251. const storeId = uni.getStorageSync('currentStoreId') || '';
  252. try {
  253. const res = await diningApi.GetUserOwnedCouponList({ storeId });
  254. const list = Array.isArray(res) ? res : (res?.data ?? res?.records ?? res?.list ?? []);
  255. const normalized = (Array.isArray(list) ? list : []).map(normalizeCouponItem).filter(Boolean);
  256. couponList.value = normalized;
  257. selectedCouponId.value = null;
  258. selectedCouponDisplay.value = '';
  259. orderInfo.value.couponId = null;
  260. orderInfo.value.discountAmount = 0;
  261. updatePayAmount();
  262. } catch (err) {
  263. console.error('获取优惠券失败:', err);
  264. selectedCouponDisplay.value = '';
  265. orderInfo.value.discountAmount = 0;
  266. orderInfo.value.couponId = null;
  267. selectedCouponId.value = null;
  268. updatePayAmount();
  269. }
  270. };
  271. // 将 tags 统一为 [{ text, type }] 格式
  272. function normalizeTags(raw) {
  273. if (raw == null) return [];
  274. let arr = [];
  275. if (Array.isArray(raw)) arr = raw;
  276. else if (typeof raw === 'string') {
  277. const t = raw.trim();
  278. if (t.startsWith('[')) { try { arr = JSON.parse(t); if (!Array.isArray(arr)) arr = []; } catch { arr = t ? [t] : []; } }
  279. else arr = t ? t.split(/[,,、\s]+/).map(s => s.trim()).filter(Boolean) : [];
  280. } else if (raw && typeof raw === 'object') arr = Array.isArray(raw.list) ? raw.list : Array.isArray(raw.items) ? raw.items : [];
  281. return arr.map((it) => {
  282. if (it == null) return { text: '', type: '' };
  283. if (typeof it === 'string') return { text: it, type: '' };
  284. if (typeof it === 'number') return { text: String(it), type: '' };
  285. return { text: it.text ?? it.tagName ?? it.name ?? it.label ?? it.title ?? '', type: it.type ?? it.tagType ?? '' };
  286. }).filter((t) => t.text !== '' && t.text != null);
  287. }
  288. // 将存储的购物车项转为确认页展示格式(兼容 cuisineName/cuisineImage/unitPrice/tags 等)
  289. function normalizeCartItem(item) {
  290. const image = item?.cuisineImage ?? item?.image ?? item?.imageUrl ?? '';
  291. const url = typeof image === 'string' ? image.split(',')[0].trim() : image;
  292. const rawTags = item?.tags ?? item?.tagList ?? item?.tagNames ?? item?.labels ?? item?.tag;
  293. return {
  294. id: item?.id ?? item?.cuisineId,
  295. name: item?.name ?? item?.cuisineName,
  296. cuisineName: item?.cuisineName,
  297. price: item?.unitPrice ?? item?.price,
  298. image: url,
  299. cuisineImage: item?.cuisineImage,
  300. quantity: Number(item?.quantity) || 0,
  301. tags: normalizeTags(rawTags),
  302. subtotalAmount: item?.subtotalAmount,
  303. remark: item?.remark
  304. };
  305. }
  306. const handleConfirmOrder = async () => {
  307. const tableId = orderInfo.value.tableId;
  308. const contactPhone = orderInfo.value.contactPhone ?? '';
  309. const dinerCount = Number(orderInfo.value.diners) || 0;
  310. if (!tableId) {
  311. uni.showToast({ title: '请先选择桌号', icon: 'none' });
  312. return;
  313. }
  314. if (!contactPhone) {
  315. uni.showToast({ title: '请先填写联系电话', icon: 'none' });
  316. return;
  317. }
  318. const remark = (orderInfo.value.remark ?? '').trim().slice(0, 30);
  319. uni.showLoading({ title: '提交中...' });
  320. try {
  321. const tablewareFee = Number(orderInfo.value.utensilFee) || 0;
  322. const payAmount = Number((Number(orderInfo.value.payAmount) ?? 0).toFixed(2));
  323. const totalAmount = Number((Number(dishTotal.value) ?? 0).toFixed(2));
  324. const res = await diningApi.PostOrderCreate({
  325. tableId,
  326. contactPhone,
  327. totalAmount,
  328. couponId: (selectedCouponId.value ?? orderInfo.value.couponId) || null,
  329. discountAmount: orderInfo.value.discountAmount ?? 0,
  330. tablewareFee,
  331. payAmount,
  332. dinerCount: dinerCount || undefined,
  333. immediatePay: 0,
  334. remark: remark || undefined
  335. });
  336. uni.hideLoading();
  337. const orderId = res?.id ?? res?.orderId ?? res?.data?.id ?? res?.data?.orderId;
  338. const orderNo = res?.orderNo ?? res?.data?.orderNo ?? orderId ?? '';
  339. const total = orderInfo.value.payAmount ?? orderInfo.value.totalAmount ?? 0;
  340. // 结果页「去结算」需带 orderId/orderNo/金额/备注,用于确认支付
  341. uni.setStorageSync('lastPlaceOrderInfo', JSON.stringify({
  342. orderId: orderId ?? undefined,
  343. orderNo: orderNo ?? undefined,
  344. tableId: orderInfo.value.tableId,
  345. tableNumber: orderInfo.value.tableNumber,
  346. diners: orderInfo.value.diners,
  347. totalAmount: total,
  348. remark: (orderInfo.value.remark ?? '').trim().slice(0, 30)
  349. }));
  350. // 确认下单成功后即将跳转,此时页面不会触发 onUnload,需主动调用解锁
  351. const unlockFn = diningApi.PostOrderUnlock || diningApi.postOrderUnlock;
  352. if (typeof unlockFn === 'function' && tableId) {
  353. unlockFn({ tableId }).catch((err) => console.warn('解锁订单失败:', err));
  354. }
  355. if (orderId != null) {
  356. go(`/pages/result/index?id=${encodeURIComponent(orderId)}`);
  357. } else {
  358. go('/pages/result/index');
  359. }
  360. } catch (e) {
  361. uni.hideLoading();
  362. uni.showToast({ title: e?.message || '下单失败', icon: 'none' });
  363. }
  364. };
  365. onLoad((options) => {
  366. const userStore = useUserStore();
  367. const contactPhone = userStore.getUserInfo?.phone ?? userStore.getUserInfo?.contactPhone ?? userStore.getUserInfo?.mobile ?? '';
  368. orderInfo.value.contactPhone = contactPhone;
  369. const raw = uni.getStorageSync('placeOrderCart');
  370. if (raw) {
  371. try {
  372. const data = JSON.parse(raw);
  373. const list = Array.isArray(data.list) ? data.list : [];
  374. foodList.value = list.map(normalizeCartItem).filter((item) => (item.quantity || 0) > 0);
  375. if (data.tableId != null) orderInfo.value.tableId = data.tableId;
  376. if (data.tableNumber != null) orderInfo.value.tableNumber = data.tableNumber;
  377. if (data.diners != null) orderInfo.value.diners = data.diners;
  378. if (data.remark != null) orderInfo.value.remark = data.remark;
  379. const total = Number(data.totalAmount) || 0;
  380. orderInfo.value.totalAmount = total;
  381. if (data.dishTotal != null && data.dishTotal !== '') orderInfo.value.dishTotal = Number(data.dishTotal) || 0;
  382. const fee = data.utensilFee ?? data.tablewareFee;
  383. if (fee != null && fee !== '') orderInfo.value.utensilFee = Number(fee) || 0;
  384. if (data.discountAmount != null) orderInfo.value.discountAmount = data.discountAmount;
  385. if (data.couponId != null) selectedCouponId.value = data.couponId;
  386. updatePayAmount();
  387. } catch (e) {
  388. console.error('解析购物车数据失败:', e);
  389. }
  390. }
  391. if (orderInfo.value.tableId) uni.setStorageSync('currentTableId', String(orderInfo.value.tableId));
  392. fetchCouponsOnEnter();
  393. });
  394. // 每次进入页面(含从其他页返回)都调用锁定订单接口
  395. onShow(() => {
  396. const tableId = orderInfo.value?.tableId;
  397. if (tableId) {
  398. (diningApi.PostOrderLock || diningApi.postOrderLock)({ tableId }).catch((err) => {
  399. console.warn('锁定订单失败:', err);
  400. });
  401. }
  402. });
  403. // 离开页面时调用解锁订单接口
  404. onUnload(() => {
  405. const tableId = orderInfo.value?.tableId;
  406. if (tableId && typeof (diningApi.PostOrderUnlock || diningApi.postOrderUnlock) === 'function') {
  407. (diningApi.PostOrderUnlock || diningApi.postOrderUnlock)({ tableId }).catch((err) => {
  408. console.warn('解锁订单失败:', err);
  409. });
  410. }
  411. });
  412. </script>
  413. <style lang="scss" scoped>
  414. .content {
  415. padding: 0 30rpx 300rpx;
  416. }
  417. .card {
  418. background-color: #fff;
  419. border-radius: 24rpx;
  420. padding: 30rpx 0;
  421. margin-top: 20rpx;
  422. .card-header {
  423. display: flex;
  424. justify-content: space-between;
  425. align-items: center;
  426. padding: 0 30rpx;
  427. height: 40rpx;
  428. position: relative;
  429. font-size: 27rpx;
  430. color: #151515;
  431. font-weight: bold;
  432. }
  433. .tag {
  434. width: 10rpx;
  435. height: 42rpx;
  436. background: linear-gradient(35deg, #FCB73F 0%, #FC733D 100%);
  437. border-radius: 0rpx 0rpx 0rpx 0rpx;
  438. position: absolute;
  439. left: 0;
  440. top: 0;
  441. }
  442. .card-content {
  443. padding: 0 30rpx;
  444. }
  445. .info-item {
  446. display: flex;
  447. justify-content: space-between;
  448. align-items: center;
  449. margin-top: 20rpx;
  450. font-size: 27rpx;
  451. .info-item-label {
  452. color: #666666;
  453. }
  454. .info-item-value {
  455. color: #151515;
  456. }
  457. &--clickable {
  458. cursor: pointer;
  459. }
  460. &--coupon .coupon-value {
  461. display: flex;
  462. align-items: center;
  463. gap: 8rpx;
  464. }
  465. .coupon-amount {
  466. color: #E61F19;
  467. }
  468. .coupon-placeholder {
  469. color: #999999;
  470. }
  471. .coupon-arrow {
  472. color: #999999;
  473. font-size: 32rpx;
  474. }
  475. }
  476. .info-item-textarea {
  477. width: 100%;
  478. height: 115rpx;
  479. border-radius: 8rpx;
  480. border: 1rpx solid #F2F2F2;
  481. margin-top: 20rpx;
  482. font-size: 23rpx;
  483. color: #AAAAAA;
  484. box-sizing: border-box;
  485. padding: 20rpx;
  486. }
  487. .info-food {
  488. margin-top: 20rpx;
  489. }
  490. .food-item {
  491. display: flex;
  492. align-items: center;
  493. padding: 20rpx 0;
  494. &:last-child {
  495. border-bottom: none;
  496. }
  497. &__image {
  498. width: 118rpx;
  499. height: 118rpx;
  500. border-radius: 8rpx;
  501. flex-shrink: 0;
  502. background-color: #f5f5f5;
  503. }
  504. &__info {
  505. flex: 1;
  506. margin-left: 20rpx;
  507. display: flex;
  508. flex-direction: column;
  509. justify-content: center;
  510. }
  511. &__name {
  512. font-size: 28rpx;
  513. font-weight: bold;
  514. color: #151515;
  515. margin-bottom: 8rpx;
  516. }
  517. &__desc {
  518. font-size: 24rpx;
  519. color: #666666;
  520. line-height: 1.5;
  521. }
  522. &__tag {
  523. font-size: 24rpx;
  524. color: #666666;
  525. }
  526. &__right {
  527. display: flex;
  528. flex-direction: column;
  529. align-items: flex-end;
  530. justify-content: center;
  531. margin-left: 20rpx;
  532. }
  533. &__price {
  534. display: flex;
  535. align-items: baseline;
  536. color: #151515;
  537. font-weight: bold;
  538. margin-bottom: 8rpx;
  539. .price-symbol {
  540. font-size: 20rpx;
  541. margin-right: 2rpx;
  542. }
  543. .price-main {
  544. font-size: 28rpx;
  545. }
  546. .price-decimal {
  547. font-size: 24rpx;
  548. }
  549. }
  550. &__quantity {
  551. font-size: 24rpx;
  552. color: #797979;
  553. }
  554. }
  555. .price-line {
  556. display: flex;
  557. justify-content: space-between;
  558. align-items: center;
  559. margin-top: 20rpx;
  560. font-size: 27rpx;
  561. color: #151515;
  562. border-top: 1rpx solid rgba(170, 170, 170, 0.15);
  563. font-weight: bold;
  564. padding-top: 20rpx;
  565. }
  566. }
  567. /* 优惠券弹窗层级:需盖住底部确认订单按钮(z-index:999) */
  568. .coupon-modal-wrapper {
  569. position: relative;
  570. z-index: 99999;
  571. :deep(.uni-popup) {
  572. z-index: 99999 !important;
  573. top: 0 !important;
  574. left: 0 !important;
  575. right: 0 !important;
  576. bottom: 0 !important;
  577. }
  578. :deep(.uni-popup__wrapper) {
  579. z-index: 99999 !important;
  580. }
  581. }
  582. .bottom-button {
  583. width: 100%;
  584. background-color: #fff;
  585. padding: 20rpx 30rpx;
  586. box-sizing: border-box;
  587. position: fixed;
  588. bottom: 0;
  589. left: 0;
  590. right: 0;
  591. z-index: 999;
  592. padding-bottom: env(safe-area-inset-bottom);
  593. box-shadow: 0rpx -11rpx 46rpx 0rpx rgba(0, 0, 0, 0.05);
  594. .bottom-button-text {
  595. font-size: 32rpx;
  596. font-weight: bold;
  597. color: #fff;
  598. width: 695rpx;
  599. height: 80rpx;
  600. background: linear-gradient(90deg, #FCB73F 0%, #FC743D 100%);
  601. border-radius: 23rpx 23rpx 23rpx 23rpx;
  602. display: flex;
  603. align-items: center;
  604. justify-content: center;
  605. }
  606. }
  607. </style>