import "./FakeHome.scss";
import Taro from "@tarojs/taro";
import { View, Image, Text } from "@tarojs/components";

import SettingIcon from "../../images/home/icon_shezhi@2x.png";
import UserBoxBg from "../../images/home/img_bg@2x.png";
import UserHeaderF from "../../images/home/img_girl_touxiang@2x.png";
import MenuIconNormal from "@/components/MenuIcon/normal/MenuIconNormal";
import WaterIconNormal from "../../images/menu/ic_zizhu@2x.png";
import DryerIconNormal from "../../images/menu/ic_chuifeng@2x.png";
import DispenserIconNormal from "../../images/menu/ic_bigua@2x.png";
import WasherIconNormal from "../../images/menu/ic_xiyi@2x.png";

function FakeHome() {
  const goLoginPage = () => {
    Taro.showModal({
      title: "提示",
      content: "请登录后使用"
    })
      .then(res => {
        if (res.confirm) {
          Taro.navigateTo({
            url: "/pages/Login/Login"
          });
        }
      })
      .catch(err => {
        console.log(err);
      });
  };

  return (
    <View className="FakeHome">
      <View className="Home-UserBox">
        <View className="Home-UserBox-content">
          <Image
            className="Home-UserBox-Setting"
            src={SettingIcon}
            onClick={goLoginPage}
          />
          <Image className="bg" src={UserBoxBg} />
          <View className="Home-UserBox-info">
            <View className="Home-UserBox-other">
              <View className="Home-UserBox-name">用户</View>
              {/* <View className="Home-UserBox-tel">
                {userinfo.customerPhone &&
                  this.formatePhone(userinfo.customerPhone)}
              </View> */}
              <View className="Home-UserBox-addr">校区名称</View>
            </View>
            <Image
              className="Home-UserBox-headimg"
              src={UserHeaderF}
              onClick={goLoginPage}
            />
          </View>
        </View>

        <View className="Home-UserBox-Order">
          <Text className="Home-UserBox-Order-text" onClick={goLoginPage}>
            我的订单
          </Text>
          <Text className="Home-UserBox-Order-text" onClick={goLoginPage}>
            账户
          </Text>
        </View>
      </View>

      <View className="Home-Service">
        <View className="Home-Service-List normal">
          <MenuIconNormal
            key="1"
            icon={WaterIconNormal}
            text="饮水"
            onClick={goLoginPage}
          />
          <MenuIconNormal
            key="1"
            icon={DryerIconNormal}
            text="吹风"
            onClick={goLoginPage}
          />
          <MenuIconNormal
            key="1"
            icon={DispenserIconNormal}
            text="壁挂机"
            onClick={goLoginPage}
          />
          <MenuIconNormal
            key="1"
            icon={WasherIconNormal}
            text="洗衣"
            onClick={goLoginPage}
          />
        </View>
      </View>
    </View>
  );
}

export default FakeHome;
