refundOrderList.vue 9.9 KB

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