yunshangxie/pages/packageA/user/my_vip_clerk.vue

170 lines
4.6 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="message tn-safe-area-inset-bottom">
<tn-nav-bar :isBack="false" backTitle="" :bottomShadow="true" backgroundColor="#FFFFFF">
<view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left">
<view style="padding-left: 15rpx;" @click="goBack()">
<text class="tn-icon-left" style="font-size: 40rpx;"></text>
</view>
<view class="tn-margin-top"
style=";text-shadow: 1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;">
<tn-tabs :list="[{name:'店员管理'}]" activeColor="#000" :bold="false" :fontSize="36"></tn-tabs>
</view>
</view>
</tn-nav-bar>
<view class="" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<view class="tn-flex tn-flex-center tn-flex-col-center tn-flex-row-between" style="padding: 30rpx;">
<view>当前店铺</view>
<view @click="select_show = true">
<text>123456</text>
<text class="tn-icon-down-triangle"></text>
</view>
</view>
<tn-select v-model="select_show" mode="single" :list="select_list"></tn-select>
<view style="text-align: center;padding: 30rpx;">
<tn-button backgroundColor="#01BEFF" @click="addClerkShow = true" fontColor="#ffffff">添加店员</tn-button>
</view>
<view style="margin: 20rpx;font-size: 35rpx;font-weight: 600;">在职店员</view>
<view class="tn-flex tn-flex-center tn-flex-row-between" style="padding: 30rpx;">
<view class="tn-flex tn-flex-center tn-flex-col-center">
<view style="font-size: 30rpx;font-weight: 600;">李白</view>
<view style="margin-left: 20rpx;">1800000000</view>
<view style="margin-left: 20rpx;">
<tn-tag size="sm" backgroundColor="#FF7043" width="80rpx" shape="circle"
fontColor="#ffffff">未绑定</tn-tag>
<tn-tag size="sm" backgroundColor="#28B93D" width="80rpx" shape="circle"
fontColor="#ffffff">已绑定</tn-tag>
</view>
</view>
<view>
<tn-button backgroundColor="#E83A30" size="sm" shape="round" fontColor="#ffffff">删除</tn-button>
</view>
</view>
</view>
<tn-popup v-if="addClerkShow" :closeBtn="true" v-model="addClerkShow" mode="center" width="500rpx">
<view style="text-align: center;padding: 30rpx 0rpx;font-size: 32rpx;font-weight: 600;">添加店员</view>
<view style="text-align: center;width: 400rpx;margin:0rpx auto;">
<tn-form :model="formAdd" ref="form" labelWidth="120">
<tn-form-item label="姓名" prop="name">
<tn-input v-model="formAdd.clerk_name" :clearable="false" />
</tn-form-item>
<tn-form-item label="手机号" prop="intro">
<tn-input v-model="formAdd.phone" :clearable="false" />
</tn-form-item>
</tn-form>
</view>
<view style="text-align: center;margin-top: 50rpx;padding-bottom: 50rpx;">
<tn-button shape="round" width="80%" backgroundColor="#3F8BF2" fontColor="#ffffff">确定</tn-button>
</view>
</tn-popup>
<tn-modal v-model="show" :title="title" :content="content" :button="button" @click="dian"></tn-modal>
</view>
</template>
<script>
import {
clerkListByBusiness,
addClerk
} from "@/util/api";
import store from "@/store";
export default {
data() {
return {
show: false,
title: '提示信息',
content: '确定要删除店员吗?',
button: [{
text: '取消',
backgroundColor: '#F4F4F4',
fontColor: '#000000',
plain: true,
shape: 'round'
},
{
text: '确定',
backgroundColor: '#548ceb',
fontColor: '#FFFFFF'
}
],
addClerkShow: false,
formAdd: {
phone: '',
clerk_name: '',
},
select_show: false,
select_list: [{
value: '1',
label: 'A'
},
{
value: '2',
label: 'B'
},
{
value: '3',
label: 'C'
}
],
list: []
}
},
methods: {
add() {
addClerk({
business_id: d.code,
...formAdd
})
.then(res => {
console.log(res);
if (res.code == 1) {
}
})
.catch(error => {
uni.showToast({
title: error,
icon: 'none',
duration: 2000
});
})
},
del() {
},
dian(d) {
console.log(d);
},
getList() {
clerkListByBusiness({
business_id: d.code,
})
.then(res => {
console.log(res);
if (res.code == 1) {
this.list = res.data;
}
})
.catch(error => {
uni.showToast({
title: error,
icon: 'none',
duration: 2000
});
})
},
goBack() {
if (getCurrentPages().length > 1) {
uni.navigateBack()
} else {
uni.redirectTo({
url: '/pages/index/index'
})
}
},
}
}
</script>
<style>
</style>