card.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <view class="">
  3. <view class="page-box">
  4. <view @click="jumpDetail(res)" class="order" v-for="(res, index) in list" :key="res.id">
  5. <view class="top center">
  6. <view class="left ">
  7. <text class="">{{res.takeType}}</text>
  8. <text v-if="res.takeType=='店内堂食'" class="text-bold text-lg" style="margin: 0rpx 10rpx;">#{{res.seatNum || 0}}</text>
  9. <text v-else class="text-bold text-lg" style="margin: 0rpx 10rpx;">#{{res.verifyNum}}</text>
  10. </view>
  11. <view class="right">{{res.orderStatus}}</view>
  12. </view>
  13. <view v-if="index<=1" class="item" style="width: 100%;" v-for="(item, index) in cart(res.goodsPreview)" :key="index">
  14. <view style="display: flex;">
  15. <view class="left">
  16. <image :src="item.image" mode="aspectFill"></image>
  17. </view>
  18. <view class="content">
  19. <view class="title u-line-2">{{ item.name }}</view>
  20. <view class="type">{{ item.description }}</view>
  21. </view>
  22. </view>
  23. <view class="right flex" >
  24. <view class="price center">
  25. ¥{{item.realPrice / 100}}
  26. </view>
  27. <view class="number center ">x{{ item.number }}</view>
  28. </view>
  29. </view>
  30. <view class="center text-gray" v-if="cart(res.goodsPreview).length>2">
  31. <text class="cuIcon-more" style="font-size: 36rpx;"></text>
  32. </view>
  33. <view class="total">
  34. 共{{res.goodsTotalNum}}件商品 合计:
  35. <text class="total-price">
  36. ¥{{ res.totalPrice / 100}}
  37. </text>
  38. </view>
  39. <view class="bottom" v-if="res.orderStatus == '制作中'">
  40. <view @click="confirm(res.id)" class="evaluate btn">确认订单</view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. props:{
  49. list:Array
  50. },
  51. data() {
  52. return {
  53. };
  54. },
  55. computed:{
  56. cart(){
  57. return data=>{
  58. return JSON.parse(data)
  59. }
  60. }
  61. },
  62. methods:{
  63. confirm(id){
  64. this.$emit('confirm',id)
  65. },
  66. jumpDetail(res){
  67. uni.navigateTo({
  68. url:"/pagesGoods/pages/order/detail?id="+res.id,
  69. fail(error) {
  70. console.log(error);
  71. }
  72. })
  73. }
  74. }
  75. };
  76. </script>
  77. <style lang="scss" scoped>
  78. .order {
  79. width: 720rpx;
  80. background-color: #ffffff;
  81. margin: 15rpx auto;
  82. border-radius: 20rpx;
  83. box-sizing: border-box;
  84. padding: 20rpx;
  85. font-size: 28rpx;
  86. .top {
  87. display: flex;
  88. justify-content: space-between;
  89. .left {
  90. display: flex;
  91. align-items: center;
  92. .store {
  93. margin: 0 10rpx;
  94. font-size: 32rpx;
  95. font-weight: bold;
  96. }
  97. }
  98. .right {
  99. color: $u-type-warning-dark;
  100. }
  101. }
  102. .item {
  103. display: flex;
  104. justify-content: space-between;
  105. margin: 20rpx 0 0;
  106. .left {
  107. margin-right: 20rpx;
  108. image {
  109. width: 90rpx;
  110. height: 90rpx;
  111. border-radius: 10rpx;
  112. }
  113. }
  114. .content {
  115. .title {
  116. font-size: 28rpx;
  117. line-height: 50rpx;
  118. }
  119. .type {
  120. margin: 10rpx 0;
  121. font-size: 24rpx;
  122. color: $u-tips-color;
  123. }
  124. .delivery-time {
  125. color: #e5d001;
  126. font-size: 24rpx;
  127. }
  128. }
  129. .right {
  130. margin-right: 20rpx;
  131. margin-left: 10rpx;
  132. padding-top: 20rpx;
  133. text-align: right;
  134. .decimal {
  135. font-size: 24rpx;
  136. margin-top: 4rpx;
  137. }
  138. .number {
  139. color: $u-tips-color;
  140. font-size: 24rpx;
  141. margin-left: 15rpx;
  142. }
  143. }
  144. }
  145. .total {
  146. margin-top: 20rpx;
  147. text-align: right;
  148. font-size: 24rpx;
  149. .total-price {
  150. font-size: 32rpx;
  151. }
  152. }
  153. .bottom {
  154. display: flex;
  155. margin-top: 40rpx;
  156. justify-content: flex-end;
  157. align-items: center;
  158. .btn {
  159. line-height: 48rpx;
  160. width: 140rpx;
  161. border-radius: 26rpx;
  162. border: 2rpx solid $u-border-color;
  163. font-size: 24rpx;
  164. text-align: center;
  165. color: $u-type-info-dark;
  166. }
  167. .evaluate {
  168. background-color: $u-type-warning-dark;
  169. color: #FFFFFF;
  170. border-color: $u-type-warning-dark;
  171. }
  172. }
  173. }
  174. </style>