|
|
@@ -2,6 +2,7 @@
|
|
|
import { type PropType } from 'vue'
|
|
|
import { dict } from '@/.cool/store'
|
|
|
import { wechatPay, wechatPayRequest, wechatPayQuery, wechatPayCancel } from '@/services/user'
|
|
|
+import { type SubjectCourseResult, fetchSubjectCourse } from '@/services/subject/course'
|
|
|
import { user } from '@/.cool'
|
|
|
import { ref } from 'vue'
|
|
|
const emit = defineEmits(['close'])
|
|
|
@@ -27,19 +28,23 @@ const visible = ref(false)
|
|
|
const visible2 = ref(false)
|
|
|
const visible3 = ref(false)
|
|
|
const visible4 = ref(false)
|
|
|
+const msg = ref('')
|
|
|
function handleOpen() {
|
|
|
console.log(1)
|
|
|
- if (!props.finish) {
|
|
|
- visible2.value = true
|
|
|
- return
|
|
|
- }
|
|
|
- if (props.studyUnitLock) {
|
|
|
- visible4.value = true
|
|
|
- return
|
|
|
- }
|
|
|
switch (props.type) {
|
|
|
case 'course':
|
|
|
- visible.value = true
|
|
|
+ if (!props.record.payFlag) {
|
|
|
+ visible.value = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ fetchSubjectCourse({
|
|
|
+ id: props.record.id
|
|
|
+ }).then(res => {
|
|
|
+ if (res.studyUnitLock) {
|
|
|
+ visible4.value = true
|
|
|
+ msg.value = res.msg
|
|
|
+ }
|
|
|
+ })
|
|
|
break;
|
|
|
case 'vip':
|
|
|
visible3.value = true
|
|
|
@@ -137,7 +142,7 @@ const handlePay = async () => {
|
|
|
</cl-popup>
|
|
|
<cl-popup v-model="visible4" showClose :size="400" :show-header="false" direction="center">
|
|
|
<view class="p-[40px] ">
|
|
|
- <cl-text class="text-center" color="#000" :size="20"> 一周后解锁! </cl-text>
|
|
|
+ <cl-text class="text-center" color="#000" :size="20"> {{ msg }} </cl-text>
|
|
|
<cl-button class="mt-4" size="large" type="warn" block @tap="visible4 = false"> 返回 </cl-button>
|
|
|
</view>
|
|
|
</cl-popup>
|