send.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <view class="container">
  3. <!-- 页面标题区域 -->
  4. <view class="header" :style="{ height: customBarH * 2 + 'rpx', paddingTop: statusBarH * 2 + 'rpx' }">
  5. <img src="../../static/index/left2.png" :style="{ paddingTop: statusBarH * 2 + 'rpx' }" />
  6. <view class="header_text">发推文</view>
  7. </view>
  8. <!-- 图片视频上传展示区域 -->
  9. <view class="upload">
  10. <view class="upload_img">
  11. <img src="../../static/index/upload-img.png" />
  12. 添加图片
  13. </view>
  14. <view class="upload_video">
  15. <img src="../../static/index/upload-video.png" />
  16. 添加视频
  17. </view>
  18. </view>
  19. <!-- 标题输入区域 -->
  20. <view class="title">
  21. <input class="input" type="text" placeholder-style="color:#B3B3B3" placeholder="请输入标题" v-model="titleValue" />
  22. </view>
  23. <!-- 推文内容输入区域 -->
  24. <view class="content">
  25. <textarea class="textarea" placeholder-style="color:#B3B3B3" maxlength="3000" placeholder="请分享你的故事吧~" v-model="contentValue"></textarea>
  26. <!-- 内容长度 -->
  27. <view class="textarea_length">{{ contentValue.length }}/3000</view>
  28. </view>
  29. <!-- 添加地点区域 -->
  30. <view class="add_place">
  31. <img class="img" src="../../static/index/send-address.png" />
  32. 添加地点
  33. <img class="img2" src="../../static/index/send-right.png" />
  34. </view>
  35. <!-- 关联民宿区域 -->
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. data() {
  41. return {
  42. // 状态栏高度
  43. statusBarH: 0,
  44. // 胶囊按钮栏高度
  45. customBarH: 0,
  46. // 标题数据
  47. titleValue: '',
  48. // 推文内容区域
  49. contentValue: ''
  50. }
  51. },
  52. created() {
  53. // 获取系统信息
  54. uni.getSystemInfo({
  55. success: (e) => {
  56. // 获取状态栏高度
  57. this.statusBarH = e.statusBarHeight + 10
  58. // // 获取菜单按钮栏高度
  59. let custom = uni.getMenuButtonBoundingClientRect()
  60. this.customBarH = custom.height + 10
  61. }
  62. })
  63. }
  64. }
  65. </script>
  66. <style lang="scss">
  67. .container {
  68. height: 100vh;
  69. background-color: #fff;
  70. .header {
  71. display: flex;
  72. justify-content: center;
  73. position: relative;
  74. background-color: #fff;
  75. img {
  76. position: absolute;
  77. top: 0;
  78. left: 0;
  79. width: 47rpx;
  80. height: 47rpx;
  81. }
  82. .header_text {
  83. font-size: 34rpx;
  84. }
  85. }
  86. .upload {
  87. padding: 30rpx 0 10rpx;
  88. display: flex;
  89. .upload_img {
  90. display: flex;
  91. flex-direction: column;
  92. justify-content: center;
  93. align-items: center;
  94. margin-left: 20rpx;
  95. width: 186rpx;
  96. height: 283rpx;
  97. color: #999999;
  98. font-size: 28rpx;
  99. border-radius: 8rpx;
  100. background-color: #e6e6e6;
  101. img {
  102. margin-top: 10rpx;
  103. width: 68rpx;
  104. height: 68rpx;
  105. }
  106. }
  107. .upload_video {
  108. display: flex;
  109. flex-direction: column;
  110. justify-content: center;
  111. align-items: center;
  112. margin-left: 26rpx;
  113. width: 186rpx;
  114. height: 283rpx;
  115. color: #999999;
  116. font-size: 28rpx;
  117. border-radius: 8rpx;
  118. background-color: #e6e6e6;
  119. img {
  120. margin-top: 12rpx;
  121. width: 68rpx;
  122. height: 68rpx;
  123. }
  124. }
  125. }
  126. .title {
  127. margin: auto;
  128. width: 710rpx;
  129. height: 100rpx;
  130. border-bottom: 1rpx solid #e5e5e5;
  131. .input {
  132. box-sizing: border-box;
  133. padding-right: 20rpx;
  134. width: 100%;
  135. height: 100%;
  136. font-size: 32rpx;
  137. }
  138. }
  139. .content {
  140. margin: auto;
  141. width: 710rpx;
  142. height: 290rpx;
  143. font-size: 28rpx;
  144. color: #b3b3b3;
  145. border-bottom: 1rpx solid #e5e5e5;
  146. .textarea {
  147. margin-top: 25rpx;
  148. width: 100%;
  149. height: 240rpx;
  150. }
  151. .textarea_length {
  152. margin-top: 5rpx;
  153. text-align: end;
  154. }
  155. }
  156. .add_place {
  157. display: flex;
  158. align-items: center;
  159. margin: auto;
  160. width: 710rpx;
  161. height: 100rpx;
  162. font-size: 28rpx;
  163. border-bottom: 1rpx solid #e5e5e5;
  164. .img {
  165. margin-right: 10rpx;
  166. width: 55rpx;
  167. height: 55rpx;
  168. }
  169. .img2 {
  170. margin-left: auto;
  171. width: 40rpx;
  172. height: 40rpx;
  173. }
  174. }
  175. }
  176. </style>