Commit ce4a3bc02512311f0f6388dd74814f5b1045e3bd

Authored by wangfan
1 parent d5d27315

reserve index

  1 +// pages/customer/detail_owner.js
  2 +import util from '../../utils/util';
  3 +import App from '../../utils/api';
  4 +const {regeneratorRuntime} = global
  5 +Page({
  6 +
  7 + /**
  8 + * 页面的初始数据
  9 + */
  10 + data: {
  11 + detail:null,
  12 + },
  13 + id:null,
  14 + /**
  15 + * 生命周期函数--监听页面加载
  16 + */
  17 + onLoad: function (options) {
  18 + this.id=options.id;
  19 + },
  20 +
  21 + /**
  22 + * 生命周期函数--监听页面初次渲染完成
  23 + */
  24 + onReady: function () {
  25 +
  26 + },
  27 +
  28 + /**
  29 + * 生命周期函数--监听页面显示
  30 + */
  31 + onShow: function () {
  32 + App.Reserve.Detail({
  33 + openid: getApp().openid,
  34 + rid: this.id
  35 + }).then(res => {
  36 + this.setData({
  37 + detail:res.data
  38 + })
  39 + })
  40 + },
  41 +
  42 + /**
  43 + * 生命周期函数--监听页面隐藏
  44 + */
  45 + onHide: function () {
  46 +
  47 + },
  48 +
  49 + /**
  50 + * 生命周期函数--监听页面卸载
  51 + */
  52 + onUnload: function () {
  53 +
  54 + },
  55 +})
  1 +{
  2 + "navigationBarBackgroundColor": "#ffffff",
  3 + "navigationBarTextStyle": "black",
  4 + "navigationBarTitleText":"订座详情",
  5 + "usingComponents": {
  6 + "nav":"/components/nav/nav"
  7 + }
  8 +}
  1 +<!--pages/customer/detail_owner.wxml-->
  2 +<nav hasHome>参加人员</nav>
  3 +<view class="page">
  4 + <block wx:if="{{detail.customers.length>0}}">
  5 + <view class="line-text">
  6 + <view class="text">
  7 + <view> {{detail.customers.length}}人参与 </view>
  8 + </view>
  9 + </view>
  10 + <view>
  11 + <block wx:for="{{detail.customers}}" wx:key="detail.customers.key">
  12 + <view class="flex-lr customers">
  13 + <view class="flex-ll userinfo">
  14 + <image src="{{item.headimgurl}}" class="avatar" mode="aspectFill"></image>
  15 + <view>{{item.nickname}}</view>
  16 + </view>
  17 + <view class="userinfo-type">{{item.openid==detail.openid?'发起人':'已接受'}}</view>
  18 + </view>
  19 + </block>
  20 + </view>
  21 + </block>
  22 +</view>
  1 +/* pages/customer/detail_owner.wxss */
  2 +.page{
  3 + width: 90%;
  4 + margin: 80rpx 5% 0;
  5 + color:#353535;
  6 +}
  7 +.line-text{
  8 + border-top: 2rpx solid #F1F0F4;
  9 + position: relative;
  10 + text-align: center;
  11 + width:50%;
  12 + margin: 0 auto 40rpx;
  13 + font-size: 26rpx;
  14 +}
  15 +.line-text .text{
  16 + position: absolute;
  17 + top:-16rpx;
  18 + width:100%;
  19 +}
  20 +.line-text .text view{
  21 + width:130rpx;
  22 + margin: 0 auto;
  23 + background-color: #fff;
  24 +}
  25 +.customers{
  26 + margin-bottom: 30rpx;
  27 +}
  28 +.customers .avatar{
  29 + width:80rpx;
  30 + height:80rpx;
  31 + border-radius: 50%;
  32 + margin-right: 20rpx;
  33 +}
  34 +
  35 +.customers .userinfo{
  36 + font-size: 30rpx;
  37 +}
  38 +.customers .userinfo-type{
  39 + color:#999999;
  40 + font-size: 26rpx;
  41 +}