index.vue 5.91 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<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">
17
                <button class="button-send" @click="testEaPost">推送</button>
18 19 20 21 22 23 24 25 26 27 28 29
              </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
// import { ApiTestCfPost, ApiTestEaPost } from "@/api/test/main";
import { ApiEaPost } from "@/api/test/test";
Z's avatar
Z committed
38
// const log = console.log.bind(console);
39

40 41 42 43 44 45 46 47
export default {
  name: "discountIndex",
  data() {
    return {
      test: {
        list: {
          main: [
            {
Z's avatar
Z committed
48
              imgUrl: "/mainSale/test-city.png",
49 50 51 52 53 54
              usedPercent: "10",
              money: "100",
              shareMan: "Alice",
              commision: "11"
            },
            {
Z's avatar
Z committed
55
              imgUrl: "/mainSale/test-city.png",
56 57 58 59 60 61
              usedPercent: "20",
              money: "200",
              shareMan: "Bob",
              commision: "22"
            },
            {
Z's avatar
Z committed
62
              imgUrl: "/mainSale/test-city.png",
63 64 65 66 67 68
              usedPercent: "30",
              money: "300",
              shareMan: "Clid",
              commision: "33"
            },
            {
Z's avatar
Z committed
69
              imgUrl: "/mainSale/test-city.png",
70 71 72 73 74 75 76 77 78 79 80
              usedPercent: "40",
              money: "400",
              shareMan: "Doke",
              commision: "44"
            }
          ]
        }
      },
      dis: {}
    };
  },
81
  created() {},
Z's avatar
Z committed
82
  methods: {
83 84
    // testEaPost() {
    //   let postData = {
85 86 87
    //     appCode: '0603',
    //     condType: 1,
    //     condValue: '138069094',
88 89 90 91 92
    //   };
    //   ApiEaPost(postData).then(res => {
    //     console.log(res);
    //   });
    // },
93

94
    testEaPost() {
Z's avatar
Z committed
95
      let postData = {
96 97
        appCode: '0606',
        crmActionDate: '2019-12-12'
Z's avatar
Z committed
98
      };
99
      ApiEaPost(postData).then(res => {
100
        // console.log(res);
Z's avatar
Z committed
101 102
      });
    },
103

104 105 106 107 108 109 110 111 112 113 114
    // testEaPost() {
    //   let postData = {
    //     appCode: '0608',
    //     content: 'text',
    //     phone: '18801342762',
    //   };
    //   ApiEaPost(postData).then(res => {
    //     // console.log(res);
    //   });
    // },

Z's avatar
Z committed
115 116
    buttonSingleMarketingClick() {
      // this.$router.push("");
117
    },
Z's avatar
Z committed
118 119 120
    buttonMainMarketingClick() {
      this.$router.push("MainSale");
    }
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 215 216 217 218 219 220
  }
};
</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
221
.button-send {
222 223 224 225 226 227 228
  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
229
  font-size: 16px;
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
}

.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
245
.tip-shareMan {
246 247 248 249 250 251 252 253
  /* border: 1px solid orange; */
  width: 70%;
  height: 100%;

  font-size: 14px;
  line-height: 16px;
  color: rgb(150, 150, 150);
}
Z's avatar
Z committed
254
.tip-commision {
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
  /* 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
279
.menu {
280 281 282 283 284 285 286 287 288
  /* 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
289 290
.activeMenu {
  color: lightcoral;
291 292
}
</style>