Quellcode durchsuchen

Merge branch 'master' of http://192.168.40.220/dmc/jz_applet into master

yxb
wq vor 2 Jahren
Ursprung
Commit
987176d388

+ 141
- 140
composables/order/useOrderListItem.ts Datei anzeigen

@@ -1,159 +1,160 @@
/**
* 订单列表业务逻辑
*/
import { reactive, ref, watch,nextTick, onMounted } from "vue";
import {request} from "@/utils/network/request.js";
import { reactive, ref, watch, nextTick, onMounted } from "vue";
import { request } from "@/utils/network/request.js";
import { stringToJson } from "@/utils/network/encryption";
import {onLoad,onUnload,onReachBottom,onPullDownRefresh} from "@dcloudio/uni-app";
import { onLoad, onUnload, onReachBottom, onPullDownRefresh } from "@dcloudio/uni-app";
import { getItem, StorageKeys } from "@/utils/storage";
import { hasLogin, msg } from "@/utils/utils";
import { orderList } from "@/utils/network/api";
import {PageData} from "@/datas/enum";
import { PageData } from "@/datas/enum";

export default function useOrderListItem(props) {
//搜索关键字
const searchKeyWords = ref('');
//订单列表数据
const ordersList = ref([]);
const config = {
emptyHint:{
hint:'~ 暂无订单数据 ~',
icon:'',
mode:'order'
},
contentTxt:{
contentdown: '~上拉加载更多~',
contentrefresh: '努力加载中...',
contentnomore: '-- 我是有底线的 --'
}
}
//请求参数
const params = reactive({
pageNum: PageData.NUM,
pageSize:PageData.SIZE,
total: 0,
status: 'more',
reload: false,
})
//搜索
const doSearch = () => {
if(!searchKeyWords.value){
msg('请输入需要搜索的车牌号!');
return;
}
refreshList(true);
}
//订单车牌号输入
const onKeyInput = (event) =>{
searchKeyWords.value = event.target.value;
if(searchKeyWords.value == ''){
refreshList(true);
}
}
/* 刷新列表 */
const refreshList = (isLoading) =>{
params.pageNum = 1;
params.total = 0;
params.status = 'more';
params.reload = false;
getList();
}
/* 加载更多 */
const loadMore = () =>{
if(params.total > ordersList.value.length){
params.status = 'loading';
params.pageNum++;
getList();
}else{
params.status = 'noMore';
}
}
/* 获取列表数据 */
const getList = async(isLoading = true) =>{
if(!hasLogin()){
uni.stopPullDownRefresh();
uni.$emit('refreshFinish');
return;
}
let res: any = null;
const options = {
type:2,
data:{
"opId": getItem(StorageKeys.OpenId),
"source":"WECHAT",
"vehiclePlate":searchKeyWords.value,
"tabIndex":props.index + '',
"pageNo":params.pageNum,
"pageSize":params.pageSize
},
method:'POST',
// showLoading: isLoading ? (params.pageNum === 1 ? true : false) : false ,
}
try{
res = await request(orderList,options);
//搜索关键字
const searchKeyWords = ref('');
//订单列表数据
const ordersList = ref([]);
const config = {
emptyHint: {
hint: '~ 暂无订单数据 ~',
icon: '',
mode: 'order'
},
contentTxt: {
contentdown: '~上拉加载更多~',
contentrefresh: '努力加载中...',
contentnomore: '-- 我是有底线的 --'
}
}
//请求参数
const params = reactive({
pageNum: PageData.NUM,
pageSize: PageData.SIZE,
total: 0,
status: 'more',
reload: false,
})
//搜索
const doSearch = () => {
if (!searchKeyWords.value) {
msg('请输入需要搜索的车牌号!');
return;
}
refreshList(true);
}
//订单车牌号输入
const onKeyInput = (event) => {
searchKeyWords.value = event.target.value;
if (searchKeyWords.value == '') {
refreshList(true);
}
}
/* 刷新列表 */
const refreshList = (isLoading) => {
params.pageNum = 1;
params.total = 0;
params.status = 'more';
params.reload = false;
getList();
}
/* 加载更多 */
const loadMore = () => {
if (params.total > ordersList.value.length) {
params.status = 'loading';
params.pageNum++;
getList();
} else {
params.status = 'noMore';
}
}
/* 获取列表数据 */
const getList = async (isLoading = true) => {
if (!hasLogin()) {
uni.stopPullDownRefresh();
uni.$emit('refreshFinish');
return;
}
let res: any = null;
const options = {
type: 2,
data: {
"opId": getItem(StorageKeys.OpenId),
"source": "WECHAT",
"vehiclePlate": searchKeyWords.value,
"tabIndex": props.index + '',
"pageNo": params.pageNum,
"pageSize": params.pageSize
},
method: 'POST',
// showLoading: isLoading ? (params.pageNum === 1 ? true : false) : false ,
}
try {
res = await request(orderList, options);
const data = stringToJson(res.bizContent);
console.log("aaa", data)
params.total = data.totalCount;
if(params.pageNum === 1){
if (params.pageNum === 1) {
ordersList.value = [];
}
if(params.total > 0){
const curList = data.data || [];
ordersList.value = params.reload ? curList : ordersList.value.concat(curList);
params.reload = false;
if (params.total > 0) {
const curList = data.data || [];
ordersList.value = params.reload ? curList : ordersList.value.concat(curList);
params.reload = false;
}
if(params.total === ordersList.value.length){
params.reload = false;
params.status = 'noMore';
if (params.total === ordersList.value.length) {
params.reload = false;
params.status = 'noMore';
}
if(params.pageNum === 1){
if (params.pageNum === 1) {
uni.stopPullDownRefresh();
}
uni.$emit('refreshFinish');
}catch(e){
uni.stopPullDownRefresh();
uni.$emit('refreshFinish');
}
}
watch(()=>props.index,()=>{
refreshList(true);
});
watch(()=>props.refresh,(nv)=>{
if(nv){
refreshList(false);
}
});
onMounted(()=>{
if(props.refresh){
refreshList(false);
}
})
onPullDownRefresh(()=>{
refreshList(true);
});
onReachBottom(()=>{
loadMore();
});
return {
config,
params,
ordersList,
doSearch,
onKeyInput
};
} catch (e) {
uni.stopPullDownRefresh();
uni.$emit('refreshFinish');
}
}
watch(() => props.index, () => {
refreshList(true);
});
watch(() => props.refresh, (nv) => {
if (nv) {
refreshList(false);
}
});
onMounted(() => {
if (props.refresh) {
refreshList(false);
}
})
onPullDownRefresh(() => {
refreshList(true);
});
onReachBottom(() => {
loadMore();
});
return {
config,
params,
ordersList,
doSearch,
onKeyInput
};
}

+ 1
- 1
pages/order/components/order-list-item-new.vue Datei anzeigen

@@ -34,7 +34,7 @@
<text class="value">{{getVehiclePlateColor(item.vehiclePlateColor)}}</text>
</view>
</view>
<view class="money"><text class="cny">¥</text><text class="amount">{{item.amount / 100 ?? '0.00'}}</text>
<view class="money"><text class="cny">¥</text><text class="amount" v-if="item.amount">{{item.amount / 100}}</text><text class="amount" v-else>0.00</text>
</view>
</view>


+ 1
- 1
pages/user/user.vue Datei anzeigen

@@ -29,7 +29,7 @@
<view class="panel-box">
<view class="panel">
<view class="panel-item" @click="$util.navTo('/subpackage/personal-center/vehicle-information', true)">
<view class="panel-text"><text class="num">{{state.carNumber}}</text><text class="txt">辆</text></view>
<view class="panel-text"><text class="num" v-if="state.carNumber">{{state.carNumber}}</text><text class="num" v-else>0</text><text class="txt">辆</text></view>
<text class="type">车辆</text>
</view>
<view class="panel-item">

+ 5
- 1
subpackage/after-sale/account-recharge/open-account.vue Datei anzeigen

@@ -91,7 +91,7 @@
import { navTo } from "@/utils/utils";
import {request} from "@/utils/network/request.js";
import {stringToJson} from "@/utils/network/encryption.js";
import { msg } from "@/utils/utils";
import { msg,checkStr } from "@/utils/utils";
const state = reactive({
isBusinessLicense:false, //是否上传公司营业执照
form:{
@@ -171,6 +171,10 @@
return;
}
}
if (!checkStr(state.form.handlerPhone, 'mobile')) {
msg('请输入正确手机号');
return;
}
const options = {
type: 2,
data: {

+ 2
- 0
subpackage/after-sale/replace-equipment/replace-equipment-confirm.vue Datei anzeigen

@@ -131,7 +131,9 @@

/*视图进入后操作*/
onLoad((option) => {
console.log("id",option)
queryOrderDetail(option.id).then((val: any) => {
console.log("val",val)
state.data = val
})


+ 4
- 4
subpackage/invoice/Invoice-mannager.vue Datei anzeigen

@@ -1,22 +1,22 @@
<template>
<view class="box">
<view class="card">
<view class="card" @click="toPage(1)">
<view class="card-left">
<view class="image-box">
<image :src="`${$imgUrl}InvoiceMannager/icon2.png`" mode=""></image>
</view>
<text>开票申请</text>
</view>
<u-icon name="arrow-right" color="#B2B2B2" size="30" @click="toPage(1)"></u-icon>
<u-icon name="arrow-right" color="#B2B2B2" size="30" ></u-icon>
</view>
<view class="card">
<view class="card" @click="toPage(2)">
<view class="card-left">
<view class="image-box">
<image :src="`${$imgUrl}InvoiceMannager/icon1.png`" mode=""></image>
</view>
<text>开票记录</text>
</view>
<u-icon name="arrow-right" color="#B2B2B2" size="30" @click="toPage(2)"></u-icon>
<u-icon name="arrow-right" color="#B2B2B2" size="30" ></u-icon>
</view>
</view>


Laden…
Abbrechen
Speichern