提交
This commit is contained in:
parent
a256b227f4
commit
da638ec28a
@ -66,13 +66,21 @@
|
||||
uni.scanCode({
|
||||
onlyFromCamera:true,
|
||||
success(res){
|
||||
let hdzcode = '' //??
|
||||
|
||||
// console.log('条码类型:' + res.scanType);
|
||||
// console.log('条码内容:' + res.result);
|
||||
let pars = ''
|
||||
if(res.path){
|
||||
pars = res.path.split('?')[1]
|
||||
}
|
||||
if(/hdzcode/.test(pars)){
|
||||
uni.navigateTo({
|
||||
url:`/homePages/reservation/index?hdzcode=${hdzcode}&phoneNumber=${uni.getStorageSync('userInfor').phoneNumber?uni.getStorageSync('userInfor').phoneNumber:''}`
|
||||
url:`/homePages/reservation/index?${pars}&phoneNumber=${uni.getStorageSync('userInfor').phoneNumber?uni.getStorageSync('userInfor').phoneNumber:''}`
|
||||
})
|
||||
}else{
|
||||
uni.showToast({
|
||||
title:'请扫码换电站小程序码',
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
fail() {
|
||||
uni.switchTab({
|
||||
|
||||
@ -7,7 +7,13 @@
|
||||
titleStyle="color:#fff"
|
||||
:placeholder="true"
|
||||
/>
|
||||
<view v-if="hdzcode" style="padding: 30rpx;border-bottom: 1px solid #aaaa7f;">
|
||||
<view style="padding-bottom: 20rpx;text-align: center;font-size: 48rpx;color: #005500;">{{formdata.stationName}}</view>
|
||||
<view style="color: #d09b24;font-size: 28rpx;">温馨提示:您的车辆如果都不支持此换电站,请返回首页重新选择</view>
|
||||
</view>
|
||||
|
||||
<view style="padding: 30rpx;">
|
||||
|
||||
<!-- 注意,如果需要兼容微信小程序,最好通过setRules方法设置rules规则 -->
|
||||
<up-form
|
||||
labelPosition="left"
|
||||
@ -75,12 +81,21 @@
|
||||
</template>
|
||||
|
||||
<up-form-item
|
||||
v-if="hdzcode === ''"
|
||||
label="换电站"
|
||||
prop="stationName"
|
||||
borderBottom
|
||||
>
|
||||
<up-input v-model="formdata.stationName" readonly border="none" placeholder="请选择换电站" suffixIcon="arrow-down" suffixIconStyle="color: #bababa" @tap="hdzhand" />
|
||||
</up-form-item>
|
||||
<!-- <up-form-item
|
||||
v-else
|
||||
label="换电站"
|
||||
prop="stationName"
|
||||
borderBottom
|
||||
>
|
||||
<up-input v-model="formdata.stationName" readonly border="none" placeholder="请选择换电站" />
|
||||
</up-form-item> -->
|
||||
<up-form-item
|
||||
label="预约日期"
|
||||
prop="swapDay"
|
||||
@ -115,10 +130,12 @@
|
||||
@cancel="hdzcancel"
|
||||
/>
|
||||
|
||||
<!--日期-->
|
||||
<!--日期 mindate-->
|
||||
<up-calendar
|
||||
:show="dateshow"
|
||||
mode="single"
|
||||
:defaultDate="mindate"
|
||||
:minDate="mindate"
|
||||
color="#00aa7f"
|
||||
@confirm="dateconfirm"
|
||||
@close="dateclose"
|
||||
@ -170,7 +187,7 @@
|
||||
import { ref, reactive } from 'vue'
|
||||
import { addrese,gethdz,getphone,carlist } from '@/utils/service'
|
||||
import { onLoad,onShow } from '@dcloudio/uni-app'
|
||||
import { isToday } from '@/utils/commen'
|
||||
import { isToday,getDateDaysAgo } from '@/utils/commen'
|
||||
//查询车辆
|
||||
let cpcolumns = ref<any[]>([])
|
||||
carlist(uni.getStorageSync('wxuid')).then((rps:any) => {
|
||||
@ -179,6 +196,7 @@
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
//const phoneNumber = uni.getStorageSync('PhoneNumber')
|
||||
|
||||
//获取手机号
|
||||
@ -209,8 +227,12 @@
|
||||
//reservationTime:'', //预约时间
|
||||
swapDuration:'' //预约换电时间段,示例值(8:00-10:00)
|
||||
})
|
||||
|
||||
let hdzcode = ref('')
|
||||
//是否全天
|
||||
let openAllDay:string|number = ''
|
||||
let stiem:any = ''
|
||||
let etime:any = ''
|
||||
let mindate = ref<any>(0)
|
||||
onLoad((opt:any) => {
|
||||
hdzcode.value = opt.hdzcode?opt.hdzcode:''
|
||||
if(opt.phoneNumber){
|
||||
@ -218,24 +240,26 @@
|
||||
nuindex.value = 1
|
||||
}
|
||||
|
||||
// formdata.stationCode = hdzcode.value
|
||||
// formdata.stationName = opt.hdzname?opt.hdzname:''
|
||||
formdata.stationCode = hdzcode.value
|
||||
formdata.stationName = opt.hdzname?opt.hdzname:''
|
||||
|
||||
|
||||
openAllDay = opt.openAllDay
|
||||
stiem = opt.stiem?opt.stiem:''
|
||||
etime = opt.etime?opt.etime:''
|
||||
|
||||
if(hdzcode.value){
|
||||
settime(true)
|
||||
}
|
||||
if(openAllDay == 0){
|
||||
const date = new Date()
|
||||
const hours = date.getHours()
|
||||
if(hours >= etime.split(':')[0]*1){
|
||||
mindate.value = getDateDaysAgo(1,1)
|
||||
}
|
||||
}
|
||||
})
|
||||
const timecolumns:any = ref([
|
||||
// [
|
||||
// '8:00 - 9:00',
|
||||
// '9:00 - 10:00',
|
||||
// '10:00 - 11:00',
|
||||
// '11:00 - 12:00',
|
||||
// '12:00 - 13:00',
|
||||
// '13:00 - 14:00',
|
||||
// '14:00 - 15:00',
|
||||
// '15:00 - 16:00',
|
||||
// '16:00 - 17:00',
|
||||
// '17:00 - 18:00'
|
||||
// ]
|
||||
])
|
||||
const timecolumns:any = ref([])
|
||||
|
||||
const datelist = [
|
||||
{
|
||||
@ -336,56 +360,91 @@
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
|
||||
function settime(init?:boolean) {
|
||||
timecolumns.value.splice(0)
|
||||
const date = new Date()
|
||||
const hours = date.getHours()
|
||||
const Minutes = date.getMinutes()
|
||||
//const Minutes = date.getMinutes()
|
||||
let arr:any = []
|
||||
|
||||
let gstime = stiem.split(':')
|
||||
let getime = etime.split(':')
|
||||
|
||||
let sh = gstime[0]*1
|
||||
let eh = getime[0]*1
|
||||
|
||||
let shalf = gstime[1]*1
|
||||
let ehalf = getime[1]*1
|
||||
|
||||
|
||||
if(openAllDay == 1){
|
||||
datelist.forEach(n => {
|
||||
if(n.time > hours || Minutes <= 30 && (n.time == hours)){
|
||||
//|| Minutes <= 30 && (n.time == hours)
|
||||
if(n.time >= hours){
|
||||
arr.push(n.timeslot)
|
||||
}
|
||||
})
|
||||
}else{
|
||||
datelist.forEach(n => {
|
||||
if(n.time >= hours && n.time >= sh && eh > n.time){
|
||||
if(shalf == 30 && arr.length == 0){
|
||||
arr.push(`${stiem} - ${sh+1}:00`)
|
||||
}else{
|
||||
arr.push(n.timeslot)
|
||||
}
|
||||
}
|
||||
})
|
||||
if(ehalf == 30){
|
||||
arr[arr.length -1] = `${eh-1}:00 - ${etime}`
|
||||
}
|
||||
}
|
||||
|
||||
// datelist.forEach(n => {
|
||||
// if(n.time > hours || Minutes <= 30 && (n.time == hours)){
|
||||
// arr.push(n.timeslot)
|
||||
// }
|
||||
// })
|
||||
if(init){
|
||||
if(arr.length > 0){
|
||||
timecolumns.value.push(arr)
|
||||
}
|
||||
}else{
|
||||
if(isToday(new Date(formdata.swapDay))){
|
||||
if(arr.length > 0){
|
||||
timecolumns.value.push(arr)
|
||||
}
|
||||
}else{
|
||||
timecolumns.value.push([
|
||||
'0:00 - 1:00',
|
||||
'1:00 - 2:00',
|
||||
'2:00 - 3:00',
|
||||
'3:00 - 4:00',
|
||||
'4:00 - 5:00',
|
||||
'5:00 - 6:00',
|
||||
'6:00 - 7:00',
|
||||
'7:00 - 8:00',
|
||||
'8:00 - 9:00',
|
||||
'9:00 - 10:00',
|
||||
'10:00 - 11:00',
|
||||
'11:00 - 12:00',
|
||||
'12:00 - 13:00',
|
||||
'13:00 - 14:00',
|
||||
'14:00 - 15:00',
|
||||
'15:00 - 16:00',
|
||||
'16:00 - 17:00',
|
||||
'17:00 - 18:00',
|
||||
'18:00 - 19:00',
|
||||
'19:00 - 20:00',
|
||||
'20:00 - 21:00',
|
||||
'21:00 - 22:00',
|
||||
'22:00 - 23:00',
|
||||
'23:00 - 24:00'
|
||||
])
|
||||
if(openAllDay == 1){
|
||||
timecolumns.value.push(datelist.map(n => {
|
||||
return n.timeslot
|
||||
}))
|
||||
}else{
|
||||
arr.splice(0)
|
||||
datelist.forEach(n => {
|
||||
if(n.time >= sh && eh >= n.time){
|
||||
if(shalf == 30 && arr.length == 0){
|
||||
arr.push(`${stiem} - ${sh+1}:00`)
|
||||
}else{
|
||||
arr.push(n.timeslot)
|
||||
}
|
||||
}
|
||||
})
|
||||
if(ehalf == 30){
|
||||
arr[arr.length -1] = `${eh-1}:00 - ${etime}`
|
||||
}
|
||||
}
|
||||
if(arr.length > 0){
|
||||
timecolumns.value.push(arr)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
settime(true)
|
||||
|
||||
// name:n.name,
|
||||
// code:n.code,
|
||||
// label:`${n.name}${n.isSuitable?'':'(不支持)'}`,
|
||||
@ -410,20 +469,20 @@
|
||||
required: true,
|
||||
message: '请选择车牌号',
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
{
|
||||
// 自定义验证函数,见上说明
|
||||
validator: (rule:any, value:any) => {
|
||||
const regExp = new RegExp(/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF])|([DF][A-HJ-NP-Z0-9][0-9]{4}))$/)
|
||||
if (regExp.test(value)) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
message: '车牌号格式不对',
|
||||
// 触发器可以同时用blur和change
|
||||
trigger: ['change','blur'],
|
||||
}
|
||||
// {
|
||||
// // 自定义验证函数,见上说明
|
||||
// validator: (rule:any, value:any) => {
|
||||
// const regExp = new RegExp(/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF])|([DF][A-HJ-NP-Z0-9][0-9]{4}))$/)
|
||||
// if (regExp.test(value)) {
|
||||
// return true
|
||||
// }
|
||||
// return false
|
||||
// },
|
||||
// message: '车牌号格式不对',
|
||||
// // 触发器可以同时用blur和change
|
||||
// trigger: ['change','blur'],
|
||||
// }
|
||||
],
|
||||
stationName:{
|
||||
type: 'string',
|
||||
@ -451,9 +510,33 @@
|
||||
function cpconfirm(v:any) {
|
||||
cpshow.value = false
|
||||
formdata.plateNum = v.value[0].plateNum
|
||||
|
||||
if(hdzcode.value){
|
||||
gethdz({
|
||||
plateNum:formdata.plateNum,
|
||||
code:hdzcode
|
||||
}).then((rps:any) => {
|
||||
ishdz.value = true
|
||||
if(rps.data && rps.data.length > 0){
|
||||
if(!rps.data[0].isSuitable){
|
||||
uni.showToast({
|
||||
title: '不支持此车型',
|
||||
duration: 2000,
|
||||
icon:'none'
|
||||
})
|
||||
formdata.plateNum = ''
|
||||
}
|
||||
}
|
||||
|
||||
//isSuitable
|
||||
})
|
||||
}else{
|
||||
hdzcolumns.value.splice(0)
|
||||
formdata.stationCode = ''
|
||||
formdata.stationName = ''
|
||||
|
||||
formdata.swapDay = ''
|
||||
formdata.swapDuration = ''
|
||||
//获取换电站
|
||||
gethdz({
|
||||
plateNum:formdata.plateNum
|
||||
@ -468,7 +551,10 @@
|
||||
name:n.name,
|
||||
code:n.code,
|
||||
label:`${n.name}${n.isSuitable?'':'(不支持)'}`,
|
||||
isSuitable:n.isSuitable
|
||||
isSuitable:n.isSuitable,
|
||||
openAllDay:n.openAllDay,
|
||||
stiem:n.runStartTime,
|
||||
etime:n.runEndTime
|
||||
}
|
||||
})
|
||||
hdzcolumns.value.push(arr)
|
||||
@ -476,6 +562,9 @@
|
||||
//isSuitable
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
function cpcancel() {
|
||||
cpshow.value = false
|
||||
}
|
||||
@ -498,6 +587,21 @@
|
||||
formdata.stationName = v.value[0].name
|
||||
formdata.stationCode = v.value[0].code
|
||||
hdzshow.value = false
|
||||
|
||||
openAllDay = v.value[0].openAllDay
|
||||
stiem = v.value[0].stiem?v.value[0].stiem:''
|
||||
etime = v.value[0].etime?v.value[0].etime:''
|
||||
formdata.swapDay = ''
|
||||
if(openAllDay == 0){
|
||||
const date = new Date()
|
||||
const hours = date.getHours()
|
||||
if(hours >= etime.split(':')[0]*1){
|
||||
mindate.value = getDateDaysAgo(1,1)
|
||||
}
|
||||
}
|
||||
//settime(true)
|
||||
formdata.swapDay = ''
|
||||
formdata.swapDuration = ''
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: '不支持此车型',
|
||||
@ -514,8 +618,47 @@
|
||||
//时间段
|
||||
let timeshow = ref(false)
|
||||
function timehand() {
|
||||
if(formdata.swapDay == ''){
|
||||
uni.showToast({
|
||||
title: '请选择日期',
|
||||
duration: 2000,
|
||||
icon:'none'
|
||||
})
|
||||
}else{
|
||||
timeshow.value = true
|
||||
}
|
||||
// if(stiem === ''){
|
||||
// if(timecolumns.value.length == 0){
|
||||
// uni.showToast({
|
||||
// title: '请选择换电站',
|
||||
// duration: 2000,
|
||||
// icon:'none'
|
||||
// })
|
||||
// }if(formdata.swapDay == ''){
|
||||
// uni.showToast({
|
||||
// title: '请选择日期',
|
||||
// duration: 2000,
|
||||
// icon:'none'
|
||||
// })
|
||||
// }else{
|
||||
// timeshow.value = true
|
||||
// }
|
||||
// }else{
|
||||
// if(formdata.swapDay == ''){
|
||||
// uni.showToast({
|
||||
// title: '请选择日期',
|
||||
// duration: 2000,
|
||||
// icon:'none'
|
||||
// })
|
||||
// }else{
|
||||
// timeshow.value = true
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
//formdata.swapDay
|
||||
|
||||
}
|
||||
|
||||
function timeconfirm(v:any) {
|
||||
formdata.swapDuration = v.value[0]
|
||||
@ -528,7 +671,15 @@
|
||||
//选择日期
|
||||
let dateshow = ref(false)
|
||||
function datehand() {
|
||||
if(formdata.stationCode){
|
||||
dateshow.value = true
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: '请选择换电站',
|
||||
duration: 2000,
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
function dateconfirm(v:any) {
|
||||
formdata.swapDay = v[0]
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<view @tap="zchand" class="ctbn" style="margin-right: 20rpx;border: 1px solid #fff;color: #fff;background:none;">转出</view>
|
||||
<view v-if="totalAmount > 0" @tap="zchand" class="ctbn" style="margin-right: 20rpx;border: 1px solid #fff;color: #fff;background:none;">转出</view>
|
||||
<view class="ctbn" @tap="topage('/minePages/recharge/index')">充值</view>
|
||||
</view>
|
||||
|
||||
@ -26,11 +26,13 @@
|
||||
<view class="tit">余额明细</view>
|
||||
<!--:style="{height:height,overflowY: 'auto'}"-->
|
||||
<view>
|
||||
<view v-for="n in list" class="mxitem">
|
||||
<view>
|
||||
<view v-if="n.tradeType == 1" style="padding-bottom: 8rpx;font-size: 40rpx;color: #00aa00;">充值</view>
|
||||
<view v-else-if="n.tradeType == 2" style="padding-bottom: 8rpx;font-size: 40rpx;color: #191919;">支付</view>
|
||||
<view v-else-if="n.tradeType == 9" style="padding-bottom: 8rpx;font-size: 40rpx;color: #c79a11;">转出</view>
|
||||
<view v-for="n in list" @tap="getxq(n,n.orderNo)" class="mxitem">
|
||||
<view style="flex: 1;">
|
||||
<view v-if="n.tradeType == 1" style="padding-bottom: 8rpx;font-size: 32rpx;color: #00aa00;">充值</view>
|
||||
<view v-else-if="n.tradeType == 2" style="width:500rpx;padding-bottom: 8rpx;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;font-size: 28rpx;color: #191919;">
|
||||
消费 - {{n.plateNum}} - {{n.stationName}}
|
||||
</view>
|
||||
<view v-else-if="n.tradeType == 9" style="padding-bottom: 8rpx;font-size: 32rpx;color: #c79a11;">转出</view>
|
||||
<view style="font-size: 30rpx;color: #ccc;">{{n.ctime}}</view>
|
||||
</view>
|
||||
<view style="text-align: right;">
|
||||
@ -64,42 +66,127 @@
|
||||
>
|
||||
<view style="width: 70vw;padding: 100rpx 30rpx 0;">
|
||||
<view style="padding-bottom: 30rpx;text-align: center;">
|
||||
可转出<text style="padding: 0 10rpx;font-size: 50rpx;color: #ffaa7f;">{{totalAmount/100}}</text>元
|
||||
可用余额<text style="padding: 0 10rpx;font-size: 50rpx;color: #ffaa7f;">{{totalAmount/100}}</text>元
|
||||
</view>
|
||||
<view style="display: flex;align-items: center;justify-content: center;">
|
||||
<view style="width: 420rpx;">
|
||||
<up-input
|
||||
<view style="width: 360rpx;margin: 0 auto;">
|
||||
<view style="display: flex;width: 360rpx;align-items: center;padding-bottom:5rpx;border-bottom: 1px solid #ccc;">
|
||||
<view style="padding-right: 4rpx;font-size: 32rpx;">¥</view>
|
||||
<!-- <up-input
|
||||
type="number"
|
||||
maxlength="10"
|
||||
border="bottom"
|
||||
fontSize="20"
|
||||
v-model="zcjiner"
|
||||
@focus="focus"
|
||||
placeholder="请输入金额" clearable
|
||||
/> -->
|
||||
<!-- type="digit" -->
|
||||
<!--:value="zcjiner"-->
|
||||
<input
|
||||
style="font-size: 38rpx;"
|
||||
v-model="zcjiner"
|
||||
type="digit"
|
||||
@input="handleInput"
|
||||
placeholder="请输入金额"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view style="width: 200rpx;color: #c79a11;text-align: right;">全部转出</view>
|
||||
<view style="box-sizing: border-box;width:360rpx;height: 100rpx;padding-top: 5rpx;font-size: 28rpx;color: #f00;">
|
||||
<view v-if="errtip">{{errmsg}}</view>
|
||||
</view>
|
||||
<!-- <view style="width: 200rpx;font-size:20rpx;color: #ccc;text-align: right;">全部转出</view> -->
|
||||
</view>
|
||||
|
||||
<view style="box-sizing: border-box;height: 100rpx;padding-top: 5rpx;font-size: 28rpx;color: #f00;">
|
||||
<view v-if="errtip">请输入金额</view>
|
||||
</view>
|
||||
<view style="padding:30rpx;">
|
||||
|
||||
<view style="width: 80%;margin: 0 auto;padding:30rpx;">
|
||||
<up-button type="success" @tap="zdysave">确认转出</up-button>
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
|
||||
<!-- <up-popup
|
||||
:show="ddshow"
|
||||
mode="center"
|
||||
round="10"
|
||||
closeable
|
||||
@close="xqclose"
|
||||
> -->
|
||||
<up-popup
|
||||
:show="ddshow"
|
||||
mode="bottom"
|
||||
@close="ddshow = false"
|
||||
:closeOnClickOverlay="true"
|
||||
>
|
||||
<view style="padding: 30rpx;">
|
||||
<!-- 订单编号:YTHD102120250415173442962948R2【outTradeNo】
|
||||
订单金额:0.01元【tradeAmount】
|
||||
订单状态:支付成功【payMsg】
|
||||
订单时间:2025-04-15 17:34:49 【payTime】 -->
|
||||
<view style="margin-bottom: 30rpx;padding-bottom: 30rpx;border-bottom: 2px dashed #005500;">
|
||||
<view style="color: #005500;">交易信息</view>
|
||||
<view style="display: flex;justify-content: space-between;padding-top: 20rpx;">
|
||||
<view>交易编号</view>
|
||||
<view style="font-size: 28rpx;color: #4a4a4a;">{{jyobj.tradeNo}}</view>
|
||||
</view>
|
||||
<view style="display: flex;justify-content: space-between;padding-top: 20rpx;">
|
||||
<view>交易时间</view>
|
||||
<view style="color: #4a4a4a;">{{jyobj.ctime}}</view>
|
||||
</view>
|
||||
<view style="display: flex;justify-content: space-between;padding-top: 20rpx;">
|
||||
<view>交易类型</view>
|
||||
<view style="color: #4a4a4a;">消费</view>
|
||||
</view>
|
||||
<view style="display: flex;justify-content: space-between;padding-top: 20rpx;">
|
||||
<view>交易金额</view>
|
||||
<view style="color: #4a4a4a;">{{jyobj.tradeTotalAmount/100}}元</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<view style="color: #005500;">
|
||||
关联订单信息
|
||||
</view>
|
||||
<view style="display: flex;justify-content: space-between;padding-top: 20rpx;">
|
||||
<view >订单号</view>
|
||||
<view style="font-size: 28rpx;color: #4a4a4a;">{{xqobj.orderNo}}</view>
|
||||
</view>
|
||||
<view style="display: flex;justify-content: space-between;padding-top: 20rpx;">
|
||||
<view>车牌号</view>
|
||||
<view style="color: #4a4a4a;">{{xqobj.plateNum}}</view>
|
||||
</view>
|
||||
<view style="display: flex;justify-content: space-between;padding-top: 20rpx;">
|
||||
<view>换电站</view>
|
||||
<view style="color: #4a4a4a;">{{xqobj.stationName}}</view>
|
||||
</view>
|
||||
<view style="display: flex;justify-content: space-between;padding-top: 20rpx;">
|
||||
<view>订单金额</view>
|
||||
<view style="color: #4a4a4a;">{{xqobj.amount/100}}元</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
<!-- <up-keyboard ref="uKeyboard" mode="number" :dotDisabled="true" :show="true"></up-keyboard> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref,reactive,getCurrentInstance} from 'vue'
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
getCurrentInstance,
|
||||
watch,
|
||||
nextTick,
|
||||
} from 'vue'
|
||||
import { onLoad,onShow,onReachBottom } from '@dcloudio/uni-app'
|
||||
import {
|
||||
getaccou,
|
||||
balancedetails
|
||||
balancedetails,
|
||||
getyexq,
|
||||
zcbalan
|
||||
} from '@/utils/service'
|
||||
|
||||
import { setNum } from '@/utils/commen'
|
||||
|
||||
let status = ref('nomore') //loadmore loading
|
||||
let totalAmount = ref(0)
|
||||
|
||||
@ -112,6 +199,7 @@
|
||||
let isempty = ref(false)
|
||||
let list = ref<any[]>([])
|
||||
function getylist() {
|
||||
status.value = 'loading'
|
||||
balancedetails(qsobj).then((rps:any) => {
|
||||
if(rps.data.total > 0){
|
||||
list.value = [...list.value,...rps.data.records]
|
||||
@ -136,7 +224,7 @@
|
||||
uni.getSystemInfo({
|
||||
success: n => {
|
||||
// 屏幕可用高度 减去 其他元素高度
|
||||
height.value = (n.windowHeight - (v as any).height + 20)+'px'
|
||||
height.value = (n.windowHeight - (v as any).height-200)+'px'
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -146,7 +234,7 @@
|
||||
//获取账户信息
|
||||
let account =ref<any>({})
|
||||
|
||||
onShow(() => {
|
||||
function getInfor() {
|
||||
getaccou(uni.getStorageSync('wxuid')).then((rps:any) => {
|
||||
if(rps.data.records){
|
||||
totalAmount.value = rps.data.records[0].totalAmount
|
||||
@ -156,7 +244,12 @@
|
||||
status.value = 'nomore'
|
||||
list.value.splice(0)
|
||||
isempty.value = false
|
||||
qsobj.pageNo = 1
|
||||
getylist()
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
getInfor()
|
||||
})
|
||||
|
||||
onReachBottom(() => {
|
||||
@ -173,8 +266,23 @@
|
||||
|
||||
//余额转出
|
||||
let zcshow = ref(false)
|
||||
let zcjiner = ref('') //转出金额
|
||||
let zcjiner = ref<any>('') //转出金额
|
||||
let errtip = ref(false)
|
||||
let errmsg = ref('')
|
||||
// watch(() => zcjiner.value,(v:any) => {
|
||||
// zcjiner.value = setNum(v)
|
||||
// console.log(zcjiner.value,'1')
|
||||
// console.log(setNum(v),'2')
|
||||
// })
|
||||
|
||||
function handleInput(e:any) {
|
||||
nextTick(() => {
|
||||
|
||||
zcjiner.value = setNum(e.target.value)
|
||||
})
|
||||
|
||||
console.log(e.target.value,1)
|
||||
}
|
||||
|
||||
function zchand() {
|
||||
zcshow.value = true
|
||||
@ -182,15 +290,73 @@
|
||||
|
||||
function close() {
|
||||
zcshow.value = false
|
||||
errtip.value = false
|
||||
errmsg.value = ''
|
||||
zcjiner.value = ''
|
||||
}
|
||||
|
||||
function focus() {
|
||||
errtip.value = false
|
||||
}
|
||||
|
||||
//确认转出
|
||||
function zdysave() {
|
||||
if(zcjiner.value === ''){
|
||||
errtip.value = true
|
||||
errmsg.value = '请输入金额'
|
||||
}else if(zcjiner.value == 0){
|
||||
errtip.value = true
|
||||
errmsg.value = '金额不能为0'
|
||||
}else if(zcjiner.value*100 > totalAmount.value){
|
||||
errtip.value = true
|
||||
errmsg.value = '输入金额大于可用金额'
|
||||
}else{
|
||||
errtip.value = false
|
||||
let zctotal = zcjiner.value*100
|
||||
zcbalan(uni.getStorageSync('wxuid'),zctotal).then(() => {
|
||||
close()
|
||||
uni.showToast({
|
||||
title:'转出成功',
|
||||
duration:2000
|
||||
})
|
||||
setTimeout(() => {
|
||||
getInfor()
|
||||
getylist()
|
||||
},2000)
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//详情
|
||||
let ddshow = ref(false)
|
||||
let xqobj = ref<any>({})
|
||||
let jyobj = ref<any>({})
|
||||
|
||||
function getxq(n:any,orderNo:string){
|
||||
xqobj.value = {}
|
||||
jyobj.value = {}
|
||||
if(n.tradeType == 2 && n.plateNum){
|
||||
getyexq({
|
||||
userId:uni.getStorageSync('wxuid'),
|
||||
pageSize:30,
|
||||
pageNo:1,
|
||||
orderNo
|
||||
}).then((rps:any) => {
|
||||
if(rps.data){
|
||||
ddshow.value = true
|
||||
xqobj.value = rps.data.records[0]
|
||||
jyobj.value = n
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function xqclose() {
|
||||
ddshow.value = false
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@ -200,7 +366,10 @@
|
||||
.content{
|
||||
padding: 30rpx 20rpx;
|
||||
.jiner{
|
||||
position: fixed;
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
width: calc(100% - 40rpx);
|
||||
padding: 28rpx;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
@ -225,7 +394,7 @@
|
||||
}
|
||||
.mingxi{
|
||||
background: #fff;
|
||||
margin-top: 30rpx;
|
||||
margin-top: 190rpx;
|
||||
padding: 25rpx;
|
||||
border-radius: 10rpx;
|
||||
.tit{
|
||||
@ -240,7 +409,7 @@
|
||||
padding-top: 20rpx;
|
||||
border-top: 1px dashed #ccc;
|
||||
>view{
|
||||
width: 50%;
|
||||
//width: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
192
src/minePages/company/index.vue
Normal file
192
src/minePages/company/index.vue
Normal file
@ -0,0 +1,192 @@
|
||||
<template>
|
||||
<up-navbar
|
||||
title="所属公司"
|
||||
bgColor="#00aa7f"
|
||||
:autoBack="true"
|
||||
leftIconColor="#fff"
|
||||
titleStyle="color:#fff"
|
||||
:placeholder="true"
|
||||
/>
|
||||
<view style="padding: 40rpx 20rpx; background: #fff;">
|
||||
<!--state == 1 || state == 3-->
|
||||
<template v-if="state == 1">
|
||||
<view style="padding: 50rpx 20rpx;border-radius: 20rpx;text-align: center;background: #00986f;color: #fff;">
|
||||
<view>申请加入公司</view>
|
||||
<view style="padding-top: 30rpx;">{{infobj.pname}}</view>
|
||||
</view>
|
||||
<view style="padding:300rpx 0 200rpx;font-size:38rpx;color: #2b563f;text-align: center;">正在审核中</view>
|
||||
</template>
|
||||
<template v-else-if="state == 2">
|
||||
<view class="dingdan">
|
||||
<view style="width:180rpx;color: #161616;">所属公司:</view>
|
||||
<view style="flex: 1;">{{gsxxobj.cname}}</view>
|
||||
</view>
|
||||
<view class="dingdan">
|
||||
<view style="width:180rpx;color: #161616;">详细地址:</view>
|
||||
<view style="flex: 1;">{{gsxxobj.address}}</view>
|
||||
</view>
|
||||
<view class="dingdan">
|
||||
<view style="width:180rpx;color: #161616;">加入时间:</view>
|
||||
<view style="flex: 1;">{{infobj.bindtime?infobj.bindtime.split(' ')[0]:''}}</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view v-if="state == 3" style="margin-bottom: 30rpx;padding-bottom: 30rpx;border-bottom: 1px solid #ce8900;color: #ce8900;">
|
||||
<view>管理员已拒绝加入{{infobj.pname}}</view>
|
||||
<view v-if="infobj.reason">拒绝原因:{{infobj.reason}}</view>
|
||||
<view>请重新申请加入公司</view>
|
||||
</view>
|
||||
<view v-else style="margin-bottom: 30rpx;padding-bottom: 30rpx;border-bottom: 1px solid #ce8900;color: #ce8900;">暂无所属公司,请点击下方申请加入</view>
|
||||
<view>
|
||||
<up-form
|
||||
labelPosition="left"
|
||||
labelWidth="80"
|
||||
:model="formdata"
|
||||
:rules="rules"
|
||||
ref="uFormRef"
|
||||
>
|
||||
<up-form-item
|
||||
label="所属公司"
|
||||
prop="pname"
|
||||
borderBottom
|
||||
>
|
||||
<up-input v-model="formdata.pname" readonly border="none" placeholder="请选择公司" suffixIcon="arrow-down" suffixIconStyle="color: #bababa" @tap="datehand" />
|
||||
</up-form-item>
|
||||
<up-button style="margin-top: 100rpx;" type="success" @tap="save">申请加入公司</up-button>
|
||||
</up-form>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<up-picker
|
||||
:show="hdzshow"
|
||||
:columns="hdzcolumns"
|
||||
keyName="cname"
|
||||
@confirm="hdzconfirm"
|
||||
@cancel="hdzcancel"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref,reactive } from 'vue'
|
||||
import {
|
||||
payment,
|
||||
getip,
|
||||
orderlist,
|
||||
getgslist,
|
||||
bdcomp,
|
||||
getInfo,
|
||||
getgsxx
|
||||
} from '@/utils/service'
|
||||
import { onLoad,onShow } from '@dcloudio/uni-app'
|
||||
let order = ref<any>({})
|
||||
let state = ref<any>(null)
|
||||
let infobj = ref<any>({})
|
||||
let gsxxobj = ref<any>({})
|
||||
onLoad((opt:any) => {
|
||||
|
||||
getInfo({
|
||||
wuid:uni.getStorageSync('wxuid')
|
||||
}).then((rps:any) => {
|
||||
//1 待审核 2 审核通过 3 拒绝
|
||||
state.value = rps.data.state
|
||||
infobj.value = rps.data
|
||||
if(state.value == null || state.value == 3){
|
||||
//查询公司列表
|
||||
getgslist().then((rps:any) => {
|
||||
if(rps.data && rps.data.records){
|
||||
hdzcolumns.value.push(rps.data.records)
|
||||
}
|
||||
})
|
||||
}else if(state.value == 2){
|
||||
|
||||
getgsxx(infobj.value.pcode).then((rps:any) => {
|
||||
gsxxobj.value = rps.data
|
||||
})
|
||||
}
|
||||
console.log(rps,'状态')
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
let formdata = reactive({
|
||||
pname:'',
|
||||
pcode:''
|
||||
})
|
||||
|
||||
const rules = {
|
||||
pname: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请选择公司',
|
||||
trigger: ['blur', 'change'],
|
||||
}
|
||||
}
|
||||
|
||||
let hdzshow = ref(false)
|
||||
let hdzcolumns = ref<any>([])
|
||||
|
||||
function hdzconfirm(v:any) {
|
||||
hdzshow.value = false
|
||||
formdata.pname = v.value[0].cname
|
||||
formdata.pcode = v.value[0].ccode
|
||||
}
|
||||
function hdzcancel() {
|
||||
hdzshow.value = false
|
||||
}
|
||||
|
||||
function datehand() {
|
||||
hdzshow.value = true
|
||||
}
|
||||
|
||||
|
||||
|
||||
//保存
|
||||
let uFormRef = ref(null)
|
||||
function save() {
|
||||
(uFormRef as any).value.validate().then((valid:any) => {
|
||||
if(valid){
|
||||
bdcomp(uni.getStorageSync('wxuid'),formdata.pcode,formdata.pname).then(() => {
|
||||
uni.showToast({
|
||||
title: '申请成功',
|
||||
duration: 2000
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
},2000)
|
||||
})
|
||||
}
|
||||
}).catch(() => {
|
||||
// 处理验证错误
|
||||
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page{
|
||||
background: #f4f4f4;
|
||||
}
|
||||
.dingdan{
|
||||
display: flex;
|
||||
padding:20rpx;
|
||||
}
|
||||
.btns{
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
padding: 0 30rpx;
|
||||
justify-content:space-between;
|
||||
}
|
||||
.qxyy{
|
||||
width: 240rpx;
|
||||
height: 70rpx;
|
||||
//margin: 100rpx auto 0;
|
||||
line-height: 70rpx;
|
||||
border-radius:15rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
background: #00aa00;
|
||||
}
|
||||
</style>
|
||||
@ -95,7 +95,7 @@
|
||||
if(n == 1){
|
||||
return '车辆进站'
|
||||
}else if(n == 2){
|
||||
return '车辆到达指定位置'
|
||||
return '车辆到位'
|
||||
}else if(n == 3){
|
||||
return '启动对中机构'
|
||||
}else if(n == 4){
|
||||
@ -105,7 +105,7 @@
|
||||
}else if(n == 6){
|
||||
return '装新电池'
|
||||
}else if(n == 7){
|
||||
return '放旧电池'
|
||||
return '存旧电池'
|
||||
}else if(n == 8){
|
||||
return '换电完成'
|
||||
}
|
||||
|
||||
@ -34,13 +34,24 @@
|
||||
<!--v-if="bzlist.length == 2"-->
|
||||
<!--border: 1px solid #009688;border-radius: 10rpx;-->
|
||||
<!--v-if="bzlist.length == 2"-->
|
||||
<view v-if="bzlist.length == 2 && !hdorderNo" style="display:flex;margin-bottom:20px;align-items: center;justify-content: space-between;">
|
||||
<view style="display:flex;align-items: center;color:#009688;">
|
||||
<view style="padding-right: 5rpx;">车辆已到达指定位置</view>
|
||||
<up-icon name="checkmark" color="#009688" size="20" />
|
||||
|
||||
<!--v-if="bzlist.length == 1 && !hdorderNo"-->
|
||||
<view v-if="bzlist.length == 1 && !hdorderNo" style="display:flex;margin-bottom:20px;align-items: center;justify-content: space-between;">
|
||||
<view style="display:flex;width:380rpx;align-items: center;color:#009688;">
|
||||
车辆到达指定位置后请点击开始换电按钮
|
||||
<!-- <up-icon name="checkmark" color="#009688" size="20" /> -->
|
||||
</view>
|
||||
<view style="width: 160rpx;height: 70rpx;line-height: 70rpx;border:1px solid #009688;border-radius:10rpx;text-align: center;color:#009688;" @tap="showPop = true">确认换电</view>
|
||||
<view style="width: 160rpx;height: 70rpx;line-height: 70rpx;border:1px solid #009688;border-radius:10rpx;text-align: center;color:#009688;" @tap="showPop = true">开始换电</view>
|
||||
</view>
|
||||
|
||||
<!-- <view v-if="qdzt == 2" style="display:flex;margin-bottom:20px;align-items: center;justify-content: space-between;">
|
||||
<view style="display:flex;width:380rpx;align-items: center;color:#e89506;">
|
||||
设备启动失败,请重新启动
|
||||
</view>
|
||||
<view style="width: 220rpx;height: 70rpx;line-height: 70rpx;border:1px solid #e89506;border-radius:10rpx;text-align: center;color:#e89506;" @tap="showPop = true">重新启动换电</view>
|
||||
</view> -->
|
||||
|
||||
|
||||
<view>
|
||||
<up-steps v-if="bzlist.length > 0" :current="bzlist.length" direction="column" activeColor="#009688">
|
||||
<up-steps-item v-for="n in bzlist" :title="hdbzname(n.step)" :desc="n.stepTime" :key="n.step" />
|
||||
@ -103,6 +114,7 @@
|
||||
</view>
|
||||
</up-popup>
|
||||
|
||||
<!--v-if="hdmgsPop"-->
|
||||
<!-- <zero-loading
|
||||
v-if="hdmgsPop"
|
||||
type="gear"
|
||||
@ -171,7 +183,7 @@
|
||||
if(n == 1){
|
||||
return '车辆进站'
|
||||
}else if(n == 2){
|
||||
return '车辆到达指定位置'
|
||||
return '车辆到位'
|
||||
}else if(n == 3){
|
||||
return '启动对中机构'
|
||||
}else if(n == 4){
|
||||
@ -181,7 +193,7 @@
|
||||
}else if(n == 6){
|
||||
return '装新电池'
|
||||
}else if(n == 7){
|
||||
return '放旧电池'
|
||||
return '存旧电池'
|
||||
}else if(n == 8){
|
||||
return '换电完成'
|
||||
}
|
||||
@ -218,15 +230,44 @@
|
||||
|
||||
let hdtimer:any = null
|
||||
|
||||
let qdzt = ref<any>('')
|
||||
|
||||
//确认换电
|
||||
function huandhand() {
|
||||
showsxpop.value = false
|
||||
|
||||
hdmgsPop.value = true
|
||||
//hdmgsPop.value = true
|
||||
if(hdtimer){
|
||||
clearInterval(hdtimer)
|
||||
}
|
||||
|
||||
//??
|
||||
|
||||
// setTimeout(() => {
|
||||
// if(Math.random() >= 0.5){
|
||||
// qdzt.value = 1
|
||||
|
||||
// hdtimer = setInterval(() => {
|
||||
// if(Math.random() <= 0.1){
|
||||
// hdmgsPop.value = false
|
||||
// clearInterval(hdtimer)
|
||||
// console.log('启动成功')
|
||||
// }
|
||||
// console.log('正在启动...')
|
||||
// },1000)
|
||||
// }else{
|
||||
// hdmgsPop.value = false
|
||||
// qdzt.value = 2
|
||||
// uni.showToast({
|
||||
// title:'启动失败请重新启动',
|
||||
// icon:'none'
|
||||
// })
|
||||
// }
|
||||
// },2000)
|
||||
|
||||
// return false
|
||||
//??
|
||||
|
||||
//开始换电
|
||||
starthz(uni.getStorageSync('wxuid'),props.n.orderNo).then(() => {
|
||||
uni.showToast({
|
||||
@ -249,11 +290,6 @@
|
||||
// })
|
||||
// },1000)
|
||||
}).catch(() => {
|
||||
// hdtimer = setInterval(()=>{
|
||||
// gethzmsg(uni.getStorageSync('wxuid'),props.n.orderNo).then((rps:any) => {
|
||||
// console.log(rps,'换电')
|
||||
// })
|
||||
// },1000)
|
||||
})
|
||||
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@
|
||||
payqs.goodsDetail[0].unitPrice = opt.amount*1
|
||||
|
||||
payqs.description = `${opt.plateNum}在${opt.stationName}换电` //??
|
||||
payqs.attach.description = `${opt.plateNum}在${opt.stationName}换电` //??
|
||||
//payqs.attach.description = `${opt.plateNum}在${opt.stationName}换电` //??
|
||||
|
||||
// payqs.detail.costPrice = opt.amount
|
||||
// payqs.detail.goodsDetail.unitPrice = opt.amount
|
||||
@ -115,9 +115,9 @@
|
||||
attach:{ //订单附加信息
|
||||
type: 2, //"1-充值,2-订单。类型 number"
|
||||
orderNo:'', //"订单号",
|
||||
trader:'', //交易发起人
|
||||
description:'',
|
||||
tradercode:uni.getStorageSync('wxuid') //交易人编码
|
||||
//trader:'', //交易发起人
|
||||
//description:'',
|
||||
//tradercode:uni.getStorageSync('wxuid') //交易人编码
|
||||
//walletCode:'' //钱包编码
|
||||
// ownerId:'', //"户主ID,个人wuid,企业:公司编码",
|
||||
// walletCode:'' //"钱包编码"
|
||||
|
||||
@ -31,26 +31,37 @@
|
||||
closeable
|
||||
@close="close"
|
||||
>
|
||||
<view style="width: 70vw;padding: 100rpx 50rpx 0;">
|
||||
<up-input
|
||||
<view style="box-sizing: border-box;width: 80vw;padding: 100rpx 50rpx 50rpx;">
|
||||
<!-- <up-input
|
||||
type="number"
|
||||
maxlength="10"
|
||||
v-model="zdyjr"
|
||||
@focus="focus"
|
||||
placeholder="请输入金额" clearable
|
||||
placeholder="请输入金额"
|
||||
/> -->
|
||||
<view style="box-sizing: border-box;padding:0 5vw;">
|
||||
<view style="padding: 15rpx;border-radius: 10rpx;font-size: 32rpx;border: 1px solid #ccc;">
|
||||
<input
|
||||
v-model="zdyjr"
|
||||
type="digit"
|
||||
@input="handleInput"
|
||||
placeholder="请输入金额"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view style="box-sizing: border-box;height: 100rpx;padding-top: 5rpx;font-size: 28rpx;color: #f00;">
|
||||
<view v-if="errtip">请输入金额</view>
|
||||
</view>
|
||||
<view style="padding:30rpx;">
|
||||
<view>
|
||||
<up-button type="success" @tap="zdysave">确认充值</up-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref,reactive,watch } from 'vue'
|
||||
import { ref,reactive,watch,nextTick } from 'vue'
|
||||
import { payment,getip,getInfo,getaccou,openaccou,isktbal } from '@/utils/service'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
|
||||
@ -104,8 +115,8 @@
|
||||
icon:'none'
|
||||
})
|
||||
}else{
|
||||
payqs.total = jiner.value*1
|
||||
payqs.goodsDetail[0].unitPrice = jiner.value*1
|
||||
payqs.total = jiner.value*1*100
|
||||
payqs.goodsDetail[0].unitPrice = jiner.value*1*100
|
||||
payhand()
|
||||
}
|
||||
}
|
||||
@ -114,23 +125,35 @@
|
||||
let zdyjr = ref<any>('')
|
||||
let errtip = ref(false)
|
||||
|
||||
function handleInput(e:any) {
|
||||
nextTick(() => {
|
||||
zdyjr.value = setNum(e.target.value)
|
||||
})
|
||||
}
|
||||
|
||||
// watch(() => zdyjr.value, v => {
|
||||
// zdyjr.value = setNum(v)
|
||||
// })
|
||||
|
||||
let tipmsg = ref('')
|
||||
function zdysave() {
|
||||
if(zdyjr.value == ''){
|
||||
if(zdyjr.value === ''){
|
||||
errtip.value = true
|
||||
tipmsg.value = '请输入金额'
|
||||
}else if(zdyjr.value*1 == 0){
|
||||
errtip.value = true
|
||||
tipmsg.value = '输入金额不能为0'
|
||||
}else{
|
||||
errtip.value = false
|
||||
payqs.total = zdyjr.value*1
|
||||
payqs.goodsDetail[0].unitPrice = zdyjr.value*1
|
||||
tipmsg.value = ''
|
||||
payqs.total = zdyjr.value*1*100
|
||||
payqs.goodsDetail[0].unitPrice = zdyjr.value*1*100
|
||||
payhand()
|
||||
}
|
||||
}
|
||||
|
||||
function focus() {
|
||||
errtip.value = false
|
||||
tipmsg.value = ''
|
||||
}
|
||||
|
||||
//充值
|
||||
|
||||
@ -69,6 +69,9 @@
|
||||
},
|
||||
{
|
||||
"path": "paySuccess/index" //支付成功
|
||||
},
|
||||
{
|
||||
"path": "company/index" //所属公司
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -66,9 +66,9 @@
|
||||
<view>预约记录</view>
|
||||
</view>
|
||||
</template>
|
||||
<view>
|
||||
<view @tap="kefu">
|
||||
<image src="../../static/img/kefu.png" />
|
||||
<view>客服中心</view>
|
||||
<view>客服热线</view>
|
||||
</view>
|
||||
<!--topage('/homePages/agreement/index')-->
|
||||
<!-- <view @tap="showxy()">
|
||||
@ -102,18 +102,25 @@
|
||||
</map>
|
||||
<view v-if="showxq" class="dibucoten">
|
||||
<view style="margin-bottom: 10rpx;padding-bottom:10rpx;font-size: 38rpx;color: #00aa7f;border-bottom:1px #00aa7f dashed;">{{maphdzname}}</view>
|
||||
<view>营业时间:<text style="color: #5f5f5f;">8:30 - 17:30</text></view>
|
||||
|
||||
<view>
|
||||
营业时间:
|
||||
<text v-if="allDay == 1" style="color: #5f5f5f;">全天</text>
|
||||
<text v-else-if="allDay == 0" style="color: #5f5f5f;">{{startTime}}—{{endTime}}</text>
|
||||
<text v-else style="color: #5f5f5f;">暂无信息</text>
|
||||
</view>
|
||||
<view style="display: flex;justify-content: space-between;">
|
||||
<view style="padding-top: 8rpx;">距您约 <text style="color: #5f5f5f;">{{getMapDistance(latitude,longitude,marketLat,marketLng)}}km</text></view>
|
||||
<view style="display: flex;">
|
||||
<view @tap="topage(`/homePages/reservation/index?hdzcode=${maphdzcode}&hdzname=${maphdzname}&phoneNumber=${userInfo.phoneNumber}`,true)" class="daohang" style="margin-right: 15rpx;background: #00aa00;">预约</view>
|
||||
|
||||
<view v-if="islogin" @tap="topage(`/homePages/reservation/index?openAllDay=${allDay}&stiem=${startTime}&etime=${endTime}&hdzcode=${maphdzcode}&hdzname=${maphdzname}&phoneNumber=${userInfo.phoneNumber}`,true)" class="daohang" style="margin-right: 15rpx;background: #00aa00;">预约</view>
|
||||
<view v-else @tap="wdltip()" class="daohang" style="margin-right: 15rpx;background: #00aa00;">预约</view>
|
||||
|
||||
<view @tap="getdh()" class="daohang">导航</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="islogin" @tap="topage(`/homePages/reservation/index?hdzcode=${maphdzcode}&phoneNumber=${userInfo.phoneNumber}`,true)" class="yuyue">预 约</view>
|
||||
<view v-if="islogin" @tap="topage(`/homePages/reservation/index?phoneNumber=${userInfo.phoneNumber}`,true)" class="yuyue">预 约</view>
|
||||
<view v-else @tap="wdltip()" class="yuyue">预 约</view>
|
||||
<!--xyshow-->
|
||||
<up-popup
|
||||
@ -279,11 +286,19 @@ function getinfo(){
|
||||
gethdz({
|
||||
//plateNum:formdata.plateNum
|
||||
}).then((rps:any) => {
|
||||
|
||||
// openAllDay = opt.openAllDay
|
||||
// stiem = opt.stiem?opt.stiem:''
|
||||
// etime = opt.etime?opt.etime:''
|
||||
|
||||
if(rps.data && rps.data.length > 0){
|
||||
rps.data.forEach((n:any,i:any) => {
|
||||
let jwd = n.locationPoint?n.locationPoint.split(','):[]
|
||||
covers.value.push({
|
||||
id:i,
|
||||
startTime:n.runStartTime?n.runStartTime:'',
|
||||
endTime:n.runEndTime?n.runEndTime:'',
|
||||
openAllDay:n.openAllDay,
|
||||
code:n.code,
|
||||
latitude: jwd[0]?jwd[0]:'',
|
||||
longitude: jwd[1]?jwd[1]:'',
|
||||
@ -382,6 +397,13 @@ function getdh() {
|
||||
let showxq = ref(false)
|
||||
let marketLat = ref<any>('')
|
||||
let marketLng = ref<any>('')
|
||||
|
||||
//营业时间
|
||||
let allDay = ref<any>('') //是否全天
|
||||
let startTime = ref<any>('')
|
||||
let endTime = ref<any>('')
|
||||
// runEndTime: "19:00"
|
||||
// runStartTime: "07:00"
|
||||
function markertap(v:any) {
|
||||
showxq.value = true
|
||||
|
||||
@ -389,11 +411,15 @@ function markertap(v:any) {
|
||||
// 更新markers数组,重新渲染地图
|
||||
covers.value = covers.value.map((n:any) => {
|
||||
if(n.id === markerId) {
|
||||
console.log(n,'123')
|
||||
// 当前点击的标注显示气泡
|
||||
n.callout.display = 'ALWAYS'
|
||||
maphdzname.value = n.callout.content
|
||||
maphdzcode.value = n.code
|
||||
allDay.value = n.openAllDay
|
||||
if(allDay.value == 0){
|
||||
startTime = n.startTime
|
||||
endTime = n.endTime
|
||||
}
|
||||
// latitude.value = n.latitude
|
||||
// longitude.value = n.longitude
|
||||
|
||||
@ -479,6 +505,13 @@ function getMapDistance(lat1:any, lng1:any, lat2:any, lng2:any) {
|
||||
return s
|
||||
}
|
||||
|
||||
|
||||
//客服热线
|
||||
function kefu(){
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: '400-888-12345' //示例
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<!-- <view style="text-align: center;color: #484848;">{{userInfo.phoneNumber}}</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view @tap="topage('/minePages/account/index')">
|
||||
<view style="text-align: center;" @tap="topage('/minePages/account/index')">
|
||||
<view style="font-size: 36rpx;text-align: center;">{{totalAmount/100}}</view>
|
||||
<view style="color: #848484;">余额</view>
|
||||
</view>
|
||||
@ -53,6 +53,13 @@
|
||||
</view>
|
||||
<up-icon name="arrow-right" color="#b9b9b9" />
|
||||
</view>
|
||||
<view class="gnrk" @tap="topage('/minePages/company/index')">
|
||||
<view>
|
||||
<image src="../../static/img/cd4.png" />
|
||||
<view>所属公司</view>
|
||||
</view>
|
||||
<up-icon name="arrow-right" color="#b9b9b9" />
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="gnrk" @tap="wdltip">
|
||||
@ -83,29 +90,28 @@
|
||||
</view>
|
||||
<up-icon name="arrow-right" color="#b9b9b9" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<view class="gnrk">
|
||||
<view class="gnrk" @tap="wdltip">
|
||||
<view>
|
||||
<image src="../../static/img/cd4.png" />
|
||||
<view>优惠活动</view>
|
||||
<view>所属公司</view>
|
||||
</view>
|
||||
<up-icon name="arrow-right" color="#b9b9b9" />
|
||||
</view>
|
||||
<view class="gnrk">
|
||||
</template>
|
||||
<view class="gnrk" @tap="kefu">
|
||||
<view>
|
||||
<image src="../../static/img/shiyxy.png" />
|
||||
<view>客服中心</view>
|
||||
<view>客服热线</view>
|
||||
</view>
|
||||
<up-icon name="arrow-right" color="#b9b9b9" />
|
||||
</view>
|
||||
<view class="gnrk">
|
||||
<!-- <view class="gnrk">
|
||||
<view>
|
||||
<image src="../../static/img/jrwm.png" />
|
||||
<view>加入我们</view>
|
||||
</view>
|
||||
<up-icon name="arrow-right" color="#b9b9b9" />
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="gnrk" @tap="topage('/minePages/about/index')">
|
||||
<view>
|
||||
<image src="../../static/img/gywm.png" />
|
||||
@ -258,6 +264,12 @@
|
||||
})
|
||||
}
|
||||
|
||||
//客服热线
|
||||
function kefu(){
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: '400-888-12345' //示例
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
@ -17,10 +17,10 @@ export function setNum(v?:any){
|
||||
//只能输入两个小数
|
||||
v = v.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')
|
||||
|
||||
if(/^0+[1-9]$/.test(v) || /^0+\d+\./.test(v)) {
|
||||
if(/^0+[1-9]\d*\.*/.test(v)) {
|
||||
v = v.replace(/^0+/,'')
|
||||
}
|
||||
if(/^(0+\.)/.test(v) || /^0+\.$/.test(v) || /^0+$/.test(v)) {
|
||||
if(/^0+\.*/.test(v)) {
|
||||
v = v.replace(/^0+/,'0')
|
||||
}
|
||||
return v
|
||||
@ -34,3 +34,22 @@ export function isToday(date:any) {
|
||||
const today = new Date()
|
||||
return date.toISOString().slice(0, 10) === today.toISOString().slice(0, 10)
|
||||
}
|
||||
|
||||
export function getDateDaysAgo(type:number,days:number,time?:string) {
|
||||
const date = new Date();
|
||||
if(type == 1){
|
||||
date.setDate(date.getDate() + days)
|
||||
}else if(type == 2){
|
||||
date.setDate(date.getDate() - days)
|
||||
}
|
||||
|
||||
|
||||
const year = date.getFullYear()
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
|
||||
if(time){
|
||||
return `${year}-${month}-${day} ${time}`
|
||||
}
|
||||
return `${year}-${month}-${day}`
|
||||
}
|
||||
@ -30,7 +30,10 @@ export function request(method:any,url:string,data?:any,isLoading?:any){
|
||||
header:headers,
|
||||
//url:`${conf.config.apiBaseUrl}${url}`,
|
||||
//url:'http://192.168.5.200:9104'+ url,
|
||||
//url:'http://192.168.7.152:9104'+ url,
|
||||
//url:'http://192.168.5.14:9104'+ url,
|
||||
url:'https://api.evo-techina.com'+url,
|
||||
//url:'http://192.168.7.152:9100'+ url,
|
||||
method,
|
||||
data:data,
|
||||
timeout:30000,
|
||||
|
||||
@ -211,7 +211,7 @@ export function getaccou(wuid:string){
|
||||
return request('post_form','/wechat/wechat/user/wallet/list',{wuid})
|
||||
}
|
||||
|
||||
//余额明细
|
||||
//余额明细列表
|
||||
interface Balande{
|
||||
walletCode:String,
|
||||
pageSize:String|Number, //每页条数,示例值(10)
|
||||
@ -221,6 +221,19 @@ export function balancedetails(parameter:Balande){
|
||||
return request('post_form','/wechat/wechat/user/wallet/detail/list',parameter,false)
|
||||
}
|
||||
|
||||
//转出余额
|
||||
|
||||
export function zcbalan(wuid:string,total:string|number){
|
||||
return request('post_json','/wechat/wechatpay/xcx/refundsBalance',{
|
||||
wuid,
|
||||
total
|
||||
})
|
||||
}
|
||||
|
||||
//余额详细
|
||||
export function getyexq(parameter:any){
|
||||
return request('GET','/wechat/order/swap/list',parameter)
|
||||
}
|
||||
|
||||
//个人余额支付
|
||||
interface Bapay{
|
||||
@ -247,3 +260,26 @@ export function starthz(wuid:string,orderId:string){
|
||||
export function gethzmsg(wuid:string,orderId:string){
|
||||
return request('post_form','/wechat/order/swap/getStartSwap',{wuid,orderId},false)
|
||||
}
|
||||
|
||||
//查询公司
|
||||
export function getgslist(){
|
||||
return request('GET','/wechat/wechat/user/companylist?pageSize=300&pageNo=1')
|
||||
}
|
||||
|
||||
//申请绑定公司
|
||||
export function bdcomp(wuid:string,pcode:string,pname:string){
|
||||
return request('post_form','/wechat/wechat/user/bindcompany',{wuid,pcode,pname})
|
||||
}
|
||||
|
||||
//所属公司信息
|
||||
export function getgsxx(ccode:string){
|
||||
return request('GET',`/wechat/cloud/company/companyByCode?ccode=${ccode}`)
|
||||
}
|
||||
|
||||
|
||||
//查询
|
||||
//
|
||||
// 上面接口state=1时,为待
|
||||
// export function bdstate(){
|
||||
// return request('post_form','/wechat/wechat/user/userbyuid')
|
||||
// }
|
||||
Loading…
Reference in New Issue
Block a user