webpackJsonp([22],{"+dWP":function(t,s,i){"use strict";Object.defineProperty(s,"__esModule",{value:!0});var a={data:function(){return{radio:[],id:this.$route.query.id,askJson:{}}},methods:{goBack:function(){if(this.$router.isBack=!0,window.history.length<=1)return this.$router.push({path:"/"}),!1;this.$router.go(-1)},getAsk:function(){var t=this,s={id:this.id};this.ajax.get(this.$store.state.api+"getAskById",s).then(function(s){s.data[0][0].askList=JSON.parse(s.data[0][0].content),t.askJson=s.data[0][0]}).catch(function(s){t.loading=!1,t.refreshing=!1,console.error(s)})},time:function(){if(this.now){var t=(new Date).getTime();return t-this.now>3e3&&(this.now=t,!0)}return this.now=(new Date).getTime(),!0},addAskList:function(){var t=this;if(this.radio.length==this.askJson.askList.length){var s=[{aid:this.id,c:this.radio.join(","),uid:this.$store.state.userInfo.userid}];this.time()&&this.ajax.post(this.$store.state.api+"addAskList",s).then(function(s){t.$toast.success("提交成功"),t.goBack()}).catch(function(s){t.$toast.success("提交失败"),console.error(s)})}else this.$toast.fail("你还有题没有选完，请选完后再提交")}},created:function(){this.getAsk()}},e={render:function(){var t=this,s=t.$createElement,i=t._self._c||s;return i("div",{staticClass:"pb_content2",staticStyle:{background:"#fff"}},[i("div",{staticClass:"pb_head"},[i("van-icon",{staticClass:"pb_back",attrs:{name:"arrow-left",color:"#fff",size:"1.2rem"},on:{click:t.goBack}}),t._v(" "),i("span",[t._v("问卷调查")]),t._v(" "),i("div",{staticClass:"pb_left"},[i("span",{on:{click:t.addAskList}},[t._v("提交")])])],1),t._v(" "),i("div",{staticClass:"pb_content_body"},[i("div",{staticClass:"li_head"},[i("span",[t._v(t._s(t.askJson.title))])]),t._v(" "),i("div",t._l(t.askJson.askList,function(s,a){return i("div",{key:a,staticClass:"ad_content"},[i("div",{staticClass:"ad_title"},[i("span",[t._v(t._s(a+1+"、"+s.askstitle))])]),t._v(" "),i("div",{staticClass:"ad_check"},[i("van-radio-group",{model:{value:t.radio[a],callback:function(s){t.$set(t.radio,a,s)},expression:"radio[index]"}},t._l(s.askItem,function(a,e){return i("van-radio",{key:e,attrs:{name:a,"icon-size":".75rem","checked-color":"#46bb65"}},[t._v(t._s(s.checkList[e])+"\n            ")])}),1)],1)])}),0)])])},staticRenderFns:[]};var n=i("VU/8")(a,e,!1,function(t){i("bYUA")},"data-v-ec09bd2a",null);s.default=n.exports},bYUA:function(t,s){}});
//# sourceMappingURL=22.324e4d081944599f6e02.js.map