index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  1. <template>
  2. <view class="container">
  3. <view class="headbox">
  4. <view style="padding: 10px 10px 0 10px;">
  5. <u-subsection class="subsection" :list="list" :current="current" bgColor="#e7f1fe" activeColor="#1677ff" :fontSize="15" :bold="false" @change="sectionChange"></u-subsection>
  6. <view style="margin-top: 10px;">
  7. <u-search placeholder="会员ID、昵称、姓名、手机" v-model="keyword" :showAction="false" height="30px"></u-search>
  8. </view>
  9. <view class="x-bc">
  10. <u-tabs :list="list2" :current='currentType' :lineWidth="40" lineColor="#1677ff" :activeStyle="activeStyle" :inactiveStyle="inactiveStyle" @click="clickTypeTab"></u-tabs>
  11. <view class="participate-order x-f">
  12. <image src="@/static/images/order_icon2.png" mode="aspectFill" v-if="searchTypeIndex == 0 || searchTypeIndex == 2"></image>
  13. <image src="@/static/images/order_icon.png" mode="aspectFill" v-else></image>
  14. <picker @change="bindPickerChange" :value="searchTypeIndex" :range="typeArray">
  15. {{typeoption[searchTypeIndex]}}
  16. </picker>
  17. </view>
  18. </view>
  19. <view class="tagbox x-bc">
  20. <view class="tagbox-left x-f">
  21. <view class="x-f" @click="openPop('search')">{{array[queryParam.typeIndex].name}}<u-icon name="arrow-down-fill" color="#2979ff" size="11" style="margin: 0 3px;"></u-icon></view>
  22. <view class="tagbox-list x-f">
  23. <view class="tagbox-item x-f">未打标签</view>
  24. <view class="tagbox-item x-f">未打标签</view>
  25. </view>
  26. </view>
  27. <view class="tagbox-right x-f" @click="openPop('tag')">筛选<u-icon name="arrow-down" color="#1677ff" size="12"></u-icon></view>
  28. </view>
  29. </view>
  30. <view>
  31. <dropdownPanel :filterData='filterData' @onChange="onChange" @confirm="confirm" @reset="reset">
  32. <view v-if="filterData[searchbarNav].type == 'registerTime'">
  33. <view class="boxnav x-bc">
  34. <view class="boxnav-item" style="width: 25%;" v-for="(item,index) in filterData[searchbarNav].option" :key="index">
  35. <view class="boxnav-item-info one-t" :class="registerTimeIndex == index ? 'boxnav-active':''" @click="handleParamItem('registerTime',index)">{{item.label}}</view>
  36. </view>
  37. <view class="boxnav-item x-ac" style="width: 100%;" v-show="registerTimeIndex == 4">
  38. <view class="calendar-day x-c" @click="showCalendar = true">
  39. <u-icon name="calendar" color="#999" size="20"></u-icon>{{queryParam.startTime || '选择日期'}}</view>
  40. <view class="calendar-day x-c" @click="showCalendar = true">
  41. <u-icon name="calendar" color="#999" size="20"></u-icon>{{queryParam.endTime || '选择日期'}}</view>
  42. </view>
  43. </view>
  44. </view>
  45. <view v-if="filterData[searchbarNav].type == 'watchStatus'">
  46. <view class="boxnav x-bc">
  47. <view class="boxnav-item" v-for="(item,index) in filterData[searchbarNav].option" :key="index">
  48. <view class="boxnav-item-info one-t" :class="registerTimeIndex == index ? 'boxnav-active':''" @click="handleParamItem('registerTime',index)">{{item.label}}</view>
  49. </view>
  50. </view>
  51. </view>
  52. <view v-if="filterData[searchbarNav].type == 'nowatchStatus'">
  53. <view class="boxnav x-bc">
  54. <view class="boxnav-item" v-for="(item,index) in filterData[searchbarNav].option" :key="index">
  55. <view class="boxnav-item-info one-t" :class="registerTimeIndex == index ? 'boxnav-active':''" @click="handleParamItem('registerTime',index)">{{item.label}}</view>
  56. </view>
  57. </view>
  58. </view>
  59. </dropdownPanel>
  60. </view>
  61. </view>
  62. <u-calendar :show="showCalendar" :mode="mode" @confirm="confirmCalendar" @close="closeCalendar"></u-calendar>
  63. <!-- 搜索选择弹窗/标签筛选 -->
  64. <u-popup :show="showPop" :round="12" @close="closePop" class="model" :zIndex="10076">
  65. <view class="popbox">
  66. <view class="popbox-head">
  67. <u-icon class="close-circle" name="close-circle" color="#ccc" size="24" @click="closePop"></u-icon>
  68. {{popTitle}}
  69. </view>
  70. <view class="popbox-body">
  71. <view class="radiobox" v-show="popTitle == '搜索选择'">
  72. <label class="radiobox-item x-bc mbline" v-for="(item, index) in array" :key="item.value" @click="bindTypeChange(index)">
  73. <view>{{item.name}}</view>
  74. <radio :value="item.value" :checked="index === typeIndex" style="transform:scale(0.75)" />
  75. </label>
  76. </view>
  77. <view class="tagbox-list x-f">
  78. <view class="tagbox-item x-f" @click="chooseTag">未打标签</view>
  79. <view class="tagbox-item x-f tag-active">未打标签</view>
  80. </view>
  81. </view>
  82. <view class="popbox-footer x-bc">
  83. <button class="popbox-footer-btn" @click="resetPop" v-show="popTitle == '标签筛选'">重置</button>
  84. <button class="popbox-footer-btn" @click="closePop" v-show="popTitle == '搜索选择'">取消</button>
  85. <button class="popbox-footer-btn con-btn" @click="confirmPop">确定</button>
  86. </view>
  87. </view>
  88. </u-popup>
  89. <view class="userbox">
  90. <!-- <mescroll-body bottom="0" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback" @up="upCallback"> -->
  91. <view class="userlist">
  92. <vipUserItem></vipUserItem>
  93. </view>
  94. <!-- </mescroll-body> -->
  95. </view>
  96. <image class="invite-member" src="@/static/images/invite-member-icon.png" mode="aspectFill" @click="vipInvite"></image>
  97. <!-- 邀请弹窗 -->
  98. <u-popup :show="invitePop" :round="12" @close="invitePop = false" :zIndex="10074">
  99. <view class="popbox">
  100. <view class="popbox-head">
  101. <u-icon class="close-circle" name="close-circle" color="#ccc" size="24" @click="invitePop = false"></u-icon>
  102. 分享方式
  103. </view>
  104. <view class="popbox-body">
  105. <view class="choosetitle x-bc">
  106. <view>选择标签</view>
  107. <view class="x-f" style="color:#1677ff;" @click="openPop('tag')">
  108. <u-icon name="plus" color="#1677ff" size="14" style="margin-right: 5px;"></u-icon>添加标签</view>
  109. </view>
  110. <view class="invitetip">选择标签,当会员注册成功后,即可自动打标签</view>
  111. <!-- <view class="tagbox-list x-f" style="margin-top: 10px;margin-left: 0px;">
  112. <view class="tagbox-item x-f" @click="chooseTag">未打标签</view>
  113. <view class="tagbox-item x-f tag-active">未打标签</view>
  114. </view> -->
  115. <view class="x-bc" style="margin-top: 30px;">
  116. <view class="sharePop-item y-f">
  117. <image src="@/static/images/poster_icon.png" mode="aspectFill"></image>
  118. <view style="font-weight: bold;margin-bottom: 4px;">生成海报</view>
  119. <view style="font-size: 12px;color: #888;">保存海报美观宣传</view>
  120. </view>
  121. <view class="sharePop-item y-f" @click="copyLink">
  122. <image src="@/static/images/link_icon.png" mode="aspectFill"></image>
  123. <view style="font-weight: bold;margin-bottom: 4px;">复制链接</view>
  124. <view style="font-size: 12px;color: #888;">生成链接一键复制</view>
  125. </view>
  126. </view>
  127. </view>
  128. </view>
  129. </u-popup>
  130. <!-- 设置链接有效时长弹窗 -->
  131. <u-modal :show="setTimeShow"content='content' class="model" @confirm="confirmTime">
  132. <view class="setTimebox">
  133. <view class="timetip">不传默认以系统参数为准</view>
  134. <view class="x-f">
  135. <text style="margin-right: 20px;">链接有效时长(分钟)</text>
  136. <u-input
  137. fontSize="14px"
  138. placeholder="链接有效时长"
  139. border="none"
  140. v-model="time"
  141. maxlength="5"
  142. ></u-input>
  143. </view>
  144. </view>
  145. </u-modal>
  146. </view>
  147. </template>
  148. <script>
  149. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  150. import vipUserItem from "../components/vipUserItem.vue"
  151. import dropdownPanel from "../components/dropdownPanel.vue"
  152. export default {
  153. mixins: [MescrollMixin],
  154. components: {
  155. vipUserItem,
  156. dropdownPanel
  157. },
  158. data() {
  159. return {
  160. list: [{name: '会员(0)'}, {name: '小黑屋(0)'}],
  161. current: 0,
  162. keyword: "",
  163. list2: [{
  164. name: '全部',
  165. }, {
  166. name: '今日新增',
  167. }, {
  168. name: '今日完播'
  169. }, {
  170. name: '未看过课'
  171. }],
  172. currentType: 0,
  173. activeStyle:{
  174. color: '#1677ff',
  175. fontSize: '14px',
  176. fontWeight: 'bold'
  177. },
  178. inactiveStyle:{
  179. fontSize: '14px'
  180. },
  181. searchTypeIndex: 0,
  182. typeArray: ['连续缺课天数多到少', '连续缺课天数少到多', '按注册时间晚到早','会员姓名0-9-A-Z'],
  183. typeoption: ['连续缺课', '连续缺课', '注册时间','会员姓名'],
  184. array: [{
  185. value: '0',
  186. name: '关联搜索',
  187. },{
  188. value: '1',
  189. name: '精准搜索'
  190. }],
  191. typeIndex: 0,
  192. popTitle: '搜索选择',
  193. showPop: false,
  194. filterData:[{
  195. name: '注册时间',
  196. value: 0,
  197. type: 'registerTime',
  198. option: [{
  199. label: '全部',
  200. },{
  201. label: '今天',
  202. },{
  203. label: '昨天',
  204. },{
  205. label: '近7天',
  206. },{
  207. label: '自定义',
  208. }]
  209. },{
  210. name: '看课状态',
  211. value: 1,
  212. type: 'watchStatus',
  213. option: [{
  214. label: '全部',
  215. },{
  216. label: '未看过课',
  217. },{
  218. label: '正常看课',
  219. },{
  220. label: '停止看课',
  221. }]
  222. },
  223. // {
  224. // name: '缺课状态',
  225. // value: 2,
  226. // type: 'nowatchStatus',
  227. // option: [{
  228. // label: '全部',
  229. // },{
  230. // label: '已缺课',
  231. // },{
  232. // label: '未缺课',
  233. // }]
  234. // },
  235. {
  236. name: '批量',
  237. value: 3,
  238. type: '',
  239. special: true
  240. }],
  241. searchbarNav: 0,
  242. registerTimeIndex: 0,
  243. showCalendar: false,
  244. mode: 'range',
  245. queryParam: {
  246. typeIndex: 0,
  247. startTime: '',
  248. endTime: ''
  249. },
  250. mescroll:null,
  251. downOption: {
  252. use:true,
  253. auto: false
  254. },
  255. upOption: {
  256. onScroll:false,
  257. use: true, // 是否启用上拉加载; 默认true
  258. auto: true,
  259. page: {
  260. pae: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  261. size: 10 // 每页数据的数量,默认10
  262. },
  263. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  264. textNoMore:"已经到底了",
  265. empty: {
  266. icon:'https://cos.his.cdwjyyh.com/fs/20240423/cf4a86b913a04341bb44e34bb4d37aa2.png',
  267. tip: '暂无数据'
  268. }
  269. },
  270. dataList: [],
  271. invitePop: false,
  272. setTimeShow: false,
  273. time: "",
  274. }
  275. },
  276. onLoad() {
  277. uni.setNavigationBarTitle({
  278. title: '数据统计'
  279. });
  280. },
  281. methods: {
  282. onChange(index) {
  283. this.searchbarNav = index
  284. },
  285. confirm() {
  286. const type = this.filterData[this.searchbarNav].type
  287. if(type=='registerTime') {
  288. }
  289. // this.mescroll.resetUpScroll()
  290. },
  291. reset() {
  292. const type = this.filterData[this.searchbarNav].type
  293. if(type=='registerTime') {
  294. this.registerTimeIndex = ''
  295. this.queryParam.endTime = ''
  296. this.queryParam.startTime = ''
  297. }
  298. },
  299. handleParamItem(type,index) {
  300. if(type=='registerTime') {
  301. this.registerTimeIndex = index
  302. }
  303. },
  304. sectionChange(index) {
  305. this.current = index;
  306. },
  307. clickTypeTab(e) {
  308. this.currentType = e.index
  309. },
  310. bindPickerChange(e) {
  311. console.log('picker发送选择改变,携带值为', e.detail.value)
  312. this.searchTypeIndex = e.detail.value
  313. },
  314. openPop(type) {
  315. this.popTitle = type == 'search' ? '搜索选择' : type == 'tag' ?'标签筛选' : ''
  316. this.typeIndex = this.queryParam.typeIndex
  317. this.showPop = true
  318. },
  319. closePop() {
  320. this.showPop = false
  321. },
  322. resetPop() {
  323. },
  324. closeCalendar() {
  325. this.showCalendar = false
  326. },
  327. confirmCalendar(e) {
  328. // this.startTime = e[0]
  329. // this.endTime = e[e.length-1]
  330. this.showCalendar = false
  331. // this.getCount()
  332. },
  333. bindTypeChange(i) {
  334. this.typeIndex = i
  335. },
  336. confirmPop() {
  337. this.queryParam.typeIndex = this.typeIndex
  338. this.showPop = false
  339. },
  340. chooseTag() {
  341. },
  342. vipInvite() {
  343. this.invitePop = true
  344. },
  345. copyLink(){
  346. this.setTimeShow = true
  347. },
  348. confirmTime() {
  349. this.setTimeShow = false
  350. this.showShare = false
  351. },
  352. mescrollInit(mescroll) {
  353. this.mescroll = mescroll;
  354. },
  355. /*下拉刷新的回调 */
  356. downCallback(mescroll) {
  357. mescroll.resetUpScroll()
  358. },
  359. upCallback(page) {
  360. //联网加载数据
  361. var that = this;
  362. var data={
  363. courseId:this.courseId,
  364. status: '',
  365. pageNum: page.num,
  366. pageSize: page.size
  367. };
  368. uni.showLoading({
  369. title:"加载中..."
  370. })
  371. // getCourseVdieoList(data).then(res => {
  372. // uni.hideLoading()
  373. // if(res.code==200){
  374. // //设置列表数据
  375. // if (page.num == 1) {
  376. // that.dataList = res.data.list;
  377. // } else {
  378. // that.dataList = that.dataList.concat(res.data.list);
  379. // }
  380. // that.mescroll.endBySize(res.data.list.length, res.data.total);
  381. // }else{
  382. // uni.showToast({
  383. // icon:'none',
  384. // title: "请求失败",
  385. // });
  386. // that.dataList = null;
  387. // that.mescroll.endErr();
  388. // }
  389. // });
  390. },
  391. }
  392. }
  393. </script>
  394. <style lang="scss" scoped>
  395. ::v-deep {
  396. .model .u-fade-enter-active {
  397. z-index: 10075 !important;
  398. }
  399. }
  400. .container {
  401. font-family: PingFang SC, PingFang SC;
  402. font-weight: 400;
  403. font-size: 14px;
  404. color: #222222;
  405. }
  406. .boxnav {
  407. flex-wrap: wrap;
  408. padding: 0 0 0 10px;
  409. &-item {
  410. width: 50%;
  411. overflow: hidden;
  412. }
  413. &-item-info {
  414. border: 1px solid #f5f5f5;
  415. text-align: center;
  416. color: #222;
  417. background-color: #f5f5f5;
  418. border-radius: 3px;
  419. padding: 5px;
  420. margin: 0 10px 10px 0;
  421. }
  422. &-active {
  423. border: 1px solid #1677ff !important;
  424. color: #1677ff !important;
  425. background-color: #e7f1fe !important;
  426. }
  427. }
  428. .calendar-day {
  429. font-family: PingFang SC, PingFang SC;
  430. font-weight: 400;
  431. font-size: 12px;
  432. color: #999;
  433. flex: 1;
  434. min-height: 30px;
  435. background-color: #f5f5f5;
  436. border-radius: 4px;
  437. margin: 0 10px 10px 0;
  438. }
  439. .setTimebox {
  440. font-family: PingFang SC, PingFang SC;
  441. font-weight: 400;
  442. font-size: 14px;
  443. }
  444. .timetip {
  445. font-family: PingFang SC, PingFang SC;
  446. font-weight: 400;
  447. font-size: 14px;
  448. color: #2979ff;
  449. text-align: center;
  450. margin-bottom: 5px;
  451. }
  452. .popbox{
  453. background-color: #fff;
  454. border-radius: 12px;
  455. font-family: PingFang SC, PingFang SC;
  456. font-weight: 400;
  457. font-size: 14px;
  458. color: #333;
  459. &-head {
  460. padding: 15px;
  461. font-weight: bold;
  462. font-size: 15px;
  463. text-align: center;
  464. position: relative;
  465. }
  466. .close-circle {
  467. position: absolute;
  468. right: 10px;
  469. top: 50%;
  470. transform: translateY(-50%);
  471. }
  472. &-body {
  473. padding: 10px 15px;
  474. }
  475. .radiobox {
  476. &-item{
  477. padding: 10px 0;
  478. border-bottom: 1px solid #f5f5f5;
  479. &:last-child {
  480. border-bottom: none;
  481. }
  482. }
  483. }
  484. &-footer {
  485. padding: 15px 0;
  486. }
  487. &-footer-btn {
  488. flex: 1;
  489. height: 44px;
  490. line-height: 44px;
  491. margin: 0 10px;
  492. border-radius: 50px;
  493. border: none;
  494. font-family: PingFang SC, PingFang SC;
  495. font-weight: 400;
  496. font-size: 14px;
  497. color: #333;
  498. &::after {
  499. border: none;
  500. }
  501. }
  502. .con-btn {
  503. background-color: #1677ff;
  504. color: #fff;
  505. }
  506. .choosetitle {
  507. font-family: PingFang SC, PingFang SC;
  508. font-weight: 400;
  509. font-size: 15px;
  510. color: #333;
  511. }
  512. .invitetip {
  513. margin-top: 10px;
  514. background-color: #ebf5fb;
  515. color: #1677ff;
  516. padding: 5px 10px;
  517. border-radius: 5px;
  518. }
  519. .sharePop-item {
  520. padding: 0 10px;
  521. box-sizing: border-box;
  522. font-family: PingFang SC, PingFang SC;
  523. font-weight: 400;
  524. font-size: 14px;
  525. display: inline-flex !important;
  526. image {
  527. height: 48px;
  528. width: 48px;
  529. margin-bottom: 10px;
  530. }
  531. }
  532. }
  533. .headbox {
  534. background-color: #fff;
  535. .subsection {
  536. height: 45px;
  537. padding: 4px;
  538. }
  539. .participate-order {
  540. font-size: 12px;
  541. image {
  542. width: 15px;
  543. height: 15px;
  544. }
  545. }
  546. }
  547. .tag-active {
  548. background-color: #ffeceb !important;
  549. color: #f93e3e !important;
  550. border: 1px solid #f93e3e !important;
  551. }
  552. .tagbox {
  553. padding: 10px 0;
  554. font-size: 12px;
  555. color: #1677ff;
  556. &-list {
  557. margin: 0 0 -6px 6px;
  558. flex-wrap: wrap;
  559. }
  560. &-item {
  561. height: 26px;
  562. padding: 0 8px;
  563. margin: 0 6px 6px 0;
  564. border-radius: 4px;
  565. background-color: #f5f5f5;
  566. color: #999;
  567. border: 1px solid #f5f5f5;
  568. box-sizing: border-box;
  569. font-size: 12px;
  570. }
  571. }
  572. .invite-member {
  573. height: 55px;
  574. width: 50px;
  575. position: fixed;
  576. bottom: 80px;
  577. right: 10px;
  578. cursor: pointer;
  579. }
  580. .userlist {
  581. padding: 24rpx;
  582. }
  583. </style>