record.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  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 style="margin: 20rpx 0 0 30rpx;width: 72%;">
  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: 16%; justify-content: flex-end;margin-top: 40rpx;">
  34. <view style="color: #FE6430;margin-right: 16rpx;"
  35. v-if="item.status == '审核中' || item.status == '未审核'|| item.status == '待审核'">{{item.status}}
  36. </view>
  37. <view style="color: #22C572;margin-right: 16rpx;" v-if="item.status == '已通过'">{{item.status}}</view>
  38. <view style="color: #FB1E1E;margin-right: 16rpx;" 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. this.release = []
  137. },
  138. onReachBottom() { //上拉触底函数
  139. var that = this
  140. if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
  141. this.isLoadMore = true
  142. this.currentPage += 1
  143. setTimeout(function() {
  144. uni.stopPullDownRefresh();
  145. that.getRelease()
  146. }, 1000);
  147. // this.getRelease()
  148. }
  149. },
  150. methods: {
  151. navBack() {
  152. uni.navigateBack(1)
  153. },
  154. querys(item) {
  155. for (var i = 0; i < this.choices.length; i++) {
  156. if (this.choices[i].name == item.name) {
  157. this.choices[i].check = true
  158. this.choices[i].changeCss = "label2"
  159. } else {
  160. this.choices[i].check = false
  161. this.choices[i].changeCss = "label"
  162. }
  163. }
  164. if (item.name == "审核中") {
  165. this.searchType = "1"
  166. } else if (item.name == "已通过") {
  167. this.searchType = "2"
  168. } else if (item.name == "未通过") {
  169. this.searchType = "3"
  170. } else {
  171. this.searchType = ""
  172. }
  173. this.getRelease()
  174. },
  175. getRelease() {
  176. if (!this.searchType) {
  177. this.$api.doRequest('get', '/settledCompanyDynamics/selectSettledCompanyDynamicsPage', {
  178. currentPage: this.currentPage,
  179. pageSize: this.pageSize,
  180. loginPhone: this.userInfo.phone,
  181. searchType: this.searchType
  182. })
  183. .then(res => {
  184. if (res.data.code == 200) {
  185. if(this.currentPage = 1 ){
  186. this.release = []
  187. }
  188. this.releaseInfo = res.data.data.records
  189. if (this.releaseInfo.length > 0) {
  190. this.release = this.release.concat(this.releaseInfo)
  191. this.count = this.release.length
  192. this.isLoadMore = false
  193. for (let i = 0; i < this.release.length; i++) {
  194. this.release[i].imgList = this.release[i].address.split(",")
  195. }
  196. } else {
  197. this.loadStatus = 'nomore'
  198. }
  199. }
  200. })
  201. this.searchTypeInfo = this.searchType
  202. } else {
  203. if (this.searchTypeInfo == this.searchType) {
  204. // this.loadStatus = "loading"
  205. this.$api.doRequest('get', '/settledCompanyDynamics/selectSettledCompanyDynamicsPage', {
  206. currentPage: this.currentPage,
  207. pageSize: this.pageSize,
  208. loginPhone: this.userInfo.phone,
  209. searchType: this.searchType
  210. })
  211. .then(res => {
  212. if (res.data.code == 200) {
  213. this.releaseInfo = res.data.data.records
  214. if (this.releaseInfo.length > 0) {
  215. this.release = this.release.concat(this.releaseInfo)
  216. this.count = this.release.length
  217. this.isLoadMore = false
  218. for (let i = 0; i < this.release.length; i++) {
  219. this.release[i].imgList = this.release[i].address.split(",")
  220. }
  221. } else {
  222. this.loadStatus = 'nomore'
  223. }
  224. }
  225. })
  226. } else {
  227. this.release = []
  228. this.currentPage = 1
  229. this.$api.doRequest('get', '/settledCompanyDynamics/selectSettledCompanyDynamicsPage', {
  230. currentPage: this.currentPage,
  231. pageSize: this.pageSize,
  232. loginPhone: this.userInfo.phone,
  233. searchType: this.searchType
  234. })
  235. .then(res => {
  236. if (res.data.code == 200) {
  237. this.releaseInfo = res.data.data.records
  238. if (this.releaseInfo.length > 0) {
  239. this.release = this.release.concat(this.releaseInfo)
  240. this.count = this.release.length
  241. this.isLoadMore = false
  242. for (let i = 0; i < this.release.length; i++) {
  243. this.release[i].imgList = this.release[i].address.split(",")
  244. }
  245. } else {
  246. this.loadStatus = 'nomore'
  247. }
  248. }
  249. })
  250. }
  251. this.searchTypeInfo = this.searchType
  252. }
  253. },
  254. delRecord(item) {
  255. var that = this
  256. uni.showModal({
  257. content: "确定删除该动态?",
  258. showCancel: true,
  259. confirmText: '确定',
  260. success: function(res) {
  261. if (res.confirm) {
  262. that.$api.doRequest('post',
  263. '/settledCompanyDynamics/api/deleteSettledCompanyInfo', {
  264. id: item.id,
  265. phone: item.phone
  266. })
  267. .then(res => {
  268. if (res.data.code == 200) {
  269. uni.showToast({
  270. title: '删除成功!',
  271. icon: 'none',
  272. duration: 2000,
  273. success() {
  274. setTimeout(function() {
  275. that.getRelease()
  276. }, 1000);
  277. }
  278. })
  279. }
  280. })
  281. }
  282. }
  283. })
  284. }
  285. }
  286. }
  287. </script>
  288. <style lang="scss" scoped>
  289. .center {
  290. overflow: scroll;
  291. }
  292. .topCss {
  293. overflow: scroll;
  294. background: url(../../static/img/liangmai/record@3x.png);
  295. background-size: 100%;
  296. background-repeat: no-repeat;
  297. }
  298. .back-btn {
  299. position: absolute;
  300. left: 40upx;
  301. z-index: 9999;
  302. padding-top: var(--status-bar-height);
  303. top: 40upx;
  304. font-size: 40upx;
  305. color: #fff;
  306. }
  307. .modular {
  308. width: 94%;
  309. margin: 40rpx auto;
  310. background-color: #FFFFFF;
  311. border-radius: 40rpx;
  312. // margin-top: 40rpx;
  313. }
  314. .modular {
  315. width: 94%;
  316. margin: 20rpx auto;
  317. background-color: #FFFFFF;
  318. border-radius: 40rpx;
  319. margin-top: 40rpx;
  320. }
  321. .introduce {
  322. // height: 300rpx;
  323. background-color: #FFFFFF;
  324. border-top-right-radius: 40rpx;
  325. border-top-left-radius: 40rpx;
  326. margin-top: 250rpx;
  327. }
  328. .portrait {
  329. width: 120rpx;
  330. height: 120rpx;
  331. margin: 0 auto 0;
  332. position: relative;
  333. top: -70rpx;
  334. }
  335. .name {
  336. text-align: center;
  337. color: #333333;
  338. font-size: 40rpx;
  339. margin-top: -30rpx;
  340. }
  341. .dongtai {
  342. text-align: center;
  343. }
  344. .labels {
  345. width: 140rpx;
  346. text-align: center;
  347. margin-top: 60rpx;
  348. }
  349. .label {
  350. color: #333333;
  351. font-size: 32rpx;
  352. }
  353. .label2 {
  354. color: #333333;
  355. font-size: 36rpx;
  356. font-weight: 600;
  357. }
  358. .touxiang {
  359. width: 76rpx;
  360. height: 76rpx;
  361. margin: 20rpx 0 0 34rpx;
  362. }
  363. .title {
  364. font-size: 38rpx;
  365. font-weight: 600;
  366. margin-left: 30rpx;
  367. }
  368. .titleText {
  369. font-size: 30rpx;
  370. margin-left: 30rpx;
  371. margin-top: 10rpx;
  372. }
  373. .imgList {
  374. width: 100%;
  375. margin-top: 30rpx;
  376. flex-wrap: wrap;
  377. }
  378. .address {
  379. width: 60%;
  380. height: 48rpx;
  381. background-color: #F5F6FA;
  382. border-radius: 24rpx;
  383. margin-left: 30rpx;
  384. line-height: 48rpx;
  385. margin: 30rpx;
  386. }
  387. </style>