浏览代码

连接口

zs 2 年之前
父节点
当前提交
820aa4bc30
共有 34 个文件被更改,包括 34092 次插入12596 次删除
  1. 1 1
      common/config.js
  2. 66 129
      pagesHome/home/index.vue
  3. 22 107
      pagesHome/order/add.vue
  4. 48 109
      pagesHome/order/index.vue
  5. 36 112
      pagesHome/order/info.vue
  6. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map
  7. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/common/runtime.js.map
  8. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map
  9. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/index/index.js.map
  10. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/home/index.js.map
  11. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/order/add.js.map
  12. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/order/index.js.map
  13. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/order/info.js.map
  14. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-badge/components/uni-badge/uni-badge.js.map
  15. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-icons/components/uni-icons/uni-icons.js.map
  16. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.js.map
  17. 1 0
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.js.map
  18. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-popup/components/uni-popup/uni-popup.js.map
  19. 2 2
      unpackage/dist/dev/mp-weixin/common/runtime.js
  20. 33167 11553
      unpackage/dist/dev/mp-weixin/common/vendor.js
  21. 86 149
      unpackage/dist/dev/mp-weixin/pagesHome/home/index.js
  22. 1 1
      unpackage/dist/dev/mp-weixin/pagesHome/home/index.wxml
  23. 31 110
      unpackage/dist/dev/mp-weixin/pagesHome/order/add.js
  24. 3 1
      unpackage/dist/dev/mp-weixin/pagesHome/order/add.json
  25. 1 1
      unpackage/dist/dev/mp-weixin/pagesHome/order/add.wxml
  26. 134 195
      unpackage/dist/dev/mp-weixin/pagesHome/order/index.js
  27. 1 1
      unpackage/dist/dev/mp-weixin/pagesHome/order/index.wxml
  28. 61 111
      unpackage/dist/dev/mp-weixin/pagesHome/order/info.js
  29. 4 1
      unpackage/dist/dev/mp-weixin/pagesHome/order/info.json
  30. 1 1
      unpackage/dist/dev/mp-weixin/pagesHome/order/info.wxml
  31. 327 0
      unpackage/dist/dev/mp-weixin/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.js
  32. 4 0
      unpackage/dist/dev/mp-weixin/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.json
  33. 1 0
      unpackage/dist/dev/mp-weixin/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.wxml
  34. 82 0
      unpackage/dist/dev/mp-weixin/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.wxss

+ 1 - 1
common/config.js

