This commit is contained in:
weipengfei 2023-09-02 11:56:17 +08:00
parent 2db11acdba
commit caa6828681
8 changed files with 676 additions and 700 deletions

View File

@ -3,7 +3,7 @@
const jpushModule = uni.requireNativePlugin("JG-JPush");
// #endif
export default {
onLaunch: async function() {
onLaunch: async function(info) {
// let noticeArr = []
// jpushModule.addNotificationListener(res => {
// if (!noticeArr.includes(res.messageID)) {
@ -16,6 +16,10 @@
// console.log("app")
// }
// })
uni.showModal({
content: info
})
if(info.referrerInfo?.extraData?.uniMP) uni.setStorageSync('uniMP', info.referrerInfo?.extraData?.uniMP);
console.log('App Launch')
this.$store.dispatch('initConfig');
try {

View File

@ -359,9 +359,9 @@
brigade: ''
}
},
props: ['id', 'type'],
props: ['cid', 'type'],
mounted() {
this.initContract(this.$props.id, this.$props.type || null);
this.initContract(this.$props.cid, this.$props.type || null);
},
computed: {
c_address() {

View File

@ -4,7 +4,7 @@
<view class="title">常住人口</view>
<u--form labelPosition="left" :model="residents" :rules="rules" ref="residentsForm">
<block value="人口">
<block value="人员信息" v-for="(item, index) in residents.family" :key="'user'+index">
<block value="人员信息" v-for="(item, family_index) in residents.family" :key="'user'+family_index">
<u-form-item label="姓名" required prop="family.name" borderBottom>
<u--input v-model="item.name" :readonly="readonly" placeholder="请输入姓名"></u--input>
</u-form-item>
@ -37,7 +37,7 @@
</u-radio>
</u-radio-group>
</u-form-item>
<block value="是" v-if="residents.child>0" v-for="(item,index) in residents.child_arr" :key="'child'+index">
<block value="是" v-if="residents.child>0" v-for="(item,child_arr_index) in residents.child_arr" :key="'child'+child_arr_index">
<u-form-item label="年龄" required prop="child_arr.age" borderBottom>
<u--input v-model="item.age" :readonly="readonly" placeholder="请输入年龄" type="number" maxlength="2"></u--input>
</u-form-item>

View File

@ -1,34 +1,28 @@
<template>
<view class="oa_home" style="oaColor">
<!-- <image class="header_bg" src="../../static/img/home/head-bg.png"></image> -->
<view
class="home_header"
:class="!ApproveList.length > 0 ? 'home_header_no_data' : ''"
>
<view
style="
<u-navbar v-if="uniMP" @leftClick="leftClick" :autoBack="true" bgColor="rgba(0,0,0,0)"
leftIconColor=" #fff">
</u-navbar>
<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: var(--status-bar-height)"></view>
<view style="height: 30rpx"></view>
<view v-if="uniMP" style="height: 44px"></view>
<!-- #endif -->
<view class="my_info">
<view v-if="!$store.state.app.token" @click="login" class="mesg_box">
@ -39,46 +33,30 @@
</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, ".")
@ -86,16 +64,12 @@
{{ 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>
@ -114,13 +88,7 @@
<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>
@ -129,8 +97,7 @@
<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>
@ -143,19 +110,13 @@
<!-- <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>
</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>
@ -194,46 +155,47 @@
</template>
<script>
import logistiBriefCard from "@/components/logistiComptent/logistiCard/logistiBriefCard.vue";
import globalPopup from "@/components/GlobalPopup/GlobalPopup.vue";
import {
import logistiBriefCard from "@/components/logistiComptent/logistiCard/logistiBriefCard.vue";
import globalPopup from "@/components/GlobalPopup/GlobalPopup.vue";
import {
getList
} from "@/api/logistics.js";
import {
} from "@/api/logistics.js";
import {
Toast
} from "@/libs/uniApi.js";
import {
} from "@/libs/uniApi.js";
import {
oaHomeData
} from "@/static/server/server.js";
import {
} from "@/static/server/server.js";
import {
noticeList
} from "@/api/notice.js";
// import tabbar from '../components/tabbar'
import {
} from "@/api/notice.js";
// import tabbar from '../components/tabbar'
import {
getIndexListAPI,
getTaskListAPI,
getMyTaskListAPI,
getApproveListAPI,
getUserIndexAPI,
} from "@/api/oaApi.js";
import {
} from "@/api/oaApi.js";
import {
mapState
} from 'vuex';
import bj from "@/static/animation/home.json"
//#ifdef APP-PLUS
var jpushModule = uni.requireNativePlugin("JG-JPush");
// #endif
export default {
} from 'vuex';
import bj from "@/static/animation/home.json"
//#ifdef APP-PLUS
var jpushModule = uni.requireNativePlugin("JG-JPush");
// #endif
export default {
components: {
// tabbar
logistiBriefCard,
globalPopup,
},
data () {
data() {
return {
options: {
data: '',
},
uniMP: false,
is_captain: 0,
notArr: [],
orderList: [],
@ -273,12 +235,12 @@ export default {
showOaHomeData: false, //
};
},
onLoad () {
onLoad() {
this.is_captain = JSON.parse(uni.getStorageSync("USER_INFO")).is_captain
this.options.data = bj;
//#ifdef APP-PLUS
let that = this;
jpushModule.addNotificationListener(function (result) {
jpushModule.addNotificationListener(function(result) {
if (!that.notArr.includes(result.messageID)) {
that.$refs.globalPopup.showPopu();
that.getOrderList();
@ -288,9 +250,10 @@ export default {
});
// #endif
},
onShow () {
onShow() {
// this.getUserIndex()
// this.getIndexList()
if(uni.getStorageSync('uniMP'))this.uniMP = true;
this.getApproveList();
this.initUserInfo();
this.showToask();
@ -307,7 +270,7 @@ export default {
}
},
computed: {
oaHomeData () {
oaHomeData() {
const route = '/pages/oaHome/oaHome';
let arr = [];
this.$store.state.config?.config?.menu?.forEach((item) => {
@ -326,7 +289,7 @@ export default {
},
methods: {
//
noticeFn () {
noticeFn() {
const audioContext = uni.createInnerAudioContext()
audioContext.src = '/static/mp3/order.mp3'
jpushModule.addNotificationListener(res => {
@ -338,7 +301,13 @@ export default {
console.log("index的监听")
})
},
async getOrderList () {
leftClick(e) {
uni.sendHostEvent('closeApp', e, (ret) => {
//
console.log('关闭应用'+JSON.stringify(ret));
});
},
async getOrderList() {
let id = JSON.parse(uni.getStorageSync("USER_INFO")).id || "";
let res = await getList({
user_id: id,
@ -347,17 +316,17 @@ export default {
});
this.orderList = res.data.data;
},
goOrderList () {
goOrderList() {
uni.navigateTo({
url: "/pages/logistics/index",
});
},
initUserInfo () {
initUserInfo() {
this.$store.state.app.userInfo ?
(this.myOaInfo = this.$store.state.app.userInfo) :
(this.myOaInfo.avatar = "");
},
initOaHomeDada () {
initOaHomeDada() {
if (this.$store.state.app.userInfo.admin_id == 0) {
//
let arr = oaHomeData.filter((item) => !item.admin); //
@ -381,7 +350,7 @@ export default {
this.oaHomeData.splice(this.oaHomeData.length - 1, 1);
}
},
async getApproveList () {
async getApproveList() {
const res = await noticeList({
keyword: "",
page_no: 1,
@ -389,7 +358,7 @@ export default {
});
this.ApproveList = res.data.lists;
},
async getIndexList () {
async getIndexList() {
const {
project,
task
@ -405,19 +374,19 @@ export default {
this.assessData[7].num = task.count_lv + "%";
this.myTaskList = task.list;
},
async getMyTask () {
async getMyTask() {
let data = {
page: this.page,
limit: 10,
};
const res = getMyTaskListAPI(data);
},
naviTaskDetails (id) {
naviTaskDetails(id) {
uni.navigateTo({
url: `/pages/views/task_details?id=${id}`,
});
},
navTo (url) {
navTo(url) {
if (url) {
uni.showLoading({
title: '加载中',
@ -425,16 +394,16 @@ export default {
});
uni.navigateTo({
url: url,
success () {
success() {
uni.hideLoading()
},
fail () {
fail() {
uni.switchTab({
url: url,
success () {
success() {
uni.hideLoading()
},
fail () {
fail() {
uni.hideLoading()
}
});
@ -442,7 +411,7 @@ export default {
})
} else Toast('暂未开放')
},
navTwo (url, key) {
navTwo(url, key) {
// let role_id = this.$store.state.app?.userInfo?.admin?.role_id || null;
// var arr = [3, 6];
@ -455,13 +424,13 @@ export default {
this.navTo(url);
},
//
clickNotice (e) {
clickNotice(e) {
uni.navigateTo({
url: `/pages/oaNews/oaNews?id=${e}`,
});
},
// ,
showToask () {
showToask() {
if (!this.$store.state.app.token) {
this.assessData = this.assessData.map((item) => {
item.num = "*";
@ -475,37 +444,37 @@ export default {
});
}
},
login () {
login() {
uni.navigateTo({
url: "/pages/oaLogin/oaLogin",
});
},
async getUserIndex () {
async getUserIndex() {
const res = await getUserIndexAPI();
this.myOaInfo = res;
},
},
onPullDownRefresh () {
onPullDownRefresh() {
this.getOrderList();
this.$store.dispatch('initConfig');
// this.getIndexList()
uni.stopPullDownRefresh();
},
};
};
</script>
<style lang="scss">
.oa_home {
// padding-bottom: rpx;
}
.oa_home {
padding-bottom: 100rpx;
}
.header_bg {
.header_bg {
position: absolute;
width: 100%;
// z-index: -1;
}
}
.home_header {
.home_header {
position: relative;
padding: 28rpx;
// height: 607.02rpx;
@ -677,13 +646,13 @@ export default {
.backlog_no_data {
bottom: -70rpx;
}
}
}
.home_header_no_data {
.home_header_no_data {
margin-bottom: 93.33rpx;
}
}
.fast_track {
.fast_track {
width: 694rpx;
// height: 331rpx;
display: flex;
@ -707,9 +676,9 @@ export default {
margin-top: 14.04rpx;
}
}
}
}
.my_task {
.my_task {
width: 694.74rpx;
margin: 0 auto;
// margin-top: 31.58rpx;
@ -822,9 +791,9 @@ export default {
font-size: 24.56rpx;
}
}
}
}
.no_login {
.no_login {
position: fixed;
left: 0;
bottom: 0;
@ -862,5 +831,5 @@ export default {
align-items: center;
}
}
}
}
</style>

View File

@ -1,6 +1,9 @@
import Cache from '@/utils/cache';
import { getConfig } from "@/api/config.js";
// #ifdef APP-PLUS
import Updater from '@/uni_modules/guyue-updater/index';
// #endif
function compareVersions(version1, version2) {

View File

@ -145,7 +145,7 @@
</view>
<view class="cards" v-for="(item, index) in formData.family" :key="'user'+index">
<view class="cards" v-for="(item, family_index) in formData.family" :key="'user'+family_index">
<view class="card_head">
<text>常住人口</text>
</view>
@ -184,8 +184,8 @@
</view>
<view class="cards" v-if="formData.child>0" v-for="(item,index) in formData.child_arr"
:key="'child'+index">
<view class="cards" v-if="formData.child>0" v-for="(item,child_arr_index) in formData.child_arr"
:key="'child'+child_arr_index">
<view class="card_head">
<text>婴幼儿信息</text>
</view>

View File

@ -1,6 +1,6 @@
<template>
<view class="">
<company :id="id" type="company"></company>
<company :cid="cid" type="company"></company>
<view class="need_contract" v-if="!company.contract||!company.contract.status||!company.company.is_contract">
<!-- <view class="title">电子合同</view> -->
<picker v-if="company.contract&&company.contract.check_status==0||!company.contract"

View File

@ -1,6 +1,6 @@
<template>
<view class="">
<company :id="id" type="contract"></company>
<company :cid="cid" type="contract"></company>
<!-- <button class="back_btn" @click="naviBack">返回</button> -->
<!-- <button class="stop_btn">终止合同</button> -->
</view>