Commit e94ee9315332ba16f71fdbcdc6fbc8bdc444065e

Authored by liuxuqinfhp1220
2 parents 5b313ca7 93dd231f

Merge branch 'master' of http://123.56.79.57/xt/xcx-book

# By vking
# Via vking
* 'master' of http://123.56.79.57/xt/xcx-book: (57 commits)
  距离展示调整
  距离展示调整
  距离展示调整
  距离展示调整
  fix 橱窗与地图数据不匹配
  距离展示调整
  距离展示调整
  距离展示调整
  距离展示调整
  距离展示调整
  移动或缩放地图,获取更多餐厅
  移动或缩放地图,获取更多餐厅
  移动或缩放地图,获取更多餐厅
  移动或缩放地图,获取更多餐厅
  移动或缩放地图,获取更多餐厅
  一键录入
  一键录入
  一键录入
  rs
  fix usi timeout
  ...
... ... @@ -130,6 +130,9 @@
"provider": "wx56c8f077de74b07c"
}
},
"navigateToMiniProgramAppIdList": [
"wx8abaf00ee8c3202e"
],
"permission": {
"scope.userLocation": {
"desc": "你的位置信息用于获得离你最近的餐厅"
... ...
// components/common/feedback.js
const mans=[
'oB-xJ5KJCIasaEdgMRckqoL1cwg8',
'oB-xJ5KJCIasaEdgMRckqoL1cwg8', //vking.wang
//'oB-xJ5BjnTvdgQGLHsjioNHH0eE8',
'oB-xJ5MEi2mTMrBTiYImD9cpGH6o',
'oB-xJ5MEi2mTMrBTiYImD9cpGH6o', //xiao qin qin
'oB-xJ5OE1pM_17vNyWSMGqLH1vOg', //驴肉火烧多少钱一斤 MI 8
'oB-xJ5DIWrC6MECaXfql2GvTmQTU', //红旗 Redmi Note 7 Pro
'oB-xJ5I39RVWOWq-IGoBDxcFY-3s', //曹可 iPhone 6s Plus<iPhone8,2>
];
Component({
/**
... ... @@ -25,11 +26,14 @@ Component({
let openid=wx.getStorageSync('customer_openid');
if(!openid) return;
if(mans.includes(openid)){
const logger =wx.getLogManager()
let consoleLog=console.log
console.log=function () {
consoleLog(...arguments)
logger.debug(...arguments)
if(!console.hasRewrite){
const logger =wx.getLogManager()
let consoleLog=console.log
console.hasRewrite=true
console.log=function () {
consoleLog(...arguments)
logger.debug(...arguments)
}
}
this.setData({
hasDispaly:true,
... ...
... ... @@ -26,6 +26,8 @@
color: inherit;
width: 100%;
position: relative;
border-radius: 0;
background-color: transparent;
}
.layout .button .fixed{
position:relative;
... ...
... ... @@ -79,5 +79,8 @@ Component({
})
console.log('this.setData', this.data);
},
getHeight(){
return this.data.statusBarHeightFull
},
}
})
... ...
... ... @@ -18,7 +18,7 @@
</view>
<view class="addr flex-ll" wx:if="{{item.type==-1}}">
<view class="txt" wx:if="{{item.category}}">{{item.category}}</view>
<view class="txt">{{util.distance(item.distance)}}</view>
<view class="txt" wx:if="{{item.distance!=''}}">{{util.distance(item.distance)}}</view>
</view>
<view class="addr" wx:else="">{{item.addr}}</view>
</view>
... ...
... ... @@ -8,11 +8,14 @@
.item-1{
margin-bottom: 20rpx;
}
.item-1 .item-info{
.item .item-info,.item-1 .item-info{
width: calc(100% - 60rpx);
max-width: calc(100% - 60rpx);
box-sizing: border-box;
}
.item .info{
max-width:100%;
}
.item .title{
font-size: 28rpx;
height: 40rpx;
... ... @@ -20,7 +23,6 @@
white-space:nowrap;
overflow: hidden;
text-overflow:ellipsis;
}
.item .addr{
font-size: 24rpx;
... ... @@ -30,6 +32,7 @@
white-space:nowrap;
overflow: hidden;
text-overflow:ellipsis;
max-width: 100%;
}
.item .addr .txt{
border-right: 2rpx solid #979797;
... ... @@ -47,6 +50,7 @@
height:26rpx;
background-image: url("http://qn.colorcun.com/reserve/images/addr.png");
background-size: 100% 100%;
min-width: 22rpx;
}
.item-1 .info{
width: calc(100% - 140rpx);
... ... @@ -85,7 +89,6 @@
height:50rpx;
background:rgba(245,245,245,1);
border-radius:4px;
font-weight:500;
float: left;
padding: 0 10rpx;
margin-right: 20rpx;
... ...
... ... @@ -78,6 +78,9 @@ Component({
size:this.size,
distance:50,
};
if(mapParam.centre_pos){
this.param.centre_pos=mapParam.centre_pos
}
if(mapParam.tags){
this.param.tags=mapParam.tags
}
... ...
... ... @@ -47,7 +47,11 @@ Component({
sellerStyle: {//特殊样式
type: String,
value: '',
}
},
hasSuggestion:{//是否有搜索目的地
type: Boolean,
value: false,
},
},
/**
... ... @@ -63,7 +67,7 @@ Component({
},
},
observers: {
'seller': function (seller) {
'seller': function () {
this.init()
}
},
... ... @@ -73,24 +77,17 @@ Component({
methods: {
init() {
let seller = this.data.seller
if (seller.distance || seller.distance !== "") {
seller.distance = parseInt(seller.distance);
if (seller.distance > 1000) {
seller.distanceStr = (seller.distance / 1000).toFixed(2) + 'km'
} else {
seller.distanceStr = seller.distance + 'm';
}
if (seller.label_c && seller.label_c.length > 0) {
let label_cstr = [];
seller.label_c.forEach(l => {
label_cstr.push(l.name)
})
seller.label_cstr = label_cstr.join(' | ')
}
this.setData({
se: seller,
seller.label_cstr=''
if (seller && seller.label_c && seller.label_c.length > 0) {
let label_cstr = [];
seller.label_c.forEach(l => {
label_cstr.push(l.name)
})
seller.label_cstr = label_cstr.join(' | ')
}
this.setData({
se: seller,
})
},
tapButton(e) {
let type = util.attr(e, 'type');
... ...
<!--components/showModal/showModal.wxml-->
<wxs src="../../../utils/util.wxs" module="util" />
<view class="seller flex-ll {{sellerStyle}}" >
<view class="image">
<image mode="aspectFill"
... ... @@ -13,10 +14,12 @@
<view class="ActivityShort" wx:if="{{hasActivityShort && seller.activity.length>0}}"></view>
</view>
<view wx:if="{{hasSlogan && seller.slogan}}" class="slogan">“{{seller.slogan}}”</view>
<view class="text flex-ll" wx:if="{{seller.cate.length>0}}">
<view class="text-item" wx:for="{{seller.cate}}" wx:key="seller.cate.key" wx:if="{{index<3}}">{{item.name}}</view>
</view>
<view class="text flex-ll">
<view class="text-item" wx:if="{{seller.cate[0].name}}">{{seller.cate[0].name}}</view>
<view class="text-item" wx:if="{{seller.room_num>0}}">{{seller.room_num}}个包间</view>
<view class="text-item" wx:if="{{se.distanceStr}}">{{se.distanceStr}}</view>
<view class="text-item" wx:if="{{seller.distance>=0 && seller.distance!==''}}">{{hasSuggestion?'距搜索地':'距您'}}{{util.distance(seller.distance_centre||seller.distance)}}</view>
</view>
<view wx:if="{{hasStat}}" class="stat">
<stat stat="{{seller.score}}"></stat>
... ...
... ... @@ -52,9 +52,9 @@
overflow: hidden;
}
.seller .name{
font-size: 32rpx;
height: 44rpx;
line-height: 44rpx;
font-size: 34rpx;
height: 48rpx;
line-height: 48rpx;
overflow: hidden;
white-space:nowrap;
width: 100%;
... ... @@ -68,10 +68,10 @@
overflow: hidden;
}
.seller .text{
font-size: 28rpx;
font-size: 24rpx;
color: #999999;
height: 40rpx;
line-height: 40rpx;
height: 34rpx;
line-height: 34rpx;
margin-top: 10rpx;
overflow: hidden;
white-space:nowrap;
... ... @@ -80,8 +80,8 @@
text-indent: 10rpx;
border-left: 2rpx solid #999999;
padding-right: 10rpx;
height: 30rpx;
line-height: 30rpx;
height: 24rpx;
line-height: 24rpx;
overflow: hidden;
white-space:nowrap;
}
... ... @@ -124,12 +124,14 @@
.activity{
color: #F05522;
margin-top: 10rpx;
height: 34rpx;
line-height: 34rpx;
}
.activity .activity-item{
font-size: 24rpx;
height: 36rpx;
height: 24rpx;
padding: 0 10rpx 0;
line-height: 36rpx;
line-height: 24rpx;
overflow: hidden;
max-height: 36rpx;
border-radius: 6rpx;
... ...
... ... @@ -113,6 +113,11 @@ Component({
console.log('wx.getLocation', res)
}
});
/*
setTimeout(()=>{
fail({errMsg:'getLocation:fail auth deny'})
},3000)
*/
setTimeout(()=>{
if(!hasSuccess){
success(rex)
... ...
... ... @@ -63,8 +63,8 @@
background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs2-boards-checked.png");
}
.tabBar .order{
background-image: url("http://qn.colorcun.com/custom/lite-yd/image/%E6%97%B6%E9%97%B4%E6%8A%A5%E5%91%8A%20%281%29.png");
background-image: url("http://qn.colorcun.com/custom/lite-yd/image/order.png?2");
}
.tabBar .checked .order {
background-image: url("http://qn.colorcun.com/custom/lite-yd/image/%E6%97%B6%E9%97%B4%E6%8A%A5%E5%91%8A.png");
background-image: url("http://qn.colorcun.com/custom/lite-yd/image/order-checked.png?2");
}
... ...
... ... @@ -143,7 +143,6 @@ Page({
detailData: null,
async getDetail(id, force = false) {
let res = await App.Reserve.Detail({rid: id, openid: ''}, force);
res.data.rdateStr = util.unixtoTime(res.data.ddate, "MM月DD日 HH:II")
res.data.phoneStr = res.data.phone || '';
let enter_params = util.cache('enter_params');
let sc = (await App.Reserve.SellerInfo(enter_params)).data
... ... @@ -162,6 +161,17 @@ Page({
}
this.detailData = RS.reserve(res.data);
let tpl='MM月DD日 HH:II'
/*
if(this.detailData.type>0){
tpl='MM月DD日 '+this.detailData.soltName
if(res.data.is_set_ddate>0){
tpl+=' HH:II'
}
}
*/
this.detailData.rdateStr = util.unixtoTime(this.detailData.ddate, tpl)
this.setData({
tables: res.data.tables,
bookInfo: this.detailData,
... ...
... ... @@ -143,7 +143,7 @@ Page({
onShareAppMessage: function () {
return {
title:'一起来点菜啦!',
imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-go2.jpg',
imageUrl:'http://qn.colorcun.com/manager-invitation/wx3/allin.jpg',
}
},
formatCookList(list){
... ...
... ... @@ -74,7 +74,7 @@ Page({
return {
title:'菜品已点好,快来看看都点了什么~',
path:util.http_build_query(options,'/pack-cookbook/pages/success'),
imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-show2.jpg',
imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-show3.jpg',
}
},
... ...
... ... @@ -42,7 +42,7 @@
<view class="flex-lr share-view" wx:if="{{detail.type==1}}">
<formids url="/pages/customer/detail_owner_invitation?id={{detail.id}}&hasInvitation=1&hasSellerShare=1&tplid=1"
class="share-but-view">
<view class="share-but Regular">邀请同行的朋友</view>
<view class="share-but Regular">邀请同行好友</view>
</formids>
</view>
<view class="flex-lr share-view" wx:else="">
... ...
... ... @@ -134,7 +134,7 @@
text-decoration: underline;
}
.line-push{
background-image: url("https://qn.colorcun.com/reserve/images/line-push.png");
background-image: url("http://qn.colorcun.com/reserve/images/line-push.png");
width: 328rpx;
height: 42rpx;
background-size: 100% 24rpx;
... ...
... ... @@ -54,7 +54,12 @@ Page({
}else{
this.islove=await util.cache('islove')
}
let usi=await App.Invitation.UserIdentity({openid:opt.openid});
let usi={data:{seller:{},invitation:{}}}
try{
usi=await App.Invitation.UserIdentity({openid:opt.openid});
}catch (e){
console.log('App.Invitation.UserIdentity no usi');
}
if(usi.data.seller.flag){//商户
//获得商户数据
//this.enter_params=await this.SellerForOpenid(opt.openid);
... ...
... ... @@ -150,4 +150,11 @@ Page({
url:url,
})
},
gotoDetailHan(e){
console.log(util.attr(e,'id'))
let url='/pages/customer/detail_owner_invitation?id='+util.attr(e,'id')+'&hasInvitation=1&hasSellerShare=1&tplid=1'
wx.navigateTo({
url:url,
})
}
})
\ No newline at end of file
... ...
... ... @@ -25,11 +25,17 @@
<card hasListShare bindevent="gotoDetail"
seller="{{detail.seller}}" detail="{{detail}}">
<view slot="listshare" style="height:52rpx;line-height:52rpx;margin-top:4rpx;">
<userinfo-share
id="userinfo-share-{{detail.id}}"
binduserinfo="userinfo"
bindshare="share"
share="{{detail}}">
<userinfo wx:if="{{detail.hasOwner}}"
data-id="{{detail.id}}"
binduserinfo="gotoDetailHan">
<!--<view class="opt-button">{{detail.hasOwner?'邀请':'分享日程'}}</view>-->
<view class="opt-button">邀请同行好友</view>
</userinfo>
<userinfo-share wx:else="{{}}"
id="userinfo-share-{{detail.id}}"
binduserinfo="userinfo"
bindshare="share"
share="{{detail}}">
<!--<view class="opt-button">{{detail.hasOwner?'邀请':'分享日程'}}</view>-->
<view class="opt-button">发邀请函</view>
</userinfo-share>
... ...
... ... @@ -95,7 +95,7 @@
margin-left: 14rpx;
}
.opt-button{
width: 120rpx;
padding: 0 10rpx;
height: 40rpx;
line-height: 40rpx;
font-size: 26rpx;
... ...
... ... @@ -181,6 +181,7 @@ Page({
},
bindMultiPickerChange(e){
console.log(e);
if(e.detail.value[0]<0) return;
this.setData({
pickerValue:e.detail.value,
timeStr:util.unixtoTime(this.getTimeStr(e.detail.value),this.data.tpl.timeStr)
... ... @@ -277,7 +278,7 @@ Page({
...this.data.options,
},'./review')
})
})
}).catch(()=>{})
},
chooseImage(){
wx.chooseImage({
... ...
... ... @@ -122,7 +122,7 @@ Page({
}
App.Invitation.SetSellerInfo(param).then(res=>{
wx.navigateBack();
})
}).catch(()=>{})
},
onChangeAddress(){
wx.chooseLocation({
... ...
... ... @@ -10,6 +10,9 @@ Page({
data: {
hasSellerBook:false,
hasManagerInvitation:false,
extraData:{
id:55214,
}
},
/**
* 生命周期函数--监听页面加载
... ... @@ -78,5 +81,10 @@ Page({
})
},
gotoList(e){
wx.navigateTo({
url:'/pages/me/list?type='+util.attr(e,'type')
})
}
})
\ No newline at end of file
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTextStyle": "white",
"navigationBarTitleText":"我的",
"usingComponents": {
"nav":"/components/nav/nav",
... ...
<!--pages/me/index.wxml-->
<nav>周到安排</nav>
<view class="page">
<view class="header flex-ll">
<nav backgroundColor="#262628" color="#ffffff">周到安排</nav>
<layout>
<view class="meHeader flex-ll" >
<view class="avatar">
<open-data type="userAvatarUrl"></open-data>
</view>
... ... @@ -10,51 +10,83 @@
<view class="info">查看并编辑个人资料</view>
</view>
</view>
<view class="shadow" >
<view class="shadow-mask" ></view>
</view>
<view class="list">
<formids url="/pages/me/list">
<view class="item flex-lr">
<view class="left">我的订单</view>
<view class="right">
<image src="http://qn.colorcun.com/custom/lite-yd/image/click.png"></image>
<view class="pages">
<view class="block-rev">
<navigator url="/pages/me/list">
<view class="title flex-lr">
<view >我的订单</view>
<view class="more"></view>
</view>
</view>
</formids>
<!-- <formids url="/pages/me/setting">
<view class="item flex-lr">
<view class="left">常用信息</view>
<view class="right">
<image src="http://qn.colorcun.com/custom/lite-yd/image/click.png"></image>
</navigator>
<view class="content flex-ll">
<view class="flex-vc" bindtap="gotoList" data-type="1">
<view class="icon o1"></view>
<view class="text">等待确认</view>
</view>
</view>
</formids> -->
<formids url="/pages/me/concat">
<view class="item flex-lr">
<view class="left">常用联系人</view>
<view class="right">
<image src="http://qn.colorcun.com/custom/lite-yd/image/click.png"></image>
</view>
</view>
</formids>
<formids bindclick="gotoSellerBook" wx:if="{{hasSellerBook}}">
<view class="item flex-lr">
<view class="left">切换到商户模式</view>
<view class="right">
<image src="http://qn.colorcun.com/custom/lite-yd/image/click.png"></image>
<view class="flex-vc" bindtap="gotoList" data-type="2">
<view class="icon o2"></view>
<view class="text">预订成功</view>
</view>
<view class="flex-vc" bindtap="gotoList" data-type="3">
<view class="icon o3"></view>
<view class="text">历史订单</view>
</view>
<view class="flex-vc" bindtap="gotoList" data-type="4">
<view class="icon o4"></view>
<view class="text">无效预订</view>
</view>
</view>
</formids>
<formids url="/pages/manager-invitation/index" wx:if="{{hasManagerInvitation}}">
<view class="item flex-lr">
<view class="left">客户经理模式</view>
<view class="right">
<image src="http://qn.colorcun.com/custom/lite-yd/image/click.png"></image>
</view>
<view class="block-rev">
<view class="title flex-lr">
<view >常用操作</view>
</view>
<view class="content flex-ll">
<navigator class="flex-vc" url="/pages/me/concat">
<view class="icon picon p1"></view>
<view class="text">常用联系人</view>
</navigator>
<view class="flex-vc" bindtap="gotoSellerBook" wx:if="{{hasSellerBook}}">
<view class="icon picon p2"></view>
<view class="text">商户模式</view>
</view>
<navigator class="flex-vc"
open-type="redirect"
url="/pages/manager-invitation/index" wx:if="{{hasManagerInvitation}}">
<view class="icon picon p3"></view>
<view class="text">客户经理模式</view>
</navigator>
</view>
</formids>
</view>
<view class="block-list">
<button class="button-none"
open-type="contact">
<view class="item flex-lr item-border">
<view class="item-name flex-ll">
<view class="kefu"></view>
<view>联系客服</view>
</view>
<view class="item-info flex-rr">
<view>09:00~21:00</view>
<view class="more"></view>
</view>
</view>
</button>
<navigator
target="miniProgram"
open-type="navigate"
app-id="wx8abaf00ee8c3202e"
extra-data="{{extraData}}"
version="release">
<view class="item flex-lr">
<view class="item-name flex-ll">
<view class="tuco"></view>
<view>我要吐槽</view>
</view>
<view class="more"></view>
</view>
</navigator>
</view>
</view>
</view>
<fb></fb>
</layout>
<fb></fb>
\ No newline at end of file
... ...
/* pages/me/index.wxss */
.page{
width: 90%;
margin: 0 5%;
page{
background-color: #F5F5F5;
}
.pages{
width: calc(100% - 40rpx);
margin: -24rpx 20rpx 40rpx;
color:#353535;
background-color: #ffffff;
}
image{
width:100%;
height: 100%;
display: inherit;
}
.header{
margin-top: 76rpx;
padding-bottom: 54rpx;
}
.shadow{
height: 0rpx;
margin-left: -5%;
width: 110%;
box-shadow: 0 12rpx 14rpx 14rpx RGBA(231, 228, 228, 0.5);
margin-bottom: 98rpx;
position: relative;
}
.shadow-mask{
position: relative;
top:-7rpx;
height: 20rpx;
left:-2rpx;
width: 110%;
background-color: #ffffff;
.meHeader{
padding-top: 26rpx;
padding-bottom: 64rpx;
padding-left: 40rpx;
background-color: #262628;
color:#fff;
box-sizing: border-box;
margin-top: -10rpx;
}
.avatar{
width: 80rpx;
... ... @@ -47,16 +37,113 @@ image{
font-size: 26rpx;
margin-top: 4rpx;
}
.block-rev{
height: 300rpx;
box-sizing: border-box;
width: 100%;
background:rgba(255,255,255,1);
border-radius:10rpx;
margin-bottom: 20rpx;
}
.block-rev .title{
box-sizing: border-box;
height: 100rpx;
line-height: 100rpx;
border-bottom: 2rpx solid #F5F5F5;
width: calc(100% - 80rpx);
margin: 0 auto;
font-size:30rpx;
font-weight:600;
}
.block-rev .content{
height: 198rpx;
box-sizing: border-box;
font-size: 24rpx;
}
.content .flex-vc{
width: 25%;
min-width: 25%;
}
.block-rev .icon{
width:36rpx;
height:42rpx;
background-size: 100% 100%;
margin-bottom: 20rpx;
}
.icon.o1{
background-image: url("http://qn.colorcun.com/custom/me/image/o1.png");
}
.icon.o2{
background-image: url("http://qn.colorcun.com/custom/me/image/o2.png");
}
.icon.o3{
background-image: url("http://qn.colorcun.com/custom/me/image/o3.png");
}
.icon.o4{
background-image: url("http://qn.colorcun.com/custom/me/image/o4.png");
}
.block-rev .picon{
width:38rpx;
height:38rpx;
}
.picon.p1{
background-image: url("http://qn.colorcun.com/custom/me/image/p1.png");
}
.picon.p2{
background-image: url("http://qn.colorcun.com/custom/me/image/p2.png");
}
.picon.p3{
background-image: url("http://qn.colorcun.com/custom/me/image/p3.png");
}
.block-rev .width3{
width: 75%;
}
.block-list{
box-sizing: border-box;
width: 100%;
background:rgba(255,255,255,1);
border-radius:10rpx;
padding: 0 40rpx;
}
.item{
height: 107rpx;
line-height: 107rpx;
font-size: 30rpx;
box-sizing: border-box;
}
.item-border{
border-bottom: 2rpx solid #F5F5F5;
}
.item-name{
height:42rpx;
font-size:30rpx;
color:rgba(53,53,53,1);
line-height:42rpx;
}
.item-info{
height:34rpx;
font-size:24rpx;
color:rgba(53,53,53,1);
line-height:34rpx;
}
.item .left{
height: 42rpx;
line-height: 42rpx;
.item-info .more{
margin-left: 20rpx;
}
.item .right{
width: 12rpx;
height: 22rpx;
.item-name .kefu{
width: 32rpx;
height:30rpx;
background-size: 100%;
background-image: url("http://qn.colorcun.com/custom/me/image/l1.png");
margin-right: 20rpx;
}
.item-name .tuco{
width: 34rpx;
height:26rpx;
background-size: 100%;
background-image: url("http://qn.colorcun.com/custom/me/image/l2.png");
margin-right: 20rpx;
}
\ No newline at end of file
... ...
... ... @@ -10,7 +10,7 @@ Page({
* 页面的初始数据
*/
data: {
list: [],
list: [[],[],[],[],[]],
total: 0,
tabType:1,
hasMore:true,
... ... @@ -24,6 +24,12 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if(options.type){
this.tabType=options.type
this.setData({
tabType:this.tabType
})
}
this.selectComponent('#getpos').getPos();
},
... ... @@ -55,8 +61,9 @@ Page({
},
getListData() {
let tabType=this.tabType
App.Customer.GetMyOrder({
type: this.tabType,
type: tabType,
openid: getApp().openid,
offset:this.offset,
limit:this.limit,
... ... @@ -68,7 +75,7 @@ Page({
this.offset+=this.limit
}
this.setData({
list: this.data.list.concat(data),
[`list[`+tabType+`]`]: this.data.list[tabType].concat(data),
hasMore:this.hasMore
})
if(res.data.length==0){
... ... @@ -129,7 +136,7 @@ Page({
this.tabType=util.attr(e,'type')
this.setData({
tabType:this.tabType,
list: [],
list: [[],[],[],[],[]],
hasMore:false
})
this.getListData()
... ...
... ... @@ -7,14 +7,14 @@
<view class="item {{tabType==4?'active':''}}" data-type="4" bindtap="switchType">无效预订</view>
</view>
<view class="page">
<block wx:if="{{list.length==0}}">
<block wx:if="{{list[tabType].length==0}}">
<view class="flex-vc empry">
<image src="http://qn.colorcun.com/reserve/images/order-empty.png"></image>
<view class="Medium">暂无订单</view>
</view>
</block>
<block wx:else="">
<block wx:for="{{list}}" wx:key="success.key" wx:for-item="detail" wx:for-index="dateIndex">
<block wx:for="{{list[tabType]}}" wx:key="success.key" wx:for-item="detail" wx:for-index="dateIndex">
<view class="card">
<card
hasShowStatus bindevent="gotoDetail"
... ... @@ -23,7 +23,7 @@
</block>
</block>
</view>
<block wx:if="{{list.length==0 && rsl.length>0}}">
<block wx:if="{{list[tabType].length==0 && rsl.length>0}}">
<view class="rsl-block">
<view class="line-push">为你推荐</view>
<view class="transverse-list">
... ...
... ... @@ -110,7 +110,7 @@
}
.line-push{
background-image: url("https://qn.colorcun.com/reserve/images/line-push.png");
background-image: url("http://qn.colorcun.com/reserve/images/line-push.png");
width: 328rpx;
height: 42rpx;
background-size: 100% 24rpx;
... ...
... ... @@ -79,7 +79,7 @@ Page({
}
}
wx.navigateBack()
})
}).catch(()=>{})
},
changeInput(e) {
console.log(e)
... ...
... ... @@ -159,7 +159,7 @@ Page({
phoneNumber:'400-000-9690'
})
}else{
let seller_tel=this.data.seller.seller_tel
let seller_tel=this.data.seller.seller_tel||[]
if(seller_tel.length<1) return util.toast('商家电话错误','none')
if(seller_tel.length==1){//只有一个电话
let phone=seller_tel[0].replace(/[^\d]/,'')
... ...
... ... @@ -533,7 +533,7 @@
height: 70rpx;
background-size: 40rpx 36rpx;
background-position: center center;
background-image: url("https://qn.colorcun.com/reserve/images/sphone.png");
background-image: url("http://qn.colorcun.com/reserve/images/sphone.png");
}
.reserve-button{
width:680rpx;
... ...
... ... @@ -15,7 +15,7 @@ const renNum=function(){
}
return arr;
}
const cates_version='?1.1';
const cates_version='?1.2';
const hasSellerConcat=false;//变量存储所有商户
const def_latitude=39.684670;
const def_longitude=118.176300;
... ... @@ -26,8 +26,8 @@ Page({
*/
data: {
map: {
latitude: def_latitude,
longitude: def_longitude,
latitude: def_latitude+0.0001,
longitude: def_longitude+0.0001,
scale: mapScale,
height: 300,
},
... ... @@ -49,6 +49,7 @@ Page({
{id:3,name:'超大包间'},
],
listMoreCount:0,
hasSearchLimit:false,
},
hasClickMoveToLocation:false,//点击回到我的位置
hasSellerConcat:hasSellerConcat,
... ... @@ -183,7 +184,7 @@ Page({
this.selectComponent('#getpos').getPos();
if(!this.hasClickMoveToLocation){
//this.getMarkers();
this.timeoutGetMarkers();
//this.timeoutGetMarkers();
}
},
... ... @@ -244,20 +245,24 @@ Page({
sdobj.markers=[]
}
this.setData(sdobj)
this.timeoutGetMarkers()
/*
if(this.mapCtx){
//this.mapCtx.moveToLocation();
this.mapCtx.getRegion({
success:(res)=>{
console.log('onpos.getRegion',res)
//if(res.southwest.latitude!=this.mapData.region.southwest.latitude) {
this.mapData.region = res
//this.getMarkers();
//}
if(this.mapData.region.southwest.latitude) {
this.mapData.region = res
this.timeoutGetMarkers()
}
},
})
}
*/
},
regionchange(e){
if(e.type!='end') return;
console.log('regionchange', e)
if(typeof this.mapCtx=='undefined' || !this.mapCtx) return;
this.getClassNameFlag=true;
... ... @@ -282,7 +287,9 @@ Page({
success:(res)=>{
console.log('regionchange.getRegion',res.southwest.latitude,this.mapData.region.southwest.latitude,res)
this.hasClickMoveToLocation=false
this.mapData.region = res
if(res.southwest.latitude) {
this.mapData.region = res
};
this.timeoutGetMarkers();
},
})
... ... @@ -295,7 +302,7 @@ Page({
}
this.setTimeoutGetMarkers=setTimeout(()=>{
this.getMarkers();
},500)
},300)
},
mapUpdated(e){
console.log('mapUpdated', e)
... ... @@ -320,18 +327,16 @@ Page({
});
this.mapCtx.getRegion({
success:(res)=>{
console.log('mapUpdated.getRegion',res)
//if(res.southwest.latitude!=this.mapData.region.southwest.latitude){
this.mapData.region=res
//this.getMarkers();
//}
if(this.mapData.region.southwest.latitude=='' || !res.southwest.latitude) return;
console.log('mapUpdated.getRegion',[res.southwest.latitude,this.mapData.region.southwest.latitude])
this.mapData.region=res
//this.timeoutGetMarkers();
},
})
},
hasMarkertap:false,
markertap(e,flag=true){
if(e.markerId=='location')return;
if(e.markerId=='location' || e.markerId=='locationMe')return;
this.hasMarkertap=false
let markers=this.data.markers;
console.log('markertap',e)
... ... @@ -457,11 +462,17 @@ Page({
if(tags.length>0){
param.tags=tags;
}
if(param.lat){
param.centre_pos=`${param.lat},${param.lng}`
}
if(this.data.hasSuggestion){
param.centre_pos=`${this.data.suggestion.latitude},${this.data.suggestion.longitude}`
}
this.selectComponent('#list').getList(param);
this.param=param;
let now_sid=[];
App.Customer.SellerList(param).then(res => {
this.mapData.region.southwest.latitude='';
App.Customer.SellerList(param).then(async res => {
//this.mapData.region.southwest.latitude='';
if (res.ret == 200) {
let sellersList=res.data;
let sellersLength=sellersList.length;
... ... @@ -496,7 +507,7 @@ Page({
seller:seller,
};
marker.callout={
content: ' ' + seller.sellername + ' ',
content: ' ' + seller.sellername + ' ',
color: '#353535',
fontSize: 12,
borderWidth: 1,
... ... @@ -537,7 +548,8 @@ Page({
this.sellersNow=now_sid;
let obj={
hasSellers:now_sid.length>0,
hasGetSellersEnd:true
hasGetSellersEnd:true,
hasSearchLimit:tags.length>0 || this.data.multiIndex[0]>0
}
if(this.hasSellerConcat){
obj.markers=this.data.markers.concat(markers);
... ... @@ -550,7 +562,7 @@ Page({
mk.display='';
}
})
obj.markers=this.setLocationMarker(obj.markers);
obj.markers=await this.setLocationMarker(obj.markers);
this.setData(obj)
if(now_sid.length>0) {
setTimeout(() => {
... ... @@ -689,7 +701,7 @@ Page({
})
},
a2lshow(e){
console.log('a2lshow',e)
//console.log('a2lshow',e)
let ds=this.selectComponent('#ds');
if(!ds){
return setTimeout(()=>{
... ... @@ -698,17 +710,54 @@ Page({
}
ds.setA2LHeight(e.type=='hide'?0:40);
},
setLocationMarker(markers){
async setMapRegion(){
return new Promise((success,fail)=>{
if(this.mapCtx){
this.mapCtx.getRegion({
success:(res)=>{
if(res.southwest.latitude) {
this.mapData.region = res
success()
}
},
fail:()=>{
fail()
}
})
}else{
fail()
}
})
},
async setLocationMarker(markers){
try{
await this.setMapRegion();
}catch (e){
this.timeoutGetMarkers()
return []
}
let map = this.mapData;
let mks=[]
let matchPosNum=1
if(markers.length>0){
markers.forEach(mk=>{
if(mk.id!='location'){
if(mk.id!='location' && mk.id!='locationMe'
&& mk.latitude>map.region.southwest.latitude
&& mk.longitude>map.region.southwest.longitude
&& mk.latitude<map.region.northeast.latitude
&& mk.longitude<map.region.northeast.longitude){
mks.push(mk);
}
})
}
//if(this.data.hasSuggestion){
let map = this.data.map;
if(mks.length-markers.length<0){
this.timeoutGetMarkers()
return []
}
if(this.data.hasSuggestion){
map=this.data.suggestion
mks.push({
id: 'location',
iconPath: "http://qn.colorcun.com/reserve/images/location.png"+cates_version,
... ... @@ -717,10 +766,19 @@ Page({
width: 20,
height: 25,
})
//}
}
mks.push({
id: 'locationMe',
iconPath: "http://qn.colorcun.com/reserve/images/lme.png"+cates_version,
latitude: this.user.latitude,
longitude: this.user.longitude,
width: 18,
height: 30,
})
return mks;
},
tagsChange(e){
if(this.data.listMoreCount<1 && !this.data.hasSearchLimit) return
let id=util.attr(e,'id');
let tags=this.data.tags;
let activeNum=0;
... ... @@ -758,6 +816,7 @@ Page({
})
},
caixiShow(){
if(this.data.listMoreCount<1 && !this.data.hasSearchLimit) return
this.selectComponent('#caixi').show();
},
listEvent(e){
... ... @@ -782,7 +841,27 @@ Page({
map:this.param.map,
multiIndex:this.data.multiIndex,
tags:this.param.tags,
centre_pos:this.param.centre_pos,
hasSuggestion:this.data.hasSuggestion?1:''
},'./indexList')
});
},
setTSLocal(){
let map=this.data.map;
map.latitude=def_latitude
map.longitude=def_longitude
map.scale=mapScale
this.sellersIds=[]
this.sellers=[]
let sdobj={
map: map,
hasGetSellersEnd:false,
hasSuggestion:false,
suggestion:{},
}
if(!this.hasSellerConcat){
sdobj.markers=[]
}
this.setData(sdobj)
},
})
\ No newline at end of file
... ...
... ... @@ -13,9 +13,8 @@
enable-zoom
enable-scroll
enable-rotate
show-compass
subkey="SDEBZ-I74W4-QLGUX-XXYXU-HIR23-3QFBJ"
style="width: 100%; height: {{map.height}}px;"></map>
style="width: 100%; height: {{map.height+30}}px;"></map>
<formids url="/pages/reserve/search" style="position: fixed;">
<cover-view
class="flex-ll"
... ... @@ -31,11 +30,13 @@
</cover-view>
</formids>
</view>
<view class="seller-view">
<cover-view class="flex-vc transverse-view-top" bindtap="listShow">
<view class="seller-view {{(listMoreCount<1)?(hasSearchLimit?'disabled enabled':'disabled'):''}}">
<cover-view class="toast" wx:if="{{hasGetSellersEnd && listMoreCount<1 && !hasSearchLimit && markers.length<2}}">该地区没有可供预订的餐厅哦!努力开通中</cover-view>
<cover-view class="toast" wx:if="{{hasGetSellersEnd && markers.length<2 && listMoreCount>0}}">移动或缩放地图,获取更多餐厅</cover-view>
<cover-view class="flex-vc transverse-view-top" bindtap="listShow" wx:if="{{hasGetSellersEnd && listMoreCount>0}}">
<cover-view class="line"></cover-view>
<cover-view class="text">
<cover-view wx:if="{{hasGetSellersEnd}}">{{hasSellers?'查看其它':'已扩大范围为你找到'}}{{listMoreCount}}家餐厅</cover-view>
<cover-view>{{hasSellers?'查看其它':'已扩大范围为你找到'}}{{listMoreCount}}家餐厅</cover-view>
</cover-view>
</cover-view>
<view class="transverse-search flex-ll">
... ... @@ -63,13 +64,14 @@
interval="2000" duration="500"
previous-margin="{{15}}px" next-margin="{{15}}px" style="height: 350rpx;"
current="{{current}}" bindchange="bindtransition" hidden="{{!hasSellers}}">
<block wx:for="{{markers}}" wx:key="markers.key" wx:if="{{item.id!='location'}}">
<block wx:for="{{markers}}" wx:key="markers.key" wx:if="{{item.id!='location' && item.id!='locationMe'}}">
<swiper-item bindtap="gotoDetail" data-sid="{{item.id}}" wx:if="{{item.display!='none'}}">
<view class="seller" id="seller-{{item.id}}">
<sb-tr seller="{{item.seller}}"
hasActivityTags="{{false}}"
hasActivityShort="{{true}}"
hasBrand="true" hasActivityTese="true"
hasSuggestion="{{hasSuggestion}}"
hasSlogan="{{false}}"></sb-tr>
</view>
</swiper-item>
... ... @@ -88,14 +90,25 @@
</swiper>
<view class="empty-txt flex-vc">
<view class="seller" wx:if="{{hasGetSellersEnd}}">
<view class="empty" bindtap="listShow">
<view class="info">
<view class="empty">
<view class="info" wx:if="{{listMoreCount>0}}" bindtap="listShow">
<view class="info-msg Semibold">已扩大范围为你找到餐厅</view>
<view class="info-button flex-lr">
<view>去挑选</view>
<view class="info-button-gt"></view>
</view>
</view>
<view class="info" wx:elif="{{hasSearchLimit}}">
<view class="info-msg Semibold">未找到符合要求的餐厅</view>
<view class="info-txt">修改或减少条件,获取更多餐厅</view>
</view>
<view class="info" wx:else="hasSearchLimit" bindtap="setTSLocal">
<view class="info-msg Semibold">你可以切换到其他城市看看</view>
<view class="info-button full flex-lr">
<view>唐山市</view>
<view class="info-button-gt"></view>
</view>
</view>
</view>
</view>
</view>
... ...
... ... @@ -111,10 +111,21 @@ page{
height: 16rpx;
min-width:12rpx;
}
.disabled .tags{
color: #999;
}
.enabled .tags{
color: #353535;
}
.tags.active .picker .more{
background-image: url("http://qn.colorcun.com/reserve/images/%E8%8F%9C%E7%B3%BB%E9%80%89%E4%B8%AD.png");
}
.disabled .picker .more{
background-image: url("http://qn.colorcun.com/custom/lite-yd/image/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20190925174046.png");
}
.enabled .picker .more{
background-image: url("http://qn.colorcun.com/reserve/images/%E8%8F%9C%E7%B3%BB%E9%80%89%E4%B8%AD.png");
}
.searchAddr {
margin-left: 15rpx;
width: 400rpx;
... ... @@ -198,8 +209,9 @@ page{
padding: 0 20rpx;
color: #F05522;
font-size: 28rpx;
width: 106rpx;
max-width: 106rpx;
width: 146rpx;
max-width: 146rpx;
box-sizing: border-box;
}
.info-button-gt{
background-image: url("http://qn.colorcun.com/reserve/images/gt-cheng.png");
... ... @@ -208,7 +220,13 @@ page{
height: 20rpx;
}
.info-button.full{
background-color: #F05522;
color:#fefefe;
}
.info-button.full .info-button-gt{
background-image: url("http://qn.colorcun.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20190925175650.png");
}
.transverse-search .tags{
height: 50rpx;
line-height: 50rpx;
... ... @@ -238,6 +256,9 @@ page{
box-shadow: -4rpx 0 4rpx 2rpx #C5C1C1;
overflow: hidden;
}
.seller-view.disabled{
height: 410rpx;
}
.transverse-view-top{
height: 58rpx;
overflow: hidden;
... ... @@ -266,4 +287,35 @@ page{
padding-left: 40rpx;
line-height: 90rpx;
padding-top: 58rpx;
}
.disabled .transverse-search{
padding-top: 0;
}
.toast{
background-color: #000;
width: calc(100% - 272rpx);
position: fixed;
bottom:490rpx;
color: #fefefe;
height:60rpx;
font-size:26rpx;
line-height:60rpx;
left: 136rpx;
text-align: center;
border-radius:30rpx;
opacity:0.64;
}
.disabled .toast{
background-color: #000;
width: calc(100% - 72rpx);
position: fixed;
bottom:430rpx;
color: #fefefe;
height:60rpx;
font-size:26rpx;
line-height:60rpx;
left: 36rpx;
text-align: center;
border-radius:30rpx;
opacity:0.64;
}
\ No newline at end of file
... ...
... ... @@ -19,6 +19,8 @@ Page({
],
markers:[],
hasMore:true,
hasDisabled:true,
hasSuggestion:false,
},
/**
... ... @@ -27,6 +29,11 @@ Page({
onLoad: async function (options) {
//lat=34.21719&lng=108.89155&map={"errMsg":"getMapRegion:ok","southwest":{"longitude":108.87545674591064,"latitude":34.204520114013846},"northeast":{"longitude":108.90764325408935,"latitude":34.229857981005225},"scale":15}&multiIndex=1&tags=1,2
this.options=options;
if(options.hasSuggestion){
this.setData({
hasSuggestion:true
})
}
let tags=[
{id:1,name:'环境好'},
{id:2,name:'菜品有特色'},
... ... @@ -100,8 +107,11 @@ Page({
keyword:mapParam.keyword,
offset:this.offset,
size:this.size,
distance:5000,
distance:500000,
};
if(mapParam.lat){
this.param.centre_pos=`${mapParam.lat},${mapParam.lng}`
}
}else{
//计算视窗中心
let map=JSON.parse(mapParam.map);
... ... @@ -116,7 +126,11 @@ Page({
size:this.size,
distance:50,
};
if(mapParam.centre_pos){
this.param.centre_pos=mapParam.centre_pos
}
}
if(this.data.multiIndex[0]>0){
this.param.cuisine=await DA.getCatesID(this.data.multiIndex[0]-1);
}
... ... @@ -133,10 +147,21 @@ Page({
this.setData({
hasMore:res.data.length==this.size,
markers:this.sellerFormat(res.data),
hasDisabled:this.getHasDisabled(res.data.length>0,this.data.multiIndex[0]>0 || tags.length>0)
})
this.triggerEvent('event',{type:'getListEnd',total:res.data.length})
})
},
/**
* @param hasLimit 是否有搜索条件
* @returns {boolean}
*/
getHasDisabled(hasData,hasLimit){
if(this.offset==1 && !hasLimit && !hasData) {
return true
}
return false
},
getListMore(){
this.param.offset+=1;
let markers=this.data.markers;
... ... @@ -148,6 +173,7 @@ Page({
})
},
caixiShow(){
if(this.data.hasDisabled) return
this.selectComponent('#caixi').show();
},
caixiActive(e){
... ... @@ -173,6 +199,7 @@ Page({
setTimeout(()=>{this.getList();},0)
},
tagsChange(e){
if(this.data.hasDisabled) return
let id=util.attr(e,'id');
let tags=this.data.tags;
let activeNum=0;
... ...
<!--pages/reserve/indexList.wxml-->
<nav>周到安排</nav>
<view class="header">
<view class="transverse-search flex-ll">
<view class="transverse-search flex-ll {{hasDisabled?'disabled':''}}">
<view
bindtap="caixiShow"
class="tags {{multiIndex[0]>0?'active':''}}"
... ... @@ -22,18 +22,33 @@
</view>
</view>
<view class="pages">
<view class="follow">
<view class="seller" wx:for="{{markers}}" wx:key="sellers.key"
bindtap="gotoDetail" data-sid="{{item.id}}">
<sb-tr seller="{{item}}"
hasActivityTags="{{false}}"
hasActivityShort="{{true}}"
hasBrand="true" hasActivityTese="true"
hasSlogan="{{false}}"
sellerStyle="noborder noshadow noradius"></sb-tr>
</view>
<hr class="flex-vc nomore" wx:if="{{!hasMore}}" bgColor="#f5f5f5">我是有底线的</hr>
<view class="flex-vc empty" wx:if="{{markers.length<1}}">
<block wx:if="{{!hasFirstShow}}">
<image src="http://qn.colorcun.com/custom/lite-online/image/follow-empty.png"></image>
<block wx:if="{{hasDisabled}}">
<view>该地区没有可供预订的餐厅,努力开通中</view>
</block>
<block wx:else="">
<view class="empry-info1">未找到符合要求的餐厅</view>
<view class="empry-info2">修改或减少条件,获取更多餐厅</view>
</block>
</block>
</view>
<block wx:else="">
<view class="follow" >
<view class="seller" wx:for="{{markers}}" wx:key="sellers.key"
bindtap="gotoDetail" data-sid="{{item.id}}">
<sb-tr seller="{{item}}"
hasActivityTags="{{false}}"
hasActivityShort="{{true}}"
hasBrand="true" hasActivityTese="true"
hasSlogan="{{false}}"
hasSuggestion="{{hasSuggestion}}"
sellerStyle="noborder noshadow noradius"></sb-tr>
</view>
</view>
<hr class="flex-vc nomore" wx:if="{{!hasMore}}" bgColor="#ffffff">我是有底线的</hr>
</block>
</view>
<caixi multiArray="{{multiArray}}" multiIndex="{{multiIndex}}"
bindactive="caixiActive" id="caixi"
... ...
... ... @@ -47,12 +47,14 @@
height: 16rpx;
min-width:12rpx;
}
.disabled .tags{
color: #999;
}
.tags.active .picker .more{
background-image: url("http://qn.colorcun.com/reserve/images/%E8%8F%9C%E7%B3%BB%E9%80%89%E4%B8%AD.png");
}
page{
background-color: #F5F5F5;
.disabled .picker .more{
background-image: url("http://qn.colorcun.com/custom/lite-yd/image/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20190925174046.png");
}
.pages{
width: 100%;
... ... @@ -62,22 +64,36 @@ page{
}
.follow {
padding-top: 0;
padding-bottom: 40rpx;
padding-bottom: 10rpx;
}
.follow .seller{
background-color: #ffffff;
overflow: hidden;
margin: 0 0 20rpx;
border-bottom: 20rpx solid #f5f5f5;
}
.follow .seller:last-child{
border-bottom: 20rpx solid #ffffff;
}
.nomore{
color: #999;
font-size: 28rpx;
width: calc(100% - 36rpx);
margin: 40rpx auto 0;
margin: 0rpx auto 40rpx;
}
.hr{
height: 2rpx;
background-color: #F5F5F5;
width: 90%;
margin: 19rpx auto 0;
}
.empty{margin-top: 230rpx; color: #353535}
.empty image{
width: 191px;
height: 158px;
}
.empty view{
font-size: 28rpx;
margin-top: 86rpx;
}
.empty view.empry-info2{
margin-top: 20rpx;
}
\ No newline at end of file
... ...
... ... @@ -19,13 +19,14 @@ Page({
hasSellerMore:false,
keyword:'',
sellerSplit:-1,
navHeight:100,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getPos()
this.selectComponent('#getpos').getPos();
},
/**
... ... @@ -40,6 +41,10 @@ Page({
*/
onShow: function () {
this.getHistory();
this.setData({
navHeight:this.selectComponent('#nav').getHeight()
})
},
/**
... ... @@ -98,37 +103,50 @@ Page({
getsuggest: function (e) {
//调用关键词提示接口
this.inputVal=e.detail.value;
if(e.detail.value.length<1){
if(this.inputVal.length<1){
return this.setData({
suggestion: []
suggestion: [],
keyword:''
})
}
App.Customer.KeywordTips({
let prarms={
keyword:this.inputVal,
region:this.location.city||'',
region_fix:0,
location:this.location.latitude+','+this.location.longitude,
page_size:20,
page_index:1,
key:map_key,
}).then(res=>{
res.data=res.data.data
}
if(this.location.latitude){
prarms.location=this.location.latitude+','+this.location.longitude
}
App.Customer.KeywordTips(prarms).then(res=>{
if(this.inputVal.length<1){
return this.setData({
suggestion: []
})
}
var sug = [],hasSellerMore=false,sellerSplit=-1
for (var i = 0; i < res.data.length; i++) {
if(i==2 && res.data[i].type==-1){
hasSellerMore=true
continue;
try{
res.data=res.data.data
if(res.data instanceof Array){
for (var i = 0; i < res.data.length; i++) {
if(i==2 && res.data[i].type==-1){
hasSellerMore=true
continue;
}
if((i==1 || i==2) && res.data[i-1].type==-1 && res.data[i].type!=-1){
sellerSplit=i-1
}
let item=res.data[i]
item.latitude=item.location.lat
item.longitude=item.location.lng
item.addr=item.address
item.titles=item.title.match(new RegExp('(.*)('+this.inputVal+')(.*)'))
sug.push(item);
}
}
if((i==1 || i==2) && res.data[i-1].type==-1 && res.data[i].type!=-1){
sellerSplit=i-1
}
let item=res.data[i]
item.latitude=item.location.lat
item.longitude=item.location.lng
item.addr=item.address
item.titles=item.title.match(new RegExp('(.*)('+this.inputVal+')(.*)'))
sug.push(item);
}
}catch(e){}
this.setData({ //设置suggestion属性,将关键词搜索结果以列表形式展示
suggestion: sug,
hasSellerMore:hasSellerMore,
... ... @@ -168,41 +186,11 @@ Page({
})
},
location:'',
getPos(){
this._getPos().then(res => {
console.log('wx.getLocation.then', res);
this.location=res
this.getCity()
}).catch((e) => {
console.log('wx.getLocation.catch', e);
if ('getLocation:fail auth deny' == e.errMsg || 'getLocation:fail:auth denied' == e.errMsg) {
this.selectComponent('#showModal').options({
header: '定位失败',
body: '需要地理位置授权'
}).show();
} else {
setTimeout(() => {
this.getPos()
}, 500)
}
})
},
_getPos(){
return new Promise((success, fail) => {
wx.getLocation({
type: 'gcj02',
success: (res) => {
success(res)
},
fail: (res) => {
fail(res)
},
complete: (res) => {
console.log('wx.getLocation', res)
}
});
})
onpos(e){
console.log(e);
this.location=e.detail
this.GetRecommendSellerLists()
this.getCity()
},
getCity(){
qqmapsdk.reverseGeocoder({
... ... @@ -261,4 +249,46 @@ Page({
})
})
},
clearKeyword(){
this.setData({
keyword:'',
suggestion:[],
})
},
GetRecommendSellerLists(){
if(!this.location.latitude) return;
let param={}
param={
lat:this.location.latitude,
lng:this.location.longitude
}
App.Customer.GetRecommendSellerLists(param).then(res=>{
this.setData({
rsl:res.data
})
})
},
hasGoto:false,
bindtransition(e){
console.log(e)
if('change'==e.type){
this.hasGoto=false
}
if('animationfinish'==e.type){
if(this.hasGoto && (e.detail.current+1)==this.data.rsl.length){
wx.switchTab({
url: '/pages/reserve/index'
})
return;
}else{
this.hasGoto=true
}
}
},
gotoSellerDetail(e){
let url='/pages/reserve/detail?id='+e.currentTarget.id
wx.navigateTo({
url:url,
})
},
})
\ No newline at end of file
... ...
... ... @@ -4,7 +4,9 @@
"navigationBarTitleText":"周到安排",
"usingComponents": {
"formids":"/components/formids/formids",
"getpos":"/components/userinfo/getpos",
"nav":"/components/nav/nav",
"search-item":"/components/reserve/search/item"
"search-item":"/components/reserve/search/item",
"sb-tr":"/components/reserve/seller-box-transverse/seller-box"
}
}
\ No newline at end of file
... ...
<!--pages/reserve/search.wxml-->
<nav>搜索</nav>
<view class="pages">
<view class="searchAddrView">
<view class="searchAddr flex-ll">
<image class="icon" src="http://qn.colorcun.com/custom/lite-online/image/search26.png"></image>
<input style="width: 100%;" placeholder="输入餐厅名或地名,快速订包间"
type="text" confirm-type="done"
focus
bindinput="getsuggest" value="{{backfill}}"/>
</view>
<nav id="nav">搜索</nav>
<view class="searchAddrView" style="height: {{navHeight+40}}px;">
<view class="searchAddr flex-ll" style="margin-top: {{navHeight+5}}px;">
<image class="icon" src="http://qn.colorcun.com/custom/lite-online/image/search26.png"></image>
<input style="width: 100%;" placeholder="输入餐厅名或地名,快速订包间"
type="text" confirm-type="done"
focus
bindinput="getsuggest" value="{{keyword}}"/>
<image class="icon icon-del" wx:if="{{keyword.length>0}}"
catchtap="clearKeyword"
src="http://qn.colorcun.com/reserve/images/del.png"></image>
</view>
</view>
<view class="pages">
<view class="res-view">
<!--绑定回填事件-->
<block wx:for="{{suggestion}}" wx:key="index"
... ... @@ -21,8 +24,39 @@
<view class="see-more bottom" wx:if="{{suggestion.length>0}}"></view>
</view>
</view>
<view class="history" wx:if="{{history.length>0 && suggestion.length<1}}">
<view class="pages">
<view class="history" wx:if="{{suggestion.length<1}}">
<view wx:if="{{keyword.length>0}}">
<view class="flex-vc empty">
<block wx:if="{{!hasFirstShow}}">
<image src="http://qn.colorcun.com/custom/lite-online/image/follow-empty.png"></image>
<view class="empty-t1">抱歉,没有找到符合的内容</view>
<view class="empty-t2">试试搜搜别的</view>
</block>
</view>
<view class="rsl-block" wx:if="{{rsl.length>0}}">
<view class="line-push">为你推荐</view>
<view class="transverse-list">
<swiper
indicator-dots="{{false}}" autoplay="{{false}}" circular="{{false}}" vertical="{{false}}"
interval="2000" duration="500"
previous-margin="{{15}}px" next-margin="{{15}}px" style="height: 350rpx;"
current="{{current}}" bindchange="bindtransition" bindanimationfinish="bindtransition">
<block wx:for="{{rsl}}" wx:key="rsl.key">
<swiper-item bindtap="gotoSellerDetail" id="{{item.id}}">
<view class="seller" id="seller-{{item.id}}">
<sb-tr seller="{{item}}"
hasActivityTags="{{false}}"
hasActivityShort="{{true}}"
hasBrand="true" hasActivityTese="true"
hasSlogan="{{false}}"></sb-tr>
</view>
</swiper-item>
</block>
</swiper>
</view>
</view>
</view>
<view class="pages" wx:elif="{{history.length>0}}">
<view class="flex-lr">
<view class="history-title">最近搜索</view>
<view class="history-empty" bindtap="historyEmpty"></view>
... ... @@ -34,4 +68,5 @@
</view>
</view>
</view>
<fb></fb>
\ No newline at end of file
<fb></fb>
<getpos bindpos="onpos" id="getpos" hasAllowFail></getpos>
\ No newline at end of file
... ...
... ... @@ -6,16 +6,13 @@
}
.searchAddrView{
position: fixed;
top:100rpx;
width: 110%;
height: 110rpx;
background-color: #fefefe;
z-index: 10;
margin-left: -5%;
top:0rpx;
width: 100%;
height: 240rpx;
background-color: #ffffff;
z-index: 9;
}
.searchAddr {
position: fixed;
top:150rpx;
width: 90%;
height: 60rpx;
background-color: #F5F5F5;
... ... @@ -24,8 +21,7 @@
color:#999999;
line-height: 60rpx;
font-size: 28rpx;
z-index: 99;
left: 5%;
margin:0 auto;
}
.searchAddr .icon{
min-width: 26rpx;
... ... @@ -33,8 +29,13 @@
height: 26rpx;
margin: 0 20rpx;
}
.searchAddr .icon-del{
min-width: 28rpx;
width: 28rpx;
height: 28rpx;
}
.res-view{
margin-top: 110rpx;
margin-top: 120rpx;
}
.search-but{
... ... @@ -51,7 +52,7 @@
}
.history .history-title{
font-size: 28rpx;
color:#999999;
color:#353535;
height: 40rpx;
line-height: 40rpx;
font-weight:600;
... ... @@ -79,7 +80,6 @@
width:136rpx;
height:34rpx;
font-size:24rpx;
font-weight:500;
color:rgba(153,153,153,1);
line-height:34rpx;
background-color: #fefefe;
... ... @@ -94,6 +94,9 @@
content: "我是有底线的";
left:calc(50% - 100rpx);
}
.see-more.bottom{
padding-bottom: 40rpx;
}
.see-split{
width: 100%;
height: 20rpx;
... ... @@ -103,4 +106,49 @@
height: 28rpx;
background-image: url("http://qn.colorcun.com/reserve/images/empty.png");
background-size: 100% 100%;
}
.empty{margin-top: 150rpx; color: #353535}
.empty image{
width: 191px;
height: 158px;
}
.empty .empty-t1{
font-size: 28rpx;
margin-top: 60rpx;
height:40px;
line-height:40px;
}
.empty .empty-t2{
font-size: 28rpx;
margin-top: 20rpx;
height:40px;
line-height:40px;
}
.line-push{
background-image: url("http://qn.colorcun.com/reserve/images/line-push.png");
width: 328rpx;
height: 42rpx;
background-size: 100% 24rpx;
margin: 0 auto;
font-size:30rpx;
color: #C0A369;
line-height: 24rpx;
background-repeat: no-repeat;
text-align: center;
margin-bottom: 60rpx;
}
.rsl-block{
position: fixed;
bottom: 0rpx;
width: 100%;
}
.transverse-list{
background-color: #fefefe;
width: 100%;
}
.transverse-list .seller{
width: 98%;
margin: 0 auto;
}
\ No newline at end of file
... ...
... ... @@ -169,9 +169,11 @@ Page({
firstShowMsg:firstShowMsg,
},'/pages/customer/detail_owner')
})
}).catch(()=>{
}).catch((res)=>{
this.hasSubmit=true//出错后可再次提交
return util.toast('提交失败,请重试','none');
if(!res.msgSecCheck){
return util.toast('提交失败,请重试','none');
}
})
},
getRdate(){
... ...
... ... @@ -62,7 +62,7 @@
<view class="flex-rr">
<!-- 一键获取 -->
<phone bindgetphone="getphone">
<view class="smooth white-font get-phone flex-vc" style="font-size:28rpx;">一键获取</view>
<view class="smooth white-font get-phone flex-vc" style="font-size:28rpx;">一键录入</view>
</phone>
</view>
</view>
... ...
... ... @@ -16,7 +16,7 @@
background-size: 100%;
}
.shangwu-line{
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E5%95%86%E5%8A%A1%E7%BA%BF%E6%9D%A1.png");
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/zd-line.png");
background-size: 100% 100%;
width: 604rpx;
height: 30rpx;
... ... @@ -143,7 +143,7 @@
width: 600rpx;
height: 30rpx;
background-size: 100% 100%;
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E6%B8%A9%E9%A6%A8%E7%BA%BF%E6%9D%A1.png");
background-image: url("http://qn.colorcun.com/manager-invitation/wx3/wx-line.png");
}
.wenxin .seller{
margin-top: 10rpx;
... ...
... ... @@ -3,15 +3,15 @@
"setting": {
"urlCheck": true,
"es6": true,
"enhance": true,
"postcss": true,
"minified": true,
"newFeature": true,
"coverView": true,
"nodeModules": true,
"autoAudits": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"enhance": true,
"coverView": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"babelSetting": {
... ... @@ -443,7 +443,7 @@
"id": 52,
"name": "pages/reserve/indexList",
"pathName": "pages/reserve/indexList",
"query": "lat=34.21719&lng=108.89155&map={\"errMsg\":\"getMapRegion:ok\",\"southwest\":{\"longitude\":108.87545674591064,\"latitude\":34.204520114013846},\"northeast\":{\"longitude\":108.90764325408935,\"latitude\":34.229857981005225},\"scale\":15}&multiIndex=1&tags=",
"query": "lat=34.216529&lng=108.891677&map={\"errMsg\":\"getMapRegion:ok\",\"southwest\":{\"longitude\":108.85949049182128,\"latitude\":34.18927020234597},\"northeast\":{\"longitude\":108.9238635081787,\"latitude\":34.24377898163213},\"scale\":14}&multiIndex=0&tags=1,2",
"scene": null
},
{
... ...
... ... @@ -3,12 +3,60 @@
*/
//接口地址,测试环境请修改以下地址
//const server_host='https://xt04.colorcun.com/?s=';
const api_timeout=2000; //接口超时时间,默认2s
const api_timeout = 2000; //接口超时时间,默认2s
//引入接口映射关系表
import api from './api.url'
import uri_dc from './uri'
const server_host=uri_dc.HOST__LINE;
const server_host = uri_dc.HOST__LINE;
class rpcm {
tasks = {}
check(key) {
let nt = new Date().getTime()
if (this.tasks[key]) {
//console.log('resSetIntervalnt',nt , this.tasks[key].timeout)
if (nt <= this.tasks[key].timeout) {
return true
}
}
return false
}
get(key) {
return new Promise((success, fail) => {
let resSetInterval=setInterval(()=>{
console.log('resSetInterval',key,this.tasks[key])
if(this.tasks[key].type=='success'){
wx.hideLoading();
success(this.tasks[key].res)
clearInterval(resSetInterval)
}
if(this.tasks[key].type=='fail'){
wx.hideLoading();
fail(this.tasks[key].res)
clearInterval(resSetInterval)
}
},500)
})
}
set(key,type='',res=null) {
let nt = new Date().getTime()
this.tasks[key] = {
timeout: nt + 1000
}
if(type){
this.tasks[key]['type']=type
this.tasks[key]['res']=JSON.parse(JSON.stringify(res))
}
}
}
const RMT = new rpcm()
/**
*
... ... @@ -21,178 +69,220 @@ const server_host=uri_dc.HOST__LINE;
* @param timeout 接口超时
* @returns {Promise}
*/
function rpc(host='',act,data={},fouce=false,header={},silence=true,cachetime=0,timeout=api_timeout,api={}){
host=host?host:server_host;
let param="";
for(let key in data){
let val=data[key];
if(val!=="" && val!==null){
param+='&'+key+'='+val
}
function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = true, cachetime = 0, timeout = api_timeout, api = {}) {
host = host ? host : server_host;
let param = "";
for (let key in data) {
let val = data[key];
if (val !== "" && val !== null) {
param += '&' + key + '=' + val
}
let cache_key=act;
if(param){
cache_key+='?'+param.substr((param.length-1)*-1);
}
let cache_key = act;
if (param) {
cache_key += '?' + param.substr((param.length - 1) * -1);
}
if (fouce == 'clear' || fouce == 'clean') {
return wx.removeStorageSync(cache_key);
}
if (!fouce && cachetime != 0) {//优先使用缓存
let getCache = cache(cache_key);
//console.log('getCache.'+getCache,cache_key);
if (getCache != -99999) {
return new Promise((success, fail) => {
getCache.isCache = true;
console.log(cache_key + '\nuse cache', getCache);
success(getCache);
})
}
if(fouce=='clear' || fouce=='clean'){
return wx.removeStorageSync(cache_key);
}
if (!silence) {
wx.showLoading({
title: '处理中',
mask: true
})
}
if (RMT.check(cache_key)) return RMT.get(cache_key)
RMT.set(cache_key)
return new Promise(async(success, fail) => {
if(api.msgSecCheck){//数据安全检查
try{
await msgSecCheck(host,data)
}catch (e){
wx.showToast({
title:'内容含有违法违规内容',
icon:'none'
})
return fail({msgSecCheck:true})
}
}
if(!fouce && cachetime!=0){//优先使用缓存
let getCache= cache(cache_key);
//console.log('getCache.'+getCache,cache_key);
if(getCache!=-99999){
return new Promise((success,fail)=>{
getCache.isCache=true;
console.log(cache_key+'\nuse cache',getCache);
success(getCache);
})
}
let openid = wx.getStorageSync('customer_openid');
let formids = wx.getStorageSync('formids');
if (formids) {
wx.removeStorage({key: 'formids'});
}
if(!silence){
wx.showLoading({
title: '处理中',
mask:true
})
let enter_params = wx.getStorageSync('enter_params');
let operator = ''
if (enter_params) {
operator = JSON.stringify({
uid: enter_params.manager_id,
openid: enter_params.seller_openid,
sid: enter_params.seller_id,
})
}
return new Promise((success,fail)=>{
let openid = wx.getStorageSync('customer_openid');
let formids = wx.getStorageSync('formids');
if(formids){
wx.removeStorage({key:'formids'});
}
let enter_params = wx.getStorageSync('enter_params');
let operator=''
if(enter_params){
operator=JSON.stringify({
uid:enter_params.manager_id,
openid: enter_params.seller_openid,
sid:enter_params.seller_id,
})
}
if(api.openid){
data[api.openid]=data[api.openid]||openid;
}
let stime=new Date();
wx.request({
url: host+act,
method: 'POST',
data: data,
header: {
...header,
openid:openid,
formids:formids.toString(),
operator:operator,
'content-type': 'application/x-www-form-urlencoded'
},
success: function (res) {
console.log('request.api['+(new Date()-stime)+'ms]==>',host+cache_key+('&formids='+formids.toString())+'\nrequest.success',res.data);
// return;
if(res.data){
if(cachetime!=0 && res.data.ret==200){
cache(cache_key,res.data,cachetime);//.then().catch();
}
if(res.data.ret!==200){
try{
res.data.msg=res.data.msg.replace('非法请求:','');
}catch(e){
console.log('res-fail',res,e);
if (wx.getRealtimeLogManager) {
const logger = wx.getRealtimeLogManager()
logger.error('接口错误',{url:host+cache_key,res:res.data})
}
}
}
}else{
if (wx.getRealtimeLogManager) {
const logger = wx.getRealtimeLogManager()
logger.error('接口错误',{url:host+cache_key,res:res})
}
}
success(res.data);
},
fail: function (res) {
console.log('request.api==>',host+cache_key+'\nrequest.fail',res);
fail(res);
// let query = wx.createSelectorQuery().selectComponent("#network");
// let net=query.exec(function(){
// console.log('back=>',arguments);
// });
//query.show();
//console.log('net',query);
if (api.openid) {
data[api.openid] = data[api.openid] || openid;
}
let stime = new Date();
wx.request({
url: host + act,
method: 'POST',
data: data,
header: {
...header,
openid: openid,
formids: formids.toString(),
operator: operator,
'content-type': 'application/x-www-form-urlencoded'
},
success: function (res) {
console.log('request.api[' + (new Date() - stime) + 'ms]==>', host + cache_key + ('&formids=' + formids.toString()) + '\nrequest.success', res.data);
// return;
if (res.data) {
if (cachetime != 0 && res.data.ret == 200) {
cache(cache_key, res.data, cachetime);//.then().catch();
}
if (res.data.ret !== 200) {
try {
res.data.msg = res.data.msg.replace('非法请求:', '');
} catch (e) {
console.log('res-fail', res, e);
if (wx.getRealtimeLogManager) {
const logger = wx.getRealtimeLogManager()
logger.error('调用失败',{url:host+cache_key,res:res})
logger.error('接口错误', {url: host + cache_key, res: res.data})
}
},
complete:function(){
wx.hideLoading();
}
})
}
} else {
if (wx.getRealtimeLogManager) {
const logger = wx.getRealtimeLogManager()
logger.error('接口错误', {url: host + cache_key, res: res})
}
}
success(res.data);
RMT.set(cache_key,'success',res.data)
},
fail: function (res) {
console.log('request.api==>', host + cache_key + '\nrequest.fail', res);
fail(res);
RMT.set(cache_key,'fail',res)
// let query = wx.createSelectorQuery().selectComponent("#network");
// let net=query.exec(function(){
// console.log('back=>',arguments);
// });
//query.show();
//console.log('net',query);
if (wx.getRealtimeLogManager) {
const logger = wx.getRealtimeLogManager()
logger.error('调用失败', {url: host + cache_key, res: res})
}
},
complete: function () {
wx.hideLoading();
}
})
})
}
function __api(){
let tmpApi={}
let keys=[];
for(let key in api){
api[key]=api[key]||{};
keys=key.split('.');
tmpApi[keys[0]]=tmpApi[keys[0]]?tmpApi[keys[0]]:{};
tmpApi[keys[0]][keys[1]]=tmpApi[keys[0]][keys[1]]?tmpApi[keys[0]][keys[1]]:{};
tmpApi[keys[0]][keys[1]][keys[2]]=function(data,fouce=false,header){
//console.log('api[key].host',api[key].host);
return rpc(api[key].host,api[key].alias||key,data,fouce,header,
api[key].silence,api[key].cachetime,api[key].timeout,api[key]);
}
function __api() {
let tmpApi = {}
let keys = [];
for (let key in api) {
api[key] = api[key] || {};
keys = key.split('.');
tmpApi[keys[0]] = tmpApi[keys[0]] ? tmpApi[keys[0]] : {};
tmpApi[keys[0]][keys[1]] = tmpApi[keys[0]][keys[1]] ? tmpApi[keys[0]][keys[1]] : {};
tmpApi[keys[0]][keys[1]][keys[2]] = function (data, fouce = false, header) {
//console.log('api[key].host',api[key].host);
return rpc(api[key].host, api[key].alias || key, data, fouce, header,
api[key].silence, api[key].cachetime, api[key].timeout, api[key]);
}
for(let xkey in uri_dc){
let key=uri_dc[xkey].toString();
if(key.indexOf('App.')>-1){
keys=key.split('.');
try{
if(typeof tmpApi[keys[0]][keys[1]][keys[2]]=='undefined'){
throw new Error('undefined');
}
}catch(e){
api[key]=api[key]||{};
tmpApi[keys[0]]=tmpApi[keys[0]]?tmpApi[keys[0]]:{};
tmpApi[keys[0]][keys[1]]=tmpApi[keys[0]][keys[1]]?tmpApi[keys[0]][keys[1]]:{};
tmpApi[keys[0]][keys[1]][keys[2]]=function(data,fouce=false,header){
//console.log('api[key].host',api[key]);
return rpc(api[key].host,api[key].alias||key,data,fouce,header,
api[key].silence,api[key].cachetime,api[key].timeout,api[key]);
}
}
}
for (let xkey in uri_dc) {
let key = uri_dc[xkey].toString();
if (key.indexOf('App.') > -1) {
keys = key.split('.');
try {
if (typeof tmpApi[keys[0]][keys[1]][keys[2]] == 'undefined') {
throw new Error('undefined');
}
} catch (e) {
api[key] = api[key] || {};
tmpApi[keys[0]] = tmpApi[keys[0]] ? tmpApi[keys[0]] : {};
tmpApi[keys[0]][keys[1]] = tmpApi[keys[0]][keys[1]] ? tmpApi[keys[0]][keys[1]] : {};
tmpApi[keys[0]][keys[1]][keys[2]] = function (data, fouce = false, header) {
//console.log('api[key].host',api[key]);
return rpc(api[key].host, api[key].alias || key, data, fouce, header,
api[key].silence, api[key].cachetime, api[key].timeout, api[key]);
}
}
}
//console.log(tmpApi[keys[0]]);
return tmpApi[keys[0]];
}
//console.log(tmpApi[keys[0]]);
return tmpApi[keys[0]];
}
function cache(key,val=-99999,timeout=-1){
if(val!=-99999){//写入
return new Promise((success,fail)=>{
let data={
data:val,
timeout:timeout==-1?-1:(Date.parse(new Date())/1000+timeout)
}
wx.setStorage({
key:key,
data:data,
success:()=>{
success()
},
fail:()=>{
fail()
}
});
})
}
let res=wx.getStorageSync(key);
let time=Date.parse(new Date())/1000;
if(res && (res.timeout==-1 || res.timeout>time) && res.data){
return res.data;
}else{
return -99999
}
function cache(key, val = -99999, timeout = -1) {
if (val != -99999) {//写入
return new Promise((success, fail) => {
let data = {
data: val,
timeout: timeout == -1 ? -1 : (Date.parse(new Date()) / 1000 + timeout)
}
wx.setStorage({
key: key,
data: data,
success: () => {
success()
},
fail: () => {
fail()
}
});
})
}
let res = wx.getStorageSync(key);
let time = Date.parse(new Date()) / 1000;
if (res && (res.timeout == -1 || res.timeout > time) && res.data) {
return res.data;
} else {
return -99999
}
}
function msgSecCheck(host,params){
let content=JSON.stringify(params);
return new Promise(function(success,fail){
wx.request({
url: host + 'App.Wechat.MsgSecCheck',
method: 'POST',
data: {content:content},
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success: res => {
if(res.data.data.errcode==0){
success()
}else{
fail()
}
},
fail: res => {
fail()
},
complete:res=>{
wx.hideLoading();
}
})
})
}
export default __api();
\ No newline at end of file
... ...
... ... @@ -5,7 +5,9 @@ export default {
cachetime: 0, //缓存 0无,-1永久,86400秒; 默认 0 不缓存
timeout: 2000, //接口超时时间,默认2s
host: '', //默认空使用04服务器,测试填写 'https://xt05.colorcun.com:10006/?s='
//ximing http://www.dzapi.com/index.php?s=
alias: 'App.TestManagement.TestReal', //真实接口名称,默认为空
msgSecCheck:true, //进行内容安全检查
},
//预订信息详情
... ... @@ -57,10 +59,14 @@ export default {
},
//地图页-商家
'App.Customer.SellerList': null,
'App.Customer.SellerList': {
//alias: 'App.Customer.NewSellerList'
},
//地图页-商家-列表
'App.Customer.SellerLists':null,
'App.Customer.SellerLists':{
//alias: 'App.Customer.NewSellerLists'
},
//桌位列表
'App.Tables.GetTableListsBySellerId': {
... ... @@ -204,12 +210,14 @@ export default {
//编辑、增加商家信息
'App.Invitation.SetSellerInfo':{
openid:'openid',
msgSecCheck:true,
},
//修改、录入邀请函信息,同时生成对应的商家信息
'App.Invitation.SetInvitationInfo':{
silence: false,
openid:'openid',
msgSecCheck:true,
},
//邀请函详情
... ... @@ -260,6 +268,7 @@ export default {
'App.Customer.SetCustomerInfo':{
openid:'openid',
silence:false,
msgSecCheck:true,
},
//根据openid获取用的常用信息
... ... @@ -272,6 +281,7 @@ export default {
'App.Customer.SetReserveInfo':{
openid:'openid',
silence:false,
msgSecCheck:true,
},
//获得小程序码
... ...
/*
channel 预定渠道 1/2/3/4 微信小程序/电话机/安卓手机客户端/C端
is_set_ddate 是否设置到底时间 1/0 是/否
action 默认为0 未发短信 1 已发短信 2已回访
type 0商家 1顾客
status 0:待确认1:已定座2:确认到店(到店)3:用餐完成(离店)4:取消预定 5:C端在线预定(分配包间)6:拒单
ddate_solt 未设置/早市/午市/晚市/夜宵 0/1/2/3/4
*/
import util from './util'
//0:待确认1:已定座2:确认到店(到店)3:用餐完成(离店)4:取消预定 5:C端在线预定(分配包间)6:拒单
const status=[
'待确认',//0:待确认
'已预订',//1:已定座
... ... @@ -9,21 +16,9 @@ const status=[
'已预订',//5:C端在线预定(分配包间)
'已拒绝'//6:拒单
];
const soltName=['','早餐','午餐','晚餐','夜宵']
export default {
reserve(detail){
/*
let ns = new Date() / 1000
//取消
detail.hasCancel=detail.status==4;
//结束
detail.hasOvered= (ns > detail.edate || (detail.status >= 2 && detail.status <= 3)) && detail.status!=6
//正常运行已接单
if(detail.type==0){//B端
detail.hasRunning = !detail.hasOvered && !detail.hasCancel
}else{//C端
detail.hasRunning = !detail.hasOvered && !detail.hasCancel && detail.status==5
}
*/
detail.hasRunning=this.hasRunningFlag(detail)
if(!detail.hasRunning){
detail.hasCancel=detail.status==4;
... ... @@ -54,6 +49,7 @@ export default {
detail.room_demand_str+=' 等'+how+'间'
}
}
detail.soltName=soltName[detail.ddate_solt]
return detail;
},
hasRunningFlag(detail){//判断订单正在运行
... ...
... ... @@ -6,8 +6,8 @@ let tpls=[
name: '商务',
hasImage:false,
timeStr:'YYYY/MM/DD 星期WW HH:II',
shareFirstImage:'http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E5%AE%9A%E5%AE%89%E6%8E%92-%E5%95%86%E5%8A%A1.jpg',
shareImage:'http://qn.colorcun.com/manager-invitation/wx2/%E9%82%80%E8%AF%B7%E5%87%BD-%E5%95%86%E5%8A%A1.jpg',
shareFirstImage:'http://qn.colorcun.com/manager-invitation/wx3/sw1.jpg',
shareImage:'http://qn.colorcun.com/manager-invitation/wx3/sw2.jpg',
shareFirstTitle:'用餐已为您安排,点击查看详情',
shareTitle:'您收到一个用餐邀请,点击快速导航',
},
... ... @@ -17,8 +17,8 @@ let tpls=[
name: '温馨',
hasImage:true,
timeStr:'YYYY年MM月DD日HH时II分',
shareFirstImage:'http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E5%AE%9A%E5%AE%89%E6%8E%92-%E6%B8%A9%E9%A6%A8.jpg',
shareImage:'http://qn.colorcun.com/manager-invitation/wx/share-wx.jpg',
shareFirstImage:'http://qn.colorcun.com/manager-invitation/wx3/wx1.jpg',
shareImage:'http://qn.colorcun.com/manager-invitation/wx3/wx2.jpg',
shareFirstTitle:'用餐已为您安排,点击查看详情',
shareTitle:'您收到一个用餐邀请,点击快速导航',
},
... ...
... ... @@ -72,12 +72,16 @@ module.exports = {
return name
},
distance:function(mi){
if(mi>=0){
if(mi>=0 && mi!==''){
mi=mi*1
var gl='m'
if(mi>=1000){
mi=mi/1000
gl='km'
}else{
if(mi<5){
return '5m'
}
}
return mi.toFixed(2)+gl
}
... ...