refundOrderList.vue 10 KB

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