app-order-list.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <view class="app-order-list">
  3. <view class="app-item" v-for="(item, index) in list" :key="index">
  4. <view class="app-top app-border main-between dir-left-nowrap cross-center">
  5. <text :class="theme + '-m-text ' + theme">
  6. {{item.status_cn}}
  7. </text>
  8. <view class="app-order-time" v-if="item.status === 1">
  9. <text style="margin-right: 20rpx;">剩</text>
  10. <block>
  11. <app-order-time :time="item.end_date_time"></app-order-time>
  12. </block>
  13. </view>
  14. </view>
  15. <view class="app-center app-border dir-top-nowrap">
  16. <view class="app-center-top dir-left-nowrap">
  17. <image class="app-image" lazy-load :src="item.detail[0].goods_info.cover_pic"></image>
  18. <view class="app-content dir-top-nowrap">
  19. <text class="app-name">{{item.detail[0].goods_info.name}}</text>
  20. <view class="app-attr">
  21. <text v-for="(attr, i) in item.detail[0].goods_info.attr_list" :key="i">{{attr.attr_group_name}}:{{attr.attr_name}}</text>
  22. </view>
  23. <view class="app-price-num dir-left-nowrap main-between">
  24. <text class="app-num">{{item.detail[0].num}}</text>
  25. <text class="app-price">{{item.detail[0].total_price}}</text>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="app-center-bottom dir-left-nowrap main-right">
  30. <text class="app-t">合计:</text>
  31. <text class="app-n" :class="theme + '-m-text ' + theme">{{item.total_pay_price}}</text>
  32. </view>
  33. </view>
  34. <view class="app-bottom main-right cross-center">
  35. <view class="app-button app-white-button" v-if="item.status === 2">
  36. <app-jump-button form :url="`/pages/order/order-detail/order-detail?id=${item.id}`">
  37. 订单详情
  38. </app-jump-button>
  39. </view>
  40. <view class="app-button app-red-button" :class="theme+ '-m-back ' + theme" v-if="item.is_pay === 0 && item.pay_type !== 2 && (item.status === 0 || item.status === 1)">
  41. <app-form-id from @click="goPay(item.id, item.id)">
  42. 去支付
  43. </app-form-id>
  44. </view>
  45. <view class="app-button app-red-button" :class="theme+ '-m-back ' + theme" v-else>
  46. <app-jump-button from :url="`/plugins/pt/detail/detail?pintuan_order_id=${item.pintuan_order_id}&id=${item.pintuan_order_id}`">
  47. 拼团详情
  48. </app-jump-button>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import appOrderTime from '../components/app-order-time.vue';
  56. export default {
  57. name: 'app-order-list',
  58. props: {
  59. list: {
  60. type: Array,
  61. default() {
  62. return [];
  63. }
  64. },
  65. theme: String
  66. },
  67. methods: {
  68. goPay(order_id, id) {
  69. let _this = this;
  70. uni.showModal({
  71. title: '提示',
  72. content: '订单支付',
  73. cancelText: '取消',
  74. confirmText: '确定',
  75. success(res) {
  76. if (res.confirm) {
  77. _this.$request({
  78. url: _this.$api.order.list_pay_data,
  79. data: {
  80. id: order_id,
  81. }
  82. }).then(response => {
  83. if (response.code === 0) {
  84. _this.$payment.pay(response.data.id).then(() => {
  85. for (let i = 0; i < _this.list.length; i++) {
  86. if(_this.list[i].id === id){
  87. _this.$emit('click', i);
  88. }
  89. }
  90. }).catch(() => {
  91. })
  92. }
  93. })
  94. }
  95. }
  96. })
  97. }
  98. },
  99. components: {
  100. 'app-order-time': appOrderTime,
  101. }
  102. }
  103. </script>
  104. <style scoped lang="scss">
  105. .app-order-list {
  106. width: #{750rpx};
  107. .app-item {
  108. width: #{750rpx};
  109. height: #{471rpx};
  110. background-color: white;
  111. margin-top: #{20rpx};
  112. >view {
  113. width: #{750rpx};
  114. box-sizing: border-box;
  115. padding: 0 #{24rpx};
  116. }
  117. .app-top {
  118. height: #{80rpx};
  119. font-size: #{24rpx};
  120. .app-order-time {
  121. color: #919191;
  122. }
  123. }
  124. .app-center {
  125. height: #{304rpx};
  126. padding-top: #{32rpx};
  127. box-sizing: border-box;
  128. .app-center-top {
  129. .app-image {
  130. width: #{156rpx};
  131. height: #{156rpx};
  132. margin-right: #{24rpx};
  133. }
  134. .app-content {
  135. width: #{522rpx};
  136. height: #{156rpx};
  137. .app-name {
  138. width: #{522rpx};
  139. height: #{60rpx};
  140. line-height: #{30rpx};
  141. font-size: #{28rpx};
  142. color: #353535;
  143. word-break: break-all;
  144. text-overflow: ellipsis;
  145. display: -webkit-box;
  146. -webkit-box-orient: vertical;
  147. -webkit-line-clamp: 2;
  148. overflow: hidden;
  149. }
  150. .app-attr {
  151. height: #{24rpx};
  152. font-size: #{24rpx};
  153. color: #999999;
  154. margin-bottom: #{20rpx};
  155. >text {
  156. margin-right: #{18rpx};
  157. }
  158. }
  159. .app-price-num {
  160. font-size: #{28rpx};
  161. color: #353535;
  162. .app-price:before {
  163. content: '¥';
  164. }
  165. .app-num:before {
  166. content: '×';
  167. }
  168. }
  169. }
  170. }
  171. .app-center-bottom {
  172. padding-top: #{64rpx};
  173. box-sizing: border-box;
  174. >text {
  175. font-size: #{28rpx};
  176. }
  177. .app-t {
  178. color: #353535;
  179. }
  180. .app-n:before {
  181. content: '¥';
  182. }
  183. }
  184. }
  185. .app-bottom {
  186. height: #{88rpx};
  187. .app-button {
  188. height: #{56rpx};
  189. line-height: #{56rpx};
  190. width: #{160rpx};
  191. font-size: #{24rpx};
  192. border-radius: #{28rpx};
  193. text-align: center;
  194. }
  195. .app-red-button {
  196. color: #ffffff;
  197. }
  198. .app-white-button {
  199. border: #{1rpx} solid #cdcdcd;
  200. color: #353535;
  201. margin-right: #{20rpx};
  202. }
  203. }
  204. .app-border {
  205. border-bottom: #{1rpx} solid #e2e2e2;
  206. }
  207. }
  208. }
  209. </style>