Commit f184fd44 by 无尘

add: 增加链接工具 h5 分享开关

parent 47016b98
......@@ -201,8 +201,16 @@ components: {
</div>
</div>
<div class="h5link-row">
<label class="h5link-title">时间戳开关</label>
<el-switch v-model="h5linkObj.timeSwitch" @change="timeSwitch($event,h5linkObj.timeSwitch)"></el-switch>
<label class="h5link-title">分享开关</label>
<el-switch v-model="h5linkObj.share" @change="shareSwitch($event,h5linkObj.share)"></el-switch>
</div>
<div class="h5link-row">
<label class="h5link-title">分享页面</label>
<el-radio v-model="h5linkObj.shareWebType" label="0">当前页</el-radio>
</div>
<div class="h5link-row">
<label class="h5link-title"> </label>
<el-radio class="p-l-7" v-model="h5linkObj.shareWebType" label="1">其他链接网址</el-radio><el-input class="p-l-47" v-model="h5linkObj.shareUrl" placeholder="请输入网址"></el-input>
</div>
</div>
......@@ -450,7 +458,9 @@ export default {
name: '',
url: '',
fixParam: '',
timeSwitch: false, // 默认false->0: 关闭; true->1: 开启
share: false, // 分享开关默认false->0: 关闭; true->1: 开启
shareWebType: '0', // 0:当前展示的页面, 1:分享出去的页面
shareUrl: '', // 分享的页面链接
dynamicPara:'',
dynamicParaOptions: [ // 2018.6.12 动态参数目前让写页面
{
......@@ -604,7 +614,7 @@ export default {
name: '',
url: '',
params: '',
timeSwitch: 0
share: 0
},
// 获取 location origin
baseUrl: '',
......@@ -614,7 +624,6 @@ export default {
beforeMount() {
var that = this
var host = window.location.origin;
console.log("当前host:",host)
if (host.indexOf('localhost') != '-1') {
that.baseUrl = 'http://gicdev.demogic.com';
}else {
......@@ -626,10 +635,7 @@ export default {
// 选择类型改变 (一级选择,保存选择类型)
linksTypeChange: function(e) {
var that = this
console.log("选择的链接Id:"+e)
var selectOneItem = '';
that.linksTypeOptions.forEach(function(ele,inde){
if (ele.linkId == e) {
selectOneItem = ele
......@@ -637,8 +643,7 @@ export default {
})
// 保存选择的类型
that.oneLevelTypeValue = selectOneItem.type;
console.log("that.oneLevelTypeValue:",that.oneLevelTypeValue)
console.log("一级选择的类型:",selectOneItem)
// 判断出现下拉内容/h5部分
// 每次修改选择类型,清空已选择的值
......@@ -672,7 +677,6 @@ export default {
if (type) {
// 设置选择的 id
that.selectLinkObj.id = selectOneItem.linkId;
console.log("一级选择obj:",selectOneItem,that.selectLinkObj)
if (selectOneItem.type ==5 ) {
that.h5linkVisible = true; // h5 链接参数输入部分显示
that.thirdlinkVisible = false; // 第三方小程序
......@@ -698,15 +702,12 @@ export default {
// 如果是自定义
if (selectOneItem.type == 6) {
console.log("自定义:",selectOneItem)
that.selectLinkObj.id = selectOneItem.linkId;
// that.selectLinkObj.name = selectOneItem.label;
that.selectLinkObj.url = selectOneItem.content;
that.getDefinePage();
console.log(that.selectLinkObj)
return false;
} else if (selectOneItem.type == 7){
console.log('第三方小程序第三方小程序第三方小程序第三方小程序')
that.h5linkVisible = false; // h5 链接参数输入部分显示
that.thirdlinkVisible = true; // 第三方小程序
that.threeLevelVisible = false; // 三级部分隐藏
......@@ -714,7 +715,6 @@ export default {
}
// 清空设置选择的 id
that.selectLinkObj.id = '';
console.log("一级选择obj:",that.selectLinkObj)
// 获取二级列表数据
that.getLinksList(selectOneItem.linkId,2)
......@@ -725,7 +725,6 @@ export default {
// twoLevelValueChange (二级选择,保存选择类型)
twoLevelValueChange(e) {
var that = this
console.log("二级选择值:",e)
// 清空已经选择
that.selectLinkObj.name = '';
that.selectLinkObj.url = '';
......@@ -742,7 +741,6 @@ export default {
that.selectLinkObj.params = {
pageId: e
}
console.log('二级选择是自定义:',that.twoLevelOptions,that.selectLinkObj)
return;
}
var selectTwoItem = '';
......@@ -751,13 +749,11 @@ export default {
selectTwoItem = ele;
}
})
console.log("二级选择的类型:",selectTwoItem)
// 每次选择清空原有选择参数
that.selectLinkObj.params = '';
// 设置选择的 id
that.selectLinkObj.id = e;
console.log("二级选择的 obj: ",that.selectLinkObj.id)
// 判断是否结束, 1:结束;
if (selectTwoItem.type == 1 || selectTwoItem.type == 4 || selectTwoItem.type == 6 || that.oneLevelTypeValue == 7) {
that.threeLevelVisible = false; // 三级部分隐藏
......@@ -769,12 +765,10 @@ export default {
that.selectLinkObj.url = '';
// 如果选择商品链接
if(selectTwoItem.type == 4){
that.getGoodsList(); // 获取商品列表
that.getGoodsCategory();// 获取商品品类
that.getGoodsClassify(); // 获取商品分类
that.threeLevelVisible = false; // 三级部分隐藏
that.goodsLinksVisible = true; // 商品链接列表部分显示
return false;
......@@ -782,12 +776,10 @@ export default {
that.twoLevelOptions.forEach(function(ele,index){
if (e== ele.value) {
console.log(ele);
that.selectLinkObj.name = ele.label;
that.selectLinkObj.url = ele.content;
}
})
console.log("二级结束选择的链接:",that.selectLinkObj);
}else {
// 判断三级中下拉/下拉树形/搜索下拉
that.goodsLinksVisible = false; // 商品列表隐藏
......@@ -832,7 +824,6 @@ export default {
// 设置链接 门店签到
that.selectLinkObj.name = selectTwoItem.name;
that.selectLinkObj.url = selectTwoItem.content;
console.log("二级结束选择的链接:",that.selectLinkObj);
break;
case 3: // 树形结构
that.threeLevelValue = null;
......@@ -856,7 +847,6 @@ export default {
}
that.axios.post(that.baseUrl+'/api-mall/list_mall_goods_category',qs.stringify(para))
.then((res) => {
console.log(res,res.data,res.data.errorCode)
var resData = res.data;
var onelevelCategory = '';
if (resData.errorCode == 0) {
......@@ -868,7 +858,6 @@ export default {
resData.result.splice(index,1);
}
})
console.log("resdata: ",resData)
var list = resData.result, lists = resData.result;
list.forEach(function(ele,index) {
......@@ -879,7 +868,6 @@ export default {
lists.forEach(function(el,ind) {
el.key = el.mallCategoryId;
if(el.parentId == ele.mallCategoryId ){
console.log(index,ind)
ele.subOptions = []
ele.subOptions.push(el)
list.splice(ind,1)
......@@ -887,7 +875,6 @@ export default {
})
})
console.log("list:",list,onelevelCategory)
list.forEach(function(ele,index){
onelevelCategory.subOptions.push(ele)
......@@ -922,7 +909,6 @@ export default {
}
that.axios.post(that.baseUrl+'/api-mall/list_mall_goods_tag_tree',qs.stringify(para))
.then((res) => {
console.log(res,res.data,res.data.errorCode)
var resData = res.data
if (resData.errorCode == 0) {
var list = [resData.result],lists = resData.result;
......@@ -960,9 +946,7 @@ export default {
that.goodsCategoryOptions = list;
that.classifyOptions = list;
// that.classifyOptions = list;
console.log("list:",list,that.goodsCategoryOptions)
// console.log(that.goodsCategoryOptions)
return;
}
......@@ -993,21 +977,18 @@ export default {
})
}
// console.log(childTagList)
return childTagList;
},
// threeLevelValueChange
threeLevelValueChange(e) {
var that = this
console.log(e,that.threeLevelValue)
},
// threeSingleValueChange
threeSingleValueChange(e) {
var that = this
console.log(e,that.threeLevelValue)
var selThreeItem = '';
that.threeLevelOptions.forEach(function(ele,index){
if (e==ele.linkId) {
......@@ -1033,7 +1014,6 @@ export default {
}
that.axios.post(that.baseUrl+'/api-admin/list-page',qs.stringify(para))
.then((res) => {
console.log(res,res.data,res.data.errorCode)
var resData = res.data
if (resData.errorCode == 0) {
resData.result.result.forEach(function(ele,index){
......@@ -1041,7 +1021,6 @@ export default {
ele.label = ele.title;
ele.value = ele.pageId
})
console.log("自定义列表:", resData.result.result)
that.twoLevelOptions = resData.result.result
return;
}
......@@ -1102,7 +1081,6 @@ export default {
// 商品链接部分 categorySelect
categorySelect(node, id) {
var that = this
console.log(node, id, that.category)
that.category = node.key
// 重新获取商品列表
// that.getGoodsList();
......@@ -1115,7 +1093,6 @@ export default {
},
beforeClearCategory(node,id) {
var that = this
console.log(node, id)
that.category = null;
// 重新获取商品列表
// that.getGoodsList();
......@@ -1153,7 +1130,6 @@ export default {
}
that.axios.post(that.baseUrl+'/api-mall/list_mall_goods_category',qs.stringify(para))
.then((res) => {
console.log(res,res.data,res.data.errorCode)
var resData = res.data
if (resData.errorCode == 0) {
resData.result.forEach(function(ele,index){
......@@ -1186,7 +1162,6 @@ export default {
// classifySelect 分类
classifySelect(node, id) {
var that = this
console.log(node, id,that.classify)
that.classify = node.key
// 重新获取商品列表
// that.getGoodsList();
......@@ -1228,7 +1203,6 @@ export default {
.then(_ => {
done();
that.mylinkToolsVisible = false;
console.log(this.mylinkToolsVisible)
that.$emit('linkSelect')
})
.catch(_ => {
......@@ -1239,7 +1213,6 @@ export default {
// 分页
linkSizeChange(val) {
var that = this
console.log(`每页 ${val} 条`,that.pageSize);
that.pageSize = val;
// 请求商品列表
that.getGoodsList();
......@@ -1248,7 +1221,6 @@ export default {
// 页码变化触发
linkCurrentChange(val) {
var that = this
console.log(`当前页: ${val}`,that.currentPage);
that.currentPage = val;
// 请求商品列表
that.getGoodsList();
......@@ -1257,7 +1229,6 @@ export default {
// 选择商品链接
selectGoodLinkItem(item){
var that = this
console.log(item)
that.selectGoodId = item.mallProId;
// 调用函数传递链接/名字
that.selectLinkItem(item)
......@@ -1266,7 +1237,6 @@ export default {
// 选择链接以后调用函数
selectLinkItem(item) {
var that = this
console.log(item)
that.selectLinkObj.name = item.proName;
that.selectLinkObj.url = item.url;
that.selectLinkObj.params = {"proId": item.mallProId};// 2018.6.28修改参数 proId
......@@ -1276,7 +1246,6 @@ export default {
// 搜索输入
toSearchInput: function(value) {
var that = this;
console.log("搜索////////:",that.searchGoods,value)
// 搜索重置当前页 为 1
if (that.currentPage == 1) {
......@@ -1289,7 +1258,6 @@ export default {
// 清空输入
clearInput: function(e) {
var that = this;
console.log(e,that.searchGoods);
// 搜索重置当前页 为 1
if (that.currentPage == 1) {
......@@ -1303,7 +1271,6 @@ export default {
// 获取商品列表
getGoodsList() {
var that = this
console.log("获取商品列表")
var para = {
pageNum : that.currentPage,
searchparams: that.searchGoods || '',
......@@ -1324,9 +1291,7 @@ export default {
var resData = res.data
if (resData.errorCode == 0) {
that.goodsList = resData.result.result
that.total = resData.result.totalCount
console.log(that.total)
return;
}
......@@ -1349,7 +1314,6 @@ export default {
// 搜索
remoteMethod(query) {
var that = this;
console.log("query:",query,that.threeLevelValue)
var that = this;
if (query !== '') {
// 获取搜索列表数据
......@@ -1360,8 +1324,8 @@ export default {
},
// h5 时间开关
timeSwitch(e,obj) {
// h5 分享开关
shareSwitch(e,obj) {
var that = this
console.log(e,obj)
},
......@@ -1385,7 +1349,6 @@ export default {
// 确认操作
confirmLinkSelect() {
var that = this
console.log("确定的类型:",that.oneLevelTypeValue)
// console.log(that.linksType,that.twoLevelValue,that.threeLevelValue,that.h5linkObj.conditionType)
// 如果选择 h5 判断选择的链接
if (that.oneLevelTypeValue == 5) {
......@@ -1396,6 +1359,13 @@ export default {
})
return;
}
if (!!that.h5linkObj.share && that.h5linkObj.shareWebType == 1 && !that.h5linkObj.shareUrl) {
that.$message.error({
duration: 1000,
message: "请填写分享链接"
})
return;
}
that.selectLinkObj.conditionType = that.h5linkObj.conditionType;
that.selectLinkObj.name = that.h5linkObj.name;
that.selectLinkObj.url = that.h5linkObj.url;// +'?'+that.h5linkObj.fixParam+'&'+that.h5linkObj.dynamicPara;
......@@ -1411,7 +1381,13 @@ export default {
that.selectLinkObj.params = h5DataList
}
that.selectLinkObj.timeSwitch = (that.h5linkObj.timeSwitch== true? 1:0)
that.selectLinkObj.share = (that.h5linkObj.share== true? 1:0)
if (!!that.h5linkObj.share) {
that.selectLinkObj.shareWebType = that.h5linkObj.shareWebType;
if (that.h5linkObj.shareWebType == 1) {
that.selectLinkObj.shareUrl = that.h5linkObj.shareUrl
}
}
console.log(that.selectLinkObj)
// that.selectLinkObj.fixParam = that.h5linkObj.fixParam;
// that.selectLinkObj.dynamicPara = that.h5linkObj.dynamicPara;
......@@ -1501,7 +1477,7 @@ export default {
checkTwoLevel(v) {
var that = this
console.log(that.threeLevelValue)
// console.log(that.threeLevelValue)
if (!that.threeLevelValue|| !that.threeLevelValue.length) {
that.$message.error({
duration: 1000,
......@@ -1561,6 +1537,9 @@ export default {
that.h5linkObj.url = '';
that.h5linkObj.fixParam = '';
that.h5linkObj.dynamicPara ='';
that.h5linkObj.share = false;
that.h5linkObj.shareWebType = '0'; // 0:当前展示的页面, 1:分享出去的页面
that.h5linkObj.shareUrl = ''; // 分享的页面链接
},
// 触发父组件方法,传递参数
......@@ -1617,7 +1596,6 @@ export default {
})
that.linksTypeOptions = result
console.log("获取一级类型: ",that.linksTypeOptions)
return;
}
// 设置二级
......@@ -1628,7 +1606,6 @@ export default {
ele.value = ele.linkId
})
that.twoLevelOptions = result
console.log("获取二级类型: ",that.twoLevelOptions)
return;
}
......@@ -1648,7 +1625,6 @@ export default {
that.threeLevelOptions = result
}
console.log("获取三级类型: ",that.threeLevelOptions)
return;
}
},
......@@ -1727,7 +1703,6 @@ export default {
// dynamicChange
dynamicChange(e) {
var that = this
console.log(e);
that.dynamicRow.selectKey = e
},
dynamicBlur(e) {
......@@ -1749,7 +1724,6 @@ export default {
that.dynamicList.push(JSON.parse(JSON.stringify(that.dynamicRow)))
var arrKeys = that.dynamicList.map(ite=>ite.key) // 返回对象中键值集合的数组
var arrValues = that.dynamicList.map(ite=>ite.value)
// console.log("所有name:",arrValues)
if (that.isRepeat(arrKeys) || that.isRepeat(arrValues)) {
that.dynamicList.splice(that.dynamicList.length-1,1)
// arrKeys.splice(that.dynamicList.length-1,1)
......@@ -1757,8 +1731,6 @@ export default {
duration: 1000,
message: "选项不能重复"
})
// console.log(that.dynamicList,arrKeys,arrValues)
return;
}
......@@ -1775,14 +1747,12 @@ export default {
// 删除参数
delDynamic(index) {
var that = this
console.log(index)
that.dynamicList.splice(index,1)
},
// 确认编辑
confirmDynamic(index,obj) {
var that = this
console.log(index,obj)
if (!obj.selectKey||!String(obj.inputValue).trim()) {
that.$message.error({
duration: 1000,
......@@ -1797,7 +1767,6 @@ export default {
copyList[index].value = obj.inputValue
var copyKeys = copyList.map(ite=>ite.key) // 返回对象中键值集合的数组
var copyValues = copyList.map(ite=>ite.value)
// console.log("所有name:",copyValues)
if (that.isRepeat(copyKeys) || that.isRepeat(copyValues)) {
copyList.splice(copyList.length-1,1)
// copyKeys.splice(copyList.length-1,1)
......@@ -1805,13 +1774,11 @@ export default {
duration: 1000,
message: "选项不能重复"
})
// console.log(copyList,copyKeys,copyValues)
return;
}
obj.key = obj.selectKey;
obj.value = obj.inputValue;
// console.log(that.dynamicList)
// return;
// 隐藏编辑部分
obj.editAble = false;
......@@ -1820,7 +1787,6 @@ export default {
// 取消编辑
cancleDynamic(index,obj) {
var that = this
console.log(index,obj)
// 恢复原值
obj.selectKey = obj.key
obj.inputValue = obj.value
......@@ -1832,7 +1798,6 @@ export default {
watch: {
linkToolsVisible(val) {
console.log(val)
this.mylinkToolsVisible = val; // 新增linkToolsVisible的watch,监听变更并同步到linkToolsVisible上
},
// isWx(val) {
......@@ -1845,7 +1810,6 @@ export default {
},
projectName: function(newData,oldData){
var that = this;
// console.log("新数据:",newData,oldData)
that.repProjectName = newData || 'gic-web';
},
},
......@@ -1872,6 +1836,14 @@ export default {
width:200px;
}
.p-l-7 {
padding-left: 7px;
}
.p-l-47 {
padding-left: 47px;
}
.el-tab-pane {
min-height: 200px;
}
......
......@@ -171,8 +171,16 @@
</div>
</div>
<div class="h5link-row">
<label class="h5link-title">时间戳开关</label>
<el-switch v-model="h5linkObj.timeSwitch" @change="timeSwitch($event,h5linkObj.timeSwitch)"></el-switch>
<label class="h5link-title">分享开关</label>
<el-switch v-model="h5linkObj.share" @change="shareSwitch($event,h5linkObj.share)"></el-switch>
</div>
<div class="h5link-row">
<label class="h5link-title">分享页面</label>
<el-radio v-model="h5linkObj.shareWebType" label="0">当前页</el-radio>
</div>
<div class="h5link-row">
<label class="h5link-title"> </label>
<el-radio class="p-l-7" v-model="h5linkObj.shareWebType" label="1">其他链接网址</el-radio><el-input class="p-l-47" v-model="h5linkObj.shareUrl" placeholder="请输入网址"></el-input>
</div>
</div>
......@@ -418,7 +426,9 @@ export default {
name: '',
url: '',
fixParam: '',
timeSwitch: false, // 默认false->0: 关闭; true->1: 开启
share: false, // 分享开关默认false->0: 关闭; true->1: 开启
shareWebType: '0', // 0:当前展示的页面, 1:分享出去的页面
shareUrl: '', // 分享的页面链接
dynamicPara:'',
dynamicParaOptions: [ // 2018.6.12 动态参数目前让写页面
{
......@@ -572,7 +582,7 @@ export default {
name: '',
url: '',
params: '',
timeSwitch: 0
share: 0
},
// 获取 location origin
baseUrl: '',
......@@ -594,10 +604,7 @@ export default {
// 选择类型改变 (一级选择,保存选择类型)
linksTypeChange: function(e) {
var that = this
console.log("选择的链接Id:"+e)
var selectOneItem = '';
that.linksTypeOptions.forEach(function(ele,inde){
if (ele.linkId == e) {
selectOneItem = ele
......@@ -640,7 +647,6 @@ export default {
if (type) {
// 设置选择的 id
that.selectLinkObj.id = selectOneItem.linkId;
console.log("一级选择obj:",that.selectLinkObj)
if (selectOneItem.type ==5 ) {
that.h5linkVisible = true; // h5 链接参数输入部分显示
that.thirdlinkVisible = false; // 第三方小程序
......@@ -661,15 +667,12 @@ export default {
// 如果是自定义
if (selectOneItem.type == 6) {
console.log("自定义:",selectOneItem)
that.selectLinkObj.id = selectOneItem.linkId;
// that.selectLinkObj.name = selectOneItem.label;
that.selectLinkObj.url = selectOneItem.content;
that.getDefinePage();
console.log(that.selectLinkObj)
return false;
} else if (selectOneItem.type == 7){
console.log('第三方小程序第三方小程序第三方小程序第三方小程序')
that.h5linkVisible = false; // h5 链接参数输入部分显示
that.thirdlinkVisible = true; // 第三方小程序
that.threeLevelVisible = false; // 三级部分隐藏
......@@ -678,7 +681,6 @@ export default {
// 清空设置选择的 id
that.selectLinkObj.id = '';
console.log("一级选择obj:",that.selectLinkObj)
// 获取二级列表数据
that.getLinksList(selectOneItem.linkId,2)
......@@ -689,7 +691,6 @@ export default {
// twoLevelValueChange (二级选择,保存选择类型)
twoLevelValueChange(e) {
var that = this
console.log("二级选择值:",e)
// 清空已经选择
that.selectLinkObj.name = '';
that.selectLinkObj.url = '';
......@@ -706,27 +707,22 @@ export default {
that.selectLinkObj.params = {
pageId: e
}
console.log('二级选择是自定义:',that.twoLevelOptions,that.selectLinkObj)
return;
}
console.log(that.oneLevelTypeValue)
var selectTwoItem = '';
that.twoLevelOptions.forEach(function(ele,index){
if (e == ele.linkId) {
selectTwoItem = ele;
}
})
console.log("二级选择的类型:",selectTwoItem)
// 每次选择清空原有选择参数
that.selectLinkObj.params = '';
// 设置选择的 id
that.selectLinkObj.id = e;
console.log("二级选择的 obj: ",selectTwoItem.type,that.selectLinkObj.id)
// 判断是否结束, 1:结束;
if (selectTwoItem.type == 1 || selectTwoItem.type == 4 || selectTwoItem.type == 6 || that.oneLevelTypeValue == 7 ) {
that.threeLevelVisible = false; // 三级部分隐藏
......@@ -753,7 +749,6 @@ export default {
that.selectLinkObj.url = ele.content;
}
})
console.log("二级结束选择的链接:",that.selectLinkObj);
}else {
// 判断三级中下拉/下拉树形/搜索下拉
that.goodsLinksVisible = false; // 商品列表隐藏
......@@ -798,7 +793,6 @@ export default {
// 设置链接 门店签到
that.selectLinkObj.name = selectTwoItem.name;
that.selectLinkObj.url = selectTwoItem.content;
console.log("二级结束选择的链接:",that.selectLinkObj);
break;
case 3: // 树形结构
that.threeLevelValue = null;
......@@ -822,7 +816,6 @@ export default {
}
that.axios.post(that.baseUrl+'/api-mall/list_mall_goods_category',qs.stringify(para))
.then((res) => {
console.log(res,res.data,res.data.errorCode)
var resData = res.data;
var onelevelCategory = '';
if (resData.errorCode == 0) {
......@@ -834,7 +827,6 @@ export default {
resData.result.splice(index,1);
}
})
console.log("resdata: ",resData)
var list = resData.result, lists = resData.result;
list.forEach(function(ele,index) {
......@@ -853,7 +845,6 @@ export default {
})
})
console.log("list:",list,onelevelCategory)
list.forEach(function(ele,index){
onelevelCategory.subOptions.push(ele)
......@@ -861,7 +852,6 @@ export default {
that.categoryOptions = [];
that.categoryOptions.push(onelevelCategory);
console.log("list:",that.categoryOptions)
return false;
}
......@@ -888,12 +878,9 @@ export default {
}
that.axios.post(that.baseUrl+'/api-mall/list_mall_goods_tag_tree',qs.stringify(para))
.then((res) => {
console.log(res,res.data,res.data.errorCode)
var resData = res.data
if (resData.errorCode == 0) {
var list = [resData.result],lists = resData.result;
// list.forEach(function(ele,index) {
// ele.subOptions = [];
// ele.name = ele.tagName;
......@@ -926,9 +913,6 @@ export default {
that.goodsCategoryOptions = list;
that.classifyOptions = list;
// that.classifyOptions = list;
console.log("list:",list,that.goodsCategoryOptions)
// console.log(that.goodsCategoryOptions)
return;
}
......@@ -959,21 +943,18 @@ export default {
})
}
// console.log(childTagList)
return childTagList;
},
// threeLevelValueChange
threeLevelValueChange(e) {
var that = this
console.log(e,that.threeLevelValue)
},
// threeSingleValueChange
threeSingleValueChange(e) {
var that = this
console.log(e,that.threeLevelValue)
var selThreeItem = '';
that.threeLevelOptions.forEach(function(ele,index){
if (e==ele.linkId) {
......@@ -999,7 +980,6 @@ export default {
}
that.axios.post(that.baseUrl+'/api-admin/list-page',qs.stringify(para))
.then((res) => {
console.log(res,res.data,res.data.errorCode)
var resData = res.data
if (resData.errorCode == 0) {
resData.result.result.forEach(function(ele,index){
......@@ -1007,7 +987,6 @@ export default {
ele.label = ele.title;
ele.value = ele.pageId
})
console.log("自定义列表:", resData.result.result)
that.twoLevelOptions = resData.result.result
return;
}
......@@ -1058,18 +1037,13 @@ export default {
})
});
},
// --------------------------------------------------
// -------------------------------------------
// 选择树形节点方法
// 商品链接部分 categorySelect
categorySelect(node, id) {
var that = this
console.log(node, id, that.category)
that.category = node.key
// 重新获取商品列表
if (that.currentPage == 1) {
......@@ -1081,7 +1055,6 @@ export default {
},
beforeClearCategory(node,id) {
var that = this
console.log(node, id)
that.category = null;
// 重新获取商品列表
if (that.currentPage == 1) {
......@@ -1094,10 +1067,6 @@ export default {
loadOptions({ action, parentNode, callback }) {
// Typically, do the AJAX stuff here.
// Once the server has responded,
// assign children options to the parent node & call the callback.
// We just use `setTimeout()` here to simulate an async operation
// instead of requesting a real API server for demo purpose.
var that = this
console.log(action,parentNode,callback)
if (action === "LOAD_CHILDREN_OPTIONS") {
......@@ -1118,7 +1087,7 @@ export default {
}
that.axios.post(that.baseUrl+'/api-mall/list_mall_goods_category',qs.stringify(para))
.then((res) => {
console.log("获取子节点数据",res,res.data,res.data.errorCode)
var resData = res.data
if (resData.errorCode == 0) {
resData.result.forEach(function(ele,index){
......@@ -1151,7 +1120,6 @@ export default {
// classifySelect 分类
classifySelect(node, id) {
var that = this
console.log(node, id,that.classify)
that.classify = node.key
// 重新获取商品列表
if (that.currentPage == 1) {
......@@ -1163,7 +1131,6 @@ export default {
},
beforeClearClassify(node, id) {
var that = this
console.log(node, id,that.classify)
that.classify = null;
// 重新获取商品列表
if (that.currentPage == 1) {
......@@ -1202,7 +1169,6 @@ export default {
// 分页
linkSizeChange(val) {
var that = this
console.log(`每页 ${val} 条`,that.pageSize);
that.pageSize = val;
// 请求商品列表
that.getGoodsList();
......@@ -1211,7 +1177,6 @@ export default {
// 页码变化触发
linkCurrentChange(val) {
var that = this
console.log(`当前页: ${val}`,that.currentPage);
that.currentPage = val;
// 请求商品列表
that.getGoodsList();
......@@ -1220,7 +1185,6 @@ export default {
// 选择商品链接
selectGoodLinkItem(item){
var that = this
console.log(item)
that.selectGoodId = item.mallProId;
// 调用函数传递链接/名字
that.selectLinkItem(item)
......@@ -1229,7 +1193,6 @@ export default {
// 选择链接以后调用函数
selectLinkItem(item) {
var that = this
console.log(item)
that.selectLinkObj.name = item.proName;
that.selectLinkObj.url = item.url;
that.selectLinkObj.params = {"proId": item.mallProId};// 2018.6.28修改参数 proId
......@@ -1239,9 +1202,7 @@ export default {
// 搜索输入
toSearchInput: function(value) {
var that = this;
console.log("搜索////////:",that.searchGoods,value)
// 搜索重置当前页 为 1
if (that.currentPage == 1) {
that.getGoodsList();
}else {
......@@ -1252,9 +1213,7 @@ export default {
// 清空输入
clearInput: function(e) {
var that = this;
console.log(e,that.searchGoods);
// 搜索重置当前页 为 1
if (that.currentPage == 1) {
that.getGoodsList();
}else {
......@@ -1266,7 +1225,6 @@ export default {
// 获取商品列表
getGoodsList() {
var that = this
console.log("获取商品列表")
var para = {
pageNum : that.currentPage,
searchparams: that.searchGoods || '',
......@@ -1276,20 +1234,13 @@ export default {
tagId: that.classify,// 分类
requestProject: that.repProjectName
};
// that.currentPage = 1;
// that.pageSize = 10;
// that.total = 50;
that.axios.post(that.baseUrl+'/api-mall/page-mall-goods',qs.stringify(para))
.then((res) => {
console.log(res,res.data,res.data.errorCode)
var resData = res.data
if (resData.errorCode == 0) {
that.goodsList = resData.result.result
that.total = resData.result.totalCount
console.log(that.total)
return;
}
......@@ -1312,7 +1263,6 @@ export default {
// 搜索
remoteMethod(query) {
var that = this;
console.log("query:",query,that.threeLevelValue)
var that = this;
if (query !== '') {
// 获取搜索列表数据
......@@ -1324,7 +1274,7 @@ export default {
},
// h5 时间开关
timeSwitch(e,obj) {
shareSwitch(e,obj) {
var that = this
console.log(e,obj)
},
......@@ -1338,7 +1288,6 @@ export default {
cancelButtonText: '取消',
type: ''
}).then(() => {
console.log("点击确认")
that.$emit('linkSelect')
}).catch(() => {
console.log("取消 取消关闭")
......@@ -1358,6 +1307,13 @@ export default {
})
return;
}
if (!!that.h5linkObj.share && that.h5linkObj.shareWebType == 1 && !that.h5linkObj.shareUrl) {
that.$message.error({
duration: 1000,
message: "请填写分享链接"
})
return;
}
that.selectLinkObj.conditionType = that.h5linkObj.conditionType;
that.selectLinkObj.name = that.h5linkObj.name;
that.selectLinkObj.url = that.h5linkObj.url;// +'?'+that.h5linkObj.fixParam+'&'+that.h5linkObj.dynamicPara;
......@@ -1373,7 +1329,13 @@ export default {
that.selectLinkObj.params = h5DataList
}
that.selectLinkObj.timeSwitch = (that.h5linkObj.timeSwitch== true? 1:0)
that.selectLinkObj.share = (that.h5linkObj.share== true? 1:0)
if (!!that.h5linkObj.share) {
that.selectLinkObj.shareWebType = that.h5linkObj.shareWebType;
if (that.h5linkObj.shareWebType == 1) {
that.selectLinkObj.shareUrl = that.h5linkObj.shareUrl
}
}
console.log(that.selectLinkObj)
// that.selectLinkObj.fixParam = that.h5linkObj.fixParam;
// that.selectLinkObj.dynamicPara = that.h5linkObj.dynamicPara;
......@@ -1523,6 +1485,9 @@ export default {
that.h5linkObj.url = '';
that.h5linkObj.fixParam = '';
that.h5linkObj.dynamicPara ='';
that.h5linkObj.share = false;
that.h5linkObj.shareWebType = '0'; // 0:当前展示的页面, 1:分享出去的页面
that.h5linkObj.shareUrl = ''; // 分享的页面链接
},
// 触发父组件方法,传递参数
......
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