From fdcd063c12a50a84a375dd328a09d5e8a089504c Mon Sep 17 00:00:00 2001
From: "3321822538@qq.com" <3321822538@qq.com>
Date: Fri, 17 May 2024 18:10:58 +0800
Subject: [PATCH] aaa
---
common/http.interceptor.js | 2 +-
page_user/daili/cjdaili.vue | 243 ++++++------
page_user/daili/index.vue | 26 +-
page_user/listshu/edit.vue | 17 +-
page_user/listshu/index.vue | 74 +++-
page_user/listshu/quanxian.vue | 363 ++++++++----------
page_user/listshu/xqdetail.vue | 57 +--
page_user/shopdetail.vue | 40 +-
page_user/shopedit.vue | 14 +-
pages.json | 14 +
.../shopguanli/discipleshop/index.vue | 107 +++++-
pages/agentpages/shopguanli/myshop/index.vue | 208 +++++++---
.../agentpages/shopguanli/setupshop/index.vue | 2 +-
pages/index/index.vue | 12 +-
14 files changed, 697 insertions(+), 482 deletions(-)
diff --git a/common/http.interceptor.js b/common/http.interceptor.js
index f5e4284..b06131f 100644
--- a/common/http.interceptor.js
+++ b/common/http.interceptor.js
@@ -1,6 +1,6 @@
const install = (Vue, vm) => {
Vue.prototype.$u.http.setConfig({
- baseUrl: 'http://192.168.2.17:3100/dev-api',
+ baseUrl: 'http://192.168.2.24:3100/dev-api',
// baseUrl: 'https://znb.ccttiot.com',
loadingText: '努力加载中~',
loadingTime: 800,
diff --git a/page_user/daili/cjdaili.vue b/page_user/daili/cjdaili.vue
index c425168..d3bd260 100644
--- a/page_user/daili/cjdaili.vue
+++ b/page_user/daili/cjdaili.vue
@@ -7,19 +7,19 @@
- 代理级别
+ 代理级别
- 代理名称
+ 代理名称
- 分成比例
+ 分成比例
- 手机号码
+ 手机号码
- 省市区
+ 省市区
@@ -27,125 +27,22 @@
商户权限
-
+
- 允许登录
+ {{item.name}}
- 代理登录系统
+ {{item.tit}}
-
+
-
-
-
- 允许提现
-
-
- 代理钱包余额提现
-
-
-
-
-
-
-
-
-
- 展示分成比例
-
-
- 是否展示分成比例
-
-
-
-
-
-
-
-
-
- 代理操作
-
-
- 是否展示操作代理
-
-
-
-
-
-
-
-
-
- 设备显示
-
-
- 是否允许设备显示
-
-
-
-
-
-
-
-
-
- 设备操作
-
-
- 是否展示设备操作
-
-
-
-
-
-
-
-
-
- 店铺操作
-
-
- 是否展示店铺操作
-
-
-
-
-
-
-
-
-
- 订单管理
-
-
- 是否允许查看订单
-
-
-
-
-
-
-
+
-
+
保存
@@ -156,16 +53,130 @@
export default {
data() {
return {
- checked: false,
+ list:[
+ {name:'允许登录',tit:'代理登录系统',checked:false},
+ {name:'允许提现',tit:'代理钱包余额提现',checked:false},
+ {name:'展示分成比例',tit:'是否展示分成比例',checked:false},
+ {name:'代理操作',tit:'是否展示操作代理',checked:false},
+ {name:'设备显示',tit:'是否允许设备显示',checked:false},
+ {name:'设备操作',tit:'是否展示设备操作',checked:false},
+ {name:'店铺操作',tit:'是否展示店铺操作',checked:false},
+ {name:'订单管理',tit:'是否允许查看订单',checked:false}
+ ],
show:false,
bgc: {
backgroundColor: " #25CE88",
},
+ level:'',
+ name:'',
+ ratio:'',
+ tel:'',
+ sheng:'请选择省市区',
+ arr:[],
+ arrqx:[]
}
},
methods: {
confirm(e){
- console.log(e);
+ this.arr = []
+ this.sheng = e.province.label + '/' + e.city.label + "/" + e.area.label
+ this.arr.push(e.province.label)
+ this.arr.push(e.city.label)
+ this.arr.push(e.area.label)
+ },
+ change(e){
+ console.log(this.list)
+
+ },
+
+ btncj(){
+ if(this.name == '' || this.name == '请输入代理名称'){
+ uni.showToast({
+ title: '请输入代理名称',
+ icon: 'none',
+ duration: 1000
+ })
+ }else if(this.ratio == '' || this.ratio == '请输入分成比例 %'){
+ uni.showToast({
+ title: '请输入分成比例 %',
+ icon: 'none',
+ duration: 1000
+ })
+ }else if(this.tel == '' || this.tel == '请输入手机号码'){
+ uni.showToast({
+ title: '请输入手机号码',
+ icon: 'none',
+ duration: 1000
+ })
+ }else if(this.sheng == '请选择省市区'){
+ uni.showToast({
+ title: '请选择省市区',
+ icon: 'none',
+ duration: 1000
+ })
+ }else{
+ this.arrqx = []
+ const mapping = {
+ '允许登录': 'agent:login',
+ '允许提现': 'agent:withdraw',
+ '展示分成比例': 'agent:point:show',
+ '代理操作': 'agent:operation',
+ '设备显示': 'agent:device:show',
+ '设备操作': 'agent:device:operation',
+ '店铺操作': 'agent:store:operation',
+ '订单管理': 'agent:order:manage'
+ };
+ this.list.forEach((item) => {
+ if (item.checked && mapping.hasOwnProperty(item.name)) {
+ this.arrqx.push(mapping[item.name]);
+ }
+ })
+
+ let data = {
+ name:this.name,
+ point:this.ratio,
+ mobile:this.tel,
+ area:this.arr,
+ permissions:this.arrqx
+ }
+ this.$u.post('/agent/agent',data).then(res => {
+ if (res.code == 200) {
+ uni.showToast({
+ title: '创建成功',
+ icon: 'success',
+ duration: 1000
+ })
+ setTimeout(()=>{
+ uni.navigateBack()
+ },1500)
+ }else if(res.msg == '请输入正确的手机号'){
+ uni.showToast({
+ title: '请输入正确的手机号',
+ icon: 'none',
+ duration: 1000
+ })
+ }else if(res.msg == '该手机号所绑定的用户已经是代理商,请勿重复绑定'){
+ uni.showToast({
+ title: '该手机号所绑定的用户已经是代理商,请勿重复绑定',
+ icon: 'none',
+ duration: 1000
+ })
+ }else if(res.msg == '分成比例不允许超过上级代理,最高:90.00'){
+ uni.showToast({
+ title: '分成比例不允许超过上级代理,最高:90.00',
+ icon: 'none',
+ duration: 1000
+ })
+ } else if(res.code == 500){
+ uni.showToast({
+ title: '分成比例必须为数字',
+ icon: 'none',
+ duration: 1000
+ })
+ }
+ })
+
+ }
}
}
}
diff --git a/page_user/daili/index.vue b/page_user/daili/index.vue
index f8550fe..783a0a7 100644
--- a/page_user/daili/index.vue
+++ b/page_user/daili/index.vue
@@ -1,6 +1,6 @@
-
@@ -18,13 +18,22 @@
0
- 商家>
+ 店铺>
+
+
+
+ 0
+
+
+ 运维>
+
+
-
+
@@ -59,7 +68,11 @@
})
}else if(num == 5){
uni.navigateTo({
- url:'/page_user/listshu/shangjialist'
+ url:'/page_user/daili/dianpu'
+ })
+ }else if(num == 6){
+ uni.navigateTo({
+ url:'/page_user/daili/yunweilist'
})
}
}
@@ -93,15 +106,16 @@
padding: 54rpx 78rpx;
box-sizing: border-box;
display: flex;
- justify-content: space-between;
+ // justify-content: space-between;
image{
width: 96rpx;
height: 98rpx;
+ margin-right: 100rpx;
}
}
.shuju {
display: flex;
- // justify-content: space-between;
+ justify-content: space-between;
padding: 40rpx 60rpx;
box-sizing: border-box;
width: 680rpx;
diff --git a/page_user/listshu/edit.vue b/page_user/listshu/edit.vue
index 6736a87..44731bd 100644
--- a/page_user/listshu/edit.vue
+++ b/page_user/listshu/edit.vue
@@ -24,22 +24,7 @@
-
-
-
- 商户名称
-
-
- 分成比例
-
-
- 手机号码
-
-
- 省市区
-
-
-
+
保存
diff --git a/page_user/listshu/index.vue b/page_user/listshu/index.vue
index f2ef4b7..9bc24fc 100644
--- a/page_user/listshu/index.vue
+++ b/page_user/listshu/index.vue
@@ -5,16 +5,16 @@
-
+
-
+
- 星途自助台球棋牌室
- 12312345678-商家
+ {{item.name}}
+ ID:{{item.agentId}} - {{item.level}}级代理
-
+
@@ -24,11 +24,11 @@
代理
- 1
+ {{item.childrenCount}}
店铺数
- 1
+ {{item.storeCount}}
设备统计
- 1
+ {{item.cabinetCount}}
- 联系电话:12312345678
+ 联系电话:{{item.mobile}}
- 2024-02-18
+ {{item.createTime}}
@@ -54,14 +54,61 @@
bgc: {
backgroundColor: " #25CE88"
},
+ pagenum: 1,
+ wateringList: [],
+ pagesize: 10, // 一页多少数据
+ isLoading: false, // 是否正在加载数据
+ noMoreData: false, // 是否没有更多数据
+ total: 0,
+ keyword:''
}
},
+ onShow() {
+ this.pagenum = 1
+ this.wateringList = []
+ this.getlist()
+ },
methods: {
- btnxq(){
+ btnxq(item){
uni.navigateTo({
- url:'/page_user/listshu/xqdetail?flag=' + true
+ url:'/page_user/listshu/xqdetail?agentId=' + item.agentId
})
- }
+ },
+
+ getlist() {
+ this.$u.get("/agent/agent/list?pageNum=" + this.pagenum + '&pageSize=' + this.pagesize + '&keyword=' + this.keyword).then(res => {
+ if (res.code == 200) {
+ this.total = res.total
+ if (res.rows.length > 0) {
+ // 有数据,追加到列表
+ this.wateringList = this.wateringList.concat(res.rows)
+ this.pagenum++
+ } else {
+ // 没有更多数据
+ this.noMoreData = true;
+ }
+ this.isLoading = false;
+ }
+ })
+ },
+ searchs(){
+ this.pagenum = 1
+ this.wateringList = []
+ this.getlist()
+ },
+ onReachBottom() {
+ let sum = this.total / this.pagesize
+ if (this.pagenum-1 < sum) {
+ this.getlist(); // 上拉加载更多
+ } else {
+ uni.showToast({
+ title: '没有更多代理人员了',
+ icon: 'none',
+ duration: 1000
+ });
+ }
+ },
+
}
}
@@ -78,6 +125,7 @@
height:100%;
background: #F4F5F7;
border-radius: 0rpx 0rpx 0rpx 0rpx;
+ padding-bottom: 200rpx;
.list{
width: 680rpx;
height: 336rpx;
diff --git a/page_user/listshu/quanxian.vue b/page_user/listshu/quanxian.vue
index 8326c81..5d6a16c 100644
--- a/page_user/listshu/quanxian.vue
+++ b/page_user/listshu/quanxian.vue
@@ -1,193 +1,33 @@
-
-
+
+
权限操作
-
+
- 允许登录
+ {{item.name}}
- 代理登录系统
+ {{item.tit}}
-
-
-
-
-
-
- 允许提现
-
-
- 代理钱包余额提现
-
-
-
-
-
-
-
-
-
- 展示分成比例
-
-
- 是否展示分成比例
-
-
-
-
-
-
-
-
-
- 代理操作
-
-
- 是否展示操作代理
-
-
-
-
-
-
-
-
-
- 设备显示
-
-
- 是否允许设备显示
-
-
-
-
-
-
-
-
-
- 设备操作
-
-
- 是否展示设备操作
-
-
-
-
-
-
-
-
-
- 店铺操作
-
-
- 是否展示店铺操作
-
-
-
-
-
-
-
-
-
- 订单管理
-
-
- 是否允许查看订单
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 允许登录
-
-
- 代理登录系统
-
-
-
-
-
-
-
-
-
- 允许提现
-
-
- 代理钱包余额提现
-
-
-
-
-
-
-
-
-
- 展示分成比例
-
-
- 是否展示分成比例
-
-
-
-
-
-
-
-
-
- 设备管理显示
-
-
- 是否允许设备显示
-
-
-
-
-
-
-
-
-
- 我的店铺
-
-
- 是否展示我的店铺
-
-
-
-
+
-
+
+
保存
-
+
@@ -195,20 +35,120 @@
export default {
data() {
return {
- checked: false,
- show:false,
+ list: [{
+ name: '允许登录',
+ tit: '代理登录系统',
+ checked: false
+ },
+ {
+ name: '允许提现',
+ tit: '代理钱包余额提现',
+ checked: false
+ },
+ {
+ name: '展示分成比例',
+ tit: '是否展示分成比例',
+ checked: false
+ },
+ {
+ name: '代理操作',
+ tit: '是否展示操作代理',
+ checked: false
+ },
+ {
+ name: '设备显示',
+ tit: '是否允许设备显示',
+ checked: false
+ },
+ {
+ name: '设备操作',
+ tit: '是否展示设备操作',
+ checked: false
+ },
+ {
+ name: '店铺操作',
+ tit: '是否展示店铺操作',
+ checked: false
+ },
+ {
+ name: '订单管理',
+ tit: '是否允许查看订单',
+ checked: false
+ }
+ ],
+ show: false,
bgc: {
backgroundColor: " #25CE88",
},
-
+ listobj: {},
+ arrqx:[]
}
},
- onLoad() {
-
+ onLoad(option) {
+ this.listobj = JSON.parse(option.obj)
+ console.log(this.listobj.permissions);
+ this.listobj.permissions.forEach((item) => {
+ if (item == 'agent:login') {
+ this.list[0].checked = true
+ } else if (item == 'agent:withdraw') {
+ this.list[1].checked = true
+ } else if (item == 'agent:point:show') {
+ this.list[2].checked = true
+ } else if (item == 'agent:operation') {
+ this.list[3].checked = true
+ } else if (item == 'agent:device:show') {
+ this.list[4].checked = true
+ } else if (item == 'agent:device:operation') {
+ this.list[5].checked = true
+ } else if (item == 'agent:store:operation') {
+ this.list[6].checked = true
+ } else if (item == 'agent:order:manage') {
+ this.list[7].checked = true
+ }
+ })
},
methods: {
- confirm(e){
+ change(e) {
console.log(e);
+ },
+
+ btncj() {
+ this.arrqx = []
+ const mapping = {
+ '允许登录': 'agent:login',
+ '允许提现': 'agent:withdraw',
+ '展示分成比例': 'agent:point:show',
+ '代理操作': 'agent:operation',
+ '设备显示': 'agent:device:show',
+ '设备操作': 'agent:device:operation',
+ '店铺操作': 'agent:store:operation',
+ '订单管理': 'agent:order:manage'
+ };
+ this.list.forEach((item) => {
+ if (item.checked && mapping.hasOwnProperty(item.name)) {
+ this.arrqx.push(mapping[item.name]);
+ }
+ })
+
+ let data = {
+ agentId:this.listobj.agentId,
+ permissions: this.arrqx
+ }
+ this.$u.put('/agent/agent', data).then(res => {
+ if(res.code == 200){
+ uni.showToast({
+ title: '修改成功',
+ icon: 'none',
+ duration: 1000
+ })
+ setTimeout(()=>{
+ uni.navigateBack({
+ delta: 2
+ })
+ },1500)
+ }
+ })
+
}
}
}
@@ -221,23 +161,25 @@
.page {
width: 750rpx;
+
// position: fixed;
// top: 0;
// left: 0;
- .box{
+ .box {
width: 750rpx;
height: 100%;
- overflow-y:scroll;
+ overflow-y: scroll;
background: #F4F5F7;
border-radius: 0rpx 0rpx 0rpx 0rpx;
- padding: 32rpx 36rpx;
+ padding: 32rpx 36rpx;
box-sizing: border-box;
padding-bottom: 100rpx;
- .baocun{
- width: 584rpx;
+
+ .baocun {
+ width: 584rpx;
height: 90rpx;
margin: auto;
- background: linear-gradient( 270deg, #54DAA1 0%, #19CD82 100%);
+ background: linear-gradient(270deg, #54DAA1 0%, #19CD82 100%);
border-radius: 54rpx 54rpx 54rpx 54rpx;
margin-top: 62rpx;
margin-bottom: 78rpx;
@@ -247,59 +189,68 @@
text-align: center;
line-height: 90rpx;
}
- .swlist{
+
+ .swlist {
margin-top: 34rpx;
display: flex;
justify-content: space-between;
- flex-wrap: wrap;
- .swlist_val{
+ flex-wrap: wrap;
+
+ .swlist_val {
display: flex;
justify-content: space-between;
- width: 324rpx;
- height: 144rpx;
- background: #FFFFFF;
- border-radius: 24rpx 24rpx 24rpx 24rpx;
+ width: 324rpx;
+ height: 144rpx;
+ background: #FFFFFF;
+ border-radius: 24rpx 24rpx 24rpx 24rpx;
padding-top: 28rpx;
padding-left: 38rpx;
box-sizing: border-box;
margin-top: 18rpx;
}
- .lt{
- .one{
+
+ .lt {
+ .one {
font-size: 28rpx;
color: #3D3D3D;
}
- .two{
+
+ .two {
font-size: 24rpx;
color: #808080;
margin-top: 12rpx;
}
}
- .rt{
+
+ .rt {
margin-top: 24rpx;
padding-right: 12rpx;
}
}
- .title{
+
+ .title {
font-size: 32rpx;
color: #3D3D3D;
}
- .list{
- width: 680rpx;
- height: 578rpx;
- background: #FFFFFF;
- border-radius: 24rpx 24rpx 24rpx 24rpx;
- padding: 46rpx 36rpx;
- box-sizing: border-box;
- margin-top: 34rpx;
- margin-bottom: 47rpx;
- .list_val{
+
+ .list {
+ width: 680rpx;
+ height: 578rpx;
+ background: #FFFFFF;
+ border-radius: 24rpx 24rpx 24rpx 24rpx;
+ padding: 46rpx 36rpx;
+ box-sizing: border-box;
+ margin-top: 34rpx;
+ margin-bottom: 47rpx;
+
+ .list_val {
display: flex;
font-size: 32rpx;
color: #3D3D3D;
justify-content: space-between;
margin-bottom: 32rpx;
- input{
+
+ input {
width: 430rpx;
height: 70rpx;
background: #F0F0F0;
diff --git a/page_user/listshu/xqdetail.vue b/page_user/listshu/xqdetail.vue
index 181ec5b..56cc0d6 100644
--- a/page_user/listshu/xqdetail.vue
+++ b/page_user/listshu/xqdetail.vue
@@ -4,26 +4,26 @@
height='38'>
- 瑞斯特酒店(龙安店)--商家
+ {{listobj.name}}
基本信息
- ID: 12312345678
+ ID: {{listobj.agentId}}
- 分成比例: 90%
+ 分成比例: {{listobj.point}}%
- 手机号码: 12312345678
+ 手机号码: {{listobj.mobile}}
- 创建时间: 2023-10-04
+ 创建时间: {{listobj.createTime}}
- 累计订单: 130单
+ 累计订单: {{listobj.orderCount}}单
@@ -44,44 +44,51 @@
show: false,
storeId:'',
listobj:{},
- flag:false
+ flag:false,
+ agentId:''
}
},
onLoad(option) {
- if(option.flag){
- this.flag = option.flag
- }
+ this.agentId = option.agentId
+ this.getxq()
},
methods: {
+ getxq(){
+ this.$u.get(`/agent/agent/${this.agentId}`).then(res => {
+ if (res.code == 200) {
+ this.listobj = res.data
+ }
+ })
+ },
btnpag(num){
if(num == 1){
uni.navigateTo({
- url:'/page_user/listshu/quanxian'
+ url:'/page_user/listshu/quanxian?obj=' + JSON.stringify(this.listobj)
})
}else if(num == 2){
uni.navigateTo({
- url:'/page_user/listshu/edit'
+ url:'/page_user/listshu/edit?obj=' + this.listobj
})
}else if(num == 3){
let vm = this
uni.showModal({
title: '提示',
- content: '你确定要注销这个店铺吗?',
+ content: '你确定要注销这个代理吗?',
success: function (res) {
if (res.confirm) {
- // vm.$u.delete("/app/store/" + vm.storeId).then(res => {
- // if (res.code == 200) {
- // uni.showToast({
- // title: '删除成功',
- // icon: 'success',
- // duration: 1000
- // })
- // setTimeout(()=>{
- // uni.navigateBack()
- // },1500)
- // }
- // })
+ vm.$u.delete(`/agent/agent/${vm.agentId}`).then(res => {
+ if (res.code == 200) {
+ uni.showToast({
+ title: '注销成功',
+ icon: 'success',
+ duration: 1000
+ })
+ setTimeout(()=>{
+ uni.navigateBack()
+ },1500)
+ }
+ })
} else if (res.cancel) {
console.log('用户点击了取消');
}
diff --git a/page_user/shopdetail.vue b/page_user/shopdetail.vue
index 5bcfc67..560a1e8 100644
--- a/page_user/shopdetail.vue
+++ b/page_user/shopdetail.vue
@@ -11,7 +11,7 @@
基本信息
- 绑定设备: {{listobj.deviceCount}}
+ 设备数量: {{listobj.cabinetCount}}
营业时间: {{listobj.businessTimeStart}}~{{listobj.businessTimeEnd}}
@@ -24,11 +24,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -41,17 +41,29 @@
return {
show: false,
storeId:'',
- listobj:{}
+ listobj:{},
+ flag:false,
+ flags:false
}
},
onLoad(option) {
- console.log(option);
- this.storeId = option.id
- // this.getdetail()
+ this.storeId = option.storeId
+ let userdata = uni.getStorageSync('userdata').permissions
+ if (Array.isArray(userdata) && userdata.includes('agent:store:operation')) {
+ this.flag = true
+ } else {
+ this.flag = false
+ }
+ if (Array.isArray(userdata) && userdata.includes('agent:device:show')) {
+ this.flags = true
+ } else {
+ this.flags = false
+ }
+ this.getdetail()
},
methods: {
getdetail(){
- this.$u.get("/app/store/mch/" + this.storeId).then(res => {
+ this.$u.get(`/agent/store/${this.storeId}`).then(res => {
if (res.code == 200) {
this.listobj = res.data
}
@@ -66,7 +78,7 @@
})
}else if(num == 2){
uni.navigateTo({
- url:'/page_user/shopedit'
+ url:'/page_user/shopedit?obj=' + JSON.stringify(this.listobj)
})
}else if(num == 3){
let vm = this
@@ -75,10 +87,10 @@
content: '你确定要注销这个店铺吗?',
success: function (res) {
if (res.confirm) {
- vm.$u.delete("/app/store/" + vm.storeId).then(res => {
+ vm.$u.delete(`/agent/store/${vm.storeId}`).then(res => {
if (res.code == 200) {
uni.showToast({
- title: '删除成功',
+ title: '注销成功',
icon: 'success',
duration: 1000
})
diff --git a/page_user/shopedit.vue b/page_user/shopedit.vue
index 4417f81..132e025 100644
--- a/page_user/shopedit.vue
+++ b/page_user/shopedit.vue
@@ -140,7 +140,7 @@
onLoad(option) {
let obj = JSON.parse(option.obj)
this.listobj = obj
- console.log(this.listobj);
+ // console.log(this.listobj);
this.shopname = this.listobj.name
this.ksyy = this.listobj.businessTimeStart
this.jsyy = this.listobj.businessTimeEnd
@@ -267,11 +267,11 @@
type:this.selectorvalue,
storeId:this.storeId
}
- this.$u.put("/app/store",data).then(res => {
+ this.$u.put("/agent/store",data).then(res => {
if (res.code == 500) {
uni.showToast({
- title: 'res.msg',
- icon: 'success',
+ title: res.msg,
+ icon: 'none',
duration: 1000
})
}else{
@@ -282,7 +282,7 @@
})
setTimeout(()=>{
uni.navigateBack({
- delta: 2
+ delta: 2
})
},1000)
}
@@ -368,7 +368,7 @@