<template>
  <div class="app-content">
    <div class="tab-wrap">
      <div class="logo-img">
        <img :src="`${constant.imgUrl}/retail/official/logo.png`" alt />
      </div>
      <div class="phone-img" @click="contactFn">
        <img :src="`${constant.imgUrl}/retail/official/phone.png`" alt />
      </div>
    </div>
    <app-swiper :height="{type: 'number',val: 750}" :list="swiper" />
    <div class="module-com" v-for="(item, index) in contentData" :key="index">
      <div class="module-tit">
        <div class="tit-main" v-html="item.title"></div>
        <div class="tit-sub">{{ item.subTitle }}</div>
      </div>
      <div class="module-det">
        <app-img class="module-img" :src="item.img" :lazy-load="true" mode="widthFix" />
      </div>
    </div>
    <!-- ad -->
    <div class="cooperation-wrap" :style="{backgroundImage:'url(' + backgroundImg + ')'}">
      <div class="ad-title">
        <span>他们</span>
        <span class="app-color-1">都在用</span>
      </div>
      <div class="ad-list-wrap">
        <div class="ad-list" v-for="(item, index) in adData" :key="index">
          <app-img
            :src="`${constant.imgUrl}/retail/official/list-${index + 1}.png`"
            mode="widthFix"
            alt="他们都在用"
          />
        </div>
      </div>
      <div class="official-wrap">
        <div class="off-title">技术让花店经营更简单</div>
        <div class="off-sub-tit" @click="contactFn">
          <app-img
            :src="`${constant.imgUrl}/retail/official/phone-small.png`"
            alt="电话"
            mode="widthFix"
          />
          <span>咨询热线：0592 - 3272000</span>
        </div>
      </div>
    </div>
    <!-- trademark -->
    <div class="bottom-trademark">
      <img :src="`${constant.imgUrl}/retail/common/trademark.png`" alt />
    </div>
    <!-- buttom -->
    <div
      v-if="status == 3"
      class="app-footer"
      @click="pageTo({
			url: '/pagesClient/official/pay',
			status: 1
		})"
    >立即续费</div>
    <div v-if="status != 3 && this.getLoginInfo.openShop !== 1" class="app-footer" @click="pageTo({
			url: '/pagesClient/official/pay',
      query:{
        ...option
      }
		})">申请试用</div>
    <div v-if="status != 3 && this.getLoginInfo.openShop == 1" class="app-footer">已申请</div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import AppSwiper from "@/components/app-swiper";
