Commit ce4a3bc02512311f0f6388dd74814f5b1045e3bd

Authored by wangfan
1 parent d5d27315

reserve index

// pages/customer/detail_owner.js
import util from '../../utils/util';
import App from '../../utils/api';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
detail:null,
},
id:null,
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.id=options.id;
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
App.Reserve.Detail({
openid: getApp().openid,
rid: this.id
}).then(res => {
this.setData({
detail:res.data
})
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
})
\ No newline at end of file
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"订座详情",
"usingComponents": {
"nav":"/components/nav/nav"
}
}
\ No newline at end of file
... ...
<!--pages/customer/detail_owner.wxml-->
<nav hasHome>参加人员</nav>
<view class="page">
<block wx:if="{{detail.customers.length>0}}">
<view class="line-text">
<view class="text">
<view> {{detail.customers.length}}人参与 </view>
</view>
</view>
<view>
<block wx:for="{{detail.customers}}" wx:key="detail.customers.key">
<view class="flex-lr customers">
<view class="flex-ll userinfo">
<image src="{{item.headimgurl}}" class="avatar" mode="aspectFill"></image>
<view>{{item.nickname}}</view>
</view>
<view class="userinfo-type">{{item.openid==detail.openid?'发起人':'已接受'}}</view>
</view>
</block>
</view>
</block>
</view>
... ...
/* pages/customer/detail_owner.wxss */
.page{
width: 90%;
margin: 80rpx 5% 0;
color:#353535;
}
.line-text{
border-top: 2rpx solid #F1F0F4;
position: relative;
text-align: center;
width:50%;
margin: 0 auto 40rpx;
font-size: 26rpx;
}
.line-text .text{
position: absolute;
top:-16rpx;
width:100%;
}
.line-text .text view{
width:130rpx;
margin: 0 auto;
background-color: #fff;
}
.customers{
margin-bottom: 30rpx;
}
.customers .avatar{
width:80rpx;
height:80rpx;
border-radius: 50%;
margin-right: 20rpx;
}
.customers .userinfo{
font-size: 30rpx;
}
.customers .userinfo-type{
color:#999999;
font-size: 26rpx;
}
... ...