unliquidated.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <template>
  2. <view class="unliquidated-container">
  3. <JHeader :dark="false" title="未结算奖励" width="50" height="50" style="padding: 24upx 0 0;"></JHeader>
  4. <view>
  5. <view class="unliquidated-topBackImg flex-items flex-column">
  6. <view class="totalAward-content flex-column font-color-FFF">
  7. <view class="flex-items-plus mar-top-60">
  8. <label class="fs60 amount">¥{{ directSalesDataList.total }}</label>
  9. </view>
  10. <view class="flex-row-plus flex-sp-around fs24 mar-top-30">
  11. <view class="awardBox">
  12. <view class="fs36 font-color-FFF">{{ directSalesDataList.directPrice }}</view>
  13. <view class="awardTit font-color-FFF">直接奖励(元)</view>
  14. </view>
  15. <view class="awardBox">
  16. <view class="fs36 font-color-FFF">{{ directSalesDataList.indirectPrice }}</view>
  17. <view class="awardTit font-color-FFF">间接奖励(元)</view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <view>
  23. <tui-tabs
  24. style="width: 750upx;padding: 0 0upx 0 0upx;overflow: hidden;" :slider-width="60" :padding="0"
  25. item-width="375rpx" selected-color="#C5AA7B" bold slider-bg-color="#999999"
  26. background-color="#333333" unlined
  27. :tabs="[{ name: '直接奖励' }, { name: '间接奖励' }]" :current-tab="awardTypeFlag" @change="awardTypeActive"
  28. ></tui-tabs>
  29. </view>
  30. <view v-if="awardTypeFlag == 0">
  31. <view v-if="directSalesInfo.data && directSalesInfo.data.length">
  32. <view v-for="(item, index) in directSalesInfo.data" :key="index" class="flex-center">
  33. <view class="directAward-box font-color-656 fs26" @click="arrowTypeChange1(index)">
  34. <view style="display: flex;" class="directAwardInfo">
  35. <view style="flex: 1;" class="flex-items flex-sp-between">
  36. <label class="orderId-box font-color-999">订单号:{{ item.orderFormid }}</label>
  37. <view class="mar-right-50 font-color-999">
  38. 佣金:<label class="font-color-C5AA7B">¥{{ item.commission }}</label>
  39. </view>
  40. </view>
  41. <view>
  42. <tui-icon
  43. :name="item.ifOpen ? 'arrowup' : 'arrowdown'" :size="30" unit="upx" margin="0"
  44. color="#b7b7b7"
  45. ></tui-icon>
  46. </view>
  47. </view>
  48. <view v-if="item.ifOpen == true">
  49. <view class="flex-row-plus flex-items flex-sp-between mar-top-30">
  50. <label class="orderId-box font-color-999">商品数:{{ item.products }}</label>
  51. <label class="commission-box mar-left-70 font-color-999">实付金额:¥{{ item.price }}</label>
  52. </view>
  53. <view class="flex-row-plus flex-items mar-top-30">
  54. <label class="orderId-box font-color-999">下单人:{{ item.customerName }}</label>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <view style="padding-bottom: 45upx;">
  61. <LoadingMore
  62. :status="!directSalesInfo.isEmpty && !directSalesInfo.data.length
  63. ? 'loading' : !directSalesInfo.isEmpty && directSalesInfo.data.length && (directSalesInfo.data.length >= directSalesInfo.listTotal) ? 'no-more' : ''"
  64. >
  65. </LoadingMore>
  66. <tui-no-data v-if="directSalesInfo.isEmpty" :fixed="false" style="margin-top: 60upx;">这里空空如也~</tui-no-data>
  67. </view>
  68. </view>
  69. <view v-if="awardTypeFlag == 1">
  70. <view v-if="secondhandSalesInfo.data && secondhandSalesInfo.data.length">
  71. <view v-for="(item, index) in secondhandSalesInfo.data" :key="index" class="flex-center">
  72. <view class="directAward-box font-color-656 fs26" @click="arrowTypeChange(index)">
  73. <view style="display: flex;" class="directAwardInfo">
  74. <view style="flex: 1;" class="flex-items flex-sp-between">
  75. <label class="orderId-box font-color-999">订单号:{{ item.orderFormid }}</label>
  76. <view class="mar-right-50 font-color-999">
  77. 佣金:<label class="font-color-C5AA7B">¥{{ item.commission }}</label>
  78. </view>
  79. </view>
  80. <view>
  81. <tui-icon
  82. :name="item.ifOpen ? 'arrowup' : 'arrowdown'" :size="30" unit="upx" margin="0"
  83. color="#b7b7b7"
  84. ></tui-icon>
  85. </view>
  86. </view>
  87. <view v-if="item.ifOpen == true">
  88. <view class="flex-row-plus flex-items flex-sp-between mar-top-30">
  89. <label class="orderId-box font-color-999">商品数:{{ item.products }}</label>
  90. <label class="commission-box mar-left-70 font-color-999">实付金额:¥{{ item.price }}</label>
  91. </view>
  92. <view class="flex-row-plus flex-items mar-top-30">
  93. <label class="orderId-box font-color-999">下单人:{{ item.customerName }}</label>
  94. </view>
  95. <view class="flex-row-plus flex-items mar-top-30">
  96. <label class="orderId-box font-color-999">分销员:{{ item.distributorName }}</label>
  97. </view>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. <view style="padding-bottom: 45upx;">
  103. <LoadingMore
  104. :status="!secondhandSalesInfo.isEmpty && !secondhandSalesInfo.data.length
  105. ? 'loading' : !secondhandSalesInfo.isEmpty && secondhandSalesInfo.data.length && (secondhandSalesInfo.data.length >= secondhandSalesInfo.listTotal) ? 'no-more' : ''"
  106. >
  107. </LoadingMore>
  108. <tui-no-data v-if="secondhandSalesInfo.isEmpty" :fixed="false" style="margin-top: 60upx;">这里空空如也~</tui-no-data>
  109. </view>
  110. </view>
  111. </view>
  112. </view>
  113. </template>
  114. <script>
  115. import { getNotRewardDistributorApi } from '../../../api/anotherTFInterface'
  116. export default {
  117. name: 'Unliquidated',
  118. data() {
  119. return {
  120. awardTypeFlag: 0,
  121. directSalesDataList: {},
  122. secondhandSalesDataList: {},
  123. shopId: 0,
  124. distributorId: 0,
  125. directSalesInfo: {
  126. query: {
  127. type: 1,
  128. page: 1,
  129. pageSize: 10
  130. },
  131. data: [],
  132. listTotal: 0,
  133. isEmpty: false
  134. },
  135. secondhandSalesInfo: {
  136. query: {
  137. type: 2,
  138. page: 1,
  139. pageSize: 10
  140. },
  141. data: [],
  142. listTotal: 0, // 列表数据总数
  143. isEmpty: false // 列表是否为空
  144. }
  145. }
  146. },
  147. onLoad(options) {
  148. this.shopId = options.shopId
  149. this.distributorId = options.distributorId
  150. this.getDirectSalesDataList()
  151. },
  152. methods: {
  153. awardTypeActive(e) {
  154. this.awardTypeFlag = e.index
  155. // 缓存每个tab里的数据
  156. if (this.awardTypeFlag === 0) {
  157. } else if (this.awardTypeFlag === 1) {
  158. if (!this.secondhandSalesInfo.isEmpty && !this.secondhandSalesInfo.data.length) this.getSecondhandSalesDataList()
  159. }
  160. // 每点一个tab就重新进行对它的请求
  161. // if (this.awardTypeFlag === 0) {
  162. // this.directSalesInfo.query.page = 1
  163. // this.directSalesInfo.data = []
  164. // this.directSalesInfo.listTotal = 0
  165. // this.directSalesInfo.isEmpty = false
  166. // this.getApplyByStoreList()
  167. // } else if (this.awardTypeFlag === 1) {
  168. // this.secondhandSalesInfo.query.page = 1
  169. // this.secondhandSalesInfo.data = []
  170. // this.secondhandSalesInfo.listTotal = 0
  171. // this.secondhandSalesInfo.isEmpty = false
  172. // this.getApplyByUserList()
  173. // }
  174. },
  175. getDirectSalesDataList(isLoadmore) {
  176. uni.showLoading()
  177. getNotRewardDistributorApi({ ...this.directSalesInfo.query, shopId: this.shopId, distributorId: this.distributorId })
  178. .then((res) => {
  179. this.directSalesDataList = res.data
  180. this.directSalesInfo.listTotal = res.data.page.total
  181. if (isLoadmore) {
  182. this.directSalesInfo.data.push(...res.data.page.list)
  183. } else {
  184. this.directSalesInfo.data = res.data.page.list
  185. }
  186. this.directSalesInfo.isEmpty = this.directSalesInfo.data.length === 0
  187. uni.hideLoading()
  188. })
  189. .catch(() => {
  190. uni.hideLoading()
  191. })
  192. },
  193. getSecondhandSalesDataList(isLoadmore) {
  194. uni.showLoading()
  195. getNotRewardDistributorApi({ ...this.secondhandSalesInfo.query, shopId: this.shopId, distributorId: this.distributorId })
  196. .then((res) => {
  197. this.secondhandSalesDataList = res.data
  198. this.secondhandSalesInfo.listTotal = res.data.page.total
  199. if (isLoadmore) {
  200. this.secondhandSalesInfo.data.push(...res.data.page.list)
  201. } else {
  202. this.secondhandSalesInfo.data = res.data.page.list
  203. }
  204. this.secondhandSalesInfo.isEmpty = this.secondhandSalesInfo.data.length === 0
  205. uni.hideLoading()
  206. })
  207. .catch(() => {
  208. uni.hideLoading()
  209. })
  210. },
  211. arrowTypeChange1(arrowTypeId) {
  212. this.directSalesInfo.data[arrowTypeId].ifOpen = this.directSalesInfo.data[arrowTypeId].ifOpen == false
  213. },
  214. arrowTypeChange(arrowTypeId) {
  215. this.secondhandSalesInfo.data[arrowTypeId].ifOpen = this.secondhandSalesInfo.data[arrowTypeId].ifOpen == false
  216. }
  217. },
  218. onReachBottom() {
  219. if (this.awardTypeFlag === 0) {
  220. if (this.directSalesInfo.data.length < this.directSalesInfo.listTotal) {
  221. ++this.directSalesInfo.query.page
  222. this.getDirectSalesDataList(true)
  223. }
  224. } else if (this.awardTypeFlag === 1) {
  225. if (this.secondhandSalesInfo.data.length < this.secondhandSalesInfo.listTotal) {
  226. ++this.secondhandSalesInfo.query.page
  227. this.getSecondhandSalesDataList(true)
  228. }
  229. }
  230. }
  231. }
  232. </script>
  233. <style lang="less" scoped>
  234. .unliquidated-container {
  235. min-height: 100%;
  236. background-color: #333333;
  237. box-sizing: border-box;
  238. .unliquidated-topBackImg {
  239. width: 100%;
  240. background-color: #535353;
  241. margin-top: 30 rpx;
  242. padding-bottom: 20upx;
  243. .totalAward-content {
  244. width: 90%;
  245. .awardBox {
  246. text-align: center;
  247. .awardTit {
  248. opacity: 0.7;
  249. }
  250. }
  251. .amount {
  252. color: #FFEBC4;
  253. }
  254. }
  255. }
  256. .directAward-box {
  257. width: 94%;
  258. border-bottom: 1 upx solid #666666;
  259. padding: 30 upx;
  260. display: flex;
  261. justify-content: flex-start;
  262. flex-direction: column;
  263. background: #FFFFFF;
  264. margin-top: 30 rpx;
  265. .orderId-box {
  266. display: flex;
  267. justify-content: flex-start;
  268. flex-direction: row;
  269. }
  270. .commission-box {
  271. width: 260 upx;
  272. }
  273. }
  274. }
  275. </style>