Browse Source

修复部分显示bug

zyh
Aaron 4 years ago
parent
commit
f2596c53a3
  1. 45
      components/CountDown.vue
  2. 1
      components/ProductWindow.vue
  3. 3
      pages/activity/GoodsSeckill/index.vue
  4. 36
      pages/activity/GroupDetails/index.vue
  5. 4
      pages/home/index.vue
  6. 9
      pages/order/OrderSubmission/index.vue
  7. 17
      pages/shop/GoodsList/index.vue
  8. 4
      pages/shop/ShoppingCart/index.vue
  9. 12
      pages/user/User/index.vue

45
components/CountDown.vue

@ -42,8 +42,9 @@ export default {
default: true,
},
},
data: function() {
data() {
return {
timeInterval: null,
time: this.datatime,
day: '00',
hour: '00',
@ -51,7 +52,7 @@ export default {
second: '00',
}
},
created: function() {
created() {
this.show_time()
},
watch: {
@ -61,10 +62,11 @@ export default {
this.show_time()
},
},
mounted: function() {},
mounted() {
},
methods: {
show_time: function() {
let that = this
show_time() {
console.log(this.datatime)
if (this.time.toString().length == 13) {
//
console.log('毫秒')
@ -77,17 +79,20 @@ export default {
console.log('时间')
this.time = Date.parse(this.time) / 1000
}
function runTime() {
this.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,
hour = 0,
minute = 0,
second = 0
if (intDiff > 0) {
//
if (that.isDay === true) {
if (this.isDay === true) {
day = Math.floor(intDiff / (60 * 60 * 24))
} else {
day = 0
@ -98,20 +103,20 @@ export default {
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
this.day = day
this.hour = hour
this.minute = minute
this.second = second
} else {
that.day = '00'
that.hour = '00'
that.minute = '00'
that.second = '00'
this.day = '00'
this.hour = '00'
this.minute = '00'
this.second = '00'
}
}
runTime()
this.timeInterval = setInterval(runTime, 1000)
},
},
destroyed() {
clearTimeout(this.timeInterval)
}
}
</script>

1
components/ProductWindow.vue

@ -83,6 +83,7 @@ export default {
return {};
},
mounted: function () {
console.log(this.attr)
console.log(this);
},
watch: {

3
pages/activity/GoodsSeckill/index.vue

@ -37,7 +37,7 @@
</view>
<view class="tui-countdown__box" v-if="item.status == 1 || item.status == 2">
<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>
</block>
@ -163,6 +163,7 @@ export default {
that.status = false
that.active = index
that.datatime = that.timeList[that.active].stop
console.log(new Date(that.datatime))
this.seckillList = []
that.getSeckillList()
},

36
pages/activity/GroupDetails/index.vue

@ -260,7 +260,7 @@ export default {
},
methods: {
formatPrice(price, index) {
console.log(price)
// console.log(price)
if (price) {
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() {
let that = this,
@ -452,24 +443,41 @@ export default {
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() {
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
} else {
//
that.attr.productSelect.price = this.storeInfo.price
} else { //
var data = {}
data.productId = that.storeInfo.productId
data.price = that.storeInfo.price
data.cartNum = that.attr.productSelect.cart_num
data.uniqueId = that.attr.productSelect.unique
data.combinationId = that.storeInfo.id
data.new = 1
console.log(data)
postCartAdd(data)
.then(res => {
that.$yrouter.push({
path: '/pages/order/OrderSubmission/index',
query: {
id: res.data.cartId,
// id: res.data.cartId,
pinkId: res.data.cartId,
},
})
})

4
pages/home/index.vue

@ -46,6 +46,10 @@
<PromotionGood v-if="item.type == 'promotionGood'" :benefit="benefit"></PromotionGood>
<Coupon-window :coupon-list="couponList" v-if="showCoupon" @checked="couponClose" @close="couponClose"> </Coupon-window>
</view>
<!-- <view class="demo" style='height:100rpx'></view> -->
<!-- #ifndef APP-PLUS -->
<view class="bottomSpace" style='line-height:100rpx'>PC</view>
<!-- #endif -->
</view>
</template>
<script>

9
pages/order/OrderSubmission/index.vue

@ -312,9 +312,9 @@ export default {
},
onLoad: function() {
let that = this
console.log('loadddddddd')
this.$store.dispatch('getUser', true)
that.getCartInfo()
console.log(that.$yroute)
if (that.$yroute.query.pinkid !== undefined) {
that.pinkId = that.$yroute.query.pinkid
@ -355,6 +355,7 @@ export default {
}
this.useIntegral = e.mp.detail.value[0]
},
//
computedPrice() {
let shipping_type = this.shipping_type
postOrderComputed(this.orderGroupInfo.orderKey, {
@ -377,7 +378,11 @@ export default {
})
},
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) {
uni.showToast({
title: '参数有误',

17
pages/shop/GoodsList/index.vue

@ -173,7 +173,6 @@ export default {
})
},
getProductList() {
var that = this
this.setWhere()
const { s = '', id = 0, title = '' } = this.$yroute.query
if (s !== this.where.keyword || id !== this.where.sid) {
@ -188,18 +187,18 @@ export default {
this.stock = 0
// this.getProductList();
}
let q = that.where
let q = this.where
let getData = this.isIntegral !== 'true' ? getProducts : getProductsIntegral
getData(q).then(res => {
that.loading = false
if (that.target) {
that.productList = res.data
this.loading = false
if (this.target) {
this.productList = res.data
} else {
that.productList.push.apply(that.productList, res.data)
this.productList.push.apply(this.productList, res.data)
}
that.target = false
that.loadend = res.data.length < that.where.limit //
that.where.page = that.where.page + 1
this.target = false
this.loadend = res.data.length < this.where.limit //
this.where.page = this.where.page + 1
})
},
submitForm: function() {

4
pages/shop/ShoppingCart/index.vue

@ -520,5 +520,9 @@
}
.shoppingCart{
position: relative;
.list{
margin-top: 150rpx;
padding-top: 15rpx;
}
}
</style>

12
pages/user/User/index.vue

@ -272,22 +272,22 @@ export default {
})
}
},
changeswitch: function(data) {
changeswitch(data) {
this.switchActive = data
},
MenuUser: function() {
let that = this
//
MenuUser() {
getMenuUser()
.then(res => {
uni.hideLoading()
that.MyMenus = res.data.routine_my_menus
this.MyMenus = res.data.routine_my_menus
})
.catch(error => {
uni.hideLoading()
console.log(error)
})
},
goPages: function(index) {
goPages(index) {
let url = this.MyMenus[index].uniapp_url
if (url === '/pages/user/promotion/UserPromotion/index' && this.userInfo.statu === 1) {
if (!this.userInfo.isPromoter) {
@ -322,7 +322,7 @@ export default {
path: this.MyMenus[index].uniapp_url,
})
},
goPages2: function() {
goPages2() {
this.$yrouter.push({
path: '/pages/shop/GoodsList/index',
query: {

Loading…
Cancel
Save