| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583 |
- <template>
- <view>
- <view :class="'mine' + (skinNotColor ? ' not-color' : '')">
- <view :style="'height:' + systems.barHeight + 'rpx;'"></view>
- <view
- :style="'top:' + systems.ktxStatusHeight + 'rpx;z-index:3;position: absolute;'+'line-height: '+ systems.navigationHeight+'rpx;text-align: center;left: 0;font-size: 34rpx;right: 0;color: #FFFFFF;'">
- 我的
- </view>
- <image src="../../static/pages/images/userBg.png" class="wdbg" @click="jumpUrl('mine/userinfo/userinfo')">
- </image>
- <view class="minec">
- <view class="minec-img" @click="jumpUrl('mine/set/index')">
- <image :src="userInfos.avatar ? userInfos.avatar : '/static/pages/images/userimg.png'"
- mode="aspectFit" class="user"></image>
- </view>
- <view class="mines" @click="jumpUrl('mine/set/index')" v-if="isLogin">
- <view class="ddflex">
- {{ userInfos.nickName }}
- <image src="../../static/pages/images/rz_qy_h.png" class="auth-img"
- v-if="userInfos.authStatus == 2"></image>
- <image src="../../static/pages/images/rz_qy.png" class="auth-img" v-else></image>
- <image src="../../static/pages/images/rz_gr_h.png" class="auth-img"
- v-if="userInfos.companyStatus == 2"></image>
- <image src="../../static/pages/images/rz_gr.png" class="auth-img" v-else></image>
- </view>
- <text class="edu" v-if="userInfos.mobile">{{ styleHintPhoneText(userInfos.mobile) }}</text>
- </view>
- <view class="flex" v-else><text class="login-btn" @click="jumpUrl('')">点击登录</text></view>
- <view class="rule dflex" @click="isSign == 0 || sign == 1 ? jumpUrl('') : signFun()" v-if="isShowSign">
- <image src="/static/pages/images/qdico.png"></image>
- {{ !isLogin ? '签到' : isSign == 0 || sign == 1 ? '已签到' : '签到' }}
- </view>
- <!-- </navigator> -->
- </view>
- <view class="datas dflex">
- <navigator url="" hover-class="none" class="li" v-if="is_open_wallet.isOpenWallet == 1"
- @click="jumpUrl('wallet/index/index')">
- <text>{{ userMoney ? userMoney : '0.00' }}</text>
- 钱包
- </navigator>
- <navigator url="" hover-class="none" class="li"
- :style="is_open_wallet.isOpenWallet != 1 && Open_Points_Mall != 1 ? 'width:50%' : ''"
- @click="jumpUrl('mine/coupons/coupons')">
- <text>{{ userInfos.coupon ? userInfos.coupon : '0' }}</text>
- 优惠券
- </navigator>
- <navigator url="" hover-class="none" class="li" @click="jumpUrl('integralshop/index/index')">
- <text>{{ userInfos.integral ? userInfos.integral : '0' }}</text>
- 积分
- </navigator>
- <navigator url="" hover-class="none" class="li"
- :style="is_open_wallet.isOpenWallet != 1 && Open_Points_Mall != 1 ? 'width:50%' : ''"
- @click="jumpUrl('mine/collect/collect')">
- <text>{{ userInfos.collect ? userInfos.collect : '0' }}</text>
- 收藏
- </navigator>
- <!-- <navigator url="/mine/footprint/footprint" hover-class="none" class="li"><text>{{footprint?footprint:'0'}}</text>足迹</navigator> -->
- </view>
- <view style="height: 80rpx;"></view>
- </view>
- <view class="con" style="margin-top: -80rpx;">
- <view class="order">
- <navigator url="" hover-class="none" class="tits dflex" @click="jumpUrl('mine/order/order')">
- <view class="flex">我的活动</view>
- 全部活动
- <image src="../../static/pages/images/more.png" class="rico"></image>
- </navigator>
- <view class="ddflex" style="justify-content: space-between;padding: 40rpx 80rpx;">
- <view class="order-item ddflex">
- <image src="../../static/images/sd_tw.png"></image>
- <view>待参与</view>
- </view>
- <vieW class="order-line"></vieW>
- <view class="order-item ddflex">
- <image src="../../static/images/sd_tw.png"></image>
- <view>已完成</view>
- </view>
- </view>
- </view>
- </view>
- <view class="con">
- <view class="order">
- <navigator url="" hover-class="none" class="tits dflex" @click="jumpUrl('mine/order/order')">
- <view class="flex">我的顾问</view>
- </navigator>
- <view class="service-person">
- <view class="ddflex" @click="jumpUrl('/card/index/index')">
- <image class="service-person-header" src="../../static/pages/images/userimg.png"></image>
- <view>
- <view class="service-person-name ddflex">
- <view>Hi~我是杜平</view>
- <image src="/static/images/rico2.png" class="rico"></image>
- </view>
- <view class="service-person-number">(工号:106547) 欢迎您来到我的微页</view>
- <view class="service-person-options ddflex">
- <view class="service-person-option ddflex">
- <image src="/static/pages/images/dz_hui.png"></image>
- <view>96%</view>
- </view>
- <view class="service-person-option ddflex">
- <image src="/static/pages/images/cy_hui.png"></image>
- <view>从业21.6年</view>
- </view>
- <view class="service-person-option ddflex">
- <image src="/static/pages/images/fw_hui.png"></image>
- <view>为1678人服务</view>
- </view>
- </view>
- </view>
- </view>
- <view class="service-person-phone ddflex">
- <view class="ddflex flex" style="justify-content: center;">
- <image src="/static/pages/images/phone1.png"></image>
- <view>联系电话</view>
- </view>
- <view class="order-line"></view>
- <view class="ddflex flex" style="justify-content: center;">
- <image style="width: 35rpx;height: 28rpx;" src="/static/pages/images/qw.png"></image>
- <view>加企微信</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="box mlist">
- <navigator class="li ddflex" url="/promote/invite/invite" hover-class="none">
- <image :src="picUrlss + 'scrm/mico_fx.png'" class="mico"></image>
- <view class="fflex">推荐好友</view>
- <image src="../../static/pages/images/more.png" class="rico"></image>
- </navigator>
- </view>
- <view class="box mlist">
- <view class="li ddflex">
- <view class="fflex">
- <contact-button class-name="ddflex" :img-url="picUrlss+'scrm/mico_kf.png'"
- img-style='width: 49rpx;height: 49rpx;margin: 0 25rpx 0 0;' button-text="联系客服"
- styles="line-height:initial;"></contact-button>
- </view>
- <image src="../../static/pages/images/more.png" class="rico"></image>
- </view>
- <navigator class="li ddflex" url="/mine/help/help" hover-class="none">
- <image :src="picUrlss+'ruiteng/my_service5.png'" class="mico" mode="aspectFit"></image>
- <view class="fflex">帮助中心</view>
- <image src="../../static/pages/images/more.png" class="rico"></image>
- </navigator>
- <navigator class="li ddflex" url="/mine/feedback/feedback" hover-class="none">
- <image :src="picUrlss + 'scrm/mico_fk.png'" class="mico"></image>
- <view class="fflex">建议与反馈</view>
- <image src="../../static/pages/images/more.png" class="rico"></image>
- </navigator>
- <navigator class="li ddflex" url="/pages/about/about" hover-class="none">
- <image :src="picUrlss + 'scrm/mico_about.png'" class="mico"></image>
- <view class="fflex">关于中国人寿</view>
- <image src="../../static/pages/images/more.png" class="rico"></image>
- </navigator>
- </view>
- <footer-copyright></footer-copyright>
- <!-- <view class="placeholder-view" :style="'height:' + (bottomBlankHeignt + 115) + 'rpx'"></view> -->
- <foot channel="user"></foot>
- <update-userinfo :update-info="isUpdateInfo" :update-mobile="isUpdateMobile" v-if="isShowUpdate"
- @closeUpdate="closeUpdate" @updateInfo="updateInfo" @updateMobile="updateMobile"></update-userinfo>
- <view class="lt ddflex" @click="jumpConversation()">
- <view class="ddflex" style="position: relative;width: 100%;height: 100%;">
- <image src="../../static/pages/images/lt.png"></image>
- <view class="lt-num">1</view>
- </view>
- </view>
- </view>
- </template>
- <script>
- // pages/user/user.js
- const app = getApp();
- const req = require('../../utils/request.js');
- const util = require('../../utils/util.js');
- const route = require('../../utils/route');
- import foot from '../../components/nav-bar/index';
- import footerCopyright from '../../components/footer-copyright/footer-copyright';
- export default {
- data() {
- return {
- systems: {},
- skinNotColor: req.public.skinNotColor,
- picUrlss: req.public.picUrls,
- bottomBlankHeignt: app.globalData.isIPhoneX ? 68 : 0,
- // merchantId: '',
- iconSrc: req.public.iconSrc,
- //头部页面背景链接
- isHideVip: true,
- //隐藏会员
- isVip: true,
- //是否是会员
- IS_secondary_members: 0,
- distr: '',
- userinfovip: '',
- userMoney: '',
- istetphone: '',
- logo: '',
- name: '',
- is_open_wallet: '',
- Open_Points_Mall: '',
- statistics: '',
- vipList: '',
- rongkang: req.header.appId,
- isSign: '',
- sign: 0,
- isLogin: false,
- noLogin: false,
- is_open_shop: '',
- isShowSign: false, //是否显示签到按钮
- config: {},
- userInfo: {},
- userInfos: {},
- isShowUpdate: false, //是否显示更新信息弹窗
- isUpdateInfo: false, //更新用户信息
- isUpdateMobile: false, //绑定手机号
- };
- },
- components: {
- foot,
- footerCopyright
- },
- props: {},
- onLoad(options) {
- uni.hideTabBar();
- uni.setNavigationBarColor({
- frontColor: this.skinNotColor ? '#000' : '#ffffff',
- backgroundColor: this.skinNotColor ? '#fff' : req.public.titleTopBgColor
- });
- if (JSON.parse(req.getStorage('configRes')).IS_secondary_members) {
- let IS_secondary_members = JSON.parse(req.getStorage('configRes')).IS_secondary_members;
- console.log(IS_secondary_members);
- this.setData({
- IS_secondary_members: IS_secondary_members
- });
- }
- this.userInfo = req.getStorage('userInfo');
- // #ifdef MP-WEIXIN
- let userInfo = req.getStorage('userInfo');
- if (req.isAuth()) {
- setTimeout(res => {
- if (!userInfo.avatar || userInfo.nickName == '微信用户' || this.userInfos.nickName == '微信用户') {
- this.isShowUpdate = true;
- this.isUpdateInfo = true;
- }
- if (userInfo.avatar && !userInfo.mobile && (this.userInfos && !this.userInfos.mobile)) {
- this.isShowUpdate = true;
- this.isUpdateMobile = true;
- }
- }, 2000);
- }
- // #endif
- },
- onShow: function() {
- let userInfo = req.getStorage('userInfo');
- this.isLogin = req.isLogins(false);
- if (this.isLogin) {
- this.getMy();
- this.getAbout();
- this.getRule();
- this.noLogin = true;
- } else {
- this.noLogin = false;
- }
- },
- methods: {
- styleHintPhoneText(phone) {
- var phones = util.styleHintPhoneText(phone);
- return phones;
- },
- jumpUrl(url) {
- if (req.isLogins(true)) {
- app.globalData.navigateTo(url);
- }
- },
- jumpMerchantManage() {
- let token = req.getStorage('AUTH_TOKEN');
- this.jumpUrl('merchant/index?appId=' + req.header.appId + '&token=' + token);
- },
- // 是否签到{}
- isSignFun() {
- req.getRequest('/api/integral/isSign', {}, res => {
- this.setData({
- isSign: res
- });
- });
- },
- gouserInfo() {
- app.globalData.navigateTo('mine/userinfo/userinfo');
- },
- getDistributionConfig() {
- req.postRequest('/api/distribution/config', {}, res => {
- this.setData({
- distr: res
- });
- });
- },
- // 签到
- signFun() {
- req.postRequest('/api/integral/sign', {}, data => {
- if (data) {
- req.msg('连续签到' + data.continuityDay + '天' + ',获得' + data.IntegralChange + '积分');
- this.setData({
- sign: 1
- });
- this.getOpenPonints();
- }
- });
- },
- getuserVip() {
- req.getRequest('/api/user/levelDetails', {}, data => {
- let expireTime = Array;
- if (data.expireTime) {
- expireTime = data.expireTime.split(' ');
- data.expireTime = data.expireTime.replace(/-/g, '/');
- } // 解决苹果不兼容---日期
- // data.expireTime=data.expireTime.replace(/-/g, '/')
- let nowTime = new Date().getTime();
- let endTime = new Date(data.expireTime).getTime();
- let times = parseInt((endTime - nowTime) / 1000); // var expireTime= new Date(data.expireTime)
- // var time1=expireTime.getTime();
- // console.log(times, nowTime, endTime, data.expireTime);
- this.setData({
- userinfovip: data,
- ['userinfovip.expireTime']: expireTime[0]
- });
- if (times <= 0) {
- this.setData({
- ['userinfovip.end']: true
- });
- } else {
- this.setData({
- ['userinfovip.end']: false
- });
- }
- // console.log(data);
- });
- },
- getOpenPonints() {
- req.getRequest('/api/integral/returnIntegral', {}, res => {
- this.setData({
- integral: res
- });
- });
- },
- getMy() {
- let that = this;
- req.getRequest('/api/user/info', {}, data => {
- // data.merchantId = req.getStorage('userInfo').merchantId
- data.nickName = req.excludeSpecial(data.nickName);
- this.userInfos = data;
- // that.setData(data); // this.isbindmobile();
- console.log('userinfo==' + JSON.stringify(data));
- this.isSignFun();
- this.getstatistics(data);
- this.getDistributionConfig();
- this.getuserVip();
- this.getuserMoney();
- this.getVip();
- this.getOpenPonints();
- // console.log(this);
- });
- },
- getuserMoney() {
- let is_open_wallet = JSON.parse(req.getStorage('configRes')).is_open_wallet;
- if (is_open_wallet) {
- if (JSON.parse(is_open_wallet).isOpenWallet == 1) {
- route.extendNew({}, res => {
- // console.log(parseFloat(res.all).toFixed(2));
- if (res)
- this.setData({
- userMoney: parseFloat(res.all).toFixed(2)
- });
- });
- }
- }
- },
- getAbout() {
- var _this = this;
- req.getRequest('/api/config', {}, function(res) {
- _this.phone = res.CONFIG_SERVICE_HOT_MOBILE;
- _this.config = res;
- _this.setData({
- istetphone: res.user_bind_mobile,
- logo: res.CONFIG_PROJECT_LOGO,
- name: res.CONFIG_PROJECT_TITLE
- });
- // console.log(res);
- if (res && res.is_open_wallet) {
- _this.setData({
- is_open_wallet: JSON.parse(res.is_open_wallet)
- });
- }
- if (res.is_open_shop) {
- _this.is_open_shop = res.is_open_shop;
- }
- // if (res.user_bind_mobile == '1') {
- // let userInfo = req.getStorage('userInfo');
- // if (userInfo && (userInfo.mobile == null || userInfo.mobile == '')) {
- // app.globalData.openPage('pages/authorize/authorize?bindmobile=1');
- // }
- // }
- });
- // 是否开启积分商城
- req.getRequest(
- '/api/params/value', {
- type: 'Open_Points_Mall'
- },
- res => {
- this.setData({
- Open_Points_Mall: res
- });
- }
- );
- },
- callPhone() {
- if (req.isLogins(true)) {
- uni.makePhoneCall({
- phoneNumber: this.phone
- });
- }
- },
- goUrl() {
- app.globalData.openPage('mine/vip/vip');
- },
- // 门店统计
- getstatistics(data) {
- let from = {};
- if (data.listShopBase && data.listShopBase != null && data.listShopBase.length > 0) {
- from.shopId = data.listShopBase[0].id;
- }
- if (data.listMerchant && data.listMerchant != null && data.listMerchant.length > 0 && data.listShopBase
- .length < 1) {
- from.merchantId = data.listMerchant[0].id;
- }
- req.getRequest('/api/order/statistics', from, data => {
- this.setData({
- statistics: data
- });
- console.log(data);
- });
- },
- getRule() {
- let that = this;
- req.getRequest('/api/integral/config', {}, res => {
- if (res && res.length > 0) {
- res.map(it => {
- if (it.illustrate && it.illustrate.indexOf('签到') > -1) {
- if (it.state == 2) {
- that.isShowSign = true;
- }
- }
- });
- }
- });
- },
- getVipListOrg() {
- if (this.vipList && this.userinfovip) {
- if (!this.userinfovip.levelGrade) {
- this.vipList.map((it, index) => {
- this.vipList[0].isShowInfo = true;
- });
- } else {
- this.vipList.map((it, index) => {
- if (this.userinfovip.level == it.id) {
- if (index < this.vipList.length - 1) {
- this.vipList[index + 1].isShowInfo = true;
- }
- }
- });
- }
- }
- },
- getVip() {
- req.getRequest('/api/levelStrategy/userLevelList', {}, data => {
- if (data && data.length > 0) {
- data.map((it, index) => {
- it.upgradeTerm = JSON.parse(it.upgradeTerm);
- it.isShowInfo = false;
- // if(index == 0) it.isShowInfo = true;
- return it;
- });
- this.vipList = data;
- this.getVipListOrg();
- }
- });
- },
- showInfo(index) {
- if (!this.vipList[index].isShowInfo) {
- this.vipList.map(it => {
- it.isShowInfo = false;
- return it;
- });
- }
- this.vipList[index].isShowInfo = !this.vipList[index].isShowInfo;
- },
- closeUpdate() {
- this.isShowUpdate = false;
- },
- updateInfo(e) {
- this.isUpdateInfo = e;
- this.getMy();
- },
- updateMobile(e) {
- this.isUpdateMobile = e;
- this.getMy();
- },
- jumpConversation() {
- req.jumpConversation();
- },
- // 判断强制绑定手机号
- // isbindmobile() {
- // if (req.getStorage('configRes')) {
- // let configRes = JSON.parse(req.getStorage('configRes'))
- // this.setData({ istetphone: configRes.user_bind_mobile, logo: configRes.CONFIG_PROJECT_LOGO, name: configRes.CONFIG_PROJECT_TITLE })
- // } else {
- // req.g('/api/config', (res) => {
- // req.setStorage('configRes', JSON.stringify(res))
- // this.setData({ istetphone: res.user_bind_mobile, logo: res.CONFIG_PROJECT_LOGO, name: res.CONFIG_PROJECT_TITLE })
- // })
- // }
- // if(this.data.istetphone=='1'){
- // // 获取用户手机号
- // let userInfo= req.getStorage('userInfo')
- // if(userInfo.mobile==null||userInfo.mobile==''){
- // console.log("获取用户手机号===============================")
- // app.openPage('pages/authorize/authorize?bindmobile=1')
- // }
- // }
- // },
- },
- created() {
- const systemInfo = uni.getSystemInfoSync();
- // px转换到rpx的比例
- let pxToRpxScale = 750 / systemInfo.windowWidth;
- let systems = {
- ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
- navigationHeight: 44 * pxToRpxScale // 导航栏的高度
- };
- systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
- this.systems = systems;
- }
- };
- </script>
- <style>
- @import './user.css';
- </style>
|