Commit 2b46ef27 authored by Facius's avatar Facius

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

parents e39f3951 b72a4a28
......@@ -40,6 +40,7 @@
"name": "login",
"style": {
"navigationBarTitleText": "授权登录",
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true
}
......@@ -91,16 +92,6 @@
"disableScroll": true
}
},
{
"path": "detail",
"name": "learnDetail",
"style": {
"navigationBarTitleText": "", // 题库详情
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "selectCategory",
"name": "learnSelectCategory",
......@@ -230,7 +221,10 @@
"path": "detail",
"name": "certDetail",
"style": {
"navigationBarTitleText": "证书详情"
"navigationBarTitleText": "证书详情",
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": false
}
}
]
......
......@@ -292,25 +292,15 @@ export default {
this.currentIndex = current
if (current == NO_PREV_PAGE || current == NO_NEXT_PAGE) {
if (this.requesting) {
uni.showToast({
title: '数据加载中',
icon: 'none',
})
return
return this.$u.toast('数据加载中')
}
if (current == NO_PREV_PAGE) {
return uni.showToast({
title: '已经是第一道试题',
icon: 'none',
})
return this.$u.toast('已经是第一道试题')
}
if (current == NO_NEXT_PAGE) {
return uni.showToast({
title: '已经是最后一道试题',
icon: 'none',
})
return this.$u.toast('已经是最后一道试题')
}
}
......@@ -424,10 +414,7 @@ export default {
}, 0)
if (count === this.total) {
return uni.showToast({
title: '您已经答完全部试题',
icon: 'none',
})
return this.$u.toast('您已经答完全部试题')
}
}
......@@ -617,10 +604,7 @@ export default {
this.list = list
if (this.list.length === 0) {
uni.showToast({
title: '暂无数据',
icon: 'none',
})
this.$u.toast('暂无数据')
setTimeout(() => {
this.$u.route({
delta: 1,
......
......@@ -52,6 +52,7 @@ export default {
data() {
return {
relationId: 0, // 绑卡用
info: {}
}
},
......@@ -99,7 +100,27 @@ export default {
},
})
},
handleClickBuy() {},
handleClickBuy() {
const lists = [
{
questionWarehouseId: this.questionWarehouseId,
amount: this.info.discount,
count: 1,
}
]
const data = {
instrtutionId: getApp().globalData.orgId,
orders: JSON.stringify(lists),
openId: this.openId,
}
uni.showLoading({
title: '加载中',
})
this.$u.api.payOrder(data).then((res) => {
uni.hideLoading()
this.pay(res)
})
},
handleChange() {
this.$u.route({
url: 'pages/learn/manualBinding',
......@@ -108,6 +129,48 @@ export default {
},
})
},
pay(data) {
uni.requestPayment({
provider: 'wxpay',
timeStamp: data.timeStamp,
nonceStr: data.nonce_str,
package: `prepay_id=${data.prepay_id}`,
signType: 'MD5',
paySign: data.sign,
success: (res) => {
console.log('success:' + JSON.stringify(res))
this.checkPayStatus(data.out_trade_no)
},
fail: (err) => {
console.log('fail:' + JSON.stringify(err))
if (err.errMsg === 'requestPayment:fail cancel') {
this.$u.toast('取消支付')
} else {
this.checkPayStatus(data.out_trade_no)
}
},
})
},
checkPayStatus(no) {
const params = {
outTradeNo: no,
}
uni.showLoading({
title: '支付中',
})
this.$u.api.payQuery(params).then((res) => {
uni.hideLoading()
if (res.trade_state === 'SUCCESS') {
this.$u.toast('支付成功')
} else if (res.trade_state === 'NOTPAY') {
this.$u.toast('请稍后核实订单状态,不要重复发起支付')
} else if (res.trade_state === 'PAYERROR') {
this.$u.toast('支付失败')
} else {
this.$u.toast(res.trade_state_desc)
}
})
},
},
}
</script>
......
......@@ -90,7 +90,6 @@
</template>
<script>
import md5 from '@/common/md5.js'
export default {
data() {
return {
......@@ -104,14 +103,7 @@ export default {
multipleChoice: 322,
trueOrFalse: 526,
total: 986,
},
lists: [
{
questionWarehouseId: 1,
amount: 0.01,
count: 1,
},
],
}
}
},
......@@ -214,9 +206,16 @@ export default {
})
},
handleClickBuy() {
const lists = [
{
questionWarehouseId: this.questionWarehouseId,
amount: this.info.discount,
count: 1,
}
]
const data = {
instrtutionId: 1,
orders: JSON.stringify(this.lists),
instrtutionId: getApp().globalData.orgId,
orders: JSON.stringify(lists),
openId: this.openId,
}
uni.showLoading({
......
<template>
<view class="content">
<view>
<uni-icons type="weixin" size="120" color="#04BE02"></uni-icons>
</view>
<view class="text-area">
<button class="bottom" type="primary" @tap="wxLogin">授权登录</button>
<view class="begin-answer">
<u-navbar
back-icon-color="#000000"
background="transparent"
titleColor="#000000"
:border-bottom="false"
title-bold
></u-navbar>
<view class="content">
<view>
<uni-icons type="weixin" size="120" color="#04BE02"></uni-icons>
</view>
<view class="view-image">
<u-image
:src="targetImage"
class="target-image"
width="160"
height="160"
></u-image>
</view>
<view class="target">
<text class="tips">想要轻松考过,首选模考大师</text>
</view>
<view class="text-area">
<button class="bottom" type="primary" @tap="wxLogin">授权登录</button>
</view>
</view>
</view>
</template>
......@@ -17,8 +37,12 @@ export default {
host: '', //配置为自己的额服务器即可
}
},
onShow() {
computed: {
targetImage() {
return process.uniEnv.qn_base_url + 'LOGO@3x.png'
},
},
onShow() {},
methods: {
wxLogin() {
// 获取code 小程序专有,用户登录凭证。
......@@ -40,7 +64,7 @@ export default {
orgId: getApp().globalData.orgId
}
uni.showLoading({
title: '加载中'
title: '加载中',
})
this.$u.api.loginWechatAuth(data).then((res) => {
uni.hideLoading()
......@@ -69,6 +93,23 @@ export default {
</script>
<style>
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
display: none;
}
.begin-answer {
display: flex;
flex-direction: column;
background-color: #ffffff;
background-size: 100% 920rpx;
background-repeat: no-repeat;
height: 120vh;
position: absolute;
top: 0;
width: 100%;
}
.content {
display: flex;
flex-direction: column;
......@@ -78,10 +119,31 @@ export default {
.text-area {
display: flex;
justify-content: center;
position: relative;
margin-top: 500rpx;
}
.bottom {
width: 600rpx;
height: 104rpx;
border-radius: 52rpx;
background-color: #2953ff !important;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
.target {
position: relative;
display: flex;
flex-direction: column;
}
.tips {
font-size: 40rpx;
color: #adbdd4;
margin-top: 64rpx;
}
.target-image {
margin: auto;
padding-top: 450rpx;
}
</style>
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