提交修改

This commit is contained in:
cjb 2025-03-22 17:35:30 +08:00
parent 8486ca4c34
commit c40033ed5c
15 changed files with 302 additions and 138 deletions

View File

@ -1,5 +1,5 @@
<script setup lang="ts">
import { onLaunch, onShow, onHide} from "@dcloudio/uni-app"
import { onLaunch, onShow, onHide,onShareAppMessage,onShareTimeline} from "@dcloudio/uni-app"
onLaunch(() => {
console.log("App Launch");
});

View File

@ -1,12 +1,14 @@
import { createSSRApp } from 'vue'
import uviewPlus from 'uview-plus'
import sharMx from './mixin'
import App from './App.vue'
export function createApp() {
const app = createSSRApp(App)
app.use(uviewPlus)
app.mixin(sharMx)
return {
app,
};
}
}

View File

@ -17,7 +17,9 @@
"delay" : 0
},
/* */
"modules" : {},
"modules" : {
"Share" : {}
},
/* */
"distribute" : {
/* android */
@ -43,7 +45,9 @@
/* ios */
"ios" : {},
/* SDK */
"sdkConfigs" : {}
"sdkConfigs" : {
"share" : {}
}
}
},
/* */
@ -62,7 +66,7 @@
"scope.userLocation" : {
"desc" : "获取周边换电站"
},
"requiredPrivateInfos": ["getLocation"]
"requiredPrivateInfos" : [ "getLocation" ]
},
"unipush" : {
"enable" : false

View File

@ -11,7 +11,7 @@
<view id="mancont" class="jiner">
<view class="num">
<view>余额</view>
<view><text style="font-size: 50rpx;">{{totalAmount}}</text> </view>
<view><text style="font-size: 50rpx;">{{totalAmount/100}}</text> </view>
</view>
<view class="ctbn" @tap="topage('/minePages/recharge/index')">充值</view>
</view>
@ -21,12 +21,16 @@
<view>
<view v-for="n in list" class="mxitem">
<view>
<view style="padding-bottom: 8rpx;font-size: 40rpx;color: #00aa00;">充值</view>
<view style="font-size: 30rpx;color: #ccc;">2024-12-20 11:20:00</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 style="font-size: 30rpx;color: #ccc;">{{n.ctime}}</view>
</view>
<view style="text-align: right;">
<view style="padding-bottom: 8rpx;font-size: 40rpx;color: #00aa00;">+<text>100</text></view>
<view style="font-size: 30rpx;color: #ccc;">实际到账金额100</view>
<view v-if="n.tradeType == 1" style="padding-bottom: 8rpx;font-size: 40rpx;color: #00aa00;">+<text>{{n.tradeTotalAmount/100}}</text></view>
<view v-else-if="n.tradeType == 2" style="padding-bottom: 8rpx;font-size: 40rpx;color: #191919;"><text>{{n.tradeTotalAmount/100}}</text></view>
<view v-else-if="n.tradeType == 9" style="padding-bottom: 8rpx;font-size: 40rpx;color: #c79a11;">-<text>{{n.tradeTotalAmount/100}}</text></view>
<!-- <view style="font-size: 30rpx;color: #ccc;">实际到账金额100</view> -->
</view>
</view>
<up-empty v-if="list.length == 0" mode="list" text="暂无记录" />
@ -57,8 +61,6 @@
let status = ref('nomore') //loadmore loading
let totalAmount = ref(0)
//
let qsobj = reactive({
walletCode:uni.getStorageSync('walletCode'),
@ -99,7 +101,6 @@
//
let account =ref<any>({})
onShow(() => {
getaccou(uni.getStorageSync('wxuid')).then((rps:any) => {
if(rps.data.records){
@ -107,6 +108,8 @@
uni.setStorageSync('totalAmount',totalAmount.value)
}
})
status.value = 'nomore'
list.value.splice(0)
getylist()
})
@ -116,7 +119,6 @@
}
})
function topage(url:string) {
uni.navigateTo({
url

View File

@ -33,7 +33,7 @@
</view>
<view v-if="n.status == 6 || n.status == 7">
<view>订单金额</view>
<view>{{n.amount}}</view>
<view>{{n.amount/100}}</view>
</view>
<view>
<view>订单状态</view>

View File

@ -19,11 +19,15 @@
<view style="background: #fff;">
<radio-group size="30" @change="radioChange">
<label style="display: flex;align-items: center;padding: 30rpx;border-bottom: 2px solid #f4f4f4;">
<radio :checked="actv == 1" :value="1" color="#00aa00" style="transform:scale(80%);" />
<view style="display: flex;align-items: center;">
<radio :checked="actv == 1" :value="1" :disabled="yedis" color="#00aa00" style="transform:scale(80%);" />
<view style="display: flex;flex:1;align-items: center;">
<image src="/src/static/img/yuer.png" style="width: 60rpx;height: 60rpx;" />
<view style="padding-left: 10rpx;">余额</view>
<!-- <view style="flex: 1;">100</view> -->
<view v-if="iskt" style="flex:1;font-size: 30rpx;;text-align:right;color: #949494;">
<template v-if="iskzf">可用{{totalAmount}}</template>
<template v-else>余额不足剩余{{totalAmount}}</template>
</view>
<view v-else style="flex:1;text-align:right;color: #949494;">暂未开通</view>
</view>
</label>
<label style="display: flex;align-items: center;padding: 30rpx;">
@ -39,8 +43,8 @@
</template>
<script setup lang="ts">
import { ref,reactive } from 'vue'
import { payment,getip } from '@/utils/service'
import { ref,reactive,computed } from 'vue'
import { payment,getip,balancpay,getaccou,getInfo } from '@/utils/service'
import { onLoad,onShow } from '@dcloudio/uni-app'
onLoad((opt:any) => {
@ -50,17 +54,56 @@
payqs.goodsDetail[0].unitPrice = opt.amount*1
payqs.description = `${opt.plateNum}${opt.stationName}换电`
payqs.attach.description = `${opt.plateNum}${opt.stationName}换电`
// payqs.detail.costPrice = opt.amount
// payqs.detail.goodsDetail.unitPrice = opt.amount
orderNo.value = opt.orderNo
getaccou(uni.getStorageSync('wxuid')).then((rps:any) => {
if(rps.data.records){
totalAmount.value = rps.data.records[0].totalAmount
iskt.value = true
if(opt.amount*1 > totalAmount.value*1){
iskzf.value = false
}
}
})
})
//
let totalAmount = ref(0)
let iskt = ref(false)
let iskzf = ref(true)
let yedis = computed(() => {
if(iskt.value && iskzf.value){
return false
}
return true
})
//
let username = ref('')
getInfo({
wuid:uni.getStorageSync('wxuid')
}).then((rps:any) => {
if(rps.data.name){
username.value = rps.data.name
}else if(rps.data.nickName){
username.value = rps.data.nickName
}else{
username.value = ''
}
})
let orderNo = ref('')
let actv = ref(2)
function radioChange(v:any) {
console.log(v,'v')
actv.value = v.detail.value
}
let payqs = reactive<any>({
@ -72,9 +115,10 @@
type: 2, //"1-,2- number"
orderNo:'', //"",
trader:'', //
description:'',
tradercode:uni.getStorageSync('wxuid') //
//walletCode:'' //
// ownerId:'', //"IDwuid",
// ownerId:'', //"IDwuid:",
// walletCode:'' //""
},
goodsDetail:[
@ -87,8 +131,8 @@
}
],
payerClientIp:'', //IP
deviceId:'', //
stationCode:''
//deviceId:'', //
//stationCode:''
})
//ip
@ -97,28 +141,39 @@
})
function payhand() {
payqs.attach = JSON.stringify(payqs.attach)
payment(payqs).then((rps:any) => {
//#ifdef MP-WEIXIN
wx.requestPayment({
timeStamp:rps.data.timeStamp,
nonceStr: rps.data.nonceStr,
package: rps.data.packageVal,
signType: rps.data.signType,
paySign: rps.data.paySign,
success(){
uni.redirectTo({
url:`/minePages/paySuccess/index?orderNo=${orderNo.value}`
})
},
fail(){
}
if(actv.value == 1){
balancpay({
orderNo:orderNo.value,
wuid:uni.getStorageSync('wxuid'),
uname:username.value
}).then(() => {
uni.redirectTo({
url:`/minePages/paySuccess/index?orderNo=${orderNo.value}`
})
})
//#endif
})
}else{
payqs.attach = JSON.stringify(payqs.attach)
payment(payqs).then((rps:any) => {
//#ifdef MP-WEIXIN
wx.requestPayment({
timeStamp:rps.data.timeStamp,
nonceStr: rps.data.nonceStr,
package: rps.data.packageVal,
signType: rps.data.signType,
paySign: rps.data.paySign,
success(){
uni.redirectTo({
url:`/minePages/paySuccess/index?orderNo=${orderNo.value}`
})
},
fail(){
}
})
//#endif
})
}
}
</script>

View File

@ -51,11 +51,18 @@
<script setup lang="ts">
import { ref,reactive } from 'vue'
import { payment,getip,getInfo } from '@/utils/service'
import { payment,getip,getInfo,getaccou,openaccou } from '@/utils/service'
import { onLoad } from '@dcloudio/uni-app'
onLoad((opt:any) => {
//payqs.attach.walletCode = opt.walletCode
// onLoad((opt:any) => {
// payqs.attach.walletCode = opt.walletCode
// })
getaccou(uni.getStorageSync('wxuid')).then((rps:any) => {
if(!rps.data.records){
//
openaccou(uni.getStorageSync('wxuid'))
}
})
let phoneNumber = ref('')
@ -130,7 +137,7 @@
type: 1, //"1-,2- number"
//orderNo:'', //"",
trader:'', //
tradercode:uni.getStorageSync('wxuid'), // wuid
traderCode:uni.getStorageSync('wxuid'), // wuid
walletCode:uni.getStorageSync('walletCode') //
// ownerId:'', //"IDwuid",
// walletCode:'' //""
@ -158,6 +165,7 @@
//'{"type":1,"trader":"cijiangbo","tradercode":"8d4638c713e9391baa60395385932fb3","walletCode":"YTWAP1863511124008374272NARVLW"}'
payqs.attach = JSON.stringify(payqs.attach)
payqs.total = payqs.total*100
payment(payqs).then((rps:any) => {
//#ifdef MP-WEIXIN

View File

@ -8,51 +8,101 @@
:placeholder="true"
/>
<view class="content">
<view v-for="n in list" :key="n.pkId" class="list">
<view class="zoddu">
<view>
<view>换电站</view>
<view>{{n.stationName}}</view>
</view>
<view>
<view>车牌号</view>
<view>{{n.plateNum}}</view>
</view>
<view>
<view>手机号</view>
<view>{{n.phone}}</view>
</view>
<view>
<view>预约时间</view>
<view style="font-size: 30rpx;">{{ytime(n.swapDay,n.swapDuration)}}</view>
<view class="tabct">
<up-tabs
:list="statelist"
:scrollable="false"
@click="tabshand"
lineColor="#00aa00"
/>
</view>
<view class="lisct">
<view v-for="n in list" :key="n.orderNo" class="list">
<view class="zoddu">
<view>
<view>换电站</view>
<view>{{n.stationName}}</view>
</view>
<view>
<view>车牌号</view>
<view>{{n.plateNum}}</view>
</view>
<view>
<view>手机号</view>
<view>{{n.phone}}</view>
</view>
<view>
<view>预约时间</view>
<view style="font-size: 30rpx;">{{ytime(n.swapDay,n.swapDuration)}}</view>
</view>
</view>
<view v-if="n.status == 1" @tap="cancel(n.pkId)" class="qxyy" style="background: #00aa00;">取消预约</view>
<view v-else-if="n.status == 2" class="qxyy">已使用</view>
<view v-else-if="n.status == 3" class="qxyy">已取消</view>
<view v-else class="qxyy">已过期</view>
</view>
</view>
<view v-if="n.status == 1" @tap="cancel(n.pkId)" class="qxyy" style="background: #00aa00;">取消预约</view>
<view v-else-if="n.status == 2" class="qxyy">已使用</view>
<view v-else-if="n.status == 3" class="qxyy">已取消</view>
<view v-else class="qxyy">已过期</view>
</view>
<up-empty v-if="list.length == 0" mode="list" text="暂无预约记录" />
</view>
<up-loadmore v-else :status="status" color="#c0c4cc" lineColor="#c0c4cc" />
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { ref,reactive } from 'vue'
import { getyylist,cancelrese } from '@/utils/service'
import { onShow,onReachBottom } from '@dcloudio/uni-app'
onShow(() => {
pageNo.value = 1
list.value.splice(0)
getlist()
})
//
const statelist = reactive([
{ name: '全部', status:'1'},
{ name: '已使用', status:'2' },
{ name: '已取消', status:'3' },
{ name: '已过期', status:'4'}
])
let status = ref('nomore') //loadmore loading
let list = ref<any[]>([])
getlist()
let pageNo = ref(1)
let stanum = ref('')
//tabs
function tabshand(n:any){
pageNo.value = 1
list.value.splice(0)
stanum.value = n.status
getlist()
}
function getlist() {
getyylist({
ucode:uni.getStorageSync('wxuid')
// plateNum:'A12345D',
// status:'1',
// stationCode:'123456789'
}).then((rps:any) => {
list.value = rps.data
let qsobj = {
ucode:uni.getStorageSync('wxuid'),
pageSize:30,
pageNo:pageNo.value
}
if(stanum.value){
qsobj = Object.assign(qsobj,{status:stanum.value})
}
status.value = 'loading'
getyylist(qsobj).then((rps:any) => {
if(rps.data.total > 0){
list.value = [...list.value,...rps.data.records]
if(list.value.length == rps.data.total){
status.value = 'nomore'
}else{
status.value = 'loadmore'
pageNo.value++
}
}
})
}
function cancel(id:string) {
uni.showModal({
title: '温馨提示',
@ -77,42 +127,67 @@
function ytime(n:string,v?:string){
return `${n.substring(0,4)}${n.substring(4,6)}${n.substring(6,8)}${v?v:''}`
}
onReachBottom(() => {
if(status.value == 'loadmore'){
getlist()
}
})
</script>
<style lang="scss" scoped>
<style lang="scss">
page{
background: #f4f4f4;
}
.content{
padding: 25rpx;
.list{
margin-bottom: 40rpx;
border-radius: 20rpx;
box-shadow: 0 0 10px 2px rgba(190, 190, 190, 0.5);
padding-bottom: 30rpx;
.tabct{
position: fixed;
width: 100%;
box-sizing: border-box;
padding-bottom: 10rpx;
background: #fff;
.zoddu{
padding: 25rpx;
//margin-bottom: 30rpx;
//padding-top: 20rpx;
//border-top: 1px dashed #ccc;
>view{
display: flex;
padding-bottom: 20rpx;
justify-content: space-between;
}
.lisct{
padding-top: 130rpx;
.list{
margin:0 25rpx 40rpx;
//padding: 25rpx;
border-radius: 20rpx;
box-shadow: 0 0 10px 2px rgba(190, 190, 190, 0.5);
background: #fff;
.zoddu{
padding: 25rpx;
//margin-bottom: 30rpx;
//padding-top: 20rpx;
//border-top: 1px dashed #ccc;
>view{
display: flex;
padding-bottom: 20rpx;
justify-content: space-between;
>view:last-child{
color: #7a7a7a;
}
}
>view:last-child{
color: #7a7a7a;
padding-bottom: 0;
}
}
>view:last-child{
padding-bottom: 0;
.qxyy{
height: 80rpx;
line-height: 80rpx;
border-radius: 0 0 20rpx 20rpx;
color: #fff;
text-align: center;
background: #ccc;
}
}
.qxyy{
height: 80rpx;
line-height: 80rpx;
border-radius: 0 0 20rpx 20rpx;
color: #fff;
text-align: center;
background: #ccc;
}
}
}
.hdbzcont{
box-sizing: border-box;
width: 85vw;
padding: 30rpx;
background: #fff;
}
</style>

View File

@ -90,6 +90,7 @@
let genderName = ref('')
let formdata = reactive({
wuid:uni.getStorageSync('wxuid'),
phoneNumber:'', //
nickName:'', //
avatarUrl:'', //
@ -221,6 +222,9 @@
title: '保存成功',
duration: 2000
})
setTimeout(() => {
uni.navigateBack()
},2500)
})
}
}).catch(() => {

View File

@ -98,12 +98,12 @@
"selectedIconPath": "static/img/tabbar/home.png",
"text": "首页"
},
// {
// "pagePath":"pages/scanCode/index",
// "iconPath": "static/img/tabbar/saom.png",
// "selectedIconPath": "static/img/tabbar/saom.png",
// "text": "扫码换电"
// },
{
"pagePath":"pages/scanCode/index",
"iconPath": "static/img/tabbar/saom.png",
"selectedIconPath": "static/img/tabbar/saom.png",
"text": "扫码换电"
},
{
"pagePath": "pages/mine/index",
"iconPath": "static/img/tabbar/wode.png",

View File

@ -28,12 +28,12 @@
</view>
<view class="niche">{{username()}}</view>
</view>
<view>
<!-- <view>
<view style="font-size: 36rpx;">5</view>
<view style="font-size: 26rpx;color: #8e8a8a;">优惠券</view>
</view>
</view> -->
<view @tap="topage('/minePages/account/index')">
<view style="font-size: 36rpx;">{{account.totalAmount?account.totalAmount:0}}</view>
<view style="font-size: 36rpx;">{{account.totalAmount?account.totalAmount/100:0}}</view>
<view style="font-size: 26rpx;color: #8e8a8a;">余额</view>
</view>
</view>
@ -152,6 +152,7 @@ import {
getInfo,
getaccou
} from '@/utils/service'
let height = ref('')
let islogin = ref(false)
let PhoneNumber = ref('')
@ -198,7 +199,7 @@ onShow(() => {
islogin.value = false
PhoneNumber.value = ''
covers.value = []
hdzcode.value = ''
//hdzcode.value = ''
imglist.value = []
showxy()
}
@ -288,6 +289,7 @@ function getinfo(){
getInfo({
wuid:uni.getStorageSync('wxuid')
}).then((rps:any) => {
uni.setStorageSync('userInfor',rps.data)
userInfo.phoneNumber = rps.data.phoneNumber?rps.data.phoneNumber:''
userInfo.nickName = rps.data.nickName?rps.data.nickName:''
userInfo.avatarUrl = rps.data.avatarUrl?rps.data.avatarUrl:''
@ -298,8 +300,8 @@ function getinfo(){
getaccou(uni.getStorageSync('wxuid')).then((rps:any) => {
if(rps.data.records){
account.value = rps.data.records[0]
uni.setStorageSync('totalAmount', rps.data.records[0].totalAmount) //??
uni.setStorageSync('walletCode', rps.data.records[0].code) //??
uni.setStorageSync('totalAmount', rps.data.records[0].totalAmount)
uni.setStorageSync('walletCode', rps.data.records[0].code)
}
})
}
@ -323,7 +325,6 @@ function wdltip() {
}
function getdh() {
console.log(latitude.value,longitude.value)
uni.openLocation({
latitude:latitude.value*1,
longitude:longitude.value*1,

View File

@ -10,7 +10,7 @@
</view>
</view>
<view @tap="topage('/minePages/account/index')">
<view style="font-size: 36rpx;">{{totalAmount}}</view>
<view style="font-size: 36rpx;text-align: center;">{{totalAmount/100}}</view>
<view style="color: #848484;">余额</view>
</view>
</view>
@ -177,6 +177,7 @@
import { ref,reactive } from 'vue'
import { onShow } from '@dcloudio/uni-app'
import { getInfo } from '@/utils/service'
let islogin = ref(false)
let PhoneNumber = ref('')

View File

@ -1,14 +1,15 @@
<template>
<up-navbar
<!-- <up-navbar
title="扫码换电"
bgColor="#00aa7f"
:autoBack="true"
leftIconColor="#00aa7f"
titleStyle="color:#fff"
:placeholder="true"
/>
<view>扫码换电</view>
<view>{{JSON.stringify(code)}}</view>
/> -->
<!-- <view>扫码换电</view>
<view style="width:600rpx;word-break: break-all;">{{JSON.stringify(code)}}</view> -->
<!--decodeURIComponent(code.rawData)-->
</template>
<script setup lang="ts">
@ -16,17 +17,17 @@
import { BarHeight } from '@/utils/commen'
import { onTabItemTap } from '@dcloudio/uni-app'
let code = ref<any>('')
let hdzcode = ref('')
onTabItemTap((item) => {
console.log('tabBar item clicked', item);
uni.scanCode({
onlyFromCamera:true,
success(res){
code.value = res
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
// uni.navigateTo({
// url:'/codePage/index'
// })
uni.navigateTo({
url:`/homePages/reservation/index?hdzcode=${hdzcode}&phoneNumber=${uni.getStorageSync('userInfor').phoneNumber?uni.getStorageSync('userInfor').phoneNumber:''}`
})
},
fail() {
uni.switchTab({

View File

@ -29,8 +29,8 @@ export function request(method:any,url:string,data?:any,isLoading?:any){
uni.request({
header:headers,
//url:'http://192.168.5.200:9100/gateway'+ url,//`${conf.apiBaseUrl}${url}`,
url:'http://192.168.5.213:9100/gateway'+ url,
//url:'https://api.evo-techina.com'+url,
//url:'http://192.168.5.213:9100/gateway'+ url,
url:'https://api.evo-techina.com'+url,
method,
data:data,
timeout:30000,

View File

@ -55,17 +55,17 @@ interface Ydata{
}
export function addrese(parameter:Ydata){
return request('post_form','/wechat/cloud/order/swap/pre/add',parameter)
return request('post_form','/wechat/order/swap/pre/add',parameter) //wechat/cloud/order/swap/pre/add
}
//预约记录
export function getyylist(parameter:any){
return request('GET','/wechat/cloud/order/swap/pre/list',parameter)
return request('GET','/wechat/order/swap/pre/list',parameter)
}
//取消预约
export function cancelrese(id:string){
return request('post_form','/wechat/cloud/order/swap/pre/cancel',{id})
return request('post_form','/wechat/order/swap/pre/cancel',{id})
}
//查询换电站
@ -143,12 +143,12 @@ export function getUser() {
}
export function orderlist(parameter:Oderqs){
return request('GET','/wechat/cloud/order/swap/list',parameter)
return request('GET','/wechat/order/swap/list',parameter)
}
//查询换电步骤
export function dzbzxq(orderNo:string){
return request('GET','/wechat/cloud/order/swap/step/list',{orderNo})
return request('GET','/wechat/order/swap/step/list',{orderNo})
}
//协议
@ -221,3 +221,14 @@ export function balancedetails(parameter:Balande){
return request('post_form','/wechat/wechat/user/wallet/detail/list',parameter)
}
//个人余额支付
interface Bapay{
orderNo:String
wuid:String
uname:String
}
export function balancpay(parameter:Bapay){
return request('post_form','/wechat/order/swap/wallet/pay',parameter)
}