123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872 |
- <template>
- <view class="container">
- <!-- <view class="user-section">
- <view class="bg">
- <image class="bg_ware" src="https://moyv.top/wechat/images/bg_wave.gif"></image>
- </view>
- <view class="user-info-box">
- <view class="portrait-box">
- <image v-if="userInfo" class="portrait" :src="userInfo.avatarUrl"></image>
- <u-avatar v-else class="portrait" text=""></u-avatar>
- </view>
- <view class="info-box">
- <view @click="toLogin" class="username">{{hasLogin? (userInfo.userName || '点击修改昵称') : '立即登录' }}</view>
- </view>
- </view>
- </view> -->
- <view class="indexUp flex">
- <image v-bind:src="headUrl" class="headPortrait"></image>
- <view class="personal">
- <view @click="toLogin" class="information">{{hasLogin? username : '立即登录' }}</view>
- <view class="information">{{userphone}}</view>
- </view>
- </view>
- <view class="cover-container">
- <view class="cu-list menu text-left solid-top indexlow">
- <view class="cu-item" v-for="(item, index) in gridList" v-if="item.show" :key="index"
- @click="gridClick(item, index)" hover-class="common-hover" :hover-stay-time="50">
- <view>
- <!-- <text :class="item.icon" class="grid_icon icon text-grey"></text> -->
- <image :src="item.src" class="sign"></image>
- <text class="text-grey">{{item.name}}</text>
- </view>
- <view>
- <text v-if='item.num==2&&taskTip' class='badge_user'>{{taskTip}}</text>
- <text v-if='item.num==1&&contractTip' class='badge_user'>{{contractTip}}</text>
- <text class='tip_text cuIcon-right'></text>
- </view>
- <!-- <image src="../../static/img/sign/authentication@3x.png" mode=""></image> -->
- </view>
- <!-- <view class='cu-item' @click='scanCode'>
- <view>
- <text class="cuIcon-scan icon text-grey"></text>
- <text class="text-grey">扫一扫</text>
- </view>
- <view class = 'tip_text cuIcon-right' ></view>
- </view> -->
- </view>
- <view style='text-align:center;'>
- <navigator
- url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/userAgreement.html"
- class="path" hover-class="navigator-hover">《服务协议》</navigator>|<navigator
- url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/screctAgreement.html"
- class="path" hover-class="navigator-hover">《隐私政策》</navigator>
- </view>
- </view>
- <neil-modal :show="inputShow" @close="cancel" :style="{display:inputStatus}" title="修改昵称" showCancel="true">
- <input v-model="inputContent" style="margin:20upx;" placeholder="请输入昵称" />
- <button class="margin:20upx;bg-green">
- 确认修改
- </button>
- </neil-modal>
- </view>
- </template>
- <script>
- import dragButton from "@/components/drag-button/drag-button.vue";
- import neilModal from '@/components/neil-modal/neil-modal.vue';
- import {
- mapState
- } from 'vuex';
- let startY = 0,
- moveY = 0,
- pageAtTop = true;
- export default {
- components: {
- neilModal,
- dragButton
- },
- data() {
- return {
- inputShow: false,
- modalName: '',
- mycarStyle: '',
- feild: undefined,
- inputContent: '',
- coverTransform: 'translateY(0px)',
- coverTransition: '0s',
- moving: false,
- footprintList: [],
- isVip: false,
- userInfoTmp: [],
- inputStatus: 'none',
- carInfo: [],
- headUrl:"../../static/img/myimg/YongHu@3x.png",
- userphone:"",
- username:"请更改昵称",
- gridList: [
- // {
- // num:0,
- // name: '货源信息',
- // icon:'cuIcon-apps',
- // tips: 0,
- // url:'/pages/tran/my_tran?TabCur=0',
- // show:true
- // },
- // {
- // num:1,
- // name: '承运信息',
- // icon:'cuIcon-calendar',
- // tips: 0,
- // url:'/pages/tran/my_tran?TabCur=1',
- // show:true
- // },
- // {
- // num:2,
- // name: '我的合同',
- // icon:'cuIcon-copy',
- // tips: 0,
- // url:'/pageB/contract/contract',
- // show:true
- // },
- // {
- // num:3,
- // name: '消息列表',
- // icon:'cuIcon-news',
- // tips: 0,
- // url:'/pages/user/message',
- // show:true
- // },
- // {
- // num:4,
- // name: '任务中心',
- // icon:'cuIcon-copy',
- // tips: 0,
- // url:`/pages/user/task`,
- // show:true
- // },
- // {
- // num:5,
- // name: '我的车辆',
- // icon:'cuIcon-deliver',
- // tips: 0,
- // url:'',
- // show:true
- // },
- // {
- // num:6,
- // name: '联系我们',
- // icon:'cuIcon-phone',
- // tips: 0,
- // url:'/pages/user/contact',
- // show:true
- // },
- // {
- {
- num: 0,
- name: '身份认证',
- // icon: 'cuIcon-apps',
- src:'../../static/img/sign/authentication@2x.png',
- tips: 0,
- url: '/pages/attestation/index',
- show: true
- },
- {
- num: 1,
- name: '我的合同',
- // icon: 'cuIcon-calendar',
- src:'../../static/img/sign/myContract@2x.png',
- tips: 0,
- url: '/pageB/contract/contract',
- show: true
- },
- {
- num: 2,
- name: '我的任务',
- // icon: 'cuIcon-copy',
- src:'../../static/img/sign/myTask@2x.png',
- tips: 0,
- url: '/pages/task/my_task',
- show: true
- },
- {
- num: 3,
- name: '我的发布',
- // icon: 'cuIcon-news',
- src:'../../static/img/sign/myRelease@2x.png',
- tips: 0,
- url: `/pages/release/release`,
- show: true
- },
- {
- num: 4,
- name: '货运收发',
- // icon: 'cuIcon-copy',
- src:'../../static/img/sign/receiveGoods@2x.png',
- tips: 0,
- url: `/pageA/freightTransport/index`,
- show: true
- },
- {
- num: 5,
- name: '设置',
- // icon: 'cuIcon-edit',
- src:'../../static/img/sign/shezhi@2x.png',
- tips: 0,
- url: `/pages/user/setUp`,
- show: true
- },
- {
- num:6,
- name: '退出登录',
- // icon:'cuIcon-exit',
- src:'../../static/img/sign/return@3x.png',
- tips: 0,
- url:'',
- show:true
- },
- ],
- showTran: true,
- companyId: 1,
- current: 4
- }
- },
-
- 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() {
- uni.showTabBar()
- this.loadData()
- this.userInfo = uni.getStorageSync("userInfo")
- if(!this.userInfo.avatarUrl){
- this.headUrl = "../../static/img/myimg/YongHu@3x.png"
- }else{
- this.headUrl = this.userInfo.avatarUrl
- }
- if(!this.username){
- this.username = "请更改昵称"
- }
- else{
- this.username = this.userInfo.userName
- }
- if(this.userInfo.phone){
- this.userphone = this.userInfo.phone
- }
- },
- methods: {
- zhibo() {
- uni.navigateTo({
- url: `/pageB/video/broadcast`
- })
- },
- look() {
- uni.navigateTo({
- url: `/pageB/video/look`
- })
- },
- contactUs() {
- const that = this
- uni.makePhoneCall({
- // 手机号
- phoneNumber: '18241771147',
- // 成功回调
- success: (res) => {},
- // 失败回调
- fail: (res) => {}
- });
- },
- loadData() {
- // const that = this
- // if(uni.getStorageSync("PageCur")){
- // that.PageCur = uni.getStorageSync("PageCur");
- // }
- // that.userInfoTmp = uni.getStorageSync("userInfo")
- // uni.showLoading({
- // title: '正在加载',
- // mask:true
- // })
- // that.$api.request('integral', 'getIndexData', failres => {
- // that.$api.msg(failres.errmsg)
- // uni.hideLoading()
- // }).then(res => {
- // let data = res.data
- // uni.setStorageSync("message", data.message);
- // uni.setStorageSync("task", data.task);
- // uni.setStorageSync("contract", data.contract);
- // uni.setStorageSync('showTran', data.showTran);
- // that.showTran = data.showTran
- // that.gridList[4].tips = data.task
- // that.gridList[2].tips = data.contract
- // that.companyId = data.companyId
- // uni.hideLoading()
- // })
- },
- gridClick(item, index) {
- var that = this
- if (item.name == "退出登录") {
- this.logout()
- return;
- } else if (item.name == "联系我们") {
- //#ifdef MP
- this.inputShow = true
- this.inputStatus = 'inline'
- this.feild = "nickname"
- this.inputContent = ''
- //#endif
- //#ifdef APP-PLUS
- this.contactUs()
- //#endif
- return;
- } else if (item.name == '我的车辆') {
- const that = this
- uni.showLoading({
- title: '正在加载',
- mask: true
- })
- that.$api.request('tran', 'getMyCarList', failres => {
- that.$api.msg(failres.errmsg)
- uni.hideLoading()
- }).then(res => {
- that.carInfo = res.data
- if (that.carInfo.length == 0) {
- that.$api.msg('暂无车辆信息')
- } else {
- var height = that.carInfo.length * 100
- var width = 500
- that.mycarStyle = "height:" + height + "rpx;width:" + width + "rpx"
- that.modalName = 'MycarModal'
- }
- uni.hideLoading()
- })
- return;
- }
- if (!this.hasLogin) {
- uni.showModal({
- title: '登录提示',
- content: '您尚未登录,是否立即登录?',
- showCancel: true,
- confirmText: '登录',
- success: (e) => {
- if (e.confirm) {
- uni.navigateTo({
- url: '/pages/public/login'
- })
- }
- },
- fail: () => {},
- complete: () => {}
- })
- }else {
- if (item.url) {
- uni.navigateTo({
- url: item.url + `?companyId=${that.companyId}`
- })
- }
- }
- },
- toLogin() {
- if (!this.hasLogin) {
- uni.navigateTo({
- url: '/pages/public/login_account_number'
- })
- }
- // else if(!this.userInfo.nickname){
- // this.inputShow = true
- // this.inputStatus = 'inline'
- // this.feild = "nickname"
- // this.inputContent = ''
- // }
- },
- confirm() {
- const that = this
- if (!that.inputContent) {
- that.$api.msg('输入不能为空')
- return
- }
- let obj = {}
- obj[that.feild] = that.inputContent
- that.$api.request('user', 'syncUserInfo', obj).then(res => {
- that.userInfo.nickname = that.inputContent
- that.inputContent = ''
- that.$store.commit('login', that.userInfo)
- })
- },
- cancel() {
- this.inputShow = false
- this.inputStatus = 'none'
- this.genderShow = false
- },
- myAccount() {
- uni.navigateTo({
- url: `/pageA/pages/contract`
- })
- },
- logout() {
- const that = this
- uni.showModal({
- title: '询问',
- content: '您确定要退出吗?',
- cancelText: '取消',
- confirmText: '确定',
- success: (e) => {
- if (e.confirm) {
- uni.clearStorageSync();
- that.$store.commit('logout')
- that.$api.logout()
- uni.navigateTo({
- url: `/pages/public/login`
- })
- }
- }
- })
- },
- /**
- * 统一跳转接口,拦截未登录路由
- * navigator标签现在默认没有转场动画,所以用view
- */
- navTo(url) {
- if (!this.hasLogin) {
- url = '/pages/public/login';
- }
- uni.navigateTo({
- url
- })
- },
- mycarClick(carNo) {
- this.modalName = null
- uni.navigateTo({
- url: `/pageB/car/mycar_detail?carNo=${carNo}`
- })
- },
- qrClick(userInfo) {
- this.modalName = null
- uni.navigateTo({
- url: `/pages/user/qr`
- })
- },
- scanCode() {
- uni.scanCode({
- success: function(res) {
- uni.navigateTo({
- url: res.result
- })
- }
- })
- },
- hideModal(e) {
- this.modalName = null
- },
- }
- }
- </script>
- <style lang='scss' scoped>
- .container {
- padding-top: 85px;
- background-color: #F5F6FA;
- position: relative;
- width: 100vw;
- height: 100vh;
- overflow: hidden;
- background: url('~@/static/img/login/bg.png');
- background-size: 100% 100%;
- margin: 0 auto;
- }
- .cu-tag.badge {
- right: 26rpx;
- }
- .path {
- color: #007aff;
- display: inline-block;
- text-align: center;
- }
- .icon {
- margin-right: 10rpx;
- }
- .portrait-box {
- margin-top: 20rpx;
- }
- .qr-wrap {
- margin-top: 20upx;
- color: #fff;
- font-size: 32rpx;
- }
- .cu-list {
- /* height: 483rpx;
- overflow-y: scroll; */
- margin-top: 42rpx;
- margin-bottom: 80rpx;
- }
- .badge_user {
- color: #fff;
- background-color: #dc3545;
- display: inline-block;
- padding: .25em .4em;
- font-size: 75%;
- font-weight: 700;
- line-height: 1;
- text-align: center;
- white-space: nowrap;
- vertical-align: top;
- border-radius: 50%;
- transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
- }
- @keyframes move_wave {
- 0% {
- transform: translateX(0) translateZ(0) scaleY(1)
- }
- 50% {
- transform: translateX(-25%) translateZ(0) scaleY(0.55)
- }
- 100% {
- transform: translateX(-50%) translateZ(0) scaleY(1)
- }
- }
- .bg {
- position: relative;
- height: 300rpx;
- /* background: linear-gradient(to bottom, #56ccf2, #2f80ed); */
- /*background: linear-gradient(to bottom, #0be9fe, #4bb0fe); */
- background: linear-gradient(to bottom, #d5f8ff, #56ccf2);
- }
- .bg_ware {
- position: absolute;
- left: 0;
- bottom: -2rpx;
- width: 100%;
- mix-blend-mode: screen;
- height: 224rpx;
- }
- %flex-center {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- }
- %section {
- display: flex;
- justify-content: space-around;
- align-content: center;
- background: #fff;
- border-radius: 10upx;
- }
- .grid-item-box {
- flex: 1;
- /* position: relative;
- */
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 15px 0;
- }
- .image {
- width: 80rpx;
- height: 80rpx;
- }
- .text {
- font-size: 26rpx;
- margin-top: 10rpx;
- }
- .user-section {
- height: 520upx;
- padding: 100upx 30upx 0;
- position: relative;
- .bg {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- filter: blur(1px);
- box-shadow: 0px 1px 8px #ccc;
- /* background:linear-gradient(#0eb0c9,#126bae); */
- /* opacity: .7; */
- }
- }
- .user-info-box {
- height: 180upx;
- /* display:flex; */
- /* align-items:center; */
- text-align: center;
- position: relative;
- z-index: 1;
- .portrait {
- width: 130upx;
- height: 130upx;
- border: 5upx solid #fff;
- border-radius: 50%;
- }
- .username {
- font-size: $font-lg + 3upx;
- color: #fff;
- margin-top: 20upx;
- }
- }
- .vip-card-box {
- display: flex;
- flex-direction: column;
- color: #f7d680;
- height: 240upx;
- background: linear-gradient(left, rgba(0, 0, 0, .7), rgba(0, 0, 0, .8));
- border-radius: 16upx 16upx 0 0;
- overflow: hidden;
- position: relative;
- padding: 20upx 24upx;
- .card-bg {
- position: absolute;
- top: 20upx;
- right: 0;
- width: 380upx;
- height: 260upx;
- }
- .b-btn {
- position: absolute;
- right: 20upx;
- top: 16upx;
- width: 132upx;
- height: 40upx;
- text-align: center;
- line-height: 40upx;
- font-size: 22upx;
- color: #36343c;
- border-radius: 20px;
- background: linear-gradient(left, #f9e6af, #ffd465);
- z-index: 1;
- }
- .tit {
- font-size: $font-base+2upx;
- color: #f7d680;
- margin-bottom: 28upx;
- .yticon {
- color: #f6e5a3;
- margin-right: 16upx;
- }
- }
- .e-b {
- font-size: $font-sm;
- color: #d8cba9;
- margin-top: 10upx;
- }
- }
- .cover-container {
- padding: 1px 10px ;
- padding-bottom: 200upx;
-
- background-color: #F5F6FA;
- /* border-radius: 20px; */
- margin-top: 60upx;
- .arc {
- position: absolute;
- left: 0;
- top: -34upx;
- width: 100%;
- height: 36upx;
- }
- }
- .tj-sction {
- @extend %section;
- .tj-item {
- @extend %flex-center;
- flex-direction: column;
- height: 140upx;
- font-size: $font-sm;
- color: #75787d;
- }
- .num {
- font-size: $font-lg;
- color: $font-color-dark;
- margin-bottom: 8upx;
- }
- }
- .order-section {
- @extend %section;
- padding: 28upx 0;
- margin-top: 20upx;
- .order-item {
- @extend %flex-center;
- width: 120upx;
- height: 120upx;
- border-radius: 10upx;
- font-size: $font-sm;
- color: $font-color-dark;
- }
- .yticon {
- font-size: 48upx;
- margin-bottom: 18upx;
- color: #fa436a;
- }
- .icon-shouhoutuikuan {
- font-size: 44upx;
- }
- }
- .history-section {
- padding: 30upx 0 0;
- margin-top: 20upx;
- background: #fff;
- border-radius: 10upx;
- .sec-header {
- display: flex;
- align-items: center;
- font-size: $font-base;
- color: $font-color-dark;
- line-height: 40upx;
- margin-left: 30upx;
- .yticon {
- font-size: 44upx;
- color: #5eba8f;
- margin-right: 16upx;
- line-height: 40upx;
- }
- }
- .h-list {
- white-space: nowrap;
- padding: 30upx 30upx 0;
- image {
- display: inline-block;
- width: 160upx;
- height: 160upx;
- margin-right: 20upx;
- border-radius: 10upx;
- }
- }
- }
- .grid {
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- /* border-top: 2upx solid rgba(172,172,172,.2); */
- .grid-item-3 {
- box-sizing: border-box;
- width: calc(100% / 3);
- border-bottom: 2upx solid rgba(172, 172, 172, .2);
- border-right: 2upx solid rgba(172, 172, 172, .2);
- text-align: center;
- padding: 40upx 0;
- position: relative;
- /* view{
- font-size: $font-sm;
- margin-top: 16upx;
- color: $font-color-dark;
- } */
- .grid_icon {
- font-size: 48upx;
- margin-bottom: 18upx;
- color: #fa436a;
- }
- .tip_text {
- display: block;
- padding: 4upx 8upx;
- text-align: center;
- border-radius: 36upx;
- font-size: 24upx;
- background-color: #fa436a;
- color: rgba(255, 255, 255, 1);
- position: absolute;
- right: 6upx;
- top: 6upx;
- }
- }
- .grid-item-3:nth-child(3n + 3),
- .grid-item-4:nth-child(4n + 4) {
- border-right: none;
- }
- }
- .headPortrait {
- width: 75px;
- height: 75px;
- border-radius: 40px;
- margin-left: 20px;
- border: 2px solid #ffffff;
- }
- .personal {
- margin-top: 10px;
- margin-left: 20px;
- }
- .information {
- font-size: 15px;
- font-weight: 600;
- height: 36px;
- }
- .indexlow{
- /* margin-top: 30px; */
- border-radius: 20px;
- }
- .sign{
- width: 18px;
- height: 18px;
- top: 4px;
- margin-right: 6px;
- }
- </style>
|