This commit is contained in:
scorpio 2025-10-17 21:43:58 +08:00
parent d4aa739966
commit ea5a23259a
7 changed files with 90 additions and 2 deletions

View File

@ -8,7 +8,8 @@
"pages/index/info",
"pages/index/edit",
"pages/about/index",
"pages/today/index"
"pages/today/index",
"pages/preview/index"
],
"window": {
"navigationBarTextStyle": "black",

View File

@ -58,6 +58,12 @@ Page({
}
})
},
goPreview(e){
const url = e.currentTarget.dataset.url
wx.navigateTo({
url: '../preview/index?url=' + url,
})
},
add() {
const user = wx.getStorageSync('user')
console.log(user);

View File

@ -3,7 +3,7 @@
<view wx:if="{{info}}">
<!-- top -->
<view class="top" style="position: relative; z-index: 2;">
<image src="{{info.oss.url}}" style="width: 100vw; height: 680rpx;" mode="aspectFill"></image>
<image src="{{info.oss.url}}" style="width: 100vw; height: 680rpx;" mode="aspectFill" data-url="{{info.oss.url}}" bind:tap="goPreview"></image>
</view>

66
pages/preview/index.js Normal file
View File

@ -0,0 +1,66 @@
// pages/preview/index.js
Page({
/**
* 页面的初始数据
*/
data: {
url:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({url:options.url})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

5
pages/preview/index.json Normal file
View File

@ -0,0 +1,5 @@
{
"navigationBarBackgroundColor": "#000",
"navigationBarTextStyle":"white",
"usingComponents": {}
}

6
pages/preview/index.wxml Normal file
View File

@ -0,0 +1,6 @@
<!--pages/preview/index.wxml-->
<view class="flex flex-center">
<view style="height: 80vh;" class="flex flex-center">
<image src=" {{url}}" style="width: 100vw;height: 50vh;" mode="aspectFill" show-menu-by-longpress></image>
</view>
</view>

4
pages/preview/index.wxss Normal file
View File

@ -0,0 +1,4 @@
/* pages/preview/index.wxss */
page {
background-color: black;
}