wangdong 10 months ago
commit 106c4f44a9
  1. 21
      pages/goods/detail.vue
  2. 99
      pages/goods/list.vue
  3. 53
      pages/goods/seckillDetail.vue
  4. 3
      pages/index/index.vue

@ -218,7 +218,8 @@
<view class="chosed" v-if="goods.remark">
<view class="title">须知</view>
<view class="info">
<u-read-more :toggle="true" font-size='24' text-indent='0' show-height="200" open-text='收起' close-text='展开'>
<u-read-more :toggle="true" font-size='24' text-indent='0' show-height="200" open-text='收起'
close-text='展开'>
<rich-text :nodes="goods.remark"></rich-text>
</u-read-more>
</view>
@ -482,6 +483,7 @@
import setPrice from './components/setPrice'
import * as address from '@/api/address.js'
import * as CartApi from '@/api/cart'
import store from '@/store'
export default {
components: {
SkuPopup,
@ -580,7 +582,6 @@
console.log(this.isBuy);
this.seckillText = options.seckillText ? decodeURIComponent(options.seckillText) : null;
this.getSuggestGoods()
this.getServeList()
this.getGoodsDetail()
this.cityInfo = uni.getStorageSync("cityInfo");
this.getGoodsStockInfor()
@ -729,7 +730,7 @@
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.cost_price_min=this.goods.cost_price_min
this.$refs.setRange.cost_price_min = this.goods.cost_price_min
}
this.$refs.setRange.afterSale = true;
@ -839,10 +840,10 @@
})
.catch()
},
getServeList() {
getServeList(goodsId) {
const that = this
let params = {
goodsId: that.goodsId
goodsId: goodsId
}
return new Promise((resolve, reject) => {
GoodsApi.serveList(params).then(res => {
@ -1005,6 +1006,7 @@
GoodsApi.detail(this.goodsId)
.then(result => {
let info = result.data.detail;
this.getServeList(info.goods_id)
let item = this.findItemById(info.skuList, info.goods_id)
if (item) {
if (item.sec_start_time) {
@ -1017,7 +1019,8 @@
} else {
that.seckillCountTime = 0
}
that.seckillCountTime = that.seckillCountTime > 0 && that.seckillCountTime <= item.sec_hour * 60 * 60 * 1000 ? that.seckillCountTime : 0
that.seckillCountTime = that.seckillCountTime > 0 && that.seckillCountTime <= item
.sec_hour * 60 * 60 * 1000 ? that.seckillCountTime : 0
that.goods.skuList = [];
that.godds = {}
info.goods_images1 = []
@ -1171,10 +1174,10 @@
//
const that = this;
//
const params = that.$getShareUrlParams(this.options)
const res = await GoodsApi.goodsShortUrl({
page_url: `pages/goods/detail?${params}`,
page_title: that.goods.goods_name
page_url: encodeURIComponent('pages/goods/detail?refereeId=' + store.getters.userId + '&goodsId=' + this.goods
.goods_id),
page_title: that.goods.goods_name,
})
if (res.data.url) {
let str =

@ -13,11 +13,12 @@
<template v-if="options.categoryId">
<view class="goodsban" v-if="tabbar && tabbar.length > 0">
<scroll-view class="typeList" scroll-x="true">
<view v-for="(item,index) in tabbar" :key="index" class="bandsImg"
@click="onChage(item,1,index)"
:style="{'color':item.category_id==isBanrdActive?'#F43B21':'#5A5A5A','border':item.category_id==isBanrdActive?'1rpx solid #F22029':'1rpx solid #E7E7E7'}">
<image :src="item.image?item.image.external_url:''" mode="aspectFill"></image>
<view class="typeItem">{{item.name}}</view>
<view v-for="(item,index) in tabbar" :key="index"
:class="[item.image ? 'bandsImg' : 'typeItem2']" @click="onChage(item,1,index)"
:style="{'background':item.image?'none':(isBanrdActive==item.category_id?'#FEF6F6':'#F7F8FA'),'color':item.image?(item.category_id==isBanrdActive?'#F43B21':'#5A5A5A'):(item.category_id==isBanrdActive?'#F43B21':'#5A5A5A'),'border':item.image?(item.category_id==isBanrdActive?'1rpx solid #F22029':'1rpx solid #E7E7E7'):(item.category_id==isBanrdActive?'1rpx solid #F22029':'none')}">
<image :style="{display: item.image ? 'inline-block' : 'none'}"
:src="item.image?item.image.external_url:''" mode="aspectFill"></image>
<view :class="[item.image ? 'typeItem' : '']">{{item.name}}</view>
</view>
</scroll-view>
</view>
@ -110,40 +111,39 @@
</view>
<view v-else>
<!-- <u-waterfall v-model="list.data" ref="uWaterfall1"> -->
<!-- <template v-slot:left="{leftList}"> -->
<view class="goods-item goods-item1" v-for="(item, index) in list.data" :key="index"
@click="onTargetDetail(item)">
<!-- 多列显示 -->
<view class="">
<!-- 商品图片 -->
<view class="goods-image">
<image class="image" mode="aspectFill" :src="item.goods_image"></image>
<!-- <u-lazy-load threshold="0" border-radius="10" image-mode="aspectFill" :loading-img="item.goods_image" :image="item.goods_image" :index="index"></u-lazy-load> -->
<!-- <template v-slot:left="{leftList}"> -->
<view class="goods-item goods-item1" v-for="(item, index) in list.data" :key="index"
@click="onTargetDetail(item)">
<!-- 多列显示 -->
<view class="">
<!-- 商品图片 -->
<view class="goods-image">
<image class="image" mode="aspectFill" :src="item.goods_image"></image>
<!-- <u-lazy-load threshold="0" border-radius="10" image-mode="aspectFill" :loading-img="item.goods_image" :image="item.goods_image" :index="index"></u-lazy-load> -->
</view>
<view class="detail" style="padding-top: 10rpx;">
<!-- 商品名称 -->
<view class="goods-name">
<text>{{ item.goods_name }}</text>
</view>
<!-- 商品价格 -->
<view class="shenBox">
<view class="detail-price oneline-hide">
<text class="goods-price f-30 col-m"><text
style="font-size: 26rpx;"></text>{{ item.goods_price_min>0?Number(item.goods_price_min):0.00}}
<text class="delPrice"></text></text>
<text v-if="item.line_price_min > 0"
class="line-price col-9 f-24">{{ item.line_price_min>0?Number(item.line_price_min):0.00 }}</text>
</view>
<view class="detail" style="padding-top: 10rpx;">
<!-- 商品名称 -->
<view class="goods-name">
<text>{{ item.goods_name }}</text>
</view>
<!-- 商品价格 -->
<view class="shenBox">
<view class="detail-price oneline-hide">
<text class="goods-price f-30 col-m"><text
style="font-size: 26rpx;"></text>{{ item.goods_price_min>0?Number(item.goods_price_min):0.00}}
<text class="delPrice"></text></text>
<text v-if="item.line_price_min > 0"
class="line-price col-9 f-24">{{ item.line_price_min>0?Number(item.line_price_min):0.00 }}</text>
</view>
<image :src="$picUrl+'/static/detail/redShen.png'" v-if="item.is_check==1"
mode="">
</image>
</view>
<!-- <view class="goodsInfo" v-if="item.cmmdty_model">
<image :src="$picUrl+'/static/detail/redShen.png'" v-if="item.is_check==1" mode="">
</image>
</view>
<!-- <view class="goodsInfo" v-if="item.cmmdty_model">
<view class="oneTip">
{{item.cmmdty_model}}
</view>
</view> -->
<!-- <view class="goodsSend">
<!-- <view class="goodsSend">
<view class="sendLeft">
<view class="left_1">
{{item.goods_source}}
@ -162,11 +162,11 @@
<text v-if="item.delivery_time==6">45天内发货</text>
</view>
</view> -->
</view>
</view>
</view>
<!-- </template> -->
<!-- <template v-slot:right="{rightList}">
</view>
</view>
<!-- </template> -->
<!-- <template v-slot:right="{rightList}">
<view class="goods-item goods-item1" v-for="(item, index) in rightList" :key="index"
@click="onTargetDetail(item)">
<view class="">
@ -297,7 +297,7 @@
}],
multiIndex: -1,
blheight: 0,
from: ''
from: '',
}
},
@ -572,7 +572,7 @@
<style lang="scss" scoped>
::v-deep .u-empty {
padding: 100rpx 0;
padding: 150rpx 0 0 0;
}
.head {
@ -754,6 +754,7 @@
justify-content: space-between;
flex-wrap: wrap;
}
.goods-item {
// width: 50%;
}
@ -998,12 +999,26 @@
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
line-height: 60rpx;
line-height: 59rpx;
text-align: center;
}
}
}
.typeItem2 {
margin-right: 20rpx;
display: inline-block;
height: 60rpx;
border-radius: 82rpx 82rpx 82rpx 82rpx;
opacity: 1;
padding: 0 20rpx;
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
line-height: 59rpx;
text-align: center;
}
.goodsban {
background-color: #fff;
padding: 10rpx 30rpx;
@ -1045,4 +1060,4 @@
}
}
</style>
</style>

@ -120,7 +120,8 @@
</view>
</view>
<view v-if="storeVersion == 1 && goods.merchant_id > 0" class="merchant-info" @click="toShop()">
<image :src="goods.merchant.logoImage && goods.merchant.logoImage[0].external_url" mode="aspectFill"></image>
<image :src="goods.merchant.logoImage && goods.merchant.logoImage[0].external_url" mode="aspectFill">
</image>
<view class="info-box">
<view class="info-name">
<text>{{ goods.merchant.shop_name }}</text>
@ -191,7 +192,8 @@
<view class="chosed" v-if="goods.remark">
<view class="title">须知</view>
<view class="info">
<u-read-more :toggle="true" font-size='24' text-indent='0' show-height="200" open-text='收起' close-text='展开'>
<u-read-more :toggle="true" font-size='24' text-indent='0' show-height="200" open-text='收起'
close-text='展开'>
<rich-text :nodes="goods.remark"></rich-text>
</u-read-more>
</view>
@ -412,6 +414,7 @@
import * as address from '@/api/address.js'
import * as CartApi from '@/api/cart'
import * as SharpGoodsApi from '@/api/sharp/goods'
import store from '@/store'
export default {
components: {
SkuPopup,
@ -633,7 +636,7 @@
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.cost_price_min=this.goods.cost_price_min
this.$refs.setRange.cost_price_min = this.goods.cost_price_min
}
this.$refs.setRange.afterSale = true;
@ -994,8 +997,12 @@
})
},
toDetail(goods_id) {
let that=this
uni.navigateTo({
url: '/pages/goods/detail?goodsId=' + goods_id
url: '/pages/goods/seckillDetail?goodsId=' + goods_id + '&activeTimeId=' + that.activeTimeId +
'&sharpGoodsId=' + that.sharpGoodsId + "&isSeckill=" + true + '&isBuy=' + that
.isBuy + '&seckillText=' + (that.activeInfo.status == 10 ?
'结束' : '开始')
})
},
goRanking() {
@ -1076,11 +1083,15 @@
async toQueryShortUrl() {
//
const that = this;
//
const params = that.$getShareUrlParams(this.options)
const res = await GoodsApi.goodsShortUrl({
page_url: `pages/goods/detail?${params}`,
page_title: that.goods.goods_name
page_url: encodeURIComponent('pages/goods/seckillDetail?refereeId=' + store.getters
.userId +
'&goodsId=' + this.goods
.goods_id + '&activeTimeId=' + that.activeTimeId + '&sharpGoodsId=' + that
.sharpGoodsId + "&isSeckill=" + true + '&isBuy=' + that
.isBuy + '&seckillText=' + (that.activeInfo.status == 10 ?
'结束' : '开始')),
page_title: that.goods.goods_name,
})
if (res.data.url) {
let str =
@ -1126,12 +1137,18 @@
*/
onShareAppMessage() {
const app = this
//
const params = app.$getShareUrlParams(this.options)
// const params = app.$getShareUrlParams(this.options)
return {
title: app.goods.goods_name,
imageUrl: app.goods.goods_image,
path: `/pages/goods/detail?${params}`
path: 'pages/goods/seckillDetail?refereeId=' + store.getters.userId +
'&goodsId=' + app.goods
.goods_id + '&activeTimeId=' + app.activeTimeId + '&sharpGoodsId=' + app.sharpGoodsId + "&isSeckill=" +
true + '&isBuy=' + app
.isBuy + '&seckillText=' + (app.activeInfo.status == 10 ?
'结束' : '开始')
}
},
@ -1146,7 +1163,12 @@
return {
title: app.goods.goods_name,
imageUrl: app.goods.goods_image,
path: `/pages/goods/detail?${params}`
path: 'pages/goods/seckillDetail?refereeId=' + store.getters.userId +
'&goodsId=' + app.goods
.goods_id + '&activeTimeId=' + app.activeTimeId + '&sharpGoodsId=' + app.sharpGoodsId+ "&isSeckill=" +
true + '&isBuy=' + app
.isBuy + '&seckillText=' + (app.activeInfo.status == 10 ?
'结束' : '开始')
}
}
}
@ -1572,41 +1594,47 @@
}
}
}
.merchant-info {
margin: 20rpx 18rpx 0 18rpx;
padding: 30rpx;
background: #fff;
display: flex;
>image {
width: 90rpx;
height: 90rpx;
margin-right: 20rpx;
flex-shrink: 0;
}
.info-box {
width: calc(100% - 110rpx);
display: flex;
flex-direction: column;
justify-content: space-between;
>.info-name {
font-size: 30rpx;
color: #333;
font-weight: bold;
display: flex;
align-items: center;
>text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: calc(100% - 21rpx);
}
>image {
margin-left: 10rpx;
width: 13rpx;
height: 24rpx;
}
}
>.label {
text {
display: inline-block;
@ -1622,6 +1650,7 @@
}
}
}
.orderInfo {
// width: 720rpx;
background: #FFFFFF;

@ -190,7 +190,8 @@
</view>
</view>
<view class="activity">
<view class="left" @click="goNews" v-if="wxAppSetting.service">
<!-- @click="goNews" -->
<view class="left" v-if="wxAppSetting.service">
<image :src="`${$picUrl}/static/index/activity${styleIndex || ''}.png?t=${timestamp}`" mode="widthFix"></image>
</view>
<view class="right">

Loading…
Cancel
Save