@@ -1,6 +1,6 @@
 export default {
 export default {
 	// 接口地址
 	// 接口地址
-	serverUrl: "https://broadcast.waityou24.cn",
+	serverUrl: "http://192.168.1.113:10102",
 	wechatUrl: "https://broadcast.waityou24.cn",
 	wechatUrl: "https://broadcast.waityou24.cn",
 	// 设备信息
 	// 设备信息
 	system: uni.getSystemInfoSync(),
 	system: uni.getSystemInfoSync(),

+ 66 - 129
pagesHome/home/index.vue

@@ -28,7 +28,8 @@
 					</view>
 					</view>
 				</view>
 				</view>
 				<view class="one_3">
 				<view class="one_3">
-					<image :src="shopInfo.logo" mode="scaleToFill"></image>
+					<image :src="shopInfo.logo&&shopInfo.logo.length>0?shopInfo.logo[0].url:''" mode="scaleToFill">
+					</image>
 				</view>
 				</view>
 			</view>
 			</view>
 			<view class="two">
 			<view class="two">
@@ -51,7 +52,8 @@
 							<view class="theme">{{tags.name}}</view>
 							<view class="theme">{{tags.name}}</view>
 							<view class="list" v-for="(tag,index) in marketList" :key="index">
 							<view class="list" v-for="(tag,index) in marketList" :key="index">
 								<view class="img">
 								<view class="img">
-									<image class="image" :src="tag.file" mode=""></image>
+									<image class="image" :src="tag.file&&tag.file.length>0?tag.file[0].url:''" mode="">
+									</image>
 								</view>
 								</view>
 								<view class="info">
 								<view class="info">
 									<view class="name textOver">
 									<view class="name textOver">
@@ -102,7 +104,8 @@
 						<view class="list-scroll-view">
 						<view class="list-scroll-view">
 							<view class="list" v-for="(tag,index) in buyList" :key="index">
 							<view class="list" v-for="(tag,index) in buyList" :key="index">
 								<view class="img">
 								<view class="img">
-									<image class="image" :src="tag.file" mode=""></image>
+									<image class="image" :src="tag.file&&tag.file.length>0?tag.file[0].url:''" mode="">
+									</image>
 								</view>
 								</view>
 								<view class="info">
 								<view class="info">
 									<view class="name textOver">
 									<view class="name textOver">
@@ -131,101 +134,8 @@
 		data() {
 		data() {
 			return {
 			return {
 				id: '',
 				id: '',
-				shopInfo: {
-					name: '德轩美食',
-					table: '1',
-					coupon: [{
-							name: '满100减10'
-						},
-						{
-							name: '满200减30'
-						}
-					],
-					notice: '您好,欢迎进店选购',
-					logo: require("../../static/foods_1.webp")
-				},
-				list: [{
-						_id: '1',
-						code: '0',
-						name: '三文鱼',
-						file: require("../../static/foods_1.webp"),
-						price: 126,
-						spec: '300g',
-						stock: 100
-					},
-					{
-						_id: '2',
-						code: '0',
-						name: '蜜汁扇贝',
-						file: require("../../static/foods_2.webp"),
-						price: 68,
-						spec: '400g',
-						stock: 140
-					},
-					{
-						_id: '3',
-						code: '0',
-						name: '意大利牛排',
-						file: require("../../static/foods_3.webp"),
-						price: 128,
-						spec: '600g',
-						stock: 200
-					},
-					{
-						_id: '4',
-						code: '0',
-						name: '糖醋里脊',
-						file: require("../../static/foods_4.webp"),
-						price: 58,
-						spec: '500g',
-						stock: 140
-					},
-					{
-						_id: '5',
-						code: '2',
-						name: '黑糖珍珠奶茶',
-						file: require("../../static/foods_1.webp"),
-						price: 18,
-						spec: '500g',
-						stock: 120
-					},
-					{
-						_id: '6',
-						code: '2',
-						name: '雪碧',
-						file: require("../../static/foods_2.webp"),
-						price: 5,
-						spec: '500g',
-						stock: 34
-					},
-					{
-						_id: '7',
-						code: '2',
-						name: '可口可乐',
-						file: require("../../static/foods_3.webp"),
-						price: 5,
-						spec: '500g',
-						stock: 50
-					},
-					{
-						_id: '8',
-						code: '1',
-						name: '芝士小蛋糕',
-						file: require("../../static/foods_2.webp"),
-						price: 12,
-						spec: '260g',
-						stock: 10
-					},
-					{
-						_id: '9',
-						code: '1',
-						name: '草莓千层',
-						file: require("../../static/foods_3.webp"),
-						price: 15,
-						spec: '350g',
-						stock: 40
-					}
-				],
+				shopInfo: {},
+				list: [],
 				active: '0',
 				active: '0',
 				tags: {},
 				tags: {},
 				// 数据是否触底
 				// 数据是否触底
@@ -254,32 +164,47 @@
 			// 查询左侧一级列表
 			// 查询左侧一级列表
 			async search() {
 			async search() {
 				const that = this;
 				const that = this;
-				let type = [{
-						icon: 'vip',
-						name: '主食',
-						code: '0'
-					},
-					{
-						icon: 'fire',
-						name: '甜品',
-						code: '1'
-					},
-					{
-						icon: '',
-						name: '饮料',
-						code: '2'
-					}
-				]
-				that.$set(that, `typeList`, type);
-				// 查询产品
-				that.$set(that, `tags`, type[0])
-				that.searchMarket()
+				let res;
+				res = await that.$api(`shop`, 'GET', {});
+				if (res.errcode == '0') {
+					let data = res.data[0]
+					data.table = '1'
+					that.$set(that, `shopInfo`, data);
+				}
+				res = await that.$api(`goodsTags`, 'GET', {});
+				if (res.errcode == '0') {
+					that.$set(that, `typeList`, res.data);
+					// 查询产品
+					that.$set(that.tags, `code`, res.data[0].code)
+					that.searchMarket()
+				} else {
+					uni.showToast({
+						title: res.errmsg,
+						icon: 'none'
+					})
+				}
 			},
 			},
 			// 查询产品
 			// 查询产品
 			async searchMarket() {
 			async searchMarket() {
 				const that = this;
 				const that = this;
-				let list = that.list.filter(i => i.code == that.tags.code)
-				if (list) that.$set(that, `marketList`, list)
+				let res = await that.$api(`goods`, 'GET', {
+					type: that.tags.code
+				});
+				if (res.errcode == '0') {
+					that.$nextTick(async () => {
+						for (let val of that.buyList) {
+							for (let s of res.data) {
+								if (s._id == val._id) s.num = val.num
+							}
+						}
+					})
+					that.$set(that, `marketList`, res.data)
+				} else {
+					uni.showToast({
+						title: res.errmsg,
+						icon: 'none'
+					})
+				}
 			},
 			},
 			// 改变数量
 			// 改变数量
 			async bindChange(e) {
 			async bindChange(e) {
@@ -328,18 +253,30 @@
 				that.$refs.specShow.open();
 				that.$refs.specShow.open();
 			},
 			},
 			// 去购买
 			// 去购买
-			toBuy() {
+			async toBuy() {
 				const that = this;
 				const that = this;
-				let key = '1'
+				let res;
 				if (that.buyList.length > 0) {
 				if (that.buyList.length > 0) {
 					if (that.id) {
 					if (that.id) {
-						uni.navigateTo({
-							url: `/pagesHome/order/add?key=${key}`
-						})
+						res = await that.$api(`cart/${that.id}`, 'GET', {});
+						if (res.errcode == '0') {
+							console.log(res.data);
+							// uni.navigateTo({
+							// 	url: `/pagesHome/order/add?id=${res.data._id}`
+							// })
+						}
 					} else {
 					} else {
-						uni.navigateTo({
-							url: `/pagesHome/order/index?key=${key}`
-						})
+						let obj = {
+							list: that.buyList,
+							total: that.cartNum.total,
+							table: '63dc9f7de85ec93564c717a0'
+						}
+						res = await that.$api(`cart`, 'POST', obj);
+						if (res.errcode == '0') {
+							uni.navigateTo({
+								url: `/pagesHome/order/index?id=${res.data._id}`
+							})
+						}
 					}
 					}
 
 
 				}
 				}
@@ -371,7 +308,7 @@
 				const that = this;
 				const that = this;
 				that.$set(that, `marketList`, []);
 				that.$set(that, `marketList`, []);
 				that.$set(that, `active`, index);
 				that.$set(that, `active`, index);
-				that.$set(that, `tags`, e);
+				that.$set(that.tags, `code`, e.code);
 				that.searchMarket();
 				that.searchMarket();
 			},
 			},
 		}
 		}

+ 22 - 107
pagesHome/order/add.vue

@@ -52,6 +52,10 @@
 				<button class="button" @tap.stop="toBuy">下单</button>
 				<button class="button" @tap.stop="toBuy">下单</button>
 			</view>
 			</view>
 		</view>
 		</view>
+		<uni-popup ref="popup" type="dialog">
+			<uni-popup-dialog mode="input" message="成功消息" :duration="2000" :before-close="true" @close="close"
+				@confirm="confirm"></uni-popup-dialog>
+		</uni-popup>
 	</view>
 	</view>
 </template>
 </template>
 
 
@@ -59,127 +63,38 @@
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
-				shopInfo: {
-					table: '1',
-					total: 521,
-					numTotal: 9,
-					money: 3,
-					type: '0',
-					num: 3,
-					person: 3,
-					perMoney: 9,
-					time: '2023-02-01 14:10',
-					remark: '无'
-				},
-				list: [{
-						_id: '1',
-						code: '0',
-						name: '三文鱼',
-						file: require("../../static/foods_1.webp"),
-						price: 126,
-						spec: '300g',
-						stock: 100,
-						num: 1,
-					},
-					{
-						_id: '2',
-						code: '0',
-						name: '蜜汁扇贝',
-						file: require("../../static/foods_2.webp"),
-						price: 68,
-						spec: '400g',
-						stock: 140,
-						num: 1,
-					},
-					{
-						_id: '3',
-						code: '0',
-						name: '意大利牛排',
-						file: require("../../static/foods_3.webp"),
-						price: 128,
-						spec: '600g',
-						stock: 200,
-						num: 1,
-					},
-					{
-						_id: '4',
-						code: '0',
-						name: '糖醋里脊',
-						file: require("../../static/foods_4.webp"),
-						price: 58,
-						spec: '500g',
-						stock: 140,
-						num: 1,
-					},
-					{
-						_id: '5',
-						code: '2',
-						name: '黑糖珍珠奶茶',
-						file: require("../../static/foods_1.webp"),
-						price: 18,
-						spec: '500g',
-						stock: 120,
-						num: 1,
-					},
-					{
-						_id: '6',
-						code: '2',
-						name: '雪碧',
-						file: require("../../static/foods_2.webp"),
-						price: 5,
-						spec: '500g',
-						stock: 34,
-						num: 1,
-					},
-					{
-						_id: '7',
-						code: '2',
-						name: '可口可乐',
-						file: require("../../static/foods_3.webp"),
-						price: 5,
-						spec: '500g',
-						stock: 50,
-						num: 1,
-					},
-					{
-						_id: '8',
-						code: '1',
-						name: '芝士小蛋糕',
-						file: require("../../static/foods_2.webp"),
-						price: 12,
-						spec: '260g',
-						stock: 10,
-						num: 1,
-					},
-					{
-						_id: '9',
-						code: '1',
-						name: '草莓千层',
-						file: require("../../static/foods_3.webp"),
-						price: 15,
-						spec: '350g',
-						stock: 40,
-						num: 1,
-					}
-				],
+				id: "",
+				shopInfo: {},
+				list: [],
 			}
 			}
 		},
 		},
-		onLoad() {
+		onLoad: async function(e) {
 			const that = this;
 			const that = this;
-
+			that.$set(that, `id`, e.id);
+			that.search();
 		},
 		},
 		onShow() {
 		onShow() {
 			const that = this;
 			const that = this;
-
 		},
 		},
 		methods: {
 		methods: {
 			async search(e) {
 			async search(e) {
 				const that = this;
 				const that = this;
+				if (that.id) {
+					let res = await that.$api(`order/${that.id}`, 'GET', {});
+					if (res.errcode == '0') {
+						that.$set(that, `list`, res.data.list)
+						that.$set(that, `shopInfo`, res.data)
+					}
+				}
 			},
 			},
 			// 下单
 			// 下单
 			toBuy() {
 			toBuy() {
 				const that = this;
 				const that = this;
-				console.log('结账');
+				that.$refs.popup.open()
+			},
+			close() {
+				const that = this;
+				that.$refs.popup.close()
 			},
 			},
 		}
 		}
 	}
 	}

