Browse Source

修改

master
liaoxinyu 1 year ago
parent
commit
651c8edc8d
  1. 8
      src/views/contract/handicap.vue
  2. 4
      src/views/contract/index.vue
  3. 12
      src/vuex/store.js

8
src/views/contract/handicap.vue

@ -69,6 +69,7 @@
<div class="num fn-20 increace" style="display: inline-block;"> <div class="num fn-20 increace" style="display: inline-block;">
<!-- {{ newPriceObj.price }} --> <!-- {{ newPriceObj.price }} -->
{{ price1 }} {{ price1 }}
<!-- {{set_price}} -->
</div> </div>
</div> </div>
<div class="w-14/24 text-right"> <div class="w-14/24 text-right">
@ -189,7 +190,10 @@ export default {
item.total = item.total.toFixed(3); item.total = item.total.toFixed(3);
}); });
return list; return list;
} },
// set_price() {
// return this.$store.getters.set_price; // Vuex
// }
}, },
created() { created() {
if (this.symbol) { if (this.symbol) {
@ -228,6 +232,7 @@ export default {
this.buyList = res.swapBuyList; this.buyList = res.swapBuyList;
this.tradeList = res.swapTradeList; this.tradeList = res.swapTradeList;
this.newPriceObj = this.tradeList[0]; this.newPriceObj = this.tradeList[0];
this.$store.commit('SET_PRICE', this.newPriceObj.price);
this.$emit("input", this.newPriceObj); this.$emit("input", this.newPriceObj);
}); });
}, },
@ -281,6 +286,7 @@ export default {
this.tradeList.pop(); this.tradeList.pop();
this.newPriceObj = data; this.newPriceObj = data;
localStorage.setItem("price",this.newPriceObj.price) localStorage.setItem("price",this.newPriceObj.price)
// this.$store.commit('SET_PRICE', this.newPriceObj.price);
this.$emit("input", this.newPriceObj); this.$emit("input", this.newPriceObj);
} else if (type == "ping" ||cmd == "ping") { } else if (type == "ping" ||cmd == "ping") {
this.ws.send({ this.ws.send({

4
src/views/contract/index.vue

@ -21,6 +21,7 @@
increase: activeContract.increase >= 0 increase: activeContract.increase >= 0
}"> }">
{{ price1 }} {{ price1 }}
<!-- {{set_price}} -->
</div> </div>
<!-- <div class="title mb-1 text-secondary"> <!-- <div class="title mb-1 text-secondary">
{{ $t("contract.h6") }} {{ $t("contract.h6") }}
@ -276,6 +277,9 @@ export default {
isLogin() { isLogin() {
return Boolean(localStorage.token); return Boolean(localStorage.token);
}, },
// set_price() {
// return this.$store.getters.set_price; // Vuex
// }
// contractListFilter(){ // contractListFilter(){
// return this.contractList.map((item1, index1)=>{ // return this.contractList.map((item1, index1)=>{
// item1.marketInfoList.filter(item2=>{ // item1.marketInfoList.filter(item2=>{

12
src/vuex/store.js

@ -6,6 +6,7 @@ Vue.use(Vuex)
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
theme: localStorage.theme || 'dark', theme: localStorage.theme || 'dark',
price:0,
// 获取应用配置 // 获取应用配置
appConfig: (() => { appConfig: (() => {
if (localStorage.appConfig) { if (localStorage.appConfig) {
@ -23,8 +24,17 @@ const store = new Vuex.Store({
SET_APPCONFIG(state, data) { SET_APPCONFIG(state, data) {
state.appConfig = data state.appConfig = data
localStorage.setItem('appConfig', JSON.stringify(data)) localStorage.setItem('appConfig', JSON.stringify(data))
} },
// SET_PRICE(state, data){
// state.price = data
// // console.log(data);
// }
}, },
// getters: {
// set_price(state) {
// return state.price; // 获取共享状态
// }
// },
actions: { actions: {
setTheme({ commit }, data) { setTheme({ commit }, data) {
commit('SET_THEME', data) commit('SET_THEME', data)

Loading…
Cancel
Save