修改团购和秒杀倒计时为0的问题
This commit is contained in:
@ -13,28 +13,28 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "CountDown",
|
name: 'CountDown',
|
||||||
props: {
|
props: {
|
||||||
//距离开始提示文字
|
//距离开始提示文字
|
||||||
tipText: {
|
tipText: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "倒计时"
|
default: '倒计时'
|
||||||
},
|
},
|
||||||
dayText: {
|
dayText: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "天"
|
default: '天'
|
||||||
},
|
},
|
||||||
hourText: {
|
hourText: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "时"
|
default: '时'
|
||||||
},
|
},
|
||||||
minuteText: {
|
minuteText: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "分"
|
default: '分'
|
||||||
},
|
},
|
||||||
secondText: {
|
secondText: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "秒"
|
default: '秒'
|
||||||
},
|
},
|
||||||
datatime: {
|
datatime: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@ -47,10 +47,10 @@
|
|||||||
},
|
},
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
day: "00",
|
day: '00',
|
||||||
hour: "00",
|
hour: '00',
|
||||||
minute: "00",
|
minute: '00',
|
||||||
second: "00"
|
second: '00'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created: function() {
|
created: function() {
|
||||||
@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
function runTime() {
|
function runTime() {
|
||||||
//时间函数
|
//时间函数
|
||||||
let intDiff = that.datatime - Date.parse(new Date()) / 1000; //获取数据中的时间戳的时间差;
|
let intDiff = that.datatime - new Date() / 1000; //获取数据中的时间戳的时间差;
|
||||||
let day = 0,
|
let day = 0,
|
||||||
hour = 0,
|
hour = 0,
|
||||||
minute = 0,
|
minute = 0,
|
||||||
@ -77,23 +77,19 @@
|
|||||||
}
|
}
|
||||||
hour = Math.floor(intDiff / (60 * 60)) - day * 24;
|
hour = Math.floor(intDiff / (60 * 60)) - day * 24;
|
||||||
minute = Math.floor(intDiff / 60) - day * 24 * 60 - hour * 60;
|
minute = Math.floor(intDiff / 60) - day * 24 * 60 - hour * 60;
|
||||||
second =
|
second = Math.floor(intDiff) - day * 24 * 60 * 60 - hour * 60 * 60 - minute * 60;
|
||||||
Math.floor(intDiff) -
|
if (hour <= 9) hour = '0' + hour;
|
||||||
day * 24 * 60 * 60 -
|
if (minute <= 9) minute = '0' + minute;
|
||||||
hour * 60 * 60 -
|
if (second <= 9) second = '0' + second;
|
||||||
minute * 60;
|
|
||||||
if (hour <= 9) hour = "0" + hour;
|
|
||||||
if (minute <= 9) minute = "0" + minute;
|
|
||||||
if (second <= 9) second = "0" + second;
|
|
||||||
that.day = day;
|
that.day = day;
|
||||||
that.hour = hour;
|
that.hour = hour;
|
||||||
that.minute = minute;
|
that.minute = minute;
|
||||||
that.second = second;
|
that.second = second;
|
||||||
} else {
|
} else {
|
||||||
that.day = "00";
|
that.day = '00';
|
||||||
that.hour = "00";
|
that.hour = '00';
|
||||||
that.minute = "00";
|
that.minute = '00';
|
||||||
that.second = "00";
|
that.second = '00';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
runTime();
|
runTime();
|
||||||
|
|||||||
@ -9,9 +9,7 @@
|
|||||||
<!-- 帮助砍价、帮砍成功:-->
|
<!-- 帮助砍价、帮砍成功:-->
|
||||||
<view class="pictxt acea-row row-center-wrapper ">
|
<view class="pictxt acea-row row-center-wrapper ">
|
||||||
<div class="bargain-header">
|
<div class="bargain-header">
|
||||||
<view class="pictrue">
|
<view class="pictrue"><image :src="bargainUserInfo.avatar" /></view>
|
||||||
<image :src="bargainUserInfo.avatar" />
|
|
||||||
</view>
|
|
||||||
<view class="text">
|
<view class="text">
|
||||||
{{ bargainUserInfo.nickname }}
|
{{ bargainUserInfo.nickname }}
|
||||||
<text>邀请您帮忙砍价</text>
|
<text>邀请您帮忙砍价</text>
|
||||||
@ -21,8 +19,15 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="wrapper bargain-box time on">
|
<view class="wrapper bargain-box time on">
|
||||||
<div class="pictxt ">
|
<div class="pictxt ">
|
||||||
<count-down :isDay="true" :tipText="'倒计时 '" :dayText="' 天 '" :hourText="' 时 '" :minuteText="' 分 '"
|
<count-down
|
||||||
:secondText="' 秒'" :datatime="goodsDetail.stopTime/1000"></count-down>
|
:isDay="true"
|
||||||
|
:tipText="'倒计时 '"
|
||||||
|
:dayText="' 天 '"
|
||||||
|
:hourText="' 时 '"
|
||||||
|
:minuteText="' 分 '"
|
||||||
|
:secondText="' 秒'"
|
||||||
|
:datatime="goodsDetail.stopTime"
|
||||||
|
></count-down>
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
<view class="wrapper bargain-box bargain-product">
|
<view class="wrapper bargain-box bargain-product">
|
||||||
@ -66,7 +71,8 @@
|
|||||||
userBargainStatus 砍价状态为
|
userBargainStatus 砍价状态为
|
||||||
-->
|
-->
|
||||||
<view class="bargainSuccess" v-if="pay">
|
<view class="bargainSuccess" v-if="pay">
|
||||||
<span class="iconfont icon-xiaolian"></span>恭喜您砍价成功,快去支付吧~
|
<span class="iconfont icon-xiaolian"></span>
|
||||||
|
恭喜您砍价成功,快去支付吧~
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 参与砍价按钮 同一人-->
|
<!-- 参与砍价按钮 同一人-->
|
||||||
@ -85,26 +91,23 @@
|
|||||||
<view class="bargainBnt" @click="goPay" v-if="pay">立即支付</view>
|
<view class="bargainBnt" @click="goPay" v-if="pay">立即支付</view>
|
||||||
|
|
||||||
<view class="bargainBnt on" @click="goList">抢更多商品</view>
|
<view class="bargainBnt on" @click="goList">抢更多商品</view>
|
||||||
<view class="tip">已有<span class="font-color-red" v-text="bargainHelpCount.count"></span>位好友成功帮您砍价</view>
|
<view class="tip">
|
||||||
|
已有
|
||||||
|
<span class="font-color-red" v-text="bargainHelpCount.count"></span>
|
||||||
|
位好友成功帮您砍价
|
||||||
|
</view>
|
||||||
<view class="lock"></view>
|
<view class="lock"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="bargainGang bargain-box">
|
<view class="bargainGang bargain-box">
|
||||||
<view class="title font-color-red acea-row row-center-wrapper">
|
<view class="title font-color-red acea-row row-center-wrapper">
|
||||||
<view class="pictrue">
|
<view class="pictrue"><image src="@/static/images/left.png" /></view>
|
||||||
<image src="@/static/images/left.png" />
|
|
||||||
</view>
|
|
||||||
<view class="titleCon">砍价帮</view>
|
<view class="titleCon">砍价帮</view>
|
||||||
<view class="pictrue on">
|
<view class="pictrue on"><image src="@/static/images/left.png" /></view>
|
||||||
<image src="@/static/images/left.png" />
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view class="item acea-row row-between-wrapper" v-for="(item, bargainHelpListIndex) in bargainHelpList"
|
<view class="item acea-row row-between-wrapper" v-for="(item, bargainHelpListIndex) in bargainHelpList" :key="bargainHelpListIndex">
|
||||||
:key="bargainHelpListIndex">
|
|
||||||
<view class="pictxt acea-row row-between-wrapper">
|
<view class="pictxt acea-row row-between-wrapper">
|
||||||
<view class="pictrue">
|
<view class="pictrue"><image :src="item.avatar" /></view>
|
||||||
<image :src="item.avatar" />
|
|
||||||
</view>
|
|
||||||
<view class="text">
|
<view class="text">
|
||||||
<view class="name line1" v-text="item.nickname"></view>
|
<view class="name line1" v-text="item.nickname"></view>
|
||||||
<view class="line1" v-text="item.add_time"></view>
|
<view class="line1" v-text="item.add_time"></view>
|
||||||
@ -116,42 +119,35 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="load font-color-red" v-if="!helpListStatus " @click="getBargainHelpList">点击加载更多
|
<view class="load font-color-red" v-if="!helpListStatus" @click="getBargainHelpList">点击加载更多</view>
|
||||||
</view>
|
|
||||||
<view class="lock"></view>
|
<view class="lock"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="goodsDetails bargain-box">
|
<view class="goodsDetails bargain-box">
|
||||||
<view class="title font-color-red acea-row row-center-wrapper">
|
<view class="title font-color-red acea-row row-center-wrapper">
|
||||||
<view class="pictrue">
|
<view class="pictrue"><image src="@/static/images/left.png" /></view>
|
||||||
<image src="@/static/images/left.png" />
|
|
||||||
</view>
|
|
||||||
<view class="titleCon">商品详情</view>
|
<view class="titleCon">商品详情</view>
|
||||||
<view class="pictrue on">
|
<view class="pictrue on"><image src="@/static/images/left.png" /></view>
|
||||||
<image src="@/static/images/left.png" />
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="conter" v-html="goodsDetail.description"></view>
|
<view class="conter" v-html="goodsDetail.description"></view>
|
||||||
<view class="lock"></view>
|
<view class="lock"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="goodsDetails bargain-box">
|
<view class="goodsDetails bargain-box">
|
||||||
<view class="title font-color-red acea-row row-center-wrapper">
|
<view class="title font-color-red acea-row row-center-wrapper">
|
||||||
<view class="pictrue">
|
<view class="pictrue"><image src="@/static/images/left.png" /></view>
|
||||||
<image src="@/static/images/left.png" />
|
|
||||||
</view>
|
|
||||||
<view class="titleCon">活动规则</view>
|
<view class="titleCon">活动规则</view>
|
||||||
<view class="pictrue on">
|
<view class="pictrue on"><image src="@/static/images/left.png" /></view>
|
||||||
<image src="@/static/images/left.png" />
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="conter" v-html="goodsDetail.rule"></view>
|
<view class="conter" v-html="goodsDetail.rule"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="bargainTip" :class="active === true ? 'on' : ''">
|
<view class="bargainTip" :class="active === true ? 'on' : ''">
|
||||||
<view class="cutOff" v-if="bargainUid === userInfo.uid">
|
<view class="cutOff" v-if="bargainUid === userInfo.uid">
|
||||||
您已砍掉
|
您已砍掉
|
||||||
<text class="font-color-red" v-text="bargainHelpPrice"></text>元,听说分享次数越多砍价成功的机会越大哦!
|
<text class="font-color-red" v-text="bargainHelpPrice"></text>
|
||||||
|
元,听说分享次数越多砍价成功的机会越大哦!
|
||||||
</view>
|
</view>
|
||||||
<view class="cutOff on" v-else>
|
<view class="cutOff on" v-else>
|
||||||
<view class="help font-color-red" v-text="'成功帮砍' + bargainHelpPrice + '元'"></view>,您也可以砍价低价拿哦,快去挑选心仪的商品吧~
|
<view class="help font-color-red" v-text="'成功帮砍' + bargainHelpPrice + '元'"></view>
|
||||||
|
,您也可以砍价低价拿哦,快去挑选心仪的商品吧~
|
||||||
</view>
|
</view>
|
||||||
<view class="tipBnt" @click="goPoster" v-if="bargainUid === userInfo.uid">邀请好友帮砍价</view>
|
<view class="tipBnt" @click="goPoster" v-if="bargainUid === userInfo.uid">邀请好友帮砍价</view>
|
||||||
<view class="tipBnt" @click="getBargainStart" v-else>我也要参与</view>
|
<view class="tipBnt" @click="getBargainStart" v-else>我也要参与</view>
|
||||||
@ -160,7 +156,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import CountDown from "@/components/CountDown";
|
import CountDown from '@/components/CountDown';
|
||||||
import {
|
import {
|
||||||
getBargainDetail,
|
getBargainDetail,
|
||||||
getBargainShare,
|
getBargainShare,
|
||||||
@ -170,24 +166,16 @@
|
|||||||
getBargainHelpList,
|
getBargainHelpList,
|
||||||
getBargainHelpCount,
|
getBargainHelpCount,
|
||||||
getBargainStartUser
|
getBargainStartUser
|
||||||
} from "@/api/activity";
|
} from '@/api/activity';
|
||||||
import {
|
import { postCartAdd } from '@/api/store';
|
||||||
postCartAdd
|
import { mapGetters } from 'vuex';
|
||||||
} from "@/api/store";
|
import {} from '@/libs/wechat';
|
||||||
import {
|
import { isWeixin, parseQuery, handleQrCode } from '@/utils/index';
|
||||||
mapGetters
|
|
||||||
} from "vuex";
|
|
||||||
import {} from "@/libs/wechat";
|
|
||||||
import {
|
|
||||||
isWeixin,
|
|
||||||
parseQuery,
|
|
||||||
handleQrCode
|
|
||||||
} from "@/utils/index";
|
|
||||||
|
|
||||||
const NAME = "DargainDetails";
|
const NAME = 'DargainDetails';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "DargainDetails",
|
name: 'DargainDetails',
|
||||||
components: {
|
components: {
|
||||||
CountDown
|
CountDown
|
||||||
},
|
},
|
||||||
@ -196,7 +184,7 @@
|
|||||||
return {
|
return {
|
||||||
bargainId: 0, //砍价编号
|
bargainId: 0, //砍价编号
|
||||||
bargainSumCount: 0, //砍价成功人数
|
bargainSumCount: 0, //砍价成功人数
|
||||||
activeMsg: "",
|
activeMsg: '',
|
||||||
active: false,
|
active: false,
|
||||||
bargainHelpPrice: 0, //砍掉金额
|
bargainHelpPrice: 0, //砍掉金额
|
||||||
bargainHelpList: [],
|
bargainHelpList: [],
|
||||||
@ -215,10 +203,10 @@
|
|||||||
inviteFriends: false, // 邀请好友
|
inviteFriends: false, // 邀请好友
|
||||||
helpFriendsBargain: false, // 帮好友砍
|
helpFriendsBargain: false, // 帮好友砍
|
||||||
bargainSuccess: false, // 帮好友砍价成功
|
bargainSuccess: false, // 帮好友砍价成功
|
||||||
mainBargainSuccess: false, // 砍价成功
|
mainBargainSuccess: false // 砍价成功
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: mapGetters(["userInfo", "isLogin"]),
|
computed: mapGetters(['userInfo', 'isLogin']),
|
||||||
mounted: function() {
|
mounted: function() {
|
||||||
this.mountedStart();
|
this.mountedStart();
|
||||||
},
|
},
|
||||||
@ -236,13 +224,13 @@
|
|||||||
} else {
|
} else {
|
||||||
// 正常途径进来
|
// 正常途径进来
|
||||||
that.bargainId = that.$yroute.query.id;
|
that.bargainId = that.$yroute.query.id;
|
||||||
that.bargainUid = that.$yroute.query.partake
|
that.bargainUid = that.$yroute.query.partake;
|
||||||
}
|
}
|
||||||
if (this.bargainUid == 0 || !this.bargainUid) {
|
if (this.bargainUid == 0 || !this.bargainUid) {
|
||||||
// url未携带用户uid,填上登录用户uid,跳转
|
// url未携带用户uid,填上登录用户uid,跳转
|
||||||
that.bargainUid = that.userInfo.uid;
|
that.bargainUid = that.userInfo.uid;
|
||||||
}
|
}
|
||||||
console.log(this)
|
console.log(this);
|
||||||
|
|
||||||
// 获取商品详情
|
// 获取商品详情
|
||||||
that.getBargainDetail();
|
that.getBargainDetail();
|
||||||
@ -267,7 +255,7 @@
|
|||||||
// 查看商品
|
// 查看商品
|
||||||
openAlone: function() {
|
openAlone: function() {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/shop/GoodsCon/index",
|
path: '/pages/shop/GoodsCon/index',
|
||||||
query: {
|
query: {
|
||||||
id: this.goodsDetail.productId
|
id: this.goodsDetail.productId
|
||||||
}
|
}
|
||||||
@ -279,13 +267,13 @@
|
|||||||
var that = this;
|
var that = this;
|
||||||
data.productId = that.goodsDetail.productId;
|
data.productId = that.goodsDetail.productId;
|
||||||
data.cartNum = that.goodsDetail.num;
|
data.cartNum = that.goodsDetail.num;
|
||||||
data.uniqueId = "";
|
data.uniqueId = '';
|
||||||
data.bargainId = that.bargainId;
|
data.bargainId = that.bargainId;
|
||||||
data.new = 1;
|
data.new = 1;
|
||||||
postCartAdd(data)
|
postCartAdd(data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
that.$yrouter.push({
|
that.$yrouter.push({
|
||||||
path: "/pages/order/OrderSubmission/index",
|
path: '/pages/order/OrderSubmission/index',
|
||||||
query: {
|
query: {
|
||||||
id: res.data.cartId
|
id: res.data.cartId
|
||||||
}
|
}
|
||||||
@ -294,7 +282,7 @@
|
|||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -304,7 +292,7 @@
|
|||||||
var that = this;
|
var that = this;
|
||||||
that.getBargainShare(that.bargainId);
|
that.getBargainShare(that.bargainId);
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/activity/Poster/index",
|
path: '/pages/activity/Poster/index',
|
||||||
query: {
|
query: {
|
||||||
id: that.bargainId,
|
id: that.bargainId,
|
||||||
type: 2
|
type: 2
|
||||||
@ -314,7 +302,7 @@
|
|||||||
// 跳转砍价商品列表
|
// 跳转砍价商品列表
|
||||||
goList: function() {
|
goList: function() {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/activity/GoodsBargain/index"
|
path: '/pages/activity/GoodsBargain/index'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//砍价分享
|
//砍价分享
|
||||||
@ -325,36 +313,30 @@
|
|||||||
getBargainShare({
|
getBargainShare({
|
||||||
bargainId: bargainId
|
bargainId: bargainId
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
that.bargainShare = res.data
|
that.bargainShare = res.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 获取产品详情
|
// 获取产品详情
|
||||||
getBargainDetail: function() {
|
getBargainDetail: function() {
|
||||||
var that = this;
|
var that = this;
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "加载中",
|
title: '加载中',
|
||||||
mask: true
|
mask: true
|
||||||
});
|
});
|
||||||
getBargainDetail(that.bargainId)
|
getBargainDetail(that.bargainId)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
uni.hideLoading()
|
uni.hideLoading();
|
||||||
that.goodsDetail = res.data.bargain;
|
that.goodsDetail = res.data.bargain;
|
||||||
that.goodsDetail.description = that.goodsDetail.description.replace(
|
that.goodsDetail.description = that.goodsDetail.description.replace(/\<img/gi, '<img style="max-width:100%;height:auto;"');
|
||||||
/\<img/gi,
|
that.goodsDetail.rule = that.goodsDetail.rule.replace(/\<img/gi, '<img style="max-width:100%;height:auto;"');
|
||||||
'<img style="max-width:100%;height:auto;"'
|
that.goodsDetail.stopTime = that.goodsDetail.stopTime / 1000;
|
||||||
);
|
|
||||||
that.goodsDetail.rule = that.goodsDetail.rule.replace(
|
|
||||||
/\<img/gi,
|
|
||||||
'<img style="max-width:100%;height:auto;"'
|
|
||||||
);
|
|
||||||
that.goodsDetail.stopTime = that.goodsDetail.stopTime / 1000
|
|
||||||
that.getBargainHelpCount();
|
that.getBargainHelpCount();
|
||||||
})
|
})
|
||||||
.catch(res => {
|
.catch(res => {
|
||||||
uni.hideLoading()
|
uni.hideLoading();
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -373,7 +355,7 @@
|
|||||||
.catch(res => {
|
.catch(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -381,13 +363,10 @@
|
|||||||
// 参与砍价
|
// 参与砍价
|
||||||
getBargainHelp: function() {
|
getBargainHelp: function() {
|
||||||
var that = this;
|
var that = this;
|
||||||
if (
|
if (this.bargainHelpCount.price === 0 && that.bargainUid !== that.userInfo.uid) {
|
||||||
this.bargainHelpCount.price === 0 &&
|
|
||||||
that.bargainUid !== that.userInfo.uid
|
|
||||||
) {
|
|
||||||
return uni.showToast({
|
return uni.showToast({
|
||||||
title: "好友已经砍价成功",
|
title: '好友已经砍价成功',
|
||||||
icon: "success",
|
icon: 'success',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -398,10 +377,10 @@
|
|||||||
getBargainHelp(data)
|
getBargainHelp(data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
that.activeMsg = res.data.status;
|
that.activeMsg = res.data.status;
|
||||||
if (res.data.status === "SUCCESSFUL" && that.bargainUid !== that.userInfo.uid) {
|
if (res.data.status === 'SUCCESSFUL' && that.bargainUid !== that.userInfo.uid) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "您已经砍过了",
|
title: '您已经砍过了',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@ -414,7 +393,7 @@
|
|||||||
.catch(res => {
|
.catch(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -431,9 +410,9 @@
|
|||||||
that.getBargainHelpCount();
|
that.getBargainHelpCount();
|
||||||
that.getBargainHelpList();
|
that.getBargainHelpList();
|
||||||
switch (that.activeMsg) {
|
switch (that.activeMsg) {
|
||||||
case "SUCCESSFUL":
|
case 'SUCCESSFUL':
|
||||||
break;
|
break;
|
||||||
case "SUCCESS":
|
case 'SUCCESS':
|
||||||
that.active = true;
|
that.active = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -441,7 +420,7 @@
|
|||||||
.catch(res => {
|
.catch(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -465,11 +444,11 @@
|
|||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
if (!err.msg) {
|
if (!err.msg) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -482,20 +461,20 @@
|
|||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
// 剩余砍价金额,显示已砍至¥** 使用 = 商品价格 - 已经砍掉的金额
|
// 剩余砍价金额,显示已砍至¥** 使用 = 商品价格 - 已经砍掉的金额
|
||||||
let remainingPrice = (this.goodsDetail.price - res.data.alreadyPrice).toFixed(2)
|
let remainingPrice = (this.goodsDetail.price - res.data.alreadyPrice).toFixed(2);
|
||||||
this.bargainHelpCount = {
|
this.bargainHelpCount = {
|
||||||
...res.data,
|
...res.data,
|
||||||
remainingPrice
|
remainingPrice
|
||||||
}
|
};
|
||||||
this.handleButtonStatus()
|
this.handleButtonStatus();
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
if (!err.msg) {
|
if (!err.msg) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -504,24 +483,17 @@
|
|||||||
handleButtonStatus() {
|
handleButtonStatus() {
|
||||||
// 砍价按钮分为
|
// 砍价按钮分为
|
||||||
// 1.参与砍价 ==> 发起人与当前用户为同一人 && 未参与
|
// 1.参与砍价 ==> 发起人与当前用户为同一人 && 未参与
|
||||||
if (
|
if (this.bargainUid === this.userInfo.uid && this.bargainHelpCount.status == 0) {
|
||||||
this.bargainUid === this.userInfo.uid &&
|
this.participate = true;
|
||||||
this.bargainHelpCount.status == 0
|
|
||||||
) {
|
|
||||||
this.participate = true
|
|
||||||
} else {
|
} else {
|
||||||
this.participate = false
|
this.participate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2.邀请好友 ==> 发起人与当前用户同一人 && 已参与未过期 && 剩余金额>0
|
// 2.邀请好友 ==> 发起人与当前用户同一人 && 已参与未过期 && 剩余金额>0
|
||||||
if (
|
if (this.bargainUid === this.userInfo.uid && this.bargainHelpCount.status == 1 && this.bargainHelpCount.price > 0) {
|
||||||
this.bargainUid === this.userInfo.uid &&
|
this.inviteFriends = true;
|
||||||
this.bargainHelpCount.status == 1 &&
|
|
||||||
this.bargainHelpCount.price > 0
|
|
||||||
) {
|
|
||||||
this.inviteFriends = true
|
|
||||||
} else {
|
} else {
|
||||||
this.inviteFriends = false
|
this.inviteFriends = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3.帮好友砍价 ==> 发起人与当前用户非一人 && 未参与未过期 && 剩余金额>0 && 为砍价
|
// 3.帮好友砍价 ==> 发起人与当前用户非一人 && 未参与未过期 && 剩余金额>0 && 为砍价
|
||||||
@ -531,36 +503,29 @@
|
|||||||
// this.bargainHelpCount.userBargainStatus &&
|
// this.bargainHelpCount.userBargainStatus &&
|
||||||
this.bargainHelpCount.price > 0
|
this.bargainHelpCount.price > 0
|
||||||
) {
|
) {
|
||||||
this.helpFriendsBargain = true
|
this.helpFriendsBargain = true;
|
||||||
} else {
|
} else {
|
||||||
this.helpFriendsBargain = false
|
this.helpFriendsBargain = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4.支付 ==> 发起人与当前用户同一人 && 已参与未过期 && 剩余金额<=0
|
// 4.支付 ==> 发起人与当前用户同一人 && 已参与未过期 && 剩余金额<=0
|
||||||
if (
|
if (this.bargainUid === this.userInfo.uid && this.bargainHelpCount.status == 1 && this.bargainHelpCount.price <= 0) {
|
||||||
this.bargainUid === this.userInfo.uid &&
|
this.pay = true;
|
||||||
this.bargainHelpCount.status == 1 &&
|
|
||||||
this.bargainHelpCount.price <= 0
|
|
||||||
) {
|
|
||||||
this.pay = true
|
|
||||||
} else {
|
} else {
|
||||||
this.pay = false
|
this.pay = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 5.砍价人发起新的砍价 ==> 发起人与当前用户非一人 && 未参与
|
// 5.砍价人发起新的砍价 ==> 发起人与当前用户非一人 && 未参与
|
||||||
if (
|
if (this.bargainUid != this.userInfo.uid) {
|
||||||
this.bargainUid != this.userInfo.uid
|
this.bargain = true;
|
||||||
) {
|
|
||||||
this.bargain = true
|
|
||||||
} else {
|
} else {
|
||||||
this.bargain = false
|
this.bargain = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 砍价弹窗
|
// 砍价弹窗
|
||||||
// 1.发起人砍价成功 ==> 发起人与当前用户同一人 && 已参与未过期
|
// 1.发起人砍价成功 ==> 发起人与当前用户同一人 && 已参与未过期
|
||||||
// 2.砍价人砍价成功 ==> 发起人与当前用户非一人 && 已参与未过期
|
// 2.砍价人砍价成功 ==> 发起人与当前用户非一人 && 已参与未过期
|
||||||
// 3.已砍价 ==> 已参与 && 砍价状态为 true
|
// 3.已砍价 ==> 已参与 && 砍价状态为 true
|
||||||
|
|
||||||
},
|
},
|
||||||
// 获取开启砍价用户信息
|
// 获取开启砍价用户信息
|
||||||
// 参与砍价,为同一人发起砍价后
|
// 参与砍价,为同一人发起砍价后
|
||||||
@ -577,7 +542,7 @@
|
|||||||
.catch(res => {
|
.catch(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -591,22 +556,21 @@
|
|||||||
return {
|
return {
|
||||||
title: this.storeInfo.title,
|
title: this.storeInfo.title,
|
||||||
imageUrl: this.storeInfo.image,
|
imageUrl: this.storeInfo.image,
|
||||||
path: "pages/activity/DargainDetails/index?id=" + this.storeInfo.id + "&spread=" + uni.getStorageSync(
|
path: 'pages/activity/DargainDetails/index?id=' + this.storeInfo.id + '&spread=' + uni.getStorageSync('uid'),
|
||||||
"uid"),
|
|
||||||
success(res) {
|
success(res) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '分享成功'
|
title: '分享成功'
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
fail(res) {
|
fail(res) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '分享失败',
|
title: '分享失败',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
|
||||||
onShareAppMessage() {
|
onShareAppMessage() {
|
||||||
return {
|
return {
|
||||||
path: `/pages/activity/DargainDetails/index/?id=${this.$yroute.query.id}&partake=${this.userInfo.uid}`
|
path: `/pages/activity/DargainDetails/index/?id=${this.$yroute.query.id}&partake=${this.userInfo.uid}`
|
||||||
@ -623,7 +587,6 @@
|
|||||||
width: auto;
|
width: auto;
|
||||||
margin: 0 20rpx;
|
margin: 0 20rpx;
|
||||||
border: 0;
|
border: 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
@ -642,7 +605,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
page {
|
page {
|
||||||
|
|||||||
@ -45,12 +45,12 @@
|
|||||||
<view class="piece font-color-red" v-text="'仅剩' + itemSeckill.stock + '件'"></view>
|
<view class="piece font-color-red" v-text="'仅剩' + itemSeckill.stock + '件'"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="grab bg-color-red" v-if="item.status === 1 && itemSeckill.stock > 0"
|
<view class="grab bg-color-red" v-if="item.status === 1 && itemSeckill.stock > 0" @click="goDetail(itemSeckill.id,item.status)">马上抢</view>
|
||||||
@click="goDetail(itemSeckill.id,item.status)">马上抢</view>
|
|
||||||
<view class="grab" v-if="item.status === 1 && itemSeckill.stock <= 0">已售磬</view>
|
<view class="grab" v-if="item.status === 1 && itemSeckill.stock <= 0">已售磬</view>
|
||||||
<view class="grab bg-color-red" @click="goDetail(itemSeckill.id,item.status)" v-if="item.status === 2">即将开始
|
<view class="grab bg-color-red" v-if="item.status === 2">即将开始</view>
|
||||||
</view>
|
<view class="grab bg-color-red" v-if="item.status === 0">已结束</view>
|
||||||
<view class="grab bg-color-red" @click="goDetail(itemSeckill.id,item.status)" v-if="item.status === 0">已结束</view>
|
<!-- <view class="grab bg-color-red" @click="goDetail(itemSeckill.id,item.status)" v-if="item.status === 2">即将开始</view> -->
|
||||||
|
<!-- <view class="grab bg-color-red" @click="goDetail(itemSeckill.id,item.status)" v-if="item.status === 0">已结束</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="noCommodity" style="background-color: #f5f5f5;" v-if="seckillList.length === 0 && page > 1">
|
<view class="noCommodity" style="background-color: #f5f5f5;" v-if="seckillList.length === 0 && page > 1">
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
:hourText="' : '"
|
:hourText="' : '"
|
||||||
:minuteText="' : '"
|
:minuteText="' : '"
|
||||||
:secondText="' '"
|
:secondText="' '"
|
||||||
:datatime="datatime / 1000"
|
:datatime="datatime"
|
||||||
></count-down>
|
></count-down>
|
||||||
</view>
|
</view>
|
||||||
<view class="iconfont icon-jiantou"></view>
|
<view class="iconfont icon-jiantou"></view>
|
||||||
|
|||||||
Reference in New Issue
Block a user