aftersaleList.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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. .container {
  132. padding-bottom: 40rpx;
  133. }
  134. .aftersales-switch {
  135. width: 100%;
  136. background: #fff;
  137. height: 84rpx;
  138. }
  139. .aftersales-switch .item {
  140. display: inline-block;
  141. height: 82rpx;
  142. width: 25%;
  143. padding: 0 15rpx;
  144. text-align: center;
  145. }
  146. .aftersales-switch .item .txt {
  147. display: inline-block;
  148. height: 82rpx;
  149. padding: 0 20rpx;
  150. line-height: 82rpx;
  151. color: #9a9ba1;
  152. font-size: 30rpx;
  153. width: 130rpx;
  154. }
  155. .aftersales-switch .item.active .txt {
  156. color: #ab956d;
  157. border-bottom: 4rpx solid #ab956d;
  158. }
  159. .no-aftersale {
  160. width: 100%;
  161. height: auto;
  162. margin: 0 auto;
  163. }
  164. .no-aftersale .c {
  165. width: 100%;
  166. height: auto;
  167. margin-top: 400rpx;
  168. }
  169. .no-aftersale .c text {
  170. margin: 0 auto;
  171. display: block;
  172. width: 258rpx;
  173. height: 29rpx;
  174. line-height: 29rpx;
  175. text-align: center;
  176. font-size: 29rpx;
  177. color: #999;
  178. }
  179. .aftersales {
  180. height: auto;
  181. width: 100%;
  182. overflow: hidden;
  183. }
  184. .aftersale {
  185. margin-top: 20rpx;
  186. background: #fff;
  187. }
  188. .aftersale .h {
  189. height: 83.3rpx;
  190. line-height: 83.3rpx;
  191. margin-left: 31.25rpx;
  192. padding-right: 31.25rpx;
  193. border-bottom: 1px solid #f4f4f4;
  194. font-size: 30rpx;
  195. color: #333;
  196. }
  197. .aftersale .h .l {
  198. float: left;
  199. }
  200. .aftersale .h .r {
  201. float: right;
  202. color: #b4282d;
  203. font-size: 24rpx;
  204. }
  205. .aftersale .goods {
  206. display: flex;
  207. align-items: center;
  208. height: 199rpx;
  209. margin-left: 31.25rpx;
  210. }
  211. .aftersale .goods .img {
  212. height: 145.83rpx;
  213. width: 145.83rpx;
  214. background: #f4f4f4;
  215. }
  216. .aftersale .goods .img image {
  217. height: 145.83rpx;
  218. width: 145.83rpx;
  219. }
  220. .aftersale .goods .info {
  221. height: 145.83rpx;
  222. flex: 1;
  223. padding-left: 20rpx;
  224. }
  225. .aftersale .goods .name {
  226. /* margin-top: 30rpx; */
  227. display: block;
  228. /* height: 44rpx; */
  229. line-height: 44rpx;
  230. color: #333;
  231. font-size: 30rpx;
  232. }
  233. .aftersale .goods .number {
  234. display: block;
  235. height: 37rpx;
  236. line-height: 37rpx;
  237. color: #666;
  238. font-size: 25rpx;
  239. }
  240. .aftersale .goods .status {
  241. width: 105rpx;
  242. color: #b4282d;
  243. font-size: 25rpx;
  244. }
  245. .aftersale .b {
  246. height: 103rpx;
  247. line-height: 103rpx;
  248. margin-left: 31.25rpx;
  249. padding-right: 31.25rpx;
  250. border-top: 1px solid #f4f4f4;
  251. font-size: 30rpx;
  252. color: #333;
  253. }
  254. .aftersale .b .l {
  255. float: left;
  256. }
  257. .aftersale .b .r {
  258. float: right;
  259. }
  260. .aftersale .b .btn {
  261. margin-top: 19rpx;
  262. height: 64.5rpx;
  263. line-height: 64.5rpx;
  264. text-align: center;
  265. padding: 0 20rpx;
  266. border-radius: 5rpx;
  267. font-size: 28rpx;
  268. color: #fff;
  269. background: #b4282d;
  270. }
  271. </style>