Merge branch 'master' of http://git.luyuan.tk/luyuan/deming into zmr

This commit is contained in:
zmr900709
2020-07-18 14:06:01 +08:00
21 changed files with 782 additions and 340 deletions

View File

@@ -1,6 +1,6 @@
<template>
<view class="items">
<view class="item-top">
<view class="item-top" @click="choiceAddress">
<view class="user-info">
<view class="user-name">{{ item.address_realname }}</view>
<view class="user-pnone">{{ item.address_mob_phone | phoneFormat }}</view>
@@ -35,17 +35,15 @@
</view>
</template>
<script>
/**
* address
* @description 地址
* @property {Object} item 地址信息
* @property {String} state 是否选择地址 choise
*/
export default {
name: 'address-item',
data() {
return {
}
},
props: ['item', 'current'],
mounted() {
// console.log(this.item);
},
props: ['item', 'current', 'state'],
filters: {
phoneFormat(value) {
return value.replace(/^(\d{3})\d*(\d{4})$/, '$1****$2');
@@ -74,6 +72,15 @@ export default {
}
})
},
choiceAddress() {
if(this.state) {
this.$store.commit('updateAddress', this.item);
this.$u.route({
type: 'navigateBack',
url: '/pageC/cart/ConfirmOrder',
})
}
},
showToast(message, type) {
this.$refs.uToast.show({
title: message,

View File

@@ -1,24 +1,24 @@
<template>
<view class="c-coupon">
<view :class="status == 0 ? 'coupon-usable' : 'coupon-unable'">
<view :class="type == 1 && status != 0 ? 'coupon-unable' : 'coupon-usable'">
<view class="info-type" :style="{ backgroundImage: 'url(' + (status == 0 ? '/static/image/mine/30.png' : '/static/image/mine/31.png') + ')', backgroundSize:'contain', backgroundRepeat: 'no-repeat' }">
<div class="wrap_left_top"></div>
{{ couponInfo.index&1 ? '店铺优惠券' : '平台优惠券' }}
{{ couponInfo.type == 2 ? '店铺优惠券' : '平台优惠券' }}
</view>
<view class="coupon-info">
<view class="info-usable">
<view class="price"><span>10</span></view>
<view class="condition">100使用</view>
<view class="price"><span>{{ couponInfo.vouchertemplate_price }}</span></view>
<view class="condition">{{ couponInfo.vouchertemplate_limit }}使用</view>
</view>
<view class="info-store u-line-1">仅限 nike官方旗舰店 鞋子商品使用</view>
<view class="info-integral">兑换积分200积分</view>
<view class="info-date">有效期2018.09.06-2018.10.06</view>
<view class="info-store u-line-1">仅限{{ couponInfo.vouchertemplate_storename }}鞋子商品使用</view>
<view class="info-integral">兑换积分{{ couponInfo.vouchertemplate_points }}积分</view>
<view class="info-date">有效期{{ couponInfo.vouchertemplate_startdate }}-{{ couponInfo.vouchertemplate_enddate }}</view>
</view>
<view class="coupon-btn">
<text v-if="type == 0 && status == 0" @click="exchange">立即兑换</text>
<text v-if="type == 0 && status == 0" @click="exchangeCoupon">立即兑换</text>
<text v-if="type == 1 && status == 0" @click="use">立即使用</text>
<image v-if="status == 1" src="/static/image/mine/28.png"></image>
<image v-if="status == 2" src="/static/image/mine/29.png"></image>
<image v-if="type == 1 && status == 1" src="/static/image/mine/28.png"></image>
<image v-if="type == 1 && status == 2" src="/static/image/mine/29.png"></image>
</view>
</view>
</view>
@@ -27,7 +27,7 @@
/**
* coupon 优惠券
* @description 优惠券组件
* @property {Number} type 优惠券操作方式(兑换优惠券: 0 / 使用优惠券: 1)
* @property {Number} type 优惠券操作方式(兑换优惠券: 0 / 自己的优惠券: 1)
* @property {Object} coupon-info 优惠券信息
* @event {Function} exchange 兑换优惠券
* @event {Function} use 使用优惠券
@@ -41,12 +41,21 @@ export default {
type: Number,
couponInfo: Object,
},
created() {
console.log(this.couponInfo);
},
methods: {
exchange() {
this.$emit('exchange', this.couponInfo.index);
this.$emit('exchange', this.couponInfo.vouchertemplate_id);
},
exchangeCoupon() {
this.$u.api.getCoupon({ id: this.couponInfo.vouchertemplate_id }).then(res => {
this.$u.toast(res.message);
if(res.errCode == 0) {}
})
},
use() {
this.$emit('use', this.couponInfo.index);
this.$emit('use', this.couponInfo.vouchertemplate_id);
},
},
};

View File

@@ -3,24 +3,83 @@
<view class="top">
商品推荐
</view>
<view class="label">
<!-- <view class="label">
<text v-for="item in classifyList" :key="item.gc_id">{{ item.gc_name }}</text>
</view>
<view class="item">
<item v-for="item in goodsList" :key="item.goods_id" :info="item"></item>
</view>
</view> -->
<view>
<u-tabs-swiper ref="uTabs" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="24" :show-bar="false" @change="tabsChange" height="60" ></u-tabs-swiper>
</view>
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" >
<swiper-item class="swiper-item" v-for="(_, index) in classifyList" :key="index">
<!-- <scroll-view scroll-y style="height: 800rpx;width: 100%;"> -->
<view class="item">
<item v-for="item in goodsList" :key="item.goods_id" :info="item"></item>
</view>
<u-empty text="暂无商品" mode="list" color="#000" v-if="!goodsList.length"></u-empty>
<!-- </scroll-view> -->
</swiper-item>
</swiper>
</view>
</template>
<script>
import item from "./item"
export default {
name:"list",
name:"list",
data() {
return {
current: Number,
swiperCurrent: 0,
goodsList: [],
}
},
components:{
item
},
props: {
classifyList: Array,
goodsList: Array,
classifyList: Array
},
watch: {
current(index) {
const id = this.classifyList[index].gc_id;
this.getGoodsRecommend(id);
}
},
created() {
this.current = 0;
console.log(this.classifyList);
},
methods: {
getGoodsRecommend(gc_id) {
this.$u.api.getGoodsRecommend({
page: 1,
gc_id: gc_id,
}).then((res)=>{
if (res.errCode == 0) {
this.goodsList = res.data.goodsList;
console.log(this.goodsList);
}
})
},
// tabs通知swiper切换
tabsChange(index) {
this.swiperCurrent = index;
},
// swiper-item左右移动通知tabs的滑块跟随移动
transition(e) {
let dx = e.detail.dx;
this.$refs.uTabs.setDx(dx);
},
// 由于swiper的内部机制问题快速切换swiper不会触发dx的连续变化需要在结束时重置状态
// swiper滑动结束分别设置tabs和swiper的状态
animationfinish(e) {
let current = e.detail.current;
this.$refs.uTabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.current = current;
},
}
}
</script>
@@ -33,21 +92,21 @@ export default {
text-align: center;
color: #333;
}
.label{
display: flex;
color: #999;
flex-wrap: wrap;
>text{
margin-right: 34rpx;
margin-bottom: 10rpx;
}
}
.item{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 20rpx;
// .label{
// display: flex;
// color: #999;
// flex-wrap: wrap;
// >text{
// margin-right: 34rpx;
// margin-bottom: 10rpx;
// }
// }
// .item{
// display: flex;
// flex-wrap: wrap;
// justify-content: space-between;
// margin-top: 20rpx;
}
// }
}
</style>

View File

@@ -1,16 +1,16 @@
<template>
<view class="recommend">
<view class="top">
<text>今日秒杀推荐</text>
<text>{{ type == 'spike' ? '今日秒杀推荐' : '今日拼团推荐' }}</text>
<text>点击查看更多></text>
</view>
<view class="connect">
<view class="time" v-if="type=='spike'">
<view class="time" v-if="type == 'spike'">
<image src="/static/image/common/15.png"></image>
<text>{{ info.groupbuy_starttime_histime }}</text>
</view>
<view class="info">
<text class="u-line-1">{{ info.groupbuy_name }}</text>
<text class="u-line-1">{{ type == 'spike' ? info.groupbuy_name : '' }}</text>
<text class="u-line-2">{{ info.goods_name }}</text>
<view>
<text>{{ info.groupbuy_price }}</text>

View File

@@ -4,21 +4,25 @@
<view class="title">
<view class="name">全部秒杀</view>
<view class="time">
<text class="num">12</text>
<text class="num">{{ time.littleHour }}</text>
<text class="mah">:</text>
<text class="num">12</text>
<text class="num">00</text>
<text class="mah">:</text>
<text class="num">12</text>
<text class="num">00</text>
<text>-</text>
<text class="num">{{ time.bigHour }}</text>
<text class="mah">:</text>
<text class="num">00</text>
<text class="mah">:</text>
<text class="num">00</text>
</view>
</view>
<view class="next">
<view class="next" @click="viewMore">
查看更多>
</view>
</view>
<view class="list">
<sitem></sitem>
<sitem></sitem>
<sitem></sitem>
<sitem v-for="(item, index) in list.slice(0, 3)" :key="index" :item="item"></sitem>
</view>
</view>
</template>
@@ -28,7 +32,15 @@ export default {
name:"seckill",
components:{
sitem
}
},
props: ['list', 'time'],
methods: {
viewMore() {
this.$u.route({
url: '/pageC/spike/index',
})
}
}
}
</script>
<style lang="scss" scoped>
@@ -46,15 +58,17 @@ export default {
color: #333;
}
.time{
margin-left: 39rpx;
margin-left: 20rpx;
display: flex;
align-items: center;
font-size: 20rpx;
.num{
box-sizing: content-box;
width: 25rpx;
height: 25rpx;
background-color: #bfbfbf;
margin: 0 10rpx;
padding: 2rpx;
}
}
}

View File

@@ -1,25 +1,33 @@
<template>
<view class="item">
<image class="head"></image>
<text class="title">商品名</text>
<image class="head" :src="item.groupbuy_image1"></image>
<text class="title u-line-2">{{ item.goods_name }}</text>
<view class="price">
<text>99</text>
<text>299</text>
<text>{{ item.groupbuy_price }}</text>
<text>{{ item.goods_price }}</text>
</view>
<view class="info">
<text>剩余21</text>
<text>剩余{{ item.inventory | formatValue }}</text>
<text>立即购买</text>
</view>
</view>
</template>
<script>
export default {
name:"item"
name:"item",
props: ['item'],
filters: {
formatValue(value) {
let temp = Number(value);
if(temp > 999) temp = '999+';
return temp;
}
}
}
</script>
<style lang="scss" scoped>
.item{
width: 210rpx;
width: 220rpx;
.head{
width: 210rpx;
height: 131rpx;
@@ -43,6 +51,7 @@ export default {
>text:last-child{
font-size: 24rpx;
color: #999;
text-decoration: line-through;
}
}
@@ -50,7 +59,7 @@ export default {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 22rpx;
font-size: 20rpx;
margin-top: 19rpx;
>text:first-child{
color: #666;

View File

@@ -0,0 +1,91 @@
<template>
<view class="special">
<image :src="item.groupbuy_image1"></image>
<view class="right">
<view class="name u-line-1">{{ item.goods_name }}</view>
<view class="price" v-if="type == 'spike'">
<view class="groupbuy-price">{{ item.groupbuy_price }}</view>
<view class="goods-price">{{ item.goods_price }}</view>
</view>
<view class="buy">
<view class="num">剩余{{ item.inventory }}</view>
<view class="btn">立即购买</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {}
},
props: {
item: Object,
type: String,
},
created() {
console.log(this.item);
}
};
</script>
<style lang="scss" scoped>
.special {
margin-bottom: 30rpx;
display: flex;
width: 690rpx;
background: rgba(245,245,245,1);
border-radius: 6rpx;
> image {
flex-shrink: 0;
width: 210rpx;
height: 170rpx;
border-radius: 6rpx 0rpx 0rpx 6rpx;
}
.right {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 20rpx;
.name {
width: 400rpx;
font-size: 26rpx;
color: rgba(51,51,51,1);
margin-bottom: 20rpx;
}
.price {
display: flex;
.groupbuy-price {
font-size: 26rpx;
color: rgba(255,49,49,1);
margin-right: 12rpx;
}
.goods-price {
font-size: 24rpx;
text-decoration: line-through;
color: rgba(153,153,153,1);
}
}
.buy {
display: flex;
justify-content: space-between;
align-items: center;
.num {
font-size: 22rpx;
color: rgba(102,102,102,1);
}
.btn {
width: 140rpx;
height: 50rpx;
background: rgba(255,120,15,1);
border-radius: 25rpx;
font-size: 22rpx;
font-weight: 500;
color: rgba(255,255,255,1);
line-height: 50rpx;
text-align: center;
}
}
}
}
</style>

View File

@@ -1,72 +1,119 @@
<template>
<view class="youhq">
<view class="top">
<text>全部优惠券</text>
<text>查看更多></text>
</view>
<view class="label">
<text>sda</text>
<text>asda</text>
<text>dsad</text>
<text>asdas</text>
</view>
<scroll-view style="width:100%;margin-top: 21rpx;" scroll-x="true">
<view class="list">
<sitem></sitem>
<sitem></sitem>
<sitem></sitem>
<sitem></sitem>
<sitem></sitem>
</view>
</scroll-view>
</view>
<view class="coupon-swiper">
<view class="top">
<view class="title">全部优惠券</view>
<view class="view-more" @click="toCouponPage">查看更多></view>
</view>
<u-tabs-swiper ref="coupon" :list="couponGroupList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="couponCurrent" font-size="24" :show-bar="false" @change="couponTabsChange" height="88" ></u-tabs-swiper>
<!-- :style="{ height: swiperHeight }" -->
<swiper :current="swiperCouponCurrent" @animationfinish="couponAnimationFinish">
<swiper-item class="swiper-coupon-item" v-for="(_, i) in couponGroupList" :key="i">
<!-- <scroll-view scroll-y style="height: 100%;"> -->
<view v-for="(coupon, index) in couponList.slice(0, 4)" :key="index" class="coupon-item">
<Coupon :couponInfo="coupon" :status='0' :type="0"></Coupon>
</view>
<u-empty text="暂无优惠券" mode="coupon" color="#000" v-if="!couponList.length"></u-empty>
<!-- </scroll-view> -->
</swiper-item>
</swiper>
</view>
</template>
<script>
import sitem from "./item"
import Coupon from "@/components/mine/coupon/index";
export default {
name:"youhq",
components:{
sitem
},
data(){
return {
}
}
}
data() {
return {
swiperHeight: '',
couponCurrent: 0,
swiperCouponCurrent: 0,
couponGroupList: [],
couponList: [],
}
},
components: {
Coupon
},
watch: {
couponCurrent(index) {
const id = this.couponGroupList[index].gc_id;
this.getCouponList(id);
}
},
created() {
this.setViewHeight();
this.getGoodsClass();
},
methods: {
getGoodsClass() {
this.$u.api.getGoodsClass().then(res => {
if(res.errCode == 0) {
this.couponGroupList = res.data;
this.getCouponList(this.couponGroupList[0].gc_id);
}
})
},
getCouponList(gc_id) {
this.$u.api.getCouponList({
page: 0,
gc_id: gc_id,
}).then(res => {
if(res.errCode == 0) {
this.couponList = res.data;
} else {
this.couponList = [];
}
})
},
couponTabsChange(index) {
this.couponCurrent = index;
},
couponAnimationFinish(e) {
const current = e.detail.current;
this.swiperCouponCurrent = current;
this.couponCurrent = current;
},
setViewHeight() {
const res = uni.getSystemInfoSync();
// this.swiperHeight = res.windowHeight - ((88 + 10 + 88) / 2) + 'px';
this.swiperHeight = '450px';
},
toCouponPage() {
this.$u.route({
url: '/pageE/mine/MemberServe',
params: {
current: 1
}
})
},
},
};
</script>
<style lang="scss" scoped>
.youhq{
.top{
height: 90rpx;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
>text:first-child{
font-size: 30rpx;
color: #333;
}
>text:last-child{
font-size: 18rpx;
color: #999;
}
}
.label{
display: flex;
font-size: 24rpx;
color: #999;
>text{
margin-right: 34rpx;
}
}
.list{
display: flex;
// justify-content: space-between;
width: auto;
}
.coupon-swiper {
.top {
padding-top: 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
.title {
font-size: 30rpx;
font-weight: 500;
color: rgba(51,51,51,1);
}
.view-more {
font-size: 18rpx;
color: rgba(153,153,153,1);
}
}
.swiper-coupon-item {
box-sizing: border-box;
background-color: #ffffff;
// padding: 30rpx {
// top: 0;
// };
.coupon-item {
margin-bottom: 20rpx;
}
}
}
</style>

View File

@@ -1,83 +0,0 @@
<template>
<view class="item">
<view class="top">
<view class="pic">
<text></text>
<text>12</text>
</view>
<view class="man">
<text></text>
<text></text>
</view>
<text class="button">
立即<br />领取
</text>
</view>
<view class="time">
使用时间2020.01.24-2020.05.08
</view>
</view>
</template>
<script>
export default {
name:"item"
}
</script>
<style lang="scss" scoped>
.item{
padding: 10rpx;
width: 254rpx;
height: 94rpx;
border: 2rpx solid #FDD360;
border-radius: 20rpx;
flex-shrink: 0;
margin-right: 16rpx;
.top{
display: flex;
align-items: center;
justify-content: space-between;
.pic{
display: flex;
align-items: flex-end;
color:#FDD360;
>text:first-child{
font-size: 24rpx;
}
>text:last-child{
font-size: 48rpx;
}
}
.man{
display: flex;
flex-direction: column;
align-items: center;
color: #FDD360;
>text:first-child{
font-size: 14rpx;
}
>text:last-child{
font-size: 18rpx;
font-weight: bold;
}
}
.button{
width: 61rpx;
height: 61rpx;
border-radius: 50%;
font-size: 18rpx;
background-color: #FDD360;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
}
}
.time{
font-size: 12rpx;
color: #FDD360;
font-weight: bold;
}
}
</style>