123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532 |
- <template>
- <!-- 我的 -->
- <view class="safeDistance" :style="{paddingTop:height + 'px'}">
- <view style="padding: 10rpx 20rpx 20rpx 20rpx;">
- <view class="card_mine">
- <view class="card_avatar" v-if="token != ''">
- <image class="mine_image" src="../../static/portrait.png" mode=""></image>
- <view class="card_user_title">
- <view class="mine_phone">{{userInfo.username}}</view>
- <view class="mine_phone">{{userInfo.nickName}}</view>
- </view>
- </view>
- <view class="card_avatar" v-else @click="login">
- <image class="mine_image" src="../../static/portrait.png" mode=""></image>
- <view class="mine_title">登录/注册</view>
- </view>
- </view>
- <view class="order_card" :style="{padding:(tableList.length > 5 ? '20rpx 20rpx 0rpx 20rpx' : '20rpx')}">
- <view class="order_head">
- <view class="head_left">我的运单</view>
- <!-- <view class="head_right">
- <view class="head_left">全部</view>
- <u-icon name="arrow-right"></u-icon>
- </view> -->
- </view>
- <view class="card_order">
- <u-scroll-list :indicator="tableList.length > 5 ? true : false" style="width: 100%;">
- <view :class="tableList.length > 5 ? 'card_majority' : 'card_minority'">
- <view class="item_order" v-for="(item,index) in tableList" :key="index"
- @click="goOrder(index)">
- <view class="card_tab_image center_in"
- :style="{background: item.bgColor,backgroundColor:item.colorBg}">
- <span class="iconfont icon_image" :class="item.icon"></span>
- </view>
- <view class="order_title">{{item.title}}</view>
- </view>
- </view>
- </u-scroll-list>
- </view>
- </view>
- <view class="card_system">
- <view class="space_between" @click="changePassword">
- <view style="display: flex;align-items: center;">
- <view class="card_edit_icon center_in">
- <u-icon name="setting" size="22" color="#ffffff"></u-icon>
- </view>
- <view class="option_title">修改密码</view>
- </view>
- <u-icon name="arrow-right" size="20"></u-icon>
- </view>
- </view>
- <view class="card_system">
- <view class="space_between" @click="logOut">
- <view style="display: flex;align-items: center;">
- <view class="card_icon_set center_in">
- <span class="iconfont icon-tuichudenglu"></span>
- </view>
- <view class="option_title">退出登录</view>
- </view>
- <u-icon name="arrow-right" size="20"></u-icon>
- </view>
- </view>
- <!-- <view class="card_system">
- <view class="space_between" @click="handleCheckVersion">
- <view style="display: flex;align-items: center;">
- <view class="card_icon_set center_in violet">
- <u-icon name="info" size="20" color="#ffffff"></u-icon>
- </view>
- <view class="option_title">版本更新</view>
- </view>
- <u-icon name="arrow-right" size="20"></u-icon>
- </view>
- </view> -->
- <!-- <view class="card_system">
- <view class="space_between" @click="bluetoothPrinting">
- <view style="display: flex;align-items: center;">
- <view class="card_edit_icon center_in">
- <u-icon name="setting" size="22" color="#ffffff"></u-icon>
- </view>
- <view class="option_title">蓝牙打印</view>
- </view>
- <u-icon name="arrow-right" size="20"></u-icon>
- </view>
- </view> -->
- <u-modal :show="logoutShow" showCancelButton :title="title" :content='content' @cancel="cancel"
- @confirm="confirm"></u-modal>
- </view>
- </view>
- </template>
- <script>
- const ENV = require('../../.env.js')
- export default {
- props: {
- height: {
- type: [String,Number],
- default: () => '',
- },
- token: {
- type: String,
- default: () => '',
- },
- userInfo: {
- type: Object,
- default: () => {},
- },
- },
- data() {
- return {
- tableList: [],
- list: [{
- title: '全部',
- icon: 'icon-dingdan',
- colorBg: '#4bc7fc',
- bgColor: 'linear-gradient(to right, #84d4f6, #4bc7fc)',
- }, {
- title: '待装箱',
- icon: 'icon-bepacked',
- colorBg: '#db8e3e',
- bgColor: 'linear-gradient(to right, #f6d445, #fecb0e)',
- }, {
- title: '已装箱',
- icon: 'icon-boxed',
- colorBg: '#9ddd54',
- bgColor: 'linear-gradient(to right, #b9f377, #9ddd54)',
- }, {
- title: '已出箱',
- icon: 'icon-boxed',
- colorBg: '#9ddd54',
- bgColor: 'linear-gradient(to right, #b9f377, #9ddd54)',
- }, {
- title: '未入库',
- icon: 'icon-chukudan',
- colorBg: '#fe880e',
- bgColor: 'linear-gradient(to right, #f69f45, #fe880e)',
- }, {
- title: '已入库',
- icon: 'icon-fankudengji',
- colorBg: '#fece56',
- bgColor: 'linear-gradient(to right, #f3d485, #fece56)',
- }, {
- title: '已出库',
- icon: 'icon-yidaoda',
- colorBg: '#9ddd54',
- bgColor: 'linear-gradient(to right, #b9f377, #9ddd54)',
- }, {
- title: '已签收',
- icon: 'icon-qianshou_fill',
- colorBg: '#1cc723',
- bgColor: 'linear-gradient(to right, #54ef5a, #1cc723)',
- }],
- list1: [{
- title: '全部',
- icon: 'icon-dingdan',
- colorBg: '#4bc7fc',
- bgColor: 'linear-gradient(to right, #84d4f6, #4bc7fc)',
- }, {
- title: '待装箱',
- icon: 'icon-bepacked',
- colorBg: '#db8e3e',
- bgColor: 'linear-gradient(to right, #f6d445, #fecb0e)',
- }, {
- title: '已装箱',
- icon: 'icon-boxed',
- colorBg: '#9ddd54',
- bgColor: 'linear-gradient(to right, #b9f377, #9ddd54)',
- }, {
- title: '已出箱',
- icon: 'icon-boxed',
- colorBg: '#9ddd54',
- bgColor: 'linear-gradient(to right, #b9f377, #9ddd54)',
- }, {
- title: '未装车',
- icon: 'icon-xiehuofei',
- colorBg: '#fe880e',
- bgColor: 'linear-gradient(to right, #f69f45, #fe880e)',
- }, {
- title: '已装车',
- icon: 'icon-yizhuangche',
- colorBg: '#fece56',
- bgColor: 'linear-gradient(to right, #f3d485, #fece56)',
- }, {
- title: '已下车',
- icon: 'icon-xiehuo',
- colorBg: '#9ddd54',
- bgColor: 'linear-gradient(to right, #b9f377, #9ddd54)',
- }, {
- title: '已签收',
- icon: 'icon-qianshou_fill',
- colorBg: '#1cc723',
- bgColor: 'linear-gradient(to right, #54ef5a, #1cc723)',
- }],
- list2: [{
- title: '全部',
- icon: 'icon-dingdan',
- colorBg: '#4bc7fc',
- bgColor: 'linear-gradient(to right, #84d4f6, #4bc7fc)',
- }, {
- title: '未发货',
- icon: 'icon-weifahuo',
- colorBg: '#fe880e',
- bgColor: 'linear-gradient(to right, #f69f45, #fe880e)',
- }, {
- title: '已发货',
- icon: 'icon-yifahuo',
- colorBg: '#9ddd54',
- bgColor: 'linear-gradient(to right, #b9f377, #9ddd54)',
- }, {
- title: '已签收',
- icon: 'icon-yidaoda',
- colorBg: '#1cc723',
- bgColor: 'linear-gradient(to right, #54ef5a, #1cc723)',
- }],
- logoutShow: false,
- title: '确定退出?',
- content: '退出登录后将无法查看运单,重新登录后即可查看',
- innerVer: null,
- version: null,
- isCheckVersion: false
- }
- },
- created() {
- if (this.userInfo.userType == 'sys') {
- if (this.userInfo.type == 2) {
- // 仓管
- this.tableList = this.list
- } else if (this.userInfo.type == 3) {
- // 司机
- this.tableList = this.list1
- }
- } else {
- this.tableList = this.list2
- }
- },
- methods: {
- // 修改密码
- changePassword() {
- if (this.token) {
- uni.navigateTo({
- url: '/pages/mine/password'
- });
- } else {
- uni.$u.toast('请先登录')
- }
- },
- // 登录注册
- login() {
- uni.navigateTo({
- url: '/pages/login'
- });
- },
- // 订单页面
- goOrder(index) {
- if (this.token) {
- uni.navigateTo({
- url: '/pages/order/index?current=' + index
- });
- } else {
- uni.$u.toast('请先登录')
- }
- },
- // 退出登录
- logOut() {
- if (this.token) {
- this.logoutShow = true
- } else {
- uni.$u.toast('请先登录')
- }
- },
- // 版本更新
- versionUpdating() {
- // https: //coldlogistics.coldbaozhida.com/smartAppversion.json
- },
- handleCheckVersion() {
- let _this = this;
- // #ifdef APP-PLUS
- _this.isCheckVersion = true;
- plus.screen.lockOrientation('portrait-primary') // 竖屏锁定
- plus.runtime.getProperty(plus.runtime.appid, (widgetInfo) => {
- _this.innerVer = widgetInfo.version;
- _this.version = widgetInfo.versionCode;
- uni.request({
- url: ENV.APP_LINK_URL + '/smartAppversion.json?_t=' + new Date()
- .getTime(), //版本检测
- method: 'GET',
- header: {},
- success: (result) => {
- console.log(result.data.code, 14)
- if (result.data.code === 0) {
- setTimeout(() => {
- _this.isCheckVersion = false;
- }, 100);
- if (result.data.version - _this.version > 0) { // 如果最新版本大于现在已经安装的App的版本
- uni.showModal({
- title: "更新提示",
- content: "发现新版本,请确认下载更新?",
- success: (res) => {
- if (res.confirm) {
- uni.showLoading({
- title: '下载更新包中...'
- });
- uni.downloadFile({
- url: result.data.url,
- success: (downloadResult) => {
- uni.hideLoading();
- if (downloadResult
- .statusCode === 200
- ) {
- plus.runtime
- .install(
- downloadResult
- .tempFilePath, {
- force: true
- },
- function() {
- console
- .log(
- 'App安装成功!'
- );
- uni.showModal({
- title: 'App安装成功!',
- showCancel: false
- })
- plus.runtime
- .restart();
- },
- function(
- e) {
- console
- .log(
- 'App安装失败!'
- );
- })
- }
- }
- });
- }
- }
- })
- } else {
- uni.showModal({
- title: '当前已是最新版本',
- showCancel: false
- })
- }
- }
- }
- })
- })
- // #endif
- },
- // 蓝牙打印
- bluetoothPrinting() {
- uni.navigateTo({
- url: '/pages/mine/bluetooth'
- });
- },
- // 确定退出登录
- confirm() {
- this.$cache.removeToken()
- this.$cache.removeCache('userInfo')
- uni.redirectTo({
- url: '/pages/login'
- })
- },
- // 取消
- cancel() {
- this.logoutShow = false
- },
- }
- }
- </script>
- <style lang="scss">
- .card_user_title {
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- }
- .card_mine {
- margin-top: 10rpx;
- padding: 0rpx 30rpx;
- background-color: #fff;
- border-radius: 20rpx;
- }
- .mine_image {
- width: 100rpx;
- height: 100rpx;
- border-radius: 50%;
- }
- .mine_phone {
- margin-left: 20rpx;
- font-size: 30rpx;
- }
- .mine_title {
- margin-left: 20rpx;
- font-size: 40rpx;
- font-weight: bold;
- }
- .card_avatar {
- display: flex;
- align-items: center;
- padding-top: 30rpx;
- padding-bottom: 30rpx;
- }
- .order_card {
- margin-top: 20rpx;
- background-color: #fff;
- padding: 20rpx;
- border-radius: 20rpx;
- }
- .order_head {
- position: relative;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding-bottom: 20rpx;
- }
- .order_head:before {
- content: " ";
- position: absolute;
- left: 0;
- bottom: 0;
- width: 100%;
- height: 1px;
- border-top: 1px solid #e7e6e4;
- -webkit-transform-origin: 0 0;
- transform-origin: 0 0;
- -webkit-transform: scaleY(0.5);
- transform: scaleY(0.5);
- }
- .head_left {
- margin-right: 10rpx;
- }
- .head_right {
- display: flex;
- align-items: center;
- }
- .card_order {
- margin-top: 30rpx;
- display: flex;
- justify-content: space-around;
- }
- .item_order {
- width: 20%;
- flex: none;
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .card_minority {
- width: 100%;
- display: flex;
- justify-content: space-around;
- }
- .card_majority {
- width: 100%;
- display: flex;
- }
- .card_tab_image {
- width: 80rpx;
- height: 80rpx;
- border-radius: 50%;
- }
- .order_title {
- margin-top: 6rpx;
- font-size: 25rpx;
- }
- .icon_image {
- color: #fff;
- font-size: 37rpx;
- }
- .card_system {
- margin-top: 20rpx;
- background-color: #fff;
- padding: 30rpx 20rpx;
- border-radius: 20rpx;
- }
- .card_mine_option {
- position: relative;
- margin: 20rpx 0rpx;
- padding-bottom: 30rpx;
- }
- .option_title {
- margin-left: 10rpx;
- font-size: 28rpx;
- font-weight: 500;
- }
- .card_edit_icon {
- width: 55rpx;
- height: 55rpx;
- border-radius: 50%;
- background-color: #ff9900;
- }
- .card_icon_set {
- width: 55rpx;
- height: 55rpx;
- border-radius: 50%;
- background-color: #fa3534;
- span {
- color: #fff;
- font-size: 40rpx;
- }
- }
- .violet {
- background-color: #fe654a !important;
- }
- </style>
|