Kaynağa Gözat

feat(miniprogram): 新增法律援助功能

- 新增法律援助页面和提交法律援助申请页面
- 更新证书办理页面布局
- 优化法律援助页面样式和交互
- 添加提交法律援助申请的逻辑和页面
- 更新全局样式,移除冗余代码
wzg 10 ay önce
ebeveyn
işleme
67f1177062

+ 7 - 6
miniprogram/app.json

@@ -12,6 +12,7 @@
     "pages/cert/cert",
     "pages/oilPrice/oilPrice",
     "pages/legal/legal",
+    "pages/legal/submitLegal/submitLegal",
     "pages/securityCheck/securityCheck",
     "pages/train/train"
   ],
@@ -37,20 +38,20 @@
       {
         "pagePath": "pages/cert/cert",
         "text": "证书办理",
-        "selectedIconPath": "./images/tabs/ship-.png",
-        "iconPath": "./images/tabs/ship.png"
+        "selectedIconPath": "./images/tabs/cert-.png",
+        "iconPath": "./images/tabs/cert.png"
       },
       {
         "pagePath": "pages/oilPrice/oilPrice",
         "text": "油价查询",
-        "selectedIconPath": "./images/tabs/ship-.png",
-        "iconPath": "./images/tabs/ship.png"
+        "selectedIconPath": "./images/tabs/oilPrice-.png",
+        "iconPath": "./images/tabs/oilPrice.png"
       },
       {
         "pagePath": "pages/legal/legal",
         "text": "法律援助",
-        "selectedIconPath": "./images/tabs/ship-.png",
-        "iconPath": "./images/tabs/ship.png"
+        "selectedIconPath": "./images/tabs/legal-.png",
+        "iconPath": "./images/tabs/legal.png"
       },
       {
         "pagePath": "pages/securityCheck/securityCheck",

BIN
miniprogram/images/success.png


BIN
miniprogram/images/tabs/cert-.png


BIN
miniprogram/images/tabs/cert.png


BIN
miniprogram/images/tabs/legal-.png


BIN
miniprogram/images/tabs/legal.png


BIN
miniprogram/images/tabs/oilPrice-.png


BIN
miniprogram/images/tabs/oilPrice.png


+ 1 - 1
miniprogram/pages/cert/cert.js

@@ -48,7 +48,7 @@ Page({
       });
     } else {
       this.setData({
-        introduce: [],
+        introduce: {},
       });
       wx.showToast({
         title: data.msg,

+ 4 - 4
miniprogram/pages/cert/cert.wxml

@@ -14,10 +14,10 @@
 </view>
 <view class="title mt50">证书办理服务</view>
 <view class="pl30 pr30">
-  <div class="df aic">
+  <view class="df aic">
     <image class="i-img" mode="aspectFit" bind:tap="preview" data-url="{{introduce.imageUrl}}" src="{{introduce.imageUrl}}" mode="" />
-    <div class="i-text">{{introduce.textContent||'暂无'}}</div>
-  </div>
+    <view class="i-text">{{introduce.textContent||'暂无'}}</view>
+  </view>
 </view>
 <view class="title mt50">办证联系人</view>
 <view class="pl30 pr30">
@@ -26,7 +26,7 @@
     <view class="w20p tac">姓名</view>
     <view class="w40p tac">电话</view>
   </view>
-  <view class="df aic jcsb fs28 mt10 tr" wx:for="{{contacts}}">
+  <view class="df aic jcsb fs28 mt10 tr" wx:for="{{contacts}}" wx:key="index">
     <view class="w40p tac">{{item.officeName}}</view>
     <view class="w20p tac">{{item.contactPerson}}</view>
     <view class="w40p tac df aic" bind:tap="copy" data-phone="{{item.contactPhone}}">{{item.contactPhone}}

+ 33 - 60
miniprogram/pages/legal/legal.js

@@ -1,66 +1,39 @@
 // pages/legal/legal.js
-Page({
+import { postApi, getApi } from "../../apis/api";
+import router from "../../utils/router";
 
-  /**
-   * 页面的初始数据
-   */
+Page({
   data: {
-
+    legalAidIntroduce: {},
+    lawyerIntroduce: {},
+  },
+  async getIntroduce() {
+    let { data } = await getApi("/legal/aid/introduce");
+    if (data.status === 0) {
+      this.setData({
+        ...data.result,
+      });
+    } else {
+      this.setData({
+        legalAidIntroduce: {},
+        lawyerIntroduce: {},
+      });
+      wx.showToast({
+        title: data.msg,
+        icon: "none",
+      });
+    }
+  },
+  preview(e) {
+    wx.previewImage({
+      urls: [e.currentTarget.dataset.url],
+    });
+  },
+
+  goTo(e) {
+    router(e.currentTarget.dataset.path);
   },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
   onLoad(options) {
-
+    this.getIntroduce();
   },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload() {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh() {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom() {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage() {
-
-  }
-})
+});

+ 12 - 1
miniprogram/pages/legal/legal.wxml

@@ -1,2 +1,13 @@
 <!--pages/legal/legal.wxml-->
-<text>pages/legal/legal.wxml</text>
+<view class="title mt30">援助机构介绍</view>
+<view class="pl30 pr30">
+  {{legalAidIntroduce.textContent||'暂无'}}
+</view>
+<view class="title mt50">律师(团队)介绍</view>
+<view class="pl30 pr30">
+  <view class="df aic">
+    <image class="i-img" mode="aspectFit" bind:tap="preview" data-url="{{lawyerIntroduce.imageUrl}}" src="{{lawyerIntroduce.imageUrl}}" mode="" />
+    <view class="i-text">{{lawyerIntroduce.textContent||'暂无'}}</view>
+  </view>
+</view>
+<view class="primary w500 m0a mt100" bind:tap="goTo" data-path="/pages/legal/submitLegal/submitLegal">申请法律援助</view>

+ 14 - 1
miniprogram/pages/legal/legal.wxss

@@ -1 +1,14 @@
-/* pages/legal/legal.wxss */
+/* pages/legal/legal.wxss */
+.i-img {
+  width: 45vw;
+  height: 45vw;
+}
+
+.i-text {
+  width: 43vw;
+  height: 45vw;
+  margin-left: 2vw;
+  border: 1rpx solid #eee;
+  box-sizing: border-box;
+  padding: 10rpx;
+}

+ 26 - 0
miniprogram/pages/legal/submitLegal/submitLegal.js

@@ -0,0 +1,26 @@
+// pages/legal/submitLegal/submitLegal.js
+import router from "../../../utils/router";
+
+Page({
+  data: {
+    visable: false,
+  },
+  goTo(e) {
+    console.log(e);
+    router(e.currentTarget.dataset.path);
+  },
+  submit() {
+    wx.showModal({
+      title: "提示",
+      content: "确认提交?",
+      complete: (res) => {
+        if (res.confirm) {
+          this.setData({
+            visable: true,
+          });
+        }
+      },
+    });
+  },
+  onLoad(options) {},
+});

+ 3 - 0
miniprogram/pages/legal/submitLegal/submitLegal.json

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

+ 13 - 0
miniprogram/pages/legal/submitLegal/submitLegal.wxml

@@ -0,0 +1,13 @@
+<!--pages/legal/submitLegal/submitLegal.wxml-->
+<view class="title">请告知我们您遇到了什么问题?</view>
+<textarea class="textarea" placeholder="请输入您的问题"></textarea>
+<view class="primary w500 m0a mt100" bind:tap="submit">提交</view>
+
+<view class="primary w500 m0a mt40" style="background: #fff!important;color: #777!important;border: 1px solid #ddd;" bind:tap="goTo" data-path="back">取消</view>
+<view class="mask df aic fdc" wx:if="{{visable}}">
+  <image src="../../../images/success.png" style="width: 30vw;margin: 10vw auto;" mode="widthFix" />
+  <!-- <view class="fs40 c5 mb20">提交成功! </view> -->
+  <view class="fs40 c5 mb40">感谢您的信任!</view>
+  <view class="fs30 c5 mb20 w80p" style="text-indent: 28px;line-height: 48rpx;"> 我们已收到您的援助申请,请保持电话畅通,我们的援助律师将会在第一时间与您取得联系!</view>
+  <view class="primary w500 m0a mt100" bind:tap="goTo" data-path="takePhoto">返回首页</view>
+</view>

+ 18 - 0
miniprogram/pages/legal/submitLegal/submitLegal.wxss

@@ -0,0 +1,18 @@
+/* pages/legal/submitLegal/submitLegal.wxss */
+.textarea {
+  border: 1px solid #999;
+  margin: 20rpx auto;
+  padding: 20rpx;
+  width: 90vw;
+  box-sizing: border-box;
+}
+
+.mask {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100vw;
+  height: 100vh;
+  z-index: 99999;
+  background: #fff;
+}

+ 0 - 9
miniprogram/style/color.wxss

@@ -65,13 +65,4 @@
 
 .red {
   color: red !important;
-}
-
-.primary {
-  padding: 20rpx !important;
-  font-size: 32rpx !important;
-  border-radius: 52rpx !important;
-  color: #fff !important;
-  text-align: center !important;
-  background: linear-gradient(270deg, #0089fd 0%, #43a9ff 100%) !important;
 }

+ 9 - 0
miniprogram/style/index.wxss

@@ -156,4 +156,13 @@
   font-size: 12rpx;
   height: 12rpx;
   line-height: 12rpx;
+}
+
+.primary {
+  padding: 20rpx !important;
+  font-size: 32rpx !important;
+  border-radius: 16rpx !important;
+  color: #fff !important;
+  text-align: center !important;
+  background: linear-gradient(270deg, #0089fd 0%, #43a9ff 100%) !important;
 }

+ 17 - 0
miniprogram/utils/router.js

@@ -0,0 +1,17 @@
+const tabPaths = ["takePhoto"];
+export default function (url) {
+  console.log(url);
+  if (url === "back") {
+    wx.navigateBack();
+    return;
+  }
+  if (tabPaths.includes(url)) {
+    wx.switchTab({
+      url: `/pages/${url}/${url}`,
+    });
+    return;
+  }
+  wx.navigateTo({
+    url,
+  });
+}

+ 7 - 0
project.private.config.json

@@ -2,6 +2,13 @@
   "condition": {
     "miniprogram": {
       "list": [
+        {
+          "name": "pages/legal/submitLegal/submitLegal",
+          "pathName": "pages/legal/submitLegal/submitLegal",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        },
         {
           "name": "pages/takePhoto/takePhoto",
           "pathName": "pages/takePhoto/takePhoto",