shish 8 месяцев назад
Родитель
Сommit
58ab291b47

+ 314 - 0
ghsApp/src/admin/custom/dist.vue

@@ -0,0 +1,314 @@
+<template>
+	<view class="app-content" @click="globalClick">
+		<view class="list-wrap">
+			<block v-if="!$util.isEmpty(list.data)">
+				<view class="list" v-for="(item, index) in list.data" :key="index">
+					<view class="list-index">{{ item.id }}</view>
+					<view class="list-det">
+						<view class="app-size-28 app-color-0" style="font-size:28upx;font-weight:bold;color:#333333;">
+						{{ item.name || '' }}
+						</view>
+						<view class="list-operate">
+							<view class="operate-det" style="color:#333333;">
+								<span>编号 {{ item.id }}</span>
+							</view>
+							<view class="operate-icon" @click="editItem(item)">
+								<i class="iconfont iconbianji" style="font-size:38upx;"></i>
+							</view>
+							<button class="admin-button-com middle blue" @click="plSet(item)">批量设置</button>
+							<view class="operate-icon" @click.stop="delMyDist(item)">
+								<i class="iconfont iconshanchu1" style="font-size:38upx;"></i>
+							</view>
+						</view>
+					</view>
+				</view>
+				<operate-module v-if="operateShow" :top="operateTop" :right="30" @clickFn="operateList" :btnData="btnData" />
+			</block>
+			<block v-else>
+				<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
+			</block>
+		</view>
+		<view class="app-footer">
+			<button class="admin-button-com middle blue" @click="addCategoryFn">添加片区</button>
+		</view>
+		<modal-module :show="modifyModal" :maskClosable="false" @cancel="modalCancel" @click="replaceModalClick" :title="modifyTitle" padding="30rpx 30rpx">
+			<template v-slot:content>
+				<view class="app-modal-input-wrap modify-modal">
+					<view class="inp-list-line">
+						<view class="line-label">名称</view>
+						<view class="line-input">
+							<input type="text" v-model="replaceForm.name" :adjust-position="false" class="inp-input" placeholder="请填写" />
+						</view>
+					</view>
+				</view>
+			</template>
+		</modal-module>
+		<modal-module :show="delModal" :maskClosable="false" @cancel="modalCancel" @click="delModalClick" content="确定删除?" color="#333" :size="32" padding="30upx 30upx"></modal-module>
+	</view>
+</template>
+<script>
+import ModalModule from '@/components/plugin/modal'
+import AppUploader from '@/components/app-uploader'
+import OperateModule from '@/admin/home/components/module/operate'
+import AppWrapperEmpty from '@/components/app-wrapper-empty'
+import { list } from '@/mixins'
+import { getList,addDist,updateDist,delDist} from '@/api/dist'
+export default {
+	name: 'dist',
+	components: {
+		ModalModule,
+		AppUploader,
+		OperateModule,
+		AppWrapperEmpty
+	},
+	mixins: [list],
+	data() {
+		return {
+			modifyModal: false,
+			modifyTitle: '添加',
+			replaceForm: {
+				name: '',
+				id:0
+			},
+			delModal: false,
+			operateShow: false,
+			operateData: {},
+			operateIndex: null,
+			operateTop: 0
+		}
+	},
+	computed: {
+		btnData() {
+			return [
+				{
+					text: '编辑',
+					icon: 'iconbianji',
+					click: () => {
+						this.modifyModal = true
+						this.modifyTitle = '编辑'
+						this.modifyForm = {
+							name: this.operateData.name,
+							id: this.operateData.id
+						}
+					}
+				},
+				{
+					text: '删除',
+					icon: 'iconshanchu1',
+					click: () => {
+						this.delModal = true
+					}
+				}
+			]
+		}
+	},
+	onPullDownRefresh() {
+		this.resetList()
+		this.getClassList().then(res => {
+			uni.stopPullDownRefresh()
+		})
+	},
+	onReachBottom() {
+		if (!this.list.finished) {
+			this.getClassList().then(res => {
+				uni.stopPullDownRefresh()
+			})
+		} else {
+			uni.stopPullDownRefresh()
+		}
+	},
+	onLoad() {
+	},
+	methods: {
+		plSet(item){
+			this.$util.pageTo({url: '/admin/custom/distCustom?distId='+item.id+'&distName='+item.name})
+		},
+		delMyDist(item){
+			let that = this
+			that.$util.confirmModal({content:'确认删除?'},() => {
+				delDist({id:item.id}).then(res=>{
+					if(res.code == 1){
+						that.$msg('删除成功')
+						that.getClassList()
+					}
+				})
+			})
+		},
+		editItem(item){
+				this.modifyModal = true
+				this.modifyTitle = '编辑'
+				this.replaceForm = {
+                    id:item.id,
+					name: item.name
+				}			
+		},
+		operateList(index){
+			if(index === 0){
+				this.modifyModal = true
+				this.modifyTitle = '编辑'
+				this.replaceForm = {
+                    id:this.operateData.id,
+					name: this.operateData.name
+				}
+			}else if(index === 1) {
+				this.delModal = true
+			}
+		},
+		async init() {
+			this.getClassList()
+		},
+		getClassList() {
+			return getList({page: this.list.page}).then(res => {
+				this.completes(res)
+			})
+		},
+		replaceClass() {
+			if (!this.replaceForm.name) {
+				this.$msg('请填写片区名称')
+				return false
+			}
+			let host = this.replaceForm.id == 0 ?  addDist : updateDist;
+			let form = JSON.parse(JSON.stringify(this.replaceForm))
+			host({
+				...form
+			}).then(res => {
+				this.$msg('操作成功')
+				this.modalCancel()
+				this.operateCancle()
+				setTimeout(() => {
+					this.resetList()
+					this.getClassList()
+				}, 1000)
+			})
+		},
+		addCategoryFn() {
+			this.resetForm()
+			this.modifyModal = true
+			this.modifyTitle = '新增'
+		},
+		resetForm() {
+			this.replaceForm = {
+				name: '',
+                id:0
+			}
+		},
+		replaceModalClick(e) {
+			if (e.index === 0) {
+				this.modalCancel()
+			} else {
+				this.replaceClass()
+			}
+		},
+		modalCancel() {
+			this.delModal = false
+			this.modifyModal = false
+		},
+		switchChangeFn(e) {
+			this.replaceForm.status = e.detail.value ? 1 : 0
+		},
+		delModalClick(e) {
+			if (e.index === 0) {
+				this.modalCancel()
+			} else {
+                uni.showToast({
+                    title: '开发中',
+                    duration: 2000, 
+                    icon:'none',
+                });
+			}
+		},
+		operateFn(item, index, event) {
+            this.operateData = item
+            this.operateIndex = index
+            this.operateShow = true
+            this.operateTop = event.currentTarget.offsetTop
+		},
+		operateCancle() {
+			this.operateData = {}
+			this.operateIndex = null
+			this.operateShow = false
+		},
+        globalClick(){
+            this.operateCancle()
+        },
+		changeStatusFn() {
+            uni.showToast({
+                title: '开发中',
+                duration: 2000, 
+                icon:'none',
+            });
+		}
+	}
+}
+</script>
+
+<style lang="scss" scoped>
+	.app-content {
+		min-height: calc(100vh - 100upx);
+		padding-bottom: 100upx;
+	}
+	.list-wrap {
+		position: relative;
+		background-color: #fff;
+		.list {
+			height: 130upx;
+			@include disFlex(center, flex-start);
+			margin: 0 30upx 0 30upx;
+			color: $fontColor3;
+			border-bottom: 1upx solid $borderColor;
+			.list-index {
+				width: 80upx;
+			}
+			.list-img {
+				img {
+					height: 100%;
+				}
+			}
+			.list-det {
+				width: calc(100% - 50upx);
+				margin-left: 10upx;
+				.list-operate {
+					@include disFlex(center, space-between);
+					.operate-det {
+						& > span {
+							margin-left: 60upx;
+							&:first-child {
+								margin-left: 0;
+							}
+						}
+					}
+					.add-price{
+						text-decoration:underline;
+						font-size:30upx;
+						margin-left:10upx;
+					}
+					.operate-icon{
+						margin-left:5upx;
+					}
+				}
+			}
+		}
+	}
+	.app-footer {
+		justify-content: flex-end;
+		.admin-button-com {
+			width: 200upx;
+			margin-right: 30upx;
+		}
+	}
+	.modify-modal {
+		.prompt-text {
+			color: red;
+			position: relative;
+			right: 52upx;
+			bottom: 24upx;
+		}
+		.line-label {
+			width: 140upx;
+			flex-shrink: 0;
+		}
+		.switch-wrap {
+			margin-top: 30upx;
+		}
+	}
+</style>

