123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482 |
- <template>
- <view class="container">
- <view class="top">
- <view class="bg"><image class="imgBg" src="../../static/img/user-bg.png" mode=""></image></view>
- <view class="user">
- <view class="avtor">
- <image class="portrait" :src="userInfo.avatar || '/static/img/missing-face.png'"></image>
- <view class="he"><image class="image" v-if="userInfo.point.length != 0" src="../../static/img/hehuoren.png"></image></view>
- </view>
- <view class="">
- <view class="name">
- <view class="name-left clamp">{{ userInfo.phone || userInfo.email || '游客' }}</view>
- <view class="name-right">
- <image class="image" src="../../static/img/img28.png"></image>
- <view class="level" v-if="userInfo.level">{{ userInfo.level_info.name }}</view>
- <view class="level" v-else>V0</view>
- </view>
- </view>
- <view class="id">uid:{{ userInfo.uid }}</view>
- </view>
- </view>
- <view class="config" @click="nav('/pages/set/userinfo')">
- <view class="myself"><image src="../../static/img/myself.png" mode=""></image></view>
- <view class="">
- 我的资料
- </view>
- </view>
- </view>
- <view class="main">
- <view class="title">我的工具</view>
- <view class="tt">
- <view class="tt-box" @click="nav('/pages/assets/myPing')">
- <image src="../../static/img/pinggou.png" class="tt-icon1" mode=""></image>
- <view class="tt-txt">我的拼购</view>
- <image src="../../static/img/jiantou.png" class="next-icon" mode=""></image>
- </view>
- <view class="userInfo.point">
- <view class="tt-box" v-if="userInfo.point.length != 0" @click="nav('/pages/user/myNote')">
- <image src="../../static/img/myPoint.png" class="tt-icon1" mode=""></image>
- <view class="tt-txt">我的节点</view>
- <image src="../../static/img/jiantou.png" class="next-icon" mode=""></image>
- </view>
- </view>
- <view class="tt-box" @click="nav('/pages/market/myCalculation')">
- <image src="../../static/img/myKJ.png" class="tt-icon1" mode=""></image>
- <view class="tt-txt">我的矿机</view>
- <image src="../../static/img/jiantou.png" class="next-icon" mode=""></image>
- </view>
- <view class="tt-box" @click="nav('/pages/index/info')" v-if="userInfo.level >= 4">
- <image src="../../static/img/data.png" class="tt-icon1" mode=""></image>
- <view class="tt-txt">汇总数据</view>
- <image src="../../static/img/jiantou.png" class="next-icon" mode=""></image>
- </view>
- <view class="tt-box" @click="nav('/pages/user/fulilist')">
- <image src="../../static/img/gift.png" class="tt-icon1" mode=""></image>
- <view class="tt-txt">拼购福利</view>
- <image src="../../static/img/jiantou.png" class="next-icon" mode=""></image>
- </view>
- <view class="tt-box" @click="nav('/pages/user/extension')">
- <image src="../../static/img/myTeam.png" class="tt-icon2" mode=""></image>
- <view class="tt-txt">我的团队</view>
- <image src="../../static/img/jiantou.png" class="next-icon" mode=""></image>
- </view>
- <view class="tt-box" @click="nav('/pages/user/shareQrCode')">
- <image src="../../static/img/share.png" class="tt-icon3" mode=""></image>
- <view class="tt-txt">团队邀请</view>
- <image src="../../static/img/jiantou.png" class="next-icon" mode=""></image>
- </view>
- <view class="tt-box" @click="server()">
- <image src="../../static/img/kefu.png" class="tt-icon1" mode=""></image>
- <view class="tt-txt">联系客服</view>
- <image src="../../static/img/jiantou.png" class="next-icon" mode=""></image>
- </view>
- <view class="tt-box" @click="nav('/pages/set/set')">
- <image src="../../static/img/set.png" class="tt-icon5" mode=""></image>
- <view class="tt-txt">设置</view>
- <image src="../../static/img/jiantou.png" class="next-icon" mode=""></image>
- </view>
- </view>
- <view class="kb"></view>
- </view>
- <uni-popup ref="popup" type="center">
- <view class="popup">
- <view class="popup-dox">
- <image class="popup-logo" src="../../static/img/lianxi.png"></image>
- <view class="pop-title">已为您定制专属客服</view>
- <view>{{ weixin }}</view>
- <image class="popup-text" @longtap="bc_code" :src="erweima"></image>
- <view class="btn" @click="copy(weixin)">复制微信号</view>
- <view class="pop-tip flex">
- <view class="weixin"><image src="../../static/img/weixin.png" mode=""></image></view>
- <view>长按保存二维码</view>
- </view>
- </view>
- </view>
- <view class="close_icon" @click="close"><image src="../../static/img/Close.png"></image></view>
- </uni-popup>
- </view>
- </template>
- <script>
- import uniCopy from '@/components/js_sdk/xb-copy/uni-copy.js';
- import { mapState, mapMutations } from 'vuex';
- import uniList from '@/components/uni-list/uni-list.vue';
- import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
- import { orderData, getUserInfo, service } from '@/api/user.js';
- import { saveUrl, interceptor } from '@/utils/loginUtils.js';
- import uniPopup from '@/components/uni-popup/uni-popup.vue';
- export default {
- components: {
- uniList,
- uniListItem,
- uniPopup
- },
- data() {
- return {
- erweima: '',
- weixin: ''
- };
- },
- onShow() {
- //判断是否已经登录
- if (this.hasLogin) {
- this.loadBaseData();
- } else {
- uni.showModal({
- title: '登录',
- content: '您未登录,是否马上登陆?',
- success: e => {
- if (e.confirm) {
- interceptor();
- }
- },
- fail: e => {
- console.log(e);
- }
- });
- }
- },
- computed: {
- ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
- },
- methods: {
- ...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
- loadBaseData() {
- console.log(this.userInfo);
- getUserInfo({}).then(({ data }) => {
- this.setUserInfo(data);
- });
- service({}).then(({ data }) => {
- this.erweima = data.service_qr;
- this.weixin = data.service_wechat;
- });
- },
- server() {
- this.$refs.popup.open();
- },
- close() {
- this.$refs.popup.close();
- },
- nav(url) {
- // 判断是否已经登录
- // if (this.hasLogin) {
- console.log(url);
- uni.navigateTo({
- url: url,
- fail() {
- uni.switchTab({
- url: url
- });
- }
- });
- // }else {
- // uni.showModal({
- // title: '登录',
- // content: '您未登录,是否马上登陆?',
- // success: e => {
- // if (e.confirm) {
- // interceptor();
- // }
- // },
- // fail: e => {{}
- // console.log(e);
- // }
- // });
- // }
- },
- bc_code() {
- let that = this;
- console.log('保存二维码', this.erweima);
- uni.downloadFile({
- //获得二维码的临时地址
- url: this.erweima,
- success: res => {
- //console.log('获取url',res)
- if (res.statusCode == 200) {
- uni.saveImageToPhotosAlbum({
- filePath: res.tempFilePath, //传入临时地址
- success() {
- that.$api.msg('保存成功'); //封装的提示
- },
- fail() {
- that.$api.msg('保存失败');
- }
- });
- }
- }
- });
- },
- copy(value) {
- let obj = this;
- let content = value; //需要复制的内容
- console.log('复制的内容:', content);
- // content = typeof content === 'string' ? content : content.toString(); // 复制内容,必须字符串,数字需要转换为字符串
- const result = uniCopy(content);
- if (result === false) {
- uni.showToast({
- title: '不支持'
- });
- } else {
- uni.showToast({
- title: '复制成功',
- icon: 'none'
- });
- }
- }
- }
- };
- </script>
- <style lang="scss">
- page {
- height: 100%;
- background: #ffffff;
- }
- .container {
- height: 100%;
- background: #ffffff;
- }
- .kb {
- height: 100rpx;
- }
- .top {
- width: 100%;
- height: 340rpx;
- position: relative;
- .bg {
- position: absolute;
- width: 100%;
- height: 340rpx;
- left: 0;
- top: 0;
- right: 0;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .user {
- position: relative;
- padding-top: 98rpx;
- padding-left: 34rpx;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- z-index: 10;
- .avtor {
- width: 102rpx;
- height: 102rpx;
- border-radius: 50%;
- position: relative;
- .portrait {
- width: 100%;
- height: 100%;
- border-radius: 50%;
- }
- .he {
- position: absolute;
- height: 30rpx;
- bottom: -4rpx;
- left: 0;
- .image {
- width: 102rpx;
- height: 30rpx;
- }
- }
- }
- .name {
- margin-left: 30rpx;
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #ffffff;
- display: flex;
- justify-content: start;
- .name-left {
- max-width: 220rpx;
- }
- .name-right {
- margin-left: 20rpx;
- width: 50rpx;
- height: 60rpx;
- position: relative;
- image {
- width: 100%;
- height: 100%;
- }
- .level {
- position: absolute;
- top: 35%;
- left: 50%;
- margin-left: -12rpx;
- font-size: 20rpx;
- }
- }
- }
- .id {
- margin-left: 30rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #ffffff;
- }
- }
- }
- .main {
- position: relative;
- z-index: 11;
- width: 100%;
- height: 100%;
- background: #ffffff;
- margin-top: -70rpx;
- border-top-left-radius: 60rpx;
- border-top-right-radius: 60rpx;
- .title {
- padding-top: 65rpx;
- padding-left: 36rpx;
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- .tt {
- margin: 0 auto;
- width: 750rpx;
- padding: 40rpx 70rpx;
- border-radius: 10rpx;
- background-color: #ffffff;
- .tt-box {
- height: 100rpx;
- display: flex;
- align-items: center;
- border-bottom: 1px solid #f0f0f0;
- .tt-icon1 {
- width: 42rpx;
- height: 42rpx;
- }
- .tt-icon2 {
- width: 49rpx;
- height: 38rpx;
- }
- .tt-icon3 {
- width: 46rpx;
- height: 40rpx;
- }
- .tt-icon4 {
- width: 40rpx;
- height: 42rpx;
- }
- .tt-icon5 {
- width: 44rpx;
- height: 40rpx;
- }
- .tt-txt {
- margin-left: 36rpx;
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- flex: 1;
- }
- .next-icon {
- width: 16rpx;
- height: 25rpx;
- }
- }
- .border-b {
- border-bottom: 1px solid #f1f1f1;
- }
- }
- }
- .popup {
- width: 640rpx;
- background-color: #ffffff;
- border-radius: 15rpx;
- text-align: center;
- .popup-dox {
- position: relative;
- top: -60rpx;
- .popup-logo {
- width: 460rpx;
- height: 132rpx;
- }
- .pop-title {
- font-size: 40rpx;
- font-weight: bold;
- color: #333333;
- padding: 25rpx 0rpx;
- margin-bottom: 50rpx;
- }
- .popup-text {
- width: 400rpx;
- height: 400rpx;
- margin-bottom: 50rpx;
- }
- .btn {
- width: 300rpx;
- height: 50rpx;
- line-height: 50rpx;
- background: linear-gradient(90deg, #60bab0, #60bab0, #45969b);
- margin: 0 auto;
- color: #ffffff;
- border-radius: 25rpx;
- }
- .pop-tip {
- font-size: 30rpx;
- font-weight: 500;
- color: #333333;
- justify-content: center;
- margin-top: 20rpx;
- .weixin {
- width: 48rpx;
- height: 40rpx;
- margin-right: 14rpx;
- image {
- width: 48rpx;
- height: 40rpx;
- }
- }
- }
- }
- }
- .close_icon {
- width: 60rpx;
- height: 60rpx;
- margin: 88rpx auto 0;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .config {
- z-index: 10;
- background: #fff;
- text-align: right;
- font-size: 26rpx !important;
- border-radius: 34px 0px 0px 34px;
- position: absolute;
- top: 120rpx;
- right: 0;
- font-size: 20rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #60bab0;
- line-height: 58rpx;
- padding:2rpx 20rpx;
- display: flex;
- align-items: center;
- .myself {
- padding-top: 12rpx;
- margin-right: 10rpx;
- image {
- height: 30rpx;
- width: 30rpx;
- }
- }
-
- }
- </style>
|