add
This commit is contained in:
parent
e053e6f593
commit
35fc21e14e
|
@ -70,8 +70,7 @@
|
|||
cart_num: ''
|
||||
});
|
||||
const setData = (e) => {
|
||||
console.log(datas.value)
|
||||
|
||||
console.log(e)
|
||||
datas.value = e;
|
||||
}
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@
|
|||
"path": "order/order",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的订单",
|
||||
"enablePullDownRefresh": true,
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
<view v-if="frequentlyList.length>0" class="list">
|
||||
<view class="shop-item" v-for="(item, index) in frequentlyList" :key="index"
|
||||
@click="openGoodPopup(item)">
|
||||
<image class="shop-img" :src="item.imgs"></image>
|
||||
<image class="shop-img" :src="item.image"></image>
|
||||
<view class="shop-content" style="width: 490rpx;">
|
||||
<view class="title">
|
||||
<view class="name u-line-2">{{item.name}}</view>
|
||||
|
@ -69,7 +69,7 @@
|
|||
<view class="tip u-line-1">{{item.unit_name}}</view>
|
||||
</view>
|
||||
<view class="price-btn">
|
||||
<view class="price">¥{{item.sell}}</view>
|
||||
<view class="price">¥{{item.price}}</view>
|
||||
<view class="btn">
|
||||
<up-button size="small" plain color="#20b128"
|
||||
shape="circle">加入购物车</up-button>
|
||||
|
@ -187,7 +187,6 @@
|
|||
title: '请选择商品',
|
||||
icon: 'none'
|
||||
});
|
||||
console.log(cartList.value)
|
||||
cartList.value.forEach(item => {
|
||||
if (item.check) list.push(item.id);
|
||||
})
|
||||
|
@ -223,7 +222,7 @@
|
|||
};
|
||||
const changeGood = (data) => { // 确定选择商品重量
|
||||
showGoodPopup.value = false;
|
||||
addCart(data.product_id, data.cart_num);
|
||||
addCart(data.product_id || data.id, data.cart_num);
|
||||
}
|
||||
|
||||
const cartList = ref([]);
|
||||
|
|
|
@ -2,18 +2,17 @@
|
|||
<view class="content">
|
||||
<up-navbar placeholder style="z-index: 10080;">
|
||||
<template #left>
|
||||
<view style="font-size: 30rpx;font-weight: bold;" @click="test">惠农批发 </view>
|
||||
<view class="store-info" @click="navgo('/multipleShop/index/index')">
|
||||
<view style="display: flex;font-size: 30rpx;font-weight: bold;">
|
||||
{{STORE_INFO.name}}
|
||||
<up-icon name="arrow-right"></up-icon>
|
||||
</view>
|
||||
<view style="display: flex;font-size: 24rpx;color:#777777 ;">
|
||||
{{STORE_INFO.detailed_address}}
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</up-navbar>
|
||||
<view class="store-info" @click="navgo('/multipleShop/index/index')">
|
||||
<view style="display: flex;font-size: 30rpx;font-weight: bold;">
|
||||
{{STORE_INFO.name}}
|
||||
<up-icon name="arrow-right"></up-icon>
|
||||
</view>
|
||||
<view style="display: flex;font-size: 24rpx;color:#777777 ;">
|
||||
{{STORE_INFO.detailed_address}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="navbar">
|
||||
<view style="width: 400rpx;">
|
||||
<up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword"
|
||||
|
@ -547,6 +546,7 @@
|
|||
justify-content: space-between;
|
||||
font-size: 22rpx;
|
||||
color: #777;
|
||||
margin-top: 40rpx;
|
||||
|
||||
.nav-item {
|
||||
display: flex;
|
||||
|
@ -946,5 +946,6 @@
|
|||
|
||||
.store-info {
|
||||
margin: 0 0 20rpx 20rpx;
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
</style>
|
|
@ -16,7 +16,9 @@
|
|||
|
||||
<swiper class="swiper-box" :current="swiperCurrent" @animationfinish="animationfinish">
|
||||
<swiper-item class="swiper-item" v-for="(list, k) in orderList" :key="k">
|
||||
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="loadMoreGood">
|
||||
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="loadMoreGood"
|
||||
@refresherrefresh="refresherrefresh(1)" :refresher-triggered="triggered" refresher-enabled
|
||||
refresher-background="#F6F6F6">
|
||||
<view class="page-box">
|
||||
<view v-if="list.length>0" class="list">
|
||||
<good v-for="(item, index) in list" :datas="item" :key="index" :type="k"
|
||||
|
@ -105,14 +107,12 @@
|
|||
<script setup>
|
||||
import {
|
||||
onLoad,
|
||||
onUnload
|
||||
onUnload,
|
||||
onPullDownRefresh
|
||||
} from "@dcloudio/uni-app"
|
||||
import {
|
||||
ref
|
||||
} from 'vue';
|
||||
import {
|
||||
onPullDownRefresh
|
||||
} from "@dcloudio/uni-app"
|
||||
import good from "./component/good.vue";
|
||||
import orderCanclePopup from "@/components/orderCanclePopup.vue"
|
||||
import modal from "@/components/modal.vue"
|
||||
|
@ -149,7 +149,6 @@
|
|||
current
|
||||
}
|
||||
}) => {
|
||||
console.log('current', current)
|
||||
swiperCurrent.value = current;
|
||||
tabsActive.value = current;
|
||||
|
||||
|
@ -338,7 +337,7 @@
|
|||
[],
|
||||
[]
|
||||
])
|
||||
const getOrderList = (type = 0, status = '', paid = 1) => {
|
||||
const getOrderList = (type = 0, status = '', paid = 1, ifPullReFresh = false) => {
|
||||
if (where.value[type].loadend) return;
|
||||
where.value[type].loading = true;
|
||||
orderListApi({
|
||||
|
@ -353,6 +352,8 @@
|
|||
if (res.data.lists.length < where.value[type].page_size) where.value[type].loadend = true;
|
||||
where.value[type].page_no++;
|
||||
where.value[type].loading = false;
|
||||
if (ifPullReFresh) uni.stopPullDownRefresh();
|
||||
|
||||
}).catch(err => {
|
||||
where.value[type].loading = false;
|
||||
})
|
||||
|
@ -367,15 +368,17 @@
|
|||
}
|
||||
|
||||
// 搜索
|
||||
const searchOn = () => {
|
||||
const searchOn = (ifPullReFresh = false) => {
|
||||
orderList.value[+swiperCurrent.value] = [];
|
||||
where.value[+swiperCurrent.value].page_no = 1;
|
||||
where.value[+swiperCurrent.value].loadend = false;
|
||||
if (swiperCurrent.value == 0) getOrderList(0, '', ''); //全部
|
||||
if (swiperCurrent.value == 1) getOrderList(1, '', 0); //代付款
|
||||
if (swiperCurrent.value == 2) getOrderList(2, 1, 1); //待核销
|
||||
if (swiperCurrent.value == 3) getOrderList(3, 2, 1); //已核销
|
||||
if (swiperCurrent.value == 4) getOrderList(4, -1, 1); //退款
|
||||
if (swiperCurrent.value == 0) getOrderList(0, '', '', ifPullReFresh); //全部
|
||||
if (swiperCurrent.value == 1) getOrderList(1, '', 0, ifPullReFresh); //代付款
|
||||
if (swiperCurrent.value == 2) getOrderList(2, 1, 1, ifPullReFresh); //待核销
|
||||
if (swiperCurrent.value == 3) getOrderList(3, 2, 1, ifPullReFresh); //已核销
|
||||
if (swiperCurrent.value == 4) getOrderList(4, -1, 1, ifPullReFresh); //退款
|
||||
|
||||
|
||||
}
|
||||
|
||||
let back = 0;
|
||||
|
@ -413,11 +416,14 @@
|
|||
uni.$off('reLoadOrderList', reloadAll)
|
||||
})
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
const triggered = ref(false);
|
||||
const refresherrefresh = (type = 1) => {
|
||||
triggered.value = true;
|
||||
searchOn()
|
||||
console.log(454)
|
||||
uni.stopPullDownRefresh()
|
||||
})
|
||||
setTimeout(() => {
|
||||
triggered.value = false;
|
||||
}, 500)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
|
Loading…
Reference in New Issue