refundOrderList.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  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 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:'https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com/shop/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. if(item.afterSalesType==2){
  170. uni.navigateTo({
  171. url: '/pages_shopping/live/refundOrderDetail?id=' + item.id
  172. })
  173. }else{
  174. uni.navigateTo({
  175. url: './refundOrderDetail?salesId=' + item.id
  176. })
  177. }
  178. },
  179. }
  180. }
  181. </script>
  182. <style lang="scss">
  183. .top-fixed{
  184. width: 100%;
  185. position: fixed;
  186. top: 0;
  187. left: 0;
  188. z-index: 10;
  189. }
  190. .pub-tab-box{
  191. box-sizing: border-box;
  192. width: 100%;
  193. padding: 0 60upx;
  194. background-color: #FFFFFF;
  195. .tab-inner{
  196. height: 88upx;
  197. line-height: 88upx;
  198. display: flex;
  199. align-items: center;
  200. justify-content: space-between;
  201. overflow-x: auto;
  202. }
  203. .item{
  204. font-size: 28upx;
  205. white-space: nowrap;
  206. line-height: 1;
  207. font-family: PingFang SC;
  208. font-weight: 500;
  209. color: #666666;
  210. margin-right: 60upx;
  211. display: flex;
  212. align-items: center;
  213. justify-content: center;
  214. &:last-child{
  215. margin-right: 0;
  216. }
  217. &.active{
  218. font-weight: bold;
  219. color: #333333;
  220. }
  221. .text{
  222. position: relative;
  223. z-index: 1;
  224. }
  225. .tab-bg{
  226. width: 72upx;
  227. height: 28upx;
  228. position: absolute;
  229. top: 17upx;
  230. left: 50%;
  231. transform: translateX(-36upx);
  232. z-index: -1;
  233. }
  234. }
  235. }
  236. .top-seat{
  237. width: 100%;
  238. height: 88upx;
  239. }
  240. .order-list{
  241. padding: 20upx;
  242. .item{
  243. background: #FFFFFF;
  244. border-radius: 16upx;
  245. padding: 0 30upx;
  246. margin-bottom: 20upx;
  247. .ordersn-box{
  248. display: flex;
  249. align-items: center;
  250. justify-content: space-between;
  251. padding: 34upx 0 20upx;
  252. .num{
  253. font-size: 26upx;
  254. font-family: PingFang SC;
  255. font-weight: 500;
  256. color: #999999;
  257. line-height: 1;
  258. }
  259. .status-box{
  260. display: flex;
  261. align-items: center;
  262. .text{
  263. font-size: 28upx;
  264. font-family: PingFang SC;
  265. font-weight: 500;
  266. line-height: 1;
  267. &.success{
  268. color: #2BC7B9;
  269. }
  270. &.info{
  271. color: #999999;
  272. }
  273. }
  274. }
  275. }
  276. .drug-list{
  277. .drug-item{
  278. padding: 30upx 0;
  279. border-bottom: 1px soli #F0F0F0;
  280. display: flex;
  281. align-items: center;
  282. .img-box{
  283. width: 160upx;
  284. height: 160upx;
  285. margin-right: 30upx;
  286. flex-shrink: 0;
  287. image{
  288. width: 100%;
  289. height: 100%;
  290. }
  291. }
  292. .drug-info{
  293. width: calc(100% - 190upx);
  294. height: 160upx;
  295. display: flex;
  296. flex-direction: column;
  297. justify-content: space-between;
  298. .name-box{
  299. font-size: 28upx;
  300. font-family: PingFang SC;
  301. font-weight: 500;
  302. color: #111111;
  303. line-height: 40upx;
  304. .tag{
  305. display: inline-block;
  306. padding: 0 6upx;
  307. height: 30upx;
  308. background: linear-gradient(90deg, #2BC7B9 0%, #2BC7A4 100%);
  309. border-radius: 4upx;
  310. margin-right: 10upx;
  311. font-size: 22upx;
  312. font-family: PingFang SC;
  313. font-weight: bold;
  314. color: #FFFFFF;
  315. line-height: 30upx;
  316. float: left;
  317. margin-top: 7upx;
  318. }
  319. }
  320. .spec{
  321. font-size: 24upx;
  322. font-family: PingFang SC;
  323. font-weight: 500;
  324. color: #999999;
  325. line-height: 1;
  326. margin-top: 10upx;
  327. }
  328. .num-box{
  329. display: flex;
  330. align-items: center;
  331. justify-content: space-between;
  332. .price{
  333. display: flex;
  334. align-items: flex-end;
  335. .unit{
  336. font-size: 24upx;
  337. font-family: PingFang SC;
  338. font-weight: 500;
  339. color: #111111;
  340. line-height: 1.2;
  341. margin-right: 4upx;
  342. }
  343. .num{
  344. font-size: 32upx;
  345. font-family: PingFang SC;
  346. font-weight: 500;
  347. color: #111111;
  348. line-height: 1;
  349. }
  350. }
  351. .amount{
  352. font-size: 24upx;
  353. font-family: PingFang SC;
  354. font-weight: 500;
  355. color: #999999;
  356. line-height: 1;
  357. }
  358. }
  359. }
  360. }
  361. .bottom-box{
  362. height: 110upx;
  363. display: flex;
  364. align-items: center;
  365. justify-content: space-between;
  366. .amount-paid{
  367. display: flex;
  368. align-items: center;
  369. .label{
  370. font-size: 24upx;
  371. font-family: PingFang SC;
  372. font-weight: 500;
  373. color: #999999;
  374. line-height: 1;
  375. }
  376. .price-box{
  377. display: flex;
  378. align-items: flex-end;
  379. .unit{
  380. font-size: 24upx;
  381. font-family: PingFang SC;
  382. font-weight: 500;
  383. color: #FF6633;
  384. line-height: 1.2;
  385. margin-right: 4upx;
  386. }
  387. .num{
  388. font-size: 32upx;
  389. font-family: PingFang SC;
  390. font-weight: bold;
  391. color: #FF6633;
  392. line-height: 1;
  393. }
  394. }
  395. }
  396. .btn-box{
  397. box-sizing: border-box;
  398. display: flex;
  399. align-items: center;
  400. .btn{
  401. width: 220upx;
  402. height: 64upx;
  403. line-height: 64upx;
  404. font-size: 26upx;
  405. font-family: PingFang SC;
  406. font-weight: 500;
  407. text-align: center;
  408. border-radius: 32upx;
  409. &.pay{
  410. background: #2BC7B9;
  411. color: #FFFFFF;
  412. }
  413. }
  414. }
  415. }
  416. }
  417. }
  418. }
  419. </style>