rank.vue 7.54 KB
Newer Older
wanli's avatar
wanli committed
1
<template>
wanli's avatar
wanli committed
2 3
  <div class="app-container">
    <div class="top">
4 5 6 7 8 9 10 11 12 13 14 15 16 17
      <p>
        <label @click="toggleMenu('0057c0f3380c49dc9731bdba94420d9c')"
          >应用排行</label
        >
        <label @click="toggleMenu('5734225f9f4441c99553f00d06553831')"
          >游戏排行</label
        >
      </p>
      <p>
        <span v-for="(item, index) in tabList" :key="index">今日流行</span>
        <span>上升最快</span>
        <span>本周热议</span>
        <span>最近更新</span>
      </p>
wanli's avatar
wanli committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
    </div>
    <div class="content">
      <div class="item">
        <img src="../../assets/images/evue-logo.png" alt="icon" />
        <div class="text">
          <p class="title">EVUE</p>
          <p class="subtitle">
            <star-rating
              v-bind:rating="3.5"
              v-bind:increment="0.1"
              v-bind:max-rating="5"
              v-bind:star-size="15"
              v-bind:read-only="true"
              inactive-color="#9E9E9E"
              active-color="#FFC83D"
            >
            </star-rating>
          </p>
          <p class="subtitle">八零八零八附带上方</p>
        </div>
        <button class="install">安装</button>
      </div>
      <div class="item">
        <img src="../../assets/images/evue-logo.png" alt="icon" />
        <div class="text">
          <p class="title">EVUE</p>
          <p class="subtitle">
            <star-rating
              v-bind:rating="3.5"
              v-bind:increment="0.1"
              v-bind:max-rating="5"
              v-bind:star-size="15"
              v-bind:read-only="true"
              inactive-color="#9E9E9E"
              active-color="#FFC83D"
            >
            </star-rating>
          </p>
          <p class="subtitle">八零八零八附带上方</p>
        </div>
        <button class="install">安装</button>
      </div>
      <div class="item">
        <img src="../../assets/images/evue-logo.png" alt="icon" />
        <div class="text">
          <p class="title">EVUE</p>
          <p class="subtitle">
            <star-rating
              v-bind:rating="3.5"
              v-bind:increment="0.1"
              v-bind:max-rating="5"
              v-bind:star-size="15"
              v-bind:read-only="true"
              inactive-color="#9E9E9E"
              active-color="#FFC83D"
            >
            </star-rating>
          </p>
          <p class="subtitle">八零八零八附带上方</p>
        </div>
        <button class="install">安装</button>
      </div>
      <div class="item">
        <img src="../../assets/images/evue-logo.png" alt="icon" />
        <div class="text">
          <p class="title">EVUE</p>
          <p class="subtitle">
            <star-rating
              v-bind:rating="3.5"
              v-bind:increment="0.1"
              v-bind:max-rating="5"
              v-bind:star-size="15"
              v-bind:read-only="true"
              inactive-color="#9E9E9E"
              active-color="#FFC83D"
            >
            </star-rating>
          </p>
          <p class="subtitle">八零八零八附带上方</p>
        </div>
        <button class="install">安装</button>
      </div>
      <div class="item">
        <img src="../../assets/images/evue-logo.png" alt="icon" />
        <div class="text">
          <p class="title">EVUE</p>
          <p class="subtitle">
            <star-rating
              v-bind:rating="3.5"
              v-bind:increment="0.1"
              v-bind:max-rating="5"
              v-bind:star-size="15"
              v-bind:read-only="true"
              inactive-color="#9E9E9E"
              active-color="#FFC83D"
            >
            </star-rating>
          </p>
          <p class="subtitle">八零八零八附带上方</p>
        </div>
        <button class="install">安装</button>
      </div>
      <div class="item">
        <img src="../../assets/images/evue-logo.png" alt="icon" />
        <div class="text">
          <p class="title">EVUE</p>
          <p class="subtitle">
            <star-rating
              v-bind:rating="3.5"
              v-bind:increment="0.1"
              v-bind:max-rating="5"
              v-bind:star-size="15"
              v-bind:read-only="true"
              inactive-color="#9E9E9E"
              active-color="#FFC83D"
            >
            </star-rating>
          </p>
          <p class="subtitle">八零八零八附带上方</p>
        </div>
        <button class="install">安装</button>
      </div>
    </div>
