|
@@ -1,14 +1,12 @@
|
|
<template>
|
|
<template>
|
|
<view class="teaching_case">
|
|
<view class="teaching_case">
|
|
- <msgPop :itemlist="animationDataArr" :goNum="1"></msgPop>
|
|
|
|
-
|
|
|
|
- <view class="cont" @click="gotoWeb" v-for="(item, index) in acList" :key="index"
|
|
|
|
- :data-kid="item.href">
|
|
|
|
- <image class="star" :src="collArr.includes(item.cid) ? pic_coll2 : pic_coll " @click.stop="coll" :data-e="item"
|
|
|
|
- mode="aspectFill"></image>
|
|
|
|
|
|
+
|
|
|
|
+ <view class="cont" @click="gotoWeb" v-for="(item, index) in acList" :key="index" :data-kid="item.href">
|
|
|
|
+ <image class="star" :src="collArr.includes(item.cid) ? pic_coll2 : pic_coll " @click.stop="coll"
|
|
|
|
+ :data-e="item" mode="aspectFill"></image>
|
|
<image class="img" :src="item.img" mode="aspectFill" />
|
|
<image class="img" :src="item.img" mode="aspectFill" />
|
|
<view class="tit btn-font">{{ item.ctit }}</view>
|
|
<view class="tit btn-font">{{ item.ctit }}</view>
|
|
- <view class="teacher fz-font">{{ item.school }}</view>
|
|
|
|
|
|
+ <!-- <view class="teacher fz-font">{{ item.school }}</view> -->
|
|
<view class="mon" v-if="indexId">
|
|
<view class="mon" v-if="indexId">
|
|
¥<text class="cost"></text>
|
|
¥<text class="cost"></text>
|
|
</view>
|
|
</view>
|
|
@@ -36,7 +34,10 @@
|
|
return {
|
|
return {
|
|
// 收藏列表
|
|
// 收藏列表
|
|
collArr: [],
|
|
collArr: [],
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ // 节流阀
|
|
|
|
+ stopTimer: 0,
|
|
|
|
+
|
|
timer: null,
|
|
timer: null,
|
|
animationDataArr: [],
|
|
animationDataArr: [],
|
|
// 收藏星星
|
|
// 收藏星星
|
|
@@ -48,12 +49,25 @@
|
|
// 收藏事件
|
|
// 收藏事件
|
|
coll(event) {
|
|
coll(event) {
|
|
const value = this.$store.state.user.openid;
|
|
const value = this.$store.state.user.openid;
|
|
- if(!value){
|
|
|
|
- uni.showToast({title: '未登录,请登录',icon: 'none'})
|
|
|
|
- setTimeout(this.goLog,1000)
|
|
|
|
|
|
+ if (!value) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '未登录,请登录',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ setTimeout(this.goLog, 1000)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (this.stopTimer) return uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: '点击过快'
|
|
|
|
+ })
|
|
|
|
+ this.stopTimer = 1
|
|
|
|
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ this.stopTimer=0
|
|
|
|
+ },500)
|
|
|
|
+
|
|
// return console.log(event);
|
|
// return console.log(event);
|
|
let cId = event.currentTarget.dataset.e.cid
|
|
let cId = event.currentTarget.dataset.e.cid
|
|
|
|
|
|
@@ -75,27 +89,35 @@
|
|
// iscoll为true表示已经收藏过,执行删除 为true则收藏
|
|
// iscoll为true表示已经收藏过,执行删除 为true则收藏
|
|
if (iscoll) {
|
|
if (iscoll) {
|
|
console.log('执行删除');
|
|
console.log('执行删除');
|
|
- this.animationDataArr.push({
|
|
|
|
|
|
+ // this.animationDataArr.push({
|
|
|
|
+ // collAoff: 0
|
|
|
|
+ // })
|
|
|
|
+ this.$store.dispatch('asyncUpdatemsg', {
|
|
collAoff: 0
|
|
collAoff: 0
|
|
})
|
|
})
|
|
this.$request('/deleteOperator', 'POST', data).then(res => {
|
|
this.$request('/deleteOperator', 'POST', data).then(res => {
|
|
this.getdata()
|
|
this.getdata()
|
|
- setTimeout(()=>{
|
|
|
|
- this.animationDataArr.shift()
|
|
|
|
- console.log(this.animationDataArr);
|
|
|
|
- },1500)
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ // this.animationDataArr.shift()
|
|
|
|
+ // console.log(this.animationDataArr);
|
|
|
|
+ this.$store.dispatch('asyncDelMsg')
|
|
|
|
+ }, 1500)
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
console.log('执行添加');
|
|
console.log('执行添加');
|
|
- this.animationDataArr.push({
|
|
|
|
|
|
+ // this.animationDataArr.push({
|
|
|
|
+ // collAoff: 1
|
|
|
|
+ // })
|
|
|
|
+ this.$store.dispatch('asyncUpdatemsg', {
|
|
collAoff: 1
|
|
collAoff: 1
|
|
})
|
|
})
|
|
this.$request('/insertOperator', 'POST', data).then(res => {
|
|
this.$request('/insertOperator', 'POST', data).then(res => {
|
|
this.getdata()
|
|
this.getdata()
|
|
- setTimeout(()=>{
|
|
|
|
- this.animationDataArr.shift()
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ // this.animationDataArr.shift()
|
|
|
|
+ this.$store.dispatch('asyncDelMsg')
|
|
// console.log(this.animationDataArr);
|
|
// console.log(this.animationDataArr);
|
|
- },1500)
|
|
|
|
|
|
+ }, 1500)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -111,12 +133,15 @@
|
|
// 查看课程内容
|
|
// 查看课程内容
|
|
gotoWeb(e) {
|
|
gotoWeb(e) {
|
|
const value = this.$store.state.user.openid;
|
|
const value = this.$store.state.user.openid;
|
|
- if(!value){
|
|
|
|
- uni.showToast({title: '未登录,请登录',icon: 'none'})
|
|
|
|
- setTimeout(this.goLog,1000)
|
|
|
|
|
|
+ if (!value) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '未登录,请登录',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ setTimeout(this.goLog, 1000)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
// return console.log('aaaaaa', e.currentTarget.dataset);
|
|
// return console.log('aaaaaa', e.currentTarget.dataset);
|
|
let acid = e.currentTarget.dataset.kid
|
|
let acid = e.currentTarget.dataset.kid
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
@@ -127,9 +152,9 @@
|
|
// 获取课程收藏事件
|
|
// 获取课程收藏事件
|
|
getdata() {
|
|
getdata() {
|
|
const value = this.$store.state.user.openid;
|
|
const value = this.$store.state.user.openid;
|
|
- if(!value) return this.collArr = []
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ if (!value) return this.collArr = []
|
|
|
|
+
|
|
|
|
+
|
|
// 触发收藏事件
|
|
// 触发收藏事件
|
|
// console.log('触发收藏事件');
|
|
// console.log('触发收藏事件');
|
|
let data = {
|
|
let data = {
|