代码提交

feature/v-xuexi
wangdong 10 months ago
parent 1cdd79cf9d
commit 7a0ea349da
  1. 54
      pages/learningCenter/reciteDetail.vue
  2. 32
      pages/special/confirm_order.vue
  3. 1
      pages/special/question_index.vue
  4. 9
      pages/topic/question_detail.vue
  5. 25
      pages/topic/question_result.vue
  6. 222
      pages/topic/subjectAnalysisDialog.vue
  7. BIN
      static/images/special/close.png
  8. BIN
      static/images/special/lecturer.png
  9. BIN
      static/images/special/live.png

@ -2,41 +2,41 @@
<BaseContainer class="recite-detail flex">
<NavBar title="详情" />
<view class="detail-box">
<mp-html
v-if="!!content"
class="swiper-conter"
container-style="padding: 30rpx;background: #ffffff;"
:content="content"
></mp-html>
<!-- <view class="detail-info">
<view class="detail-info">
<view class="info-name flex">
{{ detailInfo.name }}
<view :class="[
<!-- <view :class="[
'iconfont',
detailInfo.collect ? 'iconshoucang2' : 'iconshoucang11',
]" @click="detailInfo.collect = !detailInfo.collect"></view>
]" @click="detailInfo.collect = !detailInfo.collect"></view> -->
</view>
<view class="audio-box">
<view class="audio" :class="{ audioActive: activeAudio === 1 }" @click="activeAudio = 1;">
<text>{{ detailInfo.enAudio }}</text>
<image v-if="activeAudio !== 1" src="@/static/images/learning/audio.png" mode="aspectFill" @click="openAudio"></image>
<image v-else src="@/static/images/learning/audio_active.png" mode="aspectFill" @click="openAudio"></image>
<image v-if="activeAudio !== 1" src="@/static/images/learning/audio.png" mode="aspectFill" @click="openAudio(1)"></image>
<image v-else src="@/static/images/learning/audio_active.png" mode="aspectFill" @click="openAudio(1)"></image>
</view>
<view class="audio" :class="{ audioActive: activeAudio === 2 }" @click="activeAudio = 2;">
<text>{{ detailInfo.uaAudio }}</text>
<image v-if="activeAudio !== 2" src="@/static/images/learning/audio.png" mode="aspectFill" @click="openAudio"></image>
<image v-else src="@/static/images/learning/audio_active.png" mode="aspectFill" @click="openAudio"></image>
<image v-if="activeAudio !== 2" src="@/static/images/learning/audio.png" mode="aspectFill" @click="openAudio(0)"></image>
<image v-else src="@/static/images/learning/audio_active.png" mode="aspectFill" @click="openAudio(0)"></image>
</view>
</view>
<view class="info-remark flex flex-center-x">
<!-- <view class="info-remark flex flex-center-x">
<view>{{ detailInfo.remark }}</view>
<view>单词报错</view>
</view>
<view class="info-adverb">
副词 <text>{{ detailInfo.adverb }}</text>
</view>
</view> -->
</view>
<view class="example">
<mp-html
v-if="!!content"
class="swiper-conter"
container-style="padding: 30rpx;background: #ffffff;"
:content="content"
></mp-html>
<!-- <view class="example">
<view class="title">例句</view>
<view v-for="(item, index) in detailInfo.example" :key="index" class="example-item">
<view class="item-content">
@ -70,9 +70,9 @@
return {
detailInfo: {
collect: false,
name: 'outdoor',
enAudio: '/’aʊtdɔ:(r)/',
uaAudio: '/’aʊtdɔ:r/ ',
name: '',
enAudio: '',
uaAudio: '',
remark: 'adj.户外的;室外的',
adverb: 'outdoors',
example: [
@ -107,15 +107,25 @@
console.log(data);
this.allList = data.filter(v => v.name === this.name)[0].children;
this.chapterId = data.filter(v => v.name === this.name)[0].id;
this.content = this.allList.filter(v => Number(v.id) === Number(this.id))[0].content;
const {content, name, en_name, us_name} = this.allList.filter(v => Number(v.id) === Number(this.id))[0];
this.content = content;
this.detailInfo.name = name;
this.detailInfo.enAudio = en_name;
this.detailInfo.uaAudio = us_name;
this.reciteClock();
console.log(this.allList);
} catch (err) {
console.log(err);
}
},
openAudio() {
openAudio(type) {
const audio = uni.createInnerAudioContext();
audio.src = `http://dict.youdao.com/dictvoice?type=${type}&audio=${this.detailInfo.name}`;
console.log(`http://dict.youdao.com/dictvoice?type=${type}&audio=${this.detailInfo.name}`);
audio.play();
audio.onError((res) => {
console.log(res);
});
},
toNext() {
const index = this.allList.findIndex(v => Number(v.id) === Number(this.id));

@ -123,6 +123,9 @@
aliPayApp,
aliPayWap
} from "@/api/special";
import {
getUserBaseData,
} from "@/api/user";
import { getUserAddressList } from "@/api/auth";
import PayDialog from "@/components/PayDialog/index.vue";
@ -167,19 +170,21 @@
urls: '',
isOpenWeixing: false,
vip_price_subtract: 0,//
userInfo: {},
};
},
onLoad({ cartId }) {
this.cartId = cartId;
this.getData().then(this.getAddress);
},
onShow() {
if (this.isOpenWeixing && this.orderId) {
this.$util.wxh5PayIsSuccess(this.orderId, 1, this)
this.isOpenWeixing = false
}
this.getUserBaseData();
},
computed: {
url() {
@ -257,6 +262,15 @@
},
},
methods: {
async getUserBaseData() {
try {
const { data } = await getUserBaseData();
const {
userInfo,
} = data;
this.userInfo = userInfo;
} catch (error) { }
},
handlePickAddress(id) {
this.addressChecked = id;
this.popupShow = false;
@ -408,7 +422,21 @@
},
successOrder(msg) {
this.$util.showMsg(msg ? msg : "支付成功", 'success');
this.$util.refreshPage("/pages/special/order_store_list?type=1")
setTimeout(() => {
const arr = this.cartInfo.filter(v => v.productInfo.is_virtual === 1);
if (arr.length > 0 && !this.userInfo.email) {
uni.showModal({
title: "提示",
content: `您还未填邮箱,请前往我的-设置里面维护,否则影响虚拟物品发送?`,
showCancel: false,
success: async () => {
this.$util.refreshPage("/pages/special/order_store_list?type=1");
},
});
} else {
this.$util.refreshPage("/pages/special/order_store_list?type=1");
}
}, 1000);
},
extendOrder(msg) {

@ -102,7 +102,6 @@
isOpenWeixing: false,
status: -1,
is_analysis: 0,
special_id: 0,
};
},
onLoad({ id, isMember, is_analysis, special_id }) {

@ -56,13 +56,12 @@
</template>
</view>
<view v-else class="subject">
<view class="subject-title">小王同学想利用中国知网平台查询近1个月内发 表的最新的文献信息她可以利用的数据库有:()</view>
<view class="subject-content">
<textarea v-model.trim="item.user_answer" placeholder-style="input-placeholder" placeholder="请填写你的答案"></textarea>
</view>
</view>
</view>
<view v-if="item.is_correct && is_analysis" class="analysis">
<view v-if="item.question_type <= 3 && item.is_correct && is_analysis" class="analysis">
<view :class="{ no: item.is_correct === 1 }">
回答{{ item.is_correct === 2 ? "正确" : "错误" }}
</view>
@ -97,6 +96,9 @@
>{{ special.title }}</navigator
>
</view>
<view v-if="item.question_type > 3 && item.is_correct && is_analysis" class="analysis">
<view>付费阅卷后才可参考答案</view>
</view>
<view class="pl_per"></view>
</view>
<view class="swiper-pagination abs">
@ -494,6 +496,8 @@ export default {
break;
case 3:
question.questionType = "判断题";
case 4:
question.questionType = "问答题";
break;
}
});
@ -593,6 +597,7 @@ page {
margin: 40rpx 0 30rpx;
}
.subject-content {
margin-top: 30rpx;
::v-deep {
.uni-textarea-placeholder {
color: #BFBFBF;

@ -56,8 +56,10 @@
</view>
</view>
<view class="result-bd">
<view v-for="(item, index) in result.test_paper_question"
:class="{ no: item.is_correct === 1, ok: item.is_correct === 2 }">{{ index + 1 }}</view>
<template v-for="(item, index) in result.test_paper_question">
<view :class="{ no: item.is_correct === 1, ok: item.is_correct === 2 }">{{ index + 1 }}</view>
</template>
<text class="answer-analysis" @click="openAnalysis">主观题答案解析</text>
</view>
<view v-if="!footerHidden" class="result-ft">
<navigator :url="`/pages/topic/question_sheet?is_analysis=1&test_id=${test_id}&record_id=${result.id}&check_analysis=1`">查看解析
@ -67,6 +69,7 @@
</view>
<view :class="{ mask: imgSrc }" @touchmove.prevent @click="imgSrc = ''"></view>
<image v-if="imgSrc" :src="imgSrc" class="certificate-image" />
<subject-analysis-dialog ref="subjectAnalysisDialog" :id="test_id"/>
</view>
</BaseContainer>
</template>
@ -81,7 +84,12 @@ import {
import {
getUserBaseData,
} from "@/api/user";
import subjectAnalysisDialog from './subjectAnalysisDialog.vue';
export default {
components: {
subjectAnalysisDialog,
},
data() {
return {
test_id: 0,
@ -346,6 +354,9 @@ export default {
console.error(error);
});
},
openAnalysis() {
this.$refs.subjectAnalysisDialog.show = true;
},
},
};
</script>
@ -406,6 +417,16 @@ page{
margin: auto;
background: #ffffff;
}
.result-bd {
.answer-analysis {
display: flex;
white-space: nowrap;
height: 72rpx;
align-items: center;
color: #3293FF;
margin: 18rpx 18rpx;
}
}
.result-ft{
margin: 126rpx -12rpx 0 !important;
}

@ -0,0 +1,222 @@
<template>
<view v-if="show" class="dialog-mask">
<view class="dialog-box">
<view class="box-title">主观题答案解析</view>
<view class="box-content">
<view class="content-item" @click="payDialogOpen = true">
<image src="@/static/images/special/lecturer.png" mode="aspectFill" style="height: 101rpx;"></image>
<view class="item-info">
<view>人工阅卷</view>
<view>真人老师付费阅卷</view>
</view>
<text class="more"></text>
</view>
<view class="content-item" @click="payDialogOpen = true">
<image src="@/static/images/special/live.png" mode="aspectFill" style="height: 93rpx;"></image>
<view class="item-info">
<view>直播阅卷</view>
<view>真人老师付费阅卷</view>
</view>
<text class="more"></text>
</view>
</view>
</view>
<image src="@/static/images/special/close.png" mode="aspectFill" class="guanbi" @click="show = false;"></image>
<PayDialog :open.sync="payDialogOpen" :money="Number(money)"
:now_money="nowMoney" :pay_type_num="pay_type_num" :special_id="Number(id || 0)" :template-id="templateId"
:is-wechat="isWechat" :is-yue="isYue" :wxpay-h5="wxpayH5" :is-alipay="isAlipay" :is-balance="isBalance" @change="onChange"
:isMember="!!isMember" :isMembership="true" :memberMoney="member_money" />
</view>
</template>
<script>
import PayDialog from "@/components/PayDialog/index.vue";
import { getAuthInfo } from "@/api/auth";
export default {
components: {
PayDialog,
},
props: {
id: {
type: String,
default: () => '',
}
},
data() {
return {
show: false,
payDialogOpen: false, //
money: 10,
nowMoney: 0,
member_money: 10,
pay_type_num: 60,
special_id: 0,
orderId: "",
isMember: false,
isWechat: false,
isYue: true,
templateId: "",
wxpayH5: false,
isAlipay: false,
isBalance: false,
isOpenWeixing: false,
status: -1,
is_analysis: 0,
special_id: 0,
};
},
watch: {
show() {
if (this.show) {
this.getAuthInfo();
}
},
},
methods: {
async getAuthInfo() {
const res = await getAuthInfo();
const { nowMoney, isWechat, isAlipay, isBalance, wxpayH5 } = res.data
Object.assign(this, {
nowMoney,
isWechat,
isAlipay,
isBalance,
wxpayH5
})
},
onChange(obj) {
if (typeof obj != "object") {
obj = {};
}
var action = obj.action || "";
var value = obj.value || "";
this[action] && this[action](value);
},
pay_order(data) {
this.orderId = data.data.result.orderId || "";
switch (data.data.status) {
case "WECHAT_PAY":
this.wechatPay(data.data.result.jsConfig);
break;
case "WECHAT_ROUTINE_PAY":
this.$util.wechatRoutinePay(data.data.result.jsConfig, this);
break;
case "WECHAT_H5_PAY":
this.payDialogOpen = false;
this.$util.wechatH5Pay(data.data.result.jsConfig, this);
break;
case "ZHIFUBAO_PAY":
this.aliPay(data.data.result, "testpaper")
break;
case "SUCCESS":
this.successOrder(data.msg);
break;
case 'TOUTIAO_PAY':
this.$util.toutiaoPay(data.data.result.jsConfig, this);
break;
case 'KUAISHOU_PAY':
this.$util.kuaishouPay(data.data.result.jsConfig, this);
break
default:
this.extendOrder(data.msg);
break;
}
},
aliPay(msn, type) {
this.$util.aliPay(msn, type, this)
},
wechatPay(config) {
this.$util.weixinpay(config, this)
},
successOrder(msg) {
this.$util.showMsg(msg ? msg : "支付成功");
this.payDialogOpen = false;
this.question.isPay = true;
},
extendOrder(msg) {
if (typeof msg === "object") {
if (msg.errMsg === "chooseWXPay:cancel") {
msg = "微信支付取消";
} else {
msg = "支付失败";
}
} else {
msg = "支付失败";
}
this.payDialogOpen = false
this.$util.showMsg(msg)
},
}
};
</script>
<style lang="scss" scoped>
.dialog-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 99;
.dialog-box {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 100;
padding: 60rpx 30rpx;
background: linear-gradient(to bottom, #BED3FE 0%, #fff 100%);
box-shadow: 0rpx 3rpx 2rpx 0rpx rgba(255,255,255,0.69);
border-radius: 50rpx;
border: 1px solid #FFFFFF;
width: 610rpx;
.box-title {
color: #333333;
font-size: 34rpx;
text-align: center;
font-weight: bold;
margin-bottom: 30rpx;
}
.box-content {
display: flex;
align-items: center;
flex-direction: column;
.content-item {
width: 524rpx;
height: 150rpx;
background: #F3F6FD;
border-radius: 20rpx;
border: 1px solid #92BCF4;
display: flex;
align-items: center;
padding: 24rpx 40rpx 24rpx 20rpx;
margin-bottom: 20rpx;
image {
width: 105rpx;
}
.item-info {
color: #333333;
font-size: 28rpx;
line-height: 28rpx;
>view:last-child {
color: #999999;
margin-top: 16rpx;
}
}
.more {
border-color: #0F74BB;
}
}
}
}
.guanbi {
position: absolute;
left: 50%;
top: 80%;
transform: translate(-50%, -50%);
width: 54rpx;
height: 54rpx;
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Loading…
Cancel
Save