index.vue 9.89 KB
Newer Older
xd's avatar
xd committed
1
<template>
xd's avatar
xd committed
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 30 31 32 33 34
  <div class="container">
    <div class="top">
      <div class="left">
        <img src="../../../public/img/money.png" alt="" />
        <p>佣金收益</p>
        <div class="money">21321.00</div>
        <div class="detail">查看明细</div>
      </div>
      <div class="right">
        <img src="../../../public/img/task.png" alt="" />
        <p>任务达成</p>
        <div class="money">5/10</div>
        <div class="detail">查看明细</div>
      </div>
    </div>
    <div class="list">
      <!-- 搜索框 -->
      <van-search
        v-model="inputValue"
        :placeholder="time"
        shape="round"
        @search="onSearch"
        right-icon="notes-o"
        left-icon="none"
        @click="timeShow = true"
        readonly
      >
      </van-search>
      <van-popup v-model="timeShow" position="bottom" :overlay="true">
        <van-datetime-picker
          v-model="oldTime"
          type="date"
          @cancel="timeShow = false"
xd's avatar
xd committed
35
          @confirm="handleOldTime"
xd's avatar
xd committed
36 37 38 39 40 41 42 43 44 45 46 47
          @change="timeChange"
        />
      </van-popup>
      <!-- 任务列表 -->
      <van-tabs
        type="card"
        @click="onClick"
        title-active-color="#fff"
        title-inactive-color="#2D476A"
        class="tab"
        background="#F8F8F8"
      >
xd's avatar
xd committed
48
        <van-tab title="优惠券核销" @click="getList">
xd's avatar
xd committed
49 50 51 52 53 54 55
          <van-list v-model="writeOff" :finished="finished" @load="onLoad">
            <van-cell
              :value="item.action"
              class="content"
              v-for="(item, index) in writeOffList"
              :key="index"
            >
xd's avatar
xd committed
56
              <template slot="title">
xd's avatar
xd committed
57 58
                <img src="../../../public/img/photo.png" alt="" />
                <span class="custom-title">{{ item.name }}</span>
xd's avatar
xd committed
59 60 61 62
              </template>
            </van-cell>
          </van-list>
        </van-tab>
xd's avatar
xd committed
63
        <van-tab title="商品购买" @click="getGoodsList">
xd's avatar
xd committed
64 65 66 67
          <van-list v-model="writeOff" :finished="finished" @load="onLoad">
            <van-cell
              :value="item.action"
              class="content"
xd's avatar
xd committed
68
              v-for="(item, index) in ShoppingList"
xd's avatar
xd committed
69 70
              :key="index"
            >
xd's avatar
xd committed
71
              <template slot="title">
xd's avatar
xd committed
72 73
                <img src="../../../public/img/photo.png" alt="" />
                <span class="custom-title">{{ item.name }}</span>
xd's avatar
xd committed
74 75 76 77
              </template>
            </van-cell>
          </van-list>
        </van-tab>
xd's avatar
xd committed
78
        <van-tab title="拉新会员" @click="getNewMemberList">
xd's avatar
xd committed
79 80 81 82
          <van-list v-model="writeOff" :finished="finished" @load="onLoad">
            <van-cell
              :value="item.action"
              class="content"
xd's avatar
xd committed
83
              v-for="(item, index) in newMemberList"
xd's avatar
xd committed
84 85
              :key="index"
            >
xd's avatar
xd committed
86
              <template slot="title">
xd's avatar
xd committed
87 88
                <img src="../../../public/img/photo.png" alt="" />
                <span class="custom-title">{{ item.name }}</span>
xd's avatar
xd committed
89 90 91 92 93 94
              </template>
            </van-cell>
          </van-list>
        </van-tab>
      </van-tabs>
    </div>
xd's avatar
xd committed
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
    <div class="main-menuBar">
      <div class="menuBar-menu" @click="menuBarClick('MainSale')">
        <img class="menuBar-icon" :src="menuBarInfo.icon.now['1']" />
        <div class="menuBar-title">活动</div>
      </div>
      <div class="menuBar-menu" @click="menuCase()">
        <img class="menuBar-icon" :src="menuBarInfo.icon.now['2']" />
        <div class="menuBar-title">案例</div>
      </div>
      <div class="menuBar-menu" @click="menuProfit()">
        <img class="menuBar-icon" :src="menuBarInfo.icon.now['3']" />
        <div class="menuBar-title  menuBar-title-ac">收益</div>
      </div>
      <div class="menuBar-menu" @click="menuTask()">
        <img class="menuBar-icon" :src="menuBarInfo.icon.now['4']" />
        <div class="menuBar-title">任务</div>
      </div>
      <div class="menuBar-menu" @click="menuBarClick('Me')">
        <img class="menuBar-icon" :src="menuBarInfo.icon.now['5']" />
        <div class="menuBar-title">我的</div>
      </div>
    </div>
xd's avatar
xd committed
117 118 119 120
  </div>
</template>

<script>
xd's avatar
xd committed
121
import { getProfitList,getGoodsList,getNewMemberList } from '@/api/test/active'
xd's avatar
xd committed
122
export default {
xd's avatar
xd committed
123 124 125 126 127
  data() {
    return {
      time: new Date(),
      inputValue: "",
      timeShow: false,
xd's avatar
xd committed
128
      oldTime: new Date(),
xd's avatar
xd committed
129 130
      writeOff: false,
      finished: false,
xd's avatar
xd committed
131
      writeOffList: [
xd's avatar
xd committed
132 133
        {
          action: "现金券核销",
xd's avatar
xd committed
134
          src: "",
xd's avatar
xd committed
135 136 137
          name: "Solomon"
        }
      ],
xd's avatar
xd committed
138
      ShoppingList: [
xd's avatar
xd committed
139 140
        {
          action: "商品购买",
xd's avatar
xd committed
141
          src: "",
xd's avatar
xd committed
142 143 144
          name: "Solomon"
        }
      ],
xd's avatar
xd committed
145
      newMemberList: [
xd's avatar
xd committed
146 147
        {
          action: "拉新会员",
xd's avatar
xd committed
148
          src: "",
xd's avatar
xd committed
149 150
          name: "Solomon"
        }
xd's avatar
xd committed
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
      ],
      // 图标
      menuBarInfo: {
        list: {
          main: [
            {
              name: "",
              iconUaUrl: "",
              iconAcUrl: ""
            }
          ]
        },
        icon: {
          now: {
            "1": "",
            "2": "",
            "3": "",
            "4": "",
            "5": ""
          },
          ua: {
            "1": "/mainSale/icon-menuBar-1-ua.png",
            "2": "/mainSale/icon-menuBar-2-ua.png",
            "3": "/mainSale/icon-menuBar-3-ua.png",
            "4": "/mainSale/icon-menuBar-4-ua.png",
            "5": "/mainSale/icon-menuBar-5-ua.png"
          },
          ac: {
            "1": "/mainSale/icon-menuBar-1-ac.png",
            "2": "/mainSale/icon-menuBar-2-ac.png",
            "3": "/mainSale/icon-menuBar-3-ac.png",
            "4": "/mainSale/icon-menuBar-4-ac.png",
            "5": "/mainSale/icon-menuBar-5-ac.png"
          }
        }
      }
xd's avatar
xd committed
187 188
    };
  },
xd's avatar
xd committed
189 190
  created() {
    this.checkNowMenuBar();
xd's avatar
xd committed
191
    this.getList()
xd's avatar
xd committed
192
  },
xd's avatar
xd committed
193
  methods: {
xd's avatar
xd committed
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
    getList() {
      let data = {

      }
      getProfitList(data).then(res => {
        console.log(res,"收益列表");      
      })
    },
    getGoodsList() {
     let data = {

      }
      getGoodsList(data).then(res => {
        console.log(res,"商品购买列表");      
      }) 
    },
    getNewMemberList() {
     let data = {

      }
      getNewMemberList(data).then(res => {
        console.log(res,"拉新会员列表");      
      }) 
    },
xd's avatar
xd committed
218 219
    onSearch() {},
    timeFormat(time) {
xd's avatar
xd committed
220 221 222 223 224
      let year = 1900 + time.getYear();
      let month = "0" + (time.getMonth() + 1);
      let date = "0" + time.getDate();
      return year + "-" + month.substring(month.length-2, month.length)  + "-" + date.substring(date.length-2, date.length)
       + " "
xd's avatar
xd committed
225 226 227
    },
    timeChange(e) {
      let newTime = e.getValues();
xd's avatar
xd committed
228
      this.inputValue = `${newTime[0]}-${newTime[1]}-${newTime[2]}`;
xd's avatar
xd committed
229 230 231 232 233 234 235 236
    },
    onClick(name, title) {
      this.$toast(title);
    },
    onLoad() {
      // fetchSomeThing().catch(() => {
      this.writeOff = false;
      // })
xd's avatar
xd committed
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257
    },
    menuCase() {
      this.$router.push({ path: "/case" });
    },
    menuProfit() {
      this.$router.push({ path: "/profitList" });
    },
    // 导航
    checkNowMenuBar() {
      let inData = "3";
      this.menuBarInfo.icon.now = this.menuBarInfo.icon.ua;
      this.menuBarInfo.icon.now[inData] = this.menuBarInfo.icon.ac[inData];
    },
    menuBarClick(inData) {
      this.$router.push(inData);
    },
    listTaskClick() {
      this.$router.push("Task");
    },
    menuTask() {
      this.$router.push({ path: "/taskList" });
xd's avatar
xd committed
258 259 260 261
    },
    handleOldTime(value) {
      this.inputValue = this.timeFormat(value)
      this.timeShow = false
xd's avatar
xd committed
262 263 264
    }
  },
  mounted() {
xd's avatar
xd committed
265
    this.time = this.timeFormat(this.time);   
xd's avatar
xd committed
266 267
  }
};
xd's avatar
xd committed
268 269
</script>

