更新部分公共样式代码
This commit is contained in:
parent
789557183f
commit
c3d4f1d78c
|
|
@ -0,0 +1,45 @@
|
||||||
|
import {
|
||||||
|
reactive, ref
|
||||||
|
} from 'vue';
|
||||||
|
function isSameType(a, b) {
|
||||||
|
return a instanceof b === true || b instanceof a === true;
|
||||||
|
}
|
||||||
|
class LIST{
|
||||||
|
constructor(data) {
|
||||||
|
this.data=reactive({
|
||||||
|
page:0,
|
||||||
|
totalPage:0,
|
||||||
|
total:0,
|
||||||
|
list:[],
|
||||||
|
hasAjax:false,
|
||||||
|
status:'',//loading fail success
|
||||||
|
query:{
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
Object.assign(this.data, data)
|
||||||
|
}
|
||||||
|
add(item){
|
||||||
|
this.data.list.push(item)
|
||||||
|
}
|
||||||
|
del(index){
|
||||||
|
this.data.list.splice(index,1)
|
||||||
|
}
|
||||||
|
update(index,item){
|
||||||
|
this.data.list[index]=item
|
||||||
|
}
|
||||||
|
get(index){
|
||||||
|
return this.data.list[index]
|
||||||
|
}
|
||||||
|
getVal(key){
|
||||||
|
return this.data[key]
|
||||||
|
}
|
||||||
|
setVal(key,val){
|
||||||
|
this.data[key]=val
|
||||||
|
if(key=='page'){
|
||||||
|
this.data['page']=val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default LIST
|
||||||
|
|
@ -329,7 +329,9 @@ text {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
background: #F9F9F9;
|
background: #F9F9F9;
|
||||||
}
|
}
|
||||||
|
.box-shadow{
|
||||||
|
box-shadow: 0 0 5px #eee;
|
||||||
|
}
|
||||||
.safe-bottom{
|
.safe-bottom{
|
||||||
padding-bottom: env(safe-area-inset-bottom);
|
padding-bottom: env(safe-area-inset-bottom);
|
||||||
/* #ifdef H5 */
|
/* #ifdef H5 */
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,27 @@ const model = {
|
||||||
return appCache.shopId
|
return appCache.shopId
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 获取和放置useType就餐类型
|
||||||
|
useType: (val, isDelete = false) => {
|
||||||
|
if (isDelete) {
|
||||||
|
appCache.useType = ""
|
||||||
|
return uni.removeStorageSync('useType')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (val) {
|
||||||
|
// 有值,为放置
|
||||||
|
appCache.useType = val
|
||||||
|
uni.setStorageSync('useType', val)
|
||||||
|
} else {
|
||||||
|
// 否则为获取
|
||||||
|
|
||||||
|
if (!appCache.useType) {
|
||||||
|
//缓存取不到,获取应用本地信息
|
||||||
|
appCache.useType = uni.getStorageSync('useType')
|
||||||
|
}
|
||||||
|
return appCache.useType
|
||||||
|
}
|
||||||
|
},
|
||||||
// 已经登录的用户记录
|
// 已经登录的用户记录
|
||||||
loggedInUser: (addUserName = null, removeUserName = null) => {
|
loggedInUser: (addUserName = null, removeUserName = null) => {
|
||||||
let key = "loggedInUserList"
|
let key = "loggedInUserList"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue