manage.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. <template>
  2. <block>
  3. <view class="iNav iflex">
  4. <view class="iflexC aliCen tabItem" @tap="changeNav" :data-index="index" v-for="(item, index) in navs"
  5. :key="index">
  6. <text :class="'iNav-text ' + (navIndex == index ? '' : '')">{{ item.name }}</text>
  7. <image
  8. src="https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/0d08dcd267a9ecfb5aec198436d00646.png"
  9. v-if="navIndex == index"></image>
  10. </view>
  11. </view>
  12. <view class="content1">
  13. <view class="mItem" v-for="(item, index) in list" :key="index">
  14. <view class="mtop">
  15. <image class="avatar"
  16. :src="item.avatar || 'https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/a035c7dae49cc9904c7b0977895ffb1e.png'">
  17. </image>
  18. <view class="mInfo">
  19. <view class="info1">
  20. <view>
  21. {{ item.username }}
  22. </view>
  23. <view>入团:{{ item.jointime }}</view>
  24. </view>
  25. <view class="info2">
  26. <view>{{ item.mobile }}</view>
  27. <view>自购(单):
  28. <text class="fw700">{{ item.selfBuy }} </text>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="mbot">
  34. <view class="mleve">
  35. {{item.name}}
  36. </view>
  37. <view class="mInfo2">
  38. <view class="info3">
  39. <view>
  40. 下级(人): <text class="fw700"> {{ item.subLevelNum }} </text>
  41. </view>
  42. <view>下级推广(单):<text class="fw700">{{ item.subLevelShareNum }} </text> </view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="newData">
  47. <view class="newDataitem">
  48. <view>直推业绩(元)</view>
  49. <view>{{ item.direct}}</view>
  50. </view>
  51. <view class="newDataitem">
  52. <view>间推业绩(元)</view>
  53. <view>{{ item.indirect }}</view>
  54. </view>
  55. </view>
  56. <view class="newData">
  57. <view class="newDataitem">
  58. <view>累计收益(元)</view>
  59. <view>{{ item.cumulativeIncome }}</view>
  60. </view>
  61. <!-- <view class="newDataitem">
  62. <view>间推佣金(元)</view>
  63. <view>{{ item.indirectReward }}</view>
  64. </view> -->
  65. </view>
  66. </view>
  67. <view v-if="!list.length" style="color: #999; text-align: center; margin: 100rpx 0">暂无数据</view>
  68. </view>
  69. </block>
  70. </template>
  71. <script module="parse" lang="wxs">
  72. module.exports = {
  73. filterTime: function(value) {
  74. var nowDate = getDate(value * 1000); //过期时间
  75. var year = nowDate.getFullYear(); //当前年份
  76. var month = nowDate.getMonth() + 1; //当前月份
  77. var date = nowDate.getDate(); //当前几号
  78. var hours = nowDate.getHours(); //当前几小时
  79. return year + '-' + month + '-' + date
  80. }
  81. }
  82. </script>
  83. <script>
  84. // pages/tabbar/index/index.js
  85. var app = getApp();
  86. export default {
  87. data() {
  88. return {
  89. navs: [{
  90. name: "皇钻",
  91. group: 5
  92. },
  93. {
  94. name: "金钻",
  95. group: 4
  96. },
  97. {
  98. name: "银钻",
  99. group: 3
  100. },
  101. ],
  102. navIndex: 0,
  103. list: [],
  104. loaded: false,
  105. page: 1,
  106. pageSize: 10
  107. };
  108. },
  109. onLoad: function(options) {
  110. // uni.setNavigationBarTitle({
  111. // title: '团队管理'
  112. // });
  113. this.getlist();
  114. },
  115. onPullDownRefresh: function() {},
  116. onReachBottom: function() {
  117. this.loaded || this.getlist();
  118. },
  119. onShareAppMessage: function() {},
  120. methods: {
  121. changeNav(e) {
  122. let index = e.currentTarget.dataset.index;
  123. console.log(index);
  124. if (this.navIndex != index) {
  125. this.navIndex = index
  126. this.page = 1
  127. this.list = []
  128. this.loaded = false
  129. this.getlist();
  130. }
  131. },
  132. toPage(e) {
  133. app.globalData.toPage(e);
  134. },
  135. init() {
  136. this.page = 1
  137. this.loaded = false
  138. this.list = []
  139. },
  140. async getlist() {
  141. var that = this;
  142. let res = await this.$api.request('/stats/teamManage', 'GET', {
  143. page: that.page,
  144. count: that.pageSize,
  145. group: that.navs[that.navIndex].group,
  146. });
  147. console.log(res)
  148. if (res) {
  149. if (res.rows.length > 0) {
  150. this.list = this.list.concat(res.rows);
  151. this.page++;
  152. uni.setNavigationBarTitle({
  153. // title: '团队管理(' + res.total + ')'
  154. title: '团队管理'
  155. });
  156. } else {
  157. this.loaded = true
  158. this.$api.msg('没有更多数据');
  159. }
  160. }
  161. }
  162. }
  163. };
  164. </script>
  165. <style>
  166. page {
  167. background: #f4f5f9;
  168. }
  169. .select {
  170. padding: 30rpx 0 20rpx 0;
  171. background: #fff;
  172. display: flex;
  173. align-items: center;
  174. justify-content: space-around;
  175. }
  176. .selectItem {
  177. display: flex;
  178. align-items: center;
  179. }
  180. .selectItem>view {
  181. font-size: 28rpx;
  182. }
  183. .selectItem>image {
  184. width: 26rpx;
  185. margin-left: 12rpx;
  186. }
  187. .mItem {
  188. margin: 25rpx 0rpx 0;
  189. background: #fff;
  190. padding: 28rpx 20rpx;
  191. }
  192. .mtop {
  193. display: flex;
  194. align-items: center;
  195. }
  196. .mleve {
  197. width: 130rpx;
  198. height: 40rpx;
  199. border-radius: 40rpx;
  200. display: flex;
  201. align-items: center;
  202. justify-content: center;
  203. background: #FB4C6F;
  204. color: #fff;
  205. margin-left: -10rpx;
  206. font-size: 24rpx;
  207. margin-top: 12rpx;
  208. }
  209. .mbot {
  210. display: flex;
  211. align-items: center;
  212. }
  213. .avatar {
  214. width: 110rpx;
  215. height: 110rpx;
  216. border-radius: 50%;
  217. margin-right: 30rpx;
  218. }
  219. .mInfo {
  220. flex: 1;
  221. height: 110rpx;
  222. display: flex;
  223. flex-direction: column;
  224. justify-content: center;
  225. border-bottom: 1px solid #F3F0F3;
  226. padding-bottom: 14rpx;
  227. }
  228. .mInfo2 {
  229. flex: 1;
  230. display: flex;
  231. flex-direction: column;
  232. justify-content: center;
  233. margin-top: 12rpx;
  234. margin-left: 20rpx;
  235. }
  236. .info1 {
  237. display: flex;
  238. align-items: center;
  239. justify-content: space-between;
  240. }
  241. .info1>view:nth-child(1) {
  242. font-size: 30rpx;
  243. color: ;
  244. }
  245. .fz28 {
  246. font-size: 28rpx;
  247. }
  248. .info1>view:nth-child(2) {
  249. color: #8E8E8E;
  250. font-size: 24rpx;
  251. }
  252. .info2 {
  253. display: flex;
  254. align-items: center;
  255. justify-content: space-between;
  256. margin-top: 26rpx;
  257. }
  258. .info2>view:nth-child(1) {
  259. color: #010101;
  260. font-size: 24rpx;
  261. }
  262. .info2>view:nth-child(2) {
  263. color: #8E8E8E;
  264. }
  265. .fb {
  266. height: 112rpx;
  267. width: 100%;
  268. position: fixed;
  269. bottom: 0;
  270. background: #fff;
  271. display: flex;
  272. justify-content: center;
  273. align-items: center;
  274. }
  275. .info3 {
  276. display: flex;
  277. align-items: center;
  278. justify-content: space-between;
  279. font-size: 24rpx;
  280. color: #8E8E8E;
  281. }
  282. .fw700 {
  283. font-weight: 700;
  284. color: #010101;
  285. margin-left: 4rpx;
  286. }
  287. .addAddress {
  288. width: 670rpx;
  289. height: 80rpx;
  290. display: flex;
  291. justify-content: center;
  292. align-items: center;
  293. background: #1479ff;
  294. border-radius: 50rpx;
  295. }
  296. .addAddress>view {
  297. color: #fff;
  298. font-size: 30rpx;
  299. }
  300. .addAddress>image {
  301. width: 30rpx;
  302. margin-right: 14rpx;
  303. }
  304. view {
  305. font-size: 24rpx;
  306. }
  307. .iNav {
  308. /* padding: 0 20rpx 0; */
  309. /* margin-top: 34rpx; */
  310. line-height: 1;
  311. padding: 0 30rpx;
  312. background: #fff;
  313. }
  314. .iNav .iNav-text {
  315. padding: 30rpx 0rpx 28rpx;
  316. /* padding-top: 34rpx;
  317. padding-bottom: 28rpx; */
  318. color: #010101;
  319. font-size: 28rpx;
  320. }
  321. .iNav image {
  322. width: 68rpx;
  323. height: 10rpx;
  324. margin-top: -28rpx;
  325. }
  326. .jsbet {
  327. justify-content: space-between;
  328. }
  329. .iflex {
  330. display: flex;
  331. justify-content: space-around;
  332. }
  333. .aliCen {
  334. align-items: center;
  335. }
  336. .iflexC {
  337. display: flex;
  338. flex-direction: column;
  339. }
  340. .ifontweight {
  341. font-weight: 700;
  342. }
  343. .content1 {
  344. padding: 0 30rpx;
  345. box-sizing: border-box;
  346. }
  347. .tabItem {
  348. margin-right: 70rpx;
  349. }
  350. .newData {
  351. margin-top: 20rpx;
  352. padding-top: 26rpx;
  353. margin-left: 150rpx;
  354. padding-top: 1px solid #F3F0F3;
  355. display: flex;
  356. align-items: center;
  357. }
  358. .newDataitem {
  359. flex: 1;
  360. }
  361. .newDataitem>view:nth-child(1) {
  362. font-size: 24rpx;
  363. color: #8E8E8E;
  364. }
  365. .newDataitem>view:nth-child(2) {
  366. font-size: 26rpx;
  367. color: #010101;
  368. font-weight: 700;
  369. margin-top: 12rpx;
  370. }
  371. .newData>.newDataitem:nth-child(2) {
  372. padding-left: 70rpx;
  373. }
  374. </style>