Commit aa0a3845 authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/viitto/pptist

parents 548165f5 62320259
......@@ -13,7 +13,7 @@ import { injectKeyTemplate } from './types/injectKey';
import UserServices from './services/UserService';
import WaterMake from './components/WaterMake/Index.vue'
const { token } = storeToRefs(useUserStore())
const { token, userInfo } = storeToRefs(useUserStore())
const snapshotStore = useSnapshotStore()
const mainStore = useMainStore()
const { databaseId } = storeToRefs(mainStore)
......@@ -47,6 +47,15 @@ const healthCheckHandler = async ()=>{
await UserServices.CollectAsync()
}
}
const vipTips = () =>{
let Dates = new Date()
let y = Dates.getFullYear()
let m = Dates.getMonth()+1
let d = Dates.getDay()
userInfo.value.BuyvipTipsDate = y + '-' + (m>9?m:'0'+m) + '-' + (d>9?d:'0'+d)
}
setInterval(() => {
healthCheckHandler()
}, 1000*60)
......@@ -66,6 +75,8 @@ onMounted(() => {
return null;
}
})
// vipTips()
</script>
<style lang="scss">
......
<template>
<div class="vipFooterBox animate__animated animate__fadeInUp" @click="goVipIntroduce">
<img class="cursor-pointer" src="../../assets//img/vipfooter.png"/>
<span class="close-btn cursor-pointer column items-center flex-center"
@click.stop="OffVip"><IconClose :size="16"></IconClose></span>
</div>
</template>
<script setup lang="ts">
import { reactive, ref, inject, onMounted, watch} from "vue";
import LineService from '@/services/LineService'
import ConfigService from '@/services/ConfigService'
import { useUserStore } from "@/store/user";
import { useSellTemplateStore } from '@/store'
import { useScreenStore } from "@/store/screen";
import { storeToRefs } from "pinia";
import { injectKeyTemplate } from '@/types/injectKey'
import { createOpEditorLink, createSaleCreateLink, managerTemplateLink } from '@/utils/common'
import { ElLoading, ElMessage, ElMessageBox } from "element-plus";
import { useRouter } from "vue-router";
import UserCard from "@/components/User/UserCard.vue";
import { Delete,View } from '@element-plus/icons-vue';
import { VIEWPORT_SIZE, VIEWPORT_VER_SIZE } from '@/configs/canvas'
import foote from '@/components/footer/index.vue';
import { noDataImg } from "@/utils/common";
const {
userInfo
} = storeToRefs(useUserStore())
const router = useRouter();
const scrollContainer = ref<any>()
const scrollToElement = ref<any>()
const searchData = ref({} as any)
searchData.value = inject(injectKeyTemplate)
const marketStore = useScreenStore()
const { market, ConfigId} = storeToRefs(useScreenStore())
const personVisible = ref(false)
const model = ref(2)
const showCurrentTemplate = ref<any>()
const imgList = ref<any>()
const datas = reactive({
scrollTop: 0,
currentImg: 0,// 当前查看img
})
let TemplateType = 0
if(router.currentRoute.value.path=='/market') model.value=1
if(router.currentRoute.value.path.includes('create')) {
model.value=2
if(router.currentRoute.value.fullPath.indexOf('/ad')!=-1) TemplateType = 2
else if(router.currentRoute.value.fullPath.indexOf('/trip')!=-1) TemplateType = 1
}else if(router.currentRoute.value.path.includes('op')) {
model.value=0
}
marketStore.setModel(model.value)
const props = defineProps({
DetaTem:{
......@@ -67,95 +27,53 @@ const emit = defineEmits<{
(event: 'close'): void,
}>()
// 删除监听滚动
const CloseDetails = () => {
const OffVip = () => {
emit('close')
// document.querySelector("#scrollId .Details-left").removeEventListener("scroll", handleScroll);
}
const ToggleImg = (text: String) => {
if(text=='left'){
if(datas.currentImg>0) {
datas.currentImg--
scrollContainer.value.scrollTop = imgList.value[datas.currentImg].imgTop
}
}
if(text=='right'){
if(datas.currentImg<imgList.value.length-1) {
datas.currentImg++
scrollContainer.value.scrollTop = imgList.value[datas.currentImg].imgTop
}
}
}
const addTemplate = (type:number) =>{
const goVipIntroduce = () =>{
router.push({
path:`/create_template/${type}`
path:`/p/show`
})
}
// 图片滚动翻页
const handleScroll = (e) =>{
let temp = document.querySelector("#scrollId .Details-left").scrollTop;
let PageImageList = imgList.value
for(let i=0;i<PageImageList.length;i++){
if(temp>=PageImageList[i].imgTop&&datas.currentImg!=i) datas.currentImg = i
}
}
// 查看所有子模版
const getTemplate = async (item:any) => {
if(!item) return
if(item.PageImageList && item.PageImageList.length>0){
datas.currentImg = 0
datas.DetailsVisible = true
imgList.value = []
let arrList = function(list){
list.forEach(x=>{
imgList.value.push({
url: x,
imgTop: 0
})
})
}
arrList(item.PageImageList)
showCurrentTemplate.value = item
if(item.PageImageList.length>1){
setTimeout(()=>{
for(let i=0;i<imgList.value.length;i++){
imgList.value[i].imgTop = (scrollToElement.value[i].offsetHeight+30)*i
}
document.querySelector("#scrollId .Details-left").addEventListener("scroll", handleScroll);
},500)
}
}else{
ElMessage.warning({
showClose: true,
message: `当前${item.TemplateType==2?'广告':'行程'}没有预览信息,请选择其他操作`,
})
}
}
/**
* 页面跳转
*/
const goToTemplate = (item: any) => {
let url = ''
if(model.value==2) url = createSaleCreateLink(item.TempId,item.TemplateType)
else if(model.value==0 && router.currentRoute.value.params.configId) url = createOpEditorLink(parseInt(router.currentRoute.value.params.configId.toString()),item.TempId)
else if(model.value==1) url = managerTemplateLink(item.TempId,item.TemplateType)
if(url!='') {
router.push({
path:url
})
}
}
watch(()=>props.Details,()=>{
})
</script>
<style lang="scss" scoped>
.vipFooterBox{
position: relative;
position: fixed;
bottom: 0;
left: 0;
z-index: 2;
}
.vipFooterBox img{
width: 100vw;
height: 7.81vw;
}
.vipFooterBox .content-item{
display: flex;
flex-direction: row;
justify-content: space-between;
font-size: 0.73vw;
margin-bottom: 0.7vw;
color: #000000;
}
.vipFooterBox .close-btn{
position: fixed;
bottom: 3.3vw;
right: 5vw;
width: 1.77vw;
height: 1.77vw;
border:2px solid #AFAFAF;
text-align: center;
color:#AFAFAF;
border-radius: 50%;
z-index: 3;
}
.vipFooterBox .close-btn:hover{
border:2px solid #fff;
color:#fff;
}
</style>
\ No newline at end of file
......@@ -206,8 +206,8 @@
<!-- 行程、广告图详情 -->
<temDetails :DetaTem="DetailsVisible" :Details="datas.TemDetails" @close="DetailsVisible=false"/>
<!-- vip -->
<vipFooter></vipFooter>
<!-- vip购买提示 -->
<vipFooter v-if="!userInfo.iv&&!userInfo.it&&!userInfo.OpenPrompt" @close="closeVip"></vipFooter>
</template>
<script setup lang="ts">
......@@ -302,6 +302,17 @@ const queryColor = ref({
const parmas = ref({} as any)
parmas.value = router.currentRoute.value.params
// 关闭vip购买提示
const closeVip = () =>{
userInfo.value.OpenPrompt = true
// let Dates = new Date()
// let y = Dates.getFullYear()
// let m = Dates.getMonth()+1
// let d = Dates.getDay()
// userInfo.value.NewBuyvipTipsDate = y + '-' + (m>9?m:'0'+m) + '-' + (d>9?d:'0'+d)
// console.log(userInfo.value.NewBuyvipTipsDate,'-----------')
}
// 版型 横版 竖版
const SwitchingVersion = (row: Object) =>{
queryObj.TempType = row.Id
......
......@@ -191,10 +191,9 @@ const beforeAvatarUpload=async (res:any)=>{
loadingImg.value = true
let filePath="/Upload/User/";
let url = await AliyunUpload.UploadAvatar(res, filePath);
if(url!='') {
userInfo.value.photo =url
// await bindHandler()
userInfo.value.photo =url
await bindHandler()
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment