|
@@ -93,6 +93,7 @@
|
|
<van-field v-model="item.answer" placeholder="请输入" />
|
|
<van-field v-model="item.answer" placeholder="请输入" />
|
|
</span>
|
|
</span>
|
|
</van-col>
|
|
</van-col>
|
|
|
|
+ <van-button size="large" type="primary" @click="submitQuest">提交</van-button>
|
|
</van-popup>
|
|
</van-popup>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -107,6 +108,7 @@ Vue.use(Swipe);
|
|
Vue.use(SwipeItem);
|
|
Vue.use(SwipeItem);
|
|
Vue.use(VanImage);
|
|
Vue.use(VanImage);
|
|
Vue.use(Lazyload);
|
|
Vue.use(Lazyload);
|
|
|
|
+const { mapActions: uploadquestion } = createNamespacedHelpers('uploadquestion');
|
|
const { mapActions: gensign } = createNamespacedHelpers('gensign');
|
|
const { mapActions: gensign } = createNamespacedHelpers('gensign');
|
|
const { mapActions: room } = createNamespacedHelpers('room');
|
|
const { mapActions: room } = createNamespacedHelpers('room');
|
|
const { mapActions: quest } = createNamespacedHelpers('quest');
|
|
const { mapActions: quest } = createNamespacedHelpers('quest');
|
|
@@ -169,6 +171,7 @@ export default {
|
|
...room(['lookuserFetch', 'fetch', 'lookusercount', 'lookquery', 'lookupdate', 'lookrecord']),
|
|
...room(['lookuserFetch', 'fetch', 'lookusercount', 'lookquery', 'lookupdate', 'lookrecord']),
|
|
...chat(['query', 'create']),
|
|
...chat(['query', 'create']),
|
|
...quest(['questfetch']),
|
|
...quest(['questfetch']),
|
|
|
|
+ ...uploadquestion({ upcreate: 'create' }),
|
|
async recordSave() {
|
|
async recordSave() {
|
|
console.log(2121);
|
|
console.log(2121);
|
|
let data = {};
|
|
let data = {};
|
|
@@ -261,6 +264,19 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ async submitQuest() {
|
|
|
|
+ let form = { roomid: this.id, userid: this.user.uid, questionnaireid: this.queid };
|
|
|
|
+ let answers = [];
|
|
|
|
+ for (const question of this.questInfo.question) {
|
|
|
|
+ answers.push({ questionid: question._id, answer: JSON.stringify(question.answer) });
|
|
|
|
+ }
|
|
|
|
+ form.answers = answers;
|
|
|
|
+ console.log(form);
|
|
|
|
+ let res = await this.upcreate(form);
|
|
|
|
+ if (res.errcode == '0') {
|
|
|
|
+ this.showQuest = false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
async lookuserSearch() {
|
|
async lookuserSearch() {
|
|
if (this.user.uid) {
|
|
if (this.user.uid) {
|
|
let data = {};
|
|
let data = {};
|