Browse Source

添加足迹页面

zyh
xuwenbo 4 years ago
parent
commit
4d25381a0c
  1. 2
      manifest.json
  2. 4
      pages/activity/GoodsGroup/index.vue
  3. 102
      pages/shop/GoodsFoot/index.vue
  4. BIN
      static/images/group_list_bg.png

2
manifest.json

@ -1,5 +1,5 @@
{ {
"name": "yshopmall", "name" : "yshop商城演示版",
"appid" : "__UNI__C7A519E", "appid" : "__UNI__C7A519E",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",

4
pages/activity/GoodsGroup/index.vue

@ -4,7 +4,7 @@
<scroll-view class="scroll-box" scroll-y enable-back-to-top scroll-with-animation @scrolltolower="loadMore"> <scroll-view class="scroll-box" scroll-y enable-back-to-top scroll-with-animation @scrolltolower="loadMore">
<view class="group-wrap"> <view class="group-wrap">
<view class="group-head x-bc"> <view class="group-head x-bc">
<text class="group-head__title">爆款推荐</text> <text class="group-head__title">爆款拼团</text>
<text class="group-head__notice">省钱省心限时拼</text> <text class="group-head__notice">省钱省心限时拼</text>
</view> </view>
<view class="group-box"> <view class="group-box">
@ -129,7 +129,7 @@ export default {
<style lang="scss"> <style lang="scss">
.group-wrap { .group-wrap {
background: url('~@/static/images/group_list_bg.png') no-repeat; background: url('~@/static/images/index-bg.png') no-repeat;
background-size: 100% 374rpx; background-size: 100% 374rpx;
} }
.group-head { .group-head {

102
pages/shop/GoodsFoot/index.vue

@ -0,0 +1,102 @@
<template>
<view ref="container">
<view class="collectionGoods" v-if="collectProductList.length > 0">
<view
class="item acea-row row-between-wrapper"
v-for="(item, collectProductListIndex) in collectProductList"
:key="collectProductListIndex"
@click="goGoodsCon(item)"
>
<view class="pictrue">
<image :src="item.image" />
</view>
<view class="text acea-row row-column-between">
<view class="infor line1">{{ item.storeName }}</view>
<view class="acea-row row-between-wrapper">
<view class="money font-color-red">{{ item.price }}</view>
<view class="delete" @tap.stop="delCollection(collectProductListIndex)">删除</view>
</view>
</view>
</view>
</view>
<Loading :loaded="loadend" :loading="loading"></Loading>
<view
class="noCommodity"
style="background-color:#fff;"
v-if="collectProductList.length < 1 && page > 1"
>
<view class="noPictrue">
<image src="@/static/images/noCollection.png" class="image" />
</view>
<Recommend></Recommend>
</view>
</view>
</template>
<script>
import Recommend from "@/components/Recommend";
import { getCollectUser, getCollectDel } from "@/api/user";
import Loading from "@/components/Loading";
export default {
name: "GoodsCollection",
components: {
Recommend,
Loading
},
props: {},
data: function() {
return {
page: 1,
limit: 20,
type:'foot',
collectProductList: [],
loadTitle: "",
loading: false,
loadend: false
};
},
mounted: function() {
this.get_user_collect_product();
},
onReachBottom() {
!this.loading && this.get_user_collect_product();
},
methods: {
goGoodsCon(item) {
this.$yrouter.push({
path: "/pages/shop/GoodsCon/index",
query: { id: item.pid }
});
},
get_user_collect_product: function() {
let that = this;
if (that.loading) return; //false
if (that.loadend) return; //false
that.loading = true;
getCollectUser(that.page, that.limit,that.type).then(res => {
that.loading = false;
//apply();js;
that.collectProductList.push.apply(that.collectProductList, res.data);
that.loadend = res.data.length < that.limit; //
that.page = that.page + 1;
});
},
//
delCollection: function(index) {
let that = this,
id = that.collectProductList[index].pid,
category = that.collectProductList[index].category;
getCollectDel(id, category).then(function() {
uni.showToast({
title: "删除成功",
icon: "success",
duration: 2000,
complete: () => {
that.collectProductList.splice(index, 1);
that.$set(that, "collectProductList", that.collectProductList);
}
});
});
}
}
};
</script>

BIN
static/images/group_list_bg.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Loading…
Cancel
Save