|
@@ -13,16 +13,6 @@
|
|
|
<image class="top_img" src="https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/dt_ban2.png"></image>
|
|
<image class="top_img" src="https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/dt_ban2.png"></image>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <text v-if="false">
|
|
|
|
|
- 你将作为一个指令处理助手,为我处理用户口述的指令。
|
|
|
|
|
- 用户将输入一些操作指令,例如:为我开灯,打开风扇,关灯,开卧室灯,空调调到16度等等。
|
|
|
|
|
- 你需要根据用户的指令,提取以下关键信息并输出,json格式:
|
|
|
|
|
- 1. success: 指令是否处理成功。
|
|
|
|
|
- 2. object: 指令的操作对象(例如:灯、风扇、空调等)
|
|
|
|
|
- 3. action: 指令的操作动作(例如:打开、关闭、调到等)
|
|
|
|
|
- 4. parameter: 指令的操作参数(例如:温度、亮度等)
|
|
|
|
|
- 你需要注意,用户的指令可能会有错误或不完整,若指令不完整,请输出1指令处理不成功。
|
|
|
|
|
- </text>
|
|
|
|
|
<!-- 表单 -->
|
|
<!-- 表单 -->
|
|
|
<view class="example">
|
|
<view class="example">
|
|
|
<uni-forms style="padding: 0 20rpx 0 20rpx" label-position="top" ref="valiForm" :rules="rules" :modelValue="valiFormData">
|
|
<uni-forms style="padding: 0 20rpx 0 20rpx" label-position="top" ref="valiForm" :rules="rules" :modelValue="valiFormData">
|
|
@@ -67,17 +57,8 @@
|
|
|
<uni-easyinput type="email" v-model="valiFormData.email" placeholder="请输入联系邮箱" />
|
|
<uni-easyinput type="email" v-model="valiFormData.email" placeholder="请输入联系邮箱" />
|
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
|
|
|
|
|
|
- <!-- 报名选项 -->
|
|
|
|
|
- <uni-forms-item label="报名选项" label-width="100px" required name="type">
|
|
|
|
|
- <view class="checkbox-group">
|
|
|
|
|
- <uni-data-checkbox v-model="valiFormData.type" :localdata="[
|
|
|
|
|
- {value: 'volunteer', text: '巡查守护'},
|
|
|
|
|
- {value: 'xuanjiang', text: '宣讲传播'}
|
|
|
|
|
- ]" multiple="true" />
|
|
|
|
|
- </view>
|
|
|
|
|
- </uni-forms-item>
|
|
|
|
|
- <uni-forms-item label="您的选择" label-width="100px" required name="id_card">
|
|
|
|
|
- <uni-data-picker :localdata="regionList" placeholder="请选择地区" popup-title="请选择所在地区" @change="onchange" @nodeclick="onnodeclick"></uni-data-picker>
|
|
|
|
|
|
|
+ <uni-forms-item label="您的选择" label-width="100px" required v-if="valiFormData.type === 'volunteer'">
|
|
|
|
|
+ <uni-data-picker v-model="region_id" :localdata="regionList" placeholder="请选择地区" popup-title="请选择所在地区" @change="onchange" @nodeclick="onnodeclick"></uni-data-picker>
|
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
|
<!-- 本人承诺 -->
|
|
<!-- 本人承诺 -->
|
|
|
<uni-forms-item label="本人承诺" label-width="100px" required name="commitment" >
|
|
<uni-forms-item label="本人承诺" label-width="100px" required name="commitment" >
|
|
@@ -121,7 +102,9 @@ export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
regionList: [],
|
|
regionList: [],
|
|
|
- region_id: '',
|
|
|
|
|
|
|
+ region_id: null,
|
|
|
|
|
+ pendingRegionId: '',
|
|
|
|
|
+ pendingRegionName: '',
|
|
|
cr_id: '' /* 文物id */,
|
|
cr_id: '' /* 文物id */,
|
|
|
modifyId: '' /* 修改资料的文物id */,
|
|
modifyId: '' /* 修改资料的文物id */,
|
|
|
volunteer_id: '' /* 志愿者id */,
|
|
volunteer_id: '' /* 志愿者id */,
|
|
@@ -145,6 +128,11 @@ export default {
|
|
|
{ value: '民主党派', text: '民主党派' },
|
|
{ value: '民主党派', text: '民主党派' },
|
|
|
{ value: '群众', text: '群众' }
|
|
{ value: '群众', text: '群众' }
|
|
|
],
|
|
],
|
|
|
|
|
+ typeOptions: [
|
|
|
|
|
+ { value: 'volunteer', text: '巡查守护' },
|
|
|
|
|
+ { value: 'xuanjiang', text: '宣讲' },
|
|
|
|
|
+ { value: 'publicize', text: '传播' }
|
|
|
|
|
+ ],
|
|
|
|
|
|
|
|
|
|
|
|
|
/* 表单数据 */
|
|
/* 表单数据 */
|
|
@@ -158,7 +146,7 @@ export default {
|
|
|
intro: '',
|
|
intro: '',
|
|
|
political_status: '',
|
|
political_status: '',
|
|
|
email: '',
|
|
email: '',
|
|
|
- type: [],
|
|
|
|
|
|
|
+ type: '',
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/* 校验规则 */
|
|
/* 校验规则 */
|
|
@@ -291,23 +279,6 @@ export default {
|
|
|
validateTrigger: 'submit'
|
|
validateTrigger: 'submit'
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- // 报名选项校验
|
|
|
|
|
- type: {
|
|
|
|
|
- rules: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- errorMessage: '请至少选择一个报名选项'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- type: 'array',
|
|
|
|
|
- minLength: 1,
|
|
|
|
|
- errorMessage: '请至少选择一个报名选项'
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- label: '报名选项',
|
|
|
|
|
- validateTrigger: 'submit'
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
// 本人承诺校验
|
|
// 本人承诺校验
|
|
|
commitment: {
|
|
commitment: {
|
|
|
rules: [
|
|
rules: [
|
|
@@ -333,6 +304,11 @@ export default {
|
|
|
this.cr_id = o.id;
|
|
this.cr_id = o.id;
|
|
|
this.volunteer_id = o.volunteer_id;
|
|
this.volunteer_id = o.volunteer_id;
|
|
|
this.modifyId = o.modifyId;
|
|
this.modifyId = o.modifyId;
|
|
|
|
|
+ this.pendingRegionId = o.region_id ? decodeURIComponent(o.region_id) : '';
|
|
|
|
|
+ this.pendingRegionName = o.regionName ? decodeURIComponent(o.regionName) : '';
|
|
|
|
|
+ if (o.type && this.typeOptions.some((item) => item.value === o.type)) {
|
|
|
|
|
+ this.valiFormData.type = o.type;
|
|
|
|
|
+ }
|
|
|
this.getCategoryCascadeList();
|
|
this.getCategoryCascadeList();
|
|
|
|
|
|
|
|
if (this.isLogin) {
|
|
if (this.isLogin) {
|
|
@@ -359,10 +335,68 @@ export default {
|
|
|
this.region_id = node.value;
|
|
this.region_id = node.value;
|
|
|
console.log(node);
|
|
console.log(node);
|
|
|
},
|
|
},
|
|
|
|
|
+ getRegionValue(item = {}) {
|
|
|
|
|
+ if (item.value !== undefined && item.value !== null && item.value !== '') {
|
|
|
|
|
+ return item.value;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (item.id !== undefined && item.id !== null && item.id !== '') {
|
|
|
|
|
+ return item.id;
|
|
|
|
|
+ }
|
|
|
|
|
+ return '';
|
|
|
|
|
+ },
|
|
|
|
|
+ getRegionText(item = {}) {
|
|
|
|
|
+ return item.text || item.title || item.label || item.name || '';
|
|
|
|
|
+ },
|
|
|
|
|
+ findRegionById(list = [], regionId = '') {
|
|
|
|
|
+ for (let index = 0; index < list.length; index++) {
|
|
|
|
|
+ const item = list[index];
|
|
|
|
|
+ if (String(this.getRegionValue(item)) === String(regionId)) {
|
|
|
|
|
+ return item;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (Array.isArray(item.children) && item.children.length) {
|
|
|
|
|
+ const matchedChild = this.findRegionById(item.children, regionId);
|
|
|
|
|
+ if (matchedChild) {
|
|
|
|
|
+ return matchedChild;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
|
|
+ },
|
|
|
|
|
+ findRegionByName(list = [], regionName = '') {
|
|
|
|
|
+ for (let index = 0; index < list.length; index++) {
|
|
|
|
|
+ const item = list[index];
|
|
|
|
|
+ if (this.getRegionText(item) === regionName) {
|
|
|
|
|
+ return item;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (Array.isArray(item.children) && item.children.length) {
|
|
|
|
|
+ const matchedChild = this.findRegionByName(item.children, regionName);
|
|
|
|
|
+ if (matchedChild) {
|
|
|
|
|
+ return matchedChild;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
|
|
+ },
|
|
|
|
|
+ applyPendingRegion() {
|
|
|
|
|
+ if (!Array.isArray(this.regionList) || !this.regionList.length) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ let matchedRegion = null;
|
|
|
|
|
+ if (this.pendingRegionId !== '' && this.pendingRegionId !== null && this.pendingRegionId !== undefined) {
|
|
|
|
|
+ matchedRegion = this.findRegionById(this.regionList, this.pendingRegionId);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!matchedRegion && this.pendingRegionName) {
|
|
|
|
|
+ matchedRegion = this.findRegionByName(this.regionList, this.pendingRegionName);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (matchedRegion) {
|
|
|
|
|
+ this.region_id = this.getRegionValue(matchedRegion);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
// 区域
|
|
// 区域
|
|
|
getCategoryCascadeList() {
|
|
getCategoryCascadeList() {
|
|
|
this.$api.getCategoryCascadeList({ main_body_id: 1, pid: 5, level: 2 }, function (res) {
|
|
this.$api.getCategoryCascadeList({ main_body_id: 1, pid: 5, level: 2 }, function (res) {
|
|
|
that.regionList = res.data;
|
|
that.regionList = res.data;
|
|
|
|
|
+ that.applyPendingRegion();
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -410,6 +444,10 @@ export default {
|
|
|
that.$common.errorToShow('请先阅读并同意本人承诺');
|
|
that.$common.errorToShow('请先阅读并同意本人承诺');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (!this.valiFormData.type) {
|
|
|
|
|
+ that.$common.errorToShow('缺少报名类型,请从对应入口重新进入');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
if (!err) {
|
|
if (!err) {
|
|
|
console.log('校验成功');
|
|
console.log('校验成功');
|
|
|
/* 检验成功 */
|
|
/* 检验成功 */
|
|
@@ -419,21 +457,25 @@ export default {
|
|
|
unit_name, intro, fullurl,
|
|
unit_name, intro, fullurl,
|
|
|
email,
|
|
email,
|
|
|
} = this.valiFormData;
|
|
} = this.valiFormData;
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ main_body_id: 1,
|
|
|
|
|
+ name: name,
|
|
|
|
|
+ mobile: mobile,
|
|
|
|
|
+ address: address,
|
|
|
|
|
+ unit_name: unit_name,
|
|
|
|
|
+ id_card: id_card,
|
|
|
|
|
+ intro: intro,
|
|
|
|
|
+ file: fullurl,
|
|
|
|
|
+ politics_status: political_status,
|
|
|
|
|
+ email: email,
|
|
|
|
|
+ type: this.valiFormData.type,
|
|
|
|
|
+ region_id: this.region_id,
|
|
|
|
|
+ };
|
|
|
|
|
+ if (this.cr_id) {
|
|
|
|
|
+ params.cr_id = this.cr_id;
|
|
|
|
|
+ }
|
|
|
this.$api.scanApplyVolunteer(
|
|
this.$api.scanApplyVolunteer(
|
|
|
- {
|
|
|
|
|
- main_body_id: 1,
|
|
|
|
|
- name: name,
|
|
|
|
|
- mobile: mobile,
|
|
|
|
|
- address: address,
|
|
|
|
|
- unit_name: unit_name,
|
|
|
|
|
- id_card: id_card,
|
|
|
|
|
- intro: intro,
|
|
|
|
|
- file: fullurl,
|
|
|
|
|
- politics_status: political_status,
|
|
|
|
|
- email: email,
|
|
|
|
|
- type: this.valiFormData.type,
|
|
|
|
|
- region_id: this.region_id,
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ params,
|
|
|
function (res) {
|
|
function (res) {
|
|
|
if (res.code === 1) {
|
|
if (res.code === 1) {
|
|
|
that.$common.errorToShow(res.msg);
|
|
that.$common.errorToShow(res.msg);
|
|
@@ -494,10 +536,10 @@ export default {
|
|
|
height: 250rpx;
|
|
height: 250rpx;
|
|
|
margin: auto;
|
|
margin: auto;
|
|
|
}
|
|
}
|
|
|
-/deep/.uni-forms-item__error {
|
|
|
|
|
|
|
+::v-deep .uni-forms-item__error {
|
|
|
color: red !important;
|
|
color: red !important;
|
|
|
}
|
|
}
|
|
|
-/deep/ .uni-stat__select {
|
|
|
|
|
|
|
+::v-deep .uni-stat__select {
|
|
|
padding: 0!important;
|
|
padding: 0!important;
|
|
|
}
|
|
}
|
|
|
.is-input-border {
|
|
.is-input-border {
|
|
@@ -524,6 +566,7 @@ export default {
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
font-weight: 700;
|
|
font-weight: 700;
|
|
|
background: linear-gradient(180deg, #af7e44 0%, #934b36 100%);
|
|
background: linear-gradient(180deg, #af7e44 0%, #934b36 100%);
|
|
|
|
|
+ background-clip: text;
|
|
|
-webkit-background-clip: text;
|
|
-webkit-background-clip: text;
|
|
|
-webkit-text-fill-color: transparent;
|
|
-webkit-text-fill-color: transparent;
|
|
|
}
|
|
}
|
|
@@ -585,6 +628,7 @@ export default {
|
|
|
font-size: 36rpx;
|
|
font-size: 36rpx;
|
|
|
letter-spacing: 6rpx;
|
|
letter-spacing: 6rpx;
|
|
|
background: linear-gradient(180deg, #af7e44 0%, #934b36 100%);
|
|
background: linear-gradient(180deg, #af7e44 0%, #934b36 100%);
|
|
|
|
|
+ background-clip: text;
|
|
|
-webkit-background-clip: text;
|
|
-webkit-background-clip: text;
|
|
|
-webkit-text-fill-color: transparent;
|
|
-webkit-text-fill-color: transparent;
|
|
|
}
|
|
}
|
|
@@ -609,6 +653,7 @@ export default {
|
|
|
font-size: 32rpx;
|
|
font-size: 32rpx;
|
|
|
letter-spacing: 6rpx;
|
|
letter-spacing: 6rpx;
|
|
|
background: linear-gradient(180deg, #af7e44 0%, #934b36 100%);
|
|
background: linear-gradient(180deg, #af7e44 0%, #934b36 100%);
|
|
|
|
|
+ background-clip: text;
|
|
|
-webkit-background-clip: text;
|
|
-webkit-background-clip: text;
|
|
|
-webkit-text-fill-color: transparent;
|
|
-webkit-text-fill-color: transparent;
|
|
|
}
|
|
}
|