master
lion 3 years ago
parent b6238835ef
commit 2968bbc44d

@ -50,7 +50,7 @@
"quickapp" : {}, "quickapp" : {},
/* */ /* */
"mp-weixin" : { "mp-weixin" : {
"appid" : "wxd7b6631f1d3bc6bd", "appid" : "wx35190cc07e73eda1",
"setting" : { "setting" : {
"urlCheck" : false, "urlCheck" : false,
"minified" : false "minified" : false

@ -7,7 +7,7 @@
Hi ~ {{userName}} Hi ~ {{userName}}
</view> </view>
<view> <view>
www.bd.@mail.com {{userEmail}}
</view> </view>
</view> </view>
<u--image :src="logo" width="164rpx" height="65rpx"></u--image> <u--image :src="logo" width="164rpx" height="65rpx"></u--image>
@ -33,60 +33,63 @@
</view> </view>
<view class="db"> <view class="db">
<view>待办</view> <view>待办</view>
<view class="dblist"> <view class="dblist">
<view> <view>
<view v-for="(item, index) in iconList" :key="index"> <view v-for="(item, index) in list" :key="index">
<view class="dbitem" @click="toDetail"> <view class="dbitem" @click="toDetail(item.id)">
<text class="dbtype">普通访客</text> <text class="dbtype">{{item.type_text}}</text>
<view class="dbstatus bm"> <view class="dbstatus bm">
<view>待审核</view> <view>{{item.audit_status_text}}</view>
<view> <view>
<text>访问时间 2023-03-06</text> <text style="margin-right:10px">访问时间{{item.date}}</text>
<text>10:00至11:00</text> <text>{{item.visit_time.start_time}}{{item.visit_time.end_time}}</text>
</view> </view>
</view> </view>
<view class="dbinfo justify-left"> <view class="dbinfo justify-left">
<view> <view>
<view>被访人<text>章三</text></view> <view>被访人<text>{{item.accept_admin_id}}</text></view>
<view>被访人部门<text>生产</text></view> <view>部门<text>生产</text></view>
<view>长期访客申请<text></text></view> <view>访问区域<text>{{item.visit_area_id}}</text></view>
</view> </view>
<view> <view>
<view>访问区域<text>章三</text></view> <view>拜访人<text>{{item.name}}</text></view>
<view>拜访人<text>生产</text></view> <view>电话{{item.mobile}}</view>
<view>事由<text></text></view> <view v-if="item.type=='1'"><text>{{item.reason}}</text></view>
</view> <view v-else-if="item.type=='3'">车牌<text>{{item.plate}}</text></view>
</view> </view>
</view>
<view class="dblong"> <view class="dblong">
长期访问时间2023-01-01 2023-12-31 <view>长期访客申请<text>{{item.long_time==0?'否':'是'}}</text></view>
</view> <text v-if="item.long_time==1">访{{item.start_date}} {{item.end_date}}</text>
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import '@/static/css/bd.css' import '@/static/css/bd.css'
export default { export default {
data() { data() {
return { return {
userName: "12333", userName: "",
userEmail: "",
logo: require("../../static/img/logo.png"), logo: require("../../static/img/logo.png"),
searchlogo: require("../../static/img/search.png"), searchlogo: require("../../static/img/search.png"),
iconList: [{ iconList: [{
src: require("../../static/img/wdsh.png"), src: require("../../static/img/wdsh.png"),
text: '我的审核', text: '我的审核',
url: "/pages/bd/check" url: "/pages/bd/record?type=mycheck"
}, },
{ {
src: require("../../static/img/bfjl.png"), src: require("../../static/img/bfjl.png"),
text: '被访记录', text: '被访记录',
url: "/pages/bd/record" url: "/pages/bd/record?type=myrecord"
}, },
{ {
src: require("../../static/img/yy.png"), src: require("../../static/img/yy.png"),
@ -98,27 +101,114 @@
text: '代邀约记录', text: '代邀约记录',
url: "/pages/bd/replace" url: "/pages/bd/replace"
} }
], ],
data:[], list: [],
select: {
page: 1,
page_size: 5,
total: 0,
audit_status:0,
keyword:""
}
} }
}, },
onLoad() { onLoad() {
this.getBdInfo()
this.loadList()
},
onPullDownRefresh() {
this.select.page = 1
this.loadList()
uni.stopPullDownRefresh();
},
//
onReachBottom() {
//>=
if (this.list.length >= this.select.total) {
//
uni.showToast({
title: '没有更多了',
duration: 1000,
icon: 'none'
})
} else {
//+1
this.select.page++
this.loadList()
}
}, },
methods: { methods: {
toUrl(url){ toUrl(url) {
uni.navigateTo({ uni.navigateTo({
url:url url: url
}) })
}, },
toDetail(){ toDetail(id) {
uni.navigateTo({ uni.navigateTo({
url:'/pages/visit/detail' url: '/pages/visit/detail?id=' + id
}) })
}, },
searchList(val) {}, getBdInfo() {
// scrolltolower(){}, let that = this
this.util.request({
api: '/api/admin/auth/me',
method: "POST",
utilSuccess: function(res) {
console.log(res)
that.userName = res.name
that.userEmail = res.email
uni.showToast({
title: res.errmsg,
duration: 2000,
icon: 'none'
})
},
utilFail: function(res) {
uni.showToast({
title: res.errmsg,
duration: 2000,
icon: 'none'
})
}
})
},
loadList() {
let that = this
this.util.request({
api: '/api/admin/visit/index',
method: "get",
data: {
page: this.select.page,
page_size: this.select.page_size,
audit_status:this.select.audit_status,
keyword:this.select.keyword
},
utilSuccess: function(res) {
if (that.select.page == 1) {
that.list = res.data
} else {
that.list.push(...res.data)
}
that.select.total = res.total
},
utilFail: function(res) {
uni.showToast({
title: res.errmsg,
duration: 2000,
icon: 'none'
})
}
})
},
searchList(val) {
this.select.keyword = val
this.select.page = 1
this.loadList()
},
// scrolltolower(){},
} }
} }
</script> </script>
@ -181,7 +271,5 @@
.mine .icontext { .mine .icontext {
text-align: center; text-align: center;
margin-top: 15rpx margin-top: 15rpx
} }
</style> </style>

@ -1,92 +1,148 @@
<template> <template>
<view class="containers"> <view class="containers">
<view class="dbbtns justify-between"> <view class="dbbtns justify-between">
<text v-for="item in btnList" :class="{'active':btnActive===item.value}" @click="btnActive=item.value"> <text v-for="item in btnList" :class="{'active':btnActive===item.value}" @click="btnActive=item.value">
{{item.label}} {{item.label}}
</text> </text>
<!-- <text >已完成</text> <!-- <text >已完成</text>
<text>待完成</text> --> <text>待完成</text> -->
</view> </view>
<view class="db"> <view class="db">
<view class="dblist"> <view class="dblist">
<view> <view>
<view v-for="(item, index) in iconList" :key="index"> <view v-for="(item, index) in list" :key="index">
<view class="dbitem" @click="toDetail"> <view class="dbitem" @click="toDetail(item.id)">
<text class="dbtype">普通访客</text> <text class="dbtype">{{item.type_text}}</text>
<view class="dbstatus bm"> <view class="dbstatus bm">
<view>待审核</view> <view>{{item.audit_status_text}}</view>
<view> <view>
<text>访问时间 2023-03-06</text> <text style="margin-right:10px">访问时间{{item.date}}</text>
<text>10:00至11:00</text> <text>{{item.visit_time.start_time}}{{item.visit_time.end_time}}</text>
</view> </view>
</view> </view>
<view class="dbinfo justify-left"> <view class="dbinfo justify-left">
<view> <view>
<view>被访人<text>章三</text></view> <view>被访人<text>{{item.accept_admin_id}}</text></view>
<view>被访人部门<text>生产</text></view> <view>部门<text>生产</text></view>
<view>长期访客申请<text></text></view> <view>访问区域<text>{{item.visit_area_id}}</text></view>
</view> </view>
<view> <view>
<view>访问区域<text>章三</text></view> <view>拜访人<text>{{item.name}}</text></view>
<view>拜访人<text>生产</text></view> <view>电话{{item.mobile}}</view>
<view>事由<text></text></view> <view v-if="item.type=='1'"><text>{{item.reason}}</text></view>
</view> <view v-else-if="item.type=='3'">车牌<text>{{item.plate}}</text></view>
</view> </view>
<view class="dblong"> </view>
长期访问时间2023-01-01 2023-12-31 <view class="dblong">
</view> <view>长期访客申请<text>{{item.long_time==0?'否':'是'}}</text></view>
</view> <text v-if="item.long_time==1">访{{item.start_date}} {{item.end_date}}</text>
</view> </view>
</view> </view>
</view> </view>
</view>
</view> </view>
</view>
</view>
</template>
</view>
<script> </template>
import '@/static/css/bd.css'
export default{ <script>
data(){ import '@/static/css/bd.css'
return{ export default {
iconList:[1,2,3,4], data() {
btnActive:"all", return {
btnList:[ btnActive: "all",
{ btnList: [{
label:"全部", label: "全部",
value:'all' value: 'all'
}, },
{ {
label:"已完成", label: "已完成",
value:'complete' value: 'complete'
}, },
{ {
label:"待完成", label: "待完成",
value:'going' value: 'going'
} }
] ],
} list: [],
}, select: {
onLoad(){ page: 1,
page_size: 5,
}, total: 0,
methods:{ audit_status: 0
toDetail(){ }
uni.navigateTo({ }
url:'/pages/visit/detail' },
}) onLoad() {
} this.loadList()
} },
} onPullDownRefresh() {
</script> this.select.page = 1
this.loadList()
<style scoped> uni.stopPullDownRefresh();
.containers{ },
background-color: #eceefe; //
min-height: 100vh; onReachBottom() {
/* padding-top:20rpx; */ //>=
} if (this.list.length >= this.select.total) {
</style> //
uni.showToast({
title: '没有更多了',
duration: 1000,
icon: 'none'
})
} else {
//+1
this.select.page++
this.loadList()
}
},
methods: {
toDetail() {
uni.navigateTo({
url: '/pages/visit/detail'
})
},
loadList() {
let that = this
this.util.request({
api: '/api/admin/visit/index',
method: "get",
data: {
page: this.select.page,
page_size: this.select.page_size,
audit_status: this.select.audit_status
},
utilSuccess: function(res) {
if (that.select.page == 1) {
that.list = res.data
} else {
that.list.push(...res.data)
}
that.select.total = res.total
},
utilFail: function(res) {
uni.showToast({
title: res.errmsg,
duration: 2000,
icon: 'none'
})
}
})
},
}
}
</script>
<style scoped>
.containers {
background-color: #eceefe;
min-height: 100vh;
/* padding-top:20rpx; */
}
</style>

@ -29,13 +29,13 @@
wlcl: require('../../static/img/wlcl1.png'), wlcl: require('../../static/img/wlcl1.png'),
sgry: require('../../static/img/sgry1.png'), sgry: require('../../static/img/sgry1.png'),
bdgl: require('../../static/img/bdgl.png'), bdgl: require('../../static/img/bdgl.png'),
winHeight: 0 winHeight: 0,
isBd:""
} }
}, },
onLoad() { onLoad() {
console.log(uni.getSystemInfoSync().statusBarHeight) this.winHeight = uni.getSystemInfoSync().screenHeight - uni.getSystemInfoSync().statusBarHeight * 2-20;
this.winHeight = uni.getSystemInfoSync().screenHeight - uni.getSystemInfoSync().statusBarHeight * 2-20; this.isBd = uni.getStorageSync("userInfo_BD_token").token
console.log(this.winHeight)
}, },
methods: { methods: {
toUrl(type) { toUrl(type) {
@ -51,8 +51,13 @@
url = "/pages/visit/addrecord?type=3" url = "/pages/visit/addrecord?type=3"
// url = "/pages/visit/study?type=3" // url = "/pages/visit/study?type=3"
break; break;
case 4: case 4:
url = "/pages/index/login" if(!this.util.isNull(this.isBd)){
url = "/pages/bd/mine"
}else{
url = "/pages/index/login"
}
break; break;
} }
console.log(url) console.log(url)

@ -4,19 +4,20 @@
<view> <view>
<u--image :showLoading="true" :src="logo" width="336rpx" height="336rpx"></u--image> <u--image :showLoading="true" :src="logo" width="336rpx" height="336rpx"></u--image>
</view> </view>
</view> </view>
<view class="login">
<u--form labelPosition="top" :labelStyle="labelStyle" :labelWidth="'auto'" :model="form" :rules="rules" ref="form"> <view class="login">
<u-form-item label="用户名" prop="form.name" ref="item1"> <uni-forms ref="formdata" :model="form" :border="true" :rules="rules" labelWidth="100px" label-position="top">
<u--input v-model="form.name" border="bottom" placeholder="请输入用户名"></u--input> <uni-forms-item label="用户名" name="name">
</u-form-item> <uni-easyinput :inputBorder="false" v-model="form.name" placeholder="请输入用户名" />
<u-form-item label="密码" prop="form.password" ref="item1"> </uni-forms-item>
<u--input type="password" v-model="form.password" border="bottom" placeholder="请输入密码"></u--input> <uni-forms-item label="密码" name="password">
</u-form-item> <uni-easyinput :inputBorder="false" type="password" v-model="form.password" placeholder="请输入密码" />
</uni-forms-item>
</uni-forms>
<view class="sbtn"> <view class="sbtn">
<u-button type="primary" size="large" @click="submit"></u-button> <u-button type="primary" size="large" @click="submit"></u-button>
</view> </view>
</u--form>
</view> </view>
</view> </view>
</template> </template>
@ -28,7 +29,20 @@
logo: require("../../static/img/bdlogo.png"), logo: require("../../static/img/bdlogo.png"),
winHeight: 0, winHeight: 0,
form: {}, form: {},
rules: {}, rules: {
name: {
rules: [{
required: true,
errorMessage: '请输入用户名'
}]
},
password: {
rules: [{
required: true,
errorMessage: '请输入密码'
}]
}
},
labelStyle:{ labelStyle:{
fontSize:'12px', fontSize:'12px',
color:"#ccc" color:"#ccc"
@ -41,9 +55,40 @@
methods: { methods: {
submit(){ submit(){
uni.navigateTo({ let that = this
url:"/pages/bd/mine" this.$refs['formdata'].validate().then(res => {
this.util.request({
api: '/api/admin/auth/login',
data: {
username:this.form.name,
password:this.form.password
},
method:'POST',
utilSuccess: function(res) {
console.log(res)
uni.setStorageSync("userInfo_BD_token", {
token:res.access_token
})
uni.showToast({
title:"登录成功",
success() {
uni.navigateTo({
url:"/pages/bd/mine"
})
}
})
},
utilFail: function(res) {}
})
}).catch(err => {
console.log('err', err);
}) })
// uni.navigateTo({
// url:"/pages/bd/mine"
// })
} }
} }
} }

@ -4,67 +4,86 @@
<view class="dblist"> <view class="dblist">
<view> <view>
<view class="dbitem"> <view class="dbitem">
<text class="dbtype">普通访客</text> <text class="dbtype">{{info.type_text}}</text>
<view class="dbstatus bm"> <view class="dbstatus bm">
<view>待审核</view> <view>{{info.audit_status_text}}</view>
<view> <view>
<text>访问时间 2023-03-06</text> <text style="margin-right:10px">访问时间{{info.date}}</text>
<text>10:00至11:00</text> <text>{{info.visit_time.start_time}}{{info.visit_time.end_time}}</text>
</view> </view>
</view> <view v-if="info.type=='2'">{{info.work_start_time}}{{info.work_end_time}}</view>
<view class="dbinfo justify-left">
<view>
<view>被访人<text>章三</text></view>
<view>被访人部门<text>生产</text></view>
<view>长期访客申请<text></text></view>
</view>
<view>
<view>访问区域<text>章三</text></view>
<view>拜访人<text>生产</text></view>
<view>事由<text></text></view>
</view>
</view>
<view class="dblong">
长期访问时间2023-01-01 2023-12-31
</view> </view>
<view class="dbinfo justify-left">
<view>
<view>被访人<text>{{info.accept_admin_id}}</text></view>
<view>部门<text>生产</text></view>
<view>访问区域<text>{{info.visit_area_id}}</text></view>
</view>
<view>
<view>拜访人<text>{{info.name}}</text></view>
<view>电话{{info.mobile}}</view>
<view v-if="info.type=='1'"><text>{{info.reason}}</text></view>
<view v-else-if="info.type=='3'">车牌<text>{{info.plate}}</text></view>
</view>
</view>
<view class="dblong">
<view>长期访客申请<text>{{info.long_time==0?'否':'是'}}</text></view>
<view v-if="info.long_time==1">访{{info.start_date}} {{info.end_date}}</view>
</view>
</view> </view>
</view> </view>
<view class="dbtext">随访人员</view> <view class="dbtext">随访人员</view>
<view class="dbitem sfyritem"> <view class="dbitem sfyritem">
<view class="dbinfo sfry"> <template v-if="info.follw_people">
<view class="justify-between"> <view class="dbinfo justify-left" v-for="people in info.follw_people">
<view> <view>
被访人<text>章三</text> <view>
随访人<text>{{people.name}}</text>
</view>
<view>证件类型<text>{{people.credent_name}}</text></view>
<view>证件号<text>{{people.idcard}}</text></view>
</view> </view>
<view> <view>
联系电话<text>18914071203</text> 联系电话<text>{{people.mobile}}</text>
</view> </view>
</view> </view>
<view>证件类型<text>生产</text></view> </template>
<view>证件号<text></text></view> <template>
</view> <view class="dbinfo justify-left">
</view>
</template>
</view> </view>
<view class="dbtext">到访车辆</view> <view class="dbtext">到访车辆</view>
<view class="dbitem sfyritem"> <view class="dbitem sfyritem">
<view class="dbinfo sfry"> <view class="dbinfo">
<view class="justify-between"> <view class="onechild">
<view> 车牌<text>{{info.cars}}</text>
车牌<text>章三</text> </view>
</view> </view>
</view>
<view class="dbtext">收货人</view>
<view class="dbitem sfyritem">
<view class="dbinfo justify-left">
<view>
部门<text>{{info.accpet_department_id}}</text>
</view>
<view>
人员<text>{{info.accept_goods_admin_id}}</text>
</view> </view>
</view> </view>
</view> </view>
<view class="dbtext">被访人员</view> <view class="dbtext">被访人员</view>
<view class="dbitem sfyritem"> <view class="dbitem sfyritem">
<view class="dbinfo sfry"> <view class="dbinfo justify-left">
<view class="justify-between"> <view>
<view> 部门<text>{{info.accept_admin_sign}}</text>
部门<text>章三</text> </view>
</view> <view>
<view> 人员<text>{{info.accept_admin_id}}</text>
人员<text>18914071203</text>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -76,7 +95,54 @@
</template> </template>
<script> <script>
import '@/static/css/bd.css' import '@/static/css/bd.css'
export default{
data(){
return{
id:"",
info:{}
}
},
onReady() {
},
onLoad(options) {
this.id = options.id
this.loadDetail()
},
methods:{
loadDetail(){
let that = this
this.util.request({
api: '/api/admin/visit/show',
method: "get",
data: {
id:that.id
},
utilSuccess: function(res) {
that.info = res
},
utilFail: function(res) {
uni.showToast({
title: res.errmsg,
duration: 2000,
icon: 'none'
})
}
})
},
isnull(p){
if(p == '' || p == undefined || p == null || p == 'undefined' || p == 'null'){
return ""
}else{
return p
}
}
}
}
</script> </script>
<style scoped> <style scoped>
@ -95,19 +161,6 @@
.sfyritem{ .sfyritem{
padding-bottom:10rpx padding-bottom:10rpx
} }
.sfry{
padding-bottom:0
}
.sfry>view{
padding-right:0;
padding-bottom:20rpx
}
.sfry>view:last-child {
padding-left:0
}
.sfry>view view {
padding-bottom: 0rpx;
}
.dbinfo>view text { .dbinfo>view text {
color: #8f9596; color: #8f9596;
} }

@ -36,7 +36,8 @@
padding:30rpx 0 padding:30rpx 0
} }
.dbinfo>view{ .dbinfo>view{
padding-right:60rpx; /* padding-right:60rpx; */
width: 50%;
} }
.dbinfo>view:first-child{ .dbinfo>view:first-child{
border-right: 1px solid #f0f4f7; border-right: 1px solid #f0f4f7;
@ -54,6 +55,10 @@
.dbinfo>view view text{ .dbinfo>view view text{
color:#8f9596; color:#8f9596;
} }
.dbinfo view.onechild:first-child{
padding-left: 0;
border-right: none;
}
.dblong{ .dblong{
color:#8f9596; color:#8f9596;
font-size: 30rpx; font-size: 30rpx;

@ -15,7 +15,8 @@ const formatTime = date => {
return [year, month, day].map(formatNumber).join('-'); return [year, month, day].map(formatNumber).join('-');
}; };
const user_info_key = "userInfo_token"; const user_info_key = "userInfo_token";
const userInfo_BD_token = "userInfo_BD_token"
const user_key = "userInfo"; const user_key = "userInfo";
const getUserInfo = (cb, refresh) => { const getUserInfo = (cb, refresh) => {
@ -165,16 +166,19 @@ const request = options => {
}; // 如果已登录,请求中拼openId }; // 如果已登录,请求中拼openId
var access_token = uni.getStorageSync(user_info_key).token; var access_token = uni.getStorageSync(user_info_key).token;
var access_token_bd = uni.getStorageSync(userInfo_BD_token).token;
var request_token = access_token_bd?access_token_bd:access_token
console.log(request_token)
if (isLogin()) { if (isLogin()) {
options.data = { options.data = {
...options.data, ...options.data,
'token': access_token 'token': request_token
}; };
} // 如果是POST方法 } // 如果是POST方法
if (options.method == 'POST' && !isNull(access_token)) { if (options.method == 'POST' && !isNull(request_token)) {
// 拼时间戳 // 拼时间戳
options.data.ts = new Date().getTime(); options.data.ts = new Date().getTime();
} }
@ -295,8 +299,9 @@ const payOrder = (orderID, orderType, success, fail) => {
}; // 判断是否已登录同时有open-id和PhoneNum, 则认为已登录) }; // 判断是否已登录同时有open-id和PhoneNum, 则认为已登录)
const isLogin = () => { const isLogin = () => {
var userInfo = uni.getStorageSync(user_info_key); var userInfo = uni.getStorageSync(user_info_key);
return !isNull(userInfo.token); var userInfoBDtoken = uni.getStorageSync(userInfo_BD_token);
return !isNull(userInfo.token) || !isNull(userInfoBDtoken.token);
}; // 判断是否为空 }; // 判断是否为空

Loading…
Cancel
Save