Browse Source

特产

master
jiazhipeng 8 months ago
parent
commit
c7b33e278a
  1. 43
      pages/info/postProductInfo/index.js
  2. 119
      pages/info/postProductInfo/index.wxml
  3. 44
      pages/info/postProductInfo/index.wxss

43
pages/info/postProductInfo/index.js

@ -91,20 +91,33 @@ Page({
let resData = res.data let resData = res.data
try { try {
if (resData.product_data && resData.is_package==1) { if (resData.product_data && resData.is_package==1) {
for(let key in resData.product_data) { for(let key in resData.product_data) {
resData.product_data[key] = JSON.parse(resData.product_data[key]) resData.product_data[key] = JSON.parse(resData.product_data[key])
}
// if (resData.product_data["住"]) {
// resData.product_data["住"] = JSON.parse(resData.product_data["住"])
// }
// if (resData.product_data["游"]) {
// resData.product_data["游"] = JSON.parse(resData.product_data["游"])
// }
// if (resData.product_data["食"]) {
// resData.product_data["食"] = JSON.parse(resData.product_data["食"])
// }
} }
// if (resData.product_data["住"]) {
// resData.product_data["住"] = JSON.parse(resData.product_data["住"]) resData.shipment_tag_arr = []
// } if (resData.shipment_tag) {
// if (resData.product_data["游"]) { resData.shipment_tag_arr = resData.shipment_tag.split(',')
// resData.product_data["游"] = JSON.parse(resData.product_data["游"]) resData.shipment_tag_str = resData.shipment_tag_arr.slice(1).join(' | ')
// } }
// if (resData.product_data["食"]) { if (resData.service_tag) {
// resData.product_data["食"] = JSON.parse(resData.product_data["食"]) resData.service_tag_str = resData.service_tag.split(',').join(' | ')
// } }
} if (resData.parameter_tag) {
resData.parameter_tag_str = resData.parameter_tag.split(',').join(' | ')
}
} catch(e) {} } catch(e) {}
let swiperRange = this.data.swiperRange; let swiperRange = this.data.swiperRange;
@ -159,14 +172,14 @@ Page({
commonApi._post("search/product_recommend", { commonApi._post("search/product_recommend", {
offset: 0, offset: 0,
limit: 6, limit: 4,
rand: true, rand: true,
type: 'post', type: 'post',
product_ids:options.id, product_ids:options.id,
}).then(res => { }).then(res => {
try { try {
this.setData({ this.setData({
tjList: res.data.list tjList: res.data.list.slice(0,4)
}) })
} catch (error) { } catch (error) {
console.log(error); console.log(error);

119
pages/info/postProductInfo/index.wxml

@ -2,42 +2,45 @@
<wxs src="../../../utils/filter.wxs" module="tool" /> <wxs src="../../../utils/filter.wxs" module="tool" />
<title title="产品详情"></title> <title title="产品详情"></title>
<view class="share-icon" bindtap="share"></view> <view class="share-icon" bindtap="share"></view>
<view class="swiper-bottom" wx:if="{{info}}"> <image wx:for="{{info.sku}}" style="{{aniSkuIndex==index?('top:'+cartTop+'px;'):('top:'+top+'px;'+cartImgInfo)}}" class="headimg{{aniSkuIndex==index?' active':''}}" src="{{info.headimg}}" mode="aspectFill"></image>
<view class="swiper-bottom-item bottom-number active">{{swiperCurrent+1}}/{{swiperRange.sku.max+1}}</view> <view style="position: relative;">
<view class="swuper-bottom-bg"> <swiper class="swiper" wx:if="{{info}}" autoplay="{{autoPlay}}" current="{{swiperCurrent}}"
<view class="swiper-bottom-item {{(swiperCurrent>=swiperRange.video.min&&swiperCurrent<=swiperRange.video.max)?'active':''}}" wx:if="{{info.videourl}}">视频</view> interval="{{2000}}" duration="{{300}}" bindchange="swiperChange">
<view class="swiper-bottom-item {{(swiperCurrent>=swiperRange.picture.min&&swiperCurrent<=swiperRange.picture.max)?'active':''}}">图片</view> <block wx:if="{{info.videourl}}" wx:key="*this">
<view class="swiper-bottom-item {{(swiperCurrent>=swiperRange.sku.min&&swiperCurrent<=swiperRange.sku.max)?'active':''}}">款式</view> <swiper-item>
<video bindplay="playVideo" src="{{info.videourl}}" autoplay="{{true}}" muted="{{true}}"
show-mute-btn="{{true}}" show-background-playback-button="{{false}}"
show-progress="{{false}}" ></video>
<!-- <image src="{{info.headimg}}" mode="aspectFill"></image> -->
</swiper-item>
</block>
<block wx:for="{{info.listimg}}" wx:key="*this">
<swiper-item>
<image src="{{item}}" mode="aspectFill"></image>
</swiper-item>
</block>
<block wx:for="{{info.sku}}" wx:key="*this">
<swiper-item style="position: relative;">
<image src="{{item.headimg}}" mode="aspectFill"></image>
<view class="sku-tips ">
<view class="textOver">{{item.sku_name}}</view>
</view>
</swiper-item>
</block>
</swiper>
<view class="swiper-bottom" wx:if="{{info}}">
<view class="swuper-bottom-bg">
<view class="swiper-bottom-item {{(swiperCurrent>=swiperRange.video.min&&swiperCurrent<=swiperRange.video.max)?'active':''}}"
wx:if="{{info.videourl}}" bind:tap="changeSwiperCurrent" data-index="{{0}}">视频</view>
<view class="swiper-bottom-item {{(swiperCurrent>=swiperRange.picture.min&&swiperCurrent<=swiperRange.picture.max)?'active':''}}"
bind:tap="changeSwiperCurrent" data-index="{{swiperRange.picture.min}}">图片</view>
<view class="swiper-bottom-item {{(swiperCurrent>=swiperRange.sku.min&&swiperCurrent<=swiperRange.sku.max)?'active':''}}"
bind:tap="changeSwiperCurrent" data-index="{{swiperRange.sku.min}}">款式</view>
</view>
<view class="swiper-bottom-item bottom-number active">{{swiperCurrent+1}}/{{swiperRange.sku.max+1}}</view>
</view> </view>
</view> </view>
<image wx:for="{{info.sku}}" style="{{aniSkuIndex==index?('top:'+cartTop+'px;'):('top:'+top+'px;'+cartImgInfo)}}" class="headimg{{aniSkuIndex==index?' active':''}}" src="{{info.headimg}}" mode="aspectFill"></image>
<swiper class="swiper" wx:if="{{info}}" autoplay="{{autoPlay}}" current="{{swiperCurrent}}"
interval="{{2000}}" duration="{{300}}" bindchange="swiperChange">
<block wx:if="{{info.videourl}}" wx:key="*this">
<swiper-item>
<video bindplay="playVideo" src="{{info.videourl}}" autoplay="{{true}}" muted="{{true}}"
show-mute-btn="{{true}}" show-background-playback-button="{{false}}"
show-progress="{{true}}" ></video>
<!-- <image src="{{info.headimg}}" mode="aspectFill"></image> -->
</swiper-item>
</block>
<block wx:for="{{info.listimg}}" wx:key="*this">
<swiper-item>
<image src="{{item}}" mode="aspectFill"></image>
</swiper-item>
</block>
<block wx:for="{{info.sku}}" wx:key="*this">
<swiper-item style="position: relative;">
<image src="{{item.headimg}}" mode="aspectFill"></image>
<view class="sku-tips ">
<view class="textOver">{{item.sku_name}}</view>
</view>
</swiper-item>
</block>
</swiper>
<view class="allowance-box" wx:if="{{allowance_data}}" bindtap="changeAllowance"> <view class="allowance-box" wx:if="{{allowance_data}}" bindtap="changeAllowance">
补贴价 补贴价
<view class="com-price two">¥{{ allowance_data.mini_price / 100 }}起</view> <view class="com-price two">¥{{ allowance_data.mini_price / 100 }}起</view>
@ -71,22 +74,25 @@
</view> </view>
<view class="other-info-box" wx:if="{{info.is_package!=1}}"> <view class="other-info-box" wx:if="{{info.is_package!=1}}">
<view class="other-info-item" style="align-items: flex-start;"bindtap="changeSimpleVal" data-keyname="otherInfoShow" data-val="{{1}}"> <view class="other-info-item" style="align-items: flex-start;"bindtap="changeSimpleVal"
data-keyname="otherInfoShow" data-val="{{1}}" wx:if="{{info.shipment_tag}}">
<image style="margin-top: 6rpx;" src="https://static.ticket.sz-trip.com/uploads/20250826/c520e7e453443bfe19e27ea0e44e6b22.png"></image> <image style="margin-top: 6rpx;" src="https://static.ticket.sz-trip.com/uploads/20250826/c520e7e453443bfe19e27ea0e44e6b22.png"></image>
<view class="other-content"> <view class="other-content" >
<view style="color: #0B898E;">预计48小时内发货</view> <view class="textOver" style="color: #0B898E;">{{info.shipment_tag_arr[0]}}</view>
<view style="padding-top: 10rpx;">江苏苏州 | 快递:免运费</view> <view class="textOver" style="padding-top: 10rpx;">{{info.shipment_tag_str}}</view>
</view> </view>
<view style="margin-top: 6rpx;" class="view-arrow">></view> <view style="margin-top: 6rpx;" class="view-arrow">></view>
</view> </view>
<view class="other-info-item" bindtap="changeSimpleVal" data-keyname="otherInfoShow" data-val="{{2}}"> <view class="other-info-item" bindtap="changeSimpleVal" data-keyname="otherInfoShow" data-val="{{2}}"
wx:if="{{info.service_tag_str}}">
<image src="https://static.ticket.sz-trip.com/uploads/20250826/30fc41c747c0126edd396ef92ff7ef62.png"></image> <image src="https://static.ticket.sz-trip.com/uploads/20250826/30fc41c747c0126edd396ef92ff7ef62.png"></image>
<view class="other-content">极速退款 | 未使用可退 | 客服售后</view> <view class="other-content textOver">{{info.service_tag_str}}</view>
<view class="view-arrow">></view> <view class="view-arrow">></view>
</view> </view>
<view class="other-info-item" bindtap="changeSimpleVal" data-keyname="otherInfoShow" data-val="{{3}}"> <view class="other-info-item" bindtap="changeSimpleVal" data-keyname="otherInfoShow" data-val="{{3}}"
wx:if="{{info.parameter_tag_str}}">
<image src="https://static.ticket.sz-trip.com/uploads/20250826/049b31024ee73e76f9612e8d8141bd66.png"></image> <image src="https://static.ticket.sz-trip.com/uploads/20250826/049b31024ee73e76f9612e8d8141bd66.png"></image>
<view class="other-content">名称 鸡头米 | 产地 苏州 | 类型 机剥 | 重量 500g</view> <view class="other-content textOver">{{info.parameter_tag_str}}</view>
<view class="view-arrow">></view> <view class="view-arrow">></view>
</view> </view>
</view> </view>
@ -205,21 +211,21 @@
<view class="info-title">预订须知</view> <view class="info-title">预订须知</view>
<rich-text class="details" nodes="{{tool.formateRichText(info.book_info)}}"></rich-text> <rich-text class="details" nodes="{{tool.formateRichText(info.book_info)}}"></rich-text>
</view> </view>
<view style="height: 20rpx;width: 100%;background: #F7F7F7;"></view>
<view class="proad" id="box4"> <view class="info-box" id="box4" style="padding: 20rpx 26rpx;">
<view class="proad-title"> <!-- <view class="proad-title">
<image mode="aspectFill" src="https://static.ticket.sz-trip.com/uploads/20221027/93dd0ad8fade0ad845e6b67512b4e61b.png"></image> <image mode="aspectFill" src="https://static.ticket.sz-trip.com/uploads/20221027/93dd0ad8fade0ad845e6b67512b4e61b.png"></image>
</view> </view> -->
<view class="info-title">产品推荐</view>
<view class="pro-list"> <view class="pro-list">
<view class="proitem" wx:for="{{tjList}}" bindtap="gotoDetail" data-item="{{item}}"> <view class="proitem" wx:for="{{tjList}}" bindtap="gotoDetail" data-item="{{item}}">
<view class="item-hd"> <view class="item-hd">
<image src="{{item.headimg}}"></image> <image src="{{item.headimg}}"></image>
</view> </view>
<view class="item-bm"> <view class="item-bm" style="height: 120rpx;display: flex;flex-direction: column;justify-content: space-between;">
<view class="protitle textOver">{{item.title}}</view> <view class="protitle textOver2">{{item.title}}</view>
<view class="pro-price"> <view class="pro-price">{{item.price/100}}</view>
{{item.price/100}}
</view>
</view> </view>
</view> </view>
</view> </view>
@ -348,19 +354,26 @@
<view class="other-info-content"> <view class="other-info-content">
<view class="title">{{otherInfoShow==3?"产品参数":otherInfoShow==2?"服务说明":"发货说明"}}</view> <view class="title">{{otherInfoShow==3?"产品参数":otherInfoShow==2?"服务说明":"发货说明"}}</view>
<view wx:if="{{otherInfoShow==1}}"> <view wx:if="{{otherInfoShow==1}}">
<view class="key-title">该商品预计13小时内发货</view> <rich-text class="details" nodes="{{tool.formateRichText(info.shipment_info)}}"></rich-text>
<view class="key-content">订单支付成功后48小时内发货,若未在48小时内发货消费者 可联系客服咨询催促发货。</view> <!-- <view class="key-title">该商品预计13小时内发货</view>
<view class="key-content">订单支付成功后48小时内发货,若未在48小时内发货消费者 可联系客服咨询催促发货。</view> -->
</view> </view>
<view wx:if="{{otherInfoShow==2}}">
<rich-text class="details" nodes="{{tool.formateRichText(info.service_info)}}"></rich-text>
</view>
<view wx:if="{{otherInfoShow==3}}"> <view wx:if="{{otherInfoShow==3}}">
<view class="prod-param"> <rich-text class="details" nodes="{{tool.formateRichText(info.parameter_info)}}"></rich-text>
<!-- <view class="prod-param">
<view class="prod-key">名称</view> <view class="prod-key">名称</view>
<view class="prod-content">鸡头米</view> <view class="prod-content">鸡头米</view>
</view> </view>
<view class="prod-param"> <view class="prod-param">
<view class="prod-key">购买须知</view> <view class="prod-key">购买须知</view>
<view class="prod-content">购买须知购买须知购买须知购买须知购买须知购买须知购买须知购买须知购买须知购买须知</view> <view class="prod-content">购买须知购买须知购买须知购买须知购买须知购买须知购买须知购买须知购买须知购买须知</view>
</view> </view> -->
</view> </view>
</view> </view>

44
pages/info/postProductInfo/index.wxss

@ -15,41 +15,45 @@ page {
.swiper-bottom{ .swiper-bottom{
position: absolute; position: absolute;
/* top: 750rpx; */ /* top: 750rpx; */
margin-top: 694rpx; bottom: 77rpx;
right: 0; right: 0;
width: fit-content; width: 90rpx;
height: 56rpx; height: fit-content;
line-height: 56rpx;
/* background: rgba(1, 0, 0, 0.6);
border-radius: 13rpx 0 0 13rpx; */
display: flex; display: flex;
flex-direction: column;
align-items: center; align-items: center;
font-weight: 500; font-weight: 500;
font-size: 24rpx; font-size: 24rpx;
color: rgba(255,255,255,0.5); color: rgba(255,255,255,0.5);
z-index: 10; z-index: 10;
overflow: hidden;
} }
.swuper-bottom-bg{ .swuper-bottom-bg{
display: flex;
background: rgba(1, 0, 0, 0.6); background: rgba(1, 0, 0, 0.6);
border-radius: 13rpx 0 0 0; border-radius: 20rpx 0rpx 0rpx 20rpx;
padding: 0 5rpx; display: flex;
flex-direction: column;
width: 100%;
padding: 8rpx 0;
margin-bottom: 12rpx;
} }
.swiper-bottom-item{ .swiper-bottom-item{
padding: 0 14rpx; width: 100%;
text-align: center;
padding: 14rpx 0;
} }
.swiper-bottom-item.active{ .swiper-bottom-item.active{
color: #fff; color: #fff;
} }
.swiper-bottom-item.bottom-number{ .swiper-bottom-item.bottom-number{
max-width: 100%;
width: fit-content;
background: rgba(1, 0, 0, 0.6); background: rgba(1, 0, 0, 0.6);
border-radius: 13rpx; border-radius: 13rpx;
height: 40rpx; height: 40rpx;
line-height: 40rpx; line-height: 40rpx;
padding: 0 10rpx; padding: 0 10rpx;
margin-right: 6rpx; overflow: hidden;
box-sizing: border-box;
} }
.top-info { .top-info {
@ -459,8 +463,9 @@ page {
} }
.btns .btn:nth-child(1) { .btns .btn:nth-child(1) {
margin-right: 3rpx; /* margin-right: 3rpx; */
border-radius: 39rpx 0 0 39rpx; border-radius: 39rpx 0 0 39rpx;
background: #FD7601;
} }
.btns .btn:nth-child(2) { .btns .btn:nth-child(2) {
@ -692,6 +697,7 @@ width: 250rpx;
border-radius: 50%; border-radius: 50%;
right: 20rpx; right: 20rpx;
bottom: 166rpx; bottom: 166rpx;
z-index: 15;
} }
.cart-box image { .cart-box image {
@ -922,16 +928,16 @@ height: 133rpx;
flex-wrap: wrap; flex-wrap: wrap;
} }
.proitem{ .proitem{
width: 226rpx; width: 334rpx;
height: 234rpx; height: 497rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 10rpx; border-radius: 10rpx;
margin-top: 20rpx; margin-top: 20rpx;
} }
.item-hd image{ .item-hd image{
width: 226rpx; width: 334rpx;
height: 130rpx; height: 342rpx;
border-radius: 10rpx 10rpx 0px 0px; border-radius: 13rpx 13rpx 0px 0px;
} }
.item-bm{ .item-bm{
padding: 8rpx 12rpx; padding: 8rpx 12rpx;

Loading…
Cancel
Save