take-order.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <view class="page safe-area-inset-bottom">
  3. <view class="card u-border-bottom ">
  4. <text >{{shop.name}}</text>
  5. <view class="">
  6. <view @click="$util.callPhone(shop.personTel)" class="cuIcon cu-btn sm btn-icon">
  7. <u-icon name="phone-fill" color="#FF9447"></u-icon>
  8. </view>
  9. <view class="cuIcon cu-btn sm btn-icon margin-left-30">
  10. <u-icon name="map-fill" color="#FF9447"></u-icon>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="section">
  15. </view>
  16. <view class="card section" style="flex-direction: column;">
  17. <view class="center text-bold margin-50" style="font-size: 66rpx;">
  18. <text>{{order.verifyNum}}</text>
  19. </view>
  20. <view class="cu-steps steps-arrow margin-bottom-50">
  21. <view class="cu-item" :class="index>stepIndex?'text-default':'text-base'" v-for="(item,index) in stepList" :key="index">
  22. <text style="font-size: 70rpx;margin-bottom: 20rpx;margin-right: 10rpx;" :class="'cuIcon-' + item.icon"></text>
  23. <text >{{item.name}}</text>
  24. </view>
  25. </view>
  26. <view class="center padding-30" style="color: #999;">
  27. <text>备注:{{order.extraInfo}}</text>
  28. </view>
  29. </view>
  30. <view class="section"></view>
  31. <view class="padding-10 bg-white">
  32. <u-read-more ref="uReadMore" close-text="展开更多" show-height="300" color="#999">
  33. <view v-for="(item,index) in cart" :key="index" class="cart">
  34. <view class="flex" style="width: 70%;">
  35. <image :src="item.image" mode=""></image>
  36. <view class="item-content " >
  37. <text class="text-cut-1">{{item.name}}</text>
  38. <text class="text-cut-1">{{item.propertyStr ? item.propertyStr : item.name}}</text>
  39. </view>
  40. </view>
  41. <view class="item-data">
  42. <view class="">
  43. <text class="text-sm">x</text>
  44. <text class="text-lg" style="margin-left: 6rpx;">{{item.number}}</text>
  45. </view>
  46. <text class=" text-lg">{{item.realPrice / 100}}</text>
  47. </view>
  48. </view>
  49. </u-read-more>
  50. </view>
  51. <!-- 订单金额 -->
  52. <view class="">
  53. <view class="card text-df" v-if="$isNotEmpty(order.packingPrice)&&order.packingPrice != -1">
  54. <text class="text-gray">包装费</text>
  55. <text class="text-price">{{order.packingPrice / 100}}</text>
  56. </view>
  57. <view class="card text-df" v-if="$isNotEmpty(order.sendingPrice)&&order.sendingPrice != -1">
  58. <text class="text-gray">配送费</text>
  59. <text class="text-price">{{order.sendingPrice / 100}}</text>
  60. </view>
  61. <view class="card text-df ">
  62. <text class="text-gray">金额总计</text>
  63. <view class="">
  64. <text class="text-price">{{order.totalPrice / 100}}</text>
  65. </view>
  66. </view>
  67. </view>
  68. <view class="section"></view>
  69. <view class="">
  70. <view class="card text-df" >
  71. <text class="text-gray">取单号</text>
  72. <text class="">{{order.verifyNum}}</text>
  73. </view>
  74. <view class="card text-df" v-if="$isNotEmpty(order.seatNum) && order.seatNum !=-1">
  75. <text class="text-gray">座位号</text>
  76. <text class="">{{order.seatNum}}</text>
  77. </view>
  78. <view class="card text-df" >
  79. <text class="text-gray">下单时间</text>
  80. <text class="">{{order.createTime}}</text>
  81. </view>
  82. <view class="card text-df" >
  83. <text class="text-gray">下单门店</text>
  84. <text class="">{{shop.name}}</text>
  85. </view>
  86. <view class="card text-df" >
  87. <text class="text-gray">付款状态</text>
  88. <text class="">{{order.payStatus}}</text>
  89. </view>
  90. <view class="card text-df" >
  91. <text class="text-gray">订单状态</text>
  92. <text class="">{{order.orderStatus}}</text>
  93. </view>
  94. <view class="card text-df" >
  95. <text class="text-gray">订单号</text>
  96. <text class="">{{order.id}}</text>
  97. </view>
  98. </view>
  99. <view class="">
  100. <view class="card text-df" >
  101. <text class="text-gray">下单手机号</text>
  102. <text class="">{{order.userPhone}}</text>
  103. </view>
  104. <view class="card text-df" >
  105. <text class="text-gray">取餐方式</text>
  106. <text class="">{{order.takeType}}</text>
  107. </view>
  108. <view class="card text-df">
  109. <text class="text-gray">取餐时间</text>
  110. <text class="">{{order.takeTime || '立即就餐'}}</text>
  111. </view>
  112. </view>
  113. </view>
  114. </template>
  115. <script>
  116. export default {
  117. name: '',
  118. data() {
  119. return {
  120. id:'',
  121. order:{},
  122. shop:{},
  123. cart:[],
  124. //订单流程
  125. stepList:[{
  126. name:'待付款',
  127. icon:'rechargefill'
  128. },
  129. {
  130. name:'已付款',
  131. icon:'roundcheckfill'
  132. },
  133. {
  134. name:'制作中',
  135. icon:'timefill'
  136. },
  137. {
  138. name:'已完成',
  139. icon:'goodsfill'
  140. }],
  141. };
  142. },
  143. onLoad(options) {
  144. this.id=options.id
  145. this.fetchDetail()
  146. },
  147. computed:{
  148. stepIndex:{
  149. get(){
  150. if (this.order.orderStatus == '待付款') {
  151. return 0
  152. }else{
  153. return 2
  154. }
  155. }
  156. }
  157. },
  158. methods:{
  159. fetchDetail(){
  160. let params={
  161. id:this.id
  162. }
  163. this.$api.order.detail(params).then(res=>{
  164. this.order=res.data || {}
  165. this.shop=this.order.shop || {}
  166. this.cart=JSON.parse(this.order.goodsPreview)
  167. })
  168. }
  169. }
  170. };
  171. </script>
  172. <style lang="scss" scoped>
  173. .page{
  174. margin: 20rpx;
  175. }
  176. .text-default{
  177. color: #ffbf91;
  178. }
  179. .btn-icon{
  180. background-color: rgba(255, 148, 71,.3);
  181. color: #FF9447;
  182. }
  183. .card {
  184. padding: 30rpx;
  185. background-color: #FFFFFF;
  186. border-bottom: 1rpx solid #f1f1f1;
  187. display: flex;
  188. justify-content: space-between;
  189. }
  190. .cart {
  191. border-bottom: 1rpx solid #f1f1f1;
  192. display: flex;
  193. background-color: #FFFFFF;
  194. padding: 15rpx 0;
  195. image {
  196. width: 100rpx;
  197. height: 100rpx;
  198. border-radius: 8rpx;
  199. }
  200. .item-content {
  201. width: calc(100% - 100rpx);
  202. margin-left: -40rpx;
  203. display: flex;
  204. flex-direction: column;
  205. justify-content: space-between;
  206. text:first-child {
  207. font-size: 30rpx;
  208. }
  209. text:last-child {
  210. font-size: 24rpx;
  211. color: #999;
  212. font-weight: 400;
  213. }
  214. }
  215. .item-data {
  216. display: flex;
  217. align-items: center;
  218. width: 30%;
  219. justify-content: space-between;
  220. margin-right: 20rpx;
  221. }
  222. }
  223. .cart:last-child {
  224. border: none;
  225. }
  226. </style>