This commit is contained in:
weipengfei 2023-09-09 09:06:27 +08:00
commit 7eaa034da5

View File

@ -4,25 +4,39 @@
<!-- <u-navbar @leftClick="leftClick" bgColor="rgba(0,0,0,0)"
leftIconColor=" #fff" :autoBack="false">
</u-navbar> -->
<view class="home_header" :class="!ApproveList.length > 0 ? 'home_header_no_data' : ''">
<view style="
<view
class="home_header"
:class="!ApproveList.length > 0 ? 'home_header_no_data' : ''"
>
<view
style="
position: absolute;
bottom: 0;
left: 0;
overflow: hidden;
border-radius: 0 0 30rpx 30rpx;
">
<hx-lottie :options="options" ref="lottie" style="
"
>
<hx-lottie
:options="options"
ref="lottie"
style="
width: 100vw;
height: 440rpx;
transform: scale(1.2);
background-color: #0122c7;
" />
"
/>
</view>
<!-- #ifdef APP-PLUS||H5 -->
<view style="height: var(--status-bar-height)"></view>
<view v-if="uniMP" style="height: 44px;">
<u-icon name="arrow-left" color="#fff" size="20" @click="leftClick"></u-icon>
<view v-if="uniMP" style="height: 44px">
<u-icon
name="arrow-left"
color="#fff"
size="20"
@click="leftClick"
></u-icon>
</view>
<view v-else style="height: 30rpx"></view>
<!-- <view v-if="uniMP" style="height: 44px;"></view> -->
@ -36,30 +50,46 @@
</view>
<view class="head_img">
<view class="img_box">
<u--image :showLoading="true" width="131.43rpx" height="131.43rpx" class="img_box_img"
:src="myOaInfo.avatar || '../../static/img/public/avatar.png'" shape="circle"></u--image>
<u--image
:showLoading="true"
width="131.43rpx"
height="131.43rpx"
class="img_box_img"
:src="myOaInfo.avatar || '../../static/img/public/avatar.png'"
shape="circle"
></u--image>
</view>
<text class="head_text">工作证: {{ myOaInfo.nickname }}</text>
<text class="head_text" style="flex-shrink: 0">身份: {{ myOaInfo.admin_id ? "管理员" : "普通用户" }}</text>
<text class="head_text" style="flex-shrink: 0"
>身份: {{ myOaInfo.admin_id ? "管理员" : "普通用户" }}</text
>
</view>
</view>
<!-- 占位 -->
<view style="height: 150rpx"></view>
<view class="backlog" :class="!ApproveList.length > 0 ? 'backlog_no_data' : ''">
<view
class="backlog"
:class="!ApproveList.length > 0 ? 'backlog_no_data' : ''"
>
<view class="head_title flex_a_c_j_sb">
<view class="title">公告列表</view>
<view class="flex_a_c" @click="navTo('/subpkg/noticeList/noticeList')">更多
<view class="flex_a_c" @click="navTo('/subpkg/noticeList/noticeList')"
>更多
<view class="iconfont icon-you">
<uni-icons type="forward"></uni-icons>
</view>
</view>
</view>
<block v-if="ApproveList.length > 0">
<view class="backlog_item flex_a_c_j_sb" v-for="(item, index) in ApproveList.slice(0, 2)" :key="index"
@click="clickNotice(item.id)">
<view
class="backlog_item flex_a_c_j_sb"
v-for="(item, index) in ApproveList.slice(0, 2)"
:key="index"
@click="clickNotice(item.id)"
>
<view class="text">
<text class="text_time">{{
item.create_time.substring(0, 10).replace(/-/g, ".")
@ -67,12 +97,16 @@
{{ item.title }}
</view>
<i class="iconfont icon-you"><uni-icons type="forward"></uni-icons></i>
<i class="iconfont icon-you"
><uni-icons type="forward"></uni-icons
></i>
</view>
</block>
<view v-else class="backlog_no flex_a_c_j_sb">
<view class="text">暂无更多消息</view>
<i class="iconfont icon-you"><uni-icons type="forward"></uni-icons></i>
<i class="iconfont icon-you"
><uni-icons type="forward"></uni-icons
></i>
</view>
</view>
</view>
@ -91,7 +125,13 @@
<view class="fast_track">
<block v-for="(item, index) in oaHomeData" :key="item.id">
<view class="track_item" @click="navTwo(item.paths, index)">
<u--image :showLoading="true" :src="item.icon" mode="widthFix" width="77.19rpx" height="77.19rpx"></u--image>
<u--image
:showLoading="true"
:src="item.icon"
mode="widthFix"
width="77.19rpx"
height="77.19rpx"
></u--image>
<view class="title">{{ item.name }}</view>
</view>
</block>
@ -100,7 +140,8 @@
<view class="my_task">
<view class="task_title flex_a_c_j_sb">
<view class="title">配送信息</view>
<view class="flex_a_c" @click="goOrderList">更多
<view class="flex_a_c" @click="goOrderList"
>更多
<view class="iconfont icon-you">
<uni-icons type="forward"></uni-icons>
</view>
@ -113,13 +154,20 @@
<!-- <button @click="test">按钮</button> -->
<view v-if="orderList.length > 0">
<globalPopup ref="globalPopup"></globalPopup>
<logistiBriefCard v-for="(item, index) in orderList" :key="index" :goodsInfo="item">
<logistiBriefCard
v-for="(item, index) in orderList"
:key="index"
:goodsInfo="item"
>
</logistiBriefCard>
<u-loadmore :status="status" />
</view>
<view v-else class="no_task">
<view class="title">暂无配送信息</view>
<view class="tips" v-if="!$store.state.app.token">登录后查看配送信息详情</view>
<view class="tips" v-if="!$store.state.app.token"
>登录后查看配送信息详情</view
>
</view>
<!-- <view class="head_title flex_a_c_j_sb">
<view class="">我的任务</view>
@ -184,7 +232,9 @@
mapState
} from 'vuex';
import bj from "@/static/animation/home.json"
import { userInfo } from "@/api/oaUser.js"
import {
userInfo
} from "@/api/oaUser.js"
//#ifdef APP-PLUS
var jpushModule = uni.requireNativePlugin("JG-JPush");
// #endif
@ -199,7 +249,11 @@
options: {
data: '',
},
status: "loadmore",
page_num: 1,
flag: false,
uniMP: false,
id: "",
is_captain: 0,
notArr: [],
orderList: [],
@ -258,12 +312,36 @@
});
// #endif
},
onReachBottom () {
if (this.flag) return
let that = this
this.status = "loading"
this.page_num += 1
this.flag = true
getList({
status: this.curNow,
user_id: this.id,
keywords: this.keywords,
user_type: this.is_captain,
page_num: this.page_num
}).then(res => {
that.orderList = that.orderList.concat(res.data.data)
this.flag = false
if (!res.data.data.length) {
this.status = "nomore"
this.flag = true
}
})
},
async onShow () {
// this.getUserIndex()
// this.getIndexList()
await this.$onLaunched;
if (uni.getStorageSync('uniMP')) this.uniMP = true;
userInfo().then(({data})=>{
userInfo().then(({
data
}) => {
this.$store.commit('setUserInfo', data);
this.initUserInfo(data);
this.$store.dispatch('initConfig');
@ -305,7 +383,9 @@
watch: {
'$store.state.app.token': {
handler: function (n, o) {
userInfo().then(({data})=>{
userInfo().then(({
data
}) => {
// console.log(data);
this.$store.commit('setUserInfo', data);
this.initUserInfo(data);
@ -355,9 +435,9 @@
});
},
async getOrderList () {
let id = JSON.parse(uni.getStorageSync("USER_INFO")).id || "";
this.id = JSON.parse(uni.getStorageSync("USER_INFO")).id || "";
let res = await getList({
user_id: id,
user_id: this.id,
user_type: this.is_captain
// courier_id: 167
});