record.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. <template>
  2. <view class="center">
  3. <view class="topCss">
  4. <view class="back-btn cuIcon-back" @click="navBack"></view>
  5. <view class="introduce">
  6. <view class="portrait">
  7. <image :src="portraits" mode="" style="height: 120rpx;border-radius: 14rpx;"></image>
  8. </view>
  9. <view class="name">{{userName}}</view>
  10. <view class="dongtai">
  11. {{count}}
  12. <text style="color: #AFB3BF;">条动态</text>
  13. </view>
  14. <view class="flex">
  15. <view v-for="(item,index) in choices" class="labels">
  16. <view :class="item.changeCss" @click="querys(item)">{{item.name}}</view>
  17. <view style="width: 40rpx;height: 6rpx;background-color: #22C572;margin: 16rpx auto 0;"
  18. v-if="item.check == true"></view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. <view v-for="(item,index) in release">
  24. <view class="modular">
  25. <view class="flex">
  26. <view class="touxiang">
  27. <image :src="portraits" mode="" style="height: 76rpx;border-radius: 8rpx;"></image>
  28. </view>
  29. <view class="" style="margin: 20rpx 30rpx;">
  30. <view style="color: #333333;font-weight: 600;font-size: 34rpx;">{{item.compName}}</view>
  31. <view style="color: #AFB3BF; margin-top: 4rpx;">{{item.updateDate}}</view>
  32. </view>
  33. <view class="flex" style="width: 40%; justify-content: flex-end;margin: 40rpx;">
  34. <view style="color: #FE6430;"
  35. v-if="item.status == '审核中' || item.status == '未审核'|| item.status == '待审核'">{{item.status}}
  36. </view>
  37. <view style="color: #22C572;" v-if="item.status == '已通过'">{{item.status}}</view>
  38. <view style="color: #FB1E1E;" v-if="item.status == '已驳回'">{{item.status}}</view>
  39. </view>
  40. </view>
  41. <view class="title">{{item.title}}</view>
  42. <view class="titleText">
  43. {{item.content}}
  44. </view>
  45. <view class="imgList flex" v-if="item.address != ''">
  46. <view v-for="(items,count) in item.imgList" style="width: 30%;margin-left: 20rpx;">
  47. <image :src="items" style="height: 220rpx;border-radius: 16rpx;"></image>
  48. </view>
  49. </view>
  50. <view class="flex">
  51. <view class="address flex">
  52. <image src='../../static/img/location.png'
  53. style="width: 26rpx;height: 30rpx;top: 8rpx;margin: 0 10rpx;"></image>
  54. {{item.city}}
  55. </view>
  56. <view style="width: 30%;justify-content: flex-end;margin: 30rpx;" class="flex">
  57. <view @click="delRecord(item)">
  58. <image src='../../static/img/jiaoyi/shanchu@3x.png'
  59. style="width: 32rpx;height: 32rpx;margin-right: 20rpx;top: 4rpx;"></image>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <view v-show="isLoadMore">
  66. <!-- <uni-load-more :status="loadStatus"></uni-load-more> -->
  67. <!-- <u-loadmore :status="status" /> -->
  68. <u-loadmore :status="loadStatus" icon icon-type="circle" margin-bottom="80" margin-top="60rpx" />
  69. </view>
  70. <view style='height:12vh;background:#F5F6FA;line-height:12vh;text-align:center;' v-if='release.length == 0'>
  71. 当前暂无结果
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. import {
  77. mapState
  78. } from 'vuex';
  79. export default {
  80. data() {
  81. return {
  82. count: 0,
  83. portraits: "",
  84. choices: [{
  85. name: "全部",
  86. check: true,
  87. changeCss: "label2",
  88. },
  89. {
  90. name: "审核中",
  91. check: false,
  92. changeCss: "label",
  93. },
  94. {
  95. name: "已通过",
  96. check: false,
  97. changeCss: "label",
  98. },
  99. {
  100. name: "未通过",
  101. check: false,
  102. changeCss: "label",
  103. },
  104. {
  105. name: "已过期",
  106. check: false,
  107. changeCss: "label",
  108. }
  109. ],
  110. release: [],
  111. releaseInfo: [],
  112. currentPage: 1,
  113. pageSize: 10,
  114. imgList: [],
  115. userName: "",
  116. searchType: "",
  117. searchTypeInfo: "",
  118. isLoadMore: false,
  119. loadStatus: "loading",
  120. }
  121. },
  122. computed: {
  123. ...mapState(['hasLogin', 'userInfo'])
  124. },
  125. onShow() {
  126. this.userName = this.userInfo.userName
  127. this.portraits = this.userInfo.avatarUrl
  128. this.getRelease()
  129. },
  130. //下拉刷新
  131. onPullDownRefresh() {
  132. this.getRelease()
  133. setTimeout(function() {
  134. uni.stopPullDownRefresh();
  135. }, 1000);
  136. },
  137. onReachBottom() { //上拉触底函数
  138. var that = this
  139. if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
  140. this.isLoadMore = true
  141. this.currentPage += 1
  142. setTimeout(function() {
  143. uni.stopPullDownRefresh();
  144. that.getRelease()
  145. }, 1000);
  146. // this.getRelease()
  147. }
  148. },
  149. methods: {
  150. navBack() {
  151. uni.navigateBack(1)
  152. },
  153. querys(item) {
  154. for (var i = 0; i < this.choices.length; i++) {
  155. if (this.choices[i].name == item.name) {
  156. this.choices[i].check = true
  157. this.choices[i].changeCss = "label2"
  158. } else {
  159. this.choices[i].check = false
  160. this.choices[i].changeCss = "label"
  161. }
  162. }
  163. if (item.name == "审核中") {
  164. this.searchType = "1"
  165. } else if (item.name == "已通过") {
  166. this.searchType = "2"
  167. } else if (item.name == "未通过") {
  168. this.searchType = "3"
  169. } else {
  170. this.searchType = ""
  171. }
  172. this.getRelease()
  173. },
  174. getRelease() {
  175. this.$api.doRequest('get', '/settledCompanyDynamics/selectSettledCompanyDynamicsPage', {
  176. currentPage: this.currentPage,
  177. pageSize: this.pageSize,
  178. loginPhone: this.userInfo.phone,
  179. searchType: this.searchType
  180. })
  181. .then(res => {
  182. if (res.data.code == 200) {
  183. if (!this.searchType) {
  184. this.releaseInfo = res.data.data.records
  185. if (this.releaseInfo.length > 0) {
  186. this.release = this.release.concat(this.releaseInfo)
  187. this.count = this.release.length
  188. this.isLoadMore = false
  189. for (let i = 0; i < this.release.length; i++) {
  190. this.release[i].imgList = this.release[i].address.split(",")
  191. }
  192. } else {
  193. this.loadStatus = 'nomore'
  194. }
  195. } else {
  196. debugger
  197. if (this.searchTypeInfo == this.searchType) {
  198. this.releaseInfo = res.data.data.records
  199. if (this.releaseInfo.length > 0) {
  200. this.release = this.release.concat(this.releaseInfo)
  201. this.count = this.release.length
  202. this.isLoadMore = false
  203. for (let i = 0; i < this.release.length; i++) {
  204. this.release[i].imgList = this.release[i].address.split(",")
  205. }
  206. } else {
  207. this.loadStatus = 'nomore'
  208. }
  209. }else{
  210. this.release = []
  211. this.releaseInfo = res.data.data.records
  212. if (this.releaseInfo.length > 0) {
  213. this.release = this.release.concat(this.releaseInfo)
  214. this.count = this.release.length
  215. this.isLoadMore = false
  216. for (let i = 0; i < this.release.length; i++) {
  217. this.release[i].imgList = this.release[i].address.split(",")
  218. }
  219. } else {
  220. this.loadStatus = 'nomore'
  221. }
  222. }
  223. this.searchTypeInfo = this.searchType
  224. }
  225. }
  226. })
  227. },
  228. delRecord(item) {
  229. var that = this
  230. uni.showModal({
  231. content: "确定删除该动态?",
  232. showCancel: true,
  233. confirmText: '确定',
  234. success: function(res) {
  235. if (res.confirm) {
  236. that.$api.doRequest('post',
  237. '/settledCompanyDynamics/api/deleteSettledCompanyInfo', {
  238. id: item.id,
  239. phone: item.phone
  240. })
  241. .then(res => {
  242. if (res.data.code == 200) {
  243. uni.showToast({
  244. title: '删除成功!',
  245. icon: 'none',
  246. duration: 2000,
  247. success() {
  248. setTimeout(function() {
  249. that.getRelease()
  250. }, 1000);
  251. }
  252. })
  253. }
  254. })
  255. }
  256. }
  257. })
  258. }
  259. }
  260. }
  261. </script>
  262. <style lang="scss" scoped>
  263. .center {
  264. overflow: scroll;
  265. }
  266. .topCss {
  267. overflow: scroll;
  268. background: url(../../static/img/liangmai/record@3x.png);
  269. background-size: 100%;
  270. background-repeat: no-repeat;
  271. }
  272. .back-btn {
  273. position: absolute;
  274. left: 40upx;
  275. z-index: 9999;
  276. padding-top: var(--status-bar-height);
  277. top: 40upx;
  278. font-size: 40upx;
  279. color: #fff;
  280. }
  281. .modular {
  282. width: 94%;
  283. margin: 40rpx auto;
  284. background-color: #FFFFFF;
  285. border-radius: 40rpx;
  286. // margin-top: 40rpx;
  287. }
  288. .modular {
  289. width: 94%;
  290. margin: 20rpx auto;
  291. background-color: #FFFFFF;
  292. border-radius: 40rpx;
  293. margin-top: 40rpx;
  294. }
  295. .introduce {
  296. // height: 300rpx;
  297. background-color: #FFFFFF;
  298. border-top-right-radius: 40rpx;
  299. border-top-left-radius: 40rpx;
  300. margin-top: 250rpx;
  301. }
  302. .portrait {
  303. width: 120rpx;
  304. height: 120rpx;
  305. margin: 0 auto 0;
  306. position: relative;
  307. top: -70rpx;
  308. }
  309. .name {
  310. text-align: center;
  311. color: #333333;
  312. font-size: 40rpx;
  313. margin-top: -30rpx;
  314. }
  315. .dongtai {
  316. text-align: center;
  317. }
  318. .labels {
  319. width: 140rpx;
  320. text-align: center;
  321. margin-top: 60rpx;
  322. }
  323. .label {
  324. color: #333333;
  325. font-size: 32rpx;
  326. }
  327. .label2 {
  328. color: #333333;
  329. font-size: 36rpx;
  330. font-weight: 600;
  331. }
  332. .touxiang {
  333. width: 76rpx;
  334. height: 76rpx;
  335. margin: 20rpx 0 0 34rpx;
  336. }
  337. .title {
  338. font-size: 38rpx;
  339. font-weight: 600;
  340. margin-left: 30rpx;
  341. }
  342. .titleText {
  343. font-size: 30rpx;
  344. margin-left: 30rpx;
  345. margin-top: 10rpx;
  346. }
  347. .imgList {
  348. width: 100%;
  349. margin-top: 30rpx;
  350. flex-wrap: wrap;
  351. }
  352. .address {
  353. width: 60%;
  354. height: 48rpx;
  355. background-color: #F5F6FA;
  356. border-radius: 24rpx;
  357. margin-left: 30rpx;
  358. line-height: 48rpx;
  359. margin: 30rpx;
  360. }
  361. </style>