managedetail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. <template>
  2. <view class="column flex-1 hb">
  3. <view class="header-box ptb52 pl20">
  4. <view class="justify-between align-center">
  5. <view class="justify-start">
  6. <u-avatar :src="user.avatar" size="50"></u-avatar>
  7. <view class="column colorf ml16" style="color: #666;">
  8. <text>{{user.userName}}</text>
  9. <text class="mt20 fs24">ID:{{user.companyId}}</text>
  10. </view>
  11. </view>
  12. <view class="column justify-between mr20 ">
  13. <view class="box-btn base-color mb16" @click="exportlist">审核详情</view>
  14. </view>
  15. </view>
  16. <!-- <view class="bgf mr4 radius20 p32 mt32 justify-start pb32">
  17. <view class="flex-1 pb20" @click="userdataDetail">
  18. <view class="bold">账户可用余额</view>
  19. <view class="bold fs48 base-color">{{balanceuserDay.balance}}</view>
  20. </view>
  21. <view class="flex-1 pb20 pl40" style="border-left:4rpx solid #0cb2ff;" @click="showday=!showday">
  22. <view class="bold"><text class="base-color">
  23. {{PickerName}}</text>已发金额</view>
  24. <view class="bold fs48 base-color">{{balanceuserDay.todayMoney}}</view>
  25. </view>
  26. </view> -->
  27. </view>
  28. <view class="bgf centerV" style="border-radius: 10rpx 10rpx 0 0; margin-top: -8rpx;">
  29. <u-tabs :list="list1" @click="clickTab" lineColor='#1773ff' lineWidth='40'
  30. activeStyle="font-weight:bold"></u-tabs>
  31. </view>
  32. <view class="column flex-1 scrolly">
  33. <scroll-view scroll-y="true" class="hb" :refresher-enabled="isEnabled" :refresher-triggered="triggered"
  34. refresher-background="rgba(0,0,0,0)" @refresherrefresh="pullDownRefresh"
  35. @refresherrestore="triggered = false" :upper-threshold="100" :lower-threshold="100"
  36. @refresherabort="triggered = false" @scrolltolower="reachBottom">
  37. <view class="mtb20 ml20 mr8 p20 bgf radius20" v-for="(item,index) in redpacklist" :key="index"
  38. @click="managedetail(item.userId,item)">
  39. <view class="justify-start align-center">
  40. <u-avatar :src="item.avatar" size="50"></u-avatar>
  41. <view class="ml20" @click.passive.stop>
  42. <view class="justify-start align-center">
  43. <text class="fs28 bold">{{item.nickName}}</text>
  44. <image class="w40 h40" :src="imgPath+'/app/images/copy_icon.png'"
  45. @click="copyId(item.nickName)" mode="aspectFill">
  46. </view>
  47. <view class="fs24 base-color-6">备注:{{item.remark?item.remark:'暂无'}}</view>
  48. </view>
  49. </view>
  50. <view class="justify-around mt32">
  51. <view class="column align-center">
  52. <view class="fs24 base-color-3">今日观看人数</view>
  53. <view class="base-color fs28">
  54. <text class="bold fs40 base-color">{{item.todayWatchCount}}</text>人
  55. </view>
  56. </view>
  57. <view class="column align-center">
  58. <view class="fs24 base-color-3">今日完播人数</view>
  59. <view class="base-color fs28">
  60. <text class="bold fs40 base-color">{{item.todayFinishCount}}</text>人
  61. </view>
  62. </view>
  63. <view class="column align-center">
  64. <view class="fs24 base-color-3">今日完播率</view>
  65. <view class="base-color fs28">
  66. <text class="bold fs40 base-color" >{{item.todayFinishRate.toFixed(2)}}</text>%
  67. </view>
  68. </view>
  69. <view class="column align-center">
  70. <view class="fs24 base-color-3">今日红包金额</view>
  71. <view class="base-color fs28">
  72. <text class="bold fs40 base-color">{{item.todayRedPacketAmount}}</text>元
  73. </view>
  74. </view>
  75. </view>
  76. <view class="base-bg-f8 pl20 fs24 ptb8 mt4 radius20" >
  77. <text class="base-color-6">更换归属状态:</text>
  78. <text style="color: orange;" v-if="item.applyStatus==0">待审核</text>
  79. <text style="color: green;" v-if="item.applyStatus==1">审核通过</text>
  80. <text class="base-color-red" v-if="item.applyStatus==2">审核未通过</text>
  81. <text class=" base-color" v-if="item.applyStatus==3">暂无</text>
  82. </view>
  83. <view class="justify-between fs24 mt20 align-center" @click.passive.stop>
  84. <view >
  85. <text @click="showmoreA(item)">更多</text></view>
  86. <view @click.passive.stop>
  87. <view class="ptb16 plr32 base-bg-false radius50 base-color-red fs28 bold"
  88. @click="changevipDetail(item.userId)">更换会员归属</view>
  89. </view>
  90. </view>
  91. </view>
  92. <u-loadmore :status="status" />
  93. <view class="ptb20"></view>
  94. </scroll-view>
  95. </view>
  96. <!-- <image class="invite-member" :src="imgPath+'/app/images/invite-member-icon.png'" mode="aspectFill" @click="vipInvite">
  97. </image> -->
  98. <!-- 不要写在v-for里面 点击存到data里面-->
  99. <view class="">
  100. <u-popup :show="showmore" @close="closemore" @open="openmore" >
  101. <view class="column align-center">
  102. <view class="m20" v-for="(items,index) in morelist"
  103. :key="items.value" @click="nameMore(items)">
  104. {{items.name}}</view>
  105. <u-modal :show="showlist" :title="titlelist" @confirm="confirmchange" >
  106. <view class="slot-content">
  107. <u-input :placeholder="contpl" v-model="changelist" v-if="selnum==1"></u-input>
  108. <u-input :placeholder="contpl" v-model="changephone" v-if="selnum==2"></u-input>
  109. <u-input :placeholder="contpl" v-model="changeremark" v-if="selnum==3"></u-input>
  110. </view>
  111. </u-modal>
  112. </view>
  113. </u-popup>
  114. </view>
  115. <view class="">
  116. <u-picker :show="showday" :columns="columns" keyName="label" style="flex:0;" @cancel="cancel"
  117. @confirm='confirm'></u-picker>
  118. </view>
  119. <u-loading-page :loading="viewload" iconSize="32" loadingColor="#3c9cff" fontSize="20"
  120. :loading-text="loadingtext" ></u-loading-page>
  121. </view>
  122. </template>
  123. <script>
  124. import {
  125. getusergroup,
  126. getuserbalance,
  127. updategroupinfo
  128. } from "@/api/manageCompany.js"
  129. export default {
  130. data() {
  131. return {
  132. viewload:true,
  133. loadingtext:"数据加载中...",
  134. list1: [{
  135. name: '销售员(0)',
  136. },
  137. // {
  138. // name: '待审群管(0)'
  139. // }, {
  140. // name: '已拒绝(0)'
  141. // }
  142. ],
  143. user: [],
  144. showmore:false,
  145. showlist:false,
  146. contpl:'',
  147. changelist:'',
  148. changephone:'',
  149. changeremark:'',
  150. titlelist:'',
  151. selnum:0,
  152. showday: false,
  153. columns: [
  154. [{
  155. label: '今日',
  156. id: 1
  157. },
  158. {
  159. label: '昨日',
  160. id: 2
  161. },
  162. {
  163. label: '近七日',
  164. id: 3
  165. },
  166. {
  167. label: '本月',
  168. id: 4
  169. },
  170. ],
  171. ],
  172. redpacklist: [],
  173. triggered: false,
  174. status: 'loadmore',
  175. isEnabled: true,
  176. pageNum: 1,
  177. pageSize: 5,
  178. startTime: '',
  179. endTime: '',
  180. balanceuserDay: [],
  181. pickered: '',
  182. todayday: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd'),
  183. PickerName: "今日",
  184. morelist:[
  185. {
  186. name:'复制ID',
  187. value:0,
  188. text:''
  189. },
  190. {
  191. name:'改姓名',
  192. value:1,
  193. text:'请输入姓名'
  194. },
  195. {
  196. name:'改手机号码',
  197. value:2,
  198. text:'请输入手机号码'
  199. },
  200. {
  201. name:'改备注',
  202. value:3,
  203. text:'请输入备注'
  204. }
  205. ],
  206. openData:{}
  207. }
  208. },
  209. mounted() {
  210. this.user = uni.getStorageSync("companyUserInfo") ? JSON.parse(uni.getStorageSync("companyUserInfo")) : {}
  211. this.getredlist()
  212. // this.getuserbalancelist()
  213. },
  214. computed: {
  215. imgPath() {
  216. return this.$store.state.imgpath
  217. }
  218. },
  219. methods: {
  220. showmoreA(data){
  221. this.openData=data
  222. this.groupid=data.userId,
  223. this.showmore=!this.showmore
  224. },
  225. closemore(){
  226. this.showmore=false
  227. },
  228. openmore(){
  229. },
  230. updatagroup(){
  231. console.log( Number(this.groupid))
  232. const param={
  233. nickName:this.changelist,
  234. phoneNumber:this.changephone,
  235. remark:this.changeremark,
  236. userId: this.groupid
  237. }
  238. updategroupinfo(param).then(res=>{
  239. if(res.code==200){
  240. uni.showToast({
  241. icon: 'none',
  242. title: "修改成功"
  243. })
  244. this.getredlist('refresh')
  245. }else{
  246. uni.showToast({
  247. icon: 'none',
  248. title: res.msg
  249. })
  250. }
  251. })
  252. },
  253. nameMore(item){
  254. console.log(item)
  255. this.titlelist=item.name
  256. this.contpl=item.text
  257. this.selnum=item.value
  258. if(item.value==0){
  259. uni.setClipboardData({
  260. data: String(this.openData.userId),
  261. success: () => {
  262. uni.showToast({
  263. title: '复制成功',
  264. icon: 'none',
  265. duration: 2000
  266. });
  267. },
  268. })
  269. }else if(item.value==1){
  270. this.changelist=this.openData.nickName
  271. this.showlist=true
  272. }else if(item.value==2){
  273. console.log(this.openData.phonenumber)
  274. this.changephone=this.openData.phonenumber
  275. this.showlist=true
  276. }else{
  277. this.changeremark=this.openData.remark
  278. this.showlist=true
  279. }
  280. },
  281. confirmchange(){
  282. this.updatagroup()
  283. this.showlist=false
  284. setTimeout(()=>{
  285. this.showmore=false
  286. },200)
  287. },
  288. copyId(id) {
  289. uni.setClipboardData({
  290. data: String(id),
  291. success: () => {
  292. uni.showToast({
  293. title: '复制成功',
  294. icon: 'none',
  295. duration: 2000
  296. });
  297. },
  298. })
  299. },
  300. getuserbalancelist() {
  301. const params = {
  302. companyId: this.user.companyId,
  303. endTime: this.endTime,
  304. startTime: this.startTime,
  305. }
  306. getuserbalance(params).then(res => {
  307. if (res.code == 200) {
  308. this.balanceuserDay = res.data
  309. } else {
  310. uni.showToast({
  311. icon: 'none',
  312. title: res.msg
  313. })
  314. }
  315. })
  316. },
  317. pullDownRefresh() {
  318. // 下拉刷新
  319. this.triggered = true; //下拉了状态为true
  320. setTimeout(() => {
  321. this.triggered = false;
  322. uni.stopPullDownRefresh()
  323. this.pageNum = 1;
  324. this.getredlist('refresh') //触底 不穿执行else
  325. // 请求接口里面需要判断是不是最后一页 是最后一页 status赋值为‘loadmore’没有更多了
  326. // 请求接口
  327. }, 1000)
  328. },
  329. reachBottom() {
  330. // status这个是加载状态
  331. console.log(111);
  332. if (this.status === 'loadmore') {
  333. this.status = 'loading'
  334. uni.showNavigationBarLoading()
  335. setTimeout(() => {
  336. this.pageNum++
  337. this.getredlist() //触底 不穿执行else
  338. uni.hideNavigationBarLoading()
  339. }, 1000);
  340. }
  341. },
  342. getredlist(type) {
  343. const params = {
  344. pageNum: this.pageNum,
  345. pageSize: this.pageSize,
  346. }
  347. getusergroup(params).then(res => {
  348. if (res.code == 200) {
  349. console.log(res)
  350. this.viewload=false
  351. this.list1[0].name = '销售员(' + res.data.total + ')'
  352. // refresh 下拉
  353. if (type == 'refresh') {
  354. this.redpacklist = res.data.list
  355. } else {
  356. // 加载更多 当前页和下一页合并
  357. this.redpacklist = [...this.redpacklist, ...res.data.list]
  358. }
  359. if (this.pageNum >= res.data.pages) {
  360. this.status = 'nomore'
  361. } else {
  362. this.status = 'loadmore'
  363. }
  364. } else {
  365. uni.showToast({
  366. icon: 'none',
  367. title: res.msg
  368. })
  369. }
  370. })
  371. },
  372. cancel() {
  373. this.showday = !this.showday
  374. },
  375. close() {
  376. this.showday = !this.showday
  377. },
  378. confirm(e) {
  379. this.pickered = e.indexs[0]
  380. this.PickerName = e.value[0].label
  381. if (this.pickered == 0) {
  382. this.startTime = this.todayday
  383. this.endTime = this.todayday
  384. } else if (this.pickered == 1) {
  385. let yesterday = new Date();
  386. yesterday.setDate(yesterday.getDate() - 1);
  387. this.startTime = uni.$u.timeFormat(yesterday, 'yyyy-mm-dd')
  388. this.endTime = uni.$u.timeFormat(yesterday, 'yyyy-mm-dd')
  389. } else if (this.pickered == 2) {
  390. let yesterday = new Date();
  391. yesterday.setDate(yesterday.getDate() - 6);
  392. this.startTime = uni.$u.timeFormat(yesterday, 'yyyy-mm-dd')
  393. this.endTime = uni.$u.timeFormat(this.todayday, 'yyyy-mm-dd')
  394. } else {
  395. let today = new Date();
  396. let lastDayOfMonth = new Date(today.getFullYear(), today.getMonth() + 1, 0);
  397. this.startTime = uni.$u.timeFormat(this.todayday, 'yyyy-mm') + '-01'
  398. this.endTime = uni.$u.timeFormat(lastDayOfMonth, 'yyyy-mm-dd')
  399. }
  400. this.startTime = this.startTime + ' 00:00:00'
  401. this.endTime = this.endTime + ' 23:59:59'
  402. this.showday = !this.showday
  403. this.getuserbalancelist()
  404. },
  405. clickTab(item) {
  406. // console.log('item', item);
  407. },
  408. exportlist() {
  409. uni.navigateTo({
  410. url: "/pages_managedata/exprotList"
  411. })
  412. },
  413. userdataDetail() {
  414. uni.navigateTo({
  415. url: "/pages/courseManage/manage/userDataDetail"
  416. })
  417. },
  418. managedetail(id,item) {
  419. uni.setStorageSync('grouplist', item)
  420. uni.navigateTo({
  421. url: "/pages_manage/manageDataDetail?id="+id
  422. })
  423. },
  424. changevipDetail(id) {
  425. uni.navigateTo({
  426. url: '/pages_managedata/changeVip?id='+id
  427. })
  428. }
  429. }
  430. }
  431. </script>
  432. <style lang="scss" scoped>
  433. .header-box {
  434. // background: linear-gradient(to right, rgba(66, 144, 240, 1.0), rgba(39, 107, 254, 1));
  435. background: linear-gradient(to bottom, #dae9ff, #e1e1fd);
  436. }
  437. .box-btn {
  438. font-size: 28rpx;
  439. background-color: #fff;
  440. border-radius: 8rpx;
  441. padding: 4rpx 20rpx;
  442. width: fit-content;
  443. }
  444. .invite-member {
  445. height: 55px;
  446. width: 50px;
  447. position: fixed;
  448. bottom: 80px;
  449. right: 10px;
  450. cursor: pointer;
  451. }
  452. </style>