Commit 097b1b1f by sunchao

Merge branch 'dev' of http://139.224.139.2:9091/chaosun/CFFP into dev

parents bbf0933d b30043d5
......@@ -12,9 +12,9 @@
{{loginTypeName}}
</view>
<form>
<view class="inputItem" v-if="loginType==='register'">
<!-- <view class="inputItem" v-if="loginType==='register'">
<input class="uni-input" name="invitationCode" placeholder="输入邀请码(非必填)" v-model="invitation_code"/>
</view>
</view> -->
<view class="inputItem" v-if="loginType!=='agentlogin'">
<input class="uni-input" name="mobileNo" placeholder="输入手机号" v-model="form.mobile" maxlength="11"/>
</view>
......
......@@ -10,6 +10,7 @@
</template>
<script>
import {fmdata} from '@/util/currentDate.js'
export default {
props:{
fields:{
......@@ -22,16 +23,18 @@
name: "time-picker",
data() {
return {
queryDate: `${new Date().getFullYear()}-${new Date().getMonth() + 1}`,
queryDate: fmdata(new Date(),'M'),
// queryDate: `${new Date().getFullYear()}-${new Date().getMonth() + 1}`,
maxDate: `${new Date().getFullYear()}-${new Date().getMonth() + 1}`,
};
},
mounted() {
if(this.fields == "month"){
this.queryDate = `${new Date().getFullYear()}-${new Date().getMonth() + 1}`
// this.queryDate = `${new Date().getFullYear()}-${new Date().getMonth() + 1}`
this.queryDate = fmdata(new Date(),'M');
}else if (this.fields == "year") {
this.queryDate = `${new Date().getFullYear()}`
console.log(this.queryDate, 'cak')
// this.queryDate = `${new Date().getFullYear()}`
this.queryDate = fmdata(new Date(),'Y');
}else {
return false
}
......
......@@ -136,6 +136,10 @@
}
}
}
},
"nvueLaunchMode" : "",
"uniStatistics" : {
"enable" : false
}
},
/* 快应用特有相关 */
......@@ -187,6 +191,14 @@
}
}
}
},
"uniStatistics" : {
"enable" : false
},
"optimization" : {
"treeShaking" : {
"enable" : true
}
}
},
"_spaceID" : "mp-68e17e23-e517-4839-8210-27480303cc51",
......
......@@ -22,8 +22,8 @@
<!-- v-show="!sliceshare" -->
<view class="courseBannerBox" v-if="!sliceshare">
<video v-if="isRenderVideo" id="myVideo" :src="courseInfo.filePathOss" :initial-time="viewTime"
object-fit="contain" class="videoBox" :poster="courseInfo.fileFirstImage"
:title="courseInfo.fileTitle" @play="playVideo" @pause="pause" @timeupdate="timeupdate" style="width: 100vw;height: 320rpx;"></video>
object-fit="contain" class="videoBox" :poster="courseInfo.fileFirstImage" :title="courseInfo.fileTitle"
@play="playVideo" @pause="pause" @timeupdate="timeupdate" style="width: 100vw;height: 320rpx;"></video>
</view>
<!-- 课程详情图 -->
......@@ -39,6 +39,17 @@
</view>
<text>唤醒App</text>
</view>
<!-- v-if="isWeixin == true" -->
<!-- <view class="awakenApp">
<wx-open-launch-app id="launch-btn" appid="wxb591d0034cdcf0cd" extinfo="extinfo">
<script type="text/wxtag-template">
<button class="btn" >打开/下载App</button>
</script>
</wx-open-launch-app>
</view> -->
<strong>
</strong>
</view>
</view>
<view class="dataBox">
......@@ -139,6 +150,7 @@
},
data() {
return {
isWeixin: false,
isRenderVideo: false,
fileId: null,
lecturerId: null,
......@@ -170,9 +182,9 @@
shareCode: null,
sharelogin: false,
startTime: '',
newCourseInfo:{},
isPauseFlag:true,
CONFIG : {
newCourseInfo: {},
isPauseFlag: true,
CONFIG: {
android: 'https://a.app.qq.com/o/simple.jsp?pkgname=com.xiaoxiao.shihaoo',
ios: 'https://apps.apple.com/cn/app/%E6%98%AF%E5%A5%BD/id1457958161',
scheme: 'com.qdxxzy.user://'
......@@ -188,9 +200,9 @@
this.userId = val
uni.setStorageSync('cffp_userId', this.userId);
this.courseDetail();
setTimeout(()=>{
setTimeout(() => {
this.getuserRead(this.courseInfo.status)
},500)
}, 500)
} else {
this.sharelogin = false
}
......@@ -250,7 +262,6 @@
jumpapp() {
let platform = uni.getSystemInfoSync().platform
if (platform == 'ios') {
// var loadDateTime = new Date();
window.location.href = "https://mcffp.anjibao.cn/app/";
// window.setTimeout(function() { //如果没有安装app,便会执行setTimeout跳转下载页
// var timeOutDateTime = new Date();
......@@ -262,28 +273,16 @@
// }, 500);
} else if (platform == 'android') {
window.location.href = "cffpapp://";
// window.open('cffpapp://');
// var loadDateTime = new Date();
// window.setTimeout(function() { //如果没有安装app,便会执行setTimeout跳转下载页
// var timeOutDateTime = new Date();
// if (timeOutDateTime - loadDateTime < 500) {
// } else {
// // window.location = "https://mdev.anjibao.cn/cffp/app.ipa"; //ios下载地址
// window.location = "www.baidu.com"; //ios下载地址
// }
// }, 500);
// window.location.href = "cffpapp://";
}
},
goBack() {
let back = getCurrentPages();
if(back && back.length>1) {
if (back && back.length > 1) {
uni.navigateBack({
delta: 1
});
}else{
} else {
history.back();
}
},
......@@ -413,7 +412,7 @@
}
if (this.courseInfo.status == 2) {
this.findVideoPlayback();
}else{
} else {
this.isRenderVideo = true;
}
}
......@@ -450,16 +449,16 @@
});
} else {
this.videoContext.pause();
if(this.fileId != item.fileId){
if (this.fileId != item.fileId) {
// 当点击的课程和当前播放的课程不一致时,执行此方法
uni.showLoading({
title: '加载中'
});
this.newCourseInfo = {
fileId:item.fileId,
packFileId:item.packFileId,
fileId: item.fileId,
packFileId: item.packFileId,
}
if(this.isPauseFlag){
if (this.isPauseFlag) {
this.pause()
}
}
......@@ -478,8 +477,8 @@
viewTime: Math.floor(this.viewTime),
playbackStatus: this.viewTime >= this.totalTime ? '2' : '1'
}
return new Promise((resolve,reject)=>{
if(this.viewTime == 0){
return new Promise((resolve, reject) => {
if (this.viewTime == 0) {
resolve('success');
return;
}
......@@ -488,10 +487,10 @@
this.playbackId = res['data']['id'];
console.log('save已经执行完毕');
resolve('success');
}else{
} else {
reject('fail')
}
}).catch((err)=>{
}).catch((err) => {
reject('fail')
})
})
......@@ -509,7 +508,7 @@
api.findVideoPlayback(param).then(res => {
if (res['success']) {
this.videoPlaybackInfo = res['data'];
console.log('查询视频播放轨迹结果=====',this.videoPlaybackInfo)
console.log('查询视频播放轨迹结果=====', this.videoPlaybackInfo)
this.viewTime = this.videoPlaybackInfo.viewTime
this.viewTime = this.videoPlaybackInfo.viewTime ? this.videoPlaybackInfo.viewTime : 0;
this.totalTime = this.videoPlaybackInfo.totalTime ? this.videoPlaybackInfo.totalTime : 0;
......@@ -518,7 +517,7 @@
// 跳转到指定位置
this.videoContext.seek(this.viewTime);
uni.hideLoading();
}else{
} else {
this.isRenderVideo = true;
this.totalTime = this.viewTime = 0;
// 跳转到指定位置
......@@ -529,9 +528,9 @@
},
// 点击播放
playVideo(e) {
console.log('playVideo',this.totalTime,this.viewTime)
console.log('playVideo', this.totalTime, this.viewTime)
this.isPauseFlag = false;
if(this.viewTime>=this.totalTime){
if (this.viewTime >= this.totalTime) {
this.viewTime = 0;
this.videoContext.seek(this.viewTime);
}
......@@ -547,14 +546,14 @@
},
// // 暂停播放
async pause() {
if (this.courseInfo.status != 1){
if (this.courseInfo.status != 1) {
console.log('pause')
this.isPauseFlag = true;
if (this.timer) {
clearInterval(this.timer)
}
const result = await this.saveVideoPlayback()
if(result=='success' && this.newCourseInfo.fileId){
if (result == 'success' && this.newCourseInfo.fileId) {
console.log('新的课程要进行赋值查询了')
this.fileId = this.newCourseInfo.fileId;
this.courseInfo.packFileId = this.newCourseInfo.packFileId;
......@@ -615,6 +614,27 @@
var url = window.location.href.split('#')[0]
hshare(data, url)
},
// 唤醒app 测试
JsApiTicketApi() {
let WxConfigRequestVO = {
url: window.location.href.split('#')[0],
systemType: '1'
}
api.Wxshare(WxConfigRequestVO).then(res => {
console.log(res, '第三步');
jWeixin.config({
debug: false, //调试的时候需要 在app上回弹出errmg:config ok 的时候就证明没问题了 这时候就可以改为false
appId: res.data.appId, //appid
timestamp: res.data.timestamp, //时间戳
nonceStr: res.data.nonceStr, //随机串
signature: res.data.signature, //签名
jsApiList: res.data.jsApiList //必填 是下面需要用到的方法集合
})
if (callback) {
callback()
}
})
},
},
......@@ -624,6 +644,8 @@
if (option.coursesharing) {
this.userId = ''
this.coursesharing = option.coursesharing
// this.isWeixin = true; // 是微信端
// this.JsApiTicketApi();
this.serialsNo = option.serialsNo
this.shareCode = option.shareCode
this.shareUserId = option.shareUserId
......@@ -636,7 +658,6 @@
uni.setStorageSync('h5_coursesharing', this.coursesharing);
this.getshareData()
}
let dataForm = uni.getStorageSync('userinfodataForm')
this.realName = dataForm.realName
// this.switchTab(1);
......@@ -645,11 +666,36 @@
this.switchTab(1);
this.loginType = uni.getStorageSync('loginType')
},
// mounted() {
// let _this = this;
// var btn = document.getElementById('launch-btn');
// alert(btn)
// btn.addEventListener('launch', function(e) {
// alert('success')
// console.log('success');
// });
// btn.addEventListener('error', function(e) {
// console.log('fail', e.detail);
// alert('fail')
// uni.showModal({
// title: '系统消息',
// content: '您的手机未找到当前应用,是否去下载?',
// success: function(res) {
// if (res.confirm) {
// window.location.href = _this.versionsData.versionResources
// console.log('用户点击确定');
// } else if (res.cancel) {
// console.log('用户点击取消');
// }
// }
// });
// });
// },
onReady() {
this.videoContext = uni.createVideoContext('myVideo');
},
onUnload() {
if (this.courseInfo.status != 1 && this.viewTime!=0) {
if (this.courseInfo.status != 1 && this.viewTime != 0) {
this.videoContext.pause();
this.saveVideoPlayback();
if (this.timer) {
......
......@@ -199,7 +199,7 @@
padding: 20rpx;
.grey{
min-width: 100rpx;
font-size: 24rpx;
font-size: 22rpx;
color: #CECECE;
}
}
......
......@@ -66,11 +66,12 @@
</template>
<script>
import {fmdata} from '@/util/currentDate.js'
import api from '../../api/api';
export default{
data(){
return {
fortuneDate:`${new Date().getFullYear()}-${new Date().getMonth() + 1}-${new Date().getDate()}`,
fortuneDate: fmdata(new Date(),'D'),
maxDate:`${new Date().getFullYear()}-${new Date().getMonth() + 1}`,
navList:[{name:'日积分',timeFlag:'D'},{name:'月积分',timeFlag:'M'},{name:'年积分',timeFlag:'Y'}],
timeFlag:'D',
......@@ -92,14 +93,15 @@
selectNav(navItem){
this.timeFlag = navItem.timeFlag;
if(this.timeFlag == 'D'){
this.fortuneDate = `${new Date().getFullYear()}-${new Date().getMonth() + 1}-${new Date().getDate()}`
this.fortuneDate = fmdata(new Date(),'D');
}
if(this.timeFlag == 'M'){
this.fortuneDate = `${new Date().getFullYear()}-${new Date().getMonth() + 1}`
this.fortuneDate = fmdata(new Date(),'M');
this.fields = 'month'
}
if(this.timeFlag == 'Y'){
this.fortuneDate=`${new Date().getFullYear()}`
this.fortuneDate = fmdata(new Date(),'Y');
// this.fortuneDate=`${new Date().getFullYear()}`
this.fields = 'year'
}
this.findByUserIdForFortuneStatistic();
......
......@@ -43,7 +43,10 @@
<view class="shareOrderInfoItem" v-for="item in userShareCourses" :key="item.fileId">
<view class="timeBox">{{item.shareDate}}</view>
<view class="courseInfoContent">
<course-item :thumbnailPath="item.displayImage" :title="item.fileTitle" :summaryBox="item.fileSynopsis" :dataList="{coursePrice:item.coursePrice,salesNumber:item.salesNumber}" :fileLecturerId="item.fileLecturerId"></course-item>
<course-item :thumbnailPath="item.displayImage" :title="item.fileTitle"
:summaryBox="item.fileSynopsis"
:dataList="{coursePrice:item.coursePrice,salesNumber:item.salesNumber}"
:fileLecturerId="item.fileLecturerId"></course-item>
</view>
<view class="countsContent">
<view @click="goDetail(item.fileId,1)">
......@@ -71,34 +74,38 @@
<script>
import api from "@/api/api";
import courseItem from "@/components/courseItem/courseItem.vue";
import {
fmdata
} from '@/util/currentDate.js'
export default {
components:{
components: {
courseItem
},
data() {
return {
queryDate:`${new Date().getFullYear()}-${new Date().getMonth() + 1}`,
maxDate:`${new Date().getFullYear()}-${new Date().getMonth() + 1}`,
userId:uni.getStorageSync('cffp_userId'),
queryDate: fmdata(new Date(), 'M'),
// queryDate:`${new Date().getFullYear()}-${new Date().getMonth() + 1}`,
maxDate: `${new Date().getFullYear()}-${new Date().getMonth() + 1}`,
userId: uni.getStorageSync('cffp_userId'),
coursesCountInfos: {
shareFrequencyMonth:0,
integralMonth:0,
shareSectionMonth:0,
shareFrequencyCount:0,
integralCount:0,
shareSectionCount:0
shareFrequencyMonth: 0,
integralMonth: 0,
shareSectionMonth: 0,
shareFrequencyCount: 0,
integralCount: 0,
shareSectionCount: 0
},
userShareCourses:[]
userShareCourses: []
}
},
methods: {
goBack(){
goBack() {
let back = getCurrentPages();
if(back && back.length>1) {
if (back && back.length > 1) {
uni.navigateBack({
delta: 1
});
}else{
} else {
history.back();
}
},
......@@ -107,58 +114,58 @@
this.userShareCount();
this.userShareQuery();
},
userShareCount(){
userShareCount() {
const params = {
userId:this.userId,
queryDate:this.queryDate
userId: this.userId,
queryDate: this.queryDate
}
api.userShareCount(params).then(res=>{
api.userShareCount(params).then(res => {
console.log(res)
if(res['success']){
if (res['success']) {
this.coursesCountInfos = res['data'] ? res['data'] : this.coursesCountInfos;
Object.keys(this.coursesCountInfos).forEach((item)=>{
if(!this.coursesCountInfos[item]){
Object.keys(this.coursesCountInfos).forEach((item) => {
if (!this.coursesCountInfos[item]) {
this.coursesCountInfos[item] = 0;
}
})
}else{
} else {
this.coursesCountInfos = {
shareFrequencyMonth:0,
integralMonth:0,
shareSectionMonth:0,
shareFrequencyCount:0,
integralCount:0,
shareSectionCount:0
shareFrequencyMonth: 0,
integralMonth: 0,
shareSectionMonth: 0,
shareFrequencyCount: 0,
integralCount: 0,
shareSectionCount: 0
};
console.log(this.coursesCountInfos)
}
})
},
userShareQuery(){
userShareQuery() {
const params = {
userId:this.userId,
queryDate:this.queryDate
userId: this.userId,
queryDate: this.queryDate
}
console.log(this.userShareCourses)
api.userShareQuery(params).then(res=>{
api.userShareQuery(params).then(res => {
console.log(res)
if(res['success']){
if (res['success']) {
this.userShareCourses = res['data']['userShareCourses'];
}else{
} else {
this.userShareCourses = [];
}
})
},
// 查看详情
goDetail(val,type){
goDetail(val, type) {
uni.navigateTo({
url:`/pages/commonDetail/commonDetail?fileId=${val}&type=${type}`
url: `/pages/commonDetail/commonDetail?fileId=${val}&type=${type}`
})
},
// 查看积分
viewIntegral(){
viewIntegral() {
uni.navigateTo({
url:`/pages/myPoints/myPoints`
url: `/pages/myPoints/myPoints`
})
}
},
......@@ -173,29 +180,33 @@
</script>
<style lang="scss">
.container{
.container {
height: 100%;
.timeSelectContent{
.timeSelectContent {
background-color: #fff;
padding: 20rpx 0;
display: flex;
justify-content: center;
align-items: baseline;
color: #333;
.xiajiantou{
.xiajiantou {
color: #999;
font-size: 24rpx;
transform: rotate(90deg);
margin-left: 8rpx;
}
}
.shareStatisticalContent{
.shareStatisticalContent {
background-color: #fff;
margin: 10rpx 20rpx;
padding: 20rpx 14rpx;
display: flex;
flex-wrap: wrap;
.statisticItem{
.statisticItem {
flex: 1;
min-width: 33%;
display: flex;
......@@ -203,29 +214,35 @@
align-items: center;
border-right: 1px solid #F4F4F4;
margin-bottom: 10rpx;
&:nth-of-type(3n){
&:nth-of-type(3n) {
border-right: none;
}
text{
text {
color: #333;
font-size: 36rpx;
&:last-child{
&:last-child {
color: #666;
font-size: 28rpx;
}
&.colorText{
&.colorText {
color: #F15A1F;
}
}
}
}
.shareDetailContent{
h3{
.shareDetailContent {
h3 {
color: #333;
font-size: 36rpx;
position: relative;
margin: 10rpx 0 10rpx 58rpx;
&::before{
&::before {
content: '';
display: block;
position: absolute;
......@@ -237,27 +254,33 @@
background-color: #FA882F;
}
}
.shareOrderInfoItem{
.shareOrderInfoItem {
margin: 0 20rpx;
.timeBox{
.timeBox {
font-size: 28rpx;
color: #999;
margin: 10rpx 0 10rpx 50rpx;
}
.countsContent{
.countsContent {
background-color: #fff;
display: flex;
border-bottom-left-radius: 20rpx;
border-bottom-right-radius: 20rpx;
padding: 10rpx 10rpx 20rpx 10rpx;
view{
view {
flex: 1;
font-size: 24rpx;
display: flex;
align-items: center;
text{
text {
color: #666;
&:last-child{
&:last-child {
margin-left: 10rpx;
color: #0A2F99;
font-weight: bold;
......
......@@ -79,13 +79,15 @@
<script>
import api from "@/api/api";
import courseItem from "@/components/courseItem/courseItem.vue";
import {fmdata} from '@/util/currentDate.js'
export default {
components:{
courseItem
},
data() {
return {
queryDate:`${new Date().getFullYear()}-${new Date().getMonth() + 1}`,
queryDate: fmdata(new Date(),'M'),
// queryDate:`${new Date().getFullYear()}-${new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1): new Date().getMonth() + 1}`,
maxDate:`${new Date().getFullYear()}-${new Date().getMonth() + 1}`,
userId: uni.getStorageSync('cffp_userId'),
coursesCountInfos:{},
......
export function fmdata(val, filets) {
var date = new Date(Number(val)); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
var Y = date.getFullYear();
var M = (date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1);
// var D = date.getDate() + " ";
var D = (date.getDate() < 10 ? "0" + (date.getDate()) : date.getDate()) + " ";
var h = date.getHours() + ":";
var m = date.getMinutes() + ":";
var s = (date.getSeconds() < 10 ? "0" + (date.getSeconds()) : date.getSeconds());
if (filets == 'D') {
return Y + "-" + M + "-" + D;
}
if (filets == 'M') {
return Y + "-" + M;
}
if (filets == 'Y') {
return Y;
}
// return Y + M + D + h + m + s;
}
export function fmdataTime(val) {
var date = new Date(Number(val)); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
var Y = date.getFullYear() + "-";
var M = (date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1) + "-";
// var D = date.getDate() + " ";
var D = (date.getDate() < 10 ? "0" + (date.getDate()) : date.getDate()) + " ";
var h = date.getHours() + ":";
// var m = date.getMinutes() + ":";
var m = (date.getMinutes() < 10 ? "0" + (date.getMinutes()) : date.getMinutes()) + ":";
var s = (date.getSeconds() < 10 ? "0" + (date.getSeconds()) : date.getSeconds());
return h + m + s;
}
// format(date, fmt) {
// let ret;
// const opt = {
// "Y+": date.getFullYear().toString(), // 年
// "m+": (date.getMonth() + 1).toString(), // 月
// "d+": date.getDate().toString(), // 日
// "H+": date.getHours().toString(), // 时
// "M+": date.getMinutes().toString(), // 分
// "S+": date.getSeconds().toString() // 秒
// // 有其他格式化字符需求可以继续添加,必须转化成字符串
// };
// for (let k in opt) {
// ret = new RegExp("(" + k + ")").exec(fmt);
// if (ret) {
// fmt = fmt.replace(
// ret[1],
// ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0")
// );
// }
// }
// // str=str.Substring(0,i);
// return fmt;
// },
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment