Browse Source

refactor: 优化代码结构并修复部分功能问题

- 移除提现页面的重复代码,统一使用`binding/withdrawal/index.vue`
- 将`onMounted`替换为`onShow`以确保页面显示时获取最新数据
- 修复`getTransactionDetailsList`的URL参数问题
- 更新开发环境API地址
- 优化提现表单处理逻辑
master
前端-胡立永 1 month ago
parent
commit
c76edb2a89
12 changed files with 738 additions and 3325 deletions
  1. +1
    -1
      api/home.js
  2. +7
    -2
      otherPages/authentication/connectAddress/detail.vue
  3. +19
    -14
      otherPages/binding/partner/index.vue
  4. +31
    -15
      otherPages/binding/withdrawal/index.vue
  5. +2
    -2
      otherPages/myOrdersManage/clock/index.vue
  6. +0
    -158
      otherPages/myOrdersManage/withdrawal/index.vue
  7. +3
    -3
      otherPages/orderTakingManage/detail/index.vue
  8. +4
    -1
      otherPages/workbenchManage/myUser/index.vue
  9. +2
    -1
      otherPages/workbenchManage/myWallet/index.vue
  10. +1
    -6
      pages.json
  11. +666
    -3121
      pages/myOrdersManage/dateOrder.json
  12. +2
    -1
      utils/getUrl.js

+ 1
- 1
api/home.js View File

