partner.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  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.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. this.totalInfo = this.tablist[index].total; //获取对应身份的数据统计
  127. },
  128. methods: {
  129. //下拉筛选
  130. timeDropdownFilter() {
  131. this.$refs.datePicker.open()
  132. },
  133. //日期选择事件
  134. confirmPickDate(startdate, enddate) {
  135. this.pageQuery.startTime = startdate;
  136. this.pageQuery.endTime = enddate;
  137. this.queryData();
  138. },
  139. //数据格式化
  140. numberFormat(value) {
  141. return (value).toLocaleString('en-US');
  142. },
  143. //选项卡切换
  144. change(index) {
  145. this.current = index;
  146. this.personlist = this.tablist[index]
  147. this.totalInfo = this.tablist[index].total;
  148. this.pageQuery.pageNum = 1;
  149. this.pageQuery.pageSize = 5;
  150. this.queryData(index);
  151. },
  152. //返回上一页
  153. back() {
  154. uni.navigateBack({
  155. delta: 1, // 返回的页面数,如果是1表示返回上一页
  156. success: function() {}
  157. });
  158. },
  159. //跳转详情页
  160. partnerDetail(id) {
  161. uni.navigateTo({
  162. url: "/pages/institutional/partnerDetail?id=" + id,
  163. })
  164. },
  165. //列表数据
  166. async queryData(grade) {
  167. let res = await this.$http.post('/newAppPartner/selectByGradeList', this.pageQuery);
  168. if (res.code == '200') {
  169. this.tablist = res.data; //选项卡
  170. this.tablist.map(val => {
  171. val.gradeName = "我是" + val.gradeName;
  172. return val;
  173. })
  174. this.personlist = res.data[grade]; //页面赋值第一条数据
  175. this.totalInfo = res.data[grade].total;
  176. }
  177. },
  178. }
  179. }
  180. </script>
  181. <style lang="scss" scoped>
  182. .headers {
  183. position: fixed;
  184. top: 0;
  185. left: 0;
  186. height: auto;
  187. width: 100%;
  188. z-index: 999;
  189. .roleIdentity {
  190. width: 100%;
  191. height: 176rpx;
  192. padding: 108rpx 30rpx 20rpx;
  193. box-sizing: border-box;
  194. background: linear-gradient(180deg, #D1EFFE 0%, #FFFFFF 100%);
  195. border-bottom: 1rpx solid #f2f2f2;
  196. .headers-activeTab {
  197. width: 80%;
  198. height: 50rpx;
  199. }
  200. .right {
  201. image {
  202. width: 28rpx;
  203. height: 28rpx;
  204. margin-right: 4rpx;
  205. }
  206. text {
  207. font-size: 24rpx;
  208. color: #333;
  209. }
  210. }
  211. }
  212. //筛选
  213. .filter {
  214. width: 100%;
  215. padding: 20rpx 30rpx;
  216. box-sizing: border-box;
  217. background-color: #fff;
  218. .filterTime {
  219. text:first-child {
  220. font-size: 26rpx;
  221. color: #333;
  222. }
  223. text:last-child {
  224. font-size: 19rpx;
  225. color: #666;
  226. margin-left: 4rpx;
  227. }
  228. }
  229. }
  230. //统计
  231. .statistics {
  232. width: 100%;
  233. background: #EBF4FF;
  234. padding: 8rpx 57rpx;
  235. box-sizing: border-box;
  236. font-size: 30rpx;
  237. color: #2B67EF;
  238. }
  239. }
  240. //列表数据
  241. .card {
  242. position: relative;
  243. background: #FFFFFF;
  244. border-radius: 10rpx;
  245. background-image: url("/static/card.png");
  246. background-size: 100% 100%;
  247. border-top: 1px solid;
  248. border-image: linear-gradient(270deg, rgba(45, 109, 255, 0), rgba(45, 109, 255, 1), rgba(45, 109, 255, 0)) 1 1;
  249. padding: 20rpx 30rpx 30rpx;
  250. .card-title {
  251. .avatar {
  252. width: 40rpx;
  253. height: 40rpx;
  254. border-radius: 50%;
  255. image {
  256. width: 100%;
  257. height: 100%;
  258. }
  259. }
  260. >text {
  261. font-size: 24rpx;
  262. color: #666;
  263. }
  264. .name {
  265. font-size: 30rpx;
  266. color: #333;
  267. font-weight: bold;
  268. }
  269. }
  270. .card-data {
  271. .view {
  272. width: 33.33%;
  273. text:first-child {
  274. font-size: 30rpx;
  275. color: #333;
  276. font-weight: bold;
  277. }
  278. text:last-child {
  279. font-size: 24rpx;
  280. color: #999;
  281. }
  282. }
  283. .view:nth-child(2) {
  284. border-left: 1rpx solid #eee;
  285. border-right: 1rpx solid #eee;
  286. }
  287. }
  288. }
  289. .popup-code {
  290. text {
  291. display: block;
  292. border-bottom: 1px solid #EEEEEE;
  293. height: 50px;
  294. line-height: 50px;
  295. text-align: center;
  296. font-size: 16px;
  297. color: #666666;
  298. }
  299. }
  300. .ShowModalCode-style {
  301. text:first-of-type {
  302. display: block;
  303. font-weight: 600;
  304. font-size: 16px;
  305. color: #333333;
  306. border: 1px solid #EEEEEE;
  307. padding: 15px;
  308. text-align: center;
  309. }
  310. }
  311. .popup-code {
  312. text {
  313. display: block;
  314. border-bottom: 1px solid #EEEEEE;
  315. height: 50px;
  316. line-height: 50px;
  317. text-align: center;
  318. font-size: 16px;
  319. color: #666666;
  320. }
  321. }
  322. .ShowModalCode-con {
  323. padding: 30px;
  324. text-align: center;
  325. image {
  326. margin: 0 auto;
  327. margin-top: 15px;
  328. }
  329. }
  330. </style>