修改html标签为uni标签,修改rem单位为rpx,修改提示及确认为uniapi,修改登录模块为uni接口,修改css入口为APP.vue,增加app端样式支持

This commit is contained in:
gaoxs
2020-03-16 15:51:08 +08:00
parent fa289d66a8
commit 95845779db
422 changed files with 34024 additions and 32630 deletions

View File

@ -1,36 +1,36 @@
<template>
<div class="evaluate-list" ref="container">
<div class="header">
<div class="generalComment acea-row row-between-wrapper">
<div class="acea-row row-middle font-color-red">
<div class="evaluate">评分</div>
<div class="start" :class="'star' + replyData.replyStar"></div>
</div>
<div>
<span class="font-color-red">{{ replyData.replyChance || 0 }}%</span
>好评率
</div>
</div>
<div class="nav acea-row row-middle">
<div
<view class="evaluate-list" ref="container">
<view class="header">
<view class="generalComment acea-row row-between-wrapper">
<view class="acea-row row-middle font-color-red">
<text class="evaluate">评分</text>
<view class="start" :class="'star' + replyData.replyStar"></view>
</view>
<view>
<text class="font-color-red">{{ replyData.replyChance || 0 }}%</text>
<text>好评率</text>
</view>
</view>
<view class="nav acea-row row-middle">
<view
class="acea-row row-center-wrapper"
v-for="(item, navListIndex) in navList"
:key="navListIndex"
@click="changeType(navListIndex)"
>
<div
<view
class="item"
:class="currentActive === navListIndex ? 'bg-color-red' : ''"
v-if="item.num"
>
{{ item.evaluate }}({{ item.num }})
</div>
</div>
</div>
</div>
>
<text>{{ item.evaluate }}({{ item.num }})</text>
</view>
</view>
</view>
</view>
<UserEvaluation :reply="reply"></UserEvaluation>
<Loading :loaded="loadend" :loading="loading"></Loading>
</div>
</view>
</template>
<script>
import UserEvaluation from "@/components/UserEvaluation";

View File

@ -1,35 +1,35 @@
<template>
<div>
<div class="searchGood">
<div class="search acea-row row-between-wrapper">
<div class="input acea-row row-between-wrapper">
<span class="iconfont icon-sousuo2"></span>
<view>
<view class="searchGood">
<view class="search acea-row row-between-wrapper">
<view class="input acea-row row-between-wrapper">
<text class="iconfont icon-sousuo2"></text>
<!-- <form @submit.prevent="submit"></form> -->
<input type="text" placeholder="点击搜索商品" v-model="search" />
</div>
<div class="bnt" @click="submit">搜索</div>
</div>
<div v-if="keywords.length">
<div class="title">热门搜索</div>
<div class="list acea-row">
<div
</view>
<view class="bnt" @click="submit">搜索</view>
</view>
<view v-if="keywords.length">
<view class="title">热门搜索</view>
<view class="list acea-row">
<view
class="item"
v-for="keywordsKey of keywords"
:key="keywordsKey"
@click="toSearch(keywordsKey)"
>{{ keywordsKey }}</div>
</div>
</div>
<div class="line"></div>
>{{ keywordsKey }}</view>
</view>
</view>
<view class="line"></view>
<!-- <GoodList></GoodList>-->
</div>
<!--<div class="noCommodity">-->
<!--<div class="noPictrue">-->
<!--<img :src="$VUE_APP_RESOURCES_URL+'/images/noSearch.png'" class="image" />-->
<!--</div>-->
</view>
<!--<view class="noCommodity">-->
<!--<view class="noPictrue">-->
<!--<image :src="$VUE_APP_RESOURCES_URL+'/images/noSearch.png'" class="image" />-->
<!--</view>-->
<!--<recommend></recommend>-->
<!--</div>-->
</div>
<!--</view>-->
</view>
</template>
<script>
// import GoodList from "@/components/GoodList";

View File

@ -1,50 +1,50 @@
<template>
<div class="productSort">
<view class="productSort">
<form @submit.prevent="submitForm">
<div class="header acea-row row-center-wrapper" ref="header">
<div class="acea-row row-between-wrapper input">
<span class="iconfont icon-sousuo"></span>
<view class="header acea-row row-center-wrapper" ref="header">
<view class="acea-row row-between-wrapper input">
<text class="iconfont icon-sousuo"></text>
<input type="text" placeholder="搜索商品信息" v-model="search" />
</div>
</div>
</view>
</view>
</form>
<div class="aside">
<div
<view class="aside">
<view
class="item acea-row row-center-wrapper"
:class="categoryDivindex === navActive ? 'on' : ''"
v-for="(item, categoryDivindex) in category"
:key="categoryDivindex"
@click="asideTap(categoryDivindex)"
>
<span>{{ item.cateName }}</span>
</div>
</div>
<div class="conter">
<div class="listw" v-for="(item, eq) in category" :key="eq">
<div v-if="eq === navActive">
<div class="title acea-row row-center-wrapper" ref="title">
<div class="line"></div>
<div class="name">{{ item.cateName }}</div>
<div class="line"></div>
</div>
<div class="list acea-row">
<div
<text>{{ item.cateName }}</text>
</view>
</view>
<view class="conter">
<view class="listw" v-for="(item, eq) in category" :key="eq">
<view v-if="eq === navActive">
<view class="title acea-row row-center-wrapper" ref="title">
<view class="line"></view>
<view class="name">{{ item.cateName }}</view>
<view class="line"></view>
</view>
<view class="list acea-row">
<view
class="item acea-row row-column row-middle"
v-for="(child, categoryIndex) in item.children"
:key="categoryIndex"
@click="goGoodsList(child)"
>
<div class="picture">
<img :src="child.pic" />
</div>
<div class="name line1">{{ child.cateName }}</div>
</div>
</div>
</div>
</div>
</div>
<div style="height:100rpx;"></div>
</div>
<view class="picture">
<image :src="child.pic" />
</view>
<view class="name line1">{{ child.cateName }}</view>
</view>
</view>
</view>
</view>
</view>
<view style="height:100rpx;"></view>
</view>
</template>
<script>
import debounce from "lodash.debounce";

View File

