Browse Source

改一大堆

epass
mk 1 month ago
parent
commit
9ef97e9d71
  1. 9
      app.json
  2. 14
      custom-tab-bar/index.js
  3. 47
      pages/index/index.js
  4. 106
      pages/noData/noData.js
  5. 8
      pages/noData/noData.json
  6. 10
      pages/noData/noData.wxml
  7. 20
      pages/noData/noData.wxss
  8. 45
      pages/serve/serve.js
  9. 16
      pages/serve/serve.wxml
  10. 11
      project.private.config.json
  11. 44
      subpages/OCRCard/pages/OCR/OCR.js
  12. 63
      subpages/index/checkInUser/checkInUser.js
  13. 2
      subpages/index/checkInWait/checkInWait.js
  14. 14
      subpages/index/checkOutConfirm/index/index.js
  15. 3
      subpages/index/checkOutConfirm/index/index.json
  16. 4
      utils/config.js
  17. 10
      utils/request.js

9
app.json

@ -6,7 +6,8 @@
"pages/serve/serve", "pages/serve/serve",
"pages/mine/mine", "pages/mine/mine",
"pages/register/register", "pages/register/register",
"pages/webView/webView" "pages/webView/webView",
"pages/noData/noData"
], ],
"subPackages": [ "subPackages": [
{ {
@ -83,11 +84,7 @@
"iconPath": "images/icon/home.png" "iconPath": "images/icon/home.png"
}, },
{
"text": "服务",
"pagePath": "pages/serve/serve",
"iconPath": "images/icon/home.png"
},
{ {
"text": "我的", "text": "我的",
"pagePath": "pages/mine/mine", "pagePath": "pages/mine/mine",

14
custom-tab-bar/index.js

@ -22,13 +22,13 @@ Component({
// selectedIconPath: "/images/icon/message-a.png", // selectedIconPath: "/images/icon/message-a.png",
// text: "消息", // text: "消息",
// }, // },
{ // {
pagePath: "/pages/serve/serve", // pagePath: "/pages/serve/serve",
iconPath: "/images/icon/serve-a.png", // iconPath: "/images/icon/serve-a.png",
selectedIconPath: "/images/icon/serve.png", // selectedIconPath: "/images/icon/serve.png",
bulge:false, // bulge:false,
text: "服务", // text: "服务",
}, // },
// { // {
// pagePath: "/pages/life/life", // pagePath: "/pages/life/life",
// iconPath: "/images/icon/life.png", // iconPath: "/images/icon/life.png",

47
pages/index/index.js

@ -6,7 +6,8 @@ import {
} from "../../api/user" } from "../../api/user"
import { import {
getPolicyList, getPolicyList,
message message,
selectMzGraduateInfo
} from "../../api/index" } from "../../api/index"
Page({ Page({
/** /**
@ -48,14 +49,16 @@ Page({
// url: "/subpages/bsPage/bsPage/bsPage", // url: "/subpages/bsPage/bsPage/bsPage",
// image:'../../images/icon/baoshi.png' // image:'../../images/icon/baoshi.png'
// }, // },
// {
// name: "生活圈",
// },
{ {
name: "更多", name: "居住评价",
url:'/pages/serve/serve', url: "/subpages/mine/checkInEvaluate/checkInEvaluate",
image:'../../images/icon/gengduo.png' image:'../../images/icon/nav_3.png'
}, },
// {
// name: "更多",
// url:'/pages/serve/serve',
// image:'../../images/icon/gengduo.png'
// },
], ],
searchValue: "", searchValue: "",
policyList:[],//政策列表 policyList:[],//政策列表
@ -67,7 +70,6 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.setData({ this.setData({
statusHeight: app.globalData.deviceInfo.statusHeight, statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight, navigationHeight: app.globalData.deviceInfo.navigationHeight,
@ -76,6 +78,31 @@ Page({
init(){ init(){
this.login() this.login()
}, },
selectMzGraduateInfo(obj){
selectMzGraduateInfo({idCard:obj.idCard}).then(res=>{
if (res.data.signType === 0 && res.data.contract) {
//线上支付去跳转签合同
app.globalData.userInfo.chooseRoomId = res.data.chooseRecId
console.log(res.data.contract, '链接》》》》');
res.data.contract = res.data.contract.replace('https://h5.esign.cn', 'https://hxm5112004501.h5.esign.cn')
wx.navigateTo({
url: '/pages/webView/webView?url=' + encodeURIComponent(res.data.contract),
})
} else if (res.data.signType === 1) {
wx.navigateTo({
url: '/pages/noData/noData?msg=暂无合同签订&idCard=' + obj.idCard,
})
} else {
wx.navigateTo({
url: '/pages/noData/noData?msg=暂无合同签订&idCard=' + obj.idCard,
})
}
}).catch(err=>{
wx.navigateTo({
url: '/pages/noData/noData?msg=暂无合同签订&idCard=' + obj.idCard,
})
})
},
login() { login() {
wx.showLoading({ wx.showLoading({
title:'加载中...' title:'加载中...'
@ -201,9 +228,7 @@ Page({
}else if(e.currentTarget.dataset.url === '/subpages/OCRCard/pages/index/index'){ }else if(e.currentTarget.dataset.url === '/subpages/OCRCard/pages/index/index'){
if(!this.data.bindPhone){ if(!this.data.bindPhone){
if(this.data.userInfo.idCard){ if(this.data.userInfo.idCard){
wx.navigateTo({ this.selectMzGraduateInfo({idCard:this.data.userInfo.idCard})
url: `/subpages/index/checkInUser/checkInUser?idCard=${this.data.userInfo.idCard}&name=${this.data.userInfo.name}&phone=${this.data.userInfo.phone}`,
})
}else{ }else{
wx.navigateTo({ wx.navigateTo({
url: `/subpages/OCRCard/pages/index/index`, url: `/subpages/OCRCard/pages/index/index`,

106
pages/noData/noData.js

@ -0,0 +1,106 @@
// pages/noData/noData.js
import {selectMzGraduateInfo } from "../../api/index"
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
msg:'暂无信息',
idCard:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if(options){
this.setData({
msg:options.msg,
idCard:options.idCard,
statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight,
})
this.selectMzGraduateInfo()
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
back(){
wx.switchTab({
url: '/pages/index/index',
})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
this.selectMzGraduateInfo()
wx.stopPullDownRefresh();
},
selectMzGraduateInfo(){
console.log(this.data.idCard);
selectMzGraduateInfo({idCard:this.data.idCard}).then(res=>{
if (res.data.signType === 0 && res.data.contract) {
//线上支付去跳转签合同
app.globalData.userInfo.chooseRoomId = res.data.chooseRecId
console.log(res.data.contract, '链接》》》》');
res.data.contract = res.data.contract.replace('https://h5.esign.cn', 'https://hxm5112004501.h5.esign.cn')
wx.navigateTo({
url: '/pages/webView/webView?url=' + encodeURIComponent(res.data.contract),
})
}else{
wx.showToast({
title: '暂无合同签订',
icon:'none'
})
}
}).catch(err=>{
wx.showToast({
title: '暂无合同签订',
icon:'none'
})
})
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

8
pages/noData/noData.json

@ -0,0 +1,8 @@
{
"usingComponents": {
"van-empty": "@vant/weapp/empty/index"
},
"navigationBarTitleText": "入住办理",
"enablePullDownRefresh": true,
"navigationStyle": "custom"
}

10
pages/noData/noData.wxml

@ -0,0 +1,10 @@
<view >
<image src="../../images/back.png" class="back" bind:tap="back" style=" top: {{statusHeight}}px;width: 50rpx;height: 50rpx;" bindtap="back" mode="" />
<view class="navigation" style="height: {{navigationHeight}}px; top: {{statusHeight}}px;line-height: {{navigationHeight}}px;">
入住办理
</view>
</view>
<view style="margin-top: 200rpx;">
<van-empty description="{{msg}}" cost/>
</view>

20
pages/noData/noData.wxss

@ -0,0 +1,20 @@
/* pages/noData/noData.wxss */
.navigation {
display: flex;
align-items: center;
color: #333333;
font-size: 32rpx;
z-index: 100;
position: fixed;
left: 50%;
transform: translateX(-60rpx);
}
.back {
width: 30rpx;
height: 30rpx;
margin-left: 20rpx;
margin-top: 20rpx;
border-radius: 0rpx;
z-index: 101;
position: fixed;
}

45
pages/serve/serve.js

@ -73,6 +73,51 @@ Page({
url: '/subpages/eventAdd/add/add', url: '/subpages/eventAdd/add/add',
}) })
}, },
toPage(e){
console.log(e);
if(e.currentTarget.dataset.url && e.currentTarget.dataset.url != '/subpages/OCRCard/pages/index/index' && e.currentTarget.dataset.url != '/subpages/index/checkOutConfirm/index/index'){
if(e.currentTarget.dataset.url === '/pages/serve/serve'){
wx.switchTab({
url: '/pages/serve/serve',
})
}
wx.navigateTo({
url: e.currentTarget.dataset.url,
})
}else if(e.currentTarget.dataset.url === '/subpages/OCRCard/pages/index/index'){
if(!this.data.bindPhone){
if(this.data.userInfo.idCard){
wx.navigateTo({
url: `/subpages/index/checkInUser/checkInUser?idCard=${this.data.userInfo.idCard}&name=${this.data.userInfo.name}&phone=${this.data.userInfo.phone}`,
})
}else{
wx.navigateTo({
url: `/subpages/OCRCard/pages/index/index`,
})
}
}else{
wx.navigateTo({
url: '/pages/register/register',
})
}
}else if(e.currentTarget.dataset.url === '/subpages/index/checkOutConfirm/index/index'){
if(!this.data.bindPhone){
if(this.data.userInfo.idCard){
wx.navigateTo({
url: `/subpages/index/checkOutConfirm/index/index`,
})
}else{
wx.navigateTo({
url: `/subpages/OCRCard/pages/index/index?type=out`,
})
}
}else{
wx.navigateTo({
url: '/pages/register/register',
})
}
}
},
toBsPage(){ toBsPage(){
wx.navigateTo({ wx.navigateTo({
url: '/subpages/bsPage/bsPage/bsPage', url: '/subpages/bsPage/bsPage/bsPage',

16
pages/serve/serve.wxml

@ -9,22 +9,22 @@
<view class="card header-card"> <view class="card header-card">
<view style="font-size: 36rpx;margin-bottom:52rpx;">居住服务</view> <view style="font-size: 36rpx;margin-bottom:52rpx;">居住服务</view>
<view class="flex flex-sa" style="gap: 30rpx;"> <view class="flex flex-sa" style="gap: 30rpx;">
<navigator url="/subpages/OCRCard/pages/index/index" class=" flex items-center flex-center-j flex-col" style="width: 25%;"> <view bind:tap="toPage" data-url="/subpages/OCRCard/pages/index/index" bind class=" flex items-center flex-center-j flex-col" style="width: 25%;">
<image src="../../images/icon/nav_1.png" class="icon-100" mode="" /> <image src="../../images/icon/nav_1.png" class="icon-100" mode="" />
<view style="font-size:28rpx;color:#ffffff;font-weight: 600;" class="flex items-center flex-1 mt-14">入住办理</view> <view style="font-size:28rpx;color:#ffffff;font-weight: 600;" class="flex items-center flex-1 mt-14">入住办理</view>
</navigator> </view>
<navigator url="/subpages/index/checkOutConfirm/index/index" class=" flex items-center flex-center-j flex-col" style="width: 25%;"> <view bind:tap="toPage" data-url="/subpages/index/checkOutConfirm/index/index" class=" flex items-center flex-center-j flex-col" style="width: 25%;">
<image src="../../images/icon/nav_2.png" class="icon-100" mode="" /> <image src="../../images/icon/nav_2.png" class="icon-100" mode="" />
<text style="font-size:28rpx;color:#ffffff;font-weight: 600;" class="flex items-center flex-1 mt-14">退房确认</text> <text style="font-size:28rpx;color:#ffffff;font-weight: 600;" class="flex items-center flex-1 mt-14">退房确认</text>
</navigator> </view>
<navigator url="/subpages/index/renewalApplication/renewalApplication" class=" flex items-center flex-center-j flex-col" style="width: 25%;"> <view bind:tap="toPage" data-url="/subpages/index/renewalApplication/renewalApplication" class=" flex items-center flex-center-j flex-col" style="width: 25%;">
<image src="../../images/icon/nav_10.png" class="icon-100" mode="" /> <image src="../../images/icon/nav_10.png" class="icon-100" mode="" />
<view style="font-size:28rpx;color:#ffffff;font-weight: 600;" class="flex items-center flex-1 mt-14">延租申请</view> <view style="font-size:28rpx;color:#ffffff;font-weight: 600;" class="flex items-center flex-1 mt-14">延租申请</view>
</navigator> </view>
<navigator url="/subpages/mine/checkInEvaluate/checkInEvaluate" class=" flex items-center flex-center-j flex-col" style="width: 25%;"> <view bind:tap="toPage" data-url="/subpages/mine/checkInEvaluate/checkInEvaluate" class=" flex items-center flex-center-j flex-col" style="width: 25%;">
<image src="../../images/icon/nav_3.png" class="icon-100" mode="" /> <image src="../../images/icon/nav_3.png" class="icon-100" mode="" />
<text style="font-size:28rpx;color:#ffffff;font-weight: 600;" class="flex items-center flex-1 mt-14">居住评价</text> <text style="font-size:28rpx;color:#ffffff;font-weight: 600;" class="flex items-center flex-1 mt-14">居住评价</text>
</navigator> </view>
</view> </view>
</view> </view>
<!-- <view class="card flex flex-col list"> <!-- <view class="card flex flex-col list">

11
project.private.config.json

@ -14,12 +14,19 @@
"condition": { "condition": {
"miniprogram": { "miniprogram": {
"list": [ "list": [
{
"name": "pages/noData/noData",
"pathName": "pages/noData/noData",
"query": "idCard=1",
"scene": null,
"launchMode": "default"
},
{ {
"name": "subpages/bsPage/bsPage/bsPage", "name": "subpages/bsPage/bsPage/bsPage",
"pathName": "subpages/bsPage/bsPage/bsPage", "pathName": "subpages/bsPage/bsPage/bsPage",
"query": "", "query": "",
"scene": null, "launchMode": "default",
"launchMode": "default" "scene": null
}, },
{ {
"name": "subpages/mine/checkInRecord/checkInRecord", "name": "subpages/mine/checkInRecord/checkInRecord",

44
subpages/OCRCard/pages/OCR/OCR.js

@ -113,13 +113,15 @@ import {
mediaType:['image'], mediaType:['image'],
success: (res) => { success: (res) => {
ocrAction(res.tempFiles[0].tempFilePath).then(res=>{ ocrAction(res.tempFiles[0].tempFilePath).then(res=>{
if(res.success){ console.log(res);
that.selectMzGraduateInfo(res.result.data.idcard_res) wx.navigateTo({
}else{ url: `/subpages/index/checkInUser/checkInUser?idCard=${res.result.data.idcard_res.id.text}&type=${this.data.type}`,
that.selectMzGraduateInfo() })
}
}).catch(err=>{ }).catch(err=>{
that.selectMzGraduateInfo() wx.navigateTo({
url: `/subpages/index/checkInUser/checkInUser?idCard=${res.result.data.idcard_res}&type=${this.data.type}`,
})
}) })
}, },
fail: (res) => { fail: (res) => {
@ -217,35 +219,9 @@ import {
}) })
}, },
success(e) { success(e) {
if(e.success){ console.log(e);
this.selectMzGraduateInfo(e.result.data.idcard_res)
}else{
wx.navigateTo({ wx.navigateTo({
url: `/subpages/index/checkInUser/checkInUser?type=${this.data.type}`, url: `/subpages/index/checkInUser/checkInUser?idCard=${e.result.data.idcard_res.id.text}&type=${this.data.type}`,
}) })
}
}, },
selectMzGraduateInfo(data){
if(data){
if(this.data.type== 'out'){
wx.navigateTo({
url: `/subpages/index/checkInUser/checkInUser?type=${this.data.type}&idCard=${data.id.text || ''}`,
})
return
}
selectMzGraduateInfo({idCard:data.id.text}).then(res=>{
if(res.code === 200){
wx.navigateTo({
url: `/subpages/index/checkInUser/checkInUser?idCard=${data.id.text}`,
})
}
}).catch(err=>{
})
}else{
wx.navigateTo({
url: `/subpages/index/checkInUser/checkInUser?type=${this.data.type}`,
})
}
}
}) })

63
subpages/index/checkInUser/checkInUser.js

@ -29,11 +29,9 @@ Page({
if (options) { if (options) {
this.setData({ this.setData({
'form.idCard': options.idCard, 'form.idCard': options.idCard,
'form.telephone':app.globalData.userInfo.phone,
type: options.type || '' type: options.type || ''
}) })
if(!options.type){
this.selectMzGraduateInfo()
}
} }
}, },
@ -103,44 +101,46 @@ Page({
}) })
}, },
submit() { submit() {
this.bindIdCard()
if (this.data.type === 'out') { if (this.data.type === 'out') {
setTimeout(()=>{
wx.navigateTo({ wx.navigateTo({
url: '/subpages/index/checkOutConfirm/index/index', url: '/subpages/index/checkOutConfirm/index/index',
}) })
this.bindIdCard() },1500)
return false return false
} }else{
selectMzGraduateInfo({ selectMzGraduateInfo({idCard:this.data.form.idCard}).then(res=>{
idCard: this.data.form.idCard if(res.code === 200){
}).then(res => { this.setData({
console.log(res, '毕业生信息'); info:res.data
if (res.code === 200) { })
this.bindIdCard() if(res.data.signType === 0 && res.data.contract){
if (res.data.signType === 0 && res.data.contract) {
//线上支付去跳转签合同
app.globalData.userInfo.chooseRoomId = res.data.chooseRecId app.globalData.userInfo.chooseRoomId = res.data.chooseRecId
console.log(res.data.contract, '链接》》》》'); console.log(res.data.contract,'链接》》》》');
res.data.contract = res.data.contract.replace('https://h5.esign.cn', 'https://hxm5112004501.h5.esign.cn') res.data.contract = res.data.contract.replace('https://h5.esign.cn','https://hxm5112004501.h5.esign.cn')
wx.navigateTo({ wx.navigateTo({
url: '/pages/webView/webView?url=' + encodeURIComponent(res.data.contract), url: '/pages/webView/webView?url=' + encodeURIComponent(res.data.contract),
}) })
} else if (res.data.signType === 1) { }else if(res.data.signType === 1){
// 线下签订去支付 // 线下签订
wx.switchTab({ wx.switchTab({
url: '/pages/index/index', url: '/pages/noData/noData?msg=暂无合同签订&idCard=' + this.data.idCard,
}) })
} else { }else{
wx.navigateTo({ wx.navigateTo({
url: `/subpages/index/checkInWait/checkInWait?idCard=${this.data.form.idCard}`, url: '/pages/noData/noData?idCard='+ this.data.form.idCard,
}) })
} }
} }
}).catch(err => { }).catch(err=>{
console.log(err); wx.navigateTo({
url: '/pages/noData/noData?idCard='+ this.data.form.idCard,
})
}) })
}
}, },
bindIdCard() { bindIdCard() {
bindIdCard({ bindIdCard({
@ -149,18 +149,5 @@ Page({
}).then(res => { }).then(res => {
console.log(res); console.log(res);
}) })
},
selectMzGraduateInfo() {
selectMzGraduateInfo({
idCard: this.data.form.idCard
}).then(res => {
if (res.code === 200) {
this.setData({
form: res.data
})
}
}).catch(err => {
console.log(err);
})
} }
}) })

2
subpages/index/checkInWait/checkInWait.js

@ -104,7 +104,7 @@ Page({
}else if(res.data.signType === 1){ }else if(res.data.signType === 1){
// 线下签订 // 线下签订
wx.switchTab({ wx.switchTab({
url: '/pages/index/index', url: '/pages/noData/noData?msg=暂无合同签订&idCard=' + this.data.idCard,
}) })
}else{ }else{
// 没有合同信息 // 没有合同信息

14
subpages/index/checkOutConfirm/index/index.js

@ -134,11 +134,19 @@ console.log('area',scrollArea.node);
}, },
getProcessingCheckOutInfo(){ getProcessingCheckOutInfo(){
getProcessingCheckOutInfo().then(res=>{ getProcessingCheckOutInfo().then(res=>{
if(res.code === 200){ if(res.code === 200 && res.data){
wx.stopPullDownRefresh();
this.setData({ this.setData({
info:res.data info:res.data
}) })
}else{
wx.showToast({
title: '暂无退房确认信息',
icon:'none'
})
} }
}).catch(err=>{
wx.stopPullDownRefresh();
}) })
}, },
/** /**
@ -166,7 +174,9 @@ console.log('area',scrollArea.node);
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() {}, onPullDownRefresh() {
this.getProcessingCheckOutInfo()
},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数

3
subpages/index/checkOutConfirm/index/index.json

@ -11,5 +11,6 @@
"van-icon": "@vant/weapp/icon/index", "van-icon": "@vant/weapp/icon/index",
"navigationBar": "/components/navigationBar/navigationBar", "navigationBar": "/components/navigationBar/navigationBar",
"van-empty": "@vant/weapp/empty/index" "van-empty": "@vant/weapp/empty/index"
} },
"enablePullDownRefresh": true
} }

4
utils/config.js

@ -13,8 +13,8 @@ module.exports = {
}; };
function BASEURL() { function BASEURL() {
return 'https://zsbz.qdcfy.com/mz-api' // return 'https://zsbz.qdcfy.com/mz-api'
// return 'http://219.146.91.110:30801/mz-api' return 'http://219.146.91.110:30801/mz-api'
// return 'https://epmet-test.elinkservice.cn/api/' // return 'https://epmet-test.elinkservice.cn/api/'
} }

10
utils/request.js

@ -38,11 +38,11 @@ const request = function (url, options) {
if(errmsg==undefined || errmsg=='undefined' ){ if(errmsg==undefined || errmsg=='undefined' ){
errmsg = '未返回错误信息' errmsg = '未返回错误信息'
} }
wx.showToast({ // wx.showToast({
title: errmsg, // title: errmsg,
icon: 'none', // icon: 'none',
duration: 3000 // duration: 3000
}) // })
reject(response.data) reject(response.data)
} }
} else if(response.statusCode !== 404){ } else if(response.statusCode !== 404){

Loading…
Cancel
Save