refundOrderList.vue 10 KB

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