【新增】后台页面设计【导航组件】增加跳转到其他小程序的下拉设置。

This commit is contained in:
jianweie code
2024-06-20 21:22:03 +08:00
parent 79e15fdeb1
commit f4d0d610cb
4 changed files with 21 additions and 4 deletions

View File

@@ -305,6 +305,19 @@ module.exports = {
} else if (type == navLinkType.shopCategory) { } else if (type == navLinkType.shopCategory) {
//商品分类 //商品分类
this.$u.route('/pages/category/list/list', { id: val }); this.$u.route('/pages/category/list/list', { id: val });
} else if (type == navLinkType.wxMiNiProgram) {
//跳转微信小程序
console.log("跳转微信小程序");
uni.navigateToMiniProgram({
appId: val,
path: '',
extraData: {},
success(res) {
console.log("跳转小程序成功", res);
}, fail(res) {
console.log("跳转小程序失败", res);
}
})
} else { } else {
this.$u.route(val); this.$u.route(val);
} }

View File

@@ -132,6 +132,7 @@ export const navLinkType = {
article: 3,// "文章" article: 3,// "文章"
articleCategory: 4,// "文章分类", articleCategory: 4,// "文章分类",
intelligentForms: 5,// "智能表单" intelligentForms: 5,// "智能表单"
shopCategory: 6// "商品分类" shopCategory: 6,// "商品分类"
wxMiNiProgram: 7// "跳转小程序Appid"
}; };

View File

@@ -652,6 +652,7 @@ Vue.component('select-link', {
changeSelect: function () { changeSelect: function () {
this.$emit('update:type', this.selectType) this.$emit('update:type', this.selectType)
this.$emit("update:id", '') this.$emit("update:id", '')
this.$emit("update:linkUrl", '')
}, },
updateLinkValue: function () { updateLinkValue: function () {
this.$emit("update:id", this.linkUrl) this.$emit("update:id", this.linkUrl)
@@ -866,7 +867,7 @@ Vue.component('layout-config', {
coreHelper.Post(getDesign, { id: id }, function (e) { coreHelper.Post(getDesign, { id: id }, function (e) {
if (e.code === 0) { if (e.code === 0) {
//console.log(e); //console.log(e);
linkType = { "1": "URL链接", "2": "商品", "6": "商品分类", "3": "文章", "4": "文章分类", "5": "智能表单" }; linkType = { "1": "URL链接", "2": "商品", "6": "商品分类", "3": "文章", "4": "文章分类", "5": "智能表单", "7": "小程序AppId" };
that.pageCode = e.data.model.code; that.pageCode = e.data.model.code;
that.brandList = e.data.brandList; that.brandList = e.data.brandList;
that.pageConfig = e.data.pageConfig; that.pageConfig = e.data.pageConfig;

View File

@@ -1218,8 +1218,7 @@
</el-form-item> </el-form-item>
<el-form-item label="链接指向:"> <el-form-item label="链接指向:">
<div v-if="selectType==1"> <div v-if="selectType==1">
<el-input type="textarea" autosize placeholder="http开头为webview跳转其他为站内页面跳转" v-model="linkUrl" <el-input type="textarea" autosize placeholder="http开头为webview跳转其他为站内页面跳转" v-model="linkUrl" @change="updateLinkValue"></el-input>
@change="updateLinkValue"></el-input>
</div> </div>
<div v-if="selectType==2"> <div v-if="selectType==2">
<input type="text" v-model="id" class="selectLinkVal" :readonly="true" @click="selectLink" placeholder="请选择"> <input type="text" v-model="id" class="selectLinkVal" :readonly="true" @click="selectLink" placeholder="请选择">
@@ -1240,6 +1239,9 @@
<div v-if="selectType==6"> <div v-if="selectType==6">
<input type="text" v-model="id" class="selectLinkVal" :readonly="true" @click="selectLink" placeholder="请选择"> <input type="text" v-model="id" class="selectLinkVal" :readonly="true" @click="selectLink" placeholder="请选择">
</div> </div>
<div v-if="selectType==7">
<el-input type="textarea" autosize placeholder="请填写小程序的appId" v-model="linkUrl" @change="updateLinkValue"></el-input>
</div>
</el-form-item> </el-form-item>
</div> </div>
</template> </template>