wanli's avatar
wanli committed
141 142 143
  </div>
</template>
<script>
144
import { getDataList } from "@/api/app-store";
wanli's avatar
wanli committed
145
import StarRating from "vue-star-rating";
wanli's avatar
wanli committed
146
export default {
147
  name: "AppRank",
wanli's avatar
wanli committed
148 149 150
  components: {
    StarRating,
  },
wanli's avatar
wanli committed
151
  data() {
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
    return {
      tabIndex: 0,
      tabChildIndex: 0,
      tabList: [],
      tabChildList: [],
      dataList: [],
      query: {
        method: "internal.getTabDetail",
        serviceType: 20,
        reqPageNum: 1,
        uri: "0057c0f3380c49dc9731bdba94420d9c",
        maxResults: 25,
        zone: "",
        locale: "zh",
      },
    };
wanli's avatar
wanli committed
168 169
  },
  computed: {},
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
  methods: {
    getTabList() {
      getDataList(this.query)
        .then((res) => {
          console.log(res);
        })
        .catch((err) => {
          console.log(err);
        });
    },
    getDataList() {
      getDataList()
        .then((res) => {
          console.log(res);
        })
        .catch((err) => {
          console.log(err);
        });
    },
    toggleMenu(uri) {
      console.log(uri);
    },
  },
  created() {
    this.getTabList();
  },
wanli's avatar
wanli committed
196 197 198
};
</script>
<style lang="scss" scoped>
wanli's avatar
wanli committed
199 200 201 202 203
div.app-container {
  margin: 20px 0px;
  & > div.top {
    display: flex;
    justify-content: space-between;
204
    margin-bottom: 20px;
wanli's avatar
wanli committed
205 206 207 208 209
    & > p {
      margin: 0px;
      display: inline-flex;
      align-items: center;
      font-size: 14px;
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
      & > label {
        cursor: pointer;
        margin: 0px 10px;
        font-size: 18px;
        &:hover {
          color: #4cd1e0;
          text-decoration: underline;
        }
        &.active {
          color: #4cd1e0;
          text-decoration: underline;
        }
      }
      & > span {
        cursor: pointer;
        margin: 0px 10px;
        font-size: 13px;
        &.active {
          color: #4cd1e0;
        }
wanli's avatar
wanli committed
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295
      }
    }
  }
  & > div.content {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    flex-grow: 1;
    flex-shrink: 0;
    & > div.item {
      flex: 1;
      width: 50%;
      max-width: 50%;
      min-width: 50%;
      cursor: pointer;
      display: inline-flex;
      flex-direction: row;
      box-sizing: border-box;
      border: none;
      margin: 0px;
      padding: 10px 20px;
      & > img {
        width: 80px;
        height: 80px;
      }
      & > button {
        width: 100px;
      }
      & > button.install {
        width: auto;
        min-width: 72px;
        max-width: 100px;
        height: 28px;
        margin: 10px auto;
        padding: 0 12px;
        font-size: 14px;
        font-weight: bolder;
        border-radius: 14px;
        color: #007dff;
        background: rgba(0, 0, 0, 0.05);
        border: 0;
        cursor: pointer;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        z-index: 1;
        outline: none;
      }
      & > div.text {
        flex: 1;
        padding: 15px 0px;
        margin-left: 20px;
        border-bottom: 1px solid #f2f2f2;
        & > p {
          margin: 1px 0px;
        }
        & > p.title {
          line-height: 18px;
        }
        & > p.subtitle {
          color: grey;
          font-size: 12px;
          line-height: 18px;
        }
      }
    }
wanli's avatar
wanli committed
296 297
  }
}
298
</style>