+ 48 - 109
pagesHome/order/index.vue

@@ -38,7 +38,9 @@
 						<view class="list-scroll-view">
 						<view class="list-scroll-view">
 							<view class="list" v-for="(item,index) in list" :key="index">
 							<view class="list" v-for="(item,index) in list" :key="index">
 								<view class="img">
 								<view class="img">
-									<image class="image" :src="item.file" mode=""></image>
+									<image class="image" :src="item.file&&item.file.length>0?item.file[0].url:''"
+										mode="">
+									</image>
 								</view>
 								</view>
 								<view class="info">
 								<view class="info">
 									<view class="name textOver">
 									<view class="name textOver">
@@ -65,7 +67,7 @@
 						<view class="right">¥{{shopInfo.perMoney}}</view>
 						<view class="right">¥{{shopInfo.perMoney}}</view>
 					</view>
 					</view>
 					<view class="two_3_2">
 					<view class="two_3_2">
-						共{{shopInfo.numTotal}}件商品,合计:<text>¥</text><text>{{shopInfo.goods_total}}</text>
+						共{{list.length}}件商品,合计:<text>¥</text><text>{{shopInfo.goods_total}}</text>
 					</view>
 					</view>
 				</view>
 				</view>
 			</view>
 			</view>
@@ -82,118 +84,25 @@
 </template>
 </template>
 
 
 <script>
 <script>
+	import moment from 'moment';
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
-				shopInfo: {
-					table: '1',
-					goods_total: 512,
-					numTotal: 9,
-					money: 3,
-					type: '1',
-				},
+				id: "",
+				shopInfo: {},
 				is_show: true,
 				is_show: true,
 				personList: [
 				personList: [
 					'1人', '2人', '3人', '4人', '5人', '6人', '7人', '8人', '9人', '10人', '11人', '12人', '13人', '14人',
 					'1人', '2人', '3人', '4人', '5人', '6人', '7人', '8人', '9人', '10人', '11人', '12人', '13人', '14人',
 					'15人', '16人', '17人',
 					'15人', '16人', '17人',
 					'18人', '19人', '20人', '21人', '22人'
 					'18人', '19人', '20人', '21人', '22人'
 				],
 				],
-				list: [{
-						_id: '1',
-						code: '0',
-						name: '三文鱼',
-						file: require("../../static/foods_1.webp"),
-						price: 126,
-						spec: '300g',
-						stock: 100,
-						num: 1,
-					},
-					{
-						_id: '2',
-						code: '0',
-						name: '蜜汁扇贝',
-						file: require("../../static/foods_2.webp"),
-						price: 68,
-						spec: '400g',
-						stock: 140,
-						num: 1,
-					},
-					{
-						_id: '3',
-						code: '0',
-						name: '意大利牛排',
-						file: require("../../static/foods_3.webp"),
-						price: 128,
-						spec: '600g',
-						stock: 200,
-						num: 1,
-					},
-					{
-						_id: '4',
-						code: '0',
-						name: '糖醋里脊',
-						file: require("../../static/foods_4.webp"),
-						price: 58,
-						spec: '500g',
-						stock: 140,
-						num: 1,
-					},
-					{
-						_id: '5',
-						code: '2',
-						name: '黑糖珍珠奶茶',
-						file: require("../../static/foods_1.webp"),
-						price: 18,
-						spec: '500g',
-						stock: 120,
-						num: 1,
-					},
-					{
-						_id: '6',
-						code: '2',
-						name: '雪碧',
-						file: require("../../static/foods_2.webp"),
-						price: 5,
-						spec: '500g',
-						stock: 34,
-						num: 1,
-					},
-					{
-						_id: '7',
-						code: '2',
-						name: '可口可乐',
-						file: require("../../static/foods_3.webp"),
-						price: 5,
-						spec: '500g',
-						stock: 50,
-						num: 1,
-					},
-					{
-						_id: '8',
-						code: '1',
-						name: '芝士小蛋糕',
-						file: require("../../static/foods_2.webp"),
-						price: 12,
-						spec: '260g',
-						stock: 10,
-						num: 1,
-					},
-					{
-						_id: '9',
-						code: '1',
-						name: '草莓千层',
-						file: require("../../static/foods_3.webp"),
-						price: 15,
-						spec: '350g',
-						stock: 40,
-						num: 1,
-					}
-				],
+				list: [],
 			}
 			}
 		},
 		},
-		onLoad() {
+		onLoad: async function(e) {
 			const that = this;
 			const that = this;
-
+			that.$set(that, `id`, e.id);
+			that.search();
 		},
 		},
 		onShow() {
 		onShow() {
 			const that = this;
 			const that = this;
@@ -202,6 +111,23 @@
 		methods: {
 		methods: {
 			async search(e) {
 			async search(e) {
 				const that = this;
 				const that = this;
+				let res;
+				if (that.id) {
+					res = await that.$api(`shop`, 'GET', {});
+					if (res.errcode == '0') {
+						let data = res.data[0]
+						data.table = '1'
+						that.$set(that, `shopInfo`, data);
+					}
+					res = await that.$api(`cart/${that.id}`, 'GET', {});
+					if (res.errcode == '0') {
+						that.$set(that, `list`, res.data.list)
+						that.$set(that.shopInfo, `goods_total`, res.data.total)
+						let table = await that.$api(`table/${res.data.table}`, `GET`)
+						that.$set(that.shopInfo, `table`, table.data.name)
+						that.$set(that.shopInfo, `table_id`, res.data.table)
+					}
+				}
 			},
 			},
 			// 选择堂食还是打包
 			// 选择堂食还是打包
 			toChang() {
 			toChang() {
@@ -216,16 +142,29 @@
 				that.$set(that.shopInfo, `perMoney`, money)
 				that.$set(that.shopInfo, `perMoney`, money)
 				let total = that.$plus(money, that.shopInfo.goods_total)
 				let total = that.$plus(money, that.shopInfo.goods_total)
 				that.$set(that.shopInfo, `detail_total`, total)
 				that.$set(that.shopInfo, `detail_total`, total)
-
 			},
 			},
 			// 下单
 			// 下单
-			toBuy() {
+			async toBuy() {
 				const that = this;
 				const that = this;
-				console.log('下单');
-				let key = '1'
-				uni.navigateTo({
-					url: `/pagesHome/order/info?key=${key}`
-				})
+				let type = '0';
+				if (that.is_show == true) type = '0'
+				else type = '1'
+				let obj = {
+					time: moment().format('YYYY-MM-DD HH:mm:ss'),
+					remark: that.shopInfo.remark,
+					table: that.shopInfo.table_id,
+					money: that.shopInfo.detail_total,
+					money_num: that.shopInfo.perMoney,
+					num: that.shopInfo.person,
+					type: type,
+					list: that.list
+				}
+				let res = await that.$api(`order`, 'POST', obj);
+				if (res.errcode == '0') {
+					uni.navigateTo({
+						url: `/pagesHome/order/info?id=${res.data._id}`
+					})
+				}
 			},
 			},
 		}
 		}
 	}
 	}

+ 36 - 112
pagesHome/order/info.vue

@@ -6,7 +6,7 @@
 			</view>
 			</view>
 			<view class="two">
 			<view class="two">
 				<view class="two_1">
 				<view class="two_1">
