Просмотр исходного кода

feat(miniprogram): 新增内河干散货运输船东服务功能

- 添加海事公告列表,展示最新的海事通知和安全要求
- 创建法律援助机构介绍,提供法律援助服务信息
- 实现法律援助申请功能,用户可提交法律援助需求
- 优化页面样式,增加顶部标题、卡片布局等元素
wzg 9 месяцев назад
Родитель
Сommit
48db51a9fa

+ 58 - 38
miniprogram/pages/maritime/maritime.js

@@ -1,46 +1,66 @@
 Page({
-  /**
-   * 页面的初始数据
-   */
-  data: {},
+  data: {
+    notices: [
+      {
+        title: "关于加强长江干线船舶污染防治的通知",
+        date: "2024-01-15",
+        unit: "江苏海事局",
+      },
+      {
+        title: "2024年春运期间船舶安全管理要求",
+        date: "2024-01-10",
+        unit: "交通运输部海事局",
+      },
+      {
+        title: "关于开展内河船舶安全专项检查的通知",
+        date: "2024-01-05",
+        unit: "南京海事局",
+      },
+    ],
+    legalOrg: {
+      name: "江苏海事法律援助中心",
+      photoUrl: "https://example.com/legal_org.jpg",
+      introduction:
+        "江苏海事法律援助中心成立于2010年,是专门为船东、船员提供法律服务的专业机构。中心配备了多名具有海事海商法专业背景的律师,长期从事海事纠纷处理、海事诉讼代理等业务。我们致力于为内河航运企业和个人提供优质、高效的法律服务,包括船舶买卖、租赁合同纠纷、海事事故处理、保险理赔等方面的法律咨询和援助。中心秉持公正、专业、高效的服务理念,为促进航运业健康发展贡献力量。",
+    },
+    aidRequest: "",
+  },
 
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {},
+  handleInputChange(e) {
+    this.setData({
+      aidRequest: e.detail.value,
+    });
+  },
 
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {},
+  submitAidRequest() {
+    if (!this.data.aidRequest.trim()) {
+      wx.showToast({
+        title: "请输入法律援助需求",
+        icon: "none",
+      });
+      return;
+    }
 
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {},
+    // TODO: 实现提交法律援助申请的接口调用
+    wx.showToast({
+      title: "申请提交成功",
+      icon: "success",
+    });
 
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {},
+    this.setData({
+      aidRequest: "",
+    });
+  },
 
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {},
+  onLoad() {
+    // TODO: 从服务器获取海事公告列表和法律援助机构信息
+  },
 
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {},
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {},
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {},
+  onShow() {
+    if (typeof this.getTabBar === "function" && this.getTabBar()) {
+      this.getTabBar().setData({
+        selected: 2,
+      });
+    }
+  },
 });

+ 43 - 0
miniprogram/pages/maritime/maritime.wxml

@@ -0,0 +1,43 @@
+<view class="container">
+    <!-- 顶部标题 -->
+    <view class="header">内河干散货运输船东服务</view>
+    <!-- 内容区域 -->
+    <view class="content">
+        <!-- 海事公告列表 -->
+        <view class="card">
+            <view class="card-header">海事公告</view>
+            <view class="card-content">
+                <view class="notice-list">
+                    <view class="notice-item" wx:for="{{notices}}" wx:key="index">
+                        <view class="notice-title">{{item.title}}</view>
+                        <view class="notice-info">
+                            <text class="notice-date">{{item.date}}</text>
+                            <text class="notice-unit">{{item.unit}}</text>
+                        </view>
+                    </view>
+                </view>
+            </view>
+        </view>
+        <!-- 法律援助机构介绍 -->
+        <view class="card">
+            <view class="card-header">法律援助机构</view>
+            <view class="card-content">
+                <view class="org-info">
+                    <view class="org-name">{{legalOrg.name}}</view>
+                    <image class="org-photo" mode="aspectFit" src="{{legalOrg.photoUrl}}"></image>
+                    <view class="org-intro">{{legalOrg.introduction}}</view>
+                </view>
+            </view>
+        </view>
+        <!-- 法律援助申请 -->
+        <view class="card">
+            <view class="card-header">申请法律援助</view>
+            <view class="card-content">
+                <view class="legal-aid-form">
+                    <textarea class="aid-input" placeholder="请描述您的法律援助需求..." bindinput="handleInputChange" value="{{aidRequest}}"></textarea>
+                    <button class="submit-btn" bindtap="submitAidRequest">提交申请</button>
+                </view>
+            </view>
+        </view>
+    </view>
+</view>

+ 120 - 0
miniprogram/pages/maritime/maritime.wxss

@@ -0,0 +1,120 @@
+.container {
+  padding: 20rpx;
+  background-color: #f5f5f5;
+}
+
+.header {
+  font-size: 36rpx;
+  font-weight: bold;
+  color: #333;
+  padding: 20rpx 0;
+  text-align: center;
+}
+
+.content {
+  margin-top: 20rpx;
+}
+
+.card {
+  background-color: #fff;
+  border-radius: 16rpx;
+  margin-bottom: 20rpx;
+  box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
+  overflow: hidden;
+}
+
+.card-header {
+  font-size: 32rpx;
+  font-weight: bold;
+  color: #333;
+  padding: 20rpx;
+  border-bottom: 2rpx solid #f0f0f0;
+}
+
+.card-content {
+  padding: 20rpx;
+}
+
+/* 海事公告列表样式 */
+.notice-list {
+  margin-top: 10rpx;
+}
+
+.notice-item {
+  padding: 20rpx 0;
+  border-bottom: 2rpx solid #f0f0f0;
+}
+
+.notice-item:last-child {
+  border-bottom: none;
+}
+
+.notice-title {
+  font-size: 28rpx;
+  color: #333;
+  margin-bottom: 10rpx;
+}
+
+.notice-info {
+  display: flex;
+  justify-content: space-between;
+  font-size: 24rpx;
+  color: #999;
+}
+
+/* 法律援助机构样式 */
+.org-info {
+  text-align: center;
+}
+
+.org-name {
+  font-size: 32rpx;
+  font-weight: bold;
+  color: #333;
+  margin-bottom: 20rpx;
+}
+
+.org-photo {
+  width: 100%;
+  height: 300rpx;
+  margin-bottom: 20rpx;
+  border-radius: 8rpx;
+}
+
+.org-intro {
+  font-size: 26rpx;
+  color: #666;
+  text-align: justify;
+  line-height: 1.6;
+}
+
+/* 法律援助申请表单样式 */
+.legal-aid-form {
+  margin-top: 10rpx;
+}
+
+.aid-input {
+  width: 100%;
+  height: 200rpx;
+  padding: 20rpx;
+  box-sizing: border-box;
+  border: 2rpx solid #e0e0e0;
+  border-radius: 8rpx;
+  font-size: 28rpx;
+  margin-bottom: 20rpx;
+}
+
+.submit-btn {
+  width: 100%;
+  height: 80rpx;
+  line-height: 80rpx;
+  text-align: center;
+  background-color: #1989fa;
+  color: #fff;
+  border-radius: 8rpx;
+  font-size: 28rpx;
+}
+
+.submit-btn:active {
+  opacity: 0.8;
+}