index.vue 21 KB

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