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

9
api/question.js

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

32
manifest.json

@ -1,6 +1,6 @@
{
"name" : "zdxtDrillProgram",
"appid" : "",
"appid" : "__UNI__E147012",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
@ -18,7 +18,8 @@
},
"modules" : {
"Barcode" : {},
"Camera" : {}
"LivePusher" : {},
"VideoPlayer" : {}
},
/* 模块配置 */
"distribute" : {
@ -26,26 +27,33 @@
"android" : {
/* android打包配置 */
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<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\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<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.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.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.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.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
"ios" : {},
"ios" : {
"dSYMs" : false
},
/* ios打包配置 */
"sdkConfigs" : {}
"sdkConfigs" : {
"ad" : {}
}
}
},
/* SDK配置 */

2
pages.json

@ -149,7 +149,7 @@
},
{
"path" : "review/review",
"style" :
"style" :
{
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false

2
pages/index/index.vue

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

6
pages/my/my.vue

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

12
static/base_css.css

@ -178,7 +178,7 @@ h3.contit span {
color: #0b68f7;
}
.ahome {
/* .ahome {
background: url(/static/images/icon_home_2.png) no-repeat center top;
}
@ -208,7 +208,7 @@ h3.contit span {
.amine:hover, .amine.curaf {
background: url(/static/images/icon_mine.png) no-repeat center top;
}
} */
/*************** 场景 ************************/
@ -310,7 +310,7 @@ h3.contit span {
height: 36px;
line-height: 34px;
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%;
box-sizing: border-box;
border: 1px solid rgba(0,0,0,.05);
@ -404,7 +404,7 @@ h3.contit span {
width: 5rem;
height: 5rem;
overflow: hidden;
background: url(/static/images/hpic.jpg) no-repeat;
/* background: url(/static/images/hpic.jpg) no-repeat; */
background-size: cover;
background-position: center top;
border: 1px solid #fff;
@ -469,7 +469,7 @@ h3.contit span {
.mset li {
width: 100%;
/*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%;
display: table;
}
@ -626,7 +626,7 @@ span.rigadd {
height: 1.25rem;
line-height: 20rem;
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%;
border: 1px solid #ddd;
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
})
uni.$showMsg('数据请求成功!')
// uni.$showMsg('数据请求成功!')
},
}
}

2
subpkg/agreement/agreement.vue

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

4
subpkg/complete/complete.vue

@ -23,8 +23,8 @@
</view>
<view class="perinfo">
<view class="myitem">
<span><button open-type="share"></button>炫耀一下</span>
<span @click="review()">演练回顾</span>
<span><button open-type="share"></button>炫耀一下</span>
<span @click="review()">演练回顾</span>
<span @click="reChallenge()">重新挑战</span>
</view>
</view>

4
subpkg/list/list.vue

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

4
subpkg/medal/medal.vue

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

2
subpkg/messageInfo/messageInfo.vue

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

2
subpkg/privacy/privacy.vue

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

4
subpkg/role/role.vue

@ -165,7 +165,7 @@
display: inline-block;
margin: 0 auto;
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%;
border-radius: 8px;
color: #2e6ddd;
@ -246,7 +246,7 @@
right: 1rem;
width: 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%;
transform: rotateZ(45deg);
}

Loading…
Cancel
Save