瀏覽代碼

fix: bugFix 2022-10-22

wangyuan 2 年之前
父節點
當前提交
3a82edf0db

+ 4 - 0
api/index.js

@@ -8,6 +8,10 @@ const homePageURL = '/home/page'
 // 套餐列表 支付页面
 const goodsListURL = '/goods/list'
 
+const  appGetConfigImgURL = '/app/get/config/img'
+
 export const homePage =  (data) => wxRequest(homePageURL, data)
 
 export const goodsList =  (data) => wxRequest(goodsListURL, data)
+
+export const appGetConfigImg =  (data) => wxRequest(appGetConfigImgURL, data)

+ 2 - 1
app.json

@@ -19,7 +19,8 @@
     "pages/myRecord/myRecord",
     "pages/exchange/exchange",
     "pages/aatest/test",
-    "pages/aboutUs/aboutUs"
+    "pages/aboutUs/aboutUs",
+    "pages/userAgreement/userAgreement"
   ],
   "requiredPrivateInfos": [
     "chooseAddress"

+ 16 - 4
pages/aboutUs/aboutUs.js

@@ -1,11 +1,13 @@
 // pages/aboutUs/aboutUs.js
+import { appGetConfigImg } from '../../api/index'
+
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-
+    imgUrl: ''
   },
 
   /**
@@ -18,15 +20,25 @@ Page({
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
-  onReady() {
-
+  getAppGetConfigImg() {
+    const that = this
+    wx.showNavigationBarLoading()
+    // 类型  【1.关于我的 2.用户协议 3.我的 4.实体卡兑换说明 】
+    appGetConfigImg({
+      'imgType': '1'
+    }).then(configRes => {
+      wx.hideNavigationBarLoading()
+      that.setData({
+        imgUrl: configRes.data[0].imgUrl
+      })
+    })
   },
 
   /**
    * 生命周期函数--监听页面显示
    */
   onShow() {
-
+    this.getAppGetConfigImg()
   },
 
   /**

+ 1 - 1
pages/aboutUs/aboutUs.wxml

@@ -1,6 +1,6 @@
 <!--pages/aboutUs/aboutUs.wxml-->
 <view class="about">
   <view class="aboutimg">
-    <image src="../../imaes/compant.jpg"></image>
+    <image class="imgitem" src="{{imgUrl}}"></image>
   </view>
 </view>

+ 9 - 4
pages/aboutUs/aboutUs.wxss

@@ -3,11 +3,16 @@
   width: 100%;
   height: 100%;
   overflow: hidden;
+  display: flex;
+  flex-direction: column;
+  justify-content: flex-start;
+  align-items: center;
 }
 .aboutimg {
-  width: 100%;
+  width: 690rpx;
   height: auto;
-  margin-top: 10rpx;
-  display: flex;
-  justify-content: center;
+  margin: 10rpx auto 0;
+}
+.imgitem {
+  width: 100%;
 }

+ 21 - 1
pages/exchange/exchange.js

@@ -1,5 +1,7 @@
 // pages/exchange/exchange.js
 import { userEntityRecharge } from '../../api/charge'
+import { appGetConfigImg } from '../../api/index'
+
 Page({
 
   /**
@@ -7,7 +9,25 @@ Page({
    */
   data: {
     cardNo: '',
-    cardSecret: ''
+    cardSecret: '',
+    imgUrl: ''
+  },
+
+  onShow () {
+    this.appGetConfigImgFn()
+  },
+  appGetConfigImgFn () {
+    const that = this
+    wx.showNavigationBarLoading()
+    appGetConfigImg({
+      'imgType': '4'
+    }).then(configRes => {
+      wx.hideNavigationBarLoading()
+      console.log(configRes, 'configRes')
+      that.setData({
+        imgUrl: configRes.data[0].imgUrl
+      })
+    })
   },
 
 

+ 1 - 1
pages/exchange/exchange.wxml

