Browse Source

feat: 订单bug

2912631854@qq.com 1 year ago
parent
commit
ba324308f5

+ 2 - 2
pages.json

@@ -45,7 +45,7 @@
 				"navigationStyle": "custom"
 			}
 		},
-		
+
 		//房态
 		{
 			"path": "pages/house/index",
@@ -242,7 +242,7 @@
 				{
 					"path": "Mine/Businesses/Businesses",
 					"style": {
-						"navigationBarTitleText": "商户",
+						"navigationBarTitleText": "商户信息",
 						"enablePullDownRefresh": false
 					}
 				}

+ 189 - 27
pagesHouse/Mine/Businesses/Businesses.vue

@@ -109,27 +109,27 @@
 		</view>
 		<view class="from-content" style="padding: 30rpx;">
 			<view class="tenant-image">
-				<view>
+				<view @click="idCardFront">
 					<image :src="list.idCardFront" mode=""></image>
 					<view>法人身份证国徽面</view>
 				</view>
-				<view>
+				<view @click="idCardReverse">
 					<image :src="list.idCardReverse" mode=""></image>
 					<view>法人身份证人像面</view>
 				</view>
-				<view>
+				<view @click="licensePic">
 					<image :src="list.licensePic" mode=""></image>
 					<view>营业执照</view>
 				</view>
-				<view>
+				<view @click="usccl">
 					<image :src="list.usccl" mode=""></image>
 					<view>统一社会信息代码证</view>
 				</view>
-				<view>
+				<view @click="shopSign">
 					<image :src="list.shopSign" mode=""></image>
 					<view>门头照</view>
 				</view>
-				<view>
+				<view @click="shopImgs">
 					<image :src="list.shopImgs" mode=""></image>
 					<view>店铺照片</view>
 				</view>
@@ -161,7 +161,7 @@
 		</u-popup>
 
 		<view class="from-content">
-			<button class="tenant-button">
+			<button class="tenant-button" @click="merchant">
 				立即保存
 			</button>
 		</view>
@@ -194,15 +194,27 @@
 						name: '硕士',
 					}
 				],
+				fishermanId: uni.getStorageSync('merchantId'),
+				list: {},
 				dto: {
-					realName: '黄沙村渔家乐', //昵称
-					modifyPhone: '18755113256', //手机号
-					headUrl: '', // 头像
-					idCode: '', // 证件号
+					name: '', //商户名称
+					busName: '', //企业名称
+					merchantType: 10, //商户类型
+					companyType: '', //企业类型
+					legalPerson: '', //企业法人
+					idCard: '', //法人身份证号码
+					creditCode: '', //统一社区信用代码
+					areaDetail: '', //企业地址
+					linkName: '', //联系人姓名
+					phone: '', //联系人号码
+					idCardFront: '', //法人身份证国徽面
+					idCardReverse: '', //法人身份证人像面
+					licensePic: '', //营业执照
+					usccl: '', //统一社会信息代码证
+					shopSign: '', //门头照
+					shopImgs: '', //店铺照片
 					id: ''
-				},
-				fishermanId: uni.getStorageSync('merchantId'),
-				list: {}
+				}
 			}
 		},
 		onLoad() {
@@ -210,8 +222,38 @@
 		},
 
 		methods: {
-			// 上传头像
-			upImage() {
+			getList() {
+				// this.$api.get('/merchant/merchantFisherman/home?id=' + this.homestayId).then(res => {
+				// 	console.log(res.data);
+				// })
+				let id = this.fishermanId
+				this.$api.get(`/merchant/merchantFisherman/home/${id}`).then(res => {
+					console.log(res.data);
+					this.list = res.data.data
+				})
+			},
+			// 立即保存
+			merchant() {
+				this.dto.name = this.list.name
+				this.dto.busName = this.list.busName
+				this.dto.merchantType = this.list.merchantType
+				this.dto.companyType = this.list.companyType
+				this.dto.legalPerson = this.list.legalPerson
+				this.dto.idCard = this.list.idCard
+				this.dto.creditCode = this.list.creditCode
+				this.dto.idCardReverse = this.list.idCardReverse
+				this.dto.licensePic = this.list.licensePic
+				this.dto.usccl = this.list.usccl
+				this.dto.shopSign = this.list.shopSign
+				this.dto.shopImgs = this.list.shopImgs
+				this.dto.id = uni.getStorageSync('merchantId')
+
+				this.$api.put('/merchant/merchantFisherman/home', this.dto).then(res => {
+					console.log(res);
+				})
+			},
+			// 上传头像法人身份证国徽面
+			idCardFront() {
 				uni.chooseImage({
 					sourceType: ['album'], //从相册选择
 					success: chooseImageRes => {
@@ -226,7 +268,8 @@
 							success: res => {
 								// uploadFile上传成功后,根据和后台的约定msgCode判断接口调用状态
 								let data = JSON.parse(res.data);
-								this.dto.headUrl = data.data.url
+								this.dto.idCardFront = data.data.url
+								this.list.idCardFront = data.data.url
 							}
 						});
 					},
@@ -236,18 +279,137 @@
 				});
 
 			},
