diff --git a/api/service.js b/api/service.js
index d8838dc..a8835dd 100644
--- a/api/service.js
+++ b/api/service.js
@@ -4,6 +4,10 @@ import request from "@/utils/request.js";
export function getStaffList(data) {
return request.get('staff/staff_list',data);
}
+// 员工管理 - 获取员工列表
+export function staffInviteQrCode(data) {
+ return request.get('staff/staff_invite_qr_code',data);
+}
// 员工管理 - 员工编辑
export function editStaff(data) {
return request.get('staff/staff_edit',data);
diff --git a/config/app.js b/config/app.js
index 6a45260..e76d97b 100644
--- a/config/app.js
+++ b/config/app.js
@@ -6,13 +6,13 @@ let VUE_APP_WS_URL = `ws://${location.hostname}?type=user`
let openPlantGrass = '-openPlantGrass-'
// 网络接口修改此字符 小程序域名要求https
-// let httpApi = 'https://bt.test.cdlfjy.com/' // 开发
-let httpApi = 'https://mp.scwmbh.cn/' // 生产
+let httpApi = 'https://bt.test.cdlfjy.com/' // 开发
+// let httpApi = 'https://mp.scwmbh.cn/' // 生产
// 聊天接口修改此字符 小程序聊天要求wss 例如:
-// let wsApi = 'wss://bt.test.cdlfjy.com'
-let wsApi = 'wss://mp.scwmbh.cn'
+let wsApi = 'wss://bt.test.cdlfjy.com'
+// let wsApi = 'wss://mp.scwmbh.cn'
module.exports = {
diff --git a/pages/admin/business/edit_staff.vue b/pages/admin/business/edit_staff.vue
index 16e8132..af4ce63 100644
--- a/pages/admin/business/edit_staff.vue
+++ b/pages/admin/business/edit_staff.vue
@@ -1,18 +1,18 @@
- 添加员工
+ {{ Number(service_id) > 0 ? '编辑' : '添加' }}员工
用户
- 选择用户
+ 选择用户
-
+
{{ consume_info.nickname}}
UID:{{ consume_info.uid}}
@@ -61,67 +61,69 @@
-
-
- 账号状态
-
-
-
-
+
- 客服功能
-
+ 账号状态
+
-
-
- 订单管理
-
+
+
+
+ 客服功能
+
+
-
-
-
- 商品管理
-
+
+
+ 订单管理
+
+
-
-
-
- 开启核销
-
+
+
+ 商品管理
+
+
-
-
-
- 客户管理
-
+
+
+ 开启核销
+
+
-
-
-
- 员工管理
-
+
+
+ 客户管理
+
+
-
-
-
- 订单通知
-
+
+
+ 员工管理
+
+
-
-
-
- 通知电话
-
+
+
+ 订单通知
+
+
-
-
-
- 推广二维码
-
+
+
+ 通知电话
+
+
-
+
+
+ 推广二维码
+
+
+
+
@@ -156,6 +158,8 @@
+
+
@@ -164,10 +168,14 @@ import avatar from "@/components/yq-avatar/yq-avatar.vue";
import { HTTP_REQUEST_URL } from '@/config/app';
import {editStaff,getStaffInfo} from "@/api/service";
import { getCustomList } from "@/api/user.js";
+import {mapGetters} from "vuex";
+import authorize from '@/components/Authorize';
+
export default {
name: 'custom',
components: {
- avatar
+ avatar,
+ authorize
},
data() {
return {
@@ -182,7 +190,7 @@ export default {
account: '',
confirm_pwd: '',
pwd: '',
- is_open: 0,
+ is_open: 1,
status: 0,
customer: 0,
is_goods: 0,
@@ -201,20 +209,49 @@ export default {
nickname: '',
default_consume_id: 0,
},
-
+ is_regular: false,
+ // 登录相关
+ isAuto: false, //没有授权的不会自动授权
+ isShowAuth: false,//是否隐藏授权
}
},
- computed: { },
+ computed: {
+ ...mapGetters(['isLogin', 'uid', 'userInfo', 'viewColor'])
+ },
onLoad: function(options) {
+ // 判断:是否登录;未登录 授权登录
+ if (!this.isLogin) {
+ this.isAuto = true;
+ this.isShowAuth = true
+ }
// 参数处理
this.service_id = options.service_id || 0;
this.mer_id = options.mer_id || 0;
+ // 二维码参数接收
+ if(options.scene){
+ // console.log("接收参数 - 未转义",options.scene)
+ var scene = this.$util.getUrlParams(decodeURIComponent(options.scene));
+ this.mer_id = scene.mer_id || this.mer_id;
+ // 判断:存在二维码参数,并且mer_id大于0 则固定用户及权限
+ if(Number(scene.mer_id) > 0){
+ this.is_regular = true;
+ this.consume_search.default_consume_id = this.uid;
+ this.showConsumePopup();
+ }
+ }
+ // 设置页面标题
+ uni.setNavigationBarTitle({
+ title: Number(this.service_id) > 0 ? '编辑员工' : '添加员工'
+ })
+ // 判断:不存在mer_id 直接报错
if(this.mer_id <= 0){
uni.showModal({
title: '提示',
content: '非法访问,参数不明确!',
success: function success(res) {
- uni.navigateBack();
+ uni.switchTab({
+ url: '/pages/user/index',
+ });
}
});
}
@@ -222,6 +259,16 @@ export default {
if(this.service_id > 0) this.getStaffInfo();
},
methods: {
+ // 授权回调
+ onLoadFun() {
+ if(this.isLogin){
+ this.isShowAuth = false;
+ }
+ },
+ // 授权关闭
+ authColse(e) {
+ this.isShowAuth = e
+ },
// 图片上传 - 触发上传
uploadImage() {
let avatar = this.$refs.avatar;
@@ -237,7 +284,7 @@ export default {
name: 'field',
formData: {
'filename': rsp.path,
- 'name': _this.imgName
+ 'name': ""
},
header: {
// #ifdef MP
@@ -247,7 +294,7 @@ export default {
},
success: (uploadFileRes) => {
let imgData = JSON.parse(uploadFileRes.data)
- console.log('图片上传回调',imgData);
+ // console.log('图片上传回调',imgData);
if(imgData.data) _this.info.avatar = imgData.data.path || '';
}
});
@@ -266,6 +313,19 @@ export default {
let _this = this;
getCustomList(_this.mer_id, _this.consume_search).then(res => {
_this.consume_list = res.data.list || {};
+ // 判断:如果固定用户、且用户列表信息为空则报错并且返回个人中心
+ if(_this.is_regular && Number(this.consume_search.default_consume_id) > 0 && Object.values(_this.consume_list).length <= 0){
+ uni.showModal({
+ title: '提示',
+ content: '非该商户用户,请先关注商户或者在该商户进行消费!',
+ success: function success(res) {
+ uni.switchTab({
+ url: '/pages/user/index',
+ });
+ }
+ });
+ return false;
+ }
// 判断:是否只有一个-是则选中
if(Object.values(_this.consume_list).length == 1){
_this.selectedConsume(_this.consume_list[0]);
@@ -293,12 +353,24 @@ export default {
}
// 提交信息
editStaff(info).then(res => {
- this.$util.Tips({
- title: res.message
- },{
- tab: 5,
- url: '/pages/admin/business/staff?mer_id=' + _this.mer_id,
- });
+ // 判断:如果固定用户则返回个人中心 否则返回员工管理
+ console.log('_this.is_regular:',_this.is_regular)
+ if(_this.is_regular){
+ this.$util.Tips({
+ title: res.message
+ },{
+ tab: 5,
+ url: '/pages/admin/business/index?is_sys=0',
+ });
+ }
+ else{
+ this.$util.Tips({
+ title: res.message
+ },{
+ tab: 5,
+ url: '/pages/admin/business/staff?mer_id=' + _this.mer_id,
+ });
+ }
}).catch(err => {
this.$util.Tips({
title: err
@@ -337,7 +409,7 @@ export default {
.custom-content{
width: 100vw;
min-height: 100vh;
- background: orange;
+ background: #f6f6f6;
padding: 0 30rpx 100rpx 30rpx;
.title{
diff --git a/pages/admin/business/staff.vue b/pages/admin/business/staff.vue
index 398f1d9..1f2ed92 100644
--- a/pages/admin/business/staff.vue
+++ b/pages/admin/business/staff.vue
@@ -25,14 +25,28 @@
- 添加员工
+ 添加员工
+
+
+
+ 手动添加
+ 二维码邀请
+
+
+
+
+
+
+ 关闭
+
+