Browse Source

优化

master
邓平艺 4 years ago
parent
commit
2d384bd75f
  1. 2
      components/lf-adModal/lf-adModal.vue
  2. 3
      components/lf-indexShopMatrix/lf-indexShopMatrix.vue
  3. 4
      components/lf-waterfall-pointgoods/lf-waterfall.vue
  4. 8
      components/lf-waterfall-shopdetails/lf-waterfall.vue
  5. 26
      pages/order/cashier/cashier.vue
  6. 18
      pages/order/confirm/confirm.vue
  7. 9
      pages/order/index/onlineorder.vue
  8. 32
      pages/order/newdetail/newdetail.vue
  9. 52
      pages/shop/searchList.vue
  10. 14
      pages/user/my/center.vue

2
components/lf-adModal/lf-adModal.vue

@ -10,7 +10,7 @@
</swiper-item>
</swiper>
<view class="close" @click="close">
<text class="lf-iconfont icon-shanchu"></text>
<text class="lf-iconfont icon-cuo1" style="color: #FFFFFF;"></text>
</view>
</view>
</view>

3
components/lf-indexShopMatrix/lf-indexShopMatrix.vue

@ -63,7 +63,6 @@
.item{
width: 165rpx;
height: 165rpx;
border: 1rpx solid #979797;
margin-right: 9rpx;
position: relative;
overflow: hidden;
@ -84,7 +83,7 @@
.shop{
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.1);
background-color: rgba(0,0,0,0.5);
display: flex;
flex-direction: column;
justify-content: center;

4
components/lf-waterfall-pointgoods/lf-waterfall.vue

@ -4,7 +4,7 @@
<template v-slot:left="{leftList}">
<view class="list-warter" v-for="(item, index) in leftList" :key="index">
<view @click="onClick(item.id)">
<u-lazy-load threshold="-450" border-radius="8px 8px 0 0" :height="!ifsale?333:0" :img-mode="ifsale?'aspectFill':''" :image="item.picture" :index="index">
<u-lazy-load threshold="600" border-radius="8px 8px 0 0" :height="!ifsale?333:0" :img-mode="ifsale?'aspectFill':''" :image="item.picture" :index="index">
<view class="list-label">已兑{{item.sale}}</view>
</u-lazy-load>
<view class="lf-p-20">
@ -22,7 +22,7 @@
<template v-slot:right="{rightList}">
<view class="list-warter" v-for="(item, index) in rightList" :key="index">
<view @click="onClick(item.id)">
<u-lazy-load threshold="-450" border-radius="8px 8px 0 0" :height="!ifsale?333:0" :img-mode="ifsale?'aspectFill':''" :image="item.picture" :index="index">
<u-lazy-load threshold="600" border-radius="8px 8px 0 0" :height="!ifsale?333:0" :img-mode="ifsale?'aspectFill':''" :image="item.picture" :index="index">
<view class="list-label">已兑{{item.sale}}</view>
</u-lazy-load>
<view class="lf-p-20">

8
components/lf-waterfall-shopdetails/lf-waterfall.vue

@ -4,7 +4,7 @@
<template v-slot:left="{leftList}">
<view class="list-warter" v-for="(item, index) in leftList" :key="index">
<view v-if="!item.is_ad" @click="onClick(item.id)">
<u-lazy-load threshold="-450" border-radius="8px 8px 0 0" :height="!ifsale?333:0" :img-mode="ifsale?'aspectFill':''" :image="item.picture" :index="index">
<u-lazy-load threshold="600" border-radius="8px 8px 0 0" :height="!ifsale?333:0" :img-mode="ifsale?'aspectFill':''" :image="item.picture" :index="index">
<view class="list-label" v-if="ifsale">已售{{item.sale}}</view>
</u-lazy-load>
<view class="lf-p-20">
@ -19,7 +19,7 @@
</view>
</view>
<view v-else @click="goAd(item.type,item.url)">
<u-lazy-load threshold="-450" border-radius="8px 8px 0 0" :image="item.picture" :index="index"></u-lazy-load>
<u-lazy-load threshold="600" border-radius="8px 8px 0 0" :image="item.picture" :index="index"></u-lazy-load>
<view class="lf-p-20">
<view class="list-title">
{{item.title}}
@ -135,7 +135,9 @@
},
clear() {
console.log('组件名',this.$refs)
this.$refs.uWaterfall[0].clear();
if(this.$isRight(this.$refs)){
this.$refs.uWaterfall[0].clear();
}
}
}
}

