整体代码优化

This commit is contained in:
王奥斯
2021-11-10 14:13:24 +08:00
parent 5b91c88880
commit a321bf358f
25 changed files with 43 additions and 3131 deletions
+13 -107
View File
@@ -107,139 +107,45 @@ export default {
changeType(isVisible, linkType) {
if (isVisible && linkType) {
this.emptyText = '正在搜索中'
/* 获取视频,音频,直播信息 */
/* 获取信息 */
let res = {
code: 0,
success: true,
error: false,
data: [
{
id: 403,
createTime: 1621504872000,
updateTime: 1621504872000,
remark: null,
name: '查玛代表传承人',
classifyId: null,
type: 2,
retailPrice: 0,
price: 0,
memberPrice: 0,
vipPrice: 0,
costPrice: 0,
jidPrice: 0,
zidPrice: 0,
tidPrice: 0,
scorePrice: 0,
freight: 0,
top: null,
score: null,
sort: 1,
status: 1,
code: null,
coverUrl:
'https://imgs.starfirelink.com/minicourse/非遗传承人@2x_1621504834414.png',
url: 'https://mgt.starfirelink.com/mobile/index.html#/videoOnDemand?videoId=5285890818212341060',
lengths: '',
introduce: '',
free: 1,
classOne: null,
classTwo: null,
classThree: null,
seriesId: 0,
vId: null,
price: 0,
name: '测试1',
videoId: '5285890818212341060',
teacherId: 1,
details: '',
buys: 0,
tryVideoId: null,
tryLengths: null,
num: 0,
bannerImgUrl: null,
specifications: null,
color: null,
createTimes: null,
createTimee: null,
updateTimes: null,
updateTimee: null,
page: 1,
limit: 20,
order: null,
ordertype: null,
minPrice: null,
maxPrice: null,
seriesName: null,
id: 403,
type: 2,
seriesId: '0',
},
{
id: 396,
createTime: 1621403190000,
updateTime: 1621416056000,
remark: null,
name: '测试',
classifyId: null,
type: 2,
retailPrice: 0,
price: 1,
memberPrice: 1,
vipPrice: 0,
costPrice: 0,
jidPrice: 0,
zidPrice: 0,
tidPrice: 0,
scorePrice: 0,
freight: 0,
top: null,
score: null,
sort: 1,
status: 1,
code: null,
coverUrl:
'https://imgs.starfirelink.com/minicourse/QQ截图20210409170420_1621416051505.png',
url: 'https://mgt.starfirelink.com/mobile/index.html#/videoOnDemand?videoId=',
lengths: '1',
introduce: '1',
free: 0,
classOne: null,
classTwo: null,
classThree: null,
seriesId: 85,
vId: null,
price: 1,
name: '测试2',
videoId: '',
teacherId: 1,
details: '1',
buys: 1,
tryVideoId: null,
tryLengths: null,
num: 0,
bannerImgUrl: null,
specifications: null,
color: null,
createTimes: null,
createTimee: null,
updateTimes: null,
updateTimee: null,
page: 1,
limit: 20,
order: null,
ordertype: null,
minPrice: null,
maxPrice: null,
seriesName: '非遗商城',
id: 396,
type: 2,
seriesId: '85',
},
],
}
this.activ = 0
res.data.length === 0 ? (this.emptyText = '暂无数据') : null
this.options = res.data
// 校验数据
this.options = this.$utils.filterCommodityData(linkType, this.options)
}
},
// 保存跳转的地方
changeId(res) {
console.log(res)
// 通过商品 type 和 id 获取到商品数据 newList接口数据可以不用
console.log(this.$utils.getCoursewareData(this.type, res.id),'--------')
this.dialogImageUrl = this.$utils.getCoursewareData(this.type, res.id)
this.dialogImageUrl = res
console.log(this.dialogImageUrl, '----------------changeId')
},
/* 显示上传文件组件 */
showUpload() {