Browse Source

入住办理逻辑理了一下 就差跳转合同页跟支付了

epass
mk 3 months ago
parent
commit
e3c52f3b3f
  1. 5
      api/index.js
  2. 7
      app.json
  3. 24
      pages/index/index.js
  4. 4
      pages/index/index.wxml
  5. 66
      pages/webView/webView.js
  6. 3
      pages/webView/webView.json
  7. 2
      pages/webView/webView.wxml
  8. 1
      pages/webView/webView.wxss
  9. 18
      project.private.config.json
  10. 32
      subpages/OCRCard/pages/OCR/OCR.js
  11. 10
      subpages/OCRCard/pages/OCR/OCR.wxml
  12. 59
      subpages/index/checkInUser/checkInUser.js
  13. 3
      subpages/index/checkInUser/checkInUser.json
  14. 8
      subpages/index/checkInUser/checkInUser.wxml
  15. 98
      subpages/index/checkInWait/checkInWait.js
  16. 10
      subpages/index/checkInWait/checkInWait.json
  17. 12
      subpages/index/checkInWait/checkInWait.wxml
  18. 51
      subpages/index/checkInWait/checkInWait.wxss
  19. 2
      subpages/index/checkOutConfirm/index/index.wxml

5
api/index.js

@ -28,4 +28,9 @@ export function evaluateAdd(data) {
export function evaluateInfo(id) { export function evaluateInfo(id) {
return fly.get(`/bysmp/evaluate/${id}`) return fly.get(`/bysmp/evaluate/${id}`)
} }
//获取毕业生详细信息
export function selectMzGraduateInfo(pamars) {
return fly.get(`/bysmp/user/selectMzGraduateInfo`,pamars)
}

7
app.json

@ -5,7 +5,8 @@
"pages/life/life", "pages/life/life",
"pages/serve/serve", "pages/serve/serve",
"pages/mine/mine", "pages/mine/mine",
"pages/register/register" "pages/register/register",
"pages/webView/webView"
], ],
"subPackages": [ "subPackages": [
{ {
@ -35,7 +36,9 @@
"policy/index/index", "policy/index/index",
"policy/detail/detail", "policy/detail/detail",
"checkOutConfirm/index/index", "checkOutConfirm/index/index",
"checkOutConfirm/sign/sign" "checkOutConfirm/sign/sign",
"checkInUser/checkInUser",
"checkInWait/checkInWait"
] ]
}, },
{ {

24
pages/index/index.js

@ -134,4 +134,28 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() {}, onShareAppMessage() {},
getUserInfo(){
getUserInfo().then(res=>{
// 有身份证号直接去信息确认没有的话就去识别身份证信息
if(res.data.idCard){
wx.navigateTo({
url: `/subpages/index/checkInUser/checkInUser?idCard=${res.data.idCard}`,
})
}else{
wx.navigateTo({
url: `/subpages/OCRCard/pages/index/index`,
})
}
})
},
navigateTo(e){
if(e.currentTarget.dataset.url && e.currentTarget.dataset.url != '/subpages/OCRCard/pages/index/index'){
wx.navigateTo({
url: e.currentTarget.dataset.url,
})
}else if(e.currentTarget.dataset.url){
this.getUserInfo()
}
}
}); });

4
pages/index/index.wxml

@ -19,8 +19,8 @@
<view class="ellipsis">青岛人彩棉租住房申请条件的先骨干说明</view> <view class="ellipsis">青岛人彩棉租住房申请条件的先骨干说明</view>
</view> </view>
<van-grid square border="{{false}}"> <van-grid square border="{{false}}">
<van-grid-item use-slot wx:for="{{ navList }}" wx:key="index" link-type="navigateTo" <van-grid-item use-slot wx:for="{{ navList }}" wx:key="index"
url="{{item.url}}"> bind:click="navigateTo" data-url="{{item.url}}">
<image style="width: 100rpx;min-height: 100rpx;" src="{{'../../images/icon/nav_'+index + '.png'}}" /> <image style="width: 100rpx;min-height: 100rpx;" src="{{'../../images/icon/nav_'+index + '.png'}}" />
<text class="text-28 m-top-12">{{item.name}}</text> <text class="text-28 m-top-12">{{item.name}}</text>
</van-grid-item> </van-grid-item>

66
pages/webView/webView.js

@ -0,0 +1,66 @@
// pages/webView/webView.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

3
pages/webView/webView.json

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

2
pages/webView/webView.wxml

@ -0,0 +1,2 @@
<!--pages/webView/webView.wxml-->
<text>pages/webView/webView.wxml</text>

1
pages/webView/webView.wxss

@ -0,0 +1 @@
/* pages/webView/webView.wxss */

18
project.private.config.json

@ -14,12 +14,19 @@
"condition": { "condition": {
"miniprogram": { "miniprogram": {
"list": [ "list": [
{
"name": "确认信息",
"pathName": "subpages/index/checkInUser/checkInUser",
"query": "",
"scene": null,
"launchMode": "default"
},
{ {
"name": "新增评价", "name": "新增评价",
"pathName": "subpages/mine/evaluate/evaluate", "pathName": "subpages/mine/evaluate/evaluate",
"query": "id=6", "query": "id=6",
"scene": null, "launchMode": "default",
"launchMode": "default" "scene": null
}, },
{ {
"name": "入住记录", "name": "入住记录",
@ -98,13 +105,6 @@
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{
"name": "subpages/index/checkInUser/checkInUser",
"pathName": "subpages/index/checkInUser/checkInUser",
"query": "",
"launchMode": "default",
"scene": null
},
{ {
"name": "subpages/index/renewalApplication/renewalApplication", "name": "subpages/index/renewalApplication/renewalApplication",
"pathName": "subpages/index/renewalApplication/renewalApplication", "pathName": "subpages/index/renewalApplication/renewalApplication",

32
subpages/OCRCard/pages/OCR/OCR.js

@ -1,7 +1,8 @@
import { import {
ocrAction, ocrAction,
} from '../../../../ocr.js' } from '../../../../ocr.js'
import {bindIdCard} from "../../../../api/user" import {selectMzGraduateInfo} from "../../../../api/index"
const chooseImage = async () => { const chooseImage = async () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -24,7 +25,8 @@ import {
top: 386, top: 386,
left: 24, left: 24,
width: 666, width: 666,
height: 464 height: 464,
info:{}
}, },
onLoad(opt) { onLoad(opt) {
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
@ -106,7 +108,7 @@ import {
success: (res) => { success: (res) => {
ocrAction(res.tempFiles[0].tempFilePath).then(res=>{ ocrAction(res.tempFiles[0].tempFilePath).then(res=>{
if(res.success){ if(res.success){
that.bindIdCard(res.result.data.idcard_res) that.selectMzGraduateInfo(res.result.data.idcard_res)
} }
}) })
}, },
@ -116,11 +118,7 @@ import {
}) })
}, },
bindIdCard(data){
bindIdCard({name:data.name.text,idCard:data.id.text}).then(res=>{
console.log(res);
})
},
takePhotoAction(e) { takePhotoAction(e) {
this.setData({ this.setData({
isShowImage: true, isShowImage: true,
@ -178,7 +176,7 @@ import {
success: function (res) { success: function (res) {
that.setData({ that.setData({
image: res.tempFilePath, image: res.tempFilePath,
isShowImage: false isShowImage: true
}) })
wx.hideLoading() wx.hideLoading()
ocrAction(res.tempFilePath) ocrAction(res.tempFilePath)
@ -186,6 +184,7 @@ import {
that.success(result) that.success(result)
}) })
.catch((e) => { .catch((e) => {
console.log(e);
that.setData({ that.setData({
isShowImage: true isShowImage: true
}) })
@ -208,8 +207,19 @@ import {
}) })
}, },
success(e) { success(e) {
if(res.success){ if(e.success){
this.bindIdCard(res.result.data) this.selectMzGraduateInfo(e.result.data.idcard_res)
} }
}, },
selectMzGraduateInfo(data){
selectMzGraduateInfo({idCard:data.id.text}).then(res=>{
if(res.code === 200){
wx.navigateTo({
url: `/subpages/index/checkInUser/checkInUser?idCard=${data.id.text}`,
})
}
}).catch(err=>{
console.log(err);
})
}
}) })

10
subpages/OCRCard/pages/OCR/OCR.wxml

@ -58,6 +58,7 @@
<cover-view wx:if='{{!isShowImage}}' class="show-img"> <cover-view wx:if='{{!isShowImage}}' class="show-img">
<cover-view style="display: flex; height: 100vh; flex-direction: column;"> <cover-view style="display: flex; height: 100vh; flex-direction: column;">
<cover-view style="height:{{top}}rpx;" class="header"> <cover-view style="height:{{top}}rpx;" class="header">
</cover-view> </cover-view>
<cover-view class="main-container"> <cover-view class="main-container">
<cover-view style="height: {{height}}rpx;" class="container-center"> <cover-view style="height: {{height}}rpx;" class="container-center">
@ -67,6 +68,15 @@
<cover-view style="flex: 0 0 {{left}}px;" class="container-right"></cover-view> <cover-view style="flex: 0 0 {{left}}px;" class="container-right"></cover-view>
</cover-view> </cover-view>
<cover-view class="footer"> <cover-view class="footer">
<cover-view class="tool-container">
<!-- <cover-view wx:if="{{cameraAuth}}" style="margin-bottom: {{touchPadding}}px" class="touch-wording">轻触拍照</cover-view> -->
<cover-view class="img-container">
<cover-image bindtap="goPre" class="close tool-icon btn-click" src="../../image/ScanCode_Close@3x.png"> </cover-image>
<cover-image bindtap="takePhotoAction" class="cam tool-icon btn-click" src="../../image/ScanCode_Cam@3x.png"> </cover-image>
<cover-image bindtap="chooseImg" class="pic tool-icon btn-click" src="../../image/ScanCode_Pic@3x.png"> </cover-image>
</cover-view>
<cover-view style="height: {{bottom}}px" class="tool-blank"></cover-view>
</cover-view>
</cover-view> </cover-view>
<!-- <cover-view ></cover-view> --> <!-- <cover-view ></cover-view> -->
</cover-view> </cover-view>

59
subpages/index/checkInUser/checkInUser.js

@ -1,18 +1,30 @@
// subpages/index/checkInUser/checkInUser.js // subpages/index/checkInUser/checkInUser.js
import {bindIdCard} from "../../../api/user"
import {selectMzGraduateInfo} from "../../../api/index"
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
form:{
graduateName:'',
idCard:'',
telephone:''
}
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
if(options.idCard){
this.setData({
'form.idCard':options.idCard
})
this.selectMzGraduateInfo()
}
}, },
/** /**
@ -62,5 +74,46 @@ Page({
*/ */
onShareAppMessage() { onShareAppMessage() {
} },
submit(){
selectMzGraduateInfo({idCard:this.data.form.idCard}).then(res=>{
if(res.code === 200){
this.bindIdCard()
if(res.data.signType === 0){
//线上支付去跳转签合同
wx.navigateTo({
url: '/pages/webView/webView',
})
}else if(res.data.signType === 1){
// 线下签订去支付
wx.navigateTo({
url: '/subpages/OCRCard/pages/deposit/deposit',
})
}else{
wx.navigateTo({
url: `/subpages/index/checkInWait/checkInWait?idCard=${this.data.form.idCard}`,
})
}
}
}).catch(err=>{
console.log(err);
})
},
bindIdCard(){
bindIdCard({idCard:this.data.form.idCard,name:this.data.form.graduateName}).then(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);
})
}
}) })

3
subpages/index/checkInUser/checkInUser.json

@ -5,6 +5,7 @@
"van-image": "@vant/weapp/image/index", "van-image": "@vant/weapp/image/index",
"van-button": "@vant/weapp/button/index", "van-button": "@vant/weapp/button/index",
"van-cell": "@vant/weapp/cell/index", "van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index" "van-cell-group": "@vant/weapp/cell-group/index",
"van-field": "@vant/weapp/field/index"
} }
} }

