| | |
| | | { |
| | | "path": "suppler-order", |
| | | "style": { |
| | | "navigationBarTitleText": "供应商端" |
| | | "navigationBarTitleText": "供应商端", |
| | | // "navigationStyle": "custom" |
| | | "componentPlaceholder":{ |
| | | "u-empty":"view", |
| | | "u-image":"view" |
| | | } |
| | | } |
| | | }, |
| | | { |
| | |
| | | { |
| | | "path": "userPermissions", |
| | | "style": { |
| | | "navigationBarTitleText": "用户权限", |
| | | "navigationBarTitleText": "店员管理", |
| | | "componentPlaceholder": { |
| | | "u-icon": "view", |
| | | "u-button": "view", |
| | |
| | | <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> |
| | |
| | | this.getMemberTag() |
| | | }, |
| | | methods: { |
| | | |
| | | toggleTag(tag) { |
| | | console.log(tag) |
| | | }, |
| | |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | /** |
| | | * 修改头像 |
| | | * @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; |
| | | // } |
| | | // }); |
| | | // }, |
| | | // }); |
| | | // }, |
| | | |
| | | /** |
| | | * 选择地址 |
| | |
| | | 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> |
| | |
| | | <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> |
| | |
| | | url: `/pages/tabbar/home/index`, |
| | | }); |
| | | }, |
| | | onChooseAvatar(e){ |
| | | console.log(e.detail.avatarUrl) |
| | | }, |
| | | |
| | | //获取用户信息 |
| | | getUserProfile(e) { |
| | | if(!this.checked){ |
| | |
| | | orderList: [], |
| | | pageNumber: 1, |
| | | }, |
| | | // { |
| | | // state: 4, |
| | | // text: "已完成", |
| | | // loadStatus: "more", |
| | | // orderList: [], |
| | | // pageNumber: 1, |
| | | // }, |
| | | { |
| | | state: 4, |
| | | text: "已完成", |
| | | loadStatus: "more", |
| | | orderList: [], |
| | | pageNumber: 1, |
| | | }, |
| | | // { |
| | | // state: 5, |
| | | // text: "已取消", |
| | |
| | | { |
| | | orderStatus: "WAIT_ROG", //待收货 |
| | | }, |
| | | // { |
| | | // orderStatus: "COMPLETE", //已完成 |
| | | // }, |
| | | { |
| | | orderStatus: "COMPLETE", //已完成 |
| | | }, |
| | | // { |
| | | // orderStatus: "CANCELLED", //已取消 |
| | | // }, |
| | |
| | | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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" > |
| | | |
| | |
| | | data() { |
| | | return { |
| | | total:0, |
| | | clerkList: [], // 用户列表数据 |
| | | clerkList: [], // 店员列表数据 |
| | | loading: false, // 加载状态 |
| | | noMore: false, // 是否没有更多数据 |
| | | query: { |
| | |
| | | }, |
| | | onLoad() { |
| | | this.getPage() |
| | | //获得用户权限 |
| | | //获得店员权限 |
| | | checkClerkPermission().then(res=>{ |
| | | this.isSuper = res.data.data.isSuper; |
| | | this.isShopkeeper = res.data.data.isShopkeeper; |
| | |
| | | |
| | | }, |
| | | |
| | | // 搜索用户 |
| | | // 搜索店员 |
| | | searchClerk() { |
| | | this.query.pageNumber = 1 |
| | | this.noMore = false |
| | |
| | | this.getPage() |
| | | } |
| | | }, |
| | | // 跳转到新增用户 |
| | | // 跳转到新增店员 |
| | | navigateToAdd() { |
| | | uni.navigateTo({ |
| | | url: `/pages/userPermissions/addStoreMember` |
| | | }) |
| | | }, |
| | | // 跳转到用户详情 |
| | | // 跳转到店员详情 |
| | | navigateToDetail(id) { |
| | | uni.navigateTo({ |
| | | url: `/pages/userPermissions/addStoreMember?id=${id}` |
| | |
| | | |
| | | // module.exports = { |
| | | module.exports = { |
| | | // /** |
| | | // * 此处为发行h5,微信小程序,app中删除console |
| | | // * 此处为发行h5,微信小程序,app中删除console |
| | | // * 如需显示console 需要注释此处重新运行 |
| | | // */ |
| | | // chainWebpack: (config) => { |
| | |
| | | // return args |
| | | // }) |
| | | |
| | | // } |
| | | // } |
| | | // }, |
| | | css: { |
| | | loaderOptions: { |
| | | sass: { |
| | | implementation: require('node-sass'), // 明确使用 node-sass |
| | | }, |
| | | }, |
| | | }, |
| | | } |
| | | |