Browse Source

no message

feature/v2.1
xpz2018 4 years ago
parent
commit
d187f582df
3 changed files with 46 additions and 45 deletions
  1. 31
      xtends/client/index/index.js
  2. 8
      xtends/client/index/index.json
  3. 52
      xtends/client/index/index.wxml

31
xtends/client/index/index.js

@ -9,38 +9,19 @@ Page({
data: { data: {
safeBottom: app.globalData.safeBottom, safeBottom: app.globalData.safeBottom,
fragment: app.globalData.safeFragmentHeight, fragment: app.globalData.safeFragmentHeight,
tabList: [
{ index: 0, value: 'message', badge: 0, name: '消息', blue: '/assets/tabbar/mall-blue.png', gray: '/assets/tabbar/mall-gray.png' },
{ index: 1, value: 'work', badge: 0, name: '工作台', blue: '/assets/tabbar/storage-blue.png', gray: '/assets/tabbar/storage-gray.png' },
{ index: 2, value: 'home', badge: 0, name: '我的', blue: '/assets/tabbar/home-blue.png', gray: '/assets/tabbar/home-gray.png' }
],
tabIndex: 1,
show: false,
visiable: true visiable: true
}, },
/************************************** 初始化流程 ********************************************/ /************************************** 初始化流程 ********************************************/
onLoad: function (options) { onLoad: function (options) {
const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate()
updateManager.onUpdateReady(function () {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
})
event.on('TabMessage', this, this.onEvent)
this.setData({fragment: (app.globalData.safeFragmentHeight + app.globalData.statusBarHeight), safeBottom: app.globalData.safeBottom })
this.setData({ safeBottom: app.globalData.safeBottom })
}, },
/************************************** 生命周期函数--监听页面初次渲染完成 ********************************************/ /************************************** 生命周期函数--监听页面初次渲染完成 ********************************************/
onShow: function () {
var pageView = this.selectComponent('#' + this.data.tabList[this.data.tabIndex].value)
if (pageView) {
pageView.onRestart()
}
},
onChange: function ({detail}) {
this.setData({ tabIndex: detail })
this.onShow()
showMenu: function () {
this.setData({show: !this.data.show})
}, },
stopTouchMove: function(e){
return false
onClose: function(){
this.setData({show: false})
}, },
onEvent: function (message) { onEvent: function (message) {
if (message.what == 99) { if (message.what == 99) {

8
xtends/client/index/index.json

@ -1,11 +1,7 @@
{ {
"usingComponents": { "usingComponents": {
"van-icon": "/components/icon/index",
"van-tabbar": "/components/tabbar/index",
"van-tabbar-item": "/components/tabbar-item/index",
"message": "/xtends/client/message/index/index",
"workbench": "/xtends/client/workbench/index",
"home": "/xtends/client/home/index",
"van-popup": "/components/popup/index",
"van-submit-bar": "/components/submit-bar/index",
"van-dialog": "/components/dialog/index" "van-dialog": "/components/dialog/index"
} }
} }

52
xtends/client/index/index.wxml

@ -1,18 +1,42 @@
<!--pages/administ/index.wxml--> <!--pages/administ/index.wxml-->
<swiper current="{{tabIndex}}" duration="0" style="height:{{fragment}}rpx">
<swiper-item catchtouchmove="stopTouchMove"><message id="{{tabList[0].value}}"/></swiper-item>
<swiper-item catchtouchmove="stopTouchMove"><workbench id="{{tabList[1].value}}"/></swiper-item>
<swiper-item catchtouchmove="stopTouchMove"><home id="{{tabList[2].value}}"/></swiper-item>
</swiper>
<cu-custom id="custom" bgColor="bg-white">
<view class="menu" slot="right" bindtap="showMenu" style="margin-left:32rpx">
<van-icon name="bars" size="26px" color="#000000" />
</view>
<view slot="content" style="color:black;font-size:36rpx">premeal</view>
</cu-custom>
<view class="cu-bar bg-white foot" style="height:{{100 + safeBottom}}rpx;padding-bottom:{{safeBottom}}rpx;display:{{visiable? 'block' : 'none'}}">
<van-tabbar active="{{ tabIndex }}" fixed="{{false}}" bind:change="onChange">
<van-tabbar-item wx:for="{{tabList}}" wx:key="index" >
<van-icon slot="icon" name="{{item.gray}}" size="25"/>
<van-icon slot="icon-active" name="{{item.blue}}" size="25"/>
<text>{{item.name}}</text>
</van-tabbar-item>
</van-tabbar>
<view style="height:{{116 + safeBottom}}rpx;"></view>
<view class="cu-bar bg-white foot" style="height:{{100 + safeBottom}}rpx;padding-bottom:{{safeBottom}}rpx;">
<van-submit-bar price="{{ 3050 }}" button-text="提交订单" bind:submit="onSubmit" />
</view> </view>
<van-dialog id="van-dialog" />
<van-popup show="{{ show }}" position="left" custom-style="height:100%;width:80%" bind:close="onClose">
<view style="margin-top:240rpx;padding:30rpx">
<view class="flex flex-justify">
<text style="color:black;font-size:40rpx;">荒山野岭</text>
</view>
<view style="color:black;font-size:30rpx;margin-top:16rpx">18565126880</view>
</view>
<view style="height:48rpx"></view>
<van-cell is-link url="/pages/home/coupon/index">
<van-icon slot="icon" name="coupon-o" size="20px" />
<view class="van-cell-text" slot="title" style="margin-left:16rpx">优惠券</view>
</van-cell>
<van-cell is-link url="/pages/message/index/index">
<van-icon slot="icon" name="expand-o" size="20px" />
<view class="van-cell-text" slot="title" style="margin-left:16rpx">分享邀请</view>
</van-cell>
<van-cell is-link url="/pages/order/index/index">
<van-icon slot="icon" name="balance-list-o" size="20px" />
<view class="van-cell-text" slot="title" style="margin-left:16rpx">历史订单</view>
</van-cell>
<van-cell is-link url="/pages/message/index/index">
<van-icon slot="icon" name="chat-o" size="20px" />
<view class="van-cell-text" slot="title" style="margin-left:16rpx">消息列表</view>
</van-cell>
<van-cell is-link url="/pages/message/index/index">
<van-icon slot="icon" name="service-o" size="20px" />
<view class="van-cell-text" slot="title" style="margin-left:16rpx">问题反馈</view>
</van-cell>
</van-popup>
Loading…
Cancel
Save