Browse Source

m代码精简, 删除多余图片视频, 更新视频功能

h5_css
蟑螂恶霸 3 years ago
parent
commit
397f1a066c
  1. 9
      api/question.js
  2. 45
      components/s-video/s-video.vue
  3. 32
      manifest.json
  4. 2
      pages/index/index.vue
  5. 6
      pages/my/my.vue
  6. 12
      static/base_css.css
  7. BIN
      static/cart_border@2x.png
  8. BIN
      static/images/arrow-b.png
  9. BIN
      static/images/arrow-r.png
  10. BIN
      static/images/banner.jpg
  11. BIN
      static/images/banner_mine.jpg
  12. BIN
      static/images/banner_sec.jpg
  13. BIN
      static/images/hpic.jpg
  14. BIN
      static/images/icon_50about.png
  15. BIN
      static/images/icon_50adr.png
  16. BIN
      static/images/icon_50agr.png
  17. BIN
      static/images/icon_50help.png
  18. BIN
      static/images/icon_50idea.png
  19. BIN
      static/images/icon_50msg.png
  20. BIN
      static/images/icon_50priv.png
  21. BIN
      static/images/icon_50set.png
  22. BIN
      static/images/icon_50vip.png
  23. BIN
      static/images/icon_60add.png
  24. BIN
      static/images/icon_base.png
  25. BIN
      static/images/icon_base_2.png
  26. BIN
      static/images/icon_home.png
  27. BIN
      static/images/icon_home_2.png
  28. BIN
      static/images/icon_info.png
  29. BIN
      static/images/icon_info_2.png
  30. BIN
      static/images/icon_mine.png
  31. BIN
      static/images/icon_mine_2.png
  32. BIN
      static/images/icon_scan.png
  33. BIN
      static/images/icon_scan_2.png
  34. BIN
      static/images/icon_sou.png
  35. BIN
      static/images/item_1.jpg
  36. BIN
      static/images/item_2.jpg
  37. BIN
      static/images/logo_header.png
  38. BIN
      static/images/scene_p1.jpg
  39. BIN
      static/images/scene_p2.jpg
  40. BIN
      static/images/scene_p3.jpg
  41. BIN
      static/images/scene_p4.jpg
  42. BIN
      static/images/scene_p5.jpg
  43. BIN
      static/logo.png
  44. BIN
      static/medal_top.jpg
  45. BIN
      static/tab_icons/cate.png
  46. BIN
      static/tab_icons/home.png
  47. BIN
      static/tab_icons/knownledge.png
  48. BIN
      static/tab_icons/my.png
  49. BIN
      static/uni.png
  50. 2
      subpkg/about/about.vue
  51. 2
      subpkg/agreement/agreement.vue
  52. 4
      subpkg/list/list.vue
  53. 4
      subpkg/medal/medal.vue
  54. 2
      subpkg/messageInfo/messageInfo.vue
  55. 2
      subpkg/privacy/privacy.vue
  56. 4
      subpkg/role/role.vue

9
api/question.js

@ -26,3 +26,12 @@ export const addAnswer = (data) => {
data data
}) })
} }
/** 答题 */
export const getAnswerByFreId = (data) => {
return $http({
method: 'POST',
url: 'small/questionAnswer/add',
data
})
}

