Browse Source

知识库

h5_css
yanyan 3 years ago
parent
commit
a77cad598d
  1. 8
      pages.json
  2. 76
      pages/knowledge/knowledge.vue
  3. 39
      subpkg/complete/complete.vue
  4. 1
      subpkg/message/message.vue
  5. 38
      subpkg/role/role.vue

8
pages.json

@ -170,6 +170,14 @@
"enablePullDownRefresh" : false, "enablePullDownRefresh" : false,
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},
{
"path" : "knowledgeInfo/knowledgeInfo",
"style" :
{
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false
}
}] }]
}], }],
"globalStyle": { "globalStyle": {

76
pages/knowledge/knowledge.vue

@ -1,26 +1,20 @@
<template> <template>
<view class="wrap"> <view class="wrap">
<view class="stabar"></view> <view class="stabar"></view>
<view class="secbar"> <view class="secbar">
<view class="title">知识库</view> <view class="title">知识库</view>
</view>
<view class="mainwrap2">
<view class="subwrap">
<view class="artlist">
<view class="timetop">2024-02-19 04:21</view>
<view class="txtlist">凌晨突发6.2级地震!这份逃生避险指南,请收藏</view>
</view>
<view class="artlist">
<view class="timetop">2024-02-19 04:21</view>
<view class="txtlist">应急科普 | 注意防范!大范围雨雪进入鼎盛期 </view>
</view> </view>
</view> <view class="mainwrap2">
</view> <view class="subwrap">
<tabbar :page="page"></tabbar> <view class="message-list">
<view class="artlist" v-for="(item, i) in knowledgeList" :key="i" @click="navClickHandler(item)">
<view class="timetop">{{item.createTime}}</view>
<view class="txtlist">{{item.title}}</view>
</view>
</view>
</view>
</view>
<tabbar :page="page"></tabbar>
</view> </view>
</template> </template>
@ -30,17 +24,49 @@
data() { data() {
return { return {
page: "", page: "",
queryObj:{
pageNum:1,
pageSize:10
},
total:0,
isloading:false,
//数据列表
knowledgeList:[]
}; };
}, },
onShow() { onShow() {
this.page= "know" this.page= "know"
}, },
onLoad() {
methods: { this.getContentList();
}, },
components: {tabbar} methods:{
async getContentList() {
this.isloading = true
const {
data: res
} = await uni.$http.post('/small/library/listApp',this.queryObj)
this.isloading = false
res.rows.forEach(item=>{
item.uploadPath = uni.$http.baseUrl +item.uploadPath
})
this.knowledgeList =[...this.knowledgeList,...res.rows]
this.total = res.total
},
navClickHandler(item) {
uni.navigateTo({
url: '/subpkg/knowledgeInfo/knowledgeInfo?guid='+item.guid
})
}
},
onReachBottom(){
if(this.queryObj.pageNum * this.queryObj.pageSize >= this.total) return uni.$showMsg('已展示所有内容')
if(this.isloading) return
this.queryObj.pageNum++
this.getContentList()
},
components: {tabbar},
} }
</script> </script>

39
subpkg/complete/complete.vue

