This commit is contained in:
zoujiandong
2025-06-17 17:58:29 +08:00
commit b496603f7c
129 changed files with 14644 additions and 0 deletions
+154
View File
@@ -0,0 +1,154 @@
// case/pages/agreement/agreement.js
import {getDeal,getRubric,getSign} from "../../../api/api"
import { throttle } from "../../../utils/util"
const dayjs = require("../../../utils/dayjs");
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
node:'',
type:'',
year:'',
month:'',
day:'',
signImg:'',
navName:'项目协议'
},
handleGetDeal(name,mobile,bankName,bankCardNo,idCardNo){
getDeal().then(res=>{
let deal=res.replace(/\$\{name\}/g,name).replace(/\$\{mobile\}/g,mobile).replace(/\$\{bankName\}/g,bankName).replace(/\$\{bankCardNo\}/g,bankCardNo).replace(/\$\{idCardNo\}/g,idCardNo);
this.setData({
node:deal
})
})
},
handleFetRubric(){
getRubric().then(res=>{
this.setData({
node:res
})
})
},
goSign:throttle(function(){
let tokenStr=''
const { envVersion } = wx.getAccountInfoSync().miniProgram;
if(envVersion=="develop" || envVersion=="trial"){
tokenStr="DEV_CASE_TOKEN"
}else{
tokenStr="PROD_CASE_TOKEN"
}
let token = wx.getStorageSync(tokenStr);
if(token){
app.method.navigateTo({
url: '/case/pages/bankCard/bankCard',
complete:function(err){
console.log(err)
}
})
}else{
app.method.navigateTo({
url: '/case/pages/mobileLogin/mobileLogin?redirectUrl='+encodeURIComponent('case/pages/agreement/agreement'),
complete:function(err){
console.log(err)
}
})
}
}),
handleGetSign(){
getSign().then(res=>{
if(res && res.signImg){
let {signImg,createTime,bankCardNo,bankName,idCardNo,mobile,name}=res;
this.handleGetDeal(name,mobile,bankName,bankCardNo,idCardNo);
this.setData({
signImg:signImg,
year:dayjs(createTime).format("YYYY"),
month:dayjs(createTime).format("M"),
day:dayjs(createTime).format("D"),
})
}else{
this.handleGetDeal('','','','','');
}
}).catch(error=>{
if(error.code==30007){
app.method.navigateTo({
url: '/case/pages/mobileLogin/mobileLogin?redirectUrl='+encodeURIComponent('case/pages/agreement/agreement'),
complete:function(err){
console.log(err)
}
})
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if(options.type=="description"){
this.handleFetRubric();
this.setData({
type:'description',
navName:'操作说明'
})
}else{
this.handleGetSign();
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
// onShareAppMessage() {
// }
})
+6
View File
@@ -0,0 +1,6 @@
{
"usingComponents": {
"navBar":"../../../components/navBar/navBar"
},
"navigationStyle":"custom"
}
+33
View File
@@ -0,0 +1,33 @@
<!--case/pages/agreement/agreement.wxml-->
<navBar navName="{{navName}}"></navBar>
<view class="page">
<view class="con {{(!type && !signImg)?'active':''}}">
<rich-text nodes="{{node}}"></rich-text>
</view>
<view class="imgbox" wx:if="{{signImg}}">
<view class="jiafang">
<view>甲方:北京欣欣相照健康科技有限公司</view>
<view class="signdate">日期:<text class="signtext">{{year}}</text>年<text class="signtext">{{month}}</text>月<text class="signtext">{{day}}</text>日</view>
<image src="../../../static/gdxz.png" mode="" class="company" />
</view>
<view class="jiafang" style="margin-top: 40rpx;">
<view>乙方:北京杏苑爱医科技发展有限公司</view>
<view class="signdate">日期:<text class="signtext">{{year}}</text>年<text class="signtext">{{month}}</text>月<text class="signtext">{{day}}</text>日</view>
<image src="../../../static/xinlin.png" mode="" class="company company2" />
</view>
<view class="yifang" style="margin-top: 40rpx;">
<view>丙方:</view>
<view class="signdate">日期:<text class="signtext">{{year}}</text>年<text class="signtext">{{month}}</text>月<text class="signtext">{{day}}</text>日</view>
<image src="{{signImg}}" mode="" class="signimg" />
</view>
<!-- <image src="../../../static/gdxz.png" mode="" class="company" />
<image src="{{signImg}}" mode="" class="signimg" /> -->
</view>
<!-- wx:if="{{!type && !signImg}}" -->
<view class="btnbox" wx:if="{{!type && !signImg}}">
<view class="btn" bind:tap="goSign">同意签署</view>
</view>
</view>
+92
View File
@@ -0,0 +1,92 @@
/* case/pages/agreement/agreement.wxss */
.page{
background: #F7F9F9;
flex:1;
display: flex;
position: relative;
flex-direction: column;
margin-top: 172rpx;
}
.con{
flex:1;
padding:10rpx 32rpx 0;
margin-bottom: 20rpx;
}
.con.active{
margin-bottom: 150rpx;
}
.btnbox{
z-index:999;
padding:0 32rpx;
background-color: #fff;
position: fixed;
box-sizing: border-box;
bottom:0;
height: 130rpx;
width:100%;
}
.btnbox .btn{
margin-top: 15rpx;
width:100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
font-weight: 500;
color: #FFFFFF;
height: 88rpx;
background: linear-gradient(90deg, #377FF7 0%, #51AAFF 100%);
border-radius: 8rpx;
}
.imgbox{
margin:30rpx 32rpx 60rpx;
display: flex;
flex-direction: column;
align-items: stretch;
justify-content: space-between;
}
.company{
z-index:99;
top:-55rpx;
position: absolute;
width:220rpx;
right:206rpx;
height:220rpx;
}
.signimg{
top:-40rpx;
left:80rpx;
position: absolute;
width:160rpx;
height:120rpx;
}
.signbox{
display: flex;
align-items: center;
justify-content: flex-start;
}
.jiafang{
position: relative;
flex:1;
font-size:28rpx;
margin-bottom:50rpx;
}
.yifang{
font-size:small;
flex:1;
font-size:28rpx;
display: flex;
justify-content: space-between;
align-items: flex-start;
flex-direction: column;
position: relative;
}
.signdate{
margin-top: 40rpx;
}
.company2{
top:-90rpx;
right:280rpx;
width:280rpx;
height:300rpx;
}