team.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. <template>
  2. <view class="content">
  3. <!-- <view class="status_bar"></view> -->
  4. <view class="top-wrap flex">
  5. <view class="item">
  6. <view class="">
  7. 下级人数
  8. </view>
  9. <view class="val">
  10. {{info.area_taem_count}}
  11. </view>
  12. </view>
  13. <view class="item">
  14. <view class="">
  15. 团队业绩
  16. </view>
  17. <view class="val">
  18. ¥{{info.area_taem_cashback_money || '0.00'}}
  19. </view>
  20. </view>
  21. </view>
  22. <!-- <view class="content-money">
  23. <view class="body-title">
  24. <view class="goback-box" @click="toBack">
  25. <image class="goback" src="../../static/icon/fanhui.png" mode=""></image>
  26. </view>
  27. <view class="header">我的推广</view>
  28. </view>
  29. <view class="content-bg">
  30. <image src="../../static/img/tg-bg.png" mode=""></image>
  31. </view>
  32. <view class="money-box">
  33. <view class="money">{{ alls|| '0' }}</view>
  34. <view>我的团队</view>
  35. </view>
  36. </view> -->
  37. <view v-for="(item, index) in info.area_taem_lst" :key="index" class="order-item">
  38. <view class="top flex">
  39. <view class="name clamp">
  40. {{item.agent_user.nickname}}
  41. </view>
  42. <!-- <view class="name clamp">
  43. {{item.agent_user.phone}}
  44. </view> -->
  45. <!-- <image src="https://stx2.qiniu1314.com/static/img/level0.png" mode="" class="gp"></image> -->
  46. <view class="tc">
  47. {{item.name}}
  48. </view>
  49. <image src="../../static/icon/call.png" mode="" class="call" @click="makeCall(item.agent_user.phone)" v-if="item.agent_user.phone"></image>
  50. </view>
  51. <view class="info">
  52. <view class="info-item flex">
  53. <view class="">
  54. 待处理单数:<text>{{item.sub_not_count + item.wy_not_count}}</text>
  55. </view>
  56. <view class="">
  57. 完成单数:<text>{{item.wy_ok_count + item.sub_ok_count}}</text>
  58. </view>
  59. <view class="">
  60. <!-- 待处理单数:<text>5</text> -->
  61. </view>
  62. </view>
  63. <view class="info-val flex">
  64. <view class="">
  65. 累计金额:<text>¥{{item.wy_cashback_money + item.wy_cashback_money}}</text>
  66. </view>
  67. <!-- <view class="more">
  68. 查看明细<image src="../../static/index/in-go.png" mode=""></image>
  69. </view> -->
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. import {
  77. myspread,
  78. agentInfo,
  79. getLevelList
  80. } from '@/api/user.js';
  81. import empty from '@/components/empty';
  82. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  83. import {
  84. mapState,
  85. mapMutations
  86. } from 'vuex';
  87. export default {
  88. components: {
  89. empty,
  90. uniLoadMore
  91. },
  92. data() {
  93. return {
  94. // 头部图高度
  95. maxheight: '',
  96. tabCurrentIndex: 0,
  97. navList: [{
  98. state: 0,
  99. text: '直接推荐',
  100. loadingType: 'more',
  101. orderList: [],
  102. page: 1, //当前页数
  103. limit: 10 //每次信息条数
  104. },
  105. {
  106. state: 1,
  107. text: '间接推荐',
  108. loadingType: 'more',
  109. orderList: [],
  110. page: 1, //当前页数
  111. limit: 10 //每次信息条数
  112. }],
  113. alls: 0,
  114. all: '',
  115. list: '',
  116. totalLevel: '',
  117. order: '',
  118. zt_order: '',
  119. jt_order: '',
  120. listList: [],
  121. info: {
  122. area_taem_lst: [],
  123. area_taem_count: 0,
  124. area_taem_cashback_money: 0
  125. }
  126. };
  127. },
  128. computed: {
  129. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin']),
  130. ...mapState(['baseURL'])
  131. },
  132. onLoad(options) {},
  133. onShow() {
  134. this.agentInfo()
  135. // this.loadData();
  136. // getLevelList().then(res => {
  137. // console.log(res);
  138. // this.listList = res.data.list
  139. // })
  140. },
  141. methods: {
  142. makeCall(phone) {
  143. uni.makePhoneCall({
  144. phoneNumber: phone + ''
  145. })
  146. },
  147. agentInfo() {
  148. agentInfo().then(res => {
  149. console.log(res.data);
  150. this.info = res.data
  151. })
  152. },
  153. showLevel(val) {
  154. let data = this.listList.find(item => item.grade == val.level)
  155. if(data) {
  156. return data.name
  157. }else {
  158. if(val.orderCount > 0) {
  159. return '会员'
  160. }else {
  161. return '粉丝'
  162. }
  163. }
  164. },
  165. // 页面跳转
  166. navto(e) {
  167. uni.navigateTo({
  168. url: e
  169. });
  170. },
  171. //获取收入支出信息
  172. async loadData(source) {
  173. //这里是将订单挂载到tab列表下
  174. let index = this.tabCurrentIndex;
  175. let navItem = this.navList[index];
  176. let state = navItem.state;
  177. if (source === 'tabChange' && navItem.loaded === true) {
  178. //tab切换只有第一次需要加载数据
  179. return;
  180. }
  181. if (navItem.loadingType === 'loading') {
  182. //防止重复加载
  183. return;
  184. }
  185. if (navItem.loadingType === 'noMore') {
  186. //防止重复加载
  187. return;
  188. }
  189. // 修改当前对象状态为加载中
  190. navItem.loadingType = 'loading';
  191. myspread({
  192. page: navItem.page,
  193. limit: navItem.limit,
  194. grade:state,
  195. uid: this.userInfo.uid
  196. })
  197. .then(({
  198. data
  199. }) => {
  200. console.log(data,'的');
  201. this.order = data.order
  202. this.zt_order = data.zt_order
  203. this.jt_order = data.jt_order
  204. this.all = data.total;
  205. this.alls = data.all;
  206. this.totalLevel = data.totalLevel
  207. if (data.list.length > 0) {
  208. this.list = data.list;
  209. navItem.orderList = navItem.orderList.concat(data.list);
  210. navItem.page++;
  211. }
  212. this.$nextTick(function() {
  213. if (navItem.limit == data.list.length) {
  214. //判断是否还有数据, 有改为 more, 没有改为noMore
  215. navItem.loadingType = 'more';
  216. return;
  217. } else {
  218. //判断是否还有数据, 有改为 more, 没有改为noMore
  219. navItem.loadingType = 'noMore';
  220. }
  221. });
  222. this.$set(navItem, 'loaded', true);
  223. })
  224. .catch(e => {
  225. console.log(e);
  226. });
  227. },
  228. //swiper 切换
  229. changeTab(e) {
  230. this.tabCurrentIndex = e.target.current;
  231. this.loadData('tabChange');
  232. },
  233. //顶部tab点击
  234. tabClick(index) {
  235. this.tabCurrentIndex = index;
  236. },
  237. // 点击返回 我的页面
  238. toBack() {
  239. uni.switchTab({
  240. url: '/pages/user/user'
  241. });
  242. }
  243. }
  244. };
  245. </script>
  246. <style lang="scss">
  247. page {
  248. background: #f8f8f8;
  249. height: 100%;
  250. }
  251. .status_bar {
  252. height: var(--status-bar-height);
  253. width: 100%;
  254. background: #5dbc7c;
  255. }
  256. .top-wrap {
  257. background-color: $base-color;
  258. padding: 34rpx 32rpx;
  259. .item {
  260. width: 327rpx;
  261. height: 152rpx;
  262. padding: 30rpx 0 0 30rpx;
  263. background: #FFFFFF;
  264. border-radius: 16rpx;
  265. font-size: 28rpx;
  266. font-weight: bold;
  267. color: #303133;
  268. view {
  269. padding-bottom: 15rpx;
  270. }
  271. .val {
  272. font-size: 36rpx;
  273. }
  274. }
  275. }
  276. .order-item {
  277. width: 684rpx;
  278. background: #FFFFFF;
  279. border-radius: 16rpx;
  280. margin: 0 auto 20rpx;
  281. .top {
  282. width: 684rpx;
  283. height: 76rpx;
  284. background: #E9EEFF;
  285. border-radius: 16rpx 16rpx 0 0;
  286. justify-content: flex-start;
  287. padding:0 32rpx;
  288. .name {
  289. width: 150rpx;
  290. }
  291. .gp {
  292. width: 150rpx;
  293. height: 48rpx;
  294. }
  295. .tc {
  296. flex-grow: 1;
  297. }
  298. .call {
  299. width: 52rpx;
  300. height: 52rpx;
  301. }
  302. }
  303. .info {
  304. // height: 164rpx;
  305. .info-item {
  306. width: 618rpx;
  307. margin: auto;
  308. height: 80rpx;
  309. font-size: 28rpx;
  310. border-bottom:#DDE1EB 1px solid;
  311. text {
  312. font-weight: bold;
  313. }
  314. }
  315. .info-val {
  316. padding:0 33rpx;
  317. height: 80rpx;
  318. font-weight: 500;
  319. font-size: 28rpx;
  320. color: #303133;
  321. text {
  322. font-weight: bold;
  323. font-size: 28rpx;
  324. color: #FF6B2E;
  325. }
  326. .more {
  327. font-weight: 500;
  328. font-size: 24rpx;
  329. color: #999999;
  330. }
  331. image {
  332. display: inline-block;
  333. margin-left: 10rpx;
  334. width: 10rpx;
  335. height: 20rpx;
  336. vertical-align: middle;
  337. }
  338. }
  339. }
  340. }
  341. .list-scroll-content {
  342. padding-top: 20rpx;
  343. }
  344. </style>