修复部分显示bug
This commit is contained in:
@ -42,8 +42,9 @@ export default {
|
|||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data: function() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
timeInterval: null,
|
||||||
time: this.datatime,
|
time: this.datatime,
|
||||||
day: '00',
|
day: '00',
|
||||||
hour: '00',
|
hour: '00',
|
||||||
@ -51,7 +52,7 @@ export default {
|
|||||||
second: '00',
|
second: '00',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created: function() {
|
created() {
|
||||||
this.show_time()
|
this.show_time()
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -61,10 +62,11 @@ export default {
|
|||||||
this.show_time()
|
this.show_time()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted: function() {},
|
mounted() {
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
show_time: function() {
|
show_time() {
|
||||||
let that = this
|
console.log(this.datatime)
|
||||||
if (this.time.toString().length == 13) {
|
if (this.time.toString().length == 13) {
|
||||||
// 毫秒级
|
// 毫秒级
|
||||||
console.log('毫秒')
|
console.log('毫秒')
|
||||||
@ -77,17 +79,20 @@ export default {
|
|||||||
console.log('时间')
|
console.log('时间')
|
||||||
this.time = Date.parse(this.time) / 1000
|
this.time = Date.parse(this.time) / 1000
|
||||||
}
|
}
|
||||||
|
this.runTime()
|
||||||
function runTime() {
|
this.timeInterval = setInterval(this.runTime, 1000)
|
||||||
|
},
|
||||||
|
runTime() {
|
||||||
//时间函数
|
//时间函数
|
||||||
let intDiff = that.time - Date.parse(new Date()) / 1000 //获取数据中的时间戳的时间差;
|
let intDiff = this.time - Date.parse(new Date()) / 1000 //获取数据中的时间戳的时间差
|
||||||
|
console.log(intDiff)
|
||||||
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 (this.isDay === true) {
|
||||||
day = Math.floor(intDiff / (60 * 60 * 24))
|
day = Math.floor(intDiff / (60 * 60 * 24))
|
||||||
} else {
|
} else {
|
||||||
day = 0
|
day = 0
|
||||||
@ -98,20 +103,20 @@ export default {
|
|||||||
if (hour <= 9) hour = '0' + hour
|
if (hour <= 9) hour = '0' + hour
|
||||||
if (minute <= 9) minute = '0' + minute
|
if (minute <= 9) minute = '0' + minute
|
||||||
if (second <= 9) second = '0' + second
|
if (second <= 9) second = '0' + second
|
||||||
that.day = day
|
this.day = day
|
||||||
that.hour = hour
|
this.hour = hour
|
||||||
that.minute = minute
|
this.minute = minute
|
||||||
that.second = second
|
this.second = second
|
||||||
} else {
|
} else {
|
||||||
that.day = '00'
|
this.day = '00'
|
||||||
that.hour = '00'
|
this.hour = '00'
|
||||||
that.minute = '00'
|
this.minute = '00'
|
||||||
that.second = '00'
|
this.second = '00'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
runTime()
|
|
||||||
this.timeInterval = setInterval(runTime, 1000)
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
destroyed() {
|
||||||
|
clearTimeout(this.timeInterval)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -83,6 +83,7 @@ export default {
|
|||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
|
console.log(this.attr)
|
||||||
console.log(this);
|
console.log(this);
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="tui-countdown__box" v-if="item.status == 1 || item.status == 2">
|
<view class="tui-countdown__box" v-if="item.status == 1 || item.status == 2">
|
||||||
<text>距离{{ item.status == 1 ? '结束还剩' : '开始还有' }}</text>
|
<text>距离{{ item.status == 1 ? '结束还剩' : '开始还有' }}</text>
|
||||||
<count-down :isDay="true" :tipText="'倒计时 '" :dayText="' 天 '" :hourText="' 时 '" :minuteText="' 分 '" :secondText="' 秒'" :datatime="item.stop"></count-down>
|
<CountDown :isDay="true" :tipText="'倒计时 '" :dayText="' 天 '" :hourText="' 时 '" :minuteText="' 分 '" :secondText="' 秒'" :datatime="item.stop"></CountDown>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
@ -163,6 +163,7 @@ export default {
|
|||||||
that.status = false
|
that.status = false
|
||||||
that.active = index
|
that.active = index
|
||||||
that.datatime = that.timeList[that.active].stop
|
that.datatime = that.timeList[that.active].stop
|
||||||
|
console.log(new Date(that.datatime))
|
||||||
this.seckillList = []
|
this.seckillList = []
|
||||||
that.getSeckillList()
|
that.getSeckillList()
|
||||||
},
|
},
|
||||||
|
@ -260,7 +260,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
formatPrice(price, index) {
|
formatPrice(price, index) {
|
||||||
console.log(price)
|
// console.log(price)
|
||||||
if (price) {
|
if (price) {
|
||||||
return price.split('.')[index]
|
return price.split('.')[index]
|
||||||
}
|
}
|
||||||
@ -284,15 +284,6 @@ export default {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
openAlone: function() {
|
|
||||||
this.$yrouter.push({
|
|
||||||
path: '/pages/shop/GoodsCon/index',
|
|
||||||
query: {
|
|
||||||
id: this.storeInfo.productId,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
// this.$yrouter.replace({ path: "/detail/" + this.storeInfo.productId });
|
|
||||||
},
|
|
||||||
//收藏商品
|
//收藏商品
|
||||||
setCollect: function() {
|
setCollect: function() {
|
||||||
let that = this,
|
let that = this,
|
||||||
@ -452,24 +443,41 @@ export default {
|
|||||||
this.$set(this, 'attrTxt', '请选择')
|
this.$set(this, 'attrTxt', '请选择')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 单独购买
|
||||||
|
openAlone: function() {
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: '/pages/shop/GoodsCon/index',
|
||||||
|
query: {
|
||||||
|
id: this.storeInfo.productId,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
// this.$yrouter.replace({ path: "/detail/" + this.storeInfo.productId });
|
||||||
|
},
|
||||||
|
// 发起拼团
|
||||||
openTeam: function() {
|
openTeam: function() {
|
||||||
var that = this
|
var that = this
|
||||||
if (that.attr.cartAttr == false) {
|
console.log(this.attr)
|
||||||
|
if (that.attr.cartAttr == false) { // 展示弹框
|
||||||
|
console.log(this.attr.cartAttr)
|
||||||
that.attr.cartAttr = !this.attr.cartAttr
|
that.attr.cartAttr = !this.attr.cartAttr
|
||||||
} else {
|
// 设置拼团价格
|
||||||
|
that.attr.productSelect.price = this.storeInfo.price
|
||||||
|
} else { // 已有弹框——初始化商品信息,下单请求
|
||||||
var data = {}
|
var data = {}
|
||||||
data.productId = that.storeInfo.productId
|
data.productId = that.storeInfo.productId
|
||||||
|
data.price = that.storeInfo.price
|
||||||
data.cartNum = that.attr.productSelect.cart_num
|
data.cartNum = that.attr.productSelect.cart_num
|
||||||
data.uniqueId = that.attr.productSelect.unique
|
data.uniqueId = that.attr.productSelect.unique
|
||||||
data.combinationId = that.storeInfo.id
|
data.combinationId = that.storeInfo.id
|
||||||
data.new = 1
|
data.new = 1
|
||||||
|
console.log(data)
|
||||||
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,
|
||||||
|
pinkId: res.data.cartId,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -46,6 +46,10 @@
|
|||||||
<PromotionGood v-if="item.type == 'promotionGood'" :benefit="benefit"></PromotionGood>
|
<PromotionGood v-if="item.type == 'promotionGood'" :benefit="benefit"></PromotionGood>
|
||||||
<Coupon-window :coupon-list="couponList" v-if="showCoupon" @checked="couponClose" @close="couponClose"> </Coupon-window>
|
<Coupon-window :coupon-list="couponList" v-if="showCoupon" @checked="couponClose" @close="couponClose"> </Coupon-window>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- <view class="demo" style='height:100rpx'></view> -->
|
||||||
|
<!-- #ifndef APP-PLUS -->
|
||||||
|
<view class="bottomSpace" style='line-height:100rpx'>PC</view>
|
||||||
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
@ -312,9 +312,9 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad: 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)
|
||||||
if (that.$yroute.query.pinkid !== undefined) {
|
if (that.$yroute.query.pinkid !== undefined) {
|
||||||
that.pinkId = that.$yroute.query.pinkid
|
that.pinkId = that.$yroute.query.pinkid
|
||||||
@ -355,6 +355,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.useIntegral = e.mp.detail.value[0]
|
this.useIntegral = e.mp.detail.value[0]
|
||||||
},
|
},
|
||||||
|
// 计算商品价格
|
||||||
computedPrice() {
|
computedPrice() {
|
||||||
let shipping_type = this.shipping_type
|
let shipping_type = this.shipping_type
|
||||||
postOrderComputed(this.orderGroupInfo.orderKey, {
|
postOrderComputed(this.orderGroupInfo.orderKey, {
|
||||||
@ -377,7 +378,11 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCartInfo() {
|
getCartInfo() {
|
||||||
const cartIds = this.$yroute.query.id
|
let cartIds = this.$yroute.query.id
|
||||||
|
// 拼团id
|
||||||
|
if (this.$yroute.query.pinkId) {
|
||||||
|
cartIds = this.$yroute.query.pinkId
|
||||||
|
}
|
||||||
if (!cartIds) {
|
if (!cartIds) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '参数有误',
|
title: '参数有误',
|
||||||
|
@ -173,7 +173,6 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getProductList() {
|
getProductList() {
|
||||||
var that = this
|
|
||||||
this.setWhere()
|
this.setWhere()
|
||||||
const { s = '', id = 0, title = '' } = this.$yroute.query
|
const { s = '', id = 0, title = '' } = this.$yroute.query
|
||||||
if (s !== this.where.keyword || id !== this.where.sid) {
|
if (s !== this.where.keyword || id !== this.where.sid) {
|
||||||
@ -188,18 +187,18 @@ export default {
|
|||||||
this.stock = 0
|
this.stock = 0
|
||||||
// this.getProductList();
|
// this.getProductList();
|
||||||
}
|
}
|
||||||
let q = that.where
|
let q = this.where
|
||||||
let getData = this.isIntegral !== 'true' ? getProducts : getProductsIntegral
|
let getData = this.isIntegral !== 'true' ? getProducts : getProductsIntegral
|
||||||
getData(q).then(res => {
|
getData(q).then(res => {
|
||||||
that.loading = false
|
this.loading = false
|
||||||
if (that.target) {
|
if (this.target) {
|
||||||
that.productList = res.data
|
this.productList = res.data
|
||||||
} else {
|
} else {
|
||||||
that.productList.push.apply(that.productList, res.data)
|
this.productList.push.apply(this.productList, res.data)
|
||||||
}
|
}
|
||||||
that.target = false
|
this.target = false
|
||||||
that.loadend = res.data.length < that.where.limit //判断所有数据是否加载完成;
|
this.loadend = res.data.length < this.where.limit //判断所有数据是否加载完成;
|
||||||
that.where.page = that.where.page + 1
|
this.where.page = this.where.page + 1
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
submitForm: function() {
|
submitForm: function() {
|
||||||
|
@ -520,5 +520,9 @@
|
|||||||
}
|
}
|
||||||
.shoppingCart{
|
.shoppingCart{
|
||||||
position: relative;
|
position: relative;
|
||||||
|
.list{
|
||||||
|
margin-top: 150rpx;
|
||||||
|
padding-top: 15rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -272,22 +272,22 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeswitch: function(data) {
|
changeswitch(data) {
|
||||||
this.switchActive = data
|
this.switchActive = data
|
||||||
},
|
},
|
||||||
MenuUser: function() {
|
// 获取用户信息
|
||||||
let that = this
|
MenuUser() {
|
||||||
getMenuUser()
|
getMenuUser()
|
||||||
.then(res => {
|
.then(res => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
that.MyMenus = res.data.routine_my_menus
|
this.MyMenus = res.data.routine_my_menus
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
console.log(error)
|
console.log(error)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goPages: function(index) {
|
goPages(index) {
|
||||||
let url = this.MyMenus[index].uniapp_url
|
let url = this.MyMenus[index].uniapp_url
|
||||||
if (url === '/pages/user/promotion/UserPromotion/index' && this.userInfo.statu === 1) {
|
if (url === '/pages/user/promotion/UserPromotion/index' && this.userInfo.statu === 1) {
|
||||||
if (!this.userInfo.isPromoter) {
|
if (!this.userInfo.isPromoter) {
|
||||||
@ -322,7 +322,7 @@ export default {
|
|||||||
path: this.MyMenus[index].uniapp_url,
|
path: this.MyMenus[index].uniapp_url,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goPages2: function() {
|
goPages2() {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: '/pages/shop/GoodsList/index',
|
path: '/pages/shop/GoodsList/index',
|
||||||
query: {
|
query: {
|
||||||
|
Reference in New Issue
Block a user