Browse Source

提交代码

master
杨豪 3 years ago
parent
commit
1521d49cdb
  1. 7
      pages.json
  2. 6
      pages/course/detail.vue
  3. 2
      pages/course/index.vue
  4. 246
      pages/course/signIn.vue
  5. 4
      pages/home/index.vue
  6. 2
      pages/shop/GoodSearch/index.vue
  7. 5
      pages/user/User/index.vue
  8. 16
      pages/user/feedBack/index.vue

7
pages.json

@ -78,6 +78,13 @@
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
}, },
{
"path": "pages/course/signIn",
"style": {
"navigationBarTitleText": "课程签到",
"enablePullDownRefresh": true
}
},
{ {
"path": "pages/study/detail", "path": "pages/study/detail",
"style": { "style": {

6
pages/course/detail.vue

@ -263,12 +263,6 @@
userInfo(){ userInfo(){
return this.$store.getters["userInfo"] return this.$store.getters["userInfo"]
}, },
// courseStartTime(){
// return this.detail.courseStartTime.split(' ')[0]
// },
// courseEndTime(){
// return this.detail.courseEndTime.split(' ')[0]
// },
}, },
mounted(){ mounted(){

2
pages/course/index.vue

@ -53,7 +53,7 @@
<view class="no-content" v-if="courseList.length == 0">暂无内容...</view> <view class="no-content" v-if="courseList.length == 0">暂无内容...</view>
<view class="knowledge-item acea-row" v-for="(item,index) in courseList" :key="index" @click="toDetail(item.id)"> <view class="knowledge-item acea-row" v-for="(item,index) in courseList" :key="index" @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>

246
pages/course/signIn.vue

@ -0,0 +1,246 @@
<template>
<view class="course-detail-index">
<view v-if="$store.getters.token || userInfo.uid">
<view class="swiper-box">
<view class="swiper-item">
<image :src="detail.imageArr[0]" mode="aspectFill" :key="index"></image>
</view>
</view>
<view class="course-info-box">
<view class="course-title acea-row row-between-wrapper">
<view>{{detail.courseName}}</view>
<view class="price" v-if="detail.price == 0">公开课</view>
<view class="price" v-if="detail.price > 0 && detail.price < 199">{{detail.price}}</view>
</view>
<view class="tips-box">
<view class="tip-item blue">{{detail.categoryName}}</view>
<view class="tip-item orange">{{detail.levelName}}</view>
</view>
</view>
<view class="course-desc-box content" id="content2">
<view class="title-box acea-row row-middle">
<view class="left-line"></view>
<span>课程表</span>
</view>
<view class="course-card-list">
<view class="course-card-item acea-row row-middle">
<image src="../../static/course-icon5.png"></image>
<view class="label">课程类型</view>
<view class="info">{{detail.courseType == 0 ? '线下课程' : '直播课程'}}</view>
</view>
<view class="course-card-item acea-row row-middle">
<image src="../../static/course-icon1.png"></image>
<view class="label">课程时间</view>
<view class="info">{{detail.courseStartTime}} {{detail.courseEndTime}}</view>
</view>
<view class="course-card-item acea-row row-middle">
<image src="../../static/course-icon2.png"></image>
<view class="label">课程地点</view>
<view class="info">{{detail.coursePlace}}</view>
</view>
<view class="course-card-item acea-row row-middle">
<image src="../../static/course-icon3.png"></image>
<view class="label">签到时间</view>
<view class="info">{{detail.signStartTime}} {{detail.signEndTime}}</view>
</view>
<view class="course-card-item acea-row row-middle">
<image src="../../static/course-icon4.png"></image>
<view class="label">报名截止</view>
<view class="info">{{detail.enterEndTime}}</view>
</view>
</view>
</view>
<view class="sign-btn" @click="signIn">立即签到</view>
</view>
<Authorization v-else />
</view>
</template>
<script>
import Authorization from '@/pages/authorization/index'
import { mapState, mapGetters, mapMutations, mapActions } from 'vuex'
import { getCourseDetail ,enterCourse, signCourse } from '@/api/knowledge';
import { handleQrCode, handleUrlParam, getCurrentPageUrlWithArgs } from '@/utils'
export default{
components: {
Authorization,
},
data(){
return {
courseId: '',
detail: []
}
},
computed:{
userInfo(){
return this.$store.getters["userInfo"]
},
},
onLoad(){
let url = handleQrCode()
if (!url) {
url = handleUrlParam(getCurrentPageUrlWithArgs())
}
console.log(url)
if (url && url.id) {
this.courseId = url.id
}
if(this.userInfo.uid && this.courseId){
this.getDetail()
}
},
methods:{
getDetail(){
uni.showLoading({
title:'正在加载中...'
})
let nowTime = Date.parse(new Date())/1000;
getCourseDetail({id:this.courseId}).then((res)=>{
uni.hideLoading()
res.data.courseIntroduce = res.data.courseIntroduce.replace(/\<img/g, "<img style='width: 100%;'")
this.detail = res.data
let t = res.data.signEndTime.replace(/-/g, '/');
let endTime = Date.parse(new Date(t))/1000
this.times = endTime - nowTime;
this.day = Math.floor(this.times / (60 * 60 * 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.second = Math.floor(this.times) - (this.day * 24 * 60 * 60) - (this.hour * 60 * 60) - (this.minute * 60);
// console.log(this.times)
uni.stopPullDownRefresh()
})
},
signIn(){
signCourse(this.courseId).then((res)=>{
if(res.success){
uni.showModal({
title:'提示!',
content:'签到成功!'
})
} else{
uni.showToast({
title:res.msg,
icon:'none',
duration:5000
})
}
})
},
}
}
</script>
<style lang="less">
.course-detail-index{
width: 100%;
min-height: 100vh;
padding-bottom: 200rpx;
box-sizing: border-box;
}
.swiper-box{
width: 100%;
height: 340rpx;
.swiper-item{
width: 100%;
height: 100%;
image{
width: 100%;
height: 100%;
}
}
swiper{
height: 100%;
.swiper-item{
width: 100%;
height: 100%;
image{
width: 100%;
height: 100%;
}
}
}
}
.course-info-box{
box-sizing: border-box;
padding: 30rpx 30rpx 50rpx;
background: #fff;
.course-title{
font-size: 40rpx;
font-weight: 500;
color: #333333;
line-height: 56rpx;
margin: 0rpx 0 20rpx;
.price{
color: #EA533E;
}
}
.tips-box{
display: flex;
.tip-item{
min-width: 60rpx;
height: 34rpx;
text-align: center;
line-height: 34rpx;
font-size: 24rpx;
padding: 0 5rpx;
border-radius: 5rpx;
}
.blue{
color: #6E85EB;
border: 1px solid #6E85EB;
background: #EDEFF8;
}
.orange{
margin-left: 10rpx;
border: 1px solid #F99C10;
color: #F99C10;
background: #FFEDCC;
}
}
}
.course-desc-box{
width: 100%;
background:#fff;
border-radius: 8rpx;
padding: 0rpx 24rpx 30rpx;
margin-bottom: 20rpx;
}
.course-card-item{
font-size: 26rpx;
margin-bottom: 12rpx;
image{
width: 30rpx;
height: 30rpx;
}
.label{
color: #999999;
margin: 0 24rpx 0 16rpx;
}
.info{
color: #666666;
}
}
.title-box{
font-size: 36rpx;
font-weight: bold;
color: #3C464F;
line-height: 50rpx;
margin-bottom: 20rpx;
.left-line{
width: 6rpx;
height: 32rpx;
background-color: #F99C10;
margin-right: 16rpx;
}
}
.sign-btn{
width: 254rpx;
height: 79rpx;
background: linear-gradient(180deg, #F7D08E 0%, #ECBE71 100%);
border-radius: 12rpx;
text-align: center;
line-height: 79rpx;
color: #fff;
margin: 60rpx auto 0;
}
</style>

4
pages/home/index.vue

@ -6,9 +6,9 @@
搜索商品 搜索商品
</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">

2
pages/shop/GoodSearch/index.vue

@ -59,7 +59,7 @@ export default {
this.toSearch(search); this.toSearch(search);
}, },
toSearch(s) { toSearch(s) {
this.$yrouter.push({ path: "/pages/shop/GoodsList/index", query: { s } }); this.$yrouter.push({ path:"pagesB/pages/shop/GoodsList/index", query: { s } });
}, },
getData() { getData() {
getSearchKeyword().then(res => { getSearchKeyword().then(res => {

5
pages/user/User/index.vue

@ -61,7 +61,7 @@
</view> </view>
<view class="address-box acea-row row-between row-middle"> <view class="address-box acea-row row-between row-middle">
<view class="address line1">地点{{item.coursePlace}}</view> <view class="address line1">地点{{item.coursePlace}}</view>
<view class="btn" @click.stop="startQr()" v-if="item.signState == 2">扫一扫</view> <!-- <view class="btn" @click.stop="startQr()" v-if="item.signState == 2">扫一扫</view> -->
<view class="btn" v-if="item.signState == 1">已签到</view> <view class="btn" v-if="item.signState == 1">已签到</view>
</view> </view>
</view> </view>
@ -239,10 +239,11 @@ export default {
return { return {
MyMenus: [], MyMenus: [],
switchActive: false, switchActive: false,
isWeixin: false, isWeixin: false
} }
}, },
computed: mapGetters(['userInfo']), computed: mapGetters(['userInfo']),
watch: {},
methods: { methods: {
...mapMutations(['updateAuthorizationPage']), ...mapMutations(['updateAuthorizationPage']),
startQr: function() { startQr: function() {

16
pages/user/feedBack/index.vue

@ -10,6 +10,8 @@
v-model="content"/> v-model="content"/>
<view class="fontnum">{{fontnum}}/100</view> <view class="fontnum">{{fontnum}}/100</view>
</view> </view>
<view class="tips">该反馈功能只做收集会员反馈信息不做解答如有问题需要解答可联系服务老师进行沟通</view>
<view class="tips">您反馈的信息我们会及时跟进感谢您的宝贵建议谢谢</view>
<view class="submit-btn" @click="submitClick()">提交</view> <view class="submit-btn" @click="submitClick()">提交</view>
</view> </view>
</template> </template>
@ -56,11 +58,13 @@
<style lang="less" scoped> <style lang="less" scoped>
.inp-box{ .inp-box{
width: 100%; width: 690rpx;
background: #fff; background: #fff;
padding: 24rpx; padding: 24rpx;
font-size: 28rpx; font-size: 28rpx;
position: relative; position: relative;
margin: 20px auto 0;
border-radius: 12rpx;
.fontnum{ .fontnum{
font-size: 24rpx; font-size: 24rpx;
color: #999; color: #999;
@ -69,6 +73,12 @@
bottom: 16rpx; bottom: 16rpx;
} }
} }
.tips{
padding: 0 32rpx;
font-size: 24rpx;
color: #FF0000;
margin: 12px 0;
}
.submit-btn{ .submit-btn{
width: 208rpx; width: 208rpx;
height: 80rpx; height: 80rpx;
@ -76,7 +86,7 @@
color: #fff; color: #fff;
text-align: center; text-align: center;
line-height: 80rpx; line-height: 80rpx;
border-radius: 4rpx; border-radius: 12rpx;
margin: 30rpx auto; margin: 60rpx auto;
} }
</style> </style>

Loading…
Cancel
Save