Commit 823ccca4 authored by Facius's avatar Facius

feat: 蒙版提示

parent 75d9006f
<template>
<u-mask :show="show" @click="handleClick" :zoom="false">
<view class="tip-view">
<image
class="tip-image"
:src="imageUrl"
:style="imageStyle"
mode="widthFix"
></image>
</view>
</u-mask>
</template>
<script>
/**
* @description 创建一个遮罩层,提示图片
* @property {Boolean} visible 是否显示遮罩(默认false)
* @property {Object} customStyle 自定义样式对象,见上方说明
* @example <answer-operation-tips :show.sync="show"></answer-operation-tips>
*/
export default {
props: {
show: {
type: Boolean,
default: false,
},
imageStyle: String,
imageName: String,
customStyle: {
type: Object,
default() {
return {}
},
},
},
data() {
return {}
},
computed: {
imageUrl() {
return process.uniEnv.qn_base_url + this.imageName
},
},
methods: {
handleClick() {
console.log('--------------')
this.$emit('update:show', false)
this.$emit('click')
},
},
}
</script>
<style lang="scss" scoped>
.tip-view {
}
</style>
...@@ -2,35 +2,24 @@ ...@@ -2,35 +2,24 @@
<view class="statis"> <view class="statis">
<image class="background-image" :src="meiriyilianImage"></image> <image class="background-image" :src="meiriyilianImage"></image>
<view class="content-view"> <view class="content-view">
<!-- <view class="u-flex top">
<view class="u-flex avatar">
<view
class="avatar-list"
v-for="(item, index) in info.avatar"
:key="index"
><image :src="item" mode="scaleToFill"
/></view>
</view>
<view class="notice">
<u-notice-bar
mode="horizontal"
type="none"
font-size="26"
:list="info.dynamic"
color="#FFFFFF"
:volume-icon="false"
autoplay
padding="0 10rpx"
></u-notice-bar>
</view>
</view> -->
<NoticeBar /> <NoticeBar />
<view class="u-flex center"> <view class="u-flex center">
<view v-for="(value, key) in detailLabels" :key="key" class="item-view"> <view v-for="(value, key) in detailLabels" :key="key" class="item-view">
<view v-if="key == 'total'" class="line-view"></view> <view v-if="key == 'total'" class="line-view"></view>
<view class="left-view" @click="handleClick(key)"> <view
class="left-view"
@click="handleClick(key)"
hover-class="u-hover-class"
>
<view class="count-view">{{ info[key] }}</view> <view class="count-view">{{ info[key] }}</view>
<view>{{ value }}</view> <view
>{{ value
}}<u-icon
class="arrow-icon"
name="arrow-right"
color="#cccccc"
></u-icon
></view>
</view> </view>
<view v-if="key == 'total'" class="line-view"></view> <view v-if="key == 'total'" class="line-view"></view>
</view> </view>
...@@ -175,6 +164,9 @@ export default { ...@@ -175,6 +164,9 @@ export default {
font-size: 48rpx; font-size: 48rpx;
margin-bottom: 6rpx; margin-bottom: 6rpx;
} }
.arrow-icon {
margin-left: 4rpx;
}
} }
.line-view { .line-view {
width: 2rpx; width: 2rpx;
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
</view> </view>
<SubjectStatistics <SubjectStatistics
:info="info" :info="info"
class="subject-statistics"
@answer="handleAnswer" @answer="handleAnswer"
@click="handleClickItem" @click="handleClickItem"
></SubjectStatistics> ></SubjectStatistics>
...@@ -105,6 +106,16 @@ ...@@ -105,6 +106,16 @@
<view> <view>
<u-toast ref="uToast" /> <u-toast ref="uToast" />
</view> </view>
<MaskTip
:show.sync="showMask"
imageName="mengceng1.png"
imageStyle="width:502rpx;margin-top:50rpx"
/>
<MaskTip
:show.sync="showCountTip"
imageName="mengceng2.png"
:imageStyle="imageStyle"
/>
</view> </view>
</template> </template>
...@@ -112,13 +123,16 @@ ...@@ -112,13 +123,16 @@
import SubjectStatistics from '@/components/subject-statistics' import SubjectStatistics from '@/components/subject-statistics'
import ExperiencePop from '@/components/experience-pop' import ExperiencePop from '@/components/experience-pop'
import ToastPop from '@/components/toast-pop' import ToastPop from '@/components/toast-pop'
import MaskTip from '@/components/mask-tip'
export default { export default {
components: { SubjectStatistics, ExperiencePop, ToastPop }, components: { SubjectStatistics, ExperiencePop, ToastPop, MaskTip },
data() { data() {
return { return {
visible: false, // 免费体验弹窗 visible: false, // 免费体验弹窗
show: false, show: false,
showMask: false, // 左上角选题库提示
showCountTip: false, // 题数可点击提示
type: 'select', type: 'select',
// provinceList: [], // provinceList: [],
detail: { questionWarehouse: {} }, detail: { questionWarehouse: {} },
...@@ -132,6 +146,7 @@ export default { ...@@ -132,6 +146,7 @@ export default {
isAdd: false, // 题库切换 isAdd: false, // 题库切换
tapCount: 0, // 点击底部logo五次,显示机构id tapCount: 0, // 点击底部logo五次,显示机构id
showOrgId: false, // 显示机构id showOrgId: false, // 显示机构id
tipTop: 410,
} }
}, },
computed: { computed: {
...@@ -254,19 +269,36 @@ export default { ...@@ -254,19 +269,36 @@ export default {
}, },
] ]
}, },
imageStyle() {
return `width:640rpx;margin-top:${this.tipTop}rpx;margin-left:56rpx;`
},
},
watch: {
'detail.totalCount'(val) {
// 上次答题总数为0,这次答题总数大于0,弹出提示
let id = this.detail.questionWarehouse?.echoMap?.questionWarehouseId?.id
if (val > 0 && getApp().globalData.oldTotalCount == id + '-' + 0) {
this.$nextTick(() => {
const query = uni.createSelectorQuery().in(this)
query
.select('.subject-statistics')
.boundingClientRect((data) => {
this.tipTop = data?.top * 2 + 100
this.showCountTip = true
})
.exec()
})
}
getApp().globalData.oldTotalCount = id + '-' + val
},
}, },
// watch: {
// vuex_token(val, oldVal) {
// // 监听token变化,如果更新则重新加载页面数据
// val && !oldVal && this.initData()
// },
// },
onLoad() { onLoad() {
getApp().trackPage('首页') getApp().trackPage('首页')
if (this.vuex_token) { if (this.vuex_token) {
this.loading = true this.loading = true
// this.getProvinceList() // this.getProvinceList()
} }
this.showMaskTip()
}, },
onShow() { onShow() {
if (this.vuex_token) { if (this.vuex_token) {
...@@ -284,6 +316,7 @@ export default { ...@@ -284,6 +316,7 @@ export default {
this.chagefinishCount() this.chagefinishCount()
} }
}, },
onUnload() {},
methods: { methods: {
// initData() { // initData() {
// // this.getProvinceList() // // this.getProvinceList()
...@@ -402,13 +435,7 @@ export default { ...@@ -402,13 +435,7 @@ export default {
}, },
}) })
} else { } else {
this.$u.route({ this.showBuyToast()
url: 'pages/learn/detail',
params: {
// relationId: this.relationId,
id: this.info.id,
},
})
} }
} else { } else {
this.show = true this.show = true
...@@ -488,13 +515,7 @@ export default { ...@@ -488,13 +515,7 @@ export default {
} }
} else if (this.info.id) { } else if (this.info.id) {
// 已选题库 // 已选题库
this.$u.route({ this.showBuyToast()
url: 'pages/learn/detail',
params: {
// relationId: this.relationId,
id: this.info.id,
},
})
} else { } else {
// 未选题库 // 未选题库
this.show = true this.show = true
...@@ -514,13 +535,7 @@ export default { ...@@ -514,13 +535,7 @@ export default {
}) })
} else if (this.info.id) { } else if (this.info.id) {
// 已选题库未绑卡 // 已选题库未绑卡
this.$u.route({ this.showBuyToast()
url: 'pages/learn/detail',
params: {
// relationId: this.relationId,
id: this.info.id,
},
})
} else { } else {
this.show = true this.show = true
} }
...@@ -549,13 +564,7 @@ export default { ...@@ -549,13 +564,7 @@ export default {
if (!this.checkToken()) { if (!this.checkToken()) {
return return
} }
this.$u.route({ this.showBuyToast()
url: 'pages/learn/detail',
params: {
// relationId: this.relationId,
id: this.info.id,
},
})
}, },
handleClickBlank() { handleClickBlank() {
this.tapCount++ this.tapCount++
...@@ -581,6 +590,32 @@ export default { ...@@ -581,6 +590,32 @@ export default {
return false return false
} }
}, },
showMaskTip() {
this.$nextTick(() => {
if (this.firstLauch) {
this.$u.vuex('firstLauch', false)
setTimeout(() => {
this.showMask = true
}, 2000)
}
})
},
showBuyToast() {
this.$refs.uToast.show({
title: '请先进行绑卡',
type: 'warning',
duration: 1500,
callback: () => {
this.$u.route({
url: 'pages/learn/detail',
params: {
// relationId: this.relationId,
id: this.info.id,
},
})
},
})
},
}, },
} }
</script> </script>
......
...@@ -82,17 +82,29 @@ ...@@ -82,17 +82,29 @@
绑定学习卡 绑定学习卡
</u-button> </u-button>
</view> </view>
<MaskTip
:show.sync="show"
imageName="mengceng3.png"
:imageStyle="imageStyle"
/>
</view> </view>
</template> </template>
<script> <script>
import MaskTip from '@/components/mask-tip'
export default { export default {
components: {
MaskTip,
},
data() { data() {
return { return {
// relationId: 0, // 绑卡用 // relationId: 0, // 绑卡用
info: { info: {
questionWarehouse: {}, questionWarehouse: {},
}, },
show: false,
tipTop: 452,
} }
}, },
...@@ -166,6 +178,9 @@ export default { ...@@ -166,6 +178,9 @@ export default {
}, },
] ]
}, },
imageStyle() {
return `width:492rpx;margin-top:${this.tipTop}rpx;margin-left:244rpx;`
},
}, },
onLoad(e) { onLoad(e) {
// if (e && e.relationId) { // if (e && e.relationId) {
...@@ -190,6 +205,7 @@ export default { ...@@ -190,6 +205,7 @@ export default {
.queryQuestionWarehouseById(id) .queryQuestionWarehouseById(id)
.then((res) => { .then((res) => {
this.info = res || { questionWarehouse: {} } this.info = res || { questionWarehouse: {} }
this.showTip()
}) })
.catch((err) => { .catch((err) => {
this.loading = false this.loading = false
...@@ -279,6 +295,18 @@ export default { ...@@ -279,6 +295,18 @@ export default {
} }
}) })
}, },
showTip() {
this.$nextTick(() => {
const query = uni.createSelectorQuery().in(this)
query
.select('.price-view')
.boundingClientRect((data) => {
this.tipTop = data?.top * 2 - 128
this.show = true
})
.exec()
})
},
}, },
} }
</script> </script>
......
...@@ -80,25 +80,22 @@ ...@@ -80,25 +80,22 @@
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<u-mask :show="show" @click="show = false"> <MaskTip
<view class="tip-view"> :show.sync="show"
<image class="tip-image" :src="jiantouImage"></image> imageName="fenxiangmengceng.png"
<view class="tip-message" imageStyle="width:424rpx;margin-left:244rpx;"
><text class="tip-text" />
>请点击右上角可分享至朋友圈或发送给指定朋友</text
>
</view>
</view>
</u-mask>
</view> </view>
</template> </template>
<script> <script>
import CircleProgress from '@/components/circle-progress' import CircleProgress from '@/components/circle-progress'
import MaskTip from '@/components/mask-tip'
export default { export default {
components: { components: {
CircleProgress, CircleProgress,
MaskTip,
}, },
data() { data() {
return { return {
...@@ -191,7 +188,7 @@ export default { ...@@ -191,7 +188,7 @@ export default {
} }
let trackProperties = { let trackProperties = {
openId: this.openId, openId: this.openId,
nickname: this.userInfo.nickName nickname: this.userInfo.nickName,
} }
getApp().share(toShareProperties, trackProperties) getApp().share(toShareProperties, trackProperties)
return toShareProperties return toShareProperties
...@@ -234,7 +231,7 @@ export default { ...@@ -234,7 +231,7 @@ export default {
pageTotalPoint: Number(res.pageTotalPoint) || 0, pageTotalPoint: Number(res.pageTotalPoint) || 0,
category: echoMap.questionWarehouseId.title, category: echoMap.questionWarehouseId.title,
type: '模拟考试', type: '模拟考试',
passPoint: echoMap?.paperId?.passPoint || 80 passPoint: echoMap?.paperId?.passPoint || 80,
} }
} }
}) })
...@@ -250,6 +247,7 @@ export default { ...@@ -250,6 +247,7 @@ export default {
handleClick() { handleClick() {
this.show = true this.show = true
setTimeout(() => { setTimeout(() => {
// 防止分享的时候带着遮罩
this.show = false this.show = false
}, 2500) }, 2500)
}, },
...@@ -405,30 +403,5 @@ export default { ...@@ -405,30 +403,5 @@ export default {
} }
} }
} }
.tip-view {
margin-top: 116rpx;
display: flex;
flex-direction: column;
align-items: flex-end;
.tip-image {
width: 96rpx;
height: 282rpx;
margin-right: 200rpx;
margin-bottom: 24rpx;
}
.tip-message {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
.tip-text {
color: #ffffff;
font-size: 32rpx;
font-weight: bold;
text-align: left;
width: 420rpx;
}
}
}
} }
</style> </style>
...@@ -20,7 +20,8 @@ let saveStateKeys = [ ...@@ -20,7 +20,8 @@ let saveStateKeys = [
'questionWarehouseId', 'questionWarehouseId',
'relationId', // 绑卡用 'relationId', // 绑卡用
'answerCount', 'answerCount',
'orgId' 'orgId',
'firstLauch', // 初次使用
] ]
// 保存变量到本地存储中 // 保存变量到本地存储中
...@@ -46,7 +47,7 @@ const store = new Vuex.Store({ ...@@ -46,7 +47,7 @@ const store = new Vuex.Store({
openId: lifeData.openId ? lifeData.openId : '', openId: lifeData.openId ? lifeData.openId : '',
relationId: lifeData.relationId ? lifeData.relationId : '', // 绑卡用 relationId: lifeData.relationId ? lifeData.relationId : '', // 绑卡用
searchHistory: lifeData.searchHistory ? lifeData.searchHistory : [], // 搜索历史记录 searchHistory: lifeData.searchHistory ? lifeData.searchHistory : [], // 搜索历史记录
answerCount: lifeData.answerCount ? lifeData.answerCount : {},// 已回答题数 answerCount: lifeData.answerCount ? lifeData.answerCount : {}, // 已回答题数
lastIndex: lifeData.lastIndex ? lifeData.lastIndex : {}, // 上次做到第几题 lastIndex: lifeData.lastIndex ? lifeData.lastIndex : {}, // 上次做到第几题
tipStatus: lifeData.tipStatus ? lifeData.tipStatus : false, // 滑动提示 tipStatus: lifeData.tipStatus ? lifeData.tipStatus : false, // 滑动提示
questionWarehouseId: lifeData.questionWarehouseId questionWarehouseId: lifeData.questionWarehouseId
...@@ -56,7 +57,8 @@ const store = new Vuex.Store({ ...@@ -56,7 +57,8 @@ const store = new Vuex.Store({
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式 // 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
vuex_version: '1.0.0', vuex_version: '1.0.0',
questionList: {}, // 练习列表 questionList: {}, // 练习列表
beginTime: null // 考试开始时间 beginTime: null, // 考试开始时间
firstLauch: lifeData.firstLauch == null ? true : false, // 初次使用
}, },
mutations: { mutations: {
$uStore(state, payload) { $uStore(state, payload) {
......
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