@@ -18,6 +18,6 @@
     <view class="itt-btn confirm btn" bindtap="handleComfirm">确定</view>
   </view>
   <view class="shuoming ittflex">
-    实体卡说明
+    <image class="shuomingitem" src="{{imgUrl}}"></image>
   </view>
 </view>

+ 4 - 3
pages/exchange/exchange.wxss

@@ -57,10 +57,11 @@
 .shuoming {
   width: 690rpx;
   margin: 80rpx auto 0;
-  height: 808rpx;
-  background: #D8D8D8;
+  height: auto;
   border-radius: 10rpx;
   font-size: 26rpx;
   font-weight: 400;
-  color: #333333;
+}
+.shuomingitem {
+  width: 100%;
 }

+ 12 - 4
pages/index/index.js

@@ -1,5 +1,5 @@
 // pages/index/index.js
-import { homePage } from '../../api/index'
+import { homePage, appGetConfigImg } from '../../api/index'
 import { createQRcode } from "../../api/document"
 import { ittLogin, bindMobile, bindBaseInfo } from '../../api/my'
 import { appointmentList } from '../../api/appointment'
@@ -26,7 +26,8 @@ Page({
     nickName: '',
     isRefreshPage: false,
     showTopBar: false,
-    topBarObj: null
+    topBarObj: null,
+    homepageImg: ''
   },
   
   onShow () {
@@ -310,8 +311,15 @@ Page({
           topBarObj: null
         })
       }
-    }).catch(e => {
-
+    })
+    // 获取图片资源
+    appGetConfigImg({
+      'imgType': '5'
+    }).then(configRes => {
+      console.log(configRes.data[0].imgUrl, 'configRes')
+      that.setData({
+        homepageImg: configRes.data[0].imgUrl
+      })
     })
   },
 

+ 1 - 1
pages/index/index.wxml

@@ -68,7 +68,7 @@
     <view class="add-btn absolute-btn ittflex" bindtap="handleAddCheck">添加检测人</view>
   </view>
   <view class="index-banner" bindtap="handlActions">
-    <image class="index-img" src="../../imaes/index.jpg"></image>
+    <image class="index-img" src="{{homepageImg}}"></image>
   </view>
   <view class="my-dialog" wx:if="{{qrcodeDialog}}">
     <view class="qr-content">

+ 21 - 3
pages/my/my.js

@@ -1,7 +1,8 @@
 // pages/my/my.js
-import { getAccountNmber } from '../../api/appointment'
+import { getAccountNmber, appointmentList } from '../../api/appointment'
 import { documentList } from "../../api/document"
-import { appointmentList } from '../../api/appointment'
+import { appGetConfigImg } from '../../api/index'
+
 const app = getApp()
 Page({
 
@@ -68,7 +69,8 @@ Page({
         url: '/pages/aatest/test',
         imgUrl: '../../imaes/shezhi@2x.png'
       } */
-    ]
+    ],
+    imageList: []
   },
 
   onShow () {
@@ -92,6 +94,22 @@ Page({
     })
     this.getAccountNmberFn()
     this.appointmentListFn()
+    this.getAppGetConfigImg()
+  },
+
+  getAppGetConfigImg() {
+    const that = this
+    wx.showNavigationBarLoading()
+    // 类型  【1.关于我的 2.用户协议 3.我的 4.实体卡兑换说明 】
+    appGetConfigImg({
+      'imgType': '3'
+    }).then(configRes => {
+      wx.hideNavigationBarLoading()
+      console.log(configRes, 'configRes my')
+      that.setData({
+        imageList: configRes.data || []
+      })
+    })
   },
 
   // 获取用户档案信息

+ 5 - 14
pages/my/my.wxml

@@ -29,19 +29,10 @@
       </van-grid-item>
     </van-grid>
   </view>
