main
fanfan 10 months ago
parent fe753b116d
commit 47d650ef06
  1. 56
      pages/goods/detail.vue
  2. 13
      pages/goods/seckillDetail.vue

@ -33,7 +33,7 @@
<text class="sellLeft"></text>{{goods.line_price_min?Number(goods.line_price_min):0}} <text class="sellLeft"></text>{{goods.line_price_min?Number(goods.line_price_min):0}}
</view> </view>
</view> </view>
<view class="right" > <view class="right">
<view class="rightPrice" v-if="goods.is_check==1"> <view class="rightPrice" v-if="goods.is_check==1">
<image :src="$picUrl+'/static/detail/shenhe.png'" style="width: 44rpx;height: 42rpx;"></image> <image :src="$picUrl+'/static/detail/shenhe.png'" style="width: 44rpx;height: 42rpx;"></image>
</view> </view>
@ -49,10 +49,10 @@
v-else>{{(goods.line_price_min>0&&goods.goods_price_min>0)?Number((Number(goods.line_price_min)-Number(goods.goods_price_min)).toFixed(2)):0}}</text> v-else>{{(goods.line_price_min>0&&goods.goods_price_min>0)?Number((Number(goods.line_price_min)-Number(goods.goods_price_min)).toFixed(2)):0}}</text>
</view> </view>
<view class="rightBox" v-if="isSeckill" style="background:unset;padding:unset;"> <view class="rightBox" v-if="isSeckill" style="background:unset;padding:unset;">
<text class="span" style="color: #ffffff;font-size: 45rpx;font-family: STXinwei;" <text class="span" style="color: #ffffff;font-size: 45rpx;font-family: STXinwei;">限时抢购</text>
>限时抢购</text>
</view> </view>
<view class="rest" v-if="isSeckill" style="display: inline-flex;color:#ffffff;font-size: 30rpx;margin-top: 5rpx;float: right;font-family: STXinwei;width: 300rpx;"> <view class="rest" v-if="isSeckill"
style="display: inline-flex;color:#ffffff;font-size: 30rpx;margin-top: 5rpx;float: right;font-family: STXinwei;width: 300rpx;">
<text style="margin-right: 20rpx;font-family: STXinwei;">距活动{{seckillText}}</text> <text style="margin-right: 20rpx;font-family: STXinwei;">距活动{{seckillText}}</text>
<u-count-down :timestamp="isBuy" format="HH:mm:ss" autoStart <u-count-down :timestamp="isBuy" format="HH:mm:ss" autoStart
@change="onChangeSeckillCutDownTime"> @change="onChangeSeckillCutDownTime">
@ -200,7 +200,7 @@
</view> </view>
</view> </view>
</view> </view>
<!-- <view class="about"> <!-- <view class="about">
<view class="aboutHead"> <view class="aboutHead">
<view class="aboutSuggest"> <view class="aboutSuggest">
相关推荐 相关推荐
@ -520,7 +520,7 @@
multiArray: [], multiArray: [],
multiData: [], multiData: [],
stockValue: '有货', stockValue: '有货',
promise_info:'', promise_info: '',
timeData: {}, timeData: {},
addressResult: { addressResult: {
province: '江苏省', province: '江苏省',
@ -600,7 +600,7 @@
goods_id: this.goodsId, goods_id: this.goodsId,
num: this.selectNum num: this.selectNum
}], }],
province: this.addressResult ?this.addressResult.province : '江苏省', province: this.addressResult ? this.addressResult.province : '江苏省',
city: this.addressResult ? this.addressResult.city : '南京市', city: this.addressResult ? this.addressResult.city : '南京市',
district: this.addressResult ? this.addressResult.district : '玄武区' district: this.addressResult ? this.addressResult.district : '玄武区'
} }
@ -684,9 +684,20 @@
}) })
.catch() .catch()
}, },
findItemById(items, id) {
return items.find(item => item.goods_id == id);
},
setPirce() { setPirce() {
console.log(this.$refs.setRange) let item = this.findItemById(this.goods.skuList, this.goods.goods_id)
if (item) {
this.$refs.setRange.startTime = item.sec_start_time;
this.$refs.setRange.sec_hour = item.sec_hour
this.$refs.setRange.secondPrice = item.seckill_price
this.$refs.setRange.secondQuota = item.is_limit == 1 ? true : false
this.$refs.setRange.quotaNum = item.limit_times
}
this.$refs.setRange.afterSale = true; this.$refs.setRange.afterSale = true;
}, },
// //
getCartTotal() { getCartTotal() {
@ -970,8 +981,10 @@
info.content = info.content info.content = info.content
.replace(/style=""/g, '') .replace(/style=""/g, '')
.replace(/<img " src=/g, '<img src=') .replace(/<img " src=/g, '<img src=')
.replace(/<img src=/g, '<img style="width: 100%; display:inline-block;height:auto" src=') .replace(/<img src=/g,
info.content=info.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto" '); '<img style="width: 100%; display:inline-block;height:auto" src=')
info.content = info.content.replace(/\<img/gi,
'<img style="max-width:100%;height:auto" ');
info.contentLink = that.getValueAfterSymbol(that.getLinksFromRichText(info info.contentLink = that.getValueAfterSymbol(that.getLinksFromRichText(info
.content), 'client://') .content), 'client://')
info.isLink = that.containsLetterMix(info.contentLink, 'http') ? true : false info.isLink = that.containsLetterMix(info.contentLink, 'http') ? true : false
@ -1044,11 +1057,11 @@
}) })
return; return;
} }
if(this.userInfo.user_type == 30){ if (this.userInfo.user_type == 30) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/member/index?type=fx' url: '/pages/member/index?type=fx'
}) })
}else{ } else {
uni.navigateTo({ uni.navigateTo({
url: '/pages/member/index1?type=hy' url: '/pages/member/index1?type=hy'
}) })
@ -1115,8 +1128,9 @@
page_url: `pages/goods/detail?${params}`, page_url: `pages/goods/detail?${params}`,
page_title: that.goods.goods_name page_title: that.goods.goods_name
}) })
if(res.data.url){ if (res.data.url) {
let str = `型号:${that.goods.goods_name}\n前台价:¥${that.goods.goods_price_max}\n推广价:¥${that.goods.goods_price_min}\nSKU:${that.goods.goods_no}\n小程序链接:${res.data.url}` let str =
`型号:${that.goods.goods_name}\n前台价:¥${that.goods.goods_price_max}\n推广价:¥${that.goods.goods_price_min}\nSKU:${that.goods.goods_no}\n小程序链接:${res.data.url}`
uni.setClipboardData({ uni.setClipboardData({
data: str, // value data: str, // value
success: function() { success: function() {
@ -1128,20 +1142,20 @@
}) })
} }
}) })
}else{ } else {
uni.showToast({ uni.showToast({
title: '复制失败', title: '复制失败',
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}) })
} }
}, },
toHaibao(index) { toHaibao(index) {
this.shareCancel(); this.shareCancel();
if (index == 2) { if (index == 2) {
this.toQueryShortUrl(); this.toQueryShortUrl();
} else { } else {
this.openDialog = false this.openDialog = false
this.showGoodsPosterPopup = true; this.showGoodsPosterPopup = true;
@ -1412,7 +1426,8 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
float:right; float: right;
image { image {
width: 38rpx; width: 38rpx;
height: 38rpx; height: 38rpx;
@ -2307,7 +2322,8 @@
text-align: center; text-align: center;
margin-right: 12rpx; margin-right: 12rpx;
} }
.detail-content{
.detail-content {
overflow: hidden; overflow: hidden;
} }
</style> </style>

@ -595,9 +595,20 @@
}) })
.catch() .catch()
}, },
findItemById(items, id) {
return items.find(item => item.goods_id == id);
},
setPirce() { setPirce() {
console.log(this.$refs.setRange) let item = this.findItemById(this.goods.skuList, this.goods.goods_id)
if (item) {
this.$refs.setRange.startTime = item.sec_start_time;
this.$refs.setRange.sec_hour = item.sec_hour
this.$refs.setRange.secondPrice = item.seckill_price
this.$refs.setRange.secondQuota = item.is_limit == 1 ? true : false
this.$refs.setRange.quotaNum = item.limit_times
}
this.$refs.setRange.afterSale = true; this.$refs.setRange.afterSale = true;
}, },
// //
getCartTotal() { getCartTotal() {

Loading…
Cancel
Save