Commit 1bd87c65 by member

fix: 修复商品链接分页问题

parent c38d6944
...@@ -63,7 +63,9 @@ export default { ...@@ -63,7 +63,9 @@ export default {
watch: { watch: {
treeVis(newval) { treeVis(newval) {
if (!newval) { if (!newval) {
this.$emit('pass-mall', this.mallData); if (this.mallData) {
this.$emit('pass-mall', this.mallData);
}
} }
} }
} }
......
...@@ -36,6 +36,7 @@ components: {linkId ...@@ -36,6 +36,7 @@ components: {linkId
title="链接小工具" title="链接小工具"
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="mylinkToolsVisible" :visible.sync="mylinkToolsVisible"
@close="changeVisible"
:modal-append-to-body="false"> :modal-append-to-body="false">
<!-- 链接类型 --> <!-- 链接类型 -->
<div class="links-types"> <div class="links-types">
...@@ -72,7 +73,7 @@ components: {linkId ...@@ -72,7 +73,7 @@ components: {linkId
<goods-tree v-if="goodsTreeVisible" @pass-mall="getMallId" :tree-data="treeData"></goods-tree> <goods-tree v-if="goodsTreeVisible" @pass-mall="getMallId" :tree-data="treeData"></goods-tree>
<!-- 商品分类链接 --> <!-- 商品分类链接 -->
<treeselect <!-- <treeselect
v-if="threeLevelTreeVisible" v-if="threeLevelTreeVisible"
v-model="threeLevelValue" v-model="threeLevelValue"
:options="goodsCategoryOptions" :options="goodsCategoryOptions"
...@@ -82,7 +83,7 @@ components: {linkId ...@@ -82,7 +83,7 @@ components: {linkId
noOptionsText="暂无数据" noOptionsText="暂无数据"
noResultsText="无数据" noResultsText="无数据"
@select="goodsCategorySelect" @select="goodsCategorySelect"
/> /> -->
<!-- 搜索后出现下列 --> <!-- 搜索后出现下列 -->
<el-select <el-select
v-if="threeLevelSearchVisible" v-if="threeLevelSearchVisible"
...@@ -308,9 +309,6 @@ components: {linkId ...@@ -308,9 +309,6 @@ components: {linkId
</table> </table>
</div> </div>
</div> --> </div> -->
</div> </div>
<!-- 商品链接 --> <!-- 商品链接 -->
...@@ -393,7 +391,7 @@ components: {linkId ...@@ -393,7 +391,7 @@ components: {linkId
</div> </div>
<!-- 底部按钮 --> <!-- 底部按钮 -->
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="cancelLinkSelect">取 消</el-button> <!-- <el-button @click="cancelLinkSelect">取 消</el-button> -->
<el-button type="primary" @click="confirmLinkSelect">确 定</el-button> <el-button type="primary" @click="confirmLinkSelect">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
...@@ -401,6 +399,7 @@ components: {linkId ...@@ -401,6 +399,7 @@ components: {linkId
</template> </template>
<script> <script>
// 使用树形插件 // 使用树形插件
// import the component // import the component
import Treeselect from '@riophae/vue-treeselect'; import Treeselect from '@riophae/vue-treeselect';
...@@ -412,8 +411,10 @@ import GoodsTree from './goods-tree'; ...@@ -412,8 +411,10 @@ import GoodsTree from './goods-tree';
import qs from 'qs'; import qs from 'qs';
export default { export default {
name: 'links', name: 'links-tool',
props: ['linkToolsVisible','showType','projectName'],
props: ['linkVisible','showType','projectName'],
data () { data () {
return { return {
treeData: [], treeData: [],
...@@ -569,7 +570,7 @@ export default { ...@@ -569,7 +570,7 @@ export default {
// --------------------------- // ---------------------------
// 父组件传递的 props // 父组件传递的 props
mylinkToolsVisible: this.linkToolsVisible, mylinkToolsVisible: false,
// 商品链接 // 商品链接
goodsLinksVisible: false, goodsLinksVisible: false,
...@@ -672,6 +673,13 @@ export default { ...@@ -672,6 +673,13 @@ export default {
} }
}, },
methods: { methods: {
changeVisible() {
if (!this.selectLinkObj.id) {
this.selectLinkObj = '';
}
this.transData();
this.$emit('update:linkVisible', false);
},
handlePaddGift(list) { handlePaddGift(list) {
// 拼接id // 拼接id
this.giftFlag = true; this.giftFlag = true;
...@@ -786,7 +794,7 @@ export default { ...@@ -786,7 +794,7 @@ export default {
// twoLevelValueChange (二级选择,保存选择类型) // twoLevelValueChange (二级选择,保存选择类型)
twoLevelValueChange(e) { twoLevelValueChange(e) {
if (e == 'product_category_link') { // 商品链接 if (e == 'product_category_link') { // 商品分类链接
this.middleGoodId = e; this.middleGoodId = e;
this.goodType = 10; this.goodType = 10;
this.threeLevelVisible = true; this.threeLevelVisible = true;
...@@ -807,6 +815,7 @@ export default { ...@@ -807,6 +815,7 @@ export default {
} }
var that = this var that = this
this.goodsLinksVisible = false;
this.visibleType = null; this.visibleType = null;
// 清空已经选择 // 清空已经选择
that.selectLinkObj.name = ''; that.selectLinkObj.name = '';
...@@ -849,7 +858,8 @@ export default { ...@@ -849,7 +858,8 @@ export default {
that.selectLinkObj.name = ''; that.selectLinkObj.name = '';
that.selectLinkObj.url = ''; that.selectLinkObj.url = '';
// 如果选择商品链接 // 如果选择商品链接
if(selectTwoItem.type == 4){ if(selectTwoItem.type == 4) {
this.currentPage = 1;
that.getGoodsList(); // 获取商品列表 that.getGoodsList(); // 获取商品列表
that.getGoodsCategory();// 获取商品品类 that.getGoodsCategory();// 获取商品品类
that.getGoodsClassify(); // 获取商品分类 that.getGoodsClassify(); // 获取商品分类
...@@ -1014,7 +1024,6 @@ export default { ...@@ -1014,7 +1024,6 @@ export default {
that.categoryOptions = []; that.categoryOptions = [];
that.categoryOptions.push(onelevelCategory); that.categoryOptions.push(onelevelCategory);
console.log("list:",that.categoryOptions)
return false; return false;
} }
...@@ -1024,7 +1033,6 @@ export default { ...@@ -1024,7 +1033,6 @@ export default {
}) })
}) })
.catch(function (error) { .catch(function (error) {
console.log(error);
// that.toLogin() // that.toLogin()
that.$message.error({ that.$message.error({
duration: 1000, duration: 1000,
...@@ -1078,7 +1086,6 @@ export default { ...@@ -1078,7 +1086,6 @@ export default {
that.goodsCategoryOptions = list; that.goodsCategoryOptions = list;
that.classifyOptions = list; that.classifyOptions = list;
// that.classifyOptions = list; // that.classifyOptions = list;
console.log("list:",list,that.goodsCategoryOptions)
return; return;
} }
...@@ -1368,10 +1375,9 @@ export default { ...@@ -1368,10 +1375,9 @@ export default {
// 页码变化触发 // 页码变化触发
linkCurrentChange(val) { linkCurrentChange(val) {
var that = this this.currentPage = val;
that.currentPage = val;
// 请求商品列表 // 请求商品列表
that.getGoodsList(); this.getGoodsList();
}, },
// 选择商品链接 // 选择商品链接
...@@ -1435,7 +1441,6 @@ export default { ...@@ -1435,7 +1441,6 @@ export default {
that.axios.post(that.baseUrl+'/api-mall/page-mall-goods',qs.stringify(para)) that.axios.post(that.baseUrl+'/api-mall/page-mall-goods',qs.stringify(para))
.then((res) => { .then((res) => {
console.log(res,res.data,res.data.errorCode)
var resData = res.data var resData = res.data
if (resData.errorCode == 0) { if (resData.errorCode == 0) {
that.goodsList = resData.result.result that.goodsList = resData.result.result
...@@ -1449,8 +1454,6 @@ export default { ...@@ -1449,8 +1454,6 @@ export default {
}) })
}) })
.catch(function (error) { .catch(function (error) {
console.log(error);
// that.toLogin()
that.$message.error({ that.$message.error({
duration: 1000, duration: 1000,
message: error.message message: error.message
...@@ -1479,25 +1482,22 @@ export default { ...@@ -1479,25 +1482,22 @@ export default {
}, },
// 取消操作 // // 取消操作
cancelLinkSelect() { // cancelLinkSelect() {
var that = this // var that = this
this.$confirm('确认关闭?', '', { // this.$confirm('确认关闭?', '', {
confirmButtonText: '确定', // confirmButtonText: '确定',
cancelButtonText: '取消', // cancelButtonText: '取消',
type: '' // type: ''
}).then(() => { // }).then(() => {
console.log("点击确认") // that.$emit('linkSelect')
that.$emit('linkSelect') // }).catch(() => {
}).catch(() => { // });
console.log("取消 取消关闭") // },
});
},
// 确认操作 // 确认操作
confirmLinkSelect() { confirmLinkSelect() {
var that = this var that = this
// console.log(that.linksType,that.twoLevelValue,that.threeLevelValue,that.h5linkObj.conditionType)
// 如果选择 h5 判断选择的链接 // 如果选择 h5 判断选择的链接
if (that.oneLevelTypeValue == 5) { if (that.oneLevelTypeValue == 5) {
if (!that.h5linkObj.name.trim() || !that.h5linkObj.url.trim()) { if (!that.h5linkObj.name.trim() || !that.h5linkObj.url.trim()) {
...@@ -1536,7 +1536,6 @@ export default { ...@@ -1536,7 +1536,6 @@ export default {
that.selectLinkObj.shareUrl = that.h5linkObj.shareUrl that.selectLinkObj.shareUrl = that.h5linkObj.shareUrl
} }
} }
console.log(that.selectLinkObj)
// that.selectLinkObj.fixParam = that.h5linkObj.fixParam; // that.selectLinkObj.fixParam = that.h5linkObj.fixParam;
// that.selectLinkObj.dynamicPara = that.h5linkObj.dynamicPara; // that.selectLinkObj.dynamicPara = that.h5linkObj.dynamicPara;
// 触发父组件方法,传递参数 // 触发父组件方法,传递参数
...@@ -1579,8 +1578,6 @@ export default { ...@@ -1579,8 +1578,6 @@ export default {
}) })
that.selectLinkObj.params = thirdDataList that.selectLinkObj.params = thirdDataList
} }
console.log(this.selectLinkObj);
// 触发父组件方法,传递参数 // 触发父组件方法,传递参数
that.transData(); that.transData();
return; return;
...@@ -1596,7 +1593,6 @@ export default { ...@@ -1596,7 +1593,6 @@ export default {
return; return;
} }
// 触发父组件方法,传递参数 // 触发父组件方法,传递参数
console.log(that.selectLinkObj)
that.transData(); that.transData();
return; return;
} }
...@@ -1695,6 +1691,7 @@ export default { ...@@ -1695,6 +1691,7 @@ export default {
} }
return false; return false;
} }
if (!!this.selectLinkObj.name && !!this.selectLinkObj.id) { if (!!this.selectLinkObj.name && !!this.selectLinkObj.id) {
// 触发父组件方法,传递参数 // 触发父组件方法,传递参数
this.transData(); this.transData();
...@@ -1714,7 +1711,6 @@ export default { ...@@ -1714,7 +1711,6 @@ export default {
checkTwoLevel(v) { checkTwoLevel(v) {
var that = this var that = this
// console.log(that.threeLevelValue)
if (!that.threeLevelValue|| !that.threeLevelValue.length) { if (!that.threeLevelValue|| !that.threeLevelValue.length) {
that.$message.error({ that.$message.error({
duration: 1000, duration: 1000,
...@@ -1785,9 +1781,8 @@ export default { ...@@ -1785,9 +1781,8 @@ export default {
// 触发父组件方法,传递参数 // 触发父组件方法,传递参数
transData() { transData() {
var that = this; this.$emit('linkSelect', this.selectLinkObj)
that.$emit('linkSelect', that.selectLinkObj) this.resetAll();
that.resetAll();
}, },
// 获取一级列表 // 获取一级列表
...@@ -1804,7 +1799,6 @@ export default { ...@@ -1804,7 +1799,6 @@ export default {
that.axios.post(that.baseUrl+'/api-plug/list-link-data',qs.stringify(para)) that.axios.post(that.baseUrl+'/api-plug/list-link-data',qs.stringify(para))
.then((res) => { .then((res) => {
console.log(res,res.data,res.data.errorCode)
var resData = res.data var resData = res.data
if (resData.errorCode == 0) { if (resData.errorCode == 0) {
that.setLevelListOptions(parentId,resData.result,num,twoType) that.setLevelListOptions(parentId,resData.result,num,twoType)
...@@ -1817,7 +1811,6 @@ export default { ...@@ -1817,7 +1811,6 @@ export default {
}) })
}) })
.catch(function (error) { .catch(function (error) {
console.log(error);
// that.toLogin() // that.toLogin()
that.$message.error({ that.$message.error({
duration: 1000, duration: 1000,
...@@ -1873,7 +1866,6 @@ export default { ...@@ -1873,7 +1866,6 @@ export default {
// 获取门店列表 // 获取门店列表
getStoreList(query,threeLevelValue) { getStoreList(query,threeLevelValue) {
var that = this var that = this
console.log(threeLevelValue.toString())
var para = { var para = {
searchParam: query, searchParam: query,
selectedIds: threeLevelValue.toString(), selectedIds: threeLevelValue.toString(),
...@@ -1883,7 +1875,6 @@ export default { ...@@ -1883,7 +1875,6 @@ export default {
that.axios.post(that.baseUrl+'/api-plug/query-store-by-code-name',qs.stringify(para)) that.axios.post(that.baseUrl+'/api-plug/query-store-by-code-name',qs.stringify(para))
.then((res) => { .then((res) => {
console.log(res,res.data,res.data.errorCode)
var resData = res.data var resData = res.data
if (resData.errorCode == 0) { if (resData.errorCode == 0) {
resData.result.forEach(function(ele,index){ resData.result.forEach(function(ele,index){
...@@ -1919,11 +1910,9 @@ export default { ...@@ -1919,11 +1910,9 @@ export default {
that.axios.post(that.baseUrl+'/api-auth/do-login',qs.stringify(para)) that.axios.post(that.baseUrl+'/api-auth/do-login',qs.stringify(para))
.then((res) => { .then((res) => {
console.log(res,res.data,res.data.errorCode)
that.getLinksList(0,1) that.getLinksList(0,1)
}) })
.catch(function (error) { .catch(function (error) {
console.log("error:",error);
}) })
}, },
...@@ -1952,7 +1941,6 @@ export default { ...@@ -1952,7 +1941,6 @@ export default {
// 添加参数 // 添加参数
addDynamic() { addDynamic() {
var that = this var that = this
// console.log(that.dynamicRow)
if (!that.dynamicRow.key||!String(that.dynamicRow.value).trim()) { if (!that.dynamicRow.key||!String(that.dynamicRow.value).trim()) {
that.$message.error({ that.$message.error({
duration: 1000, duration: 1000,
...@@ -2040,7 +2028,7 @@ export default { ...@@ -2040,7 +2028,7 @@ export default {
}, },
watch: { watch: {
linkToolsVisible(val) { linkVisible(val) {
this.mylinkToolsVisible = val; // 新增linkToolsVisible的watch,监听变更并同步到linkToolsVisible上 this.mylinkToolsVisible = val; // 新增linkToolsVisible的watch,监听变更并同步到linkToolsVisible上
}, },
// isWx(val) { // isWx(val) {
...@@ -2123,7 +2111,7 @@ export default { ...@@ -2123,7 +2111,7 @@ export default {
vertical-align: middle; vertical-align: middle;
width: 310px; width: 310px;
padding: 10px 10px; padding: 10px 10px;
/*height: 110px;*/ height: 110px;
border: 1px solid #dcdfe6; border: 1px solid #dcdfe6;
border-radius: 4px; border-radius: 4px;
margin-right: 7px; margin-right: 7px;
......
<!--
/**
* 链接小工具组件(弹窗) by fairyly on 2018/06/15
* 组件调用
*/
<linktools :showType="showType" :linkToolsVisible="linkToolsVisible" @linkSelect="linkSelect"/>
import Linktools from 'components/linktools/linktools.vue'
// 链接小工具参数
linkToolsVisible: false, //显示参数
showType: 0, // 显示类型,插件默认0:显示全部 ,1: (底部导航);2: (公众号菜单:只有小程序的,没有h5)
// methods
// linktools
showLinkDialog() {
this.linkToolsVisible = true;
},
linkSelect(val) {
console.log(val)
// 关闭时隐藏
this.linkToolsVisible = false;
}
components: {linkId
Linktools
} coupCardId
-->
<template> <template>
<!-- 链接小工具 --> <!-- 链接小工具 -->
...@@ -6,6 +36,7 @@ ...@@ -6,6 +36,7 @@
title="链接小工具" title="链接小工具"
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="mylinkToolsVisible" :visible.sync="mylinkToolsVisible"
@close="changeVisible"
:modal-append-to-body="false"> :modal-append-to-body="false">
<!-- 链接类型 --> <!-- 链接类型 -->
<div class="links-types"> <div class="links-types">
...@@ -42,7 +73,7 @@ ...@@ -42,7 +73,7 @@
<goods-tree v-if="goodsTreeVisible" @pass-mall="getMallId" :tree-data="treeData"></goods-tree> <goods-tree v-if="goodsTreeVisible" @pass-mall="getMallId" :tree-data="treeData"></goods-tree>
<!-- 商品分类链接 --> <!-- 商品分类链接 -->
<treeselect <!-- <treeselect
v-if="threeLevelTreeVisible" v-if="threeLevelTreeVisible"
v-model="threeLevelValue" v-model="threeLevelValue"
:options="goodsCategoryOptions" :options="goodsCategoryOptions"
...@@ -52,7 +83,7 @@ ...@@ -52,7 +83,7 @@
noOptionsText="暂无数据" noOptionsText="暂无数据"
noResultsText="无数据" noResultsText="无数据"
@select="goodsCategorySelect" @select="goodsCategorySelect"
/> /> -->
<!-- 搜索后出现下列 --> <!-- 搜索后出现下列 -->
<el-select <el-select
v-if="threeLevelSearchVisible" v-if="threeLevelSearchVisible"
...@@ -278,9 +309,6 @@ ...@@ -278,9 +309,6 @@
</table> </table>
</div> </div>
</div> --> </div> -->
</div> </div>
<!-- 商品链接 --> <!-- 商品链接 -->
...@@ -363,7 +391,7 @@ ...@@ -363,7 +391,7 @@
</div> </div>
<!-- 底部按钮 --> <!-- 底部按钮 -->
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="cancelLinkSelect">取 消</el-button> <!-- <el-button @click="cancelLinkSelect">取 消</el-button> -->
<el-button type="primary" @click="confirmLinkSelect">确 定</el-button> <el-button type="primary" @click="confirmLinkSelect">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
...@@ -371,6 +399,7 @@ ...@@ -371,6 +399,7 @@
</template> </template>
<script> <script>
// 使用树形插件 // 使用树形插件
// import the component // import the component
import Treeselect from '@riophae/vue-treeselect'; import Treeselect from '@riophae/vue-treeselect';
...@@ -382,8 +411,10 @@ import GoodsTree from './goods-tree'; ...@@ -382,8 +411,10 @@ import GoodsTree from './goods-tree';
import qs from 'qs'; import qs from 'qs';
export default { export default {
name: 'links', name: 'links-tool',
props: ['linkToolsVisible','showType','projectName'],
props: ['linkVisible','showType','projectName'],
data () { data () {
return { return {
treeData: [], treeData: [],
...@@ -539,7 +570,7 @@ export default { ...@@ -539,7 +570,7 @@ export default {
// --------------------------- // ---------------------------
// 父组件传递的 props // 父组件传递的 props
mylinkToolsVisible: this.linkToolsVisible, mylinkToolsVisible: false,
// 商品链接 // 商品链接
goodsLinksVisible: false, goodsLinksVisible: false,
...@@ -642,6 +673,13 @@ export default { ...@@ -642,6 +673,13 @@ export default {
} }
}, },
methods: { methods: {
changeVisible() {
if (!this.selectLinkObj.id) {
this.selectLinkObj = '';
}
this.transData();
this.$emit('update:linkVisible', false);
},
handlePaddGift(list) { handlePaddGift(list) {
// 拼接id // 拼接id
this.giftFlag = true; this.giftFlag = true;
...@@ -756,7 +794,7 @@ export default { ...@@ -756,7 +794,7 @@ export default {
// twoLevelValueChange (二级选择,保存选择类型) // twoLevelValueChange (二级选择,保存选择类型)
twoLevelValueChange(e) { twoLevelValueChange(e) {
if (e == 'product_category_link') { // 商品链接 if (e == 'product_category_link') { // 商品分类链接
this.middleGoodId = e; this.middleGoodId = e;
this.goodType = 10; this.goodType = 10;
this.threeLevelVisible = true; this.threeLevelVisible = true;
...@@ -777,6 +815,7 @@ export default { ...@@ -777,6 +815,7 @@ export default {
} }
var that = this var that = this
this.goodsLinksVisible = false;
this.visibleType = null; this.visibleType = null;
// 清空已经选择 // 清空已经选择
that.selectLinkObj.name = ''; that.selectLinkObj.name = '';
...@@ -819,7 +858,8 @@ export default { ...@@ -819,7 +858,8 @@ export default {
that.selectLinkObj.name = ''; that.selectLinkObj.name = '';
that.selectLinkObj.url = ''; that.selectLinkObj.url = '';
// 如果选择商品链接 // 如果选择商品链接
if(selectTwoItem.type == 4){ if(selectTwoItem.type == 4) {
this.currentPage = 1;
that.getGoodsList(); // 获取商品列表 that.getGoodsList(); // 获取商品列表
that.getGoodsCategory();// 获取商品品类 that.getGoodsCategory();// 获取商品品类
that.getGoodsClassify(); // 获取商品分类 that.getGoodsClassify(); // 获取商品分类
...@@ -984,7 +1024,6 @@ export default { ...@@ -984,7 +1024,6 @@ export default {
that.categoryOptions = []; that.categoryOptions = [];
that.categoryOptions.push(onelevelCategory); that.categoryOptions.push(onelevelCategory);
console.log("list:",that.categoryOptions)
return false; return false;
} }
...@@ -994,7 +1033,6 @@ export default { ...@@ -994,7 +1033,6 @@ export default {
}) })
}) })
.catch(function (error) { .catch(function (error) {
console.log(error);
// that.toLogin() // that.toLogin()
that.$message.error({ that.$message.error({
duration: 1000, duration: 1000,
...@@ -1048,7 +1086,6 @@ export default { ...@@ -1048,7 +1086,6 @@ export default {
that.goodsCategoryOptions = list; that.goodsCategoryOptions = list;
that.classifyOptions = list; that.classifyOptions = list;
// that.classifyOptions = list; // that.classifyOptions = list;
console.log("list:",list,that.goodsCategoryOptions)
return; return;
} }
...@@ -1338,10 +1375,9 @@ export default { ...@@ -1338,10 +1375,9 @@ export default {
// 页码变化触发 // 页码变化触发
linkCurrentChange(val) { linkCurrentChange(val) {
var that = this this.currentPage = val;
that.currentPage = val;
// 请求商品列表 // 请求商品列表
that.getGoodsList(); this.getGoodsList();
}, },
// 选择商品链接 // 选择商品链接
...@@ -1405,7 +1441,6 @@ export default { ...@@ -1405,7 +1441,6 @@ export default {
that.axios.post(that.baseUrl+'/api-mall/page-mall-goods',qs.stringify(para)) that.axios.post(that.baseUrl+'/api-mall/page-mall-goods',qs.stringify(para))
.then((res) => { .then((res) => {
console.log(res,res.data,res.data.errorCode)
var resData = res.data var resData = res.data
if (resData.errorCode == 0) { if (resData.errorCode == 0) {
that.goodsList = resData.result.result that.goodsList = resData.result.result
...@@ -1419,8 +1454,6 @@ export default { ...@@ -1419,8 +1454,6 @@ export default {
}) })
}) })
.catch(function (error) { .catch(function (error) {
console.log(error);
// that.toLogin()
that.$message.error({ that.$message.error({
duration: 1000, duration: 1000,
message: error.message message: error.message
...@@ -1449,25 +1482,22 @@ export default { ...@@ -1449,25 +1482,22 @@ export default {
}, },
// 取消操作 // // 取消操作
cancelLinkSelect() { // cancelLinkSelect() {
var that = this // var that = this
this.$confirm('确认关闭?', '', { // this.$confirm('确认关闭?', '', {
confirmButtonText: '确定', // confirmButtonText: '确定',
cancelButtonText: '取消', // cancelButtonText: '取消',
type: '' // type: ''
}).then(() => { // }).then(() => {
console.log("点击确认") // that.$emit('linkSelect')
that.$emit('linkSelect') // }).catch(() => {
}).catch(() => { // });
console.log("取消 取消关闭") // },
});
},
// 确认操作 // 确认操作
confirmLinkSelect() { confirmLinkSelect() {
var that = this var that = this
// console.log(that.linksType,that.twoLevelValue,that.threeLevelValue,that.h5linkObj.conditionType)
// 如果选择 h5 判断选择的链接 // 如果选择 h5 判断选择的链接
if (that.oneLevelTypeValue == 5) { if (that.oneLevelTypeValue == 5) {
if (!that.h5linkObj.name.trim() || !that.h5linkObj.url.trim()) { if (!that.h5linkObj.name.trim() || !that.h5linkObj.url.trim()) {
...@@ -1506,7 +1536,6 @@ export default { ...@@ -1506,7 +1536,6 @@ export default {
that.selectLinkObj.shareUrl = that.h5linkObj.shareUrl that.selectLinkObj.shareUrl = that.h5linkObj.shareUrl
} }
} }
console.log(that.selectLinkObj)
// that.selectLinkObj.fixParam = that.h5linkObj.fixParam; // that.selectLinkObj.fixParam = that.h5linkObj.fixParam;
// that.selectLinkObj.dynamicPara = that.h5linkObj.dynamicPara; // that.selectLinkObj.dynamicPara = that.h5linkObj.dynamicPara;
// 触发父组件方法,传递参数 // 触发父组件方法,传递参数
...@@ -1549,8 +1578,6 @@ export default { ...@@ -1549,8 +1578,6 @@ export default {
}) })
that.selectLinkObj.params = thirdDataList that.selectLinkObj.params = thirdDataList
} }
console.log(this.selectLinkObj);
// 触发父组件方法,传递参数 // 触发父组件方法,传递参数
that.transData(); that.transData();
return; return;
...@@ -1566,7 +1593,6 @@ export default { ...@@ -1566,7 +1593,6 @@ export default {
return; return;
} }
// 触发父组件方法,传递参数 // 触发父组件方法,传递参数
console.log(that.selectLinkObj)
that.transData(); that.transData();
return; return;
} }
...@@ -1665,6 +1691,7 @@ export default { ...@@ -1665,6 +1691,7 @@ export default {
} }
return false; return false;
} }
if (!!this.selectLinkObj.name && !!this.selectLinkObj.id) { if (!!this.selectLinkObj.name && !!this.selectLinkObj.id) {
// 触发父组件方法,传递参数 // 触发父组件方法,传递参数
this.transData(); this.transData();
...@@ -1684,7 +1711,6 @@ export default { ...@@ -1684,7 +1711,6 @@ export default {
checkTwoLevel(v) { checkTwoLevel(v) {
var that = this var that = this
// console.log(that.threeLevelValue)
if (!that.threeLevelValue|| !that.threeLevelValue.length) { if (!that.threeLevelValue|| !that.threeLevelValue.length) {
that.$message.error({ that.$message.error({
duration: 1000, duration: 1000,
...@@ -1755,9 +1781,8 @@ export default { ...@@ -1755,9 +1781,8 @@ export default {
// 触发父组件方法,传递参数 // 触发父组件方法,传递参数
transData() { transData() {
var that = this; this.$emit('linkSelect', this.selectLinkObj)
that.$emit('linkSelect', that.selectLinkObj) this.resetAll();
that.resetAll();
}, },
// 获取一级列表 // 获取一级列表
...@@ -1774,7 +1799,6 @@ export default { ...@@ -1774,7 +1799,6 @@ export default {
that.axios.post(that.baseUrl+'/api-plug/list-link-data',qs.stringify(para)) that.axios.post(that.baseUrl+'/api-plug/list-link-data',qs.stringify(para))
.then((res) => { .then((res) => {
console.log(res,res.data,res.data.errorCode)
var resData = res.data var resData = res.data
if (resData.errorCode == 0) { if (resData.errorCode == 0) {
that.setLevelListOptions(parentId,resData.result,num,twoType) that.setLevelListOptions(parentId,resData.result,num,twoType)
...@@ -1787,7 +1811,6 @@ export default { ...@@ -1787,7 +1811,6 @@ export default {
}) })
}) })
.catch(function (error) { .catch(function (error) {
console.log(error);
// that.toLogin() // that.toLogin()
that.$message.error({ that.$message.error({
duration: 1000, duration: 1000,
...@@ -1843,7 +1866,6 @@ export default { ...@@ -1843,7 +1866,6 @@ export default {
// 获取门店列表 // 获取门店列表
getStoreList(query,threeLevelValue) { getStoreList(query,threeLevelValue) {
var that = this var that = this
console.log(threeLevelValue.toString())
var para = { var para = {
searchParam: query, searchParam: query,
selectedIds: threeLevelValue.toString(), selectedIds: threeLevelValue.toString(),
...@@ -1853,7 +1875,6 @@ export default { ...@@ -1853,7 +1875,6 @@ export default {
that.axios.post(that.baseUrl+'/api-plug/query-store-by-code-name',qs.stringify(para)) that.axios.post(that.baseUrl+'/api-plug/query-store-by-code-name',qs.stringify(para))
.then((res) => { .then((res) => {
console.log(res,res.data,res.data.errorCode)
var resData = res.data var resData = res.data
if (resData.errorCode == 0) { if (resData.errorCode == 0) {
resData.result.forEach(function(ele,index){ resData.result.forEach(function(ele,index){
...@@ -1889,11 +1910,9 @@ export default { ...@@ -1889,11 +1910,9 @@ export default {
that.axios.post(that.baseUrl+'/api-auth/do-login',qs.stringify(para)) that.axios.post(that.baseUrl+'/api-auth/do-login',qs.stringify(para))
.then((res) => { .then((res) => {
console.log(res,res.data,res.data.errorCode)
that.getLinksList(0,1) that.getLinksList(0,1)
}) })
.catch(function (error) { .catch(function (error) {
console.log("error:",error);
}) })
}, },
...@@ -1922,7 +1941,6 @@ export default { ...@@ -1922,7 +1941,6 @@ export default {
// 添加参数 // 添加参数
addDynamic() { addDynamic() {
var that = this var that = this
// console.log(that.dynamicRow)
if (!that.dynamicRow.key||!String(that.dynamicRow.value).trim()) { if (!that.dynamicRow.key||!String(that.dynamicRow.value).trim()) {
that.$message.error({ that.$message.error({
duration: 1000, duration: 1000,
...@@ -2010,7 +2028,7 @@ export default { ...@@ -2010,7 +2028,7 @@ export default {
}, },
watch: { watch: {
linkToolsVisible(val) { linkVisible(val) {
this.mylinkToolsVisible = val; // 新增linkToolsVisible的watch,监听变更并同步到linkToolsVisible上 this.mylinkToolsVisible = val; // 新增linkToolsVisible的watch,监听变更并同步到linkToolsVisible上
}, },
// isWx(val) { // isWx(val) {
...@@ -2093,7 +2111,7 @@ export default { ...@@ -2093,7 +2111,7 @@ export default {
vertical-align: middle; vertical-align: middle;
width: 310px; width: 310px;
padding: 10px 10px; padding: 10px 10px;
/*height: 110px;*/ height: 110px;
border: 1px solid #dcdfe6; border: 1px solid #dcdfe6;
border-radius: 4px; border-radius: 4px;
margin-right: 7px; margin-right: 7px;
......
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