收藏
回答

全选里面套单选


怎样让所有问题的选项都选中,但每题只能是单选,我现在是只能选择一个题目的选项

附上代码:

<block wx:for="{{question_data}}" wx:key="question_data" wx:for-index="idx">

<view class='question-list'>

<view class='question-title'>

<text>{{item.num}}、</text>

<view>

<text>【{{item.type}}】</text>

<text>{{item.txt}}</text>

</view>

</view>

<block wx:for="{{item.select_data}}" wx:key="select_data">

<view class='question-select'>

<view class="{{activeIndex===idx&&activeIndex_1===index?'active':''}}" bindtap='select_answer' data-index="{{index}}" data-idx="{{idx}}">{{item.num}}</view>

<text>{{item.txt}}</text>

</view>

</block>

</view>

</block>

data: {

is_sample: false,

activeIndex: '',

activeIndex_1: '',

question_data: [

{

num: '1',

type: '必选',

txt: '是否俗语增量品种,不会明显抢占其他商品份额',

select_data: [

{ num: 'A', txt: '是' },

{ num: 'B', txt: '否' }

],

ischeck: false

},

{

num: '2',

type: '必填',

txt: '你的商品为什么是增量而不是抢占其他商品的份额,是否有关联商品,如果有是什么、怎么关联?针对顾客痛点请详细阐述。',

select_data: [

{ num: 'A', txt: '是' },

{ num: 'B', txt: '否' }

],

ischeck: false

},

{

num: '3',

type: '可选',

txt: '3个月试销不通过是否可清库存(进场第2个自然月为第一个月)?',

select_data: [

{ num: 'A', txt: '是' },

{ num: 'B', txt: '否' },

{ num: 'C', txt: '其他弹性方案' },

],

ischeck: false

}

]

},


回答关注问题邀请回答
收藏

3 个回答

登录 后发表内容