Gao xiaosong 4 years ago
parent
commit
e01f3f5f1e
  1. 178
      components/CountDown.vue
  2. 4
      pages/Loading/index.vue
  3. 2
      pages/activity/BargainRecord/index.vue
  4. 58
      pages/activity/DargainDetails/index.vue
  5. 2
      pages/activity/GroupDetails/index.vue
  6. 7
      pages/activity/GroupRule/index.vue
  7. 9
      pages/order/OrderSubmission/index.vue

178
components/CountDown.vue

@ -12,93 +12,109 @@
</view> </view>
</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: {
type: Number,
default: 0
},
isDay: {
type: Boolean,
default: true
}
}, },
data: function () { datatime: {},
return { isDay: {
day: "00", type: Boolean,
hour: "00", default: true,
minute: "00",
second: "00"
};
}, },
created: function () { },
this.show_time(); data: function () {
return {
time: null,
day: '00',
hour: '00',
minute: '00',
second: '00',
}
},
created: function () {
this.show_time()
},
watch: {
datatime(val) {
clearInterval(this.timeInterval)
this.time = val
this.show_time()
}, },
mounted: function () {}, },
methods: { mounted: function () {},
show_time: function () { methods: {
let that = this; show_time: function () {
let that = this
if (parseInt(this.time).length == 13) {
//
console.log('毫秒')
this.time = this.time / 1000
} else if (parseInt(this.time).length == 10) {
console.log('秒')
//
} else {
//
console.log('时间')
console.log(this.time)
this.time = Date.parse(this.time) / 1000
}
console.log(that.time)
function runTime() { function runTime() {
// //
let intDiff = that.datatime - Date.parse(new Date()) / 1000; // let intDiff = that.time - Date.parse(new Date()) / 1000 //
let day = 0, let day = 0,
hour = 0, hour = 0,
minute = 0, minute = 0,
second = 0; second = 0
if (intDiff > 0) { if (intDiff > 0) {
// //
if (that.isDay === true) { if (that.isDay === true) {
day = Math.floor(intDiff / (60 * 60 * 24)); day = Math.floor(intDiff / (60 * 60 * 24))
} else {
day = 0;
}
hour = Math.floor(intDiff / (60 * 60)) - day * 24;
minute = Math.floor(intDiff / 60) - day * 24 * 60 - hour * 60;
second =
Math.floor(intDiff) -
day * 24 * 60 * 60 -
hour * 60 * 60 -
minute * 60;
if (hour <= 9) hour = "0" + hour;
if (minute <= 9) minute = "0" + minute;
if (second <= 9) second = "0" + second;
that.day = day;
that.hour = hour;
that.minute = minute;
that.second = second;
} else { } else {
that.day = "00"; day = 0
that.hour = "00";
that.minute = "00";
that.second = "00";
} }
hour = Math.floor(intDiff / (60 * 60)) - day * 24
minute = Math.floor(intDiff / 60) - day * 24 * 60 - hour * 60
second = Math.floor(intDiff) - day * 24 * 60 * 60 - hour * 60 * 60 - minute * 60
if (hour <= 9) hour = '0' + hour
if (minute <= 9) minute = '0' + minute
if (second <= 9) second = '0' + second
that.day = day
that.hour = hour
that.minute = minute
that.second = second
} else {
that.day = '00'
that.hour = '00'
that.minute = '00'
that.second = '00'
} }
runTime();
setInterval(runTime, 1000);
} }
} runTime()
}; this.timeInterval = setInterval(runTime, 1000)
},
},
}
</script> </script>

