storeOrderRefundList.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. <template>
  2. <view>
  3. <view class="top-fixed">
  4. <u-tabs
  5. :scrollable="false"
  6. :list="tabs"
  7. lineColor="#2583EB"
  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==''?'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/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. downOption: {
  83. //下拉刷新
  84. use: true,
  85. auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
  86. },
  87. // 上拉加载的配置
  88. upOption: {
  89. onScroll:true,
  90. use: true, // 是否启用上拉加载; 默认true
  91. page: {
  92. num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  93. size: 10 // 每页数据的数量,默认10
  94. },
  95. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  96. empty: {
  97. icon:'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/empty_icon.png',
  98. tip: '暂无数据'
  99. }
  100. },
  101. // 列表数据
  102. dataList: []
  103. };
  104. },
  105. onLoad(option) {
  106. var that=this;
  107. uni.$on('refreshAfterSales', () => {
  108. that.mescroll.resetUpScroll()
  109. })
  110. this.getDictByKey("sys_after_sales_status");
  111. },
  112. methods: {
  113. getDictByKey(key){
  114. var data={key:key}
  115. getDictByKey(data).then(
  116. res => {
  117. if(res.code==200){
  118. if(key=="sys_after_sales_status"){
  119. this.statusOptions=res.data;
  120. }
  121. }
  122. },
  123. err => {
  124. }
  125. );
  126. },
  127. tabChange(item) {
  128. this.status = item.id
  129. this.mescroll.resetUpScroll()
  130. },
  131. mescrollInit(mescroll) {
  132. this.mescroll = mescroll;
  133. },
  134. /*下拉刷新的回调 */
  135. downCallback(mescroll) {
  136. mescroll.resetUpScroll()
  137. },
  138. upCallback(page) {
  139. //联网加载数据
  140. var that = this;
  141. var data = {
  142. status:this.status,
  143. pageNum: page.num,
  144. pageSize: page.size
  145. };
  146. getStoreAfterSalesList(data).then(res => {
  147. if(res.code==200){
  148. //设置列表数据
  149. if (page.num == 1) {
  150. that.dataList = res.data.list;
  151. } else {
  152. that.dataList = that.dataList.concat(res.data.list);
  153. }
  154. that.mescroll.endBySize(res.data.list.length, res.data.total);
  155. }else{
  156. uni.showToast({
  157. icon:'none',
  158. title: "请求失败",
  159. });
  160. that.dataList = null;
  161. that.mescroll.endErr();
  162. }
  163. });
  164. },
  165. // 查看订单详情
  166. showDetail(item) {
  167. uni.navigateTo({
  168. url: './storeOrderRefundDetails?id=' + item.id
  169. })
  170. },
  171. }
  172. }
  173. </script>
  174. <style lang="scss">
  175. .top-fixed{
  176. width: 100%;
  177. position: fixed;
  178. top: 0;
  179. left: 0;
  180. z-index: 10;
  181. height: 88upx;
  182. background-color: #fff;
  183. }
  184. .order-list{
  185. padding: 20upx;
  186. .item{
  187. background: #FFFFFF;
  188. border-radius: 16upx;
  189. padding: 0 30upx;
  190. margin-bottom: 20upx;
  191. .ordersn-box{
  192. display: flex;
  193. align-items: center;
  194. justify-content: space-between;
  195. padding: 34upx 0 20upx;
  196. .num{
  197. font-size: 26upx;
  198. font-family: PingFang SC;
  199. font-weight: 500;
  200. color: #999999;
  201. line-height: 1;
  202. }
  203. .status-box{
  204. display: flex;
  205. align-items: center;
  206. .text{
  207. font-size: 28upx;
  208. font-family: PingFang SC;
  209. font-weight: 500;
  210. line-height: 1;
  211. &.success{
  212. color: #2583EB;
  213. }
  214. &.info{
  215. color: #999999;
  216. }
  217. }
  218. }
  219. }
  220. .drug-list{
  221. .drug-item{
  222. padding: 30upx 0;
  223. border-bottom: 1px soli #F0F0F0;
  224. display: flex;
  225. align-items: center;
  226. .img-box{
  227. width: 160upx;
  228. height: 160upx;
  229. margin-right: 30upx;
  230. flex-shrink: 0;
  231. image{
  232. width: 100%;
  233. height: 100%;
  234. }
  235. }
  236. .drug-info{
  237. width: calc(100% - 190upx);
  238. height: 160upx;
  239. display: flex;
  240. flex-direction: column;
  241. justify-content: space-between;
  242. .name-box{
  243. font-size: 28upx;
  244. font-family: PingFang SC;
  245. font-weight: 500;
  246. color: #111111;
  247. line-height: 40upx;
  248. .tag{
  249. display: inline-block;
  250. padding: 0 6upx;
  251. height: 30upx;
  252. background: linear-gradient(90deg, #2583EB 0%, #92C1F5 100%);
  253. border-radius: 4upx;
  254. margin-right: 10upx;
  255. font-size: 22upx;
  256. font-family: PingFang SC;
  257. font-weight: bold;
  258. color: #FFFFFF;
  259. line-height: 30upx;
  260. float: left;
  261. margin-top: 7upx;
  262. }
  263. }
  264. .spec{
  265. font-size: 24upx;
  266. font-family: PingFang SC;
  267. font-weight: 500;
  268. color: #999999;
  269. line-height: 1;
  270. margin-top: 10upx;
  271. }
  272. .num-box{
  273. display: flex;
  274. align-items: center;
  275. justify-content: space-between;
  276. .price{
  277. display: flex;
  278. align-items: flex-end;
  279. .unit{
  280. font-size: 24upx;
  281. font-family: PingFang SC;
  282. font-weight: 500;
  283. color: #111111;
  284. line-height: 1.2;
  285. margin-right: 4upx;
  286. }
  287. .num{
  288. font-size: 32upx;
  289. font-family: PingFang SC;
  290. font-weight: 500;
  291. color: #111111;
  292. line-height: 1;
  293. }
  294. }
  295. .amount{
  296. font-size: 24upx;
  297. font-family: PingFang SC;
  298. font-weight: 500;
  299. color: #999999;
  300. line-height: 1;
  301. }
  302. }
  303. }
  304. }
  305. .bottom-box{
  306. height: 110upx;
  307. display: flex;
  308. align-items: center;
  309. justify-content: space-between;
  310. .amount-paid{
  311. display: flex;
  312. align-items: center;
  313. .label{
  314. font-size: 24upx;
  315. font-family: PingFang SC;
  316. font-weight: 500;
  317. color: #999999;
  318. line-height: 1;
  319. }
  320. .price-box{
  321. display: flex;
  322. align-items: flex-end;
  323. .unit{
  324. font-size: 24upx;
  325. font-family: PingFang SC;
  326. font-weight: 500;
  327. color: #FF6633;
  328. line-height: 1.2;
  329. margin-right: 4upx;
  330. }
  331. .num{
  332. font-size: 32upx;
  333. font-family: PingFang SC;
  334. font-weight: bold;
  335. color: #FF6633;
  336. line-height: 1;
  337. }
  338. }
  339. }
  340. .btn-box{
  341. box-sizing: border-box;
  342. display: flex;
  343. align-items: center;
  344. .btn{
  345. width: 220upx;
  346. height: 64upx;
  347. line-height: 64upx;
  348. font-size: 26upx;
  349. font-family: PingFang SC;
  350. font-weight: 500;
  351. text-align: center;
  352. border-radius: 32upx;
  353. &.pay{
  354. background: #2583EB;
  355. color: #FFFFFF;
  356. }
  357. }
  358. }
  359. }
  360. }
  361. }
  362. }
  363. </style>