45
components/s-video/s-video.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="video-wrapper" id="video-container"> <view class="video-wrapper" id="video-container">
<view style="position:relative;width:100%;" :style="{'height':videoHeight+'px'}"> <view style="position:relative;width:100%;" :style="{'height':videoHeight+'px'}">
<video id="video_play" :src="videoObj.videoUrl" @ended="videoEnded()" :autoplay="auto" style="width: 100%;height: 100%;"></video> <video ref="video_p" :initial-time="play_time" id="video_play" :src="videoObj.videoUrl" @ended="videoEnded()" :autoplay="auto" :show-fullscreen-btn="false" :loop="isLoop" style="width: 100%;height: 90%;"></video>
<view class="question"></view> <view class="question"></view>
<view class="popup-layer-back" v-if="!start" v-show="question"> <view class="popup-layer-back" v-if="!start" v-show="question">
<!-- <view class="popup-layer-close" @click="question=false">关闭</view> --> <!-- <view class="popup-layer-close" @click="question=false">关闭</view> -->
@ -34,6 +34,8 @@
name: "s-video", name: "s-video",
data() { data() {
return { return {
isLoop: false,
play_time: 0,
videoHeight: 300, videoHeight: 300,
videoObjList: [], videoObjList: [],
videoObj:{}, videoObj:{},
@ -73,11 +75,10 @@
this.videoContext = uni.createVideoContext("video_play"); this.videoContext = uni.createVideoContext("video_play");
this.videoContext.requestFullScreen(); this.videoContext.requestFullScreen();
this.getBindJson(); // this.getBindJson();
}, },
methods: { methods: {
videoEnded() { videoEnded() {
debugger
this.auto = false; this.auto = false;
this.question = true; this.question = true;
// 出答案 // 出答案
@ -90,9 +91,9 @@
this.end = true; this.end = true;
this.answerList = []; this.answerList = [];
this.question = false; this.question = false;
uni.navigateTo({ // uni.navigateTo({
url: '/subpkg/complete/complete?questionFreId='+this.questionFreId+'&roleId='+this.jsonId // url: '/subpkg/complete/complete?questionFreId='+this.questionFreId+'&roleId='+this.jsonId
}) // })
} }
}, },
nextQuestion(outId, obj) { nextQuestion(outId, obj) {
@ -100,32 +101,47 @@
if(2==outId) { if(2==outId) {
this.$api.addQuestionFre({ this.$api.addQuestionFre({
roleId : this.jsonId, roleId : this.jsonId,
userId : this.userId // userId : this.userId
userId : '007'
}) })
.then(res => { .then(res => {
this.questionFreId = res.data; this.questionFreId = res.data;
}).catch((e) => console.log(e)); //捕获异常 }).catch((e) => console.log(e)); //捕获异常
} }
var isCorrect = 0;
// 先提交所选答案 // 先提交所选答案
if(null!=obj) { if(null!=obj) {
// 判断答题是否正确
if(this.correct == obj.channel.slice(0, 1)) {
isCorrect = 1
}
var param = { var param = {
answer : obj.channel, answer : obj.channel,
ask : this.ask, ask : this.ask,
questionFreId : this.questionFreId, questionFreId : this.questionFreId,
questionId : this.preQuestionId, questionId : this.preQuestionId,
correctAnswer : this.correct correctAnswer : this.correct,
correct : isCorrect,
} }
this.$api.addAnswer(param) this.$api.addAnswer(param)
.then(res => { .then(res => {
console.log(res); console.log(res);
}).catch((e) => console.log(e)); //捕获异常 }).catch((e) => console.log(e)); //捕获异常
} }
// 播放下一视频
this.hasNodeId(outId); // 答案错误则重播当前视频
this.videoObj.videoUrl = uni.$http.baseUrl + this.videoObj.videoUrl if(isCorrect == 0 && 2 != outId) {
this.start = false; this.play_time = 0;
this.question = false; this.auto = true;
this.auto = true; } else {
// 播放下一视频
this.hasNodeId(outId);
this.videoObj.videoUrl = uni.$http.baseUrl + this.videoObj.videoUrl
this.start = false;
this.question = false;
this.auto = true;
}
}, },
getBindJson() { getBindJson() {
this.start = true; this.start = true;
@ -154,7 +170,6 @@
getAnswer(outId) { getAnswer(outId) {
for(var i=0; i<this.videoObjList.length; i++) { for(var i=0; i<this.videoObjList.length; i++) {
if(outId == this.videoObjList[i].nodeId) { if(outId == this.videoObjList[i].nodeId) {
console.log(this.videoObjList[i])
this.answerList.push(this.videoObjList[i]); this.answerList.push(this.videoObjList[i]);
} }
} }

32
manifest.json

@ -1,6 +1,6 @@
{ {
"name" : "zdxtDrillProgram", "name" : "zdxtDrillProgram",
"appid" : "", "appid" : "__UNI__E147012",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",
"versionCode" : "100", "versionCode" : "100",
@ -18,7 +18,8 @@
}, },
"modules" : { "modules" : {
"Barcode" : {}, "Barcode" : {},
"Camera" : {} "LivePusher" : {},
"VideoPlayer" : {}
}, },
/* 模块配置 */ /* 模块配置 */
"distribute" : { "distribute" : {
@ -26,26 +27,33 @@
"android" : { "android" : {
/* android打包配置 */ /* android打包配置 */
"permissions" : [ "permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>", "<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CAPTURE_SECURE_VIDEO_OUTPUT\"/>",
"<uses-permission android:name=\"android.permission.CAPTURE_VIDEO_OUTPUT\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
] ]
}, },
"ios" : {}, "ios" : {
"dSYMs" : false
},
/* ios打包配置 */ /* ios打包配置 */
"sdkConfigs" : {} "sdkConfigs" : {
"ad" : {}
}
} }
}, },
/* SDK配置 */ /* SDK配置 */

2
pages/index/index.vue

@ -92,7 +92,7 @@
} }
}) })
uni.$showMsg('数据请求成功!') // uni.$showMsg('数据请求成功!')
}, },
navClickHandler(item) { navClickHandler(item) {
uni.navigateTo({ uni.navigateTo({

6
pages/my/my.vue

@ -126,7 +126,7 @@
if (!res.success) return uni.$showMsg() if (!res.success) return uni.$showMsg()
this.medalNum = res.data.length; this.medalNum = res.data.length;
uni.$showMsg('数据请求成功!') // uni.$showMsg('数据请求成功!')
}, },
async getSwiperList() { async getSwiperList() {
@ -141,7 +141,7 @@
item.uploadPath = uni.$http.baseUrl + item.uploadPath item.uploadPath = uni.$http.baseUrl + item.uploadPath
this.swiperList.push(item.uploadPath) this.swiperList.push(item.uploadPath)
}) })
uni.$showMsg('数据请求成功!') // uni.$showMsg('数据请求成功!')
}, },
async getFunctionList() { async getFunctionList() {
@ -154,7 +154,7 @@
item.uploadPath = uni.$http.baseUrl + item.uploadPath item.uploadPath = uni.$http.baseUrl + item.uploadPath
}) })
this.functionList = res.data; this.functionList = res.data;
uni.$showMsg('数据请求成功!') // uni.$showMsg('数据请求成功!')
}, },
showMedal(){ showMedal(){
uni.navigateTo({ uni.navigateTo({

12
static/base_css.css

@ -178,7 +178,7 @@ h3.contit span {
color: #0b68f7; color: #0b68f7;
} }
.ahome { /* .ahome {
background: url(/static/images/icon_home_2.png) no-repeat center top; background: url(/static/images/icon_home_2.png) no-repeat center top;
} }
@ -208,7 +208,7 @@ h3.contit span {
.amine:hover, .amine.curaf { .amine:hover, .amine.curaf {
background: url(/static/images/icon_mine.png) no-repeat center top; background: url(/static/images/icon_mine.png) no-repeat center top;
} } */
/*************** 场景 ************************/ /*************** 场景 ************************/
@ -310,7 +310,7 @@ h3.contit span {
height: 36px; height: 36px;
line-height: 34px; line-height: 34px;
background-color: transparent; background-color: transparent;
background: #f6f7fe url(/static/images/icon_sou.png) no-repeat right 16px center; /* background: #f6f7fe url(/static/images/icon_sou.png) no-repeat right 16px center; */
background-size: auto 50%; background-size: auto 50%;
box-sizing: border-box; box-sizing: border-box;
border: 1px solid rgba(0,0,0,.05); border: 1px solid rgba(0,0,0,.05);
@ -404,7 +404,7 @@ h3.contit span {
width: 5rem; width: 5rem;
height: 5rem; height: 5rem;
overflow: hidden; overflow: hidden;
background: url(/static/images/hpic.jpg) no-repeat; /* background: url(/static/images/hpic.jpg) no-repeat; */
background-size: cover; background-size: cover;
background-position: center top; background-position: center top;
border: 1px solid #fff; border: 1px solid #fff;
@ -469,7 +469,7 @@ h3.contit span {
.mset li { .mset li {
width: 100%; width: 100%;
/*height: 20%;*/ /*height: 20%;*/
background: url(/static/images/arrow-r.png) no-repeat right 2% center; /* background: url(/static/images/arrow-r.png) no-repeat right 2% center; */
background-size: auto 30%; background-size: auto 30%;
display: table; display: table;
} }
@ -626,7 +626,7 @@ span.rigadd {
height: 1.25rem; height: 1.25rem;
line-height: 20rem; line-height: 20rem;
overflow: hidden; overflow: hidden;
background: url(/static/images/icon_60add.png) no-repeat top 28.5% center; /* background: url(/static/images/icon_60add.png) no-repeat top 28.5% center; */
background-size: auto 75%; background-size: auto 75%;
border: 1px solid #ddd; border: 1px solid #ddd;
border-radius: 50%; border-radius: 50%;

BIN
static/cart_border@2x.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

BIN
static/images/arrow-b.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

BIN
static/images/arrow-r.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

BIN
static/images/banner.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

BIN
static/images/banner_mine.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

BIN
static/images/banner_sec.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

BIN
static/images/hpic.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

BIN
static/images/icon_50about.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

BIN
static/images/icon_50adr.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

BIN
static/images/icon_50agr.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

BIN
static/images/icon_50help.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

BIN
static/images/icon_50idea.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

BIN
static/images/icon_50msg.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

BIN
static/images/icon_50priv.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

BIN
static/images/icon_50set.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

BIN
static/images/icon_50vip.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

BIN
static/images/icon_60add.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

BIN
static/images/icon_base.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

BIN
static/images/icon_base_2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

BIN
static/images/icon_home.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

BIN
static/images/icon_home_2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

BIN
static/images/icon_info.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

BIN
static/images/icon_info_2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

BIN
static/images/icon_mine.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/images/icon_mine_2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

BIN
static/images/icon_scan.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

BIN
static/images/icon_scan_2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

BIN
static/images/icon_sou.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

BIN
static/images/item_1.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

BIN
static/images/item_2.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

BIN
static/images/logo_header.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

BIN
static/images/scene_p1.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

BIN
static/images/scene_p2.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

BIN
static/images/scene_p3.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

BIN
static/images/scene_p4.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

BIN
static/images/scene_p5.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

BIN
static/logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

BIN
static/medal_top.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

BIN
static/tab_icons/cate.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
static/tab_icons/home.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

BIN
static/tab_icons/knownledge.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

BIN
static/tab_icons/my.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

BIN
static/uni.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

2
subpkg/about/about.vue

@ -26,7 +26,7 @@
this.content = item.content this.content = item.content
}) })
uni.$showMsg('数据请求成功!') // uni.$showMsg('数据请求成功!')
}, },
} }
} }

