order-details.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <template>
  2. <view>
  3. <view class="location">
  4. <view class="contacts">
  5. <view class="name">
  6. {{order.poststation.contacts}}
  7. </view>
  8. <view class="phone">
  9. {{order.poststation.phone}}
  10. </view>
  11. </view>
  12. <view class="address">
  13. {{order.poststation.address}}
  14. </view>
  15. </view>
  16. <view class="order">
  17. <view class="order-head">
  18. <view class="factory-name">{{order.seller.nickname?order.seller.nickname:'省心直供(该厂家暂未设置昵称)'}}</view>
  19. <view v-if="order.status === 'wait_pay'" class="order-status">待付款</view>
  20. <view v-if="order.status === 'wait_deliver'" class="order-status">待发货</view>
  21. <view v-if="order.status === 'wait_sign'" class="order-status">待签收</view>
  22. <view v-if="order.status === 'complete'" class="order-status">已完成</view>
  23. <view v-if="order.status === 'invalid'" class="order-status">已失效</view>
  24. </view>
  25. <view class="order-info">
  26. <view class="product-item" v-for="product in order.products_json">
  27. <view class="product-image">
  28. <image class="image" :src="product.spec_image" mode="scaleToFill"></image>
  29. </view>
  30. <view class="product-info">
  31. <view class="row">
  32. <view class="name">{{product.name}}</view>
  33. <view class="price">¥{{product.spec_price}}</view>
  34. </view>
  35. <view class="row">
  36. <view class="spec">{{product.spec_name}}</view>
  37. <view class="num">×{{product.num}}</view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="total-price">
  43. 总价 <text class="warning">¥{{order.total_amount}}</text>
  44. </view>
  45. </view>
  46. <view class="info">
  47. <view class="title">订单信息</view>
  48. <view class="row">
  49. <view class="label">订单编号</view>
  50. <view>{{order.order_no}}</view>
  51. </view>
  52. <view class="row">
  53. <view class="label">支付宝交易号</view>
  54. <view>456451512316545113215645</view>
  55. </view>
  56. <view class="row">
  57. <view class="label">创建时间</view>
  58. <view>{{order.createtime|datetimeFilter}}</view>
  59. </view>
  60. <view class="row" v-if="order.paytime">
  61. <view class="label">付款时间</view>
  62. <view>{{order.paytime|datetimeFilter}}</view>
  63. </view>
  64. <view class="row" v-if="order.deliver_time">
  65. <view class="label">发货时间</view>
  66. <view>{{order.deliver_time|datetimeFilter}}</view>
  67. </view>
  68. <view v-if="false" class="option">
  69. <view class="option-item">
  70. <uni-icons class="icon" color="#666666" type="chatboxes-filled"></uni-icons>
  71. 联系卖家
  72. </view>
  73. <view class="option-item">
  74. <uni-icons class="icon" color="#666666" type="phone-filled"></uni-icons>
  75. 拨打电话
  76. </view>
  77. </view>
  78. </view>
  79. <view v-if="order.status === 'wait_pay' || order.status === 'wait_sign'" class="footer">
  80. <view class="option">
  81. <button v-if="order.status === 'wait_pay'" class="pay-btn" type="default" @tap="goToCashier">立即支付</button>
  82. <button v-if="order.status === 'wait_sign'" class="confirm-btn" type="default">确认收货</button>
  83. </view>
  84. </view>
  85. </view>
  86. </template>
  87. <script>
  88. export default {
  89. data() {
  90. return {
  91. order: {
  92. seller: {}
  93. }
  94. }
  95. },
  96. onLoad(option) {
  97. this.order.id = option.id;
  98. this.getOrderData();
  99. },
  100. methods: {
  101. getOrderData() {
  102. this.$http.get({
  103. url: "/order",
  104. data: {
  105. id: this.order.id
  106. },
  107. success: (res) => {
  108. res.data.data.products_json = JSON.parse(res.data.data.products_snapshot)
  109. this.order = res.data.data
  110. }
  111. })
  112. },
  113. goToCashier() {
  114. uni.navigateTo({
  115. url: "/pages/order/cashier?order_no=" + this.order.order_no
  116. })
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="scss" scoped>
  122. .location {
  123. padding: 40upx 20upx;
  124. background: white url(../../static/images/location.png) no-repeat;
  125. // background-color: white;
  126. background-size: 75upx 75upx;
  127. background-position: 30upx;
  128. .contacts {
  129. display: flex;
  130. align-items: center;
  131. margin-left: 100upx;
  132. .name {
  133. margin-right: 20upx;
  134. font-size: 28upx;
  135. }
  136. .phone {
  137. font-size: 24upx;
  138. color: #999999;
  139. }
  140. }
  141. .address {
  142. margin-left: 100upx;
  143. font-size: 28upx;
  144. margin-top: 10upx;
  145. }
  146. }
  147. .order {
  148. background: white;
  149. margin-top: 20upx;
  150. padding: 20upx;
  151. // border-radius: 20upx;
  152. .order-head {
  153. display: flex;
  154. justify-content: space-between;
  155. margin-bottom: 20upx;
  156. .order-status {
  157. color: $primary-color;
  158. font-size: 24upx;
  159. }
  160. }
  161. .factory-name {
  162. font-size: 28upx;
  163. font-weight: bold;
  164. }
  165. .product-item {
  166. display: flex;
  167. .product-image {
  168. width: 120upx;
  169. height: 120upx;
  170. margin-right: 20upx;
  171. margin-top: 10upx;
  172. .image {
  173. width: 120upx;
  174. height: 120upx;
  175. }
  176. }
  177. .product-info {
  178. flex-grow: 1;
  179. font-size: 28upx;
  180. .name {
  181. font-size: 28upx;
  182. white-space: normal;
  183. display: -webkit-box;
  184. -webkit-box-orient: vertical;
  185. -webkit-line-clamp: 2;
  186. overflow: hidden;
  187. }
  188. .num {
  189. color: #999999;
  190. }
  191. .spec {
  192. font-size: 26upx;
  193. background: #CCCCCC;
  194. color: white;
  195. padding: 0 10upx;
  196. border-radius: 10upx;
  197. }
  198. }
  199. .row {
  200. display: flex;
  201. justify-content: space-between;
  202. margin-bottom: 10upx;
  203. }
  204. }
  205. .total-price {
  206. text-align: right;
  207. font-size: 28upx;
  208. padding: 10upx 0;
  209. .warning {
  210. color: $primary-color;
  211. font-weight: bold;
  212. }
  213. }
  214. }
  215. .info {
  216. background: white;
  217. margin-top: 20upx;
  218. padding: 20upx;
  219. .title {
  220. font-size: 30upx;
  221. margin-bottom: 20upx;
  222. font-weight: bold;
  223. }
  224. .row {
  225. display: flex;
  226. font-size: 26upx;
  227. margin: 10upx 0;
  228. & .label {
  229. width: 200upx;
  230. }
  231. }
  232. .option {
  233. display: flex;
  234. justify-content: space-around;
  235. text-align: center;
  236. padding: 20upx 0 0 0;
  237. border-top: 2upx solid #EEEEEE;
  238. color: #666666;
  239. margin-top: 40upx;
  240. .icon {
  241. margin-right: 10upx;
  242. }
  243. .option-item {
  244. flex: 1;
  245. }
  246. .option-item:first-child {
  247. border-right: 2upx solid #EEEEEE;
  248. }
  249. }
  250. }
  251. .footer {
  252. height: 80upx;
  253. background: white;
  254. position: fixed;
  255. bottom: 0;
  256. width: 100%;
  257. box-shadow: 0 0 10upx #EEEEEE;
  258. .option {
  259. text-align: right;
  260. margin: 15upx;
  261. .pay-btn,
  262. .confirm-btn {
  263. background: white;
  264. border: 2upx solid $primary-color;
  265. display: inline-block;
  266. line-height: normal;
  267. font-size: 28upx;
  268. color: $primary-color;
  269. border-radius: 40upx;
  270. padding: 5upx 10upx;
  271. }
  272. }
  273. }
  274. </style>