|
@@ -81,30 +81,42 @@
|
|
</checkbox-group> -->
|
|
</checkbox-group> -->
|
|
</view>
|
|
</view>
|
|
<view
|
|
<view
|
|
- @click="!roadExamIds.includes(examId) ? buyRoadCourse() : ''"
|
|
|
|
|
|
+ @click="
|
|
|
|
+ !roadExamIds.includes(examId) && isVideoFree == '0'
|
|
|
|
+ ? buyRoadCourse()
|
|
|
|
+ : ''
|
|
|
|
+ "
|
|
class="pay"
|
|
class="pay"
|
|
>
|
|
>
|
|
<view class="pay-text">
|
|
<view class="pay-text">
|
|
- <text v-if="!roadExamIds.includes(examId)"
|
|
|
|
|
|
+ <text v-if="!roadExamIds.includes(examId) && isVideoFree == '0'"
|
|
>立即支付 ¥{{ price / 100 }}</text
|
|
>立即支付 ¥{{ price / 100 }}</text
|
|
>
|
|
>
|
|
<icon
|
|
<icon
|
|
- v-if="roadExamIds.includes(examId)"
|
|
|
|
|
|
+ v-if="roadExamIds.includes(examId) && isVideoFree == '0'"
|
|
type="success_no_circle"
|
|
type="success_no_circle"
|
|
color="#ffffff"
|
|
color="#ffffff"
|
|
size="16"
|
|
size="16"
|
|
style="margin-right: 15rpx"
|
|
style="margin-right: 15rpx"
|
|
></icon>
|
|
></icon>
|
|
- <text v-if="roadExamIds.includes(examId)">已购买</text>
|
|
|
|
|
|
+ <text v-if="roadExamIds.includes(examId) && isVideoFree == '0'"
|
|
|
|
+ >已购买</text
|
|
|
|
+ >
|
|
|
|
+ <text v-if="isVideoFree == '1'">免费观看</text>
|
|
</view>
|
|
</view>
|
|
<image
|
|
<image
|
|
- v-if="!roadExamIds.includes(examId)"
|
|
|
|
|
|
+ v-if="!roadExamIds.includes(examId) && isVideoFree == '0'"
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
mode="widthFix"
|
|
mode="widthFix"
|
|
src="https://ndata.zzxcx.net/ctjk/mp-wx/courseCatalog/payBg.png"
|
|
src="https://ndata.zzxcx.net/ctjk/mp-wx/courseCatalog/payBg.png"
|
|
></image>
|
|
></image>
|
|
<image
|
|
<image
|
|
- v-if="roadExamIds.includes(examId)"
|
|
|
|
|
|
+ v-if="roadExamIds.includes(examId) && isVideoFree == '0'"
|
|
|
|
+ mode="widthFix"
|
|
|
|
+ src="https://ndata.zzxcx.net/ctjk/mp-wx/courseCatalog/alreadyPay.png"
|
|
|
|
+ ></image>
|
|
|
|
+ <image
|
|
|
|
+ v-if="isVideoFree == '1'"
|
|
mode="widthFix"
|
|
mode="widthFix"
|
|
src="https://ndata.zzxcx.net/ctjk/mp-wx/courseCatalog/alreadyPay.png"
|
|
src="https://ndata.zzxcx.net/ctjk/mp-wx/courseCatalog/alreadyPay.png"
|
|
></image>
|
|
></image>
|
|
@@ -123,12 +135,13 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import api from "@/api";
|
|
import api from "@/api";
|
|
-import { mapGetters } from "vuex";
|
|
|
|
|
|
+import { mapGetters, mapState } from "vuex";
|
|
import vip_angle from "@/assets/img/vip_angle.png";
|
|
import vip_angle from "@/assets/img/vip_angle.png";
|
|
import try_angle from "@/assets/img/try_angle.png";
|
|
import try_angle from "@/assets/img/try_angle.png";
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ IS_VIDEO_FREE: 0,
|
|
query: {
|
|
query: {
|
|
price: 0,
|
|
price: 0,
|
|
},
|
|
},
|
|
@@ -145,13 +158,16 @@ export default {
|
|
console.log(this.userAgreement);
|
|
console.log(this.userAgreement);
|
|
},
|
|
},
|
|
playRoadExamVideo(item) {
|
|
playRoadExamVideo(item) {
|
|
- if (!this.roadExamIds.includes(this.examId)&&item.permission==2) {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: "请购买",
|
|
|
|
- icon: "none",
|
|
|
|
- });
|
|
|
|
- return;
|
|
|
|
|
|
+ if (this.isVideoFree == "0") {
|
|
|
|
+ if (!this.roadExamIds.includes(this.examId) && item.permission == 2) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "请购买",
|
|
|
|
+ icon: "none",
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
uni.setStorageSync("storageWebSrc", item.videoUrl);
|
|
uni.setStorageSync("storageWebSrc", item.videoUrl);
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: "/otherPages/playStorageWebSrc/index",
|
|
url: "/otherPages/playStorageWebSrc/index",
|
|
@@ -217,6 +233,11 @@ export default {
|
|
this.query = query;
|
|
this.query = query;
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
|
|
+ ...mapState({
|
|
|
|
+ isVideoFree: (state) => {
|
|
|
|
+ return state.user.isVideoFree;
|
|
|
|
+ },
|
|
|
|
+ }),
|
|
...mapGetters(["roadExamIds"]),
|
|
...mapGetters(["roadExamIds"]),
|
|
},
|
|
},
|
|
};
|
|
};
|