You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

103 lines
2.0 KiB

  1. <template>
  2. <view class="bocx">
  3. <view class="box-che">
  4. <input v-model="name" class="box-input" placeholder-class="inpTextBox" type="text" placeholder="请输入" maxlength="15" />
  5. </view>
  6. <view class="nic">请输入签名 (不超过15个字)</view>
  7. <view class="cev" @click="saveName()">保存</view>
  8. </view>
  9. </template>
  10. <script>
  11. var app = getApp();
  12. var util = require("../../utils/util.js");
  13. var config = require("../../config");
  14. export default {
  15. data() {
  16. return {
  17. name: "",
  18. };
  19. },
  20. onLoad: function(options) {
  21. var userInfos = uni.getStorageSync('weapp_session_userInfo_data');
  22. this.name=userInfos.personalProfile;
  23. },
  24. methods: {
  25. saveName() {
  26. var userInfos = uni.getStorageSync('weapp_session_userInfo_data');
  27. if (this.name == "") {
  28. uni.showModal({
  29. title: '提示',
  30. content: '签名不能为空',
  31. showCancel: false
  32. });
  33. } else {
  34. util.getRequestPromise(config.service.upload, {
  35. personalProfile: this.name
  36. }).then(data => {
  37. userInfos.personalProfile = this.name;
  38. uni.setStorageSync('weapp_session_userInfo_data', userInfos); //写入缓存
  39. uni.navigateBack({
  40. delta: 1
  41. });
  42. });
  43. }
  44. }
  45. }
  46. };
  47. </script>
  48. <style>
  49. .bocx{
  50. width: 100%;
  51. height: 100vh;
  52. background-color: #F8F8F8;
  53. }
  54. .box-che{
  55. width: 100%;
  56. height: 102rpx;
  57. background: #FFFFFF;
  58. margin-top: 20rpx;
  59. }
  60. .box-input{
  61. width: 90%;
  62. height: 100%;
  63. line-height: 102rpx;
  64. border: none;
  65. margin-left: 30rpx;
  66. font-size: 30rpx;
  67. color: #303030;
  68. }
  69. .nic{
  70. font-size: 24rpx;
  71. font-weight: 400;
  72. color: #999999;
  73. line-height: 24rpx;
  74. margin-left: 30rpx;
  75. margin-top: 20rpx;
  76. }
  77. .inpTextBox {
  78. width: 90%;
  79. height: 100%;
  80. line-height: 102rpx;
  81. border: none;
  82. font-size: 30rpx;
  83. color: #B2B2B2;
  84. }
  85. .cev{
  86. width: 690rpx;
  87. height: 88rpx;
  88. background: #2671E2;
  89. border-radius: 8rpx;
  90. text-align: center;
  91. line-height: 88rpx;
  92. color: #FFFFFF;
  93. font-size: 30rpx;
  94. margin: 0 auto;
  95. margin-top: 220rpx;
  96. }
  97. </style>