-					<view class="left">桌号:{{shopInfo.table}}</view>
+					<view class="left">桌号:{{shopInfo.table_num}}</view>
 					<view class="right">人数:{{shopInfo.num}}人</view>
 					<view class="right">人数:{{shopInfo.num}}人</view>
 				</view>
 				</view>
 				<view class="two_2">
 				<view class="two_2">
@@ -16,7 +16,9 @@
 							<view class="list-scroll-view">
 							<view class="list-scroll-view">
 								<view class="list" v-for="(item,index) in list" :key="index">
 								<view class="list" v-for="(item,index) in list" :key="index">
 									<view class="img">
 									<view class="img">
-										<image class="image" :src="item.file" mode=""></image>
+										<image class="image" :src="item.file&&item.file.length>0?item.file[0].url:''"
+											mode="">
+										</image>
 									</view>
 									</view>
 									<view class="infoList">
 									<view class="infoList">
 										<view class="name textOver">
 										<view class="name textOver">
@@ -38,12 +40,12 @@
 						<view class="two_2_3_1">
 						<view class="two_2_3_1">
 							<view class="left">
 							<view class="left">
 								餐位费
 								餐位费
-								<text>×{{shopInfo.person}}</text>
+								<text>×{{shopInfo.num}}</text>
 							</view>
 							</view>
-							<view class="right">¥{{shopInfo.perMoney}}</view>
+							<view class="right">¥{{shopInfo.money_num}}</view>
 						</view>
 						</view>
 						<view class="two_2_3_2">
 						<view class="two_2_3_2">
-							共{{shopInfo.numTotal}}件商品,合计:<text>¥</text><text>{{shopInfo.total}}</text>
+							共{{list.length}}件商品,合计:<text>¥</text><text>{{shopInfo.money}}</text>
 						</view>
 						</view>
 					</view>
 					</view>
 				</view>
 				</view>
@@ -67,6 +69,10 @@
 				<button class="button" @tap.stop="toBuy">结账</button>
 				<button class="button" @tap.stop="toBuy">结账</button>
 			</view>
 			</view>
 		</view>
 		</view>
+		<uni-popup ref="popup" type="dialog">
+			<uni-popup-dialog title="提示" content="请您前往前台付款!" :duration="2000" @close="close" @confirm="close">
+			</uni-popup-dialog>
+		</uni-popup>
 	</view>
 	</view>
 </template>
 </template>
 
 
@@ -74,113 +80,15 @@
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
-				shopInfo: {
-					table: '1',
-					total: 521,
-					numTotal: 9,
-					money: 3,
-					type: '0',
-					num: 3,
-					person: 3,
-					perMoney: 9,
-					time: '2023-02-01 14:10',
-					remark: '无'
-				},
-				list: [{
-						_id: '1',
-						code: '0',
-						name: '三文鱼',
-						file: require("../../static/foods_1.webp"),
-						price: 126,
-						spec: '300g',
-						stock: 100,
-						num: 1,
-					},
-					{
-						_id: '2',
-						code: '0',
-						name: '蜜汁扇贝',
-						file: require("../../static/foods_2.webp"),
-						price: 68,
-						spec: '400g',
-						stock: 140,
-						num: 1,
-					},
-					{
-						_id: '3',
-						code: '0',
-						name: '意大利牛排',
-						file: require("../../static/foods_3.webp"),
-						price: 128,
-						spec: '600g',
-						stock: 200,
-						num: 1,
-					},
-					{
-						_id: '4',
-						code: '0',
-						name: '糖醋里脊',
-						file: require("../../static/foods_4.webp"),
-						price: 58,
-						spec: '500g',
-						stock: 140,
-						num: 1,
-					},
-					{
-						_id: '5',
-						code: '2',
-						name: '黑糖珍珠奶茶',
-						file: require("../../static/foods_1.webp"),
-						price: 18,
-						spec: '500g',
-						stock: 120,
-						num: 1,
-					},
-					{
-						_id: '6',
-						code: '2',
-						name: '雪碧',
-						file: require("../../static/foods_2.webp"),
-						price: 5,
-						spec: '500g',
-						stock: 34,
-						num: 1,
-					},
-					{
-						_id: '7',
-						code: '2',
-						name: '可口可乐',
-						file: require("../../static/foods_3.webp"),
-						price: 5,
-						spec: '500g',
-						stock: 50,
-						num: 1,
-					},
-					{
-						_id: '8',
-						code: '1',
-						name: '芝士小蛋糕',
-						file: require("../../static/foods_2.webp"),
-						price: 12,
-						spec: '260g',
-						stock: 10,
-						num: 1,
-					},
-					{
-						_id: '9',
-						code: '1',
-						name: '草莓千层',
-						file: require("../../static/foods_3.webp"),
-						price: 15,
-						spec: '350g',
-						stock: 40,
-						num: 1,
-					}
-				],
+				id: '',
+				shopInfo: {},
+				list: [],
 			}
 			}
 		},
 		},
-		onLoad() {
+		onLoad: async function(e) {
 			const that = this;
 			const that = this;
+			that.$set(that, `id`, e.id);
+			that.search();
 		},
 		},
 		onShow() {
 		onShow() {
 			const that = this;
 			const that = this;
@@ -188,16 +96,32 @@
 		methods: {
 		methods: {
 			async search(e) {
 			async search(e) {
 				const that = this;
 				const that = this;
+				if (that.id) {
+					let res = await that.$api(`order/${that.id}`, 'GET', {});
+					if (res.errcode == '0') {
+						that.$set(that, `list`, res.data.list)
+						that.$set(that, `shopInfo`, res.data)
+						let table = await that.$api(`table/${res.data.table}`, `GET`)
+						that.$set(that.shopInfo, `table_num`, table.data.name)
+					}
+				}
 			},
 			},
 			// 加菜
 			// 加菜
 			toAdd() {
 			toAdd() {
-				let id = '1'
+				const that = this;
 				uni.navigateTo({
 				uni.navigateTo({
-					url: `/pagesHome/home/index?id=${id}`
+					url: `/pagesHome/home/index?id=${that.shopInfo.table}`
 				})
 				})
 			},
 			},
 			// 结账
 			// 结账
-			toBuy() {},
+			toBuy() {
+				const that = this;
+				that.$refs.popup.open()
+			},
+			close() {
+				const that = this;
+				that.$refs.popup.close()
+			},
 		}
 		}
 	}
 	}
 </script>
 </script>

文件差异内容过多而无法显示
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map


文件差异内容过多而无法显示
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/common/runtime.js.map


文件差异内容过多而无法显示
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map


文件差异内容过多而无法显示
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/index/index.js.map


文件差异内容过多而无法显示
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/home/index.js.map


文件差异内容过多而无法显示
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/order/add.js.map


文件差异内容过多而无法显示
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/order/index.js.map


文件差异内容过多而无法显示
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/order/info.js.map


文件差异内容过多而无法显示
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-badge/components/uni-badge/uni-badge.js.map


文件差异内容过多而无法显示
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-icons/components/uni-icons/uni-icons.js.map


文件差异内容过多而无法显示
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.js.map


文件差异内容过多而无法显示
+ 1 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.js.map


文件差异内容过多而无法显示
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-popup/components/uni-popup/uni-popup.js.map


文件差异内容过多而无法显示
+ 2 - 2
unpackage/dist/dev/mp-weixin/common/runtime.js


文件差异内容过多而无法显示
+ 33167 - 11553
unpackage/dist/dev/mp-weixin/common/vendor.js


