refundOrderList.vue 10 KB

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