Commit 403b3f0911423b55ecba2d2297144b7daf76b92e

Authored by wangfan
2 parents 87a5f596 3b6c8452

Merge remote-tracking branch 'remotes/origin/manager-invitation'

Showing 50 changed files with 2899 additions and 10 deletions
... ... @@ -31,7 +31,16 @@
"pages/book/smsbatch/result",
"pages/reserve/search",
"pages/reserve/detail",
"pages/me/follow"
"pages/me/follow",
"pages/manager-invitation/index",
"pages/manager-invitation/review",
"pages/manager-invitation/editor",
"pages/manager-invitation/display",
"pages/manager-invitation/setting/index",
"pages/manager-invitation/setting/sellers",
"pages/manager-invitation/setting/seller-editor",
"pages/manager-invitation/crm/index",
"pages/manager-invitation/setting/history"
],
"subpackages": [
{
... ...
// components/book/tabBar/tabBar.js
import util from '../../../utils/util'
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
pi:0,
},
attached(){
let pages=getCurrentPages();
let p=pages[pages.length-1];
let pi=['/pages/manager-invitation/review','/pages/manager-invitation/crm/index','/pages/manager-invitation/setting/index'];
for(let x in pi){
console.log('tabBar',pi[x],p);
if(pi[x].indexOf(p.route)>-1){
this.setData({
pi:x
})
break;
}
}
},
/**
* 组件的方法列表
*/
methods: {
redirectTo(e){
let url=util.attr(e,'url');
let pages=getCurrentPages();
let p=pages[pages.length-1];
if(url.indexOf(p.route)<0){
wx.redirectTo({
url:url,
})
}
}
}
})
... ...
{
"component": true,
"usingComponents": {
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
<!--components/book/tabBar/tabBar.wxml-->
<view class="tabBar flex-cc">
<formids class="item flex-vc" bindtap="redirectTo" data-url="/pages/manager-invitation/review">
<view class="flex-vc {{pi==0?'checked':''}}" >
<view class="icon reserve"></view>
<view class="text">通知客户</view>
</view>
</formids>
<!--
<formids class="item flex-vc" bindtap="redirectTo" data-url="/pages/manager-invitation/crm/index">
<view class="flex-vc {{pi==1?'checked':''}}">
<view class="icon book"></view>
<view class="text">我的客户</view>
</view>
</formids>
-->
<formids class="item flex-vc" bindtap="redirectTo" data-url="/pages/manager-invitation/setting/index">
<view class="flex-vc {{pi==2?'checked':''}}">
<view class="icon setting"></view>
<view class="text">我的</view>
</view>
</formids>
</view>
... ...
/* components/book/tabBar/tabBar.wxss */
@import "../../../app.wxss";
.tabBar{
height: 98rpx;
background-color: rgba(0,0,0,.7);
width:100%;
position: fixed;
bottom: 0;
font-size: 20rpx;
color:#999999;
z-index: 9;
}
.tabBar-block{
height: 98rpx;
width: 100%;
}
.tabBar .checked{
color: #C0A369;
}
.tabBar .item{
width: 50%;
}
.tabBar .icon{
width: 34rpx;
height: 32rpx;
margin-bottom: 12rpx;
background-size: 100% 100%;
}
.tabBar .icon image{
width: 100%;
height: 100%;
}
.tabBar .reserve{
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E9%80%9A%E7%9F%A5%E5%AE%A2%E6%88%B7-%E6%9C%AA%E7%82%B9%E5%87%BB.png");
}
.tabBar .checked .reserve{
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E9%80%9A%E7%9F%A5%E5%AE%A2%E6%88%B7-%E7%82%B9%E5%87%BB.png");
}
.tabBar .book{
background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs2-book.png");
}
.tabBar .checked .book {
background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs2-book-checked.png");
}
.tabBar .setting{
width: 34rpx;
height: 34rpx;
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E6%88%91%E7%9A%84.png");
}
.tabBar .checked .setting {
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E6%88%91%E7%9A%84-%E9%80%89%E4%B8%AD.png");
}
... ...
... ... @@ -4,6 +4,7 @@
position:fixed;
width: 100%;
z-index: 10;
top:0;
}
.nav{
font-size: 30rpx;
... ...
... ... @@ -49,9 +49,19 @@ Page({
}else{
this.islove=await util.cache('islove')
}
//获得商户数据
this.enter_params=await this.SellerForOpenid(opt.openid);
let usi=await App.Invitation.UserIdentity({openid:opt.openid});
if(usi.data.identity==1){//商户
//获得商户数据
//this.enter_params=await this.SellerForOpenid(opt.openid);
this.enter_params=usi.data.data;
}else if(usi.data.identity==2){//客户经理
if(this.islove!='customer'){
wx.redirectTo({
url:'/pages/manager-invitation/review'
})
return;
}
}
//console.log('this.enter_params',this.enter_params)
let url = '/pages/customer/list';
if (opt.id > 0 || opt.sms_code) {
... ...
// pages/book/setting/index.js
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
Page({
offset: 0,
limit: 10,
hasMore: true,
list:{},
/**
* 页面的初始数据
*/
data: {
list:[],
hasMore:true,
hasSalesman:false,
},
/**
* 生命周期函数--监听页面加载
*/
enter_params: {},
onLoad: function (options) {
this.getMembers();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if(this.hasMore){
this.getMembers(true);
}
},
getMembers(hasReachBottom=false){
App.Invitation.Members({
openid:getApp().openid,
offset: this.offset,
limit: this.limit,
}).then(res => {
let list = this.data.list;
let dl=res.data.length;
if (dl > 0) {
res.data.forEach(r => {
//r.addtimeStr = util.unixtoTime(r.addtime, 'MM/DD HH:II')
list.push(r)
this.list[r.id] = r;
})
}
let obj={list:list};
if(dl<this.limit && hasReachBottom){
this.hasMore=false;
obj.hasMore=false;
}else{
this.offset+=this.limit;
}
this.setData(obj)
})
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"tabBar":"/components/book/tabBar/tabBar",
"formids":"/components/formids/formids",
"tabBar":"/components/manager-invitation/tabBar/tabBar"
}
}
\ No newline at end of file
... ...
<!--pages/book/setting/index.wxml-->
<nav id="nav" backgroundColor="#199095" color="#fefefe">我的客户</nav>
<view class="pages">
<block wx:if="{{list.length>0}}">
<view class="row flex-lr" wx:for="{{list}}" wx:key="list.key" >
<view class="flex-ll">
<view class="avatar">
<image src="{{item.headimgurl}}"></image>
</view>
<view class="nickname">{{item.nickname||''}}</view>
</view>
<view class="flex-rr optmsg" wx:if="{{hasSalesman}}" bindtap="sendSalesmanMsg" data-openid="{{item.openid}}">
<view>发送消息</view>
<view class="more"></view>
</view>
</view>
</block>
<view wx:else="" class="history-is-empty flex-vc Medium">
<image src="http://qn.colorcun.com/custom/lite-yd/image/history-is-empty.png"></image>
<view>暂时还没有客户</view>
</view>
<view wx:if="{{!hasMore}}" class="row flex-vc">已经到底了</view>
</view>
<tabBar></tabBar>
\ No newline at end of file
... ...
/* pages/book/setting/index.wxss */
/*
http://qn.colorcun.com/custom/lite-yd/image/icon-zk.png
http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png
*/
.pages{
width: 90%;
margin: 0 auto 50rpx;
color: #353535;
overflow-y: auto;
}
.row{
font-size: 34rpx;
height: 106rpx;
border-bottom: 2rpx solid #F1F0F4;
padding-top: 34rpx;
}
.row .right{
font-size: 30rpx;
color:#999999;
}
.row .more{
margin-left: 20rpx;
}
.row:last-child{
border-bottom-width: 0;
}
.history-is-empty{
margin: 200rpx auto;
font-size: 34rpx;
}
.history-is-empty image{
width: 376rpx;
height: 310rpx;
margin-bottom: 122rpx;
}
.avatar{
width: 80rpx;
height: 80rpx;
border-radius: 50%;
overflow: hidden;
}
.avatar image{
width: 100%;
height: 100%;
}
.nickname{
margin-left: 40rpx;
font-size: 34rpx;
}
.optmsg{
font-size: 30rpx;
color:#199095;
}
\ No newline at end of file
... ...
// pages/manager-invitation/review.js
import util from '../../utils/util';
import App from '../../utils/api';
import TP from '../../utils/tpls';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
height: 667,
current: 0,
tpls: [],
seller:{
name:'',
room:'',
date:'',
addr:''
},
options:{tplid:1},
hasOwner:true,//是否为发起人
animation:'animation',
},
/**
* 生命周期函数--监听页面加载
*/
openid:'',
onLoad: async function (options) {
this.openid=await getApp().openid;
if(options.fromid==this.openid && options.hasSellerShare==1){//商家分享自己点跳到商家预览页
wx.redirectTo({
url:util.http_build_query({rid:options.rid,tplid:options.tplid},'./review')
})
return;
}
App.Invitation.SetInvitationRel({
id:options.rid,
initiator:options.fromid,
inviting:this.openid,
})
let param={
options:options,
hasOwner:options.hasSellerShare==1,//是否为发起人
}
if(options.rid){
param.tpls=[TP.tpls(options.tplid)]
}
this.setData(param)
this.initData(options);
},
initData(options){
App.Invitation.Detail({id:options.rid}).then(res=>{
let hasOwner=false;
let hasCanSuccess=false;
if(res.data.customers && res.data.customers.length>0){
res.data.customers.forEach((u,i)=>{
if(u.openid==this.openid){
if(i==0){hasOwner=true;}
hasCanSuccess=true;
}
})
}
let obj={
seller:{
name:res.data.seller_name,
room:res.data.room_name,
date:util.unixtoTime(res.data.arrival_time,this.data.tpls[this.data.current].timeStr),
addr:res.data.seller_address,
image:res.data.image_url,
hasCanSuccess:hasCanSuccess,
lat:res.data.lat,
long:res.data.long,
}
}
obj.hasOwner=hasOwner
this.setData(obj)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
//导航栏自适应
let systemInfo = wx.getSystemInfoSync();
let reg = /ios/i;
let pt = 20;//导航状态栏上内边距
let h = 44;//导航状态栏高度
if (reg.test(systemInfo.system)) {
pt = systemInfo.statusBarHeight;
h = 44;
} else {
pt = systemInfo.statusBarHeight;
h = 48;
}
this.setData({
statusBarHeight: pt,
titleBarHeight: h,
height: systemInfo.windowHeight
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
this.setData({
animation:'',
})
let path=util.http_build_query({
...this.data.options,
fromid:this.openid,
hasSellerShare:'',
},'/pages/manager-invitation/display')
return {
title: '你收到一个邀请函,点击查看',
path: path,
imageUrl:this.data.tpls[this.data.current].shareImage,
//imageUrl:util.cgi('App.Reserve.MakePic&rid='+this.data.options.rid),
}
},
setUserInfoSuccess(){
util.toast('授权成功,可以继续转发','none');
},
confirmed(){
if(!this.data.seller.hasCanSuccess){
let userInfo=util.cache('userInfo');
if(userInfo){
userInfo=JSON.stringify({
openid: this.openid,
avatar: userInfo.avatarUrl,
nickname: userInfo.nickName,
gender: userInfo.gender
})
}
App.Invitation.SetInvitationConfirm({
lid:this.data.options.rid,
openid:this.openid,
is_agree:1,
userinfo:userInfo
}).then(res=>{
this.setData({
[`seller.hasCanSuccess`]:true
})
util.toast('赴约成功','none')
})
}else{
util.toast('赴约成功','none')
}
},
lookLocation:function(){
//console.log(this.data.seller.lat,this.data.seller.long,this.data.detail.map_address)
wx.openLocation({
latitude:Number(this.data.seller.lat),
longitude:Number(this.data.seller.long),
scale:17,
address:this.data.seller.addr,
success:function (res) {
console.log(res)
}
})
},
})
\ No newline at end of file
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "white",
"navigationBarTitleText":"订座详情",
"usingComponents": {
"userinfo": "/components/userinfo/userinfo",
"nav":"/components/nav/nav",
"formids":"/components/formids/formids",
"userinfo-share": "/components/userinfo/share"
}
}
\ No newline at end of file
... ...
<!--pages/manager-invitation/review.wxml-->
<nav backgroundColor="rgba(0,0,0,0)" hasHome style="position: fixed;z-index: 1;"></nav>
<view class="pages bg-{{options.tplid}} flex-vc" style="height:{{height}}px;">
<template is="tpl-{{options.tplid}}" data="{{...seller,options,hasOwner,animation}}"></template>
</view>
<!--//商务-->
<template name="tpl-1">
<view class="flex-vc shangwu">
<view class="invit-logo {{hasOwner?'owner':'customer'}}"></view>
<view class="shangwu-line"></view>
<view class="seller flex-vc">
<view class="title flex-cc">
<view class="title-left"></view>
餐厅
<view class="title-right"></view>
</view>
<view class="content name">{{name}}</view>
<view class="title flex-cc">
<view class="title-left"></view>
包间
<view class="title-right"></view>
</view>
<view class="content">{{room}}</view>
<view class="title flex-cc">
<view class="title-left"></view>
时间
<view class="title-right"></view>
</view>
<view class="content">{{date}}</view>
<view class="title flex-cc">
<view class="title-left"></view>
地址
<view class="title-right"></view>
</view>
<view class="content flex-cc addr" bindtap="lookLocation">
<image src="http://qn.colorcun.com/manager-invitation/wx/address.png" class="invit-addr"></image>
{{addr}}
</view>
</view>
<block wx:if="{{hasOwner}}">
<userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess" wx:if="{{options.rid}}" catchtap="catchShare">
<view class="buts-share {{animation}}"></view>
</userinfo-share>
</block>
<block wx:else="">
<userinfo class="button-none flex-vc" binduserinfo="confirmed" wx:if="{{options.rid}}" catchtap="catchtap">
<view class="buts-share animation customer"></view>
</userinfo>
</block>
</view>
</template>
<!--//温馨-->
<template name="tpl-2">
<view class="wenxin-top"></view>
<view class="wenxin-bottom"></view>
<view class="flex-vc wenxin">
<view class="invit-logo {{hasOwner?'owner':'customer'}}"></view>
<view class="wenxin-mask">
<view class="wenxin-mask-bg" style="background-image: url({{image||'http://qn.colorcun.com/manager-invitation/wx/hunshazhao3.jpg'}})"></view>
<view class="wenxin-mask-img"></view>
</view>
<view class="wenxin-baitou"></view>
<view class="wenxin-line"></view>
<view class="seller flex-vc">
<view class="content">{{date}}</view>
<view class="content">{{name}}{{room}}</view>
<view class="content flex-cc addr" bindtap="lookLocation">
<image src="http://qn.colorcun.com/manager-invitation/wx/address.png" class="invit-addr"></image>
{{addr}}
</view>
</view>
<block wx:if="{{hasOwner}}">
<userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess" wx:if="{{options.rid}}" catchtap="catchShare">
<view class="buts-share {{animation}}"></view>
</userinfo-share>
</block>
<block wx:else="">
<userinfo class="button-none flex-vc" binduserinfo="confirmed" wx:if="{{options.rid}}" catchtap="catchtap">
<view class="buts-share animation customer"></view>
</userinfo>
</block>
</view>
</template>
... ...
/* pages/manager-invitation/review.wxss */
@import "tpls.wxss";
.pages{
font-size: 200rpx;
background-size: 100%;
font-size: 34rpx;
position: fixed;
width: 100%;
}
image{
width: 100%;
height: 100%;
}
.buts-share{
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E5%8F%91%E9%82%80%E8%AF%B7%E5%87%BD.png");
}
.buts-share.customer{
background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E7%A1%AE%E8%AE%A4%E6%94%B6%E5%88%B0.png");
}
.shangwu{
margin-top: 52rpx;
}
.shangwu .seller{
margin-bottom: 92rpx;
}
.shangwu .invit-logo.owner{
width: 380rpx;
height: 200rpx;
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92.png");
}
.shangwu .invit-logo.customer{
width: 352rpx;
height: 164rpx;
background-image: url("http://qn.colorcun.com/custom/lite-yd/image/invit-logo.png");
}
.wenxin-mask{
margin-top: 20rpx;
}
.wenxin-baitou{
margin-top: 20rpx;
}
.wenxin .seller{
margin-bottom: 22rpx;
}
.wenxin .invit-logo.owner{
width: 340rpx;
height: 184rpx;
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92-%E6%B8%A9%E9%A6%A8.png");
}
.wenxin .invit-logo.customer{
width: 344rpx;
height: 198rpx;
background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E9%82%80%E8%AF%B7%E5%87%BD.png");
}
... ...
// pages/manager-invitation/editor.js
import util from '../../utils/util';
import App from '../../utils/api';
import TP from '../../utils/tpls';
const {regeneratorRuntime} = global
import PubSub from '../../utils/PubSub'
Page({
/**
* 页面的初始数据
*/
data: {
pickerValue:[-1,0,0],
pickerData:[[],[],[]],
hasSubmit:false,
form:{
name:'',
room:'',
addr:'',
sid:'',
time:'',
image:'',
latitude:'',
longitude:'',
},
defImage:'http://qn.colorcun.com/manager-invitation/wx/upload2.jpg',
tpl:{},
timeStr:'',
},
/**
* 生命周期函数--监听页面加载
*/
pickerData:[],
tpl:{},
onLoad: function (options) {
this.tpl=TP.tpls(options.tplid);
this.pickerData=TP.pickerData();
let pd=TP.pickerData();
pd[2]=pd[2][this.data.pickerValue[1]];
this.initData(options)
this.setData({
pickerData:pd,
tpl:this.tpl,
options:options,
})
PubSub.on(
'quick',
data=>{
console.log('quick.msg',data)
this.setData({
[`form.sid`]:data.id,
[`form.name`]:data.name,
[`form.addr`]:data.address,
[`form.latitude`]:data.lat,
[`form.longitude`]:data.long,
})
this.checkHasSubmit();
}
)
},
initData(options){
if(options.rid){
App.Invitation.Detail({id:options.rid}).then(res=>{
this.setData({
form:{
sid:res.data.seller_name,
name:res.data.seller_name,
room:res.data.room_name,
addr:res.data.seller_address,
sid:res.data.sid,
time:res.data.arrival_time,
image:res.data.image_url,
latitude:res.data.lat,
longitude:res.data.long,
},
timeStr:util.unixtoTime(res.data.arrival_time,this.data.tpl.timeStr)
})
this.checkHasSubmit();
})
}else{
App.Invitation.GetSellerList({
openid:getApp().openid
}).then(res=>{
if(res.data.length>0){
let defi=0;
for(let i=0;i<res.data.length;i++){
if(res.data[i].is_default==1){
defi=i;
break;
}
}
let sel=res.data[defi];
this.setData({
form:{
sid:sel.id,
name:sel.name,
addr:sel.address,
latitude:sel.lat,
longitude:sel.long,
}
})
}
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
bindMultiPickerColumnChange(e){
//console.log(e);
if(e.detail.column==1){
this.setData({
[`pickerValue[1]`]:e.detail.value,
[`pickerData[2]`]:this.pickerData[2][e.detail.value],
})
}
},
bindMultiPickerChange(e){
console.log(e);
this.setData({
pickerValue:e.detail.value,
timeStr:util.unixtoTime(this.getTimeStr(e.detail.value),this.data.tpl.timeStr)
})
this.checkHasSubmit()
},
checkHasSubmit(){
let form=this.data.form;
let flag=false;
console.log(
form.name
, (this.data.pickerValue[0]>-1 || form.time>0)
, form.room
, form.addr
, form.latitude>0
, (!this.tpl.hasImage || (this.tpl.hasImage && form.image))
)
if(
form.name
&& (this.data.pickerValue[0]>-1 || form.time>0)
&& form.room
&& form.addr
&& form.latitude>0
&& (!this.tpl.hasImage || (this.tpl.hasImage && form.image))//带图模板
){
flag=true;
}
this.setData({
hasSubmit:flag
})
return flag;
},
input(e){
let key=util.attr(e,'key');
if(key=='addr' && !(this.data.form.latitude>0)){
return this.onChangeAddress()
}
let val=util.val(e).trim();
let form=this.data.form;
form[key]=val;
this.setData({
form:form,
})
this.checkHasSubmit()
},
getTimeStr(pickerValue=''){
if(pickerValue.length<1){
pickerValue=this.data.pickerValue;
}
if(pickerValue[0]>-1){
let d=new Date();
let y=d.getFullYear();
let md=this.data.pickerData[0][pickerValue[0]].substr(0,5);
let t=this.data.pickerData[2][pickerValue[2]];
console.log(y+'-'+md+' '+t+':00')
return util.timetouUnix(y+'-'+md+' '+t+':00');
}else{
return this.data.form.time;
}
},
submit(){
if(!this.checkHasSubmit()){
let msg='请完善邀请函信息';
if(this.data.form.latitude<1){
msg='请标注店铺位置'
}else if(!this.data.form.image){
msg='请上传或等待图片完成'
}
return util.toast(msg,'none')
}
let opt=this.data.options
let param={
openid:getApp().openid,
template_id:opt.tplid,
sid:this.data.form.sid,
sname:this.data.form.name,
seller_address:this.data.form.addr,
room_name:this.data.form.room,
arrival_time:this.getTimeStr(),
lat:this.data.form.latitude,
long:this.data.form.longitude,
}
if(opt.rid){
param.id=opt.rid
}
if(this.data.form.image){
param.image_url=this.data.form.image
}
App.Invitation.SetInvitationInfo(param).then(res=>{
wx.redirectTo({
url:util.http_build_query({
rid:res.data.id,
...this.data.options,
},'./review')
})
})
},
chooseImage(){
wx.chooseImage({
count:1,
sizeType:'compressed',
//sourceType:'album',
success:res=>{
const tempFilePaths = res.tempFilePaths[0]
this.setData({
defImage:tempFilePaths,
})
wx.uploadFile({
url:util.cgi('App.Examples_Upload.UploadQn'),
filePath:tempFilePaths,
name:'file',
success:upres=>{
try{
upres=JSON.parse(upres.data)
console.log('upres',upres)
if(upres.ret==200){
util.toast('图片上传完成','none')
this.setData({
[`form.image`]:upres.data,
})
this.checkHasSubmit()
}else{
util.toast(upres.msg||'上传出错','none')
}
}catch (e){
util.toast('上传出错','none')
}
}
})
},
})
},
onChangeAddress(){
wx.chooseLocation({
success: (res)=> {
console.log(res);
this.setData({
[`form.latitude`]:res.latitude,
[`form.longitude`]:res.longitude,
[`form.addr`]:res.name,
})
this.checkHasSubmit()
},
fail: function (err) {
console.log(err)
}
});
},
})
\ No newline at end of file
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"订座详情",
"usingComponents": {
"userinfo": "/components/userinfo/userinfo",
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
<!--pages/manager-invitation/editor.wxml-->
<nav>修改信息</nav>
<view class="pages">
<view class="base block">
<view class="item Medium">预订信息</view>
<view class="item flex-ll">
<input value="{{form.name}}" bindinput="input"
data-key="name"
placeholder="请输入店铺名称" placeholder-class="placeholder-class"/>
<formids url="./setting/sellers?hasQuick=1" class="quick">快速选择</formids>
</view>
<view class="item flex-ll">
<picker
mode="multiSelector"
bindchange="bindMultiPickerChange"
bindcolumnchange="bindMultiPickerColumnChange"
value="{{pickerValue}}"
range="{{pickerData}}"
style="width: 100%"
>
<view class="picker" style="width: 100%;">
<!--
<block wx:if="{{pickerValue[0]>-1}}">
{{pickerData[0][pickerValue[0]]}} {{pickerData[1][pickerValue[1]]}} {{pickerData[2][pickerValue[2]]}}
</block>
-->
<text wx:if="{{timeStr}}">{{timeStr}}</text>
<text class="placeholder-class" wx:else="">请输入预订时间</text>
</view>
</picker>
</view>
<view class="item flex-ll">
<input value="{{form.room}}" bindinput="input"
data-key="room"
placeholder="请输入包间名称" placeholder-class="placeholder-class"/>
</view>
<view class="item flex-ll">
<input value="{{form.addr}}"
bindinput="input" bindfocus="input"
data-key="addr"
placeholder="请输入店铺地址" placeholder-class="placeholder-class"/>
<view class="caddr flex-rr" bindtap="onChangeAddress">
<image src="http://qn.colorcun.com/manager-invitation/wx/caddr.png" style="width: 28rpx; height: 36rpx;"></image>
</view>
</view>
</view>
<view class="upload block flex-vc" wx:if="{{tpl.hasImage}}">
<view class="image" bindtap="chooseImage">
<image src="{{form.image||defImage}}" mode="aspectFill"></image>
</view>
<view class="text">(此处照片为邀请函展示照片)</view>
</view>
<formids bindclick="submit" style="width: 100%;">
<view class="submit {{hasSubmit?'submit-active':''}}">确定</view>
</formids>
</view>
\ No newline at end of file
... ...
/* pages/manager-invitation/editor.wxss */
page{
background-color: #F5F5F5;
}
.pages{
background-color: #F5F5F5;
font-size: 34rpx;
padding-top: 20rpx;
padding-bottom: 160rpx;
}
.block{
width: 94%;
margin: 0 auto;
border-radius: 8rpx;
background-color: #FEFEFE;
}
.base .item{
height: 140rpx;
line-height: 140rpx;
width: 94%;
margin: 0 auto;
border-bottom: 2rpx solid #F1F0F4;
}
.item input{
width: 100%;
}
.base .item:last-child{
border-width: 0;
}
.upload{
margin-top: 20rpx;
height: 310rpx;
}
.image{
width: 220rpx;
height: 220rpx;
border: 2rpx #E0E0E0 dashed;
margin-top: 20rpx;
}
.image image{
width: 100%;
height: 100%;
}
.text{
margin-top: 20rpx;
font-size: 28rpx;
color: #999999;
}
.submit{
position: fixed;
bottom: 30rpx;
left: 0;
right:0;
margin: 0 auto;
height: 84rpx;
line-height: 84rpx;
width: 90%;
background-color: #74BBBE;
border-radius: 10rpx;
color: #FEFEFE;
}
.submit-active{
background-color: #199095;
}
.quick{
height: 50rpx;
line-height: 50rpx;
width: 140rpx;
background-color: #46A5A9;
font-size: 28rpx;
color: #FEFEFE;
text-align: center;
min-width: 140rpx;
}
.placeholder-class{
color: #999999;
}
.caddr{
width: 140rpx;
min-width: 140rpx;
height: 140rpx;
line-height: 140rpx;
}
... ...
// pages/manager-invitation/index.js
import util from '../../utils/util';
import App from '../../utils/api';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
dots: [],
hasGo:false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let dots=[];
for(let i=0;i<15;i++){
let zf=Math.random()*10>5?1:-1;
let dot={
bottom:Math.random()*300*zf,
zoom:Math.random(),
}
dot.left=Math.random()*1000;
dots.push(dot)
}
this.setData({
dots:dots,
})
this.UserIdentity();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
userinfo(){
if(!this.data.hasGo){
return util.toast('数据初始化,请等候','none');
}
let us=util.cache('userInfo');
App.Invitation.AddInvitationUser({
openid:getApp().openid,
avatar:us.avatarUrl,
nickname:us.nickName,
gender:us.gender,
}).then(res=>{
wx.redirectTo({
url:'./review'
});
})
},
UserIdentity(){
let openid=getApp().openid;
if(!openid){
return setTimeout(()=>{
this.UserIdentity();
},300)
}
App.Invitation.UserIdentity({
openid:openid,
}).then(res=>{
this.setData({
hasGo:true,
})
if(res.ret==200){
if(res.data.identity==1){
// wx.reLaunch({
// url:'/pages/customer/index'
// })
// return;
}
if(res.data.identity==2){
wx.redirectTo({
url:'/pages/manager-invitation/review'
})
}
}else{
util.toast(res.msg)
}
})
},
})
\ No newline at end of file
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "white",
"navigationBarTitleText":"订座详情",
"usingComponents": {
"userinfo": "/components/userinfo/userinfo",
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
<!--pages/manager-invitation/index.wxml-->
<view class="pages flex-vc">
<view class="title">欢迎使用一键订</view>
<view class="steps flex-cc">
<view class="icon home"></view>
<view class="dot" wx:for="{{[4,5,6,7,8,9,10]}}" wx:key="key" style="opacity:{{item/10}};" ></view>
<view class="icon user"></view>
</view>
<view class="info">一键订,客户经理专用的拓客工具</view>
<view class="dot-max" wx:for="{{dots}}" style="bottom: {{item.bottom}}rpx;left: {{item.left}}rpx;zoom: {{item.zoom}};" wx:key="key"></view>
<userinfo binduserinfo="userinfo" style="width: 100%;">
<view class="userinfo">立即使用</view>
</userinfo>
</view>
... ...
/* pages/manager-invitation/index.wxss */
page{
background: linear-gradient(to bottom, #199095, #4BCACF);
}
.pages{
margin-top: 208rpx;
color:#FFFFFF;
}
.title{
font-size: 44rpx;
height: 60rpx;
line-height: 60rpx;
font-weight: bold;
letter-spacing:6rpx;
}
.steps {
height: 54rpx;
margin-top: 200rpx;
line-height: 54rpx;
}
.steps .icon{
width: 56rpx;
height: 56rpx;
background-size: 100%;
}
.steps .icon.home{
margin-right: 40rpx;
background-image: url("http://qn.colorcun.com/manager-invitation/%E5%95%86%E5%AE%B6.png");
}
.steps .icon.user{
margin-left: 20rpx;
background-image: url("http://qn.colorcun.com/manager-invitation/%E9%A1%BE%E5%AE%A2.png");
}
.steps .dot{
width: 12rpx;
height: 12rpx;
border-radius: 50%;
background-color: #ffffff;
margin-right: 24rpx;
}
.dot-max{
width: 200rpx;
height: 200rpx;
border-radius: 50%;
background-color: #ffffff;
opacity:0.1;
position: fixed;
animation-name: butAnimation;
animation-duration: 15s;
animation-iteration-count:9999;
}
.info{
margin-top: 42rpx;
height: 40rpx;
line-height: 40rpx;
font-size: 28rpx;
}
.userinfo{
color:#000000;
font-size: 34rpx;
height: 84rpx;
line-height: 84rpx;
border-radius: 42rpx;
background-color: #fefefe;
box-shadow: 0 4rpx 8rpx 0 #2B9397;
width:80%;
margin: 346rpx auto 0;
}
@keyframes butAnimation
{
30%{
transform: translate(-1.5rem);
}
50% {
transform: scale(1.2,1.2);
}
75%{
transform: translate(1.5rem,-1.5rem);
}
}
@-webkit-keyframes butAnimation
{
30%{
transform: translate(-1.5rem);
}
50% {
transform: scale(1.2,1.2);
}
75%{
transform: translate(1.5rem,-1.5rem);
}
}
\ No newline at end of file
... ...
// pages/manager-invitation/review.js
import util from '../../utils/util';
import App from '../../utils/api';
import TP from '../../utils/tpls';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
height: 667,
current: 0,
tpls: TP.tpls(),
seller:{
name:'一键订示例餐厅',
room:'天香阁',
date:util.unixtoTime(new Date()/1000,'YYYY/MM/DD 星期WW HH:II'),
addr:'粤江西路啤酒文化创意艺术区B09'
},
options:{},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let param={
options:options,
}
if(options.rid){
param.tpls=[TP.tpls(options.tplid)]
}
this.setData(param)
this.initData(options);
},
initData(options){
if(options.rid){
App.Invitation.Detail({id:options.rid}).then(res=>{
this.setData({
seller:{
name:res.data.seller_name,
room:res.data.room_name,
date:util.unixtoTime(res.data.arrival_time,this.data.tpls[this.data.current].timeStr),
addr:res.data.seller_address,
image:res.data.image_url,
}
})
})
}else{
App.Invitation.GetSellerList({
openid:getApp().openid
}).then(res=>{
if(res.data.length>0){
let defi=0;
for(let i=0;i<res.data.length;i++){
if(res.data[i].is_default==1){
defi=i;
break;
}
}
let sel=res.data[defi];
this.setData({
seller:{
name:sel.name,
room:'',
date:util.unixtoTime(new Date()/1000,this.data.tpls[this.data.current].timeStr),
addr:sel.address
}
})
}
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
//导航栏自适应
let systemInfo = wx.getSystemInfoSync();
let reg = /ios/i;
let pt = 20;//导航状态栏上内边距
let h = 44;//导航状态栏高度
if (reg.test(systemInfo.system)) {
pt = systemInfo.statusBarHeight;
h = 44;
} else {
pt = systemInfo.statusBarHeight;
h = 48;
}
this.setData({
statusBarHeight: pt,
titleBarHeight: h,
height: systemInfo.windowHeight
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
let path=util.http_build_query({
...this.data.options,
fromid:getApp().openid,
hasSellerShare:1,
},'/pages/manager-invitation/display')
if(!this.data.options.rid){
return {
title: '一键订,客户经理专用的拓客工具',
path: '/pages/manager-invitation/index',
imageUrl:this.data.tpls[this.data.current].shareFirstImage,
}
}
return {
title: '点击查看详情,发邀请函',
path: path,
imageUrl:this.data.tpls[this.data.current].shareFirstImage,
}
},
swiperChange(e){
let current=e.detail.current
this.setData({
current:current,
[`seller.date`]:util.unixtoTime(new Date()/1000,this.data.tpls[current].timeStr)
})
},
switchTabs(e){
let current=util.attr(e,'current')
this.setData({
current:current,
[`seller.date`]:util.unixtoTime(new Date()/1000,this.data.tpls[current].timeStr)
})
},
goEditor(){
let param={
...this.data.options,
tplid:this.data.tpls[this.data.current].id,
}
wx.navigateTo({
url:util.http_build_query(param,'./editor')
})
},
})
\ No newline at end of file
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "white",
"navigationBarTitleText":"订座详情",
"usingComponents": {
"userinfo": "/components/userinfo/userinfo",
"nav":"/components/nav/nav",
"formids":"/components/formids/formids",
"userinfo-share": "/components/userinfo/share",
"tabBar":"/components/manager-invitation/tabBar/tabBar"
}
}
\ No newline at end of file
... ...
<!--pages/manager-invitation/review.wxml-->
<swiper
indicator-dots="{{false}}"
autoplay="{{false}}"
duration="{{500}}"
bindchange="swiperChange"
current="{{current}}"
style="height:{{height}}px;"
>
<block wx:for="{{tpls}}" wx:key="tpls.key">
<swiper-item>
<view class="pages bg-{{item.id}} flex-vc" style="height:{{height}}px;width:100%;">
<template is="tpl-{{item.id}}" data="{{...seller,options}}"></template>
</view>
</swiper-item>
</block>
</swiper>
<view wx:if="{{!options.rid}}"
class="flex-vc"
style="position:fixed;top:{{statusBarHeight}}px;left:0;height: {{titleBarHeight}}px; line-height: {{titleBarHeight}}px;">
<view class="tabs flex-ll">
<block wx:for="{{tpls}}" wx:key="tpls.key">
<view class="item {{index==current?'active':''}}" bindtap="switchTabs" data-current="{{index}}">{{item.name}}</view>
</block>
</view>
</view>
<nav wx:else="" backgroundColor="rgba(0,0,0,0)" style="position: fixed;"></nav>
<!--//商务-->
<template name="tpl-1">
<view class="flex-vc shangwu" bindtap="{{options.rid?'goEditor':''}}">
<view class="invit-logo">
<image src="http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92.png"></image>
<view class="quick-editor" wx:if="{{options.rid}}">修改内容</view>
</view>
<view class="shangwu-line"></view>
<view class="seller flex-vc">
<view class="title flex-cc">
<view class="title-left"></view>
餐厅
<view class="title-right"></view>
</view>
<view class="content name">{{name}}</view>
<view class="title flex-cc">
<view class="title-left"></view>
包间
<view class="title-right"></view>
</view>
<view class="content">{{room}}</view>
<view class="title flex-cc">
<view class="title-left"></view>
时间
<view class="title-right"></view>
</view>
<view class="content">{{date}}</view>
<view class="title flex-cc">
<view class="title-left"></view>
地址
<view class="title-right"></view>
</view>
<view class="content flex-cc addr">
<image src="http://qn.colorcun.com/manager-invitation/wx/address.png" class="invit-addr"></image>
{{addr}}
</view>
</view>
<userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess" wx:if="{{options.rid}}" catchtap="catchtap">
<view class="buts-share animation"></view>
</userinfo-share>
<view class="editor" bindtap="goEditor" wx:else=""></view>
</view>
</template>
<!--//温馨-->
<template name="tpl-2">
<view class="wenxin-top"></view>
<view class="wenxin-bottom"></view>
<view class="flex-vc wenxin" bindtap="{{options.rid?'goEditor':''}}">
<view class="invit-logo">
<image src="http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92-%E6%B8%A9%E9%A6%A8.png"></image>
<view class="quick-editor" wx:if="{{options.rid}}">修改内容</view>
</view>
<view class="wenxin-mask">
<view class="wenxin-mask-bg" style="background-image: url({{image||'http://qn.colorcun.com/manager-invitation/wx/hunshazhao3.jpg'}})"></view>
<view class="wenxin-mask-img"></view>
</view>
<view class="wenxin-baitou"></view>
<view class="wenxin-line"></view>
<view class="seller flex-vc">
<view class="content">{{date}}</view>
<view class="content">{{name}}{{room}}</view>
<view class="content flex-cc addr">
<image src="http://qn.colorcun.com/manager-invitation/wx/address.png" class="invit-addr"></image>
{{addr}}
</view>
</view>
<userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess" wx:if="{{options.rid}}" catchtap="catchtap">
<view class="buts-share animation"></view>
</userinfo-share>
<view class="editor" bindtap="goEditor" wx:else=""></view>
</view>
</template>
<tabBar></tabBar>
... ...
/* pages/manager-invitation/review.wxss */
@import "tpls.wxss";
.pages{
font-size: 200rpx;
background-size: 100%;
font-size: 34rpx;
}
.tabs{
}
.tabs .item{
font-size: 32rpx;
color:#999999;
margin-left: 20rpx;
padding: 0 10rpx;
height: 66rpx;
line-height: 66rpx;
}
.tabs .item.active{
font-size: 36rpx;
font-weight: bold;
color: #E9D9B7;
border-bottom: 2rpx solid #E9D9B7;
}
image{
width: 100%;
height: 100%;
}
\ No newline at end of file
... ...
// pages/manager-invitation/setting/history.js
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
Page({
offset: 0,
limit: 10,
hasMore: true,
/**
* 页面的初始数据
*/
data: {
list:{},
hasMore:true,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getLists();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if(this.hasMore){
this.getLists(true);
}
},
getLists(hasReachBottom=false){
App.Invitation.InvitationList({
openid:getApp().openid,
offset: this.offset,
limit: this.limit,
}).then(res => {
let list = this.data.list;
let dl=res.data.length;
if (dl > 0) {
res.data.forEach(r => {
let ctime=util.unixtoTime(r.ctime,'YYYY/MM/DD')
r.arrival_timeStr = util.unixtoTime(r.arrival_time, 'HH:II')
list[ctime]=list[ctime]||{'date':ctime,data:[]};
list[ctime].data.push(r)
})
}
let obj={list:list};
if(dl<this.limit && hasReachBottom){
this.hasMore=false;
obj.hasMore=false;
}else{
this.offset+=this.limit;
}
this.setData(obj)
})
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
<!--pages/manager-invitation/setting/history.wxml-->
<nav>通知客户记录</nav>
<view class="table-header flex-lr">
<view class="Medium td1 flex-vc" style="align-items: flex-start">客户</view>
<view class="Medium td2 flex-vc" style="align-items: flex-start">桌号</view>
<view class="Medium td3">时间</view>
<view class="Medium td4">操作</view>
</view>
<view class="pages">
<view class="table-body">
<view class="table-block" wx:for="{{list}}" wx:key="list.key">
<view class="date">{{item.date}}</view>
<block wx:for="{{item.data}}" wx:key="item.data.key">
<formids url="/pages/manager-invitation/review?rid={{item.id}}&tplid={{item.template_id}}">
<view class="table-tr flex-lr">
<view class="Medium td1">
<block wx:if="{{item.nickname}}">
{{item.nickname}}
</block>
<block wx:elif="{{item.in_openid}}">
客户已查看
</block>
<block wx:else="">
<text style="color:#F05522;">客户未查看</text>
</block>
</view>
<view class="Medium td2">{{item.room_name}}</view>
<view class="Medium td3">{{item.arrival_timeStr}}</view>
<view class="Medium td4">详情</view>
</view>
</formids>
</block>
</view>
<view wx:if="{{!hasMore}}" class="hasMore flex-vc">已经到底了</view>
</view>
</view>
\ No newline at end of file
... ...
/* pages/manager-invitation/setting/history.wxss */
page{
background-color: #f5f5f5;
}
.table-header{
width: 100%;
position: fixed;
left: 0;
right: 0;
background-color: #ffffff;
height: 120rpx;
line-height: 120rpx;
z-index: 10;
font-size: 34rpx;
}
.pages{
margin-top: 120rpx;
background-color: #F5F5F5;
}
.td1{
margin-left: 40rpx;
}
.td4{
margin-right: 40rpx;
min-width: 68rpx;
}
.td1,.td2{
width: 170rpx;
min-width: 170rpx;
text-align: left;
padding-right: 38rpx;
}
.td3{
width: 100%;
text-align: left;
}
.td1,.td2{
max-height: 80rpx;
overflow: hidden;
}
.date{
background-color: #F5F5F5;
height: 60rpx;
line-height: 60rpx;
font-size: 26rpx;
width: 100%;
text-indent: 40rpx;
}
.table-tr{
background-color: #ffffff;
font-size: 30rpx;
height: 160rpx;
width: 100%;
}
.hasMore{
height: 100rpx;
line-height: 100rpx;
font-size: 30rpx;
color: #aaaaaa;
}
.table-body .td4{
color:#199095;
}
... ...
// pages/book/setting/index.js
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"formids":"/components/formids/formids",
"tabBar":"/components/manager-invitation/tabBar/tabBar"
}
}
\ No newline at end of file
... ...
<!--pages/book/setting/index.wxml-->
<nav id="nav" backgroundColor="#199095" color="#fefefe">我的</nav>
<view class="header">
<view class="info flex-ll">
<view class="avatar">
<open-data type="userAvatarUrl"></open-data>
</view>
<view class="nick"><open-data type="userNickName"></open-data></view>
</view>
</view>
<view class="page">
<formids url="/pages/manager-invitation/setting/sellers">
<view class="row flex-lr">
<view>我工作的店铺</view>
<view class="flex-rr">
<view class="more"></view>
</view>
</view>
</formids>
<formids url="/pages/manager-invitation/setting/history">
<view class="row flex-lr" style="padding-top: 34rpx;">
<view>通知客户记录</view>
<view class="flex-rr">
<view class="more"></view>
</view>
</view>
</formids>
<formids url="/pages/manager-invitation/crm/index">
<view class="row flex-lr" style="padding-top: 34rpx;">
<view>我的客户</view>
<view class="flex-rr">
<view class="more"></view>
</view>
</view>
</formids>
<formids url="/pages/customer/index?islove=customer">
<view class="row flex-lr" style="padding-top: 34rpx;">
<view>切换到顾客模式</view>
<view class="flex-rr">
<view class="more"></view>
</view>
</view>
</formids>
</view>
<tabBar></tabBar>
... ...
/* pages/book/setting/index.wxss */
/*
http://qn.colorcun.com/custom/lite-yd/image/icon-zk.png
http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png
*/
.header{
background-color: #199095;
margin-top: -2rpx;
}
.header .info{
color:#FEFEFE;
width: 90%;
padding-top: 60rpx;
margin: 0 auto;
padding-bottom: 60rpx;
}
.header .info .nick{
font-size: 40rpx;
height: 80rpx;
line-height: 80rpx;
}
.avatar{
width: 80rpx;
height: 80rpx;
border-radius: 50%;
overflow: hidden;
margin-right: 20rpx;
}
.page{
width: 90%;
margin: 0 auto;
color: #353535;
padding-top: 34rpx;
}
.row{
font-size: 34rpx;
height: 106rpx;
border-bottom: 2rpx solid #F1F0F4;
}
.row .right{
font-size: 30rpx;
color:#999999;
}
.row .more{
margin-left: 20rpx;
}
\ No newline at end of file
... ...
// pages/manager-invitation/editor.js
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
hasSubmit:false,
form:{
id:'',
name:'',
address:'',
lat:'',
long:'',
is_default:'',
},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if(options.seller){
this.setData({
form:JSON.parse(options.seller),
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
checkHasSubmit(){
let form=this.data.form;
let flag=false;
if(
form.name
&& form.address
&& form.lat>0
){
flag=true;
}
this.setData({
hasSubmit:flag
})
return flag;
},
input(e){
console.log(e);
let key=util.attr(e,'key');
if(key=='address' && !(this.data.form.lat>0)){
return this.onChangeAddress()
}
let val=util.val(e);
if(typeof val=='String'){
val=val.trim();
}
let form=this.data.form;
form[key]=val;
this.setData({
form:form,
})
this.checkHasSubmit()
},
submit(){
if(!this.checkHasSubmit()){
let msg='请完善信息';
if(this.data.form.lat<1){
msg='请标注店铺位置'
}
return util.toast(msg,'none')
}
let param={
openid:getApp().openid,
sid:this.data.form.id,
sname:this.data.form.name,
address:this.data.form.address,
lat:this.data.form.lat,
long:this.data.form.long,
is_default:(this.data.form.is_default==true || this.data.form.is_default==1)?1:0,
}
App.Invitation.SetSellerInfo(param).then(res=>{
wx.navigateBack();
})
},
onChangeAddress(){
wx.chooseLocation({
success: (res)=> {
console.log(res);
this.setData({
[`form.lat`]:res.latitude,
[`form.long`]:res.longitude,
[`form.address`]:res.name,
})
this.checkHasSubmit()
},
fail: function (err) {
console.log(err)
}
});
},
})
\ No newline at end of file
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"订座详情",
"usingComponents": {
"userinfo": "/components/userinfo/userinfo",
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
<!--pages/manager-invitation/editor.wxml-->
<nav>工作的店铺</nav>
<view class="pages">
<view class="base block">
<view class="item Medium">店铺信息</view>
<view class="item flex-ll">
<input value="{{form.name}}" bindinput="input"
data-key="name"
placeholder="请输入店铺名称" placeholder-class="placeholder-class"/>
</view>
<view class="item flex-ll">
<input value="{{form.address}}"
bindinput="input" bindfocus="input"
data-key="address"
placeholder="请输入店铺地址" placeholder-class="placeholder-class"/>
<view class="caddr flex-rr" bindtap="onChangeAddress">
<image src="http://qn.colorcun.com/manager-invitation/wx/caddr.png" style="width: 28rpx; height: 36rpx;"></image>
</view>
</view>
<view class="item flex-lr">
设置为默认地址
<switch checked="{{form.is_default==1}}" bindchange="input" data-key="is_default" />
</view>
</view>
<formids bindclick="submit" style="width: 100%;">
<view class="submit {{hasSubmit?'submit-active':''}}">确定</view>
</formids>
</view>
\ No newline at end of file
... ...
/* pages/manager-invitation/editor.wxss */
page{
background-color: #F5F5F5;
}
.pages{
background-color: #F5F5F5;
font-size: 34rpx;
padding-top: 20rpx;
padding-bottom: 160rpx;
}
.block{
width: 94%;
margin: 0 auto;
border-radius: 8rpx;
background-color: #FEFEFE;
}
.base .item{
height: 140rpx;
line-height: 140rpx;
width: 94%;
margin: 0 auto;
border-bottom: 2rpx solid #F1F0F4;
}
.item input{
width: 100%;
}
.base .item:last-child{
border-width: 0;
}
.upload{
margin-top: 20rpx;
height: 310rpx;
}
.image{
width: 220rpx;
height: 220rpx;
border: 2rpx #E0E0E0 dashed;
margin-top: 20rpx;
}
.image image{
width: 100%;
height: 100%;
}
.text{
margin-top: 20rpx;
font-size: 28rpx;
color: #999999;
}
.submit{
position: fixed;
bottom: 30rpx;
left: 0;
right:0;
margin: 0 auto;
height: 84rpx;
line-height: 84rpx;
width: 90%;
background-color: #74BBBE;
border-radius: 10rpx;
color: #FEFEFE;
}
.submit-active{
background-color: #199095;
}
.quick{
height: 50rpx;
line-height: 50rpx;
width: 140rpx;
background-color: #46A5A9;
font-size: 28rpx;
color: #FEFEFE;
text-align: center;
min-width: 140rpx;
}
.placeholder-class{
color: #999999;
}
.caddr{
width: 140rpx;
min-width: 140rpx;
height: 140rpx;
line-height: 140rpx;
}
... ...
// pages/manager-invitation/setting/sellers.js
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
import PubSub from '../../../utils/PubSub'
Page({
/**
* 页面的初始数据
*/
data: {
sellers:[],
},
/**
* 生命周期函数--监听页面加载
*/
options:{},
onLoad: function (options) {
this.options=options
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
App.Invitation.GetSellerList({openid:getApp().openid}).then(res=>{
this.setData({
sellers:res.data,
})
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
sellerEditor(e){
let i=util.attr(e,'index');
let sel=this.data.sellers[i];
if(this.options.hasQuick){
PubSub.emit(
'quick',
sel
)
wx.navigateBack();
}else{
wx.navigateTo({
url:'/pages/manager-invitation/setting/seller-editor?seller='+JSON.stringify(sel)
})
}
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
<!--pages/manager-invitation/setting/sellers.wxml-->
<nav>我工作的店铺</nav>
<view style="background-color: #F5F5F5;height: 2rpx;width: 100%;"></view>
<view class="pages" wx:if="{{sellers.length>0}}">
<block wx:for="{{sellers}}" wx:key="sellers.key">
<formids bindclick="sellerEditor" data-index="{{index}}">
<view class="seller {{item.is_default==1?'active':''}}">
<view class="name">{{item.name}}</view>
<view class="addr">{{item.address}}</view>
<view class="default" wx:if="{{item.is_default==1}}">默认</view>
</view>
</formids>
</block>
</view>
<view class="pages flex-vc" wx:else="">
<image src="http://qn.colorcun.com/custom/lite-online/image/follow-empty.png" class="empty-image"></image>
<view class="empty-text">您还没有添加工作店铺</view>
<formids url="./seller-editor" style="width: 110%">
<view class="create-but">立即添加</view>
</formids>
</view>
<formids url="./seller-editor" wx:if="{{sellers.length>0}}">
<view class="create">
<view class="create-but">立即添加</view>
</view>
</formids>
\ No newline at end of file
... ...
/* pages/manager-invitation/setting/sellers.wxss */
.pages{
width: 90%;
margin: 0 auto;
padding-top: 40rpx;
padding-bottom: 150rpx;
}
.seller{
margin-bottom: 40rpx;
border: 2rpx solid #999999;
border-radius: 10rpx;
width: 100%;
height: 200rpx;
color:#353535;
position: relative;
}
.name{
font-size: 34rpx;
width: 90%;
margin: 30rpx auto 0;
height: 48rpx;
line-height: 48rpx;
text-align: left;
}
.addr{
font-size: 30rpx;
width: 90%;
margin: 8rpx auto 0;
line-height: 40rpx;
text-align: left;
}
.seller.active{
background-color: #199095;
border: 2rpx solid #199095;
color:#FEFEFE;
}
.default{
background-color: #F05522;
color:#fefefe;
font-size: 28rpx;
height: 40rpx;
width: 90rpx;
position: absolute;
top: -2rpx;
right: -2rpx;
border-radius: 26rpx 10rpx 0 26rpx;
text-align: center;
line-height: 40rpx;
}
.create{
position: fixed;
bottom: 0rpx;
height: 150rpx;
line-height: 150rpx;
background-color: #ffffff;
width: 100%;
font-size: 34rpx;
}
.create-but{
height: 84rpx;
line-height: 84rpx;
border-radius: 10rpx;
background-color: #199095;
color: #fefefe;
width: 90%;
margin: 40rpx auto;
font-size: 34rpx;
text-align: center;
}
.empty-image{
margin-top: 200rpx;
width: 382rpx;
height: 316rpx;
}
.empty-text{
margin-top: 86rpx;
font-size: 28rpx;
margin-bottom: 220rpx;
}
\ No newline at end of file
... ...
.bg-1{
background-image: url("http://qn.colorcun.com/custom/lite-yd/image/invit-bg.png");
background-color: #353334;
color:#fefefe;
}
.bg-2{
background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E5%BA%95%E9%83%A8.png");
background-color: #F4AFB2;
}
.invit-logo{
width: 380rpx;
height: 200rpx;
position: relative;
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-size: 100% 100%;
width: 604rpx;
height: 30rpx;
margin-top: 60rpx;
}
.seller{
margin-top: 60rpx;
width: 100%;
}
.seller .title{
font-size: 28rpx;
color:#999999;
margin-bottom: 10rpx;
height: 40rpx;
line-height: 40rpx;
}
.seller .title-left,.seller .title-right{
width: 44rpx;
height: 4rpx;
background-size: 100%;
}
.seller .title-left{
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E8%8A%B1%E7%BA%B9-%E5%B7%A6%E8%BE%B9.png");
margin-right: 10rpx;
}
.seller .title-right{
margin-left: 10rpx;
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E8%8A%B1%E7%BA%B9-%E5%8F%B3.png");
}
.seller .content{
margin-bottom: 60rpx;
font-size: 36rpx;
line-height: 50rpx;
text-align: center;
align-items:flex-start;
width: 90%;
}
.seller .content:last-child{
margin-bottom: 0;
}
.seller .addr{
width: 80%;
}
.seller .invit-addr{
width: 22rpx;
height: 28rpx;
margin-right: 10rpx;
margin-top: 14rpx;
min-width: 22rpx;
}
.editor{
height:80rpx;
width: 504rpx;
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E4%BF%AE%E6%94%B9%E5%86%85%E5%AE%B92.png");
background-size: 100%;
}
.shangwu{
width: 100%;
}
.shangwu .seller{
margin-bottom: 54rpx;
}
.wenxin {
margin-top: 20rpx;
width: 100%;
}
.wenxin-top{
position: fixed;
top:0;
left:0;
width:100%;
height: 80rpx;
background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E9%A1%B6%E9%83%A8%E8%8A%B1%E8%BE%B9.png");
background-size: 100%;
}
.wenxin-bottom{
position: fixed;
bottom:0;
left:0;
width:100%;
height: 64rpx;
background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E8%8A%B1%E8%BE%B9-%E5%BA%95%E9%83%A8.png");
background-size: 100%;
}
.wenxin .invit-logo{
width: 350rpx;
height: 184rpx;
}
.wenxin-mask{
margin-top: 0rpx;
width: 528rpx;
height: 520rpx;
position: relative;
}
.wenxin-mask-bg{
margin: 46rpx auto;
width: 468rpx;
height: 468rpx;
border-radius: 50%;
overflow: hidden;
background-image: url("http://qn.colorcun.com/manager-invitation/wx/hunshazhao3.jpg");
background-size: cover;
}
.wenxin-mask-img{
position: absolute;
left: 0;
top:0;
background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E8%8A%B1%E7%8E%AF%E7%A9%BA.png");
width: 100%;
height: 520rpx;
background-size: 100%;
}
.wenxin-baitou{
margin-top: 10rpx;
width: 404rpx;
height: 42rpx;
background-size: 100%;
background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E6%B0%B8%E7%BB%93%E5%90%8C%E5%BF%83-%E7%99%BD%E5%A4%B4%E5%81%95%E8%80%81.png");
}
.wenxin-line{
margin-top: 16rpx;
width: 600rpx;
height: 30rpx;
background-size: 100%;
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E6%B8%A9%E9%A6%A8%E7%BA%BF%E6%9D%A1.png");
}
.wenxin .seller{
margin-top: 16rpx;
color:#fefefe;
}
.wenxin .seller .title{
display: none;
}
.wenxin .seller .content{
margin-bottom: 16rpx;
font-size: 36rpx;
line-height: 50rpx;
text-align: center;
align-items:flex-start;
}
.wenxin .seller .content.addr{
width: 90%;
}
.quick-editor{
background-color: #ECD9B7;
width: 120rpx;
height: 40rpx;
line-height: 40rpx;
color: #353535;
font-size: 24rpx;
position: absolute;
top:50rpx;
right:-150rpx;
text-align: center;
}
.buts-share{
width: 560rpx;
height: 86rpx;
margin: 0 auto;
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E9%80%9A%E7%9F%A5%E5%AE%A2%E6%88%B72.png");
background-size: 100%;
background-repeat: no-repeat;
background-position: center center;
position: relative;
}
.animation{
animation-name: butAnimation;
animation-duration: 0.7s;
animation-iteration-count:9999;
}
@keyframes butAnimation
{
50% {background-size:90%;}
}
@-webkit-keyframes butAnimation
{
50% {background-size:90%;}
}
\ No newline at end of file
... ...
... ... @@ -9,16 +9,21 @@ Page({
*/
data: {
hasSellerBook:false,
hasManagerInvitation:false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
App.Reserve.SellerForOpenid({openid:getApp().openid}).then(res=>{
if(res.data && res.data.seller_id) {
App.Invitation.UserIdentity({openid:getApp().openid}).then(res=>{
if(res.data.identity==1) {//商户
this.setData({
hasSellerBook: res.data,
})
}else if(res.data.identity==2){//客户经理
this.setData({
hasManagerInvitation: true,
})
}
})
},
... ...
... ... @@ -39,5 +39,13 @@
</view>
</view>
</formids>
<formids url="/pages/manager-invitation/review" 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>
</formids>
</view>
</view>
... ...
... ... @@ -31,7 +31,7 @@
"list": []
},
"miniprogram": {
"current": 25,
"current": 43,
"list": [
{
"id": 0,
... ... @@ -349,6 +349,55 @@
"pathName": "pages/me/follow",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/manager-invitation/index",
"pathName": "pages/manager-invitation/index",
"query": "id=154",
"scene": null
},
{
"id": 43,
"name": "pages/manager-invitation/review",
"pathName": "pages/manager-invitation/review",
"query": "",
"scene": null
},
{
"id": 44,
"name": "pages/manager-invitation/editor",
"pathName": "pages/manager-invitation/editor",
"query": "tplid=1&rid=",
"scene": null
},
{
"id": 45,
"name": "pages/manager-invitation/display",
"pathName": "pages/manager-invitation/display",
"query": "rid=46&tplid=1&fromid=oB-xJ5KJCIasaEdgMRckqoL1cwg8&hasSellerShare=",
"scene": null
},
{
"id": -1,
"name": "pages/manager-invitation/setting/index",
"pathName": "pages/manager-invitation/setting/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/manager-invitation/setting/sellers",
"pathName": "pages/manager-invitation/setting/sellers",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/manager-invitation/setting/history",
"pathName": "pages/manager-invitation/setting/history",
"query": "",
"scene": null
}
]
}
... ...
... ... @@ -21,7 +21,7 @@ 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){
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){
... ... @@ -69,6 +69,9 @@ function rpc(host='',act,data={},fouce=false,header={},silence=true,cachetime=0,
sid:enter_params.seller_id,
})
}
if(api.openid){
data[api.openid]=data[api.openid]||openid;
}
wx.request({
url: host+act,
method: 'POST',
... ... @@ -125,7 +128,7 @@ function __api(){
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].silence,api[key].cachetime,api[key].timeout,api[key]);
}
}
for(let xkey in uri_dc){
... ... @@ -143,7 +146,7 @@ function __api(){
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].silence,api[key].cachetime,api[key].timeout,api[key]);
}
}
}
... ...
... ... @@ -178,4 +178,61 @@ export default {
//顾客收藏的店铺列表
'App.Customer.GetCollectionSellerList':null,
/**
* 邀请函
*/
//根据订座的openid 获取当前用户身份
'App.Invitation.UserIdentity':{
openid:'openid',
},
//增加客户经理基本信息
'App.Invitation.AddInvitationUser':{
openid:'openid',
},
//获取商家列表
'App.Invitation.GetSellerList':{
//cachetime: -1,
openid:'openid',
},
//编辑、增加商家信息
'App.Invitation.SetSellerInfo':{
openid:'openid',
},
//修改、录入邀请函信息,同时生成对应的商家信息
'App.Invitation.SetInvitationInfo':{
silence: false,
openid:'openid',
},
//邀请函详情
'App.Invitation.Detail':null,
//客户经理、预定人、受邀人信息建立
'App.Invitation.SetInvitationRel':{
//cachetime: -1,
openid:'inviting',
},
//受邀人同意参加,修改关系状态
'App.Invitation.SetInvitationConfirm':{
openid:'openid',
},
//根据客户经理openid 获取当前用户所负责的顾客
'App.Invitation.Members':{
openid:'openid',
},
//根据客户经理openid 获取当前用户预定列表
'App.Invitation.InvitationList':{
openid:'openid',
},
//上传图片,只能上传单个图片文件
'App.Examples_Upload.UploadQn':null,
}
\ No newline at end of file
... ...
import util from './util';
let tpls=[
{
id: 1,
code: 1,
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',
},
{
id: 2,
code: 2,
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',
},
];
module.exports ={
tpls(id=''){
if(id){
for(let i=0;i<tpls.length;i++){
if(tpls[i].id==id){
return tpls[i]
}
}
}
return tpls;
},
pickerData(){
let now=new Date()/1000;
let date=[];
for(let i=0;i<30;i++){
let time=now+i*86400;
date.push(util.unixtoTime(time,'MM-DD 星期WW'))
}
let daily={
'午市':'12:00-15:00',
'晚市':'18:00-21:00',
};
let ti=['午市','晚市'];
let dts=[[],[]];
ti.forEach((tx,ii)=>{
let ts=daily[tx].split('-');
while (ts[0]<=ts[1]){
dts[ii].push(ts[0]);
let _dt=ts[0].split(':');
if(_dt[1]=='30'){
_dt[0]=parseInt(_dt[0])+1;
_dt[1]='00';
}else{
_dt[0]=parseInt(_dt[0])+0;
_dt[1]='30';
}
_dt[0]=_dt[0]<10?'0'+_dt[0]:_dt[0];
ts[0]=_dt.join(':');
}
})
return [date,ti,dts]
return {
date:date,
space:ti,
time:dts,
}
},
}
\ No newline at end of file
... ...