+ 86 - 149
unpackage/dist/dev/mp-weixin/pagesHome/home/index.js

@@ -292,106 +292,16 @@ __webpack_require__.r(__webpack_exports__);
 //
 //
 //
 //
 //
 //
+//
+//
+//
 var _default =
 var _default =
 {
 {
   data: function data() {
   data: function data() {
     return {
     return {
       id: '',
       id: '',
-      shopInfo: {
-        name: '德轩美食',
-        table: '1',
-        coupon: [{
-          name: '满100减10' },
-
-        {
-          name: '满200减30' }],
-
-
-        notice: '您好,欢迎进店选购',
-        logo: __webpack_require__(/*! ../../static/foods_1.webp */ 34) },
-
-      list: [{
-        _id: '1',
-        code: '0',
-        name: '三文鱼',
-        file: __webpack_require__(/*! ../../static/foods_1.webp */ 34),
-        price: 126,
-        spec: '300g',
-        stock: 100 },
-
-      {
-        _id: '2',
-        code: '0',
-        name: '蜜汁扇贝',
-        file: __webpack_require__(/*! ../../static/foods_2.webp */ 25),
-        price: 68,
-        spec: '400g',
-        stock: 140 },
-
-      {
-        _id: '3',
-        code: '0',
-        name: '意大利牛排',
-        file: __webpack_require__(/*! ../../static/foods_3.webp */ 35),
-        price: 128,
-        spec: '600g',
-        stock: 200 },
-
-      {
-        _id: '4',
-        code: '0',
-        name: '糖醋里脊',
-        file: __webpack_require__(/*! ../../static/foods_4.webp */ 36),
-        price: 58,
-        spec: '500g',
-        stock: 140 },
-
-      {
-        _id: '5',
-        code: '2',
-        name: '黑糖珍珠奶茶',
-        file: __webpack_require__(/*! ../../static/foods_1.webp */ 34),
-        price: 18,
-        spec: '500g',
-        stock: 120 },
-
-      {
-        _id: '6',
-        code: '2',
-        name: '雪碧',
-        file: __webpack_require__(/*! ../../static/foods_2.webp */ 25),
-        price: 5,
-        spec: '500g',
-        stock: 34 },
-
-      {
-        _id: '7',
-        code: '2',
-        name: '可口可乐',
-        file: __webpack_require__(/*! ../../static/foods_3.webp */ 35),
-        price: 5,
-        spec: '500g',
-        stock: 50 },
-
-      {
-        _id: '8',
-        code: '1',
-        name: '芝士小蛋糕',
-        file: __webpack_require__(/*! ../../static/foods_2.webp */ 25),
-        price: 12,
-        spec: '260g',
-        stock: 10 },
-
-      {
-        _id: '9',
-        code: '1',
-        name: '草莓千层',
-        file: __webpack_require__(/*! ../../static/foods_3.webp */ 35),
-        price: 15,
-        spec: '350g',
-        stock: 40 }],
-
-
+      shopInfo: {},
+      list: [],
       active: '0',
       active: '0',
       tags: {},
       tags: {},
       // 数据是否触底
       // 数据是否触底
@@ -418,58 +328,73 @@ var _default =
   },
   },
   methods: {
   methods: {
     // 查询左侧一级列表
     // 查询左侧一级列表
-    search: function search() {var _this = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2() {var that, type;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:
-                that = _this;
-                type = [{
-                  icon: 'vip',
-                  name: '主食',
-                  code: '0' },
-
-                {
-                  icon: 'fire',
-                  name: '甜品',
-                  code: '1' },
-
-                {
-                  icon: '',
-                  name: '饮料',
-                  code: '2' }];
-
-
-                that.$set(that, "typeList", type);
-                // 查询产品
-                that.$set(that, "tags", type[0]);
-                that.searchMarket();case 5:case "end":return _context2.stop();}}}, _callee2);}))();
+    search: function search() {var _this = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2() {var that, res, data;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:
+                that = _this;_context2.next = 3;return (
+
+                  that.$api("shop", 'GET', {}));case 3:res = _context2.sent;
+                if (res.errcode == '0') {
+                  data = res.data[0];
+                  data.table = '1';
+                  that.$set(that, "shopInfo", data);
+                }_context2.next = 7;return (
+                  that.$api("goodsTags", 'GET', {}));case 7:res = _context2.sent;
+                if (res.errcode == '0') {
+                  that.$set(that, "typeList", res.data);
+                  // 查询产品
+                  that.$set(that.tags, "code", res.data[0].code);
+                  that.searchMarket();
+                } else {
+                  uni.showToast({
+                    title: res.errmsg,
+                    icon: 'none' });
+
+                }case 9:case "end":return _context2.stop();}}}, _callee2);}))();
     },
     },
     // 查询产品
     // 查询产品
-    searchMarket: function searchMarket() {var _this2 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3() {var that, list;return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0:
-                that = _this2;
-                list = that.list.filter(function (i) {return i.code == that.tags.code;});
-                if (list) that.$set(that, "marketList", list);case 3:case "end":return _context3.stop();}}}, _callee3);}))();
+    searchMarket: function searchMarket() {var _this2 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee4() {var that, res;return _regenerator.default.wrap(function _callee4$(_context4) {while (1) {switch (_context4.prev = _context4.next) {case 0:
+                that = _this2;_context4.next = 3;return (
+                  that.$api("goods", 'GET', {
+                    type: that.tags.code }));case 3:res = _context4.sent;
+
+                if (res.errcode == '0') {
+                  that.$nextTick( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3() {var _iterator, _step, val, _iterator2, _step2, s;return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0:_iterator = _createForOfIteratorHelper(
+                            that.buyList);try {for (_iterator.s(); !(_step = _iterator.n()).done;) {val = _step.value;_iterator2 = _createForOfIteratorHelper(
+                                res.data);try {for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {s = _step2.value;
+                                    if (s._id == val._id) s.num = val.num;
+                                  }} catch (err) {_iterator2.e(err);} finally {_iterator2.f();}
+                              }} catch (err) {_iterator.e(err);} finally {_iterator.f();}case 2:case "end":return _context3.stop();}}}, _callee3);})));
+
+                  that.$set(that, "marketList", res.data);
+                } else {
+                  uni.showToast({
+                    title: res.errmsg,
+                    icon: 'none' });
+
+                }case 5:case "end":return _context4.stop();}}}, _callee4);}))();
     },
     },
     // 改变数量
     // 改变数量
