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