|
@@ -29,6 +29,35 @@
|
|
|
<el-tab-pane v-if="products.id != 1" class="software-content" name="second" v-html="products.content">
|
|
|
<span slot="label" class="detail-title"><span class="iconbg iconbg-green rounded"><i class="fas fa-info"></i></span>软件详情</span>
|
|
|
</el-tab-pane>
|
|
|
+ <el-tab-pane v-if="products.id != 1" class="software-content" name="third">
|
|
|
+ <span slot="label" class="detail-title"><span class="iconbg iconbg-yellow rounded"><i class="fas fa-video"></i></span>动画教程</span>
|
|
|
+ <h1 class="vide-title" v-if="video1.length > 0">专属教程</h1>
|
|
|
+ <div class="row" v-if="video1.length > 0">
|
|
|
+ <div class="col-auto mb-4" v-for="video in video1" :key="video.aid">
|
|
|
+ <div class="card card-width">
|
|
|
+ <img class="card-img-top" :src="SmartCostUrl+video.img_url" :alt="video.title">
|
|
|
+ <div class="card-body p-3">
|
|
|
+ <button class="btn btn-success btn-block btn-sm" @click="showVideo(video.aid)"><i class="fas fa-play-circle pr-1"></i>播放</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <h1 class="vide-title">通用教程</h1>
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-auto mb-4" v-for="video in video2" :key="video.aid">
|
|
|
+ <div class="card card-width">
|
|
|
+ <img class="card-img-top" :src="SmartCostUrl+video.img_url" :alt="video.title">
|
|
|
+ <div class="card-body p-3">
|
|
|
+ <button class="btn btn-success btn-block btn-sm" @click="showVideo(video.aid)"><i class="fas fa-play-circle pr-1"></i>播放</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--<div class="row">-->
|
|
|
+ <!--<!–<iframe class="col-12" scrolling=auto src="http://ol.smartcost.com.cn/loginbanner.html" frameborder="0"></iframe>–>-->
|
|
|
+ <!--<webview id="banner" style="width:100%; height:360px" src="http://ol.smartcost.com.cn/loginbanner.html"></webview>-->
|
|
|
+ <!--</div>-->
|
|
|
+ </el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -45,12 +74,27 @@
|
|
|
return {
|
|
|
activeName: 'first',
|
|
|
products: '',
|
|
|
- exelist: ''
|
|
|
+ exelist: '',
|
|
|
+ SmartCostUrl: 'https://smartcost.com.cn',
|
|
|
+ video1: '',
|
|
|
+ video2: ''
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
this.fetchData()
|
|
|
},
|
|
|
+ // mounted () {
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // document.getElementById('banner').addEventListener('new-window', (e) => {
|
|
|
+ // const protocol = require('url').parse(e.url).protocol
|
|
|
+ // if (protocol === 'http:' || protocol === 'https:') {
|
|
|
+ // // electron.shell.openExternal(e.url)
|
|
|
+ // this.$electron.ipcRenderer.send('openWindow', e.url)
|
|
|
+ // // window.open(e.url)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // },
|
|
|
watch: {
|
|
|
// 如果路由有变化,会再次执行该方法
|
|
|
'$route': 'fetchData',
|
|
@@ -59,6 +103,28 @@
|
|
|
if (!this.checkOnline()) {
|
|
|
this.$message.error('当前网络不可用,图片信息将无法加载')
|
|
|
}
|
|
|
+ } else if (val === 'third') {
|
|
|
+ if (!this.checkOnline()) {
|
|
|
+ this.$message.error('当前网络不可用,无法获取视频信息')
|
|
|
+ } else {
|
|
|
+ let productid = this.$route.params.productid === undefined ? this.$db.read().get('sc_productData').last().value().id : this.$route.params.productid
|
|
|
+ let productInfo = this.$db.read().get('sc_productData').getById(productid).value()
|
|
|
+ let self2 = this
|
|
|
+ this.$http({
|
|
|
+ url: this.SmartCostUrl + '/animation/list?pid=' + productInfo.product_id,
|
|
|
+ method: 'get',
|
|
|
+ timeout: 5000
|
|
|
+ }).then(function (response) {
|
|
|
+ if (response.data.err === 0) {
|
|
|
+ self2.video1 = response.data.info.list1
|
|
|
+ self2.video2 = response.data.info.list2
|
|
|
+ } else {
|
|
|
+ this.$message.error(response.data.msg)
|
|
|
+ }
|
|
|
+ }).catch(function (error2) {
|
|
|
+ throw error2
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -68,9 +134,7 @@
|
|
|
this.$db.read().set('sc_hadInstall.url', '/softwarestartup/' + productid).write()
|
|
|
this.products = this.$db.read().get('sc_productData').getById(productid).value()
|
|
|
this.exelist = this.$db.read().get('sc_exeData').filter({ pid: productid }).orderBy('addtime', 'desc').value()
|
|
|
- if (productid === '1') {
|
|
|
- this.activeName = 'first'
|
|
|
- }
|
|
|
+ this.activeName = 'first'
|
|
|
},
|
|
|
openExebtn (id) {
|
|
|
let info = this.$db.read().get('sc_exeData').getById(id).value()
|
|
@@ -136,6 +200,10 @@
|
|
|
},
|
|
|
openFolder (path) {
|
|
|
this.$electron.shell.openItem(path)
|
|
|
+ },
|
|
|
+ showVideo (id) {
|
|
|
+ let url = this.SmartCostUrl + '/video/' + id
|
|
|
+ this.$electron.shell.openItem(url)
|
|
|
}
|
|
|
}
|
|
|
}
|