Commit 39697eeb7a13bd701f82d181c76637d8ef44d9dd

Authored by yiren
1 parent d6cbfb01

充值和购买代金券页面和接口对接

... ... @@ -98,7 +98,8 @@
"pages/index",
"pages/cart",
"pages/success",
"pages/remark"
"pages/remark",
"pages/index_new"
]
},
{
... ...
// pack-activity/pack/buyCoupon.js
import App from '../../utils/api';
import util from '../../utils/util'
Page({
/**
... ... @@ -8,10 +10,14 @@ Page({
opt: {
name: '',
id:'',
oid:'',
use:{},
sid:'',
},
detail:{},
exp_date:{},
num: 1,
totalize: '',
money: 20.55,
explain: "关于代金券不得不说的那些事,关于代金券不得不说的那些事,关于代金券不得不说的那些事,关于代金券不得不说的那些事",
},
... ... @@ -23,20 +29,19 @@ Page({
opt:{
id:options.id,
name:options.name,
sid:options.sid,
oid:options.oid,
use:JSON.parse(options.use)
}
})
console.log({...this.data.opt});
console.log('onLoad',{...this.data.opt});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
let money = this.data.money * 1;
let num = this.data.num * 1;
this.setData({
totalize: (money * num).toFixed(2)
})
this.getDetail();
},
/**
... ... @@ -45,9 +50,29 @@ Page({
onShow() {
},
getDetail(){
App.Activity.GetActivityById({
id: this.data.opt.id
}).then(res => {
if(res.data.length>0){
let detail=res.data[0];
let exp_date=detail.exp_date?JSON.parse(detail.exp_date):'';
let price = detail.price * 1;
let num = this.data.num * 1;
this.setData({
detail,
exp_date,
totalize: (price * num).toFixed(2)
})
console.log('detail',{...detail});
console.log('exp_date',{...exp_date});
console.log('totalize',this.data.totalize);
}
})
},
// 点击减号
subtraction() {
let money = this.data.money * 1;
let price = this.data.detail.price * 1;
let num = this.data.num * 1;
let num1 = num - 1
if (num == '1') {
... ... @@ -55,23 +80,44 @@ Page({
}
this.setData({
num: num1,
totalize: (money * num1).toFixed(2)
totalize: (price * num1).toFixed(2)
})
},
// 点击加号
addition() {
let money = this.data.money * 1;
let price = this.data.detail.price * 1;
let num = this.data.num * 1;
let num1 = num + 1
this.setData({
num: num1,
totalize: (money * num1).toFixed(2)
totalize: (price * num1).toFixed(2)
})
},
// 提交订单
submitOrder() {
wx.navigateTo({
url: '/pack-activity/pack/confirmPayment',
console.log('oidoid',this.data.opt.oid);
let detail=this.data.detail
detail.name=this.data.opt.name;
detail.oid=this.data.opt.oid;
App.Activity.CreateNewRechargeOrder({
recharge_id:this.data.opt.id,
sellerid:this.data.opt.sid,
number:this.data.num,
price:this.data.totalize,
type:'1',
}).then(res=>{
console.log(res);
if(res.ret=='200'){
wx.navigateTo({
url: `./confirmPayment?type=1&detail=${JSON.stringify(detail)}&orderId=${res.data.id}&totalize=${this.data.totalize}`,
})
}else{
wx.showToast({
title:res.msg,
duration:2000,
mask:true
})
}
})
},
/**
... ...
<!--pack-activity/pack/buyCoupon.wxml 代金券抢购页面-->
<wxs src="../../utils/util.wxs" module="util" />
<nav>{{opt.name}}</nav>
<view class="wrap">
<view class="info info1">
<view class="info_left font38r">
200元代金券
{{detail.aname}}
</view>
<view class="info_right">
<view class="preferential font32r"><text class="font32r">200元/</text>{{money}}元</view>
<view class="preferential font32r">
<text wx:if="{{use.cash && (use.is_cash=='1' || use.is_cash)}}" class="font32r">{{use.cash}}元/</text>
{{detail.price}}元
</view>
<view class="operation">
<text class="font30r" bindtap="subtraction">-</text>
<input type="number" model:value="{{num}}" />
... ... @@ -19,7 +23,7 @@
券要求
</view>
<view class="info_right text_info font32r">
满200可用
{{detail.desc}}
</view>
</view>
<view class="info">
... ... @@ -27,7 +31,7 @@
有效期从
</view>
<view class="info_right text_info font32r">
2023-04-28
{{util.unixtoTime(detail.stime,'YYYY-MM-DD')}}
</view>
</view>
<view class="info">
... ... @@ -35,23 +39,29 @@
有效期至
</view>
<view class="info_right text_info font32r">
2023-08-28
{{util.unixtoTime(detail.etime,'YYYY-MM-DD')}}
</view>
</view>
<view class="info">
<view class="info_left font32r">
使用限制:
</view>
<view class="info_right text_info font32r">
<view wx:if="{{exp_date.is_week=='1' || exp_date.is_week*1}}" class="info_right text_info font32r" >
{{exp_date.week_show?exp_date.week_show+'可用':''}}
</view>
<view wx:if="{{exp_date.is_none=='1' || exp_date.is_none*1}}" class="info_right text_info font32r" >
无限制
</view>
<view wx:if="{{exp_date.is_birthday=='1' || exp_date.is_birthday*1}}" class="info_right text_info font32r" >
生日当天可用
</view>
</view>
<view class="info">
<view class="info_left font32r">
券说明
</view>
</view>
<view class="explain_news">{{explain}}</view>
<view class="explain_news">{{detail.explain}}</view>
</view>
<view class="fixed_box">
<view class="shoppingCart_img">
... ...
// pack-activity/pack/confirmPayment.js
import util from '../../utils/util'
import util from '../../utils/util';
import App from '../../utils/api';
Page({
/**
* 页面的初始数据
*/
data: {
type: '2',
opt:{
detail:{},
orderId:'',
totalize:'',
},
type: '',
price:'',
detail:{},
time: 1800,
time: 300,
countdown: '',
tip: '',
date: "",
type: '2',
},
/**
... ... @@ -21,39 +27,84 @@ Page({
onLoad(options) {
this.setData({
opt:{
type:options.type,
detail:JSON.parse(options.detail),
}
detail:options.detail?JSON.parse(options.detail):'',
orderId:options.orderId,
totalize:options.totalize?options.totalize:''
},
type:options.type
})
console.log('options.detail',JSON.parse(options.detail));
console.log('onLoad',{...this.data.opt});
this.countdown()
this.modal = this.selectComponent("#payModal"); //通过给组件所起的id调用组件
},
showModal() {
this.modal.showModal() //调用组件中打开模态框方法
},
recharge(){
console.log('11111111111111111',this.data.opt.detail.oid);
this.closeModal()
wx.reLaunch({
url: `/miniprogram/pages/customer/detail_owner_invitation_new.wxml?id=${this.data.opt.detail.oid}&hasInvitation=1&hasSellerShare=1&tplid=1`
})
},
certificate(){
console.log('11111111111111111',this.data.opt.detail.oid);
this.closeModal()
wx.reLaunch({
url: '/miniprogram/pages/me/coupon_news'
})
},
confirmPayment(){
console.log(11111);
App.PayOnline.CombineTransactionsByRecharge({
id:this.data.opt.orderId
}).then(res=>{
console.log(res.ret);
if(res.ret=='200'){
console.log(res.ret);
this.setData({
price:res.data.price
})
wx.requestPayment({
timeStamp: res.data.timeStamp+'',
nonceStr: res.data.nonceStr,
package: res.data.package,
signType: res.data.signType,
paySign: res.data.paySign,
success (ress) {
this.showModal()
},
fail (ress) {
console.log(ress);
}
})
}
})
},
closeModal() {
this.modal.closeModal() //调用组件中关闭模态框方法
},
// 充值————点击确认支付
formSubmit(e) {
let form=e.detail.value
console.log('form',form);
if (!form.name) {
util.toast('未填写姓名', 'none')
return;
}
if (!form.phone) {
util.toast('未填写手机号码', 'none')
return;
}
if (!/^1\d{10}$/.test(form.phone)) {
util.toast('手机号码错误', 'none')
return;
console.log(this.data.type);
if(this.data.type=='2'){
let form=e.detail.value
if (!form.name) {
util.toast('未填写姓名', 'none')
return;
}
if (!form.phone) {
util.toast('未填写手机号码', 'none')
return;
}
if (!/^1\d{10}$/.test(form.phone)) {
util.toast('手机号码错误', 'none')
return;
}
}
this.confirmPayment()
console.log(1111);
this.confirmPayment()
},
// 选择日期
bind_ChangeDate(event) {
... ... @@ -87,22 +138,6 @@ Page({
})
setTimeout(this.countdown, 1000);
},
// 支付
confirmPayment() {
// wx.requestPayment({
// timeStamp: '',
// nonceStr: '',
// package: '',
// signType: 'MD5',
// paySign: '',
// success (res) {
// },
// fail (res) {
// }
// })
},
/**
* 生命周期函数--监听页面隐藏
*/
... ...
... ... @@ -6,13 +6,13 @@
支付剩余时间 {{countdown}}
</view>
<view class="money_text">
¥50.00
{{opt.detail.aname}}
</view>
<view class="nameText font24r">
200元代金券
{{opt.detail.totalize}}
</view>
<view class="nameText font24r">
唐人街1号中餐厅
{{opt.detail.name}}
</view>
</view>
<view wx:if="{{type=='2'}}" class="coupon">
... ... @@ -26,7 +26,7 @@
<view class="page-section">
<view class="page-section-title font32r">联系电话</view>
<view class="weui-cells weui-cell__bd" style="margin: 30rpx 0">
<input class="weui-input" type="number" name="phone" maxlength="11" placeholder="点击输入您的电话" placeholder-style="color:#999;" style="color: #999"/>
<input class="weui-input" type="number" name="phone" maxlength="11" placeholder="点击输入您的电话" placeholder-style="color:#999;" style="color: #999" />
</view>
</view>
<view class="page-section page-section1">
... ... @@ -36,7 +36,7 @@
<view class="colorSty">{{date?date:'点击输入您的生日'}}</view>
</picker>
</view>
<view class="more"></view>
<view class="more"></view>
</view>
<view class="page-section">
<view class="page-section-title font32r">充值金额</view>
... ... @@ -44,22 +44,26 @@
{{opt.detail.recharge_money}}元
</view>
</view>
<view class="fixed_box">
<button class="font32r btns" formType="submit">确认支付
</button>
</view>
</form>
</view>
</view>
<view wx:if="{{type=='2'}}" class="fixed_box">
<button class="font32r btns" formType="submit">确认支付
</button>
</view>
<view wx:if="{{type=='1'}}" class="fixed_box">
<button class="font32r btns" bindtap="formSubmit">确认支付
</button>
</view>
<my-modal id="payModal" fadeStyle="slideUp" height="380px">
<view slot="modalName" class="titleModal">成功支付50.00元</view>
<view slot="modalName" class="titleModal">成功支付{{price}}元</view>
<view slot="modalContent">
<view class="explain" wx:if="{{type=='2'}}">
您的会员充值已经在办理中,到店消费时请和收银核实,谢谢!
</view>
<button wx:if="{{type=='2'}}" class="font32r btnsPay" bindtap="closeModal">完成
<button wx:if="{{type=='2'}}" class="font32r btnsPay" bindtap="recharge">完成
</button>
<button wx:else class="font32r btnsPay" bindtap="closeModal">朕知道了
<button wx:else class="font32r btnsPay" bindtap="certificate">朕知道了
</button>
</view>
</my-modal>
\ No newline at end of file
... ...
... ... @@ -10,6 +10,8 @@ Page({
opt: {
name: '',
id:'',
sid:'',
oid:'',
},
exp_date:{},
detail:{},
... ... @@ -24,9 +26,11 @@ Page({
opt:{
id:options.id,
name:options.name,
sid:options.sid,
oid:options.oid
}
})
console.log({...this.data.opt});
console.log('onLoad',{...this.data.opt});
},
/**
... ... @@ -55,8 +59,8 @@ Page({
}).then(res => {
let detail=res.data
detail.name=this.data.opt.name
let exp_date=util.parseDataValue(res.data.exp_date)
let recharge_list=util.parseDataValue(res.data.recharge_list)
let exp_date=res.data.exp_date?JSON.parse(res.data.exp_date):''
let recharge_list=res.data.recharge_list?JSON.parse(res.data.recharge_list):''
this.setData({
detail,
exp_date,
... ... @@ -73,8 +77,29 @@ Page({
})
},
submitOrder(){
wx.navigateTo({
url: `./confirmPayment?type=2&detail=${JSON.stringify(this.data.detail)}`,
console.log('oidoid',this.data.opt.oid);
let detail=this.data.detail
detail.name=this.data.opt.name;
detail.oid=this.data.opt.oid;
App.Activity.CreateNewRechargeOrder({
recharge_id:this.data.opt.id,
sellerid:this.data.opt.sid,
number:'1',
price:this.data.detail.recharge_money,
type:'2',
}).then(res=>{
console.log(res);
if(res.ret=='200'){
wx.navigateTo({
url: `./confirmPayment?type=2&detail=${JSON.stringify(detail)}&orderId=${res.data.id}`,
})
}else{
wx.showToast({
title:res.msg,
duration:2000,
mask:true
})
}
})
},
/**
... ...
// pack-activity/pack/buyCoupon.js
Page({
/**
* 页面的初始数据
*/
data: {
opt: {
name: '',
id:'',
},
num: 1,
totalize: '',
money: 20.55,
explain: "关于代金券不得不说的那些事,关于代金券不得不说的那些事,关于代金券不得不说的那些事,关于代金券不得不说的那些事",
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
opt:{
id:options.id,
name:options.name,
}
})
console.log({...this.data.opt});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
let money = this.data.money * 1;
let num = this.data.num * 1;
this.setData({
totalize: (money * num).toFixed(2)
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
// 点击减号
subtraction() {
let money = this.data.money * 1;
let num = this.data.num * 1;
let num1 = num - 1
if (num == '1') {
return false
}
this.setData({
num: num1,
totalize: (money * num1).toFixed(2)
})
},
// 点击加号
addition() {
let money = this.data.money * 1;
let num = this.data.num * 1;
let num1 = num + 1
this.setData({
num: num1,
totalize: (money * num1).toFixed(2)
})
},
// 提交订单
submitOrder() {
wx.navigateTo({
url: '/pack-activity/pack/confirmPayment',
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
... ...
// pack-cookbook/pages/index_new.js
var mta = require('mta-wechat-analysis')
import util from '../../utils/util';
import App from '../../utils/api';
Page({
/**
* 页面的初始数据
*/
data: {
type:'C',//样式A,B,C
scrollTop: 0,
isloading: true,
toView: "",
hasEnter: false,
totalWidth: getApp().system.windowWidth,
singleWidth: parseInt((getApp().system.windowWidth * 0.92 - 16) / 2),
totalHeight: getApp().system.windowHeight,
kindHeight: getApp().system.windowHeight - 68,
hasListModel: true,
cookbooklist: [{}, {}, {}, {}, {}, {}, {},],
showSkeleton: true,
order: {},
orderItemCount:0,
twoList:[
{
title:'烤鸽子',
info:'¥48/位 ',
vip:'会员 ¥38/位',
image:'https://img.zcool.cn/community/0143e15b0239e4a801218cf4503272.jpg@3000w_1l_0o_100sh.jpg',
quantum:0,
},
{
title:'烤鸽子',
info:'¥48/位 ',
vip:'会员 ¥38/位',
image:'https://img.zcool.cn/community/0143e15b0239e4a801218cf4503272.jpg@3000w_1l_0o_100sh.jpg',
quantum:0,
},
{
title:'烤鸽子',
info:'¥48/位 ',
vip:'会员 ¥38/位',
image:'https://img.zcool.cn/community/0143e15b0239e4a801218cf4503272.jpg@3000w_1l_0o_100sh.jpg',
quantum:0,
}
],
dishList:[
{
image:'https://img.zcool.cn/community/0143e15b0239e4a801218cf4503272.jpg@3000w_1l_0o_100sh.jpg',
title:'默认菜品样式A',
info:'¥168/份 会员 ¥160/份',
normsInfo:'味型:咸鲜 烹调:熬煮',
dw:'1个 (如果没有会员价,则不显示会员价)',
zs:'有图大',
quantum:1,
js:'有(菜品录入了就有,没录入就没有)',
xz:'否,只显示加号',
ggInfo:'江南传统名菜,口味咸鲜,汤白汁浓,肉质酥肥,笋清香脆嫩,鲜味浓厚。',
gg:'菜品名称(味型/烹调)和价格在顶部分开(默认),菜品味型/烹调 录入了才有,没录入没有。'
},
{
image:'https://img.zcool.cn/community/0143e15b0239e4a801218cf4503272.jpg@3000w_1l_0o_100sh.jpg',
title:'默认菜品样式A',
info:'¥168/份 会员 ¥160/份',
normsInfo:'味型:咸鲜 烹调:熬煮',
dw:'1个 (如果没有会员价,则不显示会员价)',
zs:'有图大',
quantum:0,
js:'有(菜品录入了就有,没录入就没有)',
xz:'否,只显示加号',
ggInfo:'江南传统名菜,口味咸鲜,汤白汁浓,肉质酥肥,笋清香脆嫩,鲜味浓厚。',
gg:'菜品名称(味型/烹调)和价格在顶部分开(默认),菜品味型/烹调 录入了才有,没录入没有。'
},
]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
options: options,
})
this.getCookList();
this.initOrder();
mta.Page.init({
"appID": "500667280",
"eventID": "500667287",
"statPullDownFresh": true,
"statShareApp": true,
"statReachBottom": true,
"lauchOpts": options, //渠道分析
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
// 点击加号
addition(e){
const item= e.currentTarget.dataset['item'];
const index= e.currentTarget.dataset['key'];
const type= e.currentTarget.dataset['type'];
let quantum = item.quantum * 1 + 1;
let obj;
if(type=='one') obj=`dishList[${index}].quantum`;
if(type=='two') obj=`twoList[${index}].quantum`;
this.setData({
[obj]:quantum
})
},
// 点击减号
subtraction(e){
const item= e.currentTarget.dataset['item'];
const index= e.currentTarget.dataset['key'];
const type= e.currentTarget.dataset['type'];
let quantum = item.quantum * 1 - 1;
let obj;
if(type=='one') obj=`dishList[${index}].quantum`;
if(type=='two') obj=`twoList[${index}].quantum`;
this.setData({
[obj]:quantum
})
},
initOrder() {
App.Advance.CreateOrder({
rid: this.data.options.rid,
identity: this.data.options.identity,
status: '0,1',
openid: getApp().openid,
}).then(res => {
let orderItemCount = 0;
res.data.cookbooklist.forEach(cb => {
if (this.data.options.identity == 1 && cb.status > 0) {
wx.redirectTo({
url: util.http_build_query({
rid: this.data.options.rid,
oid: res.data.id,
identity: 1
}, '/pack-cookbook/pages/success')
});
return false;
}
orderItemCount += parseInt(cb.num)
})
this.setData({
[`options.oid`]: res.data.id,
order: res.data,
orderItemCount: orderItemCount,
})
})
},
formatCookList(list){
//原栏目下显示
let hasShowClass = false;
//菜单中展示沽清的菜品
let hasClearCookbook = false;
//十道必选菜
let has10CaiOpen = false;
let flist = [];
if (list.length > 0) {
has10CaiOpen = list[0].status == 1;
list.forEach(function (cate, i) {
if (cate.status == 1 && cate.cookbooklist[0].length > 0) {
let cooks = [];
//let cooks_order=[];
cate.cookbooklist[0].forEach(function (cook, n) {
if (cook.status == 1) {
let flag = true;
if (has10CaiOpen) {
if (cate.class_type == 2 && !hasShowClass && flist.length > 0 && flist[0].class_type == 1) {
for (let fi = 0; fi < flist[0].cookbooklist[0].length; fi++) {
if (flist[0].cookbooklist[0][fi].id == cook.id) {
flag = false;
break;
}
}
}
}
cook.item_clear_num = cook.clear_num;
if (!hasClearCookbook) {//不显示卖光了
let item_clear_num = cook.clear_num;
if (cook.spec) {
let clear_num = null;
cook.spec.forEach(spec => {
if (spec.clear_num == 0) {
clear_num = 0;
} else {
clear_num = null;
}
})
if (clear_num == 0) {
item_clear_num = 0;
}
}
cook.item_clear_num = item_clear_num;
if (item_clear_num == 0) {
flag = false;
}
}
if (flag) {
cooks.push(cook);
//cooks_order.push(cook.order_o);
}
}
})
if (cooks.length > 0) {
//cooks 排序...
cate.cookbooklist[0] = cooks;
flist.push(cate)
}
}
})
}
return flist;
},
getCookList: function (orderid) {
let param = {
sellerid: this.data.options.sid,
identity: this.data.options.identity,
orderid : this.data.options.oid,
status:'0,1',
};
App.Advance.GetCookbookByClass(param).then(json => {
//菜单分类添加修饰
let cookbooklist = this.formatCookList(json.data[0].list);
setTimeout(() => {
this.setData({
cookbooklist: cookbooklist,
countPirce: json.data[0].countPirce ? json.data[0].countPirce : 0,
countTotal: json.data[0].countTotal ? json.data[0].countTotal : 0,
isloading: false,
showSkeleton: false,
})
}, 0)
}).catch(res => {
console.log('getCookList-catch', res);
this.selectComponent("#network").show('网络不给力,请检查网络后重试');
});
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
... ...
{
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#4d4e50",
"navigationBarTextStyle": "white",
"usingComponents": {
"foodCard": "../components/food-card/food-card",
"cookClass": "../components/cook-class/cook-class",
"nav":"/components/nav/nav",
"cart":"../components/cart/cart",
"formids":"/components/formids/formids",
"userinfo":"/components/userinfo/userinfo",
"network":"/components/network/network"
}
}
\ No newline at end of file
... ...
<!--pack-cookbook/pages/index_new.wxml-->
<nav backgroundColor="#4d4e50" color="#fff">{{options.seeAll||order.seller.sellername||'提前点菜'}}</nav>
<loading wx:if="{{isloading}}">数据加载中</loading>
<view class="wrapIine"></view>
<view wx:if="{{type=='A'}}" class="heand flex-vc flex-cc">
<view class="style_round flex-vc flex-cc">
<view class="round"></view>
<view class="line"></view>
</view>
<view class="title">10道必点菜</view>
<view class="style_round flex-vc flex-cc">
<view class="line"></view>
<view class="round"></view>
</view>
</view>
<view wx:if="{{type=='A'}}" class="wrapIine"></view>
<view class="dishWrap" wx:for="{{dishList}}" wx:key="index">
<block wx:if="{{type=='A'}}">
<view class="dishItem flex-lr">
<view class="dishLeft dishTexts">
{{item.title}}
</view>
<view class="dishTexts dishRight">
{{item.info}}
</view>
</view>
<view class="norms">
{{item.normsInfo}}
</view>
</block>
<block wx:if="{{type=='B'}}">
<view class="dishItem typeB">
<view class="dishLeft dishTexts">
{{item.title}}
</view>
<view class="dishTexts dishRight">
{{item.normsInfo}}
</view>
</view>
<view class="norms normsB">
{{item.info}}
</view>
</block>
<block wx:if="{{type=='C'}}">
<view class="dishItem">
<view class="dishLeft dishTexts">
{{item.title}}
</view>
<view class="dishTexts dishRight">
{{item.normsInfo}}
</view>
</view>
<view class="norms">
{{item.info}}
</view>
</block>
<image src="{{item.image}}" class="dishImg" mode="widthFix" />
<view class="greens">
<view class="news">
{{item.ggInfo}}
</view>
<view class="news">
<text class="Textcolor">样式说明:</text>{{item.gg}}
</view>
<view class="news">
<text class="Textcolor">售卖单位:</text>{{item.dw}}
</view>
<view class="news">
<text class="Textcolor">展示大小:</text>{{item.zs}}
</view>
<view class="news">
<text class="Textcolor">菜品介绍:</text>{{item.js}}
</view>
<view class="news">
<text class="Textcolor">是否选中:</text>{{item.xz}}
</view>
</view>
<view wx:if="{{item.quantum==0}}" class="algorithmImg flex-rr">
<image src="../add.png" class="imgs" mode="aspectFill" bindtap="addition" data-item="{{item}}" data-key="{{index}}" data-type="one" />
</view>
<view wx:else class="algorithmImg flex-lr calculate">
<image src="../reduce.png" mode="aspectFill" class="reduceImg" bindtap="subtraction" data-item="{{item}}" data-key="{{index}}" data-type="one" />
<view class="box flex-cc">
<view class="num flex-cc">
{{item.quantum}}<view>份</view>
</view>
<view class="practice">
清蒸
</view>
</view>
<image src="../add.png" mode="aspectFill" class="imgs" bindtap="addition" data-item="{{item}}" data-key="{{index}}" data-type="one" />
</view>
<view class="wrapIine"></view>
</view>
<view class="twoBox flex-rs">
<view class="twoItem" wx:for="{{twoList}}" wx:key="index">
<view class="twoTitle">
{{item.title}}
</view>
<view class="twoInfo">
{{item.info}}{{item.vip}}
</view>
{{item.quantum}}
<image src="{{item.image}}" mode="aspectFill" />
<view wx:if="{{item.quantum==0}}" class="algorithmImg flex-rr oneImg">
<image src="../add.png" class="imgs" mode="aspectFill" bindtap="addition" data-item="{{item}}" data-key="{{index}}" data-type="two" />
</view>
<view wx:else class="algorithmImg flex-lr twoImgs">
<image src="../reduce.png" mode="aspectFill" class="reduceImg" bindtap="subtraction" data-item="{{item}}" data-key="{{index}}" data-type="two" />
<view class="box flex-cc">
<view class="num flex-cc">
{{item.quantum}}
</view>
</view>
<image src="../add.png" mode="aspectFill" class="imgs" bindtap="addition" data-item="{{item}}" data-key="{{index}}" data-type="two" />
</view>
</view>
</view>
<view class="fixedBox flex-lr">
<view class="left flex-cmc">
<image src="../img1.png" mode="" />
<view class="fixedName">
菜品分类
</view>
</view>
<view class="right flex-cmc">
<image src="../img2.png" mode="" />
<view class="fixedName">
已选菜品
</view>
</view>
</view>
\ No newline at end of file
... ...
/* pack-cookbook/pages/index_new.wxss */
page{
background-color: #4d4e50;
}
.wrapIine{
height: 4rpx;
width: 100%;
background-color: #dbdbdb;
}
.heand{
width: 100%;
}
.heand .style_round{
width: 160rpx;
}
.style_round .line{
width: 100rpx;
height: 2rpx;
background: #dbdbdb;
}
.style_round .round{
width: 8rpx;
height: 8rpx;
background: #dbdbdb;
border-radius: 50%;
}
.heand .title{
color: #fff;
padding: 10rpx 0;
}
.dishWrap{
color: #fff;
padding-top: 40rpx;
}
.dishTexts{
padding: 0 40rpx;
color: #dbdbdb;
font-family: PingFang SC;
font-weight: 500;
font-size: 40rpx;
-webkit-text-stroke: 1rpx black;
}
.dishRight{
font-family: PingFang SC;
font-weight: 500;
font-size: 28rpx;
}
.norms{
margin-top: 10rpx;
color: #dbdbdb;
font-family: PingFang SC;
font-size: 24rpx;
padding:0 40rpx 30rpx 40rpx;
}
.dishImg{
width: 100%;
}
.greens{
padding: 20rpx 32rpx 58rpx 32rpx;
color: #dbdbdb;
font-family: PingFang SC;
font-size: 24rpx;
}
.Textcolor{
color: #EBDD3C;
}
.algorithmImg{
height: 60rpx;
padding-bottom: 58rpx;
}
.algorithmImg .imgs{
width: 60rpx;
height: 100%;
margin-right: 80rpx;
}
.calculate{
padding: 0 80rpx 58rpx 80rpx;
}
.calculate .imgs{
width: 60rpx;
height: 60rpx;
margin: 0;
}
.box .num{
color: #e34d59;
font-family: PingFang SC;
font-weight: 500;
font-size: 80rpx;
}
.num view{
color: #dbdbdb;
font-family: PingFang SC;
font-weight: 500;
font-size: 32rpx;
margin:0 20rpx;
}
.twoItem{
width: 50%;
box-sizing: border-box;
border-bottom: 4rpx solid #dbdbdb;
}
.twoItem:nth-of-type(odd){
border-right: 4rpx solid #dbdbdb;
}
.twoTitle{
padding: 30rpx 0 10rpx 20rpx;
color: #dbdbdb;
font-family: PingFang SC;
font-weight: 500;
font-size: 40rpx;
}
.twoInfo{
color: #dbdbdb;
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
padding: 0 0 30rpx 20rpx;
}
.twoItem image{
height: 247rpx;
}
.oneImg{
margin: 38rpx 40rpx 0 0;
}
.twoImgs{
margin: 38rpx 40rpx 0 40rpx;
}
.twoBox .imgs{
margin-right: 0;
}
.reduceImg{
width: 90rpx;
height: 8rpx !important;
}
.fixedBox{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
padding: 18rpx 80rpx 18rpx 80rpx;
box-sizing: border-box;
background-color: #4D4E50;
}
.fixedBox .left image{
width: 44rpx;
height: 36rpx;
}
.fixedBox .right image{
width: 41rpx;
height: 36rpx;
}
.fixedName{
color: #dbdbdb;
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
margin-top: 10rpx;
}
.typeB{
display: flex;
align-items: flex-end;
flex-direction: column;
}
.normsB{
text-align: right;
}
... ...
... ... @@ -16,7 +16,6 @@ Page({
detail:{},
staffinfo:{},
between: false,
is_display:true,
id: null,
msgTpl: '',
chef: {},
... ... @@ -25,7 +24,10 @@ Page({
reserve: {},
signboard: {},
store: {},
recharge_data:{},
coupon_data:{},
homeColor: '',
use:'',
current: 0,
theme: 'blackGold', //blue green blackGold
seller: {
... ... @@ -36,6 +38,7 @@ Page({
},
priceInfo:'',
scoreInfo:'',
discount:'',
},
/**
* 生命周期函数--监听页面加载
... ... @@ -162,11 +165,6 @@ Page({
long:reserev.seller.long,
}
})
if(this.data.seller.sid=="677" || this.data.seller.sid=="26" || this.data.seller.sid=="8" || this.data.seller.sid=="4352"){
this.setData({
is_display : false
})
}
console.log('reserevreserevreserevreserevreserev',reserev);
console.log('sellersellersellerseller',this.data.seller);
console.log('detaildetaildetaildetail',this.data.detail);
... ... @@ -207,6 +205,7 @@ 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,
... ... @@ -262,21 +261,46 @@ Page({
App.Seller.GetSellerTemplateConf({
sid
}).then(res => {
let home,chef,marketing,reserve,signboard,store,homeColor,priceInfo,scoreInfo,recharge_data,recharge_list;
chef = util.parseDataValue(res.data.chef)
reserve = util.parseDataValue(res.data.reserve)
marketing = util.parseDataValue(res.data.marketing)
signboard = util.parseDataValue(res.data.signboard)
store = util.parseDataValue(res.data.store)
home = util.parseDataValue(res.data.home)
if(marketing.is_recharge=='1'){
recharge_data=marketing.recharge_data
let data=res.data
let home,chef,marketing,reserve,signboard,store,homeColor,coupon_data,priceInfo,scoreInfo,recharge_list;
chef = data.chef ? JSON.parse(data.chef) : '';
reserve = data.reserve ? JSON.parse(data.reserve) : '';
marketing = data.marketing ? JSON.parse(data.marketing) : '';
signboard = data.signboard ? JSON.parse(data.signboard) : '';
store = data.store ? JSON.parse(data.store) : '';
home = data.home ? JSON.parse(data.home) : '';
coupon_data=marketing.coupon_data;
let use=JSON.stringify(marketing.coupon_data.use)
if(marketing.is_recharge=='1' && marketing.recharge_data){
let recharge_data=marketing.recharge_data
recharge_list=marketing.recharge_data.recharge_list
if(recharge_list.is_price=='1') priceInfo='会员充值满'+recharge_data.recharge_money+'元赠送'+recharge_list.price+'元余额';
if(recharge_list.is_score=='1') scoreInfo='会员充值满'+recharge_data.recharge_money+'元赠送'+recharge_list.score+'积分';
console.log('scoreInfo',scoreInfo);
this.setData({
recharge_data:marketing.recharge_data
})
console.log('recharge_data',recharge_data);
}
this.setData({
coupon_data,
use
})
// is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
if(marketing.is_coupon=='1' && coupon_data && (!coupon_data.use.is_cash || coupon_data.use.is_cash=='1')){
let cash=coupon_data.use.cash;
let price=coupon_data.price*1;
let discount=((price/cash)*10).toFixed(2);
console.log('cash',cash);
console.log('price',price);
console.log('discount',discount);
this.setData({
discount,
coupon_data
})
}
if(store && store.images.length>0) store.images =util.parseDataValue(store.images)
if(signboard && signboard.images) signboard.images = util.parseDataValue(signboard.images)
if(store && store.images.length>0) store.images =store.images?JSON.parse(store.images):'';
if(signboard && signboard.images) signboard.images = signboard.images?JSON.parse(signboard.images):'';
if (marketing && marketing.is_online_book=='1' && marketing.is_transpond =='1') {
this.setData({
between: true
... ...
... ... @@ -188,46 +188,50 @@
</view>
</view>
</view>
<!-- <view class="preferential" wx:if="{{marketing && (marketing.is_coupon=='1' || marketing.is_recharge=='1')}}"> -->
<view class="preferential">
<view class="preferential" wx:if="{{marketing && (marketing.is_coupon=='1' || marketing.is_recharge=='1')}}">
<view class="rubric rubric1">
特别优惠
</view>
<!-- <view class="preferentialItems" wx:if="{{marketing && marketing.is_coupon=='1'}}"> -->
<view class="preferentialItems" wx:if="{{marketing.is_coupon=='1'}}">
<view class="preferentialItems" wx:if="{{marketing && marketing.is_coupon=='1'}}">
<view class="left">
<view class="top">
<text>{{marketing.coupon_data.aname}}代金券</text>
<!-- <text class="price">¥{{ticketList.ticket.price1}}</text>
<text class="discount">{{ticketList.ticket.rebate}}折</text> -->
<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="{{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}}" 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}}" 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}}" class="bottom" >
生日当天可用{{coupon_data.desc?','+coupon_data.desc+'。':'。'}}
</view>
<!-- <view class="bottom">
{{ticketList.ticket.info}}
</view> -->
</view>
<navigator url="/pack-activity/pack/buyCoupon?id={{marketing.coupon_data.id}}&name={{seller.name}}" hover-class="navigator-hover">
<navigator url="/pack-activity/pack/buyCoupon?id={{coupon_data.id}}&name={{seller.name}}&use={{use}}&sid={{seller.sid}}&oid={{detail.id}}" hover-class="navigator-hover">
<view class="font24r orderingFood">
去抢购
</view>
</navigator>
</view>
<!-- <view class="preferentialItems" wx:if="{{marketing && marketing.is_recharge=='1'}}"> -->
<view class="preferentialItems" wx:if="{{marketing.is_recharge=='1'}}">
<view class="preferentialItems" wx:if="{{marketing && marketing.is_recharge=='1' && recharge_data}}">
<view class="left">
<view class="top">
<text>{{marketing.recharge_data.rname}}</text>
<text>{{recharge_data.rname}}</text>
</view>
<view class="bottom">
{{priceInfo}}{{(marketing.recharge_data.recharge_list.is_coupons=='0' && marketing.recharge_data.recharge_list.is_score=='0')?'。':';'}}
<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">
{{scoreInfo}}{{marketing.recharge_data.recharge_list.is_coupons=='0'?'。':';'}}
<view class="bottom" wx:if="{{scoreInfo}}">
{{scoreInfo}}{{recharge_data.recharge_list.is_coupons=='0'?'。':';'}}
</view>
<view class="bottom">
{{marketing.recharge_data.recharge_list.is_coupons=='1'?'会员充值满'+marketing.recharge_data.recharge_money+'元赠送优惠券':''}}。
<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 url="/pack-activity/pack/vipRecharge?id={{marketing.recharge_data.id}}&name={{seller.name}}" hover-class="navigator-hover">
<navigator url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}" hover-class="navigator-hover">
<view class="font24r orderingFood">
去充值
</view>
... ...
... ... @@ -503,6 +503,8 @@
margin: 0 10rpx 0 20rpx;
font-family: PingFang SC;
font-size: 14rpx;
height: 30rpx;
line-height: 30rpx;
}
.top .price {
... ...
... ... @@ -634,5 +634,15 @@ export default {
//客户经理优惠券信息
'App.Activity.GetActivityById':{
openid:'openid'
},
//创建购买优惠活动订单
'App.Activity.CreateNewRechargeOrder':{
openid:'openid'
},
//合单支付
'App.PayOnline.CombineTransactionsByRecharge':{
openid:'openid'
}
}
\ No newline at end of file
... ...