正在显示
2 个修改的文件
包含
45 行增加
和
9 行删除
| @@ -7,8 +7,10 @@ Page({ | @@ -7,8 +7,10 @@ Page({ | ||
| 7 | * Page initial data | 7 | * Page initial data |
| 8 | */ | 8 | */ |
| 9 | data: { | 9 | data: { |
| 10 | - showModal: false, | 10 | + showModal: true, |
| 11 | inputValue:"", | 11 | inputValue:"", |
| 12 | + comlist:"", | ||
| 13 | + choosed_index:0, | ||
| 12 | datas: ["", "", "", "", ""] | 14 | datas: ["", "", "", "", ""] |
| 13 | }, | 15 | }, |
| 14 | 16 | ||
| @@ -16,7 +18,7 @@ Page({ | @@ -16,7 +18,7 @@ Page({ | ||
| 16 | * Lifecycle function--Called when page load | 18 | * Lifecycle function--Called when page load |
| 17 | */ | 19 | */ |
| 18 | onLoad: function(options) { | 20 | onLoad: function(options) { |
| 19 | - | 21 | + this.getComList() |
| 20 | }, | 22 | }, |
| 21 | 23 | ||
| 22 | /** | 24 | /** |
| @@ -33,6 +35,29 @@ Page({ | @@ -33,6 +35,29 @@ Page({ | ||
| 33 | 35 | ||
| 34 | }, | 36 | }, |
| 35 | 37 | ||
| 38 | + getComList:function(){ | ||
| 39 | + var that = this; | ||
| 40 | + var Authorization = getApp().globalData.Authorization; | ||
| 41 | + wx.request({ | ||
| 42 | + url: baseUrl + 'uaa/v1/tenants', | ||
| 43 | + data: { | ||
| 44 | + all:"true" | ||
| 45 | + }, | ||
| 46 | + header: { | ||
| 47 | + 'content-type': 'application/json', | ||
| 48 | + "Authorization": Authorization | ||
| 49 | + }, | ||
| 50 | + success: function (res) { | ||
| 51 | + if (res && res.data) { | ||
| 52 | + console.log("res", res) | ||
| 53 | + that.setData({ | ||
| 54 | + comlist: res.data.items | ||
| 55 | + }) | ||
| 56 | + } | ||
| 57 | + } | ||
| 58 | + }) | ||
| 59 | + }, | ||
| 60 | + | ||
| 36 | bindKeyInput(e) { | 61 | bindKeyInput(e) { |
| 37 | console.log("bindKeyInput",e) | 62 | console.log("bindKeyInput",e) |
| 38 | this.setData({ | 63 | this.setData({ |
| @@ -72,8 +97,19 @@ Page({ | @@ -72,8 +97,19 @@ Page({ | ||
| 72 | confirmhandle: function(e) { | 97 | confirmhandle: function(e) { |
| 73 | console.log("confirmhandle", e) | 98 | console.log("confirmhandle", e) |
| 74 | this.setData({ | 99 | this.setData({ |
| 75 | - showModal: false | 100 | + showModal: false, |
| 76 | }) | 101 | }) |
| 102 | + this.getChatinfo(); | ||
| 103 | + }, | ||
| 104 | + | ||
| 105 | + goselect:function(e){ | ||
| 106 | + this.setData({ | ||
| 107 | + choosed_index: e.currentTarget.id | ||
| 108 | + }) | ||
| 109 | + }, | ||
| 110 | + | ||
| 111 | + getChatinfo:function(){ | ||
| 112 | + | ||
| 77 | }, | 113 | }, |
| 78 | 114 | ||
| 79 | /** | 115 | /** |
| @@ -31,14 +31,14 @@ | @@ -31,14 +31,14 @@ | ||
| 31 | <text class="text_title">您在多个单位有任职信息,请选择您要在哪家单位资讯问题。</text> | 31 | <text class="text_title">您在多个单位有任职信息,请选择您要在哪家单位资讯问题。</text> |
| 32 | <view class='divide_line_f5f5f5'></view> | 32 | <view class='divide_line_f5f5f5'></view> |
| 33 | <view style='width:100%;display:flex;flex-direction:column;align-items:center;max-height:450rpx'> | 33 | <view style='width:100%;display:flex;flex-direction:column;align-items:center;max-height:450rpx'> |
| 34 | - <block wx:for="{{datas}}" wx:for-index="idx"> | ||
| 35 | - <view wx:if="{{idx!=1}}"> | ||
| 36 | - <text class='text_item_black float_left'>北京小爱智能科技有限公司</text> | ||
| 37 | - </view> | ||
| 38 | - <view wx:else> | ||
| 39 | - <text class='text_item_blue float_left'>北京小爱智能科技有限公司</text> | 34 | + <block wx:for="{{comlist}}" wx:for-index="idx"> |
| 35 | + <view wx:if="{{idx==choosed_index}}" bindtap='goselect' id="{{idx}}"> | ||
| 36 | + <text class='text_item_blue float_left'>{{item.name}}</text> | ||
| 40 | <image class='icon_choosed' src="/images/icon_chat_choosed.png"></image> | 37 | <image class='icon_choosed' src="/images/icon_chat_choosed.png"></image> |
| 41 | </view> | 38 | </view> |
| 39 | + <view wx:else bindtap='goselect' id="{{idx}}"> | ||
| 40 | + <text class='text_item_black float_left' >{{item.name}}</text> | ||
| 41 | + </view> | ||
| 42 | <view class='divide_line_f5f5f5'></view> | 42 | <view class='divide_line_f5f5f5'></view> |
| 43 | </block> | 43 | </block> |
| 44 | </view> | 44 | </view> |
请
注册
或
登录
后发表评论