master
wbb 2 years ago
parent 56646892c7
commit 3602f7d731

@ -9,7 +9,8 @@
"pages/detail/detail",
"pages/searchShow/searchShow",
"pages/change/change",
"pages/answer/answer"
"pages/answer/answer",
"pages/orderdoing/orderdoing"
],
"tabBar": {

@ -1,11 +1,18 @@
// pages/cart/cart.js
const db = wx.cloud.database({});
Page({
/**
* 页面的初始数据
*/
data: {
cartlist:[]
cartlistsee:[]
},
async f() {
const res = await db.collection('user').doc('eda7dd506371adb300c89bc66afc4601').get();
console.log(res);
},
/**
@ -18,7 +25,7 @@ Page({
env: 'cloud1-8g5wmepxce8a3b8a'
})
//2、开始查询数据了 news对应的是集合的名称
db.collection('user').doc('aa9355ef636df7cc004ab37533cb2c96').get({
db.collection('user').doc('eda7dd506371adb300c89bc66afc4601').get({
//如果查询成功的话
success: res => {
console.log(res.data)

@ -1,2 +1,2 @@
<!--pages/cart/cart.wxml-->
<view>{{cartlist.cartlist}}</view>
<view catchtap="f">测试</view>

@ -35,7 +35,7 @@ Page({
// 渲染数据
async addCar(event) {
var detailObj= event.currentTarget.dataset.item;
db.collection('user').doc('aa9355ef636df7cc004ab37533cb2c96').update({
db.collection('user').doc('eda7dd506371adb300c89bc66afc4601').update({
data:{
cartlist:db.command.push(detailObj)
}
@ -46,9 +46,13 @@ async addCar(event) {
duration: 2000
})
},
async immeBuy(event){
var index = event.currentTarget.dataset.item;
console.log(index);
wx.navigateTo({
url:'/pages/orderdoing/orderdoing?id='+ index,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

@ -16,5 +16,5 @@
<view class="separate"></view>
<view class="detail-nav" >
<button class="button-green" catchtap="addCar" formType="submit" data-item="{{detailObj}}">加入购物车</button>
<button class="button-red" bindtap="immeBuy" formType="submit">立即购买</button>
<button class="button-red" bindtap="immeBuy" data-item="{{detailObj._id}}" formType="submit">立即购买</button>
</view>

@ -0,0 +1,77 @@
// pages/orderdoing/orderdoing.js
const db = wx.cloud.database({});
const cont = db.collection('food');
Page({
/**
* 页面的初始数据
*/
data: {
orderfood:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad:function(options) {
let foodid =options.id
cont.doc(foodid).get({
success: res => {
console.log(res.data)
//这一步很重要给ne赋值没有这一步的话前台就不会显示值
this.setData({
orderfood: res.data
})
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

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

@ -0,0 +1,6 @@
<view>干饭地址:</view>
<image src="{{orderfood.url}}"></image>
<view>{{orderfood.food_name}}</view>
<button bindtap="primary" style="background-color: rgb(253, 228, 84);">立即支付</button>

@ -0,0 +1 @@
/* pages/orderdoing/orderdoing.wxss */

@ -0,0 +1,66 @@
// pages/usercenter/usercenter.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,58 @@
<view class="view_contain">
<!-- 第一部分 -->
<view class="view_1">
<view class="view_image_text">
<image class="image_radius" src="../images/timg.png" />
<text>张三</text>
</view>
</view>
<!-- 第二部分 -->
<view class="view_2">
<view class="view_tupianwenzi">
<image class="image_tupian" src="../images/test1.png"></image>
<text class="text_saoyisao">待付款</text>
</view>
<view class="view_tupianwenzi">
<image class="image_tupian" src="../images/test2.png"></image>
<text class="text_saoyisao">待发货</text>
</view>
<view class="view_tupianwenzi">
<image class="image_tupian" src="../images/test3.png"></image>
<text class="text_saoyisao">待收货</text>
</view>
<view class="view_tupianwenzi">
<image class="image_tupian" src="../images/test4.png"></image>
<text class="text_saoyisao">待评价</text>
</view>
</view>
<!-- 第三部分 -->
<view class="view_3">
<view class="list-item">
<image class="item-image" src="../images/test5.png"></image>
<text class="item-text">我的收藏</text>
<image class="image-jiantou" src="../images/jiantou.png"></image>
</view>
<view class="line"></view>
<view class="list-item">
<image class="item-image" src="../images/test6.png"></image>
<text class="item-text">我的评价</text>
<image class="image-jiantou" src="../images/jiantou.png"></image>
</view>
<view class="line"></view>
<view class="line"></view>
<view class="list-item">
<image class="item-image" src="../images/test9.png"></image>
<text class="item-text">售后记录</text>
<image class="image-jiantou" src="../images/jiantou.png"></image>
</view>
<view class="line"></view>
<view class="list-item">
<image class="item-image" src="../images/test12.png"></image>
<text class="item-text">分享邀请</text>
<image class="image-jiantou" src="../images/jiantou.png"></image>
</view>
<view class="line"></view>
</view>
</view>

@ -1,83 +1,110 @@
/* pages/mine/mine.wxss */
.userinfo {
display: flex;
flex-direction: column;
align-items: center;
background: #eb6161;
page {
width: 100%;
height: 300rpx;
height: 100%;
}
.userinfo-avatar {
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
.view_contain {
width: 100%;
height: 100%;
background: #f0eeed
}
.userinfo-nickname {
color: black;
/* 第一部分 */
.view_1 {
display: flex;
justify-content: center;
width: 100%;
height: 25%;
background: #a0deee;
}
.header {
margin: 90rpx 0 90rpx 50rpx;
border-bottom: 1px solid #ccc;
text-align: center;
width: 650rpx;
height: 300rpx;
line-height: 450rpx;
.view_image_text {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.header image {
width: 200rpx;
height: 200rpx;
.image_radius {
height: 50px;
width: 50px;
border-radius: 30px;
}
.content {
margin-left: 50rpx;
margin-bottom: 90rpx;
/* 第二部分 */
.view_2 {
width: 100%;
height: 15%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
background: white;
}
.content text {
display: block;
color: #9d9d9d;
margin-top: 40rpx;
.view_tupianwenzi {
display: flex;
flex-direction: column;
width: 120rpx;
align-items: center;
margin-left: 25rpx;
margin-right: 25rpx;
}
.bottom {
border-radius: 80rpx;
margin: 70rpx 50rpx;
font-size: 35rpx;
.image_tupian {
display: flex;
width: 100rpx;
height: 100rpx;
}
/* 用户中心 */
/* 第三部分 */
.hr {
.view_3 {
width: 100%;
height: 15px;
background-color: #f4f5f6;
height: 50%;
/* background: #f0eeed; */
}
.item {
.list-item {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
height: 80rpx;
margin-top: 20rpx;
position: relative; /*父元素位置要设置为相对*/
background: white;
}
.title {
padding-top: 15px;
padding-bottom: 15px;
padding-left: 15px;
font-size: 15px;
.item-image {
width: 50rpx;
height: 50rpx;
margin: 20rpx;
}
.detail2 {
font-size: 15px;
position: absolute;
right: 10px;
height: 50px;
line-height: 50px;
color: #888;
.item-text {
color: gray;
font-size: 35rpx;
margin-left: 20rpx;
}
.image-jiantou {
width: 20rpx;
height: 35rpx;
position: absolute; /* 要约束所在位置的子元素的位置要设置成绝对 */
right: 0; /* 靠右调节 */
margin-right: 35rpx;
}
/* 黑线 使得产生阴影效果 */
.line {
border: 1px solid #ccc;
opacity: 0.2;
width: 100%;
height: 3rpx;
background: lightgray;
margin-left: 90rpx;
}

Loading…
Cancel
Save