|
@@ -15,12 +15,21 @@
|
|
|
</view>
|
|
|
<uni-load-more :status="loadingType"></uni-load-more>
|
|
|
</view>
|
|
|
+
|
|
|
+ <view class="cart">
|
|
|
+
|
|
|
+ </view>
|
|
|
+
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
|
|
|
import empty from '@/components/empty';
|
|
|
+ import {
|
|
|
+ getCartList,
|
|
|
+ } from '@/api/cart.js';
|
|
|
import {
|
|
|
getProducts,
|
|
|
cartAdd
|
|
@@ -32,6 +41,7 @@
|
|
|
limit: 20,
|
|
|
loadingType: 'more',
|
|
|
list: [],
|
|
|
+ total:0
|
|
|
};
|
|
|
},
|
|
|
components: {
|
|
@@ -40,13 +50,28 @@
|
|
|
},
|
|
|
onLoad() {
|
|
|
this.loadData();
|
|
|
+
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ this.loadCart();
|
|
|
},
|
|
|
- onShow() {},
|
|
|
onReachBottom() {
|
|
|
this.loadData();
|
|
|
},
|
|
|
onReady() {},
|
|
|
methods: {
|
|
|
+ async loadCart() {
|
|
|
+ let obj = this;
|
|
|
+ getCartList({
|
|
|
+ type:1
|
|
|
+ })
|
|
|
+ .then(function(e) {
|
|
|
+ obj.total = e.data.valid.length;
|
|
|
+ })
|
|
|
+ .catch(function(e) {
|
|
|
+ console.log(e);
|
|
|
+ });
|
|
|
+ },
|
|
|
loadData() {
|
|
|
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
|
|
|
return
|