4
pages/Loading/index.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="lottie-bg"> <view class="lottie-bg">
<view id="lottie"> <view id="lottie">
<image src="@/static/live-logo.gif" rel="preload" mode="widthFix" style="width: 100%;" /> <image src="@/static/live-logo.gif" rel="preload" mode="widthFix" style="width: 100%" />
</view> </view>
</view> </view>
</template> </template>
@ -61,11 +61,11 @@ export default {
console.log('loading home') console.log('loading home')
this.changeAuthorization(false) this.changeAuthorization(false)
let redirect = cookie.get('redirect').replace(/\ /g, '') let redirect = cookie.get('redirect').replace(/\ /g, '')
cookie.remove('redirect')
if (redirect && redirect.indexOf('/pages') != -1) { if (redirect && redirect.indexOf('/pages') != -1) {
this.$yrouter.replace({ this.$yrouter.replace({
path: '/pages' + redirect.split('/pages')[1], path: '/pages' + redirect.split('/pages')[1],
}) })
cookie.remove('redirect')
} else { } else {
this.$yrouter.switchTab({ this.$yrouter.switchTab({
path: '/pages/home/index', path: '/pages/home/index',

2
pages/activity/BargainRecord/index.vue

@ -14,7 +14,7 @@
:hourText="' 时 '" :hourText="' 时 '"
:minuteText="' 分 '" :minuteText="' 分 '"
:secondText="' 秒'" :secondText="' 秒'"
:datatime="item.datatime/1000" :datatime="item.datatime"
></count-down> ></count-down>
<view class="money font-color-red"> <view class="money font-color-red">
已砍至 已砍至

58
pages/activity/DargainDetails/index.vue

@ -7,9 +7,9 @@
{{ bargainShare.lookCount }}人查看 {{ bargainShare.shareCount }}人分享 {{ bargainShare.userCount }}人参与 {{ bargainShare.lookCount }}人查看 {{ bargainShare.shareCount }}人分享 {{ bargainShare.userCount }}人参与
</view> --> </view> -->
<!-- 帮助砍价帮砍成功--> <!-- 帮助砍价帮砍成功-->
<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"><image :src="bargainUserInfo.avatar"/></view> <view class="pictrue"><image :src="bargainUserInfo.avatar" /></view>
<view class="text"> <view class="text">
{{ bargainUserInfo.nickname }} {{ bargainUserInfo.nickname }}
<text>邀请您帮忙砍价</text> <text>邀请您帮忙砍价</text>
@ -18,7 +18,7 @@
</view> </view>
</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="' 分 '" :secondText="' 秒'" :datatime="goodsDetail.stopTime"></count-down> <count-down :isDay="true" :tipText="'倒计时 '" :dayText="' 天 '" :hourText="' 时 '" :minuteText="' 分 '" :secondText="' 秒'" :datatime="goodsDetail.stopTime"></count-down>
</div> </div>
</view> </view>
@ -92,14 +92,14 @@
</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"><image :src="`${$VUE_APP_RESOURCES_URL}/images/left.png`"/></view> <view class="pictrue"><image :src="`${$VUE_APP_RESOURCES_URL}/images/left.png`" /></view>
<view class="titleCon">砍价帮</view> <view class="titleCon">砍价帮</view>
<view class="pictrue on"><image :src="`${$VUE_APP_RESOURCES_URL}/images/left.png`"/></view> <view class="pictrue on"><image :src="`${$VUE_APP_RESOURCES_URL}/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" :key="bargainHelpListIndex"> <view class="item acea-row row-between-wrapper" v-for="(item, bargainHelpListIndex) in bargainHelpList" :key="bargainHelpListIndex">
<view class="pictxt acea-row row-between-wrapper"> <view class="pictxt acea-row row-between-wrapper">
<view class="pictrue"><image :src="item.avatar"/></view> <view class="pictrue"><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,18 +116,18 @@
</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"><image :src="`${$VUE_APP_RESOURCES_URL}/images/left.png`"/></view> <view class="pictrue"><image :src="`${$VUE_APP_RESOURCES_URL}/images/left.png`" /></view>
<view class="titleCon">商品详情</view> <view class="titleCon">商品详情</view>
<view class="pictrue on"><image :src="`${$VUE_APP_RESOURCES_URL}/images/left.png`"/></view> <view class="pictrue on"><image :src="`${$VUE_APP_RESOURCES_URL}/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"><image :src="`${$VUE_APP_RESOURCES_URL}/images/left.png`"/></view> <view class="pictrue"><image :src="`${$VUE_APP_RESOURCES_URL}/images/left.png`" /></view>
<view class="titleCon">活动规则</view> <view class="titleCon">活动规则</view>
<view class="pictrue on"><image :src="`${$VUE_APP_RESOURCES_URL}/images/left.png`"/></view> <view class="pictrue on"><image :src="`${$VUE_APP_RESOURCES_URL}/images/left.png`" /></view>
</view> </view>
<view class="conter" v-html="goodsDetail.rule"></view> <view class="conter" v-html="goodsDetail.rule"></view>
</view> </view>
@ -163,7 +163,7 @@ export default {
CountDown, CountDown,
}, },
props: {}, props: {},
data: function() { data: function () {
return { return {
bargainId: 0, // bargainId: 0, //
bargainSumCount: 0, // bargainSumCount: 0, //
@ -190,12 +190,12 @@ export default {
} }
}, },
computed: mapGetters(['userInfo', 'isLogin']), computed: mapGetters(['userInfo', 'isLogin']),
mounted: function() { mounted: function () {
this.mountedStart() this.mountedStart()
}, },
methods: { methods: {
// //
mountedStart: function() { mountedStart: function () {
var that = this var that = this
let url = handleQrCode() let url = handleQrCode()
// bargainId id // bargainId id
@ -213,8 +213,6 @@ export default {
// urluiduid // urluiduid
that.bargainUid = that.userInfo.uid that.bargainUid = that.userInfo.uid
} }
console.log(this)
// //
that.getBargainDetail() that.getBargainDetail()
// //
@ -236,7 +234,7 @@ export default {
this.getBargainHelpCount() this.getBargainHelpCount()
}, },
// //
openAlone: function() { openAlone: function () {
this.$yrouter.push({ this.$yrouter.push({
path: '/pages/shop/GoodsCon/index', path: '/pages/shop/GoodsCon/index',
query: { query: {
@ -245,7 +243,7 @@ export default {
}) })
}, },
// //
goPay: function() { goPay: function () {
var data = {} var data = {}
var that = this var that = this
data.productId = that.goodsDetail.productId data.productId = that.goodsDetail.productId
@ -271,7 +269,7 @@ export default {
}) })
}, },
// //
goPoster: function() { goPoster: function () {
var that = this var that = this
that.getBargainShare(that.bargainId) that.getBargainShare(that.bargainId)
this.$yrouter.push({ this.$yrouter.push({
@ -283,7 +281,7 @@ export default {
}) })
}, },
// //
goList: function() { goList: function () {
this.$yrouter.push({ this.$yrouter.push({
path: '/pages/activity/GoodsBargain/index', path: '/pages/activity/GoodsBargain/index',
}) })
@ -291,7 +289,7 @@ export default {
// //
//bargainId 0 //bargainId 0
//bargainId //bargainId
getBargainShare: function(bargainId) { getBargainShare: function (bargainId) {
var that = this var that = this
getBargainShare({ getBargainShare({
bargainId: bargainId, bargainId: bargainId,
@ -300,7 +298,7 @@ export default {
}) })
}, },
// //
getBargainDetail: function() { getBargainDetail: function () {
var that = this var that = this
uni.showLoading({ uni.showLoading({
title: '加载中', title: '加载中',
@ -310,9 +308,9 @@ export default {
.then(res => { .then(res => {
uni.hideLoading() uni.hideLoading()
that.goodsDetail = res.data.bargain that.goodsDetail = res.data.bargain
console.log(that.goodsDetail)
that.goodsDetail.description = that.goodsDetail.description.replace(/\<img/gi, '<img style="max-width:100%;height:auto;"') that.goodsDetail.description = that.goodsDetail.description.replace(/\<img/gi, '<img style="max-width:100%;height:auto;"')
that.goodsDetail.rule = that.goodsDetail.rule.replace(/\<img/gi, '<img style="max-width:100%;height:auto;"') 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 => {
@ -325,7 +323,7 @@ export default {
}) })
}, },
// - // -
getBargainStart: function() { getBargainStart: function () {
var that = this var that = this
getBargainStart({ getBargainStart({
bargainId: that.bargainId, bargainId: that.bargainId,
@ -344,7 +342,7 @@ export default {
}) })
}, },
// //
getBargainHelp: function() { getBargainHelp: function () {
var that = this var that = this
if (this.bargainHelpCount.price === 0 && that.bargainUid !== that.userInfo.uid) { if (this.bargainHelpCount.price === 0 && that.bargainUid !== that.userInfo.uid) {
return uni.showToast({ return uni.showToast({
@ -382,7 +380,7 @@ export default {
}) })
}, },
// //
getBargainHelpPrice: function() { getBargainHelpPrice: function () {
var that = this var that = this
getBargainHelpPrice({ getBargainHelpPrice({
bargainId: that.bargainId, bargainId: that.bargainId,
@ -409,7 +407,7 @@ export default {
}) })
}, },
// //
getBargainHelpList: function() { getBargainHelpList: function () {
var that = this var that = this
if (that.helpListStatus === true) return if (that.helpListStatus === true) return
getBargainHelpList({ getBargainHelpList({
@ -440,7 +438,7 @@ export default {
}) })
}, },
// //
getBargainHelpCount: function() { getBargainHelpCount: function () {
getBargainHelpCount({ getBargainHelpCount({
bargainId: this.bargainId, bargainId: this.bargainId,
bargainUserUid: this.bargainUid, bargainUserUid: this.bargainUid,
@ -515,7 +513,7 @@ export default {
}, },
// //
// //
getBargainStartUser: function() { getBargainStartUser: function () {
var that = this var that = this
getBargainStartUser({ getBargainStartUser({
bargainId: that.bargainId, bargainId: that.bargainId,
@ -534,11 +532,11 @@ export default {
}) })
}, },
// //
close: function() { close: function () {
this.active = false this.active = false
}, },
// //
onShareAppMessage: function() { onShareAppMessage: function () {
return { return {
title: this.storeInfo.title, title: this.storeInfo.title,
imageUrl: this.storeInfo.image, imageUrl: this.storeInfo.image,

2
pages/activity/GroupDetails/index.vue

@ -72,7 +72,7 @@
<text class="font-color-red" v-text="item.count"></text> <text class="font-color-red" v-text="item.count"></text>
<text>人成团</text> <text>人成团</text>
</view> </view>
<count-down :isDay="true" :tipText="'剩余 '" :dayText="' 天 '" :hourText="' : '" :minuteText="' : '" :secondText="' '" :datatime="item.stopTime / 1000"></count-down> <count-down :isDay="true" :tipText="'剩余 '" :dayText="' 天 '" :hourText="' : '" :minuteText="' : '" :secondText="' '" :datatime="item.stopTime"></count-down>
</view> </view>
<view class="spellBnt" @click="groupRule(item.id)"> <view class="spellBnt" @click="groupRule(item.id)">
去拼单 去拼单

7
pages/activity/GroupRule/index.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="group-con"> <view class="group-con">
<view class="tui-goods-item"> <view class="tui-goods-item" v-if="storeCombination">
<image :src="storeCombination.image" class="tui-goods-img"></image> <image :src="storeCombination.image" class="tui-goods-img"></image>
<view class="tui-goods-center"> <view class="tui-goods-center">
<view class="tui-goods-name">{{ storeCombination.title }}</view> <view class="tui-goods-name">{{ storeCombination.title }}</view>
@ -19,8 +19,9 @@
<view class="tui-group__box tui-mtop__20"> <view class="tui-group__box tui-mtop__20">
<tui-divider backgroundColor="#fff" width="70%" gradual> <tui-divider backgroundColor="#fff" width="70%" gradual>
<view class="tui-divider__content"> <view class="tui-divider__content">
<text v-if="pinkBool == 0">拼团失败</text> <text v-if="pinkBool == 0">进行中</text>
<text v-if="pinkBool == 1">拼团成功</text> <text v-if="pinkBool == 1">拼团成功</text>
<text v-if="pinkBool == -1">拼团失败</text>
</view> </view>
</tui-divider> </tui-divider>
<view class="tui-group__title" v-if="pinkBool == 0"> <view class="tui-group__title" v-if="pinkBool == 0">
@ -30,7 +31,7 @@
</view> </view>
<view class="tui-group-countdown" v-if="pinkBool == 0"> <view class="tui-group-countdown" v-if="pinkBool == 0">
<view class="tui-countdown-right">剩余</view> <view class="tui-countdown-right">剩余</view>
<count-down :isDay="true" :tipText="'倒计时 '" :dayText="' 天 '" :hourText="' 时 '" :minuteText="' 分 '" :secondText="' 秒'" :datatime="pinkT.stopTime / 1000"></count-down> <count-down :isDay="true" :tipText="'倒计时 '" :dayText="' 天 '" :hourText="' 时 '" :minuteText="' 分 '" :secondText="' 秒'" :datatime="pinkT.stopTime"></count-down>
<view class="tui-countdown-left">结束</view> <view class="tui-countdown-left">结束</view>
</view> </view>
<view class="tui-user__box"> <view class="tui-user__box">

9
pages/order/OrderSubmission/index.vue

@ -306,15 +306,13 @@ export default {
useIntegral() { useIntegral() {
this.computedPrice() this.computedPrice()
}, },
$yroute(n) {
if (n.name === NAME) this.getCartInfo()
},
shipping_type() { shipping_type() {
this.computedPrice() this.computedPrice()
}, },
}, },
onShow: function() { onLoad: function() {
let that = this let that = this
console.log('loadddddddd')
this.$store.dispatch('getUser', true) this.$store.dispatch('getUser', true)
that.getCartInfo() that.getCartInfo()
console.log(that.$yroute) console.log(that.$yroute)
@ -402,7 +400,8 @@ export default {
this.storeSelfMention = res.data.storeSelfMention this.storeSelfMention = res.data.storeSelfMention
this.computedPrice() this.computedPrice()
}) })
.catch(() => { .catch((error) => {
console.log(error)
uni.showToast({ uni.showToast({
title: '加载订单数据失败', title: '加载订单数据失败',
icon: 'none', icon: 'none',

Loading…
Cancel
Save