123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745 |
- <template>
- <view class="column flex-1 hb">
- <view class="header p20">
- <view class="justify-start">
- <u-avatar :src="grouplist.avatar" size="50"></u-avatar>
- <view>
- <view class="justify-start align-center ml20">
- <text class="fs32 bold mr8">{{grouplist.nickName}}</text>
- <image class="w40 h40" src="@/static/images/copy_icon.png" @click="copyId" mode="aspectFill">
- </view>
- </view>
- </view>
- <view class="ptb20">-</view>
- </view>
- <view class="bgf">
- <view class="centerV">
- <u-tabs :list="list1" @click="clickTab" lineColor='#1773ff' lineWidth='40'
- activeStyle="font-weight:bold"></u-tabs>
- </view>
- <view class="justify-between box-blue" v-show="showCont==1">
- <view class="base-bg-sure boxs">
- <view class="bold">会员总数</view>
- <view class="base-color fs28">
- <text class="fs40 bold">{{companyUserUserCount}}</text>人
- </view>
- </view>
- <view class="base-bg-sure boxs">
- <view class="bold">今日新增会员</view>
- <view class="base-color fs28">
- <text class="fs40 bold">{{companyUserCount}}</text>人
- </view>
- </view>
- <view class="base-bg-sure boxs">
- <view class="bold">会员红包数</view>
- <view class="base-color fs28"><text class="fs40 bold">{{redbaglist.count}}</text>个</view>
- </view>
- <view class="base-bg-sure boxs">
- <view class="bold">新会员红包金额</view>
- <view class="base-color fs28"><text class="fs40 bold">{{redbaglist.amount}}</text>元</view>
- </view>
- </view>
- <dropdownPanel :filterData='filterData' @onChange="onChange" @confirm="confirm" @reset="reset">
- <view v-if="searchbarNav == 0">
- <view class="p20 fs28 column flex-1 scrolly">
- <view v-for="(item,index) in courseOne" :key="item.index"
- :class="courseid==item.courseId?'actNav':''" class="m10 p10 center"
- style="border-bottom: 2rpx solid #eee;" @click="getCourseOne(item.courseId)">
- {{item.courseName}}
- </view>
- </view>
- </view>
- <view class="p20 fs28 column flex-1 hidden h100" v-if="searchbarNav == 1">
- <scroll-view scroll-y="true" class="hb" :refresher-enabled="isEnableds"
- :refresher-triggered="triggereds" refresher-background="rgba(0,0,0,0)"
- @refresherrefresh="pullDownRefreshs" @refresherrestore="triggereds = false"
- :upper-threshold="100" :lower-threshold="100" @refresherabort="triggereds = false"
- @scrolltolower="reachBottoms">
- <view v-for="(item,index) in courseTwo" :key="item.index"
- :class="courseids==item.videoId?'actNav':''" class="m10 p10 center"
- style="border-bottom: 2rpx solid #eee;" @click="getCourseTwo(item.videoId)">
- {{item.title}}
- </view>
- <u-loadmore :status="statusA" />
- <view class="ptb40"></view>
- </scroll-view>
- </view>
- </dropdownPanel>
- </view>
- <view class="column flex-1 scrolly" v-show="showCont==0">
- <scroll-view scroll-y="true" class="hb" :refresher-enabled="isEnabled" :refresher-triggered="triggered"
- refresher-background="rgba(0,0,0,0)" @refresherrefresh="pullDownRefresh"
- @refresherrestore="triggered = false" :upper-threshold="100" :lower-threshold="100"
- @refresherabort="triggered = false" @scrolltolower="reachBottom">
- <view class="m20 radius16 bgf p20" style="border: #3e9f59 solid 2rpx;"
- v-for="(item,index) in courselist" :key="index">
- <view class="justify-start align-center pb20" style="border-bottom: #eee solid 2rpx;">
- <view class="doingimg">
- <image src="../../../static/manergevip/book.png" class='w150 h90 radius16'></image>
- <view class="doing">进行中</view>
- </view>
- <view class="ml20">
- <view class="justify-start align-center">
- <view>{{item.courseName}}</view>
- <view class="justify-start align-center base-color">ID
- <image class="w40 h40" @click="copyCourseId(item.courseId)"
- src="@/static/images/copy_icon.png" mode="aspectFill">
- </view>
- </view>
- <view class="fs24 base-color-6 column">
- <text>{{item.title}}</text>
- <text></text>
- </view>
- </view>
- </view>
- <view class="justify-between fs28 mt20">
- <view class="flex-1">
- <view class="mb8 base-color-6">观看人数</view>
- <view>{{item.count}}</view>
- </view>
- <view class="flex-1">
- <view class="mb8 base-color-6">完播人数</view>
- <view>{{item.completeCount}}
- <text class="base-color-red ml16">完播率{{item.completeRate.toFixed(2)}}%</text>
- </view>
- </view>
- </view>
- <view class="justify-between fs28 mt20 pb20" style="border-bottom: #eee solid 2rpx;">
- <view class="flex-1">
- <view class="mb8 base-color-6">答题红包数</view>
- <view>{{item.redPacketCount}}</view>
- </view>
- <view class="flex-1">
- <view class="mb8 base-color-6">答题红包金额</view>
- <view>{{item.amount}}元</view>
- </view>
- </view>
- <view class="justify-between mt20">
- <view class="flex-1">
- <view class="base-color-6 mb8 ">答题人数</view>
- <view>{{item.answerCount}}</view>
- </view>
- <view class="flex-1">
- <view class="base-color-6 mb8 ">正确人数</view>
- <view>{{item.answerRightCount}}</view>
- </view>
- <view class="flex-1">
- <view class="base-color-6 mb8 ">正确率</view>
- <view>{{item.answerRightRate.toFixed(2)}}%</view>
- </view>
- </view>
- <view class="centerV mt20">
- <view class="colorf base-bg ptb12 w400 radius80 center ">课程数据</view>
- </view>
- </view>
- <u-loadmore :status="status" />
- <view class="h90 "></view>
- </scroll-view>
- </view>
- <view class="column flex-1 scrolly " v-show="showCont==1"
- style="height: calc(100% - 100rpx);padding-bottom: 100rpx;">
- <u-collapse ref="collapseRef" :border="false" :value="collapseValue" @change="changeCollapse">
- <u-collapse-item name="course">
- <text slot="title" class="bold fs32">课程统计</text>
- <text slot="value" class="base-color fs24">{{collapseValue.includes('course')?'收回':'展开'}}</text>
- <view slot="right-icon">
- <u-icon name="arrow-right" color="#1677ff" size="12"></u-icon>
- </view>
- <view class="justify-around ">
- <view class="base-bg-f radius16 p30 flex-1">
- <view class="mb12 bold">营期</view>
- <view class="base-color">
- <text class="bold fs40">{{courseCount.course}}</text>期
- </view>
- </view>
- <view class="base-bg-f radius16 p20 flex-1 mlr20">
- <view class="mb12 bold">课程数</view>
- <view class="base-color"><text class="bold fs40">{{courseCount.count}}
- </text>课</view>
- </view>
- <view class="base-bg-f radius16 p20 flex-1">
- <view class="mb12 bold">参与会员</view>
- <view class="base-color"><text class="bold fs40">
- {{courseCount.watchCount}}</text>人</view>
- </view>
- </view>
- </u-collapse-item>
- <u-collapse-item name="redenvelope">
- <text slot="title" class="bold fs32">答题统计</text>
- <text slot="value"
- class="base-color fs24">{{collapseValue.includes('redenvelope')?'收回':'展开'}}</text>
- <view slot="right-icon">
- <u-icon name="arrow-right" color="#1677ff" size="12"></u-icon>
- </view>
- <view class="justify-around ">
- <view class="base-bg-f radius16 p30 flex-1">
- <view class="mb12 bold">答题人次</view>
- <view class="base-color"><text class="bold fs40">
- {{answerlist.count}}</text>人</view>
- </view>
- <view class="base-bg-f radius16 p20 flex-1 mlr20">
- <view class="mb12 bold">正确人次</view>
- <view class="base-color"><text class="bold fs40">
- {{answerlist.completeCount}}</text>人</view>
- </view>
- <view class="base-bg-f radius16 p20 flex-1">
- <view class="mb12 bold">正确率</view>
- <view class="base-color"><text class="bold fs40">
- {{answerlist.rate.toFixed(2)}}</text>%</view>
- </view>
- </view>
- </u-collapse-item>
- <u-collapse-item name="live">
- <text slot="title" class="bold fs32">红包统计</text>
- <text slot="value" class="base-color fs24">{{collapseValue.includes('live')?'收回':'展开'}}</text>
- <view slot="right-icon">
- <u-icon name="arrow-right" color="#1677ff" size="12"></u-icon>
- </view>
- <view class="justify-around ">
- <view class="base-bg-f radius16 p30 flex-1">
- <view class="mb12 bold">红包个数</view>
- <view class="base-color"><text class="bold fs40">
- {{redbaglist.count}}</text>个</view>
- </view>
- <view class="base-bg-f radius16 p20 mlr20 justify-start align-center">
- <image src="../../../static/images/redenvelope.png" class="w102 h102"></image>
- <view class="ml20">
- <view class="mb12 bold">答题红包金额</view>
- <view class="base-color">
- <text class="bold fs40">
- {{redbaglist.amount}}
- </text>元
- </view>
- </view>
- </view>
- </view>
- </u-collapse-item>
- </u-collapse>
- <view class="h90 "></view>
- </view>
- <view class="foot-box justify-between bgf p20 align-center">
- <view class="fs28 base-color-6" @click="showmore=!showmore">更多</view>
- <view class="base-color-red base-bg-false plr20 fs28 ptb8 radius40 bold" @click="changevipDetail()">更换会员归属
- </view>
- </view>
- <u-popup :show="showmore" @close="closemore" @open="openmore" style="flex: 0;">
- <view class="column align-center">
- <view class="m20" v-for="(item,index) in morelist" :key="item.value" @click="nameMore(item)">
- {{item.name}}
- </view>
- <u-modal :show="showlist" :title="titlelist" @confirm="confirmchange">
- <view class="slot-content">
- <u-input :placeholder="contpl" v-model="changelist" v-if="selnum==1"></u-input>
- <u-input :placeholder="contpl" v-model="changephone" v-if="selnum==2"></u-input>
- <u-input :placeholder="contpl" v-model="changeremark" v-if="selnum==3"></u-input>
- </view>
- </u-modal>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- import dropdownPanel from "../components/dropdownPanel.vue"
- import {
- getFsCourseList,
- getCourseVdieoList,
- getCompanyUserAndUserCount,
- getRecPacketCount,
- getshopCoursenum,
- getQuesCount,
- getcourseList,
- updategroupinfo,
- getGroupDetail
- } from "@/api/courseManage.js"
- export default {
- components: {
- dropdownPanel
- },
- data() {
- return {
- changeremark: '',
- changephone: '',
- list1: [{
- name: '课程分析'
- }, {
- name: '群管数据'
- }],
- filterData: [{
- name: '训练营-营期',
- value: 0,
- },
- {
- name: '课程',
- value: 1,
- },
- ],
- searchbarNav: 0,
- showCont: 0,
- collapseValue: ['course', 'questions', 'redenvelope', 'live', 'funnel'], //
- showmore: false,
- morelist: [{
- name: '复制ID',
- value: 0,
- text: ''
- },
- {
- name: '改姓名',
- value: 1,
- text: '请输入姓名'
- },
- {
- name: '改手机号码',
- value: 2,
- text: '请输入手机号码'
- },
- {
- name: '改备注',
- value: 3,
- text: '请输入备注'
- }
- ],
- showlist: false,
- titlelist: '',
- contpl: '',
- changelist: '',
- groupid: 0,
- courseid: '',
- courseids: '',
- courseOne: [],
- courseTwo: [],
- triggereds: false,
- statusA: 'loadmore',
- isEnableds: true,
- pageNums: 1,
- pageSizes: 5,
- redprice: '',
- companyUserCount: 0,
- companyUserUserCount: 0,
- redbaglist: [],
- courseCount: [],
- answerlist: [],
- courselist: [],
- triggered: false,
- status: 'loadmore',
- isEnabled: true,
- pageNum: 1,
- pageSize: 3,
- grouplist: [],
- selnum: 0
- }
- },
- onLoad(option) {
- this.groupid = option.id
- },
- mounted() {
- this.user = uni.getStorageSync("companyUserInfo") ? JSON.parse(uni.getStorageSync("companyUserInfo")) : {}
- this.grouplist = uni.getStorageSync("grouplist")
- this.getvipcount()
- this.getredbaglist()
- this.getcout()
- this.getcoursegroup()
- this.getgroupdetail()
- },
- methods: {
- copyId() {
- uni.setClipboardData({
- data: String(this.groupid),
- success: () => {
- uni.showToast({
- title: '用户id复制成功',
- icon: 'none',
- duration: 2000
- });
- },
- })
- },
- copyCourseId(id) {
- uni.setClipboardData({
- data: String(id),
- success: () => {
- uni.showToast({
- title: '课程id复制成功',
- icon: 'none',
- duration: 2000
- });
- },
- })
- },
- getgroupdetail() {
- const param = {
- userId: this.groupid
- }
- getGroupDetail(param).then(res => {
- this.grouplist = res.data
- })
- },
- updatagroup() {
- console.log(Number(this.groupid))
- const param = {
- nickName: this.changelist,
- phonenumber: this.changephone,
- remark: this.changeremark,
- userId: this.groupid
- }
- updategroupinfo(param).then(res => {
- if (res.code == 200) {
- uni.showToast({
- icon: 'none',
- title: "修改成功"
- })
- } else {
- uni.showToast({
- icon: 'none',
- title: res.msg
- })
- }
- })
- },
- pullDownRefresh() {
- // 下拉
- this.triggered = true; //下拉了状态为true
- setTimeout(() => {
- this.triggered = false;
- uni.stopPullDownRefresh()
- this.pageNum = 1;
- this.getcoursegroup('refresh') //触底 不穿执行else
- // 请求接口里面需要判断是不是最后一页 是最后一页 status赋值为‘loadmore’没有更多了
- // 请求接口
- }, 1000)
- },
- reachBottom() {
- // status这个是加载状态
- if (this.status === 'loadmore') {
- this.status = 'loading'
- uni.showNavigationBarLoading()
- setTimeout(() => {
- this.pageNum++
- this.getcoursegroup() //触底 不穿执行else
- uni.hideNavigationBarLoading()
- }, 1000);
- }
- },
- getcoursegroup(type) {
- const param = {
- companyId: this.user.companyId,
- companyUserId: this.groupid,
- courseId: this.courseid,
- videoId: this.courseids,
- endTime: '',
- startTime: '',
- pageNum: this.pageNum,
- pageSize: this.pageSize,
- type: this.user.userType == '00' ? 0 : 1, // 0:经销商/1:群管
- }
- getcourseList(param).then(res => {
- console.log(res)
- if (res.code == 200) {
- // refresh 下拉
- if (type == 'refresh') {
- this.courselist = res.data.list
- } else {
- // 加载更多 当前页和下一页合并
- this.courselist = [...this.courselist, ...res.data.list]
- }
- if (this.pageNum >= res.data.pages) {
- this.status = 'nomore'
- } else {
- this.status = 'loadmore'
- }
- } else {
- uni.showToast({
- icon: 'none',
- title: res.msg
- })
- }
- })
- },
- getcout() {
- const param = {
- companyId: this.user.companyId,
- companyUserId: this.groupid,
- courseId: this.courseid,
- videoId: this.courseids,
- endTime: '',
- startTime: '',
- type: this.user.userType == '00' ? 0 : 1, // 0:经销商/1:群管
- }
- this.getCourselist(param)
- this.getanswer(param)
- },
- getanswer(param) {
- getQuesCount(param).then(res => {
- if (res.code == 200) {
- // console.log(res)
- this.answerlist = res.data
- } else {
- uni.showToast({
- icon: 'none',
- title: res.msg
- })
- }
- })
- },
- getCourselist(param) {
- getshopCoursenum(param).then(res => {
- if (res.code == 200) {
- this.courseCount = res.data
- } else {
- uni.showToast({
- icon: 'none',
- title: res.msg,
- });
- }
- })
- },
- getredbaglist() {
- //红包统计
- const params = {
- companyId: this.user.companyId,
- companyUserId: this.groupid,
- type: this.user.userType == '00' ? 0 : 1, // 0:经销商/1:群管
- courseId: this.courseid,
- videoId: this.courseids,
- endTime: '',
- startTime: '',
- }
- getRecPacketCount(params).then(res => {
- if (res.code == 200) {
- // console.log(res)
- this.redbaglist = res.data
- } else {
- uni.showToast({
- icon: 'none',
- title: res.msg
- })
- }
- })
- },
- getvipcount() {
- //获取会员总数
- const param = {
- companyId: this.user.companyId,
- companyUserId: this.groupid,
- courseId: '',
- endTime: '',
- startTime: '',
- type: this.user.userType == '00' ? 0 : 1, // 0:经销商/1:群管
- }
- getCompanyUserAndUserCount(param).then(res => {
- if (res.code == 200) {
- this.companyUserCount = res.data.companyUserCount || 0
- this.companyUserUserCount = res.data.companyUserUserCount || 0
- } else {
- uni.showToast({
- icon: 'none',
- title: res.msg,
- });
- }
- })
- },
- pullDownRefreshs() {
- // 下拉
- this.triggereds = true; //下拉了状态为true
- setTimeout(() => {
- this.triggereds = false;
- uni.stopPullDownRefresh()
- this.pageNums = 1;
- this.getCourseListsmall('refresh') //触底 不穿执行else
- // 请求接口里面需要判断是不是最后一页 是最后一页 status赋值为‘loadmore’没有更多了
- // 请求接口
- }, 1000)
- },
- reachBottoms() {
- // status这个是加载状态
- if (this.statusA === 'loadmore') {
- this.statusA = 'loading'
- uni.showNavigationBarLoading()
- setTimeout(() => {
- this.pageNums++
- this.getCourseListsmall() //触底 不穿执行else
- uni.hideNavigationBarLoading()
- }, 1000);
- }
- },
- getCourseOne(id) {
- this.courseid = id
- },
- getCourseTwo(id) {
- this.courseids = id
- },
- getCourseList() {
- //获取课程列表
- const param = {
- companyId: this.user.companyId,
- companyUserId: this.user.userId,
- type: this.user.userType == '00' ? 0 : 1, // 0:经销商/1:群管
- }
- getFsCourseList(param).then(res => {
- if (res.code == 200) {
- this.courseOne = res.data
- // console.log(res)
- } else {
- uni.showToast({
- icon: 'none',
- title: res.msg
- })
- }
- })
- },
- getCourseListsmall(type) {
- //获取小节目录
- const param = {
- courseId: this.courseid,
- pageNum: this.pageNums,
- pageSize: this.pageSizes, //
- status: ''
- }
- getCourseVdieoList(param).then(res => {
- if (res.code == 200) {
- // refresh 下拉
- if (type == 'refresh') {
- this.courseTwo = res.data.list
- } else {
- // 加载更多 当前页和下一页合并
- this.courseTwo = [...this.courseTwo, ...res.data.list]
- }
- if (this.pageNums >= res.data.pages) {
- this.statusA = 'nomore'
- } else {
- this.statusA = 'loadmore'
- }
- } else {
- }
- })
- },
- clickTab(e) {
- this.showCont = e.index
- this.$nextTick(() => {
- this.$refs?.collapseRef?.init()
- })
- console.log(e.index)
- },
- onChange(index) {
- this.searchbarNav = index
- if (index == 0) {
- this.getCourseList()
- } else {
- this.getCourseListsmall()
- }
- },
- confirm() {
- this.getcout()
- this.getredbaglist()
- this.courselist = []
- this.getcoursegroup()
- },
- reset() {
- if (this.searchbarNav == 0) {
- this.courseid = ''
- this.getcout()
- this.getredbaglist()
- this.courselist = []
- this.getcoursegroup()
- } else {
- this.courseids = ''
- this.getcout()
- this.getredbaglist()
- this.courselist = []
- this.getcoursegroup()
- }
- },
- changeCollapse(e) {
- this.collapseValue = e.filter(item => item.status == 'open').map(it => it.name)
- console.log(e.filter(item => item.status == 'open').map(it => it.name))
- },
- closemore() {
- this.showmore = false
- },
- openmore() {
- },
- nameMore(item) {
- this.titlelist = item.name
- this.contpl = item.text
- this.selnum = item.value
- if (item.value == 0) {
- } else if (item.value == 1) {
- this.changelist = this.grouplist.nickName
- this.showlist = true
- } else if (item.value == 2) {
- console.log(this.grouplist.phonenumber)
- this.changephone = this.grouplist.phonenumber
- this.showlist = true
- } else {
- this.changeremark = this.grouplist.remark
- this.showlist = true
- }
- },
- confirmchange() {
- this.updatagroup()
- this.showlist = false
- setTimeout(() => {
- this.showmore = false
- this.getgroupdetail()
- }, 200)
- },
- changevipDetail() {
- uni.navigateTo({
- url: '/pages/courseManage/manage/changeVip?id=' + this.groupid
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .header {
- background: linear-gradient(to right, rgba(218, 233, 255, 1), rgba(225, 225, 253, 1));
- }
- .doingimg {
- position: relative;
- }
- .doing {
- border-radius: 12rpx 0 12rpx 0;
- background-color: #3e9f59;
- color: #fff;
- width: fit-content;
- padding: 0 20rpx;
- font-size: 24rpx;
- position: absolute;
- top: 3rpx;
- }
- .box-blue {
- flex-wrap: wrap;
- padding: 20rpx;
- .boxs {
- width: 48%;
- border-radius: 20rpx;
- margin-top: 20rpx;
- padding: 20rpx 0;
- padding-left: 32rpx;
- font-size: 28rpx;
- }
- }
- .foot-box {
- position: fixed;
- bottom: 0;
- width: 100%;
- }
- .actNav {
- color: #1677ff !important;
- background-color: #e7f2fe;
- }
- </style>
|