123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342 |
- <template>
- <view class="container">
- <view class="conwarp">
- <view class="gdHead dffs">
- <view class="head flex1">{{ goodInfo.info.name }}</view>
- <text v-for="(item, index) in goodInfo.info.tags.split('|')" class="desc">{{ item }}</text>
- </view>
- <view class="subtit textgrey fontssm">{{ goodInfo.info.desc }}</view>
-
- <block v-if="goodInfo.class_vedio_status == 1">
- <view v-if="goodInfo.info.vedio" class="cl-one">
- <video class="vidBox" :src="goodInfo.info.vedio" controls></video>
- </view>
- </block>
- </view>
- <view class="conwarp">
- <view class="gdHead"><view class="head">解析文档</view></view>
- <view class="cl-one">
- <view class="xqcont">
- <u-parse :content="goodInfo.info.content"></u-parse>
- <!-- <view class="xqleft dffd">
- <image
- @click="cliCot(1)"
- class="small"
- :src="goodInfo.info.is_collection == 1 ? '/static/img/pro/navcolsel.png' : '/static/img/pro/navcol.png'"
- mode=""
- ></image>
- <view class="word">收藏</view>
- <image @click="cliCot(2)" class="big" :src="goodInfo.info.is_give == 1 ? '/static/img/pro/navgodsel.png' : '/static/img/pro/navgod.png'" mode=""></image>
- <view class="word">{{ goodInfo.info.like_num || 0 }}</view>
- <button open-type="share" class=" shareBtn " type="default">
- <image class="small" src="/static/img/pro/navshare.png" mode=""></image>
- <view class="word">分享</view>
- </button>
- </view> -->
- <view class="btnsBox dffd">
- <image @click="cliCot(2)" class="small" :src="goodInfo.info.is_give == 1 ? '/static/img/pro/navgodsel.png' : '/static/img/pro/navgod.png'" mode=""></image>
- <view class="fontssm textgrey">{{ goodInfo.info.like_num || 0 }}人喜欢</view>
- <view class="dfsb">
- <view @click="cliCot(1)" class="btns dfsb">
- <image class="icon" :src="goodInfo.info.is_collection == 1 ? '/static/img/pro/navcolsel.png' : '/static/img/pro/navcol.png'" mode=""></image>
- <view class="word">收藏</view>
- </view>
- <button open-type="share" class="btns shareBtn dfsb">
- <image class="icon" src="/static/img/pro/navshare1.png" mode=""></image>
- <view class="word">分享</view>
- </button>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="conwarp">
- <view class="gdHead"><view class="head">文档下载</view></view>
- <view class="cl-one"><video-list :flag="2" :list="goodInfo.files"></video-list></view>
- </view>
- <view class="fixBox dfsb">
- <view @tap="toPay()" class="li flex1 dffs">
- <image src="/static/img/pro/navlidown.png" mode=""></image>
- 普通下载
- </view>
- <view class="line"></view>
- <view @tap="toPay()" class="li flex1 dffs">
- <image src="/static/img/pro/navlivdown.png" mode=""></image>
- 会员下载
- </view>
- <!-- <navigator :url="'/pages/pay/pay?id=' + id" class="li flex1 dffs">
- <image src="/static/img/pro/navlidown.png" mode=""></image>
- 普通下载
- </navigator>
- <view class="line"></view>
- <navigator :url="'/pages/pay/pay?id=' + id" class="li flex1 dffs">
- <image src="/static/img/pro/navlivdown.png" mode=""></image>
- 会员下载
- </navigator> -->
- </view>
- </view>
- </template>
- <script>
- import videoList from './components/wordlist.vue';
- export default {
- components: {
- videoList
- },
- data() {
- return {
- id: 0, //商品id
- goodInfo: { tags: '', info: '' }
- };
- },
- onLoad(option) {
- console.log(option);
- if (option.scene) {
- let scene = decodeURIComponent(option.scene);
- let id =scene.split('=')[1]
- console.log(scene);
- this.id = id;
- } else {
- this.id = option.id;
- }
- this.loadData();
- this.$store.dispatch('getUserInfo');
- },
- onShareAppMessage() {
- let that = this;
- return {
- title: that.goodInfo.info.name,
- path: `/pages/index/navDet?id=${this.id}&invite_id=${this.token()}`
- };
- },
- methods: {
- // val 1收藏 2点赞
- cliCot(val) {
- let url = val == 1 ? 'collection/setCollection' : 'give/setGive';
- // type 2 类型: 1=商品 2=文档 3=视频
- // coll_id 收藏ID (分为: 商品ID , 文档ID , 视频ID)
- this.$api
- .request(url, {
- coll_id: this.goodInfo.info.id || '',
- r_id: this.goodInfo.info.id || '',
- type: 2
- })
- .then(res => {
- this.$api.toast(res.msg);
- if (res.code == '200') {
- setTimeout(res => {
- this.loadData();
- }, 600);
- }
- });
- },
- /**
- * 请求数据只是为了代码不那么乱
- * 分次请求未作整合
- */
- async loadData() {
- let url = 'index/getClassInfo';
- this.$api
- .request(url, {
- id: this.id
- })
- .then(res => {
- if (res.code == '200') {
- let data = res.data;
- this.goodInfo = data;
- }
- });
- },
- showPopup(key, type) {
- this.$refs[key].open(type);
- },
-
- toPay()
- {
- if(this.goodInfo.info.level_time == 0)
- {
- uni.showToast({
- icon:'none',
- title: '普通会员无法下载!',
- duration: 2000,
- });
-
- setTimeout(res => {
- uni.navigateTo({
- url: '/pages/user/mine/member'
- });
- }, 2000);
-
- return;
- }
-
- uni.navigateTo({
- url: '/pages/pay/pay?id=' + this.id
- });
-
- },
- //立即购买
- buyNow(data) {
-
-
-
- const parms = this.getConfirmData(data);
- console.log(parms);
- if (!parms) {
- return;
- }
- // parms.id = parms.gid;
- this.hidePopup('skuPopup');
- this.navTo('/pages/order/createOrder?data=' + JSON.stringify(parms), 'post', {
- login: true
- });
- }
- // ,
- //立即购买
- // async buyNow(data) {
- // this.getConfirmData(data);
- // this.$request('/api/cart/addCart', {
- // goods_id: this.id,
- // nums: 1,
- // nums_type: 2
- // })
- // .then(res => {
- // if (res.code == '200') {
- // this.navTo('/pages/order/createOrder?type=buyNow&ids=' + res.data, {
- // login: true
- // })
- // } else {
- // this.$util.msg(res.msg);
- // }
- // });
- // }
- }
- };
- </script>
- <style lang="scss" scoped>
- .container {
- padding-bottom: 120rpx;
- .conwarp {
- background-color: #fff;
- padding: 26rpx 30rpx 39rpx;
- border-radius: 16rpx;
- margin-bottom: 20rpx;
- .gdHead {
- line-height: 58rpx;
- margin-bottom: 16rpx;
- .head {
- font-size: 34rpx;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 600;
- color: #333333;
- line-height: 48rpx;
- }
- .desc {
- background: #f89638;
- border-radius: 5rpx;
- font-size: 18rpx;
- height: 32rpx;
- line-height: 32rpx;
- padding: 0rpx 8rpx;
- display: inline-block;
- color: #fff;
- margin-left: 10rpx;
- &:nth-of-type(2) {
- background: #7fc06e;
- }
- &:nth-of-type(3) {
- background: #75b2c4;
- }
- &:nth-of-type(4) {
- background: #8875c0;
- }
- }
- }
- .subtit {
- margin-top: 10rpx;
- }
- .cl-one {
- .vidBox {
- margin-top: 30rpx;
- width: 690rpx;
- height: 335rpx;
- }
- .xqcont {
- min-height: 800rpx;
- width: 100%;
- align-items: center;
- .xqleft {
- position: fixed;
- top: 50%;
- right: 0;
- align-items: center;
- justify-content: center;
- .small {
- width: 54rpx;
- height: 54rpx;
- }
- .big {
- width: 108rpx;
- height: 108rpx;
- }
- .word {
- margin: 8rpx 0 48rpx;
- font-size: 20rpx;
- color: #999;
- }
- }
- .btnsBox {
- align-items: center;
- .small {
- width: 90rpx;
- height: 90rpx;
- margin: 60rpx 0 16rpx;
- opacity: 0.8;
- }
- .btns {
- margin: 70rpx 60rpx 0;
- width: 154rpx;
- height: 54rpx;
- background: #f6f6f6;
- border-radius: 31px;
- align-items: center;
- padding: 0 15rpx;
- justify-content: space-around;
- .icon {
- width: 35rpx;
- height: 31rpx;
- }
- .word {
- font-size: 22rpx;
- color: #666;
- }
- }
- }
- }
- }
- }
- .fixBox {
- padding: 34rpx;
- .line {
- width: 1rpx;
- height: 20rpx;
- background: #b7b7bd;
- }
- .li {
- justify-content: center;
- color: #7fc06e;
- image {
- width: 42rpx;
- height: 32rpx;
- margin-right: 20rpx;
- }
- }
- }
- }
- </style>
|