take-order.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <view class="page">
  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: 80rpx;margin-bottom: 20rpx;margin-right: 10rpx;" :class="'cuIcon-' + item.icon"></text>
  23. <text >{{item.name}}</text>
  24. </view>
  25. </view>
  26. <u-read-more ref="uReadMore" close-text="展开更多" show-height="300" color="#999">
  27. <view v-for="(item,index) in cart" :key="index" class="cart">
  28. <view class="flex" style="width: 70%;">
  29. <image :src="item.image" mode=""></image>
  30. <view class="item-content " >
  31. <text class="text-cut-1">{{item.name}}</text>
  32. <text class="text-cut-1">{{item.propertyStr ? item.propertyStr : item.name}}</text>
  33. </view>
  34. </view>
  35. <view class="item-data">
  36. <view class="">
  37. <text class="text-sm">x</text>
  38. <text class="text-lg" style="margin-left: 6rpx;">{{item.number}}</text>
  39. </view>
  40. <text class="text-price text-lg">{{item.realPrice / 100}}</text>
  41. </view>
  42. </view>
  43. </u-read-more>
  44. </view>
  45. <view class="card text-df ">
  46. <text class="text-gray">金额总计</text>
  47. <view class="">
  48. <text class="text-price">{{order.totalPrice / 100}}</text>
  49. </view>
  50. </view>
  51. <view class="card text-df" v-if="$isNotEmpty(order.packingPrice)&&order.packingPrice != -1">
  52. <text class="text-gray">包装费</text>
  53. <text class="text-price">{{order.packingPrice / 100}}</text>
  54. </view>
  55. <view class="card text-df" v-if="$isNotEmpty(order.sendingPrice)&&order.sendingPrice != -1">
  56. <text class="text-gray">配送费</text>
  57. <text class="text-price">{{order.sendingPrice / 100}}</text>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. name: '',
  64. data() {
  65. return {
  66. id:'',
  67. order:{},
  68. shop:{},
  69. cart:[],
  70. //订单流程
  71. stepList:[{
  72. name:'待付款',
  73. icon:'rechargefill'
  74. },
  75. {
  76. name:'制作中',
  77. icon:'timefill'
  78. },
  79. {
  80. name:'已完成',
  81. icon:'roundcheckfill'
  82. }],
  83. };
  84. },
  85. onLoad(options) {
  86. this.id=options.id || '1442319466162036738'
  87. this.fetchDetail()
  88. },
  89. computed:{
  90. stepIndex:{
  91. get(){
  92. if (this.order.orderStatus == '待付款') {
  93. return 0
  94. }else{
  95. return 2
  96. }
  97. }
  98. }
  99. },
  100. methods:{
  101. fetchDetail(){
  102. let params={
  103. id:this.id
  104. }
  105. this.$api.order.detail(params).then(res=>{
  106. this.order=res.data || {}
  107. this.shop=this.order.shop || {}
  108. this.cart=JSON.parse(this.order.goodsPreview)
  109. })
  110. }
  111. }
  112. };
  113. </script>
  114. <style lang="scss" scoped>
  115. .page{
  116. margin: 20rpx;
  117. }
  118. .text-default{
  119. color: #ffbf91;
  120. }
  121. .btn-icon{
  122. background-color: rgba(255, 148, 71,.3);
  123. color: #FF9447;
  124. }
  125. .card {
  126. padding: 30rpx;
  127. background-color: #FFFFFF;
  128. border-bottom: 1rpx solid #f1f1f1;
  129. display: flex;
  130. justify-content: space-between;
  131. }
  132. .cart {
  133. border-bottom: 1rpx solid #f1f1f1;
  134. display: flex;
  135. background-color: #FFFFFF;
  136. padding: 15rpx 0;
  137. image {
  138. width: 100rpx;
  139. height: 100rpx;
  140. border-radius: 8rpx;
  141. }
  142. .item-content {
  143. width: calc(100% - 100rpx);
  144. margin-left: -40rpx;
  145. display: flex;
  146. flex-direction: column;
  147. justify-content: space-between;
  148. text:first-child {
  149. font-size: 30rpx;
  150. }
  151. text:last-child {
  152. font-size: 24rpx;
  153. color: #999;
  154. font-weight: 400;
  155. }
  156. }
  157. .item-data {
  158. display: flex;
  159. align-items: center;
  160. width: 30%;
  161. justify-content: space-between;
  162. margin-right: 20rpx;
  163. }
  164. }
  165. .cart:last-child {
  166. border: none;
  167. }
  168. </style>