aftersaleList.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. <template>
  2. <view class="container">
  3. <view class="aftersales-switch">
  4. <view :class="'item ' + (showType == 1 ? 'active' : '')" @tap="switchTab" data-index="1">
  5. <view class="txt">申请中</view>
  6. </view>
  7. <view :class="'item ' + (showType == 2 ? 'active' : '')" @tap="switchTab" data-index="2">
  8. <view class="txt">处理中</view>
  9. </view>
  10. <view :class="'item ' + (showType == 3 ? 'active' : '')" @tap="switchTab" data-index="3">
  11. <view class="txt">已完成</view>
  12. </view>
  13. <view :class="'item ' + (showType == 4 ? 'active' : '')" @tap="switchTab" data-index="4">
  14. <view class="txt">已拒绝</view>
  15. </view>
  16. </view>
  17. <view class="no-aftersale" v-if="aftersaleList.length <= 0">
  18. <view class="c">
  19. <text>还没有呢</text>
  20. </view>
  21. </view>
  22. <view class="aftersales">
  23. <navigator :url="'../aftersaleDetail/aftersaleDetail?id=' + item.aftersale.orderId" class="aftersale" v-for="(item, index) in aftersaleList" :key="index">
  24. <view class="h">
  25. <view class="l">售后编号:{{ item.aftersale.aftersaleSn }}</view>
  26. </view>
  27. <view class="goods" v-for="(gitem, index1) in item.goodsList" :key="index1">
  28. <view class="img">
  29. <image :src="gitem.picUrl"></image>
  30. </view>
  31. <view class="info">
  32. <text class="name">{{ gitem.goodsName }}</text>
  33. <text class="number">{{ gitem.number }}件商品</text>
  34. </view>
  35. <view class="status"></view>
  36. </view>
  37. <view class="b">
  38. <view class="l">申请退款金额:¥{{ item.aftersale.amount }}元</view>
  39. </view>
  40. </navigator>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. var util = require('../../../utils/util.js');
  46. var api = require('../../../config/api.js');
  47. export default {
  48. data() {
  49. return {
  50. aftersaleList: [],
  51. showType: 1,
  52. page: 1,
  53. limit: 10,
  54. totalPages: 1,
  55. gitem: {
  56. picUrl: '',
  57. goodsName: '',
  58. number: ''
  59. }
  60. };
  61. },
  62. onLoad: function (options) {},
  63. onReachBottom() {
  64. if (this.totalPages > this.page) {
  65. this.setData({
  66. page: this.page + 1
  67. });
  68. this.getAftersaleList();
  69. } else {
  70. uni.showToast({
  71. title: '没有更多售后了',
  72. icon: 'none',
  73. duration: 2000
  74. });
  75. return false;
  76. }
  77. },
  78. onReady: function () {
  79. // 页面渲染完成
  80. },
  81. onShow: function () {
  82. // 页面显示
  83. this.getAftersaleList();
  84. },
  85. onHide: function () {
  86. // 页面隐藏
  87. this.setData({
  88. aftersaleList: []
  89. });
  90. },
  91. onUnload: function () {
  92. // 页面关闭
  93. },
  94. methods: {
  95. getAftersaleList() {
  96. let that = this;
  97. util.request(api.AftersaleList, {
  98. status: that.showType,
  99. page: that.page,
  100. limit: that.limit
  101. }).then(function (res) {
  102. if (res.errno === 0) {
  103. console.log(res.data);
  104. that.setData({
  105. aftersaleList: that.aftersaleList.concat(res.data.list),
  106. totalPages: res.data.pages
  107. });
  108. }
  109. });
  110. },
  111. switchTab: function (event) {
  112. let showType = event.currentTarget.dataset.index;
  113. this.setData({
  114. aftersaleList: [],
  115. showType: showType,
  116. page: 1,
  117. limit: 10,
  118. totalPages: 1
  119. });
  120. this.getAftersaleList();
  121. }
  122. }
  123. };
  124. </script>
  125. <style>
  126. page {
  127. height: 100%;
  128. width: 100%;
  129. background: #f4f4f4;
  130. }
  131. .aftersales-switch {
  132. width: 100%;
  133. background: #fff;
  134. height: 84rpx;
  135. }
  136. .aftersales-switch .item {
  137. display: inline-block;
  138. height: 82rpx;
  139. width: 25%;
  140. padding: 0 15rpx;
  141. text-align: center;
  142. }
  143. .aftersales-switch .item .txt {
  144. display: inline-block;
  145. height: 82rpx;
  146. padding: 0 20rpx;
  147. line-height: 82rpx;
  148. color: #999;
  149. font-size: 28rpx;
  150. width: 140rpx;
  151. }
  152. .aftersales-switch .item.active .txt {
  153. color: #d77958;
  154. border-bottom: 4rpx solid #d77958;
  155. }
  156. .no-aftersale {
  157. width: 100%;
  158. height: auto;
  159. margin: 0 auto;
  160. }
  161. .no-aftersale .c {
  162. width: 100%;
  163. height: auto;
  164. margin-top: 400rpx;
  165. }
  166. .no-aftersale .c text {
  167. margin: 0 auto;
  168. display: block;
  169. width: 258rpx;
  170. height: 29rpx;
  171. line-height: 29rpx;
  172. text-align: center;
  173. font-size: 29rpx;
  174. color: #999;
  175. }
  176. .aftersales {
  177. height: auto;
  178. width: 100%;
  179. overflow: hidden;
  180. }
  181. .aftersale {
  182. margin-top: 20rpx;
  183. background: #fff;
  184. }
  185. .aftersale .h {
  186. height: 83.3rpx;
  187. line-height: 83.3rpx;
  188. margin-left: 31.25rpx;
  189. padding-right: 31.25rpx;
  190. border-bottom: 1px solid #f4f4f4;
  191. font-size: 30rpx;
  192. color: #333;
  193. }
  194. .aftersale .h .l {
  195. float: left;
  196. }
  197. .aftersale .h .r {
  198. float: right;
  199. color: #b4282d;
  200. font-size: 24rpx;
  201. }
  202. .aftersale .goods {
  203. display: flex;
  204. align-items: center;
  205. height: 199rpx;
  206. margin-left: 31.25rpx;
  207. }
  208. .aftersale .goods .img {
  209. height: 145.83rpx;
  210. width: 145.83rpx;
  211. background: #f4f4f4;
  212. }
  213. .aftersale .goods .img image {
  214. height: 145.83rpx;
  215. width: 145.83rpx;
  216. }
  217. .aftersale .goods .info {
  218. height: 145.83rpx;
  219. flex: 1;
  220. padding-left: 20rpx;
  221. }
  222. .aftersale .goods .name {
  223. margin-top: 30rpx;
  224. display: block;
  225. height: 44rpx;
  226. line-height: 44rpx;
  227. color: #333;
  228. font-size: 30rpx;
  229. }
  230. .aftersale .goods .number {
  231. display: block;
  232. height: 37rpx;
  233. line-height: 37rpx;
  234. color: #666;
  235. font-size: 25rpx;
  236. }
  237. .aftersale .goods .status {
  238. width: 105rpx;
  239. color: #b4282d;
  240. font-size: 25rpx;
  241. }
  242. .aftersale .b {
  243. height: 103rpx;
  244. line-height: 103rpx;
  245. margin-left: 31.25rpx;
  246. padding-right: 31.25rpx;
  247. border-top: 1px solid #f4f4f4;
  248. font-size: 30rpx;
  249. color: #333;
  250. }
  251. .aftersale .b .l {
  252. float: left;
  253. }
  254. .aftersale .b .r {
  255. float: right;
  256. }
  257. .aftersale .b .btn {
  258. margin-top: 19rpx;
  259. height: 64.5rpx;
  260. line-height: 64.5rpx;
  261. text-align: center;
  262. padding: 0 20rpx;
  263. border-radius: 5rpx;
  264. font-size: 28rpx;
  265. color: #fff;
  266. background: #b4282d;
  267. }
  268. </style>