@ -6,7 +6,7 @@
<image class="animg" src="/static/images/joy.png"></image> <image class="animg" src="/static/images/joy.png"></image>
</view> </view>
<view class="mainwrap3"> <view class="mainwrap">
<view class="title">恭喜完成本次演练!</view> <view class="title">恭喜完成本次演练!</view>
<view class="question-wrap"> <view class="question-wrap">
<view class="question-list"> <view class="question-list">
@ -52,7 +52,7 @@
</view> </view>
</view> </view>
<view class="popup-share" v-if="showShare"> <view class="popup-share" v-if="showShare">
<label class="closesty" @click="closeShare()"></label> <view @click="closeShare()" style="margin-left: 250px;">关闭</view>
<label class="medimg"><image src="/static/images/medal_1.png"></image></label> <label class="medimg"><image src="/static/images/medal_1.png"></image></label>
<view class="congrat">恭喜你获得1枚成就勋章!</view> <view class="congrat">恭喜你获得1枚成就勋章!</view>
<view class="perinfo"> <view class="perinfo">
@ -77,7 +77,6 @@
return { return {
"questionFreId":"59088ceb55644b03b8d0c7d48d2f7d39", "questionFreId":"59088ceb55644b03b8d0c7d48d2f7d39",
"roleId":"5f96b1baae1a47fbb17215a5dc46f5ce", "roleId":"5f96b1baae1a47fbb17215a5dc46f5ce",
"sceneId": "",
questionList: [], questionList: [],
recordList: [], recordList: [],
"ask":"", "ask":"",
@ -111,7 +110,7 @@
this.showMedal = false this.showMedal = false
this.showLayer = false this.showLayer = false
clearTimeout(this.timer) clearTimeout(this.timer)
}, 1000) }, 5000)
//this.roleId = options.roleId //this.roleId = options.roleId
//this.questionFreId = options.questionFreId //this.questionFreId = options.questionFreId
this.getQuestionList() this.getQuestionList()
@ -150,15 +149,6 @@
//uni.$showMsg('数据请求成功!') //uni.$showMsg('数据请求成功!')
}, },
async editUserMedal() {
const {
data: res
} = await uni.$http.post('/small/wechat/editUserMedal',{medal:this.sceneId})
if (!res.success) return uni.$showMsg()
// this.recordList = res.data
//uni.$showMsg('数据请求成功!')
},
backIndex(){ backIndex(){
uni.switchTab({ uni.switchTab({
url:'/pages/index/index' url:'/pages/index/index'
@ -203,7 +193,7 @@
z-index: 999; z-index: 999;
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: rgba(0, 0, 0, .35); background-color: rgba(0, 0, 0, .5);
} }
.popup-layer, .popup-share { .popup-layer, .popup-share {
//display: none; //display: none;
@ -251,11 +241,6 @@
} }
} }
.mainwrap3 {
top: 56rpx;
overflow-y: auto;
}
.title { .title {
margin: 50rpx 0; margin: 50rpx 0;
color: #333; color: #333;
@ -293,12 +278,12 @@
} }
.answer-content { .answer-content {
//display: none; //display: none;
position: relative; position: absolute;
z-index: 100; z-index: 100;
margin: 2% 3%; margin: 2% 3%;
padding: 2%; padding: 2%;
width: 90%; width: 90%;
min-height: 400rpx; height: 400rpx;
background: #fff; background: #fff;
border: 1px solid #18c569; border: 1px solid #18c569;
border-radius: 10px; border-radius: 10px;
@ -333,19 +318,19 @@
} }
view { view {
color: #666; color: #666;
line-height: 1.5; line-height: 1.75;
} }
} }
.question-record { .question-record {
margin: 3% 3% 5%; margin: 6% 3% 10%;
width: 94%; width: 94%;
height: 25%; height: 45%;
overflow: hidden; overflow: hidden;
label { label {
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
line-height: 2; line-height: 2;
} }
.list { .list {
width: 100%; width: 100%;

1
subpkg/message/message.vue

@ -31,7 +31,6 @@
}, },
navClickHandler(item) { navClickHandler(item) {
console.log(item)
uni.navigateTo({ uni.navigateTo({
url: '/subpkg/messageInfo/messageInfo?guid='+item.guid url: '/subpkg/messageInfo/messageInfo?guid='+item.guid
}) })

38
subpkg/role/role.vue

@ -1,22 +1,22 @@
<template> <template>
<view class="role-container"> <view class="role-container">
<view class="wrap"> <view class="wrap">
<view class="stabar"></view> <view class="secbar"> <span class="back" @click="back()"></span></view>
<view class="secbar"> <label class="back" @click="back()"></label></view>
<view class="mainwrap3"> <view class="mainwrap3">
<img src="/static/images/bg_role.jpg" alt=""/> <img src="/static/images/bg_role.jpg" alt=""/>
<view class="role_wrap"> <view class="role_wrap">
<view class="contit">请选择您在“<font style="color:#fd6d1f;">{{sceneName}}</font>”演练中的角色:</view> <view class="<strong>contit</strong>">请选择您在“<font style="color:#fd6d1f;">{{sceneName}}</font>”演练中的角色:</view>
<view class="role_box"> <view class="role_box">
<block class="role-item" v-for="(item,i) in roleList" :key="i"> <block class="role-item" v-for="(item,i) in roleList" :key="i">
<span :class="item.choose === 'true' ? 'change_color':''" @click="chooseRole(item)">{{item.name}}</span> <span :class="item.choose === 'true' ? 'change_color':''" @click="chooseRole(item)">{{item.name}}</span>
<!-- <span class="spanitem" @click="chooseRole(item)">{{item.name}}</span> --> <!-- <span class="spanitem" @click="chooseRole(item)">{{item.name}}</span> -->
</block> </block>
</view> </view>
<!-- <view class="more_role" @click="showMoreRole()"><a>更多角色</a></view> --> <view class="more_role" @click="showMoreRole()"><a>更多角色</a></view>
</view> </view>
<view :class="practice"><image src="/static/images/btn_start.png" @click="startPractice()"></image><a>开始演练</a></view> <view class="startbtn"><image src="/static/images/btn_start.png" @click="startPractice()"></image><a>开始演练</a></view>
</view> </view>
<view class="cnote">题目来源:深圳市******有限公司</view> <view class="cnote">题目来源:深圳市******有限公司</view>
@ -70,8 +70,7 @@
sceneName:"", sceneName:"",
roleId:"", roleId:"",
roleList:[], roleList:[],
practice:"startbtn" practice:false
}; };
}, },
onLoad(options) { onLoad(options) {
@ -100,12 +99,10 @@
if (item.choose === "true") { if (item.choose === "true") {
this.$set(item, 'choose', 'false') this.$set(item, 'choose', 'false')
this.roleId = '' this.roleId = ''
this.practice = 'startbtn'
} else if(item.choose === "false"){ } else if(item.choose === "false"){
this.roleList.forEach(item=>{this.$set(item, 'choose', 'false')}) this.roleList.forEach(item=>{this.$set(item, 'choose', 'false')})
this.$set(item, 'choose', 'true') this.$set(item, 'choose', 'true')
this.roleId = item.guid this.roleId = item.guid
this.practice = 'startbtn.active'
} }
}, },
startPractice(item) { startPractice(item) {
@ -114,7 +111,7 @@
} }
uni.navigateTo({ uni.navigateTo({
url: '/subpkg/practice/practice?roleId='+this.roleId url: '/subpkg/practice/practice?roleId='+this.roleId
// url: '/subpkg/respractice/respractice?roleId='+this.roleId //url: '/subpkg/practice/respractice?roleId='+this.roleId
}) })
}, },
back(){ back(){
@ -132,9 +129,17 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.secbar {
top: 0;
z-index: 1;
}
.secbar ._span.back {
top: 50px;
}
.mainwrap3 { .mainwrap3 {
top: 90rpx; top: 0;
height: calc(100% - 70px);
overflow: hidden;
} }
.mainwrap3 > img { .mainwrap3 > img {
@ -150,10 +155,6 @@
width: 94%; width: 94%;
} }
.contit {
margin: 3% 0;
}
.role_box { .role_box {
margin: 1% 0 2% 4%; margin: 1% 0 2% 4%;
width: 96%; width: 96%;
@ -307,9 +308,8 @@
line-height: 3.0; line-height: 3.0;
letter-spacing: 2px; letter-spacing: 2px;
} }
.change_color { .change_color{
background: #1367fe; background:rgba(138, 162, 254, 1.0);
color: #fff !important;
} }

Loading…
Cancel
Save