提交 79c5222f6735cdcc959c4631302184b083952bba

作者 wangyu
1 个父辈 ff36a77f

优化

... ... @@ -9,6 +9,7 @@ Page({
9 9 */
10 10 data: {
11 11 cur_status: "",
  12 + handle_finished:false,
12 13 legal_entity_id: "",
13 14 legal_entity: "",
14 15 house_type: "",
... ... @@ -106,6 +107,9 @@ Page({
106 107 onLoad: function(options) {
107 108 var that = this
108 109 var housetype, housestatus
  110 + wx.showLoading({
  111 + title: '',
  112 + })
109 113 console.log("options", options);
110 114 if (options.status == 'house_fund_rent') {
111 115 housetype = 'house_fund_rent'
... ... @@ -160,6 +164,9 @@ Page({
160 164 console.log("res", res)
161 165 that.handleAddition(res.data)
162 166 }
  167 + },
  168 + fail:function(res){
  169 + wx.hideLoading()
163 170 }
164 171 })
165 172 },
... ... @@ -252,10 +259,12 @@ Page({
252 259 console.log("housetype_new", housetype_new)
253 260 this.setData({
254 261 house_type: housetype_new,
  262 + handle_finished:true,
255 263 person_total_amount: data.person_total_amount ? data.person_total_amount : 0,
256 264 remaining_amount: data.remaining_amount ? data.remaining_amount : 0,
257 265 additionInfo: newdata
258 266 })
  267 + wx.hideLoading()
259 268 },
260 269
261 270 goaddSupporter: function() {
... ...
... ... @@ -385,7 +385,8 @@
385 385
386 386 </view>
387 387
388   - <view class='bottom_btn_wrap' hidden="{{additionInfo&&additionInfo.length>0&&cur_status=='house_fund'&&house_type=='house_fund_loan'}}">
  388 + <view class='bottom_btn_wrap' hidden="{{handle_finished&&additionInfo&&additionInfo.length>0&&cur_status=='house_fund'&&house_type=='house_fund_loan'}}">
  389 + <!-- <view class='bottom_btn_wrap' wx:if="{{(cur_status!='house_fund'&&additionInfo.length<1)&&cur_status=='house_fund'&&house_type=='house_fund_loan'}}"> -->
389 390 <view class='btn_blue_radius' bindtap="goadd">
390 391 <view class='text_white_34'>添加</view>
391 392 </view>
... ...
... ... @@ -20,7 +20,7 @@ Page({
20 20 onLoad: function(options) {
21 21 var mydate = new Date();
22 22 this.setData({
23   - choosed_date: mydate.getFullYear() + "年" ,
  23 + choosed_date: mydate.getFullYear() + "年",
24 24 long_date: mydate.getTime() / 1000
25 25 })
26 26
... ... @@ -37,13 +37,13 @@ Page({
37 37 animation: true,
38 38 canvasId: 'pieCanvas',
39 39 type: 'pie',
40   - series: [ {
41   - name: '子女教育可扣除金额',
42   - data: 35,
43   - }, {
  40 + series: [{
  41 + name: '子女教育可扣除金额',
  42 + data: 35,
  43 + }, {
44 44 name: '子女教育已扣除金额',
45   - data: 78,
46   - },
  45 + data: 78,
  46 + },
47 47 {
48 48 name: '继续教育可扣除金额',
49 49 data: 35,
... ... @@ -76,7 +76,8 @@ Page({
76 76 }, {
77 77 name: '剩余扣除额度已扣除金额',
78 78 data: 78,
79   - },],
  79 + },
  80 + ],
80 81 width: windowWidth,
81 82 height: 320,
82 83 dataLabel: true,
... ... @@ -103,21 +104,21 @@ Page({
103 104 })
104 105 },
105 106
106   - gohistory: function (e) {
  107 + gohistory: function(e) {
107 108 wx.navigateTo({
108 109 url: 'historylist/historylist',
109 110 })
110 111 },
111 112
112   - datePickerChange: function (e) {
  113 + datePickerChange: function(e) {
113 114 console.log("e", e)
114 115 var datelong = Date.parse(new Date(e.detail.value)) / 1000
115 116 console.log('datelong', datelong)
116 117 this.setData({
117 118 long_date: datelong,
118   - choosed_date: format.yearFormString(datelong) + "年"
  119 + choosed_date: format.yearFormString(datelong) + "年"
119 120 })
120   - },
  121 + },
121 122
122 123 /**
123 124 * Lifecycle function--Called when page hide
... ...
... ... @@ -12,6 +12,7 @@ Page({
12 12 comlist: [],
13 13 com_id: "",
14 14 choosed_index: 0,
  15 + scrollview_h:0,
15 16 chat_idx:"Toview"+0,
16 17 chatlist: []
17 18 },
... ... @@ -21,6 +22,15 @@ Page({
21 22 */
22 23 onLoad: function(options) {
23 24 this.getComList()
  25 + var that = this
  26 + wx.getSystemInfo({
  27 + success: function (res) {
  28 + that.setData({
  29 + scrollview_h: res.windowHeight-66
  30 + })
  31 + console.log("windowHeight",res.windowHeight)
  32 + }
  33 + })
24 34 },
25 35
26 36 /**
... ... @@ -104,8 +114,15 @@ Page({
104 114 chatlist: that.data.chatlist
105 115 })
106 116 console.log("chatlist", that.data.chatlist)
  117 + wx.pageScrollTo({
  118 + scrollTop: 20000,
  119 + duration: 300
  120 + })
107 121 // that.getChatinfo()
108   - that.bottom()
  122 + // setTimeout(function(){
  123 + // that.bottom()
  124 + // },400);
  125 +
109 126 }
110 127 }
111 128 })
... ... @@ -198,17 +215,21 @@ Page({
198 215
199 216 //聊天消息始终显示最底端
200 217 bottom: function () {
201   - var query = wx.createSelectorQuery()
202   - query.select('#flag').boundingClientRect()
203   - query.selectViewport().scrollOffset()
204   - query.exec(function (res) {
  218 + // var query = wx.createSelectorQuery()
  219 + // query.select('#flag').boundingClientRect()
  220 + // query.selectViewport().scrollOffset()
  221 + // query.exec(function (res) {
  222 + // wx.pageScrollTo({
  223 + // scrollTop: res[0].bottom // #the-id节点的下边界坐标
  224 + // })
  225 + // res[1].scrollTop // 显示区域的竖直滚动位置
  226 + // })
  227 + wx.createSelectorQuery().select('#flag').boundingClientRect(function (rect) {
  228 + // 使页面滚动到底部
205 229 wx.pageScrollTo({
206   - scrollTop: res[0].bottom // #the-id节点的下边界坐标
  230 + scrollTop: rect.bottom
207 231 })
208   - res[1].scrollTop // 显示区域的竖直滚动位置
209   - })
210   - // var d = SmsListView.ActualHeight;
211   - // xxx.ScrollToVerticalOffset(d);
  232 + }).exec()
212 233 },
213 234
214 235 /**
... ...
1 1 <!--pages/main/smartchat/chat.wxml-->
2 2 <import src="../../../common/picker_cell" />
3 3
4   -<view>
5   - <scroll-view style='background:#fff;margin-bottom:150rpx' scroll-y="true" >
  4 +<view class='page'>
  5 + <view style='background:#fff;margin-bottom:60px;width:100%;'>
6 6 <view wx:for="{{chatlist}}" wx:for-item="item" style='display:flex;flex-direction:column'>
7 7 <view style='margin:50rpx 60rpx 0 36rpx;display:flex;flex-direction:row' wx:if="{{item.type=='0'}}">
8 8 <image style='width:102rpx;height:92rpx' src="/images/icon_robot.png"></image>
... ... @@ -19,17 +19,17 @@
19 19 </view>
20 20 </view>
21 21 </view>
22   - <view id="flag"></view>
23   -
24   - </scroll-view>
  22 + <view id="flag"></view>
  23 + </view>
25 24 <view class='bottom_wrap' id='bottom'>
26 25 <input class='input_wrap' placeholder-class='input_placeholder_wrap' bindinput="bindKeyInput" placeholder='请输入您要咨询的问题' value='{{inputValue}}'></input>
27 26 <view class='btn_send_wrap' bindtap='sendMsg'>发送</view>
28 27 </view>
29 28 </view>
30 29
  30 +
31 31 <!-- 自定义弹窗 -->
32   -<view class="mask" catchtouchmove="preventTouchMove" hidden="{{!showModal}}"></view>
  32 +<view class="mask" hidden="{{!showModal}}"></view>
33 33 <view class='modal_lg' hidden="{{!showModal}}">
34 34 <text class="text_title">您在多个单位有任职信息,请选择您要在哪家单位咨询问题。</text>
35 35 <view class='divide_line_f5f5f5'></view>
... ...
1 1 /* pages/main/smartchat/chat.wxss */
2 2
  3 +page{
  4 + width:100%;
  5 + height: 100%
  6 +}
  7 +
3 8 /* 遮罩层 */
4 9
5 10 .mask {
... ...
注册登录 后发表评论