浏览代码

修改 优惠券显示问题+添加商品问题

付晓文。 2 月之前
父节点
当前提交
ae660809ae
共有 7 个文件被更改,包括 44 次插入24 次删除
  1. 2 2
      pages/coupon/coupon.vue
  2. 1 1
      pages/coupon/couponDetail.vue
  3. 18 2
      pages/product/creatProduct.vue
  4. 23 19
      pages/store/businessQua.vue
  5. 二进制
      static/coupon/titlebg1.png
  6. 二进制
      static/coupon/titlebg2.png
  7. 二进制
      static/coupon/titlebg3.png

+ 2 - 2
pages/coupon/coupon.vue

@@ -33,7 +33,7 @@
 				<!-- 顶部标题栏 -->
 				<view class="card-header"
 					:style="currentTab == 0 ? 'background: #F4FAFF ' : 'background: #FFF7F3'">
-					<image style=" vertical-align: top" :src="`/static/coupon/titlebg${currentTab + 1}.png`" mode="">
+					<image style=" vertical-align: top" :src="`/static/coupon/titlebg${currentTab + 2}.png`" mode="">
 					</image>
 					<view class="status" v-if="item.delFlag == '1'"
 						:style="currentTab == 0 ? 'color: #4183BC' : 'color: #DB6332'">
@@ -335,7 +335,7 @@
 			// 详情
 			handleDetail(id) {
 				uni.navigateTo({
-					url: `/pages/coupon/couponDetail?id=${id}&tab=${this.currentTab}`
+					url: `/pages/coupon/couponDetail?id=${id}&tab=${this.currentTab+1}`
 				})
 			},
 			mescrollInit(mescroll) {

+ 1 - 1
pages/coupon/couponDetail.vue

@@ -17,7 +17,7 @@
                 <view class="card-header"
                     :style="currentTab == 0 ? 'background: #EFFFFE' : currentTab == 1 ? 'background: #F4FAFF ' : 'background: #FFF7F3'">
                     <image style=" vertical-align: top"
-                        :src="`../../static/coupon/titlebg${Number(currentTab) + 1}.png`" mode=""> </image>
+                        :src="`../../static/coupon/titlebg${Number(currentTab) +1}.png`" mode=""> </image>
                     <view class="status" v-if="couponList.delFlag == '1'"
                         :style="currentTab == 0 ? 'color: #2DAC9F' : currentTab == 1 ? 'color: #4183BC' : 'color: #DB6332'">
                         销售中

+ 18 - 2
pages/product/creatProduct.vue

@@ -78,7 +78,7 @@
 					<view class="picker">
 						
 						<!-- tabIndex==1 -->
-						<u-input :disabled="form.isUpdatePrice==0" v-model="form.price" placeholder="输入商品原价" />
+						<u-input type="digit" :disabled="form.isUpdatePrice==0" v-model="form.price" placeholder="输入商品原价" @input="onPriceInput($event, 'price')" />
 					</view>
 					<view class="unit">
@@ -89,7 +89,7 @@
 						实际售价<span>*</span>
 					</view>
 					<view class="picker">
-						<u-input type="num" :disabled="form.isUpdatePrice==0" v-model="form.soldPrice" placeholder="输入客户实际支付价" />
+						<u-input type="digit" :disabled="form.isUpdatePrice==0" v-model="form.soldPrice" placeholder="输入客户实际支付价" @input="onPriceInput($event, 'soldPrice')" />
 					</view>
 					<view class="unit">
@@ -411,6 +411,22 @@
 			this.updateRangeTime()
 		},
 		methods: {
+			// 价格输入:仅允许非负数字和小数,整数部分不超过7位
+			onPriceInput(value, key) {
+				let filtered = String(value).replace(/[^\d.]/g, '');
+				filtered = filtered.replace(/^\./g, '');
+				filtered = filtered.replace(/\.{2,}/g, '.');
+				const parts = filtered.split('.');
+				const integerPart = parts[0].slice(0, 7);
+				if (parts.length > 1) {
+					filtered = integerPart + '.' + (parts[1].slice(0, 2) || '');
+				} else {
+					filtered = integerPart;
+				}
+				this.$nextTick(() => {
+					this.form[key] = filtered;
+				});
+			},
 			//全选
 			allSelect() {
 				this.all = true

+ 23 - 19
pages/store/businessQua.vue

@@ -97,6 +97,7 @@
 
 		data() {
 			return {
+				specialImg: '',
 				form: {},
 				treeData: [],
 				isSelectType: false,
@@ -217,9 +218,9 @@
 							success: (files) => {
 								let data = JSON.parse(files.data);
 								if (data.success) {
-									// this.specialImg = configService.apiUrl + '/' + data.message
-									row.special = configService.apiUrl + '/' + data.message
-
+									const imageUrl = configService.apiUrl + '/' + data.message
+									this.$set(row, 'special', imageUrl)
+									this.$set(row, 'imgList', [{ url: imageUrl }])
 								}
 							}
 						});
@@ -246,19 +247,22 @@
 					return
 				}
 				const categoryIds = categoryId.split(',').filter(Boolean)
-				const qualificationNameListDTOS = this.qualificationNameMap.map((item, index) => ({
-					...item,
-					categoryId: item.categoryId || categoryIds[index] || categoryId,
-					qualificationNameCategoryDTOS: (item.qualificationNameCategoryDTOS || []).map((row) => ({
-						...row,
-						special: row.special || ''
+				const qualificationNameListDTOS = this.qualificationNameMap.map((item, index) => {
+					const qualificationNameCategoryDTOS = (item.qualificationNameCategoryDTOS || []).map((row) => ({
+						categoryId: row.categoryId,
+						categoryName: row.categoryName,
+						qualificationName: row.qualificationName,
+						special: row.special || row.imgList?.[0]?.url || ''
 					}))
-				}))
-				const specialList = []
-				this.qualificationNameMap.forEach((item) => {
-					item.qualificationNameCategoryDTOS?.forEach((row) => {
-						if (row.special) specialList.push(row.special)
-					})
+					const specialImages = qualificationNameCategoryDTOS
+						.map((row) => row.special)
+						.filter(Boolean)
+					return {
+						categoryId: item.categoryId || categoryIds[index] || categoryId,
+						categoryName: item.categoryName || categoryName[index] || categoryName,
+						special: item.special || specialImages.join(',') || null,
+						// qualificationNameCategoryDTOS
+					}
 				})
 				let data = {
 					merchantId: uni.getStorageSync(USER_INFO).merchantId,
@@ -267,8 +271,8 @@
 					categoryId,
 					qualificationNameListDTOS,
 					source: 1,
-					special: specialList.join(','),
 				};
+				
 
 				if (hasEmptyImage) {
 					uni.showToast({
@@ -315,9 +319,9 @@
 							}
 						})
 					}
-					this.$http.post('/merchant/examine/new/special/check', data).then((res) => {
-						// this.getDetail();
-					});
+					// this.$http.post('/merchant/examine/new/special/check', data).then((res) => {
+					// 	// this.getDetail();
+					// });
 				}
 
 				// let data = {

二进制
static/coupon/titlebg1.png


二进制
static/coupon/titlebg2.png


二进制
static/coupon/titlebg3.png