studyCenter.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  1. <template>
  2. <view class="content">
  3. <!-- <view class="navbox" id="guide4">
  4. <view class="navbox-item">
  5. <view class="navbox-iteminfo" @click="loginNavTo('./learning')">
  6. <image src="@/static/image/hall/course_icon.png" mode="aspectFill"></image>
  7. <text>在学课程</text>
  8. </view>
  9. </view>
  10. <view class="navbox-item" @click="loginNavTo('./noteList')">
  11. <view class="navbox-iteminfo">
  12. <image src="@/static/image/hall/note_icon.png" mode="aspectFill"></image>
  13. <text>学习笔记</text>
  14. </view>
  15. </view>
  16. <view class="navbox-item">
  17. <view class="navbox-iteminfo" @click="handleCollect()">
  18. <image src="@/static/image/hall/collect_icon.png" mode="aspectFill"></image>
  19. <text>我的收藏</text>
  20. </view>
  21. </view>
  22. <view class="navbox-item" >
  23. <view class="navbox-iteminfo">
  24. <image src="@/static/image/hall/evaluate_icon.png" mode="aspectFill"></image>
  25. <text>我的评价</text>
  26. </view>
  27. </view>
  28. </view> -->
  29. <!-- <view class="navbox navbox-other">
  30. <view class="navbox-item" @click="handleOrder(0)">
  31. <image src="@/static/image/hall/order_icon.png" mode="aspectFill"></image>
  32. <text>全部订单</text>
  33. </view>
  34. <view class="navbox-item" @click="handleOrder(1)">
  35. <image src="@/static/image/hall/obligation_icon.png" mode="aspectFill"></image>
  36. <text>待付款</text>
  37. </view>
  38. <view class="navbox-item" @click="handleOrder(2)">
  39. <image src="@/static/image/hall/paid_icon.png" mode="aspectFill"></image>
  40. <text>已支付</text>
  41. </view>
  42. <view class="navbox-item" @click="handleOrder(4)">
  43. <image src="@/static/image/hall/evaluate_icon24.png" mode="aspectFill"></image>
  44. <text>已退款</text>
  45. </view>
  46. </view> -->
  47. <!-- 开通会员入口 -->
  48. <view class="vipbox" v-if="!user.isVip" @tap="loginNavTo('/pages/course/vipBuy')">
  49. <view class="vipbox-l">
  50. <image class="vip-icon" src="@/static/image/hall/v_icon.png" mode="aspectFill"></image>
  51. <text>新用户开通会员,仅需9.9/月看全场</text>
  52. </view>
  53. <image class="vip-arrow" src="@/static/image/hall/vip_arrow_right_icon.png" mode="aspectFill"></image>
  54. </view>
  55. <!-- 签到 -->
  56. <!-- <view class="sign">
  57. <view class="sign-info">
  58. <view class="sign-day">已连续签到<text>{{signNum}}</text>天</view>
  59. <view class="sign-num">我的芳华币:{{integral}}</view>
  60. </view>
  61. <view class="sign-box">
  62. <view class="sign-boxbar">
  63. <view class="sign-line">
  64. <view class="sign-line-item" v-for="i in 6" :key="i"></view>
  65. </view>
  66. <view class="sign-item" v-for="(item,index) in sign" :key="index">
  67. <image src="@/static/image/hall/sign_in_on_icon.png" v-if="index + 1 <= signNum"></image>
  68. <view class="sign-item-circle" v-else></view>
  69. <view :class="index + 1 <= signNum ? 'active-text sign-item-txt':'sign-item-txt'">第{{index + 1}}天</view>
  70. </view>
  71. </view>
  72. <button class="sign-btn" @click="loginNavTo('/pages/user/integral/points')">立即签到</button>
  73. </view>
  74. </view> -->
  75. <!-- 讲堂 -->
  76. <!-- <view class="hallbox">
  77. <hallItem class="gapitem" v-for="(item, index) in recommendList " :key="index" :item="item" @click="navTo('/pages/course/info?courseId='+item.courseId)" />
  78. </view> -->
  79. <view >
  80. <view style="font-weight: bold;margin-bottom: 20rpx;">训练营</view>
  81. <view class="training-camp ">
  82. <view class="training-top">
  83. <view class="training-tit">
  84. <view class="tit-box">
  85. <view class="look-box">未看</view>
  86. <view>明医有话说2.0</view>
  87. </view>
  88. <view class="srcp">1.14-辩证精准,选药高效!</view>
  89. </view>
  90. <image src="/static/bxzs.jpg" mode="aspectFill"></image>
  91. </view>
  92. <view class="training-bot">
  93. <view class="doc-box">
  94. <image src="/static/logo.png" ></image>
  95. <view>张健林</view>
  96. </view>
  97. <view>过期时间:2025-14-24 23:59:59</view>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. </template>
  103. <script>
  104. import hallItem from "./hallItem.vue";
  105. import { getCourseList } from '@/api/course'
  106. import {getUserInfo} from '@/api/user'
  107. import {getUserSign} from '@/api/integral';
  108. export default{
  109. components: {
  110. hallItem
  111. },
  112. data() {
  113. return {
  114. recommendList:[],
  115. user:{isVip:false},
  116. isDaySign:false,
  117. signNum:0,
  118. integral:0,
  119. defaultSign: [
  120. {signNum:10,sort:1,day:"第1天"},
  121. {signNum:20,sort:2,day:"第2天"},
  122. {signNum:30,sort:3,day:"第3天"},
  123. {signNum:40,sort:4,day:"第4天"},
  124. {signNum:50,sort:5,day:"第5天"},
  125. {signNum:50,sort:6,day:"第6天"},
  126. {signNum:50,sort:7,day:"第7天"},
  127. ],
  128. sign:[],
  129. data:null,
  130. }
  131. },
  132. mounted() {
  133. this.getRecommendList();
  134. if(this.$isLogin()){
  135. this.getUserInfo();
  136. this.getUserSign();
  137. } else {
  138. this.sign = this.defaultSign
  139. }
  140. let that=this;
  141. uni.$on('refreshUserSign', function() {
  142. if(that.$isLogin()){
  143. that.getUserSign();
  144. }
  145. });
  146. },
  147. methods: {
  148. onShowFun() {
  149. this.getRecommendList();
  150. if(this.$isLogin()){
  151. this.getUserInfo();
  152. this.getUserSign();
  153. } else {
  154. this.signNum=0;
  155. this.isDaySign=false;
  156. this.integral=0;
  157. this.sign = this.defaultSign
  158. }
  159. },
  160. getRecommendList(){
  161. let that=this;
  162. const params={"isTui":1};
  163. getCourseList(params,1,10).then(res => {
  164. if(res.code==200){
  165. this.recommendList=res.data.list;
  166. }
  167. },
  168. rej => {}
  169. );
  170. },
  171. getUserSign(){
  172. getUserSign().then(res => {
  173. if(res.code==200){
  174. this.data=res.member;
  175. this.signNum=res.signNum;
  176. this.isDaySign=res.isDaySign;
  177. this.integral=res.integral;
  178. this.sign=JSON.parse(res.sign);
  179. }else{
  180. uni.showToast({
  181. icon:'none',
  182. title: "请求失败",
  183. });
  184. }
  185. },
  186. rej => {}
  187. );
  188. },
  189. handleOrder(status) {
  190. this.loginNavTo('/pages/course/studyCenter/orderList?status='+status);
  191. },
  192. handleCollect() {
  193. this.loginNavTo('/pages/course/studyCenter/courseCollect');
  194. },
  195. getUserInfo(){
  196. let that=this;
  197. getUserInfo().then(res => {
  198. if(res.code==200){
  199. if(res.user!=null){
  200. uni.setStorageSync('userInfo',JSON.stringify(res.user));
  201. this.user=res.user;
  202. }
  203. else{
  204. uni.showToast({
  205. icon:'none',
  206. title: res.msg,
  207. });
  208. }
  209. }
  210. },
  211. rej => {}
  212. );
  213. },
  214. loginNavTo(url){
  215. if(!this.$isLogin()){
  216. this.$showLoginPage();
  217. return;
  218. }
  219. this.$navTo(url);
  220. },
  221. navTo(url) {
  222. uni.navigateTo({
  223. url: url
  224. })
  225. },
  226. }
  227. }
  228. </script>
  229. <style lang="scss" scoped>
  230. @mixin u-flex($flexD, $alignI, $justifyC) {
  231. display: flex;
  232. flex-direction: $flexD;
  233. align-items: $alignI;
  234. justify-content: $justifyC;
  235. }
  236. .content {
  237. padding: 0 24rpx;
  238. font-family: PingFang SC, PingFang SC;
  239. font-weight: 400;
  240. }
  241. .navbox {
  242. @include u-flex(row,center,space-between);
  243. margin-top: 12rpx;
  244. &:last-child {
  245. margin-right: 0;
  246. }
  247. &-item {
  248. flex:1;
  249. margin-right: 18rpx;
  250. @include u-flex(column,center,center);
  251. }
  252. &-iteminfo {
  253. width: 162rpx;
  254. height: 162rpx;
  255. background: rgba(255,255,255,0.7);
  256. border-radius: 24rpx 24rpx 24rpx 24rpx;
  257. @include u-flex(column,center,center);
  258. font-size: 26rpx;
  259. color: #222222;
  260. }
  261. image {
  262. width: 64rpx;
  263. height: 64rpx;
  264. margin-bottom: 14rpx;
  265. }
  266. }
  267. .navbox-other {
  268. height: 160rpx;
  269. background: #FFFFFF;
  270. border-radius: 16rpx 16rpx 16rpx 16rpx;
  271. font-size: 24rpx;
  272. image {
  273. width: 48rpx;
  274. height: 48rpx;
  275. margin-bottom: 10rpx;
  276. }
  277. }
  278. .vipbox {
  279. height: 120rpx;
  280. margin-top: 20rpx;
  281. padding: 0 20rpx 0 32rpx;
  282. border-radius: 16rpx;
  283. overflow: hidden;
  284. @include u-flex(row,center,space-between);
  285. font-weight: 500;
  286. font-size: 28rpx;
  287. color: #7F5532;
  288. background: url("@/static/image/hall/vip_bg.png") no-repeat right / 152rpx 120rpx,linear-gradient( 90deg, #FFE6C5 0%, #FBD095 100%);
  289. &-l {
  290. @include u-flex(row,center,flex-start);
  291. }
  292. .vip-icon {
  293. width: 32rpx;
  294. height: 32rpx;
  295. margin-right: 24rpx;
  296. }
  297. .vip-arrow {
  298. width: 48rpx;
  299. height: 48rpx;
  300. }
  301. }
  302. .sign {
  303. margin-top: 20rpx;
  304. padding: 26rpx 20rpx;
  305. background: url("@/static/image/hall/sign_in_bg.png") no-repeat right top / cover,linear-gradient( 180deg, #EB473A 0%, #FBE8DE 100%);
  306. border-radius: 20rpx;
  307. overflow: hidden;
  308. &-info {
  309. @include u-flex(row,center,space-between);
  310. }
  311. &-day {
  312. margin-top: -10rpx;
  313. font-weight: 600;
  314. font-size: 32rpx;
  315. color: #FFFFFF;
  316. @include u-flex(row,baseline,flex-start);
  317. text {
  318. font-family: Roboto, Roboto;
  319. font-weight: bold;
  320. font-size: 56rpx;
  321. color: #FEEBC9;
  322. }
  323. }
  324. &-num {
  325. height: 42rpx;
  326. padding: 0 16rpx;
  327. background: #FFE3DE;
  328. border-radius: 20rpx 20rpx 20rpx 20rpx;
  329. border: 2rpx solid rgba(255,255,255,0.3);
  330. font-size: 24rpx;
  331. color: #F6443C;
  332. line-height: 42rpx;
  333. }
  334. &-box {
  335. background: #FEFAF7;
  336. border-radius: 12rpx;
  337. padding: 34rpx 32rpx 32rpx 32rpx;
  338. margin-top: 20rpx;
  339. }
  340. &-btn {
  341. font-weight: 500;
  342. font-size: 28rpx;
  343. color: #FFFFFF;
  344. height: 72rpx;
  345. line-height: 72rpx;
  346. margin-top: 40rpx;
  347. background: linear-gradient( 90deg, #EB4A42 0%, #EE7E50 100%);
  348. box-shadow: 0rpx 8rpx 8rpx 0rpx rgba(238,124,80,0.2);
  349. border-radius: 36rpx 36rpx 36rpx 36rpx;
  350. &::after {
  351. border: none;
  352. }
  353. }
  354. &-boxbar {
  355. @include u-flex(row,center,space-between);
  356. overflow: hidden;
  357. position: relative;
  358. }
  359. &-line {
  360. width: 100%;
  361. padding: 0 20rpx;
  362. box-sizing: border-box;
  363. @include u-flex(row,center,space-between);
  364. position: absolute;
  365. top: 24rpx;
  366. left: 0;
  367. &-item {
  368. flex: 1;
  369. height: 4rpx;
  370. background: #F8D7D3;
  371. }
  372. }
  373. &-item {
  374. @include u-flex(column,center,center);
  375. font-size: 22rpx;
  376. color: #757575;
  377. position: relative;
  378. z-index: 1;
  379. &-circle {
  380. width: 48rpx;
  381. height: 48rpx;
  382. background: #FEFAF7;
  383. border-radius: 50%;
  384. border: 5rpx solid #F8D7D3;
  385. box-sizing: border-box;
  386. }
  387. &-txt {
  388. margin-top: 16rpx;
  389. }
  390. image {
  391. width: 48rpx;
  392. height: 48rpx;
  393. }
  394. }
  395. .active-text {
  396. color: #EC5D46;
  397. }
  398. }
  399. .hallbox {
  400. @include u-flex(row, center, flex-start);
  401. flex-wrap: wrap;
  402. margin: 0 -18rpx -18rpx 0;
  403. padding: 20rpx 0;
  404. .gapitem {
  405. margin: 0 18rpx 18rpx 0;
  406. }
  407. }
  408. .training-camp{
  409. background-color: #fff;
  410. padding: 20rpx;
  411. border-radius: 16rpx;
  412. margin-bottom: 20rpx;
  413. .training-top{
  414. display: flex;
  415. justify-content: space-between;
  416. .training-tit{
  417. .srcp{
  418. color: #757575;
  419. font-size: 24rpx;
  420. }
  421. .tit-box{
  422. display: flex;
  423. justify-content: start;
  424. align-items: center;
  425. font-weight: bold;
  426. .look-box{
  427. background-color: #FFB205;
  428. margin-right: 16rpx;
  429. color: #fff;
  430. font-weight: normal;
  431. font-size: 24rpx;
  432. height: 40rpx;
  433. padding: 0 8rpx;
  434. border-radius: 8rpx;
  435. }
  436. }
  437. }
  438. image{
  439. width: 240rpx;
  440. height: 142rpx;
  441. border-radius: 16rpx;
  442. }
  443. }
  444. .training-bot{
  445. display: flex;
  446. justify-content: space-between;
  447. align-items: center;
  448. font-size: 24rpx;
  449. margin-top: 20rpx;
  450. color: #999999;
  451. .doc-box{
  452. display: flex;
  453. justify-content: start;
  454. align-items: center;
  455. image{
  456. width: 40rpx;
  457. height: 40rpx;
  458. border-radius: 50%;
  459. margin-right: 16rpx;
  460. }
  461. }
  462. }
  463. }
  464. </style>