优化3.0功能

This commit is contained in:
gaoxs
2020-07-14 16:10:44 +08:00
parent ae5860c94e
commit 963152460c
15 changed files with 366 additions and 319 deletions

View File

@ -43,11 +43,11 @@ export default {
// // 先校验用户是否授权,如果没有授权,显示授权按钮
},
onHide() {
this.UPDATE_AUTHORIZATIONPAGE(false);
this.updateAuthorizationPage(false);
this.changeAuthorization(false);
},
onUnload() {
this.UPDATE_AUTHORIZATIONPAGE(false);
this.updateAuthorizationPage(false);
this.changeAuthorization(false);
},
methods: {

View File

@ -51,15 +51,7 @@
</view>
</view> -->
<!-- <view class="wrapper hot" v-if="likeInfo.length > 0"> -->
<view class="nav acea-row">
<view @click="goWxappUrl(item)" class="item" v-for="(item, menusIndex) in menus" :key="menusIndex">
<view class="pictrue">
<image :src="item.pic" />
</view>
<view>{{ item.name }}</view>
</view>
</view>
<uni-notice-bar scrollable="true" single="true" speed="30" showIcon="true" :text="singNew.info"></uni-notice-bar>
<uni-notice-bar scrollable="true" @click="goRoll(singNew)" single="true" speed="10" showIcon="true" :text="singNew.info"></uni-notice-bar>
<view class="wrapper hot" v-if="bastList.length > 0">
<image class="bg" src="../../static/images/index-bg.png" mode="widthFix"></image>
<view class="title no-border acea-row row-between-wrapper">
@ -130,17 +122,17 @@
</view>
</view>
<view class="wrapper" v-if="benefit.length > 0">
<view class="title acea-row row-between-wrapper">
<view class="text">
<view class="title acea-row row-center">
<view class="text text-center">
<div class="name line1 new-name">
<span class="iconfont icon-shoucang"></span>
<span class="txt">猜你喜欢</span>
</div>
</view>
<view @click="goGoodsPromotion(4)" class="more">
<!-- <view @click="goGoodsPromotion(4)" class="more">
更多
<text class="iconfont icon-jiantou"></text>
</view>
</view> -->
</view>
</view>
<PromotionGood :benefit="benefit"></PromotionGood>

View File

@ -161,7 +161,7 @@
<view class="item acea-row row-between">
<view>下单时间</view>
<view class="conter">
<data-format :date="orderInfo.addTime"></data-format>
{{ orderInfo.createTime }}
</view>
</view>
<view class="item acea-row row-between">

View File

@ -182,6 +182,7 @@
:price="orderPrice.totalPrice"
:checked="usableCoupon.id"
@checked="changeCoupon"
:cartid="cartid"
></CouponListWindow>
<AddressWindow
@checked="changeAddress"
@ -341,7 +342,8 @@ export default {
shipping_type: 0,
contacts: "",
contactsTel: "",
storeSelfMention: 0
storeSelfMention: 0,
cartid: ""
};
},
computed: mapGetters(["userInfo", "storeItems"]),
@ -360,8 +362,14 @@ export default {
let that = this;
this.$store.dispatch("getUser", true);
that.getCartInfo();
if (that.$yroute.query.pinkid !== undefined)
console.log(that.$yroute);
if (that.$yroute.query.pinkid !== undefined) {
that.pinkId = that.$yroute.query.pinkid;
}
if (that.$yroute.query.id !== undefined) {
that.cartid = that.$yroute.query.id;
console.log(that.cartid)
}
},
methods: {
showStoreList() {

View File

@ -67,7 +67,9 @@ export default {
picList: [],
activePic: 0,
numberPic: "",
paid_price: ""
paid_price: "",
rechar_id: 0
};
},
computed: mapGetters(["userInfo"]),
@ -84,6 +86,7 @@ export default {
.then(res => {
this.picList = res.data.recharge_price_ways || [];
if (this.picList[0]) {
this.rechar_id = this.picList[0].id;
this.paid_price = this.picList[0].value.price;
this.numberPic = this.picList[0].value.give_price;
}
@ -103,10 +106,12 @@ export default {
picCharge(idx, item) {
this.activePic = idx;
if (idx == this.picList.length) {
this.rechar_id = 0;
this.paid_price = "";
this.numberPic = "";
} else {
this.money = "";
this.rechar_id = item.id;
this.paid_price = item.value.give_price;
this.numberPic = item.value.price;
}
@ -140,9 +145,9 @@ export default {
}
rechargeWechat({
price: prices,
// from: that.from,
from: that.from,
paidPrice: paid_price
paid_price: paid_price,
rechar_id: that.rechar_id
})
.then(res => {
console.log(res);

View File

@ -8,7 +8,7 @@
<view>总资产()</view>
<view class="money">{{ now_money }}</view>
</view>
<navigator url="/pages/user/Recharge/index" class="recharge font-color-red">充值</navigator>
<!-- <navigator url="/pages/user/Recharge/index" class="recharge font-color-red">充值</navigator> -->
</view>
<view class="cumulative acea-row row-top">
<view class="item">

View File

@ -1,25 +1,31 @@
<template>
<view ref="container">
<view class="coupon-list" v-if="couponsList.length > 0">
<view
<div class="coupon-list" v-if="couponsList.length > 0">
<div
class="item acea-row row-center-wrapper"
v-for="(item, couponsListIndex) in couponsList"
:key="couponsListIndex"
v-cloak
v-for="(item, index) in couponsList"
:key="index"
>
<view class="money" :class="item._type === 0 ? 'moneyGray' : ''">
<text class="num">{{ item.couponPrice }}</text>
</view>
<view class="text">
<view class="condition line1">{{ item.couponTitle }}</view>
<view class="data acea-row row-between-wrapper">
<view v-if="item.endTime === 0">不限时</view>
<view v-else><data-format-t :date="item.addTime"></data-format-t> - <data-format-t :date="item.endTime"></data-format-t></view>
<view class="bnt gray" v-if="item._type === 0">{{ item._msg }}</view>
<view class="bnt bg-color-red" v-else>{{ item._msg }}</view>
</view>
</view>
</view>
</view>
<div class="money" :class="item._type === 0 ? 'moneyGray' : ''">
<div>
<span class="num">{{ item.couponPrice }}</span>
</div>
<div class="pic-num">{{ item.useMinPrice }}元可用</div>
</div>
<div class="text">
<div class="condition line1">
{{ item.couponTitle }}
</div>
<div class="data acea-row row-between-wrapper">
<div v-if="item.endTime === 0">不限时</div>
<div v-else>{{ item.createTime }}-{{ item.endTime }}</div>
<div class="bnt gray" v-if="item._type === 0">{{ item._msg }}</div>
<div class="bnt bg-color-red" v-else>{{ item._msg }}</div>
</div>
</div>
</div>
</div>
<!--暂无优惠券-->
<view
class="noCommodity"

View File

@ -1,242 +1,249 @@
<template>
<view class="promoter-list" ref="container">
<view class="header">
<view class="promoterHeader bg-color-red">
<view class="headerCon acea-row row-between-wrapper">
<view>
<view class="name">推广人数</view>
<view>
<text class="num">{{ first + second }}</text>
<text></text>
</view>
</view>
</view>
</view>
<view class="nav acea-row row-around">
<view class="item" :class="screen.grade == 0 ? 'on' : ''" @click="checkGrade(0)">
一级({{ first }})
</view>
<view class="item" :class="screen.grade == 1 ? 'on' : ''" @click="checkGrade(1)">
({{ second }})
</view>
</view>
<view class="search acea-row row-between-wrapper">
<form @submit.prevent="submitForm">
<view class="input">
<input placeholder="点击搜索会员名称" v-model="screen.keyword" />
<text class="iconfont icon-guanbi"></text>
</view>
</form>
<view class="iconfont icon-sousuo2"></view>
</view>
</view>
<view class="list">
<view class="sortNav acea-row row-middle" :class="fixedState === true ? 'on' : ''">
<view class="sortItem" @click="sort('childCount')">
团队排序
<image src="@/static/images/sort1.png" v-if="childCount == 1" />
<image src="@/static/images/sort2.png" v-if="childCount == 2" />
<image src="@/static/images/sort3.png" v-if="childCount == 3" />
</view>
<view class="sortItem" @click="sort('numberCount')">
金额排序
<image src="@/static/images/sort1.png" v-if="numberCount == 1" />
<image src="@/static/images/sort2.png" v-if="numberCount == 2" />
<image src="@/static/images/sort3.png" v-if="numberCount == 3" />
</view>
<view class="sortItem" @click="sort('orderCount')">
订单排序
<image src="@/static/images/sort1.png" v-if="orderCount == 1" />
<image src="@/static/images/sort2.png" v-if="orderCount == 2" />
<image src="@/static/images/sort3.png" v-if="orderCount == 3" />
</view>
</view>
<view :class="fixedState === true ? 'sortList' : ''">
<view class="item acea-row row-between-wrapper" v-for="(val, spreadListIndex) in spreadList" :key="spreadListIndex">
<view class="picTxt acea-row row-between-wrapper">
<view class="pictrue">
<image :src="val.avatar" />
</view>
<view class="text">
<view class="name line1">{{ val.nickname }}</view>
<view>加入时间: {{ val.time }}</view>
</view>
</view>
<view class="right">
<view>
<text class="font-color-red">{{ val.childCount }}</text> 人
</view>
<view>{{ val.orderCount }}</view>
<view>{{ val.numberCount ? val.numberCount : 0 }}</view>
</view>
</view>
</view>
</view>
<Loading :loaded="loaded" :loading="loading"></Loading>
</view>
<view class="promoter-list" ref="container">
<view class="header">
<view class="promoterHeader bg-color-red">
<view class="headerCon acea-row row-between-wrapper">
<view>
<view class="name">推广人数</view>
<view>
<text class="num">{{ first + second||'0' }}</text>
<text></text>
</view>
</view>
</view>
</view>
<view class="nav acea-row row-around">
<view
class="item"
:class="screen.grade == 0 ? 'on' : ''"
@click="checkGrade(0)"
>({{ first||'0' }})</view>
<view
class="item"
:class="screen.grade == 1 ? 'on' : ''"
@click="checkGrade(1)"
>二级({{ second||'0' }})</view>
</view>
<view class="search acea-row row-between-wrapper">
<form @submit.prevent="submitForm">
<view class="input">
<input placeholder="点击搜索会员名称" v-model="screen.keyword" />
<text class="iconfont icon-guanbi"></text>
</view>
</form>
<view class="iconfont icon-sousuo2"></view>
</view>
</view>
<view class="list">
<view class="sortNav acea-row row-middle" :class="fixedState === true ? 'on' : ''">
<view class="sortItem" @click="sort('childCount')">
团队排序
<image src="@/static/images/sort1.png" v-if="childCount == 1" />
<image src="@/static/images/sort2.png" v-if="childCount == 2" />
<image src="@/static/images/sort3.png" v-if="childCount == 3" />
</view>
<view class="sortItem" @click="sort('numberCount')">
金额排序
<image src="@/static/images/sort1.png" v-if="numberCount == 1" />
<image src="@/static/images/sort2.png" v-if="numberCount == 2" />
<image src="@/static/images/sort3.png" v-if="numberCount == 3" />
</view>
<view class="sortItem" @click="sort('orderCount')">
订单排序
<image src="@/static/images/sort1.png" v-if="orderCount == 1" />
<image src="@/static/images/sort2.png" v-if="orderCount == 2" />
<image src="@/static/images/sort3.png" v-if="orderCount == 3" />
</view>
</view>
<view :class="fixedState === true ? 'sortList' : ''">
<view
class="item acea-row row-between-wrapper"
v-for="(val, spreadListIndex) in spreadList"
:key="spreadListIndex"
>
<view class="picTxt acea-row row-between-wrapper">
<view class="pictrue">
<image :src="val.avatar" />
</view>
<view class="text">
<view class="name line1">{{ val.nickname }}</view>
<view>加入时间: {{ val.time }}</view>
</view>
</view>
<view class="right">
<view>
<text class="font-color-red">{{ val.childCount }}</text>人
</view>
<view>{{ val.orderCount }} 单</view>
<view>{{ val.numberCount ? val.numberCount : 0 }} 元</view>
</view>
</view>
</view>
</view>
<Loading :loaded="loaded" :loading="loading"></Loading>
</view>
</template>
<script>
import {
getSpreadUser
} from "@/api/user";
import Loading from "@/components/Loading";
export default {
name: "PromoterList",
components: {
Loading
},
props: {},
data: function() {
return {
fixedState: false,
screen: {
page: 1,
limit: 15,
grade: 0,
keyword: "",
sort: ""
},
childCount: 2,
numberCount: 2,
orderCount: 2,
loaded: false,
loading: false,
spreadList: [],
loadTitle: "",
first: "",
second: ""
};
},
mounted: function() {
this.getSpreadUsers();
},
onReachBottom() {
!this.loading && this.getSpreadUsers();
},
watch: {
"screen.sort": function() {
this.screen.page = 0;
this.loaded = false;
this.loading = false;
this.spreadList = [];
this.getSpreadUsers();
}
},
methods: {
handleScroll: function() {
// var scrollTop =
// document.documentElement.scrollTop || document.body.scrollTop;
// var offsetTop = document.querySelector(".header").clientHeight;
// if (scrollTop >= offsetTop) {
// this.fixedState = true;
// } else {
// this.fixedState = false;
// }
},
submitForm: function() {
this.screen.page = 0;
this.loaded = false;
this.loading = false;
this.spreadList = [];
this.getSpreadUsers();
},
getSpreadUsers: function() {
let that = this,
screen = that.screen;
if (that.loaded || that.loading) return;
that.loading = true;
getSpreadUser(screen).then(
res => {
that.loading = false;
that.spreadList.push.apply(that.spreadList, res.data.list);
that.loaded = res.data.list.length < that.screen.limit; //判断所有数据是否加载完成;
that.loadTitle = that.loaded ? "人家是有底线的" : "上拉加载更多";
that.screen.page = that.screen.page + 1;
that.first = res.data.total;
that.second = res.data.totalLevel;
},
err => {
uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message,
icon: 'none',
duration: 2000
});
},
300
);
},
checkGrade: function(val) {
if (val == this.screen.grade) return;
else {
this.screen.page = 1;
this.screen.grade = val;
this.loading = false;
this.loaded = false;
this.spreadList = [];
this.getSpreadUsers();
}
},
sort: function(types) {
let that = this;
switch (types) {
case "childCount":
if (that.childCount == 2) {
that.childCount = 1;
that.orderCount = 2;
that.numberCount = 2;
that.screen.sort = "childCount DESC";
} else if (that.childCount == 1) {
that.childCount = 3;
that.orderCount = 2;
that.numberCount = 2;
that.screen.sort = "childCount ASC";
} else if (that.childCount == 3) {
that.childCount = 2;
that.orderCount = 2;
that.numberCount = 2;
that.screen.sort = "";
}
break;
case "numberCount":
if (that.numberCount == 2) {
that.numberCount = 1;
that.orderCount = 2;
that.childCount = 2;
that.screen.sort = "numberCount DESC";
} else if (that.numberCount == 1) {
that.numberCount = 3;
that.orderCount = 2;
that.childCount = 2;
that.screen.sort = "numberCount ASC";
} else if (that.numberCount == 3) {
that.numberCount = 2;
that.orderCount = 2;
that.childCount = 2;
that.screen.sort = "";
}
break;
case "orderCount":
if (that.orderCount == 2) {
that.orderCount = 1;
that.numberCount = 2;
that.childCount = 2;
that.screen.sort = "orderCount DESC";
} else if (that.orderCount == 1) {
that.orderCount = 3;
that.numberCount = 2;
that.childCount = 2;
that.screen.sort = "orderCount ASC";
} else if (that.orderCount == 3) {
that.orderCount = 2;
that.numberCount = 2;
that.childCount = 2;
that.screen.sort = "";
}
break;
default:
that.screen.sort = "";
}
}
}
};
import { getSpreadUser } from "@/api/user";
import Loading from "@/components/Loading";
export default {
name: "PromoterList",
components: {
Loading
},
props: {},
data: function() {
return {
fixedState: false,
screen: {
page: 1,
limit: 15,
grade: 0,
keyword: "",
sort: ""
},
childCount: 2,
numberCount: 2,
orderCount: 2,
loaded: false,
loading: false,
spreadList: [],
loadTitle: "",
first: "",
second: ""
};
},
mounted: function() {
this.getSpreadUsers();
},
onReachBottom() {
!this.loading && this.getSpreadUsers();
},
watch: {
"screen.sort": function() {
this.screen.page = 0;
this.loaded = false;
this.loading = false;
this.spreadList = [];
this.getSpreadUsers();
}
},
methods: {
handleScroll: function() {
// var scrollTop =
// document.documentElement.scrollTop || document.body.scrollTop;
// var offsetTop = document.querySelector(".header").clientHeight;
// if (scrollTop >= offsetTop) {
// this.fixedState = true;
// } else {
// this.fixedState = false;
// }
},
submitForm: function() {
this.screen.page = 0;
this.loaded = false;
this.loading = false;
this.spreadList = [];
this.getSpreadUsers();
},
getSpreadUsers: function() {
let that = this,
screen = that.screen;
if (that.loaded || that.loading) return;
that.loading = true;
getSpreadUser(screen).then(
res => {
that.loading = false;
that.spreadList.push.apply(that.spreadList, res.data.list);
that.loaded = res.data.list.length < that.screen.limit; //判断所有数据是否加载完成;
that.loadTitle = that.loaded ? "人家是有底线的" : "上拉加载更多";
that.screen.page = that.screen.page + 1;
that.first = res.data.total;
that.second = res.data.totalLevel;
},
err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
},
300
);
},
checkGrade: function(val) {
if (val == this.screen.grade) return;
else {
this.screen.page = 1;
this.screen.grade = val;
this.loading = false;
this.loaded = false;
this.spreadList = [];
this.getSpreadUsers();
}
},
sort: function(types) {
let that = this;
switch (types) {
case "childCount":
if (that.childCount == 2) {
that.childCount = 1;
that.orderCount = 2;
that.numberCount = 2;
that.screen.sort = "childCount DESC";
} else if (that.childCount == 1) {
that.childCount = 3;
that.orderCount = 2;
that.numberCount = 2;
that.screen.sort = "childCount ASC";
} else if (that.childCount == 3) {
that.childCount = 2;
that.orderCount = 2;
that.numberCount = 2;
that.screen.sort = "";
}
break;
case "numberCount":
if (that.numberCount == 2) {
that.numberCount = 1;
that.orderCount = 2;
that.childCount = 2;
that.screen.sort = "numberCount DESC";
} else if (that.numberCount == 1) {
that.numberCount = 3;
that.orderCount = 2;
that.childCount = 2;
that.screen.sort = "numberCount ASC";
} else if (that.numberCount == 3) {
that.numberCount = 2;
that.orderCount = 2;
that.childCount = 2;
that.screen.sort = "";
}
break;
case "orderCount":
if (that.orderCount == 2) {
that.orderCount = 1;
that.numberCount = 2;
that.childCount = 2;
that.screen.sort = "orderCount DESC";
} else if (that.orderCount == 1) {
that.orderCount = 3;
that.numberCount = 2;
that.childCount = 2;
that.screen.sort = "orderCount ASC";
} else if (that.orderCount == 3) {
that.orderCount = 2;
that.numberCount = 2;
that.childCount = 2;
that.screen.sort = "";
}
break;
default:
that.screen.sort = "";
}
}
}
};
</script>

View File

@ -5,7 +5,7 @@
<view>
<text class="name">累计推广订单</text>
<view>
<text class="num">{{ count }}</text>
<text class="num">{{ count||'0' }}</text>
<text></text>
</view>
</view>