Bladeren bron

红包功能相关页面调整与更新

shizhongqi 6 maanden geleden
bovenliggende
commit
64ecce2912

+ 1 - 1
.cursor/rules/general-rules.mdc

@@ -10,7 +10,7 @@ alwaysApply: true
 3. **生命周期**: 精确理解并使用 uni-app 的页面生命周期 (`onLoad`, `onShow`, `onReady`, `onHide`, `onUnload`) 和应用生命周期 (`onLaunch`, `onShow`, `onError`, `onHide`)。
 4. **条件编译**: 熟练运用条件编译 (`#ifdef H5`, `#ifdef MP-WEIXIN`, `#ifdef APP-PLUS`, `#endif`) 来处理不同平台的特定逻辑和样式。
 5. **配置文件**: 充分理解 `pages.json` (用于页面路由、导航栏和样式配置) 和 `manifest.json` (用于应用标识、图标、权限和模块配置) 的重要性。
-6. **样式单位**: 在编写 CSS/SCSS/LESS 时,默认使用 `rpx` 作为响应式尺寸单位,以确保在不同尺寸的设备上表现一致。
+6. **样式单位**: 在编写 CSS/SCSS/LESS 时,默认使用 `upx` 作为响应式尺寸单位,以确保在不同尺寸的设备上表现一致。
 7. **项目结构**: 认知并遵循标准的 uni-app 项目结构,例如 `pages` 目录存放页面,`components` 存放可复用组件,`static` 存放静态资源, `store` 存放状态管理。
 8. **性能优化**: 在生成代码时,考虑到小程序的性能限制,例如避免在视图层进行复杂的运算,合理使用 `v-if` 和 `v-show`,避免频繁的 setData 操作。
 9. **Vue 语法**: 本项目使用的是 Vue 2,请使用 Options API。

+ 6 - 0
hdApp/src/admin/hb/list.vue

@@ -87,6 +87,12 @@ export default {
       customId: 0
     }
   },
+  onLoad(options) {
+    if (options.customId) {
+      this.customId = options.customId
+      this.$refs.searchRef.search = options.customName
+    }
+  },
   onShow() {
     this.loadData()
   },

+ 18 - 8
hdApp/src/admin/member/detail.vue

@@ -148,6 +148,9 @@
         <tui-list-cell @click="pageTo({ url: '/admin/order/itemOrder?customId='+data.id })" class="line-cell" :hover="false" :arrow="true" >
             <view class="tui-title">下单记录</view>
         </tui-list-cell>
+        <tui-list-cell @click="pageTo({ url: '/admin/hb/list?customId='+data.id + '&customName='+data.name })" class="line-cell" :hover="false" :arrow="true" >
+            <view class="tui-title">红包记录</view>
+        </tui-list-cell>
         <tui-list-cell @click="pageTo({ url: '/admin/custom/levelChange?id='+data.id })" class="line-cell" :hover="false" :arrow="true" >
             <view class="tui-title">等级变动</view>
         </tui-list-cell>
@@ -510,6 +513,13 @@ export default {
             this.beginModifyMember()
           }
         },
+        {
+          name: "发红包",
+          icon: "🧧",
+          funtion: () => {
+            this.sendHb()
+          }
+        },
         {
           name: "减余额",
           icon: "➖",
@@ -591,8 +601,11 @@ export default {
       // 已废弃,现在使用展开方式
     },
     addOrder(){
-      this.$util.pageTo({url:'/admin/billing/index2?customId='+this.data.id+'&customName='+this.data.name})
-    },    
+      uni.navigateTo({url:'/admin/billing/index2?customId='+this.data.id+'&customName='+this.data.name})
+    },  
+    sendHb(){
+      uni.navigateTo({url:'/admin/hb/send?customId='+this.data.id+'&customName='+this.data.name + '&userId='+this.data.userId})
+    },   
     // 打开减余额弹框
     openDeductPopup(){
       this.$refs.deductPopupRef.open('center')
@@ -1181,10 +1194,10 @@ export default {
 .tabs-wrap {
   padding: 40upx 10upx;
   @include disFlex(center, center);
-  flex-wrap: wrap;
+  flex-wrap: nowrap;
   .tabs-list {
-    width: 25%;
-    margin-bottom: 10upx;
+    flex: 1;
+    margin-bottom: 0;
     text-align: center;
     .tabs-icon {
       width: 50upx;
@@ -1202,9 +1215,6 @@ export default {
       color: $fontColor2;
       font-size: 30upx;
     }
-    &:nth-child(n + 5) {
-      margin-bottom: 0;
-    }
   }
 }
 // 备注

+ 4 - 3
hdApp/src/admin/order/detail.vue

@@ -225,14 +225,15 @@
             </view>
 
             <!-- 红包信息 -->
-            <view class="msg-list" v-if="orderInfo.hbId && orderInfo.hbId != '0'">
+            <view class="msg-list" v-if="orderInfo.hbId && Number(orderInfo.hbId) != 0">
               <view class="label">红包:</view>
               <view class="value">¥{{ orderInfo.hbAmount ? parseFloat(orderInfo.hbAmount) : 0 }}</view>
-              <button
+              <button v-if="Number(orderInfo.hbId) > 0"
                 class="admin-button-com"
                 :class="canBackHb ? 'blue' : 'default'"
                 @click.stop="backHbFun()"
               >退回红包</button>
+              <text v-else>已退回</text>
             </view>
 
             <!-- 欠款信息 -->
@@ -864,7 +865,7 @@ export default {
       this.$util.confirmModal({ content: tip }, async () => {
         uni.showLoading({ title: '处理中...' })
         try {
-          const res = await backHb({ id: hbIdNum, status: 0 })
+          const res = await backHb({ id: hbIdNum, status: 0, orderId: this.orderInfo.id })
           uni.hideLoading()
           if (res && res.code == 1) {
             this.$msg(res.msg || '操作成功')