<template>
  <view>
    <view v-for="(item, index) in dataList" :key="index">
      <div
        class="good_study_one"
        @click="openGood(item.ID, item.CategoryName)"
        :style="{
          borderRadius: '15px',
        }"
      >
        <view class="carriertag" v-if="item.IsChengDu||item.IsChengDu>=0">
          <view class="carriertagsub1">{{item.IsChengDu?'成都':'宜宾'}}</view>
        </view>
        <view class="img-box">
          <view class="img-show">
            <image
              style="
                width: 100%;
                height: 100%;
                border-radius: 10rpx 10rpx 0 0;
              "
              mode="aspectFill"
              :src="item.BannerList[0]"
            />
          </view>
        </view>
        <div class="good-info">
          <div class="good-name">
            <div class="span-name" style="display: flex">
              <div class="span-name-sub">{{ item.CarrierName }}</div>
            </div>
            <div class="span-type">
              {{ item.CategoryName }}
              <text
                v-if="item.OpeningStatus == 0"
                style="
                  font-size: 24rpx;
                  font-family: PingFang SC;
                  font-weight: 500;
                  color: #f70027;
                  margin-left: 10rpx;
                "
                >即将开业</text
              >
              <text
                v-if="item.OpeningStatus == 1"
                style="
                  font-size: 24rpx;
                  font-family: PingFang SC;
                  font-weight: 500;
                  color: #111111;
                  margin-left: 10rpx;
                "
                >已开业</text
              >
            </div>
          </div>
          <div class="good-price-info">
            <u-icon name="location" color="#999" size="24"></u-icon>
            <span class="price" style="margin-left: 5px">{{
              item.Address
            }}</span>
          </div>
        </div>
      </div>
    </view>
  </view>
</template>
<script>
    export default {
        props:['dataList'],
        data() {
            return {
                replace: null
            }
        },
        onLoad(options) {
            
        },
        mounted() {
          let uid = uni.getStorageSync("mall_UserInfo")
          this.replace = uni.getStorageSync('replace_page_index') 
        },
        methods:{
            openGood(id, type) {
                if(this.replace.state=='1'){
                  uni.navigateTo({
                    url: "/pages/kotra/carrier/detail_carrier?id=" + id + "&&type=" + type,
                  });
                }else{
                  uni.navigateTo({
                    url: "/pages/kotra/carrier/detail_building?id=" + id + "&&type=" + type,
                  });
                }
            }, 
        }
    }
</script>