index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <view>
  3. <u-navbar leftIconSize="0" :placeholder="true" bgColor="#ffffff">
  4. <view class="u-nav-slot" slot="left">
  5. <u-tabs @change="changeTab" :scrollable="false" :list="statusArr" lineWidth="30" lineHeight="1"
  6. lineColor="#E96737" :activeStyle="{
  7. color: '#E96737',
  8. transform: 'scale(1)',
  9. width: '65px',
  10. }" :inactiveStyle="{
  11. color: '#333',
  12. transform: 'scale(1)',
  13. width: '65px'
  14. }" itemStyle="padding-left: 11px; padding-right: 11px; height: 44px;text-align: center;">
  15. </u-tabs>
  16. </view>
  17. </u-navbar>
  18. <view class="order-list">
  19. <view class="order-list-data">
  20. <view class="order-list-data-item" v-for="(item, index) in list" :key="index">
  21. <view class="order-list-data-item__info">
  22. <view class="flex order-list-data-item__info__title">
  23. <view class="number">
  24. <text>订单编号:</text>
  25. <text>{{ item.orderId }}</text>
  26. </view>
  27. <view class="success" v-if="item.status.value == 1">{{ item.status.desc }}</view>
  28. <view v-else>{{ item.status.desc }}</view>
  29. </view>
  30. <navigator :url="`/packageGoods/order/detail?id=${ item.orderId }`" hover-class="navigator-hover">
  31. <view class="flex order-list-data-item__info__detail"
  32. v-for="(items, index) in item.items" :key="index">
  33. <view class="order-list-data-item__info__detail__left">
  34. <view class="img">
  35. <image class="img" :src="items.picUrl" mode="aspectFill">
  36. </image>
  37. </view>
  38. </view>
  39. <view class="order-list-data-item__info__detail__right">
  40. <view class="ells title">{{ items.title }}</view>
  41. <view class="sku" v-if="items.properties">规格:{{ items.properties }}</view>
  42. <view class="num">数量:{{ items.goodsNum }}</view>
  43. </view>
  44. </view>
  45. </navigator>
  46. <view class="order-list-data-item__info__total">
  47. <view>共{{ item.orderNum }}个商品</view>
  48. <view class="money">
  49. <text v-if="item.status.value == 0">应付:</text>
  50. <text v-else>实付:</text>
  51. <text>¥{{ $numberFormat(item.payAmt) }}</text>
  52. </view>
  53. </view>
  54. <view class="order-list-data-item__info__btn" v-if="item.status.value == 0">
  55. <text @click="cancelOrder(item.orderId)" style="border-color: #666;">取消订单</text>
  56. <text @click="payOrder(item)">去支付</text>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="flex empty" v-if="!list.length && !loading">
  62. <u-empty text="活动为空" mode="order" />
  63. </view>
  64. </view>
  65. <custom-tab-bar :activeValue="'activity'" />
  66. </view>
  67. </template>
  68. <script>
  69. export default {
  70. data() {
  71. return {
  72. list:[],
  73. statusArr: [{
  74. name: '正在进行'
  75. }, {
  76. name: '已开奖',
  77. } ],
  78. }
  79. },
  80. methods: {
  81. changeTab(e) {
  82. if (e.index == 0) {
  83. this.status = null
  84. } else if (e.index == 1) {
  85. this.status = '0'
  86. }
  87. // this.pageList()
  88. },
  89. }
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. .order-list {
  94. background-color: #F8F8F8;
  95. margin: 0rpx 10rpx 0;
  96. padding-top: 100rpx;
  97. &-data {
  98. navigator {
  99. margin-bottom: 10rpx;
  100. }
  101. navigator:last-child {
  102. margin-bottom: 0;
  103. }
  104. &-item {
  105. margin-bottom: 10rpx;
  106. padding: 20rpx 30rpx;
  107. background-color: #FFFFFF;
  108. justify-content: space-between;
  109. background-color: #FFFFFF;
  110. }
  111. &-item {
  112. &__info {
  113. &__title {
  114. justify-content: space-between;
  115. .number {
  116. line-height: 40rpx;
  117. }
  118. .success {
  119. color: $uni-text-color;
  120. }
  121. }
  122. &__detail {
  123. padding: 20rpx 0;
  124. justify-content: space-between;
  125. border-bottom: 1px solid rgba(236, 236, 236, 100);
  126. &__left {
  127. display: flex;
  128. height: 170rpx;
  129. .img {
  130. image {
  131. width: 170rpx;
  132. height: 170rpx;
  133. margin-right: 20rpx;
  134. }
  135. }
  136. }
  137. &__right {
  138. flex: 1;
  139. display: flex;
  140. height: 170rpx;
  141. flex-direction: column;
  142. justify-content: space-between;
  143. align-items: flex-start;
  144. font-size: 30rpx;
  145. .title{
  146. font-weight: bold;
  147. }
  148. .sku {
  149. color: #848484;
  150. }
  151. }
  152. }
  153. &__detail:last-child {
  154. border: none;
  155. }
  156. &__total {
  157. display: flex;
  158. align-items: center;
  159. justify-content: flex-end;
  160. padding: 10rpx 0;
  161. .money {
  162. font-weight: bold;
  163. margin-left: 54rpx;
  164. }
  165. }
  166. &__btn {
  167. display: flex;
  168. align-items: center;
  169. justify-content: flex-end;
  170. padding-top: 10rpx;
  171. border-top: 1px solid rgba(236, 236, 236, 100);
  172. text {
  173. display: block;
  174. box-sizing: border-box;
  175. margin: 0 0 0 40rpx;
  176. width: 160rpx;
  177. height: 60rpx;
  178. line-height: 60rpx;
  179. text-align: center;
  180. font-size: 24rpx;
  181. border-radius: 8rpx;
  182. border: none;
  183. }
  184. text:first-child {
  185. background-color: #fff;
  186. line-height: 56rpx;
  187. border: 2rpx solid $uni-bg-color;
  188. }
  189. text:last-child {
  190. background-color: $uni-bg-color;
  191. color: #FFFFFF;
  192. }
  193. }
  194. }
  195. }
  196. }
  197. }
  198. .empty {
  199. height: 60vh;
  200. }
  201. </style>