<template>
  <view v-if="!isFirstload" class="container" :style="appThemeStyle">
    <!-- 页面头部 -->
    <view class="main-header">
      <img class="bg-image" src="@/static/background/user-header2.png" alt="" />
      <!-- 用户信息 -->
      <view v-if="false" class="user-info">
        <view class="user-avatar" @click="handlePersonal()">
          <avatar-image :url="userInfo.avatar_url" :width="100" />
        </view>
        <view class="user-content">
          <!-- 会员昵称 -->
          <view class="nick-name oneline-hide" @click="handlePersonal()">{{ userInfo.nick_name }}</view>
          <!-- 会员等级 -->
          <view v-if="$checkModule('user-grade') && userInfo.grade_id > 0 && userInfo.grade" class="user-grade">
            <view class="user-grade_icon">
              <image
                class="image"
                src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAA0lBMVEUAAAD/tjL/tzH/uDP/uC7/tjH/tzH/tzL/tTH+tTL+tjP/tDD/tTD+tzD/tjL/szD/uDH/tjL/tjL+tjD/tjT/szb/tzL/tTL+uTH+tjL/tjL/tjL/tTT/tjL/tjL+tjH/uTL/vDD/tjL/tjH/tzL9uS//tTL/nBr/sS7/tjH/ujL/szD/uTv+rzf/tzL+tzH+vDP+uzL+tjP+ry7+tDL9ki/7szf/sEX/tTL/tjL+tjL/tTH/tTT/tzH/tzL/tjP/sTX/uTP/wzX+rTn/vDX9vC8m8ckhAAAAOXRSTlMAlnAMB/vjxKWGMh0S6drMiVxPRkEY9PLy0ru0sKagmo5+dGtgVCMgBP716eXWyMGxqJGRe2o5KSmFNjaYAAABP0lEQVQ4y8XS13KDMBAF0AWDDe4t7r3ETu9lVxJgJ/n/X8rKAzHG5TE+Twz3zki7I/g/KXdghIbGJewrU4yzn08Ebgl6TuZzzuOC6W5es3HX6qsSz3NFShRU0MpucytDmOSpu3yULx3CA9RD1HjVedc0jSjqm6ZzhUjDsFDQhSp/OKj5GQvg0+ZCOixsbtDLAeTTOm/yGi8GyIphIVsgH737FEDV44LJa88IRKK/SetrwT9G/GUIr6vXjoy4GXn7+RboVXnghuSjaoGecwQxL2su3CwAKlO+QFoqxI4FMctHQhQd2OhxTu184jWUlI+rMTBTn1/IQcJHQ6GQdZ7pWiDaNdhTt330efISeiqYwQEzQpTlsURJLhzkEmpCPsERfeIUVyXr6MNuIyp5uziW6xURtt7hhGwzmMNJExfO4Bd9X0ZPqAxdNwAAAABJRU5ErkJggg=="
              >
              </image>
            </view>
            <view class="user-grade_name">
              <text>{{ userInfo.grade.name }}</text>
            </view>
          </view>
          <!-- 会员无等级时显示手机号 -->
          <view v-else class="mobile">{{ userInfo.mobile }}</view>
        </view>
      </view>
      <!-- 未登录 -->
      <view v-else class="user-info">
        <view class="user-avatar user-logos">
          <img style="width: 100%; height: 100%" src="@/static/background/bg2111.jpg" alt="" />
        </view>
        <view class="user-content">
          <view class="nick-name r_flex">
            {{ userInfoData.customername ? userInfoData.customername : '当前是微信登录' }}
            <view v-if="userInfoData.customerzjhm" class="smTitle r_flex_center">
              <i-fingerprint-three style="margin-right: 4rpx" theme="outline" size="16" fill="#8dc63f" :strokeWidth="2" strokeLinejoin="bevel" strokeLinecap="square" />
              已实名
            </view>
          </view>
          <view class="login-tips">{{ userInfoData.customerqym ? `您的企业码：${userInfoData.customerqym}` : '您还没有企业码' }}</view>
          <view class="login-tips">{{ wx_userid ? `客户ID：${wx_userid}` : '您还没有客户ID' }}</view>
          <!-- <view class="login-tips">点击登录账号-</view> -->
        </view>
      </view>
    </view>

    <!-- 绑定手机号 -->
    <!-- <view class="my-mobile" v-if="!userInfoData.customertel" @click="handleBindMobile()">
      <view class="info">点击绑定手机号，为了您的数据安全</view>
      <view class="btn-bind">去绑定</view>
    </view> -->

    <!-- 我的钱包 -->
    <view v-if="false" class="my-asset">
      <view class="asset-left flex-box dis-flex flex-x-around">
        <view v-if="$checkModule('market-recharge')" class="asset-left-item" style="max-width: 200rpx" @click="onTargetWallet">
          <view class="item-value dis-flex flex-x-center">
            <text class="oneline-hide">{{ isLogin ? assets.balance : '--' }}</text>
          </view>
          <view class="item-name dis-flex flex-x-center">
            <text>账户余额</text>
          </view>
        </view>
        <view v-if="$checkModule('market-points')" class="asset-left-item" @click="onTargetPoints">
          <view class="item-value dis-flex flex-x-center">
            <text class="oneline-hide">{{ isLogin ? assets.points : '--' }}</text>
          </view>
          <view class="item-name dis-flex flex-x-center">
            <text>{{ setting[SettingKeyEnum.POINTS.value].points_name }}</text>
          </view>
        </view>
        <view v-if="$checkModule('market-coupon')" class="asset-left-item" @click="onTargetMyCoupon">
          <view class="item-value dis-flex flex-x-center">
            <text class="oneline-hide">{{ isLogin ? assets.coupon : '--' }}</text>
          </view>
          <view class="item-name dis-flex flex-x-center">
            <text>优惠券</text>
          </view>
        </view>
      </view>
      <view v-if="$checkModule('market-recharge')" class="asset-right">
        <view class="asset-right-item" @click="onTargetWallet">
          <view class="item-icon dis-flex flex-x-center">
            <text class="iconfont icon-qianbao"></text>
          </view>
          <view class="item-name dis-flex flex-x-center">
            <text>我的钱包</text>
          </view>
        </view>
      </view>
    </view>

    <!-- 点击实名认证 (第2种样式) -->
    <!-- <view class="my-mobile2" v-if="!userInfoData.customerzjhm" @click="handleService('pages/user/realname/index')">
      <view class="info">还没有实名</view>
      <view class="btn-bind">点击实名认证</view>
    </view> -->

    <!-- 订单操作 -->
    <view class="order-navbar">
      <view class="order-navbar-item r_flex" v-for="(item, index) in orderNavbar" :key="index" @click="onTargetOrder(item)">
        <view class="item-icon">
          <text class="iconfont" :class="[`icon-${item.icon}`]"></text>
        </view>
        <view class="item-name">{{ item.name }}</view>
        <i-more class="filter-one" theme="outline" size="30" fill="#fff" :strokeWidth="2" strokeLinejoin="bevel" strokeLinecap="square" />

        <!-- 数量标题 -->
        <!-- <view class="item-badge" v-if="item.count && item.count > 0">
          <text v-if="item.count <= 99" class="text">{{ item.count }}</text>
          <text v-else class="text">99+</text>
        </view> -->
      </view>
    </view>

    <!-- 订购用户操作 -->
    <view class="">
      <view class="oub_list order-user-buy" v-for="(item, index) in uderBuyOder" :key="index">
        <view class="oub_text oub_text01 r_flex_space">{{ item.yhinfozh }} <u-tag :text="item.yhinfozt" size="mini" type="success" mode="light" /></view>

        <view class="oub_text">客户手机：{{ item.yhinfotel }}</view>
        <view class="oub_text">产品名称：{{ item.payorderproductname }}（{{ item.payorderproductlimit }}{{ item.payorderproductlimittype }}）</view>
        <!-- <view class="oub_text">产品时长：{{ item.payorderproductlimit }}{{ item.payorderproductlimittype }}</view> -->

        <view class="oub_text">实付金额：{{ item.payorderproductprice1 }}</view>
        <view class="oub_text">开始时间：{{ item.yhinfostardate }}</view>
        <!-- <view class="oub_text">客户账号：{{ item.yhinfozh }}</view>
        <view class="oub_text">客户密码：{{ item.yhinfomm }}</view> -->

        <view class="r_flex_space" style="margin: 5px 0px;" >
          <view class="oub_text">到期时间：{{ item.yhinfoenddate }}</view>
          <view class="buttom_view" @click="onXufei(item)">续费</view>
        </view>

        <view class="r_flex_space" style="margin: 5px 0px;" >
          <view class="oub_text">客户账号：{{ item.yhinfozh }}</view>
          <view class="buttom_view" @click="onFuzhi(item.yhinfozh)">复制账号</view>
        </view>

        <view class="r_flex_space" style="margin: 5px 0px;" >
          <view class="oub_text">客户密码：{{ item.yhinfomm }}</view>
          <view class="buttom_view" @click="onFuzhi(item.yhinfomm)">复制密码</view>
        </view>

        <view class="r_flex_space" style="margin: 5px 0px;" >
          <view class="oub_text">服务器地址：szpop1.hninpop.com:8443</view>
          <view class="buttom_view" @click="onFuzhi('szpop1.hninpop.com:8443')">复制地址</view>
        </view>

        <view class="oub_text buttom_view" @click="onUrl(item)" >使用说明</view>


        <!-- <view class="oub_text">下行平均速度：{{ item.payorderradiusxxpj }}</view>
        <view class="oub_text">下行最大速度：{{ item.payorderradiusxxmax }}</view>
        <view class="oub_text">上行平均速度：{{ item.payorderradiussxpj }}</view>
        <view class="oub_text">上行最大速度：{{ item.payorderradiussxmax }}</view> -->

        <!-- <view class="oub_text">订单资费：{{ item.payorderzfsfsx }}</view> -->
      </view>
    </view>

    <!-- 我的服务 -->
    <view class="my-service" v-if="false">
      <view class="service-title">我的服务</view>
      <view class="service-content clearfix">
        <block v-for="(item, index) in service" :key="index">
          <view class="service-item" @click="handleService(item)">
            <view class="item-icon">
              <text class="iconfont" :class="[`icon-${item.icon}`]"></text>
            </view>
            <view class="item-name">{{ item.name }}</view>
            <view class="item-badge" v-if="item.count && item.count > 0">
              <text v-if="item.count <= 99" class="text">{{ item.count }}</text>
              <text v-else class="text">99+</text>
            </view>
          </view>
          <!-- 在线客服 -->
          <!-- <view class="service-item">
            <customer-btn>
              <view class="item-icon">
                <text class="iconfont" :class="[`icon-${item.icon}`]"></text>
              </view>
              <view class="item-name">{{ item.name }}</view>
            </customer-btn>
          </view> -->
        </block>
      </view>
    </view>

    <!-- 退出登录 -->
    <view v-if="isLogin" class="my-logout">
      <view class="logout-btn" @click="handleLogout()">
        <text>退出登录</text>
      </view>
    </view>

    <!-- 提示框 -->
    <u-modal v-model="modalShow" :confirm-text="'前往认证'" @confirm="onTargetOrder({id: 'comment'})">
      <view class="modalCenter">
        尊敬的客户，您有
        <text class="icon-red">{{ modalNum }}</text> 笔订单待激活，根据国家工信部实名制要求，请根据提示完成实名认证后激活此产品服务。
      </view>
    </u-modal>
  </view>
</template>

<script>
import store from '@/store'
import {inArray} from '@/utils/util'
import AvatarImage from '@/components/avatar-image'
import CustomerBtn from '@/components/customer-btn'
import {setCartTabBadge} from '@/core/app'
import SettingKeyEnum from '@/common/enum/setting/Key'
import SettingModel from '@/common/model/Setting' // 网址设置接口
import * as UserApi from '@/api/user'
import * as OrderApi from '@/api/order'
import {checkLogin, filterModules} from '@/core/app'
import storage from '@/utils/storage'
import StoreModel from '@/common/model/Store'
import * as AppApi from '@/api/app'

// 订单操作
const orderNavbar = [
  {
    id: 'all',
    name: '全部订单',
    icon: 'qpdingdan'
  },
  // {
  //   id: 'payment',
  //   name: '待支付订单',
  //   icon: 'daifukuan',
  //   count: 0
  // },
  // {
  //   id: 'delivery',
  //   name: '待发货',
  //   icon: 'daifahuo',
  //   count: 0
  // },
  {
    id: 'comment',
    name: '已支付订单',
    icon: 'daishouhuo',
    count: 0
  }
]

/**
 * 我的服务
 * id: 标识; name: 标题名称; icon: 图标; type 类型(link和button); url: 跳转的链接
 */
const service = [
  {
    id: 'address',
    name: '人脸核实',
    icon: 'shouhuodizhi',
    type: 'link',
    url: 'pages/address/index'
  },
  {
    id: 'coupon',
    name: '销户',
    icon: 'lingquan',
    type: 'link',
    url: 'pages/coupon/index',
    moduleKey: 'market-coupon'
  },
  {
    id: 'myCoupon',
    name: '变更套餐',
    icon: 'youhuiquan',
    type: 'link',
    url: 'pages/my-coupon/index',
    moduleKey: 'market-coupon'
  },
  {
    id: 'refund',
    name: '退换/售后',
    icon: 'shouhou',
    type: 'link',
    url: 'pages/refund/index',
    count: 0
  },
  {
    id: 'contact',
    name: '在线客服',
    icon: 'kefu',
    type: 'contact'
  },
  {
    id: 'points',
    name: '成为代理商',
    icon: 'jifen',
    type: 'link',
    url: 'pages/login/index',
    moduleKey: 'market-points'
  },
  {
    id: 'orderCenter',
    name: '订单中心',
    icon: 'order-c',
    type: 'link',
    url: 'pages/order/center'
  },
  {
    id: 'help',
    name: '我的帮助',
    icon: 'bangzhu',
    type: 'link',
    url: 'pages/help/index',
    moduleKey: 'content-help'
  }
]

export default {
  components: {
    AvatarImage,
    CustomerBtn
  },
  // 计算属性
  computed: {
    // 计算属性的
    userInfoComputd: () => {
      return storage.get('wx_userinfo')
    }
  },
  data() {
    return {
      modalShow: false,
      modalNum: 0,
      inArray,
      // 枚举类
      SettingKeyEnum,
      // 正在加载
      isLoading: true,
      // 首次加载
      isFirstload: true,
      // 是否已登录
      isLogin: false,
      // 系统设置
      setting: {},
      // 当前用户信息
      userInfo: {},
      // 账户资产
      assets: {
        balance: '--',
        points: '--',
        coupon: '--'
      },
      // 我的服务
      service,
      // 订单操作
      orderNavbar,
      // 当前用户待处理的订单数量
      todoCounts: {
        payment: 0,
        deliver: 0,
        received: 0
      },
      wx_userid: storage.get('wx_userid'),
      userInfoData: {},
      // 用户与订单数据
      uderBuyOder: []
    }
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onLoad(options) {},

  /**
   * 生命周期函数--监听页面显示
   */
  onShow(options) {
    this.onRefreshPage()
    this.userInfoData = storage.get('wx_userinfo')
    // 实名认证弹窗
    this.netmodalShow()
  },

  methods: {
    async netmodalShow() {
      // 获取支付数据
      const params = {
        pageindex: 1,
        rows: 999,
        'payorderopenid.value': storage.get('wx_openid'),
        'payordercustomerid.value': storage.get('wx_userid'),
        'payorderlx.value': '新购',
        pagevalue: 311
      }
      const {Data: res} = await AppApi._get_list(params)
      this.modalNum = res.Total
      if (res.Total > 0) {
        this.modalShow = true
      }
    },

    async onUrl() {
      // 获取支付数据
      // 打开一个新窗口，并导航到指定的URL
      window.open('https://support.hninpop.com', '_blank');
    },

    // 提交支付订单
    async onXufei(data) {
      // 跳转至商品列表页
      this.$navTo('pages/goods/list', {type: 'productxfky'})
      return

      const app = this
      const pram = {
        // 客户id
        customerid: storage.get('wx_userid'),
        // 用户id
        yhinfoid: data.yhinfoid,

        openid: storage.get('wx_openid'),
        // 支付方式
        paysortid: data.paysortid,
        // 产品类型
        productid: data.productid
      }
      const res = await AppApi.plXufei(pram).finally(() => {})
      if (app.curPaymentItem.paysortname == '支付宝') {
        // 发起支付宝支付
        this.formDom = res.Data
        app.$toast('提交支付宝中...')
        if (this.formDom) {
          setTimeout(() => {
            document.forms['alipaysubmit'].submit()
            app.disabled = false
          }, 500)

          setTimeout(() => {
            app.$navTo('pages/user/index')
          }, 1000)
        }
      } else if (app.curPaymentItem.paysortname == '微信') {
        // 发起微信支付
        this.formDom = res.Data
        const wechat = res

        app.$toast('提交微信中...')

        WeixinJSBridge.invoke(
          'getBrandWCPayRequest',
          {
            appId: wechat.Data.appId, //公众号ID，由商户传入
            timeStamp: wechat.Data.timeStamp, //时间戳，自1970年以来的秒数
            nonceStr: wechat.Data.nonceStr, //随机串
            package: wechat.Data.package,
            signType: wechat.Data.signType, //微信签名方式：
            paySign: wechat.Data.paySign
          },
          function (res) {
            // 支付成功
            if (res.err_msg == 'get_brand_wcpay_request:ok') {
              // 使用以上方式判断前端返回,微信团队郑重提示：
              app.$toast('支付成功')
            }
            // 支付过程中用户取消
            if (res.err_msg == 'get_brand_wcpay_request:cancel') {
              app.$toast('支付取消')
            }
            // 支付失败
            if (res.err_msg == 'get_brand_wcpay_request:fail') {
              app.$toast('支付失败')
            }
          }
        )
      }
    },

    // 刷新页面
    onRefreshPage() {
      // 更新购物车角标
      setCartTabBadge()
      // 判断是否已登录
      this.isLogin = checkLogin()
      // 获取页面数据
      this.getPageData()
    },

    // 获取页面数据
    async getPageData(callback) {
      console.log('下拉刷新user')
      const app = this

      try {
        // 初始化订单操作数据
        // app.initOrderTabbar()
        // 更新user信息
        await StoreModel.getCustomerData()
        await app.netmodalShow()
        app.uderBuyOder = storage.get('wx_yhinfo')
        // app.uderBuyOder = [{name: '111'}]
        console.log(app.uderBuyOder, 'uderBuyOder')
      } finally {
        app.isFirstload = false
        // 下拉关闭
        uni.stopPullDownRefresh()
      }
    },

    async onFuzhi(data) {
      const app = this
      uni.setClipboardData({
        data: data,
        success: () => app.$toast('复制成功'),
        fail: ({ errMsg }) => app.$toast('复制失败 ' + errMsg)
      })
    },

    // 初始化我的服务数据
    async initService() {
      const app = this
      // const isShowCustomerBtn = await SettingModel.isShowCustomerBtn()
      const newService = []
      service.forEach((item) => {
        // 默认开启
        item.enabled = true
        // // 我的积分
        // if (item.id === 'points') {
        //   item.name = '我的' + app.setting[SettingKeyEnum.POINTS.value].points_name
        // }
        // // 企业微信客服
        // if (item.id === 'contact' && !isShowCustomerBtn) {
        //   item.enabled = false
        // }
        // 数据角标
        if (item.count != undefined) {
          item.count = app.todoCounts[item.id]
        }
        newService.push(item)
      })
      app.service = filterModules(newService)
    },

    // 初始化订单操作数据
    initOrderTabbar() {
      const app = this
      const newOrderNavbar = []
      orderNavbar.forEach((item) => {
        if (item.count != undefined) {
          item.count = app.todoCounts[item.id]
        }
        newOrderNavbar.push(item)
      })
      app.orderNavbar = newOrderNavbar
    },

    // 获取商城设置
    getSetting() {
      const app = this
      return new Promise((resolve, reject) => {
        resolve(true)
        // SettingModel.data()
        //   .then((setting) => {
        //     app.setting = setting
        //     resolve(setting)
        //   })
        //   .catch(reject)
      })
    },

    // 获取当前用户信息
    getUserInfo() {
      const app = this
      return new Promise((resolve, reject) => {
        !app.isLogin
          ? resolve(null)
          : UserApi.info(
              {},
              {
                load: app.isFirstload
              }
            )
              .then((result) => {
                app.userInfo = result.data.userInfo
                resolve(app.userInfo)
              })
              .catch((err) => {
                if (err.result && err.result.status == 401) {
                  app.isLogin = false
                  resolve(null)
                } else {
                  reject(err)
                }
              })
      })
    },

    // 获取账户资产
    getUserAssets() {
      const app = this
      return new Promise((resolve, reject) => {
        !app.isLogin
          ? resolve(null)
          : UserApi.assets(
              {},
              {
                load: app.isFirstload
              }
            )
              .then((result) => {
                app.assets = result.data.assets
                resolve(app.assets)
              })
              .catch((err) => {
                if (err.result && err.result.status == 401) {
                  app.isLogin = false
                  resolve(null)
                } else {
                  reject(err)
                }
              })
      })
    },

    // 获取当前用户待处理的订单数量
    getTodoCounts() {
      const app = this
      return new Promise((resolve, reject) => {
        !app.isLogin
          ? resolve(null)
          : OrderApi.todoCounts(
              {},
              {
                load: app.isFirstload
              }
            )
              .then((result) => {
                app.todoCounts = result.data.counts
                resolve(app.todoCounts)
              })
              .catch((err) => {
                if (err.result && err.result.status == 401) {
                  app.isLogin = false
                  resolve(null)
                } else {
                  reject(err)
                }
              })
      })
    },

    // 跳转到登录页
    handleLogin() {
      !this.isLogin && this.$navTo('pages/login/index')
    },

    // 跳转到绑定手机号页面
    handleBindMobile() {
      // this.$navTo('pages/user/bind/index')
      this.$navTo('pages/user/certificate/index')
    },

    // 跳转到修改个人信息页
    handlePersonal() {
      this.$navTo('pages/user/personal/index')
    },

    // 退出登录
    handleLogout() {
      const app = this
      uni.showModal({
        title: '友情提示',
        content: '您确定要退出登录吗?',
        success(res) {
          if (res.confirm) {
            store.dispatch('Logout', {}).then((result) => app.onRefreshPage())
          }
        }
      })
    },

    // 跳转到钱包页面
    onTargetWallet() {
      this.$toast('开发中,敬请期待')
      return
      this.$navTo('pages/wallet/index')
    },

    // 跳转到订单页
    onTargetOrder(item) {
      this.$navTo('pages/order/index', {
        dataType: item.id
      })
    },

    // 跳转到我的积分页面
    onTargetPoints() {
      this.$toast('开发中,敬请期待')
      return
      this.$navTo('pages/points/log')
    },

    // 跳转到我的优惠券页
    onTargetMyCoupon() {
      this.$toast('开发中,敬请期待')
      return
      this.$navTo('pages/my-coupon/index')
    },

    // 跳转到服务页面
    handleService(url) {
      console.log('跳转路由：', url)
      this.$navTo(url)
    }
  },

  /**
   * 下拉刷新
   */
  onPullDownRefresh() {
    // 获取首页数据
    this.getPageData(() => {
      uni.stopPullDownRefresh()
    })
  }
}
</script>

<style lang="scss" scoped>
.user-logos {
  display: block;
  width: 100rpx;
  height: 100rpx;
  border-radius: 100%;
  border: 2px solid #c59a46;
  overflow: hidden;
}
.user-img {
  border: 2px solid #c59a46;
  border-radius: 100%;
}
.container {
  padding-bottom: 60rpx;
}

.modalCenter {
  padding: 30rpx 40rpx;
}

// 页面头部
.main-header {
  // background-color: #FBF7EF;
  position: relative;
  width: 100%;
  height: 280rpx;
  background-size: 100% 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding-left: 30rpx;
  border-bottom: 2px solid #c59a46;

  .bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
  }

  .user-info {
    display: flex;
    z-index: 1;
    width: 100%;

    .user-content {
      display: flex;
      flex-direction: column;
      justify-content: center;
      margin-left: 30rpx;
      color: #c59a46;
      width: 70%;

      .nick-name {
        font-size: 34rpx;
        font-weight: bold;
        width: 100%;
        width: 600rpx;
        overflow: hidden; //超出的文本隐藏
        text-overflow: ellipsis; //溢出用省略号显示
        white-space: nowrap; //溢出不换行
        margin-right: 20rpx;
      }

      .mobile {
        margin-top: 15rpx;
        font-size: 28rpx;
      }

      .user-grade {
        align-self: baseline;
        display: flex;
        align-items: center;
        background: #3c3c3c;
        margin-top: 12rpx;
        border-radius: 10rpx;
        padding: 4rpx 12rpx;

        .user-grade_icon .image {
          display: block;
          width: 32rpx;
          height: 32rpx;
        }

        .user-grade_name {
          margin-left: 5rpx;
          font-size: 26rpx;
          color: #eee0c3;
        }
      }

      .login-tips {
        margin-top: 12rpx;
        font-size: 30rpx;
      }
    }
  }
}

// 角标组件
.item-badge {
  position: absolute;
  top: 0;
  right: 55rpx;
  // background: $main-bg;
  background: #fa2209;
  color: #fff;
  border-radius: 100%;
  min-width: 38rpx;
  height: 38rpx;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rpx;
  font-size: 24rpx;
}

// 我的钱包
.my-asset {
  display: flex;
  background: #fff;
  padding: 40rpx 0;

  .asset-right {
    width: 200rpx;
    border-left: 1rpx solid #eee;
  }

  .asset-right-item {
    text-align: center;
    color: #545454;

    .item-icon {
      font-size: 44rpx;
    }

    .item-name {
      margin-top: 14rpx;
      font-size: 28rpx;
    }
  }

  .asset-left-item {
    max-width: 183rpx;
    text-align: center;
    color: #666;
    padding: 0 16rpx;

    .item-value {
      font-size: 34rpx;
      color: $main-bg;
    }

    .item-name {
      margin-top: 14rpx;
      font-size: 28rpx;
    }
  }
}

// 订单操作
.order-navbar {
  margin: 20rpx auto 0rpx auto;
  width: 94%;
  font-size: 30rpx;
  border-radius: 5rpx;

  &-item {
    align-items: center;
    position: relative;
    box-shadow: 0 1rpx 5rpx 0px rgba(0, 0, 0, 0.05);
    background: #fff;
    margin: 20rpx 0rpx;
    width: 100%;
    padding: 20rpx 40rpx;
    line-height: 40rpx;
    width: 100%;
    background: url('/static/background/NyU04x.png'), no-repeat, #f5bb27;
    background-size: 100%;
    background-position: left;
    position: relative;
    border-radius: 20rpx;
    z-index: 2;

    .item-icon {
      padding: 10rpx 0;
      color: #fff;
      font-size: 54rpx;
      margin-right: 20rpx;
    }

    .item-name {
      font-size: 32rpx;
      color: #fff;
      text-align: center;
      margin-right: 10rpx;
    }

    .filter-one {
      position: absolute;
      right: 20rpx;
      top: 20rpx;
    }
  }
}

// 订购用户列表
.order-user-buy {
  margin: 20rpx auto 0rpx auto;
  padding: 20rpx 16rpx;
  width: 94%;
  font-size: 30rpx;
  border-radius: 20rpx;
  border: 4rpx solid #f5bb27;
  background: #f1b92b17;
  color: #e2a225;
  .oub_text01 {
    font-size: 40rpx;
    margin-bottom: 10rpx;
  }
  .buttom_view {
    text-decoration: underline;
    display: flex;
    flex-direction: row-reverse;
  }
}

.smTitle {
  font-weight: 400;
  font-size: 26rpx;
  border-radius: 40rpx;
  line-height: 40rpx;
  height: 40rpx;
  padding: 6rpx 12rpx;
  background: #efe7d7;
  margin-left: 20rpx;
  margin-top: 6rpx;
  color: #8dc63f;
}
.nick-name {
  align-items: center;
}

// 我的服务
.my-service {
  margin: 22rpx auto 22rpx auto;
  padding: 22rpx 0;
  width: 94%;
  box-shadow: 0 1rpx 5rpx 0px rgba(0, 0, 0, 0.05);
  border-radius: 5rpx;
  background: #fff;

  .service-title {
    padding-left: 24rpx;
    margin-bottom: 20rpx;
    font-size: 30rpx;
  }

  .service-content {
    margin-bottom: -20rpx;

    .service-item {
      position: relative;
      width: 25%;
      float: left;
      margin-bottom: 30rpx;

      .item-icon {
        text-align: center;
        margin: 0 auto;
        padding: 14rpx 0;
        color: $main-bg;
        font-size: 44rpx;
      }

      .item-name {
        font-size: 28rpx;
        color: #545454;
        text-align: center;
      }
    }
  }
}

// 退出登录
.my-logout {
  display: flex;
  justify-content: center;
  margin-top: 50rpx;

  .logout-btn {
    width: 60%;
    margin: 0 auto;
    font-size: 28rpx;
    color: #616161;
    border-radius: 20rpx;
    border: 1px solid #dcdcdc;
    padding: 16rpx 0;
    text-align: center;
  }
}

// 绑定手机号 样式1
.my-mobile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16rpx 40rpx;
  background: #fcebd1;

  .info {
    color: #cd8c0c;
    font-size: 28rpx;
  }

  .btn-bind {
    padding: 8rpx 24rpx;
    background-color: #eab766;
    color: #fff;
    border-radius: 30rpx;
    font-size: 26rpx;
    text-align: center;
  }
}

// 绑定手机号 样式2
.my-mobile2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20rpx auto 20rpx auto;
  padding: 12rpx 40rpx;
  width: 94%;
  box-shadow: 0 1rpx 5rpx 0px rgba(0, 0, 0, 0.05);
  font-size: 30rpx;
  border-radius: 5rpx;
  color: red;
  background: #ffe7e7;
  border: 1px solid red;

  .info {
    // color: #cd8c0c;
    font-size: 26rpx;
  }

  .btn-bind {
    padding: 8rpx 24rpx;
    background-color: #fa3534;
    color: #fff;
    border-radius: 30rpx;
    font-size: 26rpx;
    text-align: center;
  }
}
</style>
