Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
data() {
return {
menuList: [],
categoryList: [],
categoryContent: [],
pageNum: 0,
type: ""
};
},
mixins: [dataMixin],
components: {
[NavBar.name]: NavBar,
[Tab.name]: Tab,
[Tabs.name]: Tabs,
[Toast.name]: Toast,
[Icon.name]: Icon
},
computed: {},
mounted() {
this.getMenuList();
// this.getCategoryList();
},
methods: {
async getMenuList() {
let res = await apiGetCategoryMenu();
this.menuList = res.data.data.slice(1);
console.log("menuList: ", this.menuList);
this.type = this.menuList[0].title;
this.getCategoryList();
},
],
uploadToken: {
token: ""
},
coverJoinUrl: "",
apiParams: {},
sex: "",
domain: ""
};
},
components: {
[NavBar.name]: NavBar,
[Cell.name]: Cell,
[CellGroup.name]: CellGroup,
[Actionsheet.name]: Actionsheet,
[Toast.name]: Toast
},
mounted() {
this.getUser();
},
methods: {
onRead(file) {
console.log(file);
this.$refs.avatar.src = file.content;
let data = new FormData();
data.append("token", this.uploadToken.token);
data.append("file", file.content);
const axiosInstance = axios.create({ withCredentials: false });
console.log("data: ", data);
axiosInstance({
method: "POST",
url: "http://upload.qiniu.com/", //上传地址
}
else{
const couponId = this.coupons[index].cid;
const userCouponId = this.coupons[index].id;
setLocalStorage({CouponId: couponId, UserCouponId: userCouponId});
}
this.init()
},
onExchange() {
this.$toast("兑换暂不支持");
}
},
components: {
[Toast.name]: Toast ,
[SubmitBar.name]: SubmitBar,
[Card.name]: Card,
[Field.name]: Field,
[Tag.name]: Tag,
[CouponCell.name]: CouponCell,
[CouponList.name]: CouponList,
[Popup.name]: Popup
}
};
};
},
data() {
return {
pageNum: 0,
bannerList: [],
productList: [],
isLoading: false
};
},
components: {
[NavBar.name]: NavBar,
[Swipe.name]: Swipe,
[SwipeItem.name]: SwipeItem,
[PullRefresh.name]: PullRefresh,
[Toast.name]: Toast,
[Icon.name]: Icon
},
mounted() {
this.getBannerList();
this.getProductData();
},
methods: {
async getProductData() {
let res = await apiGetProduct(this.pageNum, "热门");
this.productList = res.data.data;
this.isLoading = false;
},
onRefresh() {
this.pageNum = 0;
this.getProductData();
radioArr: [],
itemIndex: "",
cartsData: [],
checked: true,
showEdit: false
};
},
mixins: [dataMixin],
components: {
[NavBar.name]: NavBar,
[Checkbox.name]: Checkbox,
[CheckboxGroup.name]: CheckboxGroup,
[SubmitBar.name]: SubmitBar,
[Icon.name]: Icon,
[Dialog.name]: Dialog,
[Toast.name]: Toast
},
created() {
this.getCart();
},
mounted() {},
methods: {
async getCart() {
let res = await apiGetCart();
if (res.data.code == -1) {
this.title = this.$t("m.login.noLogin");
setTimeout(() => {
this.$refs.nopage.onDisplay();
this.$refs.nopage.onLogin();
}, 300);
return;
return {
havePage: false,
orderData: [],
type: "paying",
active: 0,
orderTab: [{ name: this.$t("m.order.paying") }, { name: this.$t("m.order.waitPack") }, { name: this.$t("m.order.done") }, { name: this.$t("m.order.all") }],
title: "",
showEdit: false
};
},
mixins: [dataMixin],
components: {
[NavBar.name]: NavBar,
[Tab.name]: Tab,
[Tabs.name]: Tabs,
[Toast.name]: Toast,
[Icon.name]: Icon,
[Tag.name]: Tag,
[Dialog.name]: Dialog
},
computed: {
...mapGetters(["this.$store.state.orderStatus"])
},
created() {
switch (this.$store.state.orderStatus) {
case "paying":
this.active = 0;
this.type = "paying";
break;
case "payed":
this.active = 1;
this.type = "payed";
state: "add"
};
},
computed: {
...mapGetters(["this.$store.state.addressStatus"])
},
components: {
[NavBar.name]: NavBar,
[Area.name]: Area,
[Field.name]: Field,
[Dialog.name]: Dialog,
[SwitchCell.name]: SwitchCell,
[Cell.name]: Cell,
[CellGroup.name]: CellGroup,
[Icon.name]: Icon,
[Toast.name]: Toast
},
created() {
this.areaList = areaList;
if (this.$route.query.state == "edit") {
let data = this.$route.query.item;
this.addressInfo = data;
this.title = this.$t("editAddressTitle");
this.state = "edit";
}
},
mounted() {},
methods: {
onAddress() {
this.showArea = !this.showArea;
},
productId: [],
addressData: [],
orderData: [],
addressInfo: {}
};
},
components: {
[NavBar.name]: NavBar,
[Dialog.name]: Dialog,
[Popup.name]: Popup,
[Card.name]: Card,
[SubmitBar.name]: SubmitBar,
[Cell.name]: Cell,
[CellGroup.name]: CellGroup,
[ContactList.name]: ContactList,
[Toast.name]: Toast
},
computed: {
cardType() {
return this.chosenContactId !== null ? "edit" : "add";
},
currentContact() {
const id = this.chosenContactId;
return id !== null ? this.list.filter(item => item.id === id)[0] : {};
},
...mapGetters(["this.$store.state.orders", "this.$store.state.address", "this.$store.state.addressStatus"])
},
created() {},
mounted() {
this.getAddress();
if (this.$route.query.status == "todo") {
query: { itemClass: categoryId }
});
});
},
initViews() {
getHome().then(res => {
this.shopInfos = res.data.data;
});
}
},
components: {
[Row.name]: Row,
[Col.name]: Col,
[Card.name]: Card,
[Toast.name]: Toast,
[CouponCell.name]: CouponCell,
[CouponList.name]: CouponList,
[Search.name]: Search,
[Panel.name]: Panel,
[List.name]: List,
[Swipe.name]: Swipe,
[SwipeItem.name]: SwipeItem,
[Tabbar.name]: Tabbar,
[TabbarItem.name]: TabbarItem,
[Tag.name]: Tag,
[Grid.name]: Grid,
[GridItem.name]: GridItem
}
};
content: this.$t("m.meta.login.content")
}
]
};
},
data() {
return {
userAccount: "guest",
userPasswd: "guest"
};
},
components: {
[NavBar.name]: NavBar,
[Cell.name]: Cell,
[CellGroup.name]: CellGroup,
[Toast.name]: Toast,
[Button.name]: Button,
[Field.name]: Field
},
mounted() {},
methods: {
async onLogin() {
const userAccountEmpty = strategies.isNonEmpty(this.userAccount, this.$t("m.strategies.name"));
const userPasswdLength = strategies.isNonEmpty(this.userPasswd, 4, this.$t("m.strategies.pwdLenth"));
const result = userAccountEmpty || userPasswdLength;
if (result) {
Toast({
message: result,
position: "bottom"
});
} else {
let res = await apiLogin(this.userAccount, this.userPasswd);