add.vue 6.7 KB

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