收藏学习课程

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 => { export const schemeFindById = id => {
return post('nakadai/nakadai/partner/schemeManagement/findById?id=' + 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 { export default {
// baseURL: 'https://huorantech.cn/', baseURL: 'https://huorantech.cn/',
// baseURL: 'http://192.168.31.117:9000/', // baseURL: 'http://192.168.31.151:9000/',
baseURL: 'http://121.37.12.51/', // baseURL: 'http://121.37.12.51/',
headers: { headers: {
'Content-Type': 'application/json;charset=UTF-8' 'Content-Type': 'application/json;charset=UTF-8'
}, },

@ -505,6 +505,23 @@
handleErr(val) { handleErr(val) {
if (val === this.err) this.err = '' 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() { submit() {
const { form, courses } = this const { form, courses } = this
@ -542,9 +559,7 @@
add(data).then(res => { add(data).then(res => {
uni.hideLoading() uni.hideLoading()
this.$util.sucMsg('添加成功') this.$util.sucMsg('添加成功')
setTimeout(() => { this.publicNotice()
uni.navigateBack()
}, 1500)
}).catch(res => { }).catch(res => {
uni.hideLoading() uni.hideLoading()
}) })

@ -27,10 +27,10 @@
<uni-icons class="icon" type="eye" size="22" color="#007FFF"></uni-icons> <uni-icons class="icon" type="eye" size="22" color="#007FFF"></uni-icons>
{{ item.learnerNumber }}人学过 {{ item.learnerNumber }}人学过
</view> </view>
<!-- <view class="meta"> <view class="meta" @click.stop="collect(item)">
<uni-icons class="icon" type="star" size="22" color="#007eff"></uni-icons> <uni-icons class="icon" :type="item.collectionStatus ? 'star-filled' : 'star'" size="22" color="#007eff"></uni-icons>
123 {{ item.collectionNumber }}
</view> --> </view>
</view> </view>
<view v-if="item.lastReading" class="last">上次阅读</view> <view v-if="item.lastReading" class="last">上次阅读</view>
</view> </view>
@ -51,7 +51,7 @@
</template> </template>
<script> <script>
import { partnerOperatingList, queryClassificationByType } from '@/apis/modules/article.js' import { partnerOperatingList, queryClassificationByType, collectCourse } from '@/apis/modules/article.js'
export default { export default {
data() { data() {
return { return {
@ -168,6 +168,14 @@
this.articleNameSort = this.articleNameSort === 'desc' ? 'asc' : 'desc' this.articleNameSort = this.articleNameSort === 'desc' ? 'asc' : 'desc'
this.initList() 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) { toDetail(item) {
this.$util.to(`/team/article/article?id=` + item.id) 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> <uni-icons class="icon" type="eye" size="22" color="#007FFF"></uni-icons>
{{ form.totalBrowsing }}人学过 {{ form.totalBrowsing }}人学过
</view> </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-if="form.labelNameList" class="labels">
<view v-for="(label, j) in form.labelNameList" :key="j" class="label">{{ label }}</view> <view v-for="(label, j) in form.labelNameList" :key="j" class="label">{{ label }}</view>
</view> </view>
@ -32,7 +35,7 @@
</template> </template>
<script> <script>
import { findById } from '@/apis/modules/article.js' import { findById, collectCourse } from '@/apis/modules/article.js'
import uParse from '@/components/gaoyia-parse/parse.vue' import uParse from '@/components/gaoyia-parse/parse.vue'
export default { export default {
data() { data() {
@ -117,31 +120,14 @@
// //
download(item) { download(item) {
this.$util.to(`../send/send?url=${item.filePath}&copyWriting=${item.fileName}`) this.$util.to(`../send/send?url=${item.filePath}&copyWriting=${item.fileName}`)
// uni.showLoading({ },
// title: '...', //
// mask: true collect() {
// }) const state = this.form.collectionStatus ? 0 : 1
// const url = item.filePath collectCourse(this.form.id, state).then(({ data }) => {
// const that = this this.form.collectionStatus = state
// // }).catch(e => {})
// 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()
// }
// })
}
} }
} }
</script> </script>

Loading…
Cancel
Save