123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311 |
- <template>
- <view class="yybox">
- <view class="navbox">
- <image :src="navbg" class="navbg"></image>
- <uni-nav-bar color="#ffffff" leftWidth='340rpx' :background-color="backgroundColor" :border="false" statusBar='true' fixed="true">
- <block slot="left">
- <view class="navleft">
- <view>{{city}} {{daytime}}</view>
- <view>农历{{lunar}}</view>
- </view>
- </block>
- <block slot="right">
- <view class="topr flexccc" v-if="weather">
- <image :src="weathericon" class="navright"></image>
- <view class="f12 cof">{{weather}} {{temperature}}°C</view>
- </view>
- </block>
- </uni-nav-bar>
- </view>
- <!-- 主体 -->
- <view class="yymain">
- <view class="yycard">
- <view class="top flexccc">
- <image :src="headimg"></image>
- <view>欢迎您,尊敬的管理员!</view>
- </view>
- <view class="flexcc">
- <view class="list">
- <view class="tit">613</view>
- <view class="txt">来访数(位)</view>
- </view>
- <view class="list">
- <view class="tit">246</view>
- <view class="txt">本月预约(位)</view>
- </view>
- <view class="list">
- <view class="tit">613</view>
- <view class="txt">今日来访(位)</view>
- </view>
- <view class="list">
- <view class="tit">613</view>
- <view class="txt">今日预约(位)</view>
- </view>
-
- </view>
- </view>
- <view class="yylists">
- <view class="yyltab flexcj">
- <view class="left flexc">待审批列表<image :src="listline"></image></view>
- <view class="right" @click="getMoreFn">查看更多 >></view>
- </view>
- <!-- 列表 -->
- <view>
- <y-list type='1' :datalist="list" :wtdt="wtdt" @getDetail='getDetail' :adrlist="adrlist" @getDelFn="getDelFn" @gettypeFn="gettypeFn"></y-list>
- </view>
- </view>
- </view>
-
- <footers v-if="isfootflag" :footlist="footlist" :footerindex="footerindex" :color_checked="color_checked" :color_nochecked="color_nochecked" :isHomeIndex="true"></footers>
- </view>
- </template>
- <script>
- import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
- import self from '@/utils/location.js';
- import yList from "@/components/order/list.vue"
- let { calendar } = require("@/components/lunc-calendar/calendar.js");
- import {getReservatcountl,getReservatList,getReservatDel,getReservatSh} from "@/api/mine/order.js"
- import {getDictionaryFn} from "@/api/mine/register.js"
- import footers from '@/components/footer/footer.vue'
- export default {
- components:{yList,footers},
- data(){
- return{
- footlist:[
- {module:'home',title:'首页',icon_checked:require('@/static/images/tabbar/home_.png'),icon_nochecked:require('@/static/images/tabbar/home.png')},
- {module:'mine',title:'我的',icon_checked:require('@/static/images/tabbar/mine_.png'),icon_nochecked:require('@/static/images/tabbar/mine.png')},
- ],
- footerindex:'home',
- isfootflag:true,
- color_checked :'161616',
- color_nochecked :'666666',
- navbg:require("@/static/images/navbg.png"),
- headimg:require("@/static/images/order/staff/head.png"),
- listline:require("@/static/images/order/staff/listline.png"),
- backgroundColor: "transparent",
- city:'',
- weather:'',
- temperature:'',
- list:[],
- adrlist:[],
- pageSize: 10,
- pageNum: 1,
- reachflag: false,
- wtdt:'',
- daytime:'',
- lunar:'',
- weathericon:require("@/static/images/weather/weaionf.png"),
-
- }
- },
- onPageScroll(e) {
- var scrollTop = Number(e.scrollTop);
- if (scrollTop > 0) {
- this.backgroundColor = '#0491FD'
- } else {
- this.backgroundColor = 'transparent'
- }
- },
- onLoad: function() {
- uni.$on('refreshdatalist',(e) => {
- this.reachflag=false;
- this.pageNum=1;
- this.list=[];
- this.getDataFn();
- // this.getcount();
- })
-
- this.init()
- // this.getcount()
- this.getDataFn()
-
- },
- onUnload() {
- uni.$off('refreshdatalist')
- },
- onShow() {
- var that=this;
- this.time();
- // #ifndef H5
- self.getLocation(function(res){
- if(res==-1){
- that.setflag=true
- }else{
- // that.getAdrinfoFn(res)
- // that.location = `${res.lng},${res.lat}`
- that.city=res.city;
- that.temperature=res.temperature;
- that.weather=res.weather;
- that.weathericon=res.icon;
- }
- })
- // #endif
- },
- mounted() {
- },
- // 上拉触底加载更多触发事件
- onReachBottom() {
- if (this.reachflag) {
- this.pageNum++
- this.getDataFn()
- }
- },
- methods:{
- checkPermi, checkRole,
- init(){
- // 记录来源
- getDictionaryFn('jluly').then(res=>{
- if(res.code==200){
- this.adrlist = res.data.map(v => {
- return {
- dictLabel: v.dictLabel,
- dictValue: Number(v.dictValue)
- }
- })
- }
- })
- },
- getMoreFn(){
- this.$tab.navigateTo("/pages/order/list")
- },
- getDelFn(id){
- var that=this;
- getReservatDel(id).then(res=>{
- if(res.code==200){
- that.$toast('删除成功')
- setTimeout(function(){
- that.reachflag=true;
- that.pageNum=1;
- that.list=[];
- that.getDataFn();
- // that.getcount();
- },1500)
-
- }else{
- that.$toast(res.msg)
- }
- })
- },
- gettypeFn(ite){
- var that=this;
- var params={
- reservatId:ite.id,
- visitType:ite.type
- }
- getReservatSh(params).then(res=>{
- if(res.code==200){
- that.$toast('审核成功')
- setTimeout(function(){
- that.reachflag=true;
- that.pageNum=1;
- that.list=[];
- that.getDataFn();
- // that.getcount();
- },1500)
-
- }else{
- that.$toast(res.msg)
- }
- })
- },
- time() {
- var date = new Date();
- var y = date.getFullYear();
- var m = date.getMonth() + 1;
- var d = date.getDate();
- let lunar = calendar.solar2lunar(y, m, d); //农历
- this.lunar=lunar.IMonthCn+lunar.IDayCn;
- this.daytime=m+'月'+d+"日";
- // var h = date.getHours();
- // var min = date.getMinutes();
- // var s = date.getSeconds();
- // var week = date.getDay(); //获取当前星期X(0-6,0代表星期天)
- // var weeks = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
- // var yearStr = y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d)
- // var timeStr = (h < 10 ? ('0' + h) : h) + ':' + (min < 10 ? ('0' + min) : min) + ':' + (s < 10 ? (
- // '0' + s) : s);
- // this.kaTime = yearStr + ' ' + timeStr;
- },
- getcount(){
-
- getReservatcountl().then(res=>{
- if(res.code==200){
- this.conuntinfo=res.data
- }else{
- this.$toast(res.msg)
- }
- })
- },
- getDetail(data){
- this.$tab.navigateTo('/pages/order/staffcode?type=look&id='+data)
- },
- getDataFn(){
- var params={
- pageSize:this.pageSize,
- pageNum: this.pageNum,
- // visitType:3
- }
- getReservatList(params).then(res=>{
- if(res.code==200){
- if (res.rows.length < this.pageSize) {
- this.reachflag = false
- this.wtdt = '到底了~';
- } else {
- var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
- if (num < res.total) {
- this.reachflag = true
- this.wtdt = '上拉加载更多'
- } else {
- this.reachflag = false
- this.wtdt = '到底了~';
- }
- }
- if (this.pageNum == 1) {
- this.list = res.rows;
- } else {
- this.list = this.list.concat(res.rows)
- }
- }else{
- this.$toast(res.msg)
- }
- })
-
- },
- },
-
- }
- </script>
- <style lang="scss" scoped>
- .navbox{
- .navbg{width: 100%;height: 692rpx;position: fixed;left: 0;right: 0;top: 0;z-index: 1;}
- }
- .navleft{padding-left: 12rpx;
- view{font-weight: bold;font-size: 26rpx;color: #FFFFFF;line-height: 36rpx;}
- }
- .navright{width: 40rpx;height: 40rpx;}
- .yymain{
- flex: 1;z-index: 2;padding-top: 20rpx;
- }
- .yycard{width: 684rpx;height: 306rpx;background: #FFFFFF;border-radius: 14rpx;margin: 0 auto;
- .top{
- image{width: 132rpx;height: 132rpx;margin-bottom: 12rpx;margin-top: -56rpx;}
- view{font-weight: bold;font-size: 30rpx;color: #161616;}
- }
- .list{text-align: center;flex: 1;padding-top: 44rpx;
- .tit{font-weight: bold;font-size: 36rpx;color: #0391FD;margin-bottom: 16rpx;}
- .txt{font-weight: bold;font-size: 18rpx;color: #666666;}
- }
- }
- .yylists{width: 684rpx;margin: 42rpx auto 0;
- .yyltab{margin-bottom: 28rpx;
- .left{font-weight: bold;font-size: 15px;color: #161616;
- image{width: 110rpx;height: 14rpx;margin-left: 16rpx;}
- }
- .right{font-size: 500;font-size: 22rpx;color: #AAAAAA;}
- }
- }
- </style>
|