123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- <template>
- <view class="wrap">
- <view class='content1'>
- <view class='row content-item'>
- <view class="left" style="color: #878C9C ;">仓库</view>
- <view class="right">鲅鱼圈库</view>
- </view>
- <view class='row content-item'>
- <textarea disabled placeholder="请输入仓库信息" class="textarea" maxlength="2000" v-model="textareaValue"></textarea>
- <view class="textarea-bottom">{{textareaValue?textareaValue.length:'0'}}/2000字</view>
- </view>
- <view class='row content-item'>
- <u-checkbox disabled activeColor="#19be6b" v-model="value">显示在易粮易运收购信息中</u-checkbox>
- </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 {
- isSHowBtn: true,
- isShowAlert: false,
- content: '当前登入信息验证失败,是否重新登录?',
- textareaValue: '',
- value: ''
- }
- },
- 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: {
- /**
- * 统一跳转接口,拦截未登录路由
- * navigator标签现在默认没有转场动画,所以用view
- */
- navTo(url) {
- if (!this.hasLogin) {
- url = '/pages/public/login';
- }
- uni.navigateTo({
- url
- })
- },
- alertBtn() {
- uni.navigateTo({
- url: '/pages/public/login'
- })
- },
- cancelClick() {
- this.isShowAlert = false
- },
- checkBoxChange(e) {
- console.log(e)
- }
- }
- }
- </script>
- <style lang='scss' scoped>
- page {
- background: #F5F6FA;
- }
- .wrap {
- background: #fff;
- margin: 10px;
- border-radius: 10px;
- padding: 10px;
- }
- .row {
- display: flex;
- justify-content: space-between;
- position: relative;
- /* border-bottom: 1px solid #EEEEEE; */
- .right,
- input {
- font-size: 28rpx;
- // color: #333333;
- }
- }
- .textarea {
- background: #F9F9FA;
- font-size: 12px;
- text-align: left;
- width: 100%;
- height: 60px;
- padding: 10px;
- border-radius: 5px;
- margin-top: 10px;
- height: 50vh;
- padding-bottom: 20rpx;
- }
- .textarea-bottom {
- position: absolute;
- bottom: 20rpx;
- right: 20rpx;
- color: #606266;
- }
- </style>
|