Commit d58c747f authored by Facius's avatar Facius

improvement:上传图片授权和配置

首页跳转
parent 559c4fe3
...@@ -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)
}, },
}, },
} }
......
...@@ -34,13 +34,21 @@ ...@@ -34,13 +34,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 +74,10 @@ ...@@ -66,10 +74,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 +92,16 @@ export default { ...@@ -84,12 +92,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: 没有体验机会了
}, },
} }
}, },
...@@ -110,16 +122,28 @@ export default { ...@@ -110,16 +122,28 @@ export default {
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 +217,11 @@ export default { ...@@ -193,12 +217,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 +233,39 @@ export default { ...@@ -210,11 +233,39 @@ 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
} }
}, },
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) { handleClick(path) {
// if (this.vuex_token) { // if (this.vuex_token) {
this.$u.route({ this.$u.route({
......
...@@ -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