123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387 |
- <template>
- <view class="">
- <view class="header">
- <view class='locationwrap' @click='naviageToPage("/pages/user/depotAcquisition/selectCity")'>
- {{currentCityName}}
- <u-icon name="arrow-down" size="28" class="icon-jt"></u-icon>
- </view>
- <u-search class="search" bg-color="#F5F6F9" placeholder="请输入仓库名" v-model="searchKeyWord"
- :show-action="false" @change="searchChange"></u-search>
- <!-- <view @click='naviageToPage("/pages/user/depotAcquisition/grainDeliveryRecord")'
- class='Regular flex align-item-center distribution justify-center'>
- <image class='cangku' src="../../../static/img/liangmai/cangku.png" mode=""></image>
- </view> -->
- </view>
- <view class="content1" v-for="(item,index) in dataList" :key="index">
- <view class="row row1">
- <view class="title">{{item.warehouseName}}</view>
- <view class='follow' @click="followClick(item)">{{item.follow=='未关注'?'+关注':'已关注'}}</view>
- </view>
- <view class="row2">
- <view class='position'>
- <image class='location' src="../../../static/img/liangmai/icon_ditu.png" mode=""></image>
- {{item.warehousePrivate}}{{item.warehouseCity}}{{item.warehouseArea}}{{item.detailedAddress}}
- </view>
- </view>
- <view class="row3">
- <view class="row3-item">
- <u-read-more color='#22C572' show-height="140" :index="index" :shadow-style="shadowStyle"
- :toggle="true" close-text="展开阅读更多内容" @open='open' @close='close'>
- <rich-text :nodes="item.acquisitionInformation" class="rich-item"></rich-text>
- <!-- @load="parseLoaded" -->
- <!-- <u-parse :html="item.content" ></u-parse> -->
- </u-read-more>
- </view>
- </view>
- <view class="row4">
- <view class="time">{{item.updateDate}}</view>
-
- </view>
- <view class="row4">
- <view></view>
- <view class='flex'>
- <view class="btn"
- @click='naviageToPage("/pages/user/depotAcquisition/grainDeliveryRegistration1?warehouseName="+item.warehouseName+"&warehouseId="+item.warehouseId+"&warehousePrivate="+item.warehousePrivate+"&warehouseCity="+item.warehouseCity+"&warehouseArea="+item.warehouseArea+"&detailedAddress="+item.detailedAddress+"&compId="+item.compId)'>
- 贸易粮叫号
- </view>
- <view class="btn"
- @click='naviageToPage("/pages/user/depotAcquisition/grainDeliveryRegistration?warehouseName="+item.warehouseName+"&warehouseId="+item.warehouseId+"&warehousePrivate="+item.warehousePrivate+"&warehouseCity="+item.warehouseCity+"&warehouseArea="+item.warehouseArea+"&detailedAddress="+item.detailedAddress+"&compId="+item.compId)'>
- 自产粮叫号
- </view>
-
- </view>
-
-
- </view>
- </view>
- <u-modal confirm-color='#22C572' @confirm="confirm" show-cancel-button='false' class='radio' title='查看叫号记录' v-model="show" >
- <view class="slot-content ">
- <u-radio-group active-color='#22C572' v-model="value" @change="radioGroupChange">
- <u-radio name="贸易粮叫号记录">贸易粮叫号记录</u-radio>
- <u-radio name="自产粮叫号记录">自产粮叫号记录</u-radio>
- </u-radio-group>
- </view>
- </u-modal>
- <u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
- :content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='提示'
- :showCancelButton='false' :content="content" @confirm="alertBtn" @cancel="cancelClick"></u-modal>
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex';
- export default {
- components: {
- },
- data() {
- return {
- show:false,
- value:'贸易粮叫号记录',
- isShowAlert: false,
- content: '当前登入信息验证失败,是否重新登录?',
- currentCityName: '',
- searchKeyWord: '',
- shadowStyle: {
- backgroundImage: "none",
- paddingTop: "0",
- marginTop: "20rpx",
- },
- dataList: [],
- currentPage: 1,
- pageSize: 10,
- loadStatus: 'loading',
- isLoadMore: false,
- }
- },
- onLoad() {
- },
- // #ifndef MP
- onNavigationBarButtonTap(e) {
- const index = e.index;
- if (index == 1) {
- uni.navigateBack()
- } else {
- this.show=true
- }
- },
- // #endif
- computed: {
- ...mapState(['hasLogin', 'userInfo']),
- },
- onReachBottom() { //上拉触底函数
- if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
- this.isLoadMore = true
- this.currentPage += 1
- this.getListData()
- }
- },
- onPullDownRefresh() {
- this.currentPage = 1
- this.isLoadMore = false
- this.loadStatus = 'loading'
- this.dataList = []
- this.getListData()
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 1000);
- },
- onShow() {
- let _city = uni.getStorageSync("depotAcquisition_selectCity")
- this.currentCityName = _city ? _city.positionName.cityName : ''
- // this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
- // console.log("checkSession", res)
- // if (res.data.data == "INVALID") {
- // this.isShowAlert = true;
- // }
- // this.currentPage = 1
- // this.isLoadMore = false
- // this.loadStatus = 'more'
- // this.getListData()
- // })
- this.currentPage = 1
- this.isLoadMore = false
- this.loadStatus = 'more'
- this.getListData()
- console.log("hasLogin", this.hasLogin)
- },
- methods: {
- confirm(){
- if(this.value=='自产粮叫号记录') this.naviageToPage("/pages/user/depotAcquisition/grainDeliveryRecord")
- else uni.navigateTo({url:'/pages/user/depotAcquisition/grainDeliveryRecord1'})
- },
- radioGroupChange(e){
- this.value=e
- },
- getListData() {
- if (this.currentCityName == '全国') this.currentCityName = ''
- this.$api.doRequest('get', '/acquisitionInfo/selectAcquisitionPage', {
- searchKeyWord: this.searchKeyWord,
- city: this.currentCityName,
- compId: uni.getStorageSync('pcUserInfo').compId,
- loginPhone:uni.getStorageSync("userInfo").phone,
-
- }).then(res => {
- if (res.data.code == "200") {
- if (this.currentCityName == '') this.currentCityName = '全国'
- this.dataList = res.data.data
- this.isLoadMore = true
- this.loadStatus = 'nomore'
- }
- })
- },
- followClick(val) {
- console.log(val)
- let _url = ''
- if(val.follow=='已关注'){
- _url = '/acquisitionInfo/api/followNot'
- }else{
- _url = '/acquisitionInfo/api/follow'
- }
- this.$api.doRequest('post', _url, {
- id: val.id,
- commonId: uni.getStorageSync("userInfo").id,
- loginPhone:uni.getStorageSync("userInfo").phone,
- warehouseName:val.warehouseName,
- }).then(res => {
- if (res.data.code == "200") {
- if (val.follow == '未关注') {
- val.follow = '已关注'
- this.$api.msg('关注成功')
- } else {
- val.follow = '未关注'
- this.$api.msg('取消关注成功')
- }
- this.$forceUpdate()
- }
- })
-
-
-
- // this.$api.doRequest('post', '/acquisitionInfo/api/editFollowFlag', {
- // id: val.id,
- // commonId: uni.getStorageSync("userInfo").id,
- // }).then(res => {
- // if (res.data.code == "200") {
- // if (res.data.data == '1') {
- // val.followFlag = '1'
- // this.$api.msg('关注成功')
- // } else {
- // val.followFlag = '0'
- // this.$api.msg('取消关注成功')
- // }
- // this.$forceUpdate()
- // }
- // })
- },
- open(e) {
- console.log(e)
- },
- close(e) {
- console.log(e)
- },
- /**
- * 统一跳转接口,拦截未登录路由
- * navigator标签现在默认没有转场动画,所以用view
- */
- naviageToPage(url) {
- if (!this.hasLogin) {
- url = '/pages/public/login';
- }
- uni.navigateTo({
- url
- })
- },
- alertBtn() {
- uni.navigateTo({
- url: '/pages/public/login'
- })
- },
- cancelClick() {
- this.isShowAlert = false
- },
- searchChange(e) {
- console.log(e)
- this.getListData()
- }
- }
- }
- </script>
- <style lang='scss' scoped>
- page {
- background: #F5F6FA;
- }
- .wrap {
- background: #fff;
- margin: 10px;
- border-radius: 10px;
- padding: 10px;
- /* position: relative; */
- top: 20rpx;
- }
- .header {
- padding: 25rpx;
- background: #fff;
- border-radius: 0 0 10px 10px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- position: relative;
- /deep/.u-content {
- padding-left: 180rpx;
- }
- }
- .location {
- width: 32rpx;
- height: 32rpx;
- margin-right: 10rpx;
- }
- .locationwrap {
- font-size: 16px;
- display: flex;
- align-items: center;
- position: absolute;
- top: 0;
- bottom: 0;
- margin: auto;
- /* height: 100%; */
- left: 60rpx
- }
- .cangku {
- width: 16.5px;
- height: 16.5px;
- margin-right: 5px;
- }
- .search {}
- .rich-item {
- line-height: 46rpx;
- }
- .row1 {
- display: flex;
- justify-content: space-between;
- }
- .row4 {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .btn {
- background: #22C572;
- border-radius: 40rpx;
- font-size: 28rpx;
- font-weight: 400;
- color: #FFFFFF;
- padding: 10rpx 30rpx;
- margin:10rpx;
- }
- .time {
- color: #878C9C;
- margin: 20rpx 0;
- }
- }
- .icon-jt {
- margin-left: 20rpx;
- }
- .content1 {
- background: white;
- margin: 20rpx;
- padding: 30rpx;
- border-radius: 20rpx;
- .row1 {
- .title {
- font-size: 32rpx;
- font-weight: 500;
- color: #333333;
- }
- .follow {
- border: 1px solid #EEEEEE;
- font-weight: 400;
- color: #878C9C;
- padding: 9rpx 28rpx;
- border-radius: 40rpx;
- }
- }
- .row2 {
- .position {
- margin: 20rpx 0;
- font-size: 12px;
- color: #676E80;
- background: #F5F6FA;
- padding: 0rpx 20rpx;
- height: 50rpx;
- display: flex;
- align-items: center;
- border-radius: 50rpx;
- }
- }
- }
- .slot-content{
- text-align:center;
- height:120rpx;
- line-height: 120rpx;
- }
- </style>
|