Commit 846950c8c37da3fd1c0a2ea1d3712f8f456e336c

Authored by wangfan
1 parent 3fce6e73

customer

{
"pages": [
"pages/customer/index",
"pages/book/b_index",
"pages/book/b_detail",
"pages/book/b_add",
"pages/book/b_info",
"pages/book/b_desk",
"pages/customer/index",
"pages/customer/detail_owner",
"pages/customer/detail_customer",
"pages/customer/list",
... ...
... ... @@ -2,7 +2,7 @@
<view class="page">
<view class="tip">{{detail.rname}} 给你发了一个邀请:</view>
<view class="card">
<view class="top">
<view class="top" wx:if="{{detail.topic}}">
<view class="title">{{detail.topic?'#'+detail.topic+'#':''}}</view>
</view>
<view class="bottom">
... ... @@ -35,11 +35,11 @@
<view>
<block wx:for="{{detail.customers}}" wx:key="detail.customers.key">
<view class="flex-lr customers">
<view class="flex-ll">
<view class="flex-ll userinfo">
<image src="{{item.headimgurl}}" class="avatar" mode="aspectFill"></image>
<view>{{item.nickname}}</view>
</view>
<view>{{item.openid==detail.openid?'发起人':'已接受'}}</view>
<view class="userinfo-type">{{item.openid==detail.openid?'发起人':'已接受'}}</view>
</view>
</block>
</view>
... ...
... ... @@ -35,6 +35,7 @@
.seller .addr{
font-size: 26rpx;
color:#999999;
margin-top: 8rpx;
}
.hr{
border-top: 2rpx solid #F1F0F4;
... ... @@ -57,7 +58,7 @@
position: relative;
text-align: center;
width:50%;
margin: 0 auto;
margin: 0 auto 40rpx;
font-size: 26rpx;
}
.line-text .text{
... ... @@ -71,13 +72,23 @@
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;
}
.tip{
font-size: 26rpx;
color:#666666;
... ... @@ -91,6 +102,14 @@
.card .top{
min-height: 160rpx;
}
.card .title{
line-height: 160rpx;
font-size: 44rpx;
font-weight: bold;
color:#AD7644;
width:94%;
margin: 0 auto;
}
.card .bottom{
background-color: #EAECEE;
border-radius: 10rpx;
... ...
... ... @@ -31,12 +31,13 @@ Page({
return;
}
let url = 'list';
App.Reserve.SetRelaOpenid({
rid:opt.id,
openid:opt.openid,
fromid:opt.fromid?opt.fromid:''
})
if (opt.id > 0) {
App.Reserve.SetRelaOpenid({
rid:opt.id,
openid:opt.openid,
fromid:opt.fromid?opt.fromid:''
})
App.Reserve.Detail({
openid: opt.openid,
rid: opt.id
... ... @@ -56,6 +57,7 @@ Page({
wx.redirectTo({url: url});
})
} else {
console.log('url',url);
wx.redirectTo({url: url});
}
... ...
... ... @@ -72,10 +72,7 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {
return {
title: this.topicVal,
path: '/pages/customer/index?id='+this.id+'&fromid='+getApp().openid,
}
return this.shareSetting();
},
formatDatail(detail){
detail.rdateStr=util.unixtoTime(detail.rdate,'MM月DD日 WW HH:II');
... ... @@ -95,26 +92,18 @@ Page({
let val=util.val(e);
this.topicVal=val.trim();
},
userinfo(){
shareSetting(){
console.log('this.topicVal',this.topicVal)
if (!this.topicVal) {
wx.showToast({
title: '请填写邀请主题',
icon: "none"
if(this.topicVal && this.data.detail.openid==getApp().openid){
App.Reserve.SetTopicFromShare({
rid:this.id,
topic:this.topicVal
})
return;
}
if(this.data.detail.openid!=getApp().openid){
wx.showToast({
title: '只有发起人才能设置',
icon: "none"
})
return;
return {
title: this.topicVal,
path: '/pages/customer/index?id='+this.id+'&fromid='+getApp().openid,
}
App.Reserve.SetTopicFromShare({
rid:this.id,
topic:this.topicVal
})
}
})
\ No newline at end of file
... ...
... ... @@ -3,7 +3,7 @@
<view class="card">
<view class="top flex-vc">
<input bindinput="topic" bindconfirm="topic" value="{{detail.topic}}"
class="topic"
class="topic" maxlength="13"
placeholder="点这里,填写你想说的话" class-placeholder="topic-placeholder"/>
</view>
<view class="bottom">
... ...
// pages/customer/list.js
import util from '../../utils/util';
import App from '../../utils/api';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
tabFlag:0,
list:[{
success:[],
padding:[]
},{
success:[],
padding:[]
}]
},
/**
... ... @@ -26,7 +36,14 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
App.Reserve.GetListFromScheAndRes({
flag:this.data.tabFlag,
openid:getApp().openid,
}).then(res => {
let data=this.formatList(res.data);
let list=this.data.list;
list[this.data.tabFlag]=data;
})
},
/**
... ... @@ -42,25 +59,23 @@ Page({
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
_formatList(list){
if(!list) return [];
if(list.length>0){
list.forEach(row=>{
row.rdateStr=util.unixtoTime(row.rdate,'MM月DD日 WW HH:II');
})
}
return list;
},
formatList(res){
res.success=this._formatList(res.success);
res.padding=this._formatList(res.padding);
return res;
},
switchTab(e){
this.setData({
tabFlag:util.attr(e,'index')
})
}
})
\ No newline at end of file
... ...
{}
\ No newline at end of file
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"定个座儿"
}
\ No newline at end of file
... ...
<!--pages/customer/list.wxml-->
<text>pages/customer/list.wxml</text>
<view class="page">
<view class="tabs flex-cc">
<view class="item {{0==tabFlag?'active':''}}"
bindtap="switchTab" data-index="0">我的日程</view>
<view class="item" style="width: 246rpx;"></view>
<view class="item {{1==tabFlag?'active':''}}"
bindtap="switchTab" data-index="1">我的订座</view>
</view>
<block wx:for="{{list}}" wx:key="list.key" wx:for-item="parts" wx:for-index="tabindex">
<block wx:if="{{parts.success.length>0 || parts.padding.length>0}}">
<block wx:for="{{parts}}" wx:key="partskey" wx:for-item="part">
<view class="list-content" wx:if="{{tabindex==tabFlag}}">
<view>{{index=='success'?'即将开始':'待处理'}}<text>({{part.length}}条)</text></view>
<block wx:for="{{part}}" wx:key="part.key" wx:for-item="detail">
<view class="card">
<view class="top" wx:if="{{detail.topic}}">
<view class="title">{{detail.topic?'#'+detail.topic+'#':''}}</view>
</view>
<view class="bottom">
<view class="rdateStr Medium">{{detail.rdateStr}}</view>
<view class="seller flex-lr" bindtap="lookLocation">
<view class="seller-info">
<view class="name Medium">{{detail.seller.sellername}}</view>
<view class="addr">{{detail.seller.map_address}}</view>
</view>
<view class="addr-icon">
<image src="../image/gps-icon.png"></image>
</view>
</view>
</view>
</view>
</block>
</view>
</block>
</block>
<block wx:else>
<view wx:if="{{tabindex==tabFlag}}" class="flex-vc empry">
<image src="http://qn.colorcun.com/custom/lite/image/empty-order.png"></image>
<view class="Medium">{{0==tabFlag?'暂无日程':'暂无订座'}}</view>
</view>
</block>
</block>
</view>
... ...
/* pages/customer/list.wxss */
\ No newline at end of file
/* pages/customer/list.wxss */
.page{
width: 94%;
margin: 0 3%;
color:#353535;
}
.card{
border-radius: 10rpx;
box-shadow: 2rpx 2rpx 14rpx 6rpx rgba(231,228,228,.5);
}
.card .top{
min-height: 160rpx;
}
.card .title{
line-height: 160rpx;
font-size: 44rpx;
font-weight: bold;
color:#AD7644;
width:94%;
margin: 0 auto;
}
.card .bottom{
background-color: #EAECEE;
border-radius: 10rpx;
box-shadow: 2rpx 2rpx 14rpx 6rpx rgba(231,228,228,.5);
padding: 36rpx 46rpx 40rpx;
}
.card .bottom .rdateStr{
font-size: 30rpx;
}
.tabs{
margin: 56rpx 0 88rpx;
font-size: 38rpx;
color:#999999;
font-weight: bold;
}
.tabs .item{
}
.tabs .active{
color:#353535;
}
.empry{
font-size: 34rpx;
}
.empry image{
width:384rpx;
height: 296rpx;
margin-bottom: 100rpx;
margin-top: 176rpx;
}
\ No newline at end of file
... ...
... ... @@ -81,10 +81,11 @@
"query": "id=64"
},
{
"id": -1,
"id": 8,
"name": "邀请进入 pages/customer/index",
"pathName": "pages/customer/index",
"query": "id=64&fromid=test"
"query": "id=64&fromid=test",
"scene": "1001"
}
]
}
... ...
... ... @@ -25,4 +25,7 @@ export default {
//邀请详情页面----设置分享信息
'App.Reserve.SetTopicFromShare':null,
//列表----我的日程
'App.Reserve.GetListFromScheAndRes':null,
}
\ No newline at end of file
... ...