2
subpkg/agreement/agreement.vue

@ -26,7 +26,7 @@
this.content = item.content this.content = item.content
}) })
uni.$showMsg('数据请求成功!') // uni.$showMsg('数据请求成功!')
}, },
} }
} }

4
subpkg/list/list.vue

@ -65,7 +65,7 @@
this.swiperList.push(item.uploadPath) this.swiperList.push(item.uploadPath)
}) })
uni.$showMsg('数据请求成功!') // uni.$showMsg('数据请求成功!')
}, },
async getSceneList() { async getSceneList() {
this.isloading = true this.isloading = true
@ -79,7 +79,7 @@
}) })
this.sceneList =[...this.sceneList,...res.rows] this.sceneList =[...this.sceneList,...res.rows]
this.total = res.total this.total = res.total
uni.$showMsg('数据请求成功!') // uni.$showMsg('数据请求成功!')
}, },
navClickHandler(item) { navClickHandler(item) {
if(item !== ""){ if(item !== ""){

4
subpkg/medal/medal.vue

@ -63,7 +63,7 @@
this.taskMedalList.push(item.iconPath) this.taskMedalList.push(item.iconPath)
}) })
uni.$showMsg('数据请求成功!') // uni.$showMsg('数据请求成功!')
}, },
async getMyMedalList() { async getMyMedalList() {
@ -77,7 +77,7 @@
this.myMedalList.push(item.iconPath) this.myMedalList.push(item.iconPath)
}) })
uni.$showMsg('数据请求成功!') // uni.$showMsg('数据请求成功!')
}, },
taskMedal(){ taskMedal(){
this.showMedal = true this.showMedal = true

2
subpkg/messageInfo/messageInfo.vue

@ -26,7 +26,7 @@
if (!res.success) return uni.$showMsg() if (!res.success) return uni.$showMsg()
this.content = res.data.content this.content = res.data.content
uni.$showMsg('数据请求成功!') // uni.$showMsg('数据请求成功!')
}, },
} }
} }

2
subpkg/privacy/privacy.vue

@ -26,7 +26,7 @@
this.content = item.content this.content = item.content
}) })
uni.$showMsg('数据请求成功!') // uni.$showMsg('数据请求成功!')
}, },
} }
} }

4
subpkg/role/role.vue

@ -165,7 +165,7 @@
display: inline-block; display: inline-block;
margin: 0 auto; margin: 0 auto;
padding: 2% 8% 2% 3%; padding: 2% 8% 2% 3%;
background: #a6c5fd url(/static/images/arrow-b.png) no-repeat right 10% center; // background: #a6c5fd url(/static/images/arrow-b.png) no-repeat right 10% center;
background-size: auto 40%; background-size: auto 40%;
border-radius: 8px; border-radius: 8px;
color: #2e6ddd; color: #2e6ddd;
@ -246,7 +246,7 @@
right: 1rem; right: 1rem;
width: 1.75rem; width: 1.75rem;
height: 1.75rem; height: 1.75rem;
background: url(/static/images/icon_60add.png) no-repeat; // background: url(/static/images/icon_60add.png) no-repeat;
background-size: 100%; background-size: 100%;
transform: rotateZ(45deg); transform: rotateZ(45deg);
} }

Loading…
Cancel
Save