refundOrderList.vue 10 KB

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