Browse Source

提交代码

master
杨豪 3 years ago
parent
commit
6cb6d8ee06
  1. 11
      api/knowledge.js
  2. 2
      api/user.js
  3. 3
      pages.json
  4. 10
      pages/Loading/index.vue
  5. 49
      pages/course/detail.vue
  6. 29
      pages/home/index.vue
  7. 2
      pages/knowledge/detail.vue
  8. 8
      pages/shop/GoodsClass/index.vue
  9. 56
      pages/study/dabang.vue
  10. 62
      pages/study/editDabang.vue
  11. 67
      pages/user/User/index.vue
  12. 2
      pages/user/myCourses/index.vue
  13. BIN
      static/loading.gif
  14. 5
      store/index.js
  15. 5
      utils/index.js
  16. 2
      utils/request.js

11
api/knowledge.js

@ -62,7 +62,7 @@ export function enterStudyList(data) {
* 获取榜单打榜进度 * 获取榜单打榜进度
*/ */
export function myProgress(data) { export function myProgress(data) {
return request.get("/StudyList/myProgress?studyListId="+data); return request.get("/StudyList/myProgress",data);
} }
/** /**
@ -72,6 +72,13 @@ export function studyListPublish(data) {
return request.post("/StudyList/studyListPublish",data); return request.post("/StudyList/studyListPublish",data);
} }
/**
* 补卡打榜分享
*/
export function studyListRepublish(data) {
return request.post("/StudyList/studyListRepublish",data);
}
/** /**
* 发布打榜点赞 * 发布打榜点赞
*/ */
@ -104,7 +111,7 @@ export function getCourseDetail(data) {
* 报名 * 报名
*/ */
export function enterCourse(data) { export function enterCourse(data) {
return request.post("/user/enterCourse",data); return request.post("/lession/enterCourse",data);
} }
/** /**

2
api/user.js

@ -439,7 +439,7 @@ export function getRechargeApi() {
* 获取我的课程列表 * 获取我的课程列表
* */ * */
export function getMyCourseList(q) { export function getMyCourseList(q) {
return request.get('/Course/listCoursesByMemberId?type='+q) return request.get('/lession/myLessionList?type='+q)
} }
/* /*

3
pages.json

@ -164,7 +164,8 @@
{ {
"path": "pages/user/User/index", "path": "pages/user/User/index",
"style": { "style": {
"navigationBarTitleText": "我的" "navigationBarTitleText": "我的",
"enablePullDownRefresh": true
} }
}, },

10
pages/Loading/index.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="lottie-bg"> <view class="lottie-bg">
<view id="lottie"> <view id="lottie">
<image src="@/static/live-logo.gif" rel="preload" mode="widthFix" style="width: 100%" /> <image src="../../static/loading.gif" rel="preload" mode="widthFix" style="width: 100%;height:100%;" />
</view> </view>
</view> </view>
</template> </template>
@ -23,13 +23,12 @@ export default {
return {} return {}
}, },
onShow() { onShow() {
console.log('getUser',this.userInfo)
var url = handleQrCode() var url = handleQrCode()
if (!url) { if (!url) {
url = handleUrlParam(getCurrentPageUrlWithArgs()) url = handleUrlParam(getCurrentPageUrlWithArgs())
} }
console.log(url) // console.log(url)
console.log('判断是否是分销') // console.log('')
// //
if (url) { if (url) {
let urlSpread = parseInt(url.spread) let urlSpread = parseInt(url.spread)
@ -109,7 +108,8 @@ export default {
} }
#lottie { #lottie {
width: 35%; width: 42rpx;
height: 42rpx;
display: block; display: block;
overflow: hidden; overflow: hidden;
transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0);

49
pages/course/detail.vue

@ -50,7 +50,7 @@
<span>课程简介</span> <span>课程简介</span>
</view> </view>
<!-- <text class="desc">{{detail.courseIntroduce}}</text> --> <!-- <text class="desc">{{detail.courseIntroduce}}</text> -->
<rich-text class="content" :nodes="detail.courseIntroduce"></rich-text> <rich-text class="content" :nodes="detail.content"></rich-text>
</view> </view>
<view class="course-desc-box content" id="content2"> <view class="course-desc-box content" id="content2">
<view class="title-box acea-row row-middle"> <view class="title-box acea-row row-middle">
@ -131,7 +131,6 @@
<view class="price" v-if="detail.signState == 1">座位号{{detail.seat}}</view> <view class="price" v-if="detail.signState == 1">座位号{{detail.seat}}</view>
</view> </view>
<view class="footer-right"> <view class="footer-right">
<view class="btn-box acea-row row-between-wrapper" v-if="yhStatus == 1 || yhStatus == 3 "> <view class="btn-box acea-row row-between-wrapper" v-if="yhStatus == 1 || yhStatus == 3 ">
<view class="count-down"> <view class="count-down">
<view>距离截止时间还剩</view> <view>距离截止时间还剩</view>
@ -140,9 +139,6 @@
<view class="signin-btn" @click="signInClick(2)">立即报名</view> <view class="signin-btn" @click="signInClick(2)">立即报名</view>
</view> </view>
<view class="signin-btn" v-if="yhStatus == 2 ">报名已截止 请关注下期</view> <view class="signin-btn" v-if="yhStatus == 2 ">报名已截止 请关注下期</view>
<!-- <view class="btn-box acea-row row-between-wrapper" v-if="yhStatus == 2 ">
</view> -->
<!-- 在线直播 --> <!-- 在线直播 -->
<view class="signin-btn call-btn" v-if="yhStatus == 4 " @click="signInClick(3)" >立即观看</view> <view class="signin-btn call-btn" v-if="yhStatus == 4 " @click="signInClick(3)" >立即观看</view>
@ -335,20 +331,23 @@
test(){ test(){
let yhStatus = 0; let yhStatus = 0;
let detail = this.detail; let detail = this.detail;
let enterEndTime = detail.enterEndTime.replace(/-/g, '/')
let enterStartTime = detail.enterStartTime.replace(/-/g, '/')
let courseEndTime = detail.courseEndTime.replace(/-/g, '/')
if ( !detail.enterState ){ if ( !detail.enterState ){
yhStatus = 0; yhStatus = 0;
if( new Date(detail.enterEndTime) >= new Date() && new Date(detail.enterStartTime) <= new Date() ){ if( new Date(enterEndTime) >= new Date() && new Date(enterStartTime) <= new Date() ){
yhStatus = 1; // yhStatus = 1; //
}else if(new Date(detail.enterEndTime) < new Date()){ }else if(new Date(enterEndTime) < new Date()){
yhStatus = 2; // yhStatus = 2; //
}else if(new Date(detail.enterStartTime) > new Date()){ }else if(new Date(enterStartTime) > new Date()){
yhStatus = 3; // yhStatus = 3; //
} }
}else{ }else{
// //
if (detail.status == 1 && detail.courseType == 1){ if (detail.status == 1 && detail.courseType == 1){
if( new Date(detail.courseEndTime) >= new Date() ){ if( new Date(courseEndTime) >= new Date() ){
yhStatus = 4; // yhStatus = 4; //
}else{ }else{
yhStatus = 5; // yhStatus = 5; //
@ -360,12 +359,13 @@
yhStatus = 7; // yhStatus = 7; //
} }
}else { }else {
if ( detail.status == 0 ){ if (detail.status == 0 ){
yhStatus = 8; // yhStatus = 8; //
} }
} }
} }
this.yhStatus = yhStatus; this.yhStatus = yhStatus;
// console.log(this.yhStatus)
}, },
getDetail(){ getDetail(){
uni.showLoading({ uni.showLoading({
@ -374,18 +374,19 @@
let nowTime = Date.parse(new Date())/1000; let nowTime = Date.parse(new Date())/1000;
getCourseDetail({id:this.courseId}).then((res)=>{ getCourseDetail({id:this.courseId}).then((res)=>{
uni.hideLoading() uni.hideLoading()
//res.data.courseIntroduce = res.data.courseIntroduce.replace(/\<img/g, "<img style='width: 100%;'") // res.data.content = res.data.content.replace(/\<img/g, "<img style='width: 100%;'")
this.detail = res.data; this.detail = res.data;
this.test(); let t = res.data.enterEndTime.replace(/-/g, '/');
let t = res.data.signEndTime.replace(/-/g, '/');
let endTime = Date.parse(new Date(t))/1000 let endTime = Date.parse(new Date(t))/1000
this.times = endTime - nowTime; this.times = endTime - nowTime;
this.day = Math.floor(this.times / (60 * 60 * 24)); this.day = Math.floor(this.times / (60 * 60 * 24));
this.hour = Math.floor(this.times / (60 * 60)) - (this.day * 24); this.hour = Math.floor(this.times / (60 * 60)) - (this.day * 24);
this.minute = Math.floor(this.times / 60) - (this.day * 24 * 60) - (this.hour * 60); this.minute = Math.floor(this.times / 60) - (this.day * 24 * 60) - (this.hour * 60);
this.second = Math.floor(this.times) - (this.day * 24 * 60 * 60) - (this.hour * 60 * 60) - (this.minute * 60); this.second = Math.floor(this.times) - (this.day * 24 * 60 * 60) - (this.hour * 60 * 60) - (this.minute * 60);
// console.log(this.times) // console.log(this.times,'times')
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
}).then(()=>{
this.test();
}) })
}, },
@ -423,7 +424,7 @@
}) })
} else if(type == 1){ // } else if(type == 1){ //
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: this.userInfo.sellerPhone phoneNumber: this.userInfo.seller.phone
}); });
} else{ } else{
this.sign() this.sign()
@ -432,10 +433,6 @@
}, },
sign(){ sign(){
if(!this.userInfo.spreadUid){
this.maskDialog = true
return
}
enterCourse({ enterCourse({
lessionId: this.courseId lessionId: this.courseId
}).then((res)=>{ }).then((res)=>{
@ -449,11 +446,14 @@
},1500) },1500)
} else if(res.data.state == 2){ } else if(res.data.state == 2){
this.payment(res.data.payData) this.payment(res.data.payData)
} else if(res.data.status == 4045){
this.maskDialog = true
return
} else{ } else{
uni.showToast({ uni.showModal({
title: res.msg, title: '提示!',
icon: 'none', content: res.msg,
duration: 2000 showCancel:false
}); });
} }
}) })
@ -1036,8 +1036,9 @@
background: #F99C10; background: #F99C10;
} }
.call-btn{ .call-btn{
width: 268rpx; min-width: 230rpx;
height: 80rpx; height: 80rpx;
padding: 0 20rpx;
background: #F99C10; background: #F99C10;
border-radius: 44rpx; border-radius: 44rpx;
text-align: center; text-align: center;

29
pages/home/index.vue

@ -1,16 +1,16 @@
<template> <template>
<view class="index"> <view class="index">
<view class="header header-search acea-row row-middle"> <!-- <view class="header header-search acea-row row-middle"> -->
<view @click="goGoodSearch()" class="search acea-row row-middle"> <!-- view @click="goGoodSearch()" class="search acea-row row-middle">
<text class="iconfont icon-xiazai5"></text> <text class="iconfont icon-xiazai5"></text>
搜索商品 搜索商品
</view> </view> -->
<!-- #ifndef H5 --> <!-- #ifndef H5 -->
<!-- <view class="qr" @click="startQr()" v-if="$deviceType !== 'weixin'"> <!-- <view class="qr" @click="startQr()" v-if="$deviceType !== 'weixin'">
<image src="../../static/saoyisao-icon.png" /> <image src="../../static/saoyisao-icon.png" />
</view> --> </view> -->
<!-- #endif --> <!-- #endif -->
</view> <!-- </view> -->
<view class="banner-box"> <view class="banner-box">
<image src="https://www.cyjyyjy.com:8081/static/home-banner.png" mode=""></image> <image src="https://www.cyjyyjy.com:8081/static/home-banner.png" mode=""></image>
</view> </view>
@ -59,38 +59,38 @@
</view> </view>
</view> --> </view> -->
</view> </view>
<view class="notice-box acea-row row-middle" @click="toNoticePage"> <!-- <view class="notice-box acea-row row-middle" @click="toNoticePage">
<view class="notice-t">公告</view> <view class="notice-t">公告</view>
<view class="notice">点击下载直播APP在线观看</view> <view class="notice">点击下载直播APP在线观看</view>
</view> </view> -->
<!-- 推荐课程 --> <!-- 推荐课程 -->
<view class="recommend-box p30"> <view class="recommend-box p30" v-if="courseList.length > 0">
<view class="title-box acea-row row-between-wrapper"> <view class="title-box acea-row row-between-wrapper">
<view class="title">今日推荐</view> <view class="title">今日推荐</view>
<view class="more" @click="toCourse">查看全部课程</view> <view class="more" @click="toCourse">查看全部课程</view>
</view> </view>
<view class="recommend-list-box acea-row"> <view class="recommend-list-box acea-row">
<view class="recommend-item" v-for="(item,index) in courseList" :key="index" @click="toCourseDetail(item.id)"> <view class="recommend-item" v-for="(item,index) in courseList" :key="index" @click="toCourseDetail(item.id)">
<view class="img-box"><image :src="item.imageArr[0]" mode="aspectFill"></image></view> <view class="img-box"><image :src="item.coverImg" mode="aspectFill"></image></view>
<view class="course-content"> <view class="course-content">
<view class="course-title line1">{{item.courseName}}</view> <view class="course-title line1">{{item.courseName}}</view>
<view class="course-tips-box acea-row"> <view class="course-tips-box acea-row">
<view class="course-tip-item blue">{{item.categoryName}}</view> <view class="course-tip-item blue">{{item.categoryName}}</view>
<view class="course-tip-item yellow">{{item.levelName}}</view> <!-- <view class="course-tip-item yellow">{{item.levelName}}</view> -->
</view> </view>
<!-- <view class="price" v-if="item.level > 2">{{item.level}}级课程</view> <!-- <view class="price" v-if="item.level > 2">{{item.level}}级课程</view>
<view class="price" v-if="item.level == 2">{{item.courseCharge}}</view> <view class="price" v-if="item.level == 2">{{item.courseCharge}}</view>
<view class="price colG" v-if="item.chargeType == 0 || item.level == 1">免费</view> --> <view class="price colG" v-if="item.chargeType == 0 || item.level == 1">免费</view> -->
<view class="course-address acea-row row-between-wrapper"> <view class="course-address acea-row row-between-wrapper">
<view class="address">{{item.coursePlace}}</view> <view class="address">{{item.coursePlace}}</view>
<view class="course-time">{{setDate(item.courseStartTime)}}-{{setDate(item.courseEndTime)}}</view> <view class="course-time">{{setDate(item.enterStartTime)}}-{{setDate(item.enterEndTime)}}</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- 学习榜 --> <!-- 学习榜 -->
<view class="study-list-box"> <view class="study-list-box" v-if="studyList.length > 0">
<view class="title-box acea-row row-between-wrapper"> <view class="title-box acea-row row-between-wrapper">
<view class="title">学习榜单</view> <view class="title">学习榜单</view>
<view class="more" @click="toCourse">查看全部榜单</view> <view class="more" @click="toCourse">查看全部榜单</view>
@ -300,13 +300,13 @@ export default {
that.$set(that, 'benefit', res.data.benefit) that.$set(that, 'benefit', res.data.benefit)
that.$set(that, 'couponList', res.data.couponList) that.$set(that, 'couponList', res.data.couponList)
that.$set(that, 'combinationList', res.data.combinationList) that.$set(that, 'combinationList', res.data.combinationList)
that.$set(that, 'courseList', res.data.courseDtos) that.$set(that, 'courseList', res.data.lessionDtos)
that.$set(that, 'studyList', res.data.studyLists) that.$set(that, 'studyList', res.data.studyLists)
that.$set(that, 'articleList', res.data.articleDtos) that.$set(that, 'articleList', res.data.articleDtos)
uni.hideLoading() uni.hideLoading()
that.setOpenShare() that.setOpenShare()
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
console.log(res.data.courseDtos) // console.log(res.data.courseDtos)
}) })
}, },
todiandeng(){ todiandeng(){
@ -315,8 +315,10 @@ export default {
}) })
}, },
setDate(t){ setDate(t){
if(t && t.length > 0){
let str = t.split(" ")[0].split("-")[1] + "." + t.split(" ")[0].split("-")[2] let str = t.split(" ")[0].split("-")[1] + "." + t.split(" ")[0].split("-")[2]
return str return str
}
}, },
getDate(){ getDate(){
var today = new Date(); var today = new Date();
@ -439,7 +441,6 @@ export default {
uni.showModal({ uni.showModal({
title:'提示!', title:'提示!',
content:'签到成功!您的座位号是' + res.data, content:'签到成功!您的座位号是' + res.data,
}) })
} else{ } else{
uni.showToast({ uni.showToast({

2
pages/knowledge/detail.vue

@ -175,7 +175,7 @@ export default{
.charge-type-price{ .charge-type-price{
background: #F99C10; background: #F99C10;
color: #FFEDCC; color: #FFEDCC;
border: 1px solid #F99C10;; border: 1px solid #F99C10;
} }
} }
.audio-box{ .audio-box{

8
pages/shop/GoodsClass/index.vue

@ -22,17 +22,17 @@
</view> --> </view> -->
<view class="userInfo-box acea-row row-between row-middle"> <view class="userInfo-box acea-row row-between row-middle">
<view class="userInfo-l acea-row row-center-wrapper"> <view class="userInfo-l acea-row row-center-wrapper">
<image :src="userInfo.avatar"></image> <image :src="userInfo.avatar || '../../../static/default-headerimg.png'"></image>
<view class="userInfo"> <view class="userInfo">
<view>亲爱的{{getTime()}}</view> <view>亲爱的{{getTime()}}</view>
<view class="name line1">{{userInfo.nickname}}</view> <view class="name line1">{{userInfo.nickname || '禅易家人'}}</view>
</view> </view>
</view> </view>
<view class="userInfo-r"> <view class="userInfo-r">
<view> <view>
<text>{{userInfo.integral}}</text>积分 <text>{{userInfo.integral || 0}}</text>积分
</view> </view>
<view class="tips">您还有{{userInfo.integral}}积分未使用</view> <view class="tips">您还有{{userInfo.integral || 0}}积分未使用</view>
</view> </view>
</view> </view>
<view class="goods-list-box"> <view class="goods-list-box">

56
pages/study/dabang.vue

@ -40,9 +40,9 @@
</view> </view>
<view class="progress-r acea-row row-column row-center-wrapper"> <view class="progress-r acea-row row-column row-center-wrapper">
<text>{{detail.enterState ? '今日已打卡' : '今日未打卡'}}</text> <text>{{detail.enterState ? '今日已打卡' : '今日未打卡'}}</text>
<view class="dabang-btn default" v-if="detail.enterState">已打卡</view> <!-- <view class="dabang-btn default" v-if="detail.enterState">已打卡</view> -->
<view class="dabang-btn default" v-if="detail.studyListDto.listState == 0">未开始</view> <view class="dabang-btn default" v-if="detail.studyListDto.listState == 0">未开始</view>
<view class="dabang-btn" @click="toEdit" v-if="detail.studyListDto.isClockTime && !detail.enterState && detail.studyListDto.listState == 1">立即打卡</view> <view class="dabang-btn" @click="toEdit" v-if="detail.studyListDto.isClockTime && detail.studyListDto.listState == 1">立即打卡</view>
<view class="dabang-btn default" v-if="!detail.studyListDto.isClockTime && !detail.enterState && detail.studyListDto.listState == 1">未开始</view> <view class="dabang-btn default" v-if="!detail.studyListDto.isClockTime && !detail.enterState && detail.studyListDto.listState == 1">未开始</view>
</view> </view>
</view> </view>
@ -53,7 +53,7 @@
</view> </view>
<!-- 打榜分享 --> <!-- 打榜分享 -->
<view class="dabang-share-box" v-if="active == 0"> <view class="dabang-share-box" v-if="active == 0">
<view class="dabang-share-item" v-for="(item,index) in detail.studyListRecordDtos" :key="index"> <view class="dabang-share-item" v-for="(item,index) in studyListRecordDtos" :key="index">
<view class="user-info-box acea-row row-middle"> <view class="user-info-box acea-row row-middle">
<view class="header-img"> <view class="header-img">
<image :src="item.avatar" mode="aspectFill"></image> <image :src="item.avatar" mode="aspectFill"></image>
@ -95,7 +95,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="loading-status">{{loadingStatus}}</view>
</view> </view>
</template> </template>
@ -112,15 +112,31 @@
finishTimes: 0, finishTimes: 0,
progress: 0, progress: 0,
rank: 0, rank: 0,
studyListRecordDtos:[],
memberIntegralRankVos:[], memberIntegralRankVos:[],
} },
studyListRecordDtos:[],
page: 0,
pagesize: 10,
isLoad: true,
loadingStatus: '没有更多了...'
} }
}, },
onLoad() { onLoad() {
this.studyId = this.$yroute.query.id; this.studyId = this.$yroute.query.id;
this.getProgress(); this.getProgress();
}, },
onReachBottom(){
this.page = this.page + 1
this.getProgress()
console.log('上拉加载')
},
onPullDownRefresh() {
this.studyListRecordDtos = []
this.page = 0;
this.isLoad = true;
this.getProgress();
},
methods:{ methods:{
previewImage(imgArr,idx) { previewImage(imgArr,idx) {
// //
@ -130,18 +146,34 @@
}); });
}, },
getProgress(){ getProgress(){
if(this.isLoad){
uni.showLoading({ uni.showLoading({
title: "正在加载中..." title: "正在加载中..."
}) })
myProgress(this.studyId).then((res)=>{ this.loadingStatus = '加载中...'
const data = {
page: this.page,
size: this.pagesize,
studyListId: this.studyId
}
myProgress(data).then((res)=>{
if(res.success){ if(res.success){
res.data.studyListDto.listStartTime = res.data.studyListDto.listStartTime.split(" ")[0]; res.data.studyListDto.listStartTime = res.data.studyListDto.listStartTime.split(" ")[0];
res.data.studyListDto.listEndTime = res.data.studyListDto.listEndTime.split(" ")[0] res.data.studyListDto.listEndTime = res.data.studyListDto.listEndTime.split(" ")[0];
this.detail = res.data; this.detail = res.data;
this.studyListRecordDtos = this.studyListRecordDtos.concat(res.data.studyListRecordDtos.content)
uni.hideLoading() uni.hideLoading()
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
if(this.pagesize <= res.data.studyListRecordDtos.content.length){
this.isLoad = true;
this.loadingStatus = '上拉加载更多...'
} else{
this.isLoad = false;
this.loadingStatus = '没有更多了...'
}
} }
}) })
}
}, },
voteClick(item){ voteClick(item){
let id = item.id, let id = item.id,
@ -188,14 +220,16 @@
} }
}) })
}, },
onPullDownRefresh() {
this.getProgress();
}
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.loading-status{
text-align: center;
font-size: 28rpx;
color: #B9B9B9;
}
.dabang-index{ .dabang-index{
min-height: 100vh; min-height: 100vh;
background: #fff; background: #fff;

62
pages/study/editDabang.vue

@ -20,13 +20,30 @@
<switch checked @change="switchChange" color="#FDBF68" /> <switch checked @change="switchChange" color="#FDBF68" />
<text>{{isShow == 1 ? '显示' : '不显示'}}</text> <text>{{isShow == 1 ? '显示' : '不显示'}}</text>
</view> </view>
<view class="tips">提示由于11月2728日系统升级导致部分打卡未成功的学员现可以根据自己需求进行补卡操作</view>
<view class="isShow-box acea-row row-middle row-right">
<text>是否为补打卡内容</text>
<switch :checked="isBuka" @change="switchChange2" color="#FDBF68" />
<text>{{isBuka == 1 ? '是' : '否'}}</text>
</view>
<view class="isShow-box acea-row row-middle row-right" v-if="isBuka">
<text>请选择补卡日期</text>
<radio-group @change="choseDate">
<label>
<radio value="2021-11-27" /><text>2021-11-27</text>
</label>
<label>
<radio value="2021-11-28" /><text>2021-11-28</text>
</label>
</radio-group>
</view>
<view class="submit-btn" @click="submitClick()">发布</view> <view class="submit-btn" @click="submitClick()">发布</view>
</view> </view>
</template> </template>
<script> <script>
import { chooseImages } from "@/utils" import { chooseImages } from "@/utils"
import { studyListPublish } from "@/api/knowledge" import { studyListPublish, studyListRepublish } from "@/api/knowledge"
export default { export default {
components: { components: {
// VueCoreImageUpload // VueCoreImageUpload
@ -37,7 +54,9 @@
studyId: '', studyId: '',
uploadPictures: [], uploadPictures: [],
content: "", content: "",
unique: "" unique: "",
isBuka: 0,
republishTime: ''
}; };
}, },
onLoad(){ onLoad(){
@ -47,6 +66,12 @@
switchChange(e){ switchChange(e){
this.isShow = e.target.value ? 1 : 0 this.isShow = e.target.value ? 1 : 0
}, },
switchChange2(e){
this.isBuka = e.target.value ? 1 : 0
},
choseDate(e){
this.republishTime = e.detail.value
},
chooseImage() { chooseImage() {
chooseImages(img => { chooseImages(img => {
console.log(img) console.log(img)
@ -55,19 +80,35 @@
}, },
submitClick(){ submitClick(){
if(this.content == ''){ if(this.content == ''){
uni.showToast({ return uni.showToast({
title: '请填写分享内容', title: '请填写分享内容',
icon: 'none' icon: 'none'
}) })
return
} }
let data = { if(this.isBuka == 1 && this.republishTime == ''){
return uni.showToast({
title: '请选择补卡日期',
icon: 'none'
})
}
const data = {
content: this.content, content: this.content,
imgPaths: this.uploadPictures, imgPaths: this.uploadPictures,
studylistId: this.studyId, studylistId: this.studyId,
isShow: this.isShow isShow: this.isShow
} }
if(this.isBuka){ //
data.republishTime = this.republishTime
studyListRepublish(data).then((res)=>{
this.fnCallBack(res)
})
} else{
studyListPublish(data).then((res)=>{ studyListPublish(data).then((res)=>{
this.fnCallBack(res)
})
}
},
fnCallBack(res){
if(res.success){ if(res.success){
uni.showToast({ uni.showToast({
title: '发布成功!', title: '发布成功!',
@ -75,9 +116,6 @@
duration:1500 duration:1500
}) })
setTimeout(()=>{ setTimeout(()=>{
// uni.navigateBack({
// delta:1
// })
uni.redirectTo({ uni.redirectTo({
url: '/pages/study/dabang?id=' + this.studyId url: '/pages/study/dabang?id=' + this.studyId
}); });
@ -88,8 +126,7 @@
icon:'none' icon:'none'
}) })
} }
}) }
},
} }
} }
@ -134,9 +171,12 @@
} }
} }
.isShow-box{ .isShow-box,.tips{
font-size: 24rpx; font-size: 24rpx;
} }
.tips{
color: #E2B35D;
}
.submit-btn{ .submit-btn{
width: 340rpx; width: 340rpx;
height: 88rpx; height: 88rpx;

67
pages/user/User/index.vue

@ -49,7 +49,7 @@
</view> </view>
<view class="" style="color: #fff;" v-else @click="toServiceIndex()">服务老师主页</view> <view class="" style="color: #fff;" v-else @click="toServiceIndex()">服务老师主页</view>
</view> </view>
<view class="myjoin-box" v-if="userInfo.memberStudyVo.cyCourseDtos.length > 0 || userInfo.memberStudyVo.studyListDtos.length > 0"> <view class="myjoin-box" v-if="(userInfo.memberStudyVo.cyCourseDtos && userInfo.memberStudyVo.cyCourseDtos.length > 0) || (userInfo.memberStudyVo.studyListDtos && userInfo.memberStudyVo.studyListDtos.length > 0)">
<view class="t-word">我参与的</view> <view class="t-word">我参与的</view>
<scroll-view class="scroll-view_H" scroll-x="true"> <scroll-view class="scroll-view_H" scroll-x="true">
<view class="course-box" <view class="course-box"
@ -70,7 +70,7 @@
<view class="bangdan-list"> <view class="bangdan-list">
<scroll-view class="scroll-view_H" scroll-x="true"> <scroll-view class="scroll-view_H" scroll-x="true">
<view class="bangdan-item" v-for="(item,index) in userInfo.memberStudyVo.studyListDtos" :key="index"> <view class="bangdan-item" v-for="(item,index) in userInfo.memberStudyVo.studyListDtos" :key="index">
<view class="bangdan-name">{{item.listName}}</view> <view class="bangdan-name line1">{{item.listName}}</view>
<view class="acea-row row-between-wrapper"> <view class="acea-row row-between-wrapper">
<view class="signin-day">已连续{{item.signTimes}}</view> <view class="signin-day">已连续{{item.signTimes}}</view>
<view class="signin-btn" @click="toStudyDabang(item)">{{item.enterState ? '已打卡' : '立即打卡'}}</view> <view class="signin-btn" @click="toStudyDabang(item)">{{item.enterState ? '已打卡' : '立即打卡'}}</view>
@ -403,62 +403,6 @@ export default {
}) })
} }
}) })
// .catch(error => {
// uni.hideLoading()
// thit.$store.dispatch('userInfo', true)
// console.log(error)
// uni.showToast({
// title: error.msg || error.response.data.msg || error.response.data.message,
// icon: 'none',
// duration: 2000,
// })
// })
// //
// uni.getProvider({
// service: "oauth",
// success: function (res) {
// // h5
// if (res.provider) {
// uni.login({
// success: loginRes => {
// bindingPhone({
// code: loginRes.code,
// encryptedData: e.mp.detail.encryptedData,
// iv: e.mp.detail.iv
// })
// .then(res => {
// // this.User();
// thit.$store.dispatch("userInfo", true);
// uni.hideLoading();
// uni.showToast({
// title: res.msg,
// icon: "success",
// duration: 2000
// });
// })
// .catch(error => {
// uni.hideLoading();
// thit.$store.dispatch("userInfo", true);
// console.log(error);
// uni.showToast({
// title: error.msg ||
// error.response.data.msg ||
// error.response.data.message,
// icon: "none",
// duration: 2000
// });
// });
// },
// fail() {
// reject("");
// }
// });
// }
// },
// fail() {
// reject("");
// }
// });
} else { } else {
uni.showToast({ uni.showToast({
title: '已拒绝授权', title: '已拒绝授权',
@ -539,6 +483,13 @@ export default {
this.isWeixin = isWeixin() this.isWeixin = isWeixin()
} }
}, },
onPullDownRefresh() {
if (this.$store.getters.token) {
this.$store.dispatch('getUser', true)
// this.MenuUser()
this.isWeixin = isWeixin()
}
},
onHide() { onHide() {
console.log('离开用户中心') console.log('离开用户中心')

2
pages/user/myCourses/index.vue

@ -39,7 +39,7 @@
</view> </view>
<view class="knowledge-item acea-row" v-for="item in courseList" @click="toDetail(item.id)"> <view class="knowledge-item acea-row" v-for="item in courseList" @click="toDetail(item.id)">
<view class="img-box"> <view class="img-box">
<image :src="item.imageArr[0]" mode="aspectFill"></image> <image :src="item.coverImg" mode="aspectFill"></image>
</view> </view>
<view class="knowledge-info-box"> <view class="knowledge-info-box">
<view class="title line1">{{item.courseName}}</view> <view class="title line1">{{item.courseName}}</view>

BIN
static/loading.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

5
store/index.js

@ -25,9 +25,12 @@ const vuexStore = new Vuex.Store({
longitude: '', longitude: '',
}, },
storeItems: cookie.get('storeItems') || null, storeItems: cookie.get('storeItems') || null,
goName: cookie.get('goName') || '', goName: cookie.get('goName') || ''
}, },
mutations: { mutations: {
setNewMsg(state,msg){
state.newMsg = msg
},
login(state, token, expires_time) { login(state, token, expires_time) {
state.token = token state.token = token
cookie.set(loginKey, token, expires_time) cookie.set(loginKey, token, expires_time)

5
utils/index.js

@ -1047,7 +1047,7 @@ export function chooseImage(callback) {
name: 'file', name: 'file',
success: res => { success: res => {
if (callback) { if (callback) {
callback(JSON.parse(res.data).link) callback(JSON.parse(res.data).data.link)
} }
}, },
fail: err => { fail: err => {
@ -1094,7 +1094,8 @@ export function chooseImages(callback) {
name: 'file', name: 'file',
success: res => { success: res => {
if (callback) { if (callback) {
callback(JSON.parse(res.data).link) console.log(JSON.parse(res.data),'res.data')
callback(JSON.parse(res.data).data.link)
} }
}, },
fail: err => { fail: err => {

2
utils/request.js

@ -62,9 +62,9 @@ function baseRequest(options) {
// 如果接口需要登录,携带 token 去请求 // 如果接口需要登录,携带 token 去请求
options.headers = { options.headers = {
version: "2.0",
...options.headers, ...options.headers,
version: '2.0', version: '2.0',
dept: 0
} }
if (options.login === true) { if (options.login === true) {

Loading…
Cancel
Save