+			// 上传法人身份证人像面
+			idCardReverse() {
+				uni.chooseImage({
+					sourceType: ['album'], //从相册选择
+					success: chooseImageRes => {
+						const tempFilePaths = chooseImageRes.tempFilePaths;
+						uni.uploadFile({
+							url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
+							filePath: tempFilePaths[0],
+							name: 'file',
+							header: {
+								token: wx.getStorageSync('access_token')
+							},
+							success: res => {
+								// uploadFile上传成功后,根据和后台的约定msgCode判断接口调用状态
+								let data = JSON.parse(res.data);
+								this.dto.idCardReverse = data.data.url
+								this.list.idCardReverse = data.data.url
+							}
+						});
+					},
+					fail: err => {
+						this.myToast('图片上传失败', 'none');
+					}
+				});
 
-			getList() {
-				// this.$api.get('/merchant/merchantFisherman/home?id=' + this.homestayId).then(res => {
-				// 	console.log(res.data);
-				// })
-				let id = this.fishermanId
-				this.$api.get(`/merchant/merchantFisherman/home/${id}`).then(res => {
-					console.log(res.data);
-					this.list = res.data.data
-				})
-			}
+			}, // 上传营业执照
+			licensePic() {
+				uni.chooseImage({
+					sourceType: ['album'], //从相册选择
+					success: chooseImageRes => {
+						const tempFilePaths = chooseImageRes.tempFilePaths;
+						uni.uploadFile({
+							url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
+							filePath: tempFilePaths[0],
+							name: 'file',
+							header: {
+								token: wx.getStorageSync('access_token')
+							},
+							success: res => {
+								// uploadFile上传成功后,根据和后台的约定msgCode判断接口调用状态
+								let data = JSON.parse(res.data);
+								this.dto.licensePic = data.data.url
+								this.list.licensePic = data.data.url
+							}
+						});
+					},
+					fail: err => {
+						this.myToast('图片上传失败', 'none');
+					}
+				});
 
+			}, // 上传统一社会信息代码证
+			usccl() {
+				uni.chooseImage({
+					sourceType: ['album'], //从相册选择
+					success: chooseImageRes => {
+						const tempFilePaths = chooseImageRes.tempFilePaths;
+						uni.uploadFile({
+							url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
+							filePath: tempFilePaths[0],
+							name: 'file',
+							header: {
+								token: wx.getStorageSync('access_token')
+							},
+							success: res => {
+								// uploadFile上传成功后,根据和后台的约定msgCode判断接口调用状态
+								let data = JSON.parse(res.data);
+								this.dto.usccl = data.data.url
+								this.list.usccl = data.data.url
+							}
+						});
+					},
+					fail: err => {
+						this.myToast('图片上传失败', 'none');
+					}
+				});
+
+			}, // 上传门头照
+			shopSign() {
+				uni.chooseImage({
+					sourceType: ['album'], //从相册选择
+					success: chooseImageRes => {
+						const tempFilePaths = chooseImageRes.tempFilePaths;
+						uni.uploadFile({
+							url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
+							filePath: tempFilePaths[0],
+							name: 'file',
+							header: {
+								token: wx.getStorageSync('access_token')
+							},
+							success: res => {
+								// uploadFile上传成功后,根据和后台的约定msgCode判断接口调用状态
+								let data = JSON.parse(res.data);
+								this.dto.shopSign = data.data.url
+								this.list.shopSign = data.data.url
+							}
+						});
+					},
+					fail: err => {
+						this.myToast('图片上传失败', 'none');
+					}
+				});
+
+			}, // 上传店铺照片
+			shopImgs() {
+				uni.chooseImage({
+					sourceType: ['album'], //从相册选择
+					success: chooseImageRes => {
+						const tempFilePaths = chooseImageRes.tempFilePaths;
+						uni.uploadFile({
+							url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
+							filePath: tempFilePaths[0],
+							name: 'file',
+							header: {
+								token: wx.getStorageSync('access_token')
+							},
+							success: res => {
+								// uploadFile上传成功后,根据和后台的约定msgCode判断接口调用状态
+								let data = JSON.parse(res.data);
+								this.dto.shopImgs = data.data.url
+								this.list.shopImgs = data.data.url
+							}
+						});
+					},
+					fail: err => {
+						this.myToast('图片上传失败', 'none');
+					}
+				});
+
+			},
 		}
 
 

+ 24 - 19
pagesHouse/Mine/index.vue

