页面修改

This commit is contained in:
THK3121 2023-08-19 19:04:14 +08:00
parent edbef3cc41
commit adf33ad8e4
8 changed files with 1235 additions and 964 deletions

View File

@ -15,6 +15,7 @@
console.log(res.messageID) console.log(res.messageID)
audioContext.play() audioContext.play()
noticeArr.push(res.messageID) noticeArr.push(res.messageID)
console.log("app的")
uni.vibrateLong({ uni.vibrateLong({
success: function() { success: function() {
console.log('success'); console.log('success');

View File

@ -28,7 +28,9 @@
</view> </view>
</view> </view>
<view class="f_list"> <view class="f_list">
<view class="item" v-for="(item, index) in list" :key="index"> <view class="item" v-for="(item, index) in list" :key="index">
<view class="top"> <view class="top">
账单日期: {{current?item.month:item.create_time}} 账单日期: {{current?item.month:item.create_time}}
</view> </view>
@ -38,26 +40,33 @@
<view class="t_title">任务名称</view> <view class="t_title">任务名称</view>
<view class="tips">{{item.remark}}</view> <view class="tips">{{item.remark}}</view>
</view> </view>
<view class="t_item"> <!-- <view class="t_item">
<view class="t_title">金额归属</view> <view class="t_title">金额归属</view>
<view class="tips"><text v-if="item.userInfo">{{item.userInfo.nickname}}</text></view> <view class="tips"><text v-if="item.userInfo">{{item.userInfo.nickname}}</text></view>
</view> </view> -->
<view class="t_item"> <view class="t_item">
<view class="t_title">收益来源</view> <view class="t_title">收益来源</view>
<view class="tips"> <view class="tips">
<!-- {{current?item.remark:item.type_desc}} --> <!-- {{current?item.remark:item.type_desc}} -->
<text v-if="item.change_type==202" style="color: #46be61;">{{item.type_desc}}</text> <text v-if="item.change_type==202">{{item.type_desc}}</text>
<text v-else-if="item.change_type==203" <!-- <text v-else-if="item.change_type==203"
style="color: #ff7c32;">{{item.type_desc}}</text> style="color: #ff7c32;">{{item.type_desc}}</text> -->
<text v-else="item.change_type==203">{{item.type_desc}}</text> <text v-else="item.change_type==203">{{item.type_desc}}</text>
</view> </view>
</view> </view>
</view> </view>
<view class="price"> <view class="price">
{{current?(item.expenditure==0?'+'+item.income:'-'+item.income):item.change_amount_desc}} <text v-if="current" style="color: #FF7C32;">
{{item.expenditure==0?'+'+item.income:'-'+item.income}}</text>
<text>{{item.change_amount_desc}}</text>
<!-- {{current?(item.expenditure==0?'+'+item.income:'-'+item.income):item.change_amount_desc}} -->
</view> </view>
</view> </view>
</view> </view>
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText" <u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
</view> </view>
@ -239,12 +248,12 @@
&:before { &:before {
display: inline-block; display: inline-block;
content: '账单详情'; content: '账户收益';
width: 137rpx; width: 137rpx;
height: 49rpx; height: 49rpx;
line-height: 49rpx; line-height: 49rpx;
text-align: center; text-align: center;
background: #3274F9; background: #FF7C32;
border-radius: 26rpx 26rpx 26rpx 26rpx; border-radius: 26rpx 26rpx 26rpx 26rpx;
color: #fff; color: #fff;
margin-right: 28rpx; margin-right: 28rpx;
@ -258,7 +267,7 @@
.text { .text {
font-size: 25rpx; font-size: 25rpx;
font-weight: 400; font-weight: 400;
color: #999999; color: #333333;
line-height: 39rpx; line-height: 39rpx;
.t_item { .t_item {
@ -282,7 +291,7 @@
align-items: center; align-items: center;
font-size: 32rpx; font-size: 32rpx;
font-weight: 500; font-weight: 500;
color: #F02828; color: #488F00;
} }
} }
} }

View File

@ -1,282 +1,294 @@
<template> <template>
<view class="component"> <view class="component">
<view class="title">地区信息</view> <view class="title">地区信息</view>
<u--form labelPosition="left" :model="formData" :rules="rules" ref="districtForm"> <u--form labelPosition="left" :model="formData" :rules="rules" ref="districtForm">
<u-form-item v-if="!readonly" label="省" :required="!readonly" prop="province" @click="changeCity('province')" borderBottom> <u-form-item v-if="!readonly" label="省" :required="!readonly" prop="province"
<u--input :value="formDataText.province" disabled disabledColor="#fff" placeholder="请选择省"></u--input> @click="changeCity('province')" borderBottom>
<u-icon slot="right" name="arrow-right"></u-icon> <u--input :value="formDataText.province" disabled disabledColor="#fff" placeholder="请选择省"></u--input>
</u-form-item> <u-icon slot="right" name="arrow-right"></u-icon>
<u-form-item v-if="!readonly" label="市" :required="!readonly" prop="city" @click="changeCity('city')" borderBottom> </u-form-item>
<u--input :value="formDataText.city" disabled disabledColor="#fff" placeholder="请选择市"></u--input> <u-form-item v-if="!readonly" label="市" :required="!readonly" prop="city" @click="changeCity('city')"
<u-icon slot="right" name="arrow-right"></u-icon> borderBottom>
</u-form-item> <u--input :value="formDataText.city" disabled disabledColor="#fff" placeholder="请选择市"></u--input>
<u-form-item label="区县" :required="!readonly" prop="area" @click="changeCity('area')" borderBottom> <u-icon slot="right" name="arrow-right"></u-icon>
<u--input :value="formDataText.area" disabled disabledColor="#fff" placeholder="请选择区县"></u--input> </u-form-item>
<u-icon slot="right" name="arrow-right"></u-icon> <u-form-item label="区县" :required="!readonly" prop="area" @click="changeCity('area')" borderBottom>
</u-form-item> <u--input :value="formDataText.area" disabled disabledColor="#fff" placeholder="请选择区县"></u--input>
<u-form-item label="乡镇" :required="!readonly" prop="street" @click="changeCity('street')" borderBottom> <u-icon slot="right" name="arrow-right"></u-icon>
<u--input :value="formDataText.street" disabled disabledColor="#fff" placeholder="请选择镇"></u--input> </u-form-item>
<u-icon slot="right" name="arrow-right"></u-icon> <u-form-item label="乡镇" :required="!readonly" prop="street" @click="changeCity('street')" borderBottom>
</u-form-item> <u--input :value="formDataText.street" disabled disabledColor="#fff" placeholder="请选择镇"></u--input>
<u-form-item label="村社" :required="!readonly" prop="village" @click="changeCity('village')" borderBottom> <u-icon slot="right" name="arrow-right"></u-icon>
<u--input :value="formDataText.village" type="text" disabled disabledColor="#fff" placeholder="请选择村"></u--input> </u-form-item>
<u-icon slot="right" name="arrow-right"></u-icon> <u-form-item label="村社" :required="!readonly" prop="village" @click="changeCity('village')" borderBottom>
</u-form-item> <u--input :value="formDataText.village" type="text" disabled disabledColor="#fff"
<u-form-item label="小队" :required="!readonly" prop="brigade" @click="changeCity('brigade')" borderBottom> placeholder="请选择村"></u--input>
<u--input :value="formDataText.brigade" disabled disabledColor="#fff" placeholder="请选择小队"></u--input> <u-icon slot="right" name="arrow-right"></u-icon>
<u-icon slot="right" name="arrow-right"></u-icon> </u-form-item>
</u-form-item> <u-form-item label="小队" :required="!readonly" prop="brigade" @click="changeCity('brigade')" borderBottom>
</u--form> <u--input :value="formDataText.brigade" disabled disabledColor="#fff" placeholder="请选择小队"></u--input>
<u-picker :show="showProvince" :columns="[changeList()]" :keyName="changeType+'_name'" @confirm="confirm" <u-icon slot="right" name="arrow-right"></u-icon>
@cancel="showProvince = false" @close="showProvince = false"></u-picker> </u-form-item>
</view> </u--form>
<u-picker :show="showProvince" :columns="[changeList()]" :keyName="changeType+'_name'" @confirm="confirm"
@cancel="showProvince = false" @close="showProvince = false"></u-picker>
</view>
</template> </template>
<script> <script>
import { commonProvince, commonCity, commonArea, commonStreet, commonVillage, commonBrigade } from "@/api/oaPbulic.js" import {
import { Toast } from "../../libs/uniApi" commonProvince,
export default { commonCity,
name:"districtSelector", commonArea,
props:{ commonStreet,
readonly: { commonVillage,
type: Boolean, commonBrigade
default: false } from "@/api/oaPbulic.js"
}, import {
datas:{ Toast
type: Object, } from "../../libs/uniApi"
default: null export default {
} name: "districtSelector",
}, props: {
data() { readonly: {
return { type: Boolean,
showProvince: false, default: false
formData: { },
province: '', datas: {
city: '', type: Object,
area: '', default: null
street: '', }
village: '', },
brigade: '', data() {
}, return {
formDataText: { showProvince: false,
province: '', formData: {
city: '', province: '',
area: '', city: '',
street: '', area: '',
village: '', street: '',
brigade: '', village: '',
}, brigade: '',
rules:{ },
province: { formDataText: {
required: true, province: '',
message: '不能为空', city: '',
trigger: ['change', 'blur'] area: '',
}, street: '',
city: { village: '',
required: true, brigade: '',
message: '不能为空', },
trigger: ['change', 'blur'] rules: {
}, province: {
area: { required: true,
required: true, message: '不能为空',
message: '不能为空', trigger: ['change', 'blur']
trigger: ['change', 'blur'] },
}, city: {
street: { required: true,
required: true, message: '不能为空',
message: '不能为空', trigger: ['change', 'blur']
trigger: ['change', 'blur'] },
}, area: {
village: { required: true,
required: true, message: '不能为空',
message: '不能为空', trigger: ['change', 'blur']
trigger: ['change', 'blur'] },
}, street: {
brigade: { required: true,
validator: (rule, value, callback )=>{ message: '不能为空',
value?callback():callback('不能为空') trigger: ['change', 'blur']
}, },
trigger: ['change', 'blur'] village: {
}, required: true,
}, message: '不能为空',
provinceList: [], trigger: ['change', 'blur']
cityList: [], },
areaList: [], brigade: {
streetList: [], validator: (rule, value, callback) => {
villageList: [], value ? callback() : callback('不能为空')
brigadeList: [], },
changeType: '', // trigger: ['change', 'blur']
}; },
}, },
watch:{ provinceList: [],
datas(newValue, oldValue){ cityList: [],
if(this.$props.readonly&&newValue){ areaList: [],
this.formDataText.area = this.$props.datas.area_name; streetList: [],
this.formDataText.street = this.$props.datas.street_name; villageList: [],
this.formDataText.village = this.$props.datas.village_name; brigadeList: [],
this.formDataText.brigade = this.$props.datas.brigade_name; changeType: '', //
};
this.formData.area = this.$props.datas.area_id; },
this.formData.street = this.$props.datas.street_id; watch: {
this.formData.village = this.$props.datas.village_id; datas(newValue, oldValue) {
this.formData.brigade = this.$props.datas.brigade_id; if (this.$props.readonly && newValue) {
} this.formDataText.area = this.$props.datas.area_name;
} this.formDataText.street = this.$props.datas.street_name;
}, this.formDataText.village = this.$props.datas.village_name;
created() { this.formDataText.brigade = this.$props.datas.brigade_name;
if(!this.$props.readonly) {
this.initProvinceAndCity(); this.formData.area = this.$props.datas.area_id;
}else{ this.formData.street = this.$props.datas.street_id;
this.rules = {}; this.formData.village = this.$props.datas.village_id;
} this.formData.brigade = this.$props.datas.brigade_id;
}, }
methods:{ }
async validate(){ },
return await this.$refs.districtForm.validate(); created() {
}, if (!this.$props.readonly) {
// this.initProvinceAndCity();
async initProvinceAndCity() { } else {
let res = await commonProvince(); this.rules = {};
this.provinceList = res.data; }
this.provinceList.forEach(item => { },
if (item.province_name.indexOf('四川') !== -1) { methods: {
this.formData.province = item.province_code; async validate() {
this.formDataText.province = item.province_name; return await this.$refs.districtForm.validate();
commonCity({ },
city: item.province_code //
}).then(cityRes => { async initProvinceAndCity() {
this.cityList = cityRes.data; let res = await commonProvince();
this.cityList.forEach(item => { this.provinceList = res.data;
if (item.city_name.indexOf('泸州') !== -1) { this.provinceList.forEach(item => {
this.formData.city = item.city_code; if (item.province_name.indexOf('四川') !== -1) {
this.formDataText.city = item.city_name; this.formData.province = item.province_code;
commonArea({ this.formDataText.province = item.province_name;
area: item.city_code commonCity({
}).then(areaRes => { city: item.province_code
this.areaList = areaRes.data; }).then(cityRes => {
}) this.cityList = cityRes.data;
} this.cityList.forEach(item => {
}) if (item.city_name.indexOf('泸州') !== -1) {
}) this.formData.city = item.city_code;
} this.formDataText.city = item.city_name;
}) commonArea({
area: item.city_code
}, }).then(areaRes => {
// this.areaList = areaRes.data;
changeCity(type) { })
if(this.$props.readonly)return ; }
if (this[type + 'List'].length == 0) return Toast('请先选择上一级地区'); })
this.changeType = type; })
this.showProvince = true; }
}, })
//
changeList() { },
return this[this.changeType + 'List']; //
}, changeCity(type) {
// if (this.$props.readonly) return;
confirm(e) { if (this[type + 'List'].length == 0) return Toast('请先选择上一级地区');
let flag = false;// this.changeType = type;
if(this.formData[this.changeType] != e.value[0][this.changeType + '_code'])flag = true; this.showProvince = true;
if (this.changeType == 'brigade') { },
this.formData.brigade = e.value[0].id; //
this.formDataText.brigade = e.value[0].brigade_name; changeList() {
this.showProvince = false; return this[this.changeType + 'List'];
return ; },
} //
this.formData[this.changeType] = e.value[0][this.changeType + '_code']; confirm(e) {
this.formDataText[this.changeType] = e.value[0][this.changeType + '_name']; let flag = false; //
// if (this.formData[this.changeType] != e.value[0][this.changeType + '_code']) flag = true;
switch (this.changeType) { if (this.changeType == 'brigade') {
case 'province': this.formData.brigade = e.value[0].id;
this.loadCity(this.formData['province']); this.formDataText.brigade = e.value[0].brigade_name;
break; this.showProvince = false;
case 'city': return;
this.loadArea(this.formData['city']); }
break; this.formData[this.changeType] = e.value[0][this.changeType + '_code'];
case 'area': this.formDataText[this.changeType] = e.value[0][this.changeType + '_name'];
this.loadStreet(this.formData['area']); //
break; switch (this.changeType) {
case 'street': case 'province':
this.loadVillage(this.formData['street']); this.loadCity(this.formData['province']);
break; break;
case 'village': case 'city':
this.loadBrigade(this.formData['village']); this.loadArea(this.formData['city']);
break; break;
} case 'area':
// this.loadStreet(this.formData['area']);
if(flag) switch (this.changeType) { break;
case 'province': case 'street':
this.formData.city = ''; this.loadVillage(this.formData['street']);
this.formDataText.city = '' break;
case 'city': case 'village':
this.formData.area = ''; this.loadBrigade(this.formData['village']);
this.formDataText.area = '' break;
case 'area': }
this.formData.street = ''; //
this.formDataText.street = '' if (flag) switch (this.changeType) {
case 'street': case 'province':
this.formData.village = ''; this.formData.city = '';
this.formDataText.village = '' this.formDataText.city = ''
case 'village': case 'city':
this.formData.brigade = ''; this.formData.area = '';
this.formDataText.brigade = '' this.formDataText.area = ''
} case 'area':
this.showProvince = false; this.formData.street = '';
}, this.formDataText.street = ''
loadCity(code) { case 'street':
commonCity({ this.formData.village = '';
city: code this.formDataText.village = ''
}).then(res => { case 'village':
this.cityList = res.data; this.formData.brigade = '';
}) this.formDataText.brigade = ''
}, }
loadArea(code) { this.showProvince = false;
commonArea({ },
area: code loadCity(code) {
}).then(res => { commonCity({
this.areaList = res.data; city: code
}) }).then(res => {
}, this.cityList = res.data;
loadStreet(code) { })
commonStreet({ },
street: code loadArea(code) {
}).then(res => { commonArea({
this.streetList = res.data; area: code
}) }).then(res => {
}, this.areaList = res.data;
loadVillage(code) { })
commonVillage({ },
village: code loadStreet(code) {
}).then(res => { commonStreet({
this.villageList = res.data; street: code
}) }).then(res => {
}, this.streetList = res.data;
loadBrigade(code) { })
commonBrigade({ },
brigade: code loadVillage(code) {
}).then(res => { commonVillage({
this.brigadeList = res.data; village: code
}) }).then(res => {
}, this.villageList = res.data;
} })
} },
loadBrigade(code) {
commonBrigade({
brigade: code
}).then(res => {
this.brigadeList = res.data;
})
},
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
.component{ .component {
.title { .title {
font-weight: 500; font-weight: 500;
font-size: 34rpx; font-size: 34rpx;
&::before { &::before {
width: 8rpx; width: 8rpx;
height: 26rpx; height: 26rpx;
border-radius: 4rpx; border-radius: 4rpx;
background-color: #3175f9; background-color: #3175f9;
content: ""; content: "";
display: inline-block; display: inline-block;
margin-right: 8rpx; margin-right: 8rpx;
} }
} }
} }
</style> </style>

View File

@ -1,250 +1,264 @@
<template> <template>
<view class="component"> <view class="component">
<view class="title">地区信息</view> <!-- <view class="title">地区信息</view> -->
<u--form labelPosition="left" :model="formData" :rules="rules" ref="districtForm"> <u--form labelPosition="left" :model="formData" :rules="rules" ref="districtForm">
<u-form-item label="地址" :required="!readonly" prop="street" @click="changeCity('street')" borderBottom> <u-form-item label="地址" :required="!readonly" prop="street" @click="changeCity('street')" borderBottom>
<u--textarea :value="nowAddress" autoHeight readonly></u--textarea> <u--textarea :value="nowAddress" autoHeight readonly></u--textarea>
</u-form-item> </u-form-item>
<u-form-item v-if="!formDataRead.street" label="乡镇" :required="!readonly" prop="street" @click="changeCity('street')" borderBottom> <u-form-item v-if="!formDataRead.street" label="乡镇" :required="!readonly" prop="street"
<u--input :value="formDataText.street" disabled disabledColor="#fff" placeholder="请选择镇"></u--input> @click="changeCity('street')" borderBottom>
<u-icon slot="right" name="arrow-right"></u-icon> <u--input :value="formDataText.street" disabled disabledColor="#fff" placeholder="请选择镇"></u--input>
</u-form-item> <u-icon slot="right" name="arrow-right"></u-icon>
<u-form-item v-if="!formDataRead.village" label="村社" :required="!readonly" prop="village" @click="changeCity('village')" borderBottom> </u-form-item>
<u--input :value="formDataText.village" type="text" disabled disabledColor="#fff" placeholder="请选择村"></u--input> <u-form-item v-if="!formDataRead.village" label="村社" :required="!readonly" prop="village"
<u-icon slot="right" name="arrow-right"></u-icon> @click="changeCity('village')" borderBottom>
</u-form-item> <u--input :value="formDataText.village" type="text" disabled disabledColor="#fff"
<u-form-item label="小队" :required="!readonly" prop="brigade" @click="changeCity('brigade')" borderBottom> placeholder="请选择村"></u--input>
<u--input :value="formDataText.brigade" disabled disabledColor="#fff" placeholder="请选择小队"></u--input> <u-icon slot="right" name="arrow-right"></u-icon>
<u-icon slot="right" name="arrow-right"></u-icon> </u-form-item>
</u-form-item> <u-form-item label="小队" :required="!readonly" prop="brigade" @click="changeCity('brigade')" borderBottom>
</u--form> <u--input :value="formDataText.brigade" disabled disabledColor="#fff" placeholder="请选择小队"></u--input>
<u-picker :show="showProvince" :columns="[changeList()]" :keyName="changeType+'_name'" @confirm="confirm" <u-icon slot="right" name="arrow-right"></u-icon>
@cancel="showProvince = false" @close="showProvince = false"></u-picker> </u-form-item>
</view> </u--form>
<u-picker :show="showProvince" :columns="[changeList()]" :keyName="changeType+'_name'" @confirm="confirm"
@cancel="showProvince = false" @close="showProvince = false"></u-picker>
</view>
</template> </template>
<script> <script>
import { commonProvince, commonCity, commonArea, commonStreet, commonVillage, commonBrigade } from "@/api/oaPbulic.js" import {
import { Toast } from "../../libs/uniApi" commonProvince,
export default { commonCity,
name: "districtSelector", commonArea,
props: { commonStreet,
readonly: { commonVillage,
type: Boolean, commonBrigade
default: false } from "@/api/oaPbulic.js"
}, import {
datas: { Toast
type: Object, } from "../../libs/uniApi"
default: null export default {
} name: "districtSelector",
}, props: {
data() { readonly: {
return { type: Boolean,
showProvince: false, default: false
formData: { },
province: '', datas: {
city: '', type: Object,
area: '', default: null
street: '', }
village: '', },
brigade: '', data() {
}, return {
formDataText: { showProvince: false,
province: '', formData: {
city: '', province: '',
area: '', city: '',
street: '', area: '',
village: '', street: '',
brigade: '', village: '',
}, brigade: '',
formDataRead: { },
province: false, formDataText: {
city: false, province: '',
area: false, city: '',
street: false, area: '',
village: false, street: '',
brigade: false, village: '',
}, brigade: '',
rules: { },
street: { formDataRead: {
required: true, province: false,
message: '不能为空', city: false,
trigger: ['change', 'blur'] area: false,
}, street: false,
village: { village: false,
required: true, brigade: false,
message: '不能为空', },
trigger: ['change', 'blur'] rules: {
}, street: {
brigade: { required: true,
validator: (rule, value, callback) => { message: '不能为空',
value ? callback() : callback('不能为空') trigger: ['change', 'blur']
}, },
trigger: ['change', 'blur'] village: {
}, required: true,
}, message: '不能为空',
streetList: [], trigger: ['change', 'blur']
villageList: [], },
brigadeList: [], brigade: {
changeType: '', // validator: (rule, value, callback) => {
}; value ? callback() : callback('不能为空')
}, },
watch: { trigger: ['change', 'blur']
datas(newValue, oldValue) { },
if (this.$props.readonly && newValue) { },
this.formDataText.street = this.$props.datas.street_name; streetList: [],
this.formDataText.village = this.$props.datas.village_name; villageList: [],
this.formDataText.brigade = this.$props.datas.brigade_name; brigadeList: [],
changeType: '', //
};
},
watch: {
datas(newValue, oldValue) {
if (this.$props.readonly && newValue) {
this.formDataText.street = this.$props.datas.street_name;
this.formDataText.village = this.$props.datas.village_name;
this.formDataText.brigade = this.$props.datas.brigade_name;
this.formData.street = this.$props.datas.street_id; this.formData.street = this.$props.datas.street_id;
this.formData.village = this.$props.datas.village_id; this.formData.village = this.$props.datas.village_id;
this.formData.brigade = this.$props.datas.brigade_id; this.formData.brigade = this.$props.datas.brigade_id;
} }
} }
}, },
created() { created() {
if (!this.$props.readonly) { if (!this.$props.readonly) {
this.initProvinceAndCity(); this.initProvinceAndCity();
} else { } else {
this.rules = {}; this.rules = {};
} }
}, },
computed:{ computed: {
nowAddress(){ nowAddress() {
let address = this.$store.state.app.userInfo; let address = this.$store.state.app.userInfo;
let str = ''; let str = '';
address.province_name?str+=address.province_name:null; address.province_name ? str += address.province_name : null;
address.city_name?str+=address.city_name:null; address.city_name ? str += address.city_name : null;
address.area_name?str+=address.area_name:null; address.area_name ? str += address.area_name : null;
address.street_name?str+=address.street_name:null; address.street_name ? str += address.street_name : null;
address.village_name?str+=address.village_name:null; address.village_name ? str += address.village_name : null;
return str; return str;
} }
}, },
methods: { methods: {
async validate() { async validate() {
return await this.$refs.districtForm.validate(); return await this.$refs.districtForm.validate();
}, },
// //
async initProvinceAndCity() { async initProvinceAndCity() {
let user = this.$store.state.app.userInfo; let user = this.$store.state.app.userInfo;
Object.keys(this.formData).forEach(key => { Object.keys(this.formData).forEach(key => {
this.formData[key] = user[key]; this.formData[key] = user[key];
this.formDataText[key] = user[key + '_name']; this.formDataText[key] = user[key + '_name'];
if (user[key]&&key!='brigade') { if (user[key] && key != 'brigade') {
this.formDataRead[key] = true; this.formDataRead[key] = true;
// //
switch (key) { switch (key) {
case 'street': case 'street':
this.loadVillage(this.formData['street']); this.loadVillage(this.formData['street']);
break; break;
case 'village': case 'village':
this.loadBrigade(this.formData['village']); this.loadBrigade(this.formData['village']);
break; break;
} }
} }
}) })
}, },
// //
changeCity(type) { changeCity(type) {
if (this.$props.readonly) return; if (this.$props.readonly) return;
if (this[type + 'List'].length == 0) return Toast('请先选择上一级地区'); if (this[type + 'List'].length == 0) return Toast('请先选择上一级地区');
this.changeType = type; this.changeType = type;
this.showProvince = true; this.showProvince = true;
}, },
// //
changeList() { changeList() {
return this[this.changeType + 'List']; return this[this.changeType + 'List'];
}, },
// //
confirm(e) { confirm(e) {
let flag = false; // let flag = false; //
if (this.formData[this.changeType] != e.value[0][this.changeType + '_code']) flag = true; if (this.formData[this.changeType] != e.value[0][this.changeType + '_code']) flag = true;
if (this.changeType == 'brigade') { if (this.changeType == 'brigade') {
this.formData.brigade = e.value[0].id; this.formData.brigade = e.value[0].id;
this.formDataText.brigade = e.value[0].brigade_name; this.formDataText.brigade = e.value[0].brigade_name;
this.showProvince = false; this.showProvince = false;
return; return;
} }
this.formData[this.changeType] = e.value[0][this.changeType + '_code']; this.formData[this.changeType] = e.value[0][this.changeType + '_code'];
this.formDataText[this.changeType] = e.value[0][this.changeType + '_name']; this.formDataText[this.changeType] = e.value[0][this.changeType + '_name'];
// //
switch (this.changeType) { switch (this.changeType) {
case 'area': case 'area':
this.loadStreet(this.formData['area']); this.loadStreet(this.formData['area']);
break; break;
case 'street': case 'street':
this.loadVillage(this.formData['street']); this.loadVillage(this.formData['street']);
break; break;
case 'village': case 'village':
this.loadBrigade(this.formData['village']); this.loadBrigade(this.formData['village']);
break; break;
} }
// //
if (flag) switch (this.changeType) { if (flag) switch (this.changeType) {
case 'area': case 'area':
this.formData.street = ''; this.formData.street = '';
this.formDataText.street = '' this.formDataText.street = ''
case 'street': case 'street':
this.formData.village = ''; this.formData.village = '';
this.formDataText.village = '' this.formDataText.village = ''
case 'village': case 'village':
this.formData.brigade = ''; this.formData.brigade = '';
this.formDataText.brigade = '' this.formDataText.brigade = ''
} }
this.showProvince = false; this.showProvince = false;
}, },
loadStreet(code) { loadStreet(code) {
commonStreet({ commonStreet({
street: code street: code
}).then(res => { }).then(res => {
this.streetList = res.data; this.streetList = res.data;
}) })
}, },
loadVillage(code) { loadVillage(code) {
commonVillage({ commonVillage({
village: code village: code
}).then(res => { }).then(res => {
this.villageList = res.data; this.villageList = res.data;
}) })
}, },
loadBrigade(code) { loadBrigade(code) {
commonBrigade({ commonBrigade({
brigade: code brigade: code
}).then(res => { }).then(res => {
this.brigadeList = res.data; this.brigadeList = res.data;
}) })
}, },
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.component { .component {
.title { .title {
font-weight: 500; font-weight: 500;
font-size: 34rpx; font-size: 34rpx;
&::before { &::before {
width: 8rpx; width: 8rpx;
height: 26rpx; height: 26rpx;
border-radius: 4rpx; border-radius: 4rpx;
background-color: #3175f9; background-color: #3175f9;
content: ""; content: "";
display: inline-block; display: inline-block;
margin-right: 8rpx; margin-right: 8rpx;
} }
} }
// .checkbox{
// margin: 28rpx; // .checkbox{
// } // margin: 28rpx;
.box{ // }
display: flex; .box {
flex-wrap: wrap; display: flex;
} flex-wrap: wrap;
} }
.u-checkbox-group--row[data-v-2ef8bac9]{ }
flex: 1;
} .u-checkbox-group--row[data-v-2ef8bac9] {
flex: 1;
}
</style> </style>

View File

@ -1,147 +1,128 @@
<template> <template>
<view> <view>
<globalPopup ref="globalPopup"></globalPopup> <globalPopup ref="globalPopup"></globalPopup>
<u-sticky bgColor="#0122C7" style="width: 100vw"> <u-sticky bgColor="#0122C7" style="width: 100vw">
<u-tabs <u-tabs :list="tabLists" @change="sectionChange" lineColor="#fff" :scrollable="false" lineWidth="40"
:list="tabLists" inactiveStyle="color:#fff" activeStyle="color:#fff"></u-tabs>
@change="sectionChange" </u-sticky>
lineColor="#fff" <view class="content">
:scrollable="false" <u-search placeholder="搜索你的订单" @search="getOrderList" :show-action="false" bg-color="white"
lineWidth="40" v-model="keywords"></u-search>
inactiveStyle="color:#fff" <view v-if="!orderlist.length">
activeStyle="color:#fff" <u-empty mode="data" icon="../../static/img/empty/data.png"> </u-empty>
></u-tabs> </view>
</u-sticky> <view v-else>
<view class="content"> <logistiCard ref="logistiCards" v-for="(item, index) in orderlist" @getlist="getOrderList"
<u-search @showTost="showToast" @showToast2="showToast2" :goodsInfo="item" :key="index">
placeholder="搜索你的订单" </logistiCard>
@search="getOrderList" </view>
:show-action="false" <!-- -->
bg-color="white" <u-toast ref="uToast"></u-toast>
v-model="keywords" </view>
></u-search> </view>
<view v-if="!orderlist.length">
<u-empty mode="data" icon="../../static/img/empty/data.png"> </u-empty>
</view>
<view v-else>
<logistiCard
ref="logistiCards"
v-for="(item, index) in orderlist"
@getlist="getOrderList"
@showTost="showToast"
@showToast2="showToast2"
:goodsInfo="item"
:key="index"
>
</logistiCard>
</view>
<!-- -->
<u-toast ref="uToast"></u-toast>
</view>
</view>
</template> </template>
<script> <script>
import { import {
getList getList
} from "@/api/logistics.js" } from "@/api/logistics.js"
import globalPopup from "@/components/GlobalPopup/GlobalPopup.vue" import globalPopup from "@/components/GlobalPopup/GlobalPopup.vue"
import { import {
informationAdd informationAdd
} from "@/api/logistics.js" } from "@/api/logistics.js"
import logistiCard from "@/components/logistiComptent/logistiCard/logistiCard.vue" import logistiCard from "@/components/logistiComptent/logistiCard/logistiCard.vue"
//#ifdef APP-PLUS //#ifdef APP-PLUS
var jpushModule = uni.requireNativePlugin("JG-JPush"); var jpushModule = uni.requireNativePlugin("JG-JPush");
// #endif // #endif
export default { export default {
components: { components: {
logistiCard, logistiCard,
globalPopup globalPopup
}, },
data () { data() {
return { return {
notArr: [], notArr: [],
keywords: "", keywords: "",
tabLists: [{ tabLists: [{
name: '待配送', name: '待配送',
}, { }, {
name: '待送达' name: '待送达'
}, { }, {
name: '已送达' name: '已送达'
}], }],
curNow: 0, curNow: 0,
orderlist: [] orderlist: []
} }
}, },
methods: { methods: {
go () { go() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/logistics/te" url: "/pages/logistics/te"
}) })
}, },
sectionChange (index) { sectionChange(index) {
this.curNow = index.index; this.curNow = index.index;
this.getOrderList() this.getOrderList()
}, },
showToast () { showToast() {
// 6 // 6
this.$refs.uToast.show({ this.$refs.uToast.show({
type: 'success', type: 'success',
title: '成功主题(带图标)', title: '成功主题(带图标)',
message: "操作成功", message: "操作成功",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png' iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
}) })
}, },
showToast2 () { showToast2() {
// 6 // 6
this.$refs.uToast.show({ this.$refs.uToast.show({
type: 'error', type: 'error',
message: "取件码不能为空", message: "取件码不能为空",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png' iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
},) }, )
}, },
getOrderList () { getOrderList() {
console.log("列表更新") console.log("列表更新")
let id = JSON.parse(uni.getStorageSync('USER_INFO')).id let id = JSON.parse(uni.getStorageSync('USER_INFO')).id
getList({ getList({
status: this.curNow, status: this.curNow,
courier_id: id, courier_id: id,
keywords: this.keywords keywords: this.keywords
}).then(res => { }).then(res => {
this.orderlist = [] this.orderlist = []
this.orderlist = res.data.data this.orderlist = res.data.data
}) })
} }
}, },
onLoad () { onLoad() {
let that = this let that = this
//#ifdef APP-PLUS //#ifdef APP-PLUS
jpushModule.addNotificationListener(function (result) { jpushModule.addNotificationListener(function(result) {
if (!that.notArr.includes(result.messageID)) { if (!that.notArr.includes(result.messageID)) {
that.$refs.globalPopup.showPopu(); that.$refs.globalPopup.showPopu();
that.getOrderList() that.getOrderList()
} }
that.notArr.push(result.messageID) that.notArr.push(result.messageID)
}) })
// #endif // #endif
}, },
onShow () { onShow() {
this.getOrderList() this.getOrderList()
} }
} }
</script> </script>
<style lang='scss'> <style lang='scss'>
.content { .content {
margin-top: 2vh; margin-top: 2vh;
background-color: #f5f5f5; background-color: #f5f5f5;
padding: 0vh 2vw; padding: 0vh 2vw;
} }
</style> </style>

View File

@ -238,21 +238,19 @@
}); });
}, },
onLoad() { onLoad() {
// //#ifdef APP-PLUS //#ifdef APP-PLUS
// const audioContext = uni.createInnerAudioContext();
// audioContext.volume = 1; let that = this;
// audioContext.src = "../../static/mp3/order.mp3"; jpushModule.addNotificationListener(function(result) {
// let that = this; if (!that.notArr.includes(result.messageID)) {
// jpushModule.addNotificationListener(function (result) { that.$refs.globalPopup.showPopu();
// if (!that.notArr.includes(result.messageID)) { that.getOrderList();
// that.$refs.globalPopup.showPopu(); console.log("idnex的");
// that.getOrderList(); }
// console.log("idnex"); that.notArr.push(result.messageID);
// audioContext.play(); });
// } // #endif
// that.notArr.push(result.messageID);
// });
// // #endif
}, },
onShow() { onShow() {
// this.getUserIndex() // this.getUserIndex()

View File

@ -1,309 +1,558 @@
<template> <template>
<view class=""> <view class="">
<view class="card"> <view class="card">
<u--form labelPosition="left" :model="formData" :rules="rules" ref="uForm"> <u--form labelPosition="left" :model="formData" :rules="rules" ref="uForm">
<view class="title">基本信息</view> <view class="cards">
<u-form-item label="电话" required prop="account" borderBottom> <view class="avter">
<u--input v-model="formData.account" placeholder="请输入手机号" type="number"></u--input> <view class="">
</u-form-item> 用户头像:
<u-form-item label="姓名" required prop="nickname" borderBottom> </view>
<u--input v-model="formData.nickname" placeholder="请输入姓名"></u--input> <view class="">
</u-form-item> <view class="" v-if="formData.avatar">
<u-form-item label="性别" required prop="sex" borderBottom> <!-- {{formData.avatar}} -->
<u-radio-group v-model="formData.sex" style="margin: 16rpx;"> <image :src="formData.avatar" alt="" style="width:243.57rpx;height:150rpx;">
<u-radio :customStyle="{marginRight: '16px'}" </image>
v-for="(item, index) in [{value:1,label:'男'},{value:2,label:'女'}]" :key="index" :label="item.label" </view>
:name="item.value"> <view class="uplode" v-else>
</u-radio> <u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon>
</u-radio-group> 上传头像
</u-form-item> <view class="up" style="opacity: 0;">
<u-form-item label="头像" required prop="avatar" borderBottom> <u-upload :fileList="formData.avatar?[{url:formData.avatar}]:[]"
<u-upload :fileList="formData.avatar?[{url:formData.avatar}]:[]" @afterRead="afterReadAvatar" @afterRead="afterReadAvatar" @delete="formData.avatar=''" :maxCount="1">
@delete="formData.avatar=''" name="avatar" :maxCount="1" width="150rpx" height="150rpx" </u-upload>
style="margin-top: 10rpx;"> </view>
</u-upload> </view>
</u-form-item>
<u-form-item labelWidth="auto" label="身份证号" required prop="id_card" borderBottom> </view>
<u--input v-model="formData.id_card" placeholder="请输入身份证号" type="idcard"></u--input> </view>
</u-form-item> </view>
<view class="title">身份信息</view> <view class="cards">
<u-form-item labelWidth="auto" label="是否为小队长" required prop="is_captain" borderBottom>
<u-radio-group v-model="formData.is_captain" style="margin: 16rpx;"> <u-form-item label="电话" required prop="account" borderBottom>
<u-radio :customStyle="{marginRight: '16px'}" <u--input v-model="formData.account" placeholder="请输入手机号" type="number"></u--input>
v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index" :label="item.label" </u-form-item>
:name="item.value"> <u-form-item label="姓名" required prop="nickname" borderBottom>
</u-radio> <u--input v-model="formData.nickname" placeholder="请输入姓名"></u--input>
</u-radio-group> </u-form-item>
</u-form-item> <u-form-item label="性别" required prop="sex" borderBottom>
<!-- <u-form-item labelWidth="auto" label="登录密码" prop="formData.name" borderBottom> <u-radio-group v-model="formData.sex" style="margin: 16rpx;">
<u-radio activeColor="#0122C7" :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 labelWidth="auto" label="身份证号" required prop="id_card" borderBottom>
<u--input v-model="formData.id_card" placeholder="请输入身份证号" type="idcard"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="是否为小队长" required prop="is_captain" borderBottom>
<u-radio-group v-model="formData.is_captain" style="margin: 16rpx;">
<u-radio activeColor="#0122C7" :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>
<districtSelectorTow style="margin-top: 30rpx;" ref="districtSelectorRef"></districtSelectorTow>
</view>
<view class="cards">
<view style="margin-bottom:30rpx ;">
身份证照:
</view>
<view class="up_list">
<view class="" v-if="formData.qualification.id_card">
<!-- {{formData.avatar}} -->
<image :src="formData.qualification.id_card" alt="" style="width:243.57rpx;height:150rpx;">
</image>
</view>
<view class="uplode" v-else>
<u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon>
身份证正面
<view class="up" style="opacity: 0;">
<u-upload
:fileList="formData.qualification.id_card?[{url:formData.qualification.id_card}]:[]"
@afterRead="afterRead" @delete="formData.qualification.id_card=''" name="id_card"
:maxCount="1" width="638rpx" height="300rpx" style="margin-top: 10rpx;">
</u-upload>
<!--
<u-upload :fileList="formData.avatar?[{url:formData.avatar}]:[]"
@afterRead="afterReadAvatar" @delete="formData.avatar=''" :maxCount="1">
</u-upload> -->
</view>
</view>
<view class="" v-if="formData.qualification.id_card_b">
<!-- {{formData.avatar}} -->
<image :src="formData.qualification.id_card_b" alt=""
style="width:243.57rpx;height:150rpx;">
</image>
</view>
<view class="uplode" v-else>
<u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon>
身份证反面
<view class="up" style="opacity: 0;">
<u-upload
:fileList="formData.qualification.id_card_b?[{url:formData.qualification.id_card_b}]:[]"
@afterRead="afterRead" @delete="formData.qualification.id_card_b=''"
name="id_card_b" :maxCount="1" width="638rpx" height="300rpx"
style="margin-top: 10rpx;">
</u-upload>
</view>
</view>
</view>
</view>
<view class="cards">
<view style="margin-bottom:30rpx ;">
银行卡照:
</view>
<view class="up_list">
<view class="" v-if="formData.qualification.bank_account">
<!-- {{formData.avatar}} -->
<image :src="formData.qualification.bank_account" alt=""
style="width:243.57rpx;height:150rpx;">
</image>
</view>
<view class="uplode" v-else>
<u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon>
银行卡正面
<view class="up" style="opacity: 0;">
<u-upload
:fileList="formData.qualification.bank_account?[{url:formData.qualification.bank_account}]:[]"
@afterRead="afterRead" @delete="formData.qualification.bank_account=''"
name="bank_account" :maxCount="1" width="638rpx" height="300rpx"
style="margin-top: 10rpx;">
</u-upload>
</view>
</view>
<view class="" v-if="formData.qualification.bank_account_b">
<!-- {{formData.avatar}} -->
<image :src="formData.qualification.bank_account_b" alt=""
style="width:243.57rpx;height:150rpx;">
</image>
</view>
<view class="uplode" v-else>
<u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon>
银行卡反面
<view class="up" style="opacity: 0;">
<u-upload
:fileList="formData.qualification.bank_account_b?[{url:formData.qualification.bank_account_b}]:[]"
@afterRead="afterRead" @delete="formData.qualification.bank_account_b=''"
name="bank_account_b" :maxCount="1" width="638rpx" height="300rpx"
style="margin-top: 10rpx;">
</u-upload>
</view>
</view>
</view>
</view>
<view class="cards">
<view style="margin-bottom:30rpx ;">
驾驶证照:
</view>
<view class="up_list">
<view class="" v-if="formData.qualification.car_card">
<!-- {{formData.avatar}} -->
<image :src="formData.qualification.car_card" alt="" style="width:243.57rpx;height:150rpx;">
</image>
</view>
<view class="uplode" v-else>
<u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon>
驾驶证一页
<view class="up" style="opacity: 0;">
<u-upload
:fileList="formData.qualification.car_card?[{url:formData.qualification.car_card}]:[]"
@afterRead="afterRead" @delete="formData.qualification.car_card=''" name="car_card"
:maxCount="1" width="638rpx" height="300rpx" style="margin-top: 10rpx;">
</u-upload>
</view>
</view>
<view class="" v-if="formData.qualification.car_card_b">
<!-- {{formData.avatar}} -->
<image :src="formData.qualification.car_card_b" alt=""
style="width:243.57rpx;height:150rpx;">
</image>
</view>
<view class="uplode" v-else>
<u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon>
驾驶证二页
<view class="up" style="opacity: 0;">
<u-upload
:fileList="formData.qualification.car_card_b?[{url:formData.qualification.car_card_b}]:[]"
@afterRead="afterRead" @delete="formData.qualification.car_card_b=''"
name="car_card_b" :maxCount="1" width="638rpx" height="300rpx"
style="margin-top: 10rpx;">
</u-upload>
</view>
</view>
</view>
</view>
<!-- <view class="title">基本信息</view>
<u-form-item label="电话" required prop="account" borderBottom>
<u--input v-model="formData.account" placeholder="请输入手机号" type="number"></u--input>
</u-form-item>
<u-form-item label="姓名" required prop="nickname" borderBottom>
<u--input v-model="formData.nickname" placeholder="请输入姓名"></u--input>
</u-form-item>
<u-form-item label="性别" required prop="sex" borderBottom>
<u-radio-group v-model="formData.sex" 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="avatar" borderBottom>
<u-upload :fileList="formData.avatar?[{url:formData.avatar}]:[]" @afterRead="afterReadAvatar"
@delete="formData.avatar=''" name="avatar" :maxCount="1" width="150rpx" height="150rpx"
style="margin-top: 10rpx;">
</u-upload>
</u-form-item>
<u-form-item labelWidth="auto" label="身份证号" required prop="id_card" borderBottom>
<u--input v-model="formData.id_card" placeholder="请输入身份证号" type="idcard"></u--input>
</u-form-item>
<view class="title">身份信息</view>
<u-form-item labelWidth="auto" label="是否为小队长" required prop="is_captain" borderBottom>
<u-radio-group v-model="formData.is_captain" 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> -->
<!-- <u-form-item labelWidth="auto" label="登录密码" prop="formData.name" borderBottom>
<u--input v-model="formData.password" placeholder="不输入密码则默认为手机号" password></u--input> <u--input v-model="formData.password" placeholder="不输入密码则默认为手机号" password></u--input>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="确认密码" prop="formData.name" borderBottom> <u-form-item labelWidth="auto" label="确认密码" prop="formData.name" borderBottom>
<u--input v-model="formData.password_confirm" placeholder="不输入密码则默认为手机号" password></u--input> <u--input v-model="formData.password_confirm" placeholder="不输入密码则默认为手机号" password></u--input>
</u-form-item> --> </u-form-item> -->
<!-- <view class="title">地区信息</view> --> <!-- <view class="title">地区信息</view> -->
<!-- <districtSelector style="margin-top: 30rpx;" ref="districtSelectorRef"></districtSelector> --> <!-- <districtSelector style="margin-top: 30rpx;" ref="districtSelectorRef"></districtSelector> -->
<districtSelectorTow style="margin-top: 30rpx;" ref="districtSelectorRef"></districtSelectorTow> <!-- <districtSelectorTow style="margin-top: 30rpx;" ref="districtSelectorRef"></districtSelectorTow>
<view class="title">资质信息</view> <view class="title">资质信息</view>
<u-form-item label="身份证正面" required labelPosition="top" labelWidth="200rpx" prop="qualification.id_card" <u-form-item label="身份证正面" required labelPosition="top" labelWidth="200rpx" prop="qualification.id_card"
borderBottom> borderBottom>
<u-upload :fileList="formData.qualification.id_card?[{url:formData.qualification.id_card}]:[]" <u-upload :fileList="formData.qualification.id_card?[{url:formData.qualification.id_card}]:[]"
@afterRead="afterRead" @delete="formData.qualification.id_card=''" name="id_card" :maxCount="1" @afterRead="afterRead" @delete="formData.qualification.id_card=''" name="id_card" :maxCount="1"
width="638rpx" height="300rpx" style="margin-top: 10rpx;"> width="638rpx" height="300rpx" style="margin-top: 10rpx;">
</u-upload> </u-upload>
</u-form-item> </u-form-item>
<u-form-item label="身份证反面" required labelPosition="top" labelWidth="200rpx" prop="qualification.id_card_b" <u-form-item label="身份证反面" required labelPosition="top" labelWidth="200rpx"
borderBottom> prop="qualification.id_card_b" borderBottom>
<u-upload :fileList="formData.qualification.id_card_b?[{url:formData.qualification.id_card_b}]:[]" <u-upload :fileList="formData.qualification.id_card_b?[{url:formData.qualification.id_card_b}]:[]"
@afterRead="afterRead" @delete="formData.qualification.id_card_b=''" name="id_card_b" :maxCount="1" @afterRead="afterRead" @delete="formData.qualification.id_card_b=''" name="id_card_b"
width="638rpx" height="300rpx" style="margin-top: 10rpx;"> :maxCount="1" width="638rpx" height="300rpx" style="margin-top: 10rpx;">
</u-upload> </u-upload>
</u-form-item> </u-form-item>
<u-form-item label="银行卡正面" required labelPosition="top" labelWidth="200rpx" prop="qualification.bank_account" <u-form-item label="银行卡正面" required labelPosition="top" labelWidth="200rpx"
borderBottom> prop="qualification.bank_account" borderBottom>
<u-upload :fileList="formData.qualification.bank_account?[{url:formData.qualification.bank_account}]:[]" <u-upload
@afterRead="afterRead" @delete="formData.qualification.bank_account=''" name="bank_account" :maxCount="1" :fileList="formData.qualification.bank_account?[{url:formData.qualification.bank_account}]:[]"
width="638rpx" height="300rpx" style="margin-top: 10rpx;"> @afterRead="afterRead" @delete="formData.qualification.bank_account=''" name="bank_account"
</u-upload> :maxCount="1" width="638rpx" height="300rpx" style="margin-top: 10rpx;">
</u-form-item> </u-upload>
<u-form-item label="银行卡反面" required labelPosition="top" labelWidth="200rpx" prop="qualification.bank_account_b" </u-form-item>
borderBottom> <u-form-item label="银行卡反面" required labelPosition="top" labelWidth="200rpx"
<u-upload :fileList="formData.qualification.bank_account_b?[{url:formData.qualification.bank_account_b}]:[]" prop="qualification.bank_account_b" borderBottom>
@afterRead="afterRead" @delete="formData.qualification.bank_account_b=''" name="bank_account_b" <u-upload
:maxCount="1" width="638rpx" height="300rpx" style="margin-top: 10rpx;"> :fileList="formData.qualification.bank_account_b?[{url:formData.qualification.bank_account_b}]:[]"
</u-upload> @afterRead="afterRead" @delete="formData.qualification.bank_account_b=''" name="bank_account_b"
</u-form-item> :maxCount="1" width="638rpx" height="300rpx" style="margin-top: 10rpx;">
<u-form-item label="驾驶证正面" labelPosition="top" labelWidth="200rpx" </u-upload>
borderBottom> </u-form-item>
<u-upload :fileList="formData.qualification.car_card?[{url:formData.qualification.car_card}]:[]" <u-form-item label="驾驶证正面" labelPosition="top" labelWidth="200rpx" borderBottom>
@afterRead="afterRead" @delete="formData.qualification.car_card=''" name="car_card" :maxCount="1" <u-upload :fileList="formData.qualification.car_card?[{url:formData.qualification.car_card}]:[]"
width="638rpx" height="300rpx" style="margin-top: 10rpx;"> @afterRead="afterRead" @delete="formData.qualification.car_card=''" name="car_card"
</u-upload> :maxCount="1" width="638rpx" height="300rpx" style="margin-top: 10rpx;">
</u-form-item> </u-upload>
<u-form-item label="驾驶证反面" labelPosition="top" labelWidth="200rpx" </u-form-item>
borderBottom> <u-form-item label="驾驶证反面" labelPosition="top" labelWidth="200rpx" borderBottom>
<u-upload :fileList="formData.qualification.car_card_b?[{url:formData.qualification.car_card_b}]:[]" <u-upload :fileList="formData.qualification.car_card_b?[{url:formData.qualification.car_card_b}]:[]"
@afterRead="afterRead" @delete="formData.qualification.car_card_b=''" name="car_card_b" :maxCount="1" @afterRead="afterRead" @delete="formData.qualification.car_card_b=''" name="car_card_b"
width="638rpx" height="300rpx" style="margin-top: 10rpx;"> :maxCount="1" width="638rpx" height="300rpx" style="margin-top: 10rpx;">
</u-upload> </u-upload>
</u-form-item> </u-form-item> -->
</u--form> </u--form>
<button @click="addAcountNum" type="primary" class="btn">创建</button> <button @click="addAcountNum" type="primary" class="btn">创建</button>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import { upLoadImage } from "@/api/file.js" import {
import { loginAdd } from "@/api/oaUser.js" upLoadImage
import districtSelector from "@/components/districtSelector/districtSelector.vue" // } from "@/api/file.js"
import districtSelectorTow from "@/components/districtSelector/districtSelectorTow.vue" // import {
export default { loginAdd
components: { districtSelector, districtSelectorTow }, } from "@/api/oaUser.js"
data() { import districtSelector from "@/components/districtSelector/districtSelector.vue" //
return { import districtSelectorTow from "@/components/districtSelector/districtSelectorTow.vue" //
formData: { export default {
account: '', // components: {
password: '123456', // districtSelector,
password_confirm: '', // districtSelectorTow
// channel: 6, //[1- 2- 3-H5 4-PC 5-APP 6-APP] },
id_card: '', data() {
is_captain: '',// return {
sex: '', formData: {
avatar: '', account: '', //
nickname: '', password: '123456', //
address: '', password_confirm: '', //
qualification: { // channel: 6, //[1- 2- 3-H5 4-PC 5-APP 6-APP]
id_card: "", id_card: '',
id_card_b: "", is_captain: '', //
car_card: "", sex: '',
car_card_b: "", avatar: '',
bank_account: "", nickname: '',
bank_account_b: "" address: '',
}, qualification: {
}, id_card: "",
rules: { id_card_b: "",
account: { car_card: "",
required: true, car_card_b: "",
pattern: /^(1[3456789]\d{9})$/, bank_account: "",
message: '请输入正确的手机号码', bank_account_b: ""
trigger: ['change', 'blur'] },
}, },
id_card: { rules: {
required: true, account: {
pattern: /^\d{17}[\dX]$|^\d{15}[\dX]$/, required: true,
message: '请输入正确的身份证号', pattern: /^(1[3456789]\d{9})$/,
trigger: ['change', 'blur'] message: '请输入正确的手机号码',
}, trigger: ['change', 'blur']
sex: { },
validator: (rule, value, callback) => { id_card: {
typeof value === 'number' ? callback() : callback('请选择男或女') required: true,
}, pattern: /^\d{17}[\dX]$|^\d{15}[\dX]$/,
trigger: ['change', 'blur'] message: '请输入正确的身份证号',
}, trigger: ['change', 'blur']
avatar: { },
type: 'string', sex: {
required: true, validator: (rule, value, callback) => {
message: '头像不能为空', typeof value === 'number' ? callback() : callback('请选择男或女')
trigger: ['change', 'blur'] },
}, trigger: ['change', 'blur']
nickname: { },
type: 'string', avatar: {
required: true, type: 'string',
message: '姓名不能为空', required: true,
trigger: ['change', 'blur'] message: '头像不能为空',
}, trigger: ['change', 'blur']
is_captain:{ },
validator: (rule, value, callback) => { nickname: {
typeof value === 'number' ? callback() : callback('不能为空') type: 'string',
}, required: true,
trigger: ['change', 'blur'] message: '姓名不能为空',
}, trigger: ['change', 'blur']
'qualification.id_card': { },
type: 'string', is_captain: {
required: true, validator: (rule, value, callback) => {
message: '不能为空', typeof value === 'number' ? callback() : callback('不能为空')
trigger: ['change', 'blur'] },
}, trigger: ['change', 'blur']
'qualification.id_card_b': { },
type: 'string', 'qualification.id_card': {
required: true, type: 'string',
message: '不能为空', required: true,
trigger: ['change', 'blur'] message: '不能为空',
}, trigger: ['change', 'blur']
'qualification.bank_account': { },
type: 'string', 'qualification.id_card_b': {
required: true, type: 'string',
message: '不能为空', required: true,
trigger: ['change', 'blur'] message: '不能为空',
}, trigger: ['change', 'blur']
'qualification.bank_account_b': { },
type: 'string', 'qualification.bank_account': {
required: true, type: 'string',
message: '不能为空', required: true,
trigger: ['change', 'blur'] message: '不能为空',
}, trigger: ['change', 'blur']
}, },
} 'qualification.bank_account_b': {
}, type: 'string',
onLoad() {}, required: true,
onReady() { message: '不能为空',
//setRules trigger: ['change', 'blur']
this.$refs.uForm.setRules(this.rules) },
}, },
onShow() {}, }
methods: { },
// onLoad() {},
async afterReadAvatar(event) { onReady() {
upLoadImage({ //setRules
filePath: event.file.url, this.$refs.uForm.setRules(this.rules)
name: 'file' },
}).then(res => { onShow() {},
this.formData.avatar = res.data.uri methods: {
}) //
}, async afterReadAvatar(event) {
// upLoadImage({
async afterRead(event) { filePath: event.file.url,
this.upLoad(event.file.url, event.name) name: 'file'
}, }).then(res => {
// this.formData.avatar = res.data.uri
upLoad(url, type) { })
upLoadImage({ },
filePath: url, //
name: 'file' async afterRead(event) {
}).then(res => { this.upLoad(event.file.url, event.name)
this.formData.qualification[type] = res.data.uri },
}) //
}, upLoad(url, type) {
// upLoadImage({
addAcountNum() { filePath: url,
let flag = this.$refs.districtSelectorRef.validate(); name: 'file'
this.$refs.uForm.validate().then(async (e) => { }).then(res => {
if(e&&flag){ this.formData.qualification[type] = res.data.uri
uni.showLoading() })
let res = await loginAdd({...this.formData, ...this.$refs.districtSelectorRef.formData}); },
uni.hideLoading() //
uni.showToast({ addAcountNum() {
icon: "none", let flag = this.$refs.districtSelectorRef.validate();
title: "添加成功", this.$refs.uForm.validate().then(async (e) => {
success: () => { if (e && flag) {
setTimeout(() => { uni.showLoading()
uni.$emit('initPersonnel'); let res = await loginAdd({
uni.navigateBack(); ...this.formData,
}, 1000) ...this.$refs.districtSelectorRef.formData
} });
}) uni.hideLoading()
} uni.showToast({
}) icon: "none",
}, title: "添加成功",
// // ,[1- 2- 3-H5 4-PC 5-APP 6-APP] success: () => {
// initTerminal() { setTimeout(() => {
// // #ifndef APP-PLUS uni.$emit('initPersonnel');
// this.formData.terminal = 6; uni.navigateBack();
// // #endif }, 1000)
// uni.getSystemInfo({ }
// success: (res) => { })
// const platform = res.platform.toLowerCase(); }
// if (platform === 'ios') { })
// this.formData.terminal = 5; },
// } else if (platform === 'windows') { // // ,[1- 2- 3-H5 4-PC 5-APP 6-APP]
// this.formData.terminal = 4; // initTerminal() {
// } else if (platform === 'mac') { // // #ifndef APP-PLUS
// this.formData.terminal = 4; // this.formData.terminal = 6;
// } // // #endif
// } // uni.getSystemInfo({
// }) // success: (res) => {
// // #ifdef H5 // const platform = res.platform.toLowerCase();
// this.formData.terminal = 3; // if (platform === 'ios') {
// // #endif // this.formData.terminal = 5;
// // #ifdef MP-WEIXIN // } else if (platform === 'windows') {
// this.formData.terminal = 1; // this.formData.terminal = 4;
// // #endif // } else if (platform === 'mac') {
// }, // this.formData.terminal = 4;
}, // }
onPullDownRefresh() { // }
uni.stopPullDownRefresh() // })
} // // #ifdef H5
} // this.formData.terminal = 3;
// // #endif
// // #ifdef MP-WEIXIN
// this.formData.terminal = 1;
// // #endif
// },
},
onPullDownRefresh() {
uni.stopPullDownRefresh()
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
.card { .card {
background-color: #fff; // background-color: #fff;
margin: 28rpx; // margin: 28rpx;
padding: 28rpx; // padding: 28rpx;
border-radius: 14rpx; // border-radius: 14rpx;
.title { .cards {
font-weight: 500;
font-size: 34rpx;
margin-top: 30rpx;
&:nth-child(1) {
margin-top: 0;
}
&::before { margin: 28rpx;
width: 8rpx; padding: 28rpx;
height: 26rpx; border-radius: 14rpx;
border-radius: 4rpx; background-color: #fff;
background-color: #3175f9;
content: "";
display: inline-block;
margin-right: 8rpx;
}
}
.btn { .avter {
margin-top: 32rpx; display: flex;
// margin-bottom: 40rpx; justify-content: space-between;
width: 100%; // line-height: 150rpx;
height: 84rpx; align-items: center;
background: $theme-oa-color; }
border-radius: 42rpx 42rpx 42rpx 42rpx;
color: #fff; .up_list {
line-height: 80rpx; display: flex;
text-align: center; justify-content: space-between;
} }
}
.uplode {
width: 243.57rpx;
height: 173.48rpx;
box-sizing: border-box;
padding-top: 30rpx;
border-radius: 15rpx;
border: 1px solid $theme-oa-color;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
color: $theme-oa-color;
position: relative;
.up {
position: absolute;
color: transparent;
}
}
}
.title {
font-weight: 500;
font-size: 34rpx;
margin-top: 30rpx;
&:nth-child(1) {
margin-top: 0;
}
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #3175f9;
content: "";
display: inline-block;
margin-right: 8rpx;
}
}
.btn {
margin-top: 32rpx;
// margin-bottom: 40rpx;
width: 100%;
height: 84rpx;
background: $theme-oa-color;
border-radius: 42rpx 42rpx 42rpx 42rpx;
color: #fff;
line-height: 80rpx;
text-align: center;
}
}
</style> </style>

View File

@ -58,7 +58,8 @@
<view class="personnel_list"> <view class="personnel_list">
<view class="card" v-for="(item, index) in userList" :key="item.id"> <view class="card" v-for="(item, index) in userList" :key="item.id">
<view class="card_head"> <view class="card_head">
<text style="font-size: 32rpx">创建时间: {{item.create_time||"2020-10-10"}}</text> <text style="font-size: 32rpx;">创建时间: {{creTime(item.create_time)}}
</text>
<text @click="navTo('/subpkg/finance/finance?id='+item.id)">财务查看</text> <text @click="navTo('/subpkg/finance/finance?id='+item.id)">财务查看</text>
<text @click="navTo('/subpkg/personnelDetails/personnelDetails?id='+item.id)">信息查看</text> <text @click="navTo('/subpkg/personnelDetails/personnelDetails?id='+item.id)">信息查看</text>
</view> </view>
@ -137,7 +138,13 @@
this.loadUserList(); this.loadUserList();
uni.$on('initPersonnel', this.initLoad); uni.$on('initPersonnel', this.initLoad);
}, },
methods: { methods: {
creTime(a) {
return a.toString().substring(0, 10)
// return a.substring(0, 10)
// console.log(a.substring(0, 10))
},
navTo(url) { navTo(url) {
url ? url ?
uni.navigateTo({ uni.navigateTo({