123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775 |
- <template>
- <view class="container">
- <view class="userinfo flex">
- <view class="avt">
- <image src="../../static/error/missing-face.png" mode=""></image>
- </view>
- <view class="info">
- <view class="name clamp">
- 李丹丹李丹丹李丹丹李丹丹李丹丹李丹丹李丹丹李丹丹李丹丹
- </view>
- <view class="id flex">
- <view class="xs">
- ID
- </view>
- <view class="val">
- 236322
- </view>
- <image src="../../static/user/copy.png" mode="" class="copy"></image>
- </view>
- </view>
- </view>
- <view class="ks flex">
- <image src="../../static/user/ks.png" mode=""></image>
- <view class="value">
- <view class="val">
- 7772032.30
- </view>
- <view class="">
- 我的矿石
- </view>
- </view>
- <view class="btn ">
- 转赠
- </view>
- </view>
- <view class="friend">
- <view class="top flex">
- <view class="">
- 邀请好友
- </view>
- <image src="../../static/user/djl.png" mode=""></image>
- <view class="tc">
-
- </view>
- <view class="xq">
- 详情<image src="../../static/user/back.png" mode=""></image>
- </view>
- </view>
- <view class="tit">
- 好友会为你贡献一定比例的奖励
- </view>
- <view class="val-wrap flex">
- <view class="item ">
- <view class="val">
- 72032.30
- </view>
- <view class="">
- 累计收益
- </view>
- </view>
- <view class="item item1">
- <view class="val">
- 203
- </view>
- <view class="">
- 好友数
- </view>
- </view>
- <view class="btn">
- 邀请好友
- </view>
- </view>
- </view>
- <view class="main-box">
- <view class="title flex">
- <view class="title-left">
- <view class="title-font">常用功能</view>
- </view>
- <!-- <image class="title-right" src="../../static/icon/back.png" mode=""></image> -->
- </view>
- <view class="main flex">
- <view class="oitem" @click="navTo('/pages/order/order?state=0')">
- <image class="oitem-image" src="../../static/user/u1.png" mode=""></image>
- <view class="oitem-font">我的好友</view>
- </view>
- <view class="oitem" @click="openKf()">
- <image class="oitem-image" src="../../static/user/u2.png" mode=""></image>
- <view class="oitem-font">联系客服</view>
- </view>
- <view class="oitem" @click="navTo('/pages/order/order?state=2')">
- <image class="oitem-image" src="../../static/user/u3.png" mode=""></image>
- <view class="oitem-font">我的邀请人</view>
- </view>
- <view class="oitem" @click="navTo('/pages/order/order?state=3')">
- <image class="oitem-image" src="../../static/user/u5.png" mode=""></image>
- <view class="oitem-font">开通联盟</view>
- </view>
- <view class="oitem" @click="navTo('/pages/order/order?state=3')">
- <image class="oitem-image" src="../../static/user/u4.png" mode=""></image>
- <view class="oitem-font">设置</view>
- </view>
-
- </view>
- </view>
- <uni-popup ref="popupkf" type="center">
- <view class="popup-box">
-
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
- // import {
- // tabbar1
- // } from '@/utils/tabbar.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 uniCopy from '@/components/js_sdk/xb-copy/uni-copy.js';
- import {
- orderData,
- getUserInfo,
- rate,
- apply_status
- } from '@/api/user.js';
- import {
- signList,
- integral,
- signUser
- } from '@/api/functionalUnit.js';
- import {
- saveUrl,
- interceptor
- } from '@/utils/loginUtils.js';
- // #ifdef APP-PLUS
- import {
- getUpApp
- } from '@/utils/upApp.js';
- // #endif
- let startY = 0,
- moveY = 0,
- pageAtTop = true;
- export default {
- components: {
- uniList,
- uniListItem
- },
- data() {
- return {
- // #ifdef APP
- wgtinfo: {
- version: '1.0.0'
- }, //版本信息
- // #endif
- sm: 0, //是否已实名认证
- money: '', //保存当前月份
- year: '', //保存当前年份
- day: '', //保存当前日期
- current: 4,
- tabbar: tabbar1,
- qded: false, //是否已签到
- text: '18967672398', //客服微信
- actionDay: 0, //连续签到天数
- sum_integral: 0, //累计获得积分
- today_integral: '', //签到获得的数值
- tom_integral: '', //明天签到获得的数值
- tom_type: '', //签到获得的数值单位
- userDowm: 0, //卡片升级专属高度
- userMaxDowm: 0, //卡片最高高度
- toolList: [
- // {
- // id: 't1',
- // name: '新人通道',
- // width: '56rpx',
- // heigt: '54rpx',
- // img: '../../static/icon/tool-1.png',
- // path: '/pages/user/xrtd'
- // },
- {
- id: 't2',
- name: '邀请好友',
- width: '56rpx',
- heigt: '57rpx',
- img: '../../static/icon/tool-2.png',
- path: '/pages/user/shareQrCode'
- },
- {
- id: 't3',
- name: '我的粉丝',
- width: '68rpx',
- heigt: '53rpx',
- img: '../../static/icon/tool-3.png',
- path: '/pages/user/myfans'
- },
- {
- id: 't4',
- name: '我的订单',
- width: '55rpx',
- heigt: '54rpx',
- img: '../../static/icon/tool-4.png',
- path: '/pages/order/index'
- },
- {
- id: 't5',
- name: '我的商品',
- width: '50rpx',
- heigt: '58rpx',
- img: '../../static/icon/tool-5.png',
- path: '/pages/user/myproduct'
- },
- // #ifndef APP
- {
- id: 't6',
- name: '馆长申请',
- width: '59rpx',
- heigt: '56rpx',
- img: '../../static/icon/tool-6.png',
- path: '/pages/user/gzsq'
- },
- // #endif
- {
- id: 't7',
- name: '我的金豆',
- width: '59rpx',
- heigt: '56rpx',
- img: '../../static/icon/jindou.png',
- path: '/pages/user/myyue'
- }
- ]
- };
- },
- onShow() {
- // 判断是否已经登录
- if (this.hasLogin) {
- this.loadBaseData();
- // this.signUser();
- // this.loadList();
- // this.getData();
- // this.isSm();
- }
- // #ifdef APP
- if (this.appversion !== this.wgtinfo.version) {
- getUpApp();
- }
- // #endif
- },
- onReady() {
- const that = this;
- // 初始化获取页面宽度
- uni.createSelectorQuery()
- .select('.container')
- .fields({
- size: true
- },
- data => {
- // 计算最多下拉的高度
- this.userDowm = Math.floor((data.width / 750) * 185);
- // 计算最大触发修改高度事件
- this.userMaxDowm = Math.floor((data.width / 750) * 250);
- }
- )
- .exec();
- // #ifdef APP
- plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
- that.wgtinfo = wgtinfo;
- });
- // #endif
- },
- computed: {
- ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin']),
- ...mapState(["isShowIllegality", "appversion"])
- },
- methods: {
- ...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
- getData(current) {
- const date = current ? new Date(current) : new Date();
- this.year = date.getFullYear(); //保存当前年份
- this.month = date.getMonth() + 1; //保存当前月份
- this.day = date.getDate(); //保存当前日期
- },
- isSm() {
- rate({}).then(e => {
- if (e.data.is_auth == 2) {
- this.sm = 1;
- }
- });
- },
- comfirm(text) {
- let obj = this;
- let content = text; //需要复制的内容
- 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'
- });
- }
- },
- // 获取签到列表
- loadList() {
- let obj = this;
- let present = this.day; //保存当前天数用于后续计算
- let actionDay = 0; //用于计算活跃天数
- let arr = []; //保存返回数组;
- signList({
- page: 1,
- limit: 31
- }).then(e => {
- arr = e.data.map((e, ind) => {
- let time = e.add_time.split('-');
- let day = parseInt(time[2].replace(/^0/i, ''));
- let year = time[0];
- let month = +time[1];
- if (obj.year == year && obj.month == month) {
- return day;
- }
- });
- // 判断今天是否已经签到
- if (arr[0] == this.day) {
- this.qded = true;
- }
- });
- },
- //获取签到用户信息
- signUser() {
- signUser({
- all: 1
- }).then(({
- data
- }) => {
- this.actionDay = data.sign_num; //连续签到天数
- this.sum_integral = data.sum_integral; //累计总积分
- });
- },
- // 加载初始数据
- loadBaseData() {
- getUserInfo({})
- .then(({
- data
- }) => {
- this.setUserInfo(data);
- // 获取用户数据完毕后在获取订单数据防止多次跳转到登录页
- orderData({})
- .then(({
- data
- }) => {
- this.setOrderInfo(data);
- })
- .catch(e => {
- this.setOrderInfo({
- complete_count: 0, //完成
- received_count: 0, //待收货
- unshipped_count: 0, //待发货
- order_count: 0, //订单总数
- unpaid_count: 0 //待付款
- });
- });
- })
- .catch(e => {
- console.log(e);
- });
- },
- /**
- * 统一跳转接口,拦截未登录路由
- * navigator标签现在默认没有转场动画,所以用view
- */
- navTo(url) {
- const obj = this;
- if (!this.hasLogin) {
- // 保存地址
- saveUrl();
- // 登录拦截
- interceptor();
- } else {
- if (url == '/pages/user/approve') {
- rate({})
- .then(e => {
- console.log(e);
- if (e.data.is_auth == null) {
- uni.navigateTo({
- url
- });
- }
- if (e.data.is_auth == 0) {
- uni.navigateTo({
- url
- });
- }
- if (e.data.is_auth == 1) {
- // this.$api.msg('正在审核中请耐心等待');
- uni.navigateTo({
- url
- });
- }
- if (e.data.is_auth == 2) {
- this.$api.msg('已通过实名认证,无需再实名认证');
- }
- if (e.data.is_auth == 3) {
- uni.navigateTo({
- url
- });
- // uni.showModal({
- // title: '提示',
- // content: '申请失败,原因' + e.data.off + '是否重新申请',
- // success: function(res) {
- // if (res.confirm) {
- // uni.navigateTo({
- // url
- // });
- // } else if (res.cancel) {
- // console.log('用户点击取消');
- // }
- // }
- // });
- }
- })
- .catch(e => {
- return;
- });
- } else if (url == '/pages/user/gzsq') {
- apply_status({})
- .then(e => {
- if (e.data.status != 0) {
- if (e.data.status == 3) {
- uni.showModal({
- title: '提示',
- content: '申请失败是否重新申请',
- success: function(res) {
- if (res.confirm) {
- uni.navigateTo({
- url
- });
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- } else {
- obj.$api.msg(e.data.str);
- }
- } else {
- uni.navigateTo({
- url
- });
- }
- })
- .catch(e => {});
- } else {
- uni.navigateTo({
- url,
- fail() {
- uni.switchTab({
- url
- });
- }
- });
- }
- }
- },
- useTool(e) {
- this.navTo(e.path);
- },
- // 签到弹窗
- goQd() {
- integral({})
- .then(e => {
- this.integral = console.log(e);
- // 改为已签到
- this.qded = true;
- this.today_integral = e.data.integral;
- this.actionDay++;
- this.sum_integral = +this.sum_integral + +e.data.integral;
- this.$refs.popupqd.open();
- })
- .catch(e => {
- console.log(e);
- });
- },
- // 关闭签到弹窗
- closeQd() {
- this.$refs.popupqd.close();
- },
- // 打开客服
- openKf() {
- this.$refs.popupkf.open();
- },
- // 关闭客服
- cancel() {
- this.$refs.popupkf.close();
- }
- }
- };
- </script>
- <style lang="scss">
- .container {
- background-image: url('../../static/user/user-bg.png');
- background-size: 100% 100%;
- min-height: 1200rpx;
- }
- .userinfo {
- width: 709rpx;
- height: 316rpx;
- margin: auto;
- justify-content: flex-start;
- .avt {
- border-radius: 50%;
- // border-radius: 2rpx;
- border: 2rpx solid #fff;
- height: 124rpx;
- width: 124rpx;
- image {
- width: 120rpx;
- height: 120rpx;
- }
- }
- .info {
- font-weight: 800;
- font-size: 31rpx;
- color: #212121;
- padding-left: 23rpx;
- .name {
- width: 500rpx;
- }
- .id {
- width: 188rpx;
- height: 32rpx;
- border-radius: 5rpx;
- border: 1px solid #797E96;
- padding-right: 10rpx;
- margin-top: 20rpx;
- .xs {
- width: 40rpx;
- line-height:30rpx;
- background: linear-gradient(0deg, #384054, #707991);
- border-radius: 5rpx;
- font-size: 25rpx;
- color: #FFFFFF;
- text-align: center;
- }
- .copy {
- width: 24rpx;
- height: 24rpx;
- }
- .val {
- flex-grow: 1;
- padding-left: 6rpx;
- font-weight: 500;
- font-size: 25rpx;
- color: #212121;
- }
- }
- }
- }
- .ks {
- width: 709rpx;
- height: 162rpx;
- background-color: #1b2d59;
- margin:auto;
- color: #FFFFFF;
- position: relative;
- padding: 0 30rpx 0 20rpx;
- &::before ,&::after {
- content: '';
- width: 15rpx;
- height: 15rpx;
- position: absolute;
- background-color: #fff;
- }
- &::after {
- right: 15rpx;
- top: 0;
- }
- &::before {
- right: 0;
- top: 15rpx;
- }
- image {
- width: 107rpx;
- height: 84rpx;
- }
- .value {
- font-size: 23rpx;
- padding-left: 10rpx;
- flex-grow: 1;
- .val {
- font-size: 44rpx;
- }
-
- }
- .btn {
- width: 89rpx;
- // height: 38rpx;
- padding: 6rpx 0;
- border-radius: 19rpx;
- border: 1px solid #DDE1EB;
- font-weight: 500;
- font-size: 24rpx;
- text-align: center;
- }
- }
- .friend {
- width: 709rpx;
- height: 253rpx;
- background: #FFFFFF;
- border-radius: 10rpx;
- margin: 26rpx auto 30rpx;
- padding: 30rpx 20rpx;
- .top {
- font-weight: bold;
- font-size: 29rpx;
- color: #212121;
- justify-content: flex-start;
- image {
- width: 89rpx;
- height: 35rpx;
- }
- .tc {
- flex-grow: 1;
- }
- .xq {
- font-weight: 400;
- font-size: 26rpx;
- color: #8B8B8B;
- image {
- width: 10rpx;
- height: 20rpx;
- margin-left: 13rpx;
- }
- }
- }
- .tit {
- font-size: 24rpx;
- color: #8B8B8B;
- padding-top: 15rpx;
- }
- .val-wrap {
- padding-top: 30rpx;
- justify-content: flex-start;
- .item {
- padding:0 15rpx 0 0rpx;
- font-size: 24rpx;
- color: #8B8B8B;
- .val {
- font-size: 41rpx;
- color: #222222;
- &::after {
- content: '个';
- font-size: 24rpx;
- }
- }
- }
- .item1 {
- flex-grow: 1;
- border-left: 1px solid #ECECEC;
- padding-left: 30rpx;
-
- }
- .btn {
- width: 211rpx;
- line-height: 83rpx;
- background: #333333;
- border-radius: 8rpx;
- font-weight: bold;
- font-size: 28rpx;
- color: #FFFFFF;
- text-align: center;
- }
- }
- }
- .main-box {
- margin: 20rpx auto 0;
- width: 710rpx;
- background: #ffffff;
- box-shadow: 0px 4rpx 14rpx 0px rgba(229, 229, 229, 0.46);
- border-radius: 20rpx;
-
- .title {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 24rpx;
-
- .title-left {
- display: flex;
- align-items: center;
-
- .title-icon {
- width: 32rpx;
- height: 32rpx;
- }
-
- .title-font {
- margin-left: 20rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- }
-
- .title-right {
- width: 14rpx;
- height: 24rpx;
- }
- }
-
- .main {
- padding: 30rpx 0 30rpx;
- flex-wrap: wrap;
- justify-content: flex-start;
- .jg {
- width: 1px;
- height: 100rpx;
- background: #eeeeee;
- }
-
- .item {
- padding-bottom: 20rpx;
- width: 25%;
- display: flex;
- flex-direction: column;
- align-items: center;
-
- .item-num {
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
-
- .item-font {
- margin-top: 18rpx;
- font-size: 22rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- }
- }
-
- .oitem {
- width: 25%;
- display: flex;
- flex-direction: column;
- align-items: center;
- margin-bottom: 50rpx;
- .oitem-image {
- height: 50rpx;
- width: 58rpx;
- }
-
- .oitem-font {
- font-weight: 500;
- font-size: 25rpx;
- color: #212121;
- padding-top: 15rpx;
- }
- }
- }
- }
- .popup-box {
- background-image: url('../../static/user/tc.png');
- width: 542rpx;
- height: 647rpx;
- background-size: 100% 100%;
- }
- </style>
|