This commit is contained in:
lnn19986213 2022-07-18 15:44:07 +08:00
parent 29476e5f69
commit a637993e52
6 changed files with 727 additions and 761 deletions

View File

@ -530,7 +530,8 @@
"style" : "style" :
{ {
"navigationBarTitleText": "点单大厅", "navigationBarTitleText": "点单大厅",
"enablePullDownRefresh": false "enablePullDownRefresh": true,
"onReachBottomDistance": 20
} }
}, },
{ {

View File

@ -1,520 +1,233 @@
<template> <template>
<view> <view>
<view class="wanShan">
<view class="data_itm_box" style="padding: 32rpx ;">
<u--form :model="model1" ref="form1" labelPosition="top" labelWidth='auto' :labelStyle='{fontWeight:800}'> <view class="data_itm">
<!-- 完善资料 --> <view class="data_itm_key label_t">
<!-- 这里加了 v-for 导致 ref 失效 --> 图片上传
<view class="wanShan"> </view>
<view class="data_itm_box" style="padding: 32rpx ;"> </view>
<u-upload class="upload" accept="image" width="172rpx" height="172rpx" :fileList="fileList3"
@afterRead="afterRead" @delete="deletePic" name="3" multiple>
<image style="width: 172rpx;height: 172rpx;" src="../../static/improveData/jia.png"></image>
</u-upload>
<view class="data_itm"> </view>
<view class="data_itm_key label_t"> </view>
图片上传 <view class="operation">
</view> <button type="default" class="next" @click="submit">确定</button>
</view> </view>
<u-upload class="upload" accept="image" width="172rpx" height="172rpx" :fileList="fileList3" <view class="zhan_w">
@afterRead="afterRead" @delete="deletePic" name="3" multiple :maxCount="1"> <!-- zhanwei -->
<image style="width: 172rpx;height: 172rpx;" src="../../static/improveData/jia.png"></image> </view>
</u-upload> </view>
</view>
</view>
<view class="operation">
<button type="default" class="next" @click="submit">确定</button>
</view>
</u--form>
<view class="zhan_w">
<!-- zhanwei -->
</view>
</view>
</template> </template>
<script> <script>
import http from '../../request/interface.js' import http from '../../request/interface.js'
export default { export default {
data() { data() {
return { return {
fileList3: [], //
id: '',
};
},
onLoad(option) {
this.id = option.id
},
methods: {
//
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
//
async afterRead(event) {
// mutiple true , file
let lists = [].concat(event.file)
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
status: 'uploading',
message: '上传中'
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
},
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: http.config.baseUrl + '/file/upload',
filePath: url,
name: 'file',
formData: {
user: 'test'
},
success: (res) => {
if (JSON.parse(res.data).code == 200) {
setTimeout(() => {
resolve(JSON.parse(res.data).data.path)
}, 1000)
} else {
uni.showToast({
title: JSON.parse(res.data).message,
icon: "none",
});
this.fileList3.pop()
}
}
});
})
},
submit() {
let image = []
this.fileList3.forEach(function(item) {
image.push(item.url)
})
let data = image.join(',')
console.log(data)
this.http.request('/hall/addHall?id='+ this.id +'&image=' +data, {}, "POST").then(res => {
if (res.code == 200) {
uni.navigateBack()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
}
}
fileList4: [], // }
fileList1: [], //
fileList2: [
[]
], //
fileList3: [], //
model1: {
userInfo: {
name: '',
sex: '',
birthday: "2000-01-01",
idCOde: '',
phoneNum: '',
meeting: '',
// meetingTime: '',
ServerName: '',
Address: '',
serverInstrutor: '', //
serveTime: '09:00',
serveTimeend: '17:00',
jionTime: '2000-01-01',
DutyPeopleName: '', //
// ServephoneNum: '', //
pasw: ''
},
},
rules: {
'userInfo.pasw': [{
required: true,
message: '请填写密码',
trigger: ['blur','change']
}, {
min: 6,
max: 20,
message: '密码长度应大于等于6个字符小于20个字符!',
trigger: ['blur','change']
}, {
trigger: ['blur','change'],
validator: (rule, value, callback) => {
var passwordreg =
/^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)])+$).{6,20}$/;
if (!passwordreg.test(value)) {
callback(new Error('密码包含 数字,英文,字符中的两种以上'))
} else {
callback()
}
}
}],
'userInfo.serverInstrutor': [{
type: 'string',
required: true,
message: '请填写服务内容介绍',
trigger: ['blur', 'change']
}],
'userInfo.Address': [{
type: 'string',
required: true,
message: '请填写地址',
trigger: ['blur', 'change']
}],
'userInfo.name': [{
type: 'string',
required: true,
message: '请填写姓名',
trigger: ['blur', 'change']
}, {
// truefalse
validator: (rule, value, callback) => {
// uViewjshttps://www.uviewui.com/js/test.html
return uni.$u.test.chinese(value);
},
message: "姓名必须为中文",
// blurchange
trigger: ["change", "blur"],
}],
'userInfo.meeting': [{
type: 'string',
required: true,
message: '请填写协会名',
trigger: ['blur', 'change']
}],
'userInfo.sex': {
type: 'string',
max: 1,
required: true,
message: '请选择男或女',
trigger: ['blur', 'change']
},
'userInfo.idCOde': [{
required: true,
message: '请输入身份证号号',
trigger: ['change', 'blur'],
},
{
//
validator: (rule, value, callback) => {
return uni.$u.test.idCard(value);
},
message: '身份证号码格式不正确',
trigger: ['change', 'blur'],
}
]
,
'userInfo.ServerName': [{
type: 'string',
required: true,
message: '请填写服务名称',
trigger: ['blur', 'change']
}, {
// truefalse
validator: (rule, value, callback) => {
// uViewjshttps://www.uviewui.com/js/test.html
return uni.$u.test.chinese(value);
},
message: "姓名必须为中文",
// blurchange
trigger: ["change", "blur"],
}],
'userInfo.DutyPeopleName': [{
type: 'string',
required: true,
message: '请填写姓名',
trigger: ['blur', 'change']
}, {
// truefalse
validator: (rule, value, callback) => {
// uViewjshttps://www.uviewui.com/js/test.html
return uni.$u.test.chinese(value);
},
message: "姓名必须为中文",
// blurchange
trigger: ["change", "blur"],
}],
},
};
},
onLoad(option) {
console.log(option.id);
this.pageTypeId = option.id
},
onReady() {
this.$refs.form1.setRules(this.rules);
this.http.request('/association/list', {}, "GET").then((res) => {
res.data.records.map((v, i) => {
return this.xiehuiObj[v.name] = v.id
})
var xieList = res.data.records.map((v, i) => {
return v.name
})
this.xiecolumns.push(xieList)
console.log('this.xiehuiObj', this.xiehuiObj);
}).catch((error) => {
console.log("error", error);
})
},
methods: {
close(show) {
this[show] = false
},
AddItem(typNum) {
switch (typNum) {
case 0:
// this.$set(this.artlist, changeNum, null)
this.artlist.push("")
break;
case 1:
this.honorList.push('')
break;
case 2:
this.StandradList.push('')
this.fileList2.push([])
break;
}
},
delItem(typNum, num) {
switch (typNum) {
case 0:
this.artlist.splice(num, 1)
break;
case 1:
this.honorList.splice(num, 1)
break;
case 2:
this.StandradList.splice(num, 1)
break;
}
},
sexSelect(e) {
this.model1.userInfo.sex = e.name
// this.$refs.form1.validateField('userInfo.sex')
},
selectForm(sex) {
this.model1.userInfo.sex = sex
},
birthdayConfirm(e) {
this.showBirthday = false
this.model1.userInfo.birthday = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
// this.$refs.form1.validateField('userInfo.birthday')
},
ServeTimeConfirm(e) {
this.showServeTime = false
this.model1.userInfo.serveTime = e.value
},
ServeTimeConfirmend(e) {
this.showServeTimeend = false
this.model1.userInfo.serveTimeend = e.value
},
jionMeetConfirm(e) {
this.showJionmeet = false
this.model1.userInfo.jionTime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
},
confimZu(e) {
this.zuShow = false
this.zuValue = e.value[0]
// console.log(e.value[0]);
},
confirmxie(e) {
this.xieShow = false
this.xieValue = e.value[0]
this.xiehuiId = this.xiehuiObj[this.xieValue]
console.log("xiehuiId", this.xiehuiId);
},
confimZheng(e) {
this.zhengzhiShow = false
this.zhengzhiValue = e.value[0]
},
confimRenCai(e) {
this.renCaiShow = false
this.renCaiValue = e.value[0]
},
confimJi(e) {
this.jigaunShow = false
this.jiguan = e.value[0]
},
//
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
//
deletePic1(event) {
this.fileList2[event.name].splice(event.index, 1)
},
//
async afterRead(event) {
// mutiple true , file
let lists = [].concat(event.file)
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
status: 'uploading',
message: '上传中'
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
console.log("result", result);
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
console.log("fileList", this[`fileList${event.name}`]);
},
//
async afterRead1(event) {
// mutiple true , file
let lists = [].concat(event.file)
console.log(this.fileList2[event.name])
let fileListLen = this.fileList2[event.name].length
lists.map((item) => {
this.fileList2[event.name].push({
...item,
status: 'uploading',
message: '上传中'
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
console.log("result", result);
let item = this.fileList2[event.name][fileListLen]
this.fileList2[event.name].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
console.log("fileList", this.fileList2[event.name]);
},
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: http.config.baseUrl + '/upload/upload',
filePath: url,
name: 'file',
success: (res) => {
setTimeout(() => {
resolve(JSON.parse(res.data).data.path)
}, 1000)
}
});
})
},
submit() {
/*
this.$refs.form1.validate().then(res => {
this.http.request('/auth/init', data, "POST").then(res => {
if (res.code == 200) {
uni.navigateTo({
url: '/pages/pageHome/pageHome'
})
uni.showToast({
title: "成功了",
icon: "none",
});
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
}).catch(errors => {
uni.$u.toast('您的资料还未补充完整')
return
}) */
}
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
/* page { /* page {
background-color: #F5F5F5; background-color: #F5F5F5;
} }
*/ */
.p32 { .p32 {
padding: 20rpx !important; padding: 20rpx !important;
} }
.WenYiUpload { .WenYiUpload {
margin-top: 16rpx; margin-top: 16rpx;
} }
.te /deep/ .u-form-item__body__right__content__slot { .te /deep/ .u-form-item__body__right__content__slot {
flex-wrap: wrap !important; flex-wrap: wrap !important;
} }
image { image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.upload { .upload {
padding-top: 32rpx; padding-top: 32rpx;
} }
.data_itm_box { .data_itm_box {
padding: 32rpx 0rpx; padding: 32rpx 0rpx;
.chen_itm { .chen_itm {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: 16rpx; margin-bottom: 16rpx;
.right_img_box { .right_img_box {
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
margin-left: 16rpx; margin-left: 16rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
} }
margin-bottom: 16rpx; margin-bottom: 16rpx;
border: 1px solid transparent; border: 1px solid transparent;
padding: 0 32rpx; padding: 0 32rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
.data_itm { .data_itm {
.label_t { .label_t {
font-size: 28rpx; font-size: 28rpx;
color: $black; color: $black;
font-weight: 600; font-weight: 600;
} }
} }
.xie{
display: flex;justify-content: space-between; align-items: center;margin-bottom: 16rpx; .xie {
} display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16rpx;
}
.upload_box { .upload_box {
width: 166rpx; width: 166rpx;
height: 166rpx; height: 166rpx;
margin-left: 32rpx; margin-left: 32rpx;
position: relative; position: relative;
background-color: #F8F8F8; background-color: #F8F8F8;
margin-bottom: 64rpx; margin-bottom: 64rpx;
} }
} }
.operation { .operation {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 32rpx 32rpx 48rpx; padding: 32rpx 32rpx 48rpx;
position: fixed; position: fixed;
left: 0; left: 0;
bottom: 0; bottom: 0;
right: 0; right: 0;
background-color: #FFFFFF; background-color: #FFFFFF;
box-shadow: 0px -4px 10px 1px rgba(192, 192, 192, 0.12); box-shadow: 0px -4px 10px 1px rgba(192, 192, 192, 0.12);
z-index: 99; z-index: 99;
.next { .next {
width: calc(100% - 48rpx); width: calc(100% - 48rpx);
height: 80rpx; height: 80rpx;
line-height: 80rpx; line-height: 80rpx;
background-color: #99241B; background-color: #99241B;
color: #fff; color: #fff;
font-size: 32rpx; font-size: 32rpx;
font-weight: 600; font-weight: 600;
border: none; border: none;
button { button {
&::after { &::after {
border: none; border: none;
} }
} }
} }
} }
.zhan_w { .zhan_w {
height: 160rpx; height: 160rpx;
} }
</style> </style>

View File

@ -5,7 +5,8 @@
名称 名称
</view> </view>
<view class="form_right"> <view class="form_right">
<u--input placeholder="请输入名称" v-model="name" clearable border="none" inputAlign="right" style="color: #251B1D;"> <u--input placeholder="请输入名称" v-model="name" clearable border="none" inputAlign="right"
style="color: #251B1D;">
</u--input> </u--input>
</view> </view>
</view> </view>
@ -14,17 +15,16 @@
类型 类型
</view> </view>
<view class="form_right" @click="showType=true"> <view class="form_right" @click="showType=true">
<u--input placeholder="请选择类型" clearable border="none" inputAlign="right" style="color: #251B1D;" suffixIcon="map-fill" readonly v-model="type" disabledColor="#ffffff"> <u--input placeholder="请选择类型" clearable border="none" inputAlign="right" style="color: #251B1D;"
suffixIcon="arrow-right" readonly v-model="type" disabledColor="#ffffff">
</u--input> </u--input>
</view> </view>
</view> </view>
<u-popup :show="showType" @close="close" closeOnClickOverlay :round="5" <u-popup :show="showType" @close="close" closeOnClickOverlay :round="5" customStyle="padding: 16px;">
customStyle="padding: 16px;">
<u-radio-group @change="selectForm1" v-model="type" :borderBottom="true" placement="column" <u-radio-group @change="selectForm1" v-model="type" :borderBottom="true" placement="column"
iconPlacement="right"> iconPlacement="right">
<u-radio :customStyle="{marginBottom: '16px' }" v-for="(item, index) in radiolist1" :key="index" <u-radio :customStyle="{marginBottom: '16px' }" v-for="(item, index) in radiolist1" :key="index"
:label="item.label" labelSize="28rpx" labelColor="#231F1C" :name="item.label" :label="item.name" labelSize="28rpx" labelColor="#231F1C" :name="item.name" activeColor="#99241B ">
activeColor="#99241B ">
</u-radio> </u-radio>
<u-button class="custom-style" style="background-color:#99241B ; color: #FFFFFF; margin-top: 32rpx;" <u-button class="custom-style" style="background-color:#99241B ; color: #FFFFFF; margin-top: 32rpx;"
type="default" @click="showType=false">确认</u-button> type="default" @click="showType=false">确认</u-button>
@ -51,7 +51,8 @@
截止时间 截止时间
</view> </view>
<view class="form_right" @click="chooseTime(0)"> <view class="form_right" @click="chooseTime(0)">
<u--input placeholder="请选择" clearable border="none" inputAlign="right" style="color: #251B1D;" suffixIcon="map-fill" readonly v-model="eTime" disabledColor="#ffffff"> <u--input placeholder="请选择" clearable border="none" inputAlign="right" style="color: #251B1D;"
suffixIcon="calendar" readonly v-model="eTime" disabledColor="#ffffff">
</u--input> </u--input>
</view> </view>
</view> </view>
@ -60,12 +61,13 @@
活动时间 活动时间
</view> </view>
<view class="form_right" @click="chooseTime(1)"> <view class="form_right" @click="chooseTime(1)">
<u--input placeholder="请选择" clearable border="none" inputAlign="right" style="color: #251B1D;" suffixIcon="map-fill" readonly v-model="wTime" disabledColor="#ffffff"> <u--input placeholder="请选择" clearable border="none" inputAlign="right" style="color: #251B1D;"
suffixIcon="calendar" readonly v-model="wTime" disabledColor="#ffffff">
</u--input> </u--input>
</view> </view>
</view> </view>
<u-datetime-picker :show="showTime" v-model="timeValue" value-format="yyyy-MM-dd" mode="date" <u-datetime-picker :show="showTime" v-model="timeValue" value-format="yyyy-MM-dd" mode="date" @close="close"
@close="close" @cancel="close" @confirm="sureTime"></u-datetime-picker> @cancel="close" @confirm="sureTime"></u-datetime-picker>
<view class="gap"> <view class="gap">
接单设置 接单设置
</view> </view>
@ -74,13 +76,22 @@
可接单用户选择 可接单用户选择
</view> </view>
<view class="form_right" @click="showUser=true"> <view class="form_right" @click="showUser=true">
<u--input placeholder="请选择" clearable border="none" inputAlign="right" style="color: #251B1D;" suffixIcon="map-fill" readonly v-model="userType" disabledColor="#ffffff"> <u--input placeholder="请选择" clearable border="none" inputAlign="right" style="color: #251B1D;"
suffixIcon="arrow-right" readonly v-model="userType" disabledColor="#ffffff">
</u--input> </u--input>
</view> </view>
</view> </view>
<u-popup :show="showUser" @close="close" closeOnClickOverlay :round="5" <u-popup :show="showUser" @close="close" closeOnClickOverlay :round="5" customStyle="padding: 16px;">
customStyle="padding: 16px;"> <u-radio-group @change="selectForm2" v-model="userType" :borderBottom="true" placement="column"
<u-checkbox-group @change="selectForm2" v-model="radiovalue2" :borderBottom="true" placement="column" iconPlacement="right">
<u-radio :customStyle="{marginBottom: '16px' }" v-for="(item, index) in radiolist2" :key="index"
:label="item.label" labelSize="28rpx" labelColor="#231F1C" :name="item.label"
activeColor="#99241B ">
</u-radio>
<u-button class="custom-style" style="background-color:#99241B ; color: #FFFFFF; margin-top: 32rpx;"
type="default" @click="showUser=false">确认</u-button>
</u-radio-group>
<!-- <u-checkbox-group @change="selectForm2" v-model="radiovalue2" :borderBottom="true" placement="column"
iconPlacement="right"> iconPlacement="right">
<u-checkbox :customStyle="{marginBottom: '16px' }" v-for="(item, index) in radiolist2" :key="index" <u-checkbox :customStyle="{marginBottom: '16px' }" v-for="(item, index) in radiolist2" :key="index"
:label="item.label" labelSize="28rpx" labelColor="#231F1C" :name="item.label" :label="item.label" labelSize="28rpx" labelColor="#231F1C" :name="item.label"
@ -88,7 +99,7 @@
</u-checkbox> </u-checkbox>
<u-button class="custom-style" style="background-color:#99241B ; color: #FFFFFF; margin-top: 32rpx;" <u-button class="custom-style" style="background-color:#99241B ; color: #FFFFFF; margin-top: 32rpx;"
type="default" @click="showUser=false">确认</u-button> type="default" @click="showUser=false">确认</u-button>
</u-checkbox-group> </u-checkbox-group> -->
</u-popup> </u-popup>
<view class="form_line"> <view class="form_line">
<view class="form_left"> <view class="form_left">
@ -109,6 +120,12 @@
<view class="gap"> <view class="gap">
附件上传 附件上传
</view> </view>
<view class="gap" style="line-height: 30rpx;font-size: 28rpx;">
可上传图片(png/jpg/jpeg/bmp/gif/tif/tiff)或pdf
</view>
<view class="gap" style="line-height: 30rpx;font-size: 28rpx;">
(若有图片请先上传图片)
</view>
<u-upload class="upload" accept="file" width="172rpx" height="172rpx" :fileList="fileList3" <u-upload class="upload" accept="file" width="172rpx" height="172rpx" :fileList="fileList3"
@afterRead="afterRead" @delete="deletePic" name="3" multiple> @afterRead="afterRead" @delete="deletePic" name="3" multiple>
<image style="width: 172rpx;height: 172rpx;" src="../../static/improveData/jia.png"></image> <image style="width: 172rpx;height: 172rpx;" src="../../static/improveData/jia.png"></image>
@ -122,80 +139,96 @@
<script> <script>
import http from '../../request/interface.js' import http from '../../request/interface.js'
export default{ export default {
data(){ data() {
return{ return {
name:'', name: '',
typeId: '', typeId: '',
showType: false, showType: false,
type:'', type: '',
radiolist1: [ radiolist1: [],
{
label:'qwe',
id:'123',
},
{
label:'asd',
id:'124',
},
{
label:'zxc',
id:'125',
},
],
text1: '', text1: '',
text2: '', text2: '',
showTime:false, showTime: false,
timeTab: 0, timeTab: 0,
eTime:'', eTime: '',
wTime:'', wTime: '',
timeValue: Number(new Date()), timeValue: Number(new Date()),
showUser:false, showUser: false,
userType:'', userType: '',
radiovalue2: [], userTypeValue: '',
radiolist2: [ // radiovalue2: [],
{ radiolist2: [],
label:'qwe567',
id:'123',
},
{
label:'asd67',
id:'124',
},
{
label:'zxc67',
id:'125',
},
],
morePer: true, morePer: true,
perNumber: 0, perNumber: 1,
fileList3: [], fileList3: [],
} }
}, },
onShow() {
this.getTypeList()
this.getUserList()
},
methods: { methods: {
//
getTypeList() {
this.http.request('/hallType/list', {}, "GET").then(res => {
if (res.code == 200) {
this.radiolist1 = res.data.records
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
//
getUserList() {
this.http.request('/hall/yhlx', {}, "GET").then(res => {
if (res.code == 200) {
this.radiolist2 = res.data
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
close() { close() {
this.showType = false this.showType = false
this.showTime = false this.showTime = false
this.showUser = false this.showUser = false
}, },
selectForm1(form) { selectForm1(form) {
this.typeId = form let _this = this
this.radiolist1.forEach(function(item) {
if (item.name == form) {
_this.typeId = item.code
}
})
}, },
chooseTime(val){ chooseTime(val) {
this.showTime = true this.showTime = true
this.timeTab = val this.timeTab = val
}, },
sureTime(e) { sureTime(e) {
if(this.timeTab == 0){ if (this.timeTab == 0) {
this.eTime = uni.$u.timeFormat(e.value) this.eTime = uni.$u.timeFormat(e.value)
}else{ } else {
this.wTime = uni.$u.timeFormat(e.value) this.wTime = uni.$u.timeFormat(e.value)
} }
this.showTime = false this.showTime = false
}, },
selectForm2(form) { selectForm2(form) {
let data = form let _this = this
this.userType = data.join(',') this.radiolist2.forEach(function(item) {
if (item.label == form) {
_this.userTypeValue = item.value
}
})
// let data = form
// this.userType = data.join(',')
}, },
changeTrue(e) { changeTrue(e) {
console.log('change', e); console.log('change', e);
@ -240,12 +273,11 @@
user: 'test' user: 'test'
}, },
success: (res) => { success: (res) => {
console.log(res) if (JSON.parse(res.data).code == 200) {
if(JSON.parse(res.data).code == 200){
setTimeout(() => { setTimeout(() => {
resolve(JSON.parse(res.data).data.path) resolve(JSON.parse(res.data).data.path)
}, 1000) }, 1000)
}else{ } else {
uni.showToast({ uni.showToast({
title: JSON.parse(res.data).message, title: JSON.parse(res.data).message,
icon: "none", icon: "none",
@ -256,8 +288,33 @@
}); });
}) })
}, },
next(){ next() {
let image = []
this.fileList3.forEach(function(item) {
image.push(item.url)
})
let data = image.join(',')
this.http.request('/hall/addHall', {
activityTime: this.wTime,
content: this.text2,
deadline: this.eTime,
demand: this.text1,
isMultiple: this.morePer,
quantity: this.perNumber,
receiverType: this.userTypeValue,
title: this.name,
type: this.typeId,
enclosure: data
}, "POST").then(res => {
if (res.code == 200) {
uni.navigateBack()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
} }
} }
@ -265,7 +322,7 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.form_line{ .form_line {
width: 686rpx; width: 686rpx;
padding: 0 32rpx; padding: 0 32rpx;
display: flex; display: flex;
@ -275,12 +332,12 @@
height: 104rpx; height: 104rpx;
border-bottom: 1rpx solid #dadbde; border-bottom: 1rpx solid #dadbde;
.form_right{ .form_right {
width: 450rpx; width: 450rpx;
} }
} }
.form_box{ .form_box {
width: 686rpx; width: 686rpx;
padding: 0 32rpx; padding: 0 32rpx;
display: flex; display: flex;
@ -290,14 +347,13 @@
height: 104rpx; height: 104rpx;
} }
.text_box{ .text_box {
width: 686rpx; width: 686rpx;
padding: 0 32rpx; padding: 0 32rpx;
} }
.gap { .gap {
color: #AFADB0; color: #AFADB0;
height: 50rpx;
background: #F5F5F5; background: #F5F5F5;
opacity: 1; opacity: 1;
padding: 10rpx 32rpx; padding: 10rpx 32rpx;
@ -319,5 +375,4 @@
font-size: 36rpx; font-size: 36rpx;
font-weight: 600; font-weight: 600;
} }
</style> </style>

View File

@ -1,154 +1,177 @@
<template> <template>
<view class="page"> <view class="">
<view class="nav"> <view class="">
<view class="list" v-for="(item,index) in list" :key="item.text" @click="onNav(item.id,index)"> <u-loading-page :loading="load"></u-loading-page>
<view :class="['text',action == index?'on':'']">{{item.text}}</view>
</view>
</view> </view>
<view class="main" v-if="isShow == 1"> <view class="page">
<view class="mainList" v-for="item in mainList" :key="item.img"> <view class="nav">
<view class="mainListImg"> <view class="list" v-for="(item,index) in list" :key="index" @click="onNav(item.code,index)">
<img class='img' :src="item.img" alt=""> <view :class="['text',action == index?'on':'']">{{item.text}}</view>
</view>
<view class="text">
<view class="text1">象山县打造公益文化特色团队</view>
<view class="text2">这里是需求清单这里是需求清单这里是需求清单这里是需求清单这里是需求清单这里是需求清单这里是需求清单这里是需</view>
<view class="text3">
<img class='mainListTime' src="../../static/orderHall/mainListTime.png" alt="">
<view class="time">截止时间2022/06/19</view>
</view>
</view> </view>
</view> </view>
</view> <view class="addIcon" @click="toAddOrder">
<view class="main" v-if="isShow == 2"> <image src="../../static/orderHall/addOrder.png"></image>
<view class="mainList" v-for="item in mainList" :key="item.img">
<view class="mainListImg">
<img class='img' :src="item.img" alt="">
</view>
<view class="text">
<view class="text1">象山县队</view>
<view class="text2">这里是需求清单这里是需求清单这里是需求清单这里是需求清单这里是需求清单这里是需求清单这里是需求清单这里是需</view>
<view class="text3">
<img class='mainListTime' src="../../static/orderHall/mainListTime.png" alt="">
<view class="time">截止时间2022/06/19</view>
</view>
</view>
</view> </view>
</view> <view class="main" v-if="mainList.length > 0">
<view class="main" v-if="isShow == 3"> <view class="mainList" v-for="(item,i) in mainList" :key="i">
<view class="mainList" v-for="item in mainList" :key="item.img"> <view class="mainListImg" @click="toDetail(item.id)">
<view class="mainListImg"> <img class='img' :src="item.cover" alt="">
<img class='img' :src="item.img" alt=""> </view>
</view> <view class="text">
<view class="text"> <view class="text1">{{item.title}}</view>
<view class="text1">象山县333333队</view> <view class="text2">{{item.content}}</view>
<view class="text2">这里是需求清单这里是需求清单这里是需求清单这里是需求清单这里是需求清单这里是需求清单这里是需求清单这里是需</view> <view class="text3">
<view class="text3"> <img class='mainListTime' src="../../static/orderHall/mainListTime.png" alt="">
<img class='mainListTime' src="../../static/orderHall/mainListTime.png" alt=""> <view class="time">截止时间{{item.deadline}}</view>
<view class="time">截止时间2022/06/19</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> <view v-else>
<view class="main" v-if="isShow == 4"> <u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" >
<view class="mainList" v-for="item in mainList" :key="item.img"> </u-empty>
<view class="mainListImg">
<img class='img' :src="item.img" alt="">
</view>
<view class="text">
<view class="text1">象山县444444444队</view>
<view class="text2">这里是需求清单这里是需求清单这里是需求清单这里是需求清单这里是需求清单这里是需求清单这里是需求清单这里是需</view>
<view class="text3">
<img class='mainListTime' src="../../static/orderHall/mainListTime.png" alt="">
<view class="time">截止时间2022/06/19</view>
</view>
</view>
</view>
</view>
<view class="main" v-if="isShow == 5">
<view class="mainList" v-for="item in mainList" :key="item.img">
<view class="mainListImg">
<img class='img' :src="item.img" alt="">
</view>
<view class="text">
<view class="text1">象山县555555队</view>
<view class="text2">这里是需求清单这里是需求清单这里是需求清单这里是需求清单这里是需求清单这里是需求清单这里是需求清单这里是需</view>
<view class="text3">
<img class='mainListTime' src="../../static/orderHall/mainListTime.png" alt="">
<view class="time">截止时间2022/06/19</view>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default{ export default {
data(){ data() {
return{ return {
isShow: '1', load:true,
list:[ list: [{
{ text: '全部',
text:'全部', code: ''
id: 1
}, },
{ {
text:'订购', text: '订购',
id: 2 code: 'order'
}, },
{ {
text:'公益', text: '公益',
id: 3 code: 'gy'
}, },
{ {
text:'演出', text: '演出',
id: 4 code: 'show'
}, },
{ {
text:'其他', text: '其他',
id: 5 code: 'other'
} }
], ],
mainList:[ mainList: [],
{ action: 0,
img:'../../static/RewardWork/fightVirus.png' pages: 1,
}, size: 20,
{ type: '',
img:'../../static/RewardWork/fightVirus.png'
}
],
action:0
} }
}, },
methods:{ //
onNav(val,index){ onPullDownRefresh() {
this.pages = 1
this.mainList = []
this.getData()
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
//
onReachBottom() {
this.pages++
this.getData();
},
onShow() {
this.getData()
},
methods: {
getData() {
let _this = this
this.http.request('/hall/list', {
page: this.pages,
size: this.size,
type: this.type,
}, "GET").then(res => {
if (res.code == 200) {
if(res.data.records.length > 0){
res.data.records.forEach(function(item){
if (item.enclosure) {
let fileArr = item.enclosure.split(',')
let gs = fileArr[0].substr(fileArr[0].lastIndexOf(".") + 1)
if (gs == 'jpg' || gs == 'jpeg' || gs == 'png' || gs == 'bmp' || gs == 'gif' || gs == 'tif' || gs == 'tiff') {
item.enclosure = fileArr[0]
}
else if (gs == 'pdf') {
item.enclosure = '../../static/fileImg/pdfS.png'
}
}
_this.mainList.push(item)
})
}else{
this.pages--
}
this.load = false
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
onNav(val, index) {
this.action = index this.action = index
this.isShow = val this.type = val
this.pages = 1
this.mainList = []
this.getData()
},
toDetail(val){
uni.navigateTo({
url: `/pages/orderHall/orderHallDetails?id=` + val
})
},
toAddOrder(){
uni.navigateTo({
url: `/pages/orderHall/addOrder`
})
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.on{ page{
background-color: #f8f8f8;
}
image{
width: 100%;
height: 100%;
}
.on {
font-weight: 600; font-weight: 600;
} }
.page{
.nav{ .page {
.nav {
display: flex; display: flex;
.list{
.list {
width: 20%; width: 20%;
height: 76rpx; height: 76rpx;
background: #FFFFFF; background: #FFFFFF;
.text{
.text {
font-size: 28rpx; font-size: 28rpx;
font-weight: 400; font-weight: 400;
color: #251B1D; color: #251B1D;
line-height: 70rpx; line-height: 70rpx;
text-align: center; text-align: center;
position: relative; position: relative;
&.on::after{
&.on::after {
content: ''; content: '';
position: absolute; position: absolute;
height: 6rpx; height: 6rpx;
@ -161,44 +184,54 @@
} }
} }
} }
.main{
.main {
padding: 32rpx; padding: 32rpx;
background-color: #F4F5F7; // background-color: #F4F5F7;
.mainList{
.mainList {
margin-bottom: 32rpx; margin-bottom: 32rpx;
border-radius: 16rpx; border-radius: 16rpx;
overflow: hidden; overflow: hidden;
.mainListImg{
.mainListImg {
height: 400rpx; height: 400rpx;
.img{
.img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
.text{
.text {
padding: 32rpx; padding: 32rpx;
background-color: #FFF; background-color: #FFF;
.text1{
.text1 {
font-size: 28rpx; font-size: 28rpx;
font-weight: 600; font-weight: 600;
color: #251B1D; color: #251B1D;
margin-bottom: 5rpx; margin-bottom: 5rpx;
} }
.text2{
.text2 {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #989898; color: #989898;
} }
.text3{
.text3 {
display: flex; display: flex;
margin-top: 16rpx; margin-top: 16rpx;
.mainListTime{
.mainListTime {
width: 26rpx; width: 26rpx;
height: 26rpx; height: 26rpx;
margin-top: 4rpx; margin-top: 4rpx;
margin-right: 8rpx; margin-right: 8rpx;
} }
.time{
.time {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #989898; color: #989898;
@ -207,5 +240,14 @@
} }
} }
} }
.addIcon{
position: fixed;
right: 24rpx;
bottom: 242rpx;
width: 104rpx;
height: 104rpx;
border-radius: 50%;
}
} }
</style> </style>

View File

@ -1,172 +1,315 @@
<template> <template>
<view class="page"> <view class="">
<view class="return" @click="back"> <view class="">
<image src="../../static/orderLeftArrow.png" mode="scaleToFill"></image> <u-loading-page :loading="load"></u-loading-page>
</view> </view>
<view class="pageImg"> <view class="page">
<img class='img' src="../../static/RewardWork/fightVirus.png" alt=""> <view class="return" @click="back">
</view> <image src="../../static/orderLeftArrow.png" mode="scaleToFill"></image>
<view class="main"> </view>
<view class="mainTitle">善行象山走进晓塘文艺演出招募</view> <view class="pageImg">
<view class="textList"> <u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="e => currentNum = e.current"
<view class="type"> indicatorStyle="right: 20px" height='440rpx'>
<img class='textImg' src="../../static/orderHall/text.png" alt=""> <view slot="indicator" class="indicator-num">
<view class="text1">需求清单</view> <text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text>
</view>
</u-swiper>
</view>
<view class="main">
<view class="mainTitle">{{data.title}}</view>
<view class="textList">
<view class="type">
<img class='textImg' src="../../static/orderHall/text.png" alt="">
<view class="text1">需求清单</view>
</view>
<view class="text2">{{data.demand}}</view>
</view> </view>
<view class="text2">主持人2位歌手8位舞者5位志愿者10位</view> <view class="textList">
</view> <view class="type">
<view class="textList"> <img class='textImg' src="../../static/orderHall/text.png" alt="">
<view class="type"> <view class="text1">具体内容</view>
<img class='textImg' src="../../static/orderHall/text.png" alt=""> </view>
<view class="text1">具体内容</view> <view class="text2">
{{data.content}}
</view>
</view>
<view class="file_box" v-for="(item,index) in list2" :key="index" @click="downLoad(item.url)">
<view class="file_box_left">
<image :src="item.img" class="file_box_left_img"></image>
</view>
<view class="file_box_right">
<view class="file_box_name">
{{item.name}}
</view>
</view>
</view> </view>
<view class="text2">为推动社会慈善事业发展弘扬行善美德关爱弱势群体为主题由象山县慈善总会主办县义工分会等承办晓塘乡总工会晓塘乡团委晓塘乡妇联协办的善行象山走进晓塘文艺演出活动招募演出人员与志愿者</view>
</view> </view>
<view class="pdf"> <view class="line"></view>
<img class='pdfImg' src="../../static/fileImg/pdfS.png" alt=""> <view class="form">
<view class="text3">演出节目表与日程安排.pdf</view> <view class="formList">
<view class="left">类型</view>
<view class="right">{{data.typeName}}</view>
</view>
<view class="formList">
<view class="left">可接单人数</view>
<view class="right"><text style="color: #99241B;">{{data.jdrs}}</text>/{{data.quantity}}</view>
</view>
<view class="formList">
<view class="left">截止时间</view>
<view class="right">{{data.deadline}}</view>
</view>
<view class="formList">
<view class="left">活动时间</view>
<view class="right">{{data.activityTime}}</view>
</view>
</view> </view>
</view> <view class="orderBtn" v-if="data.isBaoming">
<view class="line"></view> <view class="btnQ" @click="baoQ">取消接单</view>
<view class="form">
<view class="formList">
<view class="left">类型</view>
<view class="right">演出</view>
</view> </view>
<view class="formList"> <view class="orderBtn" v-else>
<view class="left">可接单人数</view> <view class="btn" @click="bao">申请接单</view>
<view class="right"><text style="color: #99241B;">1</text>/5</view>
</view> </view>
<view class="formList">
<view class="left">截止时间</view>
<view class="right">2022-06-02</view>
</view>
<view class="formList">
<view class="left">结束时间</view>
<view class="right">2022-06-27</view>
</view>
</view>
<view class="orderBtn">
<view class="btn">申请接单</view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default{ export default {
data(){ data() {
return{ return {
load: true,
id: '',
data: {},
list: [],
list2: [],
currentNum: 0,
} }
}, },
methods:{ onLoad(op) {
this.id = op.id
},
onShow() {
this.getData()
},
methods: {
getData() {
let _this = this
this.http.request('/hall/details', {
id: this.id,
}, "GET").then(res => {
if (res.code == 200) {
//
if (res.data.enclosure) {
let fileArr = res.data.enclosure.split(',')
fileArr.forEach(function(item) {
let gs = item.substr(item.lastIndexOf(".") + 1)
if (gs == 'jpg' || gs == 'jpeg' || gs == 'png' || gs == 'bmp' || gs ==
'gif' || gs == 'tif' || gs == 'tiff') {
_this.list.push(item)
} else if (gs == 'pdf') {
_this.list2.push({
name: res.data.name + '.' + gs,
img: '../../static/fileImg/pdfS.png',
url: item,
})
}
})
}
this.data = res.data
this.load = false
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
back() { back() {
uni.navigateBack() uni.navigateBack()
},
//
downLoad(val) {
this.contractUrl = val
uni.navigateTo({
url: "/pages/ArtWorks/webView?url=" + this.contractUrl
})
},
bao() {
this.http.request('/hallUser/singUp?hallId='+this.id, {}, "POST").then(res => {
if (res.code == 200) {
this.getData()
this.load = true
this.list = []
this.list2 = []
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
baoQ(){
this.http.request('/hallUser/qxSingUp?hallId='+this.id, {}, "POST").then(res => {
if (res.code == 200) {
this.getData()
this.load = true
this.list = []
this.list2 = []
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page{ .page {
.return { .return {
position: fixed; position: fixed;
left: 24rpx; left: 24rpx;
top: 110rpx; top: 110rpx;
z-index: 10;
image { image {
width: 48rpx; width: 48rpx;
height: 48rpx; height: 48rpx;
} }
} }
.pageImg{
.pageImg {
height: 440rpx; height: 440rpx;
.img{
.img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
.main{
.main {
padding: 32rpx; padding: 32rpx;
.mainTitle{
.mainTitle {
font-size: 36rpx; font-size: 36rpx;
font-weight: 600; font-weight: 600;
color: #251B1D; color: #251B1D;
margin-bottom: 28rpx; margin-bottom: 28rpx;
} }
.textList{
.textList {
margin-bottom: 24rpx; margin-bottom: 24rpx;
.type{
.type {
display: flex; display: flex;
height: 48rpx; height: 48rpx;
line-height: 48rpx; line-height: 48rpx;
.textImg{
.textImg {
width: 28rpx; width: 28rpx;
height: 28rpx; height: 28rpx;
margin-top: 10rpx; margin-top: 10rpx;
margin-right: 8rpx; margin-right: 8rpx;
} }
.text1{
.text1 {
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
color: #32333C; color: #32333C;
} }
} }
.text2{
.text2 {
font-size: 28rpx; font-size: 28rpx;
font-weight: 400; font-weight: 400;
color: #32333C; color: #32333C;
line-height: 48rpx; line-height: 48rpx;
} }
} }
.pdf{
display: flex;
padding: 24rpx 30rpx;
background: #F4F5F7;
border-radius: 12rpx;
.pdfImg{
width: 80rpx;
height: 80rpx;
margin-right: 24rpx;
}
.text3{
.file_box {
width: 92%;
height: 64px;
margin: 10px 4%;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #251B1D;
background: #F4F5F7;
border-radius: 6px;
overflow: hidden;
.file_box_left {
width: 40px;
height: 40px;
margin-top: 12px;
margin-left: 12px;
float: left;
.file_box_left_img {
width: 40px;
height: 40px;
}
}
.file_box_right {
margin-left: 20px;
float: left;
.file_box_name {
height: 64px;
line-height: 64px;
font-size: 16px;
font-weight: 600;
color: #251B1D;
}
} }
} }
} }
.line{
.line {
height: 16rpx; height: 16rpx;
background: #F4F5F7; background: #F4F5F7;
} }
.form{
.form {
padding: 32rpx 32rpx 24rpx; padding: 32rpx 32rpx 24rpx;
margin-bottom: 132rpx; margin-bottom: 132rpx;
.formList{
.formList {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
height: 40rpx; height: 40rpx;
line-height: 40rpx; line-height: 40rpx;
margin-bottom: 40rpx; margin-bottom: 40rpx;
.left{
.left {
font-size: 28rpx; font-size: 28rpx;
font-weight: 400; font-weight: 400;
color: #AFADB0; color: #AFADB0;
} }
.right{
.right {
font-size: 28rpx; font-size: 28rpx;
font-weight: 400; font-weight: 400;
color: #251B1D; color: #251B1D;
} }
} }
} }
.orderBtn{
.orderBtn {
width: 100%; width: 100%;
height: 132rpx; height: 132rpx;
background-color: #FFF; background-color: #FFF;
position: fixed; position: fixed;
left: 0; left: 0;
bottom: 0; bottom: 0;
.btn{
.btn {
width: calc(100% - 64rpx); width: calc(100% - 64rpx);
height: 96rpx; height: 96rpx;
line-height: 96rpx; line-height: 96rpx;
@ -178,6 +321,18 @@
color: #FFFFFF; color: #FFFFFF;
margin: auto; margin: auto;
} }
.btnQ {
width: calc(100% - 64rpx);
height: 96rpx;
line-height: 96rpx;
text-align: center;
background: #F9F2F2;
border-radius: 8rpx;
font-size: 32rpx;
font-weight: 600;
color: #99241B;
margin: auto;
}
} }
} }
</style> </style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB