refundOrderList.vue 10 KB

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