Browse Source

mingsu page

邹能昇 3 months ago
parent
commit
5be7a51d0b

+ 3 - 1
app.json

@@ -8,7 +8,9 @@
             "name": "tourism",
             "pages": [
                 "pages/index/index",
-                "pages/homestay/homestay-detail/index"
+                "pages/homestay/homestay-detail/index",
+                "pages/my/my-card/index",
+                "pages/my/my-wallet/index"
             ]
         },
         {

+ 6 - 1
nova-tourism/components/my/index.js

@@ -42,6 +42,11 @@ Component({
      * 组件的方法列表
      */
     methods: {
-
+        gourl(e) {
+            const url = e.currentTarget.dataset.url;
+            wx.navigateTo({
+                url: `${url}`,
+            });
+        },
     }
 })

+ 2 - 2
nova-tourism/components/my/index.wxml

@@ -15,11 +15,11 @@
         </view>
     </view>
     <view class="tatlebox">
-        <view class="tatle">
+        <view class="tatle" data-url="../../pages/my/my-card/index" bindtap="gourl">
             <image src="https://file-cloud.fmode.cn/EbxZUK5lBI/20241122/jn1eq8050320499.png"></image>
             <view class="text">卡卷包</view>
         </view>
-        <view class="tatle">
+        <view class="tatle" data-url="../../pages/my/my-wallet/index" bindtap="gourl">
             <image src="https://file-cloud.fmode.cn/EbxZUK5lBI/20241122/dor18o050338203.png"></image>
             <view class="text">钱包</view>
         </view>

+ 84 - 0
nova-tourism/pages/my/my-card/index.js

@@ -0,0 +1,84 @@
+// nova-tourism/pages/my/my-card/index.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        statusBarHeight: 0,
+        screenHeight: 0,
+        customHeight: 0,
+        bottomNavHeight: 0,
+        contentHeight: 0,
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        const systemInfo = wx.getSystemInfoSync();
+        const statusBarHeight = systemInfo.statusBarHeight || 0;
+        const screenHeight = systemInfo.screenHeight || 0;
+        const custom = wx.getMenuButtonBoundingClientRect();
+        const customHeight = custom.height + 10 + 2 || 0;
+        const bottomNavHeight = systemInfo.screenHeight - systemInfo.safeArea.bottom || 0;
+
+        const contentHeight = (screenHeight - bottomNavHeight - statusBarHeight - customHeight) * 750 / systemInfo.windowWidth;
+        this.setData({
+            statusBarHeight,
+            screenHeight,
+            customHeight,
+            bottomNavHeight,
+            contentHeight
+        });
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 3 - 0
nova-tourism/pages/my/my-card/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 1 - 0
nova-tourism/pages/my/my-card/index.less

@@ -0,0 +1 @@
+/* nova-tourism/pages/my/my-card/index.wxss */

+ 4 - 0
nova-tourism/pages/my/my-card/index.wxml

@@ -0,0 +1,4 @@
+<!--nova-tourism/pages/my/my-card/index.wxml-->
+<nav type="back" background-color="#ffffff" frontColor="#000000" title="卡卷包" />
+<view class="all" style="height: {{contentHeight}}rpx;">
+</view>

+ 0 - 0
nova-tourism/pages/my/my-card/index.wxss


+ 84 - 0
nova-tourism/pages/my/my-wallet/index.js

@@ -0,0 +1,84 @@
+// nova-tourism/pages/my/my-wallet/index.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        statusBarHeight: 0,
+        screenHeight: 0,
+        customHeight: 0,
+        bottomNavHeight: 0,
+        contentHeight: 0,
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        const systemInfo = wx.getSystemInfoSync();
+        const statusBarHeight = systemInfo.statusBarHeight || 0;
+        const screenHeight = systemInfo.screenHeight || 0;
+        const custom = wx.getMenuButtonBoundingClientRect();
+        const customHeight = custom.height + 10 + 2 || 0;
+        const bottomNavHeight = systemInfo.screenHeight - systemInfo.safeArea.bottom || 0;
+
+        const contentHeight = (screenHeight - bottomNavHeight - statusBarHeight - customHeight) * 750 / systemInfo.windowWidth;
+        this.setData({
+            statusBarHeight,
+            screenHeight,
+            customHeight,
+            bottomNavHeight,
+            contentHeight
+        });
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 3 - 0
nova-tourism/pages/my/my-wallet/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 6 - 0
nova-tourism/pages/my/my-wallet/index.less

@@ -0,0 +1,6 @@
+/* nova-tourism/pages/my/my-wallet/index.wxss */
+.all {
+    width: 100vw;
+    padding-left: 20rpx;
+    padding-right: 20rpx;
+}

+ 5 - 0
nova-tourism/pages/my/my-wallet/index.wxml

@@ -0,0 +1,5 @@
+<!--nova-tourism/pages/my/my-wallet/index.wxml-->
+<nav type="back" background-color="#ffffff" frontColor="#000000" title="钱包" />
+<view class="all" style="height: {{contentHeight}}rpx;">
+
+</view>

+ 1 - 0
nova-tourism/pages/my/my-wallet/index.wxss

@@ -0,0 +1 @@
+.all{width:100vw;padding-left:20rpx;padding-right:20rpx}