wangxin 4 éve
szülő
commit
d1ecf010fa
33 módosított fájl, 116 hozzáadás és 77 törlés
  1. 0 12
      miniprogram/custom-tab-bar/index.wxml
  2. 9 11
      miniprogram/pages/detail/detail.js
  3. 8 10
      miniprogram/pages/detail/detail.ts
  4. 2 2
      miniprogram/pages/detail/detail.wxml
  5. 10 3
      miniprogram/pages/index/index.js
  6. 1 1
      miniprogram/pages/index/index.json
  7. 9 2
      miniprogram/pages/index/index.ts
  8. 1 1
      miniprogram/pages/index/index.wxml
  9. 1 1
      miniprogram/pages/index/index.wxss
  10. 2 2
      miniprogram/pages/login/login.js
  11. 1 1
      miniprogram/pages/login/login.ts
  12. 22 9
      miniprogram/pages/my-order/my-order.js
  13. 1 1
      miniprogram/pages/my-order/my-order.json
  14. 20 8
      miniprogram/pages/my-order/my-order.ts
  15. 2 2
      miniprogram/pages/person/person.js
  16. 1 1
      miniprogram/pages/person/person.json
  17. 1 1
      miniprogram/pages/person/person.ts
  18. 2 2
      miniprogram/pages/success/success.js
  19. 1 1
      miniprogram/pages/success/success.ts
  20. 2 0
      miniprogram/pages/userinfo/userinfo.wxss
  21. 0 0
      miniprogram/tab-bar/index.js
  22. 0 0
      miniprogram/tab-bar/index.json
  23. 0 0
      miniprogram/tab-bar/index.ts
  24. 12 0
      miniprogram/tab-bar/index.wxml
  25. 3 2
      miniprogram/custom-tab-bar/index.wxss
  26. 0 0
      miniprogram/tab-bar/tabBarImage/home-select.png
  27. 0 0
      miniprogram/tab-bar/tabBarImage/home.png
  28. 0 0
      miniprogram/tab-bar/tabBarImage/order-select.png
  29. 0 0
      miniprogram/tab-bar/tabBarImage/order.png
  30. 0 0
      miniprogram/tab-bar/tabBarImage/person-selected.png
  31. 0 0
      miniprogram/tab-bar/tabBarImage/person.png
  32. 3 2
      miniprogram/utils/util.js
  33. 2 2
      miniprogram/utils/util.ts

+ 0 - 12
miniprogram/custom-tab-bar/index.wxml

@@ -1,12 +0,0 @@
-<!--custom-tab-bar/index.wxml-->
-<cover-view class="tab-bar">
-	<cover-view class="tab-bar-border"></cover-view>
-	<block wx:for="{{list}}" wx:key="index">
-		<cover-view wx:if="{{item.showTab}}" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">
-			<cover-image src="{{route === item.pagePath ? item.selectedIconPath : item.iconPath}}"></cover-image>
-			<cover-view
-				style="color: {{route === item.pagePath ? selectedColor : color}};opacity:{{route === item.pagePath ? 1 : 0.45}}">
-				{{item.text}}</cover-view>
-		</cover-view>
-	</block>
-</cover-view>

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 9 - 11
miniprogram/pages/detail/detail.js


+ 8 - 10
miniprogram/pages/detail/detail.ts

