Commit f7689983 by 无尘

feat: 增加首页接口联调

parent 56511040
<!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>分享有礼</title><link href=./static/css/app.f379e788bfee25347b6009ab27b9b9d0.css rel=stylesheet></head><body style="background-color: #f0f2f5;min-width: 1400px;"><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/elementUI/index.2.5.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.33.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.03.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-new.2.0.29.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-card.2.0.13.js></script><script src=//web-1251519181.file.myqcloud.com/components/people.2.0.38.js></script><script src=//web-1251519181.file.myqcloud.com/components/aside-menu.2.0.11.js></script><script src=//web-1251519181.file.myqcloud.com/components/area-ab.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.02.js></script><script src=//web-1251519181.file.myqcloud.com/components/selector.1.1.91.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.12.js></script><script type=text/javascript src=./static/js/manifest.d26932f69ca098bfbef4.js></script><script type=text/javascript src=./static/js/vendor.14f8172dd3290d7d86d8.js></script><script type=text/javascript src=./static/js/app.7665d7dd2caf97ae18b7.js></script></body></html> <!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>分享有礼</title><link href=./static/css/app.6a525b5ea1b3ab6803a1c8d0e4874f63.css rel=stylesheet></head><body style="background-color: #f0f2f5;min-width: 1400px;"><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/elementUI/index.2.5.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.33.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.03.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-new.2.0.29.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-card.2.0.13.js></script><script src=//web-1251519181.file.myqcloud.com/components/people.2.0.38.js></script><script src=//web-1251519181.file.myqcloud.com/components/aside-menu.2.0.11.js></script><script src=//web-1251519181.file.myqcloud.com/components/area-ab.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.02.js></script><script src=//web-1251519181.file.myqcloud.com/components/selector.1.1.91.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.12.js></script><script type=text/javascript src=./static/js/manifest.057d6b3c65746510d7d7.js></script><script type=text/javascript src=./static/js/vendor.14f8172dd3290d7d86d8.js></script><script type=text/javascript src=./static/js/app.fea04cb8f4b9cb9f749e.js></script></body></html>
\ No newline at end of file \ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,c,f){for(var a,i,u,d=0,s=[];d<r.length;d++)i=r[d],t[i]&&s.push(t[i][0]),t[i]=0;for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(e[a]=c[a]);for(n&&n(r,c,f);s.length;)s.shift()();if(f)for(d=0;d<f.length;d++)u=o(o.s=f[d]);return u};var r={},t={15:0};function o(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,o){n=t[e]=[r,o]});n[2]=r;var c=document.getElementsByTagName("head")[0],f=document.createElement("script");f.type="text/javascript",f.charset="utf-8",f.async=!0,f.timeout=12e4,o.nc&&f.setAttribute("nonce",o.nc),f.src=o.p+"static/js/"+e+"."+{0:"0e10d3a3345996000104",1:"5b546fa38466a0b05e37",2:"cf8319af6b87bb92f8f4",3:"73fc0c8ef283540f775a",4:"b1fce92cd9cf5ce634ec",5:"4426b0fcce1baf83ce11",6:"fda09ea240d5c03fd4f4",7:"b0fd74564cc799593b8f",8:"fe9ec49f63ecd8e527ba",9:"522a01ff8d619d2bf030",10:"e16b73d2d4b922255e52",11:"c11d02c33702d00b2e2e",12:"1a632fbab3e4cc65078b"}[e]+".js";var a=setTimeout(i,12e4);function i(){f.onerror=f.onload=null,clearTimeout(a);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return f.onerror=f.onload=i,c.appendChild(f),r},o.m=e,o.c=r,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="./",o.oe=function(e){throw console.error(e),e}}([]); !function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,c,a){for(var f,i,u,d=0,s=[];d<r.length;d++)i=r[d],t[i]&&s.push(t[i][0]),t[i]=0;for(f in c)Object.prototype.hasOwnProperty.call(c,f)&&(e[f]=c[f]);for(n&&n(r,c,a);s.length;)s.shift()();if(a)for(d=0;d<a.length;d++)u=o(o.s=a[d]);return u};var r={},t={15:0};function o(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,o){n=t[e]=[r,o]});n[2]=r;var c=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,o.nc&&a.setAttribute("nonce",o.nc),a.src=o.p+"static/js/"+e+"."+{0:"0e10d3a3345996000104",1:"5b546fa38466a0b05e37",2:"81fc82ef6015ae860bf4",3:"d0027d91a91c09086609",4:"b1fce92cd9cf5ce634ec",5:"4426b0fcce1baf83ce11",6:"fda09ea240d5c03fd4f4",7:"b0fd74564cc799593b8f",8:"fe9ec49f63ecd8e527ba",9:"522a01ff8d619d2bf030",10:"e16b73d2d4b922255e52",11:"c11d02c33702d00b2e2e",12:"1a632fbab3e4cc65078b"}[e]+".js";var f=setTimeout(i,12e4);function i(){a.onerror=a.onload=null,clearTimeout(f);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return a.onerror=a.onload=i,c.appendChild(a),r},o.m=e,o.c=r,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="./",o.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file \ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2019-11-18 10:37:02 * @Date: 2019-11-18 10:37:02
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2019-11-22 14:12:14 * @LastEditTime: 2019-11-26 15:20:38
--> -->
<!-- <!--
<base-config @submitNext="submitNext"></base-config> <base-config @submitNext="submitNext"></base-config>
...@@ -212,10 +212,10 @@ export default { ...@@ -212,10 +212,10 @@ export default {
* 获取基础信息 * 获取基础信息
* /sharing-core-web/get-activity-base-info * /sharing-core-web/get-activity-base-info
*/ */
getBaseData(acitivityId) { getBaseData() {
const that = this; const that = this;
let para = { let para = {
acitivityId: acitivityId || that.$route.query.acitivityId acitivityId: that.$route.query.acitivityId
}; };
getRequest('/sharing-core-web/get-activity-base-info', para) getRequest('/sharing-core-web/get-activity-base-info', para)
.then(res => { .then(res => {
...@@ -236,7 +236,10 @@ export default { ...@@ -236,7 +236,10 @@ export default {
}, },
mounted() { mounted() {
const that = this; const that = this;
if (that.$route.query.hasOwnProperty('acitivityId')) {
that.getBaseData(); that.getBaseData();
}
}, },
}; };
</script> </script>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2019-11-13 16:37:02 * @Date: 2019-11-13 16:37:02
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2019-11-26 15:08:28 * @LastEditTime: 2019-11-26 19:47:15
--> -->
<!-- <!--
<active-select></active-select> <active-select></active-select>
...@@ -305,7 +305,8 @@ export default { ...@@ -305,7 +305,8 @@ export default {
cardList: [], cardList: [],
cardValue: '', cardValue: '',
// 选择的路径 // 选择的路径
pathNames: [] pathNames: [],
pathIds: [],
}; };
}, },
methods: { methods: {
...@@ -325,6 +326,8 @@ export default { ...@@ -325,6 +326,8 @@ export default {
// 二级选择变化,三级变化 // 二级选择变化,三级变化
that.secondGoal = {}; that.secondGoal = {};
that.thirdData = []; that.thirdData = [];
that.pathNames = [];
that.pathIds = [];
}, },
/** /**
* 选择二级 * 选择二级
...@@ -341,6 +344,7 @@ export default { ...@@ -341,6 +344,7 @@ export default {
const that = this; const that = this;
let para = { goalId: goalId }; let para = { goalId: goalId };
that.pathNames = []; // 先清空,再赋值 that.pathNames = []; // 先清空,再赋值
that.pathIds = [];
getRequest('/sharing-core-web/list-activity-dict-trans', para) getRequest('/sharing-core-web/list-activity-dict-trans', para)
.then(res => { .then(res => {
let resData = res.data; let resData = res.data;
...@@ -351,6 +355,7 @@ export default { ...@@ -351,6 +355,7 @@ export default {
if (ele.mustFlag) { if (ele.mustFlag) {
ele.check = true; ele.check = true;
that.pathNames.push(ele.transName); that.pathNames.push(ele.transName);
that.pathIds.push(ele.transId);
that.getText(ele.transId) that.getText(ele.transId)
} }
}); });
...@@ -371,11 +376,73 @@ export default { ...@@ -371,11 +376,73 @@ export default {
* 选择三级 * 选择三级
*/ */
selectThird(item) { selectThird(item) {
// const that = this; const that = this;
if (item.mustFlag) { if (item.mustFlag) {
return false; return false;
} }
item.check = item.check ? false : true; item.check = item.check ? false : true;
that.pathIds = [];
that.thirdData.forEach(ele => {
if (ele.check && ele.display) {
that.pathIds.push(ele.transId); // 暂时预留,为了防止以后数据顺序变化,可以使用这个进行下面的内部判断
}
})
that.thirdData.forEach(ele => {
if (item.check&&!!ele.mustCondition && ele.mustCondition.includes(item.transId)) {
ele.mustFlag = 1;
ele.check = true;
ele.display = 1;
}
// console.log('----->:',that.pathIds,':<-----')
if (!item.check&&!!ele.mustCondition && ele.mustCondition.includes(item.transId) &&(!that.thirdData[0].check&&!that.thirdData[1].check)) {
ele.mustFlag = 0;
ele.check = false;
ele.display = 0;
}
// 可选一
if (item.check&&!!ele.showCondition && ele.showCondition.includes(item.transId)) {
ele.display = 1;
}
if (!item.check&&!!ele.showCondition && ele.showCondition.includes(item.transId) &&!ele.selectedConditions) {
ele.display = 0;
}
// 取消
if (!item.check&&!!ele.canceCondition && ele.canceCondition.includes(item.transId)) {
ele.check = false;
}
// 8选择 4必选,如果1,2不选中不显示
if (item.check&&((!!ele.showCondition&& that.thirdData[0].check) || (!!ele.showCondition && that.thirdData[1].check) )&&!!ele.selectedConditions && ele.selectedConditions.includes(item.transId)) {
ele.display = 1;
ele.check = true;
}
if (item.check&&((!!ele.showCondition&& !that.thirdData[0].check&& !that.thirdData[1].check) )&&!!ele.selectedConditions && ele.selectedConditions.includes(item.transId)) {
ele.display = 0;
ele.check = true;
}
if (!item.check&&((!!ele.showCondition&& !that.thirdData[0].check&& !that.thirdData[1].check) )&&!!ele.selectedConditions && ele.selectedConditions.includes(item.transId)) {
ele.display = 1;
ele.check = false;
}
})
that.getPathNameText();
},
/**
* 计算路径获取文案
*/
getPathNameText() {
const that = this;
let arr = [];
let transIds = 0;
that.pathIds = [];
that.thirdData.forEach(ele => {
if (ele.check && ele.display) {
transIds += ele.transId;
arr.push(ele.transName);
that.pathIds.push(ele.transId)
}
})
that.pathNames = arr;
that.getText(transIds)
}, },
/** /**
* 跳转卡片创建页 * 跳转卡片创建页
...@@ -397,7 +464,29 @@ export default { ...@@ -397,7 +464,29 @@ export default {
showMsg.showmsg('请先完善活动目的', 'warning'); showMsg.showmsg('请先完善活动目的', 'warning');
return false; return false;
} }
that.judgeCreate(); if ((that.pathNames.includes('访问活动营销页')&&!that.markingValue) || (that.pathNames.includes('游戏参与')&&!that.gameValue.length) || (that.pathNames.includes('卡券领取')&&!that.cardValue)) {
showMsg.showmsg('请先完善活动创建前准备工作', 'warning');
return false;
}
// 整理路径id和值
let pathArr = [];
that.thirdData.forEach(ele => {
if (ele.check&&ele.display) {
pathArr.push({
transId: ele.transId,
transName: ele.transName
})
}
})
let indexObj = {
firstGoal: that.firstGoal,
secondGoal: that.secondGoal,
pathArr: pathArr,
markingValue: that.markingValue,
gameValue: that.gameValue,
cardValue: that.cardValue
}
that.judgeCreate(indexObj);
}, },
/** /**
* 获取一级二级数据 * 获取一级二级数据
...@@ -514,13 +603,14 @@ export default { ...@@ -514,13 +603,14 @@ export default {
/** /**
* 是否可以创建活动 * 是否可以创建活动
*/ */
judgeCreate() { judgeCreate(indexObj) {
const that = this; const that = this;
let para = {}; let para = {};
getRequest('/sharing-core-web/can-create', para) getRequest('/sharing-core-web/can-create', para)
.then(res => { .then(res => {
let resData = res.data; let resData = res.data;
if (resData.errorCode == 1) { if (resData.errorCode == 1) {
that.$store.dispatch('saveIndexInfo', indexObj);
that.$router.push('/createActive'); that.$router.push('/createActive');
return false; return false;
} }
...@@ -578,6 +668,7 @@ export default { ...@@ -578,6 +668,7 @@ export default {
.li-cell { .li-cell {
position: relative; position: relative;
width: 427px; width: 427px;
min-width: 405px;
height: 131px; height: 131px;
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
border-radius: 4px; border-radius: 4px;
...@@ -676,6 +767,7 @@ export default { ...@@ -676,6 +767,7 @@ export default {
} }
/* 二级 */ /* 二级 */
&.li-second-cell { &.li-second-cell {
min-width: 417px;
height: 311px; height: 311px;
border: none; border: none;
.li-cell-inner { .li-cell-inner {
...@@ -755,6 +847,7 @@ export default { ...@@ -755,6 +847,7 @@ export default {
} }
&.li-third-cell { &.li-third-cell {
width: 208px; width: 208px;
min-width: 204px;
max-width: 208px; max-width: 208px;
height: 186px; height: 186px;
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2019-11-12 10:18:30 * @Date: 2019-11-12 10:18:30
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2019-11-18 17:16:49 * @LastEditTime: 2019-11-26 15:25:57
*/ */
import Vuex from 'vuex'; import Vuex from 'vuex';
import Vue from 'vue'; import Vue from 'vue';
...@@ -19,6 +19,7 @@ export default new Vuex.Store({ ...@@ -19,6 +19,7 @@ export default new Vuex.Store({
show: false, show: false,
tagRealName: '', tagRealName: '',
uniqueId: '', uniqueId: '',
activeInfo: {}, // 首页选择数据
baseInfo: {}, // 基础信息 baseInfo: {}, // 基础信息
centerInfo: {}, // 活动中心配置 centerInfo: {}, // 活动中心配置
cardInfo: {}, // 小程序卡片配置 cardInfo: {}, // 小程序卡片配置
...@@ -47,6 +48,9 @@ export default new Vuex.Store({ ...@@ -47,6 +48,9 @@ export default new Vuex.Store({
['changeUniqueId'](state, id) { ['changeUniqueId'](state, id) {
state.uniqueId = id || ''; state.uniqueId = id || '';
}, },
saveIndex: (state, data) => {
state.activeInfo = data;
},
saveBase: (state, data) => { saveBase: (state, data) => {
state.baseInfo = data; state.baseInfo = data;
}, },
...@@ -68,9 +72,15 @@ export default new Vuex.Store({ ...@@ -68,9 +72,15 @@ export default new Vuex.Store({
state.cardInfo = {}; state.cardInfo = {};
state.posterInfo = {}; state.posterInfo = {};
state.rewardInfo = {}; state.rewardInfo = {};
},
clearIndex: state => {
state.activeInfo = {};
} }
}, },
actions: { actions: {
saveIndexInfo(context, data) {
context.commit('saveIndex', data);
},
saveBaseInfo(context, data) { saveBaseInfo(context, data) {
context.commit('saveBase', data); context.commit('saveBase', data);
}, },
...@@ -88,6 +98,9 @@ export default new Vuex.Store({ ...@@ -88,6 +98,9 @@ export default new Vuex.Store({
}, },
clearActiveData(context, data) { clearActiveData(context, data) {
context.commit('clearData'); context.commit('clearData');
} },
clearIndexData(context, data) {
context.commit('clearIndex');
},
} }
}); });
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