Prechádzať zdrojové kódy

Merge branch 'master' of git.huaml.com:zhh/front-end

shizhongqi 6 mesiacov pred
rodič
commit
b1f122be31

+ 3 - 7
.cursor/rules/project-structure.mdc

@@ -5,22 +5,18 @@ alwaysApply: true
 在执行任何操作前,必须明确识别当前工作的项目目录:
 
 **移动端项目** (uni-app 项目)
-- `hdApp/` - 花店移动端应用
+- `hdApp/` - 零售花店移动端应用
 - `ghsApp/` - 供货商移动端应用  
-- `jdApp/` - 基地业务移动端应用(jd 指的是: 基地的拼音缩写)
 - `mallApp/` - 商城移动端应用
 
 **平板端项目** (uni-app 项目)
-- `hdPad/` - 花店平板端应用
+- `hdPad/` - 零售花店平板端应用
 - `ghsPad/` - 供货商平板端应用
 
 **Web端项目**
-- `hd/` - 花店 Web 端
+- `hd/` - 零售花店 Web 端
 - `ghs/` - 供货商 Web 端
 
-**管理后台**
-- `jdadmin/` - 基地业务管理后台(jd 指的是: 基地的拼音缩写)
-
 ### 目录结构标准
 每个 uni-app 项目都应包含以下标准目录结构:
 

+ 96 - 0
.cursor/rules/style-compatibility.mdc

@@ -0,0 +1,96 @@
+---
+alwaysApply: true
+---
+
+### 样式兼容性规范 - gap 属性处理
+
+#### 概述
+`gap` 属性在 UNI-APP 的 APP 环境中兼容性差,本规范说明如何正确处理间距问题。
+
+#### gap 属性的兼容性问题
+
+**⚠️ 避免使用 gap 属性**
+- `gap` 属性在 APP 环境中(特别是 nvue)可能不生效
+- 微信小程序对 `gap` 的支持有限制
+- 不同平台表现不一致,容易导致布局错乱
+
+#### 推荐做法:使用 margin 代替 gap
+
+**❌ 不推荐的写法**
+```scss
+.container {
+  display: flex;
+  gap: 20upx;  // APP 中可能不生效
+}
+```
+
+**✅ 推荐的写法**
+```scss
+.container {
+  display: flex;
+  flex-direction: column;
+}
+
+.item {
+  margin-top: 20upx;
+  
+  &:first-child {
+    margin-top: 0;
+  }
+}
+```
+
+#### 动态间距类的正确写法
+
+**以协议类组件为例**
+```vue
+<template>
+  <view class="content-wrapper">
+    <view 
+      v-for="(item, index) in items" 
+      :key="index"
+      :class="{
+        'content-item': true,
+        'hasGap': item.gap === 2,
+        'noGap': item.gap !== 2
+      }"
+    >
+      {{ item.content }}
+    </view>
+  </view>
+</template>
+
+<style lang="scss" scoped>
+.content-item {
+  padding: 15upx 0;
+}
+
+.hasGap {
+  margin-top: 40upx;
+}
+
+.noGap {
+  margin-top: 0;
+}
+</style>
+```
+
+#### 条件编译处理 APP 差异
+
+如果需要区分 APP 和小程序的间距值:
+
+```scss
+.hasGap {
+  margin-top: 40upx;  // 小程序默认值
+  
+  /* #ifdef APP-PLUS */
+  margin-top: 50upx;  // APP 可能需要更大间距
+  /* #endif */
+}
+```
+
+#### 检查清单
+
+- [ ] 代码中是否使用了 `gap` 属性?→ 改用 `margin`
+- [ ] 是否为 Flex 容器的第一个子元素设置了 `margin: 0`?
+- [ ] 是否需要针对 APP 调整间距值?→ 使用条件编译

+ 5 - 5
ghsApp/src/admin/home/member.vue

@@ -40,11 +40,11 @@
                 </span>
 
                 <block v-if="item.passStatus == 1">
