carCountLogic.js
743 Bytes
import {observable} from 'mobx'
import {
_cartCount
} from "../integralMall/utils/AppService";
import {systemSite} from "../../index";
import {AsyncStorage} from 'react-native'
import { xnToast } from '../../utils/utils';
class carCountLogic{
@observable
count=0
async get(){
try{
console.log(9999999999999);
const data=await _cartCount({
storeId:systemSite.storeId,
operatingUnitId:systemSite.operatingUnitId,
})
const {errors, firstErrorMessage,totalQuantity} = data
if (errors.length > 0) {
xnToast(firstErrorMessage)
} else {
this.count=totalQuantity
console.log(this.count)
}
}catch(e){
console.log(e)
}
}
}
export default new carCountLogic()