info.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. <template>
  2. <view class="content">
  3. <view class="info">
  4. <view class="one">
  5. 下单成功 | {{shopInfo.type=='1'?'打包带走':'店内就餐'}}
  6. </view>
  7. <view class="two">
  8. <view class="two_1">
  9. <view class="left">桌号:{{shopInfo.table}}</view>
  10. <view class="right">人数:{{shopInfo.num}}人</view>
  11. </view>
  12. <view class="two_2">
  13. <view class="two_2_1">消费明细</view>
  14. <view class="two_2_2">
  15. <scroll-view scroll-y="true" class="scroll-view">
  16. <view class="list-scroll-view">
  17. <view class="list" v-for="(item,index) in list" :key="index">
  18. <view class="img">
  19. <image class="image" :src="item.file" mode=""></image>
  20. </view>
  21. <view class="infoList">
  22. <view class="name textOver">
  23. <text>{{item.name}}</text>
  24. </view>
  25. <view class="spec" v-if="item.spec">
  26. <text>{{item.spec}}</text>
  27. </view>
  28. </view>
  29. <view class="money">
  30. <text>¥{{item.price}}</text>
  31. <text>×{{item.num}}</text>
  32. </view>
  33. </view>
  34. </view>
  35. </scroll-view>
  36. </view>
  37. <view class="two_2_3">
  38. <view class="two_2_3_1">
  39. <view class="left">
  40. 餐位费
  41. <text>×{{shopInfo.person}}</text>
  42. </view>
  43. <view class="right">¥{{shopInfo.perMoney}}</view>
  44. </view>
  45. <view class="two_2_3_2">
  46. 共{{shopInfo.numTotal}}件商品,合计:<text>¥</text><text>{{shopInfo.total}}</text>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="two_3">
  51. <view class="two_3_1">
  52. <view class="left">下单时间</view>
  53. <view class="right">{{shopInfo.time}}</view>
  54. </view>
  55. <view class="two_3_1">
  56. <view class="left">备注</view>
  57. <view class="right">{{shopInfo.remark}}</view>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. <view class="foot">
  63. <view class="foot_1">
  64. <button class="button" @tap.stop="toAdd">加菜</button>
  65. </view>
  66. <view class="foot_2">
  67. <button class="button" @tap.stop="toBuy">结账</button>
  68. </view>
  69. </view>
  70. </view>
  71. </template>
  72. <script>
  73. export default {
  74. data() {
  75. return {
  76. shopInfo: {
  77. table: '1',
  78. total: 521,
  79. numTotal: 9,
  80. money: 3,
  81. type: '0',
  82. num: 3,
  83. person: 3,
  84. perMoney: 9,
  85. time: '2023-02-01 14:10',
  86. remark: '无'
  87. },
  88. list: [{
  89. _id: '1',
  90. code: '0',
  91. name: '三文鱼',
  92. file: require("../../static/foods_1.webp"),
  93. price: 126,
  94. spec: '300g',
  95. stock: 100,
  96. num: 1,
  97. },
  98. {
  99. _id: '2',
  100. code: '0',
  101. name: '蜜汁扇贝',
  102. file: require("../../static/foods_2.webp"),
  103. price: 68,
  104. spec: '400g',
  105. stock: 140,
  106. num: 1,
  107. },
  108. {
  109. _id: '3',
  110. code: '0',
  111. name: '意大利牛排',
  112. file: require("../../static/foods_3.webp"),
  113. price: 128,
  114. spec: '600g',
  115. stock: 200,
  116. num: 1,
  117. },
  118. {
  119. _id: '4',
  120. code: '0',
  121. name: '糖醋里脊',
  122. file: require("../../static/foods_4.webp"),
  123. price: 58,
  124. spec: '500g',
  125. stock: 140,
  126. num: 1,
  127. },
  128. {
  129. _id: '5',
  130. code: '2',
  131. name: '黑糖珍珠奶茶',
  132. file: require("../../static/foods_1.webp"),
  133. price: 18,
  134. spec: '500g',
  135. stock: 120,
  136. num: 1,
  137. },
  138. {
  139. _id: '6',
  140. code: '2',
  141. name: '雪碧',
  142. file: require("../../static/foods_2.webp"),
  143. price: 5,
  144. spec: '500g',
  145. stock: 34,
  146. num: 1,
  147. },
  148. {
  149. _id: '7',
  150. code: '2',
  151. name: '可口可乐',
  152. file: require("../../static/foods_3.webp"),
  153. price: 5,
  154. spec: '500g',
  155. stock: 50,
  156. num: 1,
  157. },
  158. {
  159. _id: '8',
  160. code: '1',
  161. name: '芝士小蛋糕',
  162. file: require("../../static/foods_2.webp"),
  163. price: 12,
  164. spec: '260g',
  165. stock: 10,
  166. num: 1,
  167. },
  168. {
  169. _id: '9',
  170. code: '1',
  171. name: '草莓千层',
  172. file: require("../../static/foods_3.webp"),
  173. price: 15,
  174. spec: '350g',
  175. stock: 40,
  176. num: 1,
  177. }
  178. ],
  179. }
  180. },
  181. onLoad() {
  182. const that = this;
  183. },
  184. onShow() {
  185. const that = this;
  186. },
  187. methods: {
  188. async search(e) {
  189. const that = this;
  190. },
  191. // 加菜
  192. toAdd() {
  193. let id = '1'
  194. uni.navigateTo({
  195. url: `/pagesHome/home/index?id=${id}`
  196. })
  197. },
  198. // 结账
  199. toBuy() {},
  200. }
  201. }
  202. </script>
  203. <style lang="scss">
  204. .content {
  205. font-family: 12px/1 Tahoma, Helvetica, Arial, "\5b8b\4f53", sans-serif;
  206. .info {
  207. display: flex;
  208. flex-direction: column;
  209. position: relative;
  210. flex-grow: 1;
  211. background-color: #f1f1f1;
  212. .one {
  213. height: 10vh;
  214. background-color: #FF7800;
  215. color: #ffffff;
  216. padding: 4vw 2vw;
  217. font-size: 18px;
  218. }
  219. .two {
  220. width: 92vw;
  221. padding: 0 4vw;
  222. position: absolute;
  223. top: 16vw;
  224. .two_1 {
  225. display: flex;
  226. justify-content: space-between;
  227. align-items: center;
  228. background-color: #ffffff;
  229. border-radius: 3vw;
  230. padding: 4vw 2vw;
  231. .left {
  232. font-size: 16px;
  233. font-weight: 600;
  234. }
  235. .right {
  236. font-size: 14px;
  237. }
  238. }
  239. .two_2 {
  240. margin: 2vw 0;
  241. padding: 2vw;
  242. background-color: #ffffff;
  243. border-radius: 4vw;
  244. .two_2_1 {
  245. padding: 2vw 0;
  246. font-size: 16px;
  247. font-weight: 600;
  248. }
  249. .two_2_2 {
  250. position: relative;
  251. display: flex;
  252. flex-direction: column;
  253. height: 32vh;
  254. .list {
  255. display: flex;
  256. width: 84vw;
  257. margin: 0 0 2vw 0;
  258. padding: 2vw;
  259. box-shadow: 0 0 5px #f1f1f1;
  260. border-radius: 5px;
  261. .img {
  262. width: 25vw;
  263. .image {
  264. width: 25vw;
  265. height: 20vw;
  266. border-radius: 5px;
  267. }
  268. }
  269. .infoList {
  270. width: 35vw;
  271. padding: 0 0 0 2vw;
  272. .name {
  273. font-size: 16px;
  274. }
  275. .spec {
  276. font-size: 12px;
  277. color: #858585;
  278. }
  279. }
  280. .money {
  281. display: flex;
  282. flex-direction: column;
  283. align-items: flex-end;
  284. width: 20vw;
  285. font-size: 14px;
  286. text:first-child {
  287. color: #FF8C00;
  288. }
  289. }
  290. }
  291. }
  292. .two_2_3 {
  293. .two_2_3_1 {
  294. display: flex;
  295. justify-content: space-between;
  296. align-items: center;
  297. font-size: 14px;
  298. padding: 2vw 3vw;
  299. .left {
  300. text {
  301. color: #858585;
  302. font-size: 12px;
  303. margin: 0 2vw;
  304. }
  305. }
  306. .right {
  307. color: #FF7800;
  308. }
  309. }
  310. .two_2_3_2 {
  311. padding: 3vw;
  312. text-align: right;
  313. font-size: 14px;
  314. color: #858585;
  315. border-top: 1px solid #f1f1f1;
  316. text:first-child {
  317. color: #FF7800;
  318. }
  319. text:last-child {
  320. color: #FF7800;
  321. font-size: 18px;
  322. }
  323. }
  324. }
  325. }
  326. .two_3 {
  327. margin: 2vw 0;
  328. padding: 2vw;
  329. background-color: #ffffff;
  330. border-radius: 4vw;
  331. .two_3_1 {
  332. display: flex;
  333. justify-content: space-between;
  334. padding: 2vw;
  335. font-size: 14px;
  336. border-bottom: 1px solid #f1f1f1;
  337. }
  338. }
  339. }
  340. }
  341. .foot {
  342. display: flex;
  343. justify-content: space-around;
  344. align-items: center;
  345. padding: 2vw 3vw;
  346. background-color: #ffffff;
  347. border-top: 1px solid #f1f1f1;
  348. .foot_1 {
  349. .button {
  350. background-color: #ffffff;
  351. color: #FF8C00;
  352. border: 1px solid #FF8C00;
  353. border-radius: 5vw;
  354. padding: 0 15vw;
  355. font-size: 16px;
  356. }
  357. }
  358. .foot_2 {
  359. .button {
  360. background-color: #FF8C00;
  361. color: #ffffff;
  362. border-radius: 5vw;
  363. padding: 0 15vw;
  364. font-size: 16px;
  365. }
  366. }
  367. }
  368. }
  369. .scroll-view {
  370. position: absolute;
  371. top: 0;
  372. left: 0;
  373. right: 0;
  374. bottom: 0;
  375. .list-scroll-view {
  376. display: flex;
  377. flex-direction: column;
  378. }
  379. }
  380. </style>