26
pages/order/cashier/cashier.vue

@ -20,25 +20,25 @@
</view>
</template>
</countdown-timer> -->
<countdown-time minute="5" second="0" :showDay="false" :showHour="false">
<countdown-time minute="5" second="0" :showDay="false" :showHour="false" color="#FF9D9D" splitorColor="#FF9D9D">
</countdown-time>
</view>
</view>
</view>
<view class="card lf-row-between" v-for="(item, index) in pay_list" :key="index">
<label class="card lf-row-between" v-for="(item, index) in pay_list" :key="index" style="padding: 16rpx 40rpx;">
<view>
<text class="lf-iconfont" :class="item.icon"></text>
<text class="lf-iconfont lf-font-50 lf-text-vertical" :class="item.icon" :style="{color: item.color}"></text>
<text class="lf-m-l-10 lf-font-28 lf-color-222">{{ item.name }}</text>
</view>
<radio-group @change="checkChange($event, index)">
<radio :checked="item.checked"></radio>
</radio-group>
</view>
</label>
</view>
<view class="fixed-btn" hover-class="lf-opacity" @click="confirm">立即支付</view>
<view class="fixed-agreement">购买须知</view>
<lf-pay-password v-if="show_pw" @comfirm="payComfirm" title="请输入支付密码"></lf-pay-password>
<lf-pay-password v-if="show_pw" @comfirm="payComfirm" title="请输入支付密码" buttonText="确认支付"></lf-pay-password>
</view>
</template>
@ -54,14 +54,16 @@
return {
pay_list: [{
name: '余额支付',
icon: 'icon--',
icon: 'icon-yuebao',
type: 'balance',
checked: false
checked: false,
color: '#15716E'
},{
name: '微信支付',
icon: 'icon--1',
icon: 'icon-weixinzhifu',
type: 'wx_lite',
checked: true
checked: true,
color: '#09BB07'
}],
time: new Date('2021/09/8 14:15:00').getTime() - new Date('2021/09/8 14:10:00').getTime(),
is_date_finish: false,
@ -114,7 +116,6 @@
//
payComfirm(event){
this.user_pw = event;
this.show_pw = false;
this.confirm();
},
//
@ -151,7 +152,6 @@
Authorization: this.token
}
}).then(res => {
console.log("-------------------", res)
res = res.data;
if (res.status) {
// this.formId = e.detail.formId || '';
@ -159,14 +159,14 @@
this.balanceCharge();
} else {
this.newcharge(true, res.data.charge);
}
} else {
this.newcharge(false, res.message);
this.show_pw = false;
}
})
}).catch(() => {
this.show_pw = false;
this.setData({
loading: false
});

18
pages/order/confirm/confirm.vue

@ -235,13 +235,19 @@
Authorization: this.token
}
}).then(res => {
let detail = res.data.data;
this.order_detail = detail;
this.address = res.data.data.address;
if(this.$isRight(detail.coupons)){
this.coupon_index = 0;
if(res.data.code == 200){
let detail = res.data.data;
this.order_detail = detail;
this.address = res.data.data.address;
if(this.$isRight(detail.coupons)){
this.coupon_index = 0;
}
this.calcAmount();
}else{
this.$msg(res.data.message || '生成订单失败').then(() => {
this.$toBack();
})
}
this.calcAmount();
uni.hideLoading()
}).catch(err => uni.hideLoading())
},

9
pages/order/index/onlineorder.vue

