Commit 7faaaa7a authored by Facius's avatar Facius

improvement: 绑卡

parent 08c6a60b
const UNI_APP = {
apiUrl: 'http://192.168.0.204:8760',
apiUrl: 'http://192.168.0.208:8760',
qn_base_url: 'https://qn-static.banshouhui.com/study/',
qn_asset_url: 'http://deudn.c.pp.cc/',
uCenterUrl: 'http://192.168.0.5:8093/',//'http://rest-u.yunya.com/'
uCenterUrl: 'http://192.168.0.5:8093/', //'http://rest-u.yunya.com/'
argoDebugMode: 1,
version: 'v1.0.0',
}
......
......@@ -78,6 +78,9 @@ let learnApiFun = function(vm) {
// 学员获取自己的题库
let getMyQuestionWarehouseList = async (params = {}) =>
await vm.$u.get('/rest/question/query/getMyQuestionWarehouseList', params)
let bindCard = async (params = {}) =>
await vm.$u.post('/rest/card/bind', params)
const learnApi = {
getQuestion,
getQuestionTotal,
......@@ -97,6 +100,7 @@ let learnApiFun = function(vm) {
queryExamRecord,
queryExamRecordOne,
getMyQuestionWarehouseList,
bindCard,
}
return learnApi
}
......
......@@ -152,7 +152,9 @@ export default {
this.detail.questionWarehouse && this.detail.questionWarehouse.cardId,
provinceName: this.provinceName,
experience:
this.selected.state && !this.detail.questionWarehouse.cardId
this.selected.state &&
(!this.detail.questionWarehouse ||
!this.detail.questionWarehouse.cardId)
? true
: false,
pass: this.$u.random(95, 99) + '%',
......
......@@ -74,7 +74,7 @@ export default {
}
},
},
onLoad() {},
onLoad(e) {},
methods: {
handleClick() {
wx.scanCode({
......@@ -83,7 +83,7 @@ export default {
console.log(res)
if (res.result) {
this.$u.route({
url: 'pages/learn/manualBinding',
url: 'pages/learn/boundTest',
params: {
code: res.result,
},
......@@ -93,7 +93,11 @@ export default {
})
},
handleClickBuy() {},
handleChange() {},
handleChange() {
this.$u.route({
url: 'pages/learn/manualBinding',
})
},
},
}
</script>
......@@ -132,7 +136,7 @@ export default {
.first-line {
display: flex;
align-items: center;
margin-bottom: 56rpx;
margin-bottom: 50rpx;
.blue-text {
color: #2953ff;
......
......@@ -9,27 +9,34 @@
title-bold
></u-navbar>
<view class="body-view">
<image class="image-view" :src="successImage"></image>
<view class="content-view">学习卡已绑定成功</view>
<view class="tip-view">可以前往首页进行答题或模拟考试学习</view>
<!-- <image class="image-view" :src="successImage"></image> -->
<view class="content-view">是否绑定该学习卡</view>
<view class="tip-view">学习卡完成绑定后,不支持解绑操作</view>
<view class="bottom-view">
<u-button
:customStyle="buttonStyle"
@click="handleClick"
type="primary"
shape="circle"
:loading="loading"
>
去首页
绑定
</u-button>
</view>
</view>
<view>
<u-toast ref="uToast" />
</view>
</view>
</template>
<script>
export default {
data() {
return {}
return {
loading: false,
param: { cardNumber: '', cardSecret: '' },
}
},
computed: {
......@@ -41,9 +48,9 @@ export default {
guize: '出题规则',
}
},
successImage() {
return process.uniEnv.qn_base_url + 'shenqingtijiaochenggong.png'
},
// successImage() {
// return process.uniEnv.qn_base_url + 'shenqingtijiaochenggong.png'
// },
buttonStyle() {
return {
height: '104rpx',
......@@ -55,12 +62,43 @@ export default {
}
},
},
onLoad() {},
onLoad(e) {
e = {}
e.code = '621001500006600c7m1dp8z2'
if (e && e.code) {
var code = e.code
this.param.cardNumber = code.slice(0, 15)
this.param.cardSecret = code.slice(15)
}
this.param.questionWarehouseId = this.questionWarehouseId
},
methods: {
handleClick() {
uni.switchTab({
url: '/pages/index/index',
})
// 获取题库列表
this.loading = true
this.$u.api
.bindCard(this.param)
.then((res) => {
console.log('--------res--------', res)
uni.switchTab({
url: '/pages/index/index',
})
})
.catch((err) => {
this.loading = false
console.log(err)
this.$refs.uToast.show({
title: err.msg,
type: 'error',
})
})
},
setPageInfo(info) {
var pages = getCurrentPages()
if (pages.length >= 2) {
var page = pages[pages.length - 2]
page.info = info
}
},
},
}
......@@ -84,13 +122,13 @@ export default {
.body-view {
height: 100%;
overflow: auto;
padding-top: 100rpx;
padding-top: 200rpx;
text-align: center;
.image-view {
margin-top: 100rpx;
width: 224rpx;
height: 224rpx;
}
// .image-view {
// margin-top: 100rpx;
// width: 224rpx;
// height: 224rpx;
// }
.content-view {
font-size: 40rpx;
color: #2953ff;
......@@ -99,7 +137,7 @@ export default {
.tip-view {
font-size: 26rpx;
color: #9ea5bb;
margin-top: 10rpx;
margin-top: 14rpx;
}
.bottom-view {
margin-top: 180rpx;
......
......@@ -180,7 +180,7 @@ export default {
]
},
},
onLoad() {},
onLoad(e) {},
methods: {
handleClick() {
this.$u.route({
......@@ -194,7 +194,7 @@ export default {
openId: this.openId,
}
uni.showLoading({
title: '加载中'
title: '加载中',
})
this.$u.api.payOrder(data).then((res) => {
uni.hideLoading()
......@@ -228,7 +228,7 @@ export default {
outTradeNo: no,
}
uni.showLoading({
title: '支付中'
title: '支付中',
})
this.$u.api.payQuery(params).then((res) => {
uni.hideLoading()
......
......@@ -17,7 +17,7 @@
<view class="field-view">
<input
type="number"
class="input-code"
class="input-view"
:value="code"
placeholder="请输入卡号"
:placeholder-style="placeplaceholderStyle"
......@@ -29,7 +29,7 @@
<view class="field-title">学习卡密码</view>
<view class="field-view">
<input
class="input-password"
class="input-view"
password
:value="password"
placeholder="请输入密码"
......@@ -54,6 +54,9 @@
>
</view>
</view>
<view>
<u-toast ref="uToast" />
</view>
</view>
</template>
......@@ -95,7 +98,32 @@ export default {
},
onLoad(e) {},
methods: {
handleClick() {},
handleClick() {
// 获取题库列表
this.loading = true
this.$u.api
.bindCard(this.param)
.then((res) => {
uni.switchTab({
url: '/pages/index/index',
})
})
.catch((err) => {
this.loading = false
console.log(err)
this.$refs.uToast.show({
title: err.msg,
type: 'error',
})
})
},
setPageInfo(info) {
var pages = getCurrentPages()
if (pages.length >= 2) {
var page = pages[pages.length - 2]
page.info = info
}
},
},
}
</script>
......@@ -146,6 +174,10 @@ export default {
justify-content: center;
border-right: 12rpx;
padding: 0 24rpx;
.input-view {
width: 100%;
text-align: center;
}
}
}
......
......@@ -84,10 +84,10 @@ export default {
})
},
// 获取题库列表
async loadList() {
loadList() {
this.loading = true
let param = {}
let res = await this.$u.api
this.$u.api
.getMyQuestionWarehouseList(param)
.then((res) => {
this.loading = false
......
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