//index.js
var app = getApp()
Page({
data: {
pageType: 1,
// index
userInfo: {},
open: false, //是否打开红包
page: true, //红包是否显示
orderOrBusiness: 'order',
newsarr: [
{ id: 0, message: "本店新用户立减1元(在线支付专享)" },
{ id: 1, message: "本店新用户立减2元(在线支付专享)" },
{ id: 2, message: "本店新用户立减3元(在线支付专享)" },
{ id: 3, message: "本店新用户立减4元(在线支付专享)" },
{ id: 4, message: "本店新用户立减5元(在线支付专享)" }
],
autoplay: true,
interval: 3000,
duration: 500,
vertical: true,
circular: true,
menu: [
{ id: 0, name: "热销" },
{ id: 1, name: "新品" },
{ id: 2, name: "下午茶" },
{ id: 3, name: "滋味盖饭" },
{ id: 4, name: "日式小食" },
{ id: 5, name: "系列套餐" },
{ id: 6, name: "特色炖汤" },
{ id: 7, name: "下午茶" },
{ id: 8, name: "日式小食" },
{ id: 9, name: "滋味盖饭" },
{ id: 10, name: "系列套餐" },
],
arr2: [
{ id: 0, value: "香辣味" },
{ id: 1, value: "盐焗味" },
{ id: 2, value: "蒜香味" },
{ id: 3, value: "姜葱味" },
],
height: 0,
orderType: 0, //点菜类型
restaurant: false, //餐厅点菜
map_address: '',
buycar_num: 0,
block: false, //选规格
foodtype: 0, //选规格种类
bindId: 0,
// buycar
totalMoney: 0,
chooseAll: false,
arr: [
{ id: 0, img: "../../img/food2.jpg", name: "五花肉石锅拌饭", num: "3", price: "51.21", selected: false },
{ id: 1, img: "../../img/food2.jpg", name: "五花肉石锅拌饭", num: "3", price: "61", selected: false },
{ id: 2, img: "../../img/food2.jpg", name: "五花肉石锅拌饭", num: "3", price: "71", selected: false },
{ id: 3, img: "../../img/food2.jpg", name: "五花肉石锅拌饭", num: "3", price: "81", selected: false },
{ id: 4, img: "../../img/food2.jpg", name: "五花肉石锅拌饭", num: "3", price: "81", selected: false }
],
arr3: [
{ id: 0, img: "../../img/food2.jpg", name: "五花肉石锅拌饭", num: "0", price: "51", message: "配米饭一份哦", message2: "月售330|好评率100%", message3: [{ id: 0, value: "香辣味" }, { id: 1, value: "盐焗味" }, { id: 2, value: "蒜香味" }, { id: 3, value: "姜葱味" },] },
{ id: 1, img: "../../img/food2.jpg", name: "五花肉石锅拌饭", num: "0", price: "51", message: "配米饭一份哦", message2: "月售330|好评率100%", message3: '' },
{ id: 2, img: "../../img/food2.jpg", name: "五花肉石锅拌饭", num: "0", price: "51", message: "配米饭一份哦", message2: "月售330|好评率100%", message3: [{ id: 0, value: "香辣味2" }, { id: 1, value: "盐焗味2" }, { id: 2, value: "蒜香味2" }, { id: 3, value: "姜葱味2" },] },
{ id: 3, img: "../../img/food2.jpg", name: "五花肉石锅拌饭", num: "0", price: "51", message: "配米饭一份哦", message2: "月售330|好评率100%", message3: [{ id: 0, value: "香辣味3" }, { id: 1, value: "盐焗味3" }, { id: 2, value: "蒜香味3" }, { id: 3, value: "姜葱味3" },] },
{ id: 4, img: "../../img/food2.jpg", name: "五花肉石锅拌饭", num: "0", price: "51", message: "配米饭一份哦", message2: "月售330|好评率100%", message3: [{ id: 0, value: "香辣味4" }, { id: 1, value: "盐焗味4" }, { id: 2, value: "蒜香味4" }, { id: 3, value: "姜葱味4" },] },
],
// order
orderOk: false,
// me
img: ''
},
onLoad: function () {
var that = this
wx.getLocation({
type: 'gcj02',
success: function (res) {
var latitude = res.latitude
var longitude = res.longitude
wx.request({
url: 'http://api.map.baidu.com/geocoder/v2/?ak=LClVsCTaW2aH8MzuviP1YMymrHWOIVvg&coordtype=gcj02ll&location=' + latitude + ',' + longitude + '&output=json&pois=0',
method: "get",
success: function (res) {
var address = res.data.result.formatted_address;
address = address.split('省')[1].split('市')[1];
that.setData({
map_address: address
})
console.log(that.data.map_address)
}
})
}
})
app.getUserInfo(function (userInfo) {
that.setData({
userInfo: userInfo,
img: userInfo.avatarUrl
})
})
wx.getSystemInfo({
success: function (res) {
that.setData({
height: (res.windowHeight*.57)+'px'
})
}
});
},
turnMenu: function(e) {
var type = e.target.dataset.index;
console.log(type)
this.setData({
orderType: type
})
},
chooseType: function (e) {
var type = e.currentTarget.dataset.id;
if (type == 1 && this.data.restaurant == true) {
wx.setNavigationBarTitle({ title: '点餐' })
} else if (type == 1 && this.data.restaurant != true) {
wx.setNavigationBarTitle({ title: '外卖' })
} else if (type == 2) {
wx.setNavigationBarTitle({ title: '购物车' })
} else if (type == 3) {
wx.setNavigationBarTitle({ title: '订单' })
} else if (type == 4) {
wx.setNavigationBarTitle({ title: '我的' })
}
this.setData({
pageType: type
})
},
// index
searchKey: function(e) {
this.setData({
searchKey: e.detail.value
})
},
searchBtn: function() {
var keyWork = this.data.searchKey;
wx.redirectTo({
url: '../test/test',
})
wx.request({
url: '',
data: {
},
success: function (res) {
}
})
},
tabChange: function(e) {
var type = e.currentTarget.dataset.id;
this.setData({
orderOrBusiness: type
})
},
//打开红包
getPag: function() {
this.setData({
open: true,
page: false
})
},
//关闭红包
hasGet: function () {
this.setData({
open: false
})
},
toSetmenu: function() {
wx.navigateTo({
url: '../setmenu/setmenu'
})
},
saoma: function() {
var that = this;
wx.scanCode({
onlyFromCamera: true,
success: (res) => {
console.log(res);
that.setData({
restaurant: true
})
wx.setNavigationBarTitle({ title: '点餐' })
},
fail: (res) => {
that.setData({
restaurant: false
});
}
})
},
toFoodDetail: function() {
wx.navigateTo({
url: '../detail/detail',
})
},
reduce: function (e) {
var i = e.currentTarget.dataset.id;
var arr3 = this.data.arr3;
if (arr3[i].num > 1) {
wx.showToast({
title: '多规格商品只能去购物车删除哦',
duration: 2000
})
}else{
if (arr3[i].num > 0) {
arr3[i].num = parseInt(arr3[i].num) - 1;
this.setData({
arr3: arr3
})
}
}
},
reduce2: function (e) {
var i = e.currentTarget.dataset.id;
var arr3 = this.data.arr3;
if (arr3[i].num > 0) {
arr3[i].num = parseInt(arr3[i].num) - 1;
this.setData({
arr3: arr3
})
}
},
add: function (e) {
var i = e.currentTarget.dataset.id;
var arr3 = this.data.arr3;
var arr = arr3[i].message3;
this.setData({
block: true,
arr2: arr,
bindId: i
})
},
add2: function (e) {
var i = e.currentTarget.dataset.id;
var arr3 = this.data.arr3;
arr3[i].num = parseInt(arr3[i].num) + 1;
this.setData({
arr3: arr3
})
},
close: function () {
this.setData({
block: false
})
},
resetNum: function (e) {
var type = e.currentTarget.dataset.id;
this.setData({
foodtype: type
})
},
submit: function() {
var i = this.data.bindId;
var arr3 = this.data.arr3;
没有合适的资源?快使用搜索试试~ 我知道了~
微信小程序精选源码亲测可用_仿美团外卖.zip
共204个文件
js:38个
png:36个
wxss:34个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 85 浏览量
2023-07-09
13:20:55
上传
评论
收藏 509KB ZIP 举报
温馨提示
微信小程序精选源码亲测可用_仿美团外卖.zip
资源推荐
资源详情
资源评论
收起资源包目录
微信小程序精选源码亲测可用_仿美团外卖.zip (204个子文件)
._addAddress 222B
._address 222B
._allEvaluate 222B
._applyRefund 222B
._detail 222B
._editAddress 222B
._evaluate 222B
._img 222B
._index 222B
._logs 222B
._myPackage 222B
._orderDetail 222B
._orderMap 222B
._pages 222B
._refundDetail 222B
._search 222B
._submitOrder 222B
._test 222B
._utils 222B
food.jpg 104KB
food2.jpg 64KB
1.jpg 44KB
2.jpg 42KB
3.jpg 32KB
me.jpg 31KB
5.jpg 15KB
._food.jpg 222B
._food2.jpg 222B
._me.jpg 222B
index.js 12KB
qqmap-wx-jssdk.min.js 6KB
applyRefund.js 4KB
orderDetail.js 3KB
evaluate.js 2KB
search.js 2KB
detail.js 2KB
test.js 2KB
addAddress.js 2KB
orderMap.js 1KB
submitOrder.js 1KB
editAddress.js 1KB
address.js 1KB
app.js 912B
logs.js 859B
myPackage.js 850B
util.js 460B
._evaluate.js 222B
._detail.js 222B
._applyRefund.js 222B
._addAddress.js 222B
._index.js 222B
._myPackage.js 222B
._refundDetail.js 222B
._allEvaluate.js 222B
._submitOrder.js 222B
._editAddress.js 222B
._orderDetail.js 222B
._logs.js 222B
._orderMap.js 222B
._search.js 222B
._test.js 222B
._address.js 222B
._util.js 222B
._app.js 222B
._qqmap-wx-jssdk.min.js 222B
refundDetail.js 99B
allEvaluate.js 12B
app.json 690B
._detail.json 222B
._evaluate.json 222B
._applyRefund.json 222B
._refundDetail.json 222B
._myPackage.json 222B
._addAddress.json 222B
._editAddress.json 222B
._index.json 222B
._submitOrder.json 222B
._allEvaluate.json 222B
._orderMap.json 222B
._search.json 222B
._orderDetail.json 222B
._logs.json 222B
._test.json 222B
._address.json 222B
._app.json 222B
addAddress.json 52B
refundDetail.json 46B
applyRefund.json 46B
detail.json 46B
myPackage.json 46B
submitOrder.json 46B
allEvaluate.json 46B
editAddress.json 46B
orderMap.json 46B
orderDetail.json 46B
address.json 46B
evaluate.json 40B
index.json 6B
test.json 6B
search.json 2B
共 204 条
- 1
- 2
- 3
资源评论
HappyGirl快乐女孩
- 粉丝: 1w+
- 资源: 4156
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功