Commit ad059e61 authored by zhangjianguo's avatar zhangjianguo

1

parent b9439f0f
......@@ -106,17 +106,14 @@ export default {
},
setFavorite() {
let h=this.apiheader()
this.request(
{
url: "",
data: {
r: this.favorStatus
? "api/user/favorite-remove"
: "api/user/favorite-add",
goods_id: this.goodId,
},
header:h
},
this.request2(
{
url: '/api/AppletUser/SetUserCollectionInfo',
data: {
GoodsId:this.goodId
}
},
(res) => {
this.favorStatus = !this.favorStatus;
}
......
......@@ -156,7 +156,7 @@ export default {
data: this.msg
},
res => {
uni.hideNavigationBarLoading();
if(res.resultCode==1){
this.loading = false;
......
<template>
<view class="favoriteStyle" :style="{'height':contentHeight}" v-if="!isloading">
<u-tabs :list="list" :is-scroll="false" :current="current" @change="change" :active-color='mainColor'></u-tabs>
<template>
<view v-show="current==0" style="
<template >
<view v-if="current==0 && goodslist.length>0" style="
height: calc(100vh - 50px);
width: calc(100vw - 20px);
margin-left: 10px;
......@@ -14,26 +14,27 @@
:scroll-y="true"
:enable-back-to-top="true"
:enable-flex="true"
@scrolltolower="lower"
style="height: 100%; padding-bottom: 0px;"
>
<view class="u-good-list" >
<u-row gutter="20">
<u-col span="6" v-for="(cx, ci) in goodslist" :key="ci">
<view class="good" @click="clickHandler(cx.goods.page_url)">
<view class="good" @click="clickHandler(cx)">
<view class="good-img">
<image
mode="aspectFit"
:src="cx.goods.cover_pic"
:src="cx.CoverImage"
style="width: 100%; height: 100%;"
/>
</view>
<view class="good-name">{{ cx.goods.name }}</view>
<view class="good-name">{{ cx.Name }}</view>
<view class="good-info">
<view class="price" :style="{ color: mainColor }">{{
cx.goods.price_content
<view class="price" :style="{ color: mainColor }">{{
cx.SellingPrice
}}</view>
<view class="sell">{{ cx.goods.sales }}</view>
<view class="cart">
<view class="sell">已售{{ cx.SalesNum }}</view>
<view class="cart" @click.stop="showSkuHandler(cx)">
<u-icon name="cart-o" size="40" :color="mainColor" />
</view>
</view>
......@@ -41,6 +42,14 @@
</u-col>
</u-row>
</view>
<u-loadmore
:status="status"
:load-text="loadText"
:font-size="24"
:margin-top="20"
:margin-bottom="20"
bg-color="#f3f4f6"
/>
</scroll-view>
<u-empty v-if="current==0&& goodslist.length==0" text="没有任何收藏商品哦~" mode="favor"></u-empty>
</view>
......@@ -55,12 +64,14 @@
</view>
</template>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo"></auth>
<good-sku v-if="showSku" :option-type="2" borderRadius="20" v-model="showSku" :good="sku"></good-sku>
<!-- <auth v-if="showAuth" @changeuserinfo="reloadUserinfo"></auth> -->
</view>
</template>
<script>
import auth from "../../components/auth/index.vue";
import goodSku from '../../components/goods/goodsku.vue';
export default {
data() {
return {
......@@ -73,14 +84,28 @@
{name: '商品'},
{name: '专题'},
],
msg:{
pageIndex: 1,
pageSize:10,
Name:''
},
sku: {},
showSku: false,
goodslist:[],
topiclist:[],
current:0
current:0,
page_count:1,
status: "loadmore",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多优惠券了",
},
}
},
components:{
auth,
goodSku,
},
created(){
this.contentHeight = this.$utils.calcContentHeight(-40)+'px';
......@@ -114,66 +139,75 @@
},
methods: {
// 购物车
showSkuHandler(g) {
g.id= g.Id
console.log('g', g);
this.sku = g;
this.showSku = true;
},
change(index) {
this.current = index;
if(index==1){
// this.gettopic()
}else{
this.gettopic()
}else if(index==0){
this.msg.pageIndex = 1;
this.goodslist = [];
this.init()
}
},
init(){
this.loading = false;
uni.showNavigationBarLoading();
let h = this.apiheader();
this.request(
{
url: "",
header:h,
data: {
r: "api/user/my-favorite-goods",
},
},
(res) => {
uni.hideNavigationBarLoading()
this.isloading = false;
this.goodslist = res.data.list
}
uni.showLoading({
title: '加载中'
});
this.request2(
{
url: '/api/AppletUser/GetUserCollectionPageList',
data: this.msg
},
res => {
uni.hideLoading();
if(res.resultCode==1){
this.goodslist = this.goodslist.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.status = "nomore";
}
}
}
);
},
gettopic(){ //专题数据
this.loading = false;
uni.showNavigationBarLoading();
let h = this.apiheader();
uni.showLoading({
title: '加载中'
});
setTimeout(()=>{
uni.hideLoading();
},1000)
this.request(
{
url: "",
header:h,
data: {
r: "api/user/my-favorite-topic",
},
},
(res) => {
uni.hideNavigationBarLoading()
this.isloading = false;
this.topiclist = res.data.list
}
);
},
reloadUserinfo() {
this.u = uni.getStorageSync("userinfo");
this.showAuth=false
},
clickHandler(url) {
clickHandler(cx) {
uni.navigateTo({
url: url,
url: '/pages/goods/goods?GoodsId='+cx.Id,
});
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.init();
} else {
this.status = "nomore";
}
},
}
}
</script>
......
......@@ -40,36 +40,39 @@
:enable-flex="true"
@scrolltolower="lower"
:style="{ height: '100%' }">
<view style="display: flex;flex-direction: column;align-items: center;">
<view v-for="(item, index) in g" :key="index" style="width: 100%;margin-bottom: 10rpx;">
<Text style='padding-left: 2.5%;margin: 20rpx 0;color: #c8c9cc;'>{{item.date}}</Text>
<view style="display: flex;flex-direction: column;align-items: center;width: 100%;">
<!-- <view v-for="(cx, ci) in g" :key="ci" style="width: 100%;margin-bottom: 10rpx;"> -->
<view class="contentBox">
<view class="cBox_item" v-for="(cx, ci) in item.goods" :key="ci" >
<view class="good-img" @click="clickHandler(cx.goods_id)">
<image :src="cx.goodsWarehouse.cover_pic" style="width: 100%; height: 100%;" />
<image src="../../../static/images/icon/plugins-out.png" v-if="item.goods_num==0"
style="width: 100%; height: 100%;position: absolute;left:0;top:0;background: #000;opacity: 0.6;" />
<view class="cBox_item" v-for="(cx, ci) in g" :key="ci" >
<view class="good-img" @click="clickHandler(cx.Id)">
<image :src="cx.GoodsImgPath" style="width: 100%; height: 100%;" />
<!-- 如果此商品售完 -->
<!-- <image src="../../../static/images/icon/plugins-out.png" v-if="item.goods_num==0"
style="width: 100%; height: 100%;position: absolute;left:0;top:0;background: #000;opacity: 0.6;" /> -->
</view>
<view class="good-info">
<Text class='good-name' @click="clickHandler(cx.goods_id)">{{cx.goodsWarehouse.name}}</Text>
<Text class='good-name' @click="clickHandler(cx.Id)">{{cx.GoodsName}}</Text>
<view style="display: flex;flex-direction: row;align-items: center;justify-content: space-between;">
<Text :style="{'color':mainColor}">¥{{cx.price}}</Text>
<u-icon name="ellipsis" color="#c8c9cc" size="40" @click='operation(cx,index,ci)'></u-icon>
<Text :style="{'color':mainColor}">¥{{cx.Price}}</Text>
<u-icon name="ellipsis" color="#c8c9cc" size="40" @click.stop='operation(cx,index,ci)'></u-icon>
</view>
</view>
</view>
</view>
</view>
<!-- </view> -->
</view>
<u-divider
contentPosition="center"
v-if="isover"
:margin-top="20"
:margin-bottom="20"
bg-color='#f3f4f6'
>没有更多足迹了</u-divider>
</scroll-view>
<u-loadmore
:status="status"
:load-text="loadText"
:font-size="24"
:margin-top="20"
:margin-bottom="20"
bg-color="#f3f4f6"
/>
</scroll-view>
</view>
<!-- <auth v-if="showAuth" @changeuserinfo="reloadUserinfo"></auth> -->
......@@ -119,6 +122,7 @@
:show-title="false"
@confirm="confirm"
></u-modal>
<u-toast ref="uToast" />
</view>
......@@ -160,10 +164,16 @@
u:{},
msg:{
pageIndex:1,
pageSize:15,
pageSize:18,
StartTime:'',
EndTime:'',
},
status: "loadmore",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多足迹了",
},
}
},
components:{
......@@ -203,71 +213,40 @@
},
methods: {
init(){
this.loading=true
this.isover = false;
this.loading2 = true;
let h=this.apiheader()
uni.showLoading({
title: '加载中'
});
this.msg.StartTime=this.start_time;
this.msg.EndTime=this.end_time;
console.log("this.msg",this.msg)
this.request2(
{
url: '/api/AppletUser/GetUserShippingAddressList',
url: '/api/AppletUser/GetUserFootMarkPageList',
data: this.msg
},
res => {
uni.hideNavigationBarLoading();
console.log("res",res);
uni.hideLoading();
if(res.resultCode==1){
if(res.data.pageData.length>0){
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.isover = true;
}
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.status = "nomore";
}
this.isloading = false;
this.list = res.data.list;
}
}
);
// this.request(
// {
// url: "",
// header:h,
// data: {
// r: "api/footprint/footprint",
// start_time: this.start_time,
// end_time: this.end_time,
// page: this.page,
// }
// },
// res => {
// if(res.list.length>0){
// this.g = this.g.concat(res.list);
// this.page_count = res.pagination.page_count;
// if (this.page_count == 1) {
// this.isover = true;
// }
// }
// this.loading = false;
// this.loading2 = false;
// }
// );
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
if (!this.loading2) {
this.msg.pageIndex++;
this.init();
}
} else {
this.isover = true;
}
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.init();
} else {
this.status = "nomore";
}
},
reloadUserinfo() {
this.u = uni.getStorageSync("userinfo");
......@@ -337,7 +316,7 @@
},
clickHandler(id) {
uni.navigateTo({
url: '/pages/goods/goods?id='+id,
url: '/pages/goods/goods?GoodsId='+id,
});
},
Collection(){
......
......@@ -307,6 +307,7 @@ export default {
this.loading = false;
this.initComments();
this.initRecommend();
this.setFootMarkInfo(res.data.goods.id)
} else {
this.isExsitGoods = false;
}
......@@ -364,6 +365,19 @@ export default {
}
);
},
setFootMarkInfo(id){
this.request2(
{
url: "/api/AppletUser/SetUserFootMarkInfo",
data: {
GoodsId: id,
},
},
(res) => {
}
);
},
joinCar() {
this.showSku = true;
this.ot = 0;
......
......@@ -23,24 +23,24 @@
:scroll-y="true"
:enable-back-to-top="true"
:enable-flex="true"
@scrolltolower="lower"
:style="{ height: '100%' }"
>
<view class="interDList" v-for="(x, i) in g" :key="i">
<Text>{{x.desc}}</Text>
<Text>{{x.Description}}</Text>
<view style="display: flex;align-items: center;justify-content: space-between;width: 100%;margin-top: 5px;">
<Text :style="{color:x.type==1?mainColor:secondary}">{{x.type==1?'+':'-'}}{{x.integral}}积分</Text>
<Text style='font-size: 12px; color: #B5B5B5;'>时间:{{x.created_at}}</Text>
<Text :style="{color:x.Type==1?mainColor:secondary}">{{x.Type==1?'+':'-'}}{{x.Integral}}积分</Text>
<Text style='font-size: 12px; color: #B5B5B5;'>时间:{{x.CreateDate}}</Text>
</view>
</view>
<u-divider
contentPosition="center"
v-if="isover"
:margin-top="20"
:margin-bottom="20"
bg-color="#f3f4f6"
>没有更多卡券了</u-divider
>
<u-loadmore
:status="status"
:load-text="loadText"
:font-size="24"
:margin-top="20"
:margin-bottom="20"
bg-color="#f3f4f6"
/>
</scroll-view>
</view>
......@@ -71,6 +71,12 @@ export default {
{ name: "支出" },
],
msg:{
pageIndex: 1,
pageSize:10,
Type:0
},
mainColor: "",
secondary:'',
contentHeight: 0,
......@@ -79,6 +85,12 @@ export default {
g: [],
loading: false,
isover: false,
status: "loadmore",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多优惠券了",
},
};
},
created() {
......@@ -100,57 +112,50 @@ export default {
uni.setNavigationBarTitle({
title: this.pageTitle,
});
this.loading = true;
this.init();
},
onLoad: function (option) {
//option为object类型,会序列化上个页面传递的参数
// this.current = option.status;
this.loading = true;
this.init();
},
methods: {
change(index) {
this.current = index;
this.page = 1;
this.msg.pageIndex = 1;
this.g = [];
this.loading = true;
this.init();
},
init() {
this.isover = false;
let h = this.apiheader();
this.request(
{
url: "",
header: h,
data: {
r: "api/integral-log/index",
type: this.current+1,
},
},
(res) => {
this.loading = false;
if(res.data.list.length>0){
this.g = res.data.list;
// this.page_count = res.data.pagination.page_count;
// if (this.page_count == 1) {
// this.isover = true;
// }
}
}
this.msg.Type = this.current+1
this.request2(
{
url: '/api/AppletUser/GetMemberIntegralPageList',
data: this.msg
},
res => {
if(res.resultCode==1){
this.loading = false;
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.status = "nomore";
}
}
}
);
},
lower(e) {
if (this.page < this.page_count) {
this.page++;
this.init();
} else {
this.isover = true;
}
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.init();
} else {
this.status = "nomore";
}
},
},
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment