info.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  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_name}}</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&&item.file.length>0?item.file[0].url:''"
  20. mode="">
  21. </image>
  22. </view>
  23. <view class="infoList">
  24. <view class="name textOver">
  25. <text>{{item.name}}</text>
  26. </view>
  27. <view class="spec" v-if="item.spec">
  28. <text>{{item.spec}}</text>
  29. </view>
  30. </view>
  31. <view class="money">
  32. <text>¥{{item.price}}</text>
  33. <text>×{{item.num}}</text>
  34. </view>
  35. </view>
  36. </view>
  37. </scroll-view>
  38. </view>
  39. <view class="two_2_3">
  40. <view class="two_2_3_1">
  41. <view class="left">
  42. 餐位费
  43. <text>×{{shopInfo.num}}</text>
  44. </view>
  45. <view class="right">¥{{shopInfo.money_num}}</view>
  46. </view>
  47. <view class="two_2_3_2">
  48. 共{{list.length}}件商品,合计:<text>¥</text><text>{{shopInfo.money}}</text>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="two_3">
  53. <view class="two_3_1">
  54. <view class="left">下单时间</view>
  55. <view class="right">{{shopInfo.time}}</view>
  56. </view>
  57. <view class="two_3_1">
  58. <view class="left">备注</view>
  59. <view class="right">{{shopInfo.remark}}</view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="foot">
  65. <view class="foot_1">
  66. <button class="button" @tap.stop="toAdd">加菜</button>
  67. </view>
  68. <view class="foot_2">
  69. <button class="button" @tap.stop="toBuy">结账</button>
  70. </view>
  71. </view>
  72. <uni-popup ref="popup" type="dialog">
  73. <uni-popup-dialog title="提示" content="请您前往前台付款!" :duration="2000" @close="close" @confirm="close">
  74. </uni-popup-dialog>
  75. </uni-popup>
  76. </view>
  77. </template>
  78. <script>
  79. export default {
  80. data() {
  81. return {
  82. id: '',
  83. shopInfo: {},
  84. list: [],
  85. }
  86. },
  87. onLoad: async function(e) {
  88. const that = this;
  89. that.$set(that, `id`, e.id);
  90. that.search();
  91. },
  92. onShow() {
  93. const that = this;
  94. },
  95. methods: {
  96. async search(e) {
  97. const that = this;
  98. if (that.id) {
  99. let res = await that.$api(`order/${that.id}`, 'GET', {});
  100. if (res.errcode == '0') {
  101. that.$set(that, `list`, res.data.list)
  102. that.$set(that, `shopInfo`, res.data)
  103. let table = await that.$api(`table/${res.data.table}`, `GET`)
  104. that.$set(that.shopInfo, `table_name`, table.data.name)
  105. }
  106. }
  107. },
  108. // 加菜
  109. toAdd() {
  110. const that = this;
  111. uni.navigateTo({
  112. url: `/pagesHome/home/index?id=${that.shopInfo.cart}&order=${that.id}`
  113. })
  114. },
  115. // 结账
  116. toBuy() {
  117. const that = this;
  118. that.$refs.popup.open()
  119. },
  120. close() {
  121. const that = this;
  122. that.$refs.popup.close()
  123. },
  124. }
  125. }
  126. </script>
  127. <style lang="scss">
  128. .content {
  129. font-family: 12px/1 Tahoma, Helvetica, Arial, "\5b8b\4f53", sans-serif;
  130. .info {
  131. display: flex;
  132. flex-direction: column;
  133. position: relative;
  134. flex-grow: 1;
  135. background-color: #f1f1f1;
  136. .one {
  137. height: 10vh;
  138. background-color: #FF7800;
  139. color: #ffffff;
  140. padding: 4vw 2vw;
  141. font-size: 18px;
  142. }
  143. .two {
  144. width: 92vw;
  145. padding: 0 4vw;
  146. position: absolute;
  147. top: 16vw;
  148. .two_1 {
  149. display: flex;
  150. justify-content: space-between;
  151. align-items: center;
  152. background-color: #ffffff;
  153. border-radius: 3vw;
  154. padding: 4vw 2vw;
  155. .left {
  156. font-size: 16px;
  157. font-weight: 600;
  158. }
  159. .right {
  160. font-size: 14px;
  161. }
  162. }
  163. .two_2 {
  164. margin: 2vw 0;
  165. padding: 2vw;
  166. background-color: #ffffff;
  167. border-radius: 4vw;
  168. .two_2_1 {
  169. padding: 2vw 0;
  170. font-size: 16px;
  171. font-weight: 600;
  172. }
  173. .two_2_2 {
  174. position: relative;
  175. display: flex;
  176. flex-direction: column;
  177. height: 32vh;
  178. .list {
  179. display: flex;
  180. width: 84vw;
  181. margin: 0 0 2vw 0;
  182. padding: 2vw;
  183. box-shadow: 0 0 5px #f1f1f1;
  184. border-radius: 5px;
  185. .img {
  186. width: 25vw;
  187. .image {
  188. width: 25vw;
  189. height: 20vw;
  190. border-radius: 5px;
  191. }
  192. }
  193. .infoList {
  194. width: 35vw;
  195. padding: 0 0 0 2vw;
  196. .name {
  197. font-size: 16px;
  198. }
  199. .spec {
  200. font-size: 12px;
  201. color: #858585;
  202. }
  203. }
  204. .money {
  205. display: flex;
  206. flex-direction: column;
  207. align-items: flex-end;
  208. width: 20vw;
  209. font-size: 14px;
  210. text:first-child {
  211. color: #FF8C00;
  212. }
  213. }
  214. }
  215. }
  216. .two_2_3 {
  217. .two_2_3_1 {
  218. display: flex;
  219. justify-content: space-between;
  220. align-items: center;
  221. font-size: 14px;
  222. padding: 2vw 3vw;
  223. .left {
  224. text {
  225. color: #858585;
  226. font-size: 12px;
  227. margin: 0 2vw;
  228. }
  229. }
  230. .right {
  231. color: #FF7800;
  232. }
  233. }
  234. .two_2_3_2 {
  235. padding: 3vw;
  236. text-align: right;
  237. font-size: 14px;
  238. color: #858585;
  239. border-top: 1px solid #f1f1f1;
  240. text:first-child {
  241. color: #FF7800;
  242. }
  243. text:last-child {
  244. color: #FF7800;
  245. font-size: 18px;
  246. }
  247. }
  248. }
  249. }
  250. .two_3 {
  251. margin: 2vw 0;
  252. padding: 2vw;
  253. background-color: #ffffff;
  254. border-radius: 4vw;
  255. .two_3_1 {
  256. display: flex;
  257. justify-content: space-between;
  258. padding: 2vw;
  259. font-size: 14px;
  260. border-bottom: 1px solid #f1f1f1;
  261. }
  262. }
  263. }
  264. }
  265. .foot {
  266. display: flex;
  267. justify-content: space-around;
  268. align-items: center;
  269. padding: 2vw 3vw;
  270. background-color: #ffffff;
  271. border-top: 1px solid #f1f1f1;
  272. .foot_1 {
  273. .button {
  274. background-color: #ffffff;
  275. color: #FF8C00;
  276. border: 1px solid #FF8C00;
  277. border-radius: 5vw;
  278. padding: 0 15vw;
  279. font-size: 16px;
  280. }
  281. }
  282. .foot_2 {
  283. .button {
  284. background-color: #FF8C00;
  285. color: #ffffff;
  286. border-radius: 5vw;
  287. padding: 0 15vw;
  288. font-size: 16px;
  289. }
  290. }
  291. }
  292. }
  293. .scroll-view {
  294. position: absolute;
  295. top: 0;
  296. left: 0;
  297. right: 0;
  298. bottom: 0;
  299. .list-scroll-view {
  300. display: flex;
  301. flex-direction: column;
  302. }
  303. }
  304. </style>