Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { Icon } from 'vant';
import { mapMutations} from "vuex";
import CarHeader from '../../common/header';
export default{
data(){
return{
checkedAll:true
}
},
components:{
[Checkbox.name]:Checkbox,
[CheckboxGroup.name]:CheckboxGroup,
[Card.name]:Card,
[Stepper.name]:Stepper,
[SubmitBar.name]:SubmitBar,
[Icon.name]:Icon,
CarHeader
},
computed:{
...mapState([
"carts"
])
},
created(){
console.log(this.carts);
},
methods:{
...mapMutations(["shanchu"]),
toggleCheckedAll(){
this.checkedAll= !this.checkedAll;
if(!this.checkedAll){
this.carts.forEach((item)=>{
title: this.$t("addAddressTitle"),
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;
goodsRadioAll: false,
allCoach: 0,
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();
},
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();
},
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";
break;
icon: 'closed-eye',
toggleMsg: '验证码登录'
}
}
return {
icon: 'eye',
toggleMsg: '密码登录'
}
},
passwordIcon: function () {
return this.passwordType === 'password' ? 'closed-eye' : 'eye'
}
},
components: {
[Field.name]: Field,
[Icon.name]: Icon,
[Button.name]: Button,
VerifyCodeBtn
}
}
<style lang="scss"></style>