[Human] chore(project): 初始化导入 91dj H5 客户端项目代码
从本地工程首次入库;.npmrc(含私有 npm 源 token)与 tsbuildinfo 已加入 .gitignore,不随仓库提交。
This commit is contained in:
@@ -0,0 +1,155 @@
|
||||
<template>
|
||||
<van-overlay :show="isShow" z-index="2001" @click.stop="emit('close')" :lock-scroll="false">
|
||||
<div class="wrapper flex-center-center">
|
||||
<div class="content">
|
||||
<div class="title">提示</div>
|
||||
<div class="horizontalLine"></div>
|
||||
<div class="text">当前免费观影次数已用完!</div>
|
||||
<div class="text">支付尾款 享受完整超级会员特权</div>
|
||||
<div class="btnBox flex-center-between">
|
||||
<div class="inviteBtn" @click.stop="unlockNow">{{ gold }}金币支付</div>
|
||||
<div class="btn flex-center-center" @click.stop="$router.push('/presale')">前往活动</div>
|
||||
</div>
|
||||
<template v-if="useGlobalStore().presaleObj.status == 2">
|
||||
<div class="startActivity">
|
||||
{{ dateFormatMmDd(useGlobalStore().presaleObj.activityDetail.startTime) }} 限时开启
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="useGlobalStore().presaleObj.status == 3">
|
||||
<div class="countdown">{{ useGlobalStore().presaleObj.timeStrCoinPay }}</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</van-overlay>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import useLoading from '@/hooks/loading';
|
||||
import VideoApi from '@/service/video';
|
||||
import { computed } from 'vue';
|
||||
import { ProductType } from '@/enums/app';
|
||||
import { showToast } from 'vant';
|
||||
import { useUserStore } from '@/stores/user';
|
||||
import { useGlobalStore } from '@/stores/global';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { dateFormatMmDd } from '@/utils/index';
|
||||
|
||||
const props = defineProps<{
|
||||
videoInfo: Types.Video.VInfosItem;
|
||||
isOpen: boolean;
|
||||
productType?: ProductType;
|
||||
}>();
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.userInfo;
|
||||
|
||||
const router = useRouter();
|
||||
const { openLoading, closeLoading } = useLoading();
|
||||
const emit = defineEmits(['close', 'buySuccess']);
|
||||
const isShow = computed(() => {
|
||||
return props.isOpen;
|
||||
});
|
||||
const gold = computed(() => {
|
||||
return userInfo.isVip ? props.videoInfo.coins : props.videoInfo.originCoins;
|
||||
});
|
||||
const unlockNow = () => {
|
||||
try {
|
||||
openLoading();
|
||||
let productID = props.videoInfo.id;
|
||||
if (!productID) {
|
||||
showToast('购买出错~');
|
||||
return;
|
||||
}
|
||||
VideoApi.videoBuying({ productType: ProductType.VIDEO, productID: productID })
|
||||
.then(async () => {
|
||||
showToast('购买成功');
|
||||
useUserStore().updateWallet();
|
||||
emit('buySuccess');
|
||||
})
|
||||
.catch((e) => {
|
||||
if (e.toString().indexOf('8000') != -1) {
|
||||
router.push({
|
||||
path: '/wallet',
|
||||
query: {
|
||||
id: props.videoInfo.id,
|
||||
title: props.videoInfo.title || '无标题',
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
} finally {
|
||||
closeLoading();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.wrapper {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
color: #fff;
|
||||
.content {
|
||||
width: 311px;
|
||||
height: 240px;
|
||||
background-color: #202133;
|
||||
position: relative;
|
||||
border-radius: 8px;
|
||||
padding: 18px;
|
||||
.title {
|
||||
color: #3476ff;
|
||||
font-size: 16px;
|
||||
line-height: 22px;
|
||||
text-align: center;
|
||||
}
|
||||
.horizontalLine {
|
||||
height: 1px;
|
||||
background-color: rgb(54, 55, 70);
|
||||
margin: 18px 0;
|
||||
}
|
||||
.text {
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
line-height: 32px;
|
||||
}
|
||||
.btnBox {
|
||||
margin-top: 18px;
|
||||
.inviteBtn {
|
||||
height: 42px;
|
||||
width: 112px;
|
||||
text-align: center;
|
||||
line-height: 42px;
|
||||
font-size: 16px;
|
||||
border-radius: 42px;
|
||||
color: #e0e0e0;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
.btn {
|
||||
height: 42px;
|
||||
width: 147px;
|
||||
text-align: center;
|
||||
line-height: 42px;
|
||||
font-size: 16px;
|
||||
border-radius: 42px;
|
||||
background: #3476ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
.startActivity {
|
||||
color: #ffcc14;
|
||||
text-align: right;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
padding: 12px 22px 0 0;
|
||||
}
|
||||
.countdown {
|
||||
opacity: 0.9;
|
||||
background: var(---, linear-gradient(135deg, #35debc 0%, #22bb9c 100%));
|
||||
background-clip: text;
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
text-align: right;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
padding: 12px 22px 0 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user