Browse Source

一系列优化

master
邓平艺 4 years ago
parent
commit
265faea6b9
  1. 6
      pages/coupon/index/index.vue
  2. 6
      pages/index/category/category.vue
  3. 35
      pages/order/confirm/confirm.vue
  4. 6
      pages/order/newdetail/newdetail.vue
  5. 16
      pages/shop/goodsdetail.vue
  6. 18
      pages/store/cart/cart.vue

6
pages/coupon/index/index.vue

@ -250,10 +250,12 @@
align-items: flex-start;
display: flex;
flex-direction: column;
margin-left: 84rpx;
margin-left: 54rpx;
width: 380rpx;
}
.coupon-left {
margin-left: 20rpx;
// margin-left: 20rpx;
width: 182rpx;
display: flex;
flex-direction: column;
justify-content: center;

6
pages/index/category/category.vue

@ -70,7 +70,8 @@
</view>
</view>
</view>
<lf-nocontent src="/static/images/empty.png" v-if="brand_list.length <= 0"></lf-nocontent>
<view style="height: 40rpx;" v-if="brand_list.length > 0"></view>
<lf-nocontent src="/static/images/empty.png" v-else></lf-nocontent>
</scroll-view>
<!-- 锚点定位 -->
<view class="fixed-point" v-if="point_list.length">
@ -637,6 +638,9 @@
margin-top: 30rpx;
}
}
.brand-item:last-child{
margin-bottom: 0rpx;
}
.img{
width: 150rpx;
height: 150rpx;

35
pages/order/confirm/confirm.vue

@ -83,10 +83,10 @@
<view class="lf-font-28 lf-color-777">运费</view>
<view class="lf-font-26" style="color: #F63434;">+¥{{ order_detail.order.payable_freight_yuan || 0 }}</view>
</view>
<view class="lf-row-between lf-m-t-20">
<!-- <view class="lf-row-between lf-m-t-20">
<view class="lf-font-28 lf-color-777">优惠</view>
<view class="lf-font-26" style="color: #F63434;">-¥{{ fullMinus(order_detail.discounts) }}</view>
</view>
</view> -->
</view>
<view class="spread-out"></view>
<view class="fixed-bottom">
@ -107,11 +107,11 @@
<!-- 选择优惠券弹出层 -->
<u-popup v-model="show_coupon" mode="bottom" :round="true" borderRadius="20">
<view class="popup-content">
<view class="lf-row-between" v-for="(item, index) in order_detail.coupons" :key="index">
<label class="lf-row-between" v-for="(item, index) in order_detail.coupons" :key="index">
<radio-group @change="couponChange">
<radio :value="index" :checked="coupon_index == index"></radio>
</radio-group>
<view class="coupon-card lf-m-b-30" :class="{'invalid-bg': item.ifpast == true}">
<view class="coupon-card lf-m-b-30" >
<view class="coupon-circle-top">
<view class="coupon-circle1"></view>
</view>
@ -129,15 +129,6 @@
<text class="lf-font-70 lf-font-bold">{{item.discount.action_type.value}}</text>
<text>%</text>
</view>
<view class="coupon-tag" v-if="item.used_at != ''">
已使用
</view>
<view class="coupon-tag" v-if="item.ifpast">
已过期
</view>
<view class="coupon-tag" v-if="!item.ifpast && item.used_at == ''">
待使用
</view>
</view>
<view class="coupon-right">
<view class="lf-font-32 lf-font-bold lf-color-white">{{item.discount.title}}</view>
@ -145,14 +136,14 @@
</view>
</view>
</view>
</view>
</label>
<!-- 不使用优惠券 -->
<view class="lf-flex">
<label class="lf-flex">
<radio-group @change="couponChange">
<radio value="null" :checked="coupon_index == null"></radio>
</radio-group>
<view>不使用优惠券</view>
</view>
</label>
</view>
</u-popup>
</block>
@ -338,8 +329,6 @@
address_id: this.address.id,
note: this.value,
}
// TODO id
if(this.coupon_index != null){
par.coupon_id = this.order_detail.coupons[this.coupon_index].id;
}
@ -472,8 +461,8 @@
height: max-content;
background-color: #FFFFFF;
border-top: 1rpx solid #e5e5e5;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
// padding-bottom: constant(safe-area-inset-bottom);
// padding-bottom: env(safe-area-inset-bottom);
.fixed-content{
width: 100%;
height: 118rpx;
@ -544,10 +533,12 @@
align-items: flex-start;
display: flex;
flex-direction: column;
margin-left: 90rpx;
margin-left: 54rpx;
width: 380rpx;
}
.coupon-left {
margin-left: 30rpx;
// margin-left: 30rpx;
width: 182rpx;
display: flex;
flex-direction: column;
justify-content: center;

6
pages/order/newdetail/newdetail.vue

@ -291,9 +291,13 @@
Authorization: this.$cookieStorage.get('user_token')
}
}).then(res => {
this.$msg(res.data.message).then(() => {
if(res.data.status){
this.$msg('确认收货成功', {icon: 'success'}).then(() => {
this.getOrderDetails();
})
}else{
this.$msg(res.data.message || '确认收货失败');
}
})
},
searchLogistics() {

16
pages/shop/goodsdetail.vue

@ -1,5 +1,5 @@
<template>
<view>
<view style="overflow-x: hidden;">
<lf-nav title="商品详情" titleColor="#fff" :spreadOut="false" :showIcon="true" bgColor="transparent"></lf-nav>
<skeleton :loading="skeletonLoading" :row="12" :showAvatar="false" :showTitle="true">
<block>
@ -169,7 +169,7 @@
<!-- 商品详情 -->
<view class="goods-detail">
<view class="lf-font-32 lf-font-bold lf-m-b-20">商品详情</view>
<rich-text :nodes="formatRichText(goods_detail.content)"></rich-text>
<rich-text :nodes="goods_content"></rich-text>
<!-- <image class="goods-img" :src="item" v-for="(item, index) in goods_detail.content" :key="index" v-if="goods_detail.content_type == 'img'"></image> -->
</view>
<!-- 修饰专用 -->
@ -293,7 +293,8 @@
coupons: [], //
goods_num: 1,
is_date_finish: false,
car_num: 0
car_num: 0,
goods_content: ''
}
},
computed: {
@ -358,16 +359,9 @@
}else {
this.car_num = res.data.data;
}
} else {
wx.showModal({
content: '请下拉页面刷新重试',
showCancel: false
});
}
})
.catch(() => {
wx.stopPullDownRefresh();
wx.hideLoading();
wx.showModal({
content: '请求失败',
showCancel: false
@ -542,6 +536,7 @@
}).then(res => {
if(res.data.code == 200){
this.$msg('加入购物车成功', {icon: 'success'})
this.getcarNum()
}else{
this.$msg('加入购物车失败', {icon: 'error'})
}
@ -635,6 +630,7 @@
this.goods_detail = goods_detail;
this.pictures = [res.data.data.img];
this.is_collect = Boolean(res.data.data.is_collect) || false;
this.goods_content = this.formatRichText(goods_detail.content);
let type = 'mail';
if(this.$isRight(goods_detail.is_largess)){
type = 'point';

18
pages/store/cart/cart.vue

@ -103,7 +103,8 @@
backgroundColor: '#15716E'
}
}],
show: false
show: false,
show_count: 0
}
},
watch: {
@ -130,6 +131,15 @@
this.token = this.$cookieStorage.get('user_token');
this.getCartList();
},
onShow(){
this.show_count++;
if(this.show_count > 1){
this.allChecked = false;
this.total_price = '';
this.total_count = '';
this.getCartList();
}
},
methods: {
//
changeNum(type, parentIndex, childIndex){
@ -166,6 +176,9 @@
})
},
getCartList(){
uni.showLoading({
title: '正在查询购物车'
})
this.$http.get({
api: 'api/cart',
header: {
@ -173,6 +186,7 @@
}
}).then(res => {
console.log("===", res);
uni.hideLoading();
let data = res.data.data;
let list = [];
for(let i in data){
@ -188,7 +202,7 @@
})
}
this.list = list;
})
}).catch(err => uni.hideLoading())
},
//
goodsCheckChange(event, parentIndex, childIndex) {

Loading…
Cancel
Save