فهرست منبع

添加退出、修改商户信息等

付晓文。 2 ماه پیش
والد
کامیت
a0542dde80
6فایلهای تغییر یافته به همراه92 افزوده شده و 37 حذف شده
  1. 28 0
      pages/index/full.vue
  2. 7 3
      pages/product/creatProduct.vue
  3. 3 1
      pages/product/index.vue
  4. 1 1
      pages/store/businessInfor.vue
  5. 53 32
      pages/store/businessQua.vue
  6. BIN
      static/login/tuichu.png

+ 28 - 0
pages/index/full.vue

@@ -40,6 +40,17 @@
 				</view>
 			</view>
 		</view>
+		<view class="function">
+			<view class="title">
+				设置
+			</view>
+			<view class="fun_box">
+				<view class="item"style="margin: 0px;" @click="loginOut">
+					<image src="@/static/login/tuichu.png" mode=""></image>
+					退出
+				</view>
+			</view>
+		</view>
 
 		<!-- 弹窗 -->
 		<Modal ref="myModal"
@@ -52,6 +63,7 @@
 
 <script>
 import Modal from '@/components/modal/index.vue';
+	import api from "@/api/api";
 export default {
 	components: {
 		Modal,
@@ -132,6 +144,22 @@ export default {
 		}
 	},
 	methods: {
+		loginOut(){
+			uni.showModal({
+				title: '提示',
+				content: '是否确认退出当前账号?',
+				success: (res) => {
+					if (res.confirm) {
+						api.logout().then(res=>{
+							uni.clearStorageSync();
+							uni.navigateTo({
+								url: `/pages/login/login`
+							});
+						})
+					}
+				}
+			});
+		},
 		storeFunc(item) {
 			// 需要先报名
 			if (item.name === '团餐活动') {

+ 7 - 3
pages/product/creatProduct.vue

@@ -27,7 +27,9 @@
 						商品名称<span>*</span>
 					</view>
 					<view class="picker">
-						<u-input :disabled="tabIndex==1" v-model="form.productName" placeholder="输入商品名称" />
+						
+						<!-- tabIndex==1 -->
+						<u-input :disabled="form.isUpdatePrice==0" v-model="form.productName" placeholder="输入商品名称" />
 					</view>
 				</view>
 				<view class="item">
@@ -74,7 +76,9 @@
 						原价<span>*</span>
 					</view>
 					<view class="picker">
-						<u-input :disabled="tabIndex==1" v-model="form.price" placeholder="输入商品原价" />
+						
+						<!-- tabIndex==1 -->
+						<u-input :disabled="form.isUpdatePrice==0" v-model="form.price" placeholder="输入商品原价" />
 					</view>
 					<view class="unit">
@@ -638,7 +642,7 @@
 				})
 			},
 			selectProductType() {
-				if (this.tabIndex == '0') {
+				if (this.tabIndex == '0' || this.form.isUpdatePrice == 1) {
 					this.isSelectType = true
 					this.showText = ''
 					this.productType = []

+ 3 - 1
pages/product/index.vue

@@ -455,12 +455,14 @@ export default {
 			// } else {
 				this.sellProducts.push({
 					productId: item.productId,
-					productStatus: 1
+					// productStatus: 1,
+					productStatus: 2
 				})
 				this.isSell = true
 			// }
 		},
 		sellProduct() {
+			
 			this.$http.post("/app/product/shelves", this.sellProducts)
 				.then(res => {
 					if (res.data.code == 200) {

+ 1 - 1
pages/store/businessInfor.vue

@@ -179,7 +179,7 @@
 		},
 		methods: {
 			back() {
-				uni.navigateTo({ url: '/pages/store/settings' });
+				uni.navigateBack();
 			},
 			selectAddress() {
 				uni.navigateTo({ url: '/pages/store/selectTdMap?url=' + '/pages/store/businessInfor' });

+ 53 - 32
pages/store/businessQua.vue

@@ -104,6 +104,7 @@
 				treeLeft: [], //一级列表
 				showText: '',
 				classifyList: [],
+				categoryId: '',
 				qualificationNameMap: []
 			}
 		},
@@ -115,25 +116,32 @@
 			if (data.params) {
 				let obj = JSON.parse(decodeURIComponent(data.params));
 				this.form = obj
-				this.qualificationNameMap = this.form.qualificationNameListDTOS;
-				this.qualificationNameMap.forEach((item) => {
-					this.showText += item.categoryName + ' / '
-					item.qualificationNameCategoryDTOS?.forEach((row) => {
-						// row.special = '';
-						row.imgList = [];
-						row.imgList.push({
-							url: row.special,
+				console.log('onLoad',obj)
+				const list = this.form.qualificationNameListDTOS || []
+				this.qualificationNameMap = list
+				if (list.length) {
+					this.classifyList = list.map((item) => item.categoryId).filter(Boolean)
+					this.categoryId = this.classifyList.join(',')
+					list.forEach((item) => {
+						this.showText += item.categoryName + ' / '
+						item.qualificationNameCategoryDTOS?.forEach((row) => {
+							row.imgList = [];
+							row.imgList.push({
+								url: row.special,
+							});
 						});
 					});
-				});
-				// this.specialImg = obj.special
+				} else if (this.form.categoryId) {
+					this.categoryId = this.form.categoryId
+					this.classifyList = this.form.categoryId.split(',').filter(Boolean)
+				}
 			}
 		},
 		methods: {
 			getTree() {
 				this.$http.get('/sys/category/loadTreeRoot?pcode=' + 'c09' + '&async=' + false).then(res => {
-					this.treeData = res.data.result
-					console.log(this.treeData)
+					// 只展示一级分类,去掉子级
+					this.treeData = (res.data.result || []).map(({ children, ...item }) => item)
 				})
 			},
 			showPicker() {
@@ -149,8 +157,8 @@
 			},
 			//监听选择(ids为数组)
 			selectChange(ids, names) {
-				console.log(ids, names)
 				this.classifyList = ids
+				this.categoryId = ids.join(',')
 				this.showText = names
 				this.selectClassify()
 			},
@@ -160,7 +168,12 @@
 				let categoryNames = this.showText
 				this.$http.get('/localQualificationClassifica/localQualificationClassifica/getByCategoryId?categoryIds=' +
 					categoryIds + '&merchantId=' + merchantId + '&categoryNames=' + categoryNames).then(res => {
-					this.qualificationNameMap = res.data.result
+					this.qualificationNameMap = res.data.result || []
+					const ids = this.qualificationNameMap.map((item) => item.categoryId).filter(Boolean)
+					if (ids.length) {
+						this.classifyList = ids
+						this.categoryId = ids.join(',')
+					}
 					this.qualificationNameMap.forEach((item) => {
 						item.qualificationNameCategoryDTOS?.forEach((row) => {
 							row.special = row.special ? row.special : '';
@@ -218,34 +231,42 @@
 				let hasEmptyImage = false;
 				this.qualificationNameMap.forEach((item) => {
 					item.qualificationNameCategoryDTOS?.forEach((row) => {
-						console.log(row);
-						// if (row.imgList[0]?.response) {
-						//   row.special = import.meta.env.VITE_GLOB_DOMAIN_URL + '/' + row.imgList[0].response.message;
-						// }
-
-						// 检查图片是否为空
 						if (!row.special) {
 							hasEmptyImage = true;
 						}
 					});
 				});
+				const categoryId = this.categoryId ||
+					this.classifyList.filter(Boolean).join(',') ||
+					this.qualificationNameMap.map((item) => item.categoryId).filter(Boolean).join(',')
+				if (!categoryId) {
+					uni.showToast({
+						icon: 'none',
+						title: '请选择分类'
+					})
+					return
+				}
+				const categoryIds = categoryId.split(',').filter(Boolean)
+				const qualificationNameListDTOS = this.qualificationNameMap.map((item, index) => ({
+					...item,
+					categoryId: item.categoryId || categoryIds[index] || categoryId
+				}))
 				let data = {
 					merchantId: uni.getStorageSync(USER_INFO).merchantId,
 					merchantUserId: this.form.merchantUserId,
 					merchantUserName: this.form.merchantUserName,
-					// special: this.specialImage[0].url,
-					qualificationNameListDTOS: this.qualificationNameMap,
+					categoryId,
+					qualificationNameListDTOS,
 					source: 1,
 				};
-				console.log(data);
-
-				if (hasEmptyImage) {
-					// message.error('请上传全部图片');
-					uni.showToast({
-						icon: 'none',
-						message: '请上传全部图片'
-					})
-				} else {
+				
+
+				// if (hasEmptyImage) {
+				// 	uni.showToast({
+				// 		icon: 'none',
+				// 		title: '请上传全部图片'
+				// 	})
+				// } else {
 					if (this.form.specialStatus == null) {
 						this.$http.post('/merchant/localMerchantSpecial/add', data).then(res => {
 							if (res.data.success) {
@@ -288,7 +309,7 @@
 					// this.$http.post('/merchant/examine/new/special/check', data).then((res) => {
 					// 	// this.getDetail();
 					// });
-				}
+				// }
 
 				// let data = {
 				// 	merchantId: uni.getStorageSync(USER_INFO).merchantId,

BIN
static/login/tuichu.png