@ -168,10 +168,15 @@
return `calc(${this.scrollH}px - ${this.nav_height}px - 90rpx)`;
}
},
onLoad(){
onLoad(options){
let info = uni.getSystemInfoSync();
this.scrollH = info.screenHeight;
this.getData()
if(typeof options.current != 'undefined'){
this.current = Number(options.current) || 0;
this.getData()
}else{
this.getData()
}
},
methods: {
goDetails(type,id) {

32
pages/order/newdetail/newdetail.vue

@ -182,7 +182,7 @@
待付款
</view>
<view class="lf-flex">
<view class="btn-gray lf-m-r-20">取消订单</view>
<view class="btn-gray lf-m-r-20" @click="cancelOrder">取消订单</view>
<view class="btn-red" @click="$url('/pages/order/cashier/cashier?amount='+ order_details.total_yuan+'&order_no='+order_details.order_no)">立即付款</view>
</view>
@ -248,7 +248,8 @@
color: '#000000', //
}
},
logistics_data: {}
logistics_data: {},
show_count: 0
}
},
components: {
@ -265,6 +266,13 @@
this.searchLogistics();
}
},
onShow(){
this.show_count++;
if(this.show_count > 1){
this.getOrderDetails();
this.searchLogistics();
}
},
methods: {
searchLogistics() {
this.$http.get({
@ -290,6 +298,26 @@
this.show = false;
console.log("倒计时结束");
},
//
cancelOrder(){
this.$http.post({
api: 'api/shopping/order/cancel',
data: {
order_no: this.order_no
},
header: {
Authorization: this.$cookieStorage.get('user_token')
}
}).then(res => {
if(res.data.code == 200){
this.$msg('订单取消成功', {icon: 'success'}).then(() => {
this.$toBack();
})
}else{
this.$msg(res.data.message || '订单取消失败');
}
})
},
countDown(munite, second) {
let m = munite;
let s = second;

52
pages/shop/searchList.vue

@ -111,32 +111,38 @@
page: this.page
}
}).then(res => {
if(res.data.code == 200){
let goods = res.data.data.goods;
let brand = res.data.data.brand;
let isPage = this.$isRight(goods.next_page_url);
this.isPage = isPage;
let list = goods.data.map(item => {
return {
id: item.id,
original_price: item.min_market_price,
picture: item.img,
pictures: [item.img],
price: item.min_price,
sale: item.sale_count,
title: item.name
if(res.data.status){
// TODO
if(this.$isRight(res.data.data)){
let goods = res.data.data.goods;
let brand = res.data.data.brand;
let isPage = this.$isRight(goods.next_page_url);
this.isPage = isPage;
let list = goods.data.map(item => {
return {
id: item.id,
original_price: item.min_market_price,
picture: item.img,
pictures: [item.img],
price: item.min_price,
sale: item.sale_count,
title: item.name
}
})
if(this.page == 1){
this.goods_list = list;
}else{
this.goods_list.push(...list);
}
})
if(this.page == 1){
this.goods_list = list;
console.log("this.goods_list", this.goods_list)
this.brand_list = brand;
this.tab_list[1].name = `商户(${brand.length})`;
this.tab_list[0].name = `商品(${this.goods_list.length})`;
}else{
this.goods_list.push(...list);
this.$msg('该关键词没有数据哦~')
}
this.brand_list = brand;
this.tab_list[1].name = `商户(${brand.length})`;
this.tab_list[0].name = `商品(${this.goods_list.length})`;
}else{
this.$msg(res.data.message || '服务器错误,请稍后再试');
}

14
pages/user/my/center.vue

@ -75,7 +75,7 @@
<view class="order-tag lf-flex-wrap">
<view class="order-children"
v-for="(item, index) in order_tablist" :key="index"
@click="$url('/pages/order/index/onlineorder')">
@click="$url(item.path)">
<!-- <view class="function-tag"></view> -->
<view class="lf-iconfont lf-font-50" :class="item.icon"></view>
<view class="lf-color-black lf-font-28 lf-m-t-20">{{ item.name }}</view>
@ -124,16 +124,20 @@
nav_bg_color: 'transparent' ,//
order_tablist: [{
name: '待付款',
icon: 'icon-daifukuan'
icon: 'icon-daifukuan',
path: '/pages/order/index/onlineorder?current=1'
},{
name: '待发货',
icon: 'icon-31daifahuo'
icon: 'icon-31daifahuo',
path: '/pages/order/index/onlineorder?current=2'
},{
name: '待收货',
icon: 'icon-daishouhuo'
icon: 'icon-daishouhuo',
path: '/pages/order/index/onlineorder?current=3'
},{
name: '待提货',
icon: 'icon-tihuo'
icon: 'icon-tihuo',
path: '/pages/order/index/onlineorder?current=4'
}],
my_service_list: [{
name: '会员服务',

Loading…
Cancel
Save