-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ad0c02
commit 3a24f0f
Showing
14 changed files
with
301 additions
and
284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
const SYNC_UPDATE = "SYNC_UPDATE" | ||
export { SYNC_UPDATE} | ||
const SYNC_UPDATE = 'SYNC_UPDATE' | ||
const REDUCENUM = 'REDUCENUM' | ||
|
||
export {SYNC_UPDATE,REDUCENUM} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
export default { | ||
computeTotal(state){ | ||
let cars = state.cars; | ||
let total = { price: 0, num: 0 } | ||
cars.forEach(item=>{ | ||
total.price += item.commoditysComponentList[0].commodityPrice * item.num; | ||
total.num += item.num | ||
}) | ||
total.price = total.price.toFixed(2);//保留2位小数 3.45 | ||
return total | ||
} | ||
computeTotal(state){ | ||
let arr = state.cars | ||
var total = {price:0,num:0} | ||
|
||
arr.forEach(item=>{ | ||
total.num += item.num | ||
|
||
total.price += Number(item.SellPrice) * item.num | ||
}) | ||
total.price = total.price.toFixed(2) | ||
return total | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import {SYNC_UPDATE} from "./const" | ||
export default { | ||
[SYNC_UPDATE](state,newCar){ | ||
state.cars = newCar; | ||
}, | ||
transfer(state,obj){ | ||
import {SYNC_UPDATE,REDUCENUM} from './const' | ||
|
||
export default{ | ||
[SYNC_UPDATE](state,newCar){ | ||
state.cars = newCar | ||
} , | ||
transfer(state,obj){ | ||
state.obj = obj | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export default { | ||
msg:1, | ||
cars:[], | ||
city:'北京', | ||
obj:Object | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Vue from 'vue' | ||
import Vuex from 'vuex' | ||
|
||
Vue.use(Vuex) | ||
|
||
// 引入state.js getters.js mutations.js actions.js 模块 | ||
import state from './state' | ||
import getters from './getters' | ||
import mutations from './mutations' | ||
import actions from './actions' | ||
|
||
export default new Vuex.Store({ | ||
state,getters,mutations,actions | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,7 +65,6 @@ export default { | |
obj:{ | ||
handler(n,o){ | ||
this.url = this.obj.interf | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
> | ||
<mt-cell | ||
title="返回" | ||
href="home" | ||
to="/home" | ||
> | ||
</mt-cell> | ||
<router-link | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.