Commit 85365c54f2fc29920d50ffff254167bcdaa9e59a

Authored by liuxuqinfhp1220
2 parents 40ee51af 5eec5616

no message

... ... @@ -38,7 +38,7 @@ App({
console.log('this.openid',this.openid,mta);
},
onShow:async function(){
this._getOpenid();
//this._getOpenid();
if (wx.canIUse('getUpdateManager')) {
const updateManager = wx.getUpdateManager();
updateManager.onCheckForUpdate(function (res) {
... ... @@ -105,6 +105,7 @@ App({
return new Promise((success,fail)=>{
wx.login({
success: (login_res)=>{
console.log('wx.login',login_res)
success(login_res);
},
fail:(res)=>{
... ... @@ -126,6 +127,7 @@ App({
try{
let openid=res.data.data.openid;
wx.setStorage({key:'customer_openid',data:openid});
wx.setStorage({key:'customer_session_key',data:res.data.data.session_key});
success(openid);
}catch(e){
console.log(res);
... ... @@ -143,8 +145,9 @@ App({
try{
let login_res=await this._login();
let openid=await this._getLiteOpenidByCode(login_res.code)
return openid;
return openid
}catch(e){
console.log('_getOpenid.catch',e)
return this._getOpenid();
}
},
... ...
Component({
data: {
curYear: new Date().getFullYear(), // 年份
curMonth: new Date().getMonth() + 1,// 月份 1-12
day: new Date().getDate(), // 日期 1-31 若日期超过该月天数,月份自动增加
header_show: true, // 主标题是否显示
prev: true, // 上一个月按钮是否显示
next: true, // 下一个月按钮是否显示
},
})
\ No newline at end of file
... ...
{
"component": true,
"usingComponents": {
"calendar": "plugin://bmCalendar/calendar"
}
}
\ No newline at end of file
... ...
<calendar
cur-year="{{curYear}}"
cur-month="{{curMonth}}"
day="{{day}}"
header_show='{{header_show}}'
prev='{{prev}}'
next='{{next}}'
calendar-style="calendar-style"
weektitle-style="week-style"
datefont-style="datefont-style"
header-style="header-style"
active-colort="active-colort"/>
\ No newline at end of file
... ...
.calendar-style{
background: #FFFBF2;
}
.week-style{
color:#999;
font-size:28rpx;
font-weight:bold;
}
.datefont-style{
color:#353535;
font-size:30rpx;
font-weight:bold;
}
.header-style{
color:#353535;
font-size:30rpx;
font-weight:bold;
}
.active-colort{
}
\ No newline at end of file
... ...
// pages/customer/detail_owner.js
import util from '../../utils/util';
import App from '../../utils/api';
const {regeneratorRuntime} = global
import TP from '../../utils/tpls';
Page({
/**
* 页面的初始数据
*/
data: {
detail:null,
detail: null,
hasOnlineReserve: false,
},
id:null,
tpls:TP.tpls(),
id: null,
tpls: TP.tpls(),
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.id=options.id;
this.id = options.id;
},
/**
... ... @@ -31,81 +34,83 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
App.Reserve.Detail({
openid: getApp().openid,
rid: this.id
}).then(res => {
this.setData({
detail:this.formatDatail(res.data)
})
App.Reserve.Detail({
openid: getApp().openid,
rid: this.id
}).then(res => {
this.setData({
detail: this.formatDatail(res.data),
hasOnlineReserve:res.data.type==0,
})
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function (e) {
console.log('onShareAppMessage',arguments)
console.log('onShareAppMessage', arguments)
return this.shareSetting(e);
},
formatDatail(detail){
detail.rdateStr=util.unixtoTime(detail.ddate,'MM月DD日 WW HH:II');
detail.tableFirst=detail.tables[0].name;
if(detail.tables.length>1){
detail.tableSubInfo='等'+(detail.tables.length)+'个'
+(detail.tables[0].tid==2?'包间':'');
}
// if(!detail.cusman){
// detail.cusman='vking';
// detail.cusman_phone='15877556369';
// detail.cusman_account='wx:vking';
// }
let ns=new Date()/1000
detail.hasCancel=detail.status==4
detail.hasOvered=false
if(!detail.hasCancel){
detail.hasOvered=ns>detail.ddate || detail.status>=2
formatDatail(detail) {
detail.rdateStr = util.unixtoTime(detail.ddate, 'MM月DD日 WW HH:II');
detail.tableFirst = detail.tables[0].name;
if (detail.tables.length > 1) {
detail.tableSubInfo = '等' + (detail.tables.length) + '个'
+ (detail.tables[0].tid == 2 ? '包间' : '');
}
return detail;
},
showManager(){
this.selectComponent('#manager').show();
},
lookLocation:function(){
wx.openLocation({
latitude:Number(this.data.detail.seller.lat),
longitude:Number(this.data.detail.seller.long),
scale:17,
address:this.data.detail.seller.map_address,
success:function (res) {
console.log(res)
}
})
},
userinfo(e){
console.log('userinfo',e)
util.toast('授权成功,可以继续转发','none');
// wx.navigateTo({
// url:'invite?id='+this.id,
// });
},
shareSetting(e){
console.log('shareSetting',e.target.dataset);
let hasInvitation=e.target.dataset.act=='invitation';
// if(!detail.cusman){
// detail.cusman='vking';
// detail.cusman_phone='15877556369';
// detail.cusman_account='wx:vking';
// }
let ns = new Date() / 1000
detail.hasCancel = detail.status == 4
detail.hasOvered = false
if (!detail.hasCancel) {
detail.hasOvered = ns > detail.ddate || detail.status >= 2
}
detail.seller.seller_tel=detail.seller.seller_tel.split(',');
return detail;
},
showManager() {
this.selectComponent('#manager').show();
},
lookLocation: function () {
wx.openLocation({
latitude: Number(this.data.detail.seller.lat),
longitude: Number(this.data.detail.seller.long),
scale: 17,
address: this.data.detail.seller.map_address,
success: function (res) {
console.log(res)
}
})
},
userinfo(e) {
console.log('userinfo', e)
util.toast('授权成功,可以继续转发', 'none');
// wx.navigateTo({
// url:'invite?id='+this.id,
// });
},
shareSetting(e) {
console.log('shareSetting', e.target.dataset);
let hasInvitation = e.target.dataset.act == 'invitation';
if (this.topicVal && this.data.detail.openid == getApp().openid) {
App.Reserve.SetTopicFromShare({
rid: this.id,
... ... @@ -117,39 +122,68 @@ Page({
nickname = util.cache('userInfo').nickName;
} catch (e) {
}
let obj={
let obj = {
//title: (nickname || '') + '给你发了一个邀请,点击查看',
title: this.tpls[0].shareTitle,
path: '/pages/customer/index?id=' + this.id + '&fromid=' + getApp().openid + '&invite_name=' + nickname+'&hasInvitation=1&tplid=1',
path: '/pages/customer/index?id=' + this.id + '&fromid=' + getApp().openid + '&invite_name=' + nickname + '&hasInvitation=1&tplid=1',
imageUrl: this.tpls[0].shareImage,
}
if(hasInvitation){
if (hasInvitation) {
//obj.title=(nickname || '') + '给你发了一个邀请函,点击查看';
obj.path=obj.path+'&hasInvitation=1';
obj.path = obj.path + '&hasInvitation=1';
}
return obj;
},
cookbook(){
if(this.data.detail.order && this.data.detail.order.cookbooklist.length>0){
cookbook() {
if (this.data.detail.order && this.data.detail.order.cookbooklist.length > 0) {
wx.navigateTo({
url:util.http_build_query({rid:this.id,oid:this.data.detail.order.id,identity:1},'/pack-cookbook/pages/success')
url: util.http_build_query({
rid: this.id,
oid: this.data.detail.order.id,
identity: 1
}, '/pack-cookbook/pages/success')
});
}else{
} else {
App.Advance.CreateOrder({
rid:this.id,
openid:getApp().openid,
}).then(res=>{
if(res.ret!=200){
return util.toast(res.msg,'none')
rid: this.id,
openid: getApp().openid,
}).then(res => {
if (res.ret != 200) {
return util.toast(res.msg, 'none')
}
wx.navigateTo({
url:util.http_build_query({rid:this.id,oid:res.data.id,identity:1,sid:res.data.sellerid},'/pack-cookbook/pages/index')
url: util.http_build_query({
rid: this.id,
oid: res.data.id,
identity: 1,
sid: res.data.sellerid
}, '/pack-cookbook/pages/index')
});
})
}
},
wineGo(){
util.toast('本区域暂无配送人员','none');
wineGo() {
util.toast('本区域暂无配送人员', 'none');
},
callSeller(){
let seller_tel=this.data.detail.seller.seller_tel
if(seller_tel.length<1) return util.toast('商家电话错误','none')
if(seller_tel.length==1){//只有一个电话
let phone=seller_tel[0].replace(/[^\d]/,'')
wx.makePhoneCall({
phoneNumber:phone
})
}else{
this.selectComponent('#as').show();
}
},
callSellerPhone(e){
if(e.detail.value){
let phone=e.detail.value.replace(/[^\d]/,'')
wx.makePhoneCall({
phoneNumber:phone
})
}
},
})
\ No newline at end of file
... ...
... ... @@ -8,6 +8,7 @@
"manager": "/components/manager/manager",
"nav":"/components/nav/nav",
"card":"/components/seller-card/seller-card",
"formids":"/components/formids/formids"
"formids":"/components/formids/formids",
"as":"/components/actionSheet/index"
}
}
\ No newline at end of file
... ...
... ... @@ -59,7 +59,7 @@
</block>
<view style="height: 40rpx;"></view>
<card seller="{{detail.seller}}" detail="{{detail}}"></card>
<card seller="{{detail.seller}}" detail="{{detail}}" hasOnlineReserve="{{hasOnlineReserve}}"></card>
<view class="detail-info Medium" style="margin-top: 56rpx;">
<view class="flex-lr">
<view>预订人</view>
... ... @@ -94,14 +94,13 @@
<image src="http://qn.colorcun.com/custom/lite-yd/image/click.png" class="more"></image>
</view>
</formids>
<view class="detail-info Medium">
<view class="flex-lr">
<view>退订政策</view>
</view>
<view class="flex-lr" style="margin-top: 43rpx;">
<view>免费退订,已提前点菜,交押金,无法退订</view>
<view class="detail-info Medium tuiding">
<view class="flex-rr">
<view class="item" bindtap="callSeller">联系商家</view>
<view class="item" bindtap="callSeller">取消预订</view>
</view>
</view>
<view style="height: 50rpx;"></view>
</view>
<manager manager="{{detail}}" id="manager"></manager>
\ No newline at end of file
<manager manager="{{detail}}" id="manager"></manager>
<as id="as" items="{{detail.seller.seller_tel}}" bindclick="callSellerPhone">拨打电话</as>
\ No newline at end of file
... ...
... ... @@ -125,4 +125,11 @@
width: 44rpx;
height: 30rpx;
margin-left: 10rpx;
}
.tuiding{
font-size: 30rpx;
}
.tuiding .item{
margin-left: 40rpx;
text-decoration: underline;
}
\ No newline at end of file
... ...
... ... @@ -253,4 +253,16 @@ Page({
activeTab:util.attr(e,'act'),
})
},
reserve:{},
selectpeople(e){
console.log(e);
this.reserve.pnum=e.detail.people;
if(e.detail.action=='click'){
this.reserve.sid=this.options.id
this.reserve.ddate=util.timetouUnix(this.reserve.date+' '+this.reserve.time+':00')
wx.navigateTo({
url:util.http_build_query(this.reserve,'./submit')
})
}
},
})
\ No newline at end of file
... ...
... ... @@ -12,7 +12,7 @@
"getpos":"/components/userinfo/getpos",
"discount":"/components/reserve/discount",
"share":"/components/reserve/share/share",
"people":"/components/reserve/people/people",
"dur":"/components/reserve/dur/dur"
"people":"/components/reserve/people/people",
"dur":"/components/reserve/dur/dur"
}
}
\ No newline at end of file
... ...
... ... @@ -196,6 +196,6 @@
</block>
<block wx:if="{{activeTab=='reserve'}}">
<view class="olreserve">
<people seller="{{seller}}" bindselectpeople="selectpeople"></people>
</view>
</block>
\ No newline at end of file
... ...
... ... @@ -464,10 +464,15 @@
"scene": null
},
{
<<<<<<< HEAD
"id": 56,
"name": "测试组件",
"pathName": "pages/reserve/detail",
"query": "id=154",
"id": -1,
"name": "pages/customer/detail_owner",
"pathName": "pages/customer/detail_owner",
"query": "id=18599",
"scene": null
}
]
... ...