yjjl.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. <template>
  2. <view class="content">
  3. <view class="user-top">
  4. <!-- <view class="select-time">
  5. <picker mode="date" @change="bindDateChange" fields="month">
  6. <view class="uni-input">{{showdate}}</view>
  7. </picker>
  8. <image src="../../static/img/downjian.png" mode="widthFix"></image>
  9. </view> -->
  10. <view class="top-val">
  11. {{userInfo.order_count}}
  12. </view>
  13. <view class="top-tit">
  14. 本月订单数量
  15. </view>
  16. </view>
  17. <!-- <view class="sz-wrap">
  18. <view class="sz-item">
  19. <view class="sz-tit">
  20. 上月收入
  21. </view>
  22. <view class="sz-val">
  23. 200
  24. </view>
  25. </view>
  26. <view class="jg">
  27. </view>
  28. <view class="sz-item">
  29. <view class="sz-tit">
  30. 累计收入
  31. </view>
  32. <view class="sz-val">
  33. 200
  34. </view>
  35. </view>
  36. </view> -->
  37. <!-- <view class="navbar">
  38. <view v-for="(item, index) in navlist" :key="index" class="nav-item"
  39. :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.title }}</view>
  40. </view> -->
  41. <swiper :current="tabCurrentIndex" :style="{ height: height }" class="swiper-box" duration="300" disable-touch>
  42. <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navlist" :key="tabIndex">
  43. <scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="loadData">
  44. <!-- 空白页 -->
  45. <u-empty text="暂无数据" mode="list" v-if="tabItem.loaded && tabItem.list.length == 0"></u-empty>
  46. <!-- 订单列表 -->
  47. <view class="order-item" v-for="(item, index) in tabItem.list" :key="index">
  48. <image src="https://api.liuniukj.com/img/admin/ywc.png" mode="" class="logo" v-if="userInfo.order_count*1 >= item.number*1"></image>
  49. <image src="https://api.liuniukj.com/img/admin/dwc.png" mode="" class="logo" v-else></image>
  50. <!-- <image src="" mode="" class="logo"></image> -->
  51. <view class="title-box">
  52. <view class="title">
  53. <!-- <text>{{ item.mark }}</text> -->
  54. {{item.name}}
  55. </view>
  56. <view class="time">
  57. <!-- <text>{{ item.create_time }}</text> -->
  58. <!-- 2022-12-1 09:30 -->
  59. 奖励股权{{item.number}}
  60. </view>
  61. </view>
  62. <view class="money">
  63. {{(userInfo.order_count*1 >= item.number*1 )? "已完成": '未完成'}}
  64. <!-- <view>{{ (item.pm == 0 ? '-' : '+') + 1500 }}</view>
  65. <image src="../../static/img/downright.png" mode=""></image> -->
  66. </view>
  67. </view>
  68. <u-loadmore :status="tabItem.loadingType" />
  69. </scroll-view>
  70. </swiper-item>
  71. </swiper>
  72. </view>
  73. </template>
  74. <script>
  75. export default {
  76. data() {
  77. return {
  78. userInfo: {},
  79. showdate: '',
  80. tabCurrentIndex: 0,
  81. height: '',
  82. id: '',
  83. navlist: [{
  84. status: 0,
  85. title: '收入',
  86. list: [],
  87. page: 1,
  88. pageSize: 100,
  89. loaded: false,
  90. loadingType: 'loadmore'
  91. },
  92. {
  93. status: 1,
  94. title: '扣除',
  95. list: [],
  96. page: 1,
  97. pageSize: 10,
  98. loaded: false,
  99. loadingType: 'loadmore'
  100. }
  101. ]
  102. }
  103. },
  104. onLoad(opt) {
  105. },
  106. onShow() {
  107. this.getCustomerInfo()
  108. },
  109. onReachBottom() {
  110. },
  111. onReady() {
  112. var _this = this;
  113. uni.getSystemInfo({
  114. success: resu => {
  115. const query = uni.createSelectorQuery();
  116. query.select('.swiper-box').boundingClientRect();
  117. query.exec(function(res) {
  118. _this.height = resu.windowHeight - res[0].top + 'px';
  119. console.log('打印页面的剩余高度', _this.height);
  120. });
  121. },
  122. fail: res => {}
  123. });
  124. },
  125. methods: {
  126. //顶部tab点击
  127. tabClick(index) {
  128. this.tabCurrentIndex = index;
  129. this.loadData('tab')
  130. },
  131. // 选择年月
  132. bindDateChange(e) {
  133. let time = e.detail.value.split('-')
  134. this.showdate = time[0] + '年' + time[1] + '月'
  135. this.loadData('reload')
  136. },
  137. // 获取当前年月
  138. getTime() {
  139. let date = new Date()
  140. this.showdate = date.getFullYear() + '年' + (date.getMonth() + 1) + '月'
  141. this.loadData()
  142. },
  143. // 获取数据
  144. loadData(type) {
  145. let that = this
  146. let index = that.tabCurrentIndex
  147. let item = that.navlist[index]
  148. if (type == 'reload') {
  149. item.loaded = false
  150. item.loadingType = 'more'
  151. item.page = 1
  152. item.list = []
  153. }
  154. if (type == 'tab' && item.loaded) {
  155. return
  156. }
  157. if (item.loadingType == 'loading' || item.loadingType == 'nomore') {
  158. return
  159. }
  160. item.loadingType = 'loading'
  161. this.$u.api.StaffLadder({
  162. page: item.page,
  163. pageSize: item.pageSize
  164. }).then(({data})=> {
  165. item.list = data
  166. item.loaded = true
  167. item.loadingType = 'nomore'
  168. })
  169. },
  170. getCustomerInfo() {
  171. this.$u.api.getYgdetail({
  172. request_id: this.$store.state.userInfo.staffId
  173. }).then(({
  174. data
  175. }) => {
  176. this.userInfo = data
  177. this.loadData()
  178. })
  179. },
  180. }
  181. }
  182. </script>
  183. <style lang="scss">
  184. .user-top {
  185. width: 100%;
  186. height: 400rpx;
  187. background-color: #4075d6;
  188. display: flex;
  189. flex-direction: column;
  190. justify-content: center;
  191. align-items: center;
  192. padding-bottom: 60rpx;
  193. // position: relative;
  194. .top-tit {
  195. font-size: 30rpx;
  196. font-weight: bold;
  197. color: #FFFFFF;
  198. }
  199. .top-val {
  200. font-size: 72rpx;
  201. font-weight: 500;
  202. color: #FFFFFF;
  203. }
  204. .select-time {
  205. position: absolute;
  206. top: 30rpx;
  207. right: 30rpx;
  208. font-size: 26rpx;
  209. font-weight: 500;
  210. color: #fff;
  211. display: flex;
  212. align-items: center;
  213. image {
  214. width: 17rpx;
  215. margin-left: 10rpx;
  216. }
  217. }
  218. }
  219. .sz-wrap {
  220. width: 670rpx;
  221. height: 186rpx;
  222. background: #FFFFFF;
  223. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  224. border-radius: 20rpx;
  225. margin: -90rpx auto 20rpx;
  226. display: flex;
  227. justify-content: center;
  228. align-items: center;
  229. .jg {
  230. width: 2rpx;
  231. height: 74rpx;
  232. background: #DCDFE6;
  233. }
  234. .sz-item {
  235. width: 330rpx;
  236. height: 100%;
  237. display: flex;
  238. flex-direction: column;
  239. align-items: center;
  240. justify-content: center;
  241. font-size: 30rpx;
  242. font-weight: bold;
  243. .sz-tit {
  244. color: #999999;
  245. }
  246. .sz-val {
  247. margin-top: 30rpx;
  248. color: #181818;
  249. }
  250. }
  251. }
  252. .navbar {
  253. margin-top: 20rpx;
  254. display: flex;
  255. height: 88rpx;
  256. padding: 0 5px;
  257. background: #fff;
  258. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  259. position: relative;
  260. z-index: 10;
  261. .nav-item {
  262. flex: 1;
  263. display: flex;
  264. justify-content: center;
  265. align-items: center;
  266. height: 100%;
  267. font-size: 15px;
  268. color: #999999;
  269. position: relative;
  270. &.current {
  271. color: #000;
  272. &:after {
  273. content: '';
  274. position: absolute;
  275. left: 50%;
  276. bottom: 0;
  277. transform: translateX(-50%);
  278. width: 44px;
  279. height: 0;
  280. border-bottom: 2px solid #fe5b38;
  281. }
  282. }
  283. }
  284. }
  285. //列表
  286. .swiper-box {
  287. margin-top: 20rpx;
  288. padding: 0 20rpx;
  289. background-color: #fff;
  290. .order-item:last-child {
  291. margin-bottom: 60rpx;
  292. }
  293. .order-item {
  294. width: 100%;
  295. // background-color: red;
  296. padding: 20rpx 30rpx;
  297. line-height: 1.5;
  298. display: flex;
  299. align-items: center;
  300. border-bottom: 1rpx solid #F0F0F0;
  301. .logo {
  302. flex-shrink: 0;
  303. margin-right: 20rpx;
  304. width: 45rpx;
  305. height: 45rpx;
  306. border-radius: 50%;
  307. background-color: #eee;
  308. }
  309. .title-box {
  310. flex-grow: 1;
  311. padding-right: 50rpx;
  312. .title {
  313. font-size: 30rpx;
  314. color: #333333;
  315. }
  316. .time {
  317. font-size: 26rpx;
  318. color: #AEAEAE;
  319. }
  320. }
  321. .money {
  322. color: #AEAEAE;
  323. min-width: 150rpx;
  324. font-size: 26rpx;
  325. text-align: right;
  326. display: flex;
  327. align-items: center;
  328. justify-content: flex-end;
  329. image {
  330. width: 10rpx;
  331. height: 20rpx;
  332. margin-left: 15rpx;
  333. }
  334. .status {
  335. color: #AEAEAE;
  336. }
  337. }
  338. }
  339. }
  340. .list-scroll-content {
  341. background: #ffffff;
  342. height: 100%;
  343. }
  344. </style>