|
@@ -84,45 +84,47 @@
|
|
|
<div v-else>
|
|
|
<!-- <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了"
|
|
|
@load="onLoad"> -->
|
|
|
- <div v-for="item in orderHisList" :key="item.id">
|
|
|
- <van-card>
|
|
|
- <template #title>
|
|
|
- <span class="word13">挂单数量:{{ item.entrustNumber }} 股 </span>
|
|
|
- </template>
|
|
|
- <template #desc>
|
|
|
- <span class="word11"> 创建时间:{{ item.createTime }}</span>
|
|
|
- </template>
|
|
|
- <template #tags>
|
|
|
- <div v-if="item.type === '1'">交易类型:<van-tag type="success">买入</van-tag>
|
|
|
- </div>
|
|
|
- <div v-else>交易类型:<van-tag type="warning">卖出</van-tag></div>
|
|
|
- <!-- <van-tag type="danger">挂单失败</van-tag> -->
|
|
|
- </template>
|
|
|
- <template #price-top>
|
|
|
- <!-- status 状态:0过期,1生效,2撤单,3全部成交,4部分成交 -->
|
|
|
- <!-- <div>
|
|
|
+ <div v-for="item in orderHisList" :key="item.id">
|
|
|
+ <van-card>
|
|
|
+ <template #title>
|
|
|
+ <span class="word13">挂单数量:{{ item.entrustNumber }} 股
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <template #desc>
|
|
|
+ <span class="word11"> 创建时间:{{ item.createTime
|
|
|
+ }}</span>
|
|
|
+ </template>
|
|
|
+ <template #tags>
|
|
|
+ <div v-if="item.type === '1'">交易类型:<van-tag type="success">买入</van-tag>
|
|
|
+ </div>
|
|
|
+ <div v-else>交易类型:<van-tag type="warning">卖出</van-tag></div>
|
|
|
+ <!-- <van-tag type="danger">挂单失败</van-tag> -->
|
|
|
+ </template>
|
|
|
+ <template #price-top>
|
|
|
+ <!-- status 状态:0过期,1生效,2撤单,3全部成交,4部分成交 -->
|
|
|
+ <!-- <div>
|
|
|
交易状态:<van-tag plain round type="danger">{{ showStatusText(item.status) }}</van-tag>
|
|
|
</div> -->
|
|
|
- <div v-if="item.status === '0'">挂单状态:<van-tag plain round
|
|
|
- type="danger">过期</van-tag></div>
|
|
|
- <div v-else-if="item.status === '1'">挂单状态:<van-tag plain round
|
|
|
- type="success">匹配中</van-tag></div>
|
|
|
- <div v-else-if="item.status === '2'">挂单状态:<van-tag plain
|
|
|
- round>撤单</van-tag></div>
|
|
|
- <div v-else-if="item.status === '3'">挂单状态:<van-tag plain round
|
|
|
- type="primary">匹配成功</van-tag></div>
|
|
|
- <div v-else-if="item.status === '4'">挂单状态:<van-tag plain round
|
|
|
+ <div v-if="item.status === '0'">挂单状态:<van-tag plain round
|
|
|
+ type="danger">过期</van-tag></div>
|
|
|
+ <div v-else-if="item.status === '1'">挂单状态:<van-tag plain round
|
|
|
+ type="success">匹配中</van-tag></div>
|
|
|
+ <div v-else-if="item.status === '2'">挂单状态:<van-tag plain round>撤单</van-tag>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="item.status === '3'">挂单状态:<van-tag plain round
|
|
|
+ type="primary">匹配成功</van-tag></div>
|
|
|
+ <div v-else-if="item.status === '4'">挂单状态:<van-tag plain round
|
|
|
color="#7232dd">部分匹配成功</van-tag></div>
|
|
|
- <div v-else>挂单状态:<van-tag plain round>未知状态</van-tag></div>
|
|
|
- </template>
|
|
|
- <template #price>
|
|
|
- <span class="txt9">每股单价
|
|
|
- :¥{{ item.price }}
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </van-card>
|
|
|
- <br>
|
|
|
- </div>
|
|
|
+ <div v-else>挂单状态:<van-tag plain round>未知状态</van-tag></div>
|
|
|
+ </template>
|
|
|
+ <template #price>
|
|
|
+ <span class="txt9">每股单价
|
|
|
+ :¥{{ item.price }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </van-card>
|
|
|
+ <br>
|
|
|
+ </div>
|
|
|
<!-- </van-list> -->
|
|
|
</div>
|
|
|
<!-- <van-back-top @click="backTop" right="5vw" bottom="10vh" /> -->
|
|
@@ -136,7 +138,8 @@
|
|
|
|
|
|
<!-- <deviceOper ref="oprRef" @operfinish="operFinish"></deviceOper> -->
|
|
|
<!-- 搜索弹出框 -->
|
|
|
- <!-- <deviceSearch ref="searchRef" @search="search($event)"></deviceSearch> -->
|
|
|
+ <deviceSearch ref="searchRef" @search="search($event)"></deviceSearch>
|
|
|
+
|
|
|
<div style="height: 50px;"></div>
|
|
|
<!-- <nav-bar></nav-bar> -->
|
|
|
</div>
|
|
@@ -150,8 +153,9 @@ import { onMounted, reactive, ref } from "vue"
|
|
|
// import SearchPop from './SearchPop.vue';
|
|
|
// import TestComp from './TestComp.vue'
|
|
|
import { listMyOrderHis, getMyStock } from "@/service/position";
|
|
|
+import deviceSearch from "./deviceSearch";
|
|
|
|
|
|
-const showSearchPop = ref(false);
|
|
|
+// const showSearchPop = ref(false);
|
|
|
|
|
|
const orderHisList = ref([]);
|
|
|
const error = ref(false);
|
|
@@ -182,36 +186,36 @@ function twoNumber(val) {
|
|
|
}
|
|
|
|
|
|
const onLoad = async () => {
|
|
|
- if (!finished.value) {
|
|
|
- loading.value = true
|
|
|
- searchParams.current = searchParams.current + 1;
|
|
|
- getList();
|
|
|
- getMyStockFunc();
|
|
|
- }
|
|
|
+ if (!finished.value) {
|
|
|
+ loading.value = true
|
|
|
+ searchParams.current = searchParams.current + 1;
|
|
|
+ getList();
|
|
|
+ getMyStockFunc();
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
let searchParams = reactive({
|
|
|
- current: 1, // 当前页,默认1
|
|
|
- size: 10, // 页大小,默认10条
|
|
|
+ current: 1, // 当前页,默认1
|
|
|
+ size: 10, // 页大小,默认10条
|
|
|
})
|
|
|
|
|
|
const getList = async () => {
|
|
|
- finished.value = false;
|
|
|
- const params = Object.assign({}, searchParams);
|
|
|
- const { data } = await listMyOrderHis(params);
|
|
|
- if (data.code === "00000") {
|
|
|
- orderHisList.value = data.data.records
|
|
|
- hisLength.value = orderHisList.value.length
|
|
|
- if (orderHisList.value.length >= data.data.total) {
|
|
|
- finished.value = true;
|
|
|
+ finished.value = false;
|
|
|
+ const params = Object.assign({}, searchParams);
|
|
|
+ const { data } = await listMyOrderHis(params);
|
|
|
+ if (data.code === "00000") {
|
|
|
+ orderHisList.value = data.data.records
|
|
|
+ hisLength.value = orderHisList.value.length
|
|
|
+ if (orderHisList.value.length >= data.data.total) {
|
|
|
+ finished.value = true;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- // 加载状态结束
|
|
|
- loading.value = false;
|
|
|
+ // 加载状态结束
|
|
|
+ loading.value = false;
|
|
|
}
|
|
|
|
|
|
onMounted(
|
|
|
- onLoad,
|
|
|
+ onLoad,
|
|
|
);
|
|
|
|
|
|
const buyPrice = ref()
|
|
@@ -220,19 +224,32 @@ const dailyDiff = ref()
|
|
|
const totalDiff = ref()
|
|
|
|
|
|
const getMyStockFunc = async () => {
|
|
|
- const { data } = await getMyStock();
|
|
|
- if (data.code === '00000') {
|
|
|
- buyPrice.value = data.data.buyPrice
|
|
|
- currentPrice.value = data.data.currentPrice
|
|
|
- dailyDiff.value = data.data.dailyDiff
|
|
|
- totalDiff.value = data.data.totalDiff
|
|
|
- }
|
|
|
+ const { data } = await getMyStock();
|
|
|
+ if (data.code === '00000') {
|
|
|
+ buyPrice.value = data.data.buyPrice
|
|
|
+ currentPrice.value = data.data.currentPrice
|
|
|
+ dailyDiff.value = data.data.dailyDiff
|
|
|
+ totalDiff.value = data.data.totalDiff
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+const searchRef = ref(null);
|
|
|
+
|
|
|
+// 搜索点击
|
|
|
const searchClick = () => {
|
|
|
- console.log("点击搜索");
|
|
|
- showSearchPop.value = true;
|
|
|
-}
|
|
|
+ console.log("点击搜索");
|
|
|
+ searchRef.value.showSearch();
|
|
|
+};
|
|
|
+
|
|
|
+// 搜索条件触发查询
|
|
|
+const search = (e) => {
|
|
|
+ orderHisList.value = [];
|
|
|
+ loading.value = true;
|
|
|
+ searchParams.current = 1;
|
|
|
+ searchParams = Object.assign(searchParams, e);
|
|
|
+ getList();
|
|
|
+};
|
|
|
+
|
|
|
|
|
|
// 处理子组件传递回来的更新事件
|
|
|
// const handleUpdateShowSearchPop = (val) => {
|