Browse Source

修改补贴

修改补贴
master
xuetaotao 4 years ago
parent
commit
9d9599f1f9
  1. 8
      pages/info/postProductInfo/index.js
  2. 12
      pages/info/postProductInfo/index.wxml
  3. 14
      pages/info/postProductInfo/index.wxss
  4. 42
      pages/info/sceneProductInfo/index.js
  5. 68
      pages/info/sceneProductInfo/index.wxml
  6. 119
      pages/info/sceneProductInfo/index.wxss
  7. 6
      pages/order/postOrder/index.js
  8. 9
      pages/order/postOrder/index.wxml
  9. 12
      pages/order/postOrder/index.wxss
  10. 69
      pages/order/scene/index.js
  11. 22
      pages/order/scene/index.wxml
  12. 71
      pages/order/scene/index.wxss
  13. 8
      project.private.config.json
  14. 8
      utils/https.js

8
pages/info/postProductInfo/index.js

@ -29,7 +29,8 @@ Page({
cartCount: 0,
shareImg: null,
showShareFlag: false,
allowance_data: null
allowance_data: null,
showAllowance: false
},
/**
@ -93,6 +94,11 @@ Page({
})
},
changeAllowance: function () {
this.setData({
showAllowance: !this.data.showAllowance
})
},
BroswerRecord: function () {
setTimeout(() => {
if (app.globalData.uuid) {

12
pages/info/postProductInfo/index.wxml

@ -18,7 +18,7 @@
</swiper-item>
</block>
</swiper>
<view class="allowance-box" wx:if="{{allowance_data}}">
<view class="allowance-box" wx:if="{{allowance_data}}" bindtap="changeAllowance">
补贴价
<view class="com-price two">¥{{ allowance_data.mini_price / 100 }}起</view>
<view class="yellow">单品最高补贴{{ allowance_data.max_price / 100 }}元</view>
@ -108,7 +108,8 @@
<image id="skuImg" src="{{info.sku[skuIndex].headimg}}" mode="aspectFill"></image>
<view class="sku-info">
<view class="sku-price">{{info.sku[skuIndex].price/100}}
<view class="allowance" wx:if="{{allowance_data}}">补贴价:¥{{ (1 - allowance_data.discount_rate / 100) * info.sku[skuIndex].price / 100 }}</view>
<view class="allowance" wx:if="{{allowance_data}}">
补贴价:¥{{ (1 - allowance_data.discount_rate / 100) * info.sku[skuIndex].price / 100 }}</view>
</view>
<view class="sku-name">已选择:{{info.sku[skuIndex].sku_name}}</view>
</view>
@ -163,3 +164,10 @@
<view class="save-btn" bindtap="save">保存到相册</view>
</view>
</view>
<view class="mask mask-allowance" wx:if="{{showAllowance}}">
<view bindtap="changeAllowance" class="mask-bg"></view>
<view class="mask-content rule-box">
<view class="rule-title">{{allowance_data.title}}</view>
<rich-text nodes="{{allowance_data.content}}"></rich-text>
</view>
</view>

14
pages/info/postProductInfo/index.wxss

@ -793,3 +793,17 @@ page {
margin-left: 20rpx;
border-radius: 30rpx;
}
.mask-allowance .mask-content {
margin: auto;
width: auto;
top: initial;
bottom: initial;
padding: 20rpx;
width: 80%;
}
.mask-allowance .mask-content .rule-title {
text-align: center;
margin-bottom: 20rpx;
}

42
pages/info/sceneProductInfo/index.js

@ -21,7 +21,9 @@ Page({
isTest: true,
retailId: "",
shareImg: null,
showShareFlag: false
showShareFlag: false,
showAllowance: false,
allowance_data:null,
},
/**
@ -123,6 +125,11 @@ Page({
console.log(res)
})
},
changeAllowance: function () {
this.setData({
showAllowance: !this.data.showAllowance
})
},
BroswerRecord: function () {
setTimeout(() => {
if (app.globalData.uuid) {
@ -499,6 +506,39 @@ Page({
}
if (this.data.info && this.data.info.id) {
this.drawImg()
// 获取补贴
if (this.data.product.length == 1) {
commonApi.user_post("product/getProductAllowancePrice", {
product_code: this.data.product[0].product.product_code
}).then(resTwo => {
console.log(resTwo)
if (resTwo && resTwo.code == 1) {
this.setData({
allowance_data: resTwo.data
})
let spread_price = Number(this.data.allowance_data.discount_limit_price - this.data.allowance_data.user_used_price)
let sInfo = this.data.product[0].sku
console.log(9999, this.data.allowance_data.discount_rate / 100 * sInfo.price)
console.log(9999, spread_price)
if (spread_price > 0) {
if (spread_price < this.data.allowance_data.discount_rate / 100 * sInfo.price) {
this.setData({
allowance_price: spread_price
})
} else {
this.setData({
allowance_price: this.data.allowance_data.discount_rate / 100 * sInfo.price
})
}
this.changePrice()
} else {
this.setData({
allowance_price: 0
})
}
}
})
}
}
else {
setTimeout(() => {

68
pages/info/sceneProductInfo/index.wxml

@ -6,8 +6,8 @@
<view>语音导览</view>
<image src="https://static.ticket.sz-trip.com/xcxImages/info/play-btn.png" mode="widthFix"></image>
</view> -->
<swiper class="swiper" indicator-dots="{{true}}" wx:if="{{info}}"
autoplay="{{true}}" interval="{{2000}}" duration="{{300}}">
<swiper class="swiper" indicator-dots="{{true}}" wx:if="{{info}}" autoplay="{{true}}" interval="{{2000}}"
duration="{{300}}">
<block wx:for="{{info.listimg}}" wx:key="*this">
<swiper-item>
<image src="{{item}}" mode="aspectFill"></image>
@ -17,20 +17,29 @@
<view class="top-info" wx:if="{{info}}" style="position:relative">
<view class="title">{{info.title}}</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-text">详情 <text class="iconfont icon-you"></text></view> -->
</view>
<view class="tags-box address-box" style="height:auto">
<view class="info-address">开园时间:{{info.open_time}}</view>
<navigator url="/pages/info/sceneInfo/index?id={{info.id}}" catchtap="pagePoint" data-event="scene_detail" class="iconfont" style="font-size:27rpx;flex-shrink:0">优待政策 | 景点介绍 <text class="iconfont icon-you" style="font-size:24rpx"></text></navigator>
<navigator url="/pages/info/sceneInfo/index?id={{info.id}}" catchtap="pagePoint" data-event="scene_detail"
class="iconfont" style="font-size:27rpx;flex-shrink:0">优待政策 | 景点介绍 <text class="iconfont icon-you"
style="font-size:24rpx"></text></navigator>
</view>
<view class="tags-box textOver address-box">
<view class="info-address">地址:{{info.address}}</view>
<view class="iconfont icon-daohang" bindtap="gotolocation"></view>
</view>
<view class="status-text{{info.garden_flag==0?' disable':''}}" wx:if="{{info.garden_flag_text && info.garden_flag!=1}}">{{info.garden_flag_text}}</view>
<view class="status-text{{info.garden_flag==0?' disable':''}}"
wx:if="{{info.garden_flag_text && info.garden_flag!=1}}">{{info.garden_flag_text}}</view>
</view>
<view class="box" wx:if="{{info}}" wx:for="{{info.product}}">
<view class="allowance-box" wx:if="{{info.allowance}}" bindtap="changeAllowance">
补贴价
<view class="com-price two">¥{{ info.allowance.mini_price / 100 }}起</view>
<view class="yellow">单品最高补贴{{ info.allowance.max_price / 100 }}元</view>
</view>
<view class="box-top">
<text>{{item.title}}</text>
</view>
@ -45,7 +54,9 @@
</view>
<view class="product-right">
<view class="price"><text>¥</text><text>{{sku.price?sku.price/100:0}}</text><text>起</text></view>
<view bindtap="order" data-sku="{{sku}}" data-product="{{item}}" data-disable="{{item.flag==0 || sku.flag=='off'?1:0}}" class="btn{{item.flag==0 || sku.flag=='off'?' disable':''}}">立即预订</view>
<view bindtap="order" data-sku="{{sku}}" data-product="{{item}}"
data-disable="{{item.flag==0 || sku.flag=='off'?1:0}}"
class="btn{{item.flag==0 || sku.flag=='off'?' disable':''}}">立即预订</view>
</view>
</view>
</view>
@ -60,10 +71,12 @@
</view>
<view class="empty-box" wx:if="{{!ask || ask.length==0}}">
<view>这里空空如也,快去向大家提问吧!</view>
<navigator url="/pages/ask/index?id={{id}}" catchtap="pagePoint" data-event="scene_question" class="empty-btn">去提问</navigator>
<navigator url="/pages/ask/index?id={{id}}" catchtap="pagePoint" data-event="scene_question" class="empty-btn">去提问
</navigator>
</view>
<view class="ask-list" wx:else>
<navigator url="/pages/ask/info/index?id={{item.id}}" catchtap="pagePoint" data-event="scene_comment" class="ask-item" wx:for="{{ask}}">
<navigator url="/pages/ask/info/index?id={{item.id}}" catchtap="pagePoint" data-event="scene_comment"
class="ask-item" wx:for="{{ask}}">
<view class="item-ques">
<image class="item-icon" src="https://static.ticket.sz-trip.com/xcxImages/ask/ask.png" mode="widthFix"></image>
<view class="ques">{{item.question_name}}</view>
@ -79,12 +92,14 @@
<!-- <view class="ans-number">全部{{item.answer && item.answer.total ? item.answer.total : 0}}个回答 <text class="iconfont icon-you"></text> </view> -->
<!-- </view> -->
</navigator>
<navigator style="border-top:1rpx solid #ccc" url="/pages/ask/index?id={{info.id}}" class="more-comment-btn">查看全部问答<text class="iconfont icon-you"></text></navigator>
<navigator style="border-top:1rpx solid #ccc" url="/pages/ask/index?id={{info.id}}" class="more-comment-btn">
查看全部问答<text class="iconfont icon-you"></text></navigator>
</view>
</view>
<view class="box">
<view class="box-top">
<text class="iconfont icon-tiwen"></text><text>游客点评</text><text class="score" wx:if="{{info && commentTotal>0}}">{{info.rate}}分</text>
<text class="iconfont icon-tiwen"></text><text>游客点评</text><text class="score"
wx:if="{{info && commentTotal>0}}">{{info.rate}}分</text>
<text class="all-comment-num">共{{commentTotal}}条</text>
</view>
<view class="empty-box" wx:if="{{!comment || comment.length==0}}">
@ -96,16 +111,19 @@
<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?sceneid={{id}}" wx:if="{{comment.length>0}}" class="more-comment-btn">查看全部点评<text class="iconfont icon-you"></text></navigator>
<navigator url="/pages/list/comments/index?sceneid={{id}}" wx:if="{{comment.length>0}}" class="more-comment-btn">
查看全部点评<text class="iconfont icon-you"></text></navigator>
</view>
<view style="height:{{safeBottom}}px"></view>
<notice bookingInfo="{{bookingInfo}}" skuName="{{bookingInfoTitle}}" wx:if="{{bookingInfo}}" bind:close="closeMask"></notice>
<notice bookingInfo="{{bookingInfo}}" skuName="{{bookingInfoTitle}}" wx:if="{{bookingInfo}}" bind:close="closeMask">
</notice>
<view style="position:absolute;right:0;left:-10000rpx;top:-20000rpx;z-index:-1">
<canvas canvas-id='imageCanvas' class='imageCanvas' style="width:551rpx;height:643rpx;" disable-scroll='true'>
</canvas>
@ -117,17 +135,31 @@
<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>
</view>
<image style="width:36rpx" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/arrow2.png" mode="widthFix"></image>
<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>
</view>
</view>
<view class="mask mask-allowance" wx:if="{{showAllowance}}">
<view bindtap="changeAllowance" class="mask-bg"></view>
<view class="mask-content rule-box">
<view class="rule-title">{{info.allowance.title}}</view>
<rich-text nodes="{{info.allowance.content}}"></rich-text>
</view>
</view>

119
pages/info/sceneProductInfo/index.wxss

@ -2,15 +2,18 @@
page {
background: #f2f2f2;
}
.swiper {
width: 100%;
height: 400rpx;
}
.swiper image {
height: 400rpx;
display: block;
width: 100%;
}
.top-info {
border-radius: 20rpx 20rpx 0 0;
background: white;
@ -19,11 +22,13 @@ page {
margin-top: -20rpx;
padding: 20rpx 40rpx;
}
.top-info .title {
font-size: 32rpx;
font-weight: 500;
color: #000;
}
.tags-box {
margin-top: 10rpx;
margin-bottom: 20rpx;
@ -33,6 +38,7 @@ page {
font-size: 27rpx;
height: 50rpx;
}
.tags-box .tag {
position: relative;
line-height: 20rpx;
@ -41,6 +47,7 @@ page {
line-height: 50rpx;
margin-right: 10rpx;
}
.tags-box .tag .line {
content: "1";
display: block;
@ -53,32 +60,39 @@ page {
top: 30rpx;
z-index: -1;
}
.tags-text {
flex: 1;
text-align: right;
}
.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;
margin-bottom: 0rpx;
line-height: 40rpx;
}
.address-box .iconfont {
font-size: 34rpx;
}
.box {
margin: 20rpx;
background: white;
border-radius: 13rpx;
}
.box-top {
line-height: 95rpx;
border-bottom: 1rpx solid #d9d9d9;
@ -87,29 +101,35 @@ page {
font-size: 35rpx;
padding: 0 20rpx;
}
.product-item {
margin: 0 20rpx;
padding: 27rpx 0;
border-bottom: 1rpx solid #ccc;
}
.skutitle {
font-size: 29rpx;
color: #333;
font-weight: 500;
}
.product-box {
display: flex;
align-items: flex-end;
justify-content: space-between;
margin-top: 20rpx;
}
.product-left {
flex: 1;
}
.product-tags {
display: flex;
align-items: center;
}
.product-tag {
font-size: 20rpx;
color: #0B898E;
@ -119,31 +139,38 @@ page {
padding: 0 15rpx;
margin-right: 13rpx;
}
.product-tags .product-tags:last-child {
margin-right: 0;
}
.order-tip-text {
margin-top: 33rpx;
font-size: 24rpx;
color: #666;
}
.product-right {
text-align: center;
flex-shrink: 0;
}
.product-right .price {
color: #D62828;
font-size: 24rpx;
margin-bottom: 20rpx;
}
.product-right .price text:nth-child(2) {
font-weight: 500;
font-size: 33rpx;
}
.product-right .price text:nth-child(3) {
color: #8D8D8D;
font-size: 20rpx;
}
.product-right .btn {
background: #D62828;
color: #fff;
@ -153,23 +180,28 @@ page {
font-weight: 500;
width: 176rpx;
}
.product-right .btn.disable {
background: #ccc;
}
.box .product-item:last-child {
border-bottom: none;
}
.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;
@ -181,17 +213,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;
@ -199,31 +234,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;
@ -232,23 +273,28 @@ 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;
}
.ask-list .ask-item:nth-child(1) {
margin-top: 40rpx;
}
.ask-item {
padding: 0 25rpx;
margin-bottom: 40rpx;
}
.item-ques {
display: flex;
color: #000;
@ -256,16 +302,19 @@ page {
font-size: 29rpx;
line-height: 38rpx;
}
.item-ques image {
width: 36rpx;
margin-right: 18rpx;
flex-shrink: 0;
}
.item-ques .ques {
font-size: 32rpx;
font-weight: 500;
flex: 1;
}
.ques-tip {
margin-left: 54rpx;
color: #999999;
@ -274,14 +323,18 @@ page {
align-items: center;
justify-content: space-between;
}
.ans-number {
color: #0B898E;
font-size: 28rpx;
}
.ans-number .iconfont {
font-size: 28rpx;
}
.icon-xin,.icon-shoucang {
.icon-xin,
.icon-shoucang {
position: absolute;
right: 100rpx;
margin-top: 20rpx;
@ -294,9 +347,11 @@ page {
font-size: 36rpx;
z-index: 1;
}
.icon-shoucang {
color: #D62828;
}
.ques-num {
flex-shrink: 0;
margin-left: 10rpx;
@ -304,6 +359,7 @@ page {
color: #999;
font-weight: 400;
}
.audio-box {
display: flex;
align-items: center;
@ -319,6 +375,7 @@ page {
font-size: 31rpx;
z-index: 1;
}
.audio-box image {
width: 45rpx;
display: block;
@ -333,6 +390,7 @@ page {
bottom: 0;
width: 100%;
}
.mask-content .icon-close {
position: absolute;
right: 40rpx;
@ -348,10 +406,12 @@ page {
align-items: center;
justify-content: center;
}
.share-img {
display: block;
width: 551rpx;
}
.share-tips {
width: 426rpx;
height: 150rpx;
@ -367,12 +427,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%;
@ -386,11 +448,13 @@ page {
justify-content: center;
top: 34rpx;
}
.tipimg image {
width: 21rpx;
display: block;
}
.save-btn {
width: 403rpx;
line-height: 77rpx;
@ -402,6 +466,7 @@ page {
font-weight: 500;
margin-top: 50rpx;
}
.status-text {
position: absolute;
right: 0;
@ -415,8 +480,60 @@ page {
font-weight: bold;
border-radius: 23rpx 0px 0px 23rpx;
}
.status-text.disable {
width: 120rpx;
background: rgba(51, 51, 51, .1);
color: #666666;
}
.allowance-box {
height: 113rpx;
background: url("https://sz-qd.oss-cn-hangzhou.aliyuncs.com/uploads/20220606/0b2895725088c04fb182e09ec186f895.png");
background-size: 100% auto;
background-repeat: no-repeat;
padding: 30rpx 30rpx 10rpx;
font-size: 24rpx;
color: #FFFFFF;
position: relative;
display: flex;
justify-content: start;
align-items: baseline;
}
.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;
}
.mask-allowance .mask-content {
margin: auto;
width: auto;
top: initial;
bottom: initial;
padding: 20rpx;
width: 80%;
}
.mask-allowance .mask-content .rule-title {
text-align: center;
margin-bottom: 20rpx;
}

6
pages/order/postOrder/index.js

@ -20,6 +20,7 @@ Page({
select_allowance: false,
allowance_data: null,
allowance_price: 0,
showAllowance: false,
},
/**
@ -51,6 +52,11 @@ Page({
this.couponCom = this.selectAllComponents("#coupon")[0];
}
},
changeAllowance: function () {
this.setData({
showAllowance: !this.data.showAllowance
})
},
inputRemark: function (e) {
let index = e.currentTarget.dataset.index, product = this.data.product;
product[index].remark = e.detail.value;

9
pages/order/postOrder/index.wxml

@ -38,7 +38,7 @@
</view>
<!-- 补贴 -->
<view class="box-title allowance" wx:if="{{allowance_price}}">
<view>惠民补贴</view>
<view bindtap="changeAllowance">惠民补贴</view>
<view class="com-flex-tao" bindtap="selectAllowance">
-¥{{allowance_price / 100}}
<image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/uploads/20220602/6ecdbc41527c0c603608686967d4493b.png"
@ -56,3 +56,10 @@
<view class="fixed-price-box" wx:else><text>合计:</text><text class="price">¥{{postFee?(0+postFee)/100:0}}</text></view>
<view class="fixed-btn" bindtap="order">提交订单</view>
</view>
<view class="mask mask-allowance" wx:if="{{showAllowance}}">
<view bindtap="changeAllowance" class="mask-bg"></view>
<view class="mask-content rule-box">
<view class="rule-title">{{allowance_data.title}}</view>
<rich-text nodes="{{allowance_data.content}}"></rich-text>
</view>
</view>

12
pages/order/postOrder/index.wxss

@ -211,3 +211,15 @@ page {
padding: 0 20rpx;
border-bottom: 1rpx solid #d8d8d8;
}
.mask-allowance .mask-content {
margin: auto;
top: initial;
bottom: initial;
padding: 20rpx;
}
.mask-allowance .mask-content .rule-title {
text-align: center;
margin-bottom: 20rpx;
}

69
pages/order/scene/index.js

@ -21,7 +21,11 @@ Page({
kjId: null,
gp_id: null,
groupName: "",
prizeId:null
prizeId: null,
select_allowance: false,
showAllowance: false,
allowance_data: null,
allowance_price: 0,
},
/**
@ -79,6 +83,7 @@ Page({
productNum: productNum,
linkmanList: linkmanList
})
this.changePrice()
},
add: function () {
if (this.data.product.sku.sku_model.traveller_limit_num != 0 && this.data.productNum == this.data.product.sku.sku_model.traveller_limit_num) {
@ -91,6 +96,7 @@ Page({
this.setData({
productNum: this.data.productNum + 1
})
this.changePrice()
},
minus: function () {
if (this.data.productNum == 1) return;
@ -108,6 +114,7 @@ Page({
productNum: (this.data.productNum - 1),
coupon: null
})
this.changePrice()
},
changeDate: function (e) {
if (e.detail.price != this.data.singlePrice && this.data.coupon) {
@ -127,18 +134,36 @@ Page({
date: e.detail,
singlePrice: this.data.gp_id ? this.data.product.sku.event_price : e.detail.price
})
console.log(e.detail)
this.changePrice()
},
changeTime: function (e) {
this.setData({
time: e.detail
})
},
changeAllowance: function () {
this.setData({
showAllowance: !this.data.showAllowance
})
},
changeRemark: function (e) {
this.setData({
remark: e.detail.value
})
},
/**
* 补贴价
*/
changePrice: function () {
let product = this.data.product, price = product.sku.price;
if (this.data.allowance_data && this.data.select_allowance && this.data.allowance_price) {
let spread_price = Number(this.data.allowance_data.discount_limit_price - this.data.allowance_data.user_used_price);
price -= this.data.allowance_price < spread_price ? this.data.allowance_price : spread_price
}
this.setData({
singlePrice: app.globalData.kjId ? 0 : price
})
},
order: function () {
let linkmanList = this.data.linkmanList, productNum = this.data.productNum, date = this.data.date, time = this.data.time, remark = this.data.remark, product = this.data.product;
let linkmanIds = [];
@ -265,6 +290,15 @@ Page({
}
},
/**
* 选择补贴
*/
selectAllowance: function () {
this.setData({
select_allowance: !this.data.select_allowance
})
this.changePrice()
},
/**
* 生命周期函数--监听页面初次渲染完成
@ -289,6 +323,37 @@ Page({
this.setData({
coupon: app.globalData.couponInfo
})
// 获取补贴
if (this.data.product) {
commonApi.user_post("product/getProductAllowancePrice", {
product_code: this.data.product.product.product_code
}).then(resTwo => {
console.log(resTwo)
if (resTwo && resTwo.code == 1) {
this.setData({
allowance_data: resTwo.data
})
let spread_price = Number(this.data.allowance_data.discount_limit_price - this.data.allowance_data.user_used_price)
let sInfo = this.data.product.sku
if (spread_price > 0) {
if (spread_price < this.data.allowance_data.discount_rate / 100 * sInfo.price) {
this.setData({
allowance_price: spread_price
})
} else {
this.setData({
allowance_price: this.data.allowance_data.discount_rate / 100 * sInfo.price
})
}
this.changePrice()
} else {
this.setData({
allowance_price: 0
})
}
}
})
}
},
/**

22
pages/order/scene/index.wxml

@ -5,7 +5,8 @@
<view class="product-title">{{product.product.title + product.isGroup==1?'(团体预约)':product.sku.sku_name}}</view>
<view class="product-price" wx:if="{{type=='museum' || type=='activity'}}">免费</view>
</view>
<date wx:if="{{isLogin && type!='activity'}}" bind:onChangeDate="changeDate" bind:onChangeTime="changeTime" product="{{product}}"></date>
<date wx:if="{{isLogin && type!='activity'}}" bind:onChangeDate="changeDate" bind:onChangeTime="changeTime"
product="{{product}}"></date>
<view class="box" wx:if="{{product && product.isGroup==1}}">
<view class="box-title">
<view style="flex-shrink:0">团体主体名称:</view>
@ -21,7 +22,20 @@
</view>
</view>
<contact wx:if="{{isLogin}}" type="{{type}}" bind:setLinkman="setLinkman"></contact>
<coupon wx:if="{{!kjId && !gp_id && type!='activity' && product && product.isGroup!=1}}" id="coupon" money="{{singlePrice * productNum}}" sku="{{product.sku.id}}"></coupon>
<!-- 补贴 -->
<view class="box">
<view class="box-title allowance" wx:if="{{allowance_price}}">
<view bindtap="changeAllowance">惠民补贴</view>
<view class="com-flex-tao" bindtap="selectAllowance">
-¥{{allowance_price / 100}}
<image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/uploads/20220602/6ecdbc41527c0c603608686967d4493b.png"
alt="" wx:if="{{select_allowance}}"></image>
<view class="border" wx:else></view>
</view>
</view>
</view>
<coupon wx:if="{{!kjId && !gp_id && type!='activity' && product && product.isGroup!=1}}" id="coupon"
money="{{singlePrice * productNum}}" sku="{{product.sku.id}}"></coupon>
<view class="box" wx:if="{{type!='activity' && product && product.isGroup!=1}}">
<view class="box-title">
<view style="flex-shrink:0">订单备注</view>
@ -33,7 +47,9 @@
<view class="fixed-bottom" wx:if="{{type!='museum' && type!='activity'}}">
<view class="fixed-price-box" wx:if="{{kjId || prizeId}}"><text>合计:</text><text class="price">¥0</text></view>
<!-- <view class="fixed-price-box" wx:elif="{{prizeId}}"><text>合计:</text><text class="price">¥0</text></view> -->
<view class="fixed-price-box" wx:else><text>合计:</text><text class="price">¥{{((singlePrice * productNum - (coupon?coupon.activity.money:0))>0?(singlePrice * productNum - (coupon?coupon.activity.money:0)):0)/ 100}}</text></view>
<view class="fixed-price-box" wx:else><text>合计:</text><text
class="price">¥{{((singlePrice * productNum - (coupon?coupon.activity.money:0))>0?(singlePrice * productNum - (coupon?coupon.activity.money:0)):0)/ 100}}</text>
</view>
<view class="fixed-btn" bindtap="order">提交订单</view>
</view>
<view class="fixed-bottom yuyue-box" wx:else>

71
pages/order/scene/index.wxss

@ -2,43 +2,54 @@
page {
background: #f6f6f6;
}
.group-order {
background: #fff;
}
.product-info {
padding: 20rpx 47rpx;
border-bottom: 1rpx solid #ccc;
}
.product-title {
font-size: 33rpx;
color: #000;
font-weight: 500;
}
.product-price {
color: #D62828;
font-size: 27rpx;
}
.group-order .box-title {
margin: 0;
}
.group-order .box,.group-order .date-box {
.group-order .box,
.group-order .date-box {
border-bottom: 1rpx solid #D8D8D8;
border-radius: 0;
margin: 0 25rpx;
}
.group-order .dates-boxes {
border-top: none;
padding-top: 0;
}
.group-order .date-time.disable {
background: #CCCCCC;
color: #fff;
}
.box {
margin: 30rpx 25rpx;
background: white;
border-radius: 9rpx;
}
.box-title {
height: 113rpx;
margin: 0 20rpx;
@ -48,12 +59,14 @@ page {
display: flex;
align-items: center;
}
.dates-boxes {
display: flex;
align-items: center;
padding: 31rpx 21rpx;
border-top: 1rpx solid #ccc;
}
.date-item {
width: 162rpx;
height: 97rpx;
@ -68,29 +81,36 @@ page {
align-items: center;
flex-direction: column;
}
.date-item.active {
border-color: #0B898E;
color: #fff;
background: #0B898E;
}
.date-item.disable {
border-color: #CCCCCC;
color: #666;
}
.date-item .price {
font-size: 25rpx;
color: #D62828;
}
.date-item.active .price {
color: #fff;
}
.date-item.disable .price {
color: #666;
}
.more-item {
width: 99rpx;
margin-right: 0;
}
.date-times {
display: flex;
justify-content: space-between;
@ -101,6 +121,7 @@ page {
border-top: 1rpx dashed #ccc;
flex-wrap: wrap;
}
.date-time {
width: 315rpx;
line-height: 58rpx;
@ -112,19 +133,23 @@ page {
margin-bottom: 24rpx;
color: #000;
}
.date-time.disable {
border-color: #ccc;
color: #666666;
}
.date-time.active {
border-color: #0B898E;
background: #0B898E;
color: #fff;
}
.box-title .iconfont {
font-size: 28rpx;
flex-shrink: 0;
}
.number-box {
font-size: 29rpx;
font-weight: 500;
@ -151,10 +176,12 @@ page {
z-index: 1;
box-shadow: 0px 0px 16rpx 0px rgba(6, 0, 1, 0.1);
}
.yuyue-box {
height: 138rpx;
justify-content: center;
}
.fixed-btn {
width: 320rpx;
line-height: 113rpx;
@ -164,6 +191,7 @@ page {
font-size: 36rpx;
font-weight: 500;
}
.fixed-price-box {
margin-left: 25rpx;
flex-shrink: 0;
@ -171,11 +199,36 @@ page {
color: #333;
font-weight: 500;
}
.fixed-price-box .price {
color: #D62828;
font-size: 36rpx;
margin-left: 10rpx;
}
.allowance {
justify-content: space-between;
}
.allowance>view:nth-child(2) {
display: flex;
align-items: center;
}
.allowance image {
width: 40rpx;
height: 40rpx;
margin-left: 10rpx;
}
.allowance .border {
width: 30rpx;
height: 30rpx;
border-radius: 50%;
border: 4rpx solid #0B98BE;
margin-left: 10rpx;
}
.coupon-btn {
width: 138rpx;
line-height: 56rpx;
@ -185,6 +238,7 @@ page {
font-size: 28rpx;
color: #000;
}
.box-title input {
flex: 1;
display: block;
@ -194,17 +248,32 @@ page {
font-weight: 400;
text-align: right;
}
.yuyue-btn {
width: 657rpx;
line-height: 78rpx;
border-radius: 39rpx;
}
.group-order .yuyue-box {
height: 100rpx;
}
.group-order .yuyue-btn {
width: 100%;
/* height: 100%; */
line-height: 100rpx;
border-radius: 0;
}
.mask-allowance .mask-content {
margin: auto;
top: initial;
bottom: initial;
padding: 20rpx;
}
.mask-allowance .mask-content .rule-title {
text-align: center;
margin-bottom: 20rpx;
}

8
project.private.config.json

@ -13,15 +13,15 @@
"miniprogram": {
"list": [
{
"name": "产品详情4407",
"name": "产4407",
"pathName": "pages/info/postProductInfo/index",
"query": "id=4407",
"scene": null
},
{
"name": "pages/index/index",
"pathName": "pages/index/index",
"query": "id=59532108251510343335",
"name": "景点5447",
"pathName": "pages/info/sceneProductInfo/index",
"query": "id=5447",
"scene": null
},
{

8
utils/https.js

@ -2,7 +2,13 @@ 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/";
let baseUrl = "https://api.cloud.sz-trip.com/api/";
const env = wx.getAccountInfoSync().miniProgram.envVersion
if (env == 'develop') {
baseUrl = "https://test.api.cloud.sz-trip.com/api/"
} else {
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