Commit 12eaffc5 authored by Damon's avatar Damon

Merge branch 'dev-v1.0.0' of git.banshouhui.com:wuzhenzhe/study into dev-v1.0.0

parents 982f5295 40a67414
<template> <template>
<!-- 合格/不合格弹窗 -->
<u-popup <u-popup
border-radius="24" border-radius="24"
v-model="visible" v-model="visible"
......
<template>
<!-- 每日一练完成弹窗 -->
<u-popup
border-radius="24"
v-model="visible"
safe-area-inset-bottom
mode="center"
width="654rpx"
:mask-close-able="false"
>
<view class="pop-view">
<image
mode="widthFix"
class="top-image-view"
:src="xunzhangImage"
></image>
<view class="pop-main">
<image
mode="widthFix"
class="image-view"
:src="backgroundImage"
></image>
<view class="head-view">
<view class="pop-title">
<text>每日一练已完成</text>
</view>
<view class="pop-message">
<text>您已经累计打卡</text>
</view>
</view>
<view class="pop-content">
<view class="list-view">
<view>{{ count }}</view>
<view class="label-view">天</view>
</view>
</view>
<view class="pop-btn-view">
<u-button
:custom-style="customStyleCancel"
hover-class="none"
shape="circle"
@click="handleClickCancel"
>
查看记录
</u-button>
<u-button
:custom-style="customStyleSave"
shape="circle"
type="primary"
@click="handleClickSure"
>
继续练习
</u-button>
</view>
</view>
</view>
</u-popup>
</template>
<script>
export default {
props: {
visible: {
type: Boolean,
default: false,
},
count: {
type: Number,
default: 0,
},
},
data() {
return {}
},
computed: {
backgroundImage() {
return process.uniEnv.qn_base_url + 'lianxibeijing.png'
},
xunzhangImage() {
return process.uniEnv.qn_base_url + 'xunzhang.png'
},
customStyleCancel() {
return {
width: '264rpx',
height: '96rpx',
color: '#9EA5BB',
fontWeight: 'bold',
fontSize: '32rpx',
backgroundColor: 'transparent',
}
},
customStyleSave() {
return {
backgroundColor: '#2953FF',
width: '264rpx',
height: '96rpx',
color: '#ffffff',
fontWeight: 'bold',
fontSize: '32rpx',
}
},
},
methods: {
changeVisibleValue(val) {
this.$emit('update:visible', val)
},
handleClickCancel() {
this.changeVisibleValue(false)
this.$emit('cancel')
},
handleClickSure() {
this.changeVisibleValue(false)
this.$emit('submit')
},
},
}
</script>
<style lang="scss">
.u-mode-center-box {
background-color: transparent !important;
padding-top: 40rpx;
}
</style>
<style lang="scss" scoped>
.pop-view {
padding-top: 90rpx;
position: relative;
.top-image-view {
width: 182rpx;
height: 272rpx;
position: absolute;
top: 0;
left: calc(50% - 91rpx);
z-index: 2;
}
.pop-main {
padding: 48rpx 24rpx 48rpx 24rpx;
min-height: 520rpx;
position: relative;
text-align: center;
border-radius: 24rpx;
overflow: hidden;
background-color: #ffffff;
z-index: 1;
.head-view {
width: 100%;
height: 432;
padding-top: 160rpx;
padding-bottom: 30rpx;
.pop-title {
font-size: 48rpx;
text-align: center;
color: #191c27;
font-weight: bold;
}
.pop-message {
margin-top: 60rpx;
font-size: 28rpx;
text-align: center;
color: #5a6073;
}
}
.image-view {
width: 100%;
position: absolute;
top: 0;
left: 0;
z-index: -1;
}
.pop-content {
margin-bottom: 140rpx;
display: flex;
align-items: center;
justify-content: space-around;
.list-view {
font-weight: bold;
width: 30%;
color: #2953ff;
font-size: 80rpx;
display: flex;
align-items: flex-end;
justify-content: center;
padding-bottom: 30rpx;
padding-top: 0rpx;
.label-view {
font-size: 28rpx;
color: #5a6073;
margin-bottom: 22rpx;
padding-top: 6rpx;
padding-left: 14rpx;
}
}
}
.line-view {
background-color: #e8ebf3;
height: 2rpx;
width: 100%;
margin-bottom: 40rpx;
margin-top: 40rpx;
}
.pop-btn-view {
display: flex;
align-items: center;
justify-content: space-between;
position: absolute;
bottom: 48rpx;
left: 24rpx;
right: 24rpx;
}
}
}
</style>
<template>
<!-- 体验资格结束弹窗 -->
<u-popup
v-model="visible"
mode="center"
safe-area-inset-bottom
width="690rpx"
:mask-close-able="flase"
close-icon-color="#FFFFFF"
height="86%"
>
<view class="pop-view">
<image mode="widthFix" class="image-view" :src="backgroundImage"></image>
<view class="head-view">
<view class="pop-title">
<text>温馨提示</text>
</view>
</view>
<view class="pop-content">
<view>您的免费答题体验已完成</view>
<view class="label-view">绑卡/购买可继续完成答题练习</view>
</view>
<view class="pop-btn-view">
<u-button
:custom-style="customStyleCancel"
hover-class="none"
shape="circle"
@click="handleClickCancel"
>
回到首页
</u-button>
<u-button
:custom-style="customStyleSave"
shape="circle"
type="primary"
@click="handleClickSure"
>
去绑卡
</u-button>
</view>
</view>
</u-popup>
</template>
<script>
export default {
props: {
visible: {
type: Boolean,
default: false,
},
},
data() {
return {}
},
computed: {
backgroundImage() {
return process.uniEnv.qn_base_url + 'zigetanchaung-w.png'
},
customStyleCancel() {
return {
width: '264rpx',
height: '96rpx',
color: '#9EA5BB',
fontWeight: 'bold',
fontSize: '32rpx',
}
},
customStyleSave() {
return {
backgroundColor: '#2953FF',
width: '264rpx',
height: '96rpx',
color: '#ffffff',
fontWeight: 'bold',
fontSize: '32rpx',
}
},
},
methods: {
handleClickCancel() {
this.$emit('update:visible', false)
uni.switchTab({
url: '/pages/index/index',
})
},
handleClickSure() {
this.$emit('update:visible', false)
this.$u.route({
url: 'pages/learn/detail',
})
},
},
}
</script>
<style lang="scss" scoped>
.pop-view {
margin-top: 80rpx;
padding: 48rpx 24rpx;
position: relative;
text-align: center;
background-color: #ffffff;
z-index: 1;
border-radius: 24rpx;
overflow: hidden;
.head-view {
width: 100%;
height: 432;
padding-top: 10rpx;
padding-bottom: 300rpx;
.pop-title {
font-size: 48rpx;
text-align: center;
color: #ffffff;
font-weight: bold;
}
}
.image-view {
width: 100%;
position: absolute;
top: 0;
left: 0;
z-index: -1;
}
.pop-content {
margin-bottom: 60rpx;
font-size: 36rpx;
font-weight: bold;
color: #191c27;
margin-top: 80rpx;
.label-view {
font-size: 28rpx;
color: #9ea5bb;
margin-top: 20rpx;
font-weight: 400;
}
}
}
.pop-btn-view {
display: flex;
align-items: center;
justify-content: space-between;
position: absolute;
bottom: 48rpx;
left: 40rpx;
right: 40rpx;
}
</style>
...@@ -105,7 +105,7 @@ export default { ...@@ -105,7 +105,7 @@ export default {
padding: 48rpx 40rpx; padding: 48rpx 40rpx;
min-height: 520rpx; min-height: 520rpx;
position: relative; position: relative;
background-image: linear-gradient(to top, #f8fafd 0%, #e9f3ff 50%); background-image: linear-gradient(to top, #ffffff 0%, #e9f3ff 50%);
background-size: 100% 240rpx; background-size: 100% 240rpx;
background-repeat: no-repeat; background-repeat: no-repeat;
.pop-title { .pop-title {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<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"> <view class="left-view" @click="handleClick(key)">
<view class="count-view">{{ info[key] }}</view> <view class="count-view">{{ info[key] }}</view>
<view>{{ value }}</view> <view>{{ value }}</view>
</view> </view>
...@@ -94,8 +94,10 @@ export default { ...@@ -94,8 +94,10 @@ export default {
}, },
created() {}, created() {},
methods: { methods: {
handleClick(key) {
this.$emit('click', key)
},
answer() { answer() {
if (this.buttonDisabled) return
this.$emit('answer') this.$emit('answer')
}, },
}, },
......
...@@ -41,20 +41,32 @@ export default { ...@@ -41,20 +41,32 @@ export default {
type: String, type: String,
default: '温馨提示', default: '温馨提示',
}, },
message: { // select: 去选题库;bound: 去绑卡
type: {
type: String, type: String,
default: '', default: 'select',
},
buttonText: {
// 确定按钮
type: String,
default: '去选择',
}, },
}, },
data() { data() {
return {} return {}
}, },
computed: { computed: {
message() {
switch (this.type) {
case 'select':
return '为了您能更好的使用“模考大师”小程序请先选择题库'
case 'bound':
return '为了您能更好的使用“模考大师”小程序请去绑定用户卡'
}
},
buttonText() {
switch (this.type) {
case 'select':
return '去选择'
case 'bound':
return '去绑定'
}
},
customStyleCancel() { customStyleCancel() {
return { return {
width: '264rpx', width: '264rpx',
...@@ -85,7 +97,7 @@ export default { ...@@ -85,7 +97,7 @@ export default {
}, },
handleClickSure() { handleClickSure() {
this.changeVisibleValue(false) this.changeVisibleValue(false)
this.$emit('submit') this.$emit('click', this.type)
}, },
}, },
} }
......
...@@ -262,20 +262,20 @@ ...@@ -262,20 +262,20 @@
"list": [ "list": [
{ {
"pagePath": "pages/index/index", "pagePath": "pages/index/index",
"iconPath": "static/logo.png", "iconPath": "static/tab/tiku0.png",
"selectedIconPath": "static/logo.png", "selectedIconPath": "static/tab/tiku1.png",
"text": "题库" "text": "题库"
}, },
{ {
"pagePath": "pages/index/cert", "pagePath": "pages/index/cert",
"iconPath": "static/logo.png", "iconPath": "static/tab/zhengshu0.png",
"selectedIconPath": "static/logo.png", "selectedIconPath": "static/tab/zhengshu1.png",
"text": "证书" "text": "证书"
}, },
{ {
"pagePath": "pages/index/mine", "pagePath": "pages/index/mine",
"iconPath": "static/logo.png", "iconPath": "static/tab/wode0.png",
"selectedIconPath": "static/logo.png", "selectedIconPath": "static/tab/wode1.png",
"text": "我的" "text": "我的"
} }
] ]
......
...@@ -8,6 +8,12 @@ ...@@ -8,6 +8,12 @@
:border-bottom="false" :border-bottom="false"
title-bold title-bold
:is-back="false" :is-back="false"
><slot
><image
:src="quanbutikuImage"
class="left-image"
@click="handleClickLeftTop"
></image></slot
></u-navbar> ></u-navbar>
<view class="content"> <view class="content">
<view class="exam-title-view" @click="$u.throttle(handleSelect, 500)"> <view class="exam-title-view" @click="$u.throttle(handleSelect, 500)">
...@@ -34,13 +40,21 @@ ...@@ -34,13 +40,21 @@
<SubjectStatistics <SubjectStatistics
:info="info" :info="info"
@answer="handleAnswer" @answer="handleAnswer"
@click="handleClickItem"
></SubjectStatistics> ></SubjectStatistics>
<view class="exam-mark"> <view class="exam-mark">
<view v-for="(item, index) in marks" :key="index" class="list-view"> <view
v-for="(item, index) in marks"
:key="index"
class="list-view"
@click="handleClickExam(index)"
>
<image class="exam-image" :src="item.image"></image> <image class="exam-image" :src="item.image"></image>
<view class="right-view"> <view class="right-view">
<view>{{ item.name }}</view> <view>{{ item.name }}</view>
<view class="label-view">{{ item.label }}</view> <view class="label-view" :style="{ color: item.labelColor }">{{
item.label
}}</view>
</view> </view>
</view> </view>
<view class="line-view"></view> <view class="line-view"></view>
...@@ -66,10 +80,10 @@ ...@@ -66,10 +80,10 @@
<view class="experience-pop-view"> <view class="experience-pop-view">
<ExperiencePop :visible.sync="visible" /> <ExperiencePop :visible.sync="visible" />
</view> </view>
<ToastPop <ToastPop :visible.sync="show" :type="type" @click="handleClickToast" />
:visible.sync="show" <view>
message="为了您能更好的使用“模考大师”小程序请先选择题库" <u-toast ref="uToast" />
/> </view>
</view> </view>
</template> </template>
...@@ -84,12 +98,16 @@ export default { ...@@ -84,12 +98,16 @@ export default {
return { return {
visible: false, visible: false,
show: false, show: false,
type: 'select',
selected: { selected: {
key: 0, key: 0,
name: '熔化焊接与热切割作业', name: '熔化焊接与热切割作业',
location: '黑龙江省题', location: '黑龙江省题',
count: '899', count: '899',
all: '10000',
pass: '96%', pass: '96%',
cardId: '', // 绑卡
free: true, // true:可以体验;false: 没有体验机会了
}, },
} }
}, },
...@@ -106,20 +124,35 @@ export default { ...@@ -106,20 +124,35 @@ export default {
mokaodashiImage() { mokaodashiImage() {
return process.uniEnv.qn_base_url + 'mokaodashi.png' return process.uniEnv.qn_base_url + 'mokaodashi.png'
}, },
quanbutikuImage() {
return process.uniEnv.qn_base_url + 'quanbutiku.png'
},
marks() { marks() {
return [ return [
{ {
name: '全部试题', name: '全部试题',
label: '题库进阶练习', label: this.examText,
labelColor: this.labelColor,
image: process.uniEnv.qn_base_url + 'quanbushiti.png', image: process.uniEnv.qn_base_url + 'quanbushiti.png',
}, },
{ {
name: '模拟考试', name: '模拟考试',
label: '真题模拟强化', label: '真题模拟强化',
labelColor: '#9EA5BB',
image: process.uniEnv.qn_base_url + 'monishiti.png', image: process.uniEnv.qn_base_url + 'monishiti.png',
}, },
] ]
}, },
labelColor() {
return this.selected.free ? '#FA5A49' : '#9EA5BB'
},
examText() {
return this.selected.free
? '免费体验1次'
: this.selected.card
? this.selected.count + '/' + this.selected.all
: '题库进阶练习'
},
info() { info() {
return { return {
days: 9, days: 9,
...@@ -193,12 +226,11 @@ export default { ...@@ -193,12 +226,11 @@ export default {
if (info) { if (info) {
this.selected = info this.selected = info
page.info = null page.info = null
this.visible = info.cardId
} }
}, },
methods: { methods: {
handleSelect() { handleSelect() {
this.visible = true
return
// if (this.vuex_token) { // if (this.vuex_token) {
var str = this.selected ? 'selectedList' : 'addExam' var str = this.selected ? 'selectedList' : 'addExam'
this.$u.route({ this.$u.route({
...@@ -210,11 +242,47 @@ export default { ...@@ -210,11 +242,47 @@ export default {
}, },
// 每日一练 // 每日一练
handleAnswer() { handleAnswer() {
if (this.selected) { if (this.selected.cardId) {
} else if (this.selected.name) {
this.type = 'bound'
this.show = true
} else { } else {
this.type = 'select'
this.show = true this.show = true
} }
}, },
handleClickLeftTop() {
this.$u.route({
url: 'pages/learn/selectCategory',
})
},
handleClickToast(type) {
var str = type == 'select' ? 'addExam' : 'detail'
this.$u.route({
url: 'pages/learn/' + str,
})
},
handleClickItem(key) {
if (this.selected.name) {
// 跳转到学练记录
} else {
this.$refs.uToast.show({
title: '暂未选题库',
type: 'warning',
})
}
},
handleClickExam(index) {
if (index == 0) {
// 点击了全部试题
} else {
// 点击了模拟考试
this.$u.route({
url: 'pages/learn/beginAnswer',
})
}
},
handleClick(path) { handleClick(path) {
// if (this.vuex_token) { // if (this.vuex_token) {
this.$u.route({ this.$u.route({
...@@ -257,6 +325,11 @@ export default { ...@@ -257,6 +325,11 @@ export default {
background-image: linear-gradient(to top, #f8fafd 0%, #e9f3ff 50%); background-image: linear-gradient(to top, #f8fafd 0%, #e9f3ff 50%);
background-size: 100% 520rpx; background-size: 100% 520rpx;
background-repeat: no-repeat; background-repeat: no-repeat;
.left-image {
width: 32rpx;
height: 32rpx;
margin-left: 22rpx;
}
.content { .content {
height: 100%; height: 100%;
overflow: auto; overflow: auto;
......
...@@ -183,8 +183,8 @@ export default { ...@@ -183,8 +183,8 @@ export default {
onLoad() {}, onLoad() {},
methods: { methods: {
handleClick() { handleClick() {
uni.switchTab({ this.$u.route({
url: '/pages/index/index', url: 'pages/learn/boundQuestions',
}) })
}, },
handleClickBuy() { handleClickBuy() {
...@@ -221,20 +221,20 @@ export default { ...@@ -221,20 +221,20 @@ export default {
}, },
checkPayStatus(no) { checkPayStatus(no) {
const params = { const params = {
outTradeNo: no outTradeNo: no,
} }
this.$u.api.payQuery(params).then(res => { this.$u.api.payQuery(params).then((res) => {
if (res.trade_state === 'SUCCESS') { if (res.trade_state === 'SUCCESS') {
this.$u.toast('支付成功') this.$u.toast('支付成功')
} else if (res.trade_state === 'NOTPAY') { } else if (res.trade_state === 'NOTPAY') {
this.$u.toast('请稍后核实订单状态,不要重复发起支付') this.$u.toast('请稍后核实订单状态,不要重复发起支付')
} else if (res.trade_state === 'PAYERROR') { } else if (res.trade_state === 'PAYERROR') {
this.$u.toast('支付失败') this.$u.toast('支付失败')
} else { } else {
this.$u.toast(res.trade_state_desc) this.$u.toast(res.trade_state_desc)
} }
}) })
} },
}, },
} }
</script> </script>
......
...@@ -189,7 +189,19 @@ export default { ...@@ -189,7 +189,19 @@ export default {
}, },
handleClickSubmit() { handleClickSubmit() {
if (this.buttonDisabled) return if (this.buttonDisabled) return
var selected = {
key: 0,
name: 'abc',
location: 'aaa题',
count: '899',
pass: '96%',
}
selected.free = true
this.setPageInfo(selected)
this.showPop = false this.showPop = false
uni.switchTab({
url: '/pages/index/index',
})
}, },
baiduLocation(long, lat) { baiduLocation(long, lat) {
let a = this, let a = this,
...@@ -217,7 +229,8 @@ export default { ...@@ -217,7 +229,8 @@ export default {
setPageInfo(info) { setPageInfo(info) {
var pages = getCurrentPages() var pages = getCurrentPages()
if (pages.length >= 1) { if (pages.length >= 1) {
var page = pages[pages.length - 1] var page = pages[0]
console.log('--------setPageInfo--------', info)
page.info = info page.info = info
} }
}, },
......
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