Commit 87b5cebba4415117fb1827ea9e614ff477ef9cfd

Authored by yiren
1 parent 14df66da

提前点餐 分享页面新增功能

... ... @@ -4,19 +4,17 @@
<scroll-view style="background: rgba({{themeColor}});" class="content" scroll-into-view="{{toView}}" scroll-y="true" scroll-with-animation="true">
<block wx:for="{{cookbooklist}}" wx:key="cookbooklist-key" wx:for-index="indexs">
<view class="dishWrap" id="{{ 'inToView'+item.id}}">
<block>
<view 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" style="color:rgba({{navColor}})">{{item.class_name}}</view>
<view class="style_round flex-vc flex-cc">
<view class="line"></view>
<view class="round"></view>
</view>
<view class="heand flex-vc flex-cc">
<view class="style_round flex-vc flex-cc">
<view class="round"></view>
<view class="line"></view>
</view>
</block>
<view class="title" style="color:rgba({{navColor}})">{{item.class_name}}</view>
<view class="style_round flex-vc flex-cc">
<view class="line"></view>
<view class="round"></view>
</view>
</view>
<block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="index">
<!-- name_type 1左侧,2右侧,3顶部分开 image_type 1大图,2小图 -->
<view wx:if="{{item.image_type=='1'}}" class="oneBox" data-idx="{{item.image_type}}" data-nameType="{{item.name_type}}">
... ...
... ... @@ -13,12 +13,6 @@ page {
padding: 0 0 30rpx 0;
}
.wrapIine {
height: 4rpx;
width: 100%;
background-color: #dbdbdb;
}
.heand {
width: 100%;
border-top: 4rpx solid #dbdbdb;
... ...
... ... @@ -16,6 +16,33 @@ Page({
seller: {},
options: {},
rechargeList:[],
textsInfoColor:'',
themeColor:'',
textColor:'',
navColor:'',
height:wx.getSystemInfoSync().windowWidth*1,
},
imageLoad(e) {
const index = e.currentTarget.dataset['index'];
const indexs = e.currentTarget.dataset['indexs'];
const idx = e.currentTarget.dataset['idx'];
//获取图片的原始宽度和高度
let originalWidth = e.detail.width;
let originalHeight = e.detail.height;
let imageSize = util.imageZoomHeightUtil(originalWidth,originalHeight);
let imageHeight = `cookbooklist[${indexs}].cookbooklist[0][${index}].norms[${idx}].imageHeight`;
let height=(imageSize && imageSize.imageHeight)?imageSize.imageHeight.toFixed(0):'';
this.setData({
[imageHeight]:height,
})
},
preview(event){
const item = event.currentTarget.dataset['item'];
let currentUrl = item.image
wx.previewImage({
current: currentUrl, // 当前显示图片的http链接
urls: [currentUrl] // 需要预览的图片http链接列表
})
},
/**
* 生命周期函数--监听页面加载
... ... @@ -152,6 +179,7 @@ Page({
image_type: '1',
name_type: ''
}; //判断是不是json,是json在转换为对象
cook.imageHeight=''
cook.cook_style = cook_style;
cook.image_type = cook_style && cook_style.image_type ? cook_style.image_type : '1'; //1大图,2小图 默认大图
cook.name_type = cook_style && cook_style.name_type ? cook_style.name_type : '3'; //1左侧,2右侧,3顶部分开 默认分开
... ... @@ -237,6 +265,8 @@ Page({
n.cookName = j.name;
n.check1 = j.check1;
n.unit = j.unit;
n.image = j.image;
n.specArr = j.specArr;
let list = j.specArr.filter(i => {
return i.id == n.specid
})
... ... @@ -275,9 +305,7 @@ Page({
this.setData({
cookbooklist
})
setTimeout(() => {
this.getNewRechargeListfFun();
}, 0);
this.getNewRechargeListfFun();
})
this.GetDzSellerConfFun()
},
... ... @@ -286,25 +314,31 @@ Page({
App.Seller.GetDzSellerConf({
sid: this.data.options.sid
}).then(res => {
let themeColor, textColor, navColor;
let themeColor, textColor, navColor,textsInfoColor;
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'; //未设置 为灰色
navColor = "255,255,255,1"
textColor = '251,246,241,1'
textsInfoColor='153, 153, 153,1'
}
if (themeColor == '251,246,241,1') {
textColor = '0,0,0,1'
navColor='0,0,0,1'
textsInfoColor='0,0,0,1'
} else {
navColor = "255,255,255,1"
textColor = '251,246,241,1'
textsInfoColor='153, 153, 153,1'
}
this.setData({
themeColor,
textColor,
navColor
navColor,
textsInfoColor
})
}
}).catch(res => {
... ... @@ -401,10 +435,8 @@ Page({
let item=this.findClosest(list,this.data.probablyPrice)
let rechargeList=[];
item?rechargeList.push(item):'';
wx.nextTick(()=>{
this.setData({
rechargeList,
})
this.setData({
rechargeList,
})
}).catch(res => {
console.log('GetSellerTemplateConf请求失败');
... ...
<!--pack-cookbook/pages/success_new.wxml-->
<view style="background: rgba({{themeColor}});height: 100%;">
<view style="background: rgba({{themeColor}});">
<nav back="none" bindNavEvent="navEvent" backgroundColor="rgba({{themeColor}})" color="rgba({{navColor}})">{{options.sellerName}}</nav>
<scroll-view class="main" style="background: rgba({{themeColor}});">
<view class="box">
... ... @@ -21,23 +21,44 @@
</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 class="heand flex-cc" wx:if="{{item.is_show}}">
<view class="style_round flex-cc">
<view class="round"></view>
<view class="line"></view>
</view>
<view class="title" style="color:rgba({{textColor}})">{{item.class_name}} <view>{{item.normsLen}}道</view></view>
<view class="style_round flex-cc">
<view class="line"></view>
<view class="round"></view>
</view>
</view>
<block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="index">
<block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="index" wx:key="{{item.id}}" >
<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:item.unit?'/'+item.unit:''}}</view>
{{item.count}}
<view wx:for="{{item.norms}}" wx:for-index="idx" wx:key="{{item.id}}" class="normsBox">
<view class="content">
<view class="single" style="color: rgba({{textColor}});">{{item.cookName}}<text wx:if="{{item.name}}">({{item.name}})</text></view>
<view class="onwBoxWrap">
<view class="oneBox" style="color: rgba({{textColor}});" wx:for="{{item.specArr}}" wx:key="{{item.id}}">
<view wx:if="{{item.str}}">{{item.str}}</view>
<view wx:if="{{item.member_str}}">{{item.member_str}}</view>
</view>
</view>
</view>
<view class="dishTexts" style="color:rgba({{textColor}})">
<text wx:if="{{item.taste}}" class="texts">味型:{{item.taste}}</text>
<text wx:if="{{item.cooks}}">烹调:{{item.cooks}}</text>
</view>
<view class="imgOneBox">
<image wx:if="{{item.image}}" catch:tap="preview" style="height: {{item.imageHeight>height?height+'px':item.imageHeight+'px'}};width: {{item.imageHeight>height?'':item.imageHeight==height?'100%':'100%'}}" mode="{{(item.imageHeight>height || item.imageHeight==height)?'aspectFit':''}}" src="{{item.image}}" bindload="imageLoad" data-item="{{item}}" data-index="{{index}}" data-indexs="{{indexs}}" data-idx="{{idx}}" />
</view>
</view>
</block>
</block>
</block>
</view>
<view style="background-color: #fff;margin:0 20rpx;padding-top: 20rpx;">
<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>
... ... @@ -46,7 +67,7 @@
<view class="poop font24r">根据您选择的菜品,我们推荐您参加以下活动,本次消费可用,预计可以节约大笔开销!</view>
<view class="preferential" wx:if="{{rechargeList.length>0}}">
<!-- 当前日期要大于限制结束日期 -->
<view class="preferentialItems" wx:for="{{rechargeList}}" data-id="{{item.id}}">
<view class="preferentialItems" wx:for="{{rechargeList}}" wx:key="{{item.id}}">
<view class="left">
<view class="top">
<text>{{item.rname}}</text>
... ... @@ -74,6 +95,9 @@
</view>
</view>
</view>
<view class="textsInfo font28r" style="color: rgba({{textsInfoColor}});">
周到安排提供技术支持 400-000-9690
</view>
</scroll-view>
<view class="btns flex-cc" wx:if="{{options.hasSuccess==1}}">
<button class="font32r continue flex-cc" style="background: rgba({{themeColor}});color: rgba({{textColor}});" bindtap="continueOrdering">菜品更换</button>
... ...
/* pack-cookbook/pages/success_new.wxss */
.main {
padding: 0 20rpx 148rpx 20rpx;
font-family: PingFang SC;
width: 100%;
box-sizing: border-box;
padding-bottom: 136rpx;
}
.info {
... ... @@ -30,39 +30,21 @@
font-size: 28rpx;
}
.line {
margin-bottom: 8rpx;
height: 2rpx;
background: #999999;
}
.checkMenu {
padding-bottom: 34rpx;
border-radius: 10rpx;
background: #ffffff;
border-bottom: 4rpx solid #dbdbdb;
margin: 0 20rpx 0 20rpx;
font-family: PingFang SC;
}
.title {
padding: 36rpx 0 4rpx 0;
margin: 0 40rpx;
border-bottom: 2rpx solid #DBDBDB;
}
.leftTitle {
color: #515151;
font-family: PingFang SC;
font-weight: 600;
font-size: 32rpx;
}
.rightTitle {
color: #515151;
font-family: PingFang SC;
font-size: 28rpx;
}
.content {
padding: 20rpx 40rpx;
.title view{
display: inline-block;
margin-left: 20px;
}
.count text {
... ... @@ -82,8 +64,10 @@
.probably {
color: #000;
background: #fff;
font-family: PingFang SC;
padding: 30rpx 40rpx 52rpx 40rpx;
margin: 0 20rpx;
}
.tariff {
... ... @@ -107,9 +91,11 @@
}
.information {
background: #fff;
color: #515151;
font-weight: 500;
margin: 0 40rpx;
padding: 0 40rpx;
margin: 0 20rpx;
}
.continue {
... ... @@ -119,11 +105,17 @@
.box {
position: relative;
padding: 0 20rpx 0 20rpx;
font-family: PingFang SC;
width: 100%;
box-sizing: border-box;
}
.poop {
margin: 20rpx 40rpx;
background: #fff;
padding: 20rpx 40rpx;
text-indent: 50rpx;
margin: 0 20rpx;
}
.imgs {
... ... @@ -151,7 +143,9 @@
}
.preferential {
margin: 16rpx 40rpx;
padding: 40rpx;
background-color: #fff;
margin: 0 20rpx;
}
.preferentialItems {
... ... @@ -177,7 +171,6 @@
.bottom {
margin-top: 20rpx;
color: #515151;
font-family: PingFang SC;
font-weight: 500;
font-size: 20rpx;
... ... @@ -211,18 +204,104 @@
}
.favouredPolicy{
background: #fff;
display: flex;
justify-content: flex-end;
margin-right: 60rpx;
padding: 0 60rpx 116rpx 0;
margin: 0 20rpx;
}
.textsInfo{
width: 100%;
height: 68rpx;
line-height: 68rpx;
display: flex;
align-items: center;
justify-content: center;
}
.policy{
width: 50%;
color: #999999;
font-family: PingFang SC;
font-weight: 500;
border: 2rpx solid #0244a4;
border-radius: 22rpx;
text-align: center;
padding: 10rpx;
}
.heand {
width: 100%;
border: 4rpx solid #dbdbdb;
box-sizing: border-box;
}
.heand .style_round {
width: 160rpx;
}
.style_round .round {
width: 8rpx;
height: 8rpx;
background: #dbdbdb;
border-radius: 50%;
}
.heand .title {
color: #fff;
padding: 10rpx 0;
}
.style_round .line {
width: 100rpx;
height: 2rpx;
background: #dbdbdb;
}
.imgOneBox{
width: 100%;
display: flex;
justify-content: center;
}
.normsBox{
display: flex;
flex-direction: column;
border-left: 4rpx solid #dbdbdb;
border-right: 4rpx solid #dbdbdb;
padding-bottom: 20rpx;
}
.single {
padding: 0 20rpx 0 0;
font-family: PingFang SC;
font-weight: 500;
font-size: 36rpx;
}
.onwBoxWrap{
display: flex;
flex-direction: column;
}
.oneBox {
display: flex;
margin-right: 20rpx;
}
.content {
padding: 40rpx 0 20rpx 20rpx;
display: flex;
justify-content: space-between;
}
.dishTexts {
padding: 0 40rpx 30rpx 20rpx;
color: #000;
font-family: PingFang SC;
font-weight: 500;
font-size: 40rpx;
width: 100%;
font-family: PingFang SC;
font-weight: 500;
font-size: 28rpx;
}
.dishTexts .texts {
margin-right: 30rpx;
}
\ No newline at end of file
... ...