Browse Source

webview页面完善 签订合同完成后做判断签订完成跳转支付

epass
mk 3 months ago
parent
commit
a912fc2928
  1. 6
      api/index.js
  2. 2
      api/user.js
  3. 4
      pages/mine/mine.wxml
  4. 2
      pages/webView/webView.js
  5. 20
      project.private.config.json
  6. 5
      subpages/OCRCard/pages/deposit/deposit.js
  7. 4
      subpages/OCRCard/pages/deposit/deposit.wxml
  8. 21
      subpages/index/checkInUser/checkInUser.js
  9. 28
      subpages/index/checkInWait/checkInWait.js
  10. 5
      subpages/index/checkOutConfirm/index/index.wxml
  11. 6
      subpages/index/checkOutConfirm/index/index.wxss
  12. 4
      subpages/index/policy/index/index.js
  13. 3
      utils/request.js

6
api/index.js

@ -32,5 +32,7 @@ export function evaluateInfo(id) {
export function selectMzGraduateInfo(pamars) {
return fly.get(`/bysmp/user/selectMzGraduateInfo`,pamars)
}
//下载已签署文件
export function eSignDownload(pamars) {
return fly.get(`/eSign/download/${pamars.bizId}`,{signType:pamars.signType})
}

2
api/user.js

@ -6,7 +6,7 @@ export function bindPhone(code) {
return fly.put(`/bysmp/user/bindPhone?code=${code}`)
}
export function bindIdCard(query) {
return fly.put(`/bysmp/user/bindIdCard?name=${query.name}&icCard=${query.idCard}`,)
return fly.put(`/bysmp/user/bindIdCard?name=${query.name}&idCard=${query.idCard}`,)
}
export function getUserInfo() {
return fly.get(`/bysmp/user/wxUserInfo`)

4
pages/mine/mine.wxml

@ -63,12 +63,12 @@
资源管理
</view>
<view class="flex flex-sb">
<view>本月用水:<text class="num blue">12m³</text> <image class="icon-26" src="../../images/mine/blue.png"></image>
<view>本月用水:<text class="num blue">--</text> <image class="icon-26" src="../../images/mine/blue.png"></image>
</view>
<view style="color: #bbbbbb;">
|
</view>
<view>本月用电:<text class="num pink">28kw-h</text><image class="icon-26" src="../../images/mine/red.png"></image>
<view>本月用电:<text class="num pink">--</text><image class="icon-26" src="../../images/mine/red.png"></image>
</view>
</view>
</view>

2
pages/webView/webView.js

@ -14,7 +14,7 @@ Page({
onLoad(options) {
if(options.url){
this.setData({
url:options.url
url:decodeURIComponent(options.url)
})
}
},

20
project.private.config.json

@ -1,5 +1,5 @@
{
"libVersion": "2.33.0",
"libVersion": "3.7.12",
"projectname": "epmet-apartment-mp",
"setting": {
"urlCheck": false,
@ -15,12 +15,19 @@
"miniprogram": {
"list": [
{
"name": "确认信息",
"pathName": "subpages/index/checkInUser/checkInUser",
"name": "支付",
"pathName": "subpages/OCRCard/pages/deposit/deposit",
"query": "",
"scene": null,
"launchMode": "default"
},
{
"name": "确认信息",
"pathName": "subpages/index/checkInUser/checkInUser",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "新增评价",
"pathName": "subpages/mine/evaluate/evaluate",
@ -77,13 +84,6 @@
"launchMode": "default",
"scene": null
},
{
"name": "subpages/OCRCard/pages/deposit/deposit",
"pathName": "subpages/OCRCard/pages/deposit/deposit",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "subpages/index/policy/detail/detail",
"pathName": "subpages/index/policy/detail/detail",

5
subpages/OCRCard/pages/deposit/deposit.js

@ -68,5 +68,10 @@ Page({
*/
onShareAppMessage() {
},
toCheckInRecord(){
wx.navigateTo({
url: '/subpages/mine/checkInRecord/checkInRecord',
})
}
})

4
subpages/OCRCard/pages/deposit/deposit.wxml

@ -30,7 +30,7 @@
<view class="remk">您尚未完成支付,请尽快前往
“我的-入住记录”完成支付。</view>
<view class="butn">
<van-button slot="button" custom-style="height:70rpx;" block type="primary" round color="linear-gradient(to right, #0DC6C6 , #46DBD5)" bind:tap="submit">
<van-button slot="button" custom-style="height:70rpx;" block type="primary" round color="linear-gradient(to right, #0DC6C6 , #46DBD5)" bind:tap="toCheckInRecord">
前往支付
</van-button>
@ -46,8 +46,6 @@
</van-button>
</view>
</view>
</view>

21
subpages/index/checkInUser/checkInUser.js

@ -1,6 +1,6 @@
// subpages/index/checkInUser/checkInUser.js
import {bindIdCard} from "../../../api/user"
import {selectMzGraduateInfo} from "../../../api/index"
import {selectMzGraduateInfo,eSignDownload} from "../../../api/index"
Page({
@ -33,12 +33,27 @@ Page({
onReady() {
},
onRouteDone(e){
console.log(e);
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
if(this.data.form){
const pamars = {
bizId:this.data.form.chooseRecId || '',
signType:1
}
eSignDownload(pamars).then(res=>{
if(res.data.code === 0){
wx.navigateTo({
url: '/subpages/OCRCard/pages/deposit/deposit',
})
}
})
}
},
/**
@ -82,7 +97,7 @@ Page({
if(res.data.signType === 0){
//线上支付去跳转签合同
wx.navigateTo({
url: '/pages/webView/webView',
url: '/pages/webView/webView?url=' + encodeURIComponent(res.data.contract),
})
}else if(res.data.signType === 1){
// 线下签订去支付

28
subpages/index/checkInWait/checkInWait.js

@ -1,12 +1,13 @@
// subpages/index/checkInWait/checkInWait.js
import {selectMzGraduateInfo} from "../../../api/index"
import {selectMzGraduateInfo,eSignDownload} from "../../../api/index"
Page({
/**
* 页面的初始数据
*/
data: {
idCard:''
idCard:'',
info:{}
},
/**
@ -27,11 +28,24 @@ Page({
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
if(this.data.info){
const pamars = {
bizId:this.data.info.chooseRecId ||'',
signType:1
}
eSignDownload(pamars).then(res=>{
if(res.data.code === 0){
wx.navigateTo({
url: '/subpages/OCRCard/pages/deposit/deposit',
})
}
})
}
},
/**
@ -72,10 +86,16 @@ Page({
submit(){
selectMzGraduateInfo({idCard:this.data.idCard}).then(res=>{
if(res.code === 200){
this.setData({
info:res.data
})
// wx.navigateTo({
// url: '/pages/webView/webView?url=' + encodeURIComponent('https://smlh5.esign.cn/mesign/guide?context=oajSUuKZG1&flowId=8004dd72e83e419d8a56fff4b32fd0d6&organ=false&appId=7439066638&linkSource=1&bizType=1&tsign_source_type=SIGN_LINK_XUANYUAN&tsign_source_detail=16R2mv%2F27h2Y5CkM9bwhboJgEfaR5q9nLW1M2TKOt%2FsnmaDbpS23d%2FYDkRZo47IgfpkLUByBPb9sP4eZvvz00wnj4Wshq%2B%2F3XgAN8xrJ7u%2BLr1f%2Fc9JAccKV839CDqMhELJXjp6kV5WYnH3Fvcm6wfNCwqHwSeMCsqO7xbinP4ECLnKbmG3FrVaZVUrg7ts7YVLxKBBH1KjdwnkF3Ehl9WC%2FTmIpV6JsVoMiZndgN3cLmTYyn8XR6DqEucQGh3hZD\res.data.contract'),
// })
// 线上签订合同跳转信息确认
if(res.data.signType === 0){
wx.navigateTo({
url: '/pages/webView/webView?url=' + res.data.contract,
url: '/pages/webView/webView?url=' + encodeURIComponent(res.data.contract),
})
}else if(res.data.signType === 1){
// 线下签订

5
subpages/index/checkOutConfirm/index/index.wxml

@ -1,11 +1,10 @@
<!-- subpages/index/checkOutConfirm/index/index.wxml -->
<view class="navigation">
<view >
<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 class="navigation" style="height: {{navigationHeight}}px; top: {{statusHeight}}px;line-height: {{navigationHeight}}px;">
退房确认
</view>
<view></view>
</view>
<view wx:if="{{info}}">

6
subpages/index/checkOutConfirm/index/index.wxss

@ -13,15 +13,14 @@
.navigation {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
color: #333333;
font-size: 32rpx;
z-index: 100;
position: fixed;
margin-top: 20rpx;
left: 50%;
transform: translateX(-60rpx);
}
.back {
width: 30rpx;
@ -30,6 +29,7 @@
margin-top: 20rpx;
border-radius: 0rpx;
z-index: 101;
position: fixed;
}
.info {
background: #ffffff;

4
subpages/index/policy/index/index.js

@ -14,7 +14,7 @@ Page({
active: 0,
policyList:[],
pageNo: 1,
pageSize: 5,
pageSize: 6,
loadingStatus:true
},
@ -29,7 +29,7 @@ Page({
title:'加载中...'
})
const res = await getPolicyList({
pageNo: this.data.pageNo,
pageNum: this.data.pageNo,
pageSize: this.data.pageSize,
dictCode:this.data.active
});

3
utils/request.js

@ -24,7 +24,6 @@ const request = function (url, options) {
data: options.method === 'GET' ? options.data : JSON.stringify(options.data),
header: header,
success (response) {
console.log(response);
if (response.statusCode === 200) {
if(response.data.code===200){
resolve(response.data)
@ -45,7 +44,7 @@ const request = function (url, options) {
})
reject(response.data)
}
} else {
} else if(response.statusCode !== 404){
wx.showToast({
title: '网络问题,请稍后再试。',
icon: 'none',

Loading…
Cancel
Save