+ 381 - 0
ghsApp/src/admin/custom/distCustom.vue

@@ -0,0 +1,381 @@
+<template>
+  <view class="app-main app-content">
+    <view class="input-wrap_box">
+      <view>
+        <AppSearchModule placeholder="输入拼音首字母搜索" @input="searchFn"/>
+      </view>
+    </view>
+    <block v-if="!$util.isEmpty(list.data)">
+      <block v-for="(item, index) in list.data" :key="index">
+        <tui-list-cell :arrow="false">
+          <view class="tui-msg-box">
+            <img :src="item.avatar" class="tui-msg-pic" mode="widthFix"/>
+            <view class="tui-msg-item" style="position:relative;">
+              <view class="tui-msg-name">
+                <view class="tui-user-name">
+                  {{ item.name }}
+                  <text v-if="item.level == 2" class="super-man">大客</text>
+                  <text v-if="item.level == 0" class="ls-man">散客</text>
+                </view>
+              </view>
+              <view class="tui-msg-content">
+                <span>{{ item.visitTime.substr(5,11) }}</span>
+
+                <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 10000" style="font-size:24upx;margin-left:20upx;color:green;font-weight:bold;">没有下过单</text>
+                <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 7" style="font-size:24upx;margin-left:20upx;color:green;font-weight:bold;">超1周未下单</text>
+                <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 30" style="font-size:24upx;margin-left:20upx;color:green;font-weight:bold;">超1个月未下单</text>
+                <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 180" style="font-size:24upx;margin-left:20upx;color:green;font-weight:bold;">超半年未下单</text>
+                <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 365" style="font-size:24upx;margin-left:20upx;color:green;font-weight:bold;">超1年未下单</text>
+
+                <text v-if="item.distName!=''" style="margin-left:30upx;font-size:30upx;font-weight:bold;color:#3385FF;">{{ item.distName }}</text>
+              </view>
+
+              <button class="admin-button-com middle" @click="openDistSelect(item)" style="position: absolute;right:80upx;top:-15upx;">重选</button>
+              <button class="admin-button-com middle blue" @click="confirmDist(item)" style="position: absolute;right:-50upx;top:-15upx;">确认</button>
+
+            </view>
+          </view>
+        </tui-list-cell>
+      </block>
+    </block>
+    <block v-else>
+      <app-wrapper-empty :is-empty="$util.isEmpty(list.data)" />
+    </block>
+
+    <!-- 配送区域选择弹框 -->
+    <uni-popup ref="distSelectRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
+      <view style="max-height:90vh;overflow: scroll;">
+        <view style="margin-left:30upx;margin-top:19upx;font-size:27upx;font-weight:bold;">请选择片区</view>
+        <view style="display:flex;padding:20upx;height:auto;justify-content: flex-start;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
+          <view v-for="(item, index) in allDist" :key="index" style="margin-bottom:20upx;margin-left:3upx;">
+            <button
+              class="admin-button-com staff-btn"
+              @click.stop="selectDist(item)"
+              :class="{'selected': currentDist.id === item.id}"
+            >
+              {{ item.name }}
+            </button>
+          </view>
+        </view>
+        <view style="text-align:center;padding:10upx 0 10upx 0;">
+          <button class="admin-button-com big blue" style="width:210upx;" @click="cancelDistSelect()">取消</button>
+        </view>
+      </view>
+    </uni-popup>
+
+  </view>
+</template>
+<script>
+import TuiListCell from "@/components/plugin/list-cell";
+import BadgeModule from "@/components/plugin/badge";
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import appVipModule from "@/components/module/app-vip";
+import AppTag from "@/components/module/app-tag.vue";
+import AppSearchModule from "@/components/module/app-search";
+import { list } from "@/mixins";
+import { getList } from "@/api/member";
+import { getAllDist,changeDist } from "@/api/dist"
+import { mapGetters } from "vuex";
+export default {
+  name: "selectCustom",
+  components: {
+    TuiListCell,
+    BadgeModule,
+    AppWrapperEmpty,
+    appVipModule,
+    AppTag,
+    AppSearchModule
+  },
+  mixins: [list],
+  data() {
+    return {
+      tabIndex: 0,
+      currentDist: {},
+      currentCustom: {},
+      couldScan: false,
+      allDist: []
+    };
+  },
+  computed:{
+  },
+  onPullDownRefresh() {
+    this.resetList();
+    this.getCustomList().then((res) => {
+      uni.stopPullDownRefresh();
+    });
+  },
+  onReachBottom() {
+    if (!this.list.finished) {
+      this.getCustomList().then((res) => {
+        uni.stopPullDownRefresh();
+      });
+    } else {
+      uni.stopPullDownRefresh();
+    }
+  },
+  onLoad() {
+    getAllDist().then(res=>{
+      if(res.code == 1){
+        this.allDist = res.data.list?res.data.list:[]
+      }
+    })
+    if(this.option.distName){
+      uni.setNavigationBarTitle({ title: '设置为'+this.option.distName })
+    }
+  },
+  methods: {
+    init() {
+       this.getCustomList()
+    },
+    searchFn(e) {
+        this.resetList();
+        this.seekVal = e;
+        this.getCustomList();
+    },
+    getCustomList() {
+      return getList({
+          search: "",
+          type:this.tabIndex,
+          page: this.list.page,
+          name: this.seekVal,
+        }).then((res) => {
+          this.completes(res);
+          if (this.$util.isEmpty(res.data)){
+            return false;
+          }
+        });
+    },
+    // 打开配送区域选择弹框
+    openDistSelect(item) {
+      this.currentCustom = item;
+      this.currentDist = { id: item.distId } || {};
+      this.$refs.distSelectRef.open('center');
+    },
+    confirmDist(custom){
+      let distId = this.option.distId?this.option.distId:0
+      let distName = this.option.distName?this.option.distName:''
+      changeDist({customId:custom.id,distId:distId}).then(res=>{
+        if(res.code == 1){
+          this.$msg('设置成功')
+          custom.distName = distName
+        }
+      })
+    },
+    // 选择配送区域
+    selectDist(dist) {
+      this.$refs.distSelectRef.close();
+      changeDist({customId:this.currentCustom.id,distId:dist.id}).then(res=>{
+        if(res.code == 1){
+          this.$msg('设置成功')
+          this.currentCustom.distName = dist.name
+        }
+      })
+    },
+    // 关闭弹框
+    cancelDistSelect() {
+      this.$refs.distSelectRef.close();
+    }
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.app-content {
+  padding-top: 100upx;
+  padding-bottom: 20upx;
+}
+.tabs-wrap {
+  position: fixed;
+  .tabs-left {
+    width: 80%;
+  }
+  .tabs-right {
+    width: 19%;
+    border-left: $borderColor;
+    @include disFlex(center, center);
+  }
+}
+.input-wrap_box {
+  background-color: #fff;
+  position: fixed;
+  top: 0;
+  z-index: 10;
+  /* 手机mobile屏幕小于1000px */
+  @media screen and (max-width: 1100px) {
+    width: 100%;
+  }
+  /* 收银台cashier屏幕大于1000px */
+  @media screen and (min-width:1100px) {
+    width: 40%;
+  }
+  height: 100upx;
+  display: flex;
+  align-items: center;
+  padding: 0 30upx;
+  & > view:nth-child(1) {
+    flex: 1;
+  }
+}
+.tui-msg-box {
+  display: flex;
+  align-items: center;
+
+  .tui-msg-pic {
+    width: 80upx;
+    height: 80upx;
+    border-radius: 50%;
+    margin-right: 20upx;
+  }
+
+  .tui-msg-item {
+    max-width:700upx;
+    min-height:100upx;
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+    & > div {
+      @include disFlex(center, flex-start);
+      & > div:first-child {
+        margin-right: 8upx;
+      }
+    }
+    .level-img {
+      ::v-deep.vip-text {
+        left: 70upx;
+        top: 8upx;
+      }
+    }
+    .normal-img {
+      width: 70upx;
+      padding: 2upx 6upx;
+      color: #999;
+      background-color: #f0f2f6;
+      border-radius: 20upx;
+      .vip-text {
+        font-size: 24upx;
+        transform: scale(0.6);
+        position: relative;
+        top: -2upx;
+        left: -8upx;
+      }
+    }
+    .member-img {
+      width: 70upx;
+      padding: 2upx 6upx;
+      color: green;
+      background-color: #f0f2f6;
+      border-radius: 20upx;
+      .vip-text {
+        font-size: 24upx;
+        transform: scale(0.6);
+        position: relative;
+        top: -2upx;
+        left: -8upx;
+      }
+    }
+    .iconfont {
+      color: #00aaed;
+    }
+  }
+
+  .tui-msg-name {
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+    font-size: 30upx;
+    line-height: 1;
+    color: #262b3a;
+    .tui-user-name {
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+      width: 500upx;
+      font-size: 32upx;
+      .super-man{
+        margin-left:30upx;
+        color:red;
+        font-size:24upx;
+        display:inline-block;
+        color:white;
+        border:1upx solid green;
+        padding:6upx 10upx;
+        background-color: green;
+        border-radius: 11upx;
+      }
+      .ls-man{
+        margin-left:30upx;
+        font-size:24upx;
+        display:inline-block;
+        color:white;
+        border:1upx solid #a5b1a5;
+        padding:6upx 10upx;
+        background-color: #a5b1a5;
+        border-radius: 11upx;
+      }
+    }
+  }
+
+  .tui-msg-content {
+    width:500upx;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+    font-size: 24upx;
+    line-height: 1;
+    color: #9397a4;
+    .debt-amount{
+      margin-left:20upx;
+      .amount_num{
+        color:red;
+        margin-left:6upx;
+        font-weight:bold;
+      }
+    }
+  }
+}
+.tui-msg-right {
+  max-width: 120upx;
+  height: 80upx;
+  margin-left: auto;
+  margin-right: 24upx;
+  text-align: right;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+.user_tag {
+  border: 1upx solid #cccccc;
+  padding: 5upx 12upx 5upx 12upx;
+  border-radius: 25upx;
+  color: #bbbbbb;
+  margin-right: 10upx;
+  margin-bottom: 12upx;
+  display: inline-block;
+  font-size: 30upx;
+}
+.class-popup-style{
+  z-index:99999;
+}
+.staff-btn {
+  min-width: 160upx;
+  padding: 0 27upx;
+  height: 80upx;
+  font-size: 40upx;
+  font-weight: bold;
+  margin: 8upx 8upx 0 0;
+  border-radius: 16upx;
+  background: #f0f2f6;
+  color: #333;
+  border: 2upx solid #e0e0e0;
+  transition: none;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+.staff-btn.selected,
+.staff-btn:active {
+  background: #f0f2f6;
+  color: #333;
+  border-color: #e0e0e0;
+}
+</style>

+ 7 - 9
ghsApp/src/admin/home/apply.vue

@@ -58,6 +58,13 @@ export default {
                         {name: "图文",img: `${this.$constant.hostUrl}/image/ghs/home/hcgl.png`,url: "/admin/picText/picTextList"},
                     ]
                 },
+                {
+                    title:'客户',
+                    list:[
+
+                        {name: "片区划分",img: `${this.$constant.hostUrl}/image/ghs/home/hcgl.png`,url: "/admin/custom/dist"}
+                    ]
+                },
                 {
                     title:'统计',
                     list:[
@@ -79,15 +86,6 @@ export default {
                         {name: "赊账汇总",img: `${this.$constant.hostUrl}/image/ghs/home/jyzk.png`,url: "/admin/custom/showTotalBalance"},
                     ]
                 },
-                {
-                    title:'产品',
-                    list:[
-
-                        {name: "产品列表",img: `${this.$constant.hostUrl}/image/ghs/home/hcgl.png`,url: "/admin/cp/list"},
-                        {name: "产品分类",img: `${this.$constant.hostUrl}/image/ghs/home/hcgl.png`,url: "/admin/cp/class"},
-                        {name: "已删除",img: `${this.$constant.hostUrl}/image/ghs/home/hcgl.png`,url: "/admin/cp/delList"},
-                    ]
-                },
                 {
                     title:'订单与销售',
                     list:[

+ 2 - 0
ghsApp/src/admin/home/member.vue

@@ -53,6 +53,8 @@
                 <text v-if="Number(item.black)==2" style="color:red;font-weight:bold;margin-left:20upx;">黑名单</text>
                 <text v-if="Number(item.delStatus)==1" style="color:red;font-weight:bold;margin-left:20upx;">已删除</text>
 
+                <text v-if="item.distName!=''" style="color:#b9a5a5;font-weight:bold;margin-left:20upx;">{{ item.distName }}</text>
+
               </div>
             </div>
           </div>

+ 25 - 0
ghsApp/src/api/dist/index.js

@@ -0,0 +1,25 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+export const getList = data => {
+	return https.get('/dist/get-list', data)
+}
+
+export const addDist = data => {
+	return https.post('/dist/add', data)
+}
+
+export const updateDist = data => {
+	return https.post('/dist/update', data)
+}
+
+export const delDist = data => {
+	return https.get('/dist/delete', data)
+}
+
+export const getAllDist = data => {
+	return https.get('/dist/get-all-dist', data)
+}
+
+export const changeDist = data => {
+	return https.get('/dist/change-dist', data)
+}

+ 3 - 1
ghsApp/src/pages.json

@@ -68,7 +68,9 @@
 				{"path": "rechargeChange","style": {"navigationBarTitleText": "充值记录","enablePullDownRefresh": false}},
 				{"path": "addStaff","style": {"navigationBarTitleText": "帮客户添加员工"}},
 				{"path": "invitePay","style": {"navigationBarTitleText": "付款结账"}},
-				{"path": "noExpend","style": {"navigationBarTitleText": "最近未下单","enablePullDownRefresh": false}}
+				{"path": "noExpend","style": {"navigationBarTitleText": "最近未下单","enablePullDownRefresh": false}},
+				{"path": "dist","style": {"navigationBarTitleText": "片区划分","enablePullDownRefresh": false}},
+				{"path": "distCustom","style": {"navigationBarTitleText": "设置片区","enablePullDownRefresh": false}}
 			]
 		},
 		{

+ 84 - 5
ghsApp/src/pagesClient/member/detail.vue

@@ -11,7 +11,7 @@
                       <text style="font-weight:bold;" @click="changeNameFn()">{{userInfo.name}}</text> <text @click="changeNameFn()" style="color:#3385ff;margin-left:32upx;font-size:30upx;">修改</text>
                   </view>
                   <view>{{userInfo.originName}}</view>
-                  <view>
+                  <view style="font-size:30upx;">
                     ID {{userInfo.sn}}
                     <text v-if="userInfo.overTimeUnExpend && userInfo.overTimeUnExpend == 10000" style="margin-left:40upx;color:green;font-weight:bold;">没有下过单</text>
                     <text v-if="userInfo.overTimeUnExpend && userInfo.overTimeUnExpend == 7" style="margin-left:40upx;color:green;font-weight:bold;">超1周未下单</text>
@@ -22,6 +22,8 @@
                     <text v-if="Number(userInfo.black)==2" style="color:red;font-weight:bold;margin-left:40upx;">黑名单</text>
                     <text v-if="Number(userInfo.delStatus)==1" style="color:red;font-weight:bold;margin-left:40upx;">已删除</text>
 
+                    <text v-if="userInfo.distName!=''" style="margin-left:40upx;color:#009688;" @click="openDistSelect">{{ userInfo.distName }}</text>
+                    <text v-else style="margin-left:40upx;color:#b9a5a5;" @click="openDistSelect">请设片区</text>
                   </view>
                 </view>
             </view>
@@ -282,14 +284,14 @@
         </div>
 
         <div class="inp-list-line" style="margin-top:35upx;" v-if="rechargeType == 0">
-						<div class="line-label">付款方式</div>
-						<div class="line-input">
+					<div class="line-label">付款方式</div>
+					<div class="line-input">
                 <button style="margin-right:2upx;" class="admin-button-com middle" :class="[payWay == 0 ? 'blue' : '']" @click="payWay = 0">微 信</button>
                 <button style="margin-right:2upx;" class="admin-button-com middle" :class="[payWay == 1 ? 'blue' : '']" @click="payWay = 1">支付宝</button>
                 <button style="margin-right:2upx;" class="admin-button-com middle" :class="[payWay == 4 ? 'blue' : '']" @click="payWay = 4">现 金</button>
                 <button class="admin-button-com middle" :class="[payWay == 5 ? 'blue' : '']" @click="payWay = 5">银行卡</button>
-						</div>
 					</div>
+				</div>
         </div>
 
         <div class="inp-list-line">
@@ -302,6 +304,27 @@
       </template>
 		</modal-module>
 
+    <!-- 配送区域选择弹框 -->
+    <uni-popup ref="distSelectRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
+      <view style="max-height:90vh;overflow: scroll;">
+        <view style="margin-left:30upx;margin-top:19upx;font-size:27upx;font-weight:bold;">请选择片区</view>
+        <view style="display:flex;padding:20upx;height:auto;justify-content: flex-start;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
+          <view v-for="(item, index) in allDist" :key="index" style="margin-bottom:20upx;margin-left:3upx;">
+            <button
+              class="admin-button-com staff-btn"
+              @click.stop="selectDist(item)"
+              :class="{'selected': currentDist.id === item.id}"
+            >
+              {{ item.name }}
+            </button>
+          </view>
+        </view>
+        <view style="text-align:center;padding:10upx 0 10upx 0;">
+          <button class="admin-button-com big blue" style="width:210upx;" @click="cancelDistSelect()">取消</button>
+        </view>
+      </view>
+    </uni-popup>
+
   </view>
 </template>
 <script>
@@ -313,6 +336,7 @@ import { IMGHOST } from '@/config'
 import { mapGetters } from "vuex"
 import { changeShowStock,changePassStatus,toChangeHome,changeWlName,modifyShortName,modifyHomeAmount,changeLevel,createSeatSnFn,modifySeatSnFn,changeDelStatus } from "@/api/custom"
 import { updateDebtLimit,updateCustomBlack,changeDiscount,changeName,rechargeFn,getGatheringCode} from "@/api/custom";
+import { getAllDist,changeDist } from "@/api/dist"
 export default {
   name: "detail",
   components: {
@@ -382,7 +406,9 @@ export default {
       payWay:-1,
       rechargeType:0,
       title:'付款结账',
-      needRefresh:0
+      needRefresh:0,
+      allDist:[],
+      currentDist:{}
     };
   },
 	computed: {
@@ -402,6 +428,11 @@ export default {
     if(this.option.name && !this.$util.isEmpty(this.option.name)){
       uni.setNavigationBarTitle({title:this.option.name})
     }
+    getAllDist().then(res=>{
+      if(res.code == 1){
+        this.allDist = res.data.list?res.data.list:[]
+      }
+    })
   },
   onShow(){
 
@@ -706,6 +737,26 @@ export default {
           this.title = name+' ¥'+res.data.remainDebtAmount
         }
       })
+    },
+    // 打开配送区域选择弹框
+    openDistSelect() {
+      this.currentDist = { id: this.userInfo.distId } || {};
+      this.$refs.distSelectRef.open('center');
+    },
+    // 选择配送区域
+    selectDist(dist) {
+      this.$refs.distSelectRef.close();
+      changeDist({customId:this.userInfo.id,distId:dist.id}).then(res=>{
+        if(res.code == 1){
+          this.$msg('设置成功')
+          this.userInfo.distName = dist.name
+          this.userInfo.distId = dist.id
+        }
+      })
+    },
+    // 关闭弹框
+    cancelDistSelect() {
+      this.$refs.distSelectRef.close();
     }
   }
 };
@@ -847,4 +898,32 @@ export default {
     color: #8c8989;
   }
 }
+
+.class-popup-style{
+  z-index:99999;
+}
+
+.staff-btn {
+  min-width: 160upx;
+  padding: 0 27upx;
+  height: 80upx;
+  font-size: 40upx;
+  font-weight: bold;
+  margin: 8upx 8upx 0 0;
+  border-radius: 16upx;
+  background: #f0f2f6;
+  color: #333;
+  border: 2upx solid #e0e0e0;
+  transition: none;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.staff-btn.selected,
+.staff-btn:active {
+  background: #f0f2f6;
+  color: #333;
+  border-color: #e0e0e0;
+}
 </style>