dynamic.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <view class="center">
  3. <u-search placeholder="请输入货名" v-model="keyword" @clear="searchClear" style="width: 96%; margin: 0 auto;"
  4. @custom="getrelease"></u-search>
  5. <view class="bottom flex">
  6. <view class="bottonCss" @click="release">
  7. <image src="../../static/img/liangmai/fabu-2@3x.png" mode="" style="width: 40rpx; height: 40rpx;">
  8. </image>
  9. <view style="color: #22C572;">发布</view>
  10. </view>
  11. <view class="bottonCss" @click="record">
  12. <image src="../../static/img/liangmai/jilu-2@3x.png" mode="" style="width: 40rpx; height: 40rpx;">
  13. </image>
  14. <view style="color: #656765;">记录</view>
  15. </view>
  16. </view>
  17. <view v-for="(item,index) in releaseList">
  18. <view class="modular">
  19. <view class="flex">
  20. <view class="touxiang">
  21. <image :src="portraits" mode="" style="height: 76rpx;border-radius: 8rpx;"></image>
  22. </view>
  23. <view class="" style="margin: 20rpx 30rpx;">
  24. <view style="color: #333333;font-weight: 600;font-size: 34rpx;">{{item.compName}}</view>
  25. <view style="color: #AFB3BF; margin-top: 4rpx;">{{item.updateDate}}</view>
  26. </view>
  27. </view>
  28. <view class="title">{{item.title}}</view>
  29. <view class="titleText">
  30. <!-- {{item.content}} -->
  31. <u-read-more show-height="200" :toggle="true" close-text="展开">
  32. <!-- <rich-text :nodes="item.content"></rich-text> -->
  33. <!-- @load="parseLoaded" -->
  34. <u-parse :html="item.content" ></u-parse>
  35. </u-read-more>
  36. </view>
  37. <view class="imgList flex" v-if="item.address != ''">
  38. <view v-for="(items,count) in item.imgList" style="width: 30%;margin-left: 20rpx;">
  39. <image :src="items" style="height: 220rpx;border-radius: 16rpx;"></image>
  40. </view>
  41. </view>
  42. <view class="flex">
  43. <view class="address flex" style="margin: 30rpx;">
  44. <image src='../../static/img/location.png'
  45. style="width: 26rpx;height: 30rpx;top: 8rpx;margin: 0 10rpx;"></image>
  46. {{item.city}}
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <view v-show="isLoadMore">
  52. <!-- <uni-load-more :status="loadStatus" icon icon-type></uni-load-more> -->
  53. <u-loadmore :status="loadStatus" icon icon-type="circle" margin-bottom="200"/>
  54. </view>
  55. <view style='height:12vh;background:#F5F6FA;line-height:12vh;text-align:center;' v-if='releaseList.length == 0'>
  56. 当前暂无结果
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. import {
  62. mapState
  63. } from 'vuex';
  64. export default {
  65. data() {
  66. return {
  67. keyword: "",
  68. releaseList: [],
  69. releaseInfo: [],
  70. currentPage: 1,
  71. pageSize: 10,
  72. isLoadMore: false,
  73. loadStatus: "loading"
  74. }
  75. },
  76. computed: {
  77. ...mapState(['hasLogin', 'userInfo'])
  78. },
  79. //下拉刷新
  80. onPullDownRefresh() {
  81. this.getrelease()
  82. setTimeout(function() {
  83. uni.stopPullDownRefresh();
  84. }, 1000);
  85. },
  86. onReachBottom() { //上拉触底函数
  87. var that = this
  88. if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
  89. this.isLoadMore = true
  90. this.currentPage += 1
  91. setTimeout(function() {
  92. uni.stopPullDownRefresh();
  93. that.getrelease()
  94. }, 1000);
  95. }
  96. },
  97. onShow() {
  98. this.userName = this.userInfo.userName
  99. this.portraits = this.userInfo.avatarUrl
  100. this.getrelease()
  101. },
  102. methods: {
  103. // parseLoaded() {
  104. // this.$refs.uReadMore.init();
  105. // },
  106. getrelease() {
  107. this.$api.doRequest('get', '/settledCompanyDynamics/selectSettledCompanyDynamicsPage', {
  108. currentPage: this.currentPage,
  109. pageSize: this.pageSize,
  110. searchKeyWord: this.keyword
  111. })
  112. .then(res => {
  113. if (res.data.code == 200) {
  114. this.releaseInfo = res.data.data.records
  115. if (this.releaseInfo.length > 0) {
  116. this.releaseList = this.releaseList.concat(this.releaseInfo)
  117. this.isLoadMore = false
  118. for (let i = 0; i < this.releaseList.length; i++) {
  119. if (this.releaseList[i].address != null) {
  120. this.releaseList[i].imgList = this.releaseList[i].address.split(",")
  121. }
  122. }
  123. } else {
  124. this.loadStatus = 'nomore'
  125. }
  126. }
  127. })
  128. },
  129. searchClear() {
  130. this.keyword = ""
  131. },
  132. release() {
  133. uni.navigateTo({
  134. url: `/pages/grain_pulse/release`
  135. })
  136. },
  137. record() {
  138. uni.navigateTo({
  139. url: `/pages/grain_pulse/record`
  140. })
  141. }
  142. }
  143. }
  144. </script>
  145. <style lang="scss" scoped>
  146. .center {
  147. padding: 10rpx 4rpx;
  148. }
  149. .bottom {
  150. width: 100%;
  151. height: 160rpx;
  152. background-color: #FFFFFF;
  153. position: fixed;
  154. bottom: 0rpx;
  155. z-index: 9999;
  156. }
  157. .bottonCss {
  158. width: 50%;
  159. height: 40rpx;
  160. margin-top: 40rpx;
  161. text-align: center;
  162. }
  163. .modular {
  164. width: 94%;
  165. margin: 40rpx auto;
  166. background-color: #FFFFFF;
  167. border-radius: 40rpx;
  168. // margin-top: 40rpx;
  169. }
  170. .touxiang {
  171. width: 76rpx;
  172. height: 76rpx;
  173. background-color: red;
  174. margin: 20rpx 0 0 34rpx;
  175. }
  176. .title {
  177. font-size: 38rpx;
  178. font-weight: 600;
  179. margin-left: 30rpx;
  180. }
  181. .titleText {
  182. font-size: 30rpx;
  183. margin-left: 30rpx;
  184. margin-top: 10rpx;
  185. }
  186. .imgList {
  187. width: 100%;
  188. margin-top: 30rpx;
  189. flex-wrap: wrap;
  190. }
  191. .address {
  192. width: 60%;
  193. height: 48rpx;
  194. background-color: #F5F6FA;
  195. border-radius: 24rpx;
  196. margin-left: 30rpx;
  197. text-align: center;
  198. line-height: 48rpx;
  199. }
  200. </style>