From 1bb473993aaae1adc1a9dd368463ffb0f550b5b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=88=B1=7E=E6=B5=B7=7E=E7=88=B1=E6=B5=B7=E7=88=B1?= =?UTF-8?q?=E6=B5=B7=7E=E5=8F=B3?= <1828712314@qq.com> Date: Mon, 24 Feb 2025 16:24:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dpackage.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 12 +- components/cs-bottom-wrapper/index.vue | 4 +- config.js | 6 +- pages.json | 48 ++- static/scss/global.scss | 1 + sub/invite/addEnterprise.vue | 392 +++++++++++++++++++++++++ sub/invite/enterpriseIntroduce.vue | 79 +++++ sub/invite/enterpriseTags.vue | 177 +++++++++++ sub/invite/index.vue | 55 ++++ sub/invite/prove.vue | 369 +++++++++++++++++++++++ sub/owner/invite.vue | 4 +- sub/task/enforce.vue | 20 +- 12 files changed, 1142 insertions(+), 25 deletions(-) create mode 100644 sub/invite/addEnterprise.vue create mode 100644 sub/invite/enterpriseIntroduce.vue create mode 100644 sub/invite/enterpriseTags.vue create mode 100644 sub/invite/index.vue create mode 100644 sub/invite/prove.vue diff --git a/App.vue b/App.vue index b99c9a4..a4debdc 100644 --- a/App.vue +++ b/App.vue @@ -99,12 +99,12 @@ export default { }, handlerNavigateTo(user) { // 邀请企业 - if (this.invateId) { - uni.navigateTo({ - url: `/sub/enterprise/edit?invateId=${this.invateId}` - }) - return - } + // if (this.invateId) { + // uni.navigateTo({ + // url: `/sub/enterprise/edit?invateId=${this.invateId}` + // }) + // return + // } // 审核中 if (user.audit == 1) { diff --git a/components/cs-bottom-wrapper/index.vue b/components/cs-bottom-wrapper/index.vue index 7461156..5ecdfeb 100644 --- a/components/cs-bottom-wrapper/index.vue +++ b/components/cs-bottom-wrapper/index.vue @@ -26,8 +26,10 @@ export default { left: 0; width: 100%; background-color: #fff; + z-index: 99; + border-top: 1px solid #f1f1f4; .safe { - height: 25px; + height: 20px; } } </style> diff --git a/config.js b/config.js index 075a612..2c2a87c 100644 --- a/config.js +++ b/config.js @@ -1,8 +1,8 @@ // 应用全局配置 module.exports = { - baseUrl: 'http://188.188.3.166:48080', - //baseUrl: 'https://hb.jzce.com', - //baseUrl: 'http://188.188.3.232:48080', + // baseUrl: 'http://188.188.3.166:48080', + // baseUrl: 'https://hb.jzce.com', + baseUrl: 'http://188.188.3.232:48080', baseApi: '/admin-api', imgUrl: 'https://hb.jzce.com', // 应用信息 diff --git a/pages.json b/pages.json index 0888034..c97e3a6 100644 --- a/pages.json +++ b/pages.json @@ -82,7 +82,7 @@ "style": { "navigationBarTitleText": "政策法规", "usingComponents": { - "van-search":"/wxcomponents/vant/search/index" + "van-search": "/wxcomponents/vant/search/index" }, "componentPlaceholder": { "u-modal": "view" @@ -93,8 +93,8 @@ "path": "owner/policy-detail", "style": { "navigationBarTitleText": "政策法规", - "usingComponents": {}, - "componentPlaceholder": {} + "usingComponents": {}, + "componentPlaceholder": {} } }, { @@ -105,7 +105,8 @@ }, { "path": "common/waiting", "style": { - "navigationBarTitleText": "" + "navigationBarTitleText": "", + "navigationStyle": "custom" } }, { "path": "enterprise/detail", @@ -189,6 +190,44 @@ "onReachBottonDistance": 50, "enablePullDownRefresh": true } + }, + { + "path": "invite/index", + "style": { + "navigationBarTitleText": "我的企业", + "componentPlaceholder": { + "u-modal": "view", + "uni-easyinput": "view" + } + } + }, + { + "path": "invite/addEnterprise", + "style": { + "navigationBarTitleText": "新增企业", + "componentPlaceholder": {} + } + }, + { + "path": "invite/enterpriseIntroduce", + "style": { + "navigationBarTitleText": "企业简介", + "componentPlaceholder": { + "uni-easyinput": "view" + } + } + }, + { + "path": "invite/enterpriseTags", + "style": { + "navigationBarTitleText": "环保标签" + } + }, + { + "path": "invite/prove", + "style": { + "navigationBarTitleText": "" + } } ] }], @@ -215,5 +254,6 @@ "navigationBarTitleText": "智慧生态", "navigationBarBackgroundColor": "#FFF", "backgroundColor": "#FFF" + } } \ No newline at end of file diff --git a/static/scss/global.scss b/static/scss/global.scss index 68a9905..583ae37 100644 --- a/static/scss/global.scss +++ b/static/scss/global.scss @@ -2,6 +2,7 @@ page { background-color: #f9f9f9; position: relative; color: #071437; + overflow: hidden; } button { diff --git a/sub/invite/addEnterprise.vue b/sub/invite/addEnterprise.vue new file mode 100644 index 0000000..f5c9ec0 --- /dev/null +++ b/sub/invite/addEnterprise.vue @@ -0,0 +1,392 @@ +<template> + <view class="view"> + <view class="block"> + <view style=""> + <text style="color: #f8285a; margin-right: 4px">*</text> + 企业名称 + </view> + <view class="value"> + <input + class="input-value" + type="text" + placeholder-class="txt" + placeholder="请输入企业名称" + v-model="form.enterpriseName" + @blur="proofName" + /> + <u-icon name="arrow-right"></u-icon> + </view> + </view> + + <view class="block"> + <view style=""> + <text style="color: #f8285a; margin-right: 4px">*</text> + 企业地址 + </view> + <view class="value" @tap="chooseAddress"> + <input + class="input-value" + type="text" + placeholder-class="txt" + placeholder="请选择企业地址" + v-model="form.address" + disabled + /> + <u-icon name="map"></u-icon> + </view> + </view> + + <view class="block"> + <view style=""> + <text style="color: #f8285a; margin-right: 4px">*</text> + 企业介绍 + </view> + <view class="value" @tap="goIntruduce"> + <view class="input-textarea" v-if="form.introduce"> + {{ form.introduce }} + </view> + <view class="input-textarea" style="color: #808080" v-else> + 请输入企业介绍 + </view> + <u-icon name="arrow-right"></u-icon> + </view> + </view> + + <view class="upload-wrapper"> + <view + class="wd-flex" + style=" + justify-content: space-between; + align-items: center; + width: 100%; + " + > + <view style=""> + <text style="color: #f8285a; margin-right: 4px">*</text> + 企业照片 + </view> + <view style="color: #808080">最多可传3张</view> + </view> + <u-upload + :fileList="form.photo" + @afterRead="addEnterprisePhoto" + @delete="delEnterprisePhoto" + multiple + :maxCount="3" + width="101" + height="101" + ></u-upload> + </view> + + <view class="block"> + <view style=""> + <text style="color: #f8285a; margin-right: 4px">*</text> + 企业标签 + </view> + <view class="value" @tap="goTags"> + <view class="input-textarea" v-if="form.introduce"> + {{ form.tags }} + </view> + <view class="input-textarea" style="color: #808080" v-else> + 请选择企业标签 + </view> + <u-icon name="arrow-right"></u-icon> + </view> + </view> + + <view class="block"> + <view style=""> + <text style="color: #f8285a; margin-right: 4px">*</text> + 企业负责人 + </view> + <view class="value"> + <input + class="input-value" + type="text" + placeholder-class="txt" + placeholder="请输入企业负责人" + v-model="form.contactName" + /> + <u-icon name="arrow-right"></u-icon> + </view> + </view> + + <view class="block"> + <view style=""> + <text style="color: #f8285a; margin-right: 4px">*</text> + 负责人电话 + </view> + <view class="value"> + <input + class="input-value" + type="text" + placeholder-class="txt" + placeholder="请输入负责人电话" + v-model="form.environmentalContactPhone" + @blur="proofName" + /> + <u-icon name="arrow-right"></u-icon> + </view> + </view> + + <view class="upload-wrapper"> + <view + class="wd-flex" + style=" + justify-content: space-between; + align-items: center; + width: 100%; + " + > + <view style=""> + <text style="color: #f8285a; margin-right: 4px">*</text> + 相关资质 + </view> + <view + class="wd-flex" + style="color: #17c653; gap: 4px; align-items: center" + @tap="addProve" + > + <u-icon name="plus-circle" color="#17C653" size="14"></u-icon> + <text style="line-height: 1rem">新增资质</text> + </view> + <view + class="wd-flex" + style="justify-content: space-between" + v-for="(p, index) in prove" + :key="index" + v-if="prove.length > 0" + > + <image + src="@/static/images/enterprise/zz.png" + style="width: 90px; height: 70px" + mode="widthFix" + ></image> + <view + style="flex: 1; justify-content: space-between" + class="wd-flex wd-flex-col" + > + <view class="wd-flex" style="gap: 8px; align-items: center"> + <text class="label">资质名称</text> + <view> + {{ + $dict.echoDicValue( + dictMap.enterprise_qua, + prove.qualificationName.toString() + ) + }} + </view> + </view> + <view class="wd-flex" style="gap: 8px; align-items: center"> + <text class="label">资质编号</text> + <view> + {{ prove.enterpriseAuth }} + </view> + </view> + <view class="wd-flex" style="gap: 8px; align-items: center"> + <text class="label">资质到期</text> + <view> + {{ $util.formatDate(prove.expiryDate, 'YYYY/M/D') }} + </view> + </view> + </view> + </view> + </view> + </view> + + <cs-bottom-wrapper> + <view class="operation"> + <button class="btn green">提交审核</button> + </view> + </cs-bottom-wrapper> + </view> +</template> + +<script> +import { uploadFile } from '@/api/system/file.js' +import { getDictBatchByType } from '@/api/system/dict.js' +export default { + data() { + return { + form: { + enterpiseName: undefined, + address: undefined, + gpsLocation: undefined, + introduce: '', + photo: [], + tags: {} + }, + dictMap: {}, + prove: [], + inviteId: undefined + } + }, + onLoad(res) { + this.inviteId = res.inviteId + this.getDict() + }, + onShow() { + uni.$on('enterpriseIntroduce', data => { + this.form.introduce = data.introduce + }) + uni.$on('enterpriseTag', data => { + this.form.tags = data + }) + uni.$on('prove', data => { + this.prove.push(data) + }) + }, + methods: { + proofName(v) { + console.log(v.detail.value) + }, + /** + * 获取字典 + */ + async getDict() { + const dict = await getDictBatchByType({ + type: ['enterprise_qua'].join(',') + }) + this.dictMap = { + ...dict.data + } + }, + chooseAddress() { + uni.chooseLocation({ + success: res => { + this.form.address = res.address + this.form.gpsLocation = res.latitude + ',' + res.longitude + } + }) + }, + goIntruduce() { + uni.navigateTo({ + url: `/sub/invite/enterpriseIntroduce?introduce=${this.form.introduce}` + }) + }, + goTags() { + uni.navigateTo({ + url: `/sub/invite/enterpriseTags?tags=${this.form.tags}` + }) + }, + /** + * 选择图片并上传 + * @param {Object} e + */ + async addEnterprisePhoto(e) { + e.file.forEach(p => { + this.form.photo.push({ + ...p, + status: 'uploading', + message: '上传中' + }) + }) + // 使用promise.all()方法上传到后端做统一接收 + await Promise.all( + this.form.photo.map(async (p, i) => { + if (p.status == 'uploading') { + const res = await uploadFile({ name: `file`, filePath: p.url }) + return { + ...res.data, + status: 'success', + message: '' + } + } + return p + }) + ).then(res => { + this.form.photo = res + }) + }, + /** + * 删除图片 + * @param {Object} e + */ + delEnterprisePhoto(e) { + this.form.photo.splice(e.index, 1) + }, + addProve() { + uni.navigateTo({ + url: '/sub/invite/prove' + }) + } + } +} +</script> + +<style lang="scss" scoped> +.view { + padding: 12px; + display: flex; + flex-flow: column nowrap; + gap: 12px; + overflow: hidden; + overflow-y: scroll; + max-height: 100vh; + padding-bottom: 12vh; +} +.block { + display: flex; + flex-flow: row nowrap; + background-color: #fff; + padding: 12px; + border-radius: 8px; + justify-content: space-between; + align-items: center; + gap: 12px; + .value { + flex: 1; + display: flex; + flex-flow: row nowrap; + justify-content: space-between; + gap: 4px; + .input-value { + flex: 1; + text-align: right; + white-space: nowrap; + text-overflow: ellipsis; + } + .input-textarea { + flex: 1; + display: -webkit-box; + overflow: hidden; + text-align: right; + max-height: 3rem; + line-height: 1rem; + text-overflow: ellipsis; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + word-break: break-all; + } + } +} + +.upload-wrapper { + display: flex; + flex-flow: column nowrap; + background-color: #fff; + padding: 12px; + border-radius: 8px; + gap: 12px; +} + +.operation { + padding: 12px; + display: flex; + align-items: center; + justify-content: center; + gap: 12px; + .btn { + flex: 1; + border-radius: 8px; + display: flex; + padding: 12px 0; + align-items: center; + justify-content: center; + } + .green { + background-color: $cs-color-main; + color: #fff; + } +} +</style> diff --git a/sub/invite/enterpriseIntroduce.vue b/sub/invite/enterpriseIntroduce.vue new file mode 100644 index 0000000..e4504ad --- /dev/null +++ b/sub/invite/enterpriseIntroduce.vue @@ -0,0 +1,79 @@ +<template> + <view class="view"> + <u--textarea + v-model="introduce" + placeholder="请输入..." + maxlength="500" + count + :autoHeight="true" + ></u--textarea> + <cs-bottom-wrapper> + <view class="operation"> + <button class="btn green" @tap="submit">保存</button> + </view> + </cs-bottom-wrapper> + </view> +</template> + +<script> +export default { + data() { + return { + introduce: '' + } + }, + onLoad(res) { + this.introduce = res.introduce + }, + methods: { + submit() { + if (!this.introduce) { + uni.showToast({ + icon: 'none', + title: '请填写介绍' + }) + return + } + uni.$emit('enterpriseIntroduce', { introduce: this.introduce }) + uni.navigateBack() + } + } +} +</script> + +<style lang="scss" scoped> +.view { + background-color: #fff; + padding: 12px; + height: 100vh; +} +::v-deep .u-textarea { + min-height: 400rpx; + background-color: #f9f9f9 !important; + border: 1px solid #f9f9f9; + border-radius: 12px; + .u-textarea__count { + background-color: #f9f9f9 !important; + } +} + +.operation { + padding: 12px; + display: flex; + align-items: center; + justify-content: center; + gap: 12px; + .btn { + flex: 1; + border-radius: 8px; + display: flex; + padding: 12px 0; + align-items: center; + justify-content: center; + } + .green { + background-color: $cs-color-main; + color: #fff; + } +} +</style> diff --git a/sub/invite/enterpriseTags.vue b/sub/invite/enterpriseTags.vue new file mode 100644 index 0000000..f0b1085 --- /dev/null +++ b/sub/invite/enterpriseTags.vue @@ -0,0 +1,177 @@ +<template> + <view class="view"> + <view class="block" v-for="(tag, index) in data" :key="index"> + <view style=""> + <text style="color: #f8285a; margin-right: 4px">*</text> + {{ tag.name }} + </view> + <view class="value" @click="showPicker(tag)"> + <view class="input-value" v-if="form[tag.name]"> + {{ form[tag.name].name }} + </view> + <view class="input-value" style="color: #808080" v-else> + {{ `请选择${tag.name}` }} + </view> + <u-icon name="arrow-right"></u-icon> + </view> + </view> + <u-picker + :show="picker.show" + :columns="picker.data" + @cancel="closePicker" + closeOnClickOverlay + keyName="name" + ref="uPicker" + @close="closePicker" + @confirm="confirmPicker" + ></u-picker> + <cs-bottom-wrapper> + <view class="operation"> + <button class="btn green" @tap="submit">提交审核</button> + </view> + </cs-bottom-wrapper> + </view> +</template> + +<script> +export default { + data() { + return { + data: [], + form: {}, + // 选择器 + picker: { + show: false, + // 做表单中键的缓存用 + key: null, + data: [] + } + } + }, + onLoad(res) { + this.getData() + }, + methods: { + getData() { + this.data = new Array(5).fill(1).map((i, index) => { + this.form[`Tag${index + 1}`] = '' + return { + name: `Tag${index + 1}`, + label: `标签${index + 1}`, + value: index, + children: new Array(10).fill(1).map((c, cIndex) => { + return { + name: `subTag${cIndex + 1}`, + value: cIndex * 10 + } + }) + } + }) + console.log(this.data) + }, + /** + * 选择器确认回调 + * @param {Object} e + */ + confirmPicker(e) { + const { value } = e + this.form[this.picker.key] = value[0].value + this.closePicker() + }, + /** + * 关闭选择器 + */ + closePicker() { + this.picker = { + show: false, + key: '', + data: [] + } + }, + showPicker(tag) { + this.picker.data.push(tag.children) + this.picker.key = tag.name + this.picker.show = true + }, + submit() { + const msg = Object.keys(this.form).filter(k => { + if (this.form[k] == '') { + return this.data.find(d => d.name == k).label + } + }) + if (msg.length > 0) { + uni.showToast({ + icon: 'none', + title: `${msg.join('\n')}不能为空` + }) + return + } + uni.$emit('enterpriseTag', this.form) + console.log(this.form) + uni.navigateBack() + } + } +} +</script> + +<style lang="scss" scoped> +.view { + padding: 12px; + display: flex; + flex-flow: column nowrap; + gap: 12px; + overflow: hidden; + overflow-y: scroll; + max-height: 100vh; + padding-bottom: 12vh; +} +.input-value { + flex: 1; + text-align: right; + white-space: nowrap; + text-overflow: ellipsis; +} +.block { + display: flex; + flex-flow: row nowrap; + background-color: #fff; + padding: 12px; + border-radius: 8px; + justify-content: space-between; + align-items: center; + gap: 12px; + .value { + flex: 1; + display: flex; + flex-flow: row nowrap; + justify-content: space-between; + gap: 4px; + .input-value { + flex: 1; + text-align: right; + white-space: nowrap; + text-overflow: ellipsis; + } + } +} + +.operation { + padding: 12px; + display: flex; + align-items: center; + justify-content: center; + gap: 12px; + .btn { + flex: 1; + border-radius: 8px; + display: flex; + padding: 12px 0; + align-items: center; + justify-content: center; + } + .green { + background-color: $cs-color-main; + color: #fff; + } +} +</style> diff --git a/sub/invite/index.vue b/sub/invite/index.vue new file mode 100644 index 0000000..0038a1a --- /dev/null +++ b/sub/invite/index.vue @@ -0,0 +1,55 @@ +<template> + <view> + <scroll-view direction="vertical"></scroll-view> + <cs-bottom-wrapper> + <view class="operation"> + <button class="btn green" @tap="addEnterprise">新增企业</button> + </view> + </cs-bottom-wrapper> + </view> +</template> + +<script> +export default { + data() { + return { + inviteId: '' + } + }, + onLoad(res) { + console.log(res) + if (res.inviteId) { + this.inviteId = res.inviteId + } + }, + methods: { + addEnterprise() { + uni.navigateTo({ + url: `/sub/invite/addEnterprise?inviteId=${this.inviteId}` + }) + } + } +} +</script> + +<style lang="scss" scoped> +.operation { + padding: 12px; + display: flex; + align-items: center; + justify-content: center; + gap: 12px; + .btn { + flex: 1; + border-radius: 8px; + display: flex; + padding: 12px 0; + align-items: center; + justify-content: center; + } + .green { + background-color: $cs-color-main; + color: #fff; + } +} +</style> diff --git a/sub/invite/prove.vue b/sub/invite/prove.vue new file mode 100644 index 0000000..20132c8 --- /dev/null +++ b/sub/invite/prove.vue @@ -0,0 +1,369 @@ +<template> + <view class="view"> + <view class="block"> + <view style=""> + <text style="color: #f8285a; margin-right: 4px">*</text> + 资质名称 + </view> + <view + class="value" + @tap="showPicker('enterprise_qua', 'qualificationName')" + > + <view class="input-textarea" v-if="prove.qualificationName"> + {{ + $dict.echoDicValue( + dictMap.enterprise_qua, + prove.qualificationName + ) + }} + </view> + <view class="input-textarea" style="color: #808080" v-else> + 请输入资质名称 + </view> + <u-icon name="arrow-right"></u-icon> + </view> + </view> + + <view class="block"> + <view style=""> + <text style="color: #f8285a; margin-right: 4px">*</text> + 资质编号 + </view> + <view class="value"> + <input + class="input-value" + type="text" + placeholder-class="txt" + placeholder="请输入资质编号" + v-model="prove.enterpriseAuth" + /> + <u-icon name="arrow-right"></u-icon> + </view> + </view> + + <!-- <view class="block"> + <view style=""> + <text style="color: #f8285a; margin-right: 4px">*</text> + 办理时间 + </view> + <view class="value" @tap="showCalendar('handleDate')"> + <view class="input-textarea" v-if="prove.handleDate"> + {{ prove.handleDate }} + </view> + <view class="input-textarea" style="color: #808080" v-else> + 请选择办理时间 + </view> + <u-icon name="arrow-right"></u-icon> + </view> + </view> --> + + <view class="block"> + <view style=""> + <text style="color: #f8285a; margin-right: 4px">*</text> + 到期时间 + </view> + <view class="value" @tap="showCalendar('expiryDate')"> + <view class="input-textarea" v-if="prove.expiryDate"> + {{ prove.expiryDate }} + </view> + <view class="input-textarea" style="color: #808080" v-else> + 请选择到期时间 + </view> + <u-icon name="arrow-right"></u-icon> + </view> + </view> + + <view class="upload-wrapper"> + <view + class="wd-flex" + style=" + justify-content: space-between; + align-items: center; + width: 100%; + " + > + <view style=""> + <text style="color: #f8285a; margin-right: 4px">*</text> + 资质照片 + </view> + <view style="color: #808080">要求清晰有效</view> + </view> + <u-upload + :fileList="prove.photo" + @afterRead="addPhoto" + @delete="delPhoto" + :maxCount="1" + width="101" + height="101" + ></u-upload> + </view> + + <cs-bottom-wrapper> + <view class="operation"> + <button class="btn green" @tap="submit">保存</button> + </view> + </cs-bottom-wrapper> + <u-picker + :show="picker.show" + :columns="picker.data" + @cancel="closePicker" + closeOnClickOverlay + keyName="label" + ref="uPicker" + @close="closePicker" + @confirm="confirmPicker" + ></u-picker> + <uni-calendar + ref="calendarRef" + :insert="false" + @confirm="confirmCalendar" + /> + </view> +</template> + +<script> +import { uploadFile } from '@/api/system/file.js' +import { getDictBatchByType } from '@/api/system/dict.js' +export default { + data() { + return { + prove: { + id: '', + qualificationName: '', + expiryDate: '', + enterpriseAuth: '', + photo: [] + }, + dictMap: {}, + // 选择器 + picker: { + show: false, + // 做表单中键的缓存用 + key: null, + data: [] + }, + // 日历控件 + calendar: { + // 做表单中键的缓存用 + key: null + } + } + }, + onLoad(res) { + uni.setNavigationBarTitle({ + title: !res ? '编辑资质' : '新增资质' + }) + this.getDict() + }, + onShow() {}, + methods: { + /** + * 获取字典 + */ + async getDict() { + const dict = await getDictBatchByType({ + type: ['enterprise_qua'].join(',') + }) + this.dictMap = { + ...dict.data + } + }, + /** + * 选择图片并上传 + * @param {Object} e + */ + async addPhoto(e) { + e.file.forEach(p => { + this.prove.photo.push({ + ...p, + status: 'uploading', + message: '上传中' + }) + }) + // 使用promise.all()方法上传到后端做统一接收 + await Promise.all( + this.prove.photo.map(async (p, i) => { + if (p.status == 'uploading') { + const res = await uploadFile({ name: `file`, filePath: p.url }) + return { + ...res.data, + status: 'success', + message: '' + } + } + return p + }) + ).then(res => { + this.prove.photo = res + }) + }, + /** + * 删除图片 + * @param {Object} e + */ + delPhoto(e) { + this.prove.photo.splice(e.index, 1) + }, + /** + * 选择器确认回调 + * @param {Object} e + */ + confirmPicker(e) { + const { value } = e + this.prove[this.picker.key] = value[0].value + this.closePicker() + }, + /** + * 关闭选择器 + */ + closePicker() { + this.picker = { + show: false, + key: '', + data: [] + } + }, + showPicker(dict, key) { + this.picker.data.push(this.dictMap[dict]) + this.picker.key = key + this.picker.show = true + }, + /** + * 显示日历 + * @param {Object} key 表单中需要赋值的键 + */ + showCalendar(key) { + this.$refs.calendarRef.open() + this.calendar = { + key + } + }, + /** + * 日历选中之后的回调 + * @param {Object} e + */ + confirmCalendar(e) { + this.prove[this.calendar.key] = e.fulldate + + this.closeCalendar() + }, + /** + * 关闭日历 + */ + closeCalendar() { + this.calendar = { + key: null + } + }, + async submit() { + const valide = await this.verifyForm() + if (!valide) return + uni.$emit('prove', this.prove) + uni.navigateBack() + }, + async verifyForm() { + const msgMap = { + qualificationName: '请填写资质名称', + expiryDate: '请选择到期日期', + enterpriseAuth: '请填写资质编号', + photo: '请上传资质照片' + } + const keys = Object.keys(this.prove).filter(i => { + if (!this.prove[i] && i != 'id') return i + if (typeof this.prove[i] == 'object' && this.prove[i].length == 0) + return i + }) + if (keys.length > 0) { + const msg = keys + .map(i => { + return msgMap[i] + }) + .join('\n') + uni.showToast({ + icon: 'none', + title: msg + }) + return false + } + return true + } + } +} +</script> + +<style lang="scss" scoped> +.view { + padding: 12px; + display: flex; + flex-flow: column nowrap; + gap: 12px; + overflow: hidden; + overflow-y: scroll; + max-height: 100vh; + padding-bottom: 12vh; +} +.block { + display: flex; + flex-flow: row nowrap; + background-color: #fff; + padding: 12px; + border-radius: 8px; + justify-content: space-between; + align-items: center; + gap: 12px; + .value { + flex: 1; + display: flex; + flex-flow: row nowrap; + justify-content: space-between; + gap: 4px; + .input-value { + flex: 1; + text-align: right; + white-space: nowrap; + text-overflow: ellipsis; + } + .input-textarea { + flex: 1; + display: -webkit-box; + overflow: hidden; + text-align: right; + max-height: 3rem; + line-height: 1rem; + text-overflow: ellipsis; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + word-break: break-all; + } + } +} + +.upload-wrapper { + display: flex; + flex-flow: column nowrap; + background-color: #fff; + padding: 12px; + border-radius: 8px; + gap: 12px; +} + +.operation { + padding: 12px; + display: flex; + align-items: center; + justify-content: center; + gap: 12px; + .btn { + flex: 1; + border-radius: 8px; + display: flex; + padding: 12px 0; + align-items: center; + justify-content: center; + } + .green { + background-color: $cs-color-main; + color: #fff; + } +} +</style> diff --git a/sub/owner/invite.vue b/sub/owner/invite.vue index 897bb8e..1eaed96 100644 --- a/sub/owner/invite.vue +++ b/sub/owner/invite.vue @@ -24,7 +24,7 @@ export default { onShareAppMessage() { return { title: '邀请企业入驻', - path: `/pages/login?invateId=${this.$store.getters.userId}`, + path: `/sub/invite/index?inviteId=${this.$store.getters.userId}`, imageUrl: 'http://82.156.141.150:9001/api/v1/download-shared-object/aHR0cDovL2xvY2FsaG9zdDo5MDAwL2h1YW5iYW8vbWluaWFwcC9pbnZhdGUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUQxODY1RVA2NEczMEdEUUhDVTglMkYyMDI1MDIxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMThUMDcyMDI0WiZYLUFtei1FeHBpcmVzPTQzMTk5JlgtQW16LVNlY3VyaXR5LVRva2VuPWV5SmhiR2NpT2lKSVV6VXhNaUlzSW5SNWNDSTZJa3BYVkNKOS5leUpoWTJObGMzTkxaWGtpT2lKQlJERTROalZGVURZMFJ6TXdSMFJSU0VOVk9DSXNJbVY0Y0NJNk1UY3pPVGt3TmpJME55d2ljR0Z5Wlc1MElqb2lZV1J0YVc0aWZRLmp6djBhdEY5QVBYXzVjYWg4c18yeXhVV3oxek9BekFzSVdzemVrUmZwcXlHd0RPWkptazlUSGJRUnBDdVNmLVMyU0otWTI1cldUd2hpNUlrY0xBSThRJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZ2ZXJzaW9uSWQ9bnVsbCZYLUFtei1TaWduYXR1cmU9MjcxZTkzOTE1MDkwYzUzYmRjYTg0MjQ1MTJhYjk3ZWQxZWMyN2QzM2MwM2U3NGUwYmRhNTBmYjQyNWI0N2MyOQ' } @@ -32,7 +32,7 @@ export default { onShareTimeline() { return { title: '邀请企业入驻', // 标题 - path: `/pages/login?invateId=${this.$store.getters.userId}`, + path: `/sub/invite/index?inviteId=${this.$store.getters.userId}`, imageUrl: 'http://82.156.141.150:9001/api/v1/download-shared-object/aHR0cDovL2xvY2FsaG9zdDo5MDAwL2h1YW5iYW8vbWluaWFwcC9pbnZhdGUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUQxODY1RVA2NEczMEdEUUhDVTglMkYyMDI1MDIxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMThUMDcyMDI0WiZYLUFtei1FeHBpcmVzPTQzMTk5JlgtQW16LVNlY3VyaXR5LVRva2VuPWV5SmhiR2NpT2lKSVV6VXhNaUlzSW5SNWNDSTZJa3BYVkNKOS5leUpoWTJObGMzTkxaWGtpT2lKQlJERTROalZGVURZMFJ6TXdSMFJSU0VOVk9DSXNJbVY0Y0NJNk1UY3pPVGt3TmpJME55d2ljR0Z5Wlc1MElqb2lZV1J0YVc0aWZRLmp6djBhdEY5QVBYXzVjYWg4c18yeXhVV3oxek9BekFzSVdzemVrUmZwcXlHd0RPWkptazlUSGJRUnBDdVNmLVMyU0otWTI1cldUd2hpNUlrY0xBSThRJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZ2ZXJzaW9uSWQ9bnVsbCZYLUFtei1TaWduYXR1cmU9MjcxZTkzOTE1MDkwYzUzYmRjYTg0MjQ1MTJhYjk3ZWQxZWMyN2QzM2MwM2U3NGUwYmRhNTBmYjQyNWI0N2MyOQ' } diff --git a/sub/task/enforce.vue b/sub/task/enforce.vue index 5309f33..17ddaa9 100644 --- a/sub/task/enforce.vue +++ b/sub/task/enforce.vue @@ -122,25 +122,27 @@ export default { * @param {Object} e */ async addPhoto(e) { - this.form.photo = e.file.map(p => { - return { + e.file.forEach(p => { + this.form.photo.push({ ...p, status: 'uploading', message: '上传中' - } + }) }) // 使用promise.all()方法上传到后端做统一接收 await Promise.all( this.form.photo.map(async (p, i) => { - const res = await uploadFile({ name: `file`, filePath: p.url }) - return { - ...res.data, - status: 'success', - message: '' + if (p.status == 'uploading') { + const res = await uploadFile({ name: `file`, filePath: p.url }) + return { + ...res.data, + status: 'success', + message: '' + } } + return p }) ).then(res => { - // 一次传三张 this.form.photo = res }) },