This commit is contained in:
Gao xiaosong
2020-10-30 01:43:42 +08:00
14 changed files with 196 additions and 190 deletions

View File

@ -55,8 +55,8 @@
<!-- 砍价进度条下的金额 -->
<view class="balance acea-row row-between-wrapper">
<view v-text="'已砍' + bargainHelpCount.alreadyPrice + '元'"></view>
<view v-if="bargainHelpCount.remainingPrice === 0">砍价成功</view>
<view v-else v-text="'还剩' + bargainHelpCount.remainingPrice + '元'"></view>
<view v-if="bargainHelpCount.price === 0">砍价成功</view>
<view v-else v-text="'还剩' + bargainHelpCount.price + '元'"></view>
</view>
<!-- 砍价成功:-->
@ -267,15 +267,18 @@
// 查看商品
openAlone: function () {
this.$yrouter.push({
path: "/detail/" + this.bargain.productId
path: "/pages/shop/GoodsCon/index",
query: {
id: this.goodsDetail.productId
}
});
},
// 砍价完成,去支付
goPay: function () {
var data = {};
var that = this;
data.productId = that.bargain.productId;
data.cartNum = that.bargain.num;
data.productId = that.goodsDetail.productId;
data.cartNum = that.goodsDetail.num;
data.uniqueId = "";
data.bargainId = that.bargainId;
data.new = 1;
@ -379,7 +382,7 @@
getBargainHelp: function () {
var that = this;
if (
this.bargainHelpCount.remainingPrice === 0 &&
this.bargainHelpCount.price === 0 &&
that.bargainUid !== that.userInfo.uid
) {
return uni.showToast({
@ -478,7 +481,7 @@
bargainUserUid: this.bargainUid
})
.then(res => {
// 剩余砍价金额 = 商品价格 - 已经砍掉的金额
// 剩余砍价金额,显示已砍至¥** 使用 = 商品价格 - 已经砍掉的金额
let remainingPrice = (this.goodsDetail.price - res.data.alreadyPrice).toFixed(2)
this.bargainHelpCount = {
...res.data,
@ -514,7 +517,7 @@
if (
this.bargainUid === this.userInfo.uid &&
this.bargainHelpCount.status == 1 &&
this.bargainHelpCount.remainingPrice > 0
this.bargainHelpCount.price > 0
) {
this.inviteFriends = true
} else {
@ -526,7 +529,7 @@
this.bargainUid != this.userInfo.uid &&
this.bargainHelpCount.status == 1 &&
// this.bargainHelpCount.userBargainStatus &&
this.bargainHelpCount.remainingPrice > 0
this.bargainHelpCount.price > 0
) {
this.helpFriendsBargain = true
} else {
@ -537,7 +540,7 @@
if (
this.bargainUid === this.userInfo.uid &&
this.bargainHelpCount.status == 1 &&
this.bargainHelpCount.remainingPrice <= 0
this.bargainHelpCount.price <= 0
) {
this.pay = true
} else {

View File

@ -10,8 +10,8 @@
<view class="acea-row row-middle">
<view class="times">
<view>距秒杀结束仅剩</view>
<count-down :isDay="false" :tipText="false" :dayText="false" :hourText="' : '" :minuteText="' : '"
:secondText="false" :datatime="datatime"></count-down>
<count-down :isDay="false" :tipText="' '" :dayText="' '" :hourText="' : '" :minuteText="' : '"
:secondText="' '" :datatime="datatime"></count-down>
</view>
<view class="iconfont icon-jiantou"></view>
</view>

View File

@ -214,7 +214,7 @@
},
},
onShow: function() {
onLoad: function() {
this.getLocation()
let that = this;
uni.showLoading({
@ -451,7 +451,7 @@
}
.nav-title {
margin-left: 20rpx;
margin-left: 20rpx;
line-height: 40px;
}
</style>
</style>

View File

@ -178,7 +178,7 @@ export default {
res => {
that.vipRequire = res.data.list;
that.vipComplete = res.data.task;
that.taskCount = res.data.reach_count;
that.taskCount = res.data.reachCount;
},
err => {
uni.showToast({

View File

@ -13,22 +13,14 @@
</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 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>
<text class="iconfont icon-guanbi" @click="screen.keyword=''"></text>
</view>
</form>
<view class="iconfont icon-sousuo2"></view>
@ -56,11 +48,8 @@
</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="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" />
@ -84,166 +73,167 @@
</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;
// }
import {
getSpreadUser
} from "@/api/user";
import Loading from "@/components/Loading";
export default {
name: "PromoterList",
components: {
Loading
},
submitForm: function() {
this.screen.page = 0;
this.loaded = false;
this.loading = false;
this.spreadList = [];
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();
},
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
);
onReachBottom() {
!this.loading && this.getSpreadUsers();
},
checkGrade: function(val) {
if (val == this.screen.grade) return;
else {
this.screen.page = 1;
this.screen.grade = val;
this.loading = false;
watch: {
"screen.sort": function () {
this.screen.page = 0;
this.loaded = false;
this.loading = 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;
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 = "";
}
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>