首页
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/index/index",
|
||||
"pages/customer/index",
|
||||
"pages/login/index",
|
||||
"pages/index/index",
|
||||
"pages/order/index",
|
||||
"pages/web-view/index",
|
||||
"pages/mine/index",
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
.img-65x65{width:65rpx;height:65rpx;box-sizing:border-box;}
|
||||
.img-72x72{width:72rpx;height:72rpx;box-sizing:border-box;}
|
||||
.img-80x80{width:80rpx;height:80rpx;box-sizing:border-box;}
|
||||
.img-90x90{width:90rpx;height:90rpx;box-sizing:border-box;}
|
||||
.img-100x100{width:100rpx;height:100rpx;box-sizing:border-box;}
|
||||
.img-120x120{width:120rpx;height:120rpx;box-sizing:border-box;}
|
||||
.img-135x135{width:135rpx;height:135rpx;box-sizing:border-box;}
|
||||
|
||||
Vendored
+19
-3
File diff suppressed because one or more lines are too long
@@ -36,7 +36,7 @@ api = {
|
||||
appCusorder: "app/cusorder", //新建订单 /获取订单列表 /获取订单详情 /修改付款方式
|
||||
appCusorderTabs: "app/cusorder/tabs", //获取tab
|
||||
|
||||
appEmployees: "app/employees", //获取客户详细信息 /获取店员列表
|
||||
appEmployees: "app/employees", //获取客户详细信息 /获取店员列表 /更新店员信息 /删除店员
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -222,6 +222,18 @@ apiQuery.postAppEmployees = function (params) {
|
||||
})
|
||||
}
|
||||
|
||||
//更新店员信息
|
||||
apiQuery.putAppEmployees = function (params) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
HttpRequest(true, Config.api.appEmployees, 2, params, "PUT", resolve, reject)
|
||||
})
|
||||
}
|
||||
|
||||
//删除店员
|
||||
apiQuery.deleteAppEmployees = function (params) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
HttpRequest(true, Config.api.appEmployees, 2, params, "DELETE", resolve, reject)
|
||||
})
|
||||
}
|
||||
|
||||
export default apiQuery;
|
||||
+10
-49
@@ -1,66 +1,27 @@
|
||||
// pages/index/index.js
|
||||
import _ from '../../commons/js/commons'
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
imgUrl:_.config.imgUrl,
|
||||
},
|
||||
|
||||
//生命周期函数--监听页面加载
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
//生命周期函数--监听页面显示
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
//页面相关事件处理函数--监听用户下拉动作
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
//页面上拉触底事件的处理函数
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -1,3 +1,10 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationBarBackgroundColor": "#1a1c26",
|
||||
"backgroundColor": "#ffffff",
|
||||
"backgroundColorTop": "#1a1c26",
|
||||
"usingComponents": {
|
||||
|
||||
}
|
||||
}
|
||||
+56
-2
@@ -1,2 +1,56 @@
|
||||
<!--pages/index/index.wxml-->
|
||||
<text>pages/index/index.wxml</text>
|
||||
<view class="container">
|
||||
<view class="inner30 img-top-cover" style="background-image:url({{imgUrl}}index/theme.png);">
|
||||
<view class="relative pt20 pb20 pl10 pr10">
|
||||
<view>
|
||||
<text class="text-middle font-22 color-fff">Hi~ 店长好!欢迎回到狸车宝!</text>
|
||||
<view class="inline-block bg-f6 pt5 pb5 pl20 pr20 font-22 color-666 ulib-r750" bindtap="logout">
|
||||
<i class="iconfont icon-tuichu mr10"></i>退出
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-bold font-60 color-fff">
|
||||
<open-data type="userNickName"></open-data>
|
||||
</view>
|
||||
<view class="absolute right-0 box-middle mr10 img-90x90 ulib-r750 overflowhidden">
|
||||
<open-data type="userAvatarUrl"></open-data>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt40 inner30 pt40 bg-fff box-shadow-000-10-10 ulib-r10">
|
||||
<view class="font-36">客户代办事项</view>
|
||||
<view class="fn-flex pt20 pb20 color-fff">
|
||||
<view class="fn-flex-item relative mr15 pt25 pb25 pl110 bg-1c89fd-8058fe ulib-r10">
|
||||
<i class="absolute left-0 box-middle ml35 iconfont icon-qianke font-60"></i>
|
||||
<view>
|
||||
<view class="font-40">234</view>
|
||||
<view class="font-22">未联系潜客(人)</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fn-flex-item relative ml15 pt25 pb25 pl110 bg-fe606c-ff9026 ulib-r10">
|
||||
<i class="absolute left-0 box-middle ml35 iconfont icon-guanzhu font-60"></i>
|
||||
<view>
|
||||
<view class="font-40">234</view>
|
||||
<view class="font-22">特别关注客户(人)</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt20 font-36">订单代办事项</view>
|
||||
<view class="fn-flex pt20 pb20">
|
||||
<view class="fn-flex-item relative pl120">
|
||||
<i class="absolute left-0 box-middle ml50 iconfont icon-qianhetong font-50"></i>
|
||||
<view>
|
||||
<view class="font-40">17</view>
|
||||
<view class="font-22 color-666">需签订合同</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fn-flex-item relative pl120">
|
||||
<i class="absolute left-0 box-middle ml50 iconfont icon-banfenqi font-50"></i>
|
||||
<view>
|
||||
<view class="font-40">12</view>
|
||||
<view class="font-22 color-666">需办理分期</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<lcb-footer></lcb-footer>
|
||||
@@ -1 +1,2 @@
|
||||
/* pages/index/index.wxss */
|
||||
.bg-1c89fd-8058fe{background-image:linear-gradient(45deg, #1c89fd, #8058fe);}
|
||||
.bg-fe606c-ff9026{background-image:linear-gradient(45deg, #fe606c, #ff9026);}
|
||||
@@ -3,42 +3,50 @@ const app = getApp()
|
||||
Page({
|
||||
data: {
|
||||
imgUrl:_.config.imgUrl,
|
||||
list:[
|
||||
{
|
||||
head:'http://img.cms.xmfish.com/data/upload/20217/file_1625105711.jpg',
|
||||
name:'逆行的光',
|
||||
id:0,
|
||||
},
|
||||
{
|
||||
head:'http://img.cms.xmfish.com/data/upload/20217/file_1625105711.jpg',
|
||||
name:'逆行的光',
|
||||
id:0,
|
||||
},
|
||||
{
|
||||
head:'http://img.cms.xmfish.com/data/upload/20217/file_1625105711.jpg',
|
||||
name:'逆行的光',
|
||||
id:0,
|
||||
},
|
||||
{
|
||||
head:'http://img.cms.xmfish.com/data/upload/20217/file_1625105711.jpg',
|
||||
name:'逆行的光',
|
||||
id:0,
|
||||
},
|
||||
{
|
||||
head:'http://img.cms.xmfish.com/data/upload/20217/file_1625105711.jpg',
|
||||
name:'逆行的光',
|
||||
id:0,
|
||||
},
|
||||
],
|
||||
isShowAddStaff:false,
|
||||
name:'',
|
||||
mobile:'',
|
||||
list: [],
|
||||
pageNo: 1,
|
||||
noData: false,
|
||||
end: false,
|
||||
load: true,
|
||||
loading: false,
|
||||
},
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
onShow: function () {
|
||||
this.getAppEmployees()
|
||||
},
|
||||
|
||||
//获取客户列表
|
||||
getAppEmployees() {
|
||||
this.setData({
|
||||
load: false,
|
||||
loading: true,
|
||||
})
|
||||
let params = {};
|
||||
params['page'] = this.data.pageNo;
|
||||
params['size'] = 20;
|
||||
_.apiQuery.getAppEmployees(params).then(res => {
|
||||
this.setData({
|
||||
pageNo: this.data.pageNo + 1,
|
||||
list: this.data.list.concat(res.data.list),
|
||||
load: true,
|
||||
loading: false,
|
||||
})
|
||||
if (res.data.total == 0) {
|
||||
this.setData({
|
||||
noData: true
|
||||
})
|
||||
} else if (this.data.list.length == res.data.total) {
|
||||
this.setData({
|
||||
end: true
|
||||
})
|
||||
}
|
||||
wx.stopPullDownRefresh()
|
||||
});
|
||||
},
|
||||
|
||||
// 输入
|
||||
@@ -58,45 +66,124 @@ Page({
|
||||
},
|
||||
|
||||
//新增员工
|
||||
addStaff(){
|
||||
let list = this.data.list
|
||||
list.push({name:'添加',head:'http://img.cms.xmfish.com/data/upload/20217/file_1625105711.jpg',}),
|
||||
this.setData({
|
||||
list:list,
|
||||
isShowAddStaff:false,
|
||||
})
|
||||
postAppEmployees(){
|
||||
let that = this
|
||||
if (that.data.name == '' ) {
|
||||
wx.showToast({
|
||||
title: '请输入店员姓名',
|
||||
icon: 'none'
|
||||
})
|
||||
} else if (!/^1[3456789]\d{9}$/.test(that.data.mobile)){
|
||||
wx.showToast({
|
||||
title: '请输入店员手机号',
|
||||
icon: 'none'
|
||||
})
|
||||
}else{
|
||||
that.setData({
|
||||
submitFlag: true,
|
||||
})
|
||||
let params = {};
|
||||
params['name'] = that.data.name;
|
||||
params['mobile'] = that.data.mobile;
|
||||
_.apiQuery.postAppEmployees(params).then(res => {
|
||||
that.setData({
|
||||
submitFlag: false,
|
||||
isShowAddStaff:false,
|
||||
})
|
||||
wx.showModal({
|
||||
title: '添加成功',
|
||||
content: '',
|
||||
confirmText: "再建一个",
|
||||
confirmColor: "#36afa2",
|
||||
cancelText: "关闭",
|
||||
success(res2) {
|
||||
if (res2.confirm) {
|
||||
that.showAddStaff()
|
||||
} else if (res2.cancel) {
|
||||
that.onPullDownRefresh()
|
||||
}
|
||||
}
|
||||
})
|
||||
}).catch(res=>{
|
||||
that.setData({
|
||||
submitFlag: false,
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
//暂停
|
||||
suspend(){
|
||||
putAppEmployees(e){
|
||||
let that = this
|
||||
wx.showModal({
|
||||
title: '',
|
||||
content: '确定暂停该店员账号吗?',
|
||||
content: that.data.list[e.currentTarget.dataset.index].status == 1?'确定暂停该店员账号吗?':'确定开启该店员账号吗?',
|
||||
confirmColor: '#36afa2',
|
||||
success (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定')
|
||||
let params = {};
|
||||
params['id'] = that.data.list[e.currentTarget.dataset.index].id;
|
||||
params['status'] = that.data.list[e.currentTarget.dataset.index].status == 1?'0':'1';
|
||||
_.apiQuery.putAppEmployees(params).then(res => {
|
||||
that.setData({
|
||||
['list['+e.currentTarget.dataset.index+'].status']:that.data.list[e.currentTarget.dataset.index].status == 1?'0':'1',
|
||||
})
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//删除
|
||||
delete(){
|
||||
deleteAppEmployees(e){
|
||||
let that = this
|
||||
wx.showModal({
|
||||
title: '',
|
||||
content: '确定删除该店员账号吗?',
|
||||
confirmColor: '#36afa2',
|
||||
success (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定')
|
||||
let params = {};
|
||||
params['id'] = that.data.list[e.currentTarget.dataset.index].id;
|
||||
_.apiQuery.deleteAppEmployees(params).then(res => {
|
||||
let list = that.data.list
|
||||
list.splice(e.currentTarget.dataset.index, 1)
|
||||
that.setData({
|
||||
list:list,
|
||||
})
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//推送链接
|
||||
pushLink(e) {
|
||||
if(e.currentTarget.dataset.url){
|
||||
_.$router.openUrlScheme(e.currentTarget.dataset.url)
|
||||
}
|
||||
},
|
||||
|
||||
//页面相关事件处理函数--监听用户下拉动作
|
||||
onPullDownRefresh(){
|
||||
this.setData({
|
||||
list: [],
|
||||
pageNo: 1,
|
||||
noData: false,
|
||||
end: false,
|
||||
load: true,
|
||||
loading: false,
|
||||
})
|
||||
this.getAppEmployees()
|
||||
},
|
||||
|
||||
//页面上拉触底事件的处理函数
|
||||
onReachBottom(){
|
||||
if (this.data.noData || this.data.end||!this.data.load) return;
|
||||
this.getAppEmployees()
|
||||
},
|
||||
|
||||
})
|
||||
@@ -29,14 +29,15 @@
|
||||
<view class="fn-flex-item">操作</view>
|
||||
</view>
|
||||
<block wx:for="{{list}}" wx:key='index'>
|
||||
<view class="relative pt30 pb30 pr250 bbs-1-eb last-b-none">
|
||||
<view class="relative pt30 pb30 pr250 bbs-1-eb last-b-none {{item.status==1?'':'opacity-50'}}">
|
||||
<view class="text-nowrap">
|
||||
<image class='img-50x50 bds-1-eb ulib-r750 text-middle' lazy-load="{{true}}" mode="scaleToFill" src="{{item.head}}"></image>
|
||||
<text class="pl10 text-middle font-28">{{item.name}}</text>
|
||||
<image class='img-50x50 bds-1-eb ulib-r750 text-middle' lazy-load="{{true}}" mode="scaleToFill" src="{{imgUrl}}common/default-head.jpg"></image>
|
||||
<text class="pl10 text-middle font-28">{{item.uname}}</text>
|
||||
<!-- <text class="pl10 text-middle font-28">{{item.mobile}}</text> -->
|
||||
</view>
|
||||
<view class="absolute right-0 box-middle">
|
||||
<view class="inline-block bg-333 mr20 pt5 pb5 pl10 pr10 font-22 color-fff ulib-r750" bindtap="suspend" data-index="{{index}}"><i class="iconfont icon-zanting mr5"></i>暂停</view>
|
||||
<view class="inline-block bg-333 pt5 pb5 pl10 pr10 font-22 color-fff ulib-r750" bindtap="delete" data-index="{{index}}"><i class="iconfont icon-shanchu mr5"></i>删除</view>
|
||||
<view class="inline-block bg-333 mr20 pt5 pb5 pl10 pr10 font-22 color-fff ulib-r750" bindtap="putAppEmployees" data-index="{{index}}"><i class="iconfont icon-zanting mr5"></i>{{item.status == 1?'暂停':'开启'}}</view>
|
||||
<view class="inline-block bg-333 pt5 pb5 pl10 pr10 font-22 color-fff ulib-r750" bindtap="deleteAppEmployees" data-index="{{index}}"><i class="iconfont icon-shanchu mr5"></i>删除</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
@@ -49,13 +50,13 @@
|
||||
<view slot="content" class="inner40 text-center">
|
||||
<view class="pt10 pb10 font-36">新增员工</view>
|
||||
<view class="pt20 pb10">
|
||||
<input class="wp100 bg-f6 font-32 ulib-r750" placeholder-class="color-ccc" type="number" placeholder="请输入店员名称" bindinput='inputTx' data-key='name' value='{{name}}' style="height:90rpx" />
|
||||
<input class="wp100 bg-f6 font-32 ulib-r750" placeholder-class="color-ccc" type="text" placeholder="请输入店员名称" bindinput='inputTx' data-key='name' value='{{name}}' style="height:90rpx" />
|
||||
</view>
|
||||
<view class="pt10 pb20">
|
||||
<input class="wp100 bg-f6 font-32 ulib-r750" placeholder-class="color-ccc" type="number" placeholder="请输入店员手机号" bindinput='inputTx' data-key='mobile' value='{{mobile}}' style="height:90rpx" />
|
||||
</view>
|
||||
<view class="pt20 pb10 pl100 pr100 text-center">
|
||||
<button class="btn-36afa2 pt10 pb10 text-center font-32 color-fff ulib-r750" hover-class="btn-36afa2-hover" disabled="{{submitFlag}}" bindtap="addStaff">添加</button>
|
||||
<button class="btn-36afa2 pt10 pb10 text-center font-32 color-fff ulib-r750" hover-class="btn-36afa2-hover" disabled="{{submitFlag}}" bindtap="postAppEmployees">添加</button>
|
||||
</view>
|
||||
</view>
|
||||
</lcb-msg>
|
||||
Reference in New Issue
Block a user