123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- <template>
- <view class="wrap">
- <view class="header">
- <view class='locationwrap' @click='naviageToPage("/pages/grain_pulse/position/position")'>
- <image class='location' src="../../../static/img/liangmai/icon_ditu@2x.png" mode=""></image>
- {{position.name}}
- </view>
- <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>
- <u-search class="search" placeholder="日照香炉生紫烟" v-model="keyword" :show-action="false" @change="searchChange"></u-search>
- <view class="content1">
- <view class="row row1">
- <view>鲅鱼圈1号库</view>
- <view class='follow'>已关注</view>
- </view>
- <view class="row2">
- <view class='locationwrap' @click='naviageToPage("/pages/grain_pulse/position/position")'>
- <image class='location' src="../../../static/img/liangmai/icon_ditu@2x.png" mode=""></image>
- {{position.name}}
- </view>
- </view>
- <view class="row3">
- <view class="row3-item" v-for="(item,index) in listData" :key='index'>
- <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.content" class="rich-item"></rich-text>
- <!-- @load="parseLoaded" -->
- <!-- <u-parse :html="item.content" ></u-parse> -->
- </u-read-more>
- </view>
- </view>
- <view class="row4">
- <u-button @click='naviageToPage("/pages/user/depotAcquisition/grainDeliveryRegistration")'>我要送粮</u-button>
- <view>2021-11-23</view>
- </view>
- </view>
- <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 {
- isShowAlert: false,
- content: '当前登入信息验证失败,是否重新登录?',
- position: {
- name: '全国'
- },
- keyword: '遥看瀑布挂前川',
- shadowStyle: {
- backgroundImage: "none",
- paddingTop: "0",
- marginTop: "20rpx",
- },
- listData:[
- {
- content:'1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111我按水分地方地方萨芬撒初学者从行政村自行车在X初学者从行政村'
- },{
- content:'222222'
- },
- {
- content:'33333'
- }
- ]
- }
- },
- onLoad() {
- },
- // #ifndef MP
- onNavigationBarButtonTap(e) {
- const index = e.index;
- if (index === 0) {
- this.navTo('/pages/set/set');
- } else if (index === 1) {
- // #ifdef APP-PLUS
- const pages = getCurrentPages();
- const page = pages[pages.length - 1];
- const currentWebview = page.$getAppWebview();
- currentWebview.hideTitleNViewButtonRedDot({
- index
- });
- // #endif
- uni.navigateTo({
- url: '/pages/notice/notice'
- })
- }
- },
- // #endif
- computed: {
- ...mapState(['hasLogin', 'userInfo']),
- },
- onShow() {
- this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
- console.log("checkSession", res)
- if (res.data.data == "INVALID") {
- this.isShowAlert = true;
- // uni.showModal({
- // title: '登录提示',
- // content: '当前登入信息验证失败,是否重新登录?',
- // showCancel: true,
- // confirmText: '登录',
- // success: (e) => {
- // if (e.confirm) {
- // uni.navigateTo({
- // url: '/pages/public/login'
- // })
- // }
- // },
- // fail: () => {},
- // complete: () => {}
- // })
- }
- })
- console.log("hasLogin", this.hasLogin)
- },
- methods: {
- 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)
- }
- }
- }
- </script>
- <style lang='scss' scoped>
- page {
- background: #F5F6FA;
- }
- .wrap {
- background: #fff;
- margin: 10px;
- border-radius: 10px;
- padding: 10px;
- }
- .header {
- padding: 0 25rpx;
- background: #fff;
- border-radius: 0 0 10px 10px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .location {
- width: 32rpx;
- height: 32rpx;
- margin-right: 10rpx;
- }
- .locationwrap {
- font-size: 16px;
- display: flex;
- align-items: center;
- }
- .cangku {
- width: 16.5px;
- height: 16.5px;
- margin-right: 5px;
- }
- .search{
- margin-top: 20rpx!important;
- }
- .rich-item{
- line-height: 44rpx;
- }
- .row1{
- display: flex;
- justify-content: space-between;
- }
- .row4{
- display: flex;
- }
- </style>
|