teamorder.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. <template>
  2. <view class="content">
  3. <view class="bg">
  4. <view style="text-align: center;display: flex;padding: 100upx 32upx 0upx 32upx;color: #FFFFFF;">
  5. <view style="width: 49%;text-align: center;">
  6. <view>本月未到账(元)</view>
  7. <view style="margin-top: 28upx;font-size: 60upx;">{{sum1}}</view>
  8. </view>
  9. <view style="background: #FFFFFF;width: 2upx;"></view>
  10. <view style="width: 49%;text-align: center;">
  11. 本月已到账(元)
  12. <view style="margin-top: 28upx;font-size: 60upx;">{{sum2}}</view>
  13. </view>
  14. </view>
  15. <!-- <view style="font-size: 24upx;color: #FFFFFF;padding-top: 30upx; padding-left: 95upx;">注:确认收货后七个工作日金额自动到账</view> -->
  16. </view>
  17. <!-- <view class="navbar">
  18. <view class="nav-item" :class="{current: index == 1}" @tap="zhishu(1)">
  19. 直属收益
  20. </view>
  21. <view class="nav-item" :class="{current: index == 3}" @tap="tuan(3)">
  22. 非直属收益
  23. </view>
  24. </view> -->
  25. <view class="navbar">
  26. <view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{current: tabCurrentIndex === index}"
  27. @click="tabClick(index)">
  28. {{item.text}}
  29. </view>
  30. </view>
  31. <swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab">
  32. <swiper-item class="tab-content" v-for="(tabItem,tabIndex) in navList" :key="tabIndex">
  33. <scroll-view class="list-scroll-content" @scrolltolower="loadMore" scroll-y>
  34. <!-- 订单列表 -->
  35. <view v-for="(item,index) in list" :key="index" class="order-item" @click="toGoodsInfo(item.goodsId)">
  36. <view class="i-top b-b">
  37. <text class="time" style="font-size: 14px;color: grey">{{item.createAt}}付款</text>
  38. <text class="state" style="color: #FF2638" v-if="item.status==1"> 未到账</text>
  39. <text class="state" style="color: #0e80d2" v-if="item.status==2"> 已到账</text>
  40. </view>
  41. <view class="goods-box-single">
  42. <image class="goods-img" :src='item.goodsImg'></image>
  43. <view class="right">
  44. <text class="title clamp">{{item.goodsTitle}}</text>
  45. <text class="attr-box">店铺名称:上门服务自营店铺</text>
  46. <text class="price">实付款 ¥{{item.payMoney}}</text>
  47. <view v-if="moneyFrom === 1" style="display: flex;flex-direction: column;">
  48. <text class="attr-box">直属名称 {{item.lowerUserName}}</text>
  49. <text class="attr-box">直属提成 ¥{{item.commissionMoney}}</text>
  50. </view>
  51. <view v-if="moneyFrom != 1" style="display: flex;flex-direction: column;">
  52. <text class="attr-box">非直属名称 {{item.lowerUserName}}</text>
  53. <text class="attr-box">非直属提成 ¥{{item.commissionMoney}}</text>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="price-box">
  58. <text>预估收入</text>
  59. <text class="price" style="color: #FF2638;font-weight: bold">
  60. {{item.commissionPrice}}
  61. </text>
  62. </view>
  63. </view>
  64. <!-- 悬浮上拉 -->
  65. <view class="scroll_top" @tap="topScrollTap" v-bind:class="[scrollTop ? 'active' : '', '']" style="bottom: 56px;"><text
  66. class="iconfont icon-shangla"></text></view>
  67. <!-- 加载更多提示 -->
  68. <view class="s-col is-col-24" v-if="list.length > 0">
  69. <load-more :loadingType="loadingType" :contentText="contentText"></load-more>
  70. </view>
  71. <!-- 空白页 -->
  72. <empty class="empty-content" v-if="list.length === 0" des="暂无数据"></empty>
  73. </scroll-view>
  74. </swiper-item>
  75. </swiper>
  76. </view>
  77. </template>
  78. <script>
  79. import empty from "@/components/empty";
  80. export default {
  81. components: {
  82. empty
  83. },
  84. data() {
  85. return {
  86. tabFromIndex: 0,
  87. index: 1,
  88. moneyFrom: 1,
  89. page: 0,
  90. size: 10,
  91. sum1: 0,
  92. sum2: 0,
  93. toBase64Url: '',
  94. tabCurrentIndex: 0,
  95. scrollTop: false,
  96. list: [],
  97. loadingType: 0,
  98. navList: [{
  99. state: 0,
  100. text: '全部'
  101. }, {
  102. state: 1,
  103. text: '未到账'
  104. },
  105. {
  106. state: 2,
  107. text: '已到账'
  108. }
  109. ],
  110. contentText: {
  111. contentdown: '上拉显示更多',
  112. contentrefresh: '正在加载...',
  113. contentnomore: '没有更多数据了'
  114. }
  115. };
  116. },
  117. onPageScroll: function(e) {
  118. this.scrollTop = e.scrollTop > 200;
  119. },
  120. onShow() {
  121. this.tabCurrentIndex = 0;
  122. this.loadData('');
  123. this.getLIst();
  124. },
  125. methods: {
  126. zhishu(nub) {
  127. this.index = nub
  128. this.page = 0;
  129. this.moneyFrom = nub;
  130. this.list = [];
  131. this.loadData('');
  132. },
  133. tuan(nub) {
  134. this.index = nub
  135. this.page = 0;
  136. this.moneyFrom = nub;
  137. this.list = [];
  138. this.loadData('');
  139. },
  140. toGoodsInfo(id) {
  141. uni.navigateTo({
  142. url: '../index/commoditydetail?ordersId=' + id
  143. });
  144. },
  145. loadMore() {
  146. this.loadData('');
  147. },
  148. getLIst() {
  149. let userId = this.$queue.getData('userId');
  150. this.$Request.getT('/app/ordersRelation/tuanStatistaical?userId=' + userId).then(res => {
  151. if (res.status === 0) {
  152. if (res.data.sum1) {
  153. this.sum1 = res.data.sum1;
  154. } else {
  155. this.sum1 = 0;
  156. }
  157. if (res.data.sum2) {
  158. this.sum2 = res.data.sum2;
  159. } else {
  160. this.sum2 = 0;
  161. }
  162. }
  163. });
  164. },
  165. loadData(type) {
  166. this.loadingType = 1;
  167. uni.showLoading({
  168. title: '加载中...'
  169. });
  170. let userId = this.$queue.getData('userId');
  171. this.$Request.getT('/app/ordersRelation/list?page=' + this.page + '&moneyFrom=' + this.moneyFrom + '&size=' + this.size +
  172. '&userId=' + userId + '&status=' + this.tabCurrentIndex).then(res => {
  173. if (res.status === 0) {
  174. if (this.page === 0 || res.status) {
  175. this.list = [];
  176. }
  177. res.data.content.forEach(d => {
  178. this.list.push(d);
  179. });
  180. if (res.data.content.length === this.size) {
  181. this.loadingType = 0;
  182. } else {
  183. this.loadingType = 3;
  184. }
  185. } else {
  186. this.loadingType = 2;
  187. }
  188. uni.hideLoading();
  189. if (type === 'Refresh') {
  190. uni.stopPullDownRefresh(); // 停止刷新
  191. }
  192. });
  193. },
  194. //swiper 切换
  195. changeTab(e) {
  196. this.tabCurrentIndex = e.target.current;
  197. },
  198. //顶部tab点击
  199. tabClick(index) {
  200. this.tabCurrentIndex = index;
  201. this.page = 0;
  202. this.loadData('');
  203. },
  204. topScrollTap: function() {
  205. uni.pageScrollTo({
  206. scrollTop: 0,
  207. duration: 300
  208. });
  209. }
  210. },
  211. onPageScroll: function(e) {
  212. this.scrollTop = e.scrollTop > 200;
  213. },
  214. onReachBottom: function() {
  215. this.page = this.page + 1;
  216. this.loadData('');
  217. },
  218. onPullDownRefresh: function() {
  219. this.page = 0;
  220. this.loadData('Refresh');
  221. }
  222. }
  223. </script>
  224. <style lang="scss">
  225. @import '../../../../static/less/index.less';
  226. @import '../../../../static/css/index.css';
  227. page,
  228. .content {
  229. background: $page-color-base;
  230. height: 100%;
  231. }
  232. .bg {
  233. background: #05C25C;
  234. background-size: 100%;
  235. height: 350upx;
  236. }
  237. .swiper-box {
  238. height: calc(100% - 40px);
  239. }
  240. .list-scroll-content {
  241. height: 100%;
  242. }
  243. .navbar {
  244. display: flex;
  245. height: 40px;
  246. padding: 0 5px;
  247. background: #fff;
  248. box-shadow: 0 1px 5px rgba(0, 0, 0, .06);
  249. position: relative;
  250. z-index: 10;
  251. .nav-item {
  252. flex: 1;
  253. display: flex;
  254. justify-content: center;
  255. align-items: center;
  256. height: 100%;
  257. font-size: 15px;
  258. color: $font-color-dark;
  259. position: relative;
  260. &.current {
  261. color: $base-color;
  262. &:after {
  263. content: '';
  264. position: absolute;
  265. left: 50%;
  266. bottom: 0;
  267. transform: translateX(-50%);
  268. width: 44px;
  269. height: 0;
  270. border-bottom: 2px solid $base-color;
  271. }
  272. }
  273. }
  274. }
  275. .uni-swiper-item {
  276. height: auto;
  277. }
  278. .order-item {
  279. display: flex;
  280. flex-direction: column;
  281. padding-left: 15px;
  282. background: #fff;
  283. margin-top: 8px;
  284. .i-top {
  285. display: flex;
  286. align-items: center;
  287. height: 40px;
  288. padding-right: 16px;
  289. font-size: $font-base;
  290. color: $font-color-dark;
  291. position: relative;
  292. .time {
  293. flex: 1;
  294. }
  295. .state {
  296. font-weight: 400;
  297. color: $base-color;
  298. }
  299. .del-btn {
  300. padding: 6px 0 6px 18px;
  301. font-size: $font-lg;
  302. color: $font-color-light;
  303. position: relative;
  304. &:after {
  305. content: '';
  306. width: 0;
  307. height: 16px;
  308. border-left: 1px solid $border-color-dark;
  309. position: absolute;
  310. left: 10px;
  311. top: 50%;
  312. transform: translateY(-50%);
  313. }
  314. }
  315. }
  316. /* 单条商品 */
  317. .goods-box-single {
  318. display: flex;
  319. padding: 10px 0;
  320. .goods-img {
  321. width: 100px;
  322. height: 100px;
  323. }
  324. .right {
  325. flex: 1;
  326. display: flex;
  327. flex-direction: column;
  328. padding: 0 15px 0 12px;
  329. overflow: hidden;
  330. .title {
  331. height: 32px;
  332. overflow: hidden;
  333. text-overflow: ellipsis;
  334. font-size: $font-base + 2upx;
  335. color: $font-color-dark;
  336. line-height: 1;
  337. }
  338. .attr-box {
  339. font-size: $font-sm + 2upx;
  340. color: $font-color-light;
  341. padding: 5px 0px;
  342. }
  343. .price {
  344. font-size: $font-base + 2upx;
  345. color: $font-color-dark;
  346. &:before {
  347. font-size: $font-sm;
  348. margin: 0 1px 0 4px;
  349. }
  350. }
  351. }
  352. }
  353. .price-box {
  354. display: flex;
  355. justify-content: flex-end;
  356. align-items: baseline;
  357. padding: 10px 16px;
  358. font-size: $font-sm + 2upx;
  359. color: $font-color-light;
  360. .num {
  361. margin: 0 4px;
  362. color: $font-color-dark;
  363. }
  364. .price {
  365. font-size: $font-lg;
  366. color: $font-color-dark;
  367. &:before {
  368. content: '¥';
  369. font-size: $font-sm;
  370. margin: 0 1px 0 4px;
  371. }
  372. }
  373. }
  374. .action-box {
  375. display: flex;
  376. justify-content: flex-end;
  377. align-items: center;
  378. height: 50px;
  379. position: relative;
  380. padding-right: 16px;
  381. }
  382. .action-btn {
  383. width: 80px;
  384. height: 30px;
  385. margin: 0;
  386. margin-left: 12px;
  387. padding: 0;
  388. text-align: center;
  389. line-height: 30px;
  390. font-size: $font-sm + 2upx;
  391. color: $font-color-dark;
  392. background: #fff;
  393. border-radius: 100px;
  394. &:after {
  395. border-radius: 100px;
  396. }
  397. &.recom {
  398. background: #fff9f9;
  399. color: $base-color;
  400. &:after {
  401. border-color: #f7bcc8;
  402. }
  403. }
  404. }
  405. }
  406. /* load-more */
  407. .uni-load-more {
  408. display: flex;
  409. flex-direction: row;
  410. height: 40px;
  411. align-items: center;
  412. justify-content: center
  413. }
  414. .uni-load-more__text {
  415. font-size: 14px;
  416. color: #999
  417. }
  418. .uni-load-more__img {
  419. height: 24px;
  420. width: 24px;
  421. margin-right: 10px
  422. }
  423. .uni-load-more__img>view {
  424. position: absolute
  425. }
  426. .uni-load-more__img>view view {
  427. width: 6px;
  428. height: 2px;
  429. border-top-left-radius: 1px;
  430. border-bottom-left-radius: 1px;
  431. background: #999;
  432. position: absolute;
  433. opacity: .2;
  434. transform-origin: 50%;
  435. animation: load 1.56s ease infinite
  436. }
  437. .uni-load-more__img>view view:nth-child(1) {
  438. transform: rotate(90deg);
  439. top: 2px;
  440. left: 9px
  441. }
  442. .uni-load-more__img>view view:nth-child(2) {
  443. transform: rotate(180deg);
  444. top: 11px;
  445. right: 0
  446. }
  447. .uni-load-more__img>view view:nth-child(3) {
  448. transform: rotate(270deg);
  449. bottom: 2px;
  450. left: 9px
  451. }
  452. .uni-load-more__img>view view:nth-child(4) {
  453. top: 11px;
  454. left: 0
  455. }
  456. .load1,
  457. .load2,
  458. .load3 {
  459. height: 24px;
  460. width: 24px
  461. }
  462. .load2 {
  463. transform: rotate(30deg)
  464. }
  465. .load3 {
  466. transform: rotate(60deg)
  467. }
  468. .load1 view:nth-child(1) {
  469. animation-delay: 0s
  470. }
  471. .load2 view:nth-child(1) {
  472. animation-delay: .13s
  473. }
  474. .load3 view:nth-child(1) {
  475. animation-delay: .26s
  476. }
  477. .load1 view:nth-child(2) {
  478. animation-delay: .39s
  479. }
  480. .load2 view:nth-child(2) {
  481. animation-delay: .52s
  482. }
  483. .load3 view:nth-child(2) {
  484. animation-delay: .65s
  485. }
  486. .load1 view:nth-child(3) {
  487. animation-delay: .78s
  488. }
  489. .load2 view:nth-child(3) {
  490. animation-delay: .91s
  491. }
  492. .load3 view:nth-child(3) {
  493. animation-delay: 1.04s
  494. }
  495. .load1 view:nth-child(4) {
  496. animation-delay: 1.17s
  497. }
  498. .load2 view:nth-child(4) {
  499. animation-delay: 1.3s
  500. }
  501. .load3 view:nth-child(4) {
  502. animation-delay: 1.43s
  503. }
  504. @-webkit-keyframes load {
  505. 0% {
  506. opacity: 1
  507. }
  508. 100% {
  509. opacity: .2
  510. }
  511. }
  512. </style>