index.vue 5.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
<template>
  <div class="main">
    <!-- <div class="tops"></div> -->
    <div class="contents">
      <div v-for="(item, index) of test.list.main" :key="index">
        <div class="content">
          <div class="content-imgs">
            <img class="imgs-img" :src="item.imgUrl" alt />
          </div>
          <div class="content-infos">
            <div class="infos-mains">
              <div class="mains">
                <div class="main-usedPercent">核销率{{item.usedPercent}}%</div>
                <div class="main-money">{{item.money}}元代金券</div>
              </div>
              <div class="buttons">
                <button class="button-send" @click="testButtonClick">推送</button>
              </div>
            </div>
            <div class="infos-tips">
              <div class="tip-shareMan">最后分享:{{item.shareMan}}</div>
              <div class="tip-commision">佣金:¥ {{item.commision}}</div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="menus">
      <div class="menu" @click="buttonMainMarketingClick">精准营销</div>
Z's avatar
Z committed
30
      <div class="menu activeMenu" @click="buttonSingleMarketingClick">一对一营销侧边栏</div>
31 32 33 34 35
    </div>
  </div>
</template>

<script>
36 37 38
import { ApiTestGet, ApiTestPost } from "@/api/test/main";
const log = console.log.bind(console);

39 40 41 42 43 44 45 46
export default {
  name: "discountIndex",
  data() {
    return {
      test: {
        list: {
          main: [
            {
Z's avatar
Z committed
47
              imgUrl: "/mainSale/test-city.png",
48 49 50 51 52 53
              usedPercent: "10",
              money: "100",
              shareMan: "Alice",
              commision: "11"
            },
            {
Z's avatar
Z committed
54
              imgUrl: "/mainSale/test-city.png",
55 56 57 58 59 60
              usedPercent: "20",
              money: "200",
              shareMan: "Bob",
              commision: "22"
            },
            {
Z's avatar
Z committed
61
              imgUrl: "/mainSale/test-city.png",
62 63 64 65 66 67
              usedPercent: "30",
              money: "300",
              shareMan: "Clid",
              commision: "33"
            },
            {
Z's avatar
Z committed
68
              imgUrl: "/mainSale/test-city.png",
69 70 71 72 73 74 75 76 77 78 79
              usedPercent: "40",
              money: "400",
              shareMan: "Doke",
              commision: "44"
            }
          ]
        }
      },
      dis: {}
    };
  },
80 81 82 83
  created() {
    // this.testApiGet();
    this.testApiPost();
  },
Z's avatar
Z committed
84
  methods: {
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
    testApiGet() {
      log("--->testApi: Start:");
      ApiTestGet().then(res => {
        log("--->Api: Get: res =", res);
      });
      log("--->testApi: End.");
    },
    testApiPost() {
      log("--->testApi: Start:");
      let postData = {
        brief: "停车券兑换",
        orderNo: "12345678",
        point: "123.321",
        procType: 46,
        updateType: "dec",
        vipId: 1
      };
      ApiTestPost(postData).then(res => {
        log("--->Api: Post: res =", res);
      });
      log("--->testApi: End.");
    },
Z's avatar
Z committed
107 108 109 110
    testButtonClick() {},

    buttonSingleMarketingClick() {
      // this.$router.push("");
111
    },
Z's avatar
Z committed
112 113 114
    buttonMainMarketingClick() {
      this.$router.push("MainSale");
    }
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 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 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 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
  }
};
</script>

<style scoped>
.main {
  background-color: white;
  width: 100%;
  height: 100%;

  display: flex;
  flex-direction: column;
  justify-content: start;
}
.tops {
  border: 2px solid lightblue;
  width: 100%;
  height: 100px;
}
.contents {
  /* border: 2px solid lightpink; */
  width: 100%;
  height: 100%;
  padding: 16px;
  padding-bottom: 40px;
}
.content {
  border: 0px solid orange;
  height: 100px;
  width: 100%;
  padding: 4px 0px;
  margin-bottom: 16px;

  border-radius: 4px;
  box-shadow: 0px 2px 4px 0px rgb(187, 187, 187);

  display: flex;
  flex-direction: row;
  justify-content: start;
}
.content-imgs {
  /* border: 1px solid pink; */
  width: 20%;
  height: 100%;

  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: center;
}
.imgs-img {
  width: 50px;
  height: 50px;
  margin-top: 10px;
  border-radius: 50%;
  object-fit: cover;
}
.content-infos {
  /* border: 1px solid orange; */
  width: 80%;
  height: 100%;
}
.infos-mains {
  height: 70%;
  width: 100%;
  /* border: 1px solid green; */

  display: flex;
  flex-direction: row;
  justify-content: start;
}
.mains {
  /* border: 1px solid red; */
  width: 70%;
  height: 100%;

  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.main-usedPercent {
  font-size: 14px;
  color: grey;
}
.main-money {
  /* border: 1px solid lightgreen; */
  font-size: 24px;
}
.buttons {
  /* border: 1px solid darkorange; */
  /* background-color: bisque; */
  width: 30%;
  height: 100%;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

Z's avatar
Z committed
215
.button-send {
216 217 218 219 220 221 222
  border: 0px solid blue;
  height: 40px;
  width: 60px;
  border-radius: 4px;
  background-color: rgba(68, 93, 251, 1);
  color: white;

Z's avatar
Z committed
223
  font-size: 16px;
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
}

.infos-tips {
  height: 30%;
  width: 100%;
  /* border: 1px solid red; */
  border-top: 1px dashed gray;
  padding-top: 6px;

  display: flex;
  flex-direction: row;
  justify-content: start;
  align-items: center;
}

Z's avatar
Z committed
239
.tip-shareMan {
240 241 242 243 244 245 246 247
  /* border: 1px solid orange; */
  width: 70%;
  height: 100%;

  font-size: 14px;
  line-height: 16px;
  color: rgb(150, 150, 150);
}
Z's avatar
Z committed
248
.tip-commision {
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
  /* border: 1px solid green; */
  width: 30%;
  height: 100%;

  font-size: 14px;
  line-height: 16px;
  color: rgb(150, 150, 150);
}

.menus {
  border-top: 1px solid rgb(194, 194, 194);

  position: fixed;
  bottom: 0px;
  left: 0px;
  width: 100%;
  height: 50px;
  background-color: white;

  display: flex;
  flex-direction: row;
  justify-content: start;
  align-items: center;
}
Z's avatar
Z committed
273
.menu {
274 275 276 277 278 279 280 281 282
  /* border: 1px solid red; */
  height: 50px;
  /* width: 120px; */
  width: 50%;
  line-height: 50px;
  text-align: center;
  font-size: 14px;
  color: black;
}
Z's avatar
Z committed
283 284
.activeMenu {
  color: lightcoral;
285 286
}
</style>