Browse Source

页面添加返回页面(固定返回上级地址)

master
1747191978@qq.com 4 months ago
parent
commit
28715d736b
  1. 11
      大唐会议前台1/App.vue
  2. BIN
      大唐会议前台1/imgs/back.png
  3. 6
      大唐会议前台1/pages/components/MeetingList.vue
  4. 23
      大唐会议前台1/pages/index/details.vue
  5. 10
      大唐会议前台1/pages/index/index.vue
  6. 17
      大唐会议前台1/pages/index/pdf.vue
  7. 3
      大唐会议前台1/pages/user/login.vue

11
大唐会议前台1/App.vue

@ -87,12 +87,19 @@
/deep/.u-toast__content__text--success { /deep/.u-toast__content__text--success {
max-width: 500px !important; max-width: 500px !important;
} }
.back{
width:40px;
position: fixed !important;
top: 16px;
left: 16px;
}
.logo { .logo {
width: 500px; width: 500px;
position: fixed !important; position: fixed !important;
top:16px;
left: 16px; left: 16px;
top: 16px; right: 16px;
margin: auto;
} }
// //

BIN
大唐会议前台1/imgs/back.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

6
大唐会议前台1/pages/components/MeetingList.vue

@ -13,7 +13,7 @@
<view class="li-text">{{item.richtext}}</view> <view class="li-text">{{item.richtext}}</view>
</view> </view>
<view class="view-ul" v-if="item.infos && item.infos.length"> <view class="view-ul" v-if="item.infos && item.infos.length">
<MeetingList :infos='item.infos'></MeetingList> <MeetingList :detailsId='detailsId' :infos='item.infos'></MeetingList>
</view> </view>
</view> </view>
<u-popup :show="show" @close="handleClose" mode="center"> <u-popup :show="show" @close="handleClose" mode="center">
@ -46,7 +46,7 @@
import pdf from 'vue-pdf' import pdf from 'vue-pdf'
export default { export default {
name: 'MeetingList', name: 'MeetingList',
props: ['infos'], props: ['infos','detailsId'],
components: { components: {
pdf pdf
}, },
@ -97,7 +97,7 @@
// this.filePdfUrl = _item.filePdfUrl // this.filePdfUrl = _item.filePdfUrl
// this.show = true // this.show = true
uni.navigateTo({ uni.navigateTo({
url: `/pages/index/pdf?filePdfUrl=${_item.filePdfUrl}`, url: `/pages/index/pdf?filePdfUrl=${_item.filePdfUrl}&detailsId=${this.detailsId}`,
}); });
}, },
}, },

23
大唐会议前台1/pages/index/details.vue

