create the deatils page

kongweiyu_branch
孔维屿 2 years ago
parent e59bd68d97
commit e649f769f3

@ -16,6 +16,25 @@ App({
this.globalData = {
// OPENID: wx.cloud.getWXContext().OPENID
OPENID: '',
USERID: ''
};
try {
this.globalData.USERID = wx.getStorageSync('user_id')
} catch (e) {
console.log(e);
}
if (this.globalData.USERID) {
wx.cloud.database().collection("user_id").doc(this.globalData.USERID).get({
success: function() {
// todo
}
})
} else {
console.log("首次登录");
}
}
});

@ -5,7 +5,8 @@
"pages/Profile/profile",
"pages/Tprofile/Tprofile",
"pages/Comments/Comments",
"pages/Order/order"
"pages/Order/order",
"pages/Details/details"
],
"window": {
"backgroundColor": "#FFF",

@ -1,4 +0,0 @@
<!--pages/Detailed/detailed.wxml-->
<text>pages/Detailed/detailed.wxml</text>

@ -1 +0,0 @@
/* pages/Detailed/detailed.wxss */

@ -1,11 +1,13 @@
// pages/Detailed/detailed.js
const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
Page({
/**
* 页面的初始数据
*/
data: {
data:{
avatarUrl: defaultAvatarUrl,
},
/**

@ -0,0 +1,15 @@
<!--pages/Detailed/detailed.wxml-->
<view style="background-color: #FFFFFF; margin: 15rpx; border-radius: 25rpx;">
<view class="avatar-wrapper">
<image class="avatar" src="{{avatarUrl}}"></image>
<text>
姓名: 老师
科目: NULL
空闲时间: NULL
学历: NULL
时薪: NULL
</text>
</view>
<view style="margin: 20rpx;">综合评分: 10.0</view>
</view>

@ -0,0 +1,15 @@
/* pages/Detailed/detailed.wxss */
.avatar-wrapper {
display: flex;
justify-content: left;
}
/* 子元素选择器 */
.avatar-wrapper > image {
height: 100px;
width: 100px;
border-style: solid;
border-color: #000;
border-width: 1px;
margin: 20px;
}

@ -10,13 +10,17 @@ Page({
currentTab: 0,
showPopup: false,
teacher: {},
exist: false
exist: false,
rec: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// wx.showLoading({
// title: '加载中',
// })
//检测用户是否注册过
wx.cloud.database()
.collection('user_Data')
@ -73,6 +77,16 @@ Page({
})
},
navToDetails: () => {
wx.navigateTo({
url: '/pages/Details/details',
success: function(res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('acceptDataFromOpenerPage', { data: 'test' })
}
})
},
// contactTeacher(event) {
// // console.log(event);
// wx.makePhoneCall({
@ -84,5 +98,12 @@ Page({
inputValue: e.detail.value
});
},
recommend() {
// TODO
this.setData({
rec: true
})
console.log("rec");
}
})

@ -15,13 +15,8 @@
<view class="tab">
<<<<<<< HEAD
<view class="tab-item" bindtap="changeTab" data-index="0">教员列表</view>
<view class="tab-item" bindtap="changeTab" data-index="1">系统推荐</view>
=======
<view class="tab-item" bindtap="changeTab" data-index="0">教员风采</view>
<view class="tab-item" bindtap="changeTab" data-index="1">学员情况</view>
>>>>>>> dev
</view>
<view class="content">
@ -39,7 +34,7 @@
<view class="show_information" wx:for="{{teacher}}" wx:key="_id">
<!-- //当每通过一个教员上传的简历信息则创建一个 -->
<view class="content-container">
<view class="content-container" bind:tap="navToDetails">
<image class="image" src="/images/user.png"></image>
<view class="text-container">
<text class="title">{{item.name}}</text>
@ -64,26 +59,66 @@
</view>
<!-- 学员发布的要求界面 -->
<view wx:if="{{currentTab === 1}}">
<<<<<<< HEAD
<view>需求科目</view>
<view>教师资历</view>
<view>上课时间</view>
<picker bindchange="bindPickerChange" value="{{index}}" range="{{['C','Java','Python','高等数学']}}">
<view class="picker">
科目:{{array[index]}}当前选择科目
</view>
</picker>
<checkbox-group bindchange="test" style="display: grid; grid-template-columns: repeat(8, 1fr); border-style: solid; margin: 10rpx; border-radius: 15px; padding: 10rpx;">
<view>\</view>
<view>周一</view>
<view>周一</view>
<view>周一</view>
<view>周一</view>
<view>周一</view>
<view>周一</view>
<view>周一</view>
<view>上午</view>
<checkbox value="mon-m"/>
<checkbox value="mon-a"/>
<checkbox value="mon-a"/>
<checkbox value="mon-a"/>
<checkbox value="mon-a"/>
<checkbox value="mon-a"/>
<checkbox value="mon-a"/>
<view>上午</view>
<checkbox value="mon-m"/>
<checkbox value="mon-a"/>
<checkbox value="mon-a"/>
<checkbox value="mon-a"/>
<checkbox value="mon-a"/>
<checkbox value="mon-a"/>
<checkbox value="mon-a"/>
</checkbox-group>
=======
<view class="show_information" wx:for="{{[1,2,3,4,5,6]}}">
<!-- //当每通过一个教员上传的简历信息则创建一个 -->
<view class="content-container">
<view class="text-container">
<text class="title">标题</text>
<view>
<text class="description">描述信息</text>
</view>
<view>
<button style="margin-bottom: 20rpx;" bind:tap="recommend">确定</button>
</view>
<!-- 分割线 -->
<view class="divLine"></view>
<view class="show_information" wx:if="{{rec}}" wx:for="{{teacher}}" wx:key="_id">
<view class="content-container">
<image class="image" src="/images/user.png"></image>
<view class="text-container">
<text class="title">{{item.name}}</text>
<view>
<text class="description">
电话号码:{{item.phone}}
email{{item.email}}
其他信息null
</text>
</view>
</view>
</view>
<view class="button-container">
<button bind:tap="navToComments" class="button">评论</button>
<!-- <button bind:tap="contactTeacher" data-item="{{item.phone}}" class="button">联系</button> -->
<button bind:tap="reserved" class="button">预约</button>
</view>
</view>
>>>>>>> dev
</view>
<view class="page-container">
<!-- 页面内容 -->
<view class="popup" hidden="{{!showPopup}}">
@ -108,7 +143,7 @@
</view>
<!-- 弹窗内容 -->
</view>
<image src="/images/add.png" class="add-button" bind:tap="onAddButtonTap" />
<!-- <image src="/images/add.png" class="add-button" bind:tap="onAddButtonTap" /> -->
</view>

@ -547,4 +547,16 @@ page {
border-radius: 10rpx;
}
.picker {
margin: 10rpx;
border-radius: 15px;
border-style: solid;
padding: 10rpx;
}
/*分割线样式*/
.divLine{
background: #E0E3DA;
width: 100%;
height: 5rpx;
}
Loading…
Cancel
Save