list.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. <template>
  2. <view class="box">
  3. <view class="topt">
  4. <view class="search_con flexC">
  5. <view class="search_inp flexB">
  6. <view class="flex">
  7. <image src="../../static/return/search.png"></image>
  8. <input type="text" v-model="params.apply_number" :placeholder="tid == 0 ? '输入退货单号' : '输入调货单号'" placeholder-class="textS" style="width: 370rpx;" />
  9. </view>
  10. <view class="search" @click="cearBox">查询</view>
  11. </view>
  12. </view>
  13. <view class="topt_title flexB">
  14. <view :style="{color: tid == 0 ? '#FB231F' : '#333'}" class="topt_item flexCC" @click="tid = 0, cearBox()">
  15. <text>退货订单({{ return_count }})</text>
  16. <view :class="tid == 0 ? 'checked_l' : 'nochecked_l'" />
  17. </view>
  18. <view class="topt_line" />
  19. <view :style="{color: tid == 1 ? '#FB231F' : '#333'}" class="topt_item flexCC" @click="tid = 1, cearBox()">
  20. <text>调货订单</text>
  21. <view :class="tid == 1 ? 'checked_l' : 'nochecked_l'" />
  22. </view>
  23. </view>
  24. </view>
  25. <view class="boxList">
  26. <view v-show="tid == 0" class="boxList_item" v-for="(item, i) in list" :key="i" @click="getDetail(item)">
  27. <image :src="item.apply_status == 5 ? statusList[1] : statusList[0]" class="itemtipImg"></image>
  28. <view class="number">
  29. 退货单号:{{ item.apply_number }}
  30. </view>
  31. <view v-for="(v, ind) in item.applydetail" :key="ind" class="flexB" style="padding-top: 24rpx">
  32. <image :src="v.goods_img" mode="" class="boxList_goodImage"></image>
  33. <view class="">
  34. <view class="goodName">大卫博士健康内裤({{ v.good_name + v.good_size }})</view>
  35. <view class="goodNumD flexB">
  36. <view class="goodNumD_left">{{ `${v.total + (v.unit ? v.unit : '条' )}` }}</view>
  37. <view class="goodNumD_right">
  38. <text>¥{{ v.return_price }}</text>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="boxList_bottom">
  44. <view class="bottom1">
  45. <text v-show="item.count">{{ item.count }}套</text>
  46. <text v-show="item.total">{{ item.total }}条</text>
  47. </view>
  48. <text class="bottom2">合计;</text>
  49. <text class="bottom3">¥</text>
  50. <text class="bottom4">{{ item.return_price }}</text>
  51. </view>
  52. </view>
  53. <view v-show="tid == 1" class="boxList_tip">
  54. 该功能暂未开通
  55. </view>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. import { getCustomerReturnList, GetApplyList, getTabNum } from '@/api/index.js'
  61. export default {
  62. data() {
  63. return {
  64. tid: 0,
  65. totalPage: 0,
  66. total: 0,
  67. list: [],
  68. return_count: 0,
  69. apply_count:0,
  70. params: {
  71. page_index: 1,
  72. page_size: 5,
  73. apply_number: ''
  74. },
  75. statusList: [
  76. require('../../static/return/audit.png'),
  77. require('../../static/return/succe.png'),
  78. // require('../../static/return/error.png')
  79. ]
  80. }
  81. },
  82. onLoad() {
  83. this.getList()
  84. this.getTab()
  85. },
  86. onReachBottom: function() {
  87. this.getMore()
  88. },
  89. methods: {
  90. getTab() {
  91. getTabNum().then(res => {
  92. if (res.code == 200) {
  93. this.return_count = res.data.return_count
  94. this.apply_count = res.data.apply_count
  95. }
  96. })
  97. },
  98. cearBox() {
  99. this.params.page_index = 1
  100. this.getList()
  101. },
  102. /*获取列表*/
  103. getList(isMore) {
  104. let _this = this
  105. let params = this.params
  106. if (this.tid == 0) { // 退货列表
  107. uni.showLoading({ title: '加载中', mask: true })
  108. getCustomerReturnList(params).then(res => {
  109. uni.hideLoading()
  110. if (res.code == 200) {
  111. _this.list = res.data.list
  112. _this.total = res.data.total
  113. _this.return_count = res.data.total
  114. _this.totalPage = Math.ceil(res.data.total / _this.params.page_size)
  115. } else {
  116. uni.showModal({
  117. content: res.data || '获取数据失败',
  118. showCancel: false
  119. });
  120. }
  121. }).catch(err => {uni.hideLoading()})
  122. } else { // 调货列表
  123. _this.list = []
  124. }
  125. },
  126. /*获取更多的列表*/
  127. getMore() {
  128. if (this.params.page_index >= this.totalPage) {
  129. uni.showToast({
  130. title: '没有更多啦~',
  131. icon: 'none'
  132. });
  133. return false
  134. }
  135. this.params.page_index++
  136. this.getList(true)
  137. },
  138. getDetail(goodItem) {
  139. const URL = encodeURIComponent(JSON.stringify(goodItem))
  140. uni.navigateTo({
  141. url: './returnDetail?item=' + URL
  142. })
  143. }
  144. }
  145. }
  146. </script>
  147. <style lang="scss" scoped>
  148. .topt {
  149. width: 100%;
  150. padding: 30rpx 24rpx 24rpx 24rpx;
  151. box-sizing: border-box;
  152. background-color: #fff;
  153. position: fixed;
  154. left: 0;
  155. top: 0;
  156. z-index: 10000;
  157. .search_con {
  158. width: 700rpx;
  159. }
  160. .search_inp {
  161. height: 80rpx;
  162. width: 100%;
  163. padding: 0 10rpx 0 30rpx;
  164. border-radius: 44rpx;
  165. background: #F9F9FB;
  166. image {
  167. width: 48rpx;
  168. height: 48rpx;
  169. margin-right: 10rpx;
  170. }
  171. .textS {
  172. font-size: 28rpx;
  173. font-family: PingFang SC-Regular, PingFang SC;
  174. font-weight: 400;
  175. color: #999999;
  176. }
  177. .flex {
  178. display: flex;
  179. }
  180. }
  181. .search {
  182. width: 132rpx;
  183. height: 64rpx;
  184. line-height: 64rpx;
  185. font-size: 28rpx;
  186. color: #FFFFFF;
  187. text-align: center;
  188. background: linear-gradient(92deg, #F30000 0%, #FE4815 100%);
  189. border-radius: 32rpx;
  190. }
  191. &_title {
  192. padding: 0 48rpx;
  193. margin-top: 24rpx;
  194. .checked_l {
  195. width: 32rpx;
  196. height: 4rpx;
  197. background: linear-gradient(180deg, #FF232C 0%, #FF571B 100%);
  198. border-radius: 4rpx 4rpx 4rpx 4rpx;
  199. }
  200. .nochecked_l {
  201. width: 32rpx;
  202. height: 4rpx;
  203. border-radius: 4rpx 4rpx 4rpx 4rpx;
  204. }
  205. }
  206. &_line {
  207. height: 40rpx;
  208. border: 2rpx solid #F5F5F5;
  209. }
  210. &_item {
  211. margin-bottom: 5rpx;
  212. text {
  213. font-size: 32rpx;
  214. font-family: PingFang SC-Bold, PingFang SC;
  215. font-weight: bold;
  216. }
  217. }
  218. }
  219. .boxList {
  220. padding: 210rpx 24rpx 24rpx 24rpx;
  221. &_tip {
  222. text-align: center;
  223. margin-top: 200rpx;
  224. }
  225. &_item {
  226. background: #FFFFFF;
  227. padding: 24rpx;
  228. border-radius: 16rpx 16rpx 16rpx 16rpx;
  229. margin-top: 24rpx;
  230. position: relative;
  231. .itemtipImg {
  232. width: 110rpx;
  233. height: 110rpx;
  234. position: absolute;
  235. top: 24rpx;
  236. right: 24rpx;
  237. }
  238. .number {
  239. font-size: 28rpx;
  240. font-family: PingFang SC-Regular, PingFang SC;
  241. font-weight: 400;
  242. color: #333333;
  243. border-bottom: 2rpx solid #E9E9E9;
  244. padding-bottom: 24rpx;
  245. }
  246. .goodName {
  247. font-size: 30rpx;
  248. font-family: PingFang SC-Bold, PingFang SC;
  249. font-weight: bold;
  250. color: #333333;
  251. }
  252. .goodNumD {
  253. margin-top: 24rpx;
  254. width: 474rpx;
  255. &_left {
  256. font-size: 28rpx;
  257. font-family: PingFang SC-Regular, PingFang SC;
  258. font-weight: 400;
  259. color: #999999;
  260. padding: 4rpx 12rpx;
  261. background: #F5F5F5;
  262. border-radius: 8rpx 8rpx 8rpx 8rpx;
  263. }
  264. &_right {
  265. // text:nth-child(1) {
  266. // font-size: 28rpx;
  267. // font-family: PingFang SC-Regular, PingFang SC;
  268. // font-weight: 400;
  269. // color: #999999;
  270. // margin-right: 48rpx;
  271. // }
  272. text {
  273. font-size: 28rpx;
  274. font-family: PingFang SC-Bold, PingFang SC;
  275. font-weight: bold;
  276. color: #333333;
  277. }
  278. }
  279. }
  280. }
  281. &_goodImage {
  282. width: 160rpx;
  283. height: 130rpx;
  284. border-radius: 16rpx 16rpx 16rpx 16rpx;
  285. }
  286. &_bottom {
  287. text-align: end;
  288. margin-top: 42rpx;
  289. display: flex;
  290. justify-content: flex-end;
  291. align-items: flex-end;
  292. text {
  293. font-size: 28rpx;
  294. font-family: PingFang SC-Bold, PingFang SC;
  295. font-weight: bold;
  296. }
  297. .bottom1 {
  298. color: #999999;
  299. }
  300. .bottom2 {
  301. color: #333333;
  302. }
  303. .bottom3 {
  304. color: #FB231F;
  305. font-weight: 400 !important;
  306. }
  307. .bottom4 {
  308. font-size: 44rpx !important;
  309. font-family: HarmonyOS Sans SC-Medium, HarmonyOS Sans SC !important;
  310. color: #FB231F !important;
  311. }
  312. }
  313. }
  314. </style>