record.vue 12 KB

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