123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495 |
- <template>
- <view class="center">
- <!-- <view class="bottom flex">
- <view class="bottonCss" @click="releaseclick">
- <image src="../../static/img/liangmai/fabu-2@3x.png" mode="" style="width: 40rpx; height: 40rpx;">
- </image>
- <view style="color: #656765;">发布</view>
- </view>
- <view class="bottonCss" @click="record">
- <image src="../../static/img/liangmai/jilu-2-check@3x.png" mode="" style="width: 40rpx; height: 40rpx;">
- </image>
- <view>记录</view>
- </view>
- </view> -->
- <view class="topCss">
- <view class="back-btn cuIcon-back" @click="navBack"></view>
- <view class="introduce">
- <view class="portrait">
- <image :src="portraits" mode="" style="height: 120rpx;border-radius: 14rpx;"></image>
- </view>
- <view class="name">{{userName}}</view>
- <view class="dongtai">
- {{count}}
- <text style="color: #AFB3BF;">条动态</text>
- </view>
- <view class="flex">
- <view v-for="(item,index) in choices" class="labels">
- <view :class="item.changeCss" @click="querys(item)">{{item.name}}</view>
- <view style="width: 40rpx;height: 6rpx;background-color: #22C572;margin: 16rpx auto 0;"
- v-if="item.check == true"></view>
- </view>
- </view>
- </view>
- </view>
- <view v-for="(item,index) in release">
- <view class="modular">
- <view class="flex">
- <view class="touxiang">
- <image v-if='item.avatarUrl' :src="item.avatarUrl" mode="" style="height: 76rpx;border-radius: 8rpx;"></image>
- <image v-else src="../../static/img/myimg/YongHu@3x.png" mode="" style="height: 76rpx;border-radius: 8rpx;"></image>
- </view>
- <view style="margin: 20rpx 0 0 30rpx;width: 72%;">
- <view style="color: #333333;font-weight: 600;font-size: 34rpx;">{{item.compName}}</view>
- <view style="color: #AFB3BF; margin-top: 4rpx;">{{item.updateDate}}</view>
- </view>
- <view class="flex" style="width: 16%; justify-content: flex-end;margin-top: 40rpx;">
- <view style="color: #FE6430;margin-right: 16rpx;"
- v-if="item.status == '审核中' || item.status == '未审核'|| item.status == '待审核'">{{item.status}}
- </view>
- <view style="color: #22C572;margin-right: 16rpx;" v-if="item.status == '已通过'">{{item.status}}</view>
- <view style="color: #FB1E1E;margin-right: 16rpx;" v-if="item.status == '已驳回'">{{item.status}}</view>
- </view>
- </view>
- <view class="title">{{item.title}}</view>
- <view class="titleText">
- {{item.content}}
- </view>
- <view class="imgList flex" v-if="item.address != ''">
- <view v-for="(items,count) in item.imgList" style="width: 30%;margin-left: 20rpx;">
- <image :src="items" style="height: 220rpx;border-radius: 16rpx;"></image>
- </view>
- </view>
- <view class=" addressTitle flex">
- <view class="address flex">
- <image src='../../static/img/location.png'
- style="width: 26rpx;height: 30rpx;top: 8rpx;margin: 0 10rpx;"></image>
- {{item.city}}
- </view>
- <view style="width: 30%;justify-content: flex-end;margin: 30rpx;" class="flex">
- <view @click="delRecord(item)">
- <image src='../../static/img/jiaoyi/shanchu@3x.png'
- style="width: 32rpx;height: 32rpx;margin-right: 20rpx;top: 4rpx;"></image>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view v-show="isLoadMore">
- <!-- <uni-load-more :status="loadStatus"></uni-load-more> -->
- <!-- <u-loadmore :status="status" /> -->
- <u-loadmore :status="loadStatus" icon icon-type="circle" margin-bottom="80" margin-top="60rpx" />
- </view>
- <view style='height:12vh;background:#F5F6FA;line-height:12vh;text-align:center;' v-if='release.length == 0'>
- 当前暂无结果
- </view>
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex';
- export default {
- data() {
- return {
- count: 0,
- portraits: "",
- choices: [{
- name: "全部",
- check: true,
- changeCss: "label2",
- },
- {
- name: "审核中",
- check: false,
- changeCss: "label",
- },
- {
- name: "已通过",
- check: false,
- changeCss: "label",
- },
- {
- name: "未通过",
- check: false,
- changeCss: "label",
- },
- {
- name: "已过期",
- check: false,
- changeCss: "label",
- }
- ],
- release: [],
- releaseInfo: [],
- currentPage: 1,
- pageSize: 10,
- imgList: [],
- userName: "",
- searchType: "",
- searchTypeInfo: "",
- isLoadMore: false,
- loadStatus: "loading",
- }
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo'])
- },
- onShow() {
- console.log(this.userInfo.avatarUrl)
- this.userName = this.userInfo.userName
- this.portraits = this.userInfo.avatarUrl?this.userInfo.avatarUrl:'../../static/img/myimg/YongHu@3x.png'
- this.getData()
- },
- //下拉刷新
- onPullDownRefresh() {
- this.getData()
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 1000);
- this.release = []
- },
- onReachBottom() { //上拉触底函数
- var that = this
- if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
- this.isLoadMore = true
- this.currentPage += 1
- setTimeout(function() {
- uni.stopPullDownRefresh();
- that.getRelease()
- }, 1000);
- // this.getRelease()
- }
- },
- methods: {
- navBack() {
- uni.navigateBack()
- },
- releaseclick() {
- this.$api.doRequest('get', '/settledCompanyInfo/companyList', {loginPhone:this.userInfo.phone})
- .then(res => {
- if (res.data.code == 200) {
- if(res.data.data.length > 0){
- uni.navigateTo({
- url: `/pages/grain_pulse/release`
- })
- }else{
- uni.showModal({
- content: "您还没有入驻粮脉,不能发布,是否前去完善入驻信息!",
- showCancel: true,
- confirmText: '前往',
- success: function(res) {
- if (res.confirm) {
- uni.navigateTo({
- url: `/pages/grain_pulse/enter`
- })
- }
- }
- })
- }
- }
- })
-
- },
- record() {
- uni.navigateTo({
- url: `/pages/grain_pulse/record`
- })
- },
- querys(item) {
- for (var i = 0; i < this.choices.length; i++) {
- if (this.choices[i].name == item.name) {
- this.choices[i].check = true
- this.choices[i].changeCss = "label2"
- } else {
- this.choices[i].check = false
- this.choices[i].changeCss = "label"
- }
- }
- if (item.name == "审核中") {
- this.searchType = "1"
- } else if (item.name == "已通过") {
- this.searchType = "2"
- } else if (item.name == "未通过") {
- this.searchType = "3"
- }else if (item.name == "已过期") {
- this.searchType = "4"
- } else {
- this.searchType = ""
- }
- this.getData()
- },
- getData() {
- this.$api.doRequest('get', '/settledCompanyDynamics/selectSettledCompanyDynamicsPage', {
- currentPage: 1,
- pageSize: 10,
- phone: this.userInfo.phone,
- searchType: this.searchType
- })
- .then(res => {
- console.log("res",res)
- if (res.data.code == 200) {
- this.release = res.data.data.records
- if (this.release.length > 0) {
- this.count = this.release.length
- this.isLoadMore = false
- for (let i = 0; i < this.release.length; i++) {
- this.release[i].imgList = this.release[i].address.split(",")
- }
- }
- }
- })
- },
- getRelease() {
- if (!this.searchType) {
- this.$api.doRequest('get', '/settledCompanyDynamics/selectSettledCompanyDynamicsPage', {
- currentPage: this.currentPage,
- pageSize: this.pageSize,
- phone: this.userInfo.phone,
- searchType: this.searchType
- })
- .then(res => {
- if (res.data.code == 200) {
- this.releaseInfo = res.data.data.records
- if (this.releaseInfo.length > 0) {
- this.release = this.release.concat(this.releaseInfo)
- this.count = this.release.length
- this.isLoadMore = false
- for (let i = 0; i < this.release.length; i++) {
- this.release[i].imgList = this.release[i].address.split(",")
- }
- } else {
- this.loadStatus = 'nomore'
- }
- }
- })
- this.searchTypeInfo = this.searchType
- } else {
- if (this.searchTypeInfo == this.searchType) {
- // this.loadStatus = "loading"
- this.$api.doRequest('get', '/settledCompanyDynamics/selectSettledCompanyDynamicsPage', {
- currentPage: this.currentPage,
- pageSize: this.pageSize,
- loginPhone: this.userInfo.phone,
- searchType: this.searchType
- })
- .then(res => {
- if (res.data.code == 200) {
- this.releaseInfo = res.data.data.records
- if (this.releaseInfo.length > 0) {
- this.release = this.release.concat(this.releaseInfo)
- this.count = this.release.length
- this.isLoadMore = false
- for (let i = 0; i < this.release.length; i++) {
- this.release[i].imgList = this.release[i].address.split(",")
- }
- } else {
- this.loadStatus = 'nomore'
- }
- }
- })
- } else {
- this.$api.doRequest('get', '/settledCompanyDynamics/selectSettledCompanyDynamicsPage', {
- currentPage: this.currentPage,
- pageSize: this.pageSize,
- loginPhone: this.userInfo.phone,
- searchType: this.searchType
- })
- .then(res => {
- if (res.data.code == 200) {
- this.releaseInfo = res.data.data.records
- if (this.releaseInfo.length > 0) {
- this.release = this.release.concat(this.releaseInfo)
- this.count = this.release.length
- this.isLoadMore = false
- for (let i = 0; i < this.release.length; i++) {
- this.release[i].imgList = this.release[i].address.split(",")
- }
- } else {
- this.loadStatus = 'nomore'
- }
- }
- })
- }
- this.searchTypeInfo = this.searchType
- }
- },
- delRecord(item) {
- var that = this
- uni.showModal({
- content: "确定删除该动态?",
- showCancel: true,
- confirmText: '确定',
- success: function(res) {
- if (res.confirm) {
- that.$api.doRequest('post',
- '/settledCompanyDynamics/api/deleteSettledCompanyInfo', {
- id: item.id,
- phone: item.phone
- })
- .then(res => {
- if (res.data.code == 200) {
- uni.showToast({
- title: '删除成功!',
- icon: 'none',
- duration: 2000,
- success() {
- setTimeout(function() {
- that.getData()
- }, 1000);
- }
- })
- }
- })
- }
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .center {
- overflow: scroll;
- margin-bottom: 100rpx;
- }
- .topCss {
- overflow: scroll;
- background: url(../../static/img/liangmai/record@3x.png);
- background-size: 100%;
- background-repeat: no-repeat;
- }
- .back-btn {
- position: absolute;
- left: 40upx;
- z-index: 9999;
- padding-top: var(--status-bar-height);
- top: 40upx;
- font-size: 40upx;
- color: #fff;
- }
- .modular {
- width: 94%;
- margin: 40rpx auto;
- background-color: #FFFFFF;
- border-radius: 40rpx;
- // margin-top: 40rpx;
- }
- .modular {
- width: 94%;
- margin: 20rpx auto;
- background-color: #FFFFFF;
- border-radius: 40rpx;
- margin-top: 40rpx;
- }
- .introduce {
- // height: 300rpx;
- background-color: #FFFFFF;
- border-top-right-radius: 40rpx;
- border-top-left-radius: 40rpx;
- margin-top: 250rpx;
- }
- .portrait {
- width: 120rpx;
- height: 120rpx;
- margin: 0 auto 0;
- position: relative;
- top: -70rpx;
- }
- .name {
- text-align: center;
- color: #333333;
- font-size: 40rpx;
- margin-top: -30rpx;
- }
- .dongtai {
- text-align: center;
- }
- .labels {
- width: 140rpx;
- text-align: center;
- margin-top: 60rpx;
- }
- .label {
- color: #333333;
- font-size: 32rpx;
- }
- .label2 {
- color: #333333;
- font-size: 36rpx;
- font-weight: 600;
- }
- .touxiang {
- width: 76rpx;
- height: 76rpx;
- margin: 20rpx 0 0 34rpx;
- }
- .title {
- font-size: 38rpx;
- font-weight: 600;
- margin-left: 30rpx;
- }
- .titleText {
- font-size: 30rpx;
- margin-left: 30rpx;
- margin-top: 10rpx;
- }
- .imgList {
- width: 100%;
- margin-top: 30rpx;
- flex-wrap: wrap;
- }
- .address {
- width: 60%;
- height: 48rpx;
- background-color: #F5F6FA;
- border-radius: 24rpx;
- margin-left: 30rpx;
- line-height: 48rpx;
- margin: 30rpx;
- }
- .addressTitle{
- height: 90rpx;
- background-color: #F5F6FA;
- border-radius: 24rpx;
- }
- .bottom {
- width: 100%;
- height: 160rpx;
- background-color: #FFFFFF;
- position: fixed;
- bottom: 0rpx;
- z-index: 9999;
- }
- .bottonCss {
- width: 50%;
- height: 40rpx;
- margin-top: 40rpx;
- text-align: center;
- font-size:20rpx;
- }
- </style>
|