-    bindChange: function bindChange(e) {var _this3 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee5() {var that;return _regenerator.default.wrap(function _callee5$(_context5) {while (1) {switch (_context5.prev = _context5.next) {case 0:
+    bindChange: function bindChange(e) {var _this3 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee6() {var that;return _regenerator.default.wrap(function _callee6$(_context6) {while (1) {switch (_context6.prev = _context6.next) {case 0:
                 that = _this3;
                 that = _this3;
-                that.$nextTick( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee4() {var list, cart, _iterator, _step, val, _iterator2, _step2, _loop;return _regenerator.default.wrap(function _callee4$(_context4) {while (1) {switch (_context4.prev = _context4.next) {case 0:
+                that.$nextTick( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee5() {var list, cart, _iterator3, _step3, val, _iterator4, _step4, _loop;return _regenerator.default.wrap(function _callee5$(_context5) {while (1) {switch (_context5.prev = _context5.next) {case 0:
                           list = that.buyList.find(function (i) {return i._id == e._id;});
                           list = that.buyList.find(function (i) {return i._id == e._id;});
                           if (list) {
                           if (list) {
                             if (list.num == 0) {
                             if (list.num == 0) {
                               cart = that.buyList.filter(function (i) {return i._id !== list._id;});
                               cart = that.buyList.filter(function (i) {return i._id !== list._id;});
                               if (cart) that.$set(that, "buyList", cart);
                               if (cart) that.$set(that, "buyList", cart);
-                            } else {_iterator = _createForOfIteratorHelper(
-                              that.buyList);try {for (_iterator.s(); !(_step = _iterator.n()).done;) {val = _step.value;
+                            } else {_iterator3 = _createForOfIteratorHelper(
+                              that.buyList);try {for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {val = _step3.value;
                                   if (val._id == list._id) val.num = list.num;
                                   if (val._id == list._id) val.num = list.num;
-                                }} catch (err) {_iterator.e(err);} finally {_iterator.f();}
+                                }} catch (err) {_iterator3.e(err);} finally {_iterator3.f();}
                             }
                             }
                           } else {
                           } else {
                             if (e.num != 0) that.buyList.push(e);
                             if (e.num != 0) that.buyList.push(e);
-                          }_iterator2 = _createForOfIteratorHelper(
-                          that.typeList);try {_loop = function _loop() {var s = _step2.value;
+                          }_iterator4 = _createForOfIteratorHelper(
+                          that.typeList);try {_loop = function _loop() {var s = _step4.value;
                               var num = that.buyList.filter(function (i) {return i.code == s.code;});
                               var num = that.buyList.filter(function (i) {return i.code == s.code;});
                               var buy = num.filter(function (i) {return i.num !== 0;});
                               var buy = num.filter(function (i) {return i.num !== 0;});
-                              if (buy) s.num = buy.length;};for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {_loop();
-                            }} catch (err) {_iterator2.e(err);} finally {_iterator2.f();}_context4.next = 6;return (
-                            that.countMoney());case 6:case "end":return _context4.stop();}}}, _callee4);})));case 2:case "end":return _context5.stop();}}}, _callee5);}))();
+                              if (buy) s.num = buy.length;};for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {_loop();
+                            }} catch (err) {_iterator4.e(err);} finally {_iterator4.f();}_context5.next = 6;return (
+                            that.countMoney());case 6:case "end":return _context5.stop();}}}, _callee5);})));case 2:case "end":return _context6.stop();}}}, _callee6);}))();
 
 
     },
     },
     // 计算总额
     // 计算总额
@@ -478,11 +403,11 @@ var _default =
       var list = that.buyList.filter(function (i) {return i.num !== 0;});
       var list = that.buyList.filter(function (i) {return i.num !== 0;});
       var totalMoney = 0;
       var totalMoney = 0;
       // 渲染结束执行下面方法
       // 渲染结束执行下面方法
-      that.$nextTick(function () {var _iterator3 = _createForOfIteratorHelper(
-        list),_step3;try {for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {var val = _step3.value;
+      that.$nextTick(function () {var _iterator5 = _createForOfIteratorHelper(
+        list),_step5;try {for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {var val = _step5.value;
             var total = that.$multiply(val.price, val.num);
             var total = that.$multiply(val.price, val.num);
             totalMoney += Number(total);
             totalMoney += Number(total);
-          }} catch (err) {_iterator3.e(err);} finally {_iterator3.f();}
+          }} catch (err) {_iterator5.e(err);} finally {_iterator5.f();}
         that.$set(that.cartNum, "num", list.length);
         that.$set(that.cartNum, "num", list.length);
         that.$set(that.cartNum, "total", totalMoney);
         that.$set(that.cartNum, "total", totalMoney);
       });
       });
@@ -494,26 +419,38 @@ var _default =
       that.$refs.specShow.open();
       that.$refs.specShow.open();
     },
     },
     // 去购买
     // 去购买
-    toBuy: function toBuy() {
-      var that = this;
-      var key = '1';
-      if (that.buyList.length > 0) {
-        if (that.id) {
-          uni.navigateTo({
-            url: "/pagesHome/order/add?key=".concat(key) });
+    toBuy: function toBuy() {var _this4 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee7() {var that, res, obj;return _regenerator.default.wrap(function _callee7$(_context7) {while (1) {switch (_context7.prev = _context7.next) {case 0:
+                that = _this4;if (!(
+
+                that.buyList.length > 0)) {_context7.next = 14;break;}if (!
+                that.id) {_context7.next = 9;break;}_context7.next = 5;return (
+                  that.$api("cart/".concat(that.id), 'GET', {}));case 5:res = _context7.sent;
+                if (res.errcode == '0') {
+                  console.log(res.data);
+                  // uni.navigateTo({
+                  // 	url: `/pagesHome/order/add?id=${res.data._id}`
+                  // })
+                }_context7.next = 14;break;case 9:
+
+                obj = {
+                  list: that.buyList,
+                  total: that.cartNum.total,
+                  table: '63dc9f7de85ec93564c717a0' };_context7.next = 12;return (
+
+                  that.$api("cart", 'POST', obj));case 12:res = _context7.sent;
+                if (res.errcode == '0') {
+                  uni.navigateTo({
+                    url: "/pagesHome/order/index?id=".concat(res.data._id) });
+
+                }case 14:case "end":return _context7.stop();}}}, _callee7);}))();
 
 
-        } else {
-          uni.navigateTo({
-            url: "/pagesHome/order/index?key=".concat(key) });
 
 
-        }
 
 
-      }
     },
     },
     // 关闭弹框
     // 关闭弹框
     toDelete: function toDelete() {
     toDelete: function toDelete() {
-      var that = this;var _iterator4 = _createForOfIteratorHelper(
-      that.typeList),_step4;try {for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {var val = _step4.value;val.num = 0;}} catch (err) {_iterator4.e(err);} finally {_iterator4.f();}
+      var that = this;var _iterator6 = _createForOfIteratorHelper(
+      that.typeList),_step6;try {for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {var val = _step6.value;val.num = 0;}} catch (err) {_iterator6.e(err);} finally {_iterator6.f();}
       that.$set(that, "buyList", []);
       that.$set(that, "buyList", []);
       that.$set(that.cartNum, "num", 0);
       that.$set(that.cartNum, "num", 0);
       that.$set(that.cartNum, "total", 0);
       that.$set(that.cartNum, "total", 0);
@@ -537,7 +474,7 @@ var _default =
       var that = this;
       var that = this;
       that.$set(that, "marketList", []);
       that.$set(that, "marketList", []);
       that.$set(that, "active", index);
       that.$set(that, "active", index);
-      that.$set(that, "tags", e);
+      that.$set(that.tags, "code", e.code);
       that.searchMarket();
       that.searchMarket();
     } } };exports.default = _default;
     } } };exports.default = _default;
 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))

文件差异内容过多而无法显示
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/home/index.wxml


+ 31 - 110
unpackage/dist/dev/mp-weixin/pagesHome/order/add.js

