Commit 35988be4 authored by Facius's avatar Facius

缴纳保证金

parent 6cb172a1
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
'4.与人交流时态度良好,沟通顺畅;' '4.与人交流时态度良好,沟通顺畅;'
] ]
}, { }, {
title: '一、注意事项', title: '二、注意事项',
content: [ content: [
'1.平台会对每笔订单收取一定比例的服务费抽成;', '1.平台会对每笔订单收取一定比例的服务费抽成;',
'2.若审核通过,平台工作人员将会电话联系您,并邀约参加师傅培训会,请您耐心等待;', '2.若审核通过,平台工作人员将会电话联系您,并邀约参加师傅培训会,请您耐心等待;',
......
...@@ -101,7 +101,9 @@ ...@@ -101,7 +101,9 @@
{ {
"path": "pages/settle/pay-ensure", "path": "pages/settle/pay-ensure",
"style": { "style": {
"navigationBarTitleText": "缴纳设备押金" "navigationBarTitleText": "缴纳设备押金",
"navigationStyle": "custom",
"disableScroll": true
} }
}, },
{ {
...@@ -239,6 +241,11 @@ ...@@ -239,6 +241,11 @@
"path": "pages/settle/file", //启动页面,必选 "path": "pages/settle/file", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到 "query": "" //启动参数,在页面的onLoad函数里面得到
}, },
{
"name": "缴纳保证金", //模式名称
"path": "pages/settle/pay-ensure", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},
{ {
"name": "签约页面", //模式名称 "name": "签约页面", //模式名称
"path": "pages/settle/sign-contract", //启动页面,必选 "path": "pages/settle/sign-contract", //启动页面,必选
......
<template> <template>
<view class="content"> <view class="content">
<view class="base-list"> <Settle :index="5">
<view class="title">充电桩安装需缴纳设备押金</view> <view class="base-list">
<view class="price"><text>¥</text>{{settledInfo.record.deposit}}</view> <view class="title">充电桩安装需缴纳设备押金</view>
<view class="list"> <view class="price"><text>¥ </text>{{settledInfo.record.deposit}}</view>
<view class="item u-flex u-row-between"> <view class="list">
<view class="txt">您已缴纳金额</view> <view class="item u-flex u-row-between">
<view class="txt">¥ 0.00</view> <view class="txt">您已缴纳金额</view>
</view> <view class="txt-value">¥ 0.00</view>
<view class="item u-flex u-row-between"> </view>
<view class="txt">待缴纳金额</view> <view class="line-view"></view>
<view class="txt">¥ {{settledInfo.record.deposit}}</view> <view class="item u-flex u-row-between">
</view> <view class="txt">待缴纳金额</view>
</view> <view class="txt-value">¥ {{settledInfo.record.deposit}}</view>
<!-- <view class="tips">你已缴纳金额:1000.00元</view> </view>
<view class="tips">充电桩安装需缴纳保证金:1000元待缴金额:1000元</view> --> </view>
</view> <!-- <view class="tips">你已缴纳金额:1000.00元</view>
<view class="seat"></view> <view class="tips">充电桩安装需缴纳保证金:1000元待缴金额:1000元</view> -->
<view class="btn-wrap flex-xc"> </view>
<button class="btn-submit" :disabled="saving" @click="paySubmit">
{{saving ? '支付中……' : '微信支付'}} <template v-slot:bottom>
</button> <view class="btn-wrap flex-xc">
</view> <button class="btn-submit" :disabled="saving" @click="paySubmit">
</view> <image class="button-image" mode="widthFix" src="../../static/settle/weixin@3x.png"></image>
</template> <text>{{saving ? '支付中……' : '微信支付'}}</text>
</button>
<script> </view>
import pingpp from '@/include/libs/pingpp.js' </template>
const globalUrl = process.uniEnv || {} </Settle>
import util from '@/utils/util.js' </view>
export default { </template>
data() {
return { <script>
saving: false, import Settle from '@/components/settle/index.vue'
paySuccess:false, import pingpp from '@/include/libs/pingpp.js'
payResult:{ const globalUrl = process.uniEnv || {}
oid:'' import util from '@/utils/util.js'
}, export default {
isRefresh:false, components: {
settledInfo:null, Settle
} },
}, data() {
onLoad(e) { return {
saving: false,
}, paySuccess: false,
onShow(){ payResult: {
if(!this.settledInfo){ oid: ''
this.getBaseInfo() },
} isRefresh: false,
}, settledInfo: {
computed: {}, record: {
watch:{ deposit: ''
isRefresh(val){ }
this.getBaseInfo() },
} }
}, },
components: { onLoad(e) {
}, },
methods: { onShow() {
successCallback(){ if (!this.settledInfo.record.deposit) {
uni.navigateTo({ this.getBaseInfo()
url:'/pages/settle/prompt' }
}) },
}, computed: {},
async getBaseInfo(){ watch: {
const app = getApp() isRefresh(val) {
const callBack = (vm,result)=>{ this.getBaseInfo()
vm.settledInfo = result }
} },
let settledInfo = app.globalData.settledInfo components: {
if(settledInfo){
callBack(this,settledInfo) },
return methods: {
} successCallback() {
await app.getBaseInfo(this,callBack) uni.navigateTo({
url: '/pages/settle/prompt'
}, })
async pending(){ },
// const timer = setTimeout(async ()=>{ async getBaseInfo() {
// clearTimeout(timer) const app = getApp()
const params = { const callBack = (vm, result) => {
...this.payResult vm.settledInfo = result
} }
const res = await this.$u.api.getSettleDepositResult(params); let settledInfo = app.globalData.settledInfo
if(res.status!==true){ if (settledInfo) {
this.saving = false callBack(this, settledInfo)
return return
} }
uni.showToast({ await app.getBaseInfo(this, callBack)
title:'支付成功',
}) },
let timer = setTimeout(()=>{ async pending() {
clearTimeout(timer) // const timer = setTimeout(async ()=>{
this.successCallback() // clearTimeout(timer)
},3000) const params = {
}, ...this.payResult
getCode: async function() { }
let that = this const res = await this.$u.api.getSettleDepositResult(params);
uni.showLoading({ if (res.status !== true) {
title: '加载中', this.saving = false
}) return
return new Promise((resolve, reject) => { }
uni.login({ uni.showToast({
// #ifdef MP-ALIPAY title: '支付成功',
scopes: 'auth_user', })
// #endif let timer = setTimeout(() => {
success: function(res) { clearTimeout(timer)
if (res.code) { this.successCallback()
resolve(res.code) }, 3000)
//resolve(res.code); },
} else { getCode: async function() {
reject('未取得code'); let that = this
} uni.showLoading({
}, title: '加载中',
fail: function(res) { })
reject('用户授权失败wx.login'); return new Promise((resolve, reject) => {
}, uni.login({
complete() { // #ifdef MP-ALIPAY
uni.hideLoading() scopes: 'auth_user',
} // #endif
}); success: function(res) {
}); if (res.code) {
}, resolve(res.code)
async paySubmit() { //resolve(res.code);
const self = this } else {
this.saving = true reject('未取得code');
uni.showLoading({ }
title:'支付中……' },
}) fail: function(res) {
// 提交支付订单 reject('用户授权失败wx.login');
const code = await this.getCode() },
const params = { complete() {
oid: this.settledInfo.record.id, uni.hideLoading()
type: 'wx_lite', }
openid:util.getOpenid(), });
code:code });
// appid:'wxd1d6eede324b0465' },
} async paySubmit() {
const response = await this.$u.api.paySettleDeposit(params) const self = this
if (response.status!==true) { this.saving = true
uni.showToast({ uni.showLoading({
title: response.message, title: '支付中……'
icon:'none' })
}) // 提交支付订单
return const code = await this.getCode()
} const params = {
let timer = setTimeout(res=>{ oid: this.settledInfo.record.id,
clearTimeout(timer) type: 'wx_lite',
uni.showModal({ openid: util.getOpenid(),
title: '提示', code: code
content: '支付结果', // appid:'wxd1d6eede324b0465'
confirmText:'成功', }
cancelText:'失败', const response = await this.$u.api.paySettleDeposit(params)
success: function (res) { if (response.status !== true) {
if (res.confirm) { uni.showToast({
// console.log(res.confirm,'res.confirm') title: response.message,
self.pending() icon: 'none'
} else if (res.cancel) { })
self.saving = false return
console.log('用户点击取消'); }
} let timer = setTimeout(res => {
} clearTimeout(timer)
}); uni.showModal({
},1000) title: '提示',
content: '支付结果',
const { confirmText: '成功',
charge, cancelText: '失败',
oid success: function(res) {
} = response.data; if (res.confirm) {
this.payResult.oid = oid // console.log(res.confirm,'res.confirm')
//Web 与微信内支付 self.pending()
pingpp.createPayment(charge, (result, err) => { } else if (res.cancel) {
if (result == "success") { self.saving = false
// 只有微信公众账号 (wx_pub)、微信小程序 (wx_lite)、QQ 公众号 (qpay_pub)、支付宝口碑 (alipay_qr) console.log('用户点击取消');
// 支付成功的结果会在这里返回,其他的支付结果都会跳转到 extra 中对应的 URL。 }
uni.showToast({ }
title: '支付成功', });
icon:'none' }, 1000)
})
} else if (result == "fail") { const {
// charge 不正确或者微信公众账号/QQ 公众号/支付宝口碑支付失败时会在此处返回 charge,
// console.log(err.msg) oid
} else if (result == "cancel") { } = response.data;
// 微信公众账号、QQ 公众号、支付宝口碑支付取消支付 this.payResult.oid = oid
uni.showToast({ //Web 与微信内支付
title: '您已经取消了支付', pingpp.createPayment(charge, (result, err) => {
icon:'none' if (result == "success") {
}) // 只有微信公众账号 (wx_pub)、微信小程序 (wx_lite)、QQ 公众号 (qpay_pub)、支付宝口碑 (alipay_qr)
} // 支付成功的结果会在这里返回,其他的支付结果都会跳转到 extra 中对应的 URL。
}); uni.showToast({
}, title: '支付成功',
}, icon: 'none'
} })
</script> } else if (result == "fail") {
// charge 不正确或者微信公众账号/QQ 公众号/支付宝口碑支付失败时会在此处返回
<style lang="scss"> // console.log(err.msg)
.base-list { } else if (result == "cancel") {
text-align: center; // 微信公众账号、QQ 公众号、支付宝口碑支付取消支付
.txt{ uni.showToast({
title: '您已经取消了支付',
line-height: 50rpx; icon: 'none'
font-size:36rpx; })
color: #333; }
} });
.title{ },
margin-top:120rpx; },
font-weight: bold; }
line-height: 50rpx; </script>
font-size:36rpx;
color: #333; <style lang="scss" scoped>
} .content {
.price{ background-color: #F4F5F7;
margin-top:120rpx; position: absolute;
font-weight: bold; top: 0;
line-height: 90rpx; left: 0;
font-size:64rpx; width: 100%;
color: #333; height: 100%;
text{ display: flex;
font-size:32rpx; flex-direction: column;
} }
}
.list{ .base-list {
margin-top:200rpx; background-color: #FFFFFF;
padding:0 50rpx; border-radius: 12rpx;
.item{ padding: 30rpx;
padding:28rpx 0; min-height: 160rpx;
border-bottom: 1rpx solid #FDFDFD; margin-bottom: 188rpx;
} text-align: center;
.txt{
line-height: 44rpx; .txt {
font-size:32rpx;
color: #333; line-height: 50rpx;
} font-size: 36rpx;
} color: #333;
.tips { }
margin-top: 20rpx;
padding: 0 30rpx; .title {
line-height: 40rpx; margin-top: 80rpx;
font-size: 28rpx; font-weight: bold;
color: #666; line-height: 50rpx;
} font-size: 40rpx;
} color: #333;
}
.seat {
padding-bottom: 144rpx; .price {
} margin-top: 100rpx;
font-weight: bold;
/*提交按钮*/ line-height: 90rpx;
.btn-wrap { font-size: 64rpx;
position: fixed; color: #2272FF;
// margin: px2rem(36);
left: 0; text {
right: 0; font-size: 32rpx;
bottom: 0; }
padding: 30rpx 0; }
background: #f3f3f3;
.list {
.btn-submit { margin-top: 200rpx;
width: 600rpx; padding: 0 50rpx;
border-radius: 52rpx;
// left: 5%; .line-view {
// bottom: px2rem(36); background-color: #F4F5F7;
height: 104rpx; height: 2rpx;
line-height: 104rpx; width: 100%;
background: #2272ff; }
font-size: 32rpx;
color: #fff; .item {
padding: 28rpx 0;
&:disabled { }
border: 2rpx solid #999;
background-color: #f3f3f3; .txt {
color: #999; line-height: 44rpx;
} font-size: 28rpx;
} color: #666666;
} }
.txt-value {
line-height: 44rpx;
font-size: 28rpx;
color: #333;
}
}
.tips {
margin-top: 20rpx;
padding: 0 30rpx;
line-height: 40rpx;
font-size: 28rpx;
color: #666;
}
}
.seat {
padding-bottom: 144rpx;
}
/*提交按钮*/
.btn-wrap {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
.button-image {
width: 38rpx;
padding-right: 20rpx;
}
.btn-submit {
width: 600rpx;
height: 104rpx;
line-height: 104rpx;
border-radius: 52rpx;
background: #2272FF;
font-size: 32rpx;
color: #fff;
&[disabled] {
background-color: #D1D4D4;
color: #FFFFFF;
}
}
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment