绿满眶商城微信小程序-uniapp
zxl
2025-07-23 1ae987d882c1d67c0ee11c40af05d311df9e214b
需求改动
8个文件已修改
180 ■■■■■ 已修改文件
pages.json 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/mine/set/personMsg.vue 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/passport/wechatMPLogin.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/supplier/suppler-order/suppler-order.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/tabbar/user/utils/tool.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/userPermissions/addStoreMember.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/userPermissions/userPermissions.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json
@@ -1785,8 +1785,12 @@
        {
          "path": "suppler-order",
          "style": {
            "navigationBarTitleText": "供应商端"
            "navigationBarTitleText": "供应商端",
            // "navigationStyle": "custom"
            "componentPlaceholder":{
                "u-empty":"view",
                "u-image":"view"
            }
          }
        },
        {
@@ -1933,7 +1937,7 @@
        {
          "path": "userPermissions",
          "style": {
            "navigationBarTitleText": "用户权限",
            "navigationBarTitleText": "店员管理",
            "componentPlaceholder": {
              "u-icon": "view",
              "u-button": "view",
pages/mine/set/personMsg.vue
@@ -1,14 +1,16 @@
<template>
    <view class="person-msg">
        <view class="head c-content" @click="changeFace">
        <view class="head c-content">
            <image v-if="form.face" :src="endpoint + '/' + form.face" mode=""></image>
            <image v-else :src="'/pages/subComponents/static/missing-face.png'" mode=""></image>
            <view>点击修改头像</view>
            <button class="avatar-button" type="default" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">点击修改头像</button>
        </view>
        <u-form :model="form" ref="uForm" class="form">
            <u-form-item label="昵称" label-width="150">
                <u-input v-model="form.nickName" placeholder="请输入昵称" />
                <u-input v-model="form.nickName" placeholder="请输入昵称" type="nickname"/>
            </u-form-item>
            <u-form-item label="性别" label-width="150">
                <u-radio-group v-model="form.sex" :active-color="lightColor">
                    <u-radio name="1">男</u-radio>
@@ -127,6 +129,7 @@
            this.getMemberTag()
        },
        methods: {
            toggleTag(tag) {
                console.log(tag)
            },
@@ -278,39 +281,67 @@
                    }
                });
            },
            /**
             * 修改头像
             * @param {Object} e
             */
            onChooseAvatar(e){
                console.log(e.detail.avatarUrl)
                console.log("")
                console.log(e.detail)
                const tempFilePath = e.detail.avatarUrl;
                let fileName = tempFilePath.substring(tempFilePath.lastIndexOf('/') + 1);
                if (fileName.indexOf('%') > -1) {
                    fileName = decodeURIComponent(fileName);
                }
                const fileKey = getFileKey(fileName);
                this.cosClient.uploadFile({
                    Bucket: this.bucket,
                    Region: this.region,
                    Key: fileKey,
                    FilePath: tempFilePath,
                    SliceSize: 1024 * 1024 * 5 /* 触发分块上传的阈值,5M */
                }, (err, data) => {
                    if (err) {
                        console.log('上传失败', err);
                    } else {
                        this.form.face = fileKey;
                    }
                });
            },
            /**
             * 修改头像
             */
            changeFace(index) {
                uni.chooseImage({
                    count: 1,
                    sizeType: ['compressed'],
                    sourceType: ['album'],
                    success: (chooseImageRes) => {
                        const tempFilePath = chooseImageRes.tempFilePaths[0];
                        let fileName = tempFilePath.substring(tempFilePath.lastIndexOf('/') + 1);
                        // 处理安卓可能的URI编码
                        if (fileName.indexOf('%') > -1) {
                            fileName = decodeURIComponent(fileName);
                        }
                        const fileKey = getFileKey(fileName);
                        this.cosClient.uploadFile({
                            Bucket: this.bucket,
                            Region: this.region,
                            Key: fileKey,
                            FilePath: tempFilePath,
                            SliceSize: 1024 * 1024 * 5 /* 触发分块上传的阈值,5M */
                        }, (err, data) => {
                            if (err) {
                                console.log('上传失败', err);
                            } else {
                                this.form.face = fileKey;
                            }
                        });
                    },
                });
            },
            // changeFace(index) {
            //     uni.chooseImage({
            //         count: 1,
            //         sizeType: ['compressed'],
            //         sourceType: ['album'],
            //         success: (chooseImageRes) => {
            //             const tempFilePath = chooseImageRes.tempFilePaths[0];
            //             let fileName = tempFilePath.substring(tempFilePath.lastIndexOf('/') + 1);
            //             // 处理安卓可能的URI编码
            //             if (fileName.indexOf('%') > -1) {
            //                 fileName = decodeURIComponent(fileName);
            //             }
            //             const fileKey = getFileKey(fileName);
            //             this.cosClient.uploadFile({
            //                 Bucket: this.bucket,
            //                 Region: this.region,
            //                 Key: fileKey,
            //                 FilePath: tempFilePath,
            //                 SliceSize: 1024 * 1024 * 5 /* 触发分块上传的阈值,5M */
            //             }, (err, data) => {
            //                 if (err) {
            //                     console.log('上传失败', err);
            //                 } else {
            //                     this.form.face = fileKey;
            //                 }
            //             });
            //         },
            //     });
            // },
            /**
             * 选择地址
@@ -497,4 +528,16 @@
        color: #999;
        font-size: 24rpx;
    }
    .avatar-button {
        background: transparent;
        color: $font-color-light;
        font-size: $font-sm;
        line-height: 2em;
        margin: 0;
        padding: 0;
        border: none;
        &::after {
          border: none;
        }
      }
</style>
pages/passport/wechatMPLogin.vue
@@ -16,8 +16,7 @@
                <view class="logo-info">
                    <text class="title">欢迎进入{{ projectName }}</text>
                </view>
                <!-- <input ref="nicknameInput"  type="nickname"/>
                <button type="default" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">选择</button> -->
                <view class="small-tips">
                    <view>为您提供优质服务,{{ projectName }}需要获取以下信息</view>
                    <view>您的公开信息(昵称、头像)</view>
@@ -114,9 +113,7 @@
                    url: `/pages/tabbar/home/index`,
                });
            },
            onChooseAvatar(e){
                console.log(e.detail.avatarUrl)
            },
            //获取用户信息
      getUserProfile(e) {
                if(!this.checked){
pages/supplier/suppler-order/suppler-order.vue
@@ -179,13 +179,13 @@
          orderList: [],
          pageNumber: 1,
        },
        // {
        //   state: 4,
        //   text: "已完成",
        //   loadStatus: "more",
        //   orderList: [],
        //   pageNumber: 1,
        // },
        {
          state: 4,
          text: "已完成",
          loadStatus: "more",
          orderList: [],
          pageNumber: 1,
        },
        // {
        //   state: 5,
        //   text: "已取消",
@@ -214,9 +214,9 @@
        {
          orderStatus: "WAIT_ROG", //待收货
        },
        // {
        //   orderStatus: "COMPLETE", //已完成
        // },
        {
          orderStatus: "COMPLETE", //已完成
        },
        // {
        //   orderStatus: "CANCELLED", //已取消
        // },
pages/tabbar/user/utils/tool.vue
@@ -65,7 +65,7 @@
                    <view class="interact-item" v-if="isStoreManger" @click="navigateTo('/pages/userPermissions/userPermissions')">
                        <image src="/static/mine/shensu.png" mode=""></image>
                        <view>新增店员</view>
                        <view>店员管理</view>
                    </view>
                    <view class="interact-item"  @click="navigateTo('/pages/news/news')">
                        <image src="/static/mine/shensu.png" mode=""></image>
pages/userPermissions/addStoreMember.vue
@@ -19,7 +19,7 @@
                    <u-input v-model="form.password" placeholder="请输入密码" border="none" type="password" />
                </u-form-item>
                <u-form-item label="超级管理员" prop="isSuper" borderBottom required="true">
                <u-form-item label="店铺管理员" prop="isSuper" borderBottom required="true">
                    <view class="switch-wrapper">
                        <u-switch v-model="form.isSuper"></u-switch>
                    </view>
pages/userPermissions/userPermissions.vue
@@ -2,17 +2,17 @@
    <view class="container">
        <!-- 标题 -->
        <view class="header">
            <text class="title">用户列表</text>
            <text class="title">店员列表</text>
        </view>
        <view>
            <button class="add-btn" @click="navigateToAdd()">新增用户</button>
            <button class="add-btn" @click="navigateToAdd()">新增店员</button>
        </view>
        <!-- 搜索框 -->
        <view class="search-box">
            <u-search v-model="query.realName" placeholder="搜索姓名" :showAction="false" @change="searchClerk()"></u-search>
        </view>
        <!-- 用户列表 -->
        <!-- 店员列表 -->
        <scroll-view scroll-y class="clerk-list" @scrolltolower="loadMore" v-if="clerkList.length > 0">
            <view class="clerk-item" v-for="(clerk, index) in clerkList" :key="clerk.id" >
@@ -72,7 +72,7 @@
        data() {
            return {
                total:0,
                clerkList: [], // 用户列表数据
                clerkList: [], // 店员列表数据
                loading: false, // 加载状态
                noMore: false, // 是否没有更多数据
                query: {
@@ -90,7 +90,7 @@
        },
        onLoad() {
            this.getPage()
            //获得用户权限
            //获得店员权限
            checkClerkPermission().then(res=>{
                this.isSuper = res.data.data.isSuper;
                this.isShopkeeper = res.data.data.isShopkeeper;
@@ -152,7 +152,7 @@
            },
            // 搜索用户
            // 搜索店员
            searchClerk() {
                this.query.pageNumber = 1
                this.noMore = false
@@ -167,13 +167,13 @@
                    this.getPage()
                }
            },
            // 跳转到新增用户
            // 跳转到新增店员
            navigateToAdd() {
                uni.navigateTo({
                    url: `/pages/userPermissions/addStoreMember`
                })
            },
            // 跳转到用户详情
            // 跳转到店员详情
            navigateToDetail(id) {
                uni.navigateTo({
                    url: `/pages/userPermissions/addStoreMember?id=${id}`
vue.config.js
@@ -1,7 +1,7 @@
// module.exports = {
module.exports = {
//     /**
//      *  此处为发行h5,微信小程序,app中删除console
//      *  此处为发行h5,微信小程序,app中删除console
//      *  如需显示console 需要注释此处重新运行
//      */
//     chainWebpack: (config) => {
@@ -17,5 +17,13 @@
//             return args
//         })
//     }
// }
//     },
    css: {
        loaderOptions: {
            sass: {
                implementation: require('node-sass'), // 明确使用 node-sass
            },
        },
    },
}