checkAdd.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <view>
  3. <uni-nav-bar statusBar backgroundColor="transparent" fixed title="验证信息" left-icon="left" @clickLeft="utils.navigateBack()"></uni-nav-bar>
  4. <view class="info-view">
  5. <view class="label">验证信息</view>
  6. <u--textarea placeholder="请输入验证信息" confirm-type="send" v-model="mono" count ></u--textarea>
  7. </view>
  8. <view class="info-view">
  9. <view class="label">备注名</view>
  10. <view class="input">
  11. <u--input border="none" v-model="remark" placeholder="请输入备注名(可为空)"></u--input>
  12. </view>
  13. </view>
  14. <view style="padding: 10px;">
  15. <view class="app-btn" @tap="tapSubmit">发送</view>
  16. </view>
  17. </view>
  18. </template>
  19. <style lang="scss">
  20. .info-view{margin: 10px;border-radius: 6px;padding: 10px;background: #fff;}
  21. .info-view .label{padding: 10px;border-bottom: 1px solid #f1f1f1;font-size: 14px;color: $ic-default-text;}
  22. .info-view .u-textarea{border: 0;}
  23. .info-view .input{padding: 10px;}
  24. .app-btn{background: $ic-appcolor;padding: 10px;border-radius: 20px;color: #fff;text-align: center;}
  25. </style>
  26. <script>
  27. import {mapState,mapMutations } from 'vuex';
  28. export default {
  29. data() {
  30. return {
  31. mono : "",
  32. usercode : "",
  33. remark : ""
  34. }
  35. },
  36. onLoad(option){
  37. this.usercode = option.userCode || "";
  38. },
  39. methods: {
  40. tapSubmit:function(){
  41. uni.showLoading({ title: '提交中..'});
  42. this
  43. .request
  44. .post("FriendVerification",{
  45. verification:this.mono,
  46. usercode:this.usercode,
  47. remark:this.remark
  48. })
  49. .then(res => {
  50. uni.hideLoading();
  51. if(res.code == 200) {
  52. this.utils.Tip("发送成功",2000,()=>{
  53. uni.navigateBack({ delta:1});
  54. });
  55. } else {
  56. uni.showModal({title: '系统提示',content: res.msg,showCancel: false});
  57. }
  58. })
  59. .catch(res=>{
  60. console.log(res);
  61. uni.hideLoading();
  62. uni.showModal({title: '系统提示',content: '加载失败,重新点击尝试!',showCancel: false});
  63. });
  64. }
  65. }
  66. }
  67. </script>