@@ -4,11 +4,11 @@
 			mode="widthFix"></image>
 		<view class="account" :style="{'margin-top':(mt-44)+'px'}">
 			<view class="a_left">
-				<view class="al_avatar" @tap="toLogin">
-					<image :src="avatar"></image>
+				<view class="al_avatar">
+					<image :src="dto.shopSign"></image>
 				</view>
 				<view class="al_name_edit">
-					<text>{{name}}</text>
+					<text>{{dto.linkName}}</text>
 					<view class="ane_edit" @tap="toTurn('/pagesHouse/Mine/PersonalEditing/PersonalEditing',true)">
 						<text>编辑</text>
 						<image src="https://i.ringzle.com/file/20240129/e824a765b6c24ac6aafbb49b12c23aa9.png"></image>
@@ -62,11 +62,10 @@
 						<view class="demo-layout bg-purple-light">
 							<view class="one2">
 								<!-- {{myList.islandName}} -->
-								{{merchantName}}
+								{{dto.name}}
 							</view>
 							<view class="two2">
-								<!-- {{myList.areaDetail}} -->
-								<!-- 舟山市嵊泗县嵊山镇前卫村后岗 -->
+								{{dto.address}}
 							</view>
 						</view>
 					</u-col>
@@ -118,8 +117,12 @@
 				],
 				price: 0, //钱包余额
 				merchantName: uni.getStorageSync('merchantName'),
+				dto: {}
 			}
 		},
+		onLoad() {
+			this.getInfo();
+		},
 		methods: {
 			toTurn(url, login) { //login 是否需要验证登录跳转
 				if (!url) return this.$showToast('正在开发中...')
@@ -128,19 +131,21 @@
 					url
 				});
 
-				// if (login) {
-				// 	this.$login().then(res => {
-				// 		if (res === 0) {
-				// 			uni.navigateTo({
-				// 				url
-				// 			});
-				// 		} else this.$refs['phoneNumber'].show = true;
-				// 	})
-				// } else {
-				// 	uni.navigateTo({
-				// 		url
-				// 	});
-				// }
+
+			},
+			getInfo() {
+				this.$api.get('/merchant/merchantFisherman/home/' + uni.getStorageSync('merchantId')).then(res => {
+					console.log(res)
+					if (res.data.code == 0) {
+						this.dto = res.data.data;
+						if (!res.data.data.shopSign) {
+							this.dto.shopSign =
+								'https://i.ringzle.com/file/20240225/26feb8cc8f744123a980211ebdfb8d40.png';
+						}
+						this.shopImgs = res.data.data.split(',');
+						console.log(this.shopImgs)
+					}
+				})
 			},
 		}
 	}

+ 13 - 7
pagesHouse/Mine/ordersList/index.vue

@@ -126,7 +126,6 @@
 				} else if (type == -3) {
 					this.changeTab1(4)
 				}
-				this.getOrderList()
 			} else {
 				console.log('2222');
 				this.getOrderList()
@@ -145,23 +144,30 @@
 				let dto = {
 					writeOffCode: item.orderCode
 				}
-				this.$api.post('/merchant/merchantFisherman/home/writeOffOrder?dto=', dto).then(res => {})
+				this.$api.post('/merchant/merchantFisherman/home/writeOffOrder?dto=', dto).then(res => {
+
+				})
 			},
 			// 删除
 			Detail(item) {
+				console.log(this.current);
 				this.$api.del('/merchant/merchantFisherman/home', [
 					item.id
 				]).then(res => {
 					if (res.data.code == 0) {
 						this.$showToast('删除成功');
-						this.getOrderList()
+						// this.getOrderList()
+						setTimeout(() => {
+							this.changeTab1(this.current)
+						}, 1000)
 					} else {
 						this.$showToast('删除失败');
-						this.getOrderList()
+						setTimeout(() => {
+							this.changeTab1(this.current)
+						}, 1000)
+						// this.getOrderList()
 					}
-
 				})
-
 			},
 			changeTab1(index) {
 				this.current = index;
@@ -194,7 +200,7 @@
 			},
 			getOrderByStatusList(state) {
 				this.$api.get('/merchant/merchantFisherman/home/queryMyOrderPage', {
-					// fishermanId:this.homestayId,
+					fishermanId: this.fishermanId,
 					limit: this.limit,
 					page: this.page,
 					state: state

+ 1 - 2
pagesHouse/Verification/handiwork.vue

@@ -12,8 +12,7 @@
 					</view>
 				</view>
 				<view class="two">
-					<u--input type='number' placeholder="请输入核销码" border="none" v-model="value" color='#FFFFFF'
-						size='36'></u--input>
+					<u--input placeholder="请输入核销码" border="none" v-model="value" color='#FFFFFF' size='36'></u--input>
 				</view>
 			</view>
 		</view>