美文网首页
picker 地区选择器

picker 地区选择器

作者: 深度_1175 | 来源:发表于2018-08-07 11:25 被阅读0次

    picker 地区选择器

    <picker bindchange="bindRegionChange" mode="region" name="picker" value="{{region}}">
                    <view class="weui-select weui-select_in-select-after">{{region[0]}}—{{region[1]}}—{{region[2]}}</view>
                </picker>
    

    地区(普通)选择器 可以自定义

    <picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
            <view class="picker">
              当前选择:{{array[index]}}
            </view>
          </picker>
    
    
    ----------------------------------------js----------
    Page({
      data: {
        array: ['中国', '美国', '巴西', '日本'],
        index: 0,
        //date: '2016-09-01',
        //time: '12:01'
      },
      bindPickerChange: function(e) {
        console.log('picker发送选择改变,携带值为', e.detail.value)
        this.setData({
          index: e.detail.value
        })
      },
      bindDateChange: function(e) {
        this.setData({
          date: e.detail.value
        })
      },
      bindTimeChange: function(e) {
        this.setData({
          time: e.detail.value
        })
      }
    })
    
    

    --------------------------------------------后端---------

    
    echo "<pre>";
    var_dump($city);die;
    echo "</pre>";
    
    $city = pdo_fetchall("SELECT DISTINCT cityname FROM " . tablename('zhtc_hotcity') . " WHERE uniacid= :weid ORDER BY id DESC", array(':weid' =>$_W['uniacid']), 'id');
    

    tcwq中真正起作用的却是

    <view class="weui-cells weui-cells_after-title">
                <radio-group bindchange="radioChange" name="radiogroup">
                    <label class="weui-cell weui-check__label" wx:for="{{radioItems}}" wx:key="value">
                        <radio checked="{{item.checked}}" class="weui-check" value="{{item.name}}"></radio>
                        <view class="weui-cell__bd">{{item.name}}</view>
                        <view class="weui-cell__ft weui-cell__ft_in-radio" wx:if="{{item.checked}}">
                            <icon class="weui-icon-radio" size="16" type="success_no_circle"></icon>
                        </view>
                    </label>
                </radio-group>
            </view>
    

    相关文章

      网友评论

          本文标题:picker 地区选择器

          本文链接:https://www.haomeiwen.com/subject/icpovftx.html