pointShopLogic.js
833 Bytes
import {observable} from 'mobx'
import {_getPointItemList} from "../integralMall/utils/AppService";
import {AsyncStorage} from 'react-native'
import {systemSite} from "../../index";
import { xnToast } from '../../utils/utils';
export default class pointShopLogic{
@observable
list=[]
async get(v){
let option={
type:"POINT",
operatingUnitId:systemSite.operatingUnitId,
systemType:"POINT",
pageSize:0,
deviceType:'MOBILE'
}
if(!!v){
option.categoryIds=[v]
}
// debugger
console.log(option)
try{
const data=await _getPointItemList(option)
// debugger
const {errors, firstErrorMessage,result} = data
if (errors.length > 0) {
xnToast(firstErrorMessage)
} else {
this.list.replace(result)
console.log(this.list.length)
}
}catch(e){
console.log(e)
}
}
}