-                  <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 10000" style="font-size:24upx;margin-left:15upx;color:green;font-weight:bold;">没有下过</text>
-                  <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 7" style="font-size:24upx;margin-left:15upx;color:green;font-weight:bold;">1周未下</text>
-                  <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 30" style="font-size:24upx;margin-left:15upx;color:green;font-weight:bold;">1月未下</text>
-                  <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 180" style="font-size:24upx;margin-left:15upx;color:green;font-weight:bold;">半年未下</text>
-                  <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 365" style="font-size:24upx;margin-left:15upx;color:green;font-weight:bold;">1年未下</text>
+                  <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 10000" style="font-size:24upx;margin-left:15upx;color:green;font-weight:bold;">没有下过</text>
+                  <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 7" style="font-size:24upx;margin-left:15upx;color:green;font-weight:bold;">1周未下</text>
+                  <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 30" style="font-size:24upx;margin-left:15upx;color:green;font-weight:bold;">1月未下</text>
+                  <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 180" style="font-size:24upx;margin-left:15upx;color:green;font-weight:bold;">半年未下</text>
+                  <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 365" style="font-size:24upx;margin-left:15upx;color:green;font-weight:bold;">1年未下</text>
                 </block>
                 <block v-else>
                   <text style="font-size:28upx;margin-left:15upx;color:#3385FF;font-weight:bold;">待审核</text>

+ 1 - 1
ghsApp/src/pages.json

@@ -401,7 +401,7 @@
 			"root": "pagesArrears",
 			"pages": [
 				{ "path": "list", "style": { "navigationBarTitleText": "客户赊账", "enablePullDownRefresh": true } },
-				{ "path": "details", "style": { "navigationBarTitleText": "账订单", "enablePullDownRefresh": false } },
+				{ "path": "details", "style": { "navigationBarTitleText": "账订单", "enablePullDownRefresh": false } },
 				{ "path": "clearResult", "style": { "navigationBarTitleText": "结果"} }
 			]
 		},

+ 5 - 5
ghsApp/src/pagesClient/member/detail.vue

@@ -14,10 +14,10 @@
                   <view style="font-size:26upx;">
                     ID {{userInfo.sn}}
                     <text v-if="userInfo.overTimeUnExpend && userInfo.overTimeUnExpend == 10000" style="margin-left:15upx;color:green;">没有下过单</text>
-                    <text v-if="userInfo.overTimeUnExpend && userInfo.overTimeUnExpend == 7" style="margin-left:15upx;color:green;">1周未下单</text>
-                    <text v-if="userInfo.overTimeUnExpend && userInfo.overTimeUnExpend == 30" style="margin-left:15upx;color:green;">1个月未下单</text>
-                    <text v-if="userInfo.overTimeUnExpend && userInfo.overTimeUnExpend == 180" style="margin-left:15upx;color:green;">半年未下单</text>
-                    <text v-if="userInfo.overTimeUnExpend && userInfo.overTimeUnExpend == 365" style="margin-left:15upx;color:green;">1年未下单</text>
+                    <text v-if="userInfo.overTimeUnExpend && userInfo.overTimeUnExpend == 7" style="margin-left:15upx;color:green;">1周未下单</text>
+                    <text v-if="userInfo.overTimeUnExpend && userInfo.overTimeUnExpend == 30" style="margin-left:15upx;color:green;">1个月未下单</text>
+                    <text v-if="userInfo.overTimeUnExpend && userInfo.overTimeUnExpend == 180" style="margin-left:15upx;color:green;">半年未下单</text>
+                    <text v-if="userInfo.overTimeUnExpend && userInfo.overTimeUnExpend == 365" style="margin-left:15upx;color:green;">1年未下单</text>
 
                     <text v-if="Number(userInfo.black)==2" style="color:red;font-weight:bold;margin-left:15upx;">黑名单</text>
                     <text v-if="Number(userInfo.delStatus)==1" style="color:red;font-weight:bold;margin-left:15upx;">已删除</text>
@@ -128,7 +128,7 @@
         <view class="input-line-wrap">
 
             <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="pageTo({ url: '/pagesArrears/details',query: {id: userInfo.id}})">
-              <div class="tui-title">账订单</div>
+              <div class="tui-title">账订单</div>
             </tui-list-cell>
 
             <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="pageTo({ url: '/admin/clear/customList',query: {customId: userInfo.id}})">

+ 10 - 37
hdApp/src/admin/hb/list.vue

@@ -35,7 +35,9 @@
               <text class="name">{{ item.customName }}</text>
               <text class="amount">¥ {{ item.amount?parseFloat(item.amount):0 }}</text>
             </view>
-            <view class="status" :class="item.statusClass">{{ item.status==0?'待使用':item.status==1?'已使用':item.status==-1?'已失效':'未知'}}</view>
+            <view class="status" :class="{ 'status-wait': item.status == 0, 'status-used': item.status == 1, 'status-expired': item.status == -1 }">
+              {{ item.status==0?'待使用':item.status==1?'已使用':item.status==-1?'已失效':'未知'}}
+            </view>
           </view>
           <view class="card-body">
             <view class="row">开始时间:{{ formatDateTime(item.beginTime) }}</view>
