Browse Source

补贴接入中

补贴接入中
master
xuetaotao 4 years ago
parent
commit
78a497ddb1
  1. 14
      pages/info/postProductInfo/index.js
  2. 50
      pages/info/postProductInfo/index.wxml
  3. 133
      pages/info/postProductInfo/index.wxss
  4. 6
      project.private.config.json
  5. 4
      utils/https.js

14
pages/info/postProductInfo/index.js

@ -28,7 +28,8 @@ Page({
cartImgInfo: null,
cartCount: 0,
shareImg: null,
showShareFlag:false
showShareFlag: false,
allowance_data: null
},
/**
@ -66,6 +67,16 @@ Page({
info: res.data
})
// 获取补贴
// commonApi.user_post("product/getProductAllowancePrice", {
// product_code: res.data.product_code
// }).then(resTwo => {
// if (resTwo) {
// this.setData({
// allowance_data: resTwo.data
// })
// }
// })
this.BroswerRecord()
})
// 获取评价列表
@ -80,6 +91,7 @@ Page({
commentTotal: res.data.total
})
})
},
BroswerRecord: function () {
setTimeout(() => {

50
pages/info/postProductInfo/index.wxml

@ -2,9 +2,10 @@
<wxs src="../../../utils/filter.wxs" module="tool" />
<title title="产品详情"></title>
<view class="iconfont icon-fenxiang" bindtap="share"></view>
<image wx:for="{{info.sku}}" style="{{aniSkuIndex==index?('top:'+cartTop+'px;'):('top:'+top+'px;'+cartImgInfo)}}" class="headimg{{aniSkuIndex==index?' active':''}}" src="{{item.headimg}}" mode="aspectFill"></image>
<swiper class="swiper" indicator-dots="{{true}}" wx:if="{{info}}"
autoplay="{{autoPlay}}" interval="{{2000}}" duration="{{300}}">
<image wx:for="{{info.sku}}" style="{{aniSkuIndex==index?('top:'+cartTop+'px;'):('top:'+top+'px;'+cartImgInfo)}}"
class="headimg{{aniSkuIndex==index?' active':''}}" src="{{item.headimg}}" mode="aspectFill"></image>
<swiper class="swiper" indicator-dots="{{true}}" wx:if="{{info}}" autoplay="{{autoPlay}}" interval="{{2000}}"
duration="{{300}}">
<block wx:if="{{info.videourl}}" wx:key="*this">
<swiper-item>
<video bindplay="playVideo" src="{{info.videourl}}" controls></video>
@ -17,11 +18,17 @@
</swiper-item>
</block>
</swiper>
<view class="allowance-box" wx:if="{{allowance_data}}">
补贴价
<view class="com-price two">{{ allowance_data.mini_price / 100 }}</view>
<view class="yellow">单品最高补贴{{ allowance_data.max_price / 100 }}元</view>
</view>
<view class="top-info" wx:if="{{info}}">
<view class="title">{{info.title}}</view>
<view class="subtitle">{{info.subtitle}}</view>
<view class="tags-box textOver">
<view class="tag textOver" wx:for="{{info.display_tags}}">{{item}}<view class="line"></view></view>
<view class="tag textOver" wx:for="{{info.display_tags}}">{{item}}<view class="line"></view>
</view>
<view class="tags-price"><text>¥</text><text>{{info.price/100}}</text><text>起</text></view>
</view>
</view>
@ -47,7 +54,8 @@
</view>
<view class="box">
<view class="box-top">
<text class="iconfont icon-tiwen"></text><text>游客点评</text><text class="score" wx:if="{{info && info.rate && commentTotal>0}}">{{info.rate}}分</text>
<text class="iconfont icon-tiwen"></text><text>游客点评</text><text class="score"
wx:if="{{info && info.rate && commentTotal>0}}">{{info.rate}}分</text>
<text class="all-comment-num">共{{commentTotal}}条</text>
</view>
<view class="empty-box" wx:if="{{!comment || comment.length==0}}">
@ -59,13 +67,15 @@
<image src="{{item.user.avatar}}" mode="aspectFill"></image>
<view class="comment-info">
<view class="nickname">{{item.user.nickname}}</view>
<view class="iconfont"><text wx:for="{{item.rate}}" class="icon-xingxing"></text><text wx:for="{{5 - item.rate}}" style="color:#999" class="icon-xingxing"></text></view>
<view class="iconfont"><text wx:for="{{item.rate}}" class="icon-xingxing"></text><text
wx:for="{{5 - item.rate}}" style="color:#999" class="icon-xingxing"></text></view>
</view>
<view class="comment-date">{{item.create_time}}</view>
</view>
<view class="comment-content">{{item.content}}</view>
</navigator>
<navigator url="/pages/list/comments/index?productid={{id}}" wx:if="{{comment.length>0}}" class="more-comment-btn">查看全部点评<text class="iconfont icon-you"></text></navigator>
<navigator url="/pages/list/comments/index?productid={{id}}" wx:if="{{comment.length>0}}" class="more-comment-btn">
查看全部点评<text class="iconfont icon-you"></text></navigator>
</view>
<view style="height:140rpx"></view>
<view class="fixed-bottom">
@ -85,7 +95,8 @@
</view>
</view>
<!-- 购物车悬浮框 -->
<navigator url="/pages/user/cartlist/list" catchtap="pagePoint" data-event='product_cart_click' class="cart-box" id="cart">
<navigator url="/pages/user/cartlist/list" catchtap="pagePoint" data-event='product_cart_click' class="cart-box"
id="cart">
<image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/cart.png" mode="widthFix"></image>
<view class="cart-num">{{cartCount}}</view>
</navigator>
@ -101,7 +112,8 @@
</view>
</view>
<view class="sku-names">
<view bindtap="selectSku" data-index="{{index}}" class="sku-name-item textOver{{index==skuIndex?' active':''}}" wx:for="{{info.sku}}">{{item.sku_name}}</view>
<view bindtap="selectSku" data-index="{{index}}" class="sku-name-item textOver{{index==skuIndex?' active':''}}"
wx:for="{{info.sku}}">{{item.sku_name}}</view>
</view>
<view class="number-box">
<text>数量</text>
@ -111,7 +123,8 @@
</view>
<view style="height:138rpx"></view>
<view class="btn-box">
<view class="mask-btn" bindtap="order" wx:if="{{info.sku[skuIndex].flag=='on'}}">{{skuFlag=='cart'?'确认':'立即购买'}}</view>
<view class="mask-btn" bindtap="order" wx:if="{{info.sku[skuIndex].flag=='on'}}">{{skuFlag=='cart'?'确认':'立即购买'}}
</view>
<view class="mask-btn disable" wx:else>该商品已下架</view>
</view>
</view>
@ -127,15 +140,22 @@
<image class="share-img" src="{{shareImg}}" mode="widthFix"></image>
<view class="share-tips">
<view style="position:relative">
<image class="img" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/img.png" mode="widthFix"></image>
<image class="img" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/img.png" mode="widthFix">
</image>
<view>保存图片到相册</view>
<view class="tipimg"><image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/ok.png" mode="widthFix"></image></view>
<view class="tipimg">
<image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/ok.png" mode="widthFix"></image>
</view>
<image style="width:36rpx" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/arrow2.png" mode="widthFix"></image>
</view>
<image style="width:36rpx" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/arrow2.png"
mode="widthFix"></image>
<view style="position:relative">
<image class="img" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/code.png" mode="widthFix"></image>
<image class="img" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/code.png" mode="widthFix">
</image>
<view>微信识别二维码</view>
<view class="tipimg"><image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/ok1.png" mode="widthFix"></image></view>
<view class="tipimg">
<image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/ok1.png" mode="widthFix"></image>
</view>
</view>
</view>
<view class="save-btn" bindtap="save">保存到相册</view>

133
pages/info/postProductInfo/index.wxss

@ -2,15 +2,19 @@
page {
background: #f2f2f2;
}
.swiper {
width: 100%;
height: 420rpx;
}
.swiper image,.swiper video {
.swiper image,
.swiper video {
height: 420rpx;
display: block;
width: 100%;
}
.top-info {
border-radius: 20rpx 20rpx 0 0;
background: white;
@ -19,16 +23,19 @@ page {
margin-top: -20rpx;
padding: 20rpx 40rpx;
}
.top-info .title {
font-size: 32rpx;
font-weight: 500;
color: #000;
}
.top-info .subtitle {
color: #666;
font-size: 27rpx;
margin-top: 20rpx;
}
.tags-box {
margin-top: 10rpx;
display: flex;
@ -37,6 +44,7 @@ page {
font-size: 27rpx;
height: 50rpx;
}
.tags-box .tag {
position: relative;
line-height: 20rpx;
@ -45,6 +53,7 @@ page {
line-height: 50rpx;
margin-right: 10rpx;
}
.tags-box .tag .line {
content: "1";
display: block;
@ -57,31 +66,38 @@ page {
top: 30rpx;
z-index: -1;
}
.tags-price {
flex: 1;
text-align: right;
color: #D62828;
}
.tags-price text:nth-child(1) {
font-size: 27rpx;
}
.tags-price text:nth-child(2) {
font-size: 40rpx;
font-weight: bold;
}
.tags-price text:nth-child(3) {
font-size: 20rpx;
color: #999999;
margin-left: 4rpx;
}
.tags-box .iconfont {
margin-left: 4rpx;
font-size: 24rpx;
}
.address-box {
justify-content: space-between;
margin-top: 0;
}
.info-address {
color: #666;
font-size: 27rpx;
@ -89,9 +105,11 @@ page {
height: 30rpx;
line-height: 30rpx;
}
.address-box .iconfont {
font-size: 34rpx;
}
.date-all-box {
margin: 24rpx 20rpx;
display: flex;
@ -105,6 +123,7 @@ page {
font-weight: 500;
padding: 0 37rpx;
}
.days {
text-align: center;
font-size: 400;
@ -115,11 +134,13 @@ page {
border: 1px solid white;
font-size: 23rpx;
}
.picker text {
font-weight: 400;
font-size: 21rpx;
margin-left: 13rpx;
}
.product-item {
display: flex;
align-items: flex-end;
@ -129,6 +150,7 @@ page {
background: white;
border-radius: 13rpx;
}
.product-item image {
width: 201rpx;
height: 201rpx;
@ -136,28 +158,34 @@ page {
margin-right: 26rpx;
flex-shrink: 0;
}
.product-item .product-info {
flex: 1;
}
.product-item .product-info .title {
font-size: 32rpx;
color: #000;
font-weight: 500;
}
.product-right {
flex-shrink: 0;
margin-left: 20rpx;
}
.product-right .price {
color: #D62828;
font-size: 40rpx;
font-weight: 500;
}
.product-right .price::before {
content: "¥";
font-size: 27rpx;
font-weight: 400;
}
.product-right .btn {
color: #fff;
width: 120rpx;
@ -169,6 +197,7 @@ page {
text-align: center;
margin-top: 20rpx;
}
.product-info .subtitle {
font-size: 24rpx;
line-height: 36rpx;
@ -178,10 +207,12 @@ page {
color: #999;
white-space: normal;
}
.product-tags {
display: flex;
align-items: center;
}
.product-tag {
font-size: 20rpx;
color: #0B898E;
@ -191,14 +222,17 @@ page {
padding: 0 15rpx;
margin-right: 13rpx;
}
.product-tags .product-tags:last-child {
margin-right: 0;
}
.box {
margin: 20rpx;
background: white;
border-radius: 13rpx;
}
.box-top {
line-height: 95rpx;
border-bottom: 1rpx solid #d9d9d9;
@ -207,17 +241,20 @@ page {
font-size: 35rpx;
padding: 0 20rpx;
}
.box-top .iconfont {
color: #0B898E;
font-size: 33rpx;
margin-right: 16rpx;
}
.empty-box {
text-align: center;
padding: 40rpx 0;
font-size: 23rpx;
color: #333;
}
.empty-btn {
margin: 0 auto;
margin-top: 30rpx;
@ -229,17 +266,20 @@ page {
font-size: 32rpx;
margin-bottom: 10rpx;
}
.box-top .score {
color: #D62828;
font-size: 30rpx;
font-weight: 400;
margin-left: 11rpx;
}
.product-comment {
margin: 0 20rpx;
border-bottom: 1rpx solid #ccc;
padding: 33rpx 0;
}
.product-comment-top {
display: flex;
justify-content: space-between;
@ -247,31 +287,37 @@ page {
align-items: center;
font-size: 24rpx;
}
.product-comment-top image {
flex-shrink: 0;
width: 57rpx;
height: 57rpx;
border-radius: 50%;
}
.product-comment-top .comment-info {
flex: 1;
margin: 0 15rpx;
color: #666;
font-size: 21rpx;
}
.product-comment-top .comment-info .iconfont {
color: #D62828;
font-size: 22rpx;
}
.product-comment-top .comment-info .iconfont text {
margin-right: 6rpx;
}
.comment-content {
margin-left: 72rpx;
margin-top: 36rpx;
font-size: 28rpx;
color: #000;
}
.more-comment-btn {
line-height: 93rpx;
margin-right: 20rpx;
@ -280,20 +326,24 @@ page {
font-size: 27rpx;
font-weight: 500;
}
.more-comment-btn .iconfont {
margin-left: 6rpx;
font-size: 24rpx;
}
.all-comment-num {
float: right;
color: #999999;
font-size: 27rpx;
font-weight: 400;
}
.scroll-all-box {
margin: 24rpx 0;
background: white;
}
.scroll-menus {
padding: 0 40rpx;
display: flex;
@ -304,10 +354,12 @@ page {
height: 84rpx;
border-bottom: 1rpx solid #d9d9d9;
}
.scroll-menu-item {
position: relative;
line-height: 84rpx;
}
.scroll-menu-item.active::after {
content: "1";
font-size: 0;
@ -321,6 +373,7 @@ page {
margin-left: -23rpx;
bottom: 0rpx;
}
.fixed-menus {
position: fixed;
left: 0;
@ -328,15 +381,18 @@ page {
background: white;
z-index: 1;
}
.info-title {
font-size: 35rpx;
font-weight: bold;
color: #000;
margin-bottom: 30rpx;
}
.info-box {
padding: 20rpx 40rpx;
}
.fixed-bottom {
position: fixed;
left: 0;
@ -353,10 +409,12 @@ page {
justify-content: space-between;
text-align: center;
}
.fixed-bottom .iconfont {
font-size: 34rpx;
line-height: 40rpx;
}
.btns {
color: #fff;
font-size: 32rpx;
@ -367,21 +425,26 @@ page {
align-items: center;
justify-content: center;
}
.btns .btn {
width: 216rpx;
line-height: 78rpx;
background: #D62828;
}
.btns .btn:nth-child(1) {
margin-right: 3rpx;
border-radius: 39rpx 0 0 39rpx;
}
.btns .btn:nth-child(2) {
border-radius: 0 39rpx 39rpx 0;
}
.btns .btn.disable {
background: #ccc;
}
.mask-content {
position: absolute;
left: 0;
@ -389,16 +452,19 @@ page {
bottom: 0;
width: 100%;
}
.mask-content .icon-close {
position: absolute;
right: 40rpx;
top: 40rpx;
}
.sku-info-box {
margin: 50rpx 40rpx;
display: flex;
justify-content: space-between;
}
.sku-info-box image {
width: 218rpx;
height: 180rpx;
@ -407,24 +473,29 @@ page {
margin-right: 40rpx;
flex-shrink: 0;
}
.sku-info {
flex: 1;
}
.sku-price {
font-size: 40rpx;
font-weight: 500;
color: #D62828;
margin: 20rpx 0;
}
.sku-price::before {
content: "¥";
font-weight: 400;
font-size: 27rpx;
}
.sku-name {
font-size: 27rpx;
color: #666666;
}
.sku-names {
display: flex;
font-size: 29rpx;
@ -434,6 +505,7 @@ page {
flex-wrap: wrap;
margin-bottom: 20rpx;
}
.sku-name-item {
background: #EFEFEF;
border: 1rpx solid #EFEFEF;
@ -443,14 +515,17 @@ page {
margin-bottom: 25rpx;
margin-right: 30rpx;
}
.sku-name-item:nth-child(2n) {
margin-right: 0;
}
.sku-name-item.active {
color: #0B898E;
border-color: #0B898E;
background: rgba(11, 137, 142, 0.1);
}
.number-box {
display: flex;
align-items: center;
@ -459,11 +534,13 @@ page {
margin: 0 40rpx;
padding: 40rpx 0;
}
.number-box text {
flex: 1;
font-size: 29rpx;
color: #333;
}
.number-box view {
border: 1rpx solid #666;
border-radius: 7rpx;
@ -473,14 +550,17 @@ page {
font-size: 33rpx;
color: #000;
}
.number-box view.disable {
border-color: #ccc;
color: #999;
}
.number-box view.number {
width: 94rpx;
margin: 0 15rpx;
}
.btn-box {
height: 138rpx;
background: #FFFFFF;
@ -493,6 +573,7 @@ page {
right: 0;
bottom: 0;
}
.mask-btn {
width: 670rpx;
line-height: 78rpx;
@ -503,9 +584,11 @@ page {
font-size: 33rpx;
font-weight: 500;
}
.mask-btn.disable {
background: #ccc;
}
/* .icon-xin,.icon-shoucang {
position: absolute;
right: 20rpx;
@ -532,11 +615,13 @@ page {
font-size: 36rpx;
z-index: 1;
}
.icon-shoucang {
color: #D62828;
font-size: 40rpx !important;
}
/* 购物车 */
.cart-box {
position: fixed;
@ -551,10 +636,12 @@ page {
right: 20rpx;
bottom: 166rpx;
}
.cart-box image {
display: block;
width: 49rpx;
}
.cart-num {
width: 26rpx;
border: 1rpx solid;
@ -567,6 +654,7 @@ page {
right: -2rpx;
top: -5rpx;
}
.headimg {
position: fixed;
z-index: 3;
@ -575,6 +663,7 @@ page {
height: 180rpx;
top: 0;
}
.headimg.active {
transition: left .6s linear, top .6s cubic-bezier(0.5, -0.5, 1, 1), width .6s ease, height .6s ease;
width: 80rpx;
@ -582,6 +671,7 @@ page {
left: 650rpx;
border-radius: 50%;
}
.share-img-box {
/* width: 551rpx; */
position: static;
@ -591,10 +681,12 @@ page {
align-items: center;
justify-content: center;
}
.share-img {
display: block;
width: 551rpx;
}
.share-tips {
width: 426rpx;
height: 150rpx;
@ -610,12 +702,14 @@ page {
text-align: center;
line-height: 40rpx;
}
.share-tips .img {
display: block;
width: 55rpx;
margin: 0 auto;
margin-bottom: 4rpx;
}
.tipimg {
position: absolute;
left: 50%;
@ -629,11 +723,13 @@ page {
justify-content: center;
top: 34rpx;
}
.tipimg image {
width: 21rpx;
display: block;
}
.save-btn {
width: 403rpx;
line-height: 77rpx;
@ -645,3 +741,38 @@ page {
font-weight: 500;
margin-top: 50rpx;
}
.allowance-box {
height: 114rpx;
background-image: url("/static/images/detail/allowanceBacTwo.png");
padding: 20rpx 10rpx;
font-size: 18rpx;
color: #FFFFFF;
margin-top: -60rpx;
position: relative;
display: flex;
justify-content: start;
}
.allowance-box .com-price {
font-size: 30rpx;
color: #FFFFFF;
}
.allowance-box .com-price:before {
font-size: 18rpx;
color: #FFFFFF;
}
.allowance-box .com-price:after {
font-size: 18rpx;
color: #FFFFFF;
}
.allowance-box .yellow {
color: #DF2115;
padding: 8rpx 14rpx;
background-color: #FDEDD4;
margin-left: 20rpx;
border-radius: 30rpx;
}

6
project.private.config.json

@ -13,9 +13,9 @@
"miniprogram": {
"list": [
{
"name": "pages/list/museum/index",
"pathName": "pages/list/museum/index",
"query": "id=59532203100900035699",
"name": "产品详情4407",
"pathName": "pages/info/postProductInfo/index",
"query": "id=4407",
"scene": null
},
{

4
utils/https.js

@ -1,8 +1,8 @@
var app = getApp();
import util from "../utils/util"
// import userApi from "../utils/https/user.js";
// const baseUrl = "https://test.api.cloud.sz-trip.com/api/";
const baseUrl = "https://api.cloud.sz-trip.com/api/";
const baseUrl = "https://test.api.cloud.sz-trip.com/api/";
// const baseUrl = "https://api.cloud.sz-trip.com/api/";
const orders = ['','weight','distance','sale_number','sale_price','price'];
//封装GET请求
function _get(url,data) {

Loading…
Cancel
Save