@ -1,6 +1,7 @@
<template> <template>
<view class="box"> <view class="box">
<image class="logo" src='../../imgs/logo.png' alt="" mode="widthFix" @click="handleLogo"></image> <image class="back" src='../../imgs/back.png' mode="widthFix" @click="handleBack"></image>
<image class="logo" src='../../imgs/logo.png' alt="" mode="widthFix" ></image>
<view class="box-cent"> <view class="box-cent">
<view class="box-cent1"> <view class="box-cent1">
<view class="view-box"> <view class="view-box">
@ -8,7 +9,7 @@
<span class="view-title"> {{listData.title}}</span> <span class="view-title"> {{listData.title}}</span>
</view> </view>
<view class="view-ul"> <view class="view-ul">
<MeetingList :infos='listData.infos'></MeetingList> <MeetingList :detailsId='detailsId' :infos='listData.infos'></MeetingList>
</view> </view>
</view> </view>
</view> </view>
@ -47,14 +48,16 @@
listData: [], listData: [],
data: [], data: [],
userName: uni.getStorageSync("userName"), userName: uni.getStorageSync("userName"),
show: false show: false,
detailsId:'',
}; };
}, },
created() { created() {
let routes = getCurrentPages(); // let routes = getCurrentPages(); //
let curParam = routes[routes.length - 1].options; // let curParam = routes[routes.length - 1].options; //
console.log('curParam', curParam) this.detailsId = curParam.id
console.log('curParam', this.detailsId)
this.getMeetingDetails(curParam.id) // this.getMeetingDetails(curParam.id) //
}, },
methods: { methods: {
@ -66,13 +69,13 @@
}); });
}, },
// logo // logo
handleLogo() { handleBack() {
// uni.navigateTo({ uni.navigateTo({
// url: `/pages/index/index`, url: `/pages/index/index`,
// });
uni.navigateBack({
delta: 2
}); });
// uni.navigateBack({
// delta: 1
// });
}, },
// //
handleItemClaick(_item) { handleItemClaick(_item) {

10
大唐会议前台1/pages/index/index.vue

@ -1,5 +1,6 @@
<template> <template>
<view class="box"> <view class="box">
<image class="back" src='../../imgs/back.png' mode="widthFix" @click='handleBack'></image>
<image class="logo" src='../../imgs/logo.png' mode="widthFix" ></image> <image class="logo" src='../../imgs/logo.png' mode="widthFix" ></image>
<view class="box-cent"> <view class="box-cent">
<view class="box-cent1"> <view class="box-cent1">
@ -54,6 +55,15 @@
this.getQueryMeeting() // this.getQueryMeeting() //
}, },
methods: { methods: {
// logo
handleBack() {
// uni.navigateTo({
// url: `/pages/user/login`,
// });
uni.navigateBack({
delta: 1
});
},
// 退 // 退
handleOut(){ handleOut(){
uni.clearStorage(); uni.clearStorage();

17
大唐会议前台1/pages/index/pdf.vue

@ -1,6 +1,7 @@
<template> <template>
<view class="box" style="position: relative;"> <view class="box" style="position: relative;">
<image class="logo" src='../../imgs/logo.png' mode="widthFix" @click="handleLogo"></image> <image class="back" src='../../imgs/back.png' mode="widthFix" @click="handleBack"></image>
<image class="logo" src='../../imgs/logo.png' mode="widthFix" ></image>
<view class="box-cent"> <view class="box-cent">
<view class="box-cent1"> <view class="box-cent1">
<view class="view-pdf"> <view class="view-pdf">
@ -54,15 +55,27 @@
curPageNum: 0, curPageNum: 0,
filePdfUrl: '', filePdfUrl: '',
userName: uni.getStorageSync("userName"), userName: uni.getStorageSync("userName"),
show: false show: false,
detailsId:'',
}; };
}, },
created() { created() {
let routes = getCurrentPages(); // let routes = getCurrentPages(); //
let curParam = routes[routes.length - 1].options; // let curParam = routes[routes.length - 1].options; //
this.detailsId = curParam.detailsId
console.log('this.detailsId ',this.detailsId)
this.filePdfUrl = curParam.filePdfUrl this.filePdfUrl = curParam.filePdfUrl
}, },
methods: { methods: {
// logo
handleBack() {
uni.navigateTo({
url: `/pages/index/details?id=${this.detailsId}`,
});
// uni.navigateBack({
// delta: 1
// });
},
// 退 // 退
handleOut() { handleOut() {
uni.clearStorage(); uni.clearStorage();

3
大唐会议前台1/pages/user/login.vue

@ -143,7 +143,7 @@
if (code === 200) { if (code === 200) {
uni.setStorageSync("userToken", res.token); uni.setStorageSync("userToken", res.token);
uni.setStorageSync("userName", this.form.username); uni.setStorageSync("userName", this.form.username);
uni.reLaunch({ uni.navigateTo({
url: "/pages/index/index", url: "/pages/index/index",
}); });
this.handleSuccess("登录成功"); this.handleSuccess("登录成功");
@ -174,7 +174,6 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.view-form { .view-form {
width: 80% width: 80%
} }

Loading…
Cancel
Save