作者 lihongjuan

考试部分

<template>
<div>
<div class="tiezhlist">
<div
class="tieziitem"
v-for="(item, index) in tiezilist"
:key="index"
@click="fenlei != 3 ? luntandetail(item) : ''"
>
<div class="tiezitop flexone">
<div class="tieziimg">
<img :src="item.user.avatar" alt="" />
</div>
<div class="tieziright">
<div class="tiezirighttop flex">
<div>
<div class="tieziming">{{ item.user.nickname }}</div>
<div class="tiezifen">30分钟</div>
</div>
<div>
<div class="vipimg" v-if="item.forum_type == 1">
<img src="../assets/vip_icon@2x.png" alt="" />
<div class="vipname">{{ item.user.level.name1 }}</div>
</div>
<div class="tiezizhuan">
面坊转让
</div>
</div>
<img
src="../assets/banggong_icon@2x.png"
class="banggongimg"
alt=""
/>
<img
src="../assets/peisong_icon@2x.png"
class="banggongimg"
alt=""
/>
<img
src="../assets/yirenzheng_icon@2x.png"
class="banggongimg"
alt=""
/>
</div>
<div class="tiezibto flexone"></div>
</div>
</div>
<div class="tiezicontent">
<div class="teizicontenttop flextwo">
<div class="tiezicontentname">{{ item.title }}</div>
<!-- <img
src="../assets/xingxing_icon@2x.png"
alt=""
class="starimg"
/>
<img
src="../assets/weishoucang_icon@2x.png"
alt=""
class="starimg"
/> -->
</div>
<div class="tieziwordbox" v-html="item.content"></div>
<div
class="teiziimgbox flexone"
v-if="item.video != null"
@click.stop="govideo(item.video)"
>
<div class="videoimg">
<img :src="item.video_image" alt="" />
<img src="../assets/bofang_icon@2x.png" alt="" class="videobtn" />
</div>
</div>
<div class="teiziimgbox flexone" v-if="item.images != null">
<div
class="tieziimgimg"
v-for="(item, indexk) in item.images"
:key="indexk"
@click.stop="previewimg(index, indexk, item)"
>
<img :src="item" alt="" />
</div>
</div>
<div class="tiezipingbot">
<div class="teizipingitem flexone" v-if="item.comment != 0">
<img src="../assets/pinglun_icon@2x.png" alt="" class="lunimg" />
{{ item.comment }}
</div>
<div
class="teizipingitem flexone"
@click.stop="
fenlei != 3 ? praisedian(item, index) : pingpraise(item, index)
"
>
<img
src="../assets/zan_icon@2x.png"
alt=""
class="lunimg zanimg"
v-if="item.is_praise == 1"
/>
<img
src="../assets/nodianzan.png"
alt=""
class="lunimg zanimg"
v-if="item.is_praise == 2"
/>
{{ item.praise }}
</div>
<div class="teizipingitem flexone">
<img
src="../assets/cai_icon@2x.png"
alt=""
class="lunimg zanimg"
/>
1005
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import wx from "weixin-js-sdk";
import Vue from "vue";
import { Toast } from "vant";
Vue.use(Toast);
export default {
props: ["tiezilist", "showpull", "fenlei"],
dta() {
return {
tiezilist: []
};
},
created() {
this.getappid();
},
methods: {
// 获取appid
getappid() {
let that = this;
console.log(34734894890);
let urlk = window.location.href;
var url = "/api/user/get_jssdk";
let param = {
url: urlk
};
that.$axios
.post(url, param)
.then(function(res) {
console.log(res, "jssdkjsskd");
wx.config({
debug: false,
appId: res.data.appId, // 和获取Ticke的必须一样------必填,公众号的唯一标识
timestamp: res.data.timestamp, // 必填,生成签名的时间戳
nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
signature: res.data.signature, // 必填,签名,见附录1
//需要分享的列表项:发送给朋友,分享到朋友圈,分享到QQ,分享到QQ空间
jsApiList: ["previewImage"]
});
})
.catch(function(err) {
console.log(err);
});
},
// 点赞和取消点赞
praisedian(item, index) {
let that = this;
if (that.tiezilist[index].is_praise == 2) {
Toast("点赞成功");
that.tiezilist[index].is_praise = 1;
that.tiezilist[index].praise = that.tiezilist[index].praise + 1;
} else {
Toast("取消点赞成功");
that.tiezilist[index].is_praise = 2;
that.tiezilist[index].praise = that.tiezilist[index].praise - 1;
}
that.tiezilist = that.tiezilist;
var url = "/api/forum/praise";
var params = {
forum_id: item.id
};
console.log("参数", params);
that.$axios
.post(url, params)
.then(res => {
console.log(res);
})
.catch(err => {
console.log(err);
});
},
// 我的评论赞
pingpraise(item, index) {
let that = this;
console.log(item, index);
if (this.tiezilist[index].is_praise == 2) {
Toast("点赞成功");
this.tiezilist[index].is_praise = 1;
this.tiezilist[index].praise = this.tiezilist[index].praise + 1;
} else {
this.tiezilist[index].is_praise = 2;
this.tiezilist[index].praise = this.tiezilist[index].praise - 1;
Toast("取消点赞成功");
}
this.tiezilist = this.tiezilist;
var url = "/api/comments/praise";
var params = {
comments_id: item.id
};
console.log("参数", params);
that.$axios
.post(url, params)
.then(res => {})
.catch(err => {
console.log(err);
});
},
// 论坛详情
luntandetail(item) {
this.$router.push({
path: "/tiezidetail",
query: { id: item.id }
});
},
// 进入video
govideo(src) {
console.log(src);
this.$router.push({
path: "/videoplay",
query: { url: src }
});
},
// 预览图片
previewimg(index, indexk, item) {
wx.previewImage({
current: item, // 当前显示图片的http链接
urls: this.tiezilist[index].images // 需要预览的图片http链接列表
});
}
}
};
</script>
<style scoped>
@import "./style/homepage.css";
</style>
... ...
<template>
<div>
<div class="tiezhlist">
<div
class="tieziitem"
v-for="(item, index) in tiezilist"
:key="index"
@click="luntandetail(item)"
>
<div class="tiezitop flexone">
<div class="tieziimg">
<img :src="item.user.avatar" alt="" />
</div>
<div class="tieziright">
<div class="tiezirighttop flex">
<div>
<div class="tieziming">{{ item.user.nickname }}</div>
<div class="tiezifen">30分钟</div>
</div>
<div>
<div class="vipimg" v-if="item.forum_type == 1">
<img src="../assets/vip_icon@2x.png" alt="" />
<div class="vipname">{{ item.user.level.name1 }}</div>
</div>
<div class="tiezizhuan">
面坊转让
</div>
</div>
<img
src="../assets/banggong_icon@2x.png"
class="banggongimg"
alt=""
/>
<img
src="../assets/peisong_icon@2x.png"
class="banggongimg"
alt=""
/>
<img
src="../assets/yirenzheng_icon@2x.png"
class="banggongimg"
alt=""
/>
</div>
<div class="tiezibto flexone"></div>
</div>
</div>
<div class="tiezicontent">
<div class="teizicontenttop flextwo">
<div class="tiezicontentname">{{ item.title }}</div>
<!-- <img
src="../assets/xingxing_icon@2x.png"
alt=""
class="starimg"
/>
<img
src="../assets/weishoucang_icon@2x.png"
alt=""
class="starimg"
/> -->
</div>
<div class="tieziwordbox" v-html="item.content"></div>
<div
class="teiziimgbox flexone"
v-if="item.video != null"
@click.stop="govideo(item.video)"
>
<div class="videoimg">
<img :src="item.video_image" alt="" />
<img src="../assets/bofang_icon@2x.png" alt="" class="videobtn" />
</div>
</div>
<div class="teiziimgbox flexone" v-if="item.images != null">
<div
class="tieziimgimg"
v-for="(item, indexk) in item.images"
:key="indexk"
@click.stop="previewimg(index, indexk, item)"
>
<img :src="item" alt="" />
</div>
</div>
<div class="tiezipingbot">
<div class="teizipingitem flexone" v-if="item.comment != 0">
<img src="../assets/pinglun_icon@2x.png" alt="" class="lunimg" />
{{ item.comment }}
</div>
<div
class="teizipingitem flexone"
@click.stop="praisedian(item, index)"
>
<img
src="../assets/zan_icon@2x.png"
alt=""
class="lunimg zanimg"
v-if="item.is_praise == 1"
/>
<img
src="../assets/nodianzan.png"
alt=""
class="lunimg zanimg"
v-if="item.is_praise == 2"
/>
{{ item.praise }}
</div>
<div class="teizipingitem flexone">
<img
src="../assets/cai_icon@2x.png"
alt=""
class="lunimg zanimg"
/>
1005
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import wx from "weixin-js-sdk";
import Vue from "vue";
import { Toast } from "vant";
Vue.use(Toast);
export default {
props: ["tiezilist", "showpull"],
dta() {
return {
tiezilist: []
};
},
created() {
this.getappid();
},
methods: {
// 获取appid
getappid() {
let that = this;
console.log(34734894890);
let urlk = window.location.href;
var url = "/api/user/get_jssdk";
let param = {
url: urlk
};
that.$axios
.post(url, param)
.then(function(res) {
console.log(res, "jssdkjsskd");
wx.config({
debug: false,
appId: res.data.appId, // 和获取Ticke的必须一样------必填,公众号的唯一标识
timestamp: res.data.timestamp, // 必填,生成签名的时间戳
nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
signature: res.data.signature, // 必填,签名,见附录1
//需要分享的列表项:发送给朋友,分享到朋友圈,分享到QQ,分享到QQ空间
jsApiList: ["previewImage"]
});
})
.catch(function(err) {
console.log(err);
});
},
// 点赞和取消点赞
praisedian(item, index) {
let that = this;
if (that.tiezilist[index].is_praise == 2) {
Toast("点赞成功");
that.tiezilist[index].is_praise = 1;
that.tiezilist[index].praise = that.tiezilist[index].praise + 1;
} else {
Toast("取消点赞成功");
that.tiezilist[index].is_praise = 2;
that.tiezilist[index].praise = that.tiezilist[index].praise - 1;
}
that.tiezilist = that.tiezilist;
var url = "/api/forum/praise";
var params = {
forum_id: item.id
};
console.log("参数", params);
that.$axios
.post(url, params)
.then(res => {
console.log(res);
})
.catch(err => {
console.log(err);
});
},
// 论坛详情
luntandetail(item) {
this.$router.push({
path: "/tiezidetail",
query: { id: item.id }
});
},
// 进入video
govideo(src) {
console.log(src);
this.$router.push({
path: "/videoplay",
query: { url: src }
});
},
// 预览图片
previewimg(index, indexk, item) {
wx.previewImage({
current: item, // 当前显示图片的http链接
urls: this.tiezilist[index].images // 需要预览的图片http链接列表
});
}
}
};
</script>
<style scoped>
@import "./style/homepage.css";
</style>
... ...
... ... @@ -3,72 +3,34 @@
<!-- <div class="nodata" v-if="present_data==''">暂无考试内容</div> -->
<div>
<div class="texttitle">
考试题目一
<!-- {{ present_data.question_name }}({{
{{ present_data.question_name }}({{
present_data.type == 1 ? "单选" : "多选"
}}) -->
<!-- 单选 -->
}})
</div>
<!-- v-if="issure" -->
<div class="textlist">
<div class="textitem flex">
<div class="flex">
<!-- v-if="item.chose == true" -->
<div class="textitemleft">
<img src="../../../assets/meisel.png" alt="" />
<!-- <image src="../../static/meisel.png" mode="" v-else></image> -->
</div>
<div class="textitemright">
A。选项
<!-- {{ item.sel }}、{{ item.option_name }} -->
</div>
</div>
</div>
<div class="textitem flex">
<div class="flex">
<!-- v-if="item.chose == true" -->
<div class="textitemleft">
<img src="../../../assets/meisel.png" alt="" />
<!-- <image src="../../static/meisel.png" mode="" v-else></image> -->
</div>
<div class="textitemright">
B.选项
<!-- {{ item.sel }}、{{ item.option_name }} -->
</div>
</div>
</div>
<div class="textitem flex">
<div class="flex">
<!-- v-if="item.chose == true" -->
<div class="textitemleft">
<img src="../../../assets/meisel.png" alt="" />
<!-- <image src="../../static/meisel.png" mode="" v-else></image> -->
</div>
<div class="textitemright">
C。选项
<!-- {{ item.sel }}、{{ item.option_name }} -->
</div>
</div>
</div>
<div class="textitem flex">
<div class="textlist" v-if="issure">
<div
class="textitem flex"
v-for="(item, index) in present_data.option"
:key="index"
@click="selchose(index)"
>
<div class="flex">
<!-- v-if="item.chose == true" -->
<div class="textitemleft">
<img src="../../../assets/meisel.png" alt="" />
<!-- <image src="../../static/meisel.png" mode="" v-else></image> -->
<img
src="../../../assets/selright.png"
alt=""
v-if="item.chose == true"
/>
<img src="../../../assets/meisel.png" alt="" v-else />
</div>
<div class="textitemright">
D。选项
<!-- {{ item.sel }}、{{ item.option_name }} -->
{{ item.sel }}、{{ item.option_name }}
</div>
</div>
</div>
</div>
<!-- <div class="textlist" v-else>
<div class="textlist" v-else>
<div
class="textitem flex"
:class="
... ... @@ -84,32 +46,32 @@
<div class="flex">
<div class="textitemleft">
<image
src="../../static/selright.png"
src="../../../assets/selright.png"
mode=""
v-if="item.answer == 1"
></image>
<image
src="../../static/slewrong.png"
src="../../../assets/slewrong.png"
mode=""
v-else-if="item.answer == 2 && item.chose == true"
></image>
<image src="../../static/meisel.png" mode="" v-else></image>
<image src="../../../assets/meisel.png" mode="" v-else></image>
</div>
<div class="textitemright">
{{ item.sel }}、{{ item.option_name }}
</div>
</div>
<div class="wrongimg" v-if="item.answer == 2 && item.chose == true">
<image src="../../static/wrong.png" mode=""></image>
<image src="../../../assets/wrong.png" mode=""></image>
</div>
</div>
</div> -->
</div>
<div class="huiyuanbot boxsizing">
<!-- v-if="issure" -->
<div>
<div class="behuiyuanbtn">确认</div>
<div v-if="issure">
<div class="behuiyuanbtn" @click="sureti">确认</div>
</div>
<!-- <div v-else>
<div v-else>
<div
class="behuiyuanbtn"
@click="nextquestion"
... ... @@ -121,14 +83,248 @@
<div v-else>
<div class="behuiyuanbtn" v-if="showfinish">完成</div>
<div class="behuiyuanbtn" @click="sure" v-else>完成</div>
</div> -->
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {};
import { Toast } from 'vant';
export default {
data() {
return {
questionnaire_id: '',
present_data: '',
last_data: '',
next_data: '',
question_id: '',
score: 0,
selitem: 0,
//是否在上一题返回的下一题
islast: 0,
present_datakarr: [],
issure: true,
showfinish: false
}
},
created() {
this.questionnaire_id = this.$route.query.id;
this.getqusetion();
},
methods: {
getqusetion() {
let that = this;
var url = '/api/question/get_question';
var params = {
questionnaire_id: that.questionnaire_id,
question_id: that.question_id
}
console.log(params)
that.$axios.post(url, params).then((res) => {
console.log(res);
console.log(res.data.present_data)
that.present_data = res.data.present_data;
that.present_data.canchose = 0;
that.present_data.option.forEach(function (value, index, array) {
value.chose = false;
switch (index) {
case 0:
value.sel = 'A';
break;
case 1:
value.sel = 'B';
break;
case 2:
value.sel = 'C';
break;
case 3:
value.sel = 'D';
break;
}
})
that.present_data = that.present_data;
that.last_data = res.data.last_data;
that.next_data = res.data.next_data;
// 查看题目答案是否正确t("present_datakarr");
let newpresent_datakarr = JSON.parse(localStorage.getItem("present_datakarr"));
if (newpresent_datakarr != null) {
console.log(newpresent_datakarr)
newpresent_datakarr.forEach(function (value, index, array) {
// console.log(348934,value)
// console.log('1111',that.present_data)
if (value.id == that.present_data.id) {
that.present_data = value;
// console.log(that.present_data)
}
})
}
}).catch((err) => {
console.log(err)
})
},
// 选择题目
selchose(index) {
let that = this;
that.selitem++;
that.present_data.canchose++;
console.log('选中的题数', that.present_data.canchose)
that.present_data.option.forEach(function (value, indexk, array) {
if (that.present_data.correct_number == 1) {
if (index == indexk) {
value.chose = true;
// value.canchose++;
that.$forceUpdate();
} else {
value.chose = false;
that.$forceUpdate();
}
} else {
if (index == indexk) {
value.chose = true;
that.$forceUpdate();
}
}
})
that.present_data = that.present_data;
if (that.present_data.correct_number == 1) {
that.present_data.option.forEach(function (value, index, array) {
if (value.chose == true && value.answer == 1) {
that.score = that.score + that.present_data.score;
}
})
} else {
let arr = []
that.present_data.option.forEach(function (value, index, array) {
if (value.chose == true && value.answer == 1) {
arr.push(1)
}
if (arr.length == that.present_data.correct_number) {
that.score = that.score + that.present_data.score;
}
})
}
console.log(that.present_data)
console.log('考试得分', that.score)
localStorage.setItem("present_datak", JSON.stringify(that.present_data))
localStorage.setItem("last_datak", JSON.stringify(that.last_data));
localStorage.setItem("next_datak", JSON.stringify(that.next_data));
this.present_datakarr.push(this.present_data);
console.log(this.present_datakarr)
localStorage.setItem("present_datakarr", JSON.stringify(this.present_datakarr));
console.log('xiaadsk', that.next_data)
},
//下一题
nextquestion() {
let that = this;
this.question_id = this.next_data.id;
console.log('判断是否答题', that.selitem);
// 判断是否答题
if (that.selitem == 0) {
Toast("请答题")
} else {
that.selitem = 0;
that.getqusetion();
that.issure = true
}
},
// 上一题
prequestion() {
// this.present_data=uni.getStorageSync("present_data");
// this.last_data=uni.getStorageSync("last_data");
// this.next_data=uni.getStorageSync("next_data");
this.question_id = this.last_data.id;
this.islast = 1;
this.getqusetion();
},
// 上一题
prequestion() {
// this.present_data=uni.getStorageSync("present_data");
// this.last_data=uni.getStorageSync("last_data");
// this.next_data=uni.getStorageSync("next_data");
this.question_id = this.last_data.id;
this.islast = 1;
this.getqusetion();
},
sureti() {
console.log(343348989)
let that = this;
let arr = []
console.log(that.present_data.option);
that.present_data.option.forEach(function (value, indexk, array) {
if (value.chose == false) {
arr.push(1)
}
})
console.log(arr)
if (arr.length == that.present_data.option.length) {
Toast('请答题')
return false
}
this.issure = false
this.question_id = this.present_data.id;
this.getqusetion()
},
sure() {
let that = this;
that.showfinish = true
var url = '/api/question/submit_answer';
var params = {
questionnaire_id: that.questionnaire_id,
score: that.score
}
console.log('7766554', params)
that.$axios.post(url, params).then((res) => {
console.log(res);
console.log(that.score)
Toast('提交成功')
localStorage.setItem("present_datak", null)
localStorage.setItem("present_datakarr", null);
this.$router.push({
path: '/kaoshiresult',
query: {
score: that.score,
id: that.questionnaire_id,
is_pass: res.data.is_pass
}
})
}).catch((err) => {
console.log(err)
})
}
}
};
</script>
<style scoped>
... ...
... ... @@ -106,9 +106,7 @@
<img src="../../../assets/vip_icon@2x.png" alt="" />
<div class="vipname">{{ item.user.level.name1 }}</div>
</div>
<div class="tiezizhuan">
面坊转让
</div>
<div class="tiezizhuan">面坊转让</div>
</div>
<img
src="../../../assets/banggong_icon@2x.png"
... ... @@ -394,7 +392,7 @@ export default {
that.$axios
.post(url, param)
.then(function(res) {
.then(function (res) {
console.log(res, "jssdkjsskd");
wx.config({
debug: false,
... ... @@ -408,7 +406,7 @@ export default {
wx.getLocation({
type: "gcj02", // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
success: function(res) {
success: function (res) {
console.log(res, "获取地理位置");
var url =
"https://restapi.amap.com/v3/geocode/regeo?key=735d888fa7a9599eea4de210edc32335&location=" +
... ... @@ -421,7 +419,7 @@ export default {
.then(mapres => {
console.log(mapres, "详细地址");
})
.catch(function(maperr) {
.catch(function (maperr) {
that.proname = maperr.regeocode.addressComponent.province;
if (changename(that.proname) != "") {
that.proname = changename(that.proname);
... ... @@ -432,7 +430,7 @@ export default {
}
});
})
.catch(function(err) {
.catch(function (err) {
console.log(err);
});
},
... ... @@ -517,11 +515,11 @@ export default {
that.$axios
.post(url, param)
.then(function(res) {
.then(function (res) {
that.tiezikind = res.data;
console.log(that.tiezikind);
})
.catch(function(err) {
.catch(function (err) {
console.log(err);
});
},
... ... @@ -543,9 +541,9 @@ export default {
that.$axios
.post(url, param)
.then(function(res) {
.then(function (res) {
that.tiezilist = that.tiezilist.concat(res.data);
that.tiezilist.forEach(function(value, index, array) {
that.tiezilist.forEach(function (value, index, array) {
value.content = that.text(value.content);
});
if (that.page > 1) {
... ... @@ -556,7 +554,7 @@ export default {
}
console.log(that.tiezilist);
})
.catch(function(err) {
.catch(function (err) {
console.log(err);
});
},
... ... @@ -622,31 +620,35 @@ export default {
},
duanshipin(id, item) {
console.log(id, item.id);
if (id == 1) {
if (item.id == 1) {
this.$router.push({
path: "/duanshipinlist",
query: {
id: item.id
}
});
} else if (id == 2) {
} else if (item.id == 2) {
this.$router.push({
path: "/duanshipinlist",
query: {
id: item.id
}
});
} else if (id == 3) {
} else if (item.id == 3) {
this.$router.push({
path: "/duanshipinlist",
query: {
id: item.id
}
});
} else if (id == 4) {
} else if (item.id == 4) {
this.$router.push({
path: "/zhenghunlist"
});
} else if (item.id == 8) {
this.$router.push({
path: "/mykaoshi"
});
}
}
}
... ...
<template>
<div class="resultbox">
<div class="resulttop">
<div class="resultname">100分</div>
<div class="resulttext">恭喜您通过本次考试!</div>
<div class="resultname">{{ score }}分</div>
<div class="resulttext" v-if="is_pass == 2">
对不起您没有通过本次考试,请重新答题
</div>
<div class="resulttext" v-else>恭喜您通过本次考试!</div>
</div>
<div class="lingzheng" @click="lingzheng">点击领证</div>
... ... @@ -33,9 +36,7 @@
</div>
<div class="mianleftitem flexone gonghao">
<div class="mianleftname">面工证号</div>
<div class="mianleftnamek">
202034943934909
</div>
<div class="mianleftnamek">202034943934909</div>
</div>
</div>
<div class="mianright">
... ... @@ -58,9 +59,19 @@
export default {
data() {
return {
miangongshow: false
miangongshow: false,
score: '',
id: '',
is_pass: ''
};
},
created() {
this.score = this.$route.query.score;
console.log(this.score)
this.id = this.$route.query.id;
this.is_pass = this.$route.query.is_pass
},
methods: {
lingzheng() {
this.miangongshow = true;
... ...
<template>
<div class="container">
<div class="mykaoshitop flexone">
<div class="mykaoshitop flexone" v-if="show">
<div class="tieziimg">
<img src="../../../assets/touxiang_img@2x.png" alt="" />
<img :src="userinfo.avatar" alt="" />
</div>
<div class="tieziright">
<div class="tiezirighttop flex">
<div>
<div class="tieziming">中面小麦</div>
<div class="tieziming">{{ userinfo.nickname }}</div>
</div>
<div>
<div class="vipimg">
<img src="../../../assets/vip_icon@2x.png" alt="" />
<div class="vipname">VIP1</div>
<div class="vipname">{{ userinfo.level.name1 }}</div>
</div>
</div>
<img
... ... @@ -36,44 +36,109 @@
</div>
</div>
<div class="kaoshilist flextwo">
<div class="homepageboxitem flexfour">
<img
src="../../../assets/duanzhipin.png"
alt=""
class="homepageitemimg"
/>
<div class="homepageitemname">帮工考试</div>
</div>
<div class="homepageboxitem flexfour">
<img
src="../../../assets/duanzhipin.png"
alt=""
class="homepageitemimg"
/>
<div class="homepageitemname">配送员考试</div>
</div>
<div class="homepageboxitem flexfour">
<img
src="../../../assets/duanzhipin.png"
alt=""
class="homepageitemimg"
/>
<div class="homepageitemname">销售员考试</div>
<div
class="homepageboxitem flexfour"
v-for="(item, index) in questionlist"
:key="index"
@click="examinetext(item)"
>
<img :src="item.image" alt="" class="homepageitemimg" />
<div class="homepageitemname">{{ item.name }}</div>
</div>
</div>
<div class="kaoshirule">
<div class="kaoshiruletitle">考试规则</div>
<div class="kaoshiruletext">
考试规则考试规则考试规则考试规则考试规则考试规则考试规则考试规则
考试规则考试规则考试规则考试规则考试规则考试规则考试规则考试规则考试规则考试规则
考试规则考试规则考试规则考试规则
{{ rulecontent }}
</div>
</div>
</div>
</template>
<script>
export default {};
export default {
data() {
return {
rulecontent: '',//考试规则
userinfo: '',
show: false,
questionlist: []
}
},
created() {
this.getuserinfo()
this.getrulecontent();
this.getquestionlist()
},
methods: {
// 获取用户信息
getuserinfo() {
let that = this;
var url = '/api/member/index';
var params = {
}
console.log('7766554', params)
that.$axios.post(url, params).then((res) => {
console.log('用户信息', res);
that.userinfo = res.data;
setTimeout(function () {
that.show = true
}, 200)
}).catch((err) => {
console.log(err)
})
},
// 获取问卷列表
getquestionlist() {
let that = this;
var url = '/api/question/get_questionnaire';
var params = {
}
console.log('7766554', params)
that.$axios.post(url, params).then((res) => {
console.log(res);
that.questionlist = res.data
}).catch((err) => {
})
},
// 考试规则
getrulecontent() {
let that = this;
var url = '/api/sundry/get_page';
var params = {
id: 5
}
console.log('7766554', params)
that.$axios.post(url, params).then((res) => {
console.log(res);
that.rulecontent = res.data.content == null ? '' : res.data.content
}).catch((err) => {
console.log(err)
})
},
//帮工考试
examinetext(item) {
this.$router.push({
path: '/examinetext',
query: { id: item.id }
})
},
}
};
</script>
<style scoped>
... ...
<template>
<div class="container">
<div class="videobox">
<video
id="video"
:src="url"
loop="loop"
controlslist="nodownload"
height="100%"
width="100%"
controls
autoplay
></video>
</div>
</div>
</template>
<script>
export default {
data() {
return {
url: ""
};
},
created() {
this.url = this.$route.query.url;
document.querySelector("body").style.height = "100%";
document.querySelector("html").style.height = "100%";
document.querySelector("#app").style.height = "100%";
// var vdo = document.getElementById("video");
// vdo.play();
document.title = "中国面条";
console.log(this.url);
},
methods: {}
};
</script>
<style scoped>
#app {
height: 100%;
}
.container,
.videobox {
width: 100%;
height: 100%;
margin-top: 1rem;
}
</style>
... ...
// 判断城市名字是否有市
function changename(value) {
let name = "";
if (value == "天津市") {
name = value.split("市")[0];
} else if (value == "北京市") {
name = value.split("市")[0];
} else if (value == "上海市") {
name = value.split("市")[0];
} else if (value == "重庆市") {
name = value.split("市")[0];
}
return name;
}
export { changename };
\ No newline at end of file
... ...