Commit c983cdc1 authored by Morson's avatar Morson
parents f848d887 b23c72f4
...@@ -71,6 +71,12 @@ ...@@ -71,6 +71,12 @@
default () { default () {
return true return true
} }
},
num: {
type: Number,
default () {
return 10
}
} }
}, },
components: { components: {
...@@ -116,7 +122,9 @@ ...@@ -116,7 +122,9 @@
const photo = getApp().globalData.photo const photo = getApp().globalData.photo
getApp().trackPage('拍照页') getApp().trackPage('拍照页')
photo.allImages = [] photo.allImages = []
photo.currentItemLength = 0
const length = (this.num > 10 || this.num < 0 || typeof this.num !== 'number') ? 0 : 10 - this.num
photo.currentItemLength = length
// this.ctx = uni.createCameraContext(); // this.ctx = uni.createCameraContext();
this.updateTime() this.updateTime()
......
...@@ -18,6 +18,7 @@ uni.hideTabBar() ...@@ -18,6 +18,7 @@ uni.hideTabBar()
| 属性名 | 类型 | 默认值 | 可选值 | 说明 | | 属性名 | 类型 | 默认值 | 可选值 | 说明 |
| :-: | :-: | :-: | :-: | :-: | | :-: | :-: | :-: | :-: | :-: |
| update | Boolean | true | true/false | 是否默认上传 true:会自动上传好图片并返回绝对路径 false: 只返回临时路径,需要在父组件做上传动作 | | update | Boolean | true | true/false | 是否默认上传 true:会自动上传好图片并返回绝对路径 false: 只返回临时路径,需要在父组件做上传动作 |
| num | Number | 10 | 1-10 | 拍照数量,只能传1-10的正整数 |
| currentItem | Object | - | - | 对应的规范数据,用于获取示意图和水印,以及保存图片所需的ID **格式见下文** | | currentItem | Object | - | - | 对应的规范数据,用于获取示意图和水印,以及保存图片所需的ID **格式见下文** |
### currentItem 格式 ### currentItem 格式
......
...@@ -110,6 +110,9 @@ export default { ...@@ -110,6 +110,9 @@ export default {
this.applyExam(); this.applyExam();
// this.getUserExamInfo(); // this.getUserExamInfo();
}, },
onUnload() {
clearTimeout(this.timer);
},
methods: { methods: {
formatTimeToMini(timestamp) { formatTimeToMini(timestamp) {
let result = timestamp; let result = timestamp;
...@@ -470,42 +473,23 @@ export default { ...@@ -470,42 +473,23 @@ export default {
//下一题 //下一题
nextClick: function () { nextClick: function () {
clearTimeout(this.timer); clearTimeout(this.timer);
this.currentNumber = this.currentNumber + 1; this.currentNumber = this.currentNumber + 1;
//this.getData()
this.handleAnswer(); this.handleAnswer();
//this.getNext()
}, },
//所选答案 //所选答案
handleAnswer: function () { handleAnswer: function () {
/* //每次清空,多选题时id按从小到大排序,并英文逗号,分隔;
userAnswerIds
本题回答。
多选题时id按从小到大排序,并英文逗号,分隔;
简答题时直接存问题答案。
如果是第一次答题,不需要传。
*/
//每次清空
this.userAnswerIds = ""; this.userAnswerIds = "";
this.currentItem.answerList.forEach((item) => { this.currentItem.answerList.forEach((item) => {
if (item.isSelect) { if (item.isSelect) {
//this.userAnswerIds = item.id + ',' + this.userAnswerIds
//answerType 题目类型,1单选,2多选,3简答, //answerType 题目类型,1单选,2多选,3简答,
if (this.currentItem.question.answerType == 2) { if (this.currentItem.question.answerType == 2) {
//多选 //多选
///*
if (this.userAnswerIds.length == 0) { if (this.userAnswerIds.length == 0) {
this.userAnswerIds = item.id; this.userAnswerIds = item.id;
} else { } else {
// if(this.userAnswerIds.length == 1) this.userAnswerIds = this.userAnswerIds + "," + item.id;
this.userAnswerIds =
this.userAnswerIds + "," + item.id;
} }
//*/
} else { } else {
//单选 //单选
this.userAnswerIds = item.id; this.userAnswerIds = item.id;
......
...@@ -264,7 +264,10 @@ ...@@ -264,7 +264,10 @@
if (res.code == 200) { if (res.code == 200) {
self.initData(res) self.initData(res)
} else { } else {
console.log(res.message, "获取订单完工项目失败!"); this.$refs.uToast.show({
title: res.message,
type: 'error',
})
} }
}); });
} }
......
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
</view> </view>
</view> </view>
</view> </view>
<take-photo type="test" v-if="takeStatus" @close="closeTake"></take-photo> <take-photo type="test" v-if="takeStatus" @close="closeTake" :num="1"></take-photo>
<PopView title="查看交互规范" message="为完善交付质量,请查看对应的交付规范" :visible.sync="visibale" @click="handleClick"/> <PopView title="查看交互规范" message="为完善交付质量,请查看对应的交付规范" :visible.sync="visibale" @click="handleClick"/>
</view> </view>
</template> </template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment