增加 常用服务查询及修改
This commit is contained in:
@@ -27,49 +27,26 @@
|
||||
<view class="white-bg">
|
||||
<view class="w-b-title">
|
||||
首页日常服务
|
||||
<view type="primary" @click="handleEdit" class="btn-edit">编 辑</view>
|
||||
<view type="primary" @click="handleJump('/pages/business/editDaily')" class="btn-edit">编 辑</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 企业日常 -->
|
||||
<view class="white-bg">
|
||||
<view class="w-b-title" @click="handleExpand">企业日常
|
||||
<text>{{expandFlag?'展开':'收起'}}<i :class="{iconfont:true,'icon-up':!expandFlag,'icon-down':expandFlag}"></i></text>
|
||||
<!-- 业务列表 -->
|
||||
<view class="white-bg" v-for="(item,index) in list" :key="index">
|
||||
<view class="w-b-title" @click="handleExpand(item)">{{ item.bizName }}
|
||||
<text>{{item.expandFlag?'展开':'收起'}}<i :class="{iconfont:true,'icon-up':!item.expandFlag,'icon-down':item.expandFlag}"></i></text>
|
||||
</view>
|
||||
<view class="logo-list" v-if="!expandFlag">
|
||||
<view v-for="(item,index) in list1" class="l-l-item" :key="index">
|
||||
<img :src="item.imgSrc" />
|
||||
<text class="font-gray">{{ item.name }}</text>
|
||||
<block v-if="!item.expandFlag">
|
||||
<view class="logo-list" v-if="item.children&&item.children.length>0">
|
||||
<block v-for="(item2,index2) in item.children">
|
||||
<view class="l-l-item" :key="index2"
|
||||
@click="handleJump(item2.bizUrl)" v-if="item2.status==1">
|
||||
<img :src="item2.icon" />
|
||||
<text class="font-gray">{{ item2.bizName }}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- CRM系统 -->
|
||||
<view class="white-bg">
|
||||
<view class="w-b-title" @click="handleExpand2">CRM系统
|
||||
<text>{{expandFlag2?'展开':'收起'}}<i :class="{iconfont:true,'icon-up':!expandFlag2,'icon-down':expandFlag2}"></i></text>
|
||||
</view>
|
||||
<view class="logo-list" v-if="!expandFlag2">
|
||||
<view v-for="(item,index) in list2" class="l-l-item" :key="index" @click="handleJump(item.url)">
|
||||
<uni-badge :text="item.badgeCount" size="small"></uni-badge>
|
||||
<img :src="item.imgSrc" />
|
||||
<text class="font-gray">{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 供应链采纳 -->
|
||||
<view class="white-bg">
|
||||
<view class="w-b-title">供应链采纳
|
||||
<text>展开<i :class="{iconfont:true,'icon-down':true}"></i></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- PLM系统 -->
|
||||
<view class="white-bg">
|
||||
<view class="w-b-title">PLM系统
|
||||
<text>展开<i :class="{iconfont:true,'icon-down':true}"></i></text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 底部加高度来避免tabbar遮挡 -->
|
||||
@@ -81,17 +58,39 @@
|
||||
|
||||
<script setup>
|
||||
import { ref,onMounted } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import customHeader from '@/components/customHeader.vue'
|
||||
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
|
||||
import { getNavBarPaddingTop} from '@/utils/system.js'
|
||||
import { businessDaily,businessCRMList } from '@/api/business.js';
|
||||
import { businessList } from '@/api/business.js';
|
||||
|
||||
onLoad(async(opt) => {
|
||||
uni.setStorageSync('page_cache',true);
|
||||
})
|
||||
|
||||
// 获取导航栏高度用于内容区域padding
|
||||
const navBarPaddingTop = ref(0);
|
||||
onMounted(() => {
|
||||
navBarPaddingTop.value = getNavBarPaddingTop()*2;
|
||||
getList();
|
||||
})
|
||||
|
||||
// 查询列表
|
||||
let list = ref([]);
|
||||
let getList = async()=>{
|
||||
let res = await businessList({});
|
||||
let arr = res.list || [];
|
||||
arr.forEach(item => {
|
||||
item.expandFlag = false;
|
||||
});
|
||||
list.value = arr;
|
||||
}
|
||||
|
||||
// 右侧展开
|
||||
let handleExpand = (item)=>{
|
||||
item.expandFlag = !item.expandFlag;
|
||||
}
|
||||
|
||||
// 查询搜索跳转
|
||||
let handleSearch = ()=>{
|
||||
|
||||
@@ -124,41 +123,8 @@ const downCallback = async (mescroll) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 日常服务编辑
|
||||
let handleEdit=()=>{
|
||||
|
||||
}
|
||||
|
||||
// 图标查询处理
|
||||
// 1.企业日常
|
||||
let list1 = ref([])
|
||||
let getBusinessDailyList= async ()=>{
|
||||
let busRes = await businessDaily({});
|
||||
list1.value = busRes.list || [];
|
||||
}
|
||||
getBusinessDailyList();
|
||||
// 企业日常-右侧展开
|
||||
let expandFlag=ref(false);
|
||||
let handleExpand = ()=>{
|
||||
expandFlag.value = !expandFlag.value;
|
||||
}
|
||||
|
||||
// 2.CRM系统
|
||||
let list2 = ref([])
|
||||
let getBusinessCRMList= async ()=>{
|
||||
let busRes = await businessCRMList({});
|
||||
list2.value = busRes.list || [];
|
||||
}
|
||||
getBusinessCRMList();
|
||||
// 企业日常-右侧展开
|
||||
let expandFlag2=ref(false);
|
||||
let handleExpand2 = ()=>{
|
||||
expandFlag2.value = !expandFlag2.value;
|
||||
}
|
||||
|
||||
// 跳转
|
||||
let handleJump=(url)=>{
|
||||
console.log(url)
|
||||
if(url){
|
||||
uni.navigateTo({ url })
|
||||
}
|
||||
|
||||
189
src/pages/business/editDaily.vue
Normal file
189
src/pages/business/editDaily.vue
Normal file
@@ -0,0 +1,189 @@
|
||||
<template>
|
||||
<view class="con-body">
|
||||
<view class="con-bg">
|
||||
<!-- 头部 -->
|
||||
<customHeader ref="customHeaderRef" :title="'常用服务'"
|
||||
:leftFlag="true" :rightFlag="false"
|
||||
></customHeader>
|
||||
<!-- 高度来避免头部遮挡 -->
|
||||
<view class="top-height"></view>
|
||||
|
||||
<!-- 下拉刷新 -->
|
||||
<mescroll-uni ref="mescrollRef" @init="mescrollInit"
|
||||
:down="downOption" @down="downCallback"
|
||||
:fixed="false" class="scroll-h"
|
||||
>
|
||||
<view class="white-bg">
|
||||
<view v-for="(item,index) in list" :key="index">
|
||||
<view class="bus-title">{{ item.bizName }}</view>
|
||||
<view class="bus-list">
|
||||
<view class="bus-tips" :class="{'bus-blue':item2.isDaily}"
|
||||
v-for="(item2,index2) in item.children" :key="index2"
|
||||
@click="handleCheck(item2)"
|
||||
>
|
||||
{{ item2.bizName }}
|
||||
<view class="bus-icon" v-if="item2.isDaily">
|
||||
<uni-icons type="checkmarkempty" size="12" color="#fff"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom-height"></view>
|
||||
</view>
|
||||
</mescroll-uni>
|
||||
|
||||
<!-- 提交按钮 -->
|
||||
<view class="bus-btn-con">
|
||||
<view class="bus-btn" @click="handleSubmit">提 交({{count}})</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref,onMounted } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import customHeader from '@/components/customHeader.vue'
|
||||
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
|
||||
import { getNavBarPaddingTop} from '@/utils/system.js'
|
||||
import { businessList } from '@/api/business.js';
|
||||
|
||||
// 获取导航栏高度用于内容区域padding
|
||||
const navBarPaddingTop = ref(0);
|
||||
onMounted(() => {
|
||||
navBarPaddingTop.value = getNavBarPaddingTop()*2;
|
||||
getList();
|
||||
})
|
||||
|
||||
// 查询列表
|
||||
let list = ref([]);
|
||||
let count = ref(7);
|
||||
let getList = async()=>{
|
||||
let res = await businessList({});
|
||||
let arr = res.list || [];
|
||||
arr.forEach(item => {
|
||||
item.expandFlag = false;
|
||||
});
|
||||
list.value = arr;
|
||||
}
|
||||
|
||||
// 下拉刷新
|
||||
const mescrollRef = ref(null);
|
||||
const mescrollInit = (mescroll) => {
|
||||
mescrollRef.value = mescroll;
|
||||
};
|
||||
const downOption = ref({
|
||||
auto: true,
|
||||
textInOffset: '下拉刷新',
|
||||
textOutOffset: '释放更新',
|
||||
textLoading: '刷新中...'
|
||||
});
|
||||
|
||||
// 下拉刷新
|
||||
const downCallback = async (mescroll) => {
|
||||
try {
|
||||
setTimeout(async ()=>{
|
||||
// mescroll.resetUpScroll();
|
||||
},500);
|
||||
} catch (error) {
|
||||
mescroll.endErr();
|
||||
} finally {
|
||||
setTimeout(async ()=>{
|
||||
mescroll.endSuccess();
|
||||
},500);
|
||||
}
|
||||
}
|
||||
|
||||
// 选择常用
|
||||
const handleCheck=(item)=>{
|
||||
item.isDaily = !item.isDaily;
|
||||
if(item.isDaily){
|
||||
count.value++;
|
||||
}else{
|
||||
count.value--;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 提交
|
||||
const handleSubmit=(item)=>{
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.scroll-h{
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.white-bg{
|
||||
width: 690rpx;
|
||||
margin-bottom:0;
|
||||
border-radius: 8px 8px 0 0;
|
||||
}
|
||||
|
||||
:deep(.mescroll-upwarp){
|
||||
display:none
|
||||
}
|
||||
|
||||
.bus-title{
|
||||
font-weight: bold;
|
||||
margin:0rpx 0 30rpx;
|
||||
}
|
||||
|
||||
.bus-list{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap:10px;
|
||||
flex-flow:row wrap;
|
||||
margin-bottom:40rpx;
|
||||
}
|
||||
.bus-list .bus-tips{
|
||||
/* width:210rpx; */
|
||||
min-width: calc(100% / 3 - 30px);
|
||||
height:60rpx;
|
||||
line-height: 60rpx;
|
||||
font-size:28rpx;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
padding:0 10px;
|
||||
background-color: #fff;
|
||||
color:#333333;
|
||||
border:1px solid #E8E8E8;
|
||||
}
|
||||
.bus-list .bus-blue{
|
||||
border:1px solid #05A3F4;
|
||||
background-color: #05A3F4;
|
||||
color:#fff;
|
||||
position: relative;
|
||||
}
|
||||
.bus-list .bus-blue .bus-icon{
|
||||
position:absolute;
|
||||
right:-10rpx;
|
||||
top:-10rpx;
|
||||
background-color: #02C74C;
|
||||
width:32rpx;
|
||||
height:32rpx;
|
||||
line-height: 32rpx;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.bus-btn-con{
|
||||
position: fixed;
|
||||
bottom:0;
|
||||
background-color: #fff;
|
||||
width:100%;
|
||||
padding:70rpx 0;
|
||||
}
|
||||
.bus-btn-con .bus-btn{
|
||||
background-color: #05A3F4;
|
||||
color:#fff;
|
||||
text-align: center;
|
||||
width:360rpx;
|
||||
height:80rpx;
|
||||
line-height: 80rpx;
|
||||
margin:0 auto;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user