仿东郊到家【8月份稳定版】同城到家/家政上门/美容/理疗/足疗/推拿/私教/瑜伽/健身

1、物料商城(商品分类、商品管理)
2、地图导览(平台总销售额、人员统计、营收数据、当前开放城市)
3、后台新增:技师统计(技师概况、技师数据统计、区域分布、技师数据等,可视化数据一目了然)
4、前台新增:地图找人(对技师分布精确定位、用户所在地,可视化数据一目了然)
5、服务管理(新增服务分类、加钟服务、服务审核、服务设置、加钟设置)
6、技师管理(新增技师入驻开关、首页推荐等)
7、营销管理(新增文章管理)
8、业务员(业务员审核、业务员数据、业务员设置)
9、渠道商(新增渠道商佣金设置)
10、代理商(代理商账号、代理商申请、代理商设置)
11、分销合伙人(分销合伙人审核、分销合伙人数据、分销合伙人设置)
12、动态管理(动态管理、评论管理、动态设置)
13、权限管理(手机端权限管理、手机端设置、后台权限管理、角色管理、账号管理、操作管理、操作日志)
14、门店管理(关联代理商)
15、电子合同(用于和平台入驻理疗师签订线上合作协议)
16、录音功能等大量新功能。
17、问题反馈(问题反馈、差评申诉)
18、DIY(新增行业服务人员名称开关。例如技师、美容师、理疗师)
19、系统设置:1、新增链接管理,可配置理疗师入驻页面、合作加盟页面链接到公众号菜单栏; 2、短信通知(新增阿里云配置、容联七陌配置、虚拟号设置、来电通知; 3、新增应用名称设置。

<template>
    <view class="pages-mine" v-if="mineInfo.id">
        <!-- <image mode="aspectFill" lazy-load class="mine-bg abs" :src="configInfo[image_type[userPageType]]"></image> -->
        <view :style="{ background: primaryColor }" class="pd-lg" style="height: 292rpx">
            <view class="pt-lg" :class="[{ 'flex-warp': userInfo.nickName }, { 'flex-center': !userInfo.nickName }]">
                <view class="avatar_view">
                    <image mode="aspectFill" class="avatar radius" :src="mineInfo.avatarUrl || `/static/mine/default_user.png`"></image>
                    <view class="text" v-if="mineInfo.is_admin == 1">代理商</view>
                </view>

                <block v-if="userInfo && !userInfo.nickName">
                    <auth :needAuth="userInfo && (!userInfo.phone || !userInfo.nickName)" :must="true" :type="!userInfo.phone ? 'phone' : 'userInfo'" class="flex-1">
                        <view class="flex-1 f-md-title text-bold ml-md" :style="{ color: configInfo[font_type[userPageType]] }">登录</view>
                    </auth>
                </block>
                <view class="flex-1 ml-md mt-sm rel" :style="{ color: configInfo[font_type[userPageType]] }" v-else>
                    <view class="flex-between">
                        <view @tap.stop="authUserProfile" class="flex-y-center f-title text-bold" style="color:#fff">
                            <view class="mr-sm max-500 ellipsis">{{ userInfo.nickName || '用户昵称' }}</view>
                            <!-- #ifdef MP-WEIXIN -->
                            <i class="flex-1 iconfont icon-shuaxin"></i>
                            <!-- #endif -->
                        </view>
                        <view @tap.stop="$util.goUrl({ url: `/user/pages/setting` })" class="notice-item ml-md"><i style="color:#fff" class="iconfont icon-xitong text-bold"></i></view>
                    </view>
                    <view class="flex-between">
                        <view class=" member-tag flex-center mt-sm pl-md pr-md f-caption radius ">
                            <i class="iconfont iconhuiyuanka mr-sm"></i>
                            {{ mineInfo.coach_status === 2 ? mineInfo.coach_level.title || '宠托师' : '普通用户' }}
                        </view>
                        <view class="f-desc">
                            <block v-if="mineInfo.coach_status === 2 && mineInfo.service_time_long * 1 > 0">{{ `已服务${mineInfo.service_time_long}分钟` }}</block>
                        </view>
                    </view>
                    <view @tap.stop="toChooseLocation" class="flex-x-center mt-md f-caption" style="height: 72rpx" v-if="mineInfo.coach_status == 2">
                        <i class="iconfont iconjuli mr-sm"></i>
                        <!-- 实时地址: -->
                        <view class="flex-1 ellipsis-2">{{ coach_info.address }}</view>
                    </view>
                    <view class="mt-md" style="height: 72rpx" v-else></view>
                </view>
            </view>
        </view>

        <view class="pages-mine-content">
            <!-- 用户 -->
            <!-- coach_status 1申请中,2已通过,3已取消授权,4已拒绝 -->
            <block v-if="userPageType == 1">
                <view class="pages-mine-balance" :style="{background:primaryColor}">
                    <view class="pages-mine-balance-left">
                        <view class="pages-mine-balance-title">账户余额</view>
                        <view class="pages-mine-balance-number">{{ mineInfo.balance || 0 }}</view>
                    </view>

                    <view class="pages-mine-balance-right">
                        <auth
                            :needAuth="userInfo && (!userInfo.phone || !userInfo.nickName)"
                            :must="true"
                            :type="!userInfo.phone ? 'phone' : 'userInfo'"
                            @go="$util.goUrl({ url: `/user/pages/stored/list` })"
                            :style="{width:'50%', color:primaryColor}"
                        >
                            立即充值
                        </auth>
                    </view>
                </view>

                <view class="pages-mine-panel">
                    <view class="pages-mine-panel-item">
                        <auth
                            :needAuth="userInfo && (!userInfo.phone || !userInfo.nickName)"
                            :must="true"
                            :type="!userInfo.phone ? 'phone' : 'userInfo'"
                            @go="$util.goUrl({ url: `/user/pages/coupon/list` })"
                            style="width: 50%"
                        >
                            <view class="pages-mine-panel-item-text">我的卡券</view>
                            <view class="pages-mine-panel-item-tips">剩余{{ mineInfo.coupon_count || 0 }}张</view>
                        </auth>
                    </view>
                    <view class="pages-mine-panel-item">
                        <auth :needAuth="userInfo && (!userInfo.phone || !userInfo.nickName)" :must="true" :type="!userInfo.phone ? 'phone' : 'userInfo'" @go="toAtv" style="width: 50%">
                            <view class="pages-mine-panel-item-text">邀请有礼</view>
                            <view class="pages-mine-panel-item-tips">邀请得福利</view>
                        </auth>
                    </view>
                </view>

                <!--     <view class="flex-center ml-lg mr-lg pt-md pb-md fill-base f-caption c-caption box-shadow radius-16 rel mine-header">
                <view class="flex-center flex-column" style="width: 50%">
                    <view class="f-lg-title c-title">{{ mineInfo.balance || 0 }}</view>
                    <view>我的余额</view>
                </view>
                <auth :needAuth="userInfo && (!userInfo.phone || !userInfo.nickName)" :must="true"
                    :type="!userInfo.phone ? 'phone' : 'userInfo'" @go="$util.goUrl({ url: `/user/pages/coupon/list` })"
                    style="width: 50%">
                    <view class="flex-center flex-column f-caption c-caption">
                        <view class="f-lg-title c-title">{{ mineInfo.coupon_count || 0 }}</view>
                        <view>我的卡券</view>
                    </view>
                </auth>
                <auth :needAuth="userInfo && (!userInfo.phone || !userInfo.nickName)" :must="true"
                    :type="!userInfo.phone ? 'phone' : 'userInfo'" @go="toAtv" style="width: 50%">
                    <view class="flex-center flex-column f-caption c-caption">
                        <view>
                            <view class="f-title text-bold mb-sm" :style="{ color: primaryColor }">邀请有礼</view> -->
                <!-- 邀请新人 获得福利 -->
                <!--         <view>邀新得福利</view>
                        </view> -->
                <!-- <image class="coupon-img" src="/static/mine/coupon.png"></image> -->
                <!--     </view>
                </auth>
                <auth :needAuth="userInfo && (!userInfo.phone || !userInfo.nickName)" :must="true"
                    :type="!userInfo.phone ? 'phone' : 'userInfo'" @go="$util.goUrl({ url: `/user/pages/stored/list` })"
                    style="width: 50%">
                    <view class="flex-center flex-column f-caption c-caption">
                        <view>
                            <view class="f-title text-bold mb-sm" :style="{ color: primaryColor }">充值</view> -->
                <!-- 余额充值 -->
                <!--     <view>充送活动</view>
                        </view> -->
                <!-- <view class="item-icon rel flex-center">
                            <view class="item-icon radius abs" :style="{background:primaryColor}"></view>
                            <i class="iconfont iconchongzhi" :style="{color:primaryColor}"></i>
                        </view> -->
                <!--                     </view>
                </auth>
            </view> -->

                <!-- <view class="share-list flex-between mt-md">
                <auth :needAuth="userInfo && (!userInfo.phone || !userInfo.nickName)" :must="true"
                    :type="!userInfo.phone ? 'phone' : 'userInfo'" @go="toAtv" style="width: 50%">
                    <view
                        class="flex-between ml-lg mr-sm pt-lg pb-lg pl-md pr-sm fill-base f-caption c-desc box-shadow radius-16 ">
                        <view>
                            <view class="f-title text-bold mb-sm" :style="{ color: primaryColor }">邀请有礼</view>
                            <view>邀请新人 获得福利</view>
                        </view>
                        <image class="coupon-img" src="/static/mine/coupon.png"></image>
                    </view>
                </auth>
                <auth :needAuth="userInfo && (!userInfo.phone || !userInfo.nickName)" :must="true"
                    :type="!userInfo.phone ? 'phone' : 'userInfo'" @go="$util.goUrl({ url: `/user/pages/stored/list` })"
                    style="width: 50%">
                    <view
                        class=" flex-between ml-sm mr-lg pt-lg pb-lg pl-md pr-sm fill-base f-caption c-desc box-shadow radius-16 ">
                        <view>
                            <view class="f-title text-bold mb-sm" :style="{ color: primaryColor }">充值</view>
                            <view>余额充值 充送活动</view>
                        </view>
                        <view class="item-icon rel flex-center">
                            <view class="item-icon radius abs" :style="{background:primaryColor}"></view>
                            <i class="iconfont iconchongzhi" :style="{color:primaryColor}"></i>
                        </view>
                    </view>
                </auth>
            </view> -->

                <view class="mine-menus">
                    <view class="mine-menus-header" @tap="toJumpAll(1)">
                        <view class="mine-menus-title">我的订单</view>
                        <view class="mine-menus-more">
                            <text>全部订单</text>
                            <text class="iconfont icon-right"></text>
                        </view>
                    </view>
                    <view class="mine-menus-content">
                        <view class="mine-menus-item" style="width: 20%;" @tap.stop="toJump('orderList', index)" v-for="(item, index) in orderList" :index="index" :key="index">
                            <view :class="['mine-menus-item-icon iconfont', item.icon]" :style="{ color: primaryColor }"></view>
                            <view class="mine-menus-item-text">{{ item.text }}</view>
                        </view>
                    </view>
                </view>
                <view class="mine-menus">
                    <view class="mine-menus-header"><view class="mine-menus-title">分享赚钱</view></view>
                    <view class="mine-menus-content">
                        <template v-for="(item, index) in mineInfo.is_fx ? distributionList : distributionApplyList">
                            <view
                                class="mine-menus-item"
                                :key="index"
                                v-if="item.text == '绑定宠托师' ? (mineInfo.is_admin == 1 ? true : false) : true"
                                @tap.stop="toJump(mineInfo.is_fx ? 'distributionList' : 'distributionApplyList', index)"
                            >
                                <view :class="['mine-menus-item-icon iconfont', item.icon]" :style="{ color: primaryColor }"></view>
                                <view class="mine-menus-item-text">{{ item.text }}</view>
                            </view>
                        </template>
                    </view>
                </view>
                <view class="mine-menus">
                    <view class="mine-menus-header"><view class="mine-menus-title">推荐工具</view></view>
                    <auth :needAuth="userInfo && (!userInfo.phone || !userInfo.nickName)" :must="true" :type="!userInfo.phone ? 'phone' : 'userInfo'">
                        <view class="mine-menus-content">
                            <view class="mine-menus-item" @click.native="toJump('toolList', index)" v-for="(item, index) in toolList" :index="index" :key="index">
                                <view :class="['mine-menus-item-icon iconfont', item.icon]" :style="{ color: primaryColor }"></view>
                                <view class="mine-menus-item-text">{{ item.text }}</view>
                            </view>
                        </view>
                    </auth>
                </view>

                <view @tap.stop="toChange" class="list-item pd-lg flex-center b-1px-t" v-if="mineInfo.coach_status == 2 || mineInfo.coach_status == 3">
                    <i class="iconfont iconqiehuanjishiduan" :style="{ color: primaryColor }"></i>
                    <view class="flex-1 flex-between ml-md">
                        <view class="f-paragraph c-title">切换宠托师端</view>
                        <i class="iconfont icon-switch c-caption"></i>
                    </view>
                </view>

                <view class="mine-tool-list fill-base radius-16">
                    <!-- <block v-for="(item, index) in toolList" :key="index"> -->
                    <!-- #ifdef MP-WEIXIN -->
                    <!-- <button :open-type="configInfo.im_type == 2 ?'contact':''" class="clear-btn"
                        v-if="item.text == '联系客服' && configInfo.im_type == 2">
                        <view class="list-item pt-lg pb-lg ml-lg mr-lg  flex-center"
                            :class="[{ 'b-1px-t': index != 0 }]">
                            <i class="iconfont" :class="item.icon" :style="{color:primaryColor}"></i>
                            <view class="flex-1 flex-between ml-md">
                                <view class="f-paragraph c-title">{{ item.text }}222</view>
                                <i class="iconfont icon-right"></i>
                            </view>
                        </view>
                    </button>
                    <block v-else>
                        <auth :needAuth="userInfo && (!userInfo.phone || !userInfo.nickName)" :must="true"
                            :type="!userInfo.phone ? 'phone' : 'userInfo'" @go="toJump('toolList', index)">
                            
                            
                            <view class="list-item pt-lg pb-lg ml-lg mr-lg flex-center"
                                :class="[{ 'b-1px-t': index != 0 }]">
                                <i class="iconfont" :class="item.icon" :style="{color:primaryColor}"></i>
                                <view class="flex-1 flex-between ml-md">
                                    <view class="f-paragraph c-title">{{ item.text }}333</view>
                                    <i class="iconfont"
                                        :class="[{'iconbodadianhua text-bold':item.text == '联系客服'},{'icon-right':item.text != '联系客服'}]"
                                        :style="{fontSize:item.text == '联系客服'?'50rpx':'',color:item.text == '联系客服'?primaryColor:''}">
                                    </i>
                                </view>
                            </view>
                        </auth>
                    </block> -->
                    <!-- #endif -->
                    <!-- #ifndef MP-WEIXIN -->
                    <!-- <view @tap.stop="toJump('toolList', index)" class="list-item pt-lg pb-lg ml-lg mr-lg flex-center"
                        :class="[{ 'b-1px-t': index != 0 }]">
                        <i class="iconfont" :class="item.icon" :style="{color:primaryColor}"></i>
                        <view class="flex-1 flex-between ml-md">
                            <view class="f-paragraph c-title">{{ item.text }}444</view>
                            <i class="iconfont"
                                :class="[{'iconbodadianhua text-bold':item.text == '联系客服'},{'icon-right':item.text != '联系客服'}]"
                                :style="{fontSize:item.text == '联系客服'?'50rpx':'',color:item.text == '联系客服'?primaryColor:''}">
                            </i>
                        </view>
                    </view> -->
                    <!-- #endif -->
                    <!-- </block> -->
                </view>
            </block>
            <!-- 宠托师 -->
            <block v-if="userPageType == 2">
                <view class=" mine-count-list rel box-shadow ml-lg mr-lg fill-base f-caption c-caption radius-16 ">
                    <view class="cancel-auth iconfont icon-biaoqian c-caption flex-center abs" v-if="mineInfo.coach_status == 3"><view class="text-bold f-icontext abs">取消授权</view></view>
                    <view @tap.stop="$util.goUrl({ url: `/technician/pages/income/index` })" class="flex-between pd-lg b-1px-b">
                        <view>
                            <view>服务收入(元)</view>
                            <view class="f-md-title c-title">{{ coach_info.service_price || 0 }}</view>
                        </view>
                        <view class="cash-btn flex-center f-paragraph radius" :style="{ color: primaryColor, border: `1rpx solid ${primaryColor}` }">去提现</view>
                    </view>
                    <view @tap.stop="$util.goUrl({ url: `/user/pages/cash-out?type=carfee` })" class="flex-between pd-lg b-1px-b">
                        <view>
                            <view>车费(元)</view>
                            <view class="f-md-title c-title">{{ coach_info.car_price || 0 }}</view>
                        </view>
                        <view class="cash-btn flex-center f-paragraph radius" :style="{ color: primaryColor, border: `1rpx solid ${primaryColor}` }">去提现</view>
                    </view>
                    <view @tap.stop="$util.goUrl({ url: `/technician/pages/income/car-fee-record` })" class="flex-between pt-md pb-md pr-lg f-paragraph">
                        <view></view>
                        <view class="flex-y-center">
                            提现记录
                            <i class="iconfont icon-right"></i>
                        </view>
                    </view>
                </view>

                <view class="mine-menu-list box-shadow fill-base radius-16">
                    <view class="menu-title flex-between pl-lg pr-sm b-1px-b"><view class="f-paragraph c-title text-bold">我的订单</view></view>
                    <view class="flex-warp pt-lg pb-lg">
                        <view
                            @tap.stop="toJump('orderList2', index)"
                            class="item-child flex-center flex-column f-caption c-paragraph"
                            style="width: 33.3%"
                            v-for="(item, index) in orderList2"
                            :key="index"
                        >
                            <view class="item-img rel flex-center radius">
                                <view class="item-img radius abs" :style="{ background: primaryColor }"></view>
                                <i class="iconfont c-title" :class="item.icon" :style="{ color: primaryColor }"></i>
                            </view>
                            <view class="mt-sm">{{ item.text }}</view>
                        </view>
                    </view>
                </view>

                <view class="mine-tool-list box-shadow fill-base radius-16">
                    <uni-grid :column="4" :highlight="true">
                        <uni-grid-item v-for="(item, index) in toolList2" :index="index" :key="index" style="width: 25%; height: 135rpx;">
                            <view class="grid-item-box" :style="{ backgroundColor: item.color }" @click.native="toJump('toolList2', index)">
                                <i class="iconfont" :class="item.icon" :style="{ color: primaryColor }"></i>
                                <text class="text">{{ item.text }}</text>
                            </view>
                        </uni-grid-item>
                    </uni-grid>

                    <!-- <view @tap.stop="toJump('toolList2', index)" class="list-item pt-lg pb-lg ml-lg mr-lg flex-center"
                    :class="[{ 'b-1px-t': index != 0 }]" v-for="(item, index) in toolList2" :key="index">
                    <i class="iconfont" :class="item.icon" :style="{color:primaryColor}"></i>
                    <view class="flex-1 flex-between ml-md">
                        <view class="f-paragraph c-title">{{ item.text }}555</view>
                        <block v-if="item.url == 'change'">
                            <i class="iconfont icon-switch c-caption"></i>
                        </block>
                        <i class="iconfont icon-right" v-else></i>
                    </view>
                </view> -->
                </view>
            </block>

            <view @tap.stop="toHelp" class="fix help-img-info f-caption c-base" :style="{ bottom: `${configInfo.tabbarHeight + 15}px` }" v-if="mineInfo.coach_status == 2">
                <view class="bg-img radius abs" :style="{ background: primaryColor }"></view>
                <view class="help-info flex-center abs">
                    <view class="help-img radius flex-center flex-column" :style="{ background: primaryColor }">
                        <i class="iconfont iconjingbao"></i>
                        <view class="f-icontext">一键求救</view>
                    </view>
                </view>
            </view>

            <view :class="[{ 'space-max-footer': mineInfo.coach_status == 2 }, { 'space-footer': mineInfo.coach_status != 2 }]"></view>
        </view>
        <view :style="{ height: `${configInfo.tabbarHeight}px` }"></view>
        <tabbar :cur="2"></tabbar>
    </view>
</template>

<script>
import { mapState, mapActions, mapMutations } from 'vuex';
import tabbar from '@/components/tabbar.vue';
export default {
    components: {
        tabbar
    },
    data() {
        return {
            options: {},
            // 我的订单
            orderList: [
                {
                    icon: 'icondaizhifu',
                    text: '待支付',
                    url: '/pages/order?tab=1'
                },
                {
                    icon: 'icondaifuwu',
                    text: '待服务',
                    url: '/pages/order?tab=2'
                },
                {
                    icon: 'iconanmo2',
                    text: '服务中',
                    url: '/pages/order?tab=3'
                },
                {
                    icon: 'icondaipingjia',
                    text: '待评价',
                    url: '/pages/order?tab=4'
                },
                {
                    icon: 'icontuikuan',
                    text: '退款/售后',
                    url: '/user/pages/refund/list'
                }
            ],
            orderList2: [
                {
                    icon: 'icondaijiedan',
                    text: '待接单',
                    url: '/technician/pages/order/list'
                },
                {
                    icon: 'iconyijiedan',
                    text: '待服务',
                    url: '/technician/pages/order/list?tab=1'
                },
                {
                    icon: 'iconfuwuzhong',
                    text: '服务中',
                    url: '/technician/pages/order/list?tab=2'
                }
            ],
            // 分享赚钱
            distributionList: [
                {
                    icon: 'iconwodeshouyi',
                    text: '我的收益',
                    url: '/user/pages/distribution/income'
                },
                {
                    icon: 'icontuiguanghaibao',
                    text: '推广海报',
                    url: '/user/pages/distribution/poster'
                },
                {
                    icon: 'iconwodetuandui1',
                    text: '我的粉丝',
                    url: '/user/pages/distribution/team'
                },
                {
                    icon: 'iconbangdingjishi',
                    text: '绑定宠托师',
                    url: '/user/pages/distribution/bind-technician'
                }
            ],
            distributionApplyList: [
                {
                    icon: 'iconwodeshouyi',
                    text: '申请分销商',
                    url: '/user/pages/distribution/apply'
                },
                {
                    icon: 'iconbangdingjishi',
                    text: '绑定宠托师',
                    url: '/user/pages/distribution/bind-technician'
                }
            ],
            toolList: [
                {
                    icon: 'iconshoucangjishi',
                    text: '收藏宠托师',
                    url: '/user/pages/collect'
                },
                {
                    icon: 'icondizhiguanli',
                    text: '地址管理',
                    url: '/user/pages/address/list'
                },    
                {
                    icon: 'chongwu-1',
                    text: '宠物管理',
                    url: '/user/pages/pet/list'
                },
                {
                    icon: 'iconlianxikefu',
                    text: '联系客服',
                    url: ''
                }
            ],
            toolList2: [
                {
                    icon: 'iconshenqingjishi',
                    text: '编辑资料',
                    url: '/technician/pages/apply?is_edit=1'
                },
                {
                    icon: 'iconshijianguanli',
                    text: '时间管理',
                    url: '/technician/pages/time-manage'
                },
                {
                    icon: 'iconqiehuanjishiduan',
                    text: '切换用户端',
                    url: 'change'
                }
            ],
            image_type: {
                1: 'user_image',
                2: 'coach_image'
            },
            font_type: {
                1: 'user_font_color',
                2: 'coach_font_color'
            },
            coach_info: {},
            showAuth: false,
            offsetL: 360,
            offsetT: 0
        };
    },
    computed: mapState({
        primaryColor: state => state.config.configInfo.primaryColor,
        subColor: state => state.config.configInfo.subColor,
        configInfo: state => state.config.configInfo,
        commonOptions: state => state.user.commonOptions,
        userInfo: state => state.user.userInfo,
        userPageType: state => state.user.userPageType,
        mineInfo: state => state.user.mineInfo
    }),
    onLoad(options) {
        this.options = options;
        let { type = 0 } = options;
        if (type) {
            this.updateUserItem({
                key: 'userPageType',
                val: type
            });
        }
        if (!this.mineInfo.id) {
            this.$util.showLoading();
        }
        this.initIndex();
    },
    onPullDownRefresh() {
        // #ifndef APP-PLUS
        uni.showNavigationBarLoading();
        // #endif
        this.initRefresh();
        uni.stopPullDownRefresh();
    },
    methods: {
        ...mapActions(['getConfigInfo', 'getMineInfo', 'getAuthUserProfile', 'updateCommonOptions', 'toPlayAudio']),
        ...mapMutations(['updateUserItem']),
        async initIndex(refresh = false) {
            // #ifdef H5
            if (!refresh && this.$jweixin.isWechat()) {
                await this.$jweixin.initJssdk();
                this.$jweixin.wxReady(() => {
                    this.$jweixin.hideOptionMenu();
                });
            }
            // #endif

            if (!this.configInfo.id || refresh) {
                await this.getConfigInfo();
            }
            await this.getMineInfo();
            this.$util.setNavigationBarColor({
                bg: this.primaryColor
            });

            let { fx_check } = this.configInfo;
            let { coach_status, fx_status } = this.mineInfo;

            let val = this.$util.deepCopy(this.mineInfo);
            val.is_fx = !fx_check || (fx_check && fx_status == 2);
            this.updateUserItem({
                key: 'mineInfo',
                val
            });
            this.updateUserItem({
                key: 'userPageType',
                val: coach_status == 2 || coach_status == 3 ? this.userPageType : 1
            });

            let arr = ['coach_status', 'channel_status'];
            let textArr = {
                coach_status: {
                    text: '申请宠托师',
                    list: {
                        icon: 'iconshenqingjishi',
                        text: '申请宠托师',
                        url: '/user/pages/apply'
                    }
                },
                channel_status: {
                    text: '申请渠道商',
                    list: {
                        icon: 'icon-zuzhi',
                        text: '申请渠道商',
                        url: '/user/pages/channel/apply'
                    },
                    list2: {
                        icon: 'icon-zuzhi',
                        text: '我是渠道商',
                        url: '/user/pages/channel/income'
                    }
                }
            };
            arr.map(item => {
                if (this.mineInfo[item] != 2) {
                    let arr = this.toolList.filter(aitem => {
                        return aitem.text === textArr[item].text;
                    });
                    if (arr.length === 0) {
                        this.toolList.unshift(textArr[item].list);
                    }
                    if (item === 'channel_status') {
                        let aindex = this.toolList.findIndex(aitem => {
                            return aitem.text === '我是渠道商';
                        });
                        if (aindex != -1) {
                            this.toolList.splice(aindex, 1);
                        }
                    }
                } else {
                    this.toolList.map((aitem, aindex) => {
                        if (aitem.text === textArr[item].text) {
                            this.toolList.splice(aindex, 1);
                        }
                    });
                    if (item === 'channel_status') {
                        let arr = this.toolList.filter(aitem => {
                            return aitem.text === '我是渠道商';
                        });
                        if (arr.length === 0) {
                            this.toolList.unshift(textArr[item].list2);
                        }
                    }
                }
            });

            if (coach_status == 2 || coach_status == 3) {
                await this.getCoachInfo();
            }
            this.$util.hideAll();
        },

        compareVersion: function(v1, v2) {
            v1 = v1.split('.');
            v2 = v2.split('.');
            var len = Math.max(v1.length, v2.length);
            while (v1.length < len) {
                v1.push('0');
            }
            while (v2.length < len) {
                v2.push('0');
            }
            for (var i = 0; i < len; i++) {
                var num1 = parseInt(v1[i]);
                var num2 = parseInt(v2[i]);
                if (num1 > num2) {
                    return 1;
                } else if (num1 < num2) {
                    return -1;
                }
            }
            return 0;
        },

        initRefresh() {
            this.initIndex(true);
        },
        async getCoachInfo() {
            this.coach_info = await this.$api.technician.coachInfo();
        },
        // 更新用户信息
        async authUserProfile(e) {
            // #ifdef APP-PLUS
            uni.getUserInfo({
                provider: 'weixin',
                success: res => {
                    let { userInfo = {} } = res;
                    this.toUpdateUserInfo(userInfo);
                }
            });
            // #endif
            // #ifndef APP-PLUS
            var sdkversion = uni.getSystemInfoSync()['SDKVersion'];

            if (this.compareVersion('2.27.1', sdkversion) == 1) {
                debugger;
                uni.getUserProfile({
                    desc: '用于完善个人资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
                    success: res => {
                        let { userInfo = {}, encryptedData, iv } = res;
                        let param = Object.assign({}, userInfo, {
                            encryptedData,
                            iv
                        });
                        this.toUpdateUserInfo(param);
                    },
                    fail: res => {
                        console.log(res, '=====fail');
                        this.toUpdateUserInfo();
                    }
                });
            } else {
                debugger;
                //去填写
                wx.navigateTo({
                    url: '/user/pages/CustomUserInfo'
                });
            }
            // #endif
        },
        async toUpdateUserInfo(userInfo = {}) {
            let { pMust } = this;
            if (userInfo.nickName) {
                this.$util.showLoading({
                    title: '更新中'
                });
                let { coupon_atv_id = 0 } = this.commonOptions;
                userInfo.coupon_atv_id = coupon_atv_id;
                await this.getAuthUserProfile(userInfo);
                setTimeout(() => {
                    this.$util.hideAll();
                }, 1000);
            }
        },
        // 选择地区
        async toChooseLocation(e) {
            await this.$util.checkAuth({
                type: 'userLocation'
            });
            let [, { address = '', longitude, latitude }] = await uni.chooseLocation();
            if (!address) return;
            await this.$api.technician.coachUpdate({
                address,
                lng: longitude,
                lat: latitude
            });
            this.coach_info.address = address;
            this.$util.showToast({
                title: `更新成功`
            });
        },
        // 跳转页面
        toJumpAll(key) {
            let url = {
                1: `/pages/order`,
                2: `/technician/pages/order/list`
            };
            let openType = {
                1: `reLaunch`,
                2: `navigateTo`
            };
            this.$util.goUrl({
                url: url[key],
                openType: openType[key]
            });
        },
        toJump(key, index) {
            console.log(key);
            console.log(index);
            console.log(this[key][index]);
            let { url, text } = this[key][index];
            if (['申请宠托师', '申请分销商', '申请渠道商'].includes(text)) {
                this.toApply(text == '申请宠托师' ? 1 : text == '申请分销商' ? 2 : 3);
                return;
            }
            if (text == '切换用户端') {
                this.toChange();
                return;
            }
            if (text == '联系客服') {
                let { mobile: url, im_type } = this.configInfo;
                // #ifdef MP-WEIXIN
                if (im_type == 2) return;
                // #endif
                this.$util.goUrl({
                    url,
                    openType: 'call'
                });
                return;
            }
            let openType = key == 'orderList' && index !== 4 ? `reLaunch` : 'navigateTo';
            this.$util.log(url);
            this.$util.goUrl({
                url,
                openType
            });
        },
        async toAtv() {
            if (!this.mineInfo.is_atv) {
                this.$util.showToast({
                    title: `暂无活动`
                });
                return;
            }
            let options = this.commonOptions;
            options.coupon_atv_id = 0;
            await this.updateCommonOptions(options);
            this.$util.goUrl({
                url: `/user/pages/coupon/share`
            });
        },
        // 申请宠托师/分销商/渠道商
        async toApply(type) {
            let { coach_status = -1, fx_status = -1, channel_status = -1 } = this.mineInfo;
            let status = type == 1 ? coach_status : type == 2 ? fx_status : channel_status;
            let page = {
                1: `/technician/pages/apply`,
                2: `/user/pages/distribution/apply`,
                3: `/user/pages/channel/apply`
            };
            // -1未申请,1审核中,2审核通过,3取消授权,4审核失败
            let url = status == -1 ? page[type] : `/user/pages/apply-result?type=${type}`;
            this.$util.log(url);
            this.$util.goUrl({
                url
            });
        },
        // 切换用户/宠托师端
        async toChange() {
            let { userPageType = 1 } = this;
            if (userPageType == 2) {
                await this.getCoachInfo();
            }
            this.updateUserItem({
                key: 'userPageType',
                val: userPageType == 2 ? 1 : 2
            });
        },
        onChange(e) {
            let { x, y } = e.detail;
            this.$nextTick(() => {
                this.offsetL = x;
                this.offsetT = y;
            });
        },
        // 求助
        async toHelp() {
            await this.$api.technician.police();
            this.$util.showToast({
                title: `求救成功`
            });
        }
    }
};
</script>

<style lang="scss">
.pages-mine-content {
    padding: 30rpx;
    box-sizing: border-box;
    background-color: #fff;
    border-radius: 30rpx 30rpx 0 0;
    margin-top: -30rpx;
    .pages-mine-balance {
        padding: 30rpx;
        box-sizing: border-box;
        margin-top: -60rpx;
        border-radius: 30rpx 30rpx 0 0;
        color: #fff;
        background: linear-gradient(to right, rgb(61, 166, 255) 20%, rgb(111, 189, 255));
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 0 5rpx  #fff;
        .pages-mine-balance-number {
            font-size: 40rpx;
            font-weight: bold;
        }
        .pages-mine-balance-right {
            border-radius: 35rpx;
            line-height: 70rpx;
            padding: 0 30rpx;
            color: rgb(61, 166, 255);
            background-color: #fff;
        }
    }
    .pages-mine-panel {
        margin: 30rpx 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 30rpx;
        .pages-mine-panel-item {
            flex: 1 0 auto;
            border-radius: 10rpx;
            background-color: pink;
            height: 160rpx;
            padding: 20rpx;
            box-sizing: border-box;
            &:first-of-type {
                background-color: rgb(254, 247, 237);
            }
            &:last-of-type {
                background-color: rgb(238, 251, 244);
            }
        }
        .pages-mine-panel-item-text {
            font-size: 32rpx;
            font-weight: bold;
        }
        .pages-mine-panel-item-tips {
            font-size: 26rpx;
            color: #888;
            margin-top: 10rpx;
        }
    }
    .mine-menus {
        margin: 30rpx 0;
        padding: 20rpx;
        border-radius: 20rpx;
        background-color: #fff;
        box-shadow: 0 0 6rpx #e2e2e2;
        .mine-menus-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .mine-menus-title {
            font-size: 32rpx;
            font-weight: bold;
        }
        .mine-menus-more {
            font-size: 28rpx;
            color: #888;
        }
        .mine-menus-content {
            display: flex;
            flex-wrap: wrap;
        }
        .mine-menus-item {
            width: 25%;
            flex-shrink: 0;
            margin-top: 20rpx;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }
        .mine-menus-item-icon {
            font-size: 50rpx;
        }
        .mine-menus-item-text {
            color: #555;
            font-size: 28rpx;
            margin-top: 10rpx;
        }
    }
}

uni-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

.images {
    width: 100rpx;
    height: 100rpx;
}

.text {
    font-size: 14px;
    margin-top: 5px;
}

.grid-item-box-row {
    flex: 1;
    // position: relative;
    /* #ifndef APP-NVUE */
    display: flex;
    /* #endif */
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 15px 0;
}

.aaaaa {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
}

.grid-dynamic-box {
    margin-bottom: 15px;
}

.grid-item-box {
    flex: 1;
    // position: relative;
    /* #ifndef APP-NVUE */
    display: flex;
    /* #endif */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    // padding: 15px 0;
}

.f_r_sb_c {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pages-mine {
    .mine-bg {
        width: 100%;
        height: 368rpx;
        z-index: 0;
    }

    .mine-master-bg {
        width: 100%;
        height: 514rpx;
        z-index: -1;
    }

    .avatar_view {
        width: 120rpx;
        height: 120rpx;
        position: relative;

        .avatar {
            width: 120rpx;
            height: 120rpx;
            overflow: hidden;

            open-data {
                width: 120rpx;
                height: 120rpx;
            }
        }

        .text {
            width: 110rpx;
            position: absolute;
            bottom: -5rpx;
            left: 5rpx;
            height: 36rpx;
            line-height: 36rpx;
            background: #ffffff;
            border-radius: 18rpx;
            color: #a40035;
            font-size: 24rpx;
            text-align: center;
        }
    }

    .member-tag {
        min-width: 168rpx;
        height: 42rpx;
        color: #333;
        background: linear-gradient(to right, rgba(206, 163, 112, 1), rgba(219, 182, 136, 1));

        .iconfont {
            font-size: 28rpx;
        }
    }

    .icon-shuaxin,
    .icon-xitong {
        font-size: 40rpx;
    }

    .share-img {
        width: 86rpx;
        height: 86rpx;
    }

    .mine-count-list {
        .cancel-auth {
            width: 110rpx;
            height: 100rpx;
            font-size: 100rpx;
            top: 100rpx;
            left: 150rpx;

            .text-bold {
                height: 26rpx;
                transform: rotate(-32deg);
            }
        }

        .cash-btn {
            width: 138rpx;
            height: 52rpx;
            transform: rotateZ(360deg);
        }

        .icon-right {
            font-size: 28rpx;
        }
    }

    .share-list {
        .coupon-img {
            width: 97rpx;
            height: 87rpx;
        }

        .item-icon {
            width: 70rpx;
            height: 70rpx;

            .iconfont {
                font-size: 38rpx;
            }

            .item-icon {
                top: 0;
                left: 0;
                opacity: 0.1;
            }
        }
    }

    .mine-menu-list {
        // margin: 20rpx 30rpx 0 30rpx;
        margin: 30rpx 0;

        .menu-title {
            height: 90rpx;

            .iconfont {
                font-size: 24rpx;
            }
        }

        .item-child {
            width: 20%;
            margin: 10rpx 0;

            .iconfont {
                font-size: 52rpx;
            }

            .item-img {
                width: 88rpx;
                height: 88rpx;

                .iconfont {
                    font-size: 44rpx;
                }

                .item-img {
                    top: 0;
                    left: 0;
                    opacity: 0.1;
                }
            }
        }
    }

    .mine-tool-list {
        margin: 20rpx 30rpx 0 30rpx;
        box-shadow: 0px 3px 6px 0px rgba(227, 227, 227, 0.47);

        .list-item {
            .iconfont {
                font-size: 42rpx;
            }

            .icon-right {
                font-size: 28rpx;
            }

            .icon-switch {
                font-size: 70rpx;
                line-height: 48rpx;
            }
        }

        .list-item.b-1px-t:before {
            left: 60rpx;
        }
    }

    .help-img-info {
        width: 130rpx;
        height: 130rpx;
        right: 30rpx;

        .bg-img {
            width: 130rpx;
            height: 130rpx;
            opacity: 0.4;
            top: 0;
            left: 0;
        }

        .help-info {
            width: 130rpx;
            height: 130rpx;
            opacity: 1;
            top: 0;
            left: 0;

            .help-img {
                width: 118rpx;
                height: 118rpx;

                .iconfont {
                    font-size: 44rpx;
                    margin-bottom: 4rpx;
                }
            }
        }
    }
}
</style>
 

 

 

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

qq_35738963

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值