|
|
@ -5,21 +5,23 @@ |
|
|
|
color="#fff" /> |
|
|
|
|
|
|
|
<!-- 顶部图片区域 --> |
|
|
|
<view class="banner" v-if="!identity"> |
|
|
|
<view class="banner" v-if="!identity">s |
|
|
|
<image src="/static/image/红烧肉.webp" mode="aspectFill" class="banner-image"></image> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="content-area"> |
|
|
|
<uv-alert v-if="status != '-1'" fontSize="28rpx" :title="toastTitle" :show-icon="true" closable :type="toastType" |
|
|
|
:description="remark" /> |
|
|
|
|
|
|
|
<!-- 送餐点照片上传区域 --> |
|
|
|
<view class="section-title">送餐点照片</view> |
|
|
|
<view class="section-title">送餐点照片 </view> |
|
|
|
<view class="section-block"> |
|
|
|
<view class="upload-container"> |
|
|
|
<view class="upload-area" @tap="chooseImage" v-if="!formData.spotImage"> |
|
|
|
<view class="plus">+</view> |
|
|
|
<view class="upload-text">添加图片</view> |
|
|
|
</view> |
|
|
|
<image v-else :src="formData.spotImage" mode="aspectFill" class="upload-area" |
|
|
|
@tap="chooseImage" /> |
|
|
|
<image v-else :src="formData.spotImage" mode="aspectFill" class="upload-area" @tap="chooseImage" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
@ -46,8 +48,9 @@ |
|
|
|
<view class="form-item region-item" @click="regionSelect"> |
|
|
|
<text class="label">所在地区</text> |
|
|
|
<text>{{ formData.area }}</text> |
|
|
|
<uv-icon name="arrow-right" color="#000" style="margin-left: 2rpx;"/> |
|
|
|
<uv-icon name="arrow-right" color="#000" style="margin-left: 2rpx;" /> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="address-item"> |
|
|
|
<text class="label">详细地址</text> |
|
|
|
<view class="address-box"> |
|
|
@ -57,12 +60,8 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 提交按钮 --> |
|
|
|
<view v-if="!this.beModify" class="submit-btn" @tap="submitApplication"> |
|
|
|
{{ !identity ? '提交申请' : '提交保存' }} |
|
|
|
</view> |
|
|
|
<view v-else class="submit-btn-container"> |
|
|
|
<view class="submit-btn-modify" @tap="submitApplication">修改</view> |
|
|
|
<view class="submit-btn-save" @tap="submitApplication">保存</view> |
|
|
|
<view class="submit-btn" v-if="status != '1' || identity != 0" @tap="submitApplication"> |
|
|
|
{{ buttonText }} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -91,20 +90,28 @@ export default { |
|
|
|
longitude: '' // 经度 |
|
|
|
}, |
|
|
|
identity: uni.getStorageSync('identity'), |
|
|
|
beModify: false // 为团员并且可以修改的模式 |
|
|
|
status: '-1', // 团长申请状态 -1 未提交 0 审核中 1 审核通过 2 审核不通过 |
|
|
|
remark: '' // 审核不通过原因 |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 选择图片 |
|
|
|
chooseImage() { |
|
|
|
uni.chooseImage({ |
|
|
|
count: 1, |
|
|
|
sizeType: ['compressed'], |
|
|
|
sourceType: ['album', 'camera'], |
|
|
|
this.$Oss.ossUploadImage({ |
|
|
|
key: '', |
|
|
|
folder: '', |
|
|
|
compressed: true, |
|
|
|
success: (res) => { |
|
|
|
// 这里可以添加图片上传到服务器的逻辑 |
|
|
|
// 暂时只展示选择的图片 |
|
|
|
this.formData.spotImage = res.tempFilePaths[0] |
|
|
|
console.log('上传成功',res); |
|
|
|
this.formData.spotImage = '' |
|
|
|
this.formData.spotImage = res |
|
|
|
}, |
|
|
|
fail: (res) => { |
|
|
|
console.log('上传失败',res); |
|
|
|
uni.showToast({ |
|
|
|
title: `上传失败,${res.errMsg}`, |
|
|
|
icon: 'error' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
@ -114,6 +121,8 @@ export default { |
|
|
|
// this.formData.area = e.detail.value[1] + e.detail.value[2] |
|
|
|
position.selectAddress(0, 0, res => { |
|
|
|
delete res.errMsg |
|
|
|
res.area = res.name |
|
|
|
delete res.name |
|
|
|
this.formData = { |
|
|
|
...this.formData, |
|
|
|
...res |
|
|
@ -127,28 +136,28 @@ export default { |
|
|
|
if (!this.formData.spotImage) { |
|
|
|
return uni.showToast({ |
|
|
|
title: '请上传送餐点照片', |
|
|
|
icon: 'none' |
|
|
|
icon: 'error' |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
if (!this.formData.spotName) { |
|
|
|
return uni.showToast({ |
|
|
|
title: '请输入送餐点名称', |
|
|
|
icon: 'none' |
|
|
|
icon: 'error' |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
if (!this.formData.name) { |
|
|
|
return uni.showToast({ |
|
|
|
title: '请输入您的姓名', |
|
|
|
icon: 'none' |
|
|
|
icon: 'error' |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
if (!this.formData.phone) { |
|
|
|
return uni.showToast({ |
|
|
|
title: '请输入联系手机号', |
|
|
|
icon: 'none' |
|
|
|
icon: 'error' |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
@ -162,14 +171,14 @@ export default { |
|
|
|
if (!this.formData.area) { |
|
|
|
return uni.showToast({ |
|
|
|
title: '请选择所在地区', |
|
|
|
icon: 'none' |
|
|
|
icon: 'error' |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
if (!this.formData.address) { |
|
|
|
return uni.showToast({ |
|
|
|
title: '请输入详细地址', |
|
|
|
icon: 'none' |
|
|
|
icon: 'error' |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
@ -178,6 +187,8 @@ export default { |
|
|
|
title: '提交中...' |
|
|
|
}) |
|
|
|
|
|
|
|
console.log(this.formData); |
|
|
|
|
|
|
|
// 如果是团员 提交申请 |
|
|
|
this.$api('updateLeaderInfo', { |
|
|
|
...this.formData, |
|
|
@ -201,7 +212,7 @@ export default { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 获取初始值进行赋值 |
|
|
|
// 获取初始值进行赋值 赋值关键部分 |
|
|
|
assign(data) { |
|
|
|
this.formData.address = data.address |
|
|
|
this.formData.area = data.area |
|
|
@ -210,34 +221,52 @@ export default { |
|
|
|
this.formData.spotImage = data.spotImage |
|
|
|
this.formData.spotName = data.spotName |
|
|
|
this.formData.id = data.id |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
buttonText() { |
|
|
|
switch (this.status) { |
|
|
|
case '-1': |
|
|
|
return '提交申请' |
|
|
|
case '0': |
|
|
|
return '修改申请' |
|
|
|
case '1': |
|
|
|
return '修改信息' |
|
|
|
case '2': |
|
|
|
return '重新申请' |
|
|
|
default: |
|
|
|
return '提交申请' |
|
|
|
} |
|
|
|
}, |
|
|
|
toastTitle() { |
|
|
|
if (this.status == '2') { |
|
|
|
return '审核不通过!' |
|
|
|
} else if (this.status == '1') { |
|
|
|
return '审核已通过!请前往个人页面右上角切换团长身份' |
|
|
|
} else if (this.status == '0') { |
|
|
|
return '审核中...' |
|
|
|
} |
|
|
|
}, |
|
|
|
toastType() { |
|
|
|
if (this.status == '2') { |
|
|
|
return 'error' |
|
|
|
} else if (this.status == '1') { |
|
|
|
return 'success' |
|
|
|
} else if (this.status == '0') { |
|
|
|
return 'warning' |
|
|
|
} else { |
|
|
|
return 'info' |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
if (!this.identity) { |
|
|
|
this.$api('queryLeaderInfo', {}, res => { |
|
|
|
if (res.code == 200){ |
|
|
|
this.assign(res.result) |
|
|
|
if (this.formData.remark){ |
|
|
|
if (this.formData.status != 0){ |
|
|
|
uni.showModal({ |
|
|
|
title: `${ this.formData.status == 1 ? '审核通过' : '审核不通过' }`, |
|
|
|
content: this.formData.remark, |
|
|
|
showCancel: false, |
|
|
|
confirmColor: '#019245', |
|
|
|
}) |
|
|
|
}else { |
|
|
|
uni.showModal({ |
|
|
|
title: `还在审核中 请稍等`, |
|
|
|
content: this.formData.remark, |
|
|
|
showCancel: false, |
|
|
|
confirmColor: '#019245', |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
this.$api('queryLeaderInfo', { }, res => { |
|
|
|
if (res.code == 200){ |
|
|
|
this.assign(res.result) |
|
|
|
this.status = res.result.status |
|
|
|
this.remark = res.result.remark |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|