
<style scoped>
.clearfix:after {
  content: ".";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}
.clearfix {
  overflow: hidden;
  _zoom: 1;
}
.text-gray {
  color: #717171;
}
.text-orange {
  color: #eb7741;
}
.text-danger {
  color: #c03546;
}
.comp-login {
  background-color: #fff;
  height: 100%;
  height: 100vh;
}
.input-box {
  background: #fff;
}
.comp-login {
  padding: 0;
  margin: 0;
}
.Owner_StoreView {
  overflow: hidden;
  background: #f3f6ff;
}
.titleClerkInfo {
  padding: 1rem 3%;
  padding-bottom:0;
  padding-left: 3%;
  text-indent: 1rem;
  color: #3a8afb;
  background: url(http://image.supercarrier8.com/h5_key/icon-info.png) no-repeat
    3% 1.1rem;
  background-size: 0.8rem 0.8rem;
  background-color: #fff;
}
/* .titleClerkInfo span{margin-left: } */
.productPanel {
  background-color: #fff;
  padding: 0 3%;
}
.productWay {
  padding: 0.8rem 0;
  border-bottom: 0.01rem solid #f5f5f5;
  display: flex;
  line-height: 1;
}
.productWay .titleInfo {
  margin-right: 0.6rem;
}
.productWay .titleInfo span {
  width: 3.75rem;
  display: inline-block;
  text-align: justify;
  text-justify: distribute-all-lines; /*ie6-8*/
  text-align-last: justify; /* ie9*/
  -moz-text-align-last: justify; /*ff*/
  -webkit-text-align-last: justify; /*chrome 20+*/
}
.productWay .resultInfo {
  -webkit-box-flex: 1;
  flex: 1;
} /*icon-tel-blue.png */
.productWay .resultInfo .telCode {
  color: #3a8afb;
  margin-left: 0.4rem;
  padding-right: 0.9rem;
  background: url(http://image.supercarrier8.com/h5_key/icon-tel-blue.png)
    no-repeat 98% center;
  background-size: 0.8rem 0.8rem;
}
/* .productWay .resultInfo span.moveDown{float: left;margin-top: 0.02rem;} */
.productWay .resultInfo .sm_lookInfo{padding-left:0.2rem;padding-right:0.5rem;color:#3A8AFB;background: url(http://image.supercarrier8.com/h5_key/icon-arrow-gray.png) no-repeat right 40%;background-size:0.4rem 0.7rem;font-size: 0.7rem;}
.productWay .resultInfo .telCode{color:#3A8AFB;margin-left:0.2rem;font-size:0.75rem;padding-right:0.9rem;background: url(http://image.supercarrier8.com/h5_key/icon-tel-blue.png) no-repeat 98% center;background-size:0.8rem 0.8rem;font-size: 0.7rem;}
.mint-button {
  width: 92%;
  margin: 0 auto;
  margin-top: 1rem;
  background-color: #3a8afb;
  border-radius: 0.2rem;
}
.mask {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
}
.item-btn {
  display: inline-block;
  width: 30%;
  height: 2rem;
  padding: 0;
  margin: 0 0;
  margin-top: 0px;
  margin-bottom: 0px;
  font-size: 1rem;
  line-height: 2rem;
  text-align: center;
  color: #fff;
  background: #3a8afb;
  border: none;
  border-radius: 0.2rem;
  font-weight: bold;
}
</style>
<style>
.mint-indicator .mint-indicator-mask {
  z-index: 2008;
}
</style>
<template>
  <div
    class="container comp-login jfBaseSize Owner_StoreView"
    v-cloak
    v-bind:style="isShow.vh?'height:100vh':'height: 100%;'"
  >
    <div class="titleClerkInfo">门店信息</div>
    <div class="productPanel">
      <div class="productWay">
        <div class="titleInfo">
          <span>门店编号</span>
        </div>
        <div class="resultInfo">
          <span class="text-gray" v-html="model.ORGANIZATION_NO?model.ORGANIZATION_NO:'-'"></span>
        </div>
      </div>
      <div class="productWay">
        <div class="titleInfo">
          <span>门店名称</span>
        </div>
        <div class="resultInfo">
          <span class="text-gray" v-html="model.ORGANIZATION_NAME?model.ORGANIZATION_NAME:'-'"></span>
        </div>
      </div>
      <div class="productWay">
        <div class="titleInfo">
          <span>门头照片</span>
        </div>
        <div class="resultInfo" v-if="model.img_list">
          <img height='75px' width='75px' v-for="item in model.img_list" v-bind:key="item" v-bind:src="item"/>
        </div>
        <div v-else class="resultInfo">
          <span class="text-gray">-</span>
        </div>
      </div>
      <div class="productWay">
        <div class="titleInfo">
          <span>门店地址</span>
        </div>
        <div class="resultInfo">
          <span class="text-gray" v-html="model.ADDRESS?model.ADDRESS:'-'"></span>
        </div>
      </div>
      <div class="productWay">
        <div class="titleInfo">
          <span>注册时间</span>
        </div>
        <div class="resultInfo">
          <span class="text-gray" v-html="model.ROW_CREATE_DATE?model.ROW_CREATE_DATE:'-'"></span>
        </div>
      </div>
    </div>
    <div class="titleClerkInfo">店长信息</div>
    <div class="productPanel">
      <div class="productWay">
        <div class="titleInfo">
          <span>店长姓名</span>
        </div>
        <div class="resultInfo">
          <span class="text-gray" v-html="model.CONTACT?model.CONTACT:'-'"></span><span class="sm_lookInfo" v-on:click="judgeExchange()" v-if="searchData.ORGANIZATION_ID">替换</span>
        </div>
        <!-- <button class="item-btn" @click="judgeExchange()">店长替换</button> -->
      </div>
      <div class="productWay">
        <div class="titleInfo">
          <span>手机号</span>
        </div>
        <div class="resultInfo">
          <span class="text-gray" v-html="model.TELEPHONE?model.TELEPHONE:'-'"></span>
          <a class="telCode" v-if="model.TELEPHONE?true:false" v-bind:href="'tel:'+model.TELEPHONE">拨打</a>
        </div>
      </div>
    </div>
     <ReturnHome ref="returnhome"></ReturnHome>
  </div>
</template>
<script>
import { Toast, InfiniteScroll } from "mint-ui";
import { Indicator } from "mint-ui";
import channelHelper from "@/assets/js/channelHelper.js";
import { base64 } from "@/assets/js/cryptoHelper";
import { debug } from "util";
 import ReturnHome from "@/components/channel/temp001/ReturnHome";
import "@/assets/js/libs/js.cookie";
export default {
  name: "Key_AddStore",
  	components: {ReturnHome},
    provide(){       
     return{           
        goPage:this.goPage       
     }   
    },
  props: ["comp", "cfg", "selectedPage"],
  data() {
    return {
      searchData: {},
      model: {},
      isShow: {
        vh: false
      }
    };
  },
  methods: {
    goPage(pagetype) {
      this.$parent.changeSelectedPage(pagetype);
    },
    GetStoreInfoByID: function() {
      //店员信息
      var that = this;
      Indicator.open();
      var url = "/channel/GetStoreInfoByID";
      var dataParams = that.searchData;
      var cbError = function() {
        Indicator.close();
      };
      var cbSuccess = function(res) {
        Indicator.close();
        if (res.flag) {
          if (res.data) {
            var obj = res.data[0];
            var img_list="";
            if (obj.LOGO_IMG) {
              obj.img_list = obj.LOGO_IMG.split(",");
            }
            // if (img_list.length > 0) {
            //   img_list.forEach(function(item) {
            //     img_html +=
            //       "<img height='75px' width='75px' src='" + item + "'/>";
            //   });
            // }
            // $("#d_LOGO_IMG").html(img_html);
            
            that.$set(that, "model", obj);
          }
        } else {
          Toast(res.msg);
        }
      };
      //请求后端
      channelHelper.CommonCallService(
        url,
        dataParams,
        cbSuccess,
        cbError,
        null,
        null
      );
    },
    judgeExchange: function() {
      var eno = this.sup8.context.enterpriseno;
      //if (!channelHelper.CheckLogin(this.$parent,eno)) {
      //return false;
      //}
      // var OldMobile = "123";
      // var StroeID = "a98918534b7e460286a23548ce6ef23b";
      // localStorage.setItem("Exx_OldMobile", OldMobile);
      // localStorage.setItem("Exx_StroeID", StroeID);
      var data = JSON.parse(sessionStorage.getItem("AgentStoreManager"));
      data.Mobile=this.model.TELEPHONE;
      data.Name=this.model.CONTACT;
      sessionStorage.setItem("AgentStoreManager",JSON.stringify(data));
      this.$parent.changeSelectedPage("A_StoreR");
    },
    judgeLogin:function(){
      var eno = this.sup8.context.enterpriseno;
      if (!channelHelper.CheckLogin(this.$parent,eno,this.sup8.context.entranceid)) {
        this.$parent.changeSelectedPage('Key_Login');
        return false;
      }
    },
  },
  created: function() {
    var that = this;
    //判断是否登录
    var isDesign = location.pathname.indexOf('design');
    if(isDesign!=-1)
    {
        return;
    }
    that.judgeLogin();
    var data = JSON.parse(sessionStorage.getItem("AgentStoreManager"));
    if(!data||!data.ID)
    {
    return;
    }
    // var ORGANIZATION_ID = "a98918534b7e460286a23548ce6ef23b";
    that.$set(that, "searchData", {
      UserToken: channelHelper.GetUserToken(),
      EnterpriseNo: that.sup8.context.enterpriseno,
      LanguageType: channelHelper.GetLanguageType(),
      ORGANIZATION_ID: data.ID
    });
    that.GetStoreInfoByID();
  },
  mounted: function() {}
};
</script>
