提交 f32608a1a9c75eeb90c60431a82e28fd432413ee

作者 wangyu
1 个父辈 3fc07efe

修改聊天页面

... ... @@ -7,8 +7,10 @@ Page({
7 7 * Page initial data
8 8 */
9 9 data: {
10   - showModal: false,
  10 + showModal: true,
11 11 inputValue:"",
  12 + comlist:"",
  13 + choosed_index:0,
12 14 datas: ["", "", "", "", ""]
13 15 },
14 16
... ... @@ -16,7 +18,7 @@ Page({
16 18 * Lifecycle function--Called when page load
17 19 */
18 20 onLoad: function(options) {
19   -
  21 + this.getComList()
20 22 },
21 23
22 24 /**
... ... @@ -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 61 bindKeyInput(e) {
37 62 console.log("bindKeyInput",e)
38 63 this.setData({
... ... @@ -72,8 +97,19 @@ Page({
72 97 confirmhandle: function(e) {
73 98 console.log("confirmhandle", e)
74 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 31 <text class="text_title">您在多个单位有任职信息,请选择您要在哪家单位资讯问题。</text>
32 32 <view class='divide_line_f5f5f5'></view>
33 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 37 <image class='icon_choosed' src="/images/icon_chat_choosed.png"></image>
41 38 </view>
  39 + <view wx:else bindtap='goselect' id="{{idx}}">
  40 + <text class='text_item_black float_left' >{{item.name}}</text>
  41 + </view>
42 42 <view class='divide_line_f5f5f5'></view>
43 43 </block>
44 44 </view>
... ...
注册登录 后发表评论