index.vue 21 KB

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