vipdetail.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <template>
  2. <view>
  3. <view class="topBgline plr20">
  4. <view class="justify-start p30 bgcolf radius12">
  5. <u-avatar :src='detailUser.avatar'></u-avatar>
  6. <view class="ml16">
  7. <view class="bold fs28">{{detailUser.nickname}}</view>
  8. <view class="fs24 base-color-3">注册时间:{{detailUser.createTime}}</view>
  9. </view>
  10. </view>
  11. </view>
  12. <view class="plr20 ptb32 justify-around bgf">
  13. <view v-for="(item,index) in typeOption" :key="item.value" class='fs24 base-color-3 ptb4 plr20 radius4'
  14. @click="tabActive(item)" :class="tabindex==index?'actsel':'notact'">{{item.label}}</view>
  15. </view>
  16. <view class="bgf pb40">
  17. <u-collapse :border='false' :value='collapseValue' @change="changeCollapse">
  18. <!-- #ifdef MP-WEIXIN -->
  19. <u-collapse-item name="course" title="看课统计">
  20. <!-- #endif -->
  21. <!-- #ifndef MP-WEIXIN -->
  22. <u-collapse-item name="course">
  23. <text slot="title" class="bold">看课统计</text>
  24. <!-- #endif -->
  25. <text slot="value" class="base-color fs24">{{collapseValue.includes('course')?'收回':'展开'}}</text>
  26. <view slot="right-icon">
  27. <u-icon name="arrow-right" color="#1677ff" size="12"></u-icon>
  28. </view>
  29. <view class="justify-between">
  30. <view class="justify-between livebox">
  31. <view class="base-color-3">观看次数</view>
  32. <view class="base-color fs24"><text class="fs32 bold">{{answerlist.watchTimes}}</text>次</view>
  33. </view>
  34. <view class="livebox justify-between">
  35. <view class="base-color-3">完播次数</view>
  36. <view class="base-color fs24"><text class="fs32 bold">{{answerlist.completeWatchCount}}</text>次</view>
  37. </view>
  38. </view>
  39. </u-collapse-item>
  40. <!-- #ifdef MP-WEIXIN -->
  41. <u-collapse-item name="questions" title="答题统计">
  42. <!-- #endif -->
  43. <!-- #ifndef MP-WEIXIN -->
  44. <u-collapse-item name="questions">
  45. <text slot="title" class="bold">答题统计</text>
  46. <!-- #endif -->
  47. <text slot="value" class="base-color fs24">{{collapseValue.includes('course')?'收回':'展开'}}</text>
  48. <view slot="right-icon">
  49. <u-icon name="arrow-right" color="#1677ff" size="12"></u-icon>
  50. </view>
  51. <view class="justify-between">
  52. <view class=" liveboxs">
  53. <view class="base-color-3">答题次数</view>
  54. <view class="base-color fs24">
  55. <text class="fs32 bold">{{answerlist.answerTime}}</text>次
  56. </view>
  57. </view>
  58. <view class="liveboxs ">
  59. <view class="base-color-3">正确次数</view>
  60. <view class="base-color fs24">
  61. <text class="fs32 bold">{{answerlist.answerRightTime}}</text>次
  62. </view>
  63. </view>
  64. <view class="liveboxs ">
  65. <view class="base-color-3">答题红包数</view>
  66. <view class="base-color fs24">
  67. <text class="fs32 bold">{{answerlist.answerRedPacketTime}}</text>次
  68. </view>
  69. </view>
  70. </view>
  71. </u-collapse-item>
  72. </u-collapse>
  73. <view class="justify-start align-center base-bg-f8 mlr30 radius12 plr20 ptb20">
  74. <u-image :src="imgPath+'/app/manergevip/book.png'" width="30" height="30"></u-image>
  75. <view class="ml20">
  76. <view class="base-color-3">答题红包金额</view>
  77. <view class="base-color fs24"><text class="fs32 bold mr4">
  78. {{answerlist.answerRedPacketAmount==0?'00.00':answerlist.answerRedPacketAmount}}</text>元</view>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="justify-center botfun">
  83. <view class="justify-start align-center bottom-btns" style="border: 2rpx solid #ee0a25;"
  84. @click="disableUser" :class="this.detailUser.status!==1?'bgf':'base-bg-red'">
  85. <u-icon name="close-circle" :color="this.detailUser.status!==1?'#ee0a25':'#fff'" size="22" ></u-icon>
  86. <view class=" ml12" :class="this.detailUser.status!==1?'base-color-red':'colorf'">{{answerText}}</view>
  87. </view>
  88. <!-- <view class="justify-start align-center bottom-btns" style="border: 2rpx solid #1677ff;">
  89. <u-icon name="pushpin" color="#1677ff" size="22"></u-icon>
  90. <view class="base-color">会员分组</view>
  91. </view>
  92. <view class="justify-start align-center base-bg bottom-btns">
  93. <u-icon name="rmb-circle" color="#fff" size="22"></u-icon>
  94. <view class="colorf">新会员奖励</view>
  95. </view> -->
  96. </view>
  97. <u-loading-page :loading="viewload" iconSize="32" loadingColor="#3c9cff" fontSize="20"
  98. :loading-text="loadingtext"></u-loading-page>
  99. </view>
  100. </template>
  101. <script>
  102. import {
  103. getanswerlist,
  104. Addblacklist,
  105. removebalcklist
  106. } from "@/api/manageCompany.js";
  107. export default {
  108. data() {
  109. return {
  110. viewload: true,
  111. loadingtext: "数据加载中...",
  112. typeOption: [{
  113. label: '全部',
  114. value: 0
  115. }, {
  116. label: '今天',
  117. value: 1
  118. }, {
  119. label: '昨天',
  120. value: 2
  121. }, {
  122. label: '前天',
  123. value: 3
  124. }, {
  125. label: '近七天',
  126. value: 4
  127. }],
  128. tabindex: 0,
  129. collapseValue: ['course', 'questions', 'redenvelope'],
  130. detailUser: [],
  131. user: [],
  132. answerlist:[],
  133. answerText:'禁用',
  134. userId:[],
  135. id:'',
  136. dateTag:'',
  137. userCompanyId:''
  138. }
  139. },
  140. computed: {
  141. imgPath() {
  142. return this.$store.state.imgpath
  143. }
  144. },
  145. onShow() {
  146. this.getAnswerlists()
  147. this.detailUser =uni.getStorageSync('detailUser')
  148. if(this.detailUser.status!==1){
  149. this.answerText='取消禁用'
  150. }
  151. },
  152. mounted() {
  153. },
  154. onLoad(option) {
  155. this.id=option.id
  156. this.userCompanyId=option.userCompanyId
  157. },
  158. methods: {
  159. tabActive(item) {
  160. this.tabindex = item.value
  161. if(item.value==0){
  162. this.dateTag=''
  163. }else{
  164. this.dateTag=item.label
  165. }
  166. console.log(item.label)
  167. this.getAnswerlists()
  168. },
  169. changeCollapse(e) {
  170. this.collapseValue = e.filter(item => item.status == 'open').map(it => it.name)
  171. },
  172. getAnswerlists() {
  173. const params = {
  174. dateTag:this.dateTag,
  175. userId: this.id,
  176. userCompanyId:this.userCompanyId
  177. }
  178. getanswerlist(params).then(res => {
  179. if (res.code == 200) {
  180. this.viewload = false
  181. this.answerlist=res.data
  182. console.log(this.answerlist)
  183. } else {
  184. uni.showToast({
  185. icon: 'none',
  186. title: res.msg
  187. })
  188. }
  189. })
  190. },
  191. disableUser(){
  192. if(this.detailUser.status==1){
  193. this.addblack()
  194. this.detailUser.status=0
  195. this.answerText='已禁用'
  196. }else{
  197. this.deleteblack()
  198. this.detailUser.status==1
  199. this.answerText='禁用'
  200. }
  201. },
  202. addblack(){
  203. //添加到黑名单
  204. this.userId[0]=this.userCompanyId
  205. const params={
  206. userCompanyUserIds : this.userId
  207. }
  208. Addblacklist(this.userId).then(res=>{
  209. if(res.code==200){
  210. console.log(res)
  211. uni.showToast({
  212. icon: 'none',
  213. title: '用户成功被禁用'
  214. })
  215. setTimeout(()=>{
  216. console.log(1232)
  217. uni.navigateBack({
  218. data:1
  219. })
  220. },500)
  221. }else{
  222. uni.showToast({
  223. icon: 'none',
  224. title: res.msg
  225. })
  226. }
  227. })
  228. },
  229. deleteblack(){
  230. //移除黑名单
  231. this.userId[0]=this.userCompanyId
  232. removebalcklist(this.userId).then(res=>{
  233. if(res.code){
  234. uni.showToast({
  235. icon: 'none',
  236. title: '用户成功取消禁用'
  237. })
  238. setTimeout(()=>{
  239. uni.navigateTo({
  240. url:'/pages_manage/index?act='+2
  241. })
  242. },500)
  243. }else{
  244. uni.showToast({
  245. icon: 'none',
  246. title: res.msg
  247. })
  248. }
  249. })
  250. }
  251. }
  252. }
  253. </script>
  254. <style lang="scss" scoped>
  255. // page {
  256. // background-color: #fff;
  257. // }
  258. .topBgline {
  259. background: linear-gradient(to right, rgba(225, 238, 255, 1), rgba(223, 224, 254, 1));
  260. padding-top: 40rpx;
  261. }
  262. .bgcolf {
  263. background: rgba(255, 255, 255, 0.4);
  264. }
  265. .actsel {
  266. background-color: #1773ff;
  267. color: #fff;
  268. transition: background-color 0.4s ease-in-out;
  269. }
  270. .notact {
  271. background-color: #f8f8f8;
  272. }
  273. .livebox {
  274. width: calc(50% - 10rpx);
  275. background-color: #f8f8f8;
  276. padding: 20rpx 10rpx;
  277. border-radius: 12rpx;
  278. }
  279. .liveboxs {
  280. width: calc(33% - 10rpx);
  281. background-color: #f8f8f8;
  282. padding: 20rpx 10rpx;
  283. border-radius: 12rpx;
  284. }
  285. .bottom-btns {
  286. padding: 10rpx 40rpx;
  287. border-radius: 50rpx;
  288. }
  289. .botfun {
  290. position: fixed;
  291. bottom: 32rpx;
  292. right: 32rpx;
  293. }
  294. </style>