couponList.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. <template>
  2. <view class="content">
  3. <u-tabs-swiper ref="uTabs" :active-color="mainColor" :list="tabList" :current="current" @change="tabsChange"
  4. :is-scroll="false"></u-tabs-swiper>
  5. <swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" class="swiper-box">
  6. <swiper-item class="swiper-item" v-for="(item, index1) in tabList" :key="index1">
  7. <scroll-view scroll-y class="scroll-box" @scrolltolower="handleLoadMore" :refresher-enabled="true"
  8. :refresher-triggered="triggered" :refresher-threshold="100" refresher-background="white" @refresherrefresh="onRefresh"
  9. @refresherrestore="onRestore">
  10. <template v-if="current != 3">
  11. <u-card :show-head="false" :show-foot="false" padding="0px" margin="10px" borderRadius="40" v-for="(site, index2) in item.tableList"
  12. :key="index2" class="class-card">
  13. <view class="class-content" slot="body">
  14. <view class="class-info-img">
  15. <u-image width="60px" height="60px" :src="site.url" shape="circle"></u-image>
  16. </view>
  17. <view class="class-info-content">
  18. <view class="class-info-label" v-if="site.discountType==3">{{site.name}}&nbsp;&nbsp;课时{{site.discountNum}}</view>
  19. <view class="class-info-label" v-else>{{site.name}}¥{{site.money}}</view>
  20. <view class="class-info-text">{{site.content}}</view>
  21. <view class="class-info-text">{{site.endDate}}&nbsp;&nbsp;到期</view>
  22. </view>
  23. <view style="width:40px;">
  24. <view class="card-mask" v-if="index1 == 1"></view>
  25. <template v-if="index1 == 0">
  26. <u-button v-if="site.commonFlag == 2" type="warning" :custom-style="{background: mainColor}" size="mini" shape="circle" :ripple="true" @click="handleShowClick(site)">查看</u-button>
  27. <view class="out-date">{{ site.commonFlag == 1 ? '通用券' : '专用券' }}</view>
  28. </template>
  29. <view class="out-date" v-if="index1 == 2">已用</view>
  30. </view>
  31. </view>
  32. </u-card>
  33. <u-divider v-if="item.isOver" bg-color="transparent">没有更多了</u-divider>
  34. </template>
  35. <template v-else>
  36. <view class="content-info">
  37. <view style="background: #fff;">
  38. <u-form ref="form" label-width="80">
  39. <u-form-item label="学员:" right-icon="arrow-right" required @click.native="studentShow = true">
  40. <u-input v-model="studentName" placeholder="请选择学员" disabled @click="studentShow = true" />
  41. </u-form-item>
  42. </u-form>
  43. </view>
  44. <view class="share-img">
  45. <u-image width="60vw" height="60vw" :src="qrcodeUrl" ></u-image>
  46. <view class="qr-box">
  47. <canvas canvas-id="qrcode" style="width: 60vw;height:60vw;margin: 0 auto;"/>
  48. </view>
  49. <view class="share-class">共{{ classes }}节课</view>
  50. </view>
  51. </view>
  52. </template>
  53. </scroll-view>
  54. </swiper-item>
  55. </swiper>
  56. <!-- 可用场馆 -->
  57. <u-popup v-model="couponShow" mode="center" border-radius="30" width="600rpx">
  58. <view class="common-title">可用场馆</view>
  59. <view class="menber-box" style="overflow-y: auto;min-height: 200px;">
  60. <template v-if="Object.keys(venueInfo).length">
  61. <view style="font-size: 16px;font-weight: bold;margin-bottom: 5px;">卡种</view>
  62. <view style="margin-bottom: 8px;">{{ venueInfo.cardType }}</view>
  63. <view style="font-size: 16px;font-weight: bold;margin-bottom: 5px;">场馆</view>
  64. <view style="margin-bottom: 8px;">{{ venueInfo.venue }}</view>
  65. </template>
  66. <template v-else>
  67. <u-empty mode="data"></u-empty>
  68. </template>
  69. </view>
  70. <view class="button-box">
  71. <u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="couponShow = false">确定</u-button>
  72. </view>
  73. </u-popup>
  74. <u-picker mode="selector" v-model="studentShow" :range="studentList" range-key="childName" @confirm="handleStudentClick"></u-picker>
  75. <u-top-tips ref="uTips"></u-top-tips>
  76. </view>
  77. </template>
  78. <script>
  79. import {
  80. mapGetters
  81. } from 'vuex'
  82. const NET = require('@/utils/request')
  83. const API = require('@/config/api')
  84. import uQRCode from '@/common/uqrcode.js'
  85. export default {
  86. computed: {
  87. ...mapGetters([
  88. 'mainColor',
  89. 'handleCustomStyle',
  90. 'handleDefaultCustomStyle',
  91. ])
  92. },
  93. data() {
  94. return {
  95. triggered: false,
  96. tabList: [{
  97. name: '可用',
  98. isOver: false,
  99. pageIndex: 1,
  100. tableList: [],
  101. }, {
  102. name: '过期',
  103. isOver: false,
  104. pageIndex: 1,
  105. tableList: [],
  106. }, {
  107. name: '使用记录',
  108. isOver: false,
  109. pageIndex: 1,
  110. tableList: [],
  111. },{
  112. name: '赠送课时券',
  113. isOver: false,
  114. pageIndex: 1,
  115. tableList: [],
  116. }],
  117. current: 0,
  118. swiperCurrent: 0,
  119. // 学生id
  120. studentId: '',
  121. // 学生姓名
  122. studentName: '',
  123. studentShow: '',
  124. studentList: [],
  125. // 二维码
  126. qrcodeUrl: '',
  127. // 课时
  128. classes: 0,
  129. couponShow: false,
  130. venueInfo: {}
  131. }
  132. },
  133. onLoad() {0
  134. this.getTableList(0)
  135. this.getTableList(1)
  136. this.getTableList(2)
  137. this.getCouponList()
  138. },
  139. onReady() {},
  140. methods: {
  141. // 获取可用优惠券列表
  142. getCouponList() {
  143. NET.request(API.getUserStudent, {
  144. userId: uni.getStorageSync('userData').userId }, 'POST').then( res => {
  145. if(res.status == 10000) {
  146. this.studentList = res.data
  147. if(this.studentList.length) {
  148. this.handleStudentClick(0)
  149. }
  150. }
  151. })
  152. },
  153. // 优惠券可用场馆
  154. handleShowClick(site) {
  155. NET.request(API.getCouponExInfo,
  156. {id: site.discountCouponId}, 'POST').then( res => {
  157. this.venueInfo = res.data
  158. this.couponShow = true
  159. })
  160. },
  161. // 选择学生
  162. handleStudentClick(args) {
  163. this.studentId = this.studentList[args].studentId
  164. this.studentName = this.studentList[args].childName
  165. this.getInfo()
  166. },
  167. // 根据学员获取二维码和剩余课时
  168. getInfo() {
  169. this.qrFun(this.studentId)
  170. /*NET.request(API.studentQRcode, { studentId: this.studentId },'POST').then(res => {
  171. if(res.status == 10000) {
  172. this.qrcodeUrl = 'data:image/png;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/2wBDAQMDAwQDBAgEBAgQCwkLEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBD/wAARCACWAJYDASIAAhEBAxEB/8QAHgAAAgMBAQEBAQEAAAAAAAAACAkABwoGBQMEAgH/xABFEAAABAQDAwUNBwMFAQEBAAABAgMEAAUGBwgREgkTIRQVGTE4FhgiQVh1dpams7TT1DdWV2iVw+QXNlEjMjNhdJFxgf/EABQBAQAAAAAAAAAAAAAAAAAAAAD/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVUWklhUxQuEiLoYbrpKJqFA5Dko6YiUxRDMBAQR4gIRVsak6T/taTeb2/uywGcHvTsU/k03V9TZj8mJ3p2Kfyabq+psx+TDspntNsEEnmTuUzG9u5dsl1Gy6fc3NzaFCGEpi5g1EByEBDMBEI/N0o+BP8c/ZmcfSQCVu9OxT+TTdX1NmPyYnenYp/Jpur6mzH5MOp6UfAn+OfszOPpIvq0927e3wohnca11Qc9U7MFFkm7zki7bWZJQU1A3a5CKBkYpg4lDPLhmEBmgq6iqyt/OlKbrykp1Tc3SIRRRhN2CrNyQhgzKYUlSlMACHEBy4w7P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Q5E9ZyF1mAC6jFDPMQhaPenYp/Jpur6mzH5MB4NZ30vbcaUFp+4V4q4qiVlWK5KynNQu3rcFSgIFUBNVQxdQAYwAOWYZj/AJjiItXvTsU/k03V9TZj8mPDrCxF8beScair+zVc0zKgVKgL6cU68ZNwUNnpJvFUyl1DkOQZ5jkMASmyO7Z8k8yTX3EM02mlZVfQWECqqmoaqpxTs4bvpWRGYSl8qzcplO8SKYCqpGKYAEoiA5DxARCFl7I7tnyTzJNfcQxzawdiSr/OEo+ORgE199jin8pa6vrlMfnRIqqJASJEiQEiRIkBIkSJASHmbH7sdt/SWZ/txIkAbkSJEgJC29t19kNufSRx8KaJEgKQ2Jf2+V36ID8a3hycSJASAi2wfY8W9JpZ+7EiQAA7I7tnyTzJNfcQxzawdiSr/OEo+ORiRIBC0SJEgP/Z'
  173. }
  174. })*/
  175. NET.request(API.getGiveLessons, { studentId: this.studentId },'POST').then(res => {
  176. console.log(res);
  177. if(res.status == 10000) {
  178. console.log(res.data);
  179. this.classes = res.data.length
  180. }
  181. })
  182. },
  183. qrFun: function(text) {
  184. let that=this
  185. uQRCode.make({
  186. canvasId: 'qrcode',
  187. componentInstance: this,
  188. text: "xinghuoclass66889955224477"+text,
  189. size: 150,
  190. margin: 0,
  191. backgroundColor: '#ffffff',
  192. foregroundColor: '#000000',
  193. fileType: 'jpg',
  194. errorCorrectLevel: uQRCode.errorCorrectLevel.H,
  195. success: res => {
  196. that.qrcodeUrl=res
  197. //console.log(res)
  198. }
  199. })
  200. },
  201. // tab页面切换
  202. tabsChange(index) {
  203. this.swiperCurrent = index;
  204. let that=this
  205. console.log(index)
  206. if(index==3){
  207. setTimeout(function(){
  208. that.qrFun(that.studentId)
  209. },1000)
  210. }
  211. },
  212. // swiper-item左右移动,通知tabs的滑块跟随移动
  213. transition(e) {
  214. let dx = e.detail.dx;
  215. this.$refs.uTabs.setDx(dx);
  216. },
  217. // swiper滑动结束,分别设置tabs和swiper的状态
  218. animationfinish(e) {
  219. let current = e.detail.current;
  220. this.$refs.uTabs.setFinishCurrent(current);
  221. this.swiperCurrent = current;
  222. this.current = current;
  223. this.qrFun(this.studentId)
  224. },
  225. // 下拉刷新
  226. onRefresh() {
  227. if (!this.triggered) {
  228. this.triggered = true
  229. this.tabList[this.current].isOver = false
  230. this.tabList[this.current].pageIndex = 1
  231. this.tabList[this.current].tableList = []
  232. this.getTableList(this.current, 'refresh')
  233. }
  234. },
  235. // 重置下拉刷新状态
  236. onRestore() {
  237. this.triggered = 'restore'
  238. this.triggered = false
  239. },
  240. // 懒加载
  241. handleLoadMore() {
  242. if (!this.tabList[this.current].isOver) {
  243. this.tabList[this.current].pageIndex++
  244. this.getTableList(this.current)
  245. }
  246. },
  247. // 获取列表数据
  248. getTableList(index, refresh) {
  249. NET.request(API.getCouponList, {
  250. status: index,
  251. page: this.tabList[index].pageIndex,
  252. size: 10,
  253. }, 'POST').then(res => {
  254. this.triggered = false
  255. this.tabList[index].tableList = this.tabList[index].tableList.concat(res.data.row)
  256. this.tabList[index].isOver = res.data.row.length != 10
  257. }).catch(error => {
  258. this.triggered = false
  259. this.$refs.uTips.show({
  260. title: error.message,
  261. type: 'warning',
  262. })
  263. })
  264. }
  265. },
  266. }
  267. </script>
  268. <style>
  269. page {
  270. width: 100%;
  271. height: 100%;
  272. background-color: #f7f7f7;
  273. }
  274. </style>
  275. <style lang="scss" scoped>
  276. @import "@/static/css/themes.scss";
  277. .content {
  278. width: 100%;
  279. float: left;
  280. .swiper-box {
  281. height: calc(100vh - 34px);
  282. .swiper-item {
  283. height: calc(100vh - 34px);
  284. .scroll-box {
  285. width: 100%;
  286. height: calc(100vh - 34px);
  287. padding-bottom: 10px;
  288. box-sizing: border-box;
  289. .class-card {
  290. .class-content {
  291. padding: 10px 15px;
  292. display: flex;
  293. align-items: center;
  294. position: relative;
  295. }
  296. .class-info-img {
  297. width: 60px;
  298. height: 60px;
  299. margin-right: 10px;
  300. }
  301. .class-info-content {
  302. flex: 1;
  303. }
  304. .class-info-label {
  305. font-size: 16px;
  306. color: #000000;
  307. word-break: break-all;
  308. margin-bottom: 5px;
  309. }
  310. .class-info-text {
  311. color: #999999;
  312. margin-bottom: 5px;
  313. }
  314. .card-mask {
  315. width: 100%;
  316. height: 100%;
  317. position: absolute;
  318. left: 0;
  319. top: 0;
  320. background-color: rgba(0, 0, 0, 0.3);
  321. }
  322. .out-date {
  323. font-size: 14px;
  324. color: #ff9900;
  325. margin-bottom: 5px;
  326. position: absolute;
  327. right: 8px;
  328. bottom: 3px;
  329. }
  330. }
  331. }
  332. }
  333. }
  334. }
  335. .content-info {
  336. width: 100%;
  337. height: 100%;
  338. float: left;
  339. position: relative;
  340. border-top: 1px solid #eee;
  341. .share-img {
  342. top: 40%;
  343. left: 50%;
  344. transform: translate(-50%, -50%);
  345. position: absolute;
  346. .share-class {
  347. margin-top: 20rpx;
  348. text-align: center;
  349. }
  350. }
  351. }
  352. .qr-box {
  353. position: absolute;
  354. margin: 0 auto;
  355. }
  356. .menber-box {
  357. width: 100%;
  358. // float: left;
  359. padding: 10px 15px;
  360. // margin-bottom: 10px;
  361. .menber-col {
  362. width: 100%;
  363. padding: 15px;
  364. margin-bottom: 10px;
  365. display: inline-block;
  366. background-color: #FFFFFF;
  367. border-radius: 15px;
  368. box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
  369. position: relative;
  370. overflow: hidden;
  371. box-sizing: border-box;
  372. .menber-label {
  373. width: 100%;
  374. margin-bottom: 5px;
  375. float: left;
  376. font-size: 14px;
  377. // line-height: 20px;
  378. }
  379. .menber-num {
  380. width: 100%;
  381. float: left;
  382. font-size: 26px;
  383. line-height: 28px;
  384. color: $mainColor;
  385. }
  386. .menber-icon {
  387. font-size: 100px;
  388. color: $mainColor;
  389. position: absolute;
  390. right: -5px;
  391. bottom: -30px;
  392. opacity: 0.5;
  393. }
  394. }
  395. }
  396. .common-title {
  397. width:100%;
  398. text-align: center;
  399. font-size: 20px;
  400. margin: 10px 0;
  401. }
  402. .fix-add-icon {
  403. position: fixed;
  404. bottom: 15px;
  405. right: 15px;
  406. }
  407. .button-box {
  408. // width: 100%;
  409. padding: 10px 15px;
  410. box-sizing: border-box;
  411. }
  412. </style>