Commit dc09eed8 authored by Damon's avatar Damon

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

parents 8165adfd 3ec47cf5
......@@ -41,7 +41,7 @@
shape="circle"
@click="handleClickCancel"
>
查看记录
{{ cancelText }}
</u-button>
<u-button
:custom-style="customStyleSave"
......@@ -49,7 +49,7 @@
type="primary"
@click="handleClickSure"
>
继续练习
{{ buttonText }}
</u-button>
</view>
</view>
......@@ -68,11 +68,25 @@ export default {
type: Number,
default: 0,
},
// normal 普通联系;experience 体验
type: {
type: String,
default: 'normal',
},
},
data() {
return {}
},
computed: {
isNormal() {
return this.type == 'normal'
},
cancelText() {
return this.isNormal ? '查看记录' : '回首页'
},
sureText() {
return this.isNormal ? '继续练习' : '去绑卡'
},
backgroundImage() {
return process.uniEnv.qn_base_url + 'lianxibeijing.png'
},
......
......@@ -25,7 +25,7 @@
type="primary"
@click="handleClick"
>
立即练习
立即体验
</u-button>
</view>
<view class="colse-view">
......
......@@ -94,7 +94,7 @@ export default {
return process.uniEnv.qn_base_url + 'lianxianniu.png'
},
buttonText() {
return this.info.experience ? '免费体验答题' : '每日一练'
return this.info.experience ? '立即体验答题' : '每日一练'
},
},
created() {},
......
......@@ -26,6 +26,16 @@
<view v-if="noExam" class="tip-view">
<text>您还未选择题库,请先选择题库</text>
</view>
<view
v-else-if="!info.cardId"
class="card-tip-view"
@click="$u.throttle(handleSelectTip, 500)"
>
题库未激活,请通过<text class="blue-text">“绑卡”</text>或<text
class="blue-text"
>“购买”</text
>激活
</view>
<view v-else class="detail-view">
<view
v-for="(item, index) in detailItems"
......@@ -111,7 +121,7 @@ export default {
detail: { questionWarehouse: {} },
selected: {},
data: {},
relationId: 0, // 绑卡用
// relationId: 0, // 绑卡用
loading: false,
canExperience: false, // 体验资格
finishCount: 0,
......@@ -296,7 +306,10 @@ export default {
.queryMyQuestionWarehouseDetail(id)
.then((res) => {
this.detail = res || { questionWarehouse: {} }
this.relationId = res.questionWarehouse.id
// this.relationId = res.questionWarehouse.id
if (res.questionWarehouse.id) {
this.$u.vuex('relationId', res.questionWarehouse.id)
}
if (res.questionWarehouse.questionWarehouseId) {
this.$u.vuex(
'questionWarehouseId',
......@@ -358,7 +371,7 @@ export default {
this.$u.route({
url: 'pages/learn/detail',
params: {
relationId: this.relationId,
// relationId: this.relationId,
id: this.info.id,
},
})
......@@ -380,7 +393,7 @@ export default {
this.$u.route({
url: 'pages/learn/' + str,
params: {
relationId: this.relationId,
// relationId: this.relationId,
id: this.info.id,
},
})
......@@ -440,7 +453,7 @@ export default {
this.$u.route({
url: 'pages/learn/detail',
params: {
relationId: this.relationId,
// relationId: this.relationId,
id: this.info.id,
},
})
......@@ -468,7 +481,7 @@ export default {
this.$u.route({
url: 'pages/learn/detail',
params: {
relationId: this.relationId,
// relationId: this.relationId,
id: this.info.id,
},
})
......@@ -506,6 +519,15 @@ export default {
)
: 0
},
handleSelectTip() {
this.$u.route({
url: 'pages/learn/detail',
params: {
// relationId: this.relationId,
id: this.info.id,
},
})
},
},
}
</script>
......@@ -574,6 +596,15 @@ export default {
margin-top: 22rpx;
margin-bottom: 40rpx;
}
.card-tip-view {
font-size: 28rpx;
color: #9ea5bb;
margin-top: 22rpx;
margin-bottom: 40rpx;
.blue-text {
color: #2953ff;
}
}
.detail-view {
display: flex;
align-items: flex-start;
......
......@@ -51,7 +51,7 @@
export default {
data() {
return {
relationId: 0, // 绑卡用
// relationId: 0, // 绑卡用
realPrice: null,
}
},
......@@ -78,10 +78,10 @@ export default {
},
},
onLoad(e) {
if (e && e.relationId) {
this.relationId = e.relationId
}
if (e && e.relationId) {
// if (e && e.relationId) {
// this.relationId = e.relationId
// }
if (e && e.realPrice) {
this.realPrice = e.realPrice
}
},
......@@ -96,7 +96,7 @@ export default {
url: 'pages/learn/boundTest',
params: {
code: res.result,
relationId: this.relationId,
// relationId: this.relationId,
},
})
}
......@@ -128,9 +128,9 @@ export default {
handleChange() {
this.$u.route({
url: 'pages/learn/manualBinding',
params: {
relationId: this.relationId,
},
// params: {
// relationId: this.relationId,
// },
})
},
pay(data) {
......
......@@ -68,9 +68,7 @@ export default {
this.param.cardNumber = code.slice(0, 15)
this.param.cardSecret = code.slice(15)
}
if (e && e.relationId) {
this.param.questionWarehouseId = e.relationId
}
this.param.questionWarehouseId = this.relationId
},
methods: {
handleClick() {
......
......@@ -34,11 +34,7 @@
><view class="line-view"></view>
</view>
</view>
<u-button
:customStyle="buyButtonStyle"
@click="handleClickBuy"
type="primary"
>
<u-button :customStyle="buyButtonStyle" @click="handleClickBuy">
立即购买
</u-button>
</view>
......@@ -83,7 +79,7 @@
type="primary"
shape="circle"
>
持卡用户绑定
绑定学习卡
</u-button>
</view>
</view>
......@@ -93,7 +89,7 @@
export default {
data() {
return {
relationId: 0, // 绑卡用
// relationId: 0, // 绑卡用
info: {
questionWarehouse: {},
},
......@@ -142,12 +138,12 @@ export default {
},
buyButtonStyle() {
return {
width: '160rpx',
height: '64rpx',
backgroundColor: '#2953FF',
color: '#FFFFFF',
marginRight: '12rpx',
width: '144rpx',
height: '56rpx',
background: '#FFFFFF',
color: '#2953FF',
fontSize: '26rpx',
borderRadius: '12rpx',
}
},
subItems() {
......@@ -171,12 +167,12 @@ export default {
},
},
onLoad(e) {
if (e && e.relationId) {
this.relationId = e.relationId
}
// if (e && e.relationId) {
// this.relationId = e.relationId
// }
if ((e && e.id) || this.questionWarehouseId) {
this.queryQuestionWarehouseById(e.id || this.questionWarehouseId)
this.queryQuestionWarehouseById((e && e.id) || this.questionWarehouseId)
}
},
methods: {
......@@ -195,7 +191,7 @@ export default {
this.$u.route({
url: 'pages/learn/boundQuestions',
params: {
relationId: this.relationId,
// relationId: this.relationId,
realPrice: this.info.questionWarehouse.realPrice,
},
})
......
......@@ -47,7 +47,7 @@
type="primary"
shape="circle"
>
绑定
确定
</u-button>
<view class="change-button"
><u-icon class="icon-view" name="error-circle"></u-icon
......@@ -71,7 +71,7 @@ export default {
password: '',
focus: true,
loading: false,
relationId: 0,
// relationId: 0,
}
},
......@@ -100,9 +100,9 @@ export default {
},
},
onLoad(e) {
if (e && e.relationId) {
this.relationId = e.relationId
}
// if (e && e.relationId) {
// this.relationId = e.relationId
// }
},
methods: {
handleClick() {
......
......@@ -19,6 +19,7 @@ let saveStateKeys = [
'lastIndex',
'tipStatus',
'questionWarehouseId',
'relationId', // 绑卡用
]
// 保存变量到本地存储中
......@@ -42,6 +43,7 @@ const store = new Vuex.Store({
userInfo: lifeData.userInfo ? lifeData.userInfo : {},
vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '',
openId: lifeData.openId ? lifeData.openId : '',
relationId: lifeData.relationId ? lifeData.relationId : '', // 绑卡用
searchHistory: lifeData.searchHistory ? lifeData.searchHistory : [], // 搜索历史记录
questionList: lifeData.questionList ? lifeData.questionList : {}, // 练习列表
lastIndex: lifeData.lastIndex ? lifeData.lastIndex : {}, // 上次做到第几题
......
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