8
subpages/index/checkInUser/checkInUser.wxml

@ -10,12 +10,10 @@
</view> </view>
<view class="info"> <view class="info">
<van-cell-group inset> <van-cell-group inset>
<van-cell title="姓名" value="张军" border /> <van-field label="姓名" model:value="{{form.graduateName}}" border placeholder="请输入"/>
<van-cell title="身份证" value="370832199602000040" border /> <van-field label="身份证" model:value="{{form.idCard}}" border placeholder="请输入"/>
<van-cell title="手机号" value="13669603020" /> <van-field label="手机号" model:value="{{form.telephone}}" placeholder="请输入"/>
</van-cell-group> </van-cell-group>
</view> </view>
<view class="btn"> <view class="btn">
<van-button slot="button" block type="primary" round color="linear-gradient(to right, #0DC6C6 , #46DBD5)" bind:tap="submit"> <van-button slot="button" block type="primary" round color="linear-gradient(to right, #0DC6C6 , #46DBD5)" bind:tap="submit">

98
subpages/index/checkInWait/checkInWait.js

@ -0,0 +1,98 @@
// subpages/index/checkInWait/checkInWait.js
import {selectMzGraduateInfo} from "../../../api/index"
Page({
/**
* 页面的初始数据
*/
data: {
idCard:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if(options.idCard){
this.setData({
idCard:options.idCard
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
submit(){
selectMzGraduateInfo({idCard:this.data.idCard}).then(res=>{
if(res.code === 200){
// 线上签订合同跳转信息确认
if(res.data.signType === 0){
wx.navigateTo({
url: '/pages/webView/webView',
})
}else if(res.data.signType === 1){
// 线下签订
wx.navigateTo({
url: '/subpages/OCRCard/pages/deposit/deposit',
})
}else{
// 没有合同信息
wx.showToast({
title: '合同准备中,请稍后...',
icon:'none'
})
}
}
}).catch(err=>{
console.log(err);
})
}
})

10
subpages/index/checkInWait/checkInWait.json

@ -0,0 +1,10 @@
{
"navigationStyle": "custom",
"usingComponents": {
"navigationBar": "/components/navigationBar/navigationBar",
"van-image": "@vant/weapp/image/index",
"van-button": "@vant/weapp/button/index"
}
}

12
subpages/index/checkInWait/checkInWait.wxml

@ -0,0 +1,12 @@
<view class="cont">
<navigationBar title="入住办理" isSowArrow isShowBg backgroundImage="/images/bg.png" height="200px" titleAlign="center"></navigationBar>
<view class="tip-cont">
<van-image width="72" height="72" src="/images/mine/md-restore.png" custom-class="cusImage" />
<view class="txt">
<view class="des">合同准备中,请稍后...</view>
</view>
</view>
<van-button slot="button" block type="primary" round color="linear-gradient(to right, #0DC6C6 , #46DBD5)" bind:tap="submit" custom-class="btn">
下一步
</van-button>
</view>

51
subpages/index/checkInWait/checkInWait.wxss

@ -0,0 +1,51 @@
/* subpages/index/renewalApplication/renewalApplication.wxss */
page{
background: #f8f8f8;
}
.cont {
position: relative;
background: #f8f8f8;
padding: 36rpx;
height: 87vh;
}
.tip-cont {
position: absolute;
width: 678rpx;
height: 624rpx;
display: flex;
align-items: center;
flex-direction: column;
z-index: 999;
background-color: #fff;
border-radius: 10rpx;
top: 214rpx;
}
.cusImage {
margin-top: 90rpx;
}
.txt {
margin-top: 100rpx;
padding: 0 32rpx;
}
.des {
margin-top: 38rpx;
line-height: 46rpx;
font-size: 32rpx;
}
.btn {
position: absolute;
top: 390px;
max-width: 440rpx;
width: calc(100% - 10rpx);
height: 80rpx;
}

2
subpages/index/checkOutConfirm/index/index.wxml

@ -3,7 +3,7 @@
<view class="navigation"> <view class="navigation">
<image src="../../../../images/back.png" class="back" bind:tap="back" style=" top: {{statusHeight}}px;width: 50rpx;height: 50rpx;" bindtap="back" mode="" /> <image src="../../../../images/back.png" class="back" bind:tap="back" style=" top: {{statusHeight}}px;width: 50rpx;height: 50rpx;" bindtap="back" mode="" />
<view style="height: {{navigationHeight}}px; top: {{statusHeight}}px;line-height: {{navigationHeight}}px;"> <view style="height: {{navigationHeight}}px; top: {{statusHeight}}px;line-height: {{navigationHeight}}px;">
身份证识别 退房确认
</view> </view>
<view></view> <view></view>
</view> </view>

Loading…
Cancel
Save