Browse Source

feat: 订单bug

2912631854@qq.com 1 year ago
parent
commit
3994ca4e5e

+ 12 - 0
http/baseApi.js

@@ -0,0 +1,12 @@
+// const BaseApi = 'http://192.168.2.190:8080' //汪瑶
+// const BaseApi = 'http://192.168.2.205:8080' //汪辉
+// const BaseApi = 'http://192.168.2.19:8080' //李勇
+// const BaseApi = 'http://192.168.3.13:8080' //徐涛
+// const BaseApi = 'http://192.168.2.39:8080' //肖添伟
+// const BaseApi = 'http://192.168.3.6:8080' //朱壮波
+
+const BaseApi = 'https://i.ringzle.com/island-cloud-server' //测试服务器 
+
+export {
+	BaseApi
+}

+ 26 - 1
pages/HotelMerchandise/addCommodity.vue

@@ -110,15 +110,40 @@
 		methods: {
 			// 保存  上架
 			Shelves(status) {
+
 				if (!this.fromData.comboName) return this.$showToast("请添商品名称");
 				if (!this.fromData.price) return this.$showToast("请填写价格");
 				if (!this.fromData.comboType) return this.$showToast("请选择套餐类型");
 				if (!this.fromData.comboExplain) return this.$showToast("请填写套餐内容");
 				if (!this.fromData.cover) return this.$showToast("请上传主图/封面");
 				if (!this.fromData.introduction) return this.$showToast("请上传套餐照片");
-
+				this.fromData.status = status
 				this.$api.post('/merchant/hotel/repast', this.fromData).then(res => {
 					console.log(res.data);
+					if (res.data.code == 0) {
+						if (status == 0) {
+							this.$showToast('保存成功');
+
+							setTimeout(() => {
+								uni.redirectTo({
+									url: '/pages/HotelMerchandise/index'
+								})
+								// uni.navigateBack(1)
+							}, 1000);
+
+						} else {
+							this.$showToast('上架成功');
+
+							setTimeout(() => {
+								uni.redirectTo({
+									url: '/pages/HotelMerchandise/index'
+								})
+								// uni.navigateBack(1)
+							}, 1000);
+						}
+
+
+					} else this.$showToast(res.data.msg);
 				})
 			},
 

+ 1 - 1
pages/HotelMerchandise/index.vue

@@ -284,7 +284,7 @@
 				this.showPricing = true
 			},
 			GoOndel() {
-				this.$api.del('/merchant/hotel/repast', ids).then(res => {
+				this.$api.del('/merchant/hotel/repast', this.ids).then(res => {
 					console.log(res);
 					if (res.data.code == 0) {
 						this.getRepast()

+ 1 - 1
pages/home/index.vue

@@ -220,7 +220,7 @@
 					onlyFromCamera: true,
 					success: (res) => {
 						console.log('扫描二维码成功,结果:' + res.result);
-						this.$api.get('/merchant/merchantFisherman/home/getDetails?writeOffCode=' + res.result)
+						this.$api.get('/merchant/hotel/repast/writeOffOrder?orderCode=' + res.result)
 							.then(res => {
 								if (res.data.code == 0) {
 									this.value = ''