Commit 6cd51240 by sunchao

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

parents 250935c6 1d6eba4e
...@@ -64,8 +64,10 @@ ...@@ -64,8 +64,10 @@
<!-- </view> --> <!-- </view> -->
</view> </view>
<view class="d-td" v-if="item.levelCode == 'A1'">{{ item.levelName }}</view> <view class="d-td" >
<view class="d-td" v-else></view> <text v-if="item.itemType == '2'">{{ item.levelName }}</text>
<text v-else></text>
</view>
<view class="d-td" style="padding-right: 10rpx;">{{ item.count }}</view> <view class="d-td" style="padding-right: 10rpx;">{{ item.count }}</view>
</view> </view>
</block> </block>
...@@ -184,6 +186,7 @@ ...@@ -184,6 +186,7 @@
} }
}, },
checkLazy(id) { checkLazy(id) {
console.log(id, 1515515)
return ~this.lazyList.findIndex(o => o === id); return ~this.lazyList.findIndex(o => o === id);
}, },
checkOpen(id) { checkOpen(id) {
...@@ -200,6 +203,7 @@ ...@@ -200,6 +203,7 @@
this.openList = list; this.openList = list;
}, },
async open(item, index) { async open(item, index) {
console.log(item, 581515)
if(index == 0 || item.itemType == '2'){ if(index == 0 || item.itemType == '2'){
return false return false
} }
...@@ -220,7 +224,6 @@ ...@@ -220,7 +224,6 @@
icon: 'none' icon: 'none'
}); });
} }
console.log(res, 7744)
res.data.list.forEach((x) => { res.data.list.forEach((x) => {
this.$set(x, 'hasChildren', true) this.$set(x, 'hasChildren', true)
this.$set(x, 'children', []) this.$set(x, 'children', [])
...@@ -245,7 +248,6 @@ ...@@ -245,7 +248,6 @@
} }
}, },
setTreeNode(list = [], id, children = []) { setTreeNode(list = [], id, children = []) {
console.log(children, '值传过来了吗?')
const o = list.find(o => { const o = list.find(o => {
if (o.id === id) { if (o.id === id) {
o.children = children; o.children = children;
......
...@@ -164,13 +164,14 @@ ...@@ -164,13 +164,14 @@
serialsNo: null, serialsNo: null,
shareCode: null, shareCode: null,
sharelogin: false, sharelogin: false,
startTime:'', startTime: '',
}; };
}, },
methods: { methods: {
close(val) { close(val) {
if (val) { if (val) {
this.startTime = Date.parse(new Date()) / 1000; this.startTime = Date.parse(new Date()) / 1000;
localStorage.setItem('h5_startTime', this.startTime)
this.sharelogin = false this.sharelogin = false
this.userId = val this.userId = val
// uni.setStorageSync('cffp_userId', this.userId); // uni.setStorageSync('cffp_userId', this.userId);
...@@ -222,8 +223,9 @@ ...@@ -222,8 +223,9 @@
reinvite() { reinvite() {
const shareCode = nanoid() + this.userId const shareCode = nanoid() + this.userId
let dataWXform = { let dataWXform = {
href:"https://mdev.zuihuibi.cn/cffp/pages/courseDetail/courseDetail?fileId=" + this.fileId + href: "https://mdev.zuihuibi.cn/cffp/pages/courseDetail/courseDetail?fileId=" + this.fileId +
'&coursesharing=1' + '&serialsNo=' + nanoid() + '&shareCode=' + shareCode+'&shareUserId=' + this.userId, '&coursesharing=1' + '&serialsNo=' + nanoid() + '&shareCode=' + shareCode + '&shareUserId=' +
this.userId,
title: this.courseInfo.fileTitle, title: this.courseInfo.fileTitle,
summary: `加入我们开启学习之旅`, summary: `加入我们开启学习之旅`,
imageUrl: this.courseInfo.displayImage, imageUrl: this.courseInfo.displayImage,
...@@ -250,28 +252,33 @@ ...@@ -250,28 +252,33 @@
}) })
} else { } else {
// let h5userId = uni.getStorageSync('h5_userId') // let h5userId = uni.getStorageSync('h5_userId')
let h5userId = localStorage.getItem('h5_userId') if (this.coursesharing == '1') {
if (this.coursesharing == '1' && h5userId == '') { this.h5jump()
this.sharelogin = true
} else { } else {
this.jumppurchase() this.jumppurchase()
} }
} }
}, },
jumppurchase() { h5jump() {
if(localStorage.getItem('h5_userId')){
let h5userId = localStorage.getItem('h5_userId') let h5userId = localStorage.getItem('h5_userId')
if (h5userId == '') {
this.sharelogin = true
} else {
this.jumppurchase()
} }
},
jumppurchase() {
const param = { const param = {
productType: '1', productType: '1',
productId: this.courseInfo.fileId, productId: this.courseInfo.fileId,
userId: this.coursesharing == 1? h5userId : uni.getStorageSync('cffp_userId'), userId: this.coursesharing == 1 ? localStorage.getItem('h5_userId') : uni.getStorageSync('cffp_userId'),
shareUserId: this.shareUserId, shareUserId: this.shareUserId,
shareReadId: this.shareReadId, shareReadId: this.shareReadId,
shareCode: this.shareCode, shareCode: this.shareCode,
dataSource: this.coursesharing == 1 ? '2': this.dataSource dataSource: this.coursesharing == 1 ? '2' : this.dataSource
} }
api.saveOrder(param).then(res => { api.saveOrder(param).then(res => {
console.log(res, 545415)
if (res['success']) { if (res['success']) {
this.orderId = res['data']['id']; this.orderId = res['data']['id'];
uni.navigateTo({ uni.navigateTo({
...@@ -302,7 +309,6 @@ ...@@ -302,7 +309,6 @@
api.lecturerQuery({ api.lecturerQuery({
id: this.lecturerId id: this.lecturerId
}).then(res => { }).then(res => {
console.log('讲师信息', res);
if (res['success']) { if (res['success']) {
this.lecturerInfo = res['data']['lecturerInfos'][0]; this.lecturerInfo = res['data']['lecturerInfos'][0];
} else { } else {
...@@ -316,13 +322,13 @@ ...@@ -316,13 +322,13 @@
}, },
// 课程详情页面 // 课程详情页面
courseDetail() { courseDetail() {
console.log(this.fileId, 545545)
api.courseDetail({ api.courseDetail({
fileId: this.fileId, fileId: this.fileId,
userId: this.coursesharing == 1? uni.getStorageSync('h5_userId') : uni.getStorageSync('cffp_userId'), userId: this.coursesharing == '1' ? uni.getStorageSync('h5_userId') : uni.getStorageSync(
'cffp_userId'),
packFileId: this.courseInfo.packFileId packFileId: this.courseInfo.packFileId
}).then(res => { }).then(res => {
console.log(res, 22554) console.log('详情页面--res', res, 1251255)
if (res['success']) { if (res['success']) {
this.courseInfo = res['data']['data']; this.courseInfo = res['data']['data'];
this.lecturerId = res['data']['data']['fileLecturerId']; this.lecturerId = res['data']['data']['fileLecturerId'];
...@@ -466,7 +472,7 @@ ...@@ -466,7 +472,7 @@
api.userRead(UserReadRequestVO).then(res => { api.userRead(UserReadRequestVO).then(res => {
if (res['success']) { if (res['success']) {
this.shareReadId = res.data.id this.shareReadId = res.data.id
if(uni.getStorageSync('h5_userId')){ if (uni.getStorageSync('h5_userId')) {
this.jumppurchase() this.jumppurchase()
} }
...@@ -486,6 +492,7 @@ ...@@ -486,6 +492,7 @@
// }, // },
}, },
onLoad(option) { onLoad(option) {
console.log(option, 1541515)
this.fileId = option.fileId; this.fileId = option.fileId;
if (option.coursesharing) { if (option.coursesharing) {
this.userId = '' this.userId = ''
...@@ -495,7 +502,8 @@ ...@@ -495,7 +502,8 @@
this.shareUserId = option.shareUserId this.shareUserId = option.shareUserId
this.getuserRead() this.getuserRead()
let endTime = Date.parse(new Date()) / 1000; let endTime = Date.parse(new Date()) / 1000;
if((endTime - startTime) > 3600 * 24) { let startTime = localStorage.getItem('h5_startTime')
if (endTime - startTime > 3600 * 24) {
this.userId = '' this.userId = ''
} }
uni.setStorageSync('h5_coursesharing', this.coursesharing); uni.setStorageSync('h5_coursesharing', this.coursesharing);
...@@ -506,7 +514,7 @@ ...@@ -506,7 +514,7 @@
// this.switchTab(1); // this.switchTab(1);
}, },
onShow() { onShow() {
if(uni.getStorageSync('h5_coursesharing')){ if (uni.getStorageSync('h5_coursesharing')) {
this.coursesharing = uni.getStorageSync('h5_coursesharing') this.coursesharing = uni.getStorageSync('h5_coursesharing')
} }
this.switchTab(1); this.switchTab(1);
...@@ -605,6 +613,7 @@ ...@@ -605,6 +613,7 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-right: 30rpx; margin-right: 30rpx;
.image { .image {
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;
......
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
isDeduction:false, isDeduction:false,
userId: uni.getStorageSync('cffp_userId'), userId: uni.getStorageSync('cffp_userId'),
intergralInfo:{}, intergralInfo:{},
orderId:'1', orderId:'',
paymentBtnDisabled:false, paymentBtnDisabled:false,
action:'', action:'',
params:'', params:'',
......
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