@ -91,7 +91,7 @@ export const hhrMyUserList = (data) => {
// 收益明细
export const getTransactionDetailsList = (params) => {
return request({
url: `/applet/wallet/getTransactionDetailsList/${transactionType}`,
url: `/applet/wallet/getTransactionDetailsList`,///${transactionType}
headers: {
isToken: true
},


+ 7
- 2
otherPages/authentication/connectAddress/detail.vue View File

@ -185,6 +185,11 @@
}
function getDetail(){
if(!addressId.value){
return
}
addressDetail(addressId.value).
then(res => {
console.log(res.data);
@ -194,8 +199,8 @@
area: eidtItem?.value?.area || null,
address: eidtItem?.value?.address || null,
status: eidtItem?.value?.status == 'true' || null,
latitude: eidtItem?.value?.latitude || null,
longitude: eidtItem?.value?.longitude || null
latitude: form.value.latitude || eidtItem?.value?.latitude || null,
longitude: form.value.latitude || eidtItem?.value?.longitude || null
}
})
}


+ 19
- 14
otherPages/binding/partner/index.vue View File

@ -42,39 +42,44 @@
import {
ref,
reactive,
onMounted
} from 'vue';
import {
onShow
} from "@dcloudio/uni-app"
import {
getTransactionDetailsList
} from "@/api/home.js"
const icon = ref('/static/images/levelImage/money.png')
const detaliList = reactive([{
title: "合伙人推广佣金",
time: "2020-12-29 12:54:54",
amont: "168.00"
},
{
title: "合伙人推广佣金",
time: "2020-12-29 12:54:54",
amont: "168.00"
},
const detaliList = reactive([
// {
// title: "广",
// time: "2020-12-29 12:54:54",
// amont: "168.00"
// },
// {
// title: "广",
// time: "2020-12-29 12:54:54",
// amont: "168.00"
// },
])
const state = reactive({
transactionType: 0
})
onMounted(() => {
onShow(() => {
getList()
})
const getList = () => {
getTransactionDetailsList({
const getList = async () => {
let response = await getTransactionDetailsList({
transactionType: state.transactionType
})
console.log(response)
}


+ 31
- 15
otherPages/binding/withdrawal/index.vue View File

@ -9,7 +9,8 @@
<view class="money level">
<text>¥</text>
<up-input class="amount" placeholderClass="placeInput" placeholder="请输入提现金额" clearable fontSize="34rpx"
border="bottom" type="number" color="#FF2742" v-model="num"></up-input>
border="bottom" type="number" color="#FF2742"
v-model="form.amount"></up-input>
</view>
<!-- <DForm :list="state. " @submit="handleSubmit" /> -->
</view>
@ -31,7 +32,7 @@
</view>
<uni-popup ref="inputDialogRef" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="提现" v-model="fullName" placeholder="请输入姓名"
<uni-popup-dialog ref="inputClose" mode="input" title="提现" v-model="form.name" placeholder="请输入姓名"
@confirm="dialogInputConfirm" @close="close" :before-close="true"></uni-popup-dialog>
</uni-popup>
</template>
@ -42,21 +43,29 @@
computed,
} from "vue"
import { useStore } from 'vuex'
import {
cashOut
} from "@/api/amount/index.js"
const store = useStore()
const configList = computed(() => {
return store.getters.configList
})
const userInfo = computed(() => {
return store.getters.userInfo
})
const num = ref('');;
const fullName = ref('')
const form = ref({
amount: '',
name : '',
})
const inputDialogRef = ref(null)
const inputClose = ref(null)
const cashClick = () => {
if (num.value) {
fullName.value = ''
if (form.value.amount) {
form.value.name = ''
inputDialogRef.value.open()
} else {
uni.showToast({
@ -67,16 +76,23 @@
}
}
const dialogInputConfirm = (val) => {
const dialogInputConfirm = async (val) => {
if (val) {
uni.showToast({
icon: 'success',
title: '提现成功',
duration: 2000
})
fullName.value = val
let response = await cashOut({
...form.value,
type: 0,
userId: userInfo.value.userId
})
if (response.code == 200) {
uni.showToast({
title: response.msg,
icon: "none"
})
}
form.value.name = val
inputClose.value.close()
fullName.value = ''
form.value.name = ''
} else {
uni.showToast({
icon: 'error',
@ -88,7 +104,7 @@
const close = () => {
inputDialogRef.value.close()
fullName.value = ''
form.value.name = ''
}
</script>


+ 2
- 2
otherPages/myOrdersManage/clock/index.vue View File

@ -187,11 +187,11 @@
<view class="buttom mt60 box-size"
style="display: flex;gap: 20rpx;"
>
<view class="buttom-item buttom-item-2 level size-30"
<!-- <view class="buttom-item buttom-item-2 level size-30"
@click="saveDraft(false)"
:style="{borderRadius:'41rpx',color:'#ff842c'}">
保存草稿
</view>
</view> -->
<view class="buttom-item level size-30"
@click="submit"


+ 0
- 158
otherPages/myOrdersManage/withdrawal/index.vue View File

@ -1,158 +0,0 @@
<template>
<!-- <div>提现</div> -->
<view class="box">
<view class="top" :style="{ borderRadius: '16rpx' }">
<view >
提现金额
</view>
<view class="level">
<view class="money level">
<text>¥</text>
<input v-model="form.amount" type="digit" />
</view>
<!-- <DForm :list="state. " @submit="handleSubmit" /> -->
</view>
</view>
</view>
<view class="center">
<view class="text">
提现说明
</view>
<view>
<up-parse :content="configList.withdrawal_statement.paramValueArea" containerStyle="{
color: '#707070',
fontSize: '30rpx',
lineHeight: '45rpx',
}"></up-parse>
</view>
<view @click="handleSubmit" class="buttom level" :style="{ borderRadius: '41rpx' }">
提现
</view>
</view>
<view >
<!-- <u-popup :show="show" mode="center" @close="close" @open="open"> -->
</view>
</template>
<script setup>
import {
reactive,
ref,
computed
} from "vue";
import DForm from "@/components/dForm/index.vue"
import {
cashOut
} from "@/api/amount/index.js"
import {
useStore
} from "vuex"
const state = reactive({
list: [{
type: "input",
key: "提现金额",
placeholder: "请输入提现金额",
}, ]
})
const store = useStore();
const configList = computed(() => {
return store.getters.configList
})
const userInfo = computed(() => {
return store.getters.userInfo
})
const form = ref({
amount: ''
})
const handleSubmit = async (val) => {
if (!form.value.amount) {
return uni.showToast({
title: '请填写提现金额',
icon: "none"
})
}
let response = await cashOut({
...form.value,
type: 0,
userId: userInfo.value.userId
})
if (response.code == 200) {
uni.showToast({
title: response.msg,
icon: "none"
})
}
}
</script>
<style scoped lang="scss">
.box {
width: 750rpx;
height: 180rpx;
background-image: linear-gradient(to bottom, #FFBF60, #FFFFFF);
padding: 60rpx 24rpx 0 24rpx;
box-sizing: border-box;
}
.top {
width: 702rpx;
height: 227rpx;
background-color: #FFFFFF;
padding: 24rpx 34rpx 0 34rpx;
box-sizing: border-box;
}
.money {
width: 550rpx;
height: 71rpx;
/* background-color: #FFBF60; */
color: #FFBF60 !important;
font-size: 54rpx !important;
;
height: 71rpx;
/* background-color: #FFBF60; */
color: #FFBF60 !important;
font-size: 54rpx !important;
margin: 3% 0 0 5%;
}
.money input {
margin-left: 5%;
font-size: 61rpx;
height: 71rpx;
}
.center {
width: 100%;
height: 1265rpx;
background-color: #FFFFFF;
font-size: 30rpx;
color: #707070;
padding: 84rpx 0 0 54rpx;
box-sizing: border-box;
line-height: 45rpx;
}
.text {
color: #000000;
font-weight: 700;
margin-bottom: 30rpx;
}
.buttom {
width: 544rpx;
height: 89rpx;
background-color: #FFBF60;
color: #FFFFFF;
font-size: 28rpx;
line-height: 89rpx;
margin: 800rpx 0 0 50rpx;
justify-content: center;
}
.level {
display: flex;
}
</style>

+ 3
- 3
otherPages/orderTakingManage/detail/index.vue View File

@ -241,7 +241,7 @@
</view>
<view class="button-group">
<up-button @click="noneOrder" color="#FFBF60" text="复制订单编号" shape="circle"></up-button>
<up-button v-if="showSecondButton" @click="toMyOrder" color="#FFBF60" text="到我的订单查看" shape="circle" style="margin-top: 20rpx;"></up-button>
<up-button v-if="showSecondButton" @click="toMyOrder" color="#FFBF60" text="到我的订单查看" shape="circle"></up-button>
</view>
</view>
</up-popup>
@ -459,7 +459,7 @@
//
const toMyOrder = () => {
orderSuccessClose();
uni.navigateTo({
uni.switchTab({
url: '/pages/myOrdersManage/index'
});
}
@ -566,7 +566,7 @@
.button-group {
display: flex;
flex-direction: column;
align-items: center;
gap: 20rpx;
}


+ 4
- 1
otherPages/workbenchManage/myUser/index.vue View File

@ -67,6 +67,9 @@ import {
onMounted,
computed,
} from "vue"
import { onShow } from '@dcloudio/uni-app'
import { useStore } from 'vuex'
import haveOrder from "./components/haveOrder.vue"
import noOrder from "./components/noOrder.vue"
@ -115,7 +118,7 @@ const state = reactive({
info: {},
baseInfo: {}
})
onMounted(() => {
onShow(() => {
getList()
state.info = JSON.parse(uni.getStorageSync("baseInfo"))
getBaseInfo()


+ 2
- 1
otherPages/workbenchManage/myWallet/index.vue View File

@ -98,6 +98,7 @@
binBaseInfo,
bindCode
} from "@/api/home.js"
import { onShow } from '@dcloudio/uni-app'
const mounthName = ref('本月数据')
const totalName = ref('累计数据')
@ -121,7 +122,7 @@
totalData: []
})
onMounted(() => {
onShow(() => {
state.info = JSON.parse(uni.getStorageSync("baseInfo"))
getBaseInfo()
})


+ 1
- 6
pages.json View File

@ -222,12 +222,7 @@
"style": {
"navigationBarTitleText": "保证金退还"
}
}, {
"path": "withdrawal/index",
"style": {
"navigationBarTitleText": "提现"
}
}, {
}, {
"path": "transaction/index",
"style": {
"navigationBarTitleText": "交易明细"


+ 666
- 3121
pages/myOrdersManage/dateOrder.json
File diff suppressed because it is too large
View File


+ 2
- 1
utils/getUrl.js View File

@ -3,7 +3,8 @@ const accountInfo = wx.getAccountInfoSync();
current = accountInfo.miniProgram.envVersion;
const api = {
develop:"http://h5.xzaiyp.top",
// develop:"http://h5.xzaiyp.top",
develop:"http://pet-admin.hhlm1688.com/api",
// develop: "http://youyi-test.natapp1.cc/prod-api", // 开发
trial: "http://h5.xzaiyp.top", //测试
release: "https://api.catmdogd.com/prod-api",


Loading…
Cancel
Save