@ -1,36 +1,36 @@
<template>
<div ref="container">
<div class="collectionGoods" v-if="collectProductList.length > 0">
<div
<view ref="container">
<view class="collectionGoods" v-if="collectProductList.length > 0">
<view
class="item acea-row row-between-wrapper"
v-for="(item, collectProductListIndex) in collectProductList"
:key="collectProductListIndex"
@click="goGoodsCon(item)"
>
<div class="pictrue">
<img :src="item.image" />
</div>
<div class="text acea-row row-column-between">
<div class="infor line1">{{ item.storeName }}</div>
<div class="acea-row row-between-wrapper">
<div class="money font-color-red">¥{{ item.price }}</div>
<div class="delete" @click.prevent="delCollection(collectProductListIndex)">删除</div>
</div>
</div>
</div>
</div>
<view class="pictrue">
<image :src="item.image" />
</view>
<view class="text acea-row row-column-between">
<view class="infor line1">{{ item.storeName }}</view>
<view class="acea-row row-between-wrapper">
<view class="money font-color-red">¥{{ item.price }}</view>
<view class="delete" @click.prevent="delCollection(collectProductListIndex)">删除</view>
</view>
</view>
</view>
</view>
<Loading :loaded="loadend" :loading="loading"></Loading>
<div
<view
class="noCommodity"
style="background-color:#fff;"
v-if="collectProductList.length < 1 && page > 1"
>
<div class="noPictrue">
<img :src="$VUE_APP_RESOURCES_URL+'/images/noCollection.png'" class="image" />
</div>
<view class="noPictrue">
<image :src="$VUE_APP_RESOURCES_URL+'/images/noCollection.png'" class="image" />
</view>
<Recommend></Recommend>
</div>
</div>
</view>
</view>
</template>
<script>
import Recommend from "@/components/Recommend";
@ -85,9 +85,11 @@ export default {
id = that.collectProductList[index].pid,
category = that.collectProductList[index].category;
getCollectDel(id, category).then(function() {
that.$dialog.toast({
mes: "删除收藏成功!",
callback: () => {
uni.showToast({
title: "添加购物车成功",
icon: "success",
duration: 2000,
complete: () => {
that.collectProductList.splice(index, 1);
that.$set(that, "collectProductList", that.collectProductList);
}

View File

@ -1,138 +1,134 @@
<template>
<div :class="[posterImageStatus ? 'noscroll product-con' : 'product-con']">
<view :class="[posterImageStatus ? 'noscroll product-con' : 'product-con']">
<product-con-swiper :img-urls="storeInfo.sliderImageArr"></product-con-swiper>
<div class="wrapper">
<div class="share acea-row row-between row-bottom">
<div class="money font-color-red">
<span class="num">{{ storeInfo.price }}</span>
<span
<view class="wrapper">
<view class="share acea-row row-between row-bottom">
<view class="money font-color-red">
<text></text>
<text class="num">{{ storeInfo.price }}</text>
<text
class="vip-money"
v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0"
>¥{{ storeInfo.vipPrice }}</span>
<img
>¥{{ storeInfo.vipPrice }}</text>
<image
:src="$VUE_APP_RESOURCES_URL+'/images/vip.png'"
class="image"
v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0"
/>
</div>
<div class="iconfont icon-fenxiang" @click="listenerActionSheet"></div>
</div>
<div class="introduce">{{ storeInfo.storeName }}</div>
<div class="label acea-row row-between-wrapper">
<div>原价:¥{{ storeInfo.otPrice }}</div>
<div>库存:{{ storeInfo.stock }}{{ storeInfo.unitName }}</div>
<div>销量:{{ storeInfo.sales }}{{ storeInfo.unitName }}</div>
</div>
<div class="coupon acea-row row-between-wrapper" @click="couponTap" v-if="couponList.length">
<div class="hide line1 acea-row">
优惠券:
<div
</view>
<view class="iconfont icon-fenxiang" @click="listenerActionSheet"></view>
</view>
<view class="introduce">{{ storeInfo.storeName }}</view>
<view class="label acea-row row-between-wrapper">
<text>原价:¥{{ storeInfo.otPrice }}</text>
<text>库存:{{ storeInfo.stock }}{{ storeInfo.unitName }}</text>
<text>销量:{{ storeInfo.sales }}{{ storeInfo.unitName }}</text>
</view>
<view class="coupon acea-row row-between-wrapper" @click="couponTap" v-if="couponList.length">
<text class="hide line1 acea-row">
<text>优惠券:</text>
<text
class="activity"
v-for="(item, couponListEq) in couponList"
:key="couponListEq"
>满{{ item.use_min_price }}减{{ item.coupon_price }}</div>
</div>
<div class="iconfont icon-jiantou"></div>
</div>
</div>
<div class="attribute acea-row row-between-wrapper" @click="selecAttrTap">
<div>
{{ attrTxt }}
<span class="atterTxt">{{ attrValue }}</span>
</div>
<div class="iconfont icon-jiantou"></div>
</div>
<div class="store-info" v-if="system_store.id !== undefined">
<div class="title">门店信息</div>
<div class="info acea-row row-between-wrapper">
<div class="picTxt acea-row row-between-wrapper">
<div class="pictrue">
<img :src="system_store.image" />
</div>
<div class="text">
<div class="name line1">{{ system_store.name }}</div>
<div class="address acea-row row-middle" @click="showChang">
<span class="addressTxt line1">
{{
system_store._detailed_address
}}
</span>
<span class="iconfont icon-youjian"></span>
</div>
</div>
</div>
>满{{ item.use_min_price }}减{{ item.coupon_price }}</text>
</text>
<view class="iconfont icon-jiantou"></view>
</view>
</view>
<view class="attribute acea-row row-between-wrapper" @click="selecAttrTap">
<view>
<text>{{ attrTxt }}</text>
<text class="atterTxt">{{ attrValue }}</text>
</view>
<view class="iconfont icon-jiantou"></view>
</view>
<view class="store-info" v-if="system_store.id !== undefined">
<text class="title">门店信息</text>
<view class="info acea-row row-between-wrapper">
<view class="picTxt acea-row row-between-wrapper">
<view class="pictrue">
<image :src="system_store.image" />
</view>
<view class="text">
<view class="name line1">{{ system_store.name }}</view>
<view class="address acea-row row-middle" @click="showChang">
<text class="addressTxt line1">{{system_store._detailed_address}}</text>
<text class="iconfont icon-youjian"></text>
</view>
</view>
</view>
<!-- <a class="iconfont icon-dadianhua01 font-color-red" :href="'tel:' + system_store.phone"></a> -->
</div>
</div>
<div class="userEvaluation" v-if="replyCount">
<div class="title acea-row row-between-wrapper">
<div>用户评价({{ replyCount }})</div>
<div @click="goEvaluateList(id)" class="praise">
<span class="font-color-red">{{ replyChance }}%</span>好评率
<span class="iconfont icon-jiantou"></span>
</div>
</div>
</view>
</view>
<view class="userEvaluation" v-if="replyCount">
<view class="title acea-row row-between-wrapper">
<view>用户评价({{ replyCount }})</view>
<text @click="goEvaluateList(id)" class="praise">
<text class="font-color-red">{{ replyChance }}%</text>好评率
<text class="iconfont icon-jiantou"></text>
</text>
</view>
<user-evaluation :reply="reply"></user-evaluation>
</div>
<div class="superior">
<div class="title acea-row row-center-wrapper">
<img :src="$VUE_APP_RESOURCES_URL+'/images/ling.png'" />
<div class="titleTxt">优品推荐</div>
<img :src="$VUE_APP_RESOURCES_URL+'/images/ling.png'" />
</div>
</view>
<view class="superior">
<view class="title acea-row row-center-wrapper">
<image :src="$VUE_APP_RESOURCES_URL+'/images/ling.png'" />
<text class="titleTxt">优品推荐</text>
<image :src="$VUE_APP_RESOURCES_URL+'/images/ling.png'" />
</view>
<template>
<div class="slider-banner banner">
<view class="slider-banner banner">
<swiper :options="swiperRecommend" v-if="goodList.length > 0">
<swiper-slide v-for="(item, eq2) in goodList" :key="eq2">
<div class="list acea-row row-middle">
<div class="item" v-for="val in item.list" :key="val.image">
<div class="pictrue">
<img :src="val.image" />
</div>
<div class="name line1">{{ val.store_name }}}</div>
<div class="money font-color-red">¥{{ val.price }}</div>
</div>
</div>
<view class="list acea-row row-middle">
<view class="item" v-for="val in item.list" :key="val.image">
<view class="pictrue">
<image :src="val.image" />
</view>
<view class="name line1">{{ val.store_name }}}</view>
<view class="money font-color-red">¥{{ val.price }}</view>
</view>
</view>
</swiper-slide>
<div class="swiper-pagination" slot="pagination"></div>
<view class="swiper-pagination" slot="pagination"></view>
</swiper>
</div>
</view>
</template>
</div>
<div class="product-intro">
<div class="title">产品介绍</div>
<div class="conter" v-html="storeInfo.description"></div>
</div>
<div style="height:100rpx;"></div>
<div class="footer acea-row row-between-wrapper">
<!--<div class="item" @click="goCustomerList()">-->
<!--<div class="iconfont icon-kefu"></div>-->
<!--<div>客服</div>-->
<!--</div>-->
<div class="item" @click="setCollect">
<div class="iconfont" :class="storeInfo.userCollect ? 'icon-shoucang1' : 'icon-shoucang'"></div>
<div>收藏</div>
</div>
<div
</view>
<view class="product-intro">
<text class="title">产品介绍</text>
<view class="conter" v-html="storeInfo.description"></view>
</view>
<view style="height:100rpx;"></view>
<view class="footer acea-row row-between-wrapper">
<!--<view class="item" @click="goCustomerList()">-->
<!--<view class="iconfont icon-kefu"></view>-->
<!--<view>客服</view>-->
<!--</view>-->
<view class="item" @click="setCollect">
<view class="iconfont" :class="storeInfo.userCollect ? 'icon-shoucang1' : 'icon-shoucang'"></view>
<text>收藏</text>
</view>
<view
@click="goShoppingCart()"
class="item animated"
:class="animated === true ? 'bounceIn' : ''"
>
<div class="iconfont icon-gouwuche1">
<span class="num bg-color-red" v-if="CartCount > 0">
{{
CartCount
}}
</span>
</div>
<div>购物车</div>
</div>
<div class="bnt acea-row">
<div class="joinCart" @click="joinCart">加入购物车</div>
<div class="buy" @click="tapBuy">立即购买</div>
</div>
</div>
<view class="iconfont icon-gouwuche1">
<text class="num bg-color-red" v-if="CartCount > 0">{{CartCount}}</text>
</view>
<text>购物车</text>
</view>
<view class="bnt acea-row">
<view class="joinCart" @click="joinCart">
<text>加入购物车</text>
</view>
<view class="buy" @click="tapBuy">
<text>立即购买</text>
</view>
</view>
</view>
<CouponPop v-on:changeFun="changeFun" :coupon="coupon"></CouponPop>
<ProductWindow v-on:changeFun="changeFun" :attr="attr" :cartNum="cart_num"></ProductWindow>
<StorePoster
@ -141,18 +137,18 @@
:posterData="posterData"
></StorePoster>
<ShareInfo v-on:setShareInfoStatus="setShareInfoStatus" :shareInfoStatus="shareInfoStatus"></ShareInfo>
<div class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
<div class="item" v-if="weixinStatus === true" @click="setShareInfoStatus">
<div class="iconfont icon-weixin3"></div>
<div class>发送给朋友</div>
</div>
<div class="item" @click="setPosterImageStatus">
<div class="iconfont icon-haibao"></div>
<div class>生成海报</div>
</div>
</div>
<div class="mask" @touchmove.prevent @click="listenerActionClose" v-show="posters"></div>
<div class="geoPage" v-if="mapShow">
<view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
<view class="item" v-if="weixinStatus === true" @click="setShareInfoStatus">
<view class="iconfont icon-weixin3"></view>
<view class>发送给朋友</view>
</view>
<view class="item" @click="setPosterImageStatus">
<view class="iconfont icon-haibao"></view>
<view class>生成海报</view>
</view>
</view>
<view class="mask" @touchmove.prevent @click="listenerActionClose" v-show="posters"></view>
<view class="geoPage" v-if="mapShow">
<iframe
width="100%"
height="100%"
@ -160,8 +156,8 @@
scrolling="no"
:src="'https://apis.map.qq.com/uri/v1/geocoder?coord=' +system_store.latitude +',' +system_store.longitude +'&referer=' +mapKey"
></iframe>
</div>
</div>
</view>
</view>
</template>
<script>
@ -272,12 +268,16 @@ export default {
this.$yrouter.switchTab("/pages/shop/ShoppingCart/index");
},
goCustomerList() {
this.$yrouter.push({ path: "/pages/user/CustomerList/index" });
this.$yrouter.push({
path: "/pages/user/CustomerList/index"
});
},
goEvaluateList(id) {
this.$yrouter.push({
path: "/pages/shop/EvaluateList/index",
query: { id }
query: {
id
}
});
},
showChang: function() {
@ -297,10 +297,14 @@ export default {
// }
// });
} else {
if (!this.mapKey)
return this.$dialog.error(
"暂无法使用查看地图请配置您的腾讯地图key"
);
if (!this.mapKey) {
uni.showToast({
title: "暂无法使用查看地图请配置您的腾讯地图key",
icon: "none",
duration: 2000
});
return;
}
this.mapShow = true;
}
},
@ -350,7 +354,10 @@ export default {
let count = Math.ceil(good_list.length / 6);
for (let i = 0; i < count; i++) {
var list = good_list.slice(i * 6, 6);
if (list.length) goodArray.push({ list: list });
if (list.length)
goodArray.push({
list: list
});
}
that.mapKay = res.data.mapKay;
that.$set(that, "goodList", goodArray);
@ -476,7 +483,10 @@ export default {
//可领取优惠券接口;
coupons: function() {
let that = this,
q = { page: 1, limit: 20 };
q = {
page: 1,
limit: 20
};
getCoupon(q).then(res => {
that.$set(that, "couponList", res.data || []);
that.$set(that.coupon, "list", res.data);
@ -566,8 +576,14 @@ export default {
that.attr.productAttr.length &&
productSelect === undefined &&
that.isOpen === true
)
return that.$dialog.toast({ mes: "产品库存不足,请选择其它" });
) {
uni.showToast({
title: "产品库存不足,请选择其它",
icon: "none",
duration: 2000
});
return;
}
let q = {
productId: that.id,
cartNum: that.attr.productSelect.cart_num,
@ -584,12 +600,16 @@ export default {
if (news) {
that.$yrouter.push({
path: "/pages/order/OrderSubmission/index",
query: { id: res.data.cartId }
query: {
id: res.data.cartId
}
});
} else {
that.$dialog.toast({
mes: "添加购物车成功",
callback: () => {
uni.showToast({
title: "添加购物车成功",
icon: "success",
duration: 2000,
complete: () => {
that.getCartCount(true);
}
});
@ -609,7 +629,9 @@ export default {
let that = this;
const isLogin = that.isLogin;
if (isLogin) {
getCartCount({ numType: 0 }).then(res => {
getCartCount({
numType: 0
}).then(res => {
that.CartCount = res.data.count;
//加入购物车后重置属性
if (isAnima) {
@ -648,10 +670,12 @@ export default {
top: 0;
z-index: 10000;
}
.product-con .store-info {
margin-top: 0.2rem;
background-color: #fff;
}
.product-con .store-info .title {
padding: 0 0.3rem;
font-size: 0.28rem;
@ -660,56 +684,70 @@ export default {
line-height: 0.8rem;
border-bottom: 0.01rem solid #f5f5f5;
}
.product-con .store-info .info {
padding: 0 0.3rem;
height: 1.26rem;
}
.product-con .store-info .info .picTxt {
width: 6.15rem;
}
.product-con .store-info .info .picTxt .pictrue {
width: 0.76rem;
height: 0.76rem;
}
.product-con .store-info .info .picTxt .pictrue img {
.product-con .store-info .info .picTxt .pictrue image {
width: 100%;
height: 100%;
border-radius: 0.06rem;
}
.product-con .store-info .info .picTxt .text {
width: 5.22rem;
}
.product-con .store-info .info .picTxt .text .name {
font-size: 0.3rem;
color: #282828;
}
.product-con .store-info .info .picTxt .text .address {
font-size: 0.24rem;
color: #666;
margin-top: 0.03rem;
}
.product-con .store-info .info .picTxt .text .address .iconfont {
color: #707070;
font-size: 0.18rem;
margin-left: 0.1rem;
}
.product-con .store-info .info .picTxt .text .address .addressTxt {
width: 4.8rem;
}
.product-con .store-info .info .iconfont {
font-size: 0.4rem;
}
.product-con .superior {
background-color: #fff;
margin-top: 0.2rem;
}
.product-con .superior .title {
height: 0.98rem;
}
.product-con .superior .title img {
.product-con .superior .title image {
width: 0.3rem;
height: 0.3rem;
}
.product-con .superior .title .titleTxt {
margin: 0 0.2rem;
font-size: 0.3rem;
@ -719,39 +757,48 @@ export default {
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.product-con .superior .slider-banner {
width: 6.9rem;
margin: 0 auto;
padding-bottom: 0.2rem;
}
.product-con .superior .slider-banner .list {
width: 100%;
padding-bottom: 0.2rem;
}
.product-con .superior .slider-banner .list .item {
width: 2.15rem;
margin: 0 0.22rem 0.3rem 0;
font-size: 0.26rem;
}
.product-con .superior .slider-banner .list .item:nth-of-type(3n) {
margin-right: 0;
}
.product-con .superior .slider-banner .list .item .pictrue {
width: 100%;
height: 2.15rem;
}
.product-con .superior .slider-banner .list .item .pictrue img {
.product-con .superior .slider-banner .list .item .pictrue image {
width: 100%;
height: 100%;
border-radius: 0.06rem;
}
.product-con .superior .slider-banner .list .item .name {
color: #282828;
margin-top: 0.12rem;
}
.product-con .superior .slider-banner .swiper-pagination-bullet {
background-color: #999;
}
.product-con .superior .slider-banner .swiper-pagination-bullet-active {
background-color: #e93323;
}
@ -762,12 +809,15 @@ export default {
-ms-filter: blur(2px);
filter: blur(2px);
}
.footer .icon-shoucang1 {
color: #73cbb6;
}
.product-con .product-intro .conter div {
.product-con .product-intro .conter view {
width: 100% !important;
}
.generate-posters {
width: 100%;
height: 1.7rem;
@ -786,6 +836,7 @@ export default {
-moz-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
-o-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
}
.generate-posters.on {
transform: translate3d(0, 0, 0);
-webkit-transform: translate3d(0, 0, 0);
@ -793,19 +844,23 @@ export default {
-moz-transform: translate3d(0, 0, 0);
-o-transform: translate3d(0, 0, 0);
}
.generate-posters .item {
flex: 50%;
-webkit-flex: 50%;
-ms-flex: 50%;
text-align: center;
}
.generate-posters .item .iconfont {
font-size: 0.8rem;
color: #5eae72;
}
.generate-posters .item .iconfont.icon-haibao {
color: #5391f1;
}
.noscroll {
height: 100%;
overflow: hidden;

View File

@ -1,58 +1,42 @@
<template>
<div class="evaluate-con">
<div class="goodsStyle acea-row row-between" v-if="orderCon.productInfo">
<div class="pictrue">
<img :src="orderCon.productInfo.image" class="image" />
</div>
<div class="text acea-row row-between">
<div class="name line2">{{ orderCon.productInfo.storeName }}</div>
<div class="money">
<div>{{ orderCon.productInfo.price }}</div>
<div class="num">x{{ orderCon.cartNum }}</div>
</div>
</div>
</div>
<div class="score">
<div
class="item acea-row row-middle"
v-for="(item, scoreListIndexw) in scoreList"
:key="scoreListIndexw"
>
<div>{{ item.name }}</div>
<div class="starsList">
<span
@click="stars(starsIndexn, scoreListIndexw)"
v-for="(itemn, starsIndexn) in item.stars"
:key="starsIndexn"
class="iconfont"
:class="
<view class="evaluate-con">
<view class="goodsStyle acea-row row-between" v-if="orderCon.productInfo">
<view class="pictrue">
<image :src="orderCon.productInfo.image" class="image" />
</view>
<view class="text acea-row row-between">
<view class="name line2">{{ orderCon.productInfo.storeName }}</view>
<view class="money">
<view>¥{{ orderCon.productInfo.price }}</view>
<view class="num">x{{ orderCon.cartNum }}</view>
</view>
</view>
</view>
<view class="score">
<view class="item acea-row row-middle" v-for="(item, scoreListIndexw) in scoreList" :key="scoreListIndexw">
<view>{{ item.name }}</view>
<view class="starsList">
<text @click="stars(starsIndexn, scoreListIndexw)" v-for="(itemn, starsIndexn) in item.stars" :key="starsIndexn"
class="iconfont" :class="
item.index >= starsIndexn
? 'icon-shitixing font-color-red'
: 'icon-kongxinxing'
"
></span>
</div>
<span class="evaluate">
{{
"></text>
</view>
<text class="evaluate">
{{
item.index === -1 ? "" : item.index + 1 + "分"
}}
</span>
</div>
<div class="textarea">
<textarea placeholder="商品满足你的期待么?说说你的想法,分享给想买的他们吧~" v-model="expect"></textarea>
<div class="list acea-row row-middle">
<div
class="pictrue"
v-for="(item, uploadPicturesIndex) in uploadPictures"
:key="uploadPicturesIndex"
>
<img :src="item" />
<span
class="iconfont icon-guanbi1 font-color-red"
@click="uploadPictures.splice(uploadPicturesIndex, 1)"
></span>
</div>
<!-- <VueCoreImageUpload
</text>
</view>
<view class="textarea">
<textarea placeholder="商品满足你的期待么?说说你的想法,分享给想买的他们吧~" v-model="expect"></textarea>
<view class="list acea-row row-middle">
<view class="pictrue" v-for="(item, uploadPicturesIndex) in uploadPictures" :key="uploadPicturesIndex">
<image :src="item" />
<text class="iconfont icon-guanbi1 font-color-red" @click="uploadPictures.splice(uploadPicturesIndex, 1)"></text>
</view>
<!-- <VueCoreImageUpload
class="btn btn-primary"
:crop="false"
compress="80"
@ -65,142 +49,168 @@
:url="url"
v-if="uploadPictures.length < 8"
>
<div
<view
class="pictrue uploadBnt acea-row row-center-wrapper row-column"
>
<span class="iconfont icon-icon25201"></span>
<div>上传图片</div>
</div>
<text class="iconfont icon-icon25201"></text>
<view>上传图片</view>
</view>
</VueCoreImageUpload>-->
</div>
</div>
<div class="evaluateBnt bg-color-red" @click="submit">立即评价</div>
</div>
</div>
</view>
</view>
<view class="evaluateBnt bg-color-red" @click="submit">立即评价</view>
</view>
</view>
</template>
<style scoped>
.evaluate-con .score .textarea .list .pictrue.uploadBnt {
border: 1px solid #ddd;
}
.evaluate-con .score .textarea .list .pictrue.uploadBnt {
border: 1px solid #ddd;
}
</style>
<script>
import { postOrderProduct, postOrderComment } from "@/api/store";
import { trim } from "@/utils";
import { VUE_APP_API_URL } from "@/config";
import { required } from "@/utils/validate";
import { validatorDefaultCatch } from "@/utils/dialog";
import {
postOrderProduct,
postOrderComment
} from "@/api/store";
import {
trim
} from "@/utils";
import {
VUE_APP_API_URL
} from "@/config";
import {
required
} from "@/utils/validate";
import {
validatorDefaultCatch
} from "@/utils/dialog";
const NAME = "GoodsEvaluate";
const NAME = "GoodsEvaluate";
export default {
name: NAME,
components: {
// VueCoreImageUpload
},
props: {},
data: function() {
return {
orderCon: {
cartProduct: {
productInfo: {}
}
},
scoreList: [
{
name: "商品质量",
stars: ["", "", "", "", ""],
index: -1
},
{
name: "服务态度",
stars: ["", "", "", "", ""],
index: -1
}
],
url: `${VUE_APP_API_URL}/api/qiNiuContent`,
headers: {
Authorization: "Bearer " + this.$store.state.token
},
uploadPictures: [],
expect: "",
unique: ""
};
},
mounted: function() {
this.unique = this.$yroute.query.id;
this.getOrderProduct();
},
watch: {
$yroute(n) {
if (n.name === NAME && this.unique !== n.params.id) {
this.unique = n.params.id;
this.$set(this.scoreList[0], "index", -1);
this.$set(this.scoreList[1], "index", -1);
this.expect = "";
this.uploadPictures = [];
this.getOrderProduct();
}
}
},
methods: {
getOrderProduct: function() {
let that = this,
unique = that.unique;
postOrderProduct(unique).then(res => {
that.orderCon = res.data;
});
},
stars: function(indexn, indexw) {
this.scoreList[indexw].index = indexn;
},
imageuploaded(res) {
if (res.errno !== 0) return this.$dialog.error(res.msg || "上传图片失败");
this.uploadPictures.push(res.data[0]);
},
async submit() {
const expect = trim(this.expect),
product_score =
this.scoreList[0].index + 1 === 0 ? "" : this.scoreList[0].index + 1,
service_score =
this.scoreList[1].index + 1 === 0 ? "" : this.scoreList[1].index + 1;
try {
await this.$validator({
product_score: [
required("请选择商品质量分数", {
type: "number"
})
],
service_score: [
required("请选择服务态度分数", {
type: "number"
})
]
}).validate({ product_score, service_score });
} catch (e) {
return validatorDefaultCatch(e);
}
postOrderComment({
productScore: product_score,
serviceScore: service_score,
unique: this.unique,
pics: this.uploadPictures.join(","),
comment: expect
})
.then(() => {
uni.showToast({
title: "评价成功",
icon: "success",
duration: 2000
});
this.$yrouter.push({
path: "/pages/order/OrderDetails/index",
query: { id: this.orderCon.orderId }
});
})
.catch(res => {
this.$dialog.error(res.msg);
});
}
}
};
</script>
export default {
name: NAME,
components: {
// VueCoreImageUpload
},
props: {},
data: function() {
return {
orderCon: {
cartProduct: {
productInfo: {}
}
},
scoreList: [{
name: "商品质量",
stars: ["", "", "", "", ""],
index: -1
},
{
name: "服务态度",
stars: ["", "", "", "", ""],
index: -1
}
],
url: `${VUE_APP_API_URL}/api/qiNiuContent`,
headers: {
Authorization: "Bearer " + this.$store.state.token
},
uploadPictures: [],
expect: "",
unique: ""
};
},
mounted: function() {
this.unique = this.$yroute.query.id;
this.getOrderProduct();
},
watch: {
$yroute(n) {
if (n.name === NAME && this.unique !== n.params.id) {
this.unique = n.params.id;
this.$set(this.scoreList[0], "index", -1);
this.$set(this.scoreList[1], "index", -1);
this.expect = "";
this.uploadPictures = [];
this.getOrderProduct();
}
}
},
methods: {
getOrderProduct: function() {
let that = this,
unique = that.unique;
postOrderProduct(unique).then(res => {
that.orderCon = res.data;
});
},
stars: function(indexn, indexw) {
this.scoreList[indexw].index = indexn;
},
imageuploaded(res) {
if (res.errno !== 0) {
uni.showToast({
title: res.msg || "上传图片失败",
icon: 'none',
duration: 2000
});
return
}
this.uploadPictures.push(res.data[0]);
},
async submit() {
const expect = trim(this.expect),
product_score =
this.scoreList[0].index + 1 === 0 ? "" : this.scoreList[0].index + 1,
service_score =
this.scoreList[1].index + 1 === 0 ? "" : this.scoreList[1].index + 1;
try {
await this.$validator({
product_score: [
required("请选择商品质量分数", {
type: "number"
})
],
service_score: [
required("请选择服务态度分数", {
type: "number"
})
]
}).validate({
product_score,
service_score
});
} catch (e) {
return validatorDefaultCatch(e);
}
postOrderComment({
productScore: product_score,
serviceScore: service_score,
unique: this.unique,
pics: this.uploadPictures.join(","),
comment: expect
})
.then(() => {
uni.showToast({
title: "评价成功",
icon: "success",
duration: 2000
});
this.$yrouter.push({
path: "/pages/order/OrderDetails/index",
query: {
id: this.orderCon.orderId
}
});
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg,
icon: 'none',
duration: 2000
});
});
}
}
};
</script>

View File

@ -1,45 +1,45 @@
<template>
<div class="productList" ref="container">
<view class="productList" ref="container">
<form @submit.prevent="submitForm">
<div class="search bg-color-red acea-row row-between-wrapper">
<div class="input acea-row row-between-wrapper">
<span class="iconfont icon-sousuo"></span>
<view class="search bg-color-red acea-row row-between-wrapper">
<view class="input acea-row row-between-wrapper">
<text class="iconfont icon-sousuo"></text>
<input placeholder="搜索商品信息" v-model="where.keyword" />
</div>
<div
</view>
<view
class="iconfont"
:class="Switch === true ? 'icon-pailie' : 'icon-tupianpailie'"
@click="switchTap"
></div>
</div>
></view>
</view>
</form>
<div class="nav acea-row row-middle">
<div
<view class="nav acea-row row-middle">
<view
class="item"
:class="title ? 'font-color-red' : ''"
@click="set_where(0)"
>{{ title ? title : "默认" }}</div>
<div class="item" @click="set_where(1)">
>{{ title ? title : "默认" }}</view>
<view class="item" @click="set_where(1)">
价格
<img :src="$VUE_APP_RESOURCES_URL+'/images/horn.png'" v-if="price === 0" />
<img :src="$VUE_APP_RESOURCES_URL+'/images/up.png'" v-if="price === 1" />
<img :src="$VUE_APP_RESOURCES_URL+'/images/down.png'" v-if="price === 2" />
</div>
<div class="item" @click="set_where(2)">
<image :src="$VUE_APP_RESOURCES_URL+'/images/horn.png'" v-if="price === 0" />
<image :src="$VUE_APP_RESOURCES_URL+'/images/up.png'" v-if="price === 1" />
<image :src="$VUE_APP_RESOURCES_URL+'/images/down.png'" v-if="price === 2" />
</view>
<view class="item" @click="set_where(2)">
销量
<img :src="$VUE_APP_RESOURCES_URL+'/images/horn.png'" v-if="stock === 0" />
<img :src="$VUE_APP_RESOURCES_URL+'/images/up.png'" v-if="stock === 1" />
<img :src="$VUE_APP_RESOURCES_URL+'/images/down.png'" v-if="stock === 2" />
</div>
<image :src="$VUE_APP_RESOURCES_URL+'/images/horn.png'" v-if="stock === 0" />
<image :src="$VUE_APP_RESOURCES_URL+'/images/up.png'" v-if="stock === 1" />
<image :src="$VUE_APP_RESOURCES_URL+'/images/down.png'" v-if="stock === 2" />
</view>
<!-- down -->
<div class="item" :class="nows ? 'font-color-red' : ''" @click="set_where(3)">新品</div>
</div>
<div
<view class="item" :class="nows ? 'font-color-red' : ''" @click="set_where(3)">新品</view>
</view>
<view
class="list acea-row row-between-wrapper"
:class="Switch === true ? '' : 'on'"
ref="container"
>
<div
<view
@click="goGoodsCon(item)"
class="item"
:class="Switch === true ? '' : 'on'"
@ -47,34 +47,34 @@
:key="productListIndex"
:title="item.storeName"
>
<div class="pictrue" :class="Switch === true ? '' : 'on'">
<img :src="item.image" :class="Switch === true ? '' : 'on'" />
</div>
<div class="text" :class="Switch === true ? '' : 'on'">
<div class="name line1">{{ item.storeName }}</div>
<div class="money font-color-red" :class="Switch === true ? '' : 'on'">
<view class="pictrue" :class="Switch === true ? '' : 'on'">
<image :src="item.image" :class="Switch === true ? '' : 'on'" />
</view>
<view class="text" :class="Switch === true ? '' : 'on'">
<view class="name line1">{{ item.storeName }}</view>
<view class="money font-color-red" :class="Switch === true ? '' : 'on'">
<span class="num">{{ item.price }}</span>
</div>
<div class="vip acea-row row-between-wrapper" :class="Switch === true ? '' : 'on'">
<div class="vip-money">¥{{ item.otPrice }}</div>
<div>已售{{ item.sales }}件</div>
</div>
</div>
</div>
</div>
<text class="num">{{ item.price }}</text>
</view>
<view class="vip acea-row row-between-wrapper" :class="Switch === true ? '' : 'on'">
<view class="vip-money">¥{{ item.otPrice }}</view>
<view>已售{{ item.sales }}件</view>
</view>
</view>
</view>
</view>
<Loading :loaded="loadend" :loading="loading"></Loading>
<div
<view
class="noCommodity"
style="background-color: #fff;"
v-if="productList.length === 0 && where.page > 1"
>
<div class="noPictrue">
<img :src="$VUE_APP_RESOURCES_URL+'/images/noGood.png'" class="image" />
</div>
</div>
<view class="noPictrue">
<image :src="$VUE_APP_RESOURCES_URL+'/images/noGood.png'" class="image" />
</view>
</view>
<Recommend v-if="productList.length === 0 && where.page > 1"></Recommend>
</div>
</view>
</template>
<script>
import Recommend from "@/components/Recommend";

View File

@ -1,72 +1,78 @@
<template>
<div class="quality-recommend">
<div class="slider-banner swiper">
<swiper indicatorDots="true" v-if="banner.length > 0">
<block v-for="(item, imgUrlsIndex) in imgUrls" :key="imgUrlsIndex">
<swiper-item>
<img :src="item.img" class="slide-image" />
</swiper-item>
</block>
</swiper>
</div>
<div class="title acea-row row-center-wrapper">
<div class="line"></div>
<div class="name">
<span class="iconfont icon-cuxiaoguanli"></span>促销单品
</div>
<div class="line"></div>
</div>
<Promotion-good :benefit="goodsList"></Promotion-good>
</div>
<view class="quality-recommend">
<view class="slider-banner swiper">
<swiper indicatorDots="true" v-if="banner.length > 0">
<block v-for="(item, imgUrlsIndex) in imgUrls" :key="imgUrlsIndex">
<swiper-item>
<image :src="item.img" class="slide-image" />
</swiper-item>
</block>
</swiper>
</view>
<view class="title acea-row row-center-wrapper">
<view class="line"></view>
<view class="name">
<text class="iconfont icon-cuxiaoguanli"></text>促销单品
</view>
<view class="line"></view>
</view>
<Promotion-good :benefit="goodsList"></Promotion-good>
</view>
</template>
<script>
// import { swiper, swiperSlide } from "vue-awesome-swiper";
// import { swiper, swiperSlide } from "vue-awesome-swiper";
import PromotionGood from "@/components/PromotionGood";
import { getGroomList } from "@/api/store";
export default {
name: "GoodsPromotion",
components: {
// swiper,
// swiperSlide,
PromotionGood
},
props: {},
data: function() {
return {
imgUrls: [],
goodsList: [],
RecommendSwiper: {
pagination: {
el: ".swiper-pagination",
clickable: true
},
autoplay: {
disableOnInteraction: false,
delay: 2000
},
loop: true,
speed: 1000,
observer: true,
observeParents: true
}
};
},
mounted: function() {
this.getIndexGroomList();
},
methods: {
getIndexGroomList: function() {
let that = this;
getGroomList(4)
.then(res => {
that.imgUrls = res.data.banner;
that.goodsList = res.data.list;
})
.catch(function(res) {
this.$dialog.toast({ mes: res.msg });
});
}
}
};
</script>
import PromotionGood from "@/components/PromotionGood";
import {
getGroomList
} from "@/api/store";
export default {
name: "GoodsPromotion",
components: {
// swiper,
// swiperSlide,
PromotionGood
},
props: {},
data: function() {
return {
imgUrls: [],
goodsList: [],
RecommendSwiper: {
pagination: {
el: ".swiper-pagination",
clickable: true
},
autoplay: {
disableOnInteraction: false,
delay: 2000
},
loop: true,
speed: 1000,
observer: true,
observeParents: true
}
};
},
mounted: function() {
this.getIndexGroomList();
},
methods: {
getIndexGroomList: function() {
let that = this;
getGroomList(4)
.then(res => {
that.imgUrls = res.data.banner;
that.goodsList = res.data.list;
})
.catch((err) => {
uni.showToast({
title: err.msg || err.response.data.msg,
icon: 'none',
duration: 2000
});
});
}
}
};
</script>

View File

@ -1,14 +1,14 @@
<template>
<div class="quality-recommend">
<div class="title acea-row row-center-wrapper">
<div class="line"></div>
<div class="name">
<span class="iconfont" :class="icon"></span>{{ name }}
</div>
<div class="line"></div>
</div>
<view class="quality-recommend">
<view class="title acea-row row-center-wrapper">
<view class="line"></view>
<view class="name">
<text class="iconfont" :class="icon"></text>{{ name }}
</view>
<view class="line"></view>
</view>
<GoodList :good-list="goodsList" :is-sort="false"></GoodList>
</div>
</view>
</template>
<script>
@ -71,8 +71,12 @@ export default {
that.imgUrls = res.data.banner;
that.goodsList = res.data.list;
})
.catch(function(res) {
this.$dialog.toast({ mes: res.msg });
.catch((err)=> {
uni.showToast({
title: err.msg || err.response.data.msg,
icon: 'none',
duration: 2000
});
});
}
}

View File

@ -1,143 +1,98 @@
<template>
<div class="shoppingCart">
<div class="labelNav acea-row row-around row-middle">
<div class="item">
<span class="iconfont icon-xuanzhong"></span>100%正品保证
</div>
<div class="item">
<span class="iconfont icon-xuanzhong"></span>所有商品精挑细选
</div>
<div class="item">
<span class="iconfont icon-xuanzhong"></span>售后无忧
</div>
</div>
<div class="nav acea-row row-between-wrapper">
<div>
购物数量
<span class="num font-color-red">{{ count }}</span>
</div>
<div
v-if="cartList.valid.length > 0"
class="administrate acea-row row-center-wrapper"
@click="manage"
>{{ footerswitch ? "取消" : "管理" }}</div>
</div>
<div v-if="validList.length > 0 || cartList.invalid.length > 0">
<div class="list">
<div
class="item acea-row row-between-wrapper"
v-for="(item, cartListValidIndex) in validList"
:key="cartListValidIndex"
>
<div class="select-btn">
<div class="checkbox-wrapper">
<checkbox-group @change="switchSelect(cartListValidIndex)">
<label class="well-check">
<checkbox value :checked="item.checked"></checkbox>
</label>
</checkbox-group>
</div>
</div>
<div class="picTxt acea-row row-between-wrapper">
<div class="pictrue" @click="goGoodsCon(item)">
<img :src="item.productInfo.attrInfo.image" v-if="item.productInfo.attrInfo" />
<img :src="item.productInfo.image" v-else />
</div>
<div class="text">
<div class="line1">{{ item.productInfo.storeName }}</div>
<div
class="infor line1"
v-if="item.productInfo.attrInfo"
>属性:{{ item.productInfo.attrInfo.suk }}</div>
<div class="money">¥{{ item.truePrice }}</div>
</div>
<div class="carnum acea-row row-center-wrapper">
<div
class="reduce"
:class="validList[cartListValidIndex].cartNum <= 1 ? 'on' : ''"
@click.prevent="reduce(cartListValidIndex)"
>-</div>
<div class="num">{{ item.cartNum }}</div>
<div
class="plus"
v-if="validList[cartListValidIndex].attrInfo"
:class="
validList[cartListValidIndex].cartNum >=
validList[cartListValidIndex].attrInfo.stock
? 'on'
: ''
"
@click.prevent="plus(cartListValidIndex)"
>+</div>
<div
class="plus"
v-else
:class="
validList[cartListValidIndex].cartNum >= validList[cartListValidIndex].stock
? 'on'
: ''
"
@click.prevent="plus(cartListValidIndex)"
>+</div>
</div>
</div>
</div>
</div>
<div class="invalidGoods" v-if="cartList.invalid.length > 0">
<div class="goodsNav acea-row row-between-wrapper">
<div @click="goodsOpen">
<span
class="iconfont"
:class="goodsHidden === true ? 'icon-xiangyou' : 'icon-xiangxia'"
></span>失效商品
</div>
<div class="del" @click="delInvalidGoods">
<span class="iconfont icon-shanchu1"></span>清空
</div>
</div>
<div class="goodsList" :hidden="goodsHidden">
<div v-for="(item, cartListinvalidIndex) in cartList.invalid" :key="cartListinvalidIndex">
<div
@click="goGoodsCon(item)"
class="item acea-row row-between-wrapper"
v-if="item.productInfo"
>
<div class="invalid acea-row row-center-wrapper">失效</div>
<div class="pictrue">
<img :src="item.productInfo.attrInfo.image" v-if="item.productInfo.attrInfo" />
<img :src="item.productInfo.image" v-else />
</div>
<div class="text acea-row row-column-between">
<div class="line1">{{ item.productInfo.storeName }}</div>
<div
class="infor line1"
v-if="item.productInfo.attrInfo"
>属性{{ item.productInfo.attrInfo.suk }}</div>
<div class="acea-row row-between-wrapper">
<div class="end">该商品已下架</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--购物车暂无商品-->
<div class="noCart" v-if="cartList.valid.length === 0 && cartList.invalid.length === 0">
<div class="pictrue">
<img :src="$VUE_APP_RESOURCES_URL+'/images/noCart.png'" />
</div>
<Recommend></Recommend>
</div>
<div style="height:2.1rem"></div>
<div
:class="['footer acea-row row-between-wrapper']"
v-if="cartList.valid.length > 0"
>
<div>
<div class="select-btn">
<div class="checkbox-wrapper">
<!-- <label class="well-check">
<view class="shoppingCart">
<view class="labelNav acea-row row-around row-middle">
<view class="item">
<text class="iconfont icon-xuanzhong"></text>100%正品保证
</view>
<view class="item">
<text class="iconfont icon-xuanzhong"></text>所有商品精挑细选
</view>
<view class="item">
<text class="iconfont icon-xuanzhong"></text>售后无忧
</view>
</view>
<view class="nav acea-row row-between-wrapper">
<view>
购物数量
<text class="num font-color-red">{{ count }}</text>
</view>
<view v-if="cartList.valid.length > 0" class="administrate acea-row row-center-wrapper" @click="manage">{{ footerswitch ? "取消" : "管理" }}</view>
</view>
<view v-if="validList.length > 0 || cartList.invalid.length > 0">
<view class="list">
<view class="item acea-row row-between-wrapper" v-for="(item, cartListValidIndex) in validList" :key="cartListValidIndex">
<view class="select-btn">
<view class="checkbox-wrapper">
<checkbox-group @change="switchSelect(cartListValidIndex)">
<label class="well-check">
<checkbox value :checked="item.checked"></checkbox>
</label>
</checkbox-group>
</view>
</view>
<view class="picTxt acea-row row-between-wrapper">
<view class="pictrue" @click="goGoodsCon(item)">
<image :src="item.productInfo.attrInfo.image" v-if="item.productInfo.attrInfo" />
<image :src="item.productInfo.image" v-else />
</view>
<view class="text">
<view class="line1">{{ item.productInfo.storeName }}</view>
<view class="infor line1" v-if="item.productInfo.attrInfo">属性:{{ item.productInfo.attrInfo.suk }}</view>
<view class="money">¥{{ item.truePrice }}</view>
</view>
<view class="carnum acea-row row-center-wrapper">
<view class="reduce" :class="validList[cartListValidIndex].cartNum <= 1 ? 'on' : ''" @click.prevent="reduce(cartListValidIndex)">-</view>
<view class="num">{{ item.cartNum }}</view>
<view class="plus" v-if="validList[cartListValidIndex].attrInfo" :class="validList[cartListValidIndex].cartNum >=validList[cartListValidIndex].attrInfo.stock? 'on': ''"
@click.prevent="plus(cartListValidIndex)">+</view>
<view class="plus" v-else :class="validList[cartListValidIndex].cartNum >= validList[cartListValidIndex].stock? 'on': ''"
@click.prevent="plus(cartListValidIndex)">+</view>
</view>
</view>
</view>
</view>
<view class="invalidGoods" v-if="cartList.invalid.length > 0">
<view class="goodsNav acea-row row-between-wrapper">
<view @click="goodsOpen">
<text class="iconfont" :class="goodsHidden === true ? 'icon-xiangyou' : 'icon-xiangxia'"></text>失效商品
</view>
<view class="del" @click="delInvalidGoods">
<text class="iconfont icon-shanchu1"></text>清空
</view>
</view>
<view class="goodsList" :hidden="goodsHidden">
<view v-for="(item, cartListinvalidIndex) in cartList.invalid" :key="cartListinvalidIndex">
<view @click="goGoodsCon(item)" class="item acea-row row-between-wrapper" v-if="item.productInfo">
<view class="invalid acea-row row-center-wrapper">失效</view>
<view class="pictrue">
<image :src="item.productInfo.attrInfo.image" v-if="item.productInfo.attrInfo" />
<image :src="item.productInfo.image" v-else />
</view>
<view class="text acea-row row-column-between">
<view class="line1">{{ item.productInfo.storeName }}</view>
<view class="infor line1" v-if="item.productInfo.attrInfo">属性{{ item.productInfo.attrInfo.suk }}</view>
<view class="acea-row row-between-wrapper">
<view class="end">该商品已下架</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<!--购物车暂无商品-->
<view class="noCart" v-if="cartList.valid.length === 0 && cartList.invalid.length === 0">
<view class="pictrue">
<image :src="$VUE_APP_RESOURCES_URL+'/images/noCart.png'" />
</view>
<Recommend></Recommend>
</view>
<view style="height:2.1rem"></view>
<view :class="['footer acea-row row-between-wrapper']" v-if="cartList.valid.length > 0">
<view>
<view class="select-btn">
<view class="checkbox-wrapper">
<!-- <label class="well-check">
<input
type="checkbox"
name
@ -146,343 +101,378 @@
@click="allChecked"
/>
<i class="icon"></i>
<span class="checkAll">全选 ({{ cartCount }})</span>
<text class="checkAll">全选 ({{ cartCount }})</text>
</label>-->
<checkbox-group @change="allChecked">
<label class="well-check">
<checkbox value :checked="isAllSelect && cartCount > 0"></checkbox>
<span class="checkAll">全选 ({{ cartCount }})</span>
</label>
</checkbox-group>
</div>
</div>
</div>
<div class="money acea-row row-middle" v-if="footerswitch === false">
<span class="font-color-red">{{ countmoney }}</span>
<div class="placeOrder bg-color-red" @click="placeOrder">立即下单</div>
</div>
<div class="button acea-row row-middle" v-else>
<div class="bnt cart-color" @click="collectAll">收藏</div>
<div class="bnt" @click="delgoods">删除</div>
</div>
</div>
</div>
<checkbox-group @change="allChecked">
<label class="well-check">
<checkbox value :checked="isAllSelect && cartCount > 0"></checkbox>
<text class="checkAll">全选 ({{ cartCount }})</text>
</label>
</checkbox-group>
</view>
</view>
</view>
<view class="money acea-row row-middle" v-if="footerswitch === false">
<text class="font-color-red">{{ countmoney }}</text>
<view class="placeOrder bg-color-red" @click="placeOrder">立即下单</view>
</view>
<view class="button acea-row row-middle" v-else>
<view class="bnt cart-color" @click="collectAll">收藏</view>
<view class="bnt" @click="delgoods">删除</view>
</view>
</view>
</view>
</template>
<script>
import Recommend from "@/components/Recommend";
import {
getCartList,
postCartDel,
changeCartNum,
getCartCount
} from "@/api/store";
import { postCollectAll } from "@/api/user";
import { mul, add } from "@/utils/bc";
import cookie from "@/utils/store/cookie";
import debounce from "lodash.debounce";
import Recommend from "@/components/Recommend";
import {
getCartList,
postCartDel,
changeCartNum,
getCartCount
} from "@/api/store";
import {
postCollectAll
} from "@/api/user";
import {
mul,
add
} from "@/utils/bc";
import cookie from "@/utils/store/cookie";
import debounce from "lodash.debounce";
const CHECKED_IDS = "cart_checked";
const CHECKED_IDS = "cart_checked";
export default {
name: "ShoppingCart",
components: {
Recommend
},
props: {},
data: function() {
return {
isIpx: false,
cartList: { invalid: [], valid: [] },
validList: [],
isAllSelect: false,
cartCount: 0,
countmoney: 0,
goodsHidden: true,
footerswitch: false,
count: 0,
checkedIds: [],
loaded: false
};
},
watch: {
$yroute(n) {
if (n.name === "ShoppingCart") {
this.carnum();
this.countMoney();
this.getCartList();
this.gainCount();
this.goodsHidden = true;
this.footerswitch = false;
}
},
cartList(list) {
this.validList = list.valid;
}
},
mounted: function() {
let that = this;
that.carnum();
that.countMoney();
that.getCartList();
that.gainCount();
wx.getSystemInfo({
success: function(res) {
console.log(res);
var name = "iPhone X";
if (res.model.indexOf(name) > -1) {
that.isIpx = true;
}
}
});
},
methods: {
goGoodsCon(item) {
this.$yrouter.push({
path: "/pages/shop/GoodsCon/index",
query: { id: item.productId }
});
},
getCartList: function() {
let that = this;
getCartList().then(res => {
that.cartList = res.data;
let checkedIds = cookie.get(CHECKED_IDS) || [];
if (!Array.isArray(checkedIds)) checkedIds = [];
this.cartList.valid.forEach(cart => {
if (checkedIds.indexOf(cart.id) !== -1) cart.checked = true;
});
if (checkedIds.length) {
that.checkedIds = checkedIds;
that.isAllSelect = checkedIds.length === this.cartList.valid.length;
that.carnum();
that.countMoney();
}
this.loaded = true;
});
},
//删除商品;
delgoods: function() {
let that = this,
id = [],
valid = [],
list = that.cartList.valid;
list.forEach(function(val) {
if (val.checked === true) {
id.push(val.id);
}
});
if (id.length === 0) {
that.$dialog.toast({ mes: "请选择产品" });
return;
}
postCartDel(id).then(function() {
list.forEach(function(val, i) {
if (val.checked === false || val.checked === undefined)
valid.push(list[i]);
});
that.$set(that.cartList, "valid", valid);
that.carnum();
that.countMoney();
that.gainCount();
that.getCartList();
});
},
// //获取数量
gainCount: function() {
let that = this;
getCartCount().then(res => {
that.count = res.data.count;
});
},
//清除失效产品;
delInvalidGoods: function() {
let that = this,
id = [],
list = that.cartList.invalid;
list.forEach(function(val) {
id.push(val.id);
});
postCartDel(id).then(function() {
list.splice(0, list.length);
that.gainCount();
that.getCartList();
});
},
//批量收藏;
collectAll: function() {
let that = this,
data = { id: [], category: "" },
list = that.cartList.valid;
list.forEach(function(val) {
if (val.checked === true) {
data.id.push(val.product_id);
data.category = val.type;
}
});
if (data.id.length === 0) {
that.$dialog.toast({ mes: "请选择产品" });
return;
}
postCollectAll(data).then(function() {
that.$dialog.toast({ mes: "收藏成功!" });
});
},
//立即下单;
placeOrder: function() {
let that = this,
list = that.cartList.valid,
id = [];
list.forEach(function(val) {
if (val.checked === true) {
id.push(val.id);
}
});
if (id.length === 0) {
that.$dialog.toast({ mes: "请选择产品" });
return;
}
console.log(id);
this.$yrouter.push({
path: "/pages/order/OrderSubmission/index",
query: { id: id.join(",") }
});
},
manage: function() {
let that = this;
that.footerswitch = !that.footerswitch;
},
goodsOpen: function() {
let that = this;
that.goodsHidden = !that.goodsHidden;
},
//加
plus: function(index) {
let that = this;
let list = that.cartList.valid[index];
list.cartNum++;
if (list.attrInfo) {
if (list.cartNum >= list.attrInfo.stock) {
that.$set(list, "cart_num", list.attrInfo.stock);
}
} else {
if (list.cartNum >= list.stock) {
that.$set(list, "cart_num", list.stock);
}
}
that.carnum();
that.countMoney();
that.syncCartNum(list);
},
//减
reduce: function(index) {
let that = this;
let list = that.cartList.valid[index];
if (list.cartNum <= 1) {
that.$dialog.toast({ mes: "已经是底线啦!" });
return;
}
list.cartNum--;
if (list.cartNum < 1) {
that.$set(list, "cart_num", 1);
}
that.carnum();
that.countMoney();
that.syncCartNum(list);
},
syncCartNum(cart) {
if (!cart.sync) {
changeCartNum(cart.id, Math.max(cart.cartNum, 1) || 1)
.then(res => {
this.getCartList();
})
.catch(error => {
uni.showToast({
title: error.response.data.msg,
export default {
name: "ShoppingCart",
components: {
Recommend
},
props: {},
data: function() {
return {
isIpx: false,
cartList: {
invalid: [],
valid: []
},
validList: [],
isAllSelect: false,
cartCount: 0,
countmoney: 0,
goodsHidden: true,
footerswitch: false,
count: 0,
checkedIds: [],
loaded: false
};
},
watch: {
$yroute(n) {
if (n.name === "ShoppingCart") {
this.carnum();
this.countMoney();
this.getCartList();
this.gainCount();
this.goodsHidden = true;
this.footerswitch = false;
}
},
cartList(list) {
this.validList = list.valid;
}
},
mounted: function() {
let that = this;
that.carnum();
that.countMoney();
that.getCartList();
that.gainCount();
wx.getSystemInfo({
success: function(res) {
console.log(res);
var name = "iPhone X";
if (res.model.indexOf(name) > -1) {
that.isIpx = true;
}
}
});
},
methods: {
goGoodsCon(item) {
this.$yrouter.push({
path: "/pages/shop/GoodsCon/index",
query: {
id: item.productId
}
});
},
getCartList: function() {
let that = this;
getCartList().then(res => {
that.cartList = res.data;
let checkedIds = cookie.get(CHECKED_IDS) || [];
if (!Array.isArray(checkedIds)) checkedIds = [];
this.cartList.valid.forEach(cart => {
if (checkedIds.indexOf(cart.id) !== -1) cart.checked = true;
});
if (checkedIds.length) {
that.checkedIds = checkedIds;
that.isAllSelect = checkedIds.length === this.cartList.valid.length;
that.carnum();
that.countMoney();
}
this.loaded = true;
});
},
//删除商品;
delgoods: function() {
let that = this,
id = [],
valid = [],
list = that.cartList.valid;
list.forEach(function(val) {
if (val.checked === true) {
id.push(val.id);
}
});
if (id.length === 0) {
uni.showToast({
title: "请选择产品",
icon: "none",
duration: 2000
});
});
}
},
//单选
switchSelect: function(index) {
let that = this,
cart = that.cartList.valid[index],
i = this.checkedIds.indexOf(cart.id);
cart.checked = !cart.checked;
return;
}
postCartDel(id).then(function() {
list.forEach(function(val, i) {
if (val.checked === false || val.checked === undefined)
valid.push(list[i]);
});
that.$set(that.cartList, "valid", valid);
that.carnum();
that.countMoney();
that.gainCount();
that.getCartList();
});
},
// //获取数量
gainCount: function() {
let that = this;
getCartCount().then(res => {
that.count = res.data.count;
});
},
//清除失效产品;
delInvalidGoods: function() {
let that = this,
id = [],
list = that.cartList.invalid;
list.forEach(function(val) {
id.push(val.id);
});
postCartDel(id).then(function() {
list.splice(0, list.length);
that.gainCount();
that.getCartList();
});
},
//批量收藏;
collectAll: function() {
let that = this,
data = {
id: [],
category: ""
},
list = that.cartList.valid;
list.forEach(function(val) {
if (val.checked === true) {
data.id.push(val.product_id);
data.category = val.type;
}
});
if (data.id.length === 0) {
uni.showToast({
title: "请选择产品",
icon: "none",
duration: 2000
});
return;
}
postCollectAll(data).then(function() {
uni.showToast({
title: "收藏成功!",
icon: "none",
duration: 2000
});
});
},
//立即下单;
placeOrder: function() {
let that = this,
list = that.cartList.valid,
id = [];
list.forEach(function(val) {
if (val.checked === true) {
id.push(val.id);
}
});
if (id.length === 0) {
uni.showToast({
title: "请选择产品",
icon: "none",
duration: 2000
});
return;
}
console.log(id);
this.$yrouter.push({
path: "/pages/order/OrderSubmission/index",
query: {
id: id.join(",")
}
});
},
manage: function() {
let that = this;
that.footerswitch = !that.footerswitch;
},
goodsOpen: function() {
let that = this;
that.goodsHidden = !that.goodsHidden;
},
//加
plus: function(index) {
let that = this;
let list = that.cartList.valid[index];
list.cartNum++;
if (list.attrInfo) {
if (list.cartNum >= list.attrInfo.stock) {
that.$set(list, "cart_num", list.attrInfo.stock);
}
} else {
if (list.cartNum >= list.stock) {
that.$set(list, "cart_num", list.stock);
}
}
that.carnum();
that.countMoney();
that.syncCartNum(list);
},
//减
reduce: function(index) {
let that = this;
let list = that.cartList.valid[index];
if (list.cartNum <= 1) {
uni.showToast({
title: "已经是底线啦!",
icon: "none",
duration: 2000
});
return;
}
list.cartNum--;
if (list.cartNum < 1) {
that.$set(list, "cart_num", 1);
}
that.carnum();
that.countMoney();
that.syncCartNum(list);
},
syncCartNum(cart) {
if (!cart.sync) {
changeCartNum(cart.id, Math.max(cart.cartNum, 1) || 1)
.then(res => {
this.getCartList();
})
.catch(error => {
uni.showToast({
title: error.response.data.msg,
icon: "none",
duration: 2000
});
});
}
},
//单选
switchSelect: function(index) {
let that = this,
cart = that.cartList.valid[index],
i = this.checkedIds.indexOf(cart.id);
cart.checked = !cart.checked;
if (i !== -1) this.checkedIds.splice(i, 1);
if (cart.checked) {
this.checkedIds.push(cart.id);
}
let len = that.cartList.valid.length;
let selectnum = [];
for (let i = 0; i < len; i++) {
if (that.cartList.valid[i].checked === true) {
selectnum.push(true);
}
}
that.isAllSelect = selectnum.length === len;
that.$set(that, "cartList", that.cartList);
that.$set(that, "isAllSelect", that.isAllSelect);
cookie.set(CHECKED_IDS, that.checkedIds);
that.carnum();
that.countMoney();
},
//全选
allChecked: function(e) {
let that = this;
let selectAllStatus = e.mp.detail.value[0] ? true : false;
// let selectAllStatus = that.isAllSelect;
let checkedIds = [];
// for (let i = 0; i < array.length; i++) {
// array[i].checked = selectAllStatus;
// checked.push()
// }
that.cartList.valid.forEach(cart => {
cart.checked = selectAllStatus;
if (selectAllStatus) {
checkedIds.push(cart.id);
}
});
let cartList = {
...that.cartList
};
that.cartList = [];
that.cartList = cartList;
this.$set(this, "cartList", this.cartList);
this.$set(this, "isAllSelect", selectAllStatus);
this.checkedIds = checkedIds;
cookie.set(CHECKED_IDS, checkedIds);
that.carnum();
that.countMoney();
this.$forceUpdate();
},
//数量
carnum: function() {
let that = this;
var carnum = 0;
var array = that.cartList.valid;
for (let i = 0; i < array.length; i++) {
if (array[i].checked === true) {
carnum += parseInt(array[i].cartNum);
}
}
that.$set(that, "cartCount", carnum);
},
//总共价钱;
countMoney: function() {
let that = this;
let carmoney = 0;
let array = that.cartList.valid;
for (let i = 0; i < array.length; i++) {
if (array[i].checked === true) {
carmoney = add(carmoney, mul(array[i].cartNum, array[i].truePrice));
}
}
that.countmoney = carmoney;
}
}
};
if (i !== -1) this.checkedIds.splice(i, 1);
if (cart.checked) {
this.checkedIds.push(cart.id);
}
let len = that.cartList.valid.length;
let selectnum = [];
for (let i = 0; i < len; i++) {
if (that.cartList.valid[i].checked === true) {
selectnum.push(true);
}
}
that.isAllSelect = selectnum.length === len;
that.$set(that, "cartList", that.cartList);
that.$set(that, "isAllSelect", that.isAllSelect);
cookie.set(CHECKED_IDS, that.checkedIds);
that.carnum();
that.countMoney();
},
//全选
allChecked: function(e) {
let that = this;
let selectAllStatus = e.mp.detail.value[0] ? true : false;
// let selectAllStatus = that.isAllSelect;
let checkedIds = [];
// for (let i = 0; i < array.length; i++) {
// array[i].checked = selectAllStatus;
// checked.push()
// }
that.cartList.valid.forEach(cart => {
cart.checked = selectAllStatus;
if (selectAllStatus) {
checkedIds.push(cart.id);
}
});
let cartList = {
...that.cartList
};
that.cartList = [];
that.cartList = cartList;
this.$set(this, "cartList", this.cartList);
this.$set(this, "isAllSelect", selectAllStatus);
this.checkedIds = checkedIds;
cookie.set(CHECKED_IDS, checkedIds);
that.carnum();
that.countMoney();
this.$forceUpdate();
},
//数量
carnum: function() {
let that = this;
var carnum = 0;
var array = that.cartList.valid;
for (let i = 0; i < array.length; i++) {
if (array[i].checked === true) {
carnum += parseInt(array[i].cartNum);
}
}
that.$set(that, "cartCount", carnum);
},
//总共价钱;
countMoney: function() {
let that = this;
let carmoney = 0;
let array = that.cartList.valid;
for (let i = 0; i < array.length; i++) {
if (array[i].checked === true) {
carmoney = add(carmoney, mul(array[i].cartNum, array[i].truePrice));
}
}
that.countmoney = carmoney;
}
}
};
</script>

View File

@ -1,17 +1,17 @@
<template>
<div class="newsDetail">
<div class="title">{{ articleInfo.title }}</div>
<div class="list acea-row row-middle">
<div class="label cart-color line1">新闻专区</div>
<div class="item">
<span class="iconfont icon-shenhezhong"></span>{{ articleInfo.addTime }}
</div>
<div class="item">
<span class="iconfont icon-liulan"></span>{{ articleInfo.visit }}
</div>
</div>
<div class="conter" v-html="articleInfo.content"></div>
</div>
<view class="newsDetail">
<view class="title">{{ articleInfo.title }}</view>
<view class="list acea-row row-middle">
<view class="label cart-color line1">新闻专区</view>
<view class="item">
<text class="iconfont icon-shenhezhong"></text>{{ articleInfo.addTime }}
</view>
<view class="item">
<text class="iconfont icon-liulan"></text>{{ articleInfo.visit }}
</view>
</view>
<view class="conter" v-html="articleInfo.content"></view>
</view>
</template>
<style scoped>
.newsDetail .picTxt {
@ -26,7 +26,7 @@
width: 2rem;
height: 2rem;
}
.newsDetail .picTxt .pictrue img {
.newsDetail .picTxt .pictrue image{
width: 100%;
height: 100%;
border-radius: 0.2rem 0 0 0.2rem;

View File

@ -1,26 +1,26 @@
<template>
<div class="newsList" ref="container">
<div class="list" v-for="(item, articleListIndex) in articleList" :key="articleListIndex">
<div @click="goNewsDetail(item)" class="item acea-row row-between-wrapper">
<div class="text acea-row row-column-between">
<div class="name line2">{{ item.title }}</div>
<div>{{ item.addTime }}</div>
</div>
<div class="pictrue">
<img :src="item.imageInput" />
</div>
</div>
</div>
<view class="newsList" ref="container">
<view class="list" v-for="(item, articleListIndex) in articleList" :key="articleListIndex">
<view @click="goNewsDetail(item)" class="item acea-row row-between-wrapper">
<view class="text acea-row row-column-between">
<view class="name line2">{{ item.title }}</view>
<view>{{ item.addTime }}</view>
</view>
<view class="pictrue">
<image :src="item.imageInput" />
</view>
</view>
</view>
<!--暂无新闻-->
<div class="noCommodity" v-if="articleList.length === 0 && page > 1">
<div class="noPictrue">
<img :src="$VUE_APP_RESOURCES_URL+'/images/noNews.png'" class="image" />
</div>
</div>
<view class="noCommodity" v-if="articleList.length === 0 && page > 1">
<view class="noPictrue">
<image :src="$VUE_APP_RESOURCES_URL+'/images/noNews.png'" class="image" />
</view>
</view>
<!--</Tab>-->
<!--</Tabs>-->
</div>
</view>
</template>
<script>
import { getArticleList } from "@/api/public";