refundOrderList.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. <template>
  2. <view>
  3. <view class="top-fixed">
  4. <!-- tab切换 -->
  5. <view class="pub-tab-box">
  6. <view class="tab-inner">
  7. <view
  8. v-for="(item,index) in statusList"
  9. :key="index"
  10. :class="status == item.value?'item active':'item'"
  11. @click="statusChange(item)"
  12. >
  13. <view class="text">
  14. {{ item.name }}
  15. <image v-show="status == item.value" class="tab-bg" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/tab_bg.png" mode=""></image>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="top-seat"></view>
  22. <!-- 订单列表 -->
  23. <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
  24. <view class="order-list">
  25. <view v-for="(item,index) in dataList" :key="index" class="item" >
  26. <!-- 订单号,状态 -->
  27. <view class="ordersn-box">
  28. <view class="num">订单号:{{item.orderCode}}</view>
  29. <view class="status-box">
  30. <text class="text success">{{$getDictLabelName("storeAfterSalesSalesStatus",item.salesStatus)}}</text>
  31. </view>
  32. </view>
  33. <!-- 药品列表 -->
  34. <view class="drug-list">
  35. <view v-for="(subitem,j) in JSON.parse(item.itemJson)" :key="j">
  36. <view class="drug-item">
  37. <view class="img-box">
  38. <image :src="subitem.imgUrl" mode="aspectFill"></image>
  39. </view>
  40. <view class="drug-info">
  41. <view>
  42. <view class="name-box ellipsis2">{{subitem.goodsName||''}}</view>
  43. <!-- <view class="spec">规格:{{JSON.parse(subitem.jsonInfo).sku}}</view> -->
  44. </view>
  45. <view class="num-box">
  46. <view class="price">
  47. <text class="num" >{{subitem.integral}}</text>
  48. <text class="unit">积分</text>
  49. <text class="num" v-if="subitem.cash>0">+{{subitem.cash}}</text>
  50. <text class="unit" v-if="subitem.cash>0">元</text>
  51. </view>
  52. <view class="amount">x{{subitem.num}}</view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <!-- 实付金额、按钮 -->
  58. <view class="bottom-box">
  59. <view class="amount-paid">
  60. <text class="label">退还:</text>
  61. <view class="price-box">
  62. <view class="num">{{item.refundIntegral || 0}}</view>
  63. <view class="unit">积分</view>
  64. </view>
  65. <view class="unit">+</view>
  66. <view class="price-box">
  67. <view class="num">{{item.refundAmount || 0}}</view>
  68. <view class="unit">元</view>
  69. </view>
  70. </view>
  71. <view class="btn-box">
  72. <view class="btn pay" @click="showDetail(item)">查看详情</view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </mescroll-body>
  79. </view>
  80. </template>
  81. <script>
  82. import {getAfterSalesList} from '../api/integralAfterSales.js'
  83. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  84. export default {
  85. mixins: [MescrollMixin],
  86. data() {
  87. return {
  88. statusList: [
  89. {name:'全部',value:"0"},
  90. {name:'售后中',value:"1"},
  91. {name:'已完成',value:"2"},
  92. ],
  93. status: 0,
  94. mescroll:null,
  95. downOption: {
  96. //下拉刷新
  97. use: true,
  98. auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
  99. },
  100. // 上拉加载的配置
  101. upOption: {
  102. onScroll:true,
  103. use: true, // 是否启用上拉加载; 默认true
  104. page: {
  105. num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  106. size: 10 // 每页数据的数量,默认10
  107. },
  108. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  109. empty: {
  110. icon:'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/empty_icon.png',
  111. tip: '暂无数据'
  112. }
  113. },
  114. // 列表数据
  115. dataList: []
  116. };
  117. },
  118. onLoad(option) {
  119. var that=this;
  120. uni.$on('refreshAfterSales', () => {
  121. that.mescroll.resetUpScroll()
  122. })
  123. },
  124. methods: {
  125. // tab切换
  126. statusChange(item) {
  127. this.status = item.value
  128. this.mescroll.resetUpScroll()
  129. },
  130. mescrollInit(mescroll) {
  131. this.mescroll = mescroll;
  132. },
  133. /*下拉刷新的回调 */
  134. downCallback(mescroll) {
  135. mescroll.resetUpScroll()
  136. },
  137. upCallback(page) {
  138. //联网加载数据
  139. var that = this;
  140. var data = {
  141. status:this.status,
  142. page: page.num,
  143. pageSize: page.size
  144. };
  145. getAfterSalesList(data).then(res => {
  146. if(res.code==200){
  147. //设置列表数据
  148. if (page.num == 1) {
  149. that.dataList = res.data.list;
  150. } else {
  151. that.dataList = that.dataList.concat(res.data.list);
  152. }
  153. that.mescroll.endBySize(res.data.list.length, res.data.total);
  154. }else{
  155. uni.showToast({
  156. icon:'none',
  157. title: "请求失败",
  158. });
  159. that.dataList = null;
  160. that.mescroll.endErr();
  161. }
  162. });
  163. },
  164. // 查看订单详情
  165. showDetail(item) {
  166. uni.navigateTo({
  167. url: './refundOrderDetail?salesId=' + item.id
  168. })
  169. },
  170. }
  171. }
  172. </script>
  173. <style lang="scss">
  174. .top-fixed{
  175. width: 100%;
  176. position: fixed;
  177. top: 0;
  178. left: 0;
  179. z-index: 10;
  180. }
  181. .pub-tab-box{
  182. box-sizing: border-box;
  183. width: 100%;
  184. padding: 0 60upx;
  185. background-color: #FFFFFF;
  186. .tab-inner{
  187. height: 88upx;
  188. line-height: 88upx;
  189. display: flex;
  190. align-items: center;
  191. justify-content: space-between;
  192. overflow-x: auto;
  193. }
  194. .item{
  195. font-size: 28upx;
  196. white-space: nowrap;
  197. line-height: 1;
  198. font-family: PingFang SC;
  199. font-weight: 500;
  200. color: #666666;
  201. margin-right: 60upx;
  202. display: flex;
  203. align-items: center;
  204. justify-content: center;
  205. &:last-child{
  206. margin-right: 0;
  207. }
  208. &.active{
  209. font-weight: bold;
  210. color: #333333;
  211. }
  212. .text{
  213. position: relative;
  214. z-index: 1;
  215. }
  216. .tab-bg{
  217. width: 72upx;
  218. height: 28upx;
  219. position: absolute;
  220. top: 17upx;
  221. left: 50%;
  222. transform: translateX(-36upx);
  223. z-index: -1;
  224. }
  225. }
  226. }
  227. .top-seat{
  228. width: 100%;
  229. height: 88upx;
  230. }
  231. .order-list{
  232. padding: 20upx;
  233. .item{
  234. background: #FFFFFF;
  235. border-radius: 16upx;
  236. padding: 0 30upx;
  237. margin-bottom: 20upx;
  238. .ordersn-box{
  239. display: flex;
  240. align-items: center;
  241. justify-content: space-between;
  242. padding: 34upx 0 20upx;
  243. .num{
  244. font-size: 26upx;
  245. font-family: PingFang SC;
  246. font-weight: 500;
  247. color: #999999;
  248. line-height: 1;
  249. }
  250. .status-box{
  251. display: flex;
  252. align-items: center;
  253. .text{
  254. font-size: 28upx;
  255. font-family: PingFang SC;
  256. font-weight: 500;
  257. line-height: 1;
  258. &.success{
  259. color: #2583EB;
  260. }
  261. &.info{
  262. color: #999999;
  263. }
  264. }
  265. }
  266. }
  267. .drug-list{
  268. .drug-item{
  269. padding: 30upx 0;
  270. border-bottom: 1px soli #F0F0F0;
  271. display: flex;
  272. align-items: center;
  273. .img-box{
  274. width: 160upx;
  275. height: 160upx;
  276. margin-right: 30upx;
  277. flex-shrink: 0;
  278. image{
  279. width: 100%;
  280. height: 100%;
  281. }
  282. }
  283. .drug-info{
  284. width: calc(100% - 190upx);
  285. height: 160upx;
  286. display: flex;
  287. flex-direction: column;
  288. justify-content: space-between;
  289. .name-box{
  290. font-size: 28upx;
  291. font-family: PingFang SC;
  292. font-weight: 500;
  293. color: #111111;
  294. line-height: 40upx;
  295. .tag{
  296. display: inline-block;
  297. padding: 0 6upx;
  298. height: 30upx;
  299. background: linear-gradient(90deg, #2583EB 0%, #2BC7A4 100%);
  300. border-radius: 4upx;
  301. margin-right: 10upx;
  302. font-size: 22upx;
  303. font-family: PingFang SC;
  304. font-weight: bold;
  305. color: #FFFFFF;
  306. line-height: 30upx;
  307. float: left;
  308. margin-top: 7upx;
  309. }
  310. }
  311. .spec{
  312. font-size: 24upx;
  313. font-family: PingFang SC;
  314. font-weight: 500;
  315. color: #999999;
  316. line-height: 1;
  317. margin-top: 10upx;
  318. }
  319. .num-box{
  320. display: flex;
  321. align-items: center;
  322. justify-content: space-between;
  323. .price{
  324. display: flex;
  325. align-items: flex-end;
  326. .unit{
  327. font-size: 24upx;
  328. font-family: PingFang SC;
  329. font-weight: 500;
  330. color: #111111;
  331. line-height: 1.2;
  332. margin-right: 4upx;
  333. }
  334. .num{
  335. font-size: 32upx;
  336. font-family: PingFang SC;
  337. font-weight: 500;
  338. color: #111111;
  339. line-height: 1;
  340. }
  341. }
  342. .amount{
  343. font-size: 24upx;
  344. font-family: PingFang SC;
  345. font-weight: 500;
  346. color: #999999;
  347. line-height: 1;
  348. }
  349. }
  350. }
  351. }
  352. .bottom-box{
  353. height: 110upx;
  354. display: flex;
  355. align-items: center;
  356. justify-content: space-between;
  357. .amount-paid{
  358. display: flex;
  359. align-items: center;
  360. .label{
  361. font-size: 24upx;
  362. font-family: PingFang SC;
  363. font-weight: 500;
  364. color: #999999;
  365. line-height: 1;
  366. }
  367. .price-box{
  368. display: flex;
  369. align-items: flex-end;
  370. }
  371. .unit{
  372. font-size: 24upx;
  373. font-family: PingFang SC;
  374. font-weight: 500;
  375. color: #FF6633;
  376. line-height: 1.2;
  377. margin-right: 4upx;
  378. }
  379. .num{
  380. font-size: 32upx;
  381. font-family: PingFang SC;
  382. font-weight: bold;
  383. color: #FF6633;
  384. line-height: 1;
  385. }
  386. }
  387. .btn-box{
  388. box-sizing: border-box;
  389. display: flex;
  390. align-items: center;
  391. .btn{
  392. width: 220upx;
  393. height: 64upx;
  394. line-height: 64upx;
  395. font-size: 26upx;
  396. font-family: PingFang SC;
  397. font-weight: 500;
  398. text-align: center;
  399. border-radius: 32upx;
  400. &.pay{
  401. background: #2583EB;
  402. color: #FFFFFF;
  403. }
  404. }
  405. }
  406. }
  407. }
  408. }
  409. }
  410. </style>