绿满眶商城微信小程序-uniapp
xiangpei
2025-06-15 9d928b12c49b7b604c0b52ce1d98846813d5b613
pages/userPermissions/userPermissions.vue
@@ -23,6 +23,7 @@
            </view>
            <!-- 操作按钮区域 -->
            <view class="action-buttons">
               <u-button type="primary" size="mini" @click.stop="restPassword(user.memberId)" class="edit-btn">重置密码</u-button>
               <u-button type="primary" size="mini" @click.stop="navigateToDetail(user.id)" class="edit-btn">修改</u-button>
               <u-button type="error" size="mini" @click.stop="deleteUser(user.id)"
                  class="delete-btn">删除</u-button>
@@ -31,18 +32,24 @@
         </view>
         <!-- 加载更多提示 -->
         <view class="load-more" v-if="loading">
            <u-loading :show="loading"></u-loading>
         <view class="load-more">
           <u-loadmore
             v-if="mockData.length > 0"
             :status="loading ? 'loading' : noMore ? 'nomore' : 'loadmore'"
             :load-text="{
               loadmore: '上拉加载更多',
               loading: '正在加载',
               nomore: '没有更多了'
             }"
           />
         </view>
         <view class="load-more" v-if="noMoreData">
            <text>没有更多数据了</text>
         <view style="height:150rpx">
         </view>
      </scroll-view>
      <!-- 空状态 -->
      <view class="empty" v-else>
         <text>暂无用户数据</text>
      </view>
   </view>
</template>
@@ -51,7 +58,8 @@
      getPage,
      del,
      add,
      update
      update,
      restPassword
   } from "@/api/userPermissions.js"
   import UIcon from '@/uview-components/uview-ui/components/u-icon/u-icon.vue';
   import UButton from '@/uview-components/uview-ui/components/u-button/u-button.vue';
@@ -95,6 +103,17 @@
         this.getPage()
      },
      methods: {
         restPassword(id){
            restPassword(id).then(res=>{
               if(res.statusCode === 200){
                  uni.showToast({
                     title: res.data.msg, // 提示文字
                     icon: 'none', // 图标类型(success/loading/none)
                     mask: true // 是否显示透明蒙层(防止触摸穿透)
                  });
               }
            })
         },
         async getPage() {
            //
            uni.showLoading({
@@ -257,30 +276,12 @@
         }
      }
   }
   .load-more {
      padding: 20rpx;
      text-align: center;
      color: #999;
      font-size: 28rpx;
   }
            padding: 20rpx 0;
            text-align: center;
            color: #999;
            font-size: 26rpx;
            background-color: #f7f8fa;
         }
   .empty {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 40rpx;
      image {
         width: 200rpx;
         margin-bottom: 20rpx;
      }
      text {
         color: #999;
         font-size: 28rpx;
      }
   }
</style>