Browse Source

吉农宝

hanfucheng 1 year ago
parent
commit
efd1234dc3
2 changed files with 8 additions and 3 deletions
  1. 5 3
      pages/asking/addquestion.vue
  2. 3 0
      pages/asking/questiondetails.vue

+ 5 - 3
pages/asking/addquestion.vue

@@ -95,6 +95,7 @@ export default {
 		this.form.score = this.form.score==null?0:this.form.score;
 		this.form.score = this.form.score==null?0:this.form.score;
 		this.form1.scoreNum = this.form.score;
 		this.form1.scoreNum = this.form.score;
 		this.form1.userId = getApp().globalData.userId;
 		this.form1.userId = getApp().globalData.userId;
+		//验证积分
 		verifyScore(this.form1).then(res => {
 		verifyScore(this.form1).then(res => {
 		  if(!res.data){
 		  if(!res.data){
 			  uni.showToast({
 			  uni.showToast({
@@ -102,9 +103,10 @@ export default {
 			  })
 			  })
 		  }else{
 		  }else{
 			  this.$refs[e].validate().then(res => {
 			  this.$refs[e].validate().then(res => {
-			  		  this.form.type = this.typeList.filter((item) => {
-			  			return this.form.typeId == item.value;
-			  		  })[0].text;
+				  this.form.type = this.typeList.filter((item) => {
+					return this.form.typeId == item.value;
+				  })[0].text;
+				  //增加问题
 			      addQuestion(this.form).then(res => {
 			      addQuestion(this.form).then(res => {
 			        uni.navigateBack();
 			        uni.navigateBack();
 			      });
 			      });

+ 3 - 0
pages/asking/questiondetails.vue

@@ -101,6 +101,9 @@ export default {
 		//采纳答案
 		//采纳答案
 		adoptFunc(id){
 		adoptFunc(id){
 			this.answer.id = id
 			this.answer.id = id
+			this.answer.createBy = getApp().globalData.userId
+			this.answer.score = this.form.score
+			console.log(this.answer)
 			adoptAnswer(this.answer).then(res =>{})
 			adoptAnswer(this.answer).then(res =>{})
 			this.isAdopt = true
 			this.isAdopt = true
 			this.form.answerList.forEach(v => {
 			this.form.answerList.forEach(v => {