add
This commit is contained in:
@ -65,7 +65,7 @@ export default {
|
||||
this.$emit("input", false);
|
||||
},
|
||||
goAddressPages: function() {
|
||||
this.$yrouter.push({ path: "/pages/user/address/AddAddress/main" });
|
||||
this.$yrouter.push({ path: "/pages/user/address/AddAddress/index" });
|
||||
this.$emit("redirect");
|
||||
},
|
||||
tapAddress: function(index) {
|
||||
|
@ -31,25 +31,25 @@ export default {
|
||||
name: "首页",
|
||||
icon1: "icon-shouye-xianxing",
|
||||
icon2: "icon-shouye",
|
||||
url: "/pages/home/main"
|
||||
url: "/pages/home/index"
|
||||
},
|
||||
{
|
||||
name: "分类",
|
||||
icon1: "icon-yingyongchengxu-xianxing",
|
||||
icon2: "icon-yingyongchengxu",
|
||||
url: "/pages/shop/GoodsClass/main"
|
||||
url: "/pages/shop/GoodsClass/index"
|
||||
},
|
||||
{
|
||||
name: "购物车",
|
||||
icon1: "icon-caigou-xianxing",
|
||||
icon2: "icon-caigou",
|
||||
url: "/pages/shop/ShoppingCart/main"
|
||||
url: "/pages/shop/ShoppingCart/index"
|
||||
},
|
||||
{
|
||||
name: "我的",
|
||||
icon1: "icon-yonghu-xianxing",
|
||||
icon2: "icon-yonghu",
|
||||
url: "/pages/user/User/main"
|
||||
url: "/pages/user/User/index"
|
||||
}
|
||||
],
|
||||
isIpx: false
|
||||
|
@ -1,36 +1,28 @@
|
||||
<template>
|
||||
<div class="goodList">
|
||||
<div
|
||||
@click="$yrouter.push({ path: '/pages/shop/GoodsCon/index',query:{id:item.id} })"
|
||||
class="item acea-row row-between-wrapper"
|
||||
v-for="(item, goodlistIndex) in goodList"
|
||||
:key="goodlistIndex"
|
||||
>
|
||||
<div class="pictrue">
|
||||
<img :src="item.image" class="image" />
|
||||
<img :src="$VUE_APP_RESOURCES_URL+'/images/one.png'" class="numPic" v-if="isSort === true && index === 0" />
|
||||
<img :src="$VUE_APP_RESOURCES_URL+'/images/two.png'" class="numPic" v-if="isSort === true && index === 1" />
|
||||
<img :src="$VUE_APP_RESOURCES_URL+'/images/three.png'" class="numPic" v-if="isSort === true && index === 2" />
|
||||
</div>
|
||||
<div class="underline">
|
||||
<div class="text">
|
||||
<div class="line1">{{ item.storeName }}</div>
|
||||
<div class="money font-color-red">
|
||||
¥
|
||||
<span class="num">{{ item.price }}</span>
|
||||
</div>
|
||||
<div class="vip-money acea-row row-middle">
|
||||
<div class="vip">
|
||||
¥{{ item.otPrice || 0
|
||||
}}
|
||||
</div>
|
||||
<span class="num">已售{{ item.sales }}{{ item.unitName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="iconfont icon-gouwuche cart-color acea-row row-center-wrapper"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="goodList">
|
||||
<div @click="routerGo(item)" class="item acea-row row-between-wrapper" v-for="(item, goodlistIndex) in goodList" :key="goodlistIndex">
|
||||
<div class="pictrue">
|
||||
<img :src="item.image" class="image" />
|
||||
<img :src="$VUE_APP_RESOURCES_URL + '/images/one.png'" class="numPic" v-if="isSort === true && index === 0" />
|
||||
<img :src="$VUE_APP_RESOURCES_URL + '/images/two.png'" class="numPic" v-if="isSort === true && index === 1" />
|
||||
<img :src="$VUE_APP_RESOURCES_URL + '/images/three.png'" class="numPic" v-if="isSort === true && index === 2" />
|
||||
</div>
|
||||
<div class="underline">
|
||||
<div class="text">
|
||||
<div class="line1">{{ item.storeName }}</div>
|
||||
<div class="money font-color-red">
|
||||
¥
|
||||
<span class="num">{{ item.price }}</span>
|
||||
</div>
|
||||
<div class="vip-money acea-row row-middle">
|
||||
<div class="vip">¥{{ item.otPrice || 0 }}</div>
|
||||
<span class="num">已售{{ item.sales }}{{ item.unitName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="iconfont icon-gouwuche cart-color acea-row row-center-wrapper"></div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
@ -47,6 +39,11 @@ export default {
|
||||
},
|
||||
data: function() {
|
||||
return {};
|
||||
},
|
||||
methods:{
|
||||
routerGo(item) {
|
||||
this.$yrouter.push({ path: '/pages/shop/GoodsCon/index', query: { id: item.id } });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
@ -1,69 +1,62 @@
|
||||
<template>
|
||||
<div
|
||||
class="home"
|
||||
:style="{ top: top + 'px' }"
|
||||
style="position:fixed;"
|
||||
id="right-nav"
|
||||
@touchmove="touchmove($event)"
|
||||
>
|
||||
<div class="homeCon bg-color-red1" :class="homeActive === true ? 'on' : ''">
|
||||
<div
|
||||
@click="$yrouter.switchTab('/pages/home/index')"
|
||||
class="iconfont icon-shouye-xianxing "
|
||||
style="color: green;"
|
||||
></div>
|
||||
<div
|
||||
@click="$yrouter.switchTab('/pages/shop/ShoppingCart/index')"
|
||||
class="iconfont icon-caigou-xianxing"
|
||||
style="color: green;"
|
||||
></div>
|
||||
<!--<div @click="$yrouter.push('/pages/user/User/index'" class="iconfont icon-yonghu1"></div>-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="home" :style="{ top: top + 'px' }" style="position:fixed;" id="right-nav" @touchmove="touchmove($event)">
|
||||
<div class="homeCon bg-color-red1" :class="homeActive === true ? 'on' : ''">
|
||||
<div @click="homeGo()" class="iconfont icon-shouye-xianxing " style="color: green;"></div>
|
||||
<div @click="shoppingCartGo()" class="iconfont icon-caigou-xianxing" style="color: green;"></div>
|
||||
<!--<div @click="userGo()" class="iconfont icon-yonghu1"></div>-->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters } from "vuex";
|
||||
import { mapGetters } from 'vuex';
|
||||
export default {
|
||||
name: "Home",
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
top: "",
|
||||
homeActive: true
|
||||
};
|
||||
},
|
||||
computed: mapGetters(["homeActive"]),
|
||||
methods: {
|
||||
touchmove(event) {
|
||||
// event.preventDefault();
|
||||
// let top =
|
||||
// event.touches[0].pageY -
|
||||
// (document.documentElement.scrollTop || document.body.scrollTop) -
|
||||
// this.$el.clientHeight;
|
||||
name: 'Home',
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
top: '',
|
||||
homeActive: true
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['homeActive']),
|
||||
methods: {
|
||||
userGo() {
|
||||
this.$yrouter.push('/pages/user/User/index');
|
||||
},
|
||||
homeGo() {
|
||||
this.$yrouter.switchTab('/pages/home/index');
|
||||
},
|
||||
shoppingCartGo() {
|
||||
this.$yrouter.switchTab('/pages/shop/ShoppingCart/index');
|
||||
},
|
||||
touchmove(event) {
|
||||
// event.preventDefault();
|
||||
// let top =
|
||||
// event.touches[0].pageY -
|
||||
// (document.documentElement.scrollTop || document.body.scrollTop) -
|
||||
// this.$el.clientHeight;
|
||||
|
||||
// if (top > 390) top = 390;
|
||||
// else if (top < 55) top = 55;
|
||||
this.top = 55;
|
||||
},
|
||||
open: function() {
|
||||
this.homeActive
|
||||
? this.$store.commit("CLOSE_HOME")
|
||||
: this.$store.commit("OPEN_HOME");
|
||||
}
|
||||
}
|
||||
// if (top > 390) top = 390;
|
||||
// else if (top < 55) top = 55;
|
||||
this.top = 55;
|
||||
},
|
||||
open: function() {
|
||||
this.homeActive ? this.$store.commit('CLOSE_HOME') : this.$store.commit('OPEN_HOME');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.mystyl {
|
||||
display: inline-block;
|
||||
width: 0.64rem;
|
||||
height: 0.64rem;
|
||||
margin-top: 0.12rem;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #e1e1e1;
|
||||
border-radius: 50%;
|
||||
background-size: 1.24rem auto;
|
||||
background-repeat: no-repeat;
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
display: inline-block;
|
||||
width: 0.64rem;
|
||||
height: 0.64rem;
|
||||
margin-top: 0.12rem;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #e1e1e1;
|
||||
border-radius: 50%;
|
||||
background-size: 1.24rem auto;
|
||||
background-repeat: no-repeat;
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -18,8 +18,8 @@
|
||||
<div class="money font-color-red">¥{{ cart.truePrice }}</div>
|
||||
<div
|
||||
class="evaluate"
|
||||
v-if="evaluate == 3"
|
||||
@click="$yrouter.push({ path: '/pages/shop/GoodsEvaluate/index',query:{id:cart.unique} })"
|
||||
v-if="evaluate == 3"
|
||||
@click="routerGo(cart)"
|
||||
>评价</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -40,6 +40,10 @@ export default {
|
||||
return {};
|
||||
},
|
||||
mounted: function() {},
|
||||
methods: {}
|
||||
methods: {
|
||||
routerGo(item) {
|
||||
this.$yrouter.push({ path: '/pages/shop/GoodsEvaluate/index',query:{id:cart.unique} });
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,41 +1,37 @@
|
||||
<template>
|
||||
<div class="promotionGood" v-if="benefit.length > 0">
|
||||
<div
|
||||
@click="$yrouter.push({ path: '/pages/shop/GoodsCon/index',query:{id:item.id} })"
|
||||
class="item acea-row row-between-wrapper"
|
||||
v-for="(item, promotionGoodIndex) in benefit"
|
||||
:key="promotionGoodIndex"
|
||||
>
|
||||
<div class="pictrue">
|
||||
<img :src="item.image" class="image" />
|
||||
</div>
|
||||
<div class="text">
|
||||
<div class="name line1">{{ item.storeName }}</div>
|
||||
<div class="sp-money acea-row">
|
||||
<div class="moneyCon">
|
||||
促销价: ¥
|
||||
<span class="num">{{ item.price }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="acea-row row-between-wrapper">
|
||||
<div class="money">日常价:¥{{ item.otPrice }}</div>
|
||||
<div>仅剩:{{ item.stock }}{{ item.unitName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="promotionGood" v-if="benefit.length > 0">
|
||||
<div class="item acea-row row-between-wrapper" v-for="(item, promotionGoodIndex) in benefit" :key="promotionGoodIndex" @click="routerGo(item)">
|
||||
<div class="pictrue"><img :src="item.image" class="image" /></div>
|
||||
<div class="text">
|
||||
<div class="name line1">{{ item.storeName }}</div>
|
||||
<div class="sp-money acea-row">
|
||||
<div class="moneyCon">
|
||||
促销价: ¥
|
||||
<span class="num">{{ item.price }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="acea-row row-between-wrapper">
|
||||
<div class="money">日常价:¥{{ item.otPrice }}</div>
|
||||
<div>仅剩:{{ item.stock }}{{ item.unitName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "PromotionGood",
|
||||
props: {
|
||||
benefit: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data: function() {
|
||||
return {};
|
||||
}
|
||||
name: 'PromotionGood',
|
||||
props: ['benefit'],
|
||||
data: function() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
routerGo(item) {
|
||||
this.$yrouter.push({ path: '/pages/shop/GoodsCon/index', query: { id: item.id } });
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
console.log(this, 999);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
@ -1,69 +1,70 @@
|
||||
<template>
|
||||
<div class="recommend" ref="container">
|
||||
<div class="title acea-row row-center-wrapper">
|
||||
<span class="iconfont icon-zhuangshixian"></span>
|
||||
<span class="name">为你推荐</span>
|
||||
<span class="iconfont icon-zhuangshixian lefticon"></span>
|
||||
</div>
|
||||
<div class="recommendList acea-row row-between-wrapper">
|
||||
<div
|
||||
@click="$yrouter.push({ path: '/pages/shop/GoodsCon/index',query:{id:item.id} })"
|
||||
class="item"
|
||||
v-for="(item, recommendIndex) in hostProduct"
|
||||
:key="recommendIndex"
|
||||
>
|
||||
<div class="pictrue">
|
||||
<img :src="item.image" class="image" />
|
||||
</div>
|
||||
<div class="name line1">{{ item.storeName }}</div>
|
||||
<div class="money font-color-red">
|
||||
¥
|
||||
<span class="num">{{ item.price }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Loading :loaded="loadend" :loading="loading"></Loading>
|
||||
</div>
|
||||
<div class="recommend" ref="container">
|
||||
<div class="title acea-row row-center-wrapper">
|
||||
<span class="iconfont icon-zhuangshixian"></span>
|
||||
<span class="name">为你推荐</span>
|
||||
<span class="iconfont icon-zhuangshixian lefticon"></span>
|
||||
</div>
|
||||
<div class="recommendList acea-row row-between-wrapper">
|
||||
<div
|
||||
@click="routerGo(item)"
|
||||
class="item"
|
||||
v-for="(item, recommendIndex) in hostProduct"
|
||||
:key="recommendIndex"
|
||||
>
|
||||
<div class="pictrue"><img :src="item.image" class="image" /></div>
|
||||
<div class="name line1">{{ item.storeName }}</div>
|
||||
<div class="money font-color-red">
|
||||
¥
|
||||
<span class="num">{{ item.price }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Loading :loaded="loadend" :loading="loading"></Loading>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getHostProducts } from "@/api/store";
|
||||
import Loading from "@/components/Loading";
|
||||
import { getHostProducts } from '@/api/store';
|
||||
import Loading from '@/components/Loading';
|
||||
export default {
|
||||
name: "Recommend",
|
||||
props: {},
|
||||
components: {
|
||||
Loading
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
hostProduct: [],
|
||||
page: 1,
|
||||
limit: 20,
|
||||
loadTitle: "",
|
||||
loading: false,
|
||||
loadend: false
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.hostProducts();
|
||||
},
|
||||
methods: {
|
||||
hostProducts: function() {
|
||||
let that = this;
|
||||
if (that.loading) return; //阻止下次请求(false可以进行请求);
|
||||
if (that.loadend) return; //阻止结束当前请求(false可以进行请求);
|
||||
that.loading = true;
|
||||
getHostProducts(that.page, that.limit).then(res => {
|
||||
that.loading = false;
|
||||
//apply();js将一个数组插入另一个数组;
|
||||
that.hostProduct.push.apply(that.hostProduct, res.data);
|
||||
that.loadend = res.data.length < that.limit; //判断所有数据是否加载完成;
|
||||
that.page = that.page + 1;
|
||||
});
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loading && this.hostProducts();
|
||||
}
|
||||
name: 'Recommend',
|
||||
props: {},
|
||||
components: {
|
||||
Loading
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
hostProduct: [],
|
||||
page: 1,
|
||||
limit: 20,
|
||||
loadTitle: '',
|
||||
loading: false,
|
||||
loadend: false
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.hostProducts();
|
||||
},
|
||||
methods: {
|
||||
routerGo(item) {
|
||||
this.$yrouter.push({ path: '/pages/shop/GoodsCon/index', query: { id: item.id } });
|
||||
},
|
||||
hostProducts: function() {
|
||||
let that = this;
|
||||
if (that.loading) return; //阻止下次请求(false可以进行请求);
|
||||
if (that.loadend) return; //阻止结束当前请求(false可以进行请求);
|
||||
that.loading = true;
|
||||
getHostProducts(that.page, that.limit).then(res => {
|
||||
that.loading = false;
|
||||
//apply();js将一个数组插入另一个数组;
|
||||
that.hostProduct.push.apply(that.hostProduct, res.data);
|
||||
that.loadend = res.data.length < that.limit; //判断所有数据是否加载完成;
|
||||
that.page = that.page + 1;
|
||||
});
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loading && this.hostProducts();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
@ -119,24 +119,24 @@ export default {
|
||||
},
|
||||
switchH5() {
|
||||
let that = this;
|
||||
wx.showLoading({title: '正在切换中'})
|
||||
uni.showLoading({title: '正在切换中'})
|
||||
if (that.login_type === "h5") {
|
||||
cookie.set("loginType", "wechat", 60);
|
||||
wx.hideLoading()
|
||||
uni.hideLoading()
|
||||
this.$store.commit("LOGOUT");
|
||||
this.$emit("changeswitch", false);
|
||||
location.reload();
|
||||
} else {
|
||||
switchH5Login()
|
||||
.then(({ data }) => {
|
||||
wx.hideLoading()
|
||||
uni.hideLoading()
|
||||
const expires_time = dayjs(data.expires_time);
|
||||
store.commit("LOGIN", data.token, expires_time);
|
||||
this.$emit("changeswitch", false);
|
||||
location.reload();
|
||||
})
|
||||
.catch(err => {
|
||||
wx.hideLoading()
|
||||
uni.hideLoading()
|
||||
return that.$dialog.toast({ mes: err });
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user