-  <van-overlay show="{{ overshow }}">
-    <view class="wrapper ittflex">
-      <view class="userinfo-auth-modal">
-        <view class="modal-title">申请权限</view>
-        <view class="px-border"></view>
-        <view class="app-logo">
-          <image class="logopng" src="../../imaes/logo1@2x.png"></image>
-        </view>
-        <view class="auth-text">
-          小程序申请授权你的公开信息(昵称,头像)
-        </view>
-        <button class="confirm auth-btn" bindtap="getUserinfo">点击授权</button>
-      </view>
+  <view class="bottom-actions">
+    <view class="b-title">小课堂</view>
+    <view class="images">
+      <image class="imageitem" wx:for="{{imageList}}" src="{{item.imgUrl}}"></image>
     </view>
-  </van-overlay>
+  </view>
 </view>

+ 25 - 0
pages/my/my.wxss

@@ -3,6 +3,8 @@
   width: 100%;
   height: 100%;
   background-color: #f7f7f7;
+  padding-bottom: 80rpx;
+  overflow-y: auto;
 }
 .my-info {
   width: 100%;
@@ -170,4 +172,27 @@
   margin-left: 10%;
   margin-top: 20rpx;
   height: 60rpx;
+}
+.bottom-actions {
+  width: 690rpx;
+  min-height: 200rpx;
+  margin: 20rpx auto 0;
+}
+.b-title {
+  width: 690;
+  font-size: 30rpx;
+  font-weight: bold;
+  color: #333333;
+  margin-bottom: 20rpx;
+}
+.images {
+  width: 100%;
+  height: auto;
+  border-radius: 20rpx;
+}
+
+.imageitem {
+  width: 100%;
+  border-radius: 20rpx;
+  margin-bottom: 20rpx;
 }

+ 6 - 0
pages/set/set.js

@@ -29,6 +29,12 @@ Page({
     })
   },
 
+  handleUserArgee () {
+    wx.navigateTo({
+      url: '/pages/userAgreement/userAgreement',
+    })
+  },
+
   handleLogout () {
     wx.showModal({
       content: '确认退出吗?',

+ 1 - 1
pages/set/set.wxml

@@ -4,7 +4,7 @@
     <view class="label">已绑定手机号</view>
     <view class="value bindphone">{{bindPhone}}</view>
   </view>
-  <view class="set-item col-b ittflex-jcb userprotal">
+  <view class="set-item col-b ittflex-jcb userprotal" bindtap="handleUserArgee">
     <view class="label">用户协议</view>
     <van-icon style="margin-right: 30rpx;" name="arrow" color="#999"/>
   </view>

+ 63 - 0
pages/userAgreement/userAgreement.js

@@ -0,0 +1,63 @@
+// pages/userAgreement/userAgreement.js
+import { appGetConfigImg } from '../../api/index'
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    webViewSrc: ''
+  },
+
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+    this.getAppGetConfigImg()
+  },
+
+  getAppGetConfigImg() {
+    const that = this
+    wx.showNavigationBarLoading()
+    // 类型  【1.关于我的 2.用户协议 3.我的 4.实体卡兑换说明 】
+    appGetConfigImg({
+      'imgType': '2'
+    }).then(configRes => {
+      wx.hideNavigationBarLoading()
+      console.log(configRes, 'configRes')
+      that.setData({
+        webViewSrc: configRes.data[0].imgUrl
+      })
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
pages/userAgreement/userAgreement.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "用户协议"
+}

+ 4 - 0
pages/userAgreement/userAgreement.wxml

@@ -0,0 +1,4 @@
+<!--pages/userAgreement/userAgreement.wxml-->
+<view class="userargee">
+  <web-view src="{{webViewSrc}}"></web-view>
+</view>

+ 5 - 0
pages/userAgreement/userAgreement.wxss

@@ -0,0 +1,5 @@
+/* pages/userAgreement/userAgreement.wxss */
+.userargee {
+  width: 100%;
+  height: 100%;
+}