优化页面

This commit is contained in:
weipengfei 2023-08-04 17:43:13 +08:00
parent 0e4762f1a2
commit 38b4229884
11 changed files with 159 additions and 109 deletions

View File

@ -1,6 +1,6 @@
<template>
<view>
<button @click="click" :class="{'new_btn': position, 'no_positon': !position, 'disabled': disabled}">{{text}}</button>
<button @click="click" :class="{'my_btn_new_btn': position, 'my_btn_no_positon': !position, 'my_btn_disabled': my_btn_disabled}">{{text}}</button>
</view>
</template>
@ -15,7 +15,7 @@
type: Boolean,
default: true
},
disabled:{
my_btn_disabled:{
type: Boolean,
default: false
}
@ -33,11 +33,12 @@
}
</script>
<style lang="scss">
.new_btn{
<style lang="scss" scoped>
.my_btn_new_btn{
position: fixed;
bottom: 0;
left: 0;
z-index: 9999999;
width: 100%;
border-radius: 0;
color: #fff;
@ -45,7 +46,7 @@
line-height: 90rpx;
background-color: $theme-oa-color;
}
.no_positon{
.my_btn_no_positon{
width: 100%;
border-radius: 0;
color: #fff;
@ -53,7 +54,7 @@
line-height: 90rpx;
background-color: $theme-oa-color;
}
.disabled{
.my_btn_disabled{
background-color: #666;
color: #eee;
}

View File

@ -123,7 +123,6 @@
this.initRules();
if (this.$props.readonly && this.$props.datas) {
this.formData = this.$props.datas;
console.log(this.formData);
let keys = Object.keys(this.formData);
keys.forEach(item => {
if (!isNaN(this.formData[item])) this.formData[item] = +this.formData[item];

View File

@ -1,7 +1,6 @@
{
"name" : "供销综合平台",
// "appid" : "__UNI__EA9FCAF",
"appid" : "__UNI__3A527D1",
"appid" : "__UNI__B5B1EDD",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
@ -56,7 +55,7 @@
"payment" : {
"weixin" : {
"__platform__" : [ "ios", "android" ],
"appid" : "wx9d68c92b550ddd1e",
"appid" : "wx4789d9f1b50390ba",
"UniversalLinks" : ""
}
},

View File

@ -9,7 +9,7 @@
<view class="login-card">
<view class="top">
<view class="text item">
<u-tabs :list="[{name:'账号登录'},{name:'手机登录'}]" @click="changeTabs" lineColor="#3274F9"
<u-tabs :list="tabList" @click="changeTabs" lineColor="#3274F9"
itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;font-size: 32rpx;"></u-tabs>
</view>
<input v-if="current==0" class="mobile item" v-model="formData.account" placeholder="输入账号" />
@ -24,7 +24,7 @@
</view>
<view class="btn">
<!-- <view>新用户注册</view> -->
<view @click="forgetPWD">忘记密码?</view>
<!-- <view @click="forgetPWD">忘记密码?</view> -->
</view>
</view>
<button class="submit_btn" @click="login">登录</button>
@ -39,6 +39,10 @@ import { Toast } from "../../libs/uniApi";
export default {
data() {
return {
tabList: [
{name:'账号登录'},
// {name:''},
],
current: 0,
formData: {
account: '',

View File

@ -108,7 +108,6 @@
backgroundColor: '#3175f9'
})
},
onLoad() {},
onShow() {
this.getOaUserInfo();
},
@ -133,13 +132,11 @@
content: '确定要退出登录吗',
success: (e) => {
if (e.confirm) {
that.$store.commit('SET_USERINFO', {
user: null,
token: null
})
that.$store.commit('LOGOUT');
uni.navigateTo({
url: '/pages/oaLogin/oaLogin'
url: '/pages/oaLogin/oaLogin?clear='+true,
success() {
that.$store.commit('CLEAR');
}
})
}
}

View File

@ -3,7 +3,7 @@ import { Toast } from "../libs/uniApi";
const functionList = ['navigateTo', 'redirectTo', 'reLaunch', 'switchTab']
const whiteList = ['/','/pages/oaHome/oaHome', '/pages/oaExamine/oaExamine', '/pages/oaTask/oaTask', '/pages/oaMy/oaMy',
'/pages/oaLogin/oaLogin', '/pages/oaManager/oaManager'
'/pages/oaLogin/oaLogin', '/pages/business/business'
]
const hasPermission = (url) => {

View File

@ -24,6 +24,12 @@ const mutations = {
}
})
},
CLEAR(state){
state.userInfo = null;
state.token = null;
Cache.clear('USER_INFO')
Cache.clear('TOKEN')
},
UPDATE_USERINFO(state, data) {
let time = res.data.result.expires_time - Cache.time();
state.userInfo = data.result.user

View File

@ -72,10 +72,19 @@
},
methods: {
navTo(url) {
url ?
if(url){
uni.showLoading({
title: '加载中',
mask: true
})
uni.navigateTo({
url: url,
}) : Toast('暂未开放')
success() {
uni.hideLoading()
}
})
}
else Toast('暂未开放');
},
initLoadconfig() {
this.loadConfig.page = 1;

View File

@ -8,90 +8,98 @@
<u-tabs :list="tabLists" @click="changeCurrent" lineColor='#3274F9' :scrollable="false" lineWidth='40'
inactiveStyle='color:#666' activeStyle="color:#3274F9"></u-tabs>
</u-sticky>
<u--form v-show="current==0" labelPosition="left" :model="formData" ref="archives">
<view class="card">
<view class="item">
<view class="title">基本信息</view>
<u-form-item labelWidth="auto" label="户主姓名" required prop="name" borderBottom>
<u--input v-model="formData.name" :readonly="readonly" placeholder="请输入姓名"></u--input>
</u-form-item>
<u-form-item label="性别" required prop="sex" borderBottom>
<u-radio-group v-model="formData.sex" :disabled="readonly" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'男'},{value:2,label:'女'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item label="年龄" required prop="age" borderBottom>
<u--input v-model="formData.age" :readonly="readonly" placeholder="请输入年龄"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="身份证号" required prop="id_card" borderBottom>
<u--input v-model="formData.id_card" :readonly="readonly" placeholder="请输入身份证号" type="idcard"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="联系方式" required prop="phone" borderBottom>
<u--input v-model="formData.phone" :readonly="readonly" placeholder="请输入手机号" type="number"></u--input>
</u-form-item>
<u-skeleton :style="{'margin': skeleton?28+'rpx':0}" :loading="skeleton" :animate="true" title rows="6"
rows-width="100%" rowsHeight="56">
<u--form v-show="current==0" labelPosition="left" :model="formData" ref="archives">
<view class="card">
<view class="item">
<view class="title">基本信息</view>
<u-form-item labelWidth="auto" label="户主姓名" required prop="name" borderBottom>
<u--input v-model="formData.name" :readonly="readonly" placeholder="请输入姓名"></u--input>
</u-form-item>
<u-form-item label="性别" required prop="sex" borderBottom>
<u-radio-group v-model="formData.sex" :disabled="readonly" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'男'},{value:2,label:'女'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item label="年龄" required prop="age" borderBottom>
<u--input v-model="formData.age" :readonly="readonly" placeholder="请输入年龄"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="身份证号" required prop="id_card" borderBottom>
<u--input v-model="formData.id_card" :readonly="readonly" placeholder="请输入身份证号" type="idcard"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="联系方式" required prop="phone" borderBottom>
<u--input v-model="formData.phone" :readonly="readonly" placeholder="请输入手机号" type="number"></u--input>
</u-form-item>
</view>
</view>
</view>
<view class="card">
<view class="item">
<districtSelector ref="districtSelectorRef" :datas="formData" :readonly="true"></districtSelector>
<u-form-item labelWidth="auto" label="详细地址" required prop="address" borderBottom>
<u--input v-model="formData.address" :readonly="readonly" placeholder="请输入详细地址"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="汽车是否能到家" required prop="highway" borderBottom>
<u-radio-group v-model="formData.highway" :disabled="readonly" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<block value="智能手机">
<u-form-item labelWidth="auto" label="是否使用智能手机" required prop="smart_phone" borderBottom>
<u-radio-group v-model="formData.smart_phone" :disabled="readonly" style="margin: 16rpx;">
<view class="card" style="margin-bottom: 0;">
<view class="item">
<view class="title">地区信息</view>
<!-- <districtSelector ref="districtSelectorRef" :datas="formData" :readonly="true"></districtSelector> -->
<u-form-item labelWidth="auto" label="详细地址" required prop="address" borderBottom>
<u--input v-model="formData.address" :readonly="readonly" placeholder="请输入详细地址"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="汽车是否能到家" required prop="highway" borderBottom>
<u-radio-group v-model="formData.highway" :disabled="readonly" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<block v-if="formData.smart_phone>0">
<u-form-item labelWidth="auto" label="微信号" required borderBottom>
<u--input v-model="formData.wechat" :readonly="readonly" placeholder="请输入微信号"></u--input>
<block value="智能手机">
<u-form-item labelWidth="auto" label="是否使用智能手机" required prop="smart_phone" borderBottom>
<u-radio-group v-model="formData.smart_phone" :disabled="readonly" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<block v-if="formData.smart_phone>0">
<u-form-item labelWidth="auto" label="微信号" required borderBottom>
<u--input v-model="formData.wechat" :readonly="readonly" placeholder="请输入微信号"></u--input>
</u-form-item>
</block>
</block>
</block>
</view>
</view>
</u--form>
<residents v-show="current==0" ref="residentsRef" :readonly="true" :datas="formData"></residents>
<view v-show="current==1">
<block v-for="(item, index) in formData.datas" :key="'demand'+index+item.id">
<block>
<breeding v-if="item.id==32" :datas="item.datas" :readonly="true" ref="demandRef32"></breeding>
<plant v-if="item.id==7" :datas="item.datas" :readonly="true" ref="demandRef7"></plant>
<store v-if="item.id==8" :datas="item.datas" :readonly="true" ref="demandRef8"></store>
<deepProcessing v-if="item.id==9" :datas="item.datas" :readonly="true" ref="demandRef9"></deepProcessing>
<thickProcessing v-if="item.id==10" :datas="item.datas" :readonly="true" ref="demandRef10">
</thickProcessing>
</block>
<block>
<houseRepair v-if="item.id==12" :datas="item.datas" :readonly="true" ref="demandRef12"></houseRepair>
<houseDecoration v-if="item.id==13" :datas="item.datas" :readonly="true" ref="demandRef13">
</houseDecoration>
<houseRenovate v-if="item.id==14" :datas="item.datas" :readonly="true" ref="demandRef14"></houseRenovate>
<houseTransaction v-if="item.id==15" :datas="item.datas" :readonly="true" ref="demandRef15">
</houseTransaction>
</block>
<block>
<banquetMarry v-if="item.id==17" :datas="item.datas" :readonly="true" ref="demandRef17"></banquetMarry>
<banquetBirthday v-if="item.id==18" :datas="item.datas" :readonly="true" ref="demandRef18">
</banquetBirthday>
<banquetFullMoon v-if="item.id==19" :datas="item.datas" :readonly="true" ref="demandRef19">
</banquetFullMoon>
<banquetOther v-if="item.id==20" :datas="item.datas" :readonly="true" ref="demandRef20"></banquetOther>
<banquetFuneral v-if="item.id==21" :datas="item.datas" :readonly="true" ref="demandRef21"></banquetFuneral>
</block>
</block>
</view>
</u--form>
<residents ref="residentsRef" :readonly="true" :datas="formData"></residents>
<view v-show="current==1">
<block v-for="(item, index) in formData.datas" :key="'demand'+index+item.id">
<block>
<breeding v-if="item.id==32" :datas="item.datas" :readonly="true" ref="demandRef32"></breeding>
<plant v-if="item.id==7" :datas="item.datas" :readonly="true" ref="demandRef7"></plant>
<store v-if="item.id==8" :datas="item.datas" :readonly="true" ref="demandRef8"></store>
<deepProcessing v-if="item.id==9" :datas="item.datas" :readonly="true" ref="demandRef9"></deepProcessing>
<thickProcessing v-if="item.id==10" :datas="item.datas" :readonly="true" ref="demandRef10"></thickProcessing>
</block>
<block>
<houseRepair v-if="item.id==12" :datas="item.datas" :readonly="true" ref="demandRef12"></houseRepair>
<houseDecoration v-if="item.id==13" :datas="item.datas" :readonly="true" ref="demandRef13"></houseDecoration>
<houseRenovate v-if="item.id==14" :datas="item.datas" :readonly="true" ref="demandRef14"></houseRenovate>
<houseTransaction v-if="item.id==15" :datas="item.datas" :readonly="true" ref="demandRef15">
</houseTransaction>
</block>
<block>
<banquetMarry v-if="item.id==17" :datas="item.datas" :readonly="true" ref="demandRef17"></banquetMarry>
<banquetBirthday v-if="item.id==18" :datas="item.datas" :readonly="true" ref="demandRef18"></banquetBirthday>
<banquetFullMoon v-if="item.id==19" :datas="item.datas" :readonly="true" ref="demandRef19"></banquetFullMoon>
<banquetOther v-if="item.id==20" :datas="item.datas" :readonly="true" ref="demandRef20"></banquetOther>
<banquetFuneral v-if="item.id==21" :datas="item.datas" :readonly="true" ref="demandRef21"></banquetFuneral>
</block>
</block>
</view>
</u-skeleton>
</view>
</template>
@ -115,16 +123,32 @@
import banquetOther from "@/components/newArchives/banquetOther.vue" //
import banquetFuneral from "@/components/newArchives/banquetFuneral.vue" //
export default {
components: { districtSelector, residents, breeding, plant, store, deepProcessing, thickProcessing, houseRepair,
houseDecoration, houseRenovate, houseTransaction, banquetMarry, banquetBirthday, banquetFullMoon, banquetOther,
banquetFuneral },
components: {
districtSelector,
residents,
breeding,
plant,
store,
deepProcessing,
thickProcessing,
houseRepair,
houseDecoration,
houseRenovate,
houseTransaction,
banquetMarry,
banquetBirthday,
banquetFullMoon,
banquetOther,
banquetFuneral
},
data() {
return {
tabLists: [{
name: '商机信息',
name: '基本信息',
}, {
name: '基本信息'
name: '商机信息'
}],
skeleton: true,
readonly: true,
current: 0,
showDemandList: [],
@ -152,12 +176,15 @@
methods: {
async initInformationDetails(id) {
let res = await informationDetails(id);
this.formData = res.data;
uni.$u.sleep(500).then(() => {
this.skeleton = false;
this.formData = res.data;
})
},
toastShow() {
Toast('不可修改')
},
changeCurrent(e){
changeCurrent(e) {
this.current = e.index;
}
},

View File

@ -4,7 +4,7 @@
<u-tabs :list="tabLists" @click="changeCurrent" lineColor='#3274F9' :scrollable="false" lineWidth='40'
inactiveStyle='color:#666' activeStyle="color:#3274F9"></u-tabs>
</u-sticky>
<view>
<view v-if="loadType">
<view class="company_info" v-show="current==0">
<company></company>
</view>
@ -42,6 +42,7 @@
<task></task>
</view>
</view>
<u-empty v-else icon="/static/img/empty/data.png" text="没有数据"></u-empty>
</view>
</template>
@ -56,6 +57,7 @@
return {
current: 0,
currentChild: 0,
loadType: true,//
tabLists: [{
name: '我的公司',
}, {
@ -79,7 +81,11 @@
},
onLoad() {},
onShow() {
this.loadCompanyList();
if(this.$store.state.app.userInfo.company_id){
this.loadCompanyList();
}else {
this.loadType = false;
}
},
onReachBottom() {
this.loadCompanyList();

View File

@ -1,6 +1,6 @@
<template>
<view class="">
<view class="card">
<view class="card" style="padding-bottom: 150rpx;">
<u--form labelPosition="left" :model="formData" :rules="rules" ref="archives">
<view class="item">
<view class="title">基本信息</view>
@ -88,8 +88,9 @@
@change="changeHandler" @cancel="demandShow = false" @confirm="changeDemand"></u-picker> -->
</u--form>
<button @click="addArchives" class="btn">完成登记</button>
<!-- <button @click="addArchives" class="btn">完成登记</button> -->
</view>
<mybtn text="完成登记" @click="addArchives"></mybtn>
</view>
</template>
@ -225,9 +226,9 @@
methods: {
//
async addArchives() {
try{
try {
// Toast('')
let refsDatas = this.loadRefsDatas();
// let refsDatas = this.loadRefsDatas();
// let flag1 = await this.$refs.districtSelectorRef.validate();
let flag2 = await this.$refs.residentsRef.validate();
let flag3 = await this.$refs.breedingRef.validate();
@ -273,7 +274,8 @@
})
}
})
}catch(e){
} catch (e) {
console.log(e);
Toast('请填写完整信息')
}