worker.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view>
  3. <form @submit="formSubmit" @reset="formReset">
  4. <input type="hidden" style="width: 0;height: 0;display: none;" class="" name="id" :value=id />
  5. <view class="tr">
  6. <view class="td-left">
  7. 用户名称:
  8. </view>
  9. <view class="td-right">
  10. <input type="text" class="input" name="workName" :value=workName />
  11. </view>
  12. </view>
  13. <view class="bomtom" >
  14. <button type="primary" formType="submit" >
  15. <p class="p1">提交</p>
  16. </button>
  17. </view>
  18. </form>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. id: null,
  26. workName: null
  27. }
  28. },
  29. onLoad: function(option) {
  30. this.id = option.id;
  31. this.workName = option.workName;
  32. console.log(this.workName);
  33. },
  34. methods: {
  35. formSubmit(event) {
  36. var that = this;
  37. var weixin = event.detail.value;
  38. var serverUrl = that.serverurl;
  39. var token = uni.getStorageSync("token");
  40. var id = weixin.id;
  41. var workName = weixin.workName;
  42. if(workName==null||workName==''){
  43. return ;
  44. }
  45. uni.request({
  46. url: serverUrl + "/TWeixin/updateWeixin?id=" + id + "&workName=" + workName,
  47. method: "POST",
  48. header: {
  49. 'token': token
  50. },
  51. success: (Result) => {
  52. var res = Result;
  53. uni.showModal({
  54. title: '提示',
  55. content: res.data.message,
  56. });
  57. }
  58. });
  59. }
  60. }
  61. }
  62. </script>
  63. <style>
  64. .tr {
  65. padding-top: 15upx;
  66. display: flex;
  67. flex-direction: row;
  68. justify-content: flex-start;
  69. font-size: 26upx;
  70. font-family: "PingFang-SC-Bold";
  71. }
  72. .td-left {
  73. font-family: "PingFang-SC-Bold";
  74. /* font-weight: bold; */
  75. margin: auto;
  76. font-size: 40upx;
  77. width: 30%;
  78. text-align: right;
  79. }
  80. .td-right {
  81. font-family: "PingFang-SC-Bold";
  82. /* font-weight: bold; */
  83. margin: auto;
  84. font-size: 40upx;
  85. width: 65%;
  86. text-align: left;
  87. }
  88. .button {
  89. margin: auto;
  90. width: 60%;
  91. height: 100upx;
  92. }
  93. .input {
  94. /* padding: 10upx 20upx 10upx 0upx; */
  95. padding-left: 20upx;
  96. padding-top: 10upx;
  97. background-color: #FFFFFF;
  98. width: 450upx;
  99. height: 50upx;
  100. box-shadow: 0upx 0upx 20upx #D3D3D3;
  101. border-radius: 5upx;
  102. }
  103. .p1 {
  104. height: 80upx;
  105. font-family: "PingFang-SC-Bold";
  106. font-weight: bold;
  107. margin: auto;
  108. font-size: 40upx;
  109. color: #363D44;
  110. }
  111. .bomtom {
  112. position: absolute;
  113. bottom: 0;
  114. left: 50%;
  115. transform: translate(-50%, 0%);
  116. padding-bottom: 40upx;
  117. }
  118. </style>