storeOrderRefundList.vue 8.6 KB

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