rebateorder.vue 11 KB

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