kf.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view class="content">
  3. <view class="flex kf-wrap">
  4. <image src="../../static/img/kfheader.png" mode=""></image>
  5. <view class="kf-info">
  6. <view class="kf-name">Json</view>
  7. <view class="">{{ $t('kf.zx') }}</view>
  8. </view>
  9. </view>
  10. <view class="" style="height: 200rpx;"></view>
  11. <view class="flex lt lt-left">
  12. <view class="lt-time"></view>
  13. <view class="lt-wrap">{{ $t('kf.nh') }}</view>
  14. </view>
  15. <view class="flex lt" v-for="item in list" :class="{ 'lt-right': item.type == 2 }">
  16. <view class="lt-time">{{ item.time }}</view>
  17. <view class="lt-wrap">{{ item.content }}</view>
  18. </view>
  19. <view class="" style="height:120rpx;"></view>
  20. <view class="foot">
  21. <input class="input-text" :placeholder="$t('kf.qsrxxnr')" type="text" v-model="inputValue" />
  22. <view class="sub" @click="sub">{{ $t('kf.fs') }}</view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import { uptxt, getlineinfo } from '@/api/login.js';
  28. export default {
  29. data() {
  30. return {
  31. inputValue: '',
  32. list: [],
  33. subing: false
  34. };
  35. },
  36. onLoad() {
  37. uni.setNavigationBarTitle({ title: this.$t('kf.kf') });
  38. this.getlineinfo();
  39. },
  40. onShow() {},
  41. onReachBottom() {
  42. this.getlineinfo();
  43. },
  44. onReady() {},
  45. methods: {
  46. sub() {
  47. let obj = this;
  48. if (obj.subing) {
  49. return;
  50. }
  51. if (obj.inputValue == '') {
  52. return obj.$api.msg(this.$t('qsrxxnr'));
  53. }
  54. obj.subing = true;
  55. uptxt({
  56. txt: obj.inputValue
  57. })
  58. .then(res => {
  59. console.log(res);
  60. obj.getlineinfo();
  61. obj.inputValue = '';
  62. obj.subing = false;
  63. })
  64. .catch(err => {
  65. obj.subing = false;
  66. });
  67. },
  68. getlineinfo() {
  69. getlineinfo().then(res => {
  70. console.log(res);
  71. this.list = res.data;
  72. });
  73. }
  74. }
  75. };
  76. </script>
  77. <style lang="scss">
  78. page {
  79. height: 100%;
  80. background-color: #fff;
  81. }
  82. .foot {
  83. box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
  84. position: fixed;
  85. width: 100%;
  86. height: 100rpx;
  87. left: 0upx;
  88. bottom: 0;
  89. overflow: hidden;
  90. // background-color: red;
  91. background-color: #fff;
  92. display: flex;
  93. align-items: center;
  94. justify-content: center;
  95. .input-text {
  96. line-height: 80rpx;
  97. height: 80rpx;
  98. width: 500rpx;
  99. // width: ;
  100. padding-left: 20rpx;
  101. border-radius: 20rpx;
  102. border: 1px solid #f5f5f5;
  103. margin-right: 40rpx;
  104. }
  105. .sub {
  106. width: 160rpx;
  107. height: 80rpx;
  108. line-height: 80rpx;
  109. background: linear-gradient(to left, #eeb80d, #ffe35b);
  110. text-align: center;
  111. border-radius: 20rpx;
  112. }
  113. }
  114. .lt-wrap {
  115. width: 514rpx;
  116. font-size: 28rpx;
  117. color: #707a8a;
  118. background-color: #f5f5f5;
  119. border-radius: 15rpx;
  120. padding: 10rpx 20rpx;
  121. }
  122. .lt {
  123. margin-bottom: 20rpx;
  124. padding: 0 40rpx;
  125. flex-direction: column;
  126. .lt-time {
  127. font-size: 28rpx;
  128. color: #fcd535;
  129. margin-bottom: 10rpx;
  130. }
  131. }
  132. .lt-right {
  133. // align-content: flex-end;
  134. align-items: flex-end;
  135. }
  136. .lt-left {
  137. align-items: flex-start;
  138. }
  139. .kf-wrap {
  140. // border-bottom: 1px solid;
  141. background-color: #fff;
  142. position: fixed;
  143. top: 44px;
  144. box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
  145. height: 180rpx;
  146. width: 100%;
  147. padding: 20rpx 40rpx;
  148. justify-content: flex-start;
  149. align-items: center;
  150. image {
  151. width: 140rpx;
  152. height: 140rpx;
  153. }
  154. .kf-info {
  155. color: #eeb80d;
  156. font-size: 28rpx;
  157. padding-left: 10rpx;
  158. .kf-name {
  159. font-size: 40rpx;
  160. color: #707a8a;
  161. margin-bottom: 10rpx;
  162. }
  163. }
  164. }
  165. </style>