首次提交

This commit is contained in:
xk_guohonglei
2020-08-18 15:09:31 +08:00
commit 1f8b3e6e55
57 changed files with 9637 additions and 0 deletions

40
store/getters.js Normal file
View File

@@ -0,0 +1,40 @@
const getters = {
driver: state => state.user.driver,
temp: state => state.user.temp,
baseDriver: state => state.user.baseDriver,
headPortrait: state => state.user.driver.headPortrait,
orderList: state => state.waybill.orderList,
runningList: state => state.waybill.runningList,
finishedList: state => state.waybill.finishedList,
canceledList: state => state.waybill.canceledList,
location: state => state.waybill.location,
waybillNumber: state => state.waybill.waybillNumber,
waybilling: state => state.waybill.waybilling,
waybillContract: state => state.contract.waybillContract,
car: state => state.user.car,
bMsgList: state => state.user.bMsgList,
sMsgList: state => state.user.sMsgList,
wsAccount: state => state.user.wsAccount,
msgKind: state => state.user.msgKind,
baseAdd: state => state.base.baseAdd,
activeFooter: state => state.base.activeFooter,
uploadMaxSize: state => state.base.uploadMaxSize,
tokenActive: state => state.base.tokenActive,
tempNo: state => state.temp.tempNo,
powerful: state => state.temp.powerful,
locationStr: state => state.temp.locationStr,
locationCenter: state => state.temp.locationCenter,
order: state => state.temp.order,
condition: state => state.temp.condition,
openid: state => state.base.openid,
carNo: state => state.base.carNo,
unionid: state => state.base.unionid
}
export default getters

39
store/index.js Normal file
View File

@@ -0,0 +1,39 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
state: {
/**
* 是否需要强制登录
*/
forcedLogin: false,
hasLogin: false,
userName: ""
},
modules: {
user,
temp,
base,
waybill,
location,
contract
},
getters,
plugins: [createPersistedState({
storage: window.sessionStorage
})],
mutations: {
login(state, userName) {
state.userName = userName || '新用户';
state.hasLogin = true;
},
logout(state) {
state.userName = "";
state.hasLogin = false;
}
}
})
export default store

40
store/modules/base.js Normal file
View File

@@ -0,0 +1,40 @@
const base = {
state: {
uploadMaxSize: 1024,
// 上传图片的大小限制 单位kb
baseAdd: {
positionStr: '',
address: ''
},
activeFooter: 0,
tokenActive: false,
openid: '',
unionid: '',
carNo: ''
},
mutations: {
SET_BASEADD: (state, baseAdd) => {
state.baseAdd = baseAdd
},
SET_ACTIVE: (state, activeFooter) => {
state.activeFooter = activeFooter
},
SET_TOKENACTIVE: (state, tokenActive) => {
state.tokenActive = tokenActive
},
SET_OPEN: (state, openid) => {
state.openid = openid
},
SET_CARNO: (state, carNo) => {
state.carNo = carNo
},
SET_UNIONID: (state, unionid) => {
state.unionid = unionid
}
}
}
export default base

12
store/modules/contract.js Normal file
View File

@@ -0,0 +1,12 @@
const contracts = {
state: {
waybillContract: ''
},
mutations: {
SET_WBCONTRACT: (state, waybillContract) => {
state.waybillContract = waybillContract
}
}
}
export default contracts

51
store/modules/driver.js Normal file
View File

@@ -0,0 +1,51 @@
const user = {
state: {
driver: {
phone: '',
headPortrait: ''
},
baseDriver: {
phone: ''
},
wsAccount: '',
temp: [],
bMsgList: [],
sMsgList: [],
msgKind: true
},
mutations: {
SET_DRIVER: (state, driver) => {
state.driver = driver
},
SET_HEAD: (state, headPortrait) => {
state.driver.headPortrait = headPortrait
},
SET_BASEDRIVER: (state, baseDriver) => {
state.baseDriver = baseDriver
},
SET_CAR: (state, car) => {
state.car = car
},
SET_BMSGLIST: (state, bMsgList) => {
state.bMsgList = bMsgList
},
SET_SMSGLIST: (state, sMsgList) => {
state.sMsgList = sMsgList
},
SET_MSG: (state, msgKind) => {
state.msgKind = msgKind
},
SET_WSACCOUNT: (state, wsAccount) => {
state.wsAccount = wsAccount
},
SET_TEMP: (state, temp) => {
state.temp = temp
},
SET_ALLSTATE: () => {
state = {}
}
}
}
export default user

View File

33
store/modules/temp.js Normal file
View File

@@ -0,0 +1,33 @@
// 全部订单各列表
const temp = {
state: {
tempNo: {},
powerful: false,
locationStr: '0,0',
locationCenter: [11, 3],
order: {},
condition: {}
},
mutations: {
SET_TEMPNO: (state, tempNo) => {
state.tempNo = tempNo
},
SET_POWER: (state, powerful) => {
state.powerful = powerful
},
SET_LOCATION: (state, locationStr) => {
state.locationStr = locationStr
},
SET_ORDERDE: (state, order) => {
state.order = order
},
SET_CONDT: (state, condition) => {
state.condition = condition
},
SET_CENTER: (state, locationCenter) => {
state.locationCenter = locationCenter
}
}
}
export default temp

34
store/modules/waybill.js Normal file
View File

@@ -0,0 +1,34 @@
// 全部订单各列表
const waybill = {
state: {
orderList: [],
runningList: [],
finishedList: [],
canceledList: [],
waybillNumber: '',
waybilling: ''
},
mutations: {
SET_ORDERLIST: (state, orderList) => {
state.orderList = orderList
},
SET_RUNNINGLIST: (state, runningList) => {
state.runningList = runningList
},
SET_FINISHEDLIST: (state, finishedList) => {
state.finishedList = finishedList
},
SET_CANCELEDLIST: (state, canceledList) => {
state.canceledList = canceledList
},
SET_WAYBILL: (state, waybillNumber) => {
state.waybillNumber = waybillNumber
},
SET_WAYBILLING: (state, waybilling) => {
state.waybilling = waybilling
}
}
}
export default waybill