Commit a9758cfa authored by Z's avatar Z

EA's API 0696,0697 use ok. Admin and WxAdmin's Eslint's unused rule closed.

parent c198c7fe
...@@ -10,7 +10,7 @@ module.exports = { ...@@ -10,7 +10,7 @@ module.exports = {
rules: { rules: {
// 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', // 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
// 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', // 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
// 'no-unused-vars': 'off', 'no-unused-vars': 'off',
// "quotes": [1, "single"],//引号类型 `` "" '' // "quotes": [1, "single"],//引号类型 `` "" ''
}, },
parserOptions: { parserOptions: {
......
import request from '@/utils/bRequestEa'
export function getVoucherList(inData) {
let postData = {
args: inData
}
return request({
url: '',
method: 'post',
data: postData
})
}
export function getVoucherWxUrl(inData) {
let postData = {
args: inData
}
return request({
url: '',
method: 'post',
data: postData
})
}
...@@ -11,3 +11,14 @@ export function ApiEaPost(inData) { ...@@ -11,3 +11,14 @@ export function ApiEaPost(inData) {
}) })
} }
export function ApiEaActiveList(inData) {
let postData = {
args: inData
}
return request({
url: '',
method: 'post',
data: postData
})
}
<template> <template>
<div class="main"> <div class="main">
<!-- <div class="tops"></div> --> <!-- <div class="tops"></div> -->
<div class="contents"> <div class="contents">
<div v-for="(item, index) of test.list.main" :key="index"> <div v-for="(item, index) of test.list.main" :key="index">
<div class="content"> <div class="content">
<div class="content-imgs"> <div class="content-imgs">
<img class="imgs-img" :src="item.imgUrl" alt /> <img class="imgs-img" :src="item.imgUrl" alt/>
</div> </div>
<div class="content-infos"> <div class="content-infos">
<div class="infos-mains"> <div class="infos-mains">
<div class="mains"> <div class="mains">
<div class="main-usedPercent">核销率{{item.usedPercent}}%</div> <div class="main-usedPercent">核销率{{item.usedPercent}}%</div>
<div class="main-money">{{item.money}}元代金券</div> <div class="main-money">{{item.money}}元代金券</div>
</div> </div>
<div class="buttons"> <div class="buttons">
<button class="button-send" @click="testEaPost">推送</button> <button class="button-send" @click="testEaPost">推送</button>
</div> </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="infos-tips"> <div class="zListActive">
<div class="tip-shareMan">最后分享:{{item.shareMan}}</div> <div class="inputs">
<div class="tip-commision">佣金:¥ {{item.commision}}</div> <!--<input class="input">-->
<div class="button" @click="zReadyDelVoucherList">Clear</div>
<div class="button" @click="zReadySetVoucherList">ReLoad</div>
</div>
<div class="lists">
<div class="item" v-for="item in zlist.voucher" :key="item.coupon_id"
@click="zVoucherPick(item.action_id, item.coupon_id)">
<div>优惠券ID: {{ item.coupon_id }}</div>
<div>活动ID: {{ item.action_id }}</div>
<div>活动标题: {{ item.coupon_title }}</div>
<div>活动列表: {{ item.coupon_link }}</div>
</div>
<!--<div class="item"></div>-->
<!--<div class="item"></div>-->
</div>
<div class="lists">
<div v-if="zlist.voucherUrl !== ''" class="voucherUrl">
<div>小程序Url: {{ zlist.voucherUrl }}</div>
</div>
<!--<div class="item"></div>-->
<!--<div class="item"></div>-->
</div>
</div> </div>
</div>
</div>
<div class="menus">
<div class="menu" @click="buttonMainMarketingClick">精准营销</div>
<div class="menu activeMenu" @click="buttonSingleMarketingClick">一对一营销侧边栏</div>
</div> </div>
</div>
</div>
<div class="menus">
<div class="menu" @click="buttonMainMarketingClick">精准营销</div>
<div class="menu activeMenu" @click="buttonSingleMarketingClick">一对一营销侧边栏</div>
</div> </div>
</div>
</template> </template>
<script> <script>
// import { ApiTestCfPost, ApiTestEaPost } from "@/api/test/main"; // import { ApiTestCfPost, ApiTestEaPost } from "@/api/test/main";
import { ApiEaPost } from "@/api/test/test"; import {ApiEaPost, ApiEaActiveList} from "@/api/test/test";
// const log = console.log.bind(console);
const zlog = console.log.bind(console);
export default { import * as APISidebarEA from "@/api/sidebar/ea";
name: "discountIndex", import Vue from 'vue';
data() { import {Field} from 'vant';
return {
test: { Vue.use(Field);
list: {
main: [
{ export default {
imgUrl: "/mainSale/test-city.png", name: "discountIndex",
usedPercent: "10", data() {
money: "100", return {
shareMan: "Alice", zcache: {
commision: "11" storeId: 1,
},
zlist: {
voucher: [],
voucherUrl: ''
},
test: {
list: {
main: [
{
imgUrl: "/mainSale/test-city.png",
usedPercent: "10",
money: "100",
shareMan: "Alice",
commision: "11"
},
{
imgUrl: "/mainSale/test-city.png",
usedPercent: "20",
money: "200",
shareMan: "Bob",
commision: "22"
},
// {
// imgUrl: "/mainSale/test-city.png",
// usedPercent: "30",
// money: "300",
// shareMan: "Clid",
// commision: "33"
// },
// {
// imgUrl: "/mainSale/test-city.png",
// usedPercent: "40",
// money: "400",
// shareMan: "Doke",
// commision: "44"
// }
]
}
},
dis: {}
};
},
created() {
this.zReadyGetVoucherList()
},
methods: {
zReadySetVoucherList() {
this.zReadyDelVoucherList()
const postData = {
appCode: '0696',
mdid: this.zcache.storeId
};
zlog('%c--->ActiveList: PD =', 'background: red;', postData)
APISidebarEA.getVoucherList(postData)
.then(res => {
zlog('%c--->ActiveList: RD =', 'background: green;', res)
this.zVoucherSet(res.result.coupons)
});
},
zReadyDelVoucherList() {
this.zVoucherDel()
this.zVoucherUrlDel()
},
zVoucherPick(inActiveId, inVoucherId) {
this.zVoucherUrlDel()
const postData = {
appCode: '0697',
action_id: Number(inActiveId),
coupon_id: Number(inVoucherId)
};
zlog('%c--->VoucherWxUrl: PD =', 'background: red;', postData)
APISidebarEA.getVoucherWxUrl(postData)
.then(res => {
zlog('%c--->VoucherWxUrl: RD =', 'background: green;', res)
this.zVoucherUrlSet(res.result.link)
});
},
zVoucherSet(inArray) {
this.zlist.voucher = inArray
}, },
{ zVoucherDel() {
imgUrl: "/mainSale/test-city.png", this.zlist.voucher = []
usedPercent: "20",
money: "200",
shareMan: "Bob",
commision: "22"
}, },
{ zVoucherUrlSet(inData) {
imgUrl: "/mainSale/test-city.png", this.zlist.voucherUrl = String(inData)
usedPercent: "30",
money: "300",
shareMan: "Clid",
commision: "33"
}, },
{ zVoucherUrlDel() {
imgUrl: "/mainSale/test-city.png", this.zlist.voucherUrl = ''
usedPercent: "40", },
money: "400", // testEaPost() {
shareMan: "Doke", // let postData = {
commision: "44" // appCode: '0603',
// condType: 1,
// condValue: '138069094',
// };
// ApiEaPost(postData).then(res => {
// console.log(res);
// });
// },
// testEaPost() {
// let postData = {
// appCode: '0606',
// crmActionDate: '2019-12-12'
// };
// ApiEaPost(postData).then(res => {
// // console.log(res);
// });
// },
testEaPost() {
let postData = {
appCode: '0696',
mdid: 1
};
ApiEaActiveList(postData).then(res => {
// console.log(res);
});
},
// testEaPost() {
// let postData = {
// appCode: '0608',
// content: 'text',
// phone: '18801342762',
// };
// ApiEaPost(postData).then(res => {
// // console.log(res);
// });
// },
buttonSingleMarketingClick() {
// this.$router.push("");
},
buttonMainMarketingClick() {
this.$router.push("MainSale");
} }
]
} }
},
dis: {}
}; };
},
created() {},
methods: {
// testEaPost() {
// let postData = {
// appCode: '0603',
// condType: 1,
// condValue: '138069094',
// };
// ApiEaPost(postData).then(res => {
// console.log(res);
// });
// },
testEaPost() {
let postData = {
appCode: '0606',
crmActionDate: '2019-12-12'
};
ApiEaPost(postData).then(res => {
// console.log(res);
});
},
// testEaPost() {
// let postData = {
// appCode: '0608',
// content: 'text',
// phone: '18801342762',
// };
// ApiEaPost(postData).then(res => {
// // console.log(res);
// });
// },
buttonSingleMarketingClick() {
// this.$router.push("");
},
buttonMainMarketingClick() {
this.$router.push("MainSale");
}
}
};
</script> </script>
<style scoped> <style scoped>
.main { .main {
background-color: white; background-color: white;
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: start; justify-content: start;
} }
.tops {
border: 2px solid lightblue; .tops {
width: 100%; border: 2px solid lightblue;
height: 100px; width: 100%;
} height: 100px;
.contents { }
/* border: 2px solid lightpink; */
width: 100%; .contents {
height: 100%; /* border: 2px solid lightpink; */
padding: 16px; width: 100%;
padding-bottom: 40px; height: 100%;
} padding: 16px;
.content { padding-bottom: 40px;
border: 0px solid orange; }
height: 100px;
width: 100%; .content {
padding: 4px 0px; border: 0px solid orange;
margin-bottom: 16px; height: 100px;
width: 100%;
border-radius: 4px; padding: 4px 0px;
box-shadow: 0px 2px 4px 0px rgb(187, 187, 187); margin-bottom: 16px;
display: flex; border-radius: 4px;
flex-direction: row; box-shadow: 0px 2px 4px 0px rgb(187, 187, 187);
justify-content: start;
} display: flex;
.content-imgs { flex-direction: row;
/* border: 1px solid pink; */ justify-content: start;
width: 20%; }
height: 100%;
.content-imgs {
display: flex; /* border: 1px solid pink; */
flex-direction: column; width: 20%;
justify-content: start; height: 100%;
align-items: center;
} display: flex;
.imgs-img { flex-direction: column;
width: 50px; justify-content: start;
height: 50px; align-items: center;
margin-top: 10px; }
border-radius: 50%;
object-fit: cover; .imgs-img {
} width: 50px;
.content-infos { height: 50px;
/* border: 1px solid orange; */ margin-top: 10px;
width: 80%; border-radius: 50%;
height: 100%; object-fit: cover;
} }
.infos-mains {
height: 70%; .content-infos {
width: 100%; /* border: 1px solid orange; */
/* border: 1px solid green; */ width: 80%;
height: 100%;
display: flex; }
flex-direction: row;
justify-content: start; .infos-mains {
} height: 70%;
.mains { width: 100%;
/* border: 1px solid red; */ /* border: 1px solid green; */
width: 70%;
height: 100%; display: flex;
flex-direction: row;
display: flex; justify-content: start;
flex-direction: column; }
justify-content: flex-start;
} .mains {
.main-usedPercent { /* border: 1px solid red; */
font-size: 14px; width: 70%;
color: grey; height: 100%;
}
.main-money { display: flex;
/* border: 1px solid lightgreen; */ flex-direction: column;
font-size: 24px; justify-content: flex-start;
} }
.buttons {
/* border: 1px solid darkorange; */ .main-usedPercent {
/* background-color: bisque; */ font-size: 14px;
width: 30%; color: grey;
height: 100%; }
display: flex; .main-money {
flex-direction: column; /* border: 1px solid lightgreen; */
justify-content: center; font-size: 24px;
align-items: center; }
}
.buttons {
.button-send { /* border: 1px solid darkorange; */
border: 0px solid blue; /* background-color: bisque; */
height: 40px; width: 30%;
width: 60px; height: 100%;
border-radius: 4px;
background-color: rgba(68, 93, 251, 1); display: flex;
color: white; flex-direction: column;
justify-content: center;
font-size: 16px; align-items: center;
} }
.infos-tips { .button-send {
height: 30%; border: 0px solid blue;
width: 100%; height: 40px;
/* border: 1px solid red; */ width: 60px;
border-top: 1px dashed gray; border-radius: 4px;
padding-top: 6px; background-color: rgba(68, 93, 251, 1);
color: white;
display: flex;
flex-direction: row; font-size: 16px;
justify-content: start; }
align-items: center;
} .infos-tips {
height: 30%;
.tip-shareMan { width: 100%;
/* border: 1px solid orange; */ /* border: 1px solid red; */
width: 70%; border-top: 1px dashed gray;
height: 100%; padding-top: 6px;
font-size: 14px; display: flex;
line-height: 16px; flex-direction: row;
color: rgb(150, 150, 150); justify-content: start;
} align-items: center;
.tip-commision { }
/* border: 1px solid green; */
width: 30%; .tip-shareMan {
height: 100%; /* border: 1px solid orange; */
width: 70%;
font-size: 14px; height: 100%;
line-height: 16px;
color: rgb(150, 150, 150); font-size: 14px;
} line-height: 16px;
color: rgb(150, 150, 150);
.menus { }
border-top: 1px solid rgb(194, 194, 194);
.tip-commision {
position: fixed; /* border: 1px solid green; */
bottom: 0px; width: 30%;
left: 0px; height: 100%;
width: 100%;
height: 50px; font-size: 14px;
background-color: white; line-height: 16px;
color: rgb(150, 150, 150);
display: flex; }
flex-direction: row;
justify-content: start; .menus {
align-items: center; border-top: 1px solid rgb(194, 194, 194);
}
.menu { position: fixed;
/* border: 1px solid red; */ bottom: 0px;
height: 50px; left: 0px;
/* width: 120px; */ width: 100%;
width: 50%; height: 50px;
line-height: 50px; background-color: white;
text-align: center;
font-size: 14px; display: flex;
color: black; flex-direction: row;
} justify-content: start;
.activeMenu { align-items: center;
color: lightcoral; }
}
.menu {
/* border: 1px solid red; */
height: 50px;
/* width: 120px; */
width: 50%;
line-height: 50px;
text-align: center;
font-size: 14px;
color: black;
}
.activeMenu {
color: lightcoral;
}
.zListActive {
/*border: 1px solid limegreen;*/
width: 100%;
height: auto;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
}
.zListActive > .inputs {
/*border: 1px solid dodgerblue;*/
width: 100%;
height: auto;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.zListActive > .inputs > .input {
/*border-bottom: 2px solid red;*/
border-color: dodgerblue;
border-radius: 4px;
width: 70%;
height: 40px;
font-size: 16px;
}
.zListActive > .inputs > .button {
border: 1px solid dodgerblue;
border-radius: 4px;
width: 40%;
height: 40px;
font-size: 14px;
line-height: 36px;
text-align: center;
}
.zListActive > .lists {
/*border: 1px solid red;*/
width: 100%;
height: auto;
margin-top: 8px;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
}
.zListActive > .lists > .item {
border: 1px solid red;
width: 100%;
height: 100px;
margin-bottom: 16px;
padding: 4px 4px;
border-radius: 4px;
box-shadow: 0px 2px 4px 0px rgb(187, 187, 187);
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: flex-start;
font-size: 14px;
text-wrap: none;
}
.zListActive > .lists > .voucherUrl {
border: 1px solid orange;
width: 100%;
height: 100px;
margin-bottom: 16px;
padding: 4px 4px;
border-radius: 4px;
box-shadow: 0px 2px 4px 0px rgb(187, 187, 187);
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: flex-start;
font-size: 14px;
text-wrap: none;
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment