diff --git a/lvdao-miniapp/utils/request.js b/lvdao-miniapp/utils/request.js index 43ee6d2..6072cba 100644 --- a/lvdao-miniapp/utils/request.js +++ b/lvdao-miniapp/utils/request.js @@ -16,18 +16,18 @@ const sendRequest = (url, method = 'GET', data = {}, baseUrl,contentType) => { if(baseUrl == 1){ // bases = 'http://8.130.38.56:8027/admin-server' + url; // bases = 'http://172.16.61.125:9003' + url; - bases = 'http://192.168.2.152:9003' + url; + // bases = 'http://192.168.2.152:9003' + url; // bases = 'https://zhld.028wlkj.com:49008/cdwlMall/admin-server' + url; - // bases = 'https://jy.scjysm.asia:18086/admin-server' + url; + bases = 'https://jy.scjysm.asia:18086/admin-server' + url; }else{ // bases = 'http://8.130.38.56:8027/business-server' + url; // bases = 'http://172.16.61.48/business-server' + url; // bases = 'http://172.16.61.125:9004' + url; - bases = 'http://192.168.2.152:9004' + url; + // bases = 'http://192.168.2.152:9004' + url; // bases = 'https://zhld.028wlkj.com:49008/cdwlMall/business-server' + url; - // bases = 'https://jy.scjysm.asia:18086/merchant-business' + url; + bases = 'https://jy.scjysm.asia:18086/merchant-business' + url; } var token = uni.getStorageSync('token') || ''; diff --git a/wenjuan-h5/pages_category_page1/question/question.vue b/wenjuan-h5/pages_category_page1/question/question.vue index 5597b48..d35e9b4 100644 --- a/wenjuan-h5/pages_category_page1/question/question.vue +++ b/wenjuan-h5/pages_category_page1/question/question.vue @@ -80,7 +80,7 @@
+ @click="chooseAnswerMore(val,index,item)">

{{ val.answer }} @@ -276,6 +276,7 @@ this.wenjuan.question = JSON.parse(res.data.question) //检查this.wenjuan.question这个list的每个里面是否有maxChoose参数,没有的话就加一个 this.wenjuan.question.forEach(item => { + console.log(item) if (!item.maxChoose) { item.maxChoose = 0 } @@ -734,8 +735,6 @@ this.wenjuan.question[key].choose = chooseItem.answer } }) - - } this.myChoose = { @@ -743,8 +742,21 @@ } chooseItem.disabled = true }, - chooseAnswerMore(chooseItem, idx) { - + chooseAnswerMore(chooseItem, idx,item) { + console.log(chooseItem, idx,item) + if (item.maxChoose && item.maxChoose > 0) { + // 获取当前题目的已选中选项数量 + const selectedCount = item.options.filter(option => option.disabled).length; + // 如果已选中到达 maxChoose,并且当前项未被选中,则不允许选择 + if (selectedCount >= item.maxChoose && !chooseItem.disabled) { + uni.showToast({ + title: `最多只能选择 ${item.maxChoose} 个选项`, + icon: 'none', + duration: 2000 + }); + return; + } + } if(chooseItem.disabled){ chooseItem.disabled=false for (let key in this.wenjuan.question) {