Enzo 4 years ago
parent
commit
4ebe098c62
  1. 4
      components/index-banner/index-banner.vue
  2. 9
      components/lf-payPassword/lf-payPassword.vue
  3. 6
      pages/coupon/index/index.vue
  4. 6
      pages/index/category/category.vue
  5. 7
      pages/order/cashier/cashier.vue
  6. 39
      pages/order/confirm/confirm.vue
  7. 10
      pages/order/newdetail/newdetail.vue
  8. 30
      pages/shop/goodsdetail.vue
  9. 18
      pages/store/cart/cart.vue

4
components/index-banner/index-banner.vue

@ -14,7 +14,7 @@
:style=" :style="
'height: ' + 'height: ' +
imgHeight + imgHeight +
'px; padding-left: ' +
'rpx; padding-left: ' +
meta.padding_left + meta.padding_left +
'px; padding-right: ' + 'px; padding-right: ' +
meta.padding_right + meta.padding_right +
@ -41,7 +41,7 @@ export default {
// data // data
data() { data() {
return { return {
imgHeight: '450'
imgHeight: 900
}; };
}, },
options: { options: {

9
components/lf-payPassword/lf-payPassword.vue

@ -50,7 +50,8 @@
data(){ data(){
return { return {
code: '', // code: '', //
time: new Date('2021/09/8 14:15:00').getTime() - new Date('2021/09/8 14:10:00').getTime()
time: new Date('2021/09/8 14:15:00').getTime() - new Date('2021/09/8 14:10:00').getTime(),
is_auto: false
} }
}, },
created(){ created(){
@ -64,12 +65,18 @@
this.code = event; this.code = event;
if(this.code.length >= 6){ if(this.code.length >= 6){
this.comfirm(); this.comfirm();
this.is_auto = true;
}else{
this.is_auto = false;
} }
}, },
comfirm(){ comfirm(){
if(this.code.length < 6){ if(this.code.length < 6){
return this.$msg('请输入完整支付密码'); return this.$msg('请输入完整支付密码');
} }
if(this.is_auto){
return;
}
this.$emit('comfirm', this.code); this.$emit('comfirm', this.code);
} }
} }

6
pages/coupon/index/index.vue

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

6
pages/index/category/category.vue

@ -70,7 +70,8 @@
</view> </view>
</view> </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> </scroll-view>
<!-- 锚点定位 --> <!-- 锚点定位 -->
<view class="fixed-point" v-if="point_list.length"> <view class="fixed-point" v-if="point_list.length">
@ -637,6 +638,9 @@
margin-top: 30rpx; margin-top: 30rpx;
} }
} }
.brand-item:last-child{
margin-bottom: 0rpx;
}
.img{ .img{
width: 150rpx; width: 150rpx;
height: 150rpx; height: 150rpx;

7
pages/order/cashier/cashier.vue

@ -129,7 +129,7 @@
this.confirm(); this.confirm();
}, },
// //
confirm() {
confirm(event) {
if (this.clickContinue == true) { if (this.clickContinue == true) {
this.clickContinue = false; this.clickContinue = false;
if (this.is_date_finish) return this.$msg('订单超时未支付'); if (this.is_date_finish) return this.$msg('订单超时未支付');
@ -143,6 +143,9 @@
this.show_pw = true; this.show_pw = true;
return; return;
} }
uni.showLoading({
title: '正在支付,请稍后'
})
this.getOpenid().then(res => { this.getOpenid().then(res => {
var data = { var data = {
@ -164,6 +167,7 @@
Authorization: this.token Authorization: this.token
} }
}).then(res => { }).then(res => {
uni.hideLoading()
res = res.data; res = res.data;
if (res.status) { if (res.status) {
// this.formId = e.detail.formId || ''; // this.formId = e.detail.formId || '';
@ -184,6 +188,7 @@
this.setData({ this.setData({
loading: false loading: false
}); });
uni.hideLoading()
wx.showModal({ wx.showModal({
content: '支付失败', content: '支付失败',
showCancel: false showCancel: false

39
pages/order/confirm/confirm.vue

@ -83,10 +83,10 @@
<view class="lf-font-28 lf-color-777">运费</view> <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 class="lf-font-26" style="color: #F63434;">+¥{{ order_detail.order.payable_freight_yuan || 0 }}</view>
</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-28 lf-color-777">优惠</view>
<view class="lf-font-26" style="color: #F63434;">-¥{{ fullMinus(order_detail.discounts) }}</view> <view class="lf-font-26" style="color: #F63434;">-¥{{ fullMinus(order_detail.discounts) }}</view>
</view>
</view> -->
</view> </view>
<view class="spread-out"></view> <view class="spread-out"></view>
<view class="fixed-bottom"> <view class="fixed-bottom">
@ -107,11 +107,11 @@
<!-- 选择优惠券弹出层 --> <!-- 选择优惠券弹出层 -->
<u-popup v-model="show_coupon" mode="bottom" :round="true" borderRadius="20"> <u-popup v-model="show_coupon" mode="bottom" :round="true" borderRadius="20">
<view class="popup-content"> <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-group @change="couponChange">
<radio :value="index" :checked="coupon_index == index"></radio> <radio :value="index" :checked="coupon_index == index"></radio>
</radio-group> </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-circle-top">
<view class="coupon-circle1"></view> <view class="coupon-circle1"></view>
</view> </view>
@ -129,15 +129,6 @@
<text class="lf-font-70 lf-font-bold">{{item.discount.action_type.value}}</text> <text class="lf-font-70 lf-font-bold">{{item.discount.action_type.value}}</text>
<text>%</text> <text>%</text>
</view> </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>
<view class="coupon-right"> <view class="coupon-right">
<view class="lf-font-32 lf-font-bold lf-color-white">{{item.discount.title}}</view> <view class="lf-font-32 lf-font-bold lf-color-white">{{item.discount.title}}</view>
@ -145,14 +136,15 @@
</view> </view>
</view> </view>
</view> </view>
</view>
</label>
<!-- 不使用优惠券 --> <!-- 不使用优惠券 -->
<view class="lf-flex">
<label class="lf-flex">
<radio-group @change="couponChange"> <radio-group @change="couponChange">
<radio value="null" :checked="coupon_index == null"></radio> <radio value="null" :checked="coupon_index == null"></radio>
</radio-group> </radio-group>
<view>不使用优惠券</view> <view>不使用优惠券</view>
</view>
</label>
<view style="height: 40rpx;"></view>
</view> </view>
</u-popup> </u-popup>
</block> </block>
@ -338,8 +330,6 @@
address_id: this.address.id, address_id: this.address.id,
note: this.value, note: this.value,
} }
// TODO id
if(this.coupon_index != null){ if(this.coupon_index != null){
par.coupon_id = this.order_detail.coupons[this.coupon_index].id; par.coupon_id = this.order_detail.coupons[this.coupon_index].id;
} }
@ -472,8 +462,8 @@
height: max-content; height: max-content;
background-color: #FFFFFF; background-color: #FFFFFF;
border-top: 1rpx solid #e5e5e5; 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{ .fixed-content{
width: 100%; width: 100%;
height: 118rpx; height: 118rpx;
@ -500,9 +490,10 @@
width: 750rpx; width: 750rpx;
height: max-content; height: max-content;
max-height: 70vh; max-height: 70vh;
overflow-y: scroll;
// overflow-y: scroll;
padding: 40rpx 32rpx; padding: 40rpx 32rpx;
background: #FFFFFF; background: #FFFFFF;
padding-bottom: 0rpx;
} }
.coupon-circle1 { .coupon-circle1 {
width: 40rpx; width: 40rpx;
@ -544,10 +535,12 @@
align-items: flex-start; align-items: flex-start;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-left: 90rpx;
margin-left: 54rpx;
width: 380rpx;
} }
.coupon-left { .coupon-left {
margin-left: 30rpx;
// margin-left: 30rpx;
width: 182rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;

10
pages/order/newdetail/newdetail.vue

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

30
pages/shop/goodsdetail.vue

@ -1,5 +1,5 @@
<template> <template>
<view>
<view style="overflow-x: hidden;">
<lf-nav title="商品详情" titleColor="#fff" :spreadOut="false" :showIcon="true" bgColor="transparent"></lf-nav> <lf-nav title="商品详情" titleColor="#fff" :spreadOut="false" :showIcon="true" bgColor="transparent"></lf-nav>
<skeleton :loading="skeletonLoading" :row="12" :showAvatar="false" :showTitle="true"> <skeleton :loading="skeletonLoading" :row="12" :showAvatar="false" :showTitle="true">
<block> <block>
@ -63,15 +63,15 @@
<view class="cu-bar padding-lr"> <view class="cu-bar padding-lr">
<view class="lf-flex"> <view class="lf-flex">
<text class="lf-color-777 lf-font-28">优惠</text> <text class="lf-color-777 lf-font-28">优惠</text>
<view style="width: 580rpx;">
<view class="lf-color-222 lf-font-26 lf-m-l-30"
v-for="(item, index) in coupons" :key="index">{{ item.title }}
</view>
<view style="width: 580rpx; padding-left: 20rpx;">
<text class="lf-color-222 lf-font-26"
v-for="(item, index) in coupons" :key="index">{{ item.title }};
</text>
</view> </view>
</view> </view>
<view>
<!-- <view>
<text class="lf-font-24 lf-color-777 lf-iconfont icon-xiangyou"></text> <text class="lf-font-24 lf-color-777 lf-iconfont icon-xiangyou"></text>
</view>
</view> -->
</view> </view>
</view> </view>
</block> </block>
@ -169,7 +169,7 @@
<!-- 商品详情 --> <!-- 商品详情 -->
<view class="goods-detail"> <view class="goods-detail">
<view class="lf-font-32 lf-font-bold lf-m-b-20">商品详情</view> <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> --> <!-- <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> </view>
<!-- 修饰专用 --> <!-- 修饰专用 -->
@ -293,7 +293,8 @@
coupons: [], // coupons: [], //
goods_num: 1, goods_num: 1,
is_date_finish: false, is_date_finish: false,
car_num: 0
car_num: 0,
goods_content: ''
} }
}, },
computed: { computed: {
@ -358,16 +359,9 @@
}else { }else {
this.car_num = res.data.data; this.car_num = res.data.data;
} }
} else {
wx.showModal({
content: '请下拉页面刷新重试',
showCancel: false
});
} }
}) })
.catch(() => { .catch(() => {
wx.stopPullDownRefresh();
wx.hideLoading();
wx.showModal({ wx.showModal({
content: '请求失败', content: '请求失败',
showCancel: false showCancel: false
@ -542,6 +536,7 @@
}).then(res => { }).then(res => {
if(res.data.code == 200){ if(res.data.code == 200){
this.$msg('加入购物车成功', {icon: 'success'}) this.$msg('加入购物车成功', {icon: 'success'})
this.getcarNum()
}else{ }else{
this.$msg('加入购物车失败', {icon: 'error'}) this.$msg('加入购物车失败', {icon: 'error'})
} }
@ -635,6 +630,7 @@
this.goods_detail = goods_detail; this.goods_detail = goods_detail;
this.pictures = [res.data.data.img]; this.pictures = [res.data.data.img];
this.is_collect = Boolean(res.data.data.is_collect) || false; this.is_collect = Boolean(res.data.data.is_collect) || false;
this.goods_content = this.formatRichText(goods_detail.content);
let type = 'mail'; let type = 'mail';
if(this.$isRight(goods_detail.is_largess)){ if(this.$isRight(goods_detail.is_largess)){
type = 'point'; type = 'point';
@ -1005,6 +1001,7 @@
padding: 0; padding: 0;
width: 88rpx; width: 88rpx;
position: relative; position: relative;
color: #555555;
&:first-child{ &:first-child{
padding-left: 0; padding-left: 0;
} }
@ -1013,6 +1010,7 @@
width: 50rpx; width: 50rpx;
font-size: 40rpx; font-size: 40rpx;
line-height: 1; line-height: 1;
color: #555555;
} }
} }
.btn1{ .btn1{

18
pages/store/cart/cart.vue

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

Loading…
Cancel
Save