|
| 1 | + <template> |
| 2 | + <div class="order_detail_page"> |
| 3 | + <section v-if="!showLoading"> |
| 4 | + <head-top head-title="订单详情" go-back='true'></head-top> |
| 5 | + <section class="order_titel"> |
| 6 | + <img :src="orderDetail.restaurant_image_url"> |
| 7 | + <p>{{orderDetail.status_bar.title}}</p> |
| 8 | + <p>{{orderDetail.timeline_node.description}}</p> |
| 9 | + <router-link class="order_again" :to="{path: '/shop', query: {geohash, id: orderDetail.restaurant_id}}">再来一单</router-link> |
| 10 | + </section> |
| 11 | + <section class="food_list"> |
| 12 | + <router-link class="food_list_header" :to="{path: '/shop', query: {geohash, id: orderDetail.restaurant_id}}"> |
| 13 | + <div class="shop_name"> |
| 14 | + <img :src="orderDetail.restaurant_image_url"> |
| 15 | + <span>{{orderDetail.restaurant_name}}</span> |
| 16 | + </div> |
| 17 | + <svg fill="#333" class="arrow_right"> |
| 18 | + <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#arrow-right"></use> |
| 19 | + </svg> |
| 20 | + </router-link> |
| 21 | + <ul class="food_list_ul"> |
| 22 | + <li v-for="item in orderDetail.basket.group[0]"> |
| 23 | + <p class="food_name ellipsis">{{item.name}}</p> |
| 24 | + <div class="quantity_price"> |
| 25 | + <span>X{{item.quantity}}</span> |
| 26 | + <span>¥{{item.price}}</span> |
| 27 | + </div> |
| 28 | + </li> |
| 29 | + </ul> |
| 30 | + <div class="deliver_fee"> |
| 31 | + <span>配送费</span> |
| 32 | + <span>{{orderDetail.basket.deliver_fee.price}}</span> |
| 33 | + </div> |
| 34 | + <div class="pay_ment">实付{{orderDetail.total_amount.toFixed(2)}}</div> |
| 35 | + </section> |
| 36 | + <section class="order_detail_style"> |
| 37 | + <header>配送信息</header> |
| 38 | + <section class="item_style"> |
| 39 | + <p class="item_left">送达时间:</p> |
| 40 | + <div class="item_right"> |
| 41 | + <p>{{orderData.deliver_time}}</p> |
| 42 | + </div> |
| 43 | + </section> |
| 44 | + <section class="item_style"> |
| 45 | + <p class="item_left">送货地址:</p> |
| 46 | + <div class="item_right"> |
| 47 | + <p>{{orderData.consignee}}</p> |
| 48 | + <p>{{orderData.phone}}</p> |
| 49 | + <p>{{orderData.address}}</p> |
| 50 | + </div> |
| 51 | + </section> |
| 52 | + <section class="item_style"> |
| 53 | + <p class="item_left">配送方式:</p> |
| 54 | + <div class="item_right"> |
| 55 | + <p>蜂鸟专送</p> |
| 56 | + </div> |
| 57 | + </section> |
| 58 | + </section> |
| 59 | + <section class="order_detail_style"> |
| 60 | + <header>订单信息</header> |
| 61 | + <section class="item_style"> |
| 62 | + <p class="item_left">订单号:</p> |
| 63 | + <div class="item_right"> |
| 64 | + <p>{{orderDetail.id}}</p> |
| 65 | + </div> |
| 66 | + </section> |
| 67 | + <section class="item_style"> |
| 68 | + <p class="item_left">支付方式:</p> |
| 69 | + <div class="item_right"> |
| 70 | + <p>在线支付</p> |
| 71 | + </div> |
| 72 | + </section> |
| 73 | + <section class="item_style"> |
| 74 | + <p class="item_left">下单时间:</p> |
| 75 | + <div class="item_right"> |
| 76 | + <p>{{orderDetail.formatted_created_at}}</p> |
| 77 | + </div> |
| 78 | + </section> |
| 79 | + </section> |
| 80 | + </section> |
| 81 | + <transition name="loading"> |
| 82 | + <loading v-if="showLoading"></loading> |
| 83 | + </transition> |
| 84 | + </div> |
| 85 | +</template> |
| 86 | + |
| 87 | +<script> |
| 88 | + import {mapState, mapMutations} from 'vuex' |
| 89 | + import headTop from '../../../components/header/head' |
| 90 | + import {getImgPath} from '../../../components/common/mixin' |
| 91 | + import {getOrderDetail} from '../../../service/getData' |
| 92 | + import loading from '../../../components/common/loading' |
| 93 | +
|
| 94 | + export default { |
| 95 | + data(){ |
| 96 | + return{ |
| 97 | + showLoading: true, //显示加载动画 |
| 98 | + orderData: null, |
| 99 | + } |
| 100 | + }, |
| 101 | + mounted(){ |
| 102 | + this.initData(); |
| 103 | + }, |
| 104 | + mixins: [getImgPath], |
| 105 | + components: { |
| 106 | + headTop, |
| 107 | + loading, |
| 108 | + }, |
| 109 | + computed: { |
| 110 | + ...mapState([ |
| 111 | + 'orderDetail', 'geohash', 'userInfo' |
| 112 | + ]), |
| 113 | + }, |
| 114 | + methods: { |
| 115 | + async initData(){ |
| 116 | + // this.orderData = await getOrderDetail(this.userInfo.user_id, this.orderDetail.id); |
| 117 | + this.orderData = await getOrderDetail(1, 1); |
| 118 | + this.showLoading = false; |
| 119 | + }, |
| 120 | + } |
| 121 | + } |
| 122 | +</script> |
| 123 | + |
| 124 | +<style lang="scss" scoped> |
| 125 | + @import '../../../style/mixin'; |
| 126 | + |
| 127 | + .order_detail_page{ |
| 128 | + position: fixed; |
| 129 | + top: 0; |
| 130 | + left: 0; |
| 131 | + right: 0; |
| 132 | + bottom: 0; |
| 133 | + background-color: #f1f1f1; |
| 134 | + z-index: 202; |
| 135 | + padding-top: 1.95rem; |
| 136 | + overflow-y: auto; |
| 137 | + p, span{ |
| 138 | + font-family: Helvetica Neue,Tahoma,Arial; |
| 139 | + } |
| 140 | + } |
| 141 | + .order_titel{ |
| 142 | + display: flex; |
| 143 | + flex-direction: column; |
| 144 | + align-items: center; |
| 145 | + padding: .7rem; |
| 146 | + background-color: #fff; |
| 147 | + margin-bottom: 0.5rem; |
| 148 | + img{ |
| 149 | + border: 0.4rem solid #f5f5f5; |
| 150 | + border-radius: 50%; |
| 151 | + @include wh(3rem, 3rem); |
| 152 | + } |
| 153 | + p:nth-of-type(1){ |
| 154 | + @include sc(.9rem, #333); |
| 155 | + font-weight: bold; |
| 156 | + margin-top: .4rem; |
| 157 | + } |
| 158 | + p:nth-of-type(2){ |
| 159 | + @include sc(.55rem, #999); |
| 160 | + width: 10rem; |
| 161 | + margin-top: .3rem; |
| 162 | + text-align: center; |
| 163 | + } |
| 164 | + .order_again{ |
| 165 | + @include sc(.6rem, $blue); |
| 166 | + margin-top: .5rem; |
| 167 | + border: 0.025rem solid $blue; |
| 168 | + padding: .15rem .4rem; |
| 169 | + border-radius: .1rem; |
| 170 | + } |
| 171 | + } |
| 172 | + .food_list{ |
| 173 | + background-color: #fff; |
| 174 | + .food_list_header{ |
| 175 | + @include fj; |
| 176 | + align-items: center; |
| 177 | + padding: .2rem .5rem; |
| 178 | + border-bottom: 1px solid #f5f5f5; |
| 179 | + .shop_name{ |
| 180 | + img{ |
| 181 | + @include wh(1.2rem, 1.2rem); |
| 182 | + vertical-align: middle; |
| 183 | + margin-right: .2rem; |
| 184 | + } |
| 185 | + span{ |
| 186 | + @include sc(.75rem, #333); |
| 187 | + font-weight: bold; |
| 188 | + } |
| 189 | + } |
| 190 | + svg{ |
| 191 | + @include wh(.6rem, .6rem); |
| 192 | + fill: #666; |
| 193 | + } |
| 194 | + } |
| 195 | + .food_list_ul{ |
| 196 | + li{ |
| 197 | + @include fj; |
| 198 | + align-items: center; |
| 199 | + padding: 0 .5rem; |
| 200 | + line-height: 2rem; |
| 201 | + .food_name{ |
| 202 | + @include sc(.6rem, #666); |
| 203 | + flex: 4; |
| 204 | + } |
| 205 | + .quantity_price{ |
| 206 | + flex: 1; |
| 207 | + @include fj; |
| 208 | + align-items: center; |
| 209 | + span:nth-of-type(1){ |
| 210 | + @include sc(.6rem, #ccc); |
| 211 | + } |
| 212 | + span:nth-of-type(2){ |
| 213 | + @include sc(.6rem, #666); |
| 214 | + } |
| 215 | + } |
| 216 | + } |
| 217 | + } |
| 218 | + .deliver_fee{ |
| 219 | + @include fj; |
| 220 | + align-items: center; |
| 221 | + padding: 0 .5rem; |
| 222 | + line-height: 2rem; |
| 223 | + border-top: 1px solid #f5f5f5; |
| 224 | + span{ |
| 225 | + @include sc(.6rem, #666); |
| 226 | + } |
| 227 | + } |
| 228 | + .pay_ment{ |
| 229 | + @include sc(.6rem, #fb6b23); |
| 230 | + border-top: 1px solid #f5f5f5; |
| 231 | + font-weight: bold; |
| 232 | + line-height: 2rem; |
| 233 | + text-align: right; |
| 234 | + padding-right: .5rem; |
| 235 | + } |
| 236 | + } |
| 237 | + .order_detail_style{ |
| 238 | + background-color: #fff; |
| 239 | + margin-top: 0.5rem; |
| 240 | + header{ |
| 241 | + @include sc(.75rem, #333); |
| 242 | + padding: .5rem; |
| 243 | + border-bottom: 1px solid #f5f5f5; |
| 244 | + } |
| 245 | + .item_style{ |
| 246 | + display: flex; |
| 247 | + padding: .5rem; |
| 248 | + p{ |
| 249 | + @include sc(.65rem, #666); |
| 250 | + line-height: 1rem; |
| 251 | + } |
| 252 | + } |
| 253 | + } |
| 254 | + .loading-enter-active, .loading-leave-active { |
| 255 | + transition: opacity .7s |
| 256 | + } |
| 257 | + .loading-enter, .loading-leave-active { |
| 258 | + opacity: 0 |
| 259 | + } |
| 260 | + |
| 261 | +</style> |
0 commit comments