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
})
}
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<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">
...@@ -24,6 +24,32 @@ ...@@ -24,6 +24,32 @@
</div> </div>
</div> </div>
</div> </div>
<div class="zListActive">
<div class="inputs">
<!--<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 class="menus"> <div class="menus">
<div class="menu" @click="buttonMainMarketingClick">精准营销</div> <div class="menu" @click="buttonMainMarketingClick">精准营销</div>
...@@ -33,15 +59,30 @@ ...@@ -33,15 +59,30 @@
</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);
import * as APISidebarEA from "@/api/sidebar/ea";
import Vue from 'vue';
import {Field} from 'vant';
Vue.use(Field);
export default {
export default {
name: "discountIndex", name: "discountIndex",
data() { data() {
return { return {
zcache: {
storeId: 1,
},
zlist: {
voucher: [],
voucherUrl: ''
},
test: { test: {
list: { list: {
main: [ main: [
{ {
...@@ -58,28 +99,73 @@ export default { ...@@ -58,28 +99,73 @@ export default {
shareMan: "Bob", shareMan: "Bob",
commision: "22" commision: "22"
}, },
{ // {
imgUrl: "/mainSale/test-city.png", // imgUrl: "/mainSale/test-city.png",
usedPercent: "30", // usedPercent: "30",
money: "300", // money: "300",
shareMan: "Clid", // shareMan: "Clid",
commision: "33" // commision: "33"
}, // },
{ // {
imgUrl: "/mainSale/test-city.png", // imgUrl: "/mainSale/test-city.png",
usedPercent: "40", // usedPercent: "40",
money: "400", // money: "400",
shareMan: "Doke", // shareMan: "Doke",
commision: "44" // commision: "44"
} // }
] ]
} }
}, },
dis: {} dis: {}
}; };
}, },
created() {}, created() {
this.zReadyGetVoucherList()
},
methods: { 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() {
this.zlist.voucher = []
},
zVoucherUrlSet(inData) {
this.zlist.voucherUrl = String(inData)
},
zVoucherUrlDel() {
this.zlist.voucherUrl = ''
},
// testEaPost() { // testEaPost() {
// let postData = { // let postData = {
// appCode: '0603', // appCode: '0603',
...@@ -91,12 +177,22 @@ export default { ...@@ -91,12 +177,22 @@ export default {
// }); // });
// }, // },
// testEaPost() {
// let postData = {
// appCode: '0606',
// crmActionDate: '2019-12-12'
// };
// ApiEaPost(postData).then(res => {
// // console.log(res);
// });
// },
testEaPost() { testEaPost() {
let postData = { let postData = {
appCode: '0606', appCode: '0696',
crmActionDate: '2019-12-12' mdid: 1
}; };
ApiEaPost(postData).then(res => { ApiEaActiveList(postData).then(res => {
// console.log(res); // console.log(res);
}); });
}, },
...@@ -119,11 +215,11 @@ export default { ...@@ -119,11 +215,11 @@ export default {
this.$router.push("MainSale"); 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%;
...@@ -131,20 +227,23 @@ export default { ...@@ -131,20 +227,23 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: start; justify-content: start;
} }
.tops {
.tops {
border: 2px solid lightblue; border: 2px solid lightblue;
width: 100%; width: 100%;
height: 100px; height: 100px;
} }
.contents {
.contents {
/* border: 2px solid lightpink; */ /* border: 2px solid lightpink; */
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 16px; padding: 16px;
padding-bottom: 40px; padding-bottom: 40px;
} }
.content {
.content {
border: 0px solid orange; border: 0px solid orange;
height: 100px; height: 100px;
width: 100%; width: 100%;
...@@ -157,8 +256,9 @@ export default { ...@@ -157,8 +256,9 @@ export default {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: start; justify-content: start;
} }
.content-imgs {
.content-imgs {
/* border: 1px solid pink; */ /* border: 1px solid pink; */
width: 20%; width: 20%;
height: 100%; height: 100%;
...@@ -167,20 +267,23 @@ export default { ...@@ -167,20 +267,23 @@ export default {
flex-direction: column; flex-direction: column;
justify-content: start; justify-content: start;
align-items: center; align-items: center;
} }
.imgs-img {
.imgs-img {
width: 50px; width: 50px;
height: 50px; height: 50px;
margin-top: 10px; margin-top: 10px;
border-radius: 50%; border-radius: 50%;
object-fit: cover; object-fit: cover;
} }
.content-infos {
.content-infos {
/* border: 1px solid orange; */ /* border: 1px solid orange; */
width: 80%; width: 80%;
height: 100%; height: 100%;
} }
.infos-mains {
.infos-mains {
height: 70%; height: 70%;
width: 100%; width: 100%;
/* border: 1px solid green; */ /* border: 1px solid green; */
...@@ -188,8 +291,9 @@ export default { ...@@ -188,8 +291,9 @@ export default {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: start; justify-content: start;
} }
.mains {
.mains {
/* border: 1px solid red; */ /* border: 1px solid red; */
width: 70%; width: 70%;
height: 100%; height: 100%;
...@@ -197,16 +301,19 @@ export default { ...@@ -197,16 +301,19 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-start; justify-content: flex-start;
} }
.main-usedPercent {
.main-usedPercent {
font-size: 14px; font-size: 14px;
color: grey; color: grey;
} }
.main-money {
.main-money {
/* border: 1px solid lightgreen; */ /* border: 1px solid lightgreen; */
font-size: 24px; font-size: 24px;
} }
.buttons {
.buttons {
/* border: 1px solid darkorange; */ /* border: 1px solid darkorange; */
/* background-color: bisque; */ /* background-color: bisque; */
width: 30%; width: 30%;
...@@ -216,9 +323,9 @@ export default { ...@@ -216,9 +323,9 @@ export default {
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.button-send { .button-send {
border: 0px solid blue; border: 0px solid blue;
height: 40px; height: 40px;
width: 60px; width: 60px;
...@@ -227,9 +334,9 @@ export default { ...@@ -227,9 +334,9 @@ export default {
color: white; color: white;
font-size: 16px; font-size: 16px;
} }
.infos-tips { .infos-tips {
height: 30%; height: 30%;
width: 100%; width: 100%;
/* border: 1px solid red; */ /* border: 1px solid red; */
...@@ -240,9 +347,9 @@ export default { ...@@ -240,9 +347,9 @@ export default {
flex-direction: row; flex-direction: row;
justify-content: start; justify-content: start;
align-items: center; align-items: center;
} }
.tip-shareMan { .tip-shareMan {
/* border: 1px solid orange; */ /* border: 1px solid orange; */
width: 70%; width: 70%;
height: 100%; height: 100%;
...@@ -250,8 +357,9 @@ export default { ...@@ -250,8 +357,9 @@ export default {
font-size: 14px; font-size: 14px;
line-height: 16px; line-height: 16px;
color: rgb(150, 150, 150); color: rgb(150, 150, 150);
} }
.tip-commision {
.tip-commision {
/* border: 1px solid green; */ /* border: 1px solid green; */
width: 30%; width: 30%;
height: 100%; height: 100%;
...@@ -259,9 +367,9 @@ export default { ...@@ -259,9 +367,9 @@ export default {
font-size: 14px; font-size: 14px;
line-height: 16px; line-height: 16px;
color: rgb(150, 150, 150); color: rgb(150, 150, 150);
} }
.menus { .menus {
border-top: 1px solid rgb(194, 194, 194); border-top: 1px solid rgb(194, 194, 194);
position: fixed; position: fixed;
...@@ -275,8 +383,9 @@ export default { ...@@ -275,8 +383,9 @@ export default {
flex-direction: row; flex-direction: row;
justify-content: start; justify-content: start;
align-items: center; align-items: center;
} }
.menu {
.menu {
/* border: 1px solid red; */ /* border: 1px solid red; */
height: 50px; height: 50px;
/* width: 120px; */ /* width: 120px; */
...@@ -285,8 +394,96 @@ export default { ...@@ -285,8 +394,96 @@ export default {
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
color: black; color: black;
} }
.activeMenu {
.activeMenu {
color: lightcoral; 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