@@ -99,6 +99,12 @@ try {
   components = {
   components = {
     uniIcons: function() {
     uniIcons: function() {
       return Promise.all(/*! import() | uni_modules/uni-icons/components/uni-icons/uni-icons */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uni-icons/components/uni-icons/uni-icons.vue */ 70))
       return Promise.all(/*! import() | uni_modules/uni-icons/components/uni-icons/uni-icons */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uni-icons/components/uni-icons/uni-icons.vue */ 70))
+    },
+    uniPopup: function() {
+      return __webpack_require__.e(/*! import() | uni_modules/uni-popup/components/uni-popup/uni-popup */ "uni_modules/uni-popup/components/uni-popup/uni-popup").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-popup/components/uni-popup/uni-popup.vue */ 85))
+    },
+    uniPopupDialog: function() {
+      return Promise.all(/*! import() | uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue */ 246))
     }
     }
   }
   }
 } catch (e) {
 } catch (e) {
@@ -212,131 +218,46 @@ Object.defineProperty(exports, "__esModule", { value: true });exports.default =
 //
 //
 //
 //
 //
 //
+//
+//
+//
+//
 var _default =
 var _default =
 {
 {
   data: function data() {
   data: function data() {
     return {
     return {
-      shopInfo: {
-        table: '1',
-        total: 521,
-        numTotal: 9,
-        money: 3,
-        type: '0',
-        num: 3,
-        person: 3,
-        perMoney: 9,
-        time: '2023-02-01 14:10',
-        remark: '无' },
-
-      list: [{
-        _id: '1',
-        code: '0',
-        name: '三文鱼',
-        file: __webpack_require__(/*! ../../static/foods_1.webp */ 34),
-        price: 126,
-        spec: '300g',
-        stock: 100,
-        num: 1 },
-
-      {
-        _id: '2',
-        code: '0',
-        name: '蜜汁扇贝',
-        file: __webpack_require__(/*! ../../static/foods_2.webp */ 25),
-        price: 68,
-        spec: '400g',
-        stock: 140,
-        num: 1 },
-
-      {
-        _id: '3',
-        code: '0',
-        name: '意大利牛排',
-        file: __webpack_require__(/*! ../../static/foods_3.webp */ 35),
-        price: 128,
-        spec: '600g',
-        stock: 200,
-        num: 1 },
-
-      {
-        _id: '4',
-        code: '0',
-        name: '糖醋里脊',
-        file: __webpack_require__(/*! ../../static/foods_4.webp */ 36),
-        price: 58,
-        spec: '500g',
-        stock: 140,
-        num: 1 },
-
-      {
-        _id: '5',
-        code: '2',
-        name: '黑糖珍珠奶茶',
-        file: __webpack_require__(/*! ../../static/foods_1.webp */ 34),
-        price: 18,
-        spec: '500g',
-        stock: 120,
-        num: 1 },
-
-      {
-        _id: '6',
-        code: '2',
-        name: '雪碧',
-        file: __webpack_require__(/*! ../../static/foods_2.webp */ 25),
-        price: 5,
-        spec: '500g',
-        stock: 34,
-        num: 1 },
-
-      {
-        _id: '7',
-        code: '2',
-        name: '可口可乐',
-        file: __webpack_require__(/*! ../../static/foods_3.webp */ 35),
-        price: 5,
-        spec: '500g',
-        stock: 50,
-        num: 1 },
-
-      {
-        _id: '8',
-        code: '1',
-        name: '芝士小蛋糕',
-        file: __webpack_require__(/*! ../../static/foods_2.webp */ 25),
-        price: 12,
-        spec: '260g',
-        stock: 10,
-        num: 1 },
-
-      {
-        _id: '9',
-        code: '1',
-        name: '草莓千层',
-        file: __webpack_require__(/*! ../../static/foods_3.webp */ 35),
-        price: 15,
-        spec: '350g',
-        stock: 40,
-        num: 1 }] };
-
-
+      id: "",
+      shopInfo: {},
+      list: [] };
 
 
   },
   },
-  onLoad: function onLoad() {
-    var that = this;
+  onLoad: function () {var _onLoad = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {var that;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:
+              that = this;
+              that.$set(that, "id", e.id);
+              that.search();case 3:case "end":return _context.stop();}}}, _callee, this);}));function onLoad(_x) {return _onLoad.apply(this, arguments);}return onLoad;}(),
 
 
-  },
   onShow: function onShow() {
   onShow: function onShow() {
     var that = this;
     var that = this;
-
   },
   },
   methods: {
   methods: {
-    search: function search(e) {var _this = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var that;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:
-                that = _this;case 1:case "end":return _context.stop();}}}, _callee);}))();
+    search: function search(e) {var _this = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2() {var that, res;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:
+                that = _this;if (!
+                that.id) {_context2.next = 6;break;}_context2.next = 4;return (
+                  that.$api("order/".concat(that.id), 'GET', {}));case 4:res = _context2.sent;
+                if (res.errcode == '0') {
+                  that.$set(that, "list", res.data.list);
+                  that.$set(that, "shopInfo", res.data);
+                }case 6:case "end":return _context2.stop();}}}, _callee2);}))();
+
     },
     },
     // 下单
     // 下单
     toBuy: function toBuy() {
     toBuy: function toBuy() {
       var that = this;
       var that = this;
-      console.log('结账');
+      that.$refs.popup.open();
+    },
+    close: function close() {
+      var that = this;
+      that.$refs.popup.close();
     } } };exports.default = _default;
     } } };exports.default = _default;
 
 
 /***/ }),
 /***/ }),

+ 3 - 1
unpackage/dist/dev/mp-weixin/pagesHome/order/add.json

@@ -1,6 +1,8 @@
 {
 {
   "navigationBarTitleText": "加菜确认",
   "navigationBarTitleText": "加菜确认",
   "usingComponents": {
   "usingComponents": {
-    "uni-icons": "/uni_modules/uni-icons/components/uni-icons/uni-icons"
+    "uni-icons": "/uni_modules/uni-icons/components/uni-icons/uni-icons",
+    "uni-popup": "/uni_modules/uni-popup/components/uni-popup/uni-popup",
+    "uni-popup-dialog": "/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog"
   }
   }
 }
 }

文件差异内容过多而无法显示
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/order/add.wxml


文件差异内容过多而无法显示
+ 134 - 195
unpackage/dist/dev/mp-weixin/pagesHome/order/index.js


文件差异内容过多而无法显示
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/order/index.wxml


+ 61 - 111
unpackage/dist/dev/mp-weixin/pagesHome/order/info.js

@@ -95,6 +95,32 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return recyclableRender; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return recyclableRender; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "components", function() { return components; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "components", function() { return components; });
 var components
 var components
+try {
+  components = {
+    uniPopup: function() {
+      return __webpack_require__.e(/*! import() | uni_modules/uni-popup/components/uni-popup/uni-popup */ "uni_modules/uni-popup/components/uni-popup/uni-popup").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-popup/components/uni-popup/uni-popup.vue */ 85))
+    },
+    uniPopupDialog: function() {
+      return Promise.all(/*! import() | uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue */ 246))
+    }
+  }
+} catch (e) {
+  if (
+    e.message.indexOf("Cannot find module") !== -1 &&
+    e.message.indexOf(".vue") !== -1
+  ) {
+    console.error(e.message)
+    console.error("1. 排查组件名称拼写是否正确")
+    console.error(
+      "2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"
+    )
+    console.error(
+      "3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件"
+    )
+  } else {
+    throw e
+  }
+}
 var render = function() {
 var render = function() {
   var _vm = this
   var _vm = this
   var _h = _vm.$createElement
   var _h = _vm.$createElement
@@ -204,134 +230,58 @@ __webpack_require__.r(__webpack_exports__);
 //
 //
 //
 //
 //
 //
+//
+//
+//
+//
+//
+//
 var _default =
 var _default =
 {
 {
   data: function data() {
   data: function data() {
     return {
     return {
-      shopInfo: {
-        table: '1',
-        total: 521,
-        numTotal: 9,
-        money: 3,
-        type: '0',
-        num: 3,
-        person: 3,
-        perMoney: 9,
-        time: '2023-02-01 14:10',
-        remark: '无' },
-
-      list: [{
-        _id: '1',
-        code: '0',
-        name: '三文鱼',
-        file: __webpack_require__(/*! ../../static/foods_1.webp */ 34),
-        price: 126,
-        spec: '300g',
-        stock: 100,
-        num: 1 },
-
-      {
-        _id: '2',
-        code: '0',
-        name: '蜜汁扇贝',
-        file: __webpack_require__(/*! ../../static/foods_2.webp */ 25),
-        price: 68,
-        spec: '400g',
-        stock: 140,
-        num: 1 },
-
-      {
-        _id: '3',
-        code: '0',
-        name: '意大利牛排',
-        file: __webpack_require__(/*! ../../static/foods_3.webp */ 35),
-        price: 128,
-        spec: '600g',
-        stock: 200,
-        num: 1 },
-
-      {
-        _id: '4',
-        code: '0',
-        name: '糖醋里脊',
-        file: __webpack_require__(/*! ../../static/foods_4.webp */ 36),
-        price: 58,
-        spec: '500g',
-        stock: 140,
-        num: 1 },
-
-      {
-        _id: '5',
-        code: '2',
-        name: '黑糖珍珠奶茶',
-        file: __webpack_require__(/*! ../../static/foods_1.webp */ 34),
-        price: 18,
-        spec: '500g',
-        stock: 120,
-        num: 1 },
-
-      {
-        _id: '6',
-        code: '2',
-        name: '雪碧',
-        file: __webpack_require__(/*! ../../static/foods_2.webp */ 25),
-        price: 5,
-        spec: '500g',
-        stock: 34,
-        num: 1 },
-
-      {
-        _id: '7',
-        code: '2',
-        name: '可口可乐',
-        file: __webpack_require__(/*! ../../static/foods_3.webp */ 35),
-        price: 5,
-        spec: '500g',
-        stock: 50,
-        num: 1 },
-
-      {
-        _id: '8',
-        code: '1',
-        name: '芝士小蛋糕',
-        file: __webpack_require__(/*! ../../static/foods_2.webp */ 25),
-        price: 12,
-        spec: '260g',
-        stock: 10,
-        num: 1 },
-
-      {
-        _id: '9',
-        code: '1',
-        name: '草莓千层',
-        file: __webpack_require__(/*! ../../static/foods_3.webp */ 35),
-        price: 15,
-        spec: '350g',
-        stock: 40,
-        num: 1 }] };
+      id: '',
+      shopInfo: {},
+      list: [] };
 
 
-
-
-  },
-  onLoad: function onLoad() {
-    var that = this;
   },
   },
+  onLoad: function () {var _onLoad = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {var that;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:
+              that = this;
+              that.$set(that, "id", e.id);
+              that.search();case 3:case "end":return _context.stop();}}}, _callee, this);}));function onLoad(_x) {return _onLoad.apply(this, arguments);}return onLoad;}(),
+
   onShow: function onShow() {
   onShow: function onShow() {
     var that = this;
     var that = this;
   },
   },
   methods: {
   methods: {
-    search: function search(e) {var _this = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var that;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:
-                that = _this;case 1:case "end":return _context.stop();}}}, _callee);}))();
+    search: function search(e) {var _this = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2() {var that, res, table;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:
+                that = _this;if (!
+                that.id) {_context2.next = 12;break;}_context2.next = 4;return (
+                  that.$api("order/".concat(that.id), 'GET', {}));case 4:res = _context2.sent;if (!(
+                res.errcode == '0')) {_context2.next = 12;break;}
+                that.$set(that, "list", res.data.list);
+                that.$set(that, "shopInfo", res.data);_context2.next = 10;return (
+                  that.$api("table/".concat(res.data.table), "GET"));case 10:table = _context2.sent;
+                that.$set(that.shopInfo, "table_num", table.data.name);case 12:case "end":return _context2.stop();}}}, _callee2);}))();
+
+
     },
     },
     // 加菜
     // 加菜
     toAdd: function toAdd() {
     toAdd: function toAdd() {
-      var id = '1';
+      var that = this;
       uni.navigateTo({
       uni.navigateTo({
-        url: "/pagesHome/home/index?id=".concat(id) });
+        url: "/pagesHome/home/index?id=".concat(that.shopInfo.table) });
 
 
     },
     },
     // 结账
     // 结账
-    toBuy: function toBuy() {} } };exports.default = _default;
+    toBuy: function toBuy() {
+      var that = this;
+      that.$refs.popup.open();
+    },
+    close: function close() {
+      var that = this;
+      that.$refs.popup.close();
+    } } };exports.default = _default;
 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
 
 
 /***/ }),
 /***/ }),

+ 4 - 1
unpackage/dist/dev/mp-weixin/pagesHome/order/info.json

@@ -1,4 +1,7 @@
 {
 {
   "navigationBarTitleText": "订单详情",
   "navigationBarTitleText": "订单详情",
-  "usingComponents": {}
+  "usingComponents": {
+    "uni-popup": "/uni_modules/uni-popup/components/uni-popup/uni-popup",
+    "uni-popup-dialog": "/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog"
+  }
 }
 }

文件差异内容过多而无法显示
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/order/info.wxml


文件差异内容过多而无法显示
+ 327 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.js


+ 4 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "component": true
+}

文件差异内容过多而无法显示
+ 1 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.wxml


+ 82 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.wxss

@@ -0,0 +1,82 @@
+.content {
+  display: flex;
+  flex-direction: column;
+  box-sizing: border-box;
+  width: 100vw;
+  height: 100vh;
+}
+.uni-popup-dialog {
+  width: 300px;
+  border-radius: 11px;
+  background-color: #fff;
+}
+.uni-dialog-title {
+  display: flex;
+  flex-direction: row;
+  justify-content: center;
+  padding-top: 25px;
+}
+.uni-dialog-title-text {
+  font-size: 16px;
+  font-weight: 500;
+}
+.uni-dialog-content {
+  display: flex;
+  flex-direction: row;
+  justify-content: center;
+  align-items: center;
+  padding: 20px;
+}
+.uni-dialog-content-text {
+  font-size: 14px;
+  color: #6C6C6C;
+}
+.uni-dialog-button-group {
+  display: flex;
+  flex-direction: row;
+  border-top-color: #f5f5f5;
+  border-top-style: solid;
+  border-top-width: 1px;
+}
+.uni-dialog-button {
+  display: flex;
+  flex: 1;
+  flex-direction: row;
+  justify-content: center;
+  align-items: center;
+  height: 45px;
+}
+.uni-border-left {
+  border-left-color: #f0f0f0;
+  border-left-style: solid;
+  border-left-width: 1px;
+}
+.uni-dialog-button-text {
+  font-size: 16px;
+  color: #333;
+}
+.uni-button-color {
+  color: #007aff;
+}
+.uni-dialog-input {
+  flex: 1;
+  font-size: 14px;
+  border: 1px #eee solid;
+  height: 40px;
+  padding: 0 10px;
+  border-radius: 5px;
+  color: #555;
+}
+.uni-popup__success {
+  color: #4cd964;
+}
+.uni-popup__warn {
+  color: #f0ad4e;
+}
+.uni-popup__error {
+  color: #dd524d;
+}
+.uni-popup__info {
+  color: #909399;
+}
+