yangsai@163.com 7 months ago
parent f519b14b79
commit ed67e7f78d
  1. 45
      pages/goods/detail.vue
  2. 11
      pages/goods/list.vue
  3. 12
      pages/index/index.vue

@ -33,11 +33,11 @@
<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>
<view class="rightBox"> <view class="rightBox" v-if="!isSeckill">
<image :src="$picUrl+'/static/detail/ben.png'" v-if="userInfo.user_type==40" <image :src="$picUrl+'/static/detail/ben.png'" v-if="userInfo.user_type==40"
style="width: 44rpx;height: 42rpx;"></image> style="width: 44rpx;height: 42rpx;"></image>
<image :src="$picUrl+'/static/detail/zhuan.png'" v-if="userInfo.user_type==30" <image :src="$picUrl+'/static/detail/zhuan.png'" v-if="userInfo.user_type==30"
@ -48,6 +48,26 @@
<text class="span" <text class="span"
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;">
<text class="span" style="color: #ffffff;font-size: 45rpx;font-family: STXinwei;"
>限时抢购</text>
</view>
<view class="rest" v-if="isSeckill" style="display: inline-flex;color:#ffffff;font-size: 30rpx;margin-top: 5rpx;float: right;width: 300rpx;">
<text style="margin-right: 20rpx;font-family: STXinwei;">距活动{{seckillText}}</text>
<u-count-down :timestamp="isBuy" format="HH:mm:ss" autoStart
@change="onChangeSeckillCutDownTime">
<view class="date-time" style="font-family: STXinwei;">
<text
class="time">{{timeData.hours>=10?timeData.hours:"0"+Number(timeData.hours)}}</text>
<text class="da">:</text>
<text
class="time">{{timeData.minutes>=10?timeData.minutes:"0"+Number(timeData.minutes)}}</text>
<text class="da">:</text>
<text
class="time">{{timeData.seconds>=10?timeData.seconds:"0"+Number(timeData.seconds)}}</text>
</view>
</u-count-down>
</view>
</view> </view>
</view> </view>
<view class="pro" v-if="userInfo.user_type==10"> <view class="pro" v-if="userInfo.user_type==10">
@ -285,7 +305,7 @@
<template v-if="!isPre"> <template v-if="!isPre">
<template v-if="isSeckill"> <template v-if="isSeckill">
<template v-if="isBuy"> <template v-if="isBuy">
<template v-if="seckillText=='距离'"> <template v-if="seckillText=='距离'||seckillText=='结束'">
<view class="addCar" <view class="addCar"
:style="{'background': stockValue=='有货'?'#FF9E2B':'#cecece' }" :style="{'background': stockValue=='有货'?'#FF9E2B':'#cecece' }"
@click="stockValue=='有货'?choseSku(2):''"> @click="stockValue=='有货'?choseSku(2):''">
@ -294,7 +314,7 @@
<view class="buyNow" <view class="buyNow"
:style="{'background': stockValue=='有货'?'linear-gradient(102deg, #FE5E06 0%, #F3221A 100%)':'#cecece' }" :style="{'background': stockValue=='有货'?'linear-gradient(102deg, #FE5E06 0%, #F3221A 100%)':'#cecece' }"
@click="stockValue=='有货'?choseSku(3):''"> @click="stockValue=='有货'?choseSku(3):''">
立即购 立即
</view> </view>
</template> </template>
<template v-else> <template v-else>
@ -445,6 +465,7 @@
}, },
data() { data() {
return { return {
timestamp: new Date().getTime(),
goods_sku_no: "", goods_sku_no: "",
isTodo: false, isTodo: false,
result: {}, result: {},
@ -498,6 +519,7 @@
multiArray: [], multiArray: [],
multiData: [], multiData: [],
stockValue: '有货', stockValue: '有货',
timeData: {},
addressResult: { addressResult: {
province: '江苏省', province: '江苏省',
city: '南京市', city: '南京市',
@ -517,7 +539,8 @@
// this.goodsId = options.goodsId ? options.goodsId : null // this.goodsId = options.goodsId ? options.goodsId : null
this.pre_id = options.pre_id ? options.pre_id : null; this.pre_id = options.pre_id ? options.pre_id : null;
this.isSeckill = options.isSeckill ? options.isSeckill : null; this.isSeckill = options.isSeckill ? options.isSeckill : null;
this.isBuy = options.isBuy ? decodeURIComponent(options.isBuy) : null; this.isBuy = options.isBuy ? Number(options.isBuy) : null;
console.log(this.isBuy);
this.seckillText = options.seckillText ? decodeURIComponent(options.seckillText) : null; this.seckillText = options.seckillText ? decodeURIComponent(options.seckillText) : null;
this.getSuggestGoods() this.getSuggestGoods()
this.getServeList() this.getServeList()
@ -550,6 +573,7 @@
this.isLogin = false; this.isLogin = false;
this.userInfo = {} this.userInfo = {}
} }
console.log(this.userInfo)
}, },
onPageScroll(e) { onPageScroll(e) {
if (e.scrollTop <= 200) { // true if (e.scrollTop <= 200) { // true
@ -601,6 +625,9 @@
] ]
} }
}, },
onChangeSeckillCutDownTime(e) {
this.timeData = e
},
// //
multiChange: function(e) { multiChange: function(e) {
this.multiIndex = e.detail.value; this.multiIndex = e.detail.value;
@ -1323,9 +1350,10 @@
} }
.right { .right {
display: flex; //display: flex;
align-items: center; align-items: center;
margin-right: 40rpx; margin-right: 40rpx;
flex-flow: column;
.rightPrice { .rightPrice {
overflow: hidden; overflow: hidden;
@ -1350,7 +1378,7 @@
} }
.rightBox { .rightBox {
// min-width: 195rpx; min-width: 120rpx;
padding: 0 20rpx; padding: 0 20rpx;
height: 64rpx; height: 64rpx;
background: #FFFFFF; background: #FFFFFF;
@ -1358,7 +1386,8 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 40%;
float:right;
image { image {
width: 38rpx; width: 38rpx;
height: 38rpx; height: 38rpx;

@ -256,7 +256,8 @@
sortType: 'all', // sortType: 'all', //
sortPrice: '', // (true false) sortPrice: '', // (true false)
options: {}, // options: {}, //
list: getEmptyPaginateObj(), // list: [], //
// list: getEmptyPaginateObj(), //
// //
upOption: { upOption: {
@ -316,7 +317,8 @@
// //
this.$refs.uWaterfall1.clear(); this.$refs.uWaterfall1.clear();
this.list.data = [] this.list.data = []
this.list = getEmptyPaginateObj() this.list = []
//this.list = getEmptyPaginateObj()
this.mescroll.resetUpScroll() this.mescroll.resetUpScroll()
}, },
getGoodsTypeList(category_id) { getGoodsTypeList(category_id) {
@ -329,6 +331,8 @@
.then(res => { .then(res => {
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
that.tabbar = res.data.list; that.tabbar = res.data.list;
that.isBanrdActive = 0
that.list= [];
that.onChage(that.tabbar[0], 1,0) that.onChage(that.tabbar[0], 1,0)
// res.data.list.forEach(item => { // res.data.list.forEach(item => {
// item.children.forEach(item_1 => { // item.children.forEach(item_1 => {
@ -433,6 +437,7 @@
let arr = getMoreListData(newList, app.list, pageNo); let arr = getMoreListData(newList, app.list, pageNo);
app.list.data = app.arrayUnique(arr, 'goods_id') app.list.data = app.arrayUnique(arr, 'goods_id')
app.total = result.data.list.total; app.total = result.data.list.total;
console.log(app.list)
resolve(newList) resolve(newList)
}) })
.catch(reject) .catch(reject)
@ -449,7 +454,7 @@
app.sortPrice = newSortPrice app.sortPrice = newSortPrice
app.$refs.uWaterfall1.clear(); app.$refs.uWaterfall1.clear();
app.list.data = [] app.list.data = []
app.list = getEmptyPaginateObj() app.list = []
app.mescroll.resetUpScroll() app.mescroll.resetUpScroll()
} }
}, },

@ -175,7 +175,7 @@
</view> </view>
</view> </view>
<view class="linePrice"> <view class="linePrice">
<text></text>{{item.seckill_price_max}} <text></text>{{item.original_price}}
</view> </view>
</view> </view>
</view> </view>
@ -190,7 +190,7 @@
<view class="right"> <view class="right">
<!-- <view class="rightContent"> --> <!-- <view class="rightContent"> -->
<view class="rightItem1" v-if="wxAppSetting.new_product"> <view class="rightItem1" v-if="wxAppSetting.new_product">
<view style="margin-bottom: 10rpx;"> <view style="">
<image :src="$picUrl+'/static/index/xinpin.png'" mode="widthFix" @click="goNewGoods" <image :src="$picUrl+'/static/index/xinpin.png'" mode="widthFix" @click="goNewGoods"
class="title"></image> class="title"></image>
<view class="more" @click="goNewGoods">查看更多<u-icon name="arrow-right"></u-icon> <view class="more" @click="goNewGoods">查看更多<u-icon name="arrow-right"></u-icon>
@ -827,8 +827,10 @@
GoodsApi.chartsGoodsJing().then(result => { GoodsApi.chartsGoodsJing().then(result => {
let arr = result.data; let arr = result.data;
let finalArr = arr.filter(item => { let finalArr = arr.filter(item => {
console.log(val)
return item.category_id == val return item.category_id == val
}) })
console.log(finalArr)
if (finalArr.length > 0) { if (finalArr.length > 0) {
let arr = finalArr[0].goods_list let arr = finalArr[0].goods_list
if (arr && arr.length > 0) { if (arr && arr.length > 0) {
@ -840,6 +842,7 @@
}) })
} }
this.paihangList = arr this.paihangList = arr
console.log(this.paihangList)
} }
}) })
}, },
@ -853,6 +856,7 @@
let count_down_time = result.data.tabbar[0].count_down_time.replace(/-/g, '/'); let count_down_time = result.data.tabbar[0].count_down_time.replace(/-/g, '/');
this.seckillCutDownTime = Math.ceil((new Date(count_down_time).getTime() - new Date() this.seckillCutDownTime = Math.ceil((new Date(count_down_time).getTime() - new Date()
.getTime())); .getTime()));
console.log(this.seckillCutDownTime)
} else { } else {
this.seckillCutDownTime = 0 this.seckillCutDownTime = 0
} }
@ -1829,7 +1833,7 @@
&>image { &>image {
width: 90rpx; width: 90rpx;
height: 90rpx; height: 100rpx;
} }
.priceBox { .priceBox {
@ -1837,7 +1841,7 @@
height: 34rpx; height: 34rpx;
width: 134rpx; width: 134rpx;
left: 0; left: 0;
top: 70rpx; top: 80rpx;
z-index: 2; z-index: 2;
image { image {

Loading…
Cancel
Save