storeOrderRefundList.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <template>
  2. <view>
  3. <u-sticky>
  4. <view class="top-fixed">
  5. <u-tabs
  6. :scrollable="false"
  7. :list="tabs"
  8. lineColor="#2583EB"
  9. @change="tabChange">
  10. </u-tabs>
  11. </view>
  12. </u-sticky>
  13. <!-- 订单列表 -->
  14. <mescroll-body top="88rpx" bottom="0" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
  15. <view class="order-list">
  16. <view v-for="(item,index) in dataList" :key="index" class="item" >
  17. <!-- 订单号,状态 -->
  18. <view class="ordersn-box">
  19. <view class="num">订单号:{{item.orderCode}}</view>
  20. <view class="status-box">
  21. <text class="text info">
  22. {{$getDictLabelName(statusOptions,item.salesStatus)}}
  23. </text>
  24. </view>
  25. </view>
  26. <!-- 药品列表 -->
  27. <view class="drug-list">
  28. <view v-if="item!=null" v-for="(subitem,j) in item.items" :key="j" class="drug-item">
  29. <view class="img-box">
  30. <image :src="JSON.parse(subitem.jsonInfo).image==''?'/static/images/drug.svg':JSON.parse(subitem.jsonInfo).image" mode="aspectFill"></image>
  31. </view>
  32. <view class="drug-info">
  33. <view>
  34. <view class="name-box ellipsis2">
  35. <!-- <view class="tag">处方药</view> -->
  36. {{JSON.parse(subitem.jsonInfo).productName}}
  37. </view>
  38. <view class="spec">规格:{{JSON.parse(subitem.jsonInfo).sku}}</view>
  39. </view>
  40. <view class="num-box">
  41. <view class="price">
  42. <text class="unit">¥</text>
  43. <text class="num">{{JSON.parse(subitem.jsonInfo).price.toFixed(2)}}</text>
  44. </view>
  45. <view class="amount">x{{JSON.parse(subitem.jsonInfo).num}}</view>
  46. </view>
  47. </view>
  48. </view>
  49. <!-- 实付金额、按钮 -->
  50. <view class="bottom-box">
  51. <view class="amount-paid">
  52. <text class="label">退款金额:</text>
  53. <view class="price-box">
  54. <view class="unit">¥</view>
  55. <view class="num">{{item.refundAmount.toFixed(2)}}</view>
  56. </view>
  57. </view>
  58. <view class="btn-box">
  59. <view class="btn pay" @click="showDetail(item)">查看详情</view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </mescroll-body>
  66. </view>
  67. </template>
  68. <script>
  69. import {getDictByKey} from '@/api/common.js'
  70. import {getStoreAfterSalesList} from '@/api/storeAfterSales.js'
  71. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  72. export default {
  73. mixins: [MescrollMixin],
  74. data() {
  75. return {
  76. statusOptions:[],
  77. tabs: [
  78. {name:"全部",id:"0"},
  79. {name:"售后中",id:"1"},
  80. {name:"已完成",id:"2"}
  81. ],
  82. status: 0,
  83. mescroll:null,
  84. // 上拉加载的配置
  85. upOption: {
  86. onScroll:true,
  87. use: true, // 是否启用上拉加载; 默认true
  88. page: {
  89. num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  90. size: 10 // 每页数据的数量,默认10
  91. },
  92. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  93. empty: {
  94. icon:'https://zkzh-2025.oss-cn-beijing.aliyuncs.com/appimgs/cf4a86b913a04341bb44e34bb4d37aa2.png',
  95. tip: '暂无数据'
  96. }
  97. },
  98. // 列表数据
  99. dataList: []
  100. };
  101. },
  102. onLoad(option) {
  103. var that=this;
  104. uni.$on('refreshAfterSales', () => {
  105. that.mescroll.resetUpScroll()
  106. })
  107. this.getDictByKey("sys_after_sales_status");
  108. },
  109. methods: {
  110. getDictByKey(key){
  111. var data={key:key}
  112. getDictByKey(data).then(
  113. res => {
  114. if(res.code==200){
  115. if(key=="sys_after_sales_status"){
  116. this.statusOptions=res.data;
  117. }
  118. }
  119. },
  120. err => {
  121. }
  122. );
  123. },
  124. tabChange(item) {
  125. this.status = item.id
  126. this.mescroll.resetUpScroll()
  127. },
  128. mescrollInit(mescroll) {
  129. this.mescroll = mescroll;
  130. },
  131. /*下拉刷新的回调 */
  132. downCallback(mescroll) {
  133. mescroll.resetUpScroll()
  134. },
  135. upCallback(page) {
  136. //联网加载数据
  137. var that = this;
  138. var data = {
  139. status:this.status,
  140. pageNum: page.num,
  141. pageSize: page.size
  142. };
  143. getStoreAfterSalesList(data).then(res => {
  144. if(res.code==200){
  145. //设置列表数据
  146. if (page.num == 1) {
  147. that.dataList = res.data.list;
  148. } else {
  149. that.dataList = that.dataList.concat(res.data.list);
  150. }
  151. that.mescroll.endBySize(res.data.list.length, res.data.total);
  152. }else{
  153. uni.showToast({
  154. icon:'none',
  155. title: "请求失败",
  156. });
  157. that.dataList = null;
  158. that.mescroll.endErr();
  159. }
  160. });
  161. },
  162. // 查看订单详情
  163. showDetail(item) {
  164. uni.navigateTo({
  165. url: './storeOrderRefundDetails?id=' + item.id
  166. })
  167. },
  168. }
  169. }
  170. </script>
  171. <style lang="scss">
  172. .top-fixed{
  173. width: 100%;
  174. position: absolute;
  175. top: 0;
  176. left: 0;
  177. z-index: 10;
  178. height: 88upx;
  179. background-color: #fff;
  180. }
  181. .order-list{
  182. padding: 20upx;
  183. .item{
  184. background: #FFFFFF;
  185. border-radius: 16upx;
  186. padding: 0 30upx;
  187. margin-bottom: 20upx;
  188. .ordersn-box{
  189. display: flex;
  190. align-items: center;
  191. justify-content: space-between;
  192. padding: 34upx 0 20upx;
  193. .num{
  194. font-size: 26upx;
  195. font-family: PingFang SC;
  196. font-weight: 500;
  197. color: #999999;
  198. line-height: 1;
  199. }
  200. .status-box{
  201. display: flex;
  202. align-items: center;
  203. .text{
  204. font-size: 28upx;
  205. font-family: PingFang SC;
  206. font-weight: 500;
  207. line-height: 1;
  208. &.success{
  209. color: #2583EB;
  210. }
  211. &.info{
  212. color: #999999;
  213. }
  214. }
  215. }
  216. }
  217. .drug-list{
  218. .drug-item{
  219. padding: 30upx 0;
  220. border-bottom: 1px soli #F0F0F0;
  221. display: flex;
  222. align-items: center;
  223. .img-box{
  224. width: 160upx;
  225. height: 160upx;
  226. margin-right: 30upx;
  227. flex-shrink: 0;
  228. image{
  229. width: 100%;
  230. height: 100%;
  231. }
  232. }
  233. .drug-info{
  234. width: calc(100% - 190upx);
  235. height: 160upx;
  236. display: flex;
  237. flex-direction: column;
  238. justify-content: space-between;
  239. .name-box{
  240. font-size: 28upx;
  241. font-family: PingFang SC;
  242. font-weight: 500;
  243. color: #111111;
  244. line-height: 40upx;
  245. .tag{
  246. display: inline-block;
  247. padding: 0 6upx;
  248. height: 30upx;
  249. background: linear-gradient(90deg, #2583EB 0%, #2BC7A4 100%);
  250. border-radius: 4upx;
  251. margin-right: 10upx;
  252. font-size: 22upx;
  253. font-family: PingFang SC;
  254. font-weight: bold;
  255. color: #FFFFFF;
  256. line-height: 30upx;
  257. float: left;
  258. margin-top: 7upx;
  259. }
  260. }
  261. .spec{
  262. font-size: 24upx;
  263. font-family: PingFang SC;
  264. font-weight: 500;
  265. color: #999999;
  266. line-height: 1;
  267. margin-top: 10upx;
  268. }
  269. .num-box{
  270. display: flex;
  271. align-items: center;
  272. justify-content: space-between;
  273. .price{
  274. display: flex;
  275. align-items: flex-end;
  276. .unit{
  277. font-size: 24upx;
  278. font-family: PingFang SC;
  279. font-weight: 500;
  280. color: #111111;
  281. line-height: 1.2;
  282. margin-right: 4upx;
  283. }
  284. .num{
  285. font-size: 32upx;
  286. font-family: PingFang SC;
  287. font-weight: 500;
  288. color: #111111;
  289. line-height: 1;
  290. }
  291. }
  292. .amount{
  293. font-size: 24upx;
  294. font-family: PingFang SC;
  295. font-weight: 500;
  296. color: #999999;
  297. line-height: 1;
  298. }
  299. }
  300. }
  301. }
  302. .bottom-box{
  303. height: 110upx;
  304. display: flex;
  305. align-items: center;
  306. justify-content: space-between;
  307. .amount-paid{
  308. display: flex;
  309. align-items: center;
  310. .label{
  311. font-size: 24upx;
  312. font-family: PingFang SC;
  313. font-weight: 500;
  314. color: #999999;
  315. line-height: 1;
  316. }
  317. .price-box{
  318. display: flex;
  319. align-items: flex-end;
  320. .unit{
  321. font-size: 24upx;
  322. font-family: PingFang SC;
  323. font-weight: 500;
  324. color: #FF6633;
  325. line-height: 1.2;
  326. margin-right: 4upx;
  327. }
  328. .num{
  329. font-size: 32upx;
  330. font-family: PingFang SC;
  331. font-weight: bold;
  332. color: #FF6633;
  333. line-height: 1;
  334. }
  335. }
  336. }
  337. .btn-box{
  338. box-sizing: border-box;
  339. display: flex;
  340. align-items: center;
  341. .btn{
  342. width: 220upx;
  343. height: 64upx;
  344. line-height: 64upx;
  345. font-size: 26upx;
  346. font-family: PingFang SC;
  347. font-weight: 500;
  348. text-align: center;
  349. border-radius: 32upx;
  350. &.pay{
  351. background: #2583EB;
  352. color: #FFFFFF;
  353. }
  354. }
  355. }
  356. }
  357. }
  358. }
  359. }
  360. </style>