Browse Source

合并yh

master
Loki 3 years ago
parent
commit
fab08ca1ad
  1. 6
      config/index.js
  2. 10
      pages.json
  3. 28
      pages/course/detail.vue
  4. 246
      pages/course/signIn.vue
  5. 5
      pages/home/index.vue
  6. 2
      pages/shop/GoodSearch/index.vue
  7. 1
      pages/study/editDabang.vue
  8. 5
      pages/user/User/index.vue
  9. 16
      pages/user/feedBack/index.vue

6
config/index.js

@ -1,8 +1,14 @@
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
// export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api'
<<<<<<< HEAD
// export const VUE_APP_API_URL = 'http://139.186.134.205:9006/api'
export const VUE_APP_API_URL = 'http://192.168.0.112:8088/api'
// export const VUE_APP_API_URL = 'https://www.cyjyyjy.com:8096/api'
=======
// export const VUE_APP_API_URL = 'http://192.168.0.112:8088/api'
// export const VUE_APP_API_URL = 'http://192.168.0.114:8088/api'
export const VUE_APP_API_URL = 'https://www.cyjyyjy.com/api'
>>>>>>> 1521d49cdb4b0c5490ac953afbe9910a0a287c45
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
// export const VUE_APP_API_URL = 'https://thapi.xinxintuan.co/api'
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';

10
pages.json

@ -74,7 +74,15 @@
{
"path": "pages/course/detail",
"style": {
"navigationBarTitleText": "课程详情"
"navigationBarTitleText": "课程详情",
"enablePullDownRefresh": true
}
},
{
"path": "pages/course/signIn",
"style": {
"navigationBarTitleText": "课程签到",
"enablePullDownRefresh": true
}
},
{

28
pages/course/detail.vue

@ -232,11 +232,11 @@
this.tabInitTop= res.top;
}
}).exec();
if(this.$yroute.query.teacherId){
if(this.$yroute.query.teacherId){ //
this.courseId = this.$yroute.query.courseId;
this.validCode = this.$yroute.query.validCode;
this.teacherId = this.$yroute.query.teacherId;
} else{
} else{ //
this.courseId = this.$yroute.query.id;
}
if(this.userInfo.uid){
@ -251,15 +251,20 @@
userInfo(){
return this.$store.getters["userInfo"]
},
// courseStartTime(){
// return this.detail.courseStartTime.split(' ')[0]
// },
// courseEndTime(){
// return this.detail.courseEndTime.split(' ')[0]
// },
},
mounted(){
},
onPullDownRefresh() {
this.getDetail()
},
onShareAppMessage: function(res) {
console.log(this.detail.id)
return {
title: this.detail.courseName,
imageUrl:this.detail.imageArr[0],
path: '/pages/course/detail?id=' + this.detail.id,
}
},
methods: {
getPhoneNumber: function(e) {
@ -340,7 +345,8 @@
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)
// console.log(this.times)
uni.stopPullDownRefresh()
})
},
@ -394,7 +400,9 @@
} else if(res.data.state == 1){
if(this.detail.courseType == 1){ //
this.showSignUp = true
this.getDetail()
setTimeout(()=>{
this.getDetail()
},1500)
} else{
uni.showToast({
title: '报名成功!'

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>

5
pages/home/index.vue

@ -6,9 +6,9 @@
搜索商品
</view>
<!-- #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" />
</view>
</view> -->
<!-- #endif -->
</view>
<view class="banner-box">
@ -305,6 +305,7 @@ export default {
that.$set(that, 'articleList', res.data.articleDtos)
uni.hideLoading()
that.setOpenShare()
uni.stopPullDownRefresh()
console.log(res.data.courseDtos)
})
},

2
pages/shop/GoodSearch/index.vue

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

1
pages/study/editDabang.vue

@ -92,6 +92,7 @@
},
}
}
</script>
<style lang="less" scoped>

5
pages/user/User/index.vue

@ -61,7 +61,7 @@
</view>
<view class="address-box acea-row row-between row-middle">
<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>
</view>
@ -239,10 +239,11 @@ export default {
return {
MyMenus: [],
switchActive: false,
isWeixin: false,
isWeixin: false
}
},
computed: mapGetters(['userInfo']),
watch: {},
methods: {
...mapMutations(['updateAuthorizationPage']),
startQr: function() {

16
pages/user/feedBack/index.vue

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

Loading…
Cancel
Save