# Conflicts:
#	scr/food/app.json
master
wbb 2 years ago
commit 170d0265f0

@ -10,10 +10,12 @@
"pages/searchShow/searchShow",
"pages/change/change",
"pages/answer/answer",
"pages/orderdoing/orderdoing",
"pages/pay/pay",
"pages/orderdoing/orderdoing",
"pages/address/address",
"pages/turning/turning",
"pages/addAddress/addAddress"
],
"tabBar": {
"custom": false,

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 KiB

@ -84,6 +84,11 @@ setChecked: function() {
}
}}},
topay: function(){
wx.navigateTo({
url:'/pages/pay/pay',
})
},
// 添加按钮被点击
addButtonClick: function(event) {

@ -31,8 +31,11 @@
<checkbox value="{{item.food_name}}" checked="{{checked}}" style='margin-left:20rpx;' bindtap='setChecked' />
<text>全选</text>
</view>
<text class='heji'>合计:<text class='all_shop_price'>¥{{total_all_price}}</text></text>
<view class='jiesuan' bindtap="toBuy">
<view class='heji'>
<text class='price'>合计:</text>
<text class='all_shop_price'>¥{{total_all_price}}</text>
</view>
<view class='jiesuan' bindtap="topay">
<text>结算</text>
</view>
</view>

@ -189,8 +189,12 @@ checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
.heji {
/* margin-left: 140px; */
float: right;
/* float: right;
margin-right: 75px;
display: inline; */
flex-flow: row;
justify-content: flex-start;
display: flex;
}
/*合计价格的样式*/

@ -9,10 +9,17 @@
</view>
<view class="separate"></view>
<!-- sku选择 -->
<text bindtap="toggleDialog">请选择购买数量</text>
<view class="a">
<text bindtap="toggleDialog" >请选择购买数量</text>
<view class="separate"></view>
<text class="separate" decode="{{true}}">&emsp;</text>
<view class="separate"></view>
<text>商品评价:东西还可以,好评~</text>
<view class="separate"></view>
<text>商品评价</text>
<text class="text-remark">东西还可以,好评~</text>
</view>
<view class="separate"></view>
<view class="detail-nav" >
<button class="button-green" catchtap="addCar" formType="submit" data-item="{{detailObj}}" data-userid="{userid}">加入购物车</button>

@ -8,7 +8,7 @@ page {
display: flex;
flex-direction: column;
margin-top: 15rpx;
margin-bottom: 0rpx;
margin-bottom: 15rpx;
}
.detail .title {
font-size: 40rpx;
@ -29,7 +29,12 @@ page {
text-align: center;
}
text{
.a {
border-bottom: 1px solid #ccc;
font-size: 30rpx;
margin: 10rpx;
color: black;
text-align: center;
border-top: 1px solid #ccc;
}

@ -8,7 +8,7 @@ Page({
*/
data: {
foodlist:[],
tabs: ['主食', '甜品', '小吃','吃得快','辣','甜','清淡'],
tabs: ['主食', '甜品', '小吃','吃得快','辣','甜','清淡'],
cateList:[],
index:null
},
@ -115,6 +115,11 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
toturning: function(){
wx.navigateTo({
url:'/pages/turning/turning',
})
}
})

@ -7,7 +7,7 @@
<image src="/images/perfer.jpg" style="width:440px" class="in-select" mode="widthFix"></image>
</navigator>
<navigator class="imagesize">
<image src="/images/zhuanpang.jpg" style="width:440px" class="in-select" mode="widthFix"></image>
<image src="/images/zhuanpang.jpg" style="width:440px" class="in-select" mode="widthFix" bindtap="toturning"></image>
</navigator>
<view class="divLine"></view>

@ -13,7 +13,7 @@ page {
.navbar {
width: 100%;
width: 800rpx;
height: 90rpx;
/* 文本不换行 */
white-space: nowrap;
@ -25,6 +25,7 @@ page {
/* 固定在顶部 */
}
.nav-item {
line-height: 60rpx;
background-color: #f7f7f7;
padding-left: 25rpx;

@ -73,5 +73,10 @@ Page({
*/
onShareAppMessage() {
}
},
topay: function(){
wx.navigateTo({
url:'/pages/pay/pay',
})
},
})

@ -3,4 +3,4 @@
<image src="{{orderfood.url}}"></image>
<view>{{orderfood.food_name}}</view>
<button bindtap="primary" style="background-color: rgb(253, 228, 84);">立即支付</button>
<button bindtap="primary" style="background-color: rgb(253, 228, 84);" bindtap="topay">立即支付</button>

@ -0,0 +1,109 @@
//turning.js
//获取应用实例
let animation = wx.createAnimation({
duration: 2000,
timingFunction: 'linear'
})
const app=getApp()
const userid=app.globalData.openid
Page({
data: {
rotate: 0, //度数
list:[],
turning: false //是否点击
},
//事件处理函数
start: function() {
let _this = this;
let cat = 60;
if (!this.data.turning) {
let rdm = 0; //随机度数
rdm = Math.floor(Math.random() * 3600); //最大10圈
//rdm = 1200;//直接确定转的度数
animation.rotate(rdm).step();
this.setData({
rotate: animation.export(),
turning: true
});
setTimeout(() => {
this.setData({
turning: false
});
let num = rdm % 360; //转了多少度
//console.log(num);
function showModal(str) {
wx.showModal({
title: '提示',
content: str,
success: function() { //点击确定后还原到0度
let animation = wx.createAnimation({
duration: 100,
timingFunction: 'linear'
});
animation.rotate(0).step();
_this.setData({
rotate: animation.export(),
turning: false
});
wx.redirectTo({
url:'/pages/pay/pay',
})
},
fail: function(res) {
console.log(res)
}
})
}
/* if (num <= cat * 0.5 && num>=cat*0 || num>=cat*5.5 ) {
showModal('今天就吃自选餐吧不要再想了GOGO');
}else if (num <= cat * 1.5 && num >= cat * 0.5) {
showModal('今天就吃麻辣烫吧不要再想了GOGO');
} else if (num <= cat * 2.5 && num >= cat * 1.5) {
showModal('今天就吃汉堡炸鸡吧不要再想了GOGO');
} else if (num <= cat * 3.5 && num >= cat * 2.5) {
showModal('今天就吃面食吧不要再想了GOGO');
} else if (num <= cat * 4.5 && num >= cat * 3.5) {
showModal('今天就吃烤盘饭吧不要再想了GOGO');
} else if (num <= cat * 5.5 && num >= cat * 4.5) {
showModal('今天就吃煎饼果子吧不要再想了GOGO');
} */
console.log(num)
var a= wx.getStorageSync('i')
console.log(a)
showModal('今天吃'+a)
}, 2000)
}
},
onLoad: function() {
const db=wx.cloud.database()
var that=this
db.collection("user")
.where({
"_openid":userid
})
.get({
success: (res) => {
console.log('请求成功',res);
var o=res.data[0].cartlist.length-1
console.log(o)
var p=Math.round(Math.random()*o)
console.log(p)
that.setData({
list:res.data[0].cartlist[p].food_name
})
console.log('请求成功2',res.data[0].cartlist[p].food_name);
wx.setStorageSync('i', res.data[0].cartlist[p].food_name)
},
fail(err) {
console.log("请求失败", err)
}
})
},
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1,16 @@
<!--turning.wxml-->
<view class="container">
<image src='/images/bg_2.png' class="bg_2"></image>
<image src='/images/start.png' animation="{{rotate}}" bindtap="start" class="start"></image>
<view class="detail">自选餐</view>
<view class="detail">麻辣烫</view>
<view class="detail">汉堡炸鸡</view>
<view class="detail">面食</view>
<view class="detail">烤盘饭</view>
<view class="detail">煎饼果子</view>
<view class="btnView">
<button class="btn1" type="warn" plain="true">加入购物车</button>
</view>
</view>

@ -0,0 +1,76 @@
/**index.wxss**/
.container view{
width: 100px;
height: 100px;
text-align: center;
line-height: 100px;
}
.bg_2{
width: 600rpx;
height: 600rpx;
position: absolute;
top: 80rpx;
}
.start{
width: 134rpx;
height: 163rpx;
position: absolute;
top: 280rpx;
}
.detail{
position: absolute;
}
/* 自选餐 */
.container>.detail:nth-child(3){
font-size: 20px;
top:35px;left:125px;
width: 70px; height: 20px;
font-weight:bold;
color: rgb(3, 10, 32);
}
/* 麻辣烫 */
.container>.detail:nth-child(4){
font-size: 20px;
top:75px;left:185px;
width: 70px; height: 20px;
font-weight:bold;
color: rgb(0, 0, 0);
}
/* 炸鸡汉堡 */
.container>.detail:nth-child(5){
font-size: 20px;
top:145px;left:180px;
width: 80px; height: 20px;
font-weight:bold;
color: rgb(2, 3, 7);
}
/* 面食 */
.container>.detail:nth-child(6){
font-size: 20px;
top:180px;left:125px;
width: 70px; height: 20px;
font-weight:bold;
color: rgb(0, 4, 15);
}
/* 烤盘饭 */
.container>.detail:nth-child(7){
font-size: 20px;
top: 145px;left:65px;
width: 70px; height: 20px;
font-weight:bold;
color: rgb(0, 3, 12);
}
/* 煎饼果子 */
.container>.detail:nth-child(8){
font-size: 20px;
top:80px;left:60px;
width: 80px; height: 20px;
font-weight:bold;
color: rgb(0, 2, 7);
}
.container>.btnView>.btn1{
top:350px;left:-40px;
}
Loading…
Cancel
Save