<template>
  <view>
    <custom-nav-bar position="absolute" color="black" :left-text="optins.name" left-arrow />
    <web-view v-if="optins.name === '手机充值' || optins.name === '生活缴费'" :src="url"></web-view>

    <image v-else class="img" mode="aspectFit" src="/static/packages/public/pages/web-view/img.jpg"
      :show-menu-by-longpress="true" />
  </view>
</template>

<script>
  // const app = getApp();
  export default {
    data() {
      return {
        optins: {
          name: ''
        },
        url: ''
      };
    },
    onLoad(optins) {
      this.optins = optins
      let url = '';
      switch (optins.name) {
        case '随手拍':
          url =
            'http://mssq.jiexiu.gov.cn/eGovaPublic/view/mobileapp/publicinspect/index.html?cityCode=2988&moduleId=2&isWechat=1&state=STATE#/report/1?hash=002';
          break;
        case '手机充值':
          url =
            'https://h5.bestpay.cn/subapps/txjfwap-h5/index.html?payType=1&amp;payChannel=winglet_go&amp;channel=xygj';
          break;
        case '生活缴费':
          url =
            'https://h5.bestpay.cn/subapps/utilities/union/main.html?cid=0880000081&amp;channel=hg&amp;partner_token=';
          break;
        default:
          break;
      }
      this.url = url
    },
    methods: {}
  };
</script>
<style lang="less">
  web-view {
    width: 100%;
    height: 100%;
  }

  .img {
    // width: 750rpx;
    // height: 1334rpx;
    width: 100%;
    height: 100%;
  }
</style>