表单
This commit is contained in:
		| @@ -13,15 +13,16 @@ | |||||||
|       </div> |       </div> | ||||||
|     </div> |     </div> | ||||||
|     <div class="microphone-info"> |     <div class="microphone-info"> | ||||||
|  |       <p class="loading" v-if="isStart">语音录制中...</p> | ||||||
|       <div class="microphone-img" @touchstart="start" @touchend="end"> |       <div class="microphone-img" @touchstart="start" @touchend="end"> | ||||||
|         <!-- <img src="./img/microphone.png" alt="" @longpress="">  --> |         <!-- <img src="./img/microphone.png" alt="" @longpress="">  --> | ||||||
|         <u-icon name="mic" color="#fff" size="140" style="margin-top:20px;"></u-icon> |         <u-icon name="mic" color="#fff" size="140" style="margin-top:20px;"></u-icon> | ||||||
|       </div> |       </div> | ||||||
|       <p class="text">{{isStart ? '松开结束说话' : '按住说话'}}</p> |       <p class="text">{{isStart ? '松开结束说话' : '按住说话'}}</p> | ||||||
|       <div class="btn"> |       <!-- <div class="btn"> | ||||||
|         <p class="cancel" @click="cancel">取消</p> |         <p class="cancel" @click="cancel">取消</p> | ||||||
|         <!-- <p class="confirm" @click="confirm" v-if="text">确定</p> --> |         <p class="confirm" @click="confirm" v-if="text">确定</p> | ||||||
|       </div> |       </div> --> | ||||||
|     </div> |     </div> | ||||||
|   </div> |   </div> | ||||||
| </template> | </template> | ||||||
| @@ -41,6 +42,7 @@ export default { | |||||||
|     ...mapState(['user']), |     ...mapState(['user']), | ||||||
|   }, |   }, | ||||||
|   onLoad() { |   onLoad() { | ||||||
|  |     this.text = '' | ||||||
|     this.injectJWeixin(['startRecord','stopRecord', 'translateVoice']) |     this.injectJWeixin(['startRecord','stopRecord', 'translateVoice']) | ||||||
|   }, |   }, | ||||||
|   onShow() { |   onShow() { | ||||||
| @@ -159,6 +161,13 @@ uni-page-body { | |||||||
|       color: #222; |       color: #222; | ||||||
|       margin-bottom: 64px; |       margin-bottom: 64px; | ||||||
|     } |     } | ||||||
|  |     .loading { | ||||||
|  |       font-family: PingFangSC-Regular; | ||||||
|  |       font-size: 28px; | ||||||
|  |       color: #666; | ||||||
|  |       margin-bottom: 32px; | ||||||
|  |       text-align: center; | ||||||
|  |     } | ||||||
|     .btn { |     .btn { | ||||||
|       text-align: center; |       text-align: center; | ||||||
|       font-family: PingFangSC-Regular; |       font-family: PingFangSC-Regular; | ||||||
|   | |||||||
| @@ -60,9 +60,9 @@ | |||||||
|       </div> |       </div> | ||||||
|     </div> |     </div> | ||||||
|     <div class="bottom-btn"> |     <div class="bottom-btn"> | ||||||
|       <div class="confirm" @click="confirm('保存成功')">保存内容</div> |       <!-- <div class="confirm" @click="confirm('保存成功')">保存内容</div> --> | ||||||
|       <div class="confirm" @click="confirm('提交成功')">提交</div> |       <div class="confirm" @click="confirm('提交成功')">提交</div> | ||||||
|       <div class="cancel">取消</div> |       <div class="cancel" @click="back">返回录制</div> | ||||||
|     </div> |     </div> | ||||||
|     <u-picker mode="time" v-model="showDate" :params="deteParams" start-year="1930" @confirm="dateConfirm">请选择</u-picker> |     <u-picker mode="time" v-model="showDate" :params="deteParams" start-year="1930" @confirm="dateConfirm">请选择</u-picker> | ||||||
|     <u-select v-model="showSex" :list="$dict.getDict('sex')" label-name="dictName" value-name="dictValue" @confirm="confirmSex"/> |     <u-select v-model="showSex" :list="$dict.getDict('sex')" label-name="dictName" value-name="dictValue" @confirm="confirmSex"/> | ||||||
| @@ -89,9 +89,9 @@ export default { | |||||||
|     ...mapState(['user']), |     ...mapState(['user']), | ||||||
|   }, |   }, | ||||||
|   onLoad(option) { |   onLoad(option) { | ||||||
|     this.word = option.word |     this.info = JSON.parse(option.info) | ||||||
|     this.$dict.load('sex', 'nation').then(() => { |     this.$dict.load('sex', 'nation').then(() => { | ||||||
|       this.getInfo() |       // this.getInfo() | ||||||
|     }) |     }) | ||||||
|   }, |   }, | ||||||
|   onShow() { |   onShow() { | ||||||
| @@ -99,7 +99,7 @@ export default { | |||||||
|   }, |   }, | ||||||
|   methods: { |   methods: { | ||||||
|     getInfo() { |     getInfo() { | ||||||
|       uni.showLoading({title: '加载中'}) |       uni.showLoading({title: '读取中'}) | ||||||
|       this.$http.post(`/app/appbaiduai/queryByInfo?word=${this.word}`).then((res) => { |       this.$http.post(`/app/appbaiduai/queryByInfo?word=${this.word}`).then((res) => { | ||||||
|         if (res.code === 0) { |         if (res.code === 0) { | ||||||
|           this.info = {...res.data} |           this.info = {...res.data} | ||||||
| @@ -120,25 +120,28 @@ export default { | |||||||
|       this.info.birthday = `${e.year}-${e.month}-${e.day}` |       this.info.birthday = `${e.year}-${e.month}-${e.day}` | ||||||
|     }, |     }, | ||||||
|     confirm(successText) { |     confirm(successText) { | ||||||
|       if(this.info.name == null || !this.info.name) { |       // if(this.info.name == null || !this.info.name) { | ||||||
|         return this.$u.toast('请输入户主姓名') |       //   return this.$u.toast('请输入户主姓名') | ||||||
|       } |       // } | ||||||
|       if(this.info.sex == null) { |       // if(this.info.sex == null) { | ||||||
|         return this.$u.toast('请选择性别') |       //   return this.$u.toast('请选择性别') | ||||||
|       } |       // } | ||||||
|       if(this.info.phone == null || !this.info.phone) { |       // if(this.info.phone == null || !this.info.phone) { | ||||||
|         return this.$u.toast('请输入联系电话') |       //   return this.$u.toast('请输入联系电话') | ||||||
|       } |       // } | ||||||
|       if(this.info.birthday == null) { |       // if(this.info.birthday == null) { | ||||||
|         return this.$u.toast('请选择出生日期') |       //   return this.$u.toast('请选择出生日期') | ||||||
|       } |       // } | ||||||
|       if(this.info.nation == null) { |       // if(this.info.nation == null) { | ||||||
|         return this.$u.toast('请选择民族') |       //   return this.$u.toast('请选择民族') | ||||||
|       } |       // } | ||||||
|       if(this.info.householdNumber == null || !this.info.householdNumber) { |       // if(this.info.householdNumber == null || !this.info.householdNumber) { | ||||||
|         return this.$u.toast('请输入家庭人口数') |       //   return this.$u.toast('请输入家庭人口数') | ||||||
|       } |       // } | ||||||
|       this.$u.toast(successText) |       this.$u.toast(successText) | ||||||
|  |     }, | ||||||
|  |     back() { | ||||||
|  |       uni.navigateBack({delta: 2}) | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
| } | } | ||||||
| @@ -227,5 +230,8 @@ uni-page-body { | |||||||
|       border: 1px solid #CCC; |       border: 1px solid #CCC; | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |   ::v-deep .u-input__right-icon { | ||||||
|  |     display: none; | ||||||
|  |   } | ||||||
| } | } | ||||||
| </style> | </style> | ||||||
|   | |||||||
| @@ -116,7 +116,7 @@ export default { | |||||||
|   }, |   }, | ||||||
|   methods: { |   methods: { | ||||||
|     getInfo() { |     getInfo() { | ||||||
|       uni.showLoading({title: '加载中'}) |       uni.showLoading({title: '读取中'}) | ||||||
|       this.$http.post(`/app/appbaiduai/queryByInfo?word=${this.word}`).then((res) => { |       this.$http.post(`/app/appbaiduai/queryByInfo?word=${this.word}`).then((res) => { | ||||||
|         if (res.code === 0) { |         if (res.code === 0) { | ||||||
|           this.info = {...res.data} |           this.info = {...res.data} | ||||||
| @@ -137,25 +137,26 @@ export default { | |||||||
|       this.info.birthday = `${e.year}-${e.month}-${e.day}` |       this.info.birthday = `${e.year}-${e.month}-${e.day}` | ||||||
|     }, |     }, | ||||||
|     toConfirm() { |     toConfirm() { | ||||||
|       if(this.info.name == null || !this.info.name) { |       // if(this.info.name == null || !this.info.name) { | ||||||
|         return this.$u.toast('请输入户主姓名') |       //   return this.$u.toast('请输入户主姓名') | ||||||
|       } |       // } | ||||||
|       if(this.info.sex == null) { |       // if(this.info.sex == null) { | ||||||
|         return this.$u.toast('请选择性别') |       //   return this.$u.toast('请选择性别') | ||||||
|       } |       // } | ||||||
|       if(this.info.phone == null || !this.info.phone) { |       // if(this.info.phone == null || !this.info.phone) { | ||||||
|         return this.$u.toast('请输入联系电话') |       //   return this.$u.toast('请输入联系电话') | ||||||
|       } |       // } | ||||||
|       if(this.info.birthday == null) { |       // if(this.info.birthday == null) { | ||||||
|         return this.$u.toast('请选择出生日期') |       //   return this.$u.toast('请选择出生日期') | ||||||
|       } |       // } | ||||||
|       if(this.info.nation == null) { |       // if(this.info.nation == null) { | ||||||
|         return this.$u.toast('请选择民族') |       //   return this.$u.toast('请选择民族') | ||||||
|       } |       // } | ||||||
|       if(this.info.householdNumber == null || !this.info.householdNumber) { |       // if(this.info.householdNumber == null || !this.info.householdNumber) { | ||||||
|         return this.$u.toast('请输入家庭人口数') |       //   return this.$u.toast('请输入家庭人口数') | ||||||
|       } |       // } | ||||||
|       uni.navigateTo({url: `./formConfirm?word=${this.word}`}) |       var info = JSON.stringify(this.info) | ||||||
|  |       uni.navigateTo({url: `./formConfirm?info=${info}`}) | ||||||
|     }, |     }, | ||||||
|     back() { |     back() { | ||||||
|       uni.navigateBack() |       uni.navigateBack() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user