import AppImg from "@/components/app-img";
import { applyStatus } from "@/api/official";
import { share } from "@/mixins";
export default {
  name: "index",
  components: {
    AppSwiper,
    AppImg
  },
  mixins: [share],
  data() {
    return {
      constant: this.$constant,
      status: -2,
      swiper: [
        {
          img: `${this.$constant.imgUrl}/retail/official/banner-1.png`
        },
        {
          img: `${this.$constant.imgUrl}/retail/official/banner-2.png`
        },
        {
          img: `${this.$constant.imgUrl}/retail/official/banner-3.png`
        },
        {
          img: `${this.$constant.imgUrl}/retail/official/banner-4.png`
        }
      ],
      backgroundImg: `${this.$constant.imgUrl}/retail/official/bg.png`,
      contentData: [
        {
          title: `<span class="app-color-1">开店更简单</span>`,
          subTitle: `便捷收集订花人信息，按距离自动算运费，后台一键配送到达达，送到自动通知客户`,
          img: `${this.$constant.imgUrl}/retail/official/content-1.png`
        },
        {
          title: `客户<span class="app-color-1">分销</span>`,
          subTitle: `招募粉丝，不断裂变，通过佣金激励粉丝将商品分享给朋友，实现社群传播，产生订单`,
          img: `${this.$constant.imgUrl}/retail/official/content-4.png`
        },
        {
          title: `<span class="app-color-1">一键操作 </span>快速涨粉`,
          subTitle: `一键操作，快速注册会员，到店客户粉丝转化率提升80%`,
          img: `${this.$constant.imgUrl}/retail/official/content-5.png`
        },
        {
          title: `精准<span class="app-color-1">管理客户</span>`,
          subTitle: `实现订单和客户分门别类，把握每个客户的个性和特征，精准营销，快速提高客户复购`,
          img: `${this.$constant.imgUrl}/retail/official/content-6.png`
        },
        {
          title: `<span class="app-color-1">流程化</span>订单管理`,
          subTitle: `流程化管理订单，下单、制单、发货、配送、送到通知客户，享尊贵开店体验`,
          img: `${this.$constant.imgUrl}/retail/official/content-2.png`
        },
        {
          title: `丰富多样的<span class="app-color-1">营销工具</span>`,
          subTitle: `契合花店的营销工具，拉新、转化、复购、裂变，面面俱到`,
          img: `${this.$constant.imgUrl}/retail/official/content-3.png`
        },
        {
          title: `经营<span class="app-color-1">数据分析</span>`,
          subTitle: `大数据分析客户行为，精准定位高利润项目，投入产出更高效`,
          img: `${this.$constant.imgUrl}/retail/official/content-7.png`
        }
      ],
      adData: [1, 2, 3, 4, 5, 6, 7, 8]
    };
  },
  mounted() {
    // 隐藏返回首页按钮。
    uni.hideHomeButton()
  },
  computed: {
    ...mapGetters(["getMerchantInfo", "getLoginInfo"])
  },
  onLoad() {
    this.jweixinFn({
      title: "更懂您的花卉宝",
      pagePath: "pagesClient/official/index",
      imageUrl: ""
    });
    console.log('this.getLoginInfo==>', this.getLoginInfo)
  },
  methods: {
    init() {
      // 续费
      if (this.option.pay == 1) {
        this.status = 3;
        uni.setStorageSync("renewOption", JSON.stringify(this.option));
      } else {
        uni.removeStorageSync("renewOption");
      }
      //花店分享的页面有邀人，打开页面保存邀请人
      // let introMerchantId = 0;
      // if (typeof this.option.introMerchantId != "undefined") {
      //   introMerchantId = this.option.introMerchantId;
      // }
      // uni.setStorageSync("introMerchantId", introMerchantId);
    },
    _getDet() {
      applyStatus().then(res => {
        this.status = res.data.status;
      });
    },
    contactFn() {
      uni.makePhoneCall({
        phoneNumber: "05923272000"
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.app-content {
  background-color: #fff;
  padding-bottom: 100px;
}
.tab-wrap {
  @include disFlex(center, space-between);
  padding: 0 30px;
  .logo-img {
    width: 160px;
  }
  .phone-img {
    width: 50px;
  }
}
// module
.module-com {
  margin-top: 80px;
  .module-tit {
    text-align: center;
    .tit-main {
      font-size: 36px;
      font-weight: 600;
      margin-bottom: 14px;
    }
    .tit-sub {
      width: 90%;
      margin: 0 auto;
      color: $fontColor3;
      line-height: 34px;
      font-size:27rpx;
    }
  }
  .module-det {
    .module-img {
      min-height: 470px;
    }
  }
}
// cooperation
.cooperation-wrap {
  width: 100%;
  height: 552px;
  padding-top: 60px;
  .ad-title {
    color: #fff;
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 50px;
    text-align: center;
  }
  .ad-list-wrap {
    @include disFlex(center, center);
    flex-wrap: wrap;
    margin-bottom: 30px;
    .ad-list {
      width: 166px;
      margin-right: 10px;
      margin-bottom: 10px;
    }
  }
  .official-wrap {
    color: #fff;
    background-color: rgba(#000000, 0.6);
    width: 90%;
    margin: 0 auto;
    padding: 20px 0;
    .off-title {
      font-size: 36px;
      font-weight: 600;
      margin-bottom: 10px;
      text-align: center;
    }
    .off-sub-tit {
      @include disFlex(center, center);
      img {
        width: 28px;
        height: 28px;
        margin-right: 10px;
      }
    }
  }
}
// trademark
.bottom-trademark {
  @include disFlex(center, center);
  background-color: #242627;
  img {
    width: 140px;
  }
}
// footer
.app-footer {
  color: #fff;
  font-size: 36px;
  font-weight: 600;
  background: linear-gradient(90deg, #3ab7ff, #3385ff);
  &.under-review {
    background: #fff !important;
    color: #333 !important;
  }
}
</style>