@@ -58,7 +58,8 @@ Page({
     options: {
       id: 0,
       status: ''
-    }
+    },
+    detail_status: 0
     // btn_message: ''
   },
   /**
@@ -134,13 +135,10 @@ Page({
         showCancel: false,
         confirmText: '知道了',
         success: () => {
-          const hwOrderAPI = this.data.hwOrderAPI
-          hwOrderAPI.status = 5
           this.setData({
-            status: 2,
-            hwOrderAPI
+            detail_status: 5
           })
-          putStorageSync(`orderDetail_${this.data.id}`, this.data.id, hwOrderAPI.status)
+          putStorageSync(`orderDetail_${this.data.id}`, this.data.id)
         }
       })
     }
@@ -375,10 +373,6 @@ Page({
           orderId: options.id
         }).then(res => {
           if (res.errCode === 0) {
-            const id = getStorageSync(`orderDetail_${this.data.id}`)
-            if (id) {
-              res.data.hwOrderAPI.status = 2
-            }
             this.setData({
               ...res.data.hwRequirementAPI,
               hwOrderAPI: res.data.hwOrderAPI,
@@ -396,6 +390,10 @@ Page({
           hwRequirementId: options.id
         }).then(res => {
           if (res.errCode === 0) {
+            const id = getStorageSync(`orderDetail_${res.data.hwRequirementAPI.id}`)
+            if (id) {
+              res.data.hwRequirementAPI.detail_status = 5
+            }
             this.setData({
               ...res.data.hwRequirementAPI,
               displayCancel: res.data.displayCancel || null,

+ 2 - 2
miniprogram/pages/detail/detail.wxml

@@ -181,11 +181,11 @@
 	</view>
 	<view class="button safe-area-bottom">
 		<block wx:if="{{status === 1}}">
-			<view class="button-content" bindtap="apply" wx:if="{{!displayCancel&&needEnrollment}}">我要报名</view>
+			<view class="button-content" bindtap="apply" wx:if="{{detail_status === 0}}">我要报名</view>
+			<view class="button-content disabled" wx:if="{{detail_status === 5}}">企业确认中</view>
 		</block>
 		<block wx:if="{{status===2}}">
 			<view class="button-content" bindtap="buttonSubmit" wx:if="{{hwOrderAPI.status === 0}}">确认签署</view>
-			<view class="button-content disabled" wx:if="{{hwOrderAPI.status ===5}}">企业确认中</view>
 			<view class="button-content disabled" wx:if="{{hwOrderAPI.status === 2}}">订单进行中</view>
 			<view class="button-content disabled" wx:if="{{hwOrderAPI.status === 1}}">订单已完成</view>
 		</block>

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 10 - 3
miniprogram/pages/index/index.js


+ 1 - 1
miniprogram/pages/index/index.json

@@ -3,6 +3,6 @@
   "enablePullDownRefresh": true,
   "usingComponents": {
     "select-district": "/component/select-district/select-district",
-    "tabBar":"../../custom-tab-bar/index"
+    "tabBar":"../../tab-bar/index"
   }
 }

+ 9 - 2
miniprogram/pages/index/index.ts

@@ -2,6 +2,7 @@
 //获取应用实例
 import { getRequirementsImpl, } from "../../service/impl/hwRequirement.impl";
 import { bannerApi } from "../../service/hwUser";
+import { getStorageSync } from "../../utils/util";
 const app = getApp()
 let cover_animation: any = {}
 Page({
@@ -251,7 +252,7 @@ Page({
                 confirmColor: '#31364C',
                 success: res => {
                     if (res.confirm) {
-                        wx.navigateTo({
+                        wx.reLaunch({
                             url: '/pages/login/login',
                         })
                     }
@@ -333,6 +334,12 @@ Page({
                     }
                     // 在成功后页数加一方便日后调用
                     _pageNo++;
+                    data.data.requirements = data.data.requirements.map((value: any) => {
+                        if (getStorageSync(`orderDetail_${value.id}`)) {
+                            value.status = 5
+                        }
+                        return value
+                    })
                     this.setData({
                         pageNo: _pageNo,
                         [`list[${_pageNo - 2}]`]: data.data.requirements,
@@ -390,7 +397,7 @@ Page({
                 })
             }
         } else {
-            wx.navigateTo({
+            wx.reLaunch({
                 url: '/pages/login/login',
             })
         }

+ 1 - 1
miniprogram/pages/index/index.wxml

@@ -107,7 +107,7 @@
             <text>任务数: {{item.number || '若干'}}</text>
           </view>
         </view>
-        <image src="../../imgs/yibaoming.png" class="icon" wx:if='{{item.isEnrollment}}'></image>
+        <image src="../../imgs/yibaoming.png" class="icon" wx:if='{{item.status === 5}}'></image>
       </view>
     </block>
 

+ 1 - 1
miniprogram/pages/index/index.wxss

@@ -349,7 +349,7 @@ swiper-item image {
   position: fixed;
   left: 750rpx;
   top: 0;
-  z-index: 3;
+  z-index: 1000;
   background: #fff;
   box-sizing: border-box;
 }

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 2 - 2
miniprogram/pages/login/login.js


+ 1 - 1
miniprogram/pages/login/login.ts

@@ -126,7 +126,7 @@ Page({
     phoneInter = setTimeout(_ => {
       let formatPhone: string
       if (phone.length === 11) {
-        formatPhone = value.replace(/^(.{3})(.*)(.{4})/, '$1 $2 $3');
+        formatPhone = phone.replace(/^(.{3})(.*)(.{4})/, '$1 $2 $3');
         this.setData({
           formatPhone
         })

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 22 - 9
miniprogram/pages/my-order/my-order.js


+ 1 - 1
miniprogram/pages/my-order/my-order.json

@@ -3,6 +3,6 @@
   "enablePullDownRefresh": true,
   "usingComponents": {
     "empty": "/component/empty/empty",
-    "tabBar":"../../custom-tab-bar/index"
+    "tabBar":"../../tab-bar/index"
   }
 }

+ 20 - 8
miniprogram/pages/my-order/my-order.ts

@@ -152,18 +152,21 @@ Page({
   reload() {
     this.getList(1)
   },
+  checkLogin(): Boolean {
+    if (wx.getStorageSync('userId') && wx.getStorageSync('userToken')) {
+      return true
+    } else {
+      wx.reLaunch({
+        url: '/pages/login/login',
+      })
+      return false
+    }
+  },
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function () {
-    wx.hideHomeButton();
-    // 获取订单列表
-    this.setData({
-      list: [],
-      pageNo: 1
-    }, () => {
-      this.getList()
-    })
+    this.checkLogin()
   },
 
   /**
@@ -178,6 +181,15 @@ Page({
    */
   onShow: function () {
     wx.hideHomeButton();
+    if (this.checkLogin()) {
+      // 获取订单列表
+      this.setData({
+        list: [],
+        pageNo: 1
+      }, () => {
+        this.getList()
+      })
+    }
   },
 
   /**

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 2 - 2
miniprogram/pages/person/person.js


+ 1 - 1
miniprogram/pages/person/person.json

@@ -1,6 +1,6 @@
 {
   "navigationBarTitleText": "个人中心",
   "usingComponents": {
-    "tabBar": "../../custom-tab-bar/index"
+    "tabBar": "../../tab-bar/index"
   }
 }

+ 1 - 1
miniprogram/pages/person/person.ts

@@ -68,7 +68,7 @@ Page({
         userInfo: wx.getStorageSync('userInfo'),
       })
     } else {
-      wx.navigateTo({
+      wx.reLaunch({
         url: '/pages/login/login',
       })
     }

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 2 - 2
miniprogram/pages/success/success.js


+ 1 - 1
miniprogram/pages/success/success.ts

@@ -46,7 +46,7 @@ Page({
         version: true
       }, () => {
         setTimeout(_ => {
-          wx.redirectTo({
+          wx.reLaunch({
             url: '/pages/login/login',
           })
         }, 2000)

+ 2 - 0
miniprogram/pages/userinfo/userinfo.wxss

@@ -17,6 +17,7 @@ page {
   display: flex;
   align-items: center;
   justify-content: space-between;
+  margin-bottom: 1rpx;
 }
 
 .avatar {
@@ -48,6 +49,7 @@ page {
   display: flex;
   align-items: center;
   justify-content: space-between;
+  margin-bottom: 1rpx;
 }
 
 .left {

miniprogram/custom-tab-bar/index.js → miniprogram/tab-bar/index.js


miniprogram/custom-tab-bar/index.json → miniprogram/tab-bar/index.json


miniprogram/custom-tab-bar/index.ts → miniprogram/tab-bar/index.ts


+ 12 - 0
miniprogram/tab-bar/index.wxml

@@ -0,0 +1,12 @@
+<!--custom-tab-bar/index.wxml-->
+<view class="tab-bar">
+	<view class="tab-bar-border"></view>
+	<block wx:for="{{list}}" wx:key="index">
+		<view wx:if="{{item.showTab}}" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">
+			<image src="{{route === item.pagePath ? item.selectedIconPath : item.iconPath}}"></image>
+			<view
+				style="color: {{route === item.pagePath ? selectedColor : color}};opacity:{{route === item.pagePath ? 1 : 0.45}}">
+				{{item.text}}</view>
+		</view>
+	</block>
+</view>

+ 3 - 2
miniprogram/custom-tab-bar/index.wxss

@@ -4,6 +4,7 @@
 	bottom: 0;
 	left: 0;
 	right: 0;
+	z-index: 100;
 	height: 110rpx;
 	background: white;
 	display: flex;
@@ -29,11 +30,11 @@
 	flex-direction: column;
 }
 
-.tab-bar-item cover-image {
+.tab-bar-item image {
 	width: 96rpx;
 	height: 68rpx;
 }
 
-.tab-bar-item cover-view {
+.tab-bar-item view {
 	font-size: 20rpx;
 }

miniprogram/custom-tab-bar/tabBarImage/home-select.png → miniprogram/tab-bar/tabBarImage/home-select.png


miniprogram/custom-tab-bar/tabBarImage/home.png → miniprogram/tab-bar/tabBarImage/home.png


miniprogram/custom-tab-bar/tabBarImage/order-select.png → miniprogram/tab-bar/tabBarImage/order-select.png


miniprogram/custom-tab-bar/tabBarImage/order.png → miniprogram/tab-bar/tabBarImage/order.png


miniprogram/custom-tab-bar/tabBarImage/person-selected.png → miniprogram/tab-bar/tabBarImage/person-selected.png


miniprogram/custom-tab-bar/tabBarImage/person.png → miniprogram/tab-bar/tabBarImage/person.png


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 3 - 2
miniprogram/utils/util.js


+ 2 - 2
miniprogram/utils/util.ts

@@ -212,7 +212,7 @@ export function getHwUserInfo() {
  * @param value 
  * @param time 
  */
-export function putStorageSync(key: string, value: any, time: number): void {
+export function putStorageSync(key: string, value: any, time: number = 86400000): void {
   wx.setStorageSync(key, value)
   const _time: number = Date.now()
   wx.setStorageSync(key + 'redis', _time + time)
@@ -224,7 +224,7 @@ export function putStorageSync(key: string, value: any, time: number): void {
  */
 export function getStorageSync(key: string): any {
   const time: number = wx.getStorageSync(key + 'redis')
-  if (Date.now() > time) {
+  if (!time || Date.now() > time) {
     wx.removeStorageSync(key)
     wx.removeStorageSync(key + 'redis')
     return ''