wangxin преди 4 години
родител
ревизия
39e3303573
променени са 100 файла, в които са добавени 2509 реда и са изтрити 197 реда
  1. BIN
      .DS_Store
  2. 13 0
      .gitignore
  3. 0 22
      app.wxss
  4. BIN
      component/.DS_Store
  5. 0 26
      component/empty/empty.wxss
  6. 0 21
      config.js
  7. BIN
      images/.DS_Store
  8. BIN
      images/empty.png
  9. BIN
      images/icon/.DS_Store
  10. 33 0
      miniprogram/api/api.js
  11. 9 3
      utils/api.js
  12. 66 0
      miniprogram/app.js
  13. 2 2
      app.json
  14. 31 44
      app.js
  15. 0 0
      miniprogram/app.wxs
  16. 8 0
      miniprogram/app.wxss
  17. BIN
      miniprogram/assets/img/login_bottom.png
  18. BIN
      miniprogram/assets/img/login_logo.png
  19. BIN
      miniprogram/assets/img/login_top.png
  20. 20 0
      miniprogram/component/empty/empty.js
  21. 0 0
      miniprogram/component/empty/empty.json
  22. 1 1
      component/empty/empty.js
  23. 0 0
      miniprogram/component/empty/empty.wxml
  24. 30 0
      miniprogram/component/empty/empty.wxss
  25. 0 0
      miniprogram/component/select-district/select-district.js
  26. 0 0
      miniprogram/component/select-district/select-district.json
  27. 1 1
      component/select-district/select-district.wxml
  28. 1 1
      component/select-district/select-district.wxss
  29. 7 0
      miniprogram/config.js
  30. 20 0
      miniprogram/config.ts
  31. 60 0
      miniprogram/custom-tab-bar/index.js
  32. 3 0
      miniprogram/custom-tab-bar/index.json
  33. 71 0
      miniprogram/custom-tab-bar/index.ts
  34. 12 0
      miniprogram/custom-tab-bar/index.wxml
  35. 39 0
      miniprogram/custom-tab-bar/index.wxss
  36. BIN
      miniprogram/custom-tab-bar/tabBarImage/home-select.png
  37. BIN
      miniprogram/custom-tab-bar/tabBarImage/home.png
  38. BIN
      miniprogram/custom-tab-bar/tabBarImage/order-select.png
  39. BIN
      miniprogram/custom-tab-bar/tabBarImage/order.png
  40. BIN
      miniprogram/custom-tab-bar/tabBarImage/person-selected.png
  41. BIN
      miniprogram/custom-tab-bar/tabBarImage/person.png
  42. 0 0
      miniprogram/data/district.js
  43. BIN
      miniprogram/images/empty.png
  44. 0 0
      images/icon/address.png
  45. 0 0
      images/icon/address_for_detail.png
  46. 0 0
      miniprogram/images/icon/agreement-privacy.png
  47. 0 0
      images/icon/already.png
  48. 0 0
      images/icon/apply.png
  49. 0 0
      images/icon/avatar.png
  50. 0 0
      miniprogram/images/icon/cancel.png
  51. 0 0
      images/icon/close.png
  52. 0 0
      miniprogram/images/icon/common-setting.png
  53. 0 0
      images/icon/down-empty-action.png
  54. 0 0
      images/icon/down.png
  55. 0 0
      miniprogram/images/icon/empty.png
  56. 0 0
      images/icon/job.png
  57. 0 0
      images/icon/jobs.png
  58. 0 0
      miniprogram/images/icon/loading.png
  59. 0 0
      miniprogram/images/icon/logo.png
  60. 0 0
      images/icon/money.png
  61. 0 0
      miniprogram/images/icon/offline.png
  62. 0 0
      images/icon/order.png
  63. 0 0
      images/icon/out.png
  64. 0 0
      images/icon/person.png
  65. 0 0
      images/icon/phone.png
  66. 0 0
      images/icon/right.png
  67. 0 0
      images/icon/setting.png
  68. 0 0
      images/icon/tax.png
  69. 0 0
      images/icon/time.png
  70. 0 0
      images/icon/tower.png
  71. 0 0
      images/icon/underway.png
  72. 0 0
      images/icon/up-empty.png
  73. 0 0
      images/icon/up.png
  74. 0 0
      miniprogram/images/icon/version.png
  75. 0 0
      miniprogram/images/icon/yibaoming.png
  76. 0 0
      miniprogram/images/login.png
  77. 0 0
      miniprogram/images/tax.png
  78. 0 0
      miniprogram/images/update.png
  79. BIN
      miniprogram/imgs/address.png
  80. BIN
      miniprogram/imgs/number.png
  81. BIN
      miniprogram/imgs/offline.png
  82. BIN
      miniprogram/imgs/sigin.png
  83. BIN
      miniprogram/imgs/time.png
  84. BIN
      miniprogram/imgs/yibaoming.png
  85. 68 0
      miniprogram/pages/common-setting/common-setting.js
  86. 0 0
      miniprogram/pages/common-setting/common-setting.json
  87. 4 5
      pages/common-setting/common-setting.js
  88. 4 4
      pages/common-setting/common-setting.wxml
  89. 32 19
      pages/common-setting/common-setting.wxss
  90. 333 0
      miniprogram/pages/detail/detail.js
  91. 0 0
      miniprogram/pages/detail/detail.json
  92. 457 0
      miniprogram/pages/detail/detail.ts
  93. 70 13
      pages/detail/detail.wxml
  94. 170 22
      pages/detail/detail.wxss
  95. 391 0
      miniprogram/pages/index/index.js
  96. 2 1
      pages/index/index.json
  97. 505 0
      miniprogram/pages/index/index.ts
  98. 46 12
      pages/index/index.wxml
  99. 0 0
      miniprogram/pages/index/index.wxs
  100. 0 0
      pages/index/index.wxss

BIN
.DS_Store


+ 13 - 0
.gitignore

@@ -1 +1,14 @@
+# Windows
+[Dd]esktop.ini
+Thumbs.db
+$RECYCLE.BIN/
+
+# macOS
 .DS_Store
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+
+# Node.js
+node_modules/

+ 0 - 22
app.wxss

@@ -1,22 +0,0 @@
-/**app.wxss**/
-@import '/style/template.wxss';
-
-page {
-  background: #f5f5f5;
-  font-family: PingFangSC-Regular, PingFang SC;
-}
-
-.global-family {
-  font-family: PingFangSC-Medium, PingFang SC;
-}
-
-.container {
-  display: flex;
-  flex-direction: column;
-  box-sizing: border-box;
-}
-
-.safe-area {
-  padding-bottom: constant(safe-area-inset-bottom);
-  padding-bottom: env(safe-area-inset-bottom);
-}

BIN
component/.DS_Store


+ 0 - 26
component/empty/empty.wxss

@@ -1,26 +0,0 @@
-/* component/empty/empty.wxss */
-
-.empty {
-  height: 70vh;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-}
-
-.empty image {
-  height: 325rpx;
-  width: 340rpx;
-}
-
-.empty-text {
-  font-size: 42rpx;
-  color: #31364c;
-  margin-top: 45rpx;
-}
-
-.empty-message {
-  font-size: 32rpx;
-  color: #888a8e;
-  margin-top: 15rpx;
-}

+ 0 - 21
config.js

@@ -1,21 +0,0 @@
-// 测试服
-// const apiUrl = "https://hw.hap-job.com/happy-boot"
-// const baseurl = "https://hw.hap-job.com"
-// const captcha = '2072736870'
-// const imgServerUrl = "https://hpjobtest.oss-cn-shanghai.aliyuncs.com/uploadfiles/mina"//图片服务器地址
-// const imgServerUrl_new = "https://hpjobtest.oss-cn-shanghai.aliyuncs.com"//图片服务器地址
-// 正式服
-const apiUrl = "https://www.dal-pay.com/happy-boot"
-const baseurl = "https://www.dal-pay.com"
-const captcha = '2012155849'
-// const imgServerUrl = "https://happyjob.oss-cn-shanghai.aliyuncs.com/uploadfiles/mina"//图片服务器地址
-// const imgServerUrl_new = "https://happyjob.oss-cn-shanghai.aliyuncs.com"//图片服务器地址
-
-
-module.exports = {
-  apiUrl,
-  baseurl,
-  captcha,
-  // imgServerUrl,
-  // imgServerUrl_new
-}

