Showing
3 changed files
with
67 additions
and
6 deletions
| @@ -20,6 +20,7 @@ Page({ | @@ -20,6 +20,7 @@ Page({ | ||
| 20 | price:'', | 20 | price:'', |
| 21 | coupon:'', | 21 | coupon:'', |
| 22 | is_user_comments:'', | 22 | is_user_comments:'', |
| 23 | + showLoading:false, | ||
| 23 | }, | 24 | }, |
| 24 | text: '', | 25 | text: '', |
| 25 | /** | 26 | /** |
| @@ -131,9 +132,8 @@ Page({ | @@ -131,9 +132,8 @@ Page({ | ||
| 131 | title: '评价已提交!', | 132 | title: '评价已提交!', |
| 132 | }) | 133 | }) |
| 133 | } | 134 | } |
| 134 | - wx.showLoading({ | ||
| 135 | - title: '提交中,请稍后!', | ||
| 136 | - mask: true, | 135 | + this.setData({ |
| 136 | + showLoading:true | ||
| 137 | }) | 137 | }) |
| 138 | let params = { | 138 | let params = { |
| 139 | sid: this.data.options.sellerid, | 139 | sid: this.data.options.sellerid, |
| @@ -150,6 +150,9 @@ Page({ | @@ -150,6 +150,9 @@ Page({ | ||
| 150 | }); | 150 | }); |
| 151 | App.User.SetComment(params).then(res => { | 151 | App.User.SetComment(params).then(res => { |
| 152 | if (res.ret== 200 && res.data) { | 152 | if (res.ret== 200 && res.data) { |
| 153 | + this.setData({ | ||
| 154 | + showLoading:false | ||
| 155 | + }) | ||
| 153 | let url = '' | 156 | let url = '' |
| 154 | let options = this.data.options | 157 | let options = this.data.options |
| 155 | console.log('options',options); | 158 | console.log('options',options); |
| @@ -172,17 +175,23 @@ Page({ | @@ -172,17 +175,23 @@ Page({ | ||
| 172 | sellid: options.sellerid, | 175 | sellid: options.sellerid, |
| 173 | }, './opinionSuccess') | 176 | }, './opinionSuccess') |
| 174 | } | 177 | } |
| 178 | + wx.hideLoading() | ||
| 175 | wx.redirectTo({ | 179 | wx.redirectTo({ |
| 176 | url | 180 | url |
| 177 | }) | 181 | }) |
| 178 | }else{ | 182 | }else{ |
| 183 | + this.setData({ | ||
| 184 | + showLoading:false | ||
| 185 | + }) | ||
| 179 | return wx.showToast({ | 186 | return wx.showToast({ |
| 180 | icon: 'none', | 187 | icon: 'none', |
| 181 | title: res.msg, | 188 | title: res.msg, |
| 182 | }) | 189 | }) |
| 183 | } | 190 | } |
| 184 | }).catch(e => { | 191 | }).catch(e => { |
| 185 | - wx.hideLoading() | 192 | + this.setData({ |
| 193 | + showLoading:false | ||
| 194 | + }) | ||
| 186 | console.log('catch', e); | 195 | console.log('catch', e); |
| 187 | wx.showToast({ | 196 | wx.showToast({ |
| 188 | icon: 'none', | 197 | icon: 'none', |
| @@ -22,4 +22,11 @@ | @@ -22,4 +22,11 @@ | ||
| 22 | <textarea class="margin-top-lg text-df textarea" bindinput="textareaInput" cols="30" rows="10" placeholder="麻烦点这里输入您的意见反馈。\n\n\n可以帮助我们持续改进,给您带来更好的服务品质,谢谢啦!" placeholder-style="color:#999999;font-size:30rpx;"></textarea> | 22 | <textarea class="margin-top-lg text-df textarea" bindinput="textareaInput" cols="30" rows="10" placeholder="麻烦点这里输入您的意见反馈。\n\n\n可以帮助我们持续改进,给您带来更好的服务品质,谢谢啦!" placeholder-style="color:#999999;font-size:30rpx;"></textarea> |
| 23 | <tpupload bind:tpupload="tpupload" tpNum='6'></tpupload> | 23 | <tpupload bind:tpupload="tpupload" tpNum='6'></tpupload> |
| 24 | </view> | 24 | </view> |
| 25 | -<button class="btn" bindtap="submit" disabled="{{is_user_comments}}">{{is_user_comments?'该订单已提交!':'提交'}}</button> | ||
| 25 | +<button class="btn" bindtap="submit" disabled="{{is_user_comments}}">{{is_user_comments?'该订单已提交!':'提交'}}</button> | ||
| 26 | +<view class="loading-container" wx:if="{{showLoading}}"> | ||
| 27 | + <view class="loading-mask"></view> | ||
| 28 | + <view class="loading-content"> | ||
| 29 | + <image src="https://qn.colorcun.com/loading.webp" class="loading-image" /> | ||
| 30 | + <text class="loading-text">提交中...</text> | ||
| 31 | + </view> | ||
| 32 | +</view> |
| @@ -59,4 +59,49 @@ | @@ -59,4 +59,49 @@ | ||
| 59 | button[disabled]:not([type]) { | 59 | button[disabled]:not([type]) { |
| 60 | color: #fff !important; | 60 | color: #fff !important; |
| 61 | background:#4c8dad; | 61 | background:#4c8dad; |
| 62 | -} | ||
| 62 | +} | ||
| 63 | +.loading-container { | ||
| 64 | + position: fixed; | ||
| 65 | + top: 0; | ||
| 66 | + left: 0; | ||
| 67 | + right: 0; | ||
| 68 | + bottom: 0; | ||
| 69 | + display: flex; | ||
| 70 | + justify-content: center; | ||
| 71 | + align-items: center; | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + .loading-mask { | ||
| 75 | + position: fixed; | ||
| 76 | + top: 0; | ||
| 77 | + left: 0; | ||
| 78 | + right: 0; | ||
| 79 | + bottom: 0; | ||
| 80 | + background-color: rgba(0, 0, 0, 0.3); | ||
| 81 | + z-index: 999; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + .loading-content { | ||
| 85 | + display: flex; | ||
| 86 | + flex-direction: column; | ||
| 87 | + align-items: center; | ||
| 88 | + position: absolute; | ||
| 89 | + top: 50%; | ||
| 90 | + left: 50%; | ||
| 91 | + transform: translate(-50%, -50%); | ||
| 92 | + background-color: #fff; | ||
| 93 | + padding: 20rpx; | ||
| 94 | + border-radius: 10rpx; | ||
| 95 | + z-index: 1000; | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + .loading-image { | ||
| 99 | + width: 60rpx; | ||
| 100 | + height: 60rpx; | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + .loading-text { | ||
| 104 | + margin-top: 10rpx; | ||
| 105 | + font-size: 28rpx; | ||
| 106 | + color: #333; | ||
| 107 | + } |
-
Please register or login to post a comment