partner.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. <template>
  2. <view class="">
  3. <!-- 全局 loding -->
  4. <public-module></public-module>
  5. <!-- 头部 -->
  6. <view class="headers ">
  7. <!-- 头部身份切换 -->
  8. <view class="roleIdentity dis a-c j-s">
  9. <u-icon name="arrow-left" color="#333" size="38" @click="back"></u-icon>
  10. <view class="headers-activeTab">
  11. <u-tabs :list="tablist" :is-scroll="true" active-color="#333" inactive-color="#999"
  12. :current="current" :show-bar="false" @change="change" name="gradeName" height="50"
  13. :active-item-style="{fontSize:'36rpx'}" style="background: transparent;"></u-tabs>
  14. </view>
  15. <view class="right dis a-c">
  16. <image src="/static/home/customerService1.png" mode=""></image>
  17. <text>客服</text>
  18. </view>
  19. </view>
  20. <!-- 下拉筛选 -->
  21. <view class="filter dis a-c j-end">
  22. <view class="filterTime dis a-c " @click="timeDropdownFilter">
  23. <text>时间筛选</text>
  24. <text>▼</text>
  25. </view>
  26. </view>
  27. <!-- 数据统计 -->
  28. <view class="statistics dis a-c j-c " v-if="totalInfo">
  29. 共有 {{totalInfo.numberOrders}} 笔订单,保费{{totalInfo.totalPremium}}元,佣金{{totalInfo.commission}}元
  30. </view>
  31. </view>
  32. <view class="body p-2" style="padding-top: 340rpx;">
  33. <view class="card mb-2" v-for="(item,index) in personlist.data.records" :key="index">
  34. <!-- 权限锁定组件 -->
  35. <uni-permission-view position="fixed" :backimage="true"
  36. v-if="personlist.parentStatus=='2' && index==personlist.data.records.length-1" direction="row"
  37. :genericText="`完成任务,解锁“${personlist.gradeName.slice(2)}”,查看所有下级成员`" cornerRadius="8rpx"
  38. :genericTextStyle="{fontSize:'26rpx'}">
  39. </uni-permission-view>
  40. <!-- 权限锁定组件 -->
  41. <view class="card-title dis a-c j-s mb-2">
  42. <view class="dis a-c ">
  43. <view class="avatar">
  44. <image src="/static/image/my/wuxingb.png" mode=""></image>
  45. </view>
  46. <text class="name ml-1">{{item.userName}}</text>
  47. </view>
  48. <text>{{item.createTime}} &nbsp;加入</text>
  49. </view>
  50. <view class="card-data dis a-c j-s " @click.stop="partnerDetail(item.id)">
  51. <view class="view dis f-c a-c ">
  52. <text>{{item.number}}</text>
  53. <text>{{item.gradeName}}</text>
  54. </view>
  55. <view class="view dis f-c a-c ">
  56. <text>{{numberFormat(item.premium || 0 )}}</text>
  57. <text>保费</text>
  58. </view>
  59. <view class="view dis f-c a-c ">
  60. <text>{{numberFormat(item.commission || 0 )}}</text>
  61. <text>我的佣金</text>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. <u-loadmore v-if=" personlist.data.records && personlist.data.records.length!=0" :status="status" />
  67. <my-date-picker ref="datePicker" @confirmPickDate="confirmPickDate" />
  68. </view>
  69. </template>
  70. <script>
  71. import myDatePicker from '../components/date-picker.vue';
  72. import QR from "@/common/wxqrcode.js"
  73. import {
  74. mapState,
  75. mapMutations
  76. } from "vuex"
  77. export default {
  78. components: {
  79. myDatePicker
  80. },
  81. computed: {
  82. ...mapState(['userInfo', "userCheckInfo"]),
  83. },
  84. data() {
  85. return {
  86. //tab选项
  87. totalInfo: {}, //选中角色统计数据
  88. tablist: [], //动态tab
  89. personlist: [],
  90. current: 0,
  91. status: 'loadmore',
  92. pageQuery: {
  93. grade: "",
  94. startTime: "",
  95. endTime: "",
  96. pageNum: 1,
  97. pageSize: 5,
  98. }
  99. }
  100. },
  101. onReachBottom() {
  102. if (this.pageQuery.pageNum >= this.personlist.data.totalPages) return;
  103. this.status = 'loading';
  104. this.pageQuery.pageNum = ++this.pageQuery.pageNum;
  105. setTimeout(async () => {
  106. let res = await this.$http.post('/newAppPartner/selectByGradeList', this.pageQuery);
  107. if (res.code == '200') {
  108. this.personlist.data.records = [...this.personlist.data.records, ...res.data[this.current]
  109. .data.records
  110. ];
  111. }
  112. if (this.pageQuery.pageNum >= this.personlist.data.totalPages) this.status = 'nomore';
  113. else this.status = 'loading';
  114. }, 1000)
  115. },
  116. async onLoad(params) {
  117. this.pageQuery.grade = params.grade;
  118. if (params.startTime) {
  119. this.pageQuery.startTime = params.startTime;
  120. this.pageQuery.endTime = params.endTime;
  121. }
  122. await this.queryData(0);
  123. const index = this.tablist.findIndex(item => item.grade == params.grade);
  124. this.current = index; //获取对应身份的数据下标
  125. this.personlist = this.tablist[index]; //获取对应身份的数据列表
  126. console.log(this.personlist);
  127. this.totalInfo = this.tablist[index].total; //获取对应身份的数据统计
  128. },
  129. methods: {
  130. //下拉筛选
  131. timeDropdownFilter() {
  132. this.$refs.datePicker.open()
  133. },
  134. //日期选择事件
  135. confirmPickDate(startdate, enddate) {
  136. this.pageQuery.startTime = startdate;
  137. this.pageQuery.endTime = enddate;
  138. this.queryData();
  139. },
  140. //数据格式化
  141. numberFormat(value) {
  142. return (value).toLocaleString('en-US');
  143. },
  144. //选项卡切换
  145. change(index) {
  146. this.current = index;
  147. this.personlist = this.tablist[index]
  148. this.totalInfo = this.tablist[index].total;
  149. this.pageQuery.pageNum = 1;
  150. this.pageQuery.pageSize = 5;
  151. this.queryData(index);
  152. },
  153. //返回上一页
  154. back() {
  155. uni.navigateBack({
  156. delta: 1, // 返回的页面数,如果是1表示返回上一页
  157. success: function() {}
  158. });
  159. },
  160. //跳转详情页
  161. partnerDetail(id) {
  162. uni.navigateTo({
  163. url: "/pages/institutional/partnerDetail?id=" + id,
  164. })
  165. },
  166. //列表数据
  167. async queryData(grade) {
  168. let res = await this.$http.post('/newAppPartner/selectByGradeList', this.pageQuery);
  169. if (res.code == '200') {
  170. this.tablist = res.data; //选项卡
  171. this.tablist.map(val => {
  172. val.gradeName = "我是" + val.gradeName;
  173. return val;
  174. })
  175. this.personlist = res.data[grade]; //页面赋值第一条数据
  176. this.totalInfo = res.data[grade].total;
  177. }
  178. },
  179. }
  180. }
  181. </script>
  182. <style lang="scss" scoped>
  183. .headers {
  184. position: fixed;
  185. top: 0;
  186. left: 0;
  187. height: auto;
  188. width: 100%;
  189. z-index: 999;
  190. .roleIdentity {
  191. width: 100%;
  192. height: 176rpx;
  193. padding: 108rpx 30rpx 20rpx;
  194. box-sizing: border-box;
  195. background: linear-gradient(180deg, #D1EFFE 0%, #FFFFFF 100%);
  196. border-bottom: 1rpx solid #f2f2f2;
  197. .headers-activeTab {
  198. width: 80%;
  199. height: 50rpx;
  200. }
  201. .right {
  202. image {
  203. width: 28rpx;
  204. height: 28rpx;
  205. margin-right: 4rpx;
  206. }
  207. text {
  208. font-size: 24rpx;
  209. color: #333;
  210. }
  211. }
  212. }
  213. //筛选
  214. .filter {
  215. width: 100%;
  216. padding: 20rpx 30rpx;
  217. box-sizing: border-box;
  218. background-color: #fff;
  219. .filterTime {
  220. text:first-child {
  221. font-size: 26rpx;
  222. color: #333;
  223. }
  224. text:last-child {
  225. font-size: 19rpx;
  226. color: #666;
  227. margin-left: 4rpx;
  228. }
  229. }
  230. }
  231. //统计
  232. .statistics {
  233. width: 100%;
  234. background: #EBF4FF;
  235. padding: 8rpx 57rpx;
  236. box-sizing: border-box;
  237. font-size: 30rpx;
  238. color: #2B67EF;
  239. }
  240. }
  241. //列表数据
  242. .card {
  243. position: relative;
  244. background: #FFFFFF;
  245. border-radius: 10rpx;
  246. background-image: url("/static/card.png");
  247. background-size: 100% 100%;
  248. border-top: 1px solid;
  249. border-image: linear-gradient(270deg, rgba(45, 109, 255, 0), rgba(45, 109, 255, 1), rgba(45, 109, 255, 0)) 1 1;
  250. padding: 20rpx 30rpx 30rpx;
  251. .card-title {
  252. .avatar {
  253. width: 40rpx;
  254. height: 40rpx;
  255. border-radius: 50%;
  256. image {
  257. width: 100%;
  258. height: 100%;
  259. }
  260. }
  261. >text {
  262. font-size: 24rpx;
  263. color: #666;
  264. }
  265. .name {
  266. font-size: 30rpx;
  267. color: #333;
  268. font-weight: bold;
  269. }
  270. }
  271. .card-data {
  272. .view {
  273. width: 33.33%;
  274. text:first-child {
  275. font-size: 30rpx;
  276. color: #333;
  277. font-weight: bold;
  278. }
  279. text:last-child {
  280. font-size: 24rpx;
  281. color: #999;
  282. }
  283. }
  284. .view:nth-child(2) {
  285. border-left: 1rpx solid #eee;
  286. border-right: 1rpx solid #eee;
  287. }
  288. }
  289. }
  290. .popup-code {
  291. text {
  292. display: block;
  293. border-bottom: 1px solid #EEEEEE;
  294. height: 50px;
  295. line-height: 50px;
  296. text-align: center;
  297. font-size: 16px;
  298. color: #666666;
  299. }
  300. }
  301. .ShowModalCode-style {
  302. text:first-of-type {
  303. display: block;
  304. font-weight: 600;
  305. font-size: 16px;
  306. color: #333333;
  307. border: 1px solid #EEEEEE;
  308. padding: 15px;
  309. text-align: center;
  310. }
  311. }
  312. .popup-code {
  313. text {
  314. display: block;
  315. border-bottom: 1px solid #EEEEEE;
  316. height: 50px;
  317. line-height: 50px;
  318. text-align: center;
  319. font-size: 16px;
  320. color: #666666;
  321. }
  322. }
  323. .ShowModalCode-con {
  324. padding: 30px;
  325. text-align: center;
  326. image {
  327. margin: 0 auto;
  328. margin-top: 15px;
  329. }
  330. }
  331. </style>