| | |
| | | }}</van-button> |
| | | </div> |
| | | |
| | | <!-- <div class="trading_card" v-for="i in 5" :key="i"> |
| | | <p class="card_label1 flex-start"> |
| | | <span class="label_icon">US</span> |
| | | <span>444</span> |
| | | <div class="trading_card" v-for="i in list" :key="i.id"> |
| | | <div class="card_label2 flex-between" style="height:1.8em" @click="toDetails(i)"> |
| | | <div> |
| | | <p class="flex-start"> |
| | | <span class="label_icon">{{ i.stockType }}</span> |
| | | <span class="label_name line-one">{{ i.stockSpell }}</span> |
| | | </p> |
| | | <p class="flex-start gp"> |
| | | <span>{{ i.stockName }}</span> |
| | | </p> |
| | | </div> |
| | | |
| | | <div class="flex-end"> |
| | | <van-icon name="arrow" color="#969799" size=".5em" /> |
| | | </div> |
| | | </div> |
| | | |
| | | <p class="card_label2 flex-between"> |
| | | <span>{{ $t("市场价") }}</span> |
| | | <span>{{ i.stockType | currencySymbol }} {{ i.nowPrice }}</span> |
| | | </p> |
| | | |
| | | <p class="card_label2 flex-between"> |
| | | <span>{{ $t("最低认购金额") }}</span> |
| | | <span>$ 2,000</span> |
| | | <span>{{ $t("最小购买数量") }}</span> |
| | | <span>{{ i.stockNum }}</span> |
| | | </p> |
| | | |
| | | <p class="card_label2 flex-between"> |
| | | <span>{{ $t("交易成功率") }}</span> |
| | | <span>100%</span> |
| | | </p> |
| | | |
| | | <p class="card_label2 flex-between"> |
| | | <span>{{ $t("预期收益") }}</span> |
| | | <span>3</span> |
| | | </p> |
| | | |
| | | <p class="card_label2 flex-between"> |
| | | <span>{{ $t("交易周期") }}</span> |
| | | <span>1天</span> |
| | | </p> |
| | | |
| | | <p class="card_buy flex-center"> |
| | | <p class="card_buy flex-center" @click="buyOpen(i)"> |
| | | <van-icon name="add-square" size=".4em" /> |
| | | <span>{{ $t("gm") }}</span> |
| | | <span>{{ $t("hj85") }}</span> |
| | | </p> |
| | | </div> --> |
| | | </div> |
| | | |
| | | <!-- 无数据时显示 --> |
| | | <div class="no_data flex-center"> |
| | | <div class="no_data flex-center" v-show="!list || list.length == 0"> |
| | | <img src="@/assets/img/zhaobudao2.png" alt="" /> |
| | | </div> |
| | | |
| | |
| | | :pageSize="pageSize" |
| | | :total="total" |
| | | ></n-pagination> |
| | | |
| | | <!-- 购买弹窗 --> |
| | | <van-popup v-model="buyShow" round> |
| | | <van-form class="buy_popup" @submit="popupSubmit"> |
| | | <div class="popup_title flex-center"> |
| | | <span>{{ popupData.stockName }}</span> |
| | | </div> |
| | | |
| | | <div class="division"></div> |
| | | |
| | | <div class="popup_item flex-between"> |
| | | <span>{{ $t("市场价") }}</span> |
| | | <span> |
| | | {{ popupData.stockType | currencySymbol }} {{ popupData.nowPrice }} |
| | | </span> |
| | | </div> |
| | | |
| | | <div class="popup_item flex-between"> |
| | | <span>{{ $t("最小购买数量") }}</span> |
| | | <span> |
| | | {{ popupData.stockNum }} |
| | | </span> |
| | | </div> |
| | | |
| | | <div class="popup_item flex-between-start"> |
| | | <span style="color:red">*</span> |
| | | <van-field |
| | | v-model="popFrom.password" |
| | | :label="$t('购买密码')" |
| | | :placeholder="$t('请输入')" |
| | | :rules="[{ required: true, message: $t('请输入') }]" |
| | | /> |
| | | </div> |
| | | |
| | | <div class="popup_item flex-between"> |
| | | <p class="flex-start"> |
| | | <span style="color:red">*</span> |
| | | <span>{{ $t("sl") }}</span> |
| | | </p> |
| | | <span> |
| | | <van-stepper |
| | | v-model="popFrom.num" |
| | | integer |
| | | :min="popupData.stockNum" |
| | | /> |
| | | </span> |
| | | </div> |
| | | |
| | | <div class="popup_item flex-end"> |
| | | <div class="zxgm flex-center" @click="minimum"> |
| | | <span>{{ $t("最小购买") }}</span> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="division"></div> |
| | | |
| | | <div class="buts flex-between"> |
| | | <p class="flex-center" @click="buyShow = false"> |
| | | <span>{{ $t("qx") }}</span> |
| | | </p> |
| | | <p class="flex-center" native-type="submit"> |
| | | <!-- <span>{{ $t("qr") }}</span> --> |
| | | <van-button native-type="submit">{{ $t("qr") }}</van-button> |
| | | </p> |
| | | </div> |
| | | </van-form> |
| | | </van-popup> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import PageHead from "@/components/pageHead.vue"; |
| | | import nPagination from "@/components/nPagination.vue"; |
| | | import * as api from "@/axios/api"; |
| | | import { Toast } from "vant"; |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | total: 1, |
| | | searchValue: "" |
| | | searchValue: "", |
| | | list: [], |
| | | buyShow: false, // 购买弹窗控制 |
| | | popupData: {}, // 点击购买的数据 |
| | | popFrom: { |
| | | password: "", |
| | | num: 0 |
| | | } |
| | | }; |
| | | }, |
| | | watch: { |
| | | pageNum() { |
| | | this.list = []; |
| | | this.getDzListTwo(); |
| | | } |
| | | }, |
| | | created() { |
| | | this.getDzListTwo(); |
| | | }, |
| | | methods: { |
| | | // 提交搜索 |
| | | submit() { |
| | | console.log(this.searchValue); |
| | | this.pageNum = 1; |
| | | this.getDzListTwo(); |
| | | }, |
| | | // 获取列表数据 |
| | | async getDzListTwo() { |
| | | let opt = { |
| | | pageNum: this.pageNum, |
| | | pageSize: this.pageSize, |
| | | keyWords: this.searchValue |
| | | // orderBy: "" |
| | | }; |
| | | let data = await api.getDzListTwo(opt); |
| | | if (data.status === 0) { |
| | | this.total = data.data.total; |
| | | this.list = data.data.list; |
| | | } |
| | | }, |
| | | // 购买弹窗 |
| | | buyOpen(i) { |
| | | this.popupData = i; |
| | | this.buyShow = true; |
| | | }, |
| | | // 提交购买 |
| | | async popupSubmit() { |
| | | let opt = { |
| | | ...this.popFrom, |
| | | dzId: this.popupData.id |
| | | }; |
| | | |
| | | let data = await api.getBuyStockDz(opt); |
| | | |
| | | if (data.status == 0) { |
| | | Toast.success(); |
| | | setTimeout(() => { |
| | | this.buyShow = false; |
| | | }, 1000); |
| | | } else { |
| | | Toast.fail(data.msg); |
| | | } |
| | | }, |
| | | // 最小购买 |
| | | minimum() { |
| | | this.popFrom.num = this.popupData.stockNum; |
| | | }, |
| | | // 点击进入详情 |
| | | toDetails(item) { |
| | | const obj = { |
| | | pid: item.id || "", |
| | | type: item.stockType || "" |
| | | }; |
| | | window.localStorage.setItem("kLine", JSON.stringify(obj)); |
| | | |
| | | this.$router.push({ |
| | | path: "/kline", |
| | | query: { |
| | | code: item.id, |
| | | type: item.stockType |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | |
| | | |
| | | <style lang="less" scoped> |
| | | @green: #c4d600; |
| | | @grey-two: #969799; |
| | | @red: #ee0a24; |
| | | .block_trading { |
| | | font-size: 10vw; |
| | | width: 100%; |
| | |
| | | min-height: 100vh; |
| | | padding-bottom: 0.3em; |
| | | padding-top: 1.4em; |
| | | |
| | | .buy_popup { |
| | | width: 8.8em; |
| | | /deep/ .van-cell { |
| | | padding: 0; |
| | | font-size: 0.4em; |
| | | } |
| | | /deep/ .van-field__body { |
| | | // border: 0.01em solid #f5f5f5; |
| | | // height: 2.5em; |
| | | // padding: 0 0.5em; |
| | | // margin-top: 0.5em; |
| | | } |
| | | /deep/ .van-field__label { |
| | | color: #000; |
| | | } |
| | | /deep/ .van-stepper__minus { |
| | | width: 1rem; |
| | | height: 1rem; |
| | | } |
| | | /deep/ .van-stepper__plus { |
| | | width: 1rem; |
| | | height: 1rem; |
| | | } |
| | | /deep/ .van-stepper__input { |
| | | height: 1rem; |
| | | width: 2rem; |
| | | font-size: 0.4rem; |
| | | } |
| | | .division { |
| | | width: 100%; |
| | | height: 0.25em; |
| | | background-color: #f5f5f5; |
| | | } |
| | | .popup_title { |
| | | width: 100%; |
| | | min-height: 1.22em; |
| | | font-weight: bold; |
| | | padding: 0 0.25em; |
| | | } |
| | | .popup_name { |
| | | color: @green; |
| | | .popup_icon { |
| | | background: @green; |
| | | color: #fff; |
| | | padding: 0.2em 0.35em; |
| | | border-radius: 0.15em; |
| | | margin-right: 0.3em; |
| | | font-size: 0.3em; |
| | | } |
| | | } |
| | | .popup_item { |
| | | width: 8.3em; |
| | | margin: 0 auto; |
| | | padding: 0.35em 0; |
| | | border-bottom: #f5f5f5 solid 0.01em; |
| | | |
| | | .zxgm { |
| | | height: 0.8em; |
| | | width: 2em; |
| | | border-radius: 0.1em; |
| | | border: #ddd solid 0.01em; |
| | | span { |
| | | font-size: 0.3em; |
| | | } |
| | | } |
| | | } |
| | | span { |
| | | font-size: 0.4em; |
| | | } |
| | | .buts { |
| | | width: 100%; |
| | | height: 1.22em; |
| | | |
| | | /deep/ .van-button { |
| | | border: none; |
| | | font-size: 1em; |
| | | color: @green; |
| | | } |
| | | p { |
| | | height: 100%; |
| | | flex: 1; |
| | | } |
| | | & > p:last-child { |
| | | border-left: #f5f5f5 solid 0.01em; |
| | | color: @green; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .popup_head { |
| | | display: flex; |
| | |
| | | width: 9em; |
| | | border-bottom: #f5f5f5 solid 0.01em; |
| | | } |
| | | |
| | | .card_label2 { |
| | | height: 1.1em; |
| | | color: #323233; |
| | |
| | | font-weight: 300; |
| | | } |
| | | & > span:last-child { |
| | | color: #969799; |
| | | color: @grey-two; |
| | | font-size: 0.36em; |
| | | } |
| | | .gp { |
| | | margin-top: 0.22em; |
| | | color: @grey-two; |
| | | font-size: 0.9em; |
| | | } |
| | | .app { |
| | | color: @green; |
| | | font-size: 0.6em; |
| | | } |
| | | .label_name { |
| | | color: @green; |
| | | width: 14em; |
| | | } |
| | | span.zje { |
| | | color: @red; |
| | | font-size: 0.48em; |
| | | } |
| | | span.zt { |
| | | color: @green; |
| | | } |
| | | } |
| | | |
| | |
| | | font-size: 0.3em; |
| | | } |
| | | } |
| | | |
| | | .label_icon { |
| | | background: @green; |
| | | color: #fff; |
| | | padding: 0.2em 0.35em; |
| | | border-radius: 0.15em; |
| | | margin-right: 0.3em; |
| | | font-size: 0.3em !important; |
| | | } |
| | | } |
| | | |
| | | .head_right { |