Commit b20afeee0fc5b96657c5fb9e0451ef72af6c59e0

Authored by yiren
1 parent 3b36561a

提前点餐

... ... @@ -13,6 +13,7 @@ Page({
oid:'',
sid:'',
types:'1',//1是邀请函过来的
rid:'',
},
use:{},
detail:{},
... ... @@ -33,7 +34,8 @@ Page({
name:options.name,
sid:options.sid,
oid:options.oid,
types:options.types
types:options.types,
rid:options.rid?options.rid:'',
}
})
console.log('onLoad',{...this.data.opt});
... ... @@ -143,7 +145,7 @@ Page({
return
}
wx.navigateTo({
url: `./confirmPayment?type=1&detail=${JSON.stringify(detail)}&combine_out_trade_no=${res.data.combine_out_trade_no}&totalize=${this.data.totalize}&types=${this.data.opt.types}`,
url: `./confirmPayment?sid=${this.data.opt.sid}&sellerName=${this.data.opt.name}&oid=${this.data.opt.oid}&rid=${this.data.opt.rid?this.data.opt.rid:''}&type=1&detail=${JSON.stringify(detail)}&combine_out_trade_no=${res.data.combine_out_trade_no}&totalize=${this.data.totalize}&types=${this.data.opt.types}`,
})
}else{
wx.showToast({
... ...
// pack-activity/pack/confirmPayment.js
import util, { unixtoTime } from '../../utils/util';
import util, {
unixtoTime
} from '../../utils/util';
import App from '../../utils/api';
Page({
... ... @@ -7,156 +9,126 @@ Page({
* 页面的初始数据
*/
data: {
opt:{
detail:{},
combine_out_trade_no:'',
totalize:'',
types:'',
opt: {
detail: {},
combine_out_trade_no: '',
totalize: '',
types: '',
},
type: '',
time: 300,
countdown: '',
name:"",
name: "",
date: "",
phone:"",
calendarData:'',
sex:"先生",
indexs:0,
sexList:[
{
sex:'先生',
value:'1',
phone: "",
calendarData: '',
sex: "先生",
indexs: 0,
sexList: [{
sex: '先生',
value: '1',
},
{
sex:'女士',
value:'2',
sex: '女士',
value: '2',
},
{
sex:'公司',
value:'3',
sex: '公司',
value: '3',
}
]
},
modal:'',
modal: '',
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
opt:{
detail:options.detail?JSON.parse(options.detail):'',
combine_out_trade_no:options.combine_out_trade_no,
totalize:options.totalize?options.totalize:'',
sellerid:options.sellerid?options.sellerid:'',
types:options.types,
opt: {
detail: options.detail ? JSON.parse(options.detail) : '',
combine_out_trade_no: options.combine_out_trade_no,
totalize: options.totalize ? options.totalize : '',
sid: options.sid ? options.sid : '',
types: options.types,
oid: options.oid ? options.oid : '',
rid: options.rid ? options.rid : '',
sellerName: options.sellerName ? options.sellerName : '',
},
type:options.type,
type: options.type,
})
console.log('onLoad',{...this.data.opt});
let obj=wx.getStorageSync('info')
let obj = wx.getStorageSync('info')
console.log('objobjobjobj',{...obj})
if(obj){
if (obj) {
this.setData({
name:obj.name,
date:obj.date,
phone:obj.phone,
indexs:obj.sex*1-1,
calendarData:obj.calendarData,
name: obj.name,
date: obj.date,
phone: obj.phone,
indexs: obj.sex * 1 - 1,
calendarData: obj.calendarData,
})
}
this.countdown()
this.modal = this.selectComponent("#payModal"); //通过给组件所起的id调用组件
},
// 购买完成券之后关注公众号
wananchi() {
// 购买完成券之后关注公众号
wananchi() {
this.closeModal()
wx.navigateTo({
url: `/pages/me/wananchi?type=1&oid=${this.data.opt.detail.oid}`
})
},
wx.navigateTo({
url: `/pages/me/wananchi?type=1&oid=${this.data.opt.detail.oid}`
})
},
showModal() {
this.modal.showModal() //调用组件中打开模态框方法
},
confirmPayment(){
confirmPayment() {
App.PayOnline.CombineTransactionsByNewRecharge({
combine_out_trade_no:this.data.opt.combine_out_trade_no
}).then(res=>{
combine_out_trade_no: this.data.opt.combine_out_trade_no
}).then(res => {
console.log(res.data);
let that=this;
if(res.ret!='200'){
let that = this;
if (res.ret != '200') {
wx.showToast({
title: res.msg,
duration: 1000,
icon:'none',
icon: 'none',
success: function () {
console.log('支付失败',that.data.opt.types);
let url='';
if(that.data.opt.types=='1'){
url='/pages/customer/detail_owner_invitation_new?id='+that.data.opt.detail.oid;
}
if(that.data.opt.types=='2'){
url='/pack-cookbook/pages/success_new';
}
if(that.data.opt.types=='3'){
url='/pages/reserve/index';
}
setTimeout(function () {
wx.reLaunch({
url
})
}, 1000);
console.log('支付失败', that.data.opt.types);
that.callbackFun()
}
})
}
if(res.ret=='200'){
if (res.ret == '200') {
console.log(res.ret);
wx.requestPayment({
timeStamp: res.data.timeStamp+'',
timeStamp: res.data.timeStamp + '',
nonceStr: res.data.nonceStr,
package: res.data.package,
signType: res.data.signType,
paySign: res.data.paySign,
success (ress) {
success(ress) {
if (ress.errMsg == 'requestPayment:ok') {
console.log('支付成功',ress);
console.log('支付成功', ress);
return that.showModal()
}
console.log('支付失败',ress);
console.log('支付失败', ress);
wx.showToast({
title: '支付失败,请重新下单',
duration: 1000,
success: function () {
setTimeout(function () {
wx.reLaunch({
url: `/pages/customer/detail_owner_invitation_new?id=${that.data.opt.detail.oid}&hasInvitation=1&hasSellerShare=1&tplid=1`
})
}, 1000);
that.callbackFun()
}
})
},
fail (ress) {
console.log('支付失败',ress);
fail(ress) {
console.log('支付失败', ress);
wx.showToast({
title: '支付失败,请重新下单',
duration: 1000,
icon:'none',
icon: 'none',
success: function () {
console.log('支付失败',that.data.opt.types);
let url='';
if(that.data.opt.types=='1'){
url='/pages/customer/detail_owner_invitation_new?id='+that.data.opt.detail.oid;
}
if(that.data.opt.types=='2'){
url='/pack-cookbook/pages/success_new';
}
if(that.data.opt.types=='3'){
url='/pages/reserve/index';
}
setTimeout(function () {
wx.reLaunch({
url
})
}, 1000);
console.log('支付失败', that.data.opt.types);
that.callbackFun()
}
})
},
... ... @@ -164,32 +136,58 @@ Page({
}
})
},
// 支付失败回调 types 1邀请函 2提前点餐 3商家端app分享
callbackFun() {
let url = '';
let that = this;
if (that.data.opt.types == '1') {
url = '/pages/customer/detail_owner_invitation_new?id=' + that.data.opt.detail.oid;
}
if (that.data.opt.types == '2') {
let cookbookObj = {
sid: that.data.opt.sid,
sellerName: that.data.opt.sellerName,
oid: that.data.opt.oid,
hasSuccess: '1',
rid: that.data.opt.rid?that.data.opt.rid:''
}
url = `/pack-cookbook/pages/success_new?cookbookObj=${JSON.stringify(cookbookObj)}`;
}
if (that.data.opt.types == '3') {
url = '/pages/reserve/index';
}
setTimeout(function () {
wx.reLaunch({
url
})
}, 1000);
},
// 充值后跳转
recharge(){
console.log('充值完成跳转',this.data.opt.detail.oid);
this.closeModal()
recharge() {
console.log('充值完成跳转', this.data.opt.detail.oid);
this.closeModal()
wx.reLaunch({
url: `/pages/customer/detail_owner_invitation_new?id=${this.data.opt.detail.oid}&hasInvitation=1&hasSellerShare=1&tplid=1`
})
},
// 绑定名称
bindKeyNameInput(event){
bindKeyNameInput(event) {
const value = event.detail.value.replace(/\s+/g, "");
this.setData({
name: value
})
name: value
})
console.log(value);
},
// 绑定电话
bindKeyPhoneInput(event){
bindKeyPhoneInput(event) {
const value = event.detail.value.replace(/\s+/g, "");
this.setData({
phone: value
})
phone: value
})
console.log(value);
},
// 购买代金券后跳转
certificate(){
certificate() {
console.log({...this.data.opt.detail});
wx.reLaunch({
url: '/pages/me/coupon_news'
... ... @@ -200,11 +198,11 @@ Page({
},
// 点击确认支付
formSubmit() {
if(this.data.time==0){
if (this.data.time == 0) {
return util.toast('当前订单已过期,请重新进入优惠券购买页面下单', 'none');
}
if(this.data.type=='2'){
let data=this.data
if (this.data.type == '2') {
let data = this.data
if (!data.name) {
util.toast('未填写姓名', 'none')
return;
... ... @@ -217,38 +215,38 @@ Page({
util.toast('手机号码错误', 'none')
return;
}
let recharge_money=this.data.opt.detail.recharge_money*1;
if(recharge_money==0){
let recharge_money = this.data.opt.detail.recharge_money * 1;
if (recharge_money == 0) {
setTimeout(() => {
util.toast('您的会员充值已经在办理中,到店消费时请和收银核实,谢谢!','none',3000);
util.toast('您的会员充值已经在办理中,到店消费时请和收银核实,谢谢!', 'none', 3000);
wx.navigateBack(1)
}, 3500);
return
return
}
this.addInfo()
}else{
} else {
this.confirmPayment()
}
},
addInfo(){
let params={
sellerid:this.data.opt.sellerid,
rname:this.data.name,
sex:this.data.indexs*1+1,//1男 2女 3公司
phone:this.data.phone,
c_day:this.data.calendarData
addInfo() {
let params = {
sellerid: this.data.opt.sid,
rname: this.data.name,
sex: this.data.indexs * 1 + 1, //1男 2女 3公司
phone: this.data.phone,
c_day: this.data.calendarData
}
console.log({...params});
App.GuestManage.InsGuest(params).then(res=>{
App.GuestManage.InsGuest(params).then(res => {
console.log(res);
if(res.ret=='200'){
if (res.ret == '200') {
this.confirmPayment()
let obj={
name:this.data.name,
phone:this.data.phone,
sex:this.data.indexs*1+1,
calendarData:this.data.calendarData,
date:this.data.date,
let obj = {
name: this.data.name,
phone: this.data.phone,
sex: this.data.indexs * 1 + 1,
calendarData: this.data.calendarData,
date: this.data.date,
}
wx.setStorageSync('info', obj)
}
... ... @@ -257,14 +255,14 @@ Page({
// 选择日期
bind_ChangeDate(event) {
let date = event.detail.value
var calendarData = new Date(date)*1;
var calendarData = new Date(date) * 1;
this.setData({
date,
calendarData
})
},
// 选择性别
bind_Changesex(event){
bind_Changesex(event) {
console.log('event.detail',{...event.detail});
let indexs = event.detail.value;
this.setData({
... ... @@ -287,14 +285,14 @@ Page({
},
// 倒计时
countdown() {
var minute = Math.floor(this.data.time*1 / 60);
var minute = Math.floor(this.data.time * 1 / 60);
var second = this.data.time % 60;
second < 10 ? second = '0' + second : '';
this.setData({
countdown: minute + ':' + second,
time: this.data.time - 1
})
if(this.data.time==0){
if (this.data.time == 0) {
this.setData({
countdown: '0:00'
})
... ... @@ -303,21 +301,21 @@ Page({
setTimeout(this.countdown, 1000);
},
// 返回
navEvent(){
navEvent() {
// 1 邀请函 2 提前点餐 3商家端分享
if(this.data.opt.types=='1'){
if (this.data.opt.types == '1') {
return wx.reLaunch({
url: '/pages/customer/detail_owner_invitation_new?id='+this.data.opt.detail.oid,
url: '/pages/customer/detail_owner_invitation_new?id=' + this.data.opt.detail.oid,
})
}
if(this.data.opt.types=='2'){
if (this.data.opt.types == '2') {
return wx.reLaunch({
url: '/pack-cookbook/pages/success_new',
url: '/pack-cookbook/pages/success_new',
})
}
if(this.data.opt.types=='3'){
if (this.data.opt.types == '3') {
return wx.reLaunch({
url: '/pages/reserve/index',
url: '/pages/reserve/index',
})
}
},
... ...
... ... @@ -13,6 +13,7 @@ Page({
sid:'',
oid:'',
types:'',
rid:'',
},
exp_date:{},
detail:{},
... ... @@ -23,6 +24,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log('options',{...options});
this.setData({
opt:{
id:options.id,
... ... @@ -30,6 +32,7 @@ Page({
sid:options.sid,
oid:options.oid,
types:options.types,
rid:options.rid?options.rid:''
}
})
console.log('onLoad',{...this.data.opt});
... ... @@ -91,8 +94,19 @@ Page({
type:'2',
}).then(res=>{
if(res.ret=='200'){
let url = util.http_build_query({
type:'2',
types: this.data.opt.types,
detail: JSON.stringify(detail),
sid: this.data.opt.sid,
combine_out_trade_no:res.data.combine_out_trade_no,
totalize:this.data.detail.recharge_money,
sellerName: this.data.opt.name,
oid: this.data.opt.oid,
rid:this.data.opt.rid?this.data.opt.rid:''
}, './confirmPayment')
wx.navigateTo({
url: `./confirmPayment?type=2&detail=${JSON.stringify(detail)}&sellerid=${this.data.opt.sid}&combine_out_trade_no=${res.data.combine_out_trade_no}&totalize=${this.data.detail.recharge_money}&types=${this.data.opt.types}`,
url
})
}else{
wx.showToast({
... ...
// pack-cookbook/pages/cart_new.js
import App from '../../utils/api';
import util from '../../utils/util';
import RS from '../../utils/reserveStatus'
import TP from '../../utils/tpls';
Page({
/**
* 页面的初始数据
... ... @@ -22,17 +24,37 @@ Page({
vipProbablyPrice: '',
notes: '',
noData: false,
tpls:[],
current: 0,
seller:{},
options:{},
themeColor:'',
textColor:'',
navColor:'',
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let obj = JSON.parse(options.cookbookObj);
console.log('options', {...obj});
let textColor;
if(obj.themeColor=='251,246,241,1'){
textColor='81,81,81,1'
}else{
textColor='251,246,241,1'
}
this.setData({
options: obj,
tpls:[TP.tpls(1)],
navColor:obj.navColor,
themeColor:obj.themeColor,
textColor,
})
console.log('options', {
...obj
});
this.getCheckCookList(obj)
this.getDetail()
},
// 获取点菜列表
getCheckCookList(options) {
... ... @@ -49,6 +71,46 @@ Page({
})
})
},
getDetail() {
App.Reserve.Detail({
openid: getApp().openid,
rid: this.data.options.rid
}).then(res => {
let tables = [], //桌子信息
regions = [], //区域名称
tableNum = 0;
res.data.tables.forEach(t => {
tables.push(t.name);
tableNum += t.table_pnum * 1
if (regions.indexOf('t.rname') == -1) {
regions.push(t.rname);
}
})
let reserev = RS.reserve(res.data)
let dateSmart;
if (res.data.type == 1) {
dateSmart = util.unixtoTime(reserev.ddate, this.data.tpls[this.data.current].timeStrSmart[0])
if (res.data.is_set_ddate == 1) {
dateSmart += ' ' + util.unixtoTime(reserev.ddate, this.data.tpls[this.data.current].timeStrSmart[1])
} else {
dateSmart += ' ' + reserev.soltName
}
} else {
dateSmart = util.unixtoTime(reserev.ddate, this.data.tpls[this.data.current].timeStr)
}
this.setData({
seller: {
soltName: reserev.soltName,
date: dateSmart,
room: tables.join('、'),
region: regions.join('、'),
tableNum,
}
})
}).catch(res => {
console.log(res, '详情请求失败');
})
},
// 过滤数据
formatCookList(list) {
// 获取所有的规格
... ... @@ -208,9 +270,10 @@ Page({
getCookNormsList(cookbooklist) {
let probablyPrice = 0;
let vipProbablyPrice = 0;
let num=0;
cookbooklist.forEach(i => {
i.normsLen = 0
i.cookbooklist[0].forEach(j=>{
i.cookbooklist[0].forEach(j => {
if (j.order_xx && j.order_xx.length > 0) {
let arr = j.order_xx;
let result = arr.reduce((obj, item) => {
... ... @@ -245,11 +308,12 @@ Page({
j.norms = []
}
})
num+=i.normsLen
})
console.log(cookbooklist);
this.setData({
cookbooklist,
noData: true,
noData:(num*1)>0?false:true,
probablyPrice,
vipProbablyPrice
})
... ... @@ -261,12 +325,20 @@ Page({
},
// 确认下单
determineFun() {
if (this.data.noData) {
if (!this.data.noData) {
let cookbookObj = {
...this.data.options
}
wx.navigateTo({
url: `/pack-cookbook/pages/success_new?cookbookObj=${JSON.stringify(cookbookObj)}`,
cookbookObj.hasSuccess = 1
cookbookObj.notes=this.data.notes
App.Advance.PlaceOrder({
orderid: this.data.options.oid,
rid: this.data.options.rid,
identity: this.data.options.identity,
}).then(res => {
wx.navigateTo({
url: `/pack-cookbook/pages/success_new?cookbookObj=${JSON.stringify(cookbookObj)}`,
})
})
}
},
... ...
<!--pack-cookbook/pages/cart_new.wxml-->
<nav backgroundColor="#4d4e50" color="#fff">{{options.sellerName||'提交订单'}}</nav>
<scroll-view class="main">
<view class="info flex-lr">
<view class="texts font28r">就餐时间:</view>
<view class="texts_right font28r">{{options.sellerDate}} {{options.soltName}}</view>
</view>
<view class="info flex-lr">
<view class="texts font28r">桌位台号:</view>
<view class="texts_right font28r">{{options.region}}</view>
</view>
<view class="info flex-lr">
<view class="texts font28r">就餐人数:</view>
<view class="texts font28r">{{options.tableNum}}</view>
</view>
<view class="info flex-lr">
<view class="texts font28r">备注信息:</view>
<input type="text" model:value="{{notes}}" placeholder="点击录入口味,偏好等要求" placeholder-style="color:#fff" />
</view>
<view class="line"></view>
<view class="checkMenu" wx:if="{{cookbooklist.length>0}}">
<block wx:for="{{cookbooklist}}" wx:key="{{item.id}}" wx:for-index="indexs">
<view wx:if="{{item.is_show}}" class="title flex-lr">
<view class="leftTitle">{{item.class_name}}</view>
<view class="rightTitle">{{item.normsLen}}道</view>
</view>
<block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="index">
<block wx:if="{{item.norms.length>0}}">
<view wx:for="{{item.norms}}" wx:for-index="idx" class="content flex-lr">
<view class="single">{{item.cookName}}<text wx:if="{{item.name}}">({{item.name}})</text></view>
<view class="price">{{item.price}}元{{item.specs?'/'+item.specs:''}}</view>
<view class="count flex-cc">
<image bindtap="countFun" data-type="2" data-item="{{item}}" src="https://qn.colorcun.com/WechatIMG809.png" class="img1" mode="" />
{{item.count}}
<image bindtap="countFun" data-type="1" data-item="{{item}}" src="https://qn.colorcun.com/WechatIMG810.png" class="img2" mode="" />
<view style="background: rgba({{themeColor}});">
<nav backgroundColor="rgba({{themeColor}})" color="rgba({{navColor}})">{{options.sellerName||'提交订单'}}</nav>
<scroll-view class="main" style="background: rgba({{themeColor}});">
<view class="info" style="color: rgba({{textColor}});">
<view class="texts font28r">就餐时间:</view>
<view class="texts_right font28r">{{seller.date}}</view>
</view>
<view class="info" style="color: rgba({{textColor}});">
<view class="texts font28r">桌位台号:</view>
<view class="texts_right font28r">{{seller.room}} {{seller.region}}</view>
</view>
<view class="info" style="color: rgba({{textColor}});">
<view class="texts font28r">就餐人数:</view>
<view class="texts font28r">{{seller.tableNum}}</view>
</view>
<view class="info" style="color: rgba({{textColor}});">
<view class="texts font28r">备注信息:</view>
<input type="text" model:value="{{notes}}" style="color:rgba({{textColor}})" placeholder="点击录入口味,偏好等要求" placeholder-style="color:rgba({{textColor}})" />
</view>
<view class="line"></view>
<view class="checkMenu" wx:if="{{cookbooklist.length>0}}">
<block wx:for="{{cookbooklist}}" wx:key="{{item.id}}" wx:for-index="indexs">
<view wx:if="{{item.is_show}}" class="title flex-lr">
<view class="leftTitle">{{item.class_name}}</view>
<view class="rightTitle">{{item.normsLen}}道</view>
</view>
<block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="index">
<block wx:if="{{item.norms.length>0}}">
<view wx:for="{{item.norms}}" wx:for-index="idx" class="content flex-lr">
<view class="single">{{item.cookName}}<text wx:if="{{item.name}}">({{item.name}})</text></view>
<view class="price">{{item.price}}元{{item.specs?'/'+item.specs:''}}</view>
<view class="count flex-cc">
<image bindtap="countFun" data-type="2" data-item="{{item}}" src="https://qn.colorcun.com/WechatIMG809.png" class="img1" mode="" />
{{item.count}}
<image bindtap="countFun" data-type="1" data-item="{{item}}" src="https://qn.colorcun.com/WechatIMG810.png" class="img2" mode="" />
</view>
</view>
</view>
</block>
</block>
</block>
</block>
</view>
<view wx:if="{{noData}}" class="probably flex-ll">
<view class="tariff font24r">菜单价:<text class="font32r">{{probablyPrice}}</text>元</view>
<view class="tariff font24r">会员价:<text class="font32r">{{vipProbablyPrice}}</text>元</view>
</view>
<view wx:if="{{!noData}}" class="probably flex-ll" style="color: rgba({{textColor}});">
<view class="tariff font24r">菜单价:<text class="font32r">{{probablyPrice}}</text>元</view>
<view class="tariff font24r">会员价:<text class="font32r">{{vipProbablyPrice}}</text>元</view>
</view>
</scroll-view>
<view class="btns flex-cc">
<button class="font32r continue flex-cc" style="background: rgba({{themeColor}});color: rgba({{textColor}});" bindtap="continueOrdering">继续点菜</button>
<button class="font32r flex-cc {{noData?'determine1':'determine'}}" bindtap="determineFun">确认下单</button>
</view>
</scroll-view>
<view class="btns flex-cc">
<button class="font32r continue flex-cc" bindtap="continueOrdering">继续点菜</button>
<button class="font32r flex-cc {{noData?'determine':'determine1'}}" bindtap="determineFun">确认下单</button>
</view>
\ No newline at end of file
... ...
/* pack-cookbook/pages/cart_new.wxss */
page {
background: #4d4e50;
}
.main {
padding: 0 20rpx 148rpx 20rpx;
font-family: PingFang SC;
... ... @@ -12,20 +8,21 @@ page {
.info {
margin-bottom: 16rpx;
display: flex;
justify-content: space-between;
}
.texts {
color: #ffffff;
font-weight: 500;
}
.texts_right {
color: #999999;
font-weight: 500;
width: 50%;
text-align: right;
}
.info input {
color: #fff;
text-align: right;
flex: 1;
margin-left: 20rpx;
... ... @@ -90,7 +87,7 @@ page {
}
.probably {
color: #999;
color: #fff;
margin-top: 36rpx;
}
... ... @@ -128,7 +125,6 @@ page {
color: #BFC4D4;
}
.probably {
border-top: 2rpx solid #DBDBDB;
font-family: PingFang SC;
padding: 30rpx 40rpx 52rpx 40rpx;
}
... ...
... ... @@ -14,6 +14,7 @@ Page({
priceInfo: '',
scoreInfo: '',
certificate: '',
rid:'',
list: []
},
/**
... ... @@ -24,7 +25,8 @@ Page({
sellerName: options.sellerName,
sellerid: options.sellerid,
oid: options.oid,
types:options.types
types:options.types,
rid:options.rid?options.rid:'',
})
console.log('options',{...options});
this.getList()
... ... @@ -64,6 +66,7 @@ Page({
name: this.data.sellerName,
types: this.data.types,
oid: this.data.oid,
rid:this.data.rid?this.data.rid:'',
id
}, '/pack-activity/pack/vipRecharge')
wx.navigateTo({
... ...
... ... @@ -44,12 +44,16 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log('options', {
...options
});
this.setData({
options: options,
options:{
rid:options.rid,
oid:options.oid,
sellerName:options.sellerName,
sid:options.sid,
identity:options.identity
},
})
console.log('optionsoptions',{...options});
this.getCookList()
mta.Page.init({
"appID": "500667280",
... ... @@ -67,7 +71,8 @@ Page({
let cookbookObj = {
...this.data.options
}
wx.setStorageSync('cookbookObj', JSON.stringify(cookbookObj));
cookbookObj.themeColor=this.data.themeColor;
cookbookObj.navColor=this.data.navColor;
wx.navigateTo({
url: `/pack-cookbook/pages/cart_new?cookbookObj=${JSON.stringify(cookbookObj)}`,
})
... ... @@ -232,6 +237,8 @@ Page({
let cookbookObj = {
...this.data.options
}
cookbookObj.sellerName=res.data.seller.sellername;
cookbookObj.oid=res.data.id;
wx.redirectTo({
url: `/pack-cookbook/pages/success_new?cookbookObj=${JSON.stringify(cookbookObj)}`,
})
... ...
... ... @@ -4,6 +4,7 @@
"navigationBarTextStyle": "white",
"usingComponents": {
"nav":"/components/nav/nav",
"my-modal": "/components/modal/modal"
"my-modal": "/components/modal/modal",
"userinfo":"/components/userinfo/userinfo"
}
}
\ No newline at end of file
... ...
... ... @@ -67,17 +67,17 @@
<view class="news" style="color:rgba({{textColor}})">{{item.desc}}</view>
</view>
<view wx:for="{{item.norms}}" wx:key="{{item.id}}" wx:for-index="normsIndex" class="algorithmImg flex-lr calculate">
<image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG697.png':'https://qn.colorcun.com/Line2.png'}}" mode="aspectFill" class="reduceImg" bindtap="subtraction" data-item="{{item}}"/>
<image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG697.png':'https://qn.colorcun.com/Line2.png'}}" mode="aspectFill" class="reduceImg" bindtap="subtraction" data-item="{{item}}" />
<view class="box flex-cc">
<view class="num flex-cc">
{{item.count}}<view wx:if="{{item.name}}" style="color:rgba({{textColor}})">{{item.name}}</view>
</view>
<view class="practice" wx:if="{{item.specs}}" style="color:rgba({{textColor}})">{{item.specs}}</view>
<view class="practice" wx:if="{{item.specs}}" style="color:rgba({{textColor}})">{{item.specs}}</view>
</view>
<image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG696.png':'https://qn.colorcun.com/Line1.png'}}" mode="aspectFill" class="imgs" data-type="0" bindtap="addition" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}"/>
<image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG696.png':'https://qn.colorcun.com/Line1.png'}}" mode="aspectFill" class="imgs" data-type="0" bindtap="addition" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" />
</view>
<view wx:if="{{(item.specArr.length>1 || item.practice.length>1) || item.norms.length=='0'}}" class="algorithmImg flex-rr imgbox">
<image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG696.png':'https://qn.colorcun.com/Line1.png'}}" class="imgs" mode="aspectFill" bindtap="addition" data-type="1" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}"/>
<image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG696.png':'https://qn.colorcun.com/Line1.png'}}" class="imgs" mode="aspectFill" bindtap="addition" data-type="1" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" />
</view>
</view>
<view wx:else class="twoBox" data-idx="{{item.image_type}}" data-nameType="{{item.name_type}}">
... ... @@ -97,7 +97,7 @@
{{item.price?'¥'+item.price+'/'+item.unit:''}}
{{item.member_price?'会员 ¥'+item.member_price+'/'+item.unit:''}}
</view>
<image src="{{item.image}}" mode="aspectFill" />
<image wx:if="{{item.image}}" src="{{item.image}}" mode="aspectFill" />
<view class="greens" wx:if="{{item.desc}}">
<view class="news" style="color:rgba({{textColor}})">{{item.desc}}</view>
</view>
... ... @@ -127,7 +127,7 @@
菜品分类
</view>
</view>
<view class="right flex-cmc" bindtap="gotoShoppingCart">
<userinfo class="right flex-cmc" style="color:rgba({{textColor}})" binduserinfo="gotoShoppingCart">
<view class="rightBox">
<image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG701.png':'https://qn.colorcun.com/s2.png'}}" mode="" />
<view class="num" wx:if="{{orderItemCount}}">{{orderItemCount}}</view>
... ... @@ -135,7 +135,7 @@
<view class="fixedName" style="color:rgba({{textColor}})">
已选菜品
</view>
</view>
</userinfo>
</view>
<my-modal id="checkModal" height="410px" fadeStyle="center">
<view slot="modalContent" class="normsModel">
... ... @@ -160,7 +160,7 @@
</view>
</view>
</my-modal>
<my-modal id="classifyModal" fadeStyle="slideDown" height="100%">
<my-modal id="classifyModal" fadeStyle="slideDown" height="100%" opacity="0">
<view slot="modalContent" class="assortModel">
<scroll-view scroll-y="true" style="height: 70%;">
<view class="boxs">
... ...
... ... @@ -244,11 +244,14 @@ page {
.fixedBox .right .rightBox {
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
.fixedBox .right .num {
position: absolute;
right: -20%;
right: 0;
top: 0;
width: 30rpx;
height: 30rpx;
... ... @@ -435,7 +438,8 @@ page {
height: 100%;
display: flex;
justify-content: center;
flex-direction: column;
flex-direction: column;
padding-top: 30%;
}
.twoItem .num view{
font-size:24rpx;
... ...
// pack-cookbook/pages/success_new.js
import App from '../../utils/api';
import util from '../../utils/util';
import RS from '../../utils/reserveStatus'
import TP from '../../utils/tpls';
Page({
/**
* 页面的初始数据
... ... @@ -19,25 +21,28 @@ Page({
marketing: {},
recharge_data: {},
coupon_data: {},
dataStr: Date.now() * 1 / 1000,
rid: '',
oid: '',
sellerDate: '',
region: '',
tableNum: '',
soltName: '',
tpls: [],
current: 0,
seller: {},
options: {},
dataStr: Date.now() * 1 / 1000,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let obj = util.determine(options.cookbookObj);
console.log('options', {...obj});
this.setData({
options: obj,
tpls: [TP.tpls(1)],
})
this.getCheckCookList(obj);
this.getSellerTemplateConfFun()
console.log('options', {
...obj
});
this.getCheckCookList()
this.getDetail()
},
// 过滤数据
formatCookList(list) {
... ... @@ -85,9 +90,6 @@ Page({
let assortArr = [];
let check1 = '';
let check2 = '';
let that = this;
let complete = false
let complete1 = false
if (sortArr.length > 0) {
has10CaiOpen = list[0].status == 1;
sortArr.forEach(function (cate, i) {
... ... @@ -133,9 +135,6 @@ Page({
}
cook.item_clear_num = item_clear_num;
cook.index = n; //分类下菜品的下标
if (!cook.order_xx || cook.order_xx.length == 0) {
cook.norms = []; //做法规格
}
cook.type = '1';
let cook_style = cook.cook_style ? util.determine(cook.cook_style) : {
image_type: '1',
... ... @@ -164,124 +163,214 @@ Page({
}
})
}
this.setData({
check1,
check2,
assortArr
})
return flist;
},
// 获取点菜列表
getCheckCookList(obj) {
let param = {
sellerid: obj.sid,
identity: obj.identity,
orderid: obj.oid,
status: '0,1',
};
let probablyPrice = 0;
let vipProbablyPrice = 0;
App.Cookbook.GetCookbookByClass(param).then(json => {
let cookbooklist = this.formatCookList(json.data[0].list)
let newArr = JSON.parse(JSON.stringify(cookbooklist))
let num = 0
for (let i = 0; i < newArr.length; i++) {
if (newArr[i].cookbooklist.length == 0) {
continue;
}
for (let j = 0; j < newArr[i].cookbooklist[0].length; j++) {
let cook_style = newArr[i].cookbooklist[0][j].cook_style
if (cook_style.image_type == 2) {
let cookbooklist = JSON.parse(JSON.stringify(flist))
let newArr = JSON.parse(JSON.stringify(cookbooklist))
let num = 0
newArr.forEach((i, u) => {
if (i.cookbooklist.length != 0) {
i.cookbooklist[0].forEach(j => {
let cook_style = j.cook_style ? j.cook_style : j.image_type
if (cook_style && cook_style.image_type == 2) {
num++
} else {
if (num % 2 != 0) {
let k = cookbooklist[i].cookbooklist[0].findIndex((item) => {
return newArr[i].cookbooklist[0][j].id == item.id
let k = cookbooklist[u].cookbooklist[0].findIndex((item) => {
return j.id == item.id
})
if (k != -1) {
let temp = {
boderNone: true,
image_type: '2',
}
cookbooklist[i].cookbooklist[0].splice(k, 0, temp)
cookbooklist[u].cookbooklist[0].splice(k, 0, temp)
}
}
num = 0
}
}
})
}
cookbooklist.forEach(item => {
item.normsLen = 0
item.cookbooklist[0].forEach((cooks, idx) => {
if (cooks.order_xx && cooks.order_xx.length > 0) {
let arr = cooks.order_xx
let result = arr.reduce((obj, item) => {
let find = obj.find(i => (i.practiceid === item.practiceid && i.specid === item.specid));
let _d = {
...item,
count: 1
};
find ? find.count++ : obj.push(_d);
return obj;
}, []);
cooks.norms = result
cooks.norms.forEach(n => {
let obj = cooks.specArr.filter(i => {
return i.id == n.specid
})
n.price = (obj[0] && obj[0].price) ? obj[0].price : cooks.price;
n.member_price = (obj[0] && obj[0].member_price) ? obj[0].member_price : cooks.member_price;
n.id = cooks.id;
n.check2 = cooks.check2;
n.cookName = cooks.name;
n.check1 = cooks.check1;
let price = n.count * 1 * (n.price * 1);
let vipPrice = n.count * 1 * (n.member_price * 1);
probablyPrice += price;
vipProbablyPrice += vipPrice;
})
this.getCookNormsList(cookbooklist)
flist = cookbooklist;
this.setData({
check1,
check2,
assortArr
})
return flist;
},
// 加减处理已点菜的数据
getCookNormsList(cookbooklist) {
let probablyPrice = 0;
let vipProbablyPrice = 0;
cookbooklist.forEach(i => {
i.normsLen = 0
i.cookbooklist[0].forEach(j => {
if (j.order_xx && j.order_xx.length > 0) {
let arr = j.order_xx;
let result = arr.reduce((obj, item) => {
let find = obj.find(i => (i.practiceid === item.practiceid && i.specid === item.specid));
let _d = {
...item,
count: 1
};
find ? find.count++ : obj.push(_d);
return obj;
}, []);
result = result.sort((obj1, obj2) => util.objCompare(obj1, obj2, 'practiceid'))
j.norms = result.sort((obj1, obj2) => util.objCompare(obj1, obj2, 'specid'))
j.norms.forEach(n => {
n.id = j.id;
n.check2 = j.check2;
n.cookName = j.name;
n.check1 = j.check1;
let list = j.specArr.filter(i => {
return i.id == n.specid
})
item.is_show = true
item.normsLen += cooks.norms.length
} else {
cooks.norms = []
}
})
n.price = (list[0] && list[0].price) ? list[0].price : j.price;
n.member_price = (list[0] && list[0].member_price) ? list[0].member_price : j.member_price;
let price = n.count * 1 * (n.price * 1);
let vipPrice = n.count * 1 * (n.member_price * 1);
probablyPrice += price;
vipProbablyPrice += vipPrice;
})
i.normsLen += j.norms.length
i.is_show = true
} else {
j.norms = []
}
})
})
console.log(cookbooklist);
this.setData({
noData: true,
probablyPrice,
vipProbablyPrice
})
return cookbooklist
},
// 获取点菜列表
getCheckCookList() {
let param = {
sellerid: this.data.options.sid,
identity: '1',
orderid: this.data.options.oid,
status: '0,1',
};
App.Cookbook.GetCookbookByClass(param).then(json => {
let cookbooklist = this.formatCookList(json.data[0].list)
this.setData({
cookbooklist
})
})
this.GetDzSellerConfFun()
},
// 获取主题色
GetDzSellerConfFun() {
App.Seller.GetDzSellerConf({
sid: this.data.options.sid
}).then(res => {
let themeColor, textColor, navColor;
if (res.data.cook_style) {
let style = util.determine(res.data.cook_style)
if (style && style.red && style.green && style.blue && style.alpha) {
themeColor = style.red + ',' + style.green + ',' + style.blue + ',' + Math.floor(style.alpha)
} else {
themeColor = '77,78,80,1'; //未设置 为灰色
}
if (themeColor == '251,246,241,1') {
textColor = '81,81,81,1'
navColor = "81,81,81,1"
} else {
navColor = "255,255,255,1"
textColor = '251,246,241,1'
}
this.setData({
themeColor,
textColor,
navColor
})
}
}).catch(res => {
themeColor = '77,78,80,1';
navColor = "255,255,255,1"
this.setData({
cookbooklist,
noData: true,
probablyPrice,
vipProbablyPrice
themeColor,
navColor
})
})
},
// 菜品更换
continueOrdering() {
console.log({...this.data.options});
wx.reLaunch({
url: `/pack-cookbook/pages/index_new?rid=${this.data.options.rid}&sid=${this.data.options.sid}&oid=${this.data.options.oid}&sellerName=${this.data.options.sellerName}&identity=1`,
wx.showToast({
title: '您的订单已经下达给商家,如果需要改菜需和商家确认,以免产生误解。',
icon: 'none',
duration: 3000
})
},
// 点击了解更多会员优惠政策
gotoFavourableList() {
let url = util.http_build_query({
sellerName: this.data.sellerName,
sellerid: this.data.sid,
oid: this.data.oid,
sellerName: this.data.options.sellerName,
sellerid: this.data.options.sid,
oid: this.data.options.oid,
rid: this.data.options.rid,
types: '2',
}, '/pack-cookbook/pages/favourableList')
wx.navigateTo({
url
})
},
getDetail() {
App.Reserve.Detail({
openid: getApp().openid,
rid: this.data.options.rid
}).then(res => {
let tables = [], //桌子信息
regions = [], //区域名称
tableNum = 0;
res.data.tables.forEach(t => {
tables.push(t.name);
tableNum += t.table_pnum * 1
if (regions.indexOf('t.rname') == -1) {
regions.push(t.rname);
}
})
let reserev = RS.reserve(res.data)
let dateSmart;
if (res.data.type == 1) {
dateSmart = util.unixtoTime(reserev.ddate, this.data.tpls[this.data.current].timeStrSmart[0])
if (res.data.is_set_ddate == 1) {
dateSmart += ' ' + util.unixtoTime(reserev.ddate, this.data.tpls[this.data.current].timeStrSmart[1])
} else {
dateSmart += ' ' + reserev.soltName
}
} else {
dateSmart = util.unixtoTime(reserev.ddate, this.data.tpls[this.data.current].timeStr)
}
this.setData({
seller: {
soltName: reserev.soltName,
date: dateSmart,
room: tables.join('、'),
region: regions.join('、'),
tableNum,
}
})
setTimeout(() => {
this.getSellerTemplateConfFun(reserev.sid);
}, 0);
}).catch(res => {
console.log(res, '详情请求失败');
})
},
getSellerTemplateConfFun() {
App.Seller.GetSellerTemplateConf({
sid: this.data.sid
sid: this.data.options.sid
}).then(res => {
let data = res.data
let marketing, coupon_data, priceInfo, scoreInfo, recharge_list, stringifyUse;
marketing = data.marketing ? JSON.parse(data.marketing) : '';
marketing = util.determine(data.marketing);
console.log('marketing', marketing);
if (marketing.coupon_data) {
coupon_data = marketing.coupon_data;
... ... @@ -327,16 +416,14 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage() {
let options = {
sid: this.data.sid,
rid: this.data.rid,
oid: this.data.oid,
identity: '1',
hasOnlyShow: '1'
let cookbookObj = {
...this.data.options,
hasOnlyShow: 1
};
delete cookbookObj.hasSuccess
return {
title: '菜品已点好,快来看看都点了什么~',
path: util.http_build_query(options, '/pack-cookbook/pages/success_new'),
path: `/pack-cookbook/pages/success_new?cookbookObj=${JSON.stringify(cookbookObj)}`,
imageUrl: 'http://nosqn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148571.jpg',
}
},
... ...
<!--pack-cookbook/pages/success_new.wxml-->
<nav backgroundColor="#4d4e50" color="#fff">{{options.sellerName||'提交订单'}}</nav>
<scroll-view class="main">
<view class="box">
<view class="info flex-lr">
<view class="texts font28r">就餐时间:</view>
<view class="texts_right font28r">{{options.sellerDate}} {{soltName}}</view>
</view>
<view class="info flex-lr">
<view class="texts font28r">桌位台号:</view>
<view class="texts_right font28r">{{options.region}}</view>
</view>
<view class="info flex-lr">
<view class="texts font28r">就餐人数:</view>
<view class="texts font28r">{{options.tableNum}}</view>
</view>
<view class="info flex-lr">
<view class="texts font28r">备注信息:</view>
<view class="texts font28r">{{options.notes}}</view>
</view>
<image class="imgs" src="https://qn.colorcun.com/001.png" mode="" />
</view>
<view class="line"></view>
<view class="checkMenu">
<block wx:for="{{cookbooklist}}" wx:key="{{item.id}}" wx:for-index="indexs">
<view wx:if="{{item.is_show}}" class="title flex-lr">
<view class="leftTitle">{{item.class_name}}</view>
<view class="rightTitle">{{item.normsLen}}道</view>
<view style="background: rgba({{themeColor}});">
<nav backgroundColor="rgba({{themeColor}})" color="rgba({{navColor}})">{{options.sellerName}}</nav>
<scroll-view class="main" style="background: rgba({{themeColor}});">
<view class="box">
<view class="info" style="color: rgba({{textColor}});">
<view class="texts font28r">就餐时间:</view>
<view class="texts_right font28r">{{seller.date}}</view>
</view>
<block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="index">
<block wx:if="{{item.norms.length>0}}">
<view wx:for="{{item.norms}}" wx:for-index="idx" class="content flex-lr">
<view class="single">{{item.cookName}}<text wx:if="{{item.name}}">({{item.name}})</text></view>
<view class="price">{{item.price}}元{{item.specs?'/'+item.specs:''}}</view>
{{item.count}}
</view>
</block>
</block>
</block>
<view class="probably flex-ll">
<view class="tariff font24r">菜单价:<text class="font32r">{{probablyPrice}}</text>元</view>
<view class="tariff font24r">会员价:<text class="font32r">{{vipProbablyPrice}}</text>元</view>
<view class="info" style="color: rgba({{textColor}});">
<view class="texts font28r">桌位台号:</view>
<view class="texts_right font28r">{{seller.room}} {{seller.region}}</view>
</view>
<view class="info" style="color: rgba({{textColor}});">
<view class="texts font28r">就餐人数:</view>
<view class="texts font28r">{{seller.tableNum}}</view>
</view>
<view class="info" style="color: rgba({{textColor}});">
<view class="texts font28r">备注信息:</view>
<view class="texts font28r">{{options.notes}}</view>
</view>
<image class="imgs" src="https://qn.colorcun.com/001.png" mode="" />
</view>
<view class="information font36r">特别优惠</view>
<view class="poop font24r">根据您选择的菜品,我们推荐您参加以下活动,本次消费可用,预计可以节约大笔开销!</view>
<view class="preferential" wx:if="{{marketing && (marketing.is_coupon=='1' || marketing.is_recharge=='1')}}">
<view class="preferentialItems" wx:if="{{marketing && marketing.is_coupon=='1' && dataStr<(coupon_data.etime*1)}}">
<view class="left">
<view class="top">
<text>{{coupon_data.aname}}</text>
<text class="price" wx:if="{{coupon_data.price}}">¥{{coupon_data.price}}</text>
<!-- is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 -->
<text wx:if="{{discount!='0.00' && (coupon_data.use.is_cash=='1' || coupon_data.use.is_cash)}}" class="discount">{{discount}}折</text>
</view>
<view wx:if="{{coupon_data.exp_date.is_week=='1' || coupon_data.exp_date.is_week===true}}" class="bottom">
{{coupon_data.exp_date.week_show?coupon_data.exp_date.week_show+'可用':''}}{{coupon_data.desc?','+coupon_data.desc+'。':'。'}}
</view>
<view wx:if="{{coupon_data.exp_date.is_none=='1' || coupon_data.exp_date.is_none===true}}" class="bottom">
无限制{{coupon_data.desc?','+coupon_data.desc+'。':'。'}}
</view>
<view wx:if="{{coupon_data.exp_date.is_birthday=='1' || coupon_data.exp_date.is_birthday===true}}" class="bottom">
会员生日当天可用{{coupon_data.desc?','+coupon_data.desc+'。':'。'}}
</view>
<view class="line"></view>
<view class="checkMenu">
<block wx:for="{{cookbooklist}}" wx:key="{{item.id}}" wx:for-index="indexs">
<view wx:if="{{item.is_show}}" class="title flex-lr">
<view class="leftTitle">{{item.class_name}}</view>
<view class="rightTitle">{{item.normsLen}}道</view>
</view>
<navigator url="/pack-activity/pack/buyCoupon?id={{coupon_data.id}}&name={{seller.name}}&use={{stringifyUse}}&sid={{seller.sid}}&oid={{detail.id}}&types=2" hover-class="navigator-hover">
<view class="font24r orderingFood">
去抢购
</view>
</navigator>
<block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="index">
<block wx:if="{{item.norms.length>0}}">
<view wx:for="{{item.norms}}" wx:for-index="idx" class="content flex-lr">
<view class="single">{{item.cookName}}<text wx:if="{{item.name}}">({{item.name}})</text></view>
<view class="price">{{item.price}}元{{item.specs?'/'+item.specs:''}}</view>
{{item.count}}
</view>
</block>
</block>
</block>
<view class="probably flex-ll">
<view class="tariff font24r">菜单价:<text class="font32r">{{probablyPrice}}</text>元</view>
<view class="tariff font24r">会员价:<text class="font32r">{{vipProbablyPrice}}</text>元</view>
</view>
<!-- 当前日期要大于限制结束日期 -->
<view class="preferentialItems" wx:if="{{marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1)))}}">
<view class="left">
<view class="top">
<text>{{recharge_data.rname}}</text>
</view>
<view class="bottom" wx:if="{{priceInfo}}">
{{priceInfo}}{{(recharge_data.recharge_list.is_coupons=='0' && recharge_data.recharge_list.is_score=='0')?'。':';'}}
</view>
<view class="bottom" wx:if="{{scoreInfo}}">
{{scoreInfo}}{{recharge_data.recharge_list.is_coupons=='0'?'。':';'}}
</view>
<view class="bottom" wx:if="{{recharge_data.recharge_list.is_coupons=='1'}}">
{{recharge_data.recharge_list.is_coupons=='1'?'会员充值满'+marketing.recharge_data.recharge_money+'元赠送优惠券':''}}。
<view class="information font36r">特别优惠</view>
<view class="poop font24r">根据您选择的菜品,我们推荐您参加以下活动,本次消费可用,预计可以节约大笔开销!</view>
<view class="preferential" wx:if="{{marketing && (marketing.is_coupon=='1' || marketing.is_recharge=='1')}}">
<view class="preferentialItems" wx:if="{{marketing && marketing.is_coupon=='1' && dataStr<(coupon_data.etime*1)}}">
<view class="left">
<view class="top">
<text>{{coupon_data.aname}}</text>
<text class="price" wx:if="{{coupon_data.price}}">¥{{coupon_data.price}}</text>
<!-- is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 -->
<text wx:if="{{discount!='0.00' && (coupon_data.use.is_cash=='1' || coupon_data.use.is_cash)}}" class="discount">{{discount}}折</text>
</view>
<view wx:if="{{coupon_data.exp_date.is_week=='1' || coupon_data.exp_date.is_week===true}}" class="bottom">
{{coupon_data.exp_date.week_show?coupon_data.exp_date.week_show+'可用':''}}{{coupon_data.desc?','+coupon_data.desc+'。':'。'}}
</view>
<view wx:if="{{coupon_data.exp_date.is_none=='1' || coupon_data.exp_date.is_none===true}}" class="bottom">
无限制{{coupon_data.desc?','+coupon_data.desc+'。':'。'}}
</view>
<view wx:if="{{coupon_data.exp_date.is_birthday=='1' || coupon_data.exp_date.is_birthday===true}}" class="bottom">
会员生日当天可用{{coupon_data.desc?','+coupon_data.desc+'。':'。'}}
</view>
</view>
<navigator url="/pack-activity/pack/buyCoupon?id={{coupon_data.id}}&name={{options.sellerName}}&use={{stringifyUse}}&rid={{options.rid}}&sid={{options.sid}}&oid={{options.oid}}&types=2" hover-class="navigator-hover">
<view class="font24r orderingFood">
去抢购
</view>
</navigator>
</view>
<navigator url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=2" hover-class="navigator-hover">
<view class="font24r orderingFood">
去充值
<!-- 当前日期要大于限制结束日期 -->
<view class="preferentialItems" wx:if="{{marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1)))}}">
<view class="left">
<view class="top">
<text>{{recharge_data.rname}}</text>
</view>
<view class="bottom" wx:if="{{priceInfo}}">
{{priceInfo}}{{(recharge_data.recharge_list.is_coupons=='0' && recharge_data.recharge_list.is_score=='0')?'。':';'}}
</view>
<view class="bottom" wx:if="{{scoreInfo}}">
{{scoreInfo}}{{recharge_data.recharge_list.is_coupons=='0'?'。':';'}}
</view>
<view class="bottom" wx:if="{{recharge_data.recharge_list.is_coupons=='1'}}">
{{recharge_data.recharge_list.is_coupons=='1'?'会员充值满'+marketing.recharge_data.recharge_money+'元赠送优惠券':''}}。
</view>
</view>
</navigator>
<navigator url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{options.sellerName}}&sid={{options.sid}}&oid={{options.oid}}&rid={{options.rid}}&types=2" hover-class="navigator-hover">
<view class="font24r orderingFood">
去充值
</view>
</navigator>
</view>
</view>
</view>
<view class="favouredPolicy">
<view class="font24r policy" bindtap="gotoFavourableList">
点击了解更多会员优惠政策
<view class="favouredPolicy">
<view class="font24r policy" bindtap="gotoFavourableList">
点击了解更多会员优惠政策
</view>
</view>
</view>
</scroll-view>
<view class="btns flex-cc">
<button class="font32r continue flex-cc" style="background: rgba({{themeColor}});color: rgba({{textColor}});" bindtap="continueOrdering">菜品更换</button>
<button class="font32r determine flex-cc" open-type="share">分享菜单</button>
</view>
</scroll-view>
<view class="btns flex-cc">
<button class="font32r continue flex-cc" bindtap="continueOrdering">菜品更换</button>
<button class="font32r determine flex-cc" open-type="share">分享菜单</button>
</view>
\ No newline at end of file
... ...
/* pack-cookbook/pages/success_new.wxss */
page {
background: #4d4e50;
}
.main {
padding: 0 20rpx 148rpx 20rpx;
font-family: PingFang SC;
... ... @@ -12,16 +8,18 @@ page {
.info {
margin-bottom: 16rpx;
display: flex;
justify-content: space-between;
}
.texts {
color: #ffffff;
font-weight: 500;
}
.texts_right {
color: #999999;
font-weight: 500;
width: 50%;
text-align: right;
}
.info input {
... ... @@ -83,8 +81,7 @@ page {
}
.probably {
border-top: 2rpx solid #DBDBDB;
color: #515151;
color: #000;
font-family: PingFang SC;
padding: 30rpx 40rpx 52rpx 40rpx;
}
... ... @@ -104,7 +101,7 @@ page {
.btns button {
width: 50%;
box-sizing: border-box;
color: #fff;
color: #BFC4D4;
height: 100%;
border-radius: 0;
}
... ...
... ... @@ -192,9 +192,12 @@ Page({
},
getstaffinfo(uid){
console.log('sellerid',this.data.detail.seller.id);
App.Activity.GetCustomerActivityBaseinfo({sellerid:this.data.detail.seller.id,uid}).then((json)=>{
if(json.ret==200){
console.log('staffinfostaffinfostaffinfo',json.data)
App.Activity.GetCustomerActivityBaseinfo({
sellerid:this.data.detail.seller.id,
uid
}).then((json)=>{
if(json.ret==200) {
console.log('staffinfostaffinfostaffinfo', json.data)
this.setData({
staffinfo:json.data
})
... ... @@ -207,7 +210,9 @@ Page({
url: util.http_build_query({
rid: this.id,
oid: this.data.detail.order.id,
identity: 1
sellerName: this.data.seller.name,
sid: this.data.seller.sid,
identity: '1',
}, '/pack-cookbook/pages/success_new')
});
} else {
... ... @@ -218,18 +223,13 @@ Page({
if (res.ret != 200) {
return util.toast(res.msg, 'none')
}
console.log(this.id,res.data.id,res.data.sellerid);
wx.navigateTo({
url: util.http_build_query({
rid: this.id,
oid: res.data.id,
identity: 1,
sid: res.data.sellerid,
sellerName:this.data.seller.name,
sellerDate:this.data.seller.date,
soltName:this.data.seller.soltName,
region:this.data.seller.region+this.data.seller.room,
tableNum:this.data.detail.actual_pum?this.data.detail.actual_pum:this.data.tableNum
sellerName: this.data.seller.name,
identity: '1',
}, '/pack-cookbook/pages/index_new')
});
})
... ...