index.vue 21 KB

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