<!--index.wxml--> <view class="container"> <view bindtap="bindViewTap" class="userinfo "> <view class="userinfo-box"> <image class="userinfo-avatar" src="{{userInfo.avatarUrl}}" background-size="cover"></image> <view class="userinfo-area"> <text class="userinfo-nickname">您好,{{userInfo.nickName}}!</text> <text class="userinfo-parent">签约企业:</text> <text class="userinfo-company">仁怀市茅台镇永泰酒业有限公司</text> </view> </view> <view class="count-list"> <view class="list-cloum"> <text class="item2">本月订单数</text> <text class="item1">{{res.monthOrdersCount}}</text> </view> <view class="list-cloum list-line"> <text class="item2">本月订单金额</text> <text class="item1"><text class="font-size-15">¥</text>{{res.monthOrdersTotalMoney}}</text> </view> <view class="list-cloum"> <text class="item2">我的客户数</text> <text class="item1">{{res.customerCount}}</text> </view> </view> </view> <view class="index-muen"> <navigator url="knowledgeList" class="muen-list" > <image class="image" src="/assets/images/index_ico1@2x.png" background-size="cover"></image> <view class="text"> <text class="font-size-18 font-color-hei">酱香型白酒</text> <text class="font-size-15 font-color-c24e4e">知识百科</text> </view> </navigator> <navigator url="verification" class="muen-list" > <image class="image" src="/assets/images/index_ico2@2x.png" background-size="cover"></image> <view class="text"> <text class="font-size-18 font-color-hei">追溯/验真</text> <text class="font-size-15 font-color-c24e4e">品质保证</text> </view> </navigator> </view> <view bindtap="bindMassge" class="massge" animation="{{animationData}}" wx:if="{{isshow}}" hover-class="weui-cell_active"> <view class="massge-hd"><image class="massge-img" src="/assets/images/index_message_1@2x.png"></image><view>系统消息</view></view> <view class="massge-bd font-color-666">订单:<text class="font-color-c24e4e font-size-15">SA123485743673</text>(客户:老王 ¥1890)</view> <view class="massge-ft font-color-666">状态变化:厂家已确认订单</view> <view catchtap="translate" class="massge-close"><image src="/assets/images/index_Close@2x.png"></image></view> </view> <view class="news"> <view class="news-list font-color-666"> <view class="newslist-hd">欢迎加入仁怀酱酒宝</view> <view class="img-box"><image class="news-listimg" src="/assets/testimages/timg.jpg"></image></view> </view> </view> </view> |
/**index.wxss**/ .userinfo { line-height: 1; padding: 0 40rpx; background: #c24e4e; overflow: hidden } .userinfo-box{ display: flex; flex-direction: row; position: relative; } .count-list { margin: 30rpx 0; display: flex; flex-direction: row; justify-content: space-around; left: 0; } .list-line{ border: 2rpx solid #d48383; border-top:none; border-bottom:none; padding: 0 70rpx; } .list-cloum { display: flex; flex-direction: column; align-items: center; } .list-cloum .item1 { font-size: 50rpx; color: #ffffff; } .list-cloum .item2 { font-size: 24rpx; color: #D9D9D9; margin-bottom: 30rpx; } .userinfo-box::after{ content: " "; position: absolute; left: 0rpx; bottom: 0; right:0rpx; height: 1px; border-top: 1rpx solid #d48383; color: #D9D9D9; } .userinfo-area{ display:flex; flex-direction: column; margin-top:50rpx; } .userinfo-avatar { width: 168rpx; height: 168rpx; border-radius: 50%; margin: 40rpx 30rpx 40rpx 0rpx; } .userinfo-nickname { color: #fff; font-size: 30rpx; } .userinfo-parent{ font-size: 24rpx; color: #d48383; margin: 30rpx 0 20rpx; } .userinfo-company{ font-size: 24rpx; color: #fff; } .index-muen{ background-color:#fff; position: relative; display: flex; flex-direction:row; align-items: center; } .index-muen::after{ content: " "; position: absolute; left: 50%; bottom: 0; height: 100%; background-color: #eeeeee; width: 2rpx; } .index-muen .muen-list{ height: 160rpx; display: flex; flex-direction: row; align-items: center; padding:0 0rpx 0 40rpx; width: 50%; } .index-muen .image{ width: 100rpx; height: 100rpx; margin-right: 16rpx; } .muen-list .text{ display: flex; flex-direction: column; justify-content: space-between; } .massge{ overflow: hidden; width: 100%; background-color: #ffffff; margin-top: 20rpx; position: relative; } .massge-img{ width: 60rpx; height: 60rpx; margin-right: 20rpx; } .massge-hd{ padding:20rpx 0rpx 30rpx 20rpx; display: flex; flex-direction: row; align-items: center; } .massge-bd,.massge-ft{ padding:0rpx 0rpx 30rpx 40rpx; } .massge-close{ width: 100rpx; height: 100rpx; position: absolute; top: 30rpx; right: 30rpx; z-index: 22; display: flex; justify-content: flex-end; } .massge-close image{ width: 50rpx; height: 50rpx; } .news{ padding: 40rpx; margin-top: 20rpx; background-color: #ffffff; } .news-listimg{ width:100%; overflow: hidden } .img-box{ width: 670rpx; height:240rpx; overflow: hidden; } .newslist-hd{ padding-bottom: 20rpx; } |
//index.js //获取应用实例 var app = getApp() Page({ data: { motto: 'Hello World', userInfo: {}, isshow:true, animationData: {}, res:{ "monthOrdersCount": 0, "monthOrdersTotalMoney": 0, "customerCount": 2 } }, //事件处理函数 bindViewTap: function() { wx.navigateTo({ url: '../logs/logs' }) }, onLoad: function () { //调用应用实例的方法获取全局数据 app.getUserInfo((userInfo)=>{ //更新数据 this.setData({ userInfo:userInfo }) }) app.tools.request('get','http://115.159.153.103:8800/disease_list?crop_id=1',(data)=>{ console.log(data); }).then(app.tools.request('get','http://115.159.153.103:8800/disease_list?crop_id=1',(data)=>{ console.log(data); })) }, translate(){ let windowWidth=null; wx.getSystemInfo({ success: (res)=> { windowWidth=res.windowWidth } }) //console.log(windowWidth) //移动动画 var animation = wx.createAnimation({ duration:600, timingFunction: "ease", delay: 0 }) animation.translate(-windowWidth).step() animation.height(0).step() setTimeout(function(){ this.setData({ animationData:animation.export() }) }.bind(this), 200) }, bindMassge(e){ //catchtap阻止事件冒泡 bindtap 不阻止事件冒泡 console.log(e.target) console.log(e.currentTarget) wx.navigateTo({ url: '../myOrder/orderMessage' }) }, onShareAppMessage: function () { return { title: '我的分享', path: 'page/index/index' } }, onPullDownRefresh:function(){ //下拉刷新 wx.stopPullDownRefresh() }, onReachBottom:function(){ console.log(12131) // 上拉触底时触发事件 wx.showModal({ title: '提示', content: '这是一个模态弹窗', success: function(res) { if (res.confirm) { console.log('用户点击确定') } else if (res.cancel) { console.log('用户点击取消') } } }) } }) |
模板简介:该模板名称为【微信小程序仁怀酱酒保类论坛式首页设计制作开发教程】,大小是,文档格式为.,推荐使用打开,作品中的图片,文字等数据均可修改,图片请在作品中选中图片替换即可,文字修改直接点击文字修改即可,您也可以新增或修改作品中的内容,该模板来自用户分享,如有侵权行为请联系网站客服处理。欢迎来懒人模板【小程序教程】栏目查找您需要的精美模板。