Commit d58c747f authored by Facius's avatar Facius

improvement:上传图片授权和配置

首页跳转
parent 559c4fe3
......@@ -105,7 +105,7 @@ export default {
padding: 48rpx 40rpx;
min-height: 520rpx;
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-repeat: no-repeat;
.pop-title {
......
......@@ -27,7 +27,7 @@
<view class="u-flex center">
<view v-for="(value, key) in detailLabels" :key="key" class="item-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>{{ value }}</view>
</view>
......@@ -94,8 +94,10 @@ export default {
},
created() {},
methods: {
handleClick(key) {
this.$emit('click', key)
},
answer() {
if (this.buttonDisabled) return
this.$emit('answer')
},
},
......
......@@ -41,20 +41,32 @@ export default {
type: String,
default: '温馨提示',
},
message: {
// select: 去选题库;bound: 去绑卡
type: {
type: String,
default: '',
},
buttonText: {
// 确定按钮
type: String,
default: '去选择',
default: 'select',
},
},
data() {
return {}
},
computed: {
message() {
switch (this.type) {
case 'select':
return '为了您能更好的使用“模考大师”小程序请先选择题库'
case 'bound':
return '为了您能更好的使用“模考大师”小程序请去绑定用户卡'
}
},
buttonText() {
switch (this.type) {
case 'select':
return '去选择'
case 'bound':
return '去绑定'
}
},
customStyleCancel() {
return {
width: '264rpx',
......@@ -85,7 +97,7 @@ export default {
},
handleClickSure() {
this.changeVisibleValue(false)
this.$emit('submit')
this.$emit('click', this.type)
},
},
}
......
......@@ -34,13 +34,21 @@
<SubjectStatistics
:info="info"
@answer="handleAnswer"
@click="handleClickItem"
></SubjectStatistics>
<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>
<view class="right-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 class="line-view"></view>
......@@ -66,10 +74,10 @@
<view class="experience-pop-view">
<ExperiencePop :visible.sync="visible" />
</view>
<ToastPop
:visible.sync="show"
message="为了您能更好的使用“模考大师”小程序请先选择题库"
/>
<ToastPop :visible.sync="show" :type="type" @click="handleClickToast" />
<view>
<u-toast ref="uToast" />
</view>
</view>
</template>
......@@ -84,12 +92,16 @@ export default {
return {
visible: false,
show: false,
type: 'select',
selected: {
key: 0,
name: '熔化焊接与热切割作业',
location: '黑龙江省题',
count: '899',
all: '10000',
pass: '96%',
cardId: '', // 绑卡
free: true, // true:可以体验;false: 没有体验机会了
},
}
},
......@@ -110,16 +122,28 @@ export default {
return [
{
name: '全部试题',
label: '题库进阶练习',
label: this.examText,
labelColor: this.labelColor,
image: process.uniEnv.qn_base_url + 'quanbushiti.png',
},
{
name: '模拟考试',
label: '真题模拟强化',
labelColor: '#9EA5BB',
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() {
return {
days: 9,
......@@ -193,12 +217,11 @@ export default {
if (info) {
this.selected = info
page.info = null
this.visible = info.cardId
}
},
methods: {
handleSelect() {
this.visible = true
return
// if (this.vuex_token) {
var str = this.selected ? 'selectedList' : 'addExam'
this.$u.route({
......@@ -210,11 +233,39 @@ export default {
},
// 每日一练
handleAnswer() {
if (this.selected) {
if (this.selected.cardId) {
} else if (this.selected.name) {
this.type = 'bound'
this.show = true
} else {
this.type = 'select'
this.show = true
}
},
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 {
// 点击了模拟考试
}
},
handleClick(path) {
// if (this.vuex_token) {
this.$u.route({
......
......@@ -189,7 +189,19 @@ export default {
},
handleClickSubmit() {
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
uni.switchTab({
url: '/pages/index/index',
})
},
baiduLocation(long, lat) {
let a = this,
......@@ -217,7 +229,8 @@ export default {
setPageInfo(info) {
var pages = getCurrentPages()
if (pages.length >= 1) {
var page = pages[pages.length - 1]
var page = pages[0]
console.log('--------setPageInfo--------', 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