Commit f0ff6b446a80cee371fe16da02e62f7682644f31

Authored by wangfan
1 parent 48492ec9

v2 customer view

... ... @@ -9,10 +9,11 @@
"pages/customer/detail_owner",
"pages/customer/detail_customer",
"pages/customer/invite",
"pages/customer/list"
"pages/customer/list",
"pages/customer/remind"
],
"window": {
"navigationStyle":"custom",
"navigationStyle": "custom",
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#199095",
"navigationBarTitleText": "点餐商户端",
... ...
... ... @@ -225,4 +225,5 @@ image{
color: inherit;
width:100%;
border-radius: 0;
background-color: transparent;
}
\ No newline at end of file
... ...
... ... @@ -22,6 +22,7 @@ Component({
data: {
rdateStr:"",
tableSubInfo:"",
masterMan:"",
},
attached(){
... ... @@ -35,9 +36,16 @@ Component({
methods: {
init(){
if(this.data.detail && this.data.detail.rdate){
let masterMan=(this.data.detail.rname||'')+' ('
+this.data.detail.phone
.replace(/([\d]{2}).*([\d]{4})/,function($0,$1,$2){
return $1+'*'+$2
})
+')';
this.setData({
rdateStr:util.unixtoTime(this.data.detail.rdate,'MM月DD日 HH:II'),
tableSubInfo:(this.data.detail.tableFirst||'')+' '+(this.data.detail.tableSubInfo||''),
masterMan:masterMan,
})
}
}
... ...
... ... @@ -30,5 +30,15 @@
{{seller.map_address}}
</view>
</view>
<view class="opt"></view>
<view class="seller master flex-lr">
<view class="master-label">
预订人
</view>
<view class="master-man">
{{masterMan}}
</view>
</view>
<view class="seller opt">
<slot></slot>
</view>
</view>
... ...
... ... @@ -74,4 +74,24 @@
height: 34rpx;
min-width: 28rpx;
margin-right: 20rpx;
}
\ No newline at end of file
}
.master{
padding-top: 0;
}
.master-label{
font-size: 20rpx;
background-color: #C8B16D;
line-height: 30rpx;
height: 30rpx;
width: 70rpx;
padding: 5rpx 10rpx;
text-align: center;
color:#FEFEFE;
}
.master-man{
font-size: 26rpx;
}
.opt{
padding-top: 0;
}
... ...
.button-none {
display: inline-block;
padding-left: 0;
padding-right: 0;
box-sizing: border-box;
font-size: inherit;
text-align: center;
text-decoration: none;
line-height: inherit;
-webkit-tap-highlight-color: transparent;
color: inherit;
width:100%;
border-radius: 0;
}
\ No newline at end of file
@import "../../app.wxss";
\ No newline at end of file
... ...
... ... @@ -60,11 +60,11 @@ Page({
onPullDownRefresh: function () {
},
getDetail(){
getDetail(fouce=false){
App.Reserve.Detail({
openid: getApp().openid,
rid: this.id
}).then(res => {
},fouce).then(res => {
this.setData({
detail:this.formatDatail(res.data)
})
... ... @@ -117,7 +117,7 @@ Page({
rid:this.id,
openid:getApp().openid
}).then(res=>{
this.getDetail();
this.getDetail(true);
})
}else{
wx.navigateTo({
... ... @@ -125,5 +125,13 @@ Page({
});
}
},
reserveCancel(){
App.Reserve.SetRelaSuccess({
rid:this.id,
openid:getApp().openid,
cancel:'cancel'
}).then(res=>{
this.getDetail(true);
})
}
})
\ No newline at end of file
... ...
... ... @@ -5,6 +5,8 @@
"usingComponents": {
"userinfo": "/components/userinfo/userinfo",
"manager": "/components/manager/manager",
"nav":"/components/nav/nav"
"nav":"/components/nav/nav",
"card":"/components/seller-card/seller-card",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
<!--pages/customer/detail_owner.wxml-->
<nav hasHome>订座详情</nav>
<view class="page">
<view class="tip">{{detail.rname}} 给你发了一个邀请:</view>
<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 class="card" style="margin-top: 42rpx; margin-bottom: 168rpx;">
<card seller="{{detail.seller}}" detail="{{detail}}">
<view class="opt flex-rr">
<block wx:if="{{!detail.hasCanSuccess}}">
<userinfo binduserinfo="userinfo">
<view class="opt-button">赴约</view>
</userinfo>
</block>
<block wx:else="">
<formids bindclick="reserveCancel">
<view class="opt-button">取消</view>
</formids>
<formids url="./remind?id={{detail.id}}&rdate={{detail.rdate}}">
<view class="opt-button">提醒</view>
</formids>
<userinfo binduserinfo="userinfo">
<view class="opt-button">分享日程</view>
</userinfo>
</block>
</view>
<view class="tableInfo">{{detail.tableFirst}} <text class="tableSubInfo"> {{detail.tableSubInfo}}</text></view>
<view class="flex-lr showManager" bindtap="showManager" wx:if="{{detail.cusman}}">
<view class="">容客户经理-{{detail.cusman}}</view>
<view style="text-decoration: underline" wx:if="{{detail.cusman_phone || detail.cusman_account}}">联系客户经理</view>
</view>
</view>
</card>
</view>
<userinfo binduserinfo="userinfo" class="share-but-view">
<view class="share-but Regular">{{!detail.hasCanSuccess?'我愿意':'去邀请'}}</view>
</userinfo>
<block wx:if="{{detail.customers.length>0}}">
<view class="line-text">
<view class="text">
<view>{{detail.customers.length}}人参与</view>
<view> {{detail.customers.length}}人参与 </view>
</view>
</view>
<view>
... ...
... ... @@ -67,7 +67,7 @@
width:100%;
}
.line-text .text view{
width:100rpx;
width:130rpx;
margin: 0 auto;
background-color: #fff;
}
... ... @@ -129,4 +129,16 @@
.showManager{
font-size: 30rpx;
margin-top: 26rpx;
}
.opt .opt-button{
width: 120rpx;
height: 40rpx;
line-height: 40rpx;
font-size: 26rpx;
color:#262628;
border: 2rpx solid #262628;
text-align: center;
margin-left: 18rpx;
}
\ No newline at end of file
... ...
... ... @@ -77,4 +77,4 @@
.tableSubInfo{
font-size: 30rpx;
color:#ccc;
}
\ No newline at end of file
}
... ...
// pages/customer/remind.js
import util from '../../utils/util';
import App from '../../utils/api';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
reminds:[
{val:0,label:'不提醒'},
{val:30,label:'30分钟前'},
{val:60,label:'1小时前'},
{val:120,label:'2小时前'},
{val:24*60,label:'1天前'},
{val:48*60,label:'2天前'},
],
},
remind_date:0,
id:null,
rdate:0,
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log('onLoad',options);
this.id=options.id;
this.rdate=options.rdate;
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
radioChange(e){
let val=util.val(e);
console.log(val);
this.remind_date=0;
if(val>0){
this.remind_date=parseInt(this.rdate)-parseInt(val*60);
}
},
remind(){
App.Reserve.SetRelaSuccess({
rid:this.id,
openid:getApp().openid,
remind_date:this.remind_date
}).then(res=>{
wx.navigateBack()
})
}
})
\ No newline at end of file
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"订座详情",
"usingComponents": {
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
<!--pages/customer/remind.wxml-->
<nav hasHome>设置提醒</nav>
<view class="page">
<view class="reminds">
<radio-group class="radio-group" bindchange="radioChange" >
<label class="radio" wx:for="{{reminds}}" wx:key="reminds.key">
<radio value="{{item.val}}" color="#262628"/>{{item.label}}
</label>
</radio-group>
</view>
<formids bindclick="remind">
<view class="share-but">确定</view>
</formids>
</view>
... ...
/* pages/customer/remind.wxss */
.page{
width: 90%;
margin: 0 5%;
color:#353535;
}
.reminds{
font-size: 34rpx;
margin: 102rpx 5% 0;
}
.reminds label{
display: flex;
display: -webkit-flex;
justify-content: space-between;
align-items:center;
flex-direction: row-reverse;
-webkit-flex-direction: row-reverse;
line-height: 48rpx;
margin-bottom: 102rpx;
height: 48rpx;
}
.reminds label.radio radio{
}
.reminds label.radio radio[checked]{
}
.share-but{
color:#FEFEFE;
background: #262628;
width: 100%;
line-height: 80rpx;
font-size: 34rpx;
text-align: center;
}
\ No newline at end of file
... ...
... ... @@ -30,7 +30,7 @@
"list": []
},
"miniprogram": {
"current": 6,
"current": 11,
"list": [
{
"id": 0,
... ... @@ -107,6 +107,18 @@
"pathName": "pages/book/b_info",
"query": "year=2018&date=08-23&time=18:30",
"scene": "1001"
},
{
"id": 11,
"name": "pages/customer/remind",
"pathName": "pages/customer/remind",
"query": "id=21&rdate=153745200",
"scene": "1044",
"shareInfo": {
"groupName": "测试模拟群1",
"shareName": "8DEbIRpK4pa9mH_QY2vU4ZUKYPuI97WoQ4BQoFej-Q8@cr4dev",
"shareKey": "PZhnqMlY2TnRuHhATyGeSamVmBQUDXXr_WtjRSddeeFK17UAiOP-HNOdhxiEN7PFub5S1DjAeUl0IXOdW-VDqg~~"
}
}
]
}
... ...
... ... @@ -51,10 +51,11 @@ function rpc(host='',act,data={},fouce=false,header={},silence=true,cachetime=0,
if(!silence){
wx.showLoading({
title: '数据加载中',
mask:true
})
}
return new Promise((success,fail)=>{
let openid = wx.getStorageSync('openid');
let openid = wx.getStorageSync('customer_openid');
let formids = wx.getStorageSync('formids');
if(formids){
wx.removeStorage({key:'formids'});
... ...
... ... @@ -9,7 +9,7 @@ export default {
//预定信息详情
'App.Reserve.Detail':{
cachetime:30,
cachetime:60,
},
//建立预定关系
... ...