@@ -74,12 +76,11 @@ export default {
   data() {
     return {
       tabIndex: 0,
-      status: 0,
       tabs: [
-        {name: '全部', value: 0},
-        {name: '待使用', value: 0},
-        {name: '已使用', value: 0},
-        {name: '已失效', value: 0}
+        {name: '全部', value: 0,status:''},
+        {name: '待使用', value: 0,status:'0'},
+        {name: '已使用', value: 0,status:'1'},
+        {name: '已失效', value: 0,status:'-1'}
       ],
       searchText: '',
       showSearch: false,
@@ -118,41 +119,13 @@ export default {
       this.getHbList()
     },
     getHbList() {
-      return hbList({
-        status: this.status,
-        page: this.list.page,
-        limit: this.list.pageSize,
-        customId: this.customId
-      }).then((res) => {
-        if (res.data && res.data.list) {
-          res.data.list.forEach(item => {
-            if (item.statusText === '待使用') item.statusClass = 'status-wait'
-            else if (item.statusText === '已使用') item.statusClass = 'status-used'
-            else if (item.statusText === '已失效') item.statusClass = 'status-expired'
-            else item.statusClass = ''
-          })
-        }
+      let status = this.tabs[this.tabIndex].status
+      return hbList({ status: status, page: this.list.page, limit: this.list.pageSize, customId: this.customId }).then((res) => {
         this.completes(res)
       })
     },
     change(e) {
       this.tabIndex = e.index
-      // 状态 -1作废 0未使用 1已使用。0时还要结合endTime来判断是否过期
-      switch (e.index) {
-        case 0:
-          this.status = ''
-          break
-        case 1:
-          this.status = 0
-          break
-        case 2:
-          this.status = 1
-          break
-        case 3:
-          this.status = -1
-          break
-      }
-      
       this.loadData()
     },
     searchFn(e) {
@@ -335,7 +308,7 @@ export default {
         color: #666;
       }
       &.status-expired {
-        color: #999;
+        color: red;
       }
     }
   }

+ 5 - 9
hdApp/src/admin/hb/send.vue

@@ -6,7 +6,7 @@
     </view>
     <view class="form-item">
       <view class="label">红包个数</view>
-      <input class="input" type="number" @focus="form.count=''" v-model="form.count" placeholder="请填写数量" />
+      <input class="input" type="number" @focus="form.count=''" v-model="form.count" placeholder="请输入数量" />
     </view>
     <view class="form-item">
       <view class="label">红包金额</view>
@@ -14,11 +14,11 @@
     </view>
     <view class="form-item">
       <view class="label">最低消费</view>
-      <input class="input" type="digit" @focus="form.minConsume=''" v-model="form.minConsume" placeholder="请填写" />
+      <input class="input" type="digit" @focus="form.minConsume=''" v-model="form.minConsume" placeholder="请输入金额" />
     </view>
     <view class="form-item">
       <view class="label">有效时长</view>
-      <input class="input" type="number" @focus="form.days=''" v-model="form.days" placeholder="请输入天数,0表示永久有效" />
+      <input class="input" type="number" @focus="form.days=''" v-model="form.days" placeholder="请输入天数,0永久有效" />
     </view>
     <view class="form-item">
       <view class="label">备注信息</view>
@@ -26,9 +26,8 @@
     </view>
     <view class="form-item">
       <view class="label">生效时间</view>
-      <view class="value">马上生效</view>
+      <view class="value">实时生效</view>
     </view>
-
     <view class="footer-btn">
       <button class="cancel-btn" @click="cancel">取消</button>
       <button class="confirm-btn" @click="confirm">发放</button>
@@ -81,10 +80,7 @@ export default {
       this.$util.confirmModal({content:'确认发放?'},() => {
         createHb({ userId: this.userId, customId: this.customId, ...this.form, }).then(res => {
           if (res.code == 1) {
-            this.$msg('发放成功')
-            setTimeout(() => {
-              this.$util.pageTo({url: '/admin/hb/result?id='+res.data.id,type:2})
-            }, 500)
+            this.$util.pageTo({url: '/admin/hb/result?id='+res.data.id,type:2})
           }
         })
       })

+ 5 - 5
hdApp/src/admin/home/member.vue

@@ -42,11 +42,11 @@
                       <text v-if="Number(item.balance) < 0" class="negative">-{{ parseFloat(Math.abs(item.balance)) }}</text>
 
                       <block v-if="item.passStatus == 1">
-                        <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 10000" style="margin-left:20upx;color:green;">没有下过</text>
-                        <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 7" style="margin-left:20upx;color:green;">1周未下</text>
-                        <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 30" style="margin-left:20upx;color:green;">1月未下</text>
-                        <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 180" style="margin-left:20upx;color:green;">半年未下</text>
-                        <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 365" style="margin-left:20upx;color:green;">1年未下</text>
+                        <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 10000" style="margin-left:20upx;color:green;">没有下过</text>
+                        <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 7" style="margin-left:20upx;color:green;">1周未下</text>
+                        <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 30" style="margin-left:20upx;color:green;">1月未下</text>
+                        <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 180" style="margin-left:20upx;color:green;">半年未下</text>
+                        <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 365" style="margin-left:20upx;color:green;">1年未下</text>
                       </block>
                       <block v-else>
                         <text style="font-size:26upx;margin-left:20upx;color:#3385FF;font-weight:bold;">待审核</text>

+ 48 - 25
hdApp/src/admin/member/detail.vue

@@ -928,12 +928,16 @@ export default {
         .user-detail-info {
           @include disFlex(flex-start, flex-start);
           flex-direction: column;
-          gap: 8upx;
           
           .user-real-name, .user-id {
             font-size: 30upx;
             color: #666;
             line-height: 1.2;
+            margin-top: 8upx;
+            
+            &:first-child {
+              margin-top: 0;
+            }
           }
         }
       }
@@ -945,7 +949,6 @@ export default {
         .member-badge-row {
           @include disFlex(center, center);
           flex-direction: column;
-          gap: 8upx;
           align-items: center;
           
           .member-badge-icon {
@@ -957,6 +960,7 @@ export default {
             font-size: 26upx;
             color: #09C567;
             text-align: center;
+            margin-top: 8upx;
           }
         }
         
@@ -992,12 +996,12 @@ export default {
         
         .balance-label-row {
           @include disFlex(center, center);
-          gap: 8upx;
           
           .balance-arrow {
             font-size: 24upx;
             color: #999;
             transition: transform 0.3s ease;
+            margin-left: 8upx;
           }
         }
         
@@ -1051,42 +1055,33 @@ export default {
     @include disFlex(center, space-between);
     padding: 10upx 20upx 15upx;
     border-bottom: 1upx solid #f0f0f0;
-    
     .contact-title {
       font-size: 32upx;
       font-weight: 600;
       color: #333;
     }
-    
     .action-buttons {
       @include disFlex(center, center);
-      gap: 30upx;
-      
       .edit-btn, .call-btn {
         width: 60upx;
         height: 60upx;
         @include disFlex(center, center);
         border-radius: 50%;
         font-size: 48upx;
+        margin-left: 50upx;
+        
+        &:first-child {
+          margin-left: 0;
+        }
       }
-      
       .edit-btn {
         background-color: #f8f9fa;
         color: #666;
-        
-        &:active {
-          background-color: #e9ecef;
-        }
       }
-      
       .call-btn {
         background-color: #e8f5e8;
         color: #28a745;
         font-size: 50upx;
-        
-        &:active {
-          background-color: #d4edda;
-        }
       }
     }
   }
@@ -1130,7 +1125,6 @@ export default {
         &.address-text {
           @include disFlex(flex-start, flex-start);
           flex-direction: column;
-          gap: 8upx;
           
           .address-main {
             .city-name {
@@ -1142,7 +1136,7 @@ export default {
           .show-address {
             color: #999;
             font-size: 28upx;
-            margin-top: 4upx;
+            margin-top: 8upx;
           }
         }
       }
@@ -1306,11 +1300,16 @@ export default {
    .payment-buttons {
     display: flex;
     flex-wrap: wrap;
-    gap: 12upx;
     
     button {
       flex: 1;
       min-width: 120upx;
+      margin-right: 12upx;
+      margin-bottom: 12upx;
+      
+      &:nth-child(4n) {
+        margin-right: 0;
+      }
     }
   }
 
@@ -1353,7 +1352,15 @@ export default {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
-   gap: 10upx;
+   
+   > * {
+     margin-right: 10upx;
+     margin-bottom: 10upx;
+     
+     &:last-child {
+       margin-right: 0;
+     }
+   }
  }
 
    .recharge-amount {
@@ -1381,7 +1388,6 @@ export default {
 
    .popup-footer {
     display: flex;
-    gap: 20upx;
     padding: 40upx;
     background: #fff;
     border-top: 1upx solid #f0f0f0;
@@ -1393,6 +1399,11 @@ export default {
       display: flex;
       align-items: center;
       justify-content: center;
+      margin-right: 20upx;
+      
+      &:last-child {
+        margin-right: 0;
+      }
     }
   }
 
@@ -1491,17 +1502,20 @@ export default {
     
     .type-buttons {
       display: flex;
-      gap: 20upx;
       
       button {
         flex: 1;
+        margin-right: 20upx;
+        
+        &:last-child {
+          margin-right: 0;
+        }
       }
     }
     
          .month-buttons {
        display: flex;
        flex-wrap: wrap;
-       gap: 10upx;
      }
      
      .month-button {
@@ -1515,8 +1529,13 @@ export default {
        border-radius: 8upx;
        font-size: 30upx;
        color: #333;
+       margin-right: 10upx;
        margin-bottom: 10upx;
        
+       &:nth-child(4n) {
+         margin-right: 0;
+       }
+       
        &.active {
          background: #e8f5ff;
          border-color: #3385FF;
@@ -1553,7 +1572,6 @@ export default {
      .date-buttons {
        display: flex;
        flex-wrap: wrap;
-       gap: 10upx;
      }
      
      .date-button {
@@ -1567,9 +1585,14 @@ export default {
        border-radius: 8upx;
        font-size: 30upx;
        color: #333;
+       margin-right: 10upx;
        margin-bottom: 10upx;
        box-sizing: border-box;
        
+       &:nth-child(4n) {
+         margin-right: 0;
+       }
+       
        &.active {
          background: #e8f5ff;
          border-color: #3385FF;

+ 6 - 5
mallApp/src/pages/hb/list.vue

@@ -77,22 +77,22 @@ export default {
 				{
 					name: '未使用',
 					value: 0,
-					key: '0'
+					status: '0'
 				},
 				{
 					name: '已使用',
 					value: 0,
-					key: '0'
+					status: '1'
 				},
 				{
 					name: '已过期',
 					value: 0,
-					key: '0'
+					status: '-1'
 				},
 				{
 					name: '全部',
 					value: 0,
-					key: '0'
+					status: ''
 				}
 			]
 		}
@@ -117,7 +117,8 @@ export default {
 			this.getHbList()
 		},
 		getHbList() {
-			return getList({ status: this.tabIndex }).then(res => {
+			let status = this.tabs[this.tabIndex].status
+			return getList({ status: status }).then(res => {
 				if(res.code == 1){
 					this.completes(res)
 				}else{

+ 1 - 1
mallApp/src/pages/member/recharge.vue

@@ -261,7 +261,7 @@ export default {
 			}
 		},
 		paySuccess() {
-			this.$util.pageTo({url: '/pages/member/rechargeResult?id='+this.hdId+'&salt='+this.salt+'&hdId='+this.hdId,type: 2})
+			this.$util.pageTo({url: '/pages/member/rechargeResult?id='+this.hdId+'&salt='+this.salt+'&hdId='+this.hdId+'&account='+this.account,type: 2})
 		},
 		payFail() {
 		},

+ 7 - 1
mallApp/src/pages/member/rechargeResult.vue

@@ -12,6 +12,7 @@
             </view>
             <view class="confirm-btn-wrap">
               <button class="confirm-btn" @click="goBack">我知道了</button>
+              <button class="confirm-btn" @click="myHb">我的红包</button>
             </view>
             <!-- #ifdef MP-WEIXIN -->
             <view style="width:100%;height:10upx;background-color:white;margin-top:60upx;"></view>
@@ -38,6 +39,11 @@
     methods: {
       init(){
       },
+      myHb(){
+        let account = this.option.account?this.option.account:0
+        let hdId = this.option.hdId?this.option.hdId:0
+        this.pageTo({url:"/pages/hb/list?hdId="+hdId+"&account="+account})
+      },
       goBack(){
         uni.navigateBack()
       }
@@ -117,7 +123,7 @@
         align-items: center;
         justify-content: center;
         transition: all 0.3s ease;
-        margin: 0 auto 25upx;
+        margin: 0 auto 35upx;
       }
       .tech-support {
         font-size: 30upx;