添加loading动画

cyl/develop
jscyl13849007907 12 months ago
parent 9578268c1a
commit ab6908d618

@ -85,7 +85,8 @@
"pages/creatorSelectPage/index", "pages/creatorSelectPage/index",
"components/chat/text", "components/chat/text",
"components/chat/hello", "components/chat/hello",
"components/chat/html" "components/chat/html",
"components/chat/loading"
], ],
"permission": { "permission": {
"scope.userLocation": { "scope.userLocation": {

@ -0,0 +1,66 @@
// components/chat/loading.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1,6 @@
<!--components/chat/loading.wxml-->
<view class="loader">
<view class="dot"></view>
<view class="dot"></view>
<view class="dot"></view>
</view>

@ -0,0 +1 @@
/* components/chat/loading.wxss */

@ -17,6 +17,7 @@ Page({
type:'text', type:'text',
isUp:false, isUp:false,
isDown:false, isDown:false,
loading:false,
}, },
], ],
/* /*
@ -202,14 +203,16 @@ Page({
type:'text', type:'text',
isUp:false, isUp:false,
isDown:false, isDown:false,
content:that.data.sendText content:that.data.sendText,
loading:false,
}, },
{ {
id:that.data.list.length + 1, id:that.data.list.length + 1,
type:'html', type:'html',
isUp:false, isUp:false,
isDown:false, isDown:false,
content:`【北京奔驰连接器日结工】<br /><br />🚻 男女 18-48 18-48周岁 男女不限, 要求26个英文字母 纹身烟疤拍照确认, 黑户,明显纹身,临时身份证不予接收,两班倒,站班<br /><br />💰 员工250元/天支付60天60天以后员工220元/天每月10号发薪。培训工资100元/天,员工 16 元/时以上部分含税6个点的打卡不满七天无工资60天以后员工缴纳社保` content:`【北京奔驰连接器日结工】<br /><br />🚻 男女 18-48 18-48周岁 男女不限, 要求26个英文字母 纹身烟疤拍照确认, 黑户,明显纹身,临时身份证不予接收,两班倒,站班<br /><br />💰 员工250元/天支付60天60天以后员工220元/天每月10号发薪。培训工资100元/天,员工 16 元/时以上部分含税6个点的打卡不满七天无工资60天以后员工缴纳社保`,
loading:true,
}, },
], ],
sendText:'' sendText:''
@ -254,14 +257,16 @@ Page({
type:'text', type:'text',
isUp:false, isUp:false,
isDown:false, isDown:false,
content:that.data.sendText content:that.data.sendText,
loading:false,
}, },
{ {
id:that.data.list.length + 1, id:that.data.list.length + 1,
type:'html', type:'html',
isUp:false, isUp:false,
isDown:false, isDown:false,
content:`【北京奔驰连接器日结工】<br /><br />🚻 男女 18-48 18-48周岁 男女不限, 要求26个英文字母 纹身烟疤拍照确认, 黑户,明显纹身,临时身份证不予接收,两班倒,站班<br /><br />💰 员工250元/天支付60天60天以后员工220元/天每月10号发薪。培训工资100元/天,员工 16 元/时以上部分含税6个点的打卡不满七天无工资60天以后员工缴纳社保` content:`【北京奔驰连接器日结工】<br /><br />🚻 男女 18-48 18-48周岁 男女不限, 要求26个英文字母 纹身烟疤拍照确认, 黑户,明显纹身,临时身份证不予接收,两班倒,站班<br /><br />💰 员工250元/天支付60天60天以后员工220元/天每月10号发薪。培训工资100元/天,员工 16 元/时以上部分含税6个点的打卡不满七天无工资60天以后员工缴纳社保`,
loading:true,
}, },
], ],
sendText:'' sendText:''

@ -2,6 +2,7 @@
"usingComponents": { "usingComponents": {
"hello-panel": "../../components/chat/hello", "hello-panel": "../../components/chat/hello",
"text-panel": "../../components/chat/text", "text-panel": "../../components/chat/text",
"html-panel": "../../components/chat/html" "html-panel": "../../components/chat/html",
"loading-panel": "../../components/chat/loading"
} }
} }

@ -19,10 +19,11 @@
<hello-panel /> <hello-panel />
</view> </view>
<view wx:if="{{index % 2 == 0 && index != 0}}" <view wx:if="{{index % 2 == 0 && index != 0}}"
class="bg-obj g_flex_row_start min80" class="{{!item.loading ? 'bg-obj' : ''}} g_flex_row_start min80"
> >
<text-panel message="{{item.content}}" color="cblack" wx:if="{{item.type == 'text'}}" /> <text-panel message="{{item.content}}" color="cblack" wx:if="{{item.type == 'text' && !item.loading}}" />
<html-panel message="{{item.content}}" color="cblack" wx:if="{{item.type == 'html'}}" /> <html-panel message="{{item.content}}" color="cblack" wx:if="{{item.type == 'html' && !item.loading}}" />
<loading-panel wx:if="{{item.loading}}" />
</view> </view>
<view wx:if="{{index % 2 == 1}}" <view wx:if="{{index % 2 == 1}}"
class="main-obj g_flex_row_end max80" class="main-obj g_flex_row_end max80"
@ -30,7 +31,7 @@
<text-panel message="{{item.content}}" color="cwhite" /> <text-panel message="{{item.content}}" color="cwhite" />
</view> </view>
</view> </view>
<view class="item-opera g_flex_row_between" wx:if="{{index % 2 == 0}}"> <view class="item-opera g_flex_row_between" wx:if="{{index % 2 == 0 && !item.loading}}">
<view class="g_flex_row_start"> <view class="g_flex_row_start">
<i class="iconfont icon-useful era-icon g_mr_12 {{item.isUp ? 'icon-active' : ''}}" <i class="iconfont icon-useful era-icon g_mr_12 {{item.isUp ? 'icon-active' : ''}}"
data-up="{{item.isUp}}" data-up="{{item.isUp}}"

Loading…
Cancel
Save