| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537 |
- <template>
- <view>
- <view class="top-cont">
- <image class="bg" src="@/static/image/bg_mine.png" mode="widthFix"></image>
- <view class="top-inner">
- <!-- 这里是状态栏 -->
- <view class="status_bar" :style="{height: statusBarHeight}"></view>
- <view class="content">
- <view class="user-info">
- <view class="left">
- <view class="head-img">
- <image :src="user.avatar==null?'/static/image/my_heads_icon.png':user.avatar"
- mode="aspectFill">
- </image>
- <image class="gender"
- :src="isGirl==null?'/static/image/icon_girl.png':'/static/image/icon_boy.png'"
- mode="aspectFill"></image>
- </view>
- <view class="name-phone">
- <view class="x-f">
- <view class="name" v-if="UserInfo">{{user.nickname}}</view>
- <view class="name" v-else>请先登录</view>
- <view class="lable">办公室主任</view>
- <!-- <text>{{user.phone?utils.parsePhone(user.phone):'-'}}</text> -->
- </view>
- </view>
- <view class="txt">您已加入小蜜蜂1582天了~</view>
- </view>
- </view>
- <view class="task-list">
- <view class="item" v-for="(item,index) in tabs" :key="index" @click="openLink(item)">
- <view class="left">
- <image :src="item.icon" mode=""></image>
- <view class="title-l">{{item.name}}</view>
- </view>
- <view class="right">
- <image src="@/static/image/icon_my_more.png" mode=""></image>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- getOrderCount
- } from '@/api/storeOrder'
- import {
- getUserInfo
- } from '@/api/user'
- export default {
- data() {
- return {
- isGirl: false,
- count0: 0,
- count1: 0,
- count2: 0,
- afterSalesCount: 0,
- tabs: [
- // {
- // name: '我的积分',
- // num: 12,
- // icon: '/static/image/icon_my_points.png',
- // url: '/pages_user/points'
- // },
- {
- name: '个人信息',
- num: 3,
- icon: '/static/image/icon_my_information.png',
- url: '/pages_user/userInfo'
- },
- {
- name: '设置中心',
- num: 8,
- icon: '/static/image/icon_my_set.png',
- url: '/pages/auth/setting'
- },
- ],
- user: {
- isPromoter: 0,
- isWeixinAuth: 0,
- phone: "",
- nickname: "用户昵称",
- avatarUrl: "/static/images/detault_head.png"
- },
- // 状态栏的高度
- statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
- // 消息数量
- msgNum: 0,
- isShow: true,
- UserInfo: uni.getStorageSync('AppToken')
- };
- },
- onLoad() {
- console.log("onload")
- },
- onShow() {
- console.log("onshow")
- //this.getUserInfo();
- //this.getOrderCount();
- },
- onReachBottom() {
- console.log("onReachBottom")
- this.$refs.product.getGoodsProducts();
- },
- methods: {
- seeChange() {
- this.isShow = !this.isShow
- },
- callService() {
- uni.makePhoneCall({
- phoneNumber: "4000717770",
- success: function() {
- console.log('拨打电话成功');
- },
- fail() {
- console.log('打电话失败了');
- }
- })
- },
- getOrderCount() {
- getOrderCount().then(
- res => {
- if (res.code == 200) {
- this.count0 = res.count0;
- this.count1 = res.count1;
- this.count2 = res.count2;
- this.afterSalesCount = res.afterSalesCount;
- }
- },
- rej => {}
- );
- },
- openLink(item) {
- if (item.name == '用户协议') {
- this.openH5()
- return;
- }
- uni.navigateTo({
- url: item.url
- })
- // this.utils.isLogin().then(res => {
- // if(res){
- // uni.navigateTo({
- // url: url+'?userId='+this.user.userId
- // })
- // }
- // })
- },
- toManager() {
- // uni.navigateTo({
- // url: '/pages_company/index'
- // })
- if (this.utils.checkCompanyUserLoginState()) {
- uni.navigateTo({
- url: '/pages_company/index'
- })
- } else {
- uni.navigateTo({
- url: '/pages_company/auth/login'
- })
- }
- },
- openH5(url) {
- var requestPath = uni.getStorageSync('requestPath');
- uni.setStorageSync('url', requestPath + url);
- uni.navigateTo({
- url: '../home/web'
- })
- },
- getUserInfo() {
- getUserInfo().then(
- res => {
- if (res.code == 200) {
- if (res.user != null) {
- this.user = res.user;
- } else {
- this.utils.loginOut();
- }
- } else {
- uni.showToast({
- icon: 'none',
- title: "请求失败",
- });
- }
- },
- rej => {}
- );
- },
- // 跳转页面
- navgetTo(url) {
- this.utils.isLogin().then(res => {
- if (res) {
- uni.navigateTo({
- url: url + '?userId=' + this.user.userId
- })
- }
- })
- },
- // 查看订单
- showOrder(status) {
- uni.navigateTo({
- url: '/pages_user/user/storeOrder?status=' + status
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .top-cont {
- width: 100%;
- height: 600rpx;
- position: relative;
- .bg {
- width: 100%;
- position: absolute;
- top: 0;
- left: 0;
- }
- .top-inner {
- width: 100%;
- height: 100%;
- position: absolute;
- top: 0;
- left: 0;
- z-index: 2;
- }
- }
- .content {
- background: linear-gradient(360deg, rgba(244, 249, 255, 0.6) 0%, #FFFFFF 100%);
- border-radius: 40rpx 40rpx 24rpx 24rpx;
- border: 2rpx solid #FFFFFF;
- margin-top: 222upx;
- align-items: center;
- justify-content: center;
- position: relative;
- .user-info {
- position: relative;
- top: -72rpx;
- left: 46rpx;
- z-index: 4;
- .left {
- position: relative;
- display: flex;
- flex-direction: column;
- .head-img {
- width: 112upx;
- height: 112upx;
- border-radius: 50%;
- margin-right: 32upx;
- border: 4upx solid #FFFFFF;
- position: relative;
- image {
- width: 112upx;
- height: 112upx;
- border-radius: 50%;
- }
- .gender {
- width: 36rpx;
- height: 36rpx;
- position: absolute;
- right: 0;
- bottom: 0;
- }
- }
- .name-phone {
- display: flex;
- align-items: flex-start;
- flex-direction: column;
- justify-content: space-around;
- margin-top: 30rpx;
- .name {
- font-size: 40upx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #111111;
- line-height: 1;
- }
- text {
- font-family: PingFang SC, PingFang SC;
- font-weight: 600;
- font-size: 28rpx;
- }
- .lable {
- padding: 4rpx 16rpx;
- font-weight: 500;
- font-size: 22rpx;
- color: #FFFFFF;
- background: #FAAB0C;
- margin-left: 18rpx;
- border-radius: 38rpx 38rpx 38rpx 38rpx;
- }
- .phone {
- width: 220rpx;
- height: 48rpx;
- margin-top: 30upx;
- background: linear-gradient(90deg, #FEA501 0%, #FECB8A 100%);
- border-radius: 24rpx 24rpx 24rpx 24rpx;
- border: 1rpx solid #FEDDB9;
- display: flex;
- align-items: center;
- justify-content: center;
- text {
- font-size: 24upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #fff;
- line-height: 1;
- margin-left: 4rpx;
- }
- }
- }
- .txt {
- font-size: 28rpx;
- color: #666666;
- margin-top: 12rpx;
- }
- }
- .right {
- display: flex;
- align-items: center;
- justify-content: center;
- .set {
- width: 48rpx;
- height: 48rpx;
- }
- }
- }
- .task-list {
- display: flex;
- align-items: center;
- flex-direction: column;
- justify-content: flex-start;
- width: 100%;
- .item {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 28rpx 24rpx;
- box-sizing: border-box;
- // margin-bottom: 24rpx;
- .left {
- display: flex;
- align-items: center;
- justify-content: center;
- image {
- width: 48rpx;
- height: 48rpx;
- margin-right: 32rpx;
- }
- .title-l {
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 32rpx;
- color: #333333;
- }
- }
- .right {
- display: flex;
- align-items: center;
- .num {
- text-align: center;
- width: 50rpx;
- height: 36rpx;
- line-height: 36rpx;
- background: rgba(56, 139, 255, 0.16);
- border-radius: 34rpx 34rpx 34rpx 34rpx;
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #388BFF;
- }
- image {
- width: 32rpx;
- height: 32rpx;
- margin-left: 12rpx;
- }
- }
- }
- }
- .used-tools {
- box-sizing: border-box;
- background: #FFFFFF;
- border-radius: 16upx;
- padding: 40upx 30upx;
- .title {
- font-size: 36upx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #222222;
- line-height: 1;
- }
- .tools-list {
- margin-top: 50upx;
- display: flex;
- flex-wrap: wrap;
- width: 100%;
- .item {
- box-sizing: border-box;
- width: 25%;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- margin-bottom: 50upx;
- position: relative;
- image {
- width: 48upx;
- height: 48upx;
- }
- .text {
- font-size: 24upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333;
- line-height: 1;
- margin-top: 20upx;
- }
- .contact-btn {
- display: inline-block;
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- opacity: 0;
- }
- }
- }
- }
- .log-out {
- height: 88upx;
- line-height: 88upx;
- text-align: center;
- font-family: PingFang SC, PingFang SC;
- font-weight: 500;
- font-size: 28rpx;
- color: #666666;
- background: #FFFFFF;
- border-radius: 16upx;
- margin-top: 52upx;
- }
- }
- .sub-btn {
- position: absolute;
- width: 100%;
- height: 100%;
- opacity: 0;
- }
- .like-product {
- padding: 0 20rpx;
- }
- .banner {
- padding: 20rpx 20rpx 0rpx 20rpx;
- height: 200rpx;
- position: relative;
- display: flex;
- align-items: center;
- justify-content: center;
- image {
- width: 100%;
- height: 100%;
- border-radius: 16rpx 16rpx 16rpx 16rpx;
- }
- .tel_btn {
- width: 100%;
- height: 100%;
- top: 0upx;
- position: absolute;
- opacity: 0.0;
- }
- }
- </style>
|