收藏学习课程

master
yujialong 2 years ago
parent 94b359091d
commit 014d19782d
  1. 4
      apis/modules/article.js
  2. 6
      config/request.js
  3. 21
      order/orderDetail/orderDetail.vue
  4. 18
      pages/study/study.vue
  5. 38
      team/article/article.vue

@ -20,3 +20,7 @@ export const schemeList = data => {
export const schemeFindById = id => {
return post('nakadai/nakadai/partner/schemeManagement/findById?id=' + id)
}
export const collectCourse = (id, state) => {
return post('nakadai/nakadai/partner/article/management/collectCourse?contentId=' + id + '&state=' + state)
}

@ -5,9 +5,9 @@
*/
export default {
// baseURL: 'https://huorantech.cn/',
// baseURL: 'http://192.168.31.117:9000/',
baseURL: 'http://121.37.12.51/',
baseURL: 'https://huorantech.cn/',
// baseURL: 'http://192.168.31.151:9000/',
// baseURL: 'http://121.37.12.51/',
headers: {
'Content-Type': 'application/json;charset=UTF-8'
},

@ -505,6 +505,23 @@
handleErr(val) {
if (val === this.err) this.err = ''
},
//
publicNotice() {
uni.requestSubscribeMessage({
tmplIds: ['8pDVfWYqh9c-nn3CeA1NXM58pmoyQXZzkVnRFKy_l2A'],
success: (res) => {
uni.navigateBack()
},
fail: function(err) {
uni.showToast({
title: err,
duration: 2000,
icon: 'error'
});
}
})
},
//
submit() {
const { form, courses } = this
@ -542,9 +559,7 @@
add(data).then(res => {
uni.hideLoading()
this.$util.sucMsg('添加成功')
setTimeout(() => {
uni.navigateBack()
}, 1500)
this.publicNotice()
}).catch(res => {
uni.hideLoading()
})

@ -27,10 +27,10 @@
<uni-icons class="icon" type="eye" size="22" color="#007FFF"></uni-icons>
{{ item.learnerNumber }}人学过
</view>
<!-- <view class="meta">
<uni-icons class="icon" type="star" size="22" color="#007eff"></uni-icons>
123
</view> -->
<view class="meta" @click.stop="collect(item)">
<uni-icons class="icon" :type="item.collectionStatus ? 'star-filled' : 'star'" size="22" color="#007eff"></uni-icons>
{{ item.collectionNumber }}
</view>
</view>
<view v-if="item.lastReading" class="last">上次阅读</view>
</view>
@ -51,7 +51,7 @@
</template>
<script>
import { partnerOperatingList, queryClassificationByType } from '@/apis/modules/article.js'
import { partnerOperatingList, queryClassificationByType, collectCourse } from '@/apis/modules/article.js'
export default {
data() {
return {
@ -168,6 +168,14 @@
this.articleNameSort = this.articleNameSort === 'desc' ? 'asc' : 'desc'
this.initList()
},
//
collect(item) {
const state = item.collectionStatus ? 0 : 1
collectCourse(item.id, state).then(({ data }) => {
item.collectionStatus = state
state ? ++item.collectionNumber : --item.collectionNumber
}).catch(e => {})
},
//
toDetail(item) {
this.$util.to(`/team/article/article?id=` + item.id)

@ -12,6 +12,9 @@
<uni-icons class="icon" type="eye" size="22" color="#007FFF"></uni-icons>
{{ form.totalBrowsing }}人学过
</view>
<!-- <view class="meta" @click.stop="collect">
<uni-icons class="icon" :type="form.collectionStatus ? 'star-filled' : 'star'" size="22" color="#007eff"></uni-icons>
</view> -->
<view v-if="form.labelNameList" class="labels">
<view v-for="(label, j) in form.labelNameList" :key="j" class="label">{{ label }}</view>
</view>
@ -32,7 +35,7 @@
</template>
<script>
import { findById } from '@/apis/modules/article.js'
import { findById, collectCourse } from '@/apis/modules/article.js'
import uParse from '@/components/gaoyia-parse/parse.vue'
export default {
data() {
@ -117,31 +120,14 @@
//
download(item) {
this.$util.to(`../send/send?url=${item.filePath}&copyWriting=${item.fileName}`)
// uni.showLoading({
// title: '...',
// mask: true
// })
// const url = item.filePath
// const that = this
// //
// uni.downloadFile({
// url,
// success: function(res) {
// console.log(444, res)
// uni.saveFile({
// tempFilePath: res.tempFilePath,
// success: function(res) {
// console.log(555, res)
// uni.hideLoading()
// that.$util.sucMsg('')
// }
// })
// },
// fail: function(err) {
// uni.hideLoading()
// }
// })
}
},
//
collect() {
const state = this.form.collectionStatus ? 0 : 1
collectCourse(this.form.id, state).then(({ data }) => {
this.form.collectionStatus = state
}).catch(e => {})
},
}
}
</script>

Loading…
Cancel
Save