BIN
images/.DS_Store


BIN
images/empty.png


BIN
images/icon/.DS_Store


Файловите разлики са ограничени, защото са твърде много
+ 33 - 0
miniprogram/api/api.js


+ 9 - 3
utils/api.js

@@ -1,6 +1,12 @@
-/* api接口地址 */
-
-module.exports = {
+/*
+ * @Author: your name
+ * @Date: 2021-06-23 23:14:14
+ * @LastEditTime: 2021-06-24 00:26:04
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: \Mina_B_T\miniprogram\api\api.ts
+ */
+export default {
   hwuser: {
     getAuthCode: '/api/hwuser/getCaptchaCode', //获取验证码
     phoneLogin: '/api/hwuser/phoneLogin', //手机号登陆

Файловите разлики са ограничени, защото са твърде много
+ 66 - 0
miniprogram/app.js


+ 2 - 2
app.json

@@ -18,8 +18,8 @@
   ],
   "window": {
     "backgroundTextStyle": "light",
-    "navigationBarBackgroundColor": "#fff",
-    "navigationBarTextStyle": "black"
+    "navigationBarBackgroundColor": "#1890FF",
+    "navigationBarTextStyle": "white"
   },
   "navigateToMiniProgramAppIdList": ["wx5a3a7366fd07e119"],
   "sitemapLocation": "sitemap.json"

+ 31 - 44
app.js

@@ -1,34 +1,48 @@
-//app.js
-require('./utils/request');
-import { Watch } from './utils/watch';
-App({
+/*
+ * @Author: your name
+ * @Date: 2021-06-23 22:15:11
+ * @LastEditTime: 2021-06-24 21:01:33
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: \Mina_B_T\miniprogram\app.ts
+ */
+// app.ts
 
+App<IAppOption>({
+  globalData: {
+    captchaTicketExpire: null,
+    captchaResult: null,
+    phone_zz: /1[0-9]{10}/,
+    webview: null,
+    version: '1.2.1',
+    platformId: 1
+  },
   /**
    * 当小程序初始化完成时,会触发 onLaunch(全局只触发一次)
    */
-  onLaunch: function () {
-    new Watch(wx, this.watchData);
+  onLaunch() {
     if (!wx.getStorageSync('hasClear')) {
       wx.clearStorage({
-        success: (res) => {
+        success: () => {
           wx.setStorageSync('hasClear', true)
         },
       })
     }
   },
+
   /**
    * 当小程序启动,或从后台进入前台显示,会触发 onShow
    */
-  onShow: function (options) {
-    if (!this.captchaTicketExpire) this.captchaTicketExpire = {};
+  onShow(options: any) {    
+    if (!this.globalData.captchaTicketExpire) this.globalData.captchaTicketExpire = {};
 
     if (options.referrerInfo.appId === 'wx5a3a7366fd07e119') {
       const result = options.referrerInfo.extraData;
       if (result.ret === 0) {
         const ticket = result.ticket;
-        if (!this.captchaTicketExpire[ticket]) {
-          this.captchaResult = result;
-          this.captchaTicketExpire[ticket] = true;
+        if (!this.globalData.captchaTicketExpire[ticket]) {
+          this.globalData.captchaResult = result;
+          this.globalData.captchaTicketExpire[ticket] = true;
         }
       }
     }
@@ -36,7 +50,7 @@ App({
       const updateManager = wx.getUpdateManager();
       updateManager.onCheckForUpdate(res => {
         if (res.hasUpdate) {
-          updateManager.onUpdateReady(res => {
+          updateManager.onUpdateReady(() => {
             wx.showModal({
               title: '更新提示',
               content: '新版本上线了,请点击确定按钮更新!',
@@ -48,7 +62,7 @@ App({
               }
             })
           })
-          updateManager.onUpdateFailed(res => {
+          updateManager.onUpdateFailed(() => {
             wx.showModal({
               title: '更新提示',
               content: '新版本已上线,请删除当前小程序,重新搜索进入',
@@ -63,40 +77,13 @@ App({
   /**
    * 当小程序从前台进入后台,会触发 onHide
    */
-  onHide: function () {
-    // if (wx.getStorageSync('userinfo').registerFrom === 2) {
-
-    // } else {
-    //   wx.clearStorage();
-    // }
+  onHide() {
   },
 
   /**
    * 当小程序发生脚本错误,或者 api 调用失败时,会触发 onError 并带上错误信息
    */
-  onError: function (msg) {
-    console.log(msg)
-  },
-  /**
-   * 工具类
-   */
-  utils: require('/utils/util.js').Utils,
-  /**
-   * 全局变量集合
-   */
-  globalData: {
-    userInfo: null,
-    phone_zz: /1[0-9]{10}/,
-    webview: null,
-    version: '1.2.1',
-    platformId: 1
-  },
-  /**
-   * 需要监测的全局变量
-   */
-  watchData: {
-    offline: false,
-    userinfo: {},
-    is_login: Boolean(wx.getStorageSync('userid'))
+  onError(msg) {
+    console.error(msg)
   },
 })

app.wxs → miniprogram/app.wxs


+ 8 - 0
miniprogram/app.wxss

@@ -0,0 +1,8 @@
+/**app.wxss**/
+.container{
+	
+}
+.safe-area-bottom {
+  padding-bottom: constant(safe-area-inset-bottom); /* 兼容 iOS < 11.2 */
+  padding-bottom: env(safe-area-inset-bottom); /* 兼容 iOS >= 11.2 */
+}

BIN
miniprogram/assets/img/login_bottom.png


BIN
miniprogram/assets/img/login_logo.png


BIN
miniprogram/assets/img/login_top.png


Файловите разлики са ограничени, защото са твърде много
+ 20 - 0
miniprogram/component/empty/empty.js


component/empty/empty.json → miniprogram/component/empty/empty.json


+ 1 - 1
component/empty/empty.js

@@ -10,7 +10,7 @@ Component({
     },
     title: { /* 提示标题 */
       type: String,
-      value: '空空如也'
+      value: '无内容'
     },
     message: { /* 提示信息 */
       type: String,

component/empty/empty.wxml → miniprogram/component/empty/empty.wxml


+ 30 - 0
miniprogram/component/empty/empty.wxss

@@ -0,0 +1,30 @@
+/* component/empty/empty.wxss */
+
+.empty {
+  height: 70%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+}
+
+.empty image {
+  height: 260rpx;
+  width: 260rpx;
+}
+
+.empty-text {
+  font-size: 34rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: rgba(0, 0, 0, 0.45);
+  margin-top: 100rpx;
+}
+
+.empty-message {
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: rgba(0, 0, 0, 0.25);
+  margin-top: 10rpx;
+}

component/select-district/select-district.js → miniprogram/component/select-district/select-district.js


component/select-district/select-district.json → miniprogram/component/select-district/select-district.json


+ 1 - 1
component/select-district/select-district.wxml

@@ -1,5 +1,5 @@
 <!--component/select-district/select-district.wxml-->
-<view class="cover safe-area">
+<view class="cover safe-area-bottom">
   <view class="district">
     <view class="district-title">
       <text>全部区域</text>

+ 1 - 1
component/select-district/select-district.wxss

@@ -106,7 +106,7 @@
   border-radius: 10rpx;
 }
 
-.safe-area {
+.safe-area-bottom {
   padding-bottom: constant(safe-area-inset-bottom);
   padding-bottom: env(safe-area-inset-bottom);
 }

Файловите разлики са ограничени, защото са твърде много
+ 7 - 0
miniprogram/config.js


+ 20 - 0
miniprogram/config.ts

@@ -0,0 +1,20 @@
+/*
+ * @Author: your name
+ * @Date: 2021-06-24 00:14:39
+ * @LastEditTime: 2021-06-24 00:17:41
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: \Mina_B_T\miniprogram\config.ts
+ */
+// 测试服
+export const apiUrl = "https://hw.hap-job.com/happy-boot"
+export const baseurl = "https://hw.hap-job.com"
+export const captcha = '2072736870'
+// export const imgServerUrl = "https://hpjobtest.oss-cn-shanghai.aliyuncs.com/uploadfiles/mina"//图片服务器地址
+// export const imgServerUrl_new = "https://hpjobtest.oss-cn-shanghai.aliyuncs.com"//图片服务器地址
+// 正式服
+// export const apiUrl = "https://www.dal-pay.com/happy-boot"
+// export const baseurl = "https://www.dal-pay.com"
+// export const captcha = '2012155849'
+// export const imgServerUrl = "https://happyjob.oss-cn-shanghai.aliyuncs.com/uploadfiles/mina"//图片服务器地址
+// export const imgServerUrl_new = "https://happyjob.oss-cn-shanghai.aliyuncs.com"//图片服务器地址

Файловите разлики са ограничени, защото са твърде много
+ 60 - 0
miniprogram/custom-tab-bar/index.js


+ 3 - 0
miniprogram/custom-tab-bar/index.json

@@ -0,0 +1,3 @@
+{
+	"component": true
+}

+ 71 - 0
miniprogram/custom-tab-bar/index.ts

@@ -0,0 +1,71 @@
+// custom-tab-bar/index.js
+Component({
+	pageLifetimes: {
+		show: function () {
+			const routeList = getCurrentPages()
+			this.setData({
+				route: routeList[routeList.length - 1].route
+			})
+			const userInfo = wx.getStorageSync('userInfo')
+			if (!userInfo.isDemonstrate) {
+				if (routeList[routeList.length - 1].route === this.data.list[1].pagePath) {
+					wx.reLaunch({
+						url: '/' + this.data.list[0].pagePath
+					})
+				}
+				this.setData({
+					[`list[1].showTab`]: false
+				})
+			}
+		},
+	},
+	/**
+	 * 组件的属性列表
+	 */
+	properties: {
+
+	},
+
+	/**
+	 * 组件的初始数据
+	 */
+	data: {
+		route: '',
+		color: "#000000",
+		selectedColor: "#1890FF",
+		list: [
+			{
+				pagePath: "pages/my-order/my-order",
+				iconPath: "./tabBarImage/order.png",
+				selectedIconPath: "./tabBarImage/order-select.png",
+				text: "我的订单",
+				showTab: true,
+			},
+			{
+				pagePath: "pages/index/index",
+				iconPath: "./tabBarImage/home.png",
+				selectedIconPath: "./tabBarImage/home-select.png",
+				text: "需求大厅",
+				showTab: true,
+			},
+			{
+				pagePath: "pages/person/person",
+				iconPath: "./tabBarImage/person.png",
+				selectedIconPath: "./tabBarImage/person-selected.png",
+				text: "个人中心",
+				showTab: true,
+			},
+		]
+	},
+
+	/**
+	 * 组件的方法列表
+	 */
+	methods: {
+		switchTab(e: any) {
+			const data = e.currentTarget.dataset
+			const url = data.path
+			wx.reLaunch({ url: `/${url}` })
+		}
+	}
+})

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

@@ -0,0 +1,12 @@
+<!--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>

+ 39 - 0
miniprogram/custom-tab-bar/index.wxss

@@ -0,0 +1,39 @@
+/* custom-tab-bar/index.wxss */
+.tab-bar {
+	position: fixed;
+	bottom: 0;
+	left: 0;
+	right: 0;
+	height: 110rpx;
+	background: white;
+	display: flex;
+	padding-bottom: env(safe-area-inset-bottom);
+}
+
+.tab-bar-border {
+	background-color: rgba(0, 0, 0, 0.33);
+	position: absolute;
+	left: 0;
+	top: 0;
+	width: 100%;
+	height: 1rpx;
+	transform: scaleY(0.5);
+}
+
+.tab-bar-item {
+	flex: 1;
+	text-align: center;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	flex-direction: column;
+}
+
+.tab-bar-item cover-image {
+	width: 96rpx;
+	height: 68rpx;
+}
+
+.tab-bar-item cover-view {
+	font-size: 20rpx;
+}

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


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


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


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


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


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


data/district.js → miniprogram/data/district.js


BIN
miniprogram/images/empty.png


+ 0 - 0
images/icon/address.png


+ 0 - 0
images/icon/address_for_detail.png


images/icon/agreement-privacy.png → miniprogram/images/icon/agreement-privacy.png


+ 0 - 0
images/icon/already.png


+ 0 - 0
images/icon/apply.png


+ 0 - 0
images/icon/avatar.png


images/icon/cancel.png → miniprogram/images/icon/cancel.png


+ 0 - 0
images/icon/close.png


images/icon/common-setting.png → miniprogram/images/icon/common-setting.png


+ 0 - 0
images/icon/down-empty-action.png


+ 0 - 0
images/icon/down.png


images/icon/empty.png → miniprogram/images/icon/empty.png


+ 0 - 0
images/icon/job.png


+ 0 - 0
images/icon/jobs.png


images/icon/loading.png → miniprogram/images/icon/loading.png


images/icon/logo.png → miniprogram/images/icon/logo.png


+ 0 - 0
images/icon/money.png


images/icon/offline.png → miniprogram/images/icon/offline.png


+ 0 - 0
images/icon/order.png


+ 0 - 0
images/icon/out.png


+ 0 - 0
images/icon/person.png


+ 0 - 0
images/icon/phone.png


+ 0 - 0
images/icon/right.png


+ 0 - 0
images/icon/setting.png


+ 0 - 0
images/icon/tax.png


+ 0 - 0
images/icon/time.png


+ 0 - 0
images/icon/tower.png


+ 0 - 0
images/icon/underway.png


+ 0 - 0
images/icon/up-empty.png


+ 0 - 0
images/icon/up.png


images/icon/version.png → miniprogram/images/icon/version.png


images/icon/yibaoming.png → miniprogram/images/icon/yibaoming.png


images/login.png → miniprogram/images/login.png


images/tax.png → miniprogram/images/tax.png


images/update.png → miniprogram/images/update.png


BIN
miniprogram/imgs/address.png


BIN
miniprogram/imgs/number.png


BIN
miniprogram/imgs/offline.png


BIN
miniprogram/imgs/sigin.png


BIN
miniprogram/imgs/time.png


BIN
miniprogram/imgs/yibaoming.png


Файловите разлики са ограничени, защото са твърде много
+ 68 - 0
miniprogram/pages/common-setting/common-setting.js


pages/common-setting/common-setting.json → miniprogram/pages/common-setting/common-setting.json


+ 4 - 5
pages/common-setting/common-setting.js

@@ -21,11 +21,10 @@ Page({
   // 注销账号
   cancellation() {
     wx.clearStorage({
-      success: res => {
+      success: () => {
         this.setData({
           cancellation: false
-        })
-        wx.$emit('is_login', false, () => {
+        }, () => {
           wx.navigateBack({
             delta: 2
           })
@@ -36,7 +35,7 @@ Page({
   // 退出登录
   logout() {
     wx.clearStorage({
-      success: res => {
+      success: () => {
         wx.reLaunch({
           url: '/pages/index/index',
         })
@@ -46,7 +45,7 @@ Page({
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function (options) {
+  onLoad: function () {
     // 判断是否有获取账户信息的api 有的话取活的
     if (wx.getAccountInfoSync) {
       const info = wx.getAccountInfoSync()

+ 4 - 4
pages/common-setting/common-setting.wxml

@@ -1,5 +1,5 @@
 <!--pages/common-setting/common-setting.wxml-->
-<view class="container">
+<view class="container safe-area-bottom">
 
 	<view class="logo">
 		<image src="/images/icon/logo.png" class="logo-image"></image>
@@ -10,10 +10,10 @@
 
 
 	<!-- 个人信息 -->
-	<view class="cell-grounp">
+	<view class="cell-group">
 		<navigator class="cell" url="/pages/web-view/web-view?url={{userAgreement}}" hover-class="none">
 			<view class="content">
-				<image class="cell-pic" src="/images/icon/agreement-privacy.png"></image>
+				<!-- <image class="cell-pic" src="/images/icon/agreement-privacy.png"></image> -->
 				<text>用户协议</text>
 			</view>
 			<image src="/images/icon/right.png" class="right"></image>
@@ -21,7 +21,7 @@
 
 		<navigator class="cell" url="/pages/web-view/web-view?url={{privacyPolicy}}" hover-class="none">
 			<view class="content">
-				<image class="cell-pic" src="/images/icon/version.png"></image>
+				<!-- <image class="cell-pic" src="/images/icon/version.png"></image> -->
 				<text>隐私政策</text>
 			</view>
 			<image src="/images/icon/right.png" class="right"></image>

+ 32 - 19
pages/common-setting/common-setting.wxss

@@ -1,12 +1,13 @@
 /* pages/common-setting/common-setting.wxss */
 
 page {
-  background: #f5f5f5;
+  background: #F0F1F2;
 }
 
 .logo {
-  height: 320rpx;
-  background: #fff;
+  width: 750rpx;
+  height: 368rpx;
+  background: #FFFFFF;
   display: flex;
   flex-direction: column;
   align-items: center;
@@ -16,23 +17,32 @@ page {
 }
 
 .logo-image {
-  height: 148rpx;
-  width: 148rpx;
+  width: 168rpx;
+  height: 168rpx;
+  border-radius: 28rpx;
 }
 
 .version {
-  font-size: 24rpx;
-  color: #31364C;
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: rgba(0, 0, 0, 0.65);
   margin-top: 24rpx;
 }
 
+.cell-group {
+  margin-top: 20rpx;
+}
+
 .cell {
   width: 750rpx;
-  height: 148rpx;
-  color: #31364c;
-  font-size: 28rpx;
-  background: #fff;
-  padding: 0 30rpx;
+  height: 112rpx;
+  font-size: 34rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: rgba(0, 0, 0, 0.85);
+  padding: 32rpx 40rpx;
+  background: #FFFFFF;
   box-sizing: border-box;
   display: flex;
   align-items: center;
@@ -53,18 +63,21 @@ page {
 }
 
 .right {
-  width: 18rpx;
-  height: 30rpx;
+  width: 14rpx;
+  height: 26rpx;
 }
 
 .cancellation,
 .logout {
-  height: 100rpx;
-  font-size: 32rpx;
-  color: #31364c;
+  width: 750rpx;
+  height: 112rpx;
+  line-height: 112rpx;
+  background: #FFFFFF;
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: rgba(0, 0, 0, 0.45);
   text-align: center;
-  line-height: 100rpx;
-  background: #fff;
   margin-top: 20rpx;
 }
 

Файловите разлики са ограничени, защото са твърде много
+ 333 - 0
miniprogram/pages/detail/detail.js


pages/detail/detail.json → miniprogram/pages/detail/detail.json


+ 457 - 0
miniprogram/pages/detail/detail.ts

@@ -0,0 +1,457 @@
+// pages/detail/detail.js
+const app = getApp();
+import { putStorageSync, getStorageSync } from '../../utils/util'
+// type errorMessageType = {
+//   info_name: String,
+//   idcardNumber: String,
+// }
+// // 未填写提示字段及信息
+// const errorMessage: errorMessageType = {
+//   info_name: '请填写姓名',
+//   idcardNumber: '请填写身份证号码',
+// }
+
+// type errorKeyType = {
+//   info_name: String,
+//   idcardNumber: String,
+// }
+// // 未填写key值
+// const errorKey: errorKeyType = {
+//   info_name: 'name_error',
+//   idcardNumber: 'id_error',
+// }
+import { cancelEnrollmentImpl, getRequirementDetailImpl } from '../../service/impl/hwRequirement.impl'
+// import { cancelEnrollmentImpl, enrollmentRequireImpl, getRequirementDetailImpl } from '../../service/impl/hwRequirement.impl'
+import { confirmECOrdersImpl, confirmOrderImpl, getOrderDetailImpl } from '../../service/impl/hwOrder.impl'
+import { getHwUserInfo } from '../../utils/util'
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    cover: true, // 蒙层
+    hasInfo: false, //是否拥有个人信息
+    info_name: '',
+    idcardNumber: '',
+    bright_points: '', // 亮点
+    message: { //订单状态映射
+      '0': '确认订单',
+      '1': '订单关闭',
+      '2': '已确认',
+      '3': '订单中止',
+      '4': '订单完成'
+    },
+    status: 0, //按钮状态 1 需求 2 已报名 3 订单
+    show: true, // 是否展示
+    name_error: '', // 姓名错误信息
+    id_error: '', //  身份证错误信息
+    id: 0,
+    hwOrderAPI: {
+      workContractType: -1,
+      workContract: '',
+      id: 0,
+      status: -1
+    },
+    name: '',
+    enrollId: 0,
+    options: {
+      id: 0,
+      status: ''
+    }
+    // btn_message: ''
+  },
+  /**
+   * 需求报名
+   * @requirement_id {string} 需求ID
+   * @bright_points {string}  亮点
+   * @enroll_from  {number} 报名来源(0:小程序  1:APP  2:后台)
+   */
+  apply() {
+    // if (!this.data.hasInfo) {
+    //   for (const key in errorMessage) {
+    //     if (this.data.hasOwnProperty(key) && !this.data[key]) {
+    //       wx.showToast({
+    //         icon: 'none',
+    //         title: errorMessage[key],
+    //         success: () => {
+    //           this.setData({
+    //             [errorKey[key]]: errorMessage[key]
+    //           })
+    //         }
+    //       })
+    //       return
+    //     }
+    //   }
+    //   if (this.data.idcardNumber.length !== 15 && this.data.idcardNumber.length !== 18) {
+    //     wx.showToast({
+    //       icon: 'none',
+    //       title: '身份证号码格式错误',
+    //       success: () => {
+    //         this.setData({
+    //           id_error: '身份证号码格式错误'
+    //         })
+    //       }
+    //     })
+    //   }
+    // }
+    // 报名需求
+    // enrollmentRequireImpl({
+    //   requirement_id: this.data.id,
+    //   name: this.data.info_name,
+    //   idcardNumber: this.data.idcardNumber,
+    //   bright_points: this.data.bright_points,
+    //   enroll_from: 0
+    // }).then(() => {
+    //   wx.showToast({
+    //     title: '报名成功',
+    //     success: () => {
+    //       this.setData({
+    //         cover: true,
+    //       }, () => {
+    //         wx.navigateBack({
+    //           delta: 1,
+    //         })
+    //       })
+    //     }
+    //   })
+    // }).catch(res => {
+    //   if (res.errCode) {
+    //     wx.showModal({
+    //       title: '报名失败',
+    //       content: res.errMsg,
+    //       showCancel: false,
+    //       confirmColor: '#31364C'
+    //     })
+    //   }
+    // })
+    const userInfo = wx.getStorageSync('userInfo')
+
+    if (userInfo.isDemonstrate) {
+      wx.showToast({
+        icon: 'none',
+        title: '报名成功',
+        success: () => {
+          const hwOrderAPI = this.data.hwOrderAPI
+          hwOrderAPI.status = 2
+          this.setData({
+            status: 2,
+            hwOrderAPI
+          })
+          putStorageSync(`orderDetail_${this.data.id}`, this.data.id, 2)
+        }
+      })
+    }
+  },
+
+  /**
+   * 亮点输入
+   * @idcardNumber {string} 身份证
+   */
+  saveIdCardNumber(e: any) {
+    const idcardNumber = e.detail.value
+    if (idcardNumber) {
+      if (idcardNumber.length !== 15 && idcardNumber.length !== 18) {
+        this.setData({
+          id_error: '身份证号码格式错误'
+        })
+      } else {
+        this.setData({
+          idcardNumber,
+          id_error: ''
+        })
+      }
+    } else {
+      this.setData({
+        id_error: '请填写身份证号码'
+      })
+    }
+  },
+  /**
+   * 亮点输入
+   * @name {string} 姓名
+   */
+  saveName(e: any) {
+    const info_name = e.detail.value
+    if (info_name) {
+      this.setData({
+        info_name,
+        name_error: ''
+      })
+    } else {
+      this.setData({
+        name_error: '请填写姓名'
+      })
+    }
+  },
+  /**
+   * 亮点输入
+   * @bright_points {string} 亮点
+   */
+  input(e: any) {
+    this.setData({
+      bright_points: e.detail.value
+    })
+  },
+  /**
+   * 打开地图
+   */
+  openMap(e: any) {
+    const name = e.currentTarget.dataset.name;
+    const address = e.currentTarget.dataset.address;
+    console.log(name, address);
+
+    // wx.openLocation({
+    //   latitude: 31.544325,
+    //   longitude: 120.356595,
+    //   name,
+    //   address
+    // })
+  },
+  /**
+   * 查看合同
+   * @filePath {string} 合同地址
+   */
+  buttonCheck() {
+    // 获取线上合同  如果存在打开合同   不存在进行提示(暂无)
+    const workContract = this.data.hwOrderAPI.workContract;
+    if (workContract) {
+      wx.showLoading({
+        mask: true,
+        title: '正在打开文件...',
+      })
+      wx.downloadFile({
+        url: this.data.hwOrderAPI.workContract,
+        success: (res) => {
+          wx.openDocument({
+            filePath: res.tempFilePath,
+            success: () => {
+              wx.hideLoading()
+            },
+            fail() {
+              wx.showToast({
+                icon: 'none',
+                title: '打开失败',
+              })
+            }
+          })
+        }
+      })
+    } else {
+      // wx.showToast({
+      //   icon:'none',
+      //   title: '',
+      // })
+    }
+  },
+  /**
+   * 确认订单
+   * @orderId {string} 订单ID
+   * 前台报名需求后  后台生成订单   需前台手动确定订单 根据订单合同不同调用不同接口
+   */
+  buttonSubmit() {
+    const workContractType = this.data.hwOrderAPI.workContractType;
+    // 电子合同确认订单
+    if (workContractType === 1) {
+      confirmECOrdersImpl({
+        orderId: this.data.hwOrderAPI.id
+      }).then(res => {
+        if (res.errCode === 0) {
+          // 跳转webview页面
+          wx.reLaunch({
+            url: `/pages/web-view/web-view?url=${encodeURIComponent(res.data.url)}`,
+            success: () => {
+              // 缓存当前页面地址   方便跳回
+              app.globalData.webview = `/pages/my-order/my-order`;
+              // wx.setStorageSync('web_view', `/pages/my-order/my-order`)
+              // wx.setStorageSync('web_view', `/${this.route}?id=${this.data.hwOrderAPI.id}&&status=${this.data.status}`)
+            }
+          })
+        }
+      })
+    }
+    // 非电子合同
+    if (workContractType === 0) {
+      confirmOrderImpl({
+        orderId: this.data.hwOrderAPI.id
+      }).then(res => {
+        if (res.errCode === 0) {
+          wx.showToast({
+            title: '订单已确认',
+            success: () => {
+              // 确认成功后 更改按钮状态
+              const hwOrderAPI = this.data.hwOrderAPI;
+              hwOrderAPI.status = 2;
+              this.setData({
+                hwOrderAPI
+              })
+            }
+          })
+        }
+      })
+    }
+  },
+  // 显示报名填写的订单输入框
+  async showCover() {
+    const userInfo: any = await getHwUserInfo()
+    if (userInfo.idcardNumber && userInfo.name) {
+      this.setData({
+        cover: false,
+        hasInfo: true
+      })
+    } else {
+      this.setData({
+        cover: false,
+        hasInfo: false
+      })
+    }
+
+  },
+  /**
+   * 控制cover层的显示与隐藏
+   */
+  cover() {
+    const cover = !this.data.cover;
+    this.setData({
+      cover
+    })
+  },
+  /**
+    * 取消报名
+    * @enroll_id {string} 报名id
+    */
+  cancelEnrollment() {
+    const id = this.data.enrollId
+    cancelEnrollmentImpl({
+      enroll_id: id
+    }).then(() => {
+      wx.showToast({
+        icon: 'none',
+        title: '取消成功',
+        success: () => {
+          setTimeout(() => {
+            wx.navigateBack({
+              delta: 1
+            })
+          }, 1200)
+        }
+      })
+    })
+  },
+  /**
+   * 
+   */
+  buttonRight() {
+
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options: any) {
+    this.setData({
+      options
+    })
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: async function () {
+    const options = this.data.options
+    if (options.id && options.status) {
+      //  如果 状态为3  请求订单详情 ID为订单id
+      if (options.status === '2') {
+        getOrderDetailImpl({
+          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,
+              // btn_message: res.data.hwOrderAPI.status === 2 && res.data.hwOrderAPI.serviceStage ? `第${res.data.hwOrderAPI.serviceStage}期服务中` : this.data.message[res.data.hwOrderAPI.status]
+            })
+          }
+        })
+      }
+
+      // 如果状态为1 请求需求详情 ID为需求id
+      if (options.status === '1') {
+        getRequirementDetailImpl({
+          user_id: wx.getStorageSync('userId'),
+          user_token: wx.getStorageSync('userToken'),
+          hwRequirementId: options.id
+        }).then(res => {
+          if (res.errCode === 0) {
+            this.setData({
+              ...res.data.hwRequirementAPI,
+              displayCancel: res.data.displayCancel || null,
+              needEnrollment: res.data.needEnrollment || null,
+              enrollId: res.data.enrollId || null
+            })
+          }
+        })
+      }
+    }
+    // 保存状态
+    if (options.status) {
+      this.setData({
+        status: Number(options.status),
+        show: false
+      })
+    }
+    this.setData({
+      user_id: wx.getStorageSync('userId'),
+    })
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+    return {
+      title: this.data.name,
+      path: `/pages/detail/detail?id=${this.data.id}&&status=${this.data.status}`
+    }
+  }
+})

+ 70 - 13
pages/detail/detail.wxml

@@ -1,8 +1,8 @@
 <!--pages/detail/detail.wxml-->
 <import src='/template/button/button.wxml' />
 <wxs src="../../app.wxs" module='app'></wxs>
-<view class="container safe-area" hidden="{{show}}">
-	<!-- 待遇详情 -->
+<!-- <view class="container safe-area-bottom" hidden="{{show}}">
+	待遇详情
 	<view class="header">
 		<view class="info">
 			<view class="name global-family">{{name}}</view>
@@ -14,8 +14,6 @@
 		</view>
 		<view class="bottom">
 			<view class="time">
-				<!-- <image src="/images/icon/time.png"></image>
-        <text>{{expiryDate}}</text> -->
 			</view>
 			<view class="job-nums">
 				<image src="/images/icon/jobs.png"></image>
@@ -23,8 +21,8 @@
 			</view>
 		</view>
 	</view>
-	<!-- 待遇详情结束 -->
-	<!-- 公司地址 -->
+	待遇详情结束
+	公司地址
 	<view class="address" data-name="{{companyName}}" data-address="{{provinceCityCountry}}{{address || ''}}" bindtap="openMap">
 		<image src="/images/icon/tower.png"></image>
 		<view class="address-info">
@@ -35,8 +33,8 @@
 			</view>
 		</view>
 	</view>
-	<!-- 公司地址结束 -->
-	<!-- 需求详情 -->
+	公司地址结束
+	需求详情
 	<view class="detail">
 		<view class="cell">
 			<view class="cell-title">需求描述</view>
@@ -57,11 +55,11 @@
 			</view>
 		</view>
 	</view>
-	<!-- 需求详情结束 -->
-	<view class="isOn safe-area" wx:if='{{isOn === 0}}'>
+	需求详情结束
+	<view class="isOn safe-area-bottom" wx:if='{{isOn === 0}}'>
 		<text>需求已经下架啦~</text>
 	</view>
-	<!-- 底部按钮开始 -->
+	底部按钮开始
 	<block wx:if='{{status === 1}}'>
 		<block wx:if='{{user_id}}'>
 			<template is='button-fixed' wx:if="{{displayCancel}}" data='{{text:"取消报名",func:"cancelEnrollment"}}' />
@@ -72,9 +70,9 @@
 			<template is='button-fixed' data='{{text:"我要报名",func:"showCover"}}' />
 		</block>
 	</block>
-	<!-- 如果合同存在则显示查看合同 没有则显示不显示该字段-->
+	如果合同存在则显示查看合同 没有则显示不显示该字段
 	<template is='button-check' wx:if='{{status === 2}}' data='{{text:"查看合同",btn:message[hwOrderAPI.status],background:hwOrderAPI.status === 0?"":"linear-gradient(135deg,#ECF0F3 0%,#E4E2E7 100%)",buttonRight:hwOrderAPI.status === 0?"":"buttonRight",display:hwOrderAPI.workContract?"":"none"}}' />
-	<!-- 底部按钮结束-->
+	底部按钮结束
 </view>
 
 <view class="cover" hidden="{{cover}}">
@@ -131,4 +129,63 @@
 			</view>
 		</view>
 	</view>
+</view> -->
+
+<view class="container safe-area-bottom">
+	<view class="header">
+		<view class="header-info">
+			<view class="name">{{name}}</view>
+			<view class="price">{{price}}元</view>
+		</view>
+		<view class="header-detail">
+			<view class="address">
+				<image src="../../imgs/address.png" class="address-image"></image>
+				<text>报名数:{{number || '若干'}}</text>
+			</view>
+			<view class="time">
+				<image src="../../imgs/time.png" class="time-image"></image>
+				<text>{{expiryDate}}</text>
+			</view>
+		</view>
+	</view>
+
+	<view class="company" data-name="{{companyName}}" data-address="{{provinceCityCountry}}{{address || ''}}"
+		bindtap="openMap">
+		<image src="../../imgs/offline.png" class="company-logo"></image>
+		<view class="company-info">
+			<view class="company-name">{{companyName}}</view>
+			<view class="company-position">{{provinceCityCountry}}{{address || ''}}</view>
+		</view>
+	</view>
+
+	<view class="content">
+		<view class="content-item">
+			<view class="content-item-name">需求描述</view>
+			<view class="content-item-text">
+				<text>{{description}}</text>
+			</view>
+		</view>
+		<view class="content-item">
+			<view class="content-item-name">资质要求</view>
+			<view class="content-item-text">
+				<text>{{qualification}}</text>
+			</view>
+		</view>
+
+		<view class="content-item">
+			<view class="content-item-name">验收标准</view>
+			<view class="content-item-text">
+				<text>{{acceptanceCriteria}}</text>
+			</view>
+		</view>
+	</view>
+	<view class="button safe-area-bottom">
+		<block wx:if="status === 1">
+			<view class="button-content" bindtap="apply" wx:if="{{!displayCancel&&needEnrollment}}">我要报名</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 !==0}}">企业确认中</view>
+		</block>
+	</view>
 </view>

+ 170 - 22
pages/detail/detail.wxss

@@ -1,13 +1,11 @@
 /* pages/detail/detail.wxss */
 
 page {
-  background: #f5f5f5;
+  background: #f0f1f2;
   padding-bottom: 201rpx;
 }
 
-/* 待遇详情 */
-
-.header {
+/* .header {
   width: 750rpx;
   height: 200rpx;
   padding: 15rpx 30rpx 40rpx 30rpx;
@@ -63,8 +61,6 @@ page {
   margin-right: 10rpx;
 }
 
-/* 公司地址 */
-
 .address {
   width: 750rpx;
   height: 148rpx;
@@ -126,8 +122,6 @@ page {
   background: #fff;
 }
 
-/* 需求详情 */
-
 .cell {
   color: #535768;
   font-size: 28rpx;
@@ -156,7 +150,7 @@ page {
 .model {
   height: 510rpx;
   width: 670rpx;
-  background: #f5f5f5;
+  background: #f0f1f2;
   border-radius: 10rpx;
 }
 
@@ -218,14 +212,10 @@ page {
   border-right: 1rpx solid #eaebee;
 }
 
-/* .confirm {
-  border-left: 1rpx solid #eaebee;
-} */
-
 .supplement-info {
   height: 896rpx;
   width: 670rpx;
-  background: #f5f5f5;
+  background: #f0f1f2;
   border-radius: 10rpx;
   box-sizing: border-box;
   position: relative;
@@ -247,13 +237,13 @@ page {
 }
 
 .supplement-header-title {
-  color: #31364C;
+  color: #31364c;
   font-size: 38rpx;
 }
 
 .supplement-header-content {
   width: 610rpx;
-  color: #31364C;
+  color: #31364c;
   font-size: 24rpx;
   padding: 20rpx;
   box-sizing: border-box;
@@ -288,7 +278,7 @@ page {
 }
 
 .placeholder {
-  color: #888A8E;
+  color: #888a8e;
   font-size: 28rpx;
 }
 
@@ -299,14 +289,14 @@ page {
 .input {
   flex: 1;
   height: 100%;
-  color: #31364C;
+  color: #31364c;
   font-size: 28rpx;
 }
 
 .error {
   height: 59rpx;
   width: 610rpx;
-  color: #D1213E;
+  color: #d1213e;
   font-size: 24rpx;
   line-height: 59rpx;
   padding: 0 15rpx;
@@ -325,11 +315,11 @@ page {
 }
 
 .supplement-action .cancel {
-  color: #888A8E;
+  color: #888a8e;
 }
 
 .border {
-  border: 1rpx solid #D1213E;
+  border: 1rpx solid #d1213e;
 }
 
 .isOn {
@@ -344,4 +334,162 @@ page {
   text-align: center;
   position: fixed;
   bottom: 124rpx;
-}
+} */
+
+.container {
+  padding: 20rpx;
+  margin-bottom: 102rpx;
+}
+
+.header {
+  width: 710rpx;
+  height: 217rpx;
+  padding: 40rpx 24rpx;
+  box-sizing: border-box;
+  background: #ffffff;
+  border-radius: 18rpx;
+  border: 2rpx solid #ebebec;
+}
+
+.header-info {
+  font-size: 52rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: rgba(0, 0, 0, 0.85);
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.price {
+  font-size: 38rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: #096dd9;
+}
+
+.header-detail {
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: rgba(0, 0, 0, 0.65);
+  display: flex;
+  align-items: center;
+  margin-top: 16rpx;
+}
+
+.address {
+  display: flex;
+  align-items: center;
+  margin-right: 24rpx;
+}
+
+.address-image {
+  height: 22rpx;
+  width: 20rpx;
+  margin-right: 14rpx;
+}
+
+.time {
+  display: flex;
+  align-items: center;
+}
+
+.time-image {
+  height: 28rpx;
+  width: 28rpx;
+  margin-right: 10rpx;
+}
+
+.company {
+  width: 710rpx;
+  min-height: 192rpx;
+  background: #ffffff;
+  border-radius: 18rpx;
+  border: 2rpx solid #ebebec;
+  padding: 0 24rpx;
+  box-sizing: border-box;
+  margin: 20rpx 0;
+  display: flex;
+  align-items: center;
+}
+
+.company-logo {
+  height: 88rpx;
+  width: 88rpx;
+  margin-right: 36rpx;
+}
+
+.company-name {
+  font-size: 34rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: rgba(0, 0, 0, 0.85);
+}
+
+.company-position {
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: rgba(0, 0, 0, 0.65);
+}
+
+.content {
+  width: 710rpx;
+  min-height: 820rpx;
+  background: #ffffff;
+  border-radius: 18rpx;
+  border: 2rpx solid #ebebec;
+  padding: 40rpx 24rpx;
+  box-sizing: border-box;
+}
+
+.content-item {
+  margin-bottom: 40rpx;
+}
+
+.content-item-name {
+  font-size: 34rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: rgba(0, 0, 0, 0.85);
+  margin-bottom: 20rpx;
+}
+
+.content-item-text {
+  font-size: 28epx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: rgba(0, 0, 0, 0.65);
+}
+
+.button {
+  width: 100%;
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.button-content {
+  width: 710rpx;
+  height: 102rpx;
+  line-height: 102rpx;
+  text-align: center;
+  font-size: 38rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: #ffffff;
+  background: #1890ff;
+  border-radius: 18rpx;
+}
+
+.disabled {
+  background: #d9d9d9;
+  font-size: 38rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: #ffffff;
+}

Файловите разлики са ограничени, защото са твърде много
+ 391 - 0
miniprogram/pages/index/index.js


+ 2 - 1
pages/index/index.json

@@ -2,6 +2,7 @@
   "navigationBarTitleText": "需求大厅",
   "enablePullDownRefresh": true,
   "usingComponents": {
-    "select-district": "/component/select-district/select-district"
+    "select-district": "/component/select-district/select-district",
+    "tabBar":"../../custom-tab-bar/index"
   }
 }

+ 505 - 0
miniprogram/pages/index/index.ts

@@ -0,0 +1,505 @@
+//index.js
+//获取应用实例
+import { getRequirementsApi, } from "../../service/hwRequirement";
+import { bannerApi } from "../../service/hwUser";
+const app = getApp()
+let cover_animation: any = {}
+Page({
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        'indicator_dots': false, //轮播指示点
+        'autoplay': true, //轮播自动播放
+        'circular': true, //轮播衔接动画
+        'interval': 3000, //轮播间隔时间
+        'duration': 1500, //轮播动画时间
+        'condition_animation': {}, //上方条件动画
+        'list_animation': {}, //下方列表动画
+        'cover_animation': {}, //选择地址动画
+        'swiper': [], // 轮播列表
+        'industry': '行业', //行业
+        'price': '单价', //单价
+        'district': '不限区域', //区域
+        'conditionList': [], //现行条件列表
+        'condition': '', //现行条件
+        'action_index': 0, //现行条件索引
+        'industry_index': 0, //行业索引
+        'industry_id': '', //行业id
+        'price_index': 0, //单价索引
+        'price_id': '', //单价id
+        'province_id': '', //省份ID
+        'city_id': '', //城市ID
+        'area_id': '', //地区ID
+        'industryList': [{
+            id: '',
+            name: '不限行业'
+        },
+        {
+            id: 0,
+            name: '教育培训'
+        },
+        {
+            id: 1,
+            name: 'IT互联网'
+        },
+        {
+            id: 2,
+            name: '仓储物流'
+        },
+        {
+            id: 3,
+            name: '酒店餐饮'
+        },
+        {
+            id: 4,
+            name: '家政保洁'
+        },
+        {
+            id: 5,
+            name: '维修保养'
+        },
+        {
+            id: 6,
+            name: '会务会展'
+        },
+        {
+            id: 7,
+            name: '专业服务'
+        },
+        {
+            id: 8,
+            name: '生产制造'
+        },
+        {
+            id: 9,
+            name: '其他行业'
+        },
+        ], //行业列表
+        'priceList': [{
+            id: '',
+            name: '不限'
+        },
+        {
+            id: 1,
+            name: '3K以下'
+        },
+        {
+            id: 2,
+            name: '3K-5K'
+        },
+        {
+            id: 3,
+            name: '5K-8K'
+        },
+        {
+            id: 4,
+            name: '8K-12K'
+        },
+        {
+            id: 5,
+            name: '12K-20K'
+        },
+        {
+            id: 6,
+            name: '20K-30K'
+        },
+        {
+            id: 7,
+            name: '30K以上'
+        },
+        ], // 单价列表
+        'list': [], //需求列表
+        'pageNo': 1,
+        'isLast': false,
+        'offline': false,
+        'loading': true,
+        'list_length': false,
+        'show': false,
+        'transition': true,
+        'fixTop': 0,
+        'scrollTop': 0,
+        swiperIndex: 0
+    },
+    swiperChange(e: any) {
+        this.setData({
+            swiperIndex: e.detail.current
+        })
+    },
+    /**
+     * 展示删选条件
+     * @condition {string}  条件  当获取的条件不等于data里面的条件时 不做改变   不等时 改变条件 以及对应的展示条件
+     */
+    chooseCondition(e: any) {
+        const condition = e.currentTarget.dataset.condition === this.data.condition ? '' : e.currentTarget.dataset.condition;
+        this.doAnimation(e.currentTarget.dataset.condition === this.data.condition)
+        // this.doAnimation(false)
+        // let action_index = this.data.condition === this.data.action_index ? [] : this.data[`${condition}_index`];
+        this.setData({
+            condition,
+            // action_index
+        })
+    },
+    /**
+     * 展开区域选择
+     * 
+     */
+    openArea() {
+        this.doAnimation(true)
+        cover_animation.left(0).step();
+        this.setData({
+            cover_animation: cover_animation.export(),
+            condition: '',
+        })
+    },
+
+    /**
+     * 点击选择条件
+     * 根据不同的条件插入不同的值
+     */
+    choose(e: any) {
+        const index = e.currentTarget.dataset.index;
+        const id = e.currentTarget.dataset.id;
+        let condition = this.data.condition;
+        let list: any[] = []
+        if (condition === 'industry') {
+            list = this.data.industryList
+        } else {
+            list = this.data.priceList
+        }
+
+        this.setData({
+            [condition]: list[index].name,
+            [`${condition}_index`]: index,
+            [`${condition}_id`]: id,
+            condition: '',
+            list: [],
+            loading: true
+        }, () => {
+            this.getList(1)
+        })
+        this.doAnimation(true)
+
+    },
+
+    /**
+     * 保存地区
+     * @district {string} 地区
+     * @province_id {} 省份ID
+     * @city_id {} 城市ID
+     * @area_id {} 地区ID
+     */
+    saveDistrict(e: any) {
+        cover_animation.left(750 + 'rpx').step();
+        this.setData({
+            cover_animation: cover_animation.export(),
+            district: e.detail.area_name,
+            province_id: e.detail.province_id,
+            city_id: e.detail.city_id,
+            area_id: e.detail.area_id,
+            list: []
+        }, () => {
+            this.getList(1)
+        })
+    },
+    /**
+     * 关闭地区选择
+     * @cover_animation 地区选择动画
+     */
+    coloseDistrict() {
+        cover_animation.left(750 + 'rpx').step();
+        this.setData({
+            cover_animation: cover_animation.export()
+        })
+        this.doAnimation(true)
+    },
+    /**
+     * 执行条件动画
+     */
+    doAnimation(status: boolean) {
+        // const condition_animation = this.condition_animation;
+        // const list_animation = this.list_animation;
+        // const condition_length = status ? 0 : -412 + 'rpx'
+        // const list_length = status ? 548 + 'rpx' : 201 + 'rpx'
+        // condition_animation.top(condition_length).step();
+        // list_animation.top(list_length).step();
+        // this.setData({
+        //   condition_animation: condition_animation.export(),
+        //   list_animation: list_animation.export(),
+        // })
+        const fixTop = this.data.fixTop;
+        const scrollTop = this.data.scrollTop;
+        if (fixTop > scrollTop) {
+            this.setData({
+                transition: status
+            })
+        }
+    },
+    /**
+     * 跳转个人中心
+     */
+    toPerson() {
+        if (wx.getStorageSync('userId') && wx.getStorageSync('userToken')) {
+            wx.navigateTo({
+                url: '/pages/person/person',
+            })
+        } else {
+            wx.showModal({
+                title: '提示',
+                content: '你还未登陆,是否立即登录',
+                cancelColor: '#888A8E',
+                confirmColor: '#31364C',
+                success: res => {
+                    if (res.confirm) {
+                        wx.navigateTo({
+                            url: '/pages/login/login',
+                        })
+                    }
+                }
+            })
+        }
+
+    },
+    /**
+     * 跳转详情页
+     */
+    toDetail(e: any) {
+        const id = e.currentTarget.dataset.id;
+        wx.navigateTo({
+            url: `/pages/detail/detail?id=${id}&&status=1`,
+        })
+    },
+    /**
+     * 获取需求列表
+     * @pageNo {number} 页码
+     * @pageSize {number} 数据条数
+     * @province_code {number} 省份代码
+     * @city_code {number} 城市代码
+     * @country_code {number} 地区代码
+     * @trade_type {number} 行业类型
+     * @priceType {number} 价格代号(1-7)(不限的话不传此参数)
+     * @platform_id {number} 接单人用户所属平台id
+     */
+    getList(pageNo?: number, province_code?: number, city_code?: number, country_code?: number, trade_type?: number, priceType?: number) {
+        let _pageNo: number = pageNo || this.data.pageNo
+        const param = Object.assign({
+            pageNo: _pageNo,
+            province_code: this.data.province_id,
+            city_code: this.data.city_id,
+            country_code: this.data.area_id,
+            trade_type: this.data.industry_id,
+            priceType: this.data.price_id
+        }, {
+            pageNo,
+            pageSize: 10,
+            province_code,
+            city_code,
+            country_code,
+            trade_type,
+            priceType,
+            platform_id: app.globalData.platformId
+        })
+        getRequirementsApi(param).then(res => {
+            if (typeof res === 'string') {
+                // 如果没有网络  展示网络故障界面
+                if (res === 'offline' && this.data.list.length === 0) {
+                    this.setData({
+                        offline: true,
+                        loading: false,
+                        list_length: false
+                    })
+                }
+            }
+            const data = <responseOptionsType>res
+            if (data.errcode === 0) {
+                if (pageNo === 1 && data.data.requirements.length === 0) {
+                    // this.doAnimation(false);
+                    this.setData({
+                        loading: false,
+                        list_length: true,
+                        offline: false
+                    })
+                    return
+                }
+                // 在成功后页数加一方便日后调用
+                _pageNo++;
+                this.setData({
+                    pageNo: _pageNo,
+                    [`list[${_pageNo - 2}]`]: data.data.requirements,
+                    isLast: data.data.isLast,
+                    offline: false,
+                    list_length: false,
+                    loading: false
+                })
+            }
+        }).catch(() => {
+            this.setData({
+                loading: false,
+                list_length: true,
+                offline: false
+            })
+        })
+    },
+    /**
+     * 获取首页banner图
+     */
+    getBanner() {
+        bannerApi().then(res => {
+            const data = <responseOptionsType>res
+            if (data.errcode === 0) {
+                this.setData({
+                    swiper: data.data.bannerList
+                })
+            }
+        })
+    },
+    reload() {
+        // 获取需求列表
+        this.setData({
+            list: [],
+            pageNo: 1,
+            scrollTop: 0
+        }, () => {
+            // 获取首页banner图
+            this.getBanner();
+            this.getList();
+        })
+        // app.utils.getHwUserInfo();
+    },
+    checkLogin() {
+        if (wx.getStorageSync('userId') && wx.getStorageSync('userToken')) {
+            if (wx.getStorageSync('userInfo').registerFrom === 0) {
+                wx.reLaunch({
+                    url: '/pages/success/success',
+                })
+            } else {
+                this.reload();
+                this.setData({
+                    show: false
+                })
+            }
+        } else {
+            wx.navigateTo({
+                url: '/pages/login/login',
+            })
+        }
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function () { this.getBanner(); },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        this.setData({
+            route: this.route
+        })
+        this.checkLogin()
+        // this.reload()
+        /**
+         * 初始化动画
+         * @condition_animation 条件框动画
+         * @list_animation 需求列表动画
+         * @cover_animation 地址选择动画
+         */
+        // this.condition_animation = wx.createAnimation({
+        //   duration: 700,
+        //   timingFunction: 'ease',
+        // })
+        // this.list_animation = wx.createAnimation({
+        //   duration: 600,
+        //   timingFunction: 'ease',
+        // })
+        cover_animation = wx.createAnimation({
+            duration: 600,
+            timingFunction: 'ease',
+        })
+        // 获取系统信息算出像素比
+        wx.getSystemInfo({
+            success: res => {
+                this.setData({
+                    per: 750 / res.windowWidth
+                })
+            }
+        })
+        // 获取绝对定位的高度
+        wx.createSelectorQuery().select('.choose-area').boundingClientRect((rect) => {
+            this.setData({
+                fixTop: rect.top,
+            })
+        }).exec();
+        if (app.globalData.webview) {
+            wx.navigateTo({
+                url: app.globalData.webview,
+                success: () => {
+                    app.globalData.webview = null
+                }
+            })
+        }
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+        this.setData({
+            list: [],
+            pageNo: 1,
+            scrollTop: 0
+        }, () => {
+            this.getList()
+        })
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+        const isLast = this.data.isLast;
+        if (isLast) {
+            // wx.showToast({
+            //   icon: 'none',
+            //   title: '已经是最后一页了',
+            // })
+        } else {
+            this.getList()
+        }
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    },
+    onPageScroll: function (res) {
+        let top = res.scrollTop;
+        this.setData({
+            scrollTop: top
+        });
+    }
+})

+ 46 - 12
pages/index/index.wxml

@@ -11,11 +11,19 @@
       <image src="/images/icon/person.png"></image>
     </view>
     <!-- 页面标题结束 -->
-    <swiper class="swiper" indicator-dots indicator-color='#fff' indicator-active-color="#fff" autoplay='{{autoplay}}' circular='{{circular}}' interval='{{interval}}' duration='{{duration}}'>
-      <swiper-item wx:for='{{swiper}}' wx:key="index">
-        <image src="{{item}}"></image>
-      </swiper-item>
-    </swiper>
+    <view class="swiper-group">
+      <swiper class="swiper" indicator-color='#fff' indicator-active-color="#fff" autoplay='{{autoplay}}'
+        circular='{{circular}}' interval='{{interval}}' duration='{{duration}}' bindchange="swiperChange">
+        <swiper-item wx:for='{{swiper}}' wx:key="index">
+          <image src="{{item}}"></image>
+        </swiper-item>
+      </swiper>
+      <view class="dot">
+        <view class="dot-list {{swiperIndex === index?'dot-list-activated':''}}" wx:for='{{swiper}}' wx:key="index">
+        </view>
+      </view>
+    </view>
+
     <!-- 条件筛选开始 -->
     <view class="choose-area-content {{fixTop < scrollTop?'fixed':''}}">
       <view class="choose-area">
@@ -28,20 +36,23 @@
         <view class="condition">
           <view data-condition="industry" bindtap="chooseCondition">
             <text class="condition-content {{condition==='industry'&&'color'}}">{{industry}}</text>
-            <image src="{{condition==='industry'?'/images/icon/down-empty-action.png':'/images/icon/up-empty.png'}}"></image>
+            <image src="{{condition==='industry'?'/images/icon/down.png':'/images/icon/up.png'}}"></image>
           </view>
 
           <view style="margin-left:15rpx;" data-condition="price" bindtap="chooseCondition">
             <text class="condition-content {{condition==='price'&&'color'}}">{{price}}</text>
-            <image src="{{condition==='price'?'/images/icon/down-empty-action.png':'/images/icon/up-empty.png'}}"></image>
+            <image src="{{condition==='price'?'/images/icon/down.png':'/images/icon/up.png'}}"></image>
           </view>
         </view>
       </view>
       <view class="industry-list" hidden="{{condition!=='industry'}}">
-        <view class="industry-list-item  {{index===industry_index?'condition-list-item-action':''}}" wx:for='{{industryList}}' wx:key="index" bindtap="choose" data-index="{{index}}" data-id="{{item.id}}">{{item.name}}</view>
+        <view class="industry-list-item  {{index===industry_index?'condition-list-item-action':''}}"
+          wx:for='{{industryList}}' wx:key="index" bindtap="choose" data-index="{{index}}" data-id="{{item.id}}">
+          {{item.name}}</view>
       </view>
       <view class="price-list" hidden="{{condition!=='price'}}">
-        <view class="price-list-item  {{index===price_index?'condition-list-item-action':''}}" wx:for='{{priceList}}' wx:key="index" bindtap="choose" data-index="{{index}}" data-id="{{item.id}}">{{item.name}}</view>
+        <view class="price-list-item  {{index===price_index?'condition-list-item-action':''}}" wx:for='{{priceList}}'
+          wx:key="index" bindtap="choose" data-index="{{index}}" data-id="{{item.id}}">{{item.name}}</view>
       </view>
     </view>
 
@@ -53,7 +64,7 @@
   <view class="list {{fixTop < scrollTop?'margin':''}} ">
     <block wx:for='{{list}}' wx:key="index">
       <view class="list-item" wx:for='{{item}}' wx:key="index" data-id="{{item.id}}" bindtap="toDetail">
-        <view class="top">
+        <!-- <view class="top">
           <view class="name global-family">{{item.name}}</view>
           <text class="payment">
           <text>{{item.price}}元</text>
@@ -75,7 +86,28 @@
             <text>任务数:{{item.number || '若干'}}</text>
           </view>
         </view>
-        <image src="/images/icon/yibaoming.png" class="icon" wx:if='{{item.isEnrollment}}'></image>
+        <image src="/images/icon/yibaoming.png" class="icon" wx:if='{{item.isEnrollment}}'></image> -->
+        <view class="list-item-header">
+          <view class="list-item-header-name">
+            {{item.name}}
+          </view>
+          <view class="list-item-header-price">{{item.price}}元</view>
+        </view>
+        <view class="list-item-info">
+          <view class="company-info">{{item.companyName}}</view>
+          <view class="company-time">{{tool.formatTime(item.createTime,'.','',true)}}</view>
+        </view>
+        <view class="position-info">
+          <view class="address">
+            <image src="../../imgs/address.png" class="address-image"></image>
+            <text>{{item.provinceCityCountry}}</text>
+          </view>
+          <view class="number">
+            <image src="../../imgs/number.png" class="number-image"></image>
+            <text>任务数: {{item.number || '若干'}}</text>
+          </view>
+        </view>
+        <image src="../../imgs/yibaoming.png" class="icon" wx:if='{{item.isEnrollment}}'></image>
       </view>
     </block>
 
@@ -106,4 +138,6 @@
 <view class="cover" animation='{{cover_animation}}'>
   <select-district bind:colose='coloseDistrict' bind:submit='saveDistrict' />
 </view>
-<!-- 蒙层  地区选择结束 -->
+<!-- 蒙层  地区选择结束 -->
+
+<tabBar></tabBar>

pages/index/index.wxs → miniprogram/pages/index/index.wxs


+ 0 - 0
pages/index/index.wxss


Някои файлове не бяха показани, защото твърде много файлове са промени