xd's avatar
xd committed
270
<style scoped>
xd's avatar
xd committed
271 272 273
.container >>> .van-tabs__wrap,
.van-tabs__wrap--scrollable {
  height: 40px;
xd's avatar
xd committed
274
}
xd's avatar
xd committed
275 276 277 278
.container >>> .van-tab,
.van-tab--active,
.van-ellipsis {
  line-height: 40px;
xd's avatar
xd committed
279 280
}
.tab {
xd's avatar
xd committed
281
  box-shadow: 0px 1px 3px 0px rgba(221, 221, 221, 1);
xd's avatar
xd committed
282 283
}
.content >>> .van-cell__value {
xd's avatar
xd committed
284 285 286
  font-size: 14px;
  font-weight: 400;
  color: rgba(45, 71, 106, 1);
xd's avatar
xd committed
287 288 289 290
  line-height: 44px;
}
.custom-title {
  margin-left: 12px;
xd's avatar
xd committed
291 292 293
  font-size: 16px;
  font-weight: bold;
  color: rgba(45, 71, 106, 1);
xd's avatar
xd committed
294
}
xd's avatar
xd committed
295
.content img {
xd's avatar
xd committed
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330
  width: 44px;
  height: 44px;
  border-radius: 50%;
  vertical-align: middle;
}
.tab >>> .van-tabs__nav--card .van-tab {
  border-right: none;
}
.tab >>> .van-tab.van-tab--active {
  background-color: #75b2fd;
}
.tab >>> .van-tabs__nav--card {
  margin: 0;
  border: none;
  height: 40px;
}
.list >>> .van-icon,
.van-icon-notes-o {
  color: #2d476a;
}
.list {
  height: 469px;
  background: rgba(255, 255, 255, 1);
  margin-top: 12px;
}
.money {
  width: 120px;
  height: 32px;
  line-height: 32px;
  background: rgba(248, 248, 248, 1);
  border-radius: 16px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  color: rgba(208, 2, 27, 1);
xd's avatar
xd committed
331
  margin: 0 auto;
xd's avatar
xd committed
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347
  margin-top: 8px;
}
.detail {
  font-size: 10px;
  color: rgba(117, 178, 253, 1);
  margin-top: 8px;
}
.top p {
  color: rgba(45, 71, 106, 1);
  font-size: 12px;
}
.top img {
  width: 32px;
  height: 32px;
}
.container {
xd's avatar
xd committed
348 349 350 351 352
  height: auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
xd's avatar
xd committed
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369
}
.top {
  height: 160px;
  background: #fff;
  box-shadow: 0px 2px 4px 0px rgba(221, 221, 221, 1);
  padding: 24px;
  display: flex;
}
.left,
.right {
  flex: 1;
  width: 100%;
  text-align: center;
}
.right {
  border-left: 1px solid #eee;
}
xd's avatar
xd committed
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409
.main-menuBar {
  /*border: 1px solid darkviolet;*/
  box-shadow: inset 0px 1px 2px 0px rgba(221, 221, 221, 1);
  width: 100%;
  height: 82px;
  position: fixed;
  bottom: 0px;
  left: 0px;
  background-color: #fafafa;
  padding: 0px 14px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
.menuBar-menu {
  /*background-color: greenyellow;*/
  width: 48px;
  height: 47px;

  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}
.menuBar-icon {
  width: 24px;
  height: 24px;
  object-fit: cover;
}
.menuBar-title {
  width: auto;
  height: 12px;
  font-size: 10px;
  font-weight: bold;
  color: rgba(67, 119, 188, 0.4);
  text-align: center;
}
.menuBar-title-ac {
  color: rgba(67, 119, 188, 1);
}
xd's avatar
xd committed
410
</style>