|
@@ -40,13 +40,13 @@
|
|
|
<view class="text-name">{{ item.goodsName }}</view>
|
|
|
<view class="text-number">×{{ item.quantity }}</view>
|
|
|
<view class="price-box">
|
|
|
- <p class="price red-color"> <span style="font-size: 24rpx;">¥</span>{{ item.price }}</p><span
|
|
|
- class="false-price">¥{{ item.originalPrice ? item.originalPrice : 0}}</span>
|
|
|
+ <p class="price red-color"> <span style="font-size: 24rpx;">¥</span>{{ item.price }}</p>
|
|
|
+ <span class="false-price">¥{{ item.originalPrice ? item.originalPrice : 0}}</span>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="item-right">
|
|
|
- <u-number-box v-model="item.quantity"></u-number-box>
|
|
|
+ <u-number-box v-model="item.quantity" @change="valChange(item,$event)"></u-number-box>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -76,8 +76,10 @@
|
|
|
<view class="message-item">
|
|
|
<view class="item-left"> 订单总价 </view>
|
|
|
<view class=" flex-end red-color" style="align-items: center;">
|
|
|
- <p style="margin-right: 20rpx; font-size: 36rpx; font-weight: bold;">¥{{ orderParams.price.toFixed(2) }}</p>
|
|
|
- <p style="text-decoration: line-through;font-style: italic;">( 已优惠¥{{ orderParams.discountPrice.toFixed(2) }} )</p>
|
|
|
+ <p style="margin-right: 20rpx; font-size: 36rpx; font-weight: bold;">
|
|
|
+ ¥{{ orderParams.price.toFixed(2) }}</p>
|
|
|
+ <p style="text-decoration: line-through;font-style: italic;">(
|
|
|
+ 已优惠¥{{ orderParams.discountPrice.toFixed(2) }} )</p>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -137,105 +139,122 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { generateOrder ,getCartList , generateConfirmOrder} from "@/api/client/business.js"
|
|
|
-// import { maintainCouponPaging } from "@/api/client/mine.js"
|
|
|
- import { changeTime } from "@/utils/date"
|
|
|
+ import {
|
|
|
+ generateOrder,
|
|
|
+ getCartList,
|
|
|
+ generateConfirmOrder,
|
|
|
+ editGoodsNumb
|
|
|
+ } from "@/api/client/business.js"
|
|
|
+ // import { maintainCouponPaging } from "@/api/client/mine.js"
|
|
|
+ import {
|
|
|
+ changeTime
|
|
|
+ } from "@/utils/date"
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
coupon_show: false,
|
|
|
- coupon_list:[],
|
|
|
- init_list:{
|
|
|
- cartItems:[],
|
|
|
- merchantDTO:[]
|
|
|
- },
|
|
|
- phoneNumber:null ,// 订购电话
|
|
|
- goodsRemark:'' ,// 备注
|
|
|
- merchantId:null
|
|
|
+ coupon_list: [],
|
|
|
+ init_list: {
|
|
|
+ cartItems: [],
|
|
|
+ merchantDTO: []
|
|
|
+ },
|
|
|
+ phoneNumber: null, // 订购电话
|
|
|
+ goodsRemark: '', // 备注
|
|
|
+ merchantId: null
|
|
|
}
|
|
|
},
|
|
|
- mounted(){
|
|
|
- this.handlerInitList()
|
|
|
- },
|
|
|
- onLoad(option){
|
|
|
- this.merchantId = option.ids
|
|
|
- },
|
|
|
- computed: {
|
|
|
- orderParams(){
|
|
|
- let price = 0
|
|
|
- let originalPrice = 0
|
|
|
- let discountPrice = 0
|
|
|
- if(this.init_list.cartItems){
|
|
|
- this.init_list.cartItems.map(rs=>{
|
|
|
- price += Number((rs.price).toFixed(2) * rs.quantity)
|
|
|
- originalPrice += Number((rs.originalPrice).toFixed(2) * rs.quantity)
|
|
|
- })
|
|
|
- discountPrice = originalPrice - price
|
|
|
- }
|
|
|
- return { price , discountPrice }
|
|
|
- }
|
|
|
- },
|
|
|
- methods:{
|
|
|
- // 初始化列表接口
|
|
|
- handlerInitList(){
|
|
|
- getCartList(this.merchantId).then(res=>{
|
|
|
- this.init_list.cartItems = res.data.cartItems
|
|
|
- this.init_list.merchantDTO = res.data.merchantDTO
|
|
|
- // this.handlerInitCouponList(res.data.cartItems)
|
|
|
- })
|
|
|
- },
|
|
|
- // 初始化优惠券列表
|
|
|
- // handlerInitCouponList(cartItems){
|
|
|
- // let params = {
|
|
|
- // cartIds:[],
|
|
|
- // merchantId:this.merchantId
|
|
|
- // }
|
|
|
- // cartItems.map(rs=>{
|
|
|
- // params.cartIds.push(rs.id)
|
|
|
- // })
|
|
|
- // // 订单接口 - 根据购物车信息生成确认单信息
|
|
|
- // generateConfirmOrder(params).then(res=>{
|
|
|
- // this.coupon_list = res.data
|
|
|
- // this.coupon_list.couponHistoryDetailList.map(rs=>{
|
|
|
- // rs.couponDTO.endTime = changeTime(rs.couponDTO.createTime)
|
|
|
- // })
|
|
|
- // })
|
|
|
- // },
|
|
|
+ mounted() {
|
|
|
+ this.handlerInitList()
|
|
|
+ },
|
|
|
+ onLoad(option) {
|
|
|
+ this.merchantId = option.ids
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ orderParams() {
|
|
|
+ let price = 0
|
|
|
+ let originalPrice = 0
|
|
|
+ let discountPrice = 0
|
|
|
+ if (this.init_list.cartItems) {
|
|
|
+ this.init_list.cartItems.map(rs => {
|
|
|
+ price += Number((rs.price).toFixed(2) * rs.quantity)
|
|
|
+ originalPrice += Number((rs.originalPrice).toFixed(2) * rs.quantity)
|
|
|
+ })
|
|
|
+ discountPrice = originalPrice - price
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ price,
|
|
|
+ discountPrice
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 初始化列表接口
|
|
|
+ handlerInitList() {
|
|
|
+ getCartList(this.merchantId).then(res => {
|
|
|
+ this.init_list.cartItems = res.data.cartItems
|
|
|
+ this.init_list.merchantDTO = res.data.merchantDTO
|
|
|
+ // this.handlerInitCouponList(res.data.cartItems)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 初始化优惠券列表
|
|
|
+ // handlerInitCouponList(cartItems){
|
|
|
+ // let params = {
|
|
|
+ // cartIds:[],
|
|
|
+ // merchantId:this.merchantId
|
|
|
+ // }
|
|
|
+ // cartItems.map(rs=>{
|
|
|
+ // params.cartIds.push(rs.id)
|
|
|
+ // })
|
|
|
+ // // 订单接口 - 根据购物车信息生成确认单信息
|
|
|
+ // generateConfirmOrder(params).then(res=>{
|
|
|
+ // this.coupon_list = res.data
|
|
|
+ // this.coupon_list.couponHistoryDetailList.map(rs=>{
|
|
|
+ // rs.couponDTO.endTime = changeTime(rs.couponDTO.createTime)
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // },
|
|
|
// 结算按钮
|
|
|
- handlerSettleBtn(){
|
|
|
- let params = {
|
|
|
- payType:'2',
|
|
|
- cartIds:[],
|
|
|
- merchantId:this.init_list.merchantDTO.id
|
|
|
- }
|
|
|
- this.init_list.cartItems.map(rs=>{
|
|
|
- params.cartIds.push(rs.goodsId)
|
|
|
- })
|
|
|
- generateOrder(params).then(res=>{
|
|
|
- if(res.code === 'OK'){
|
|
|
- uni.navigateTo({
|
|
|
- url:'/pages/client/clientPackage/settleStatusPage'
|
|
|
- })
|
|
|
- }else{
|
|
|
- uni.showToast({
|
|
|
- title:res.msg,
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- })
|
|
|
+ handlerSettleBtn() {
|
|
|
+ let params = {
|
|
|
+ payType: '2',
|
|
|
+ cartIds: [],
|
|
|
+ merchantId: this.init_list.merchantDTO.id
|
|
|
+ }
|
|
|
+ this.init_list.cartItems.map(rs => {
|
|
|
+ params.cartIds.push(rs.goodsId)
|
|
|
+ })
|
|
|
+ generateOrder(params).then(res => {
|
|
|
+ if (res.code === 'OK') {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/client/clientPackage/settleStatusPage'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
- close(){
|
|
|
- this.coupon_show = false
|
|
|
- },
|
|
|
- // 点击展示优惠券pop
|
|
|
- openCouponshow(){
|
|
|
- this.coupon_show = true
|
|
|
- },
|
|
|
- // 选择优惠券 点击确定按钮
|
|
|
- handlerSelectCoupon(){
|
|
|
- this.coupon_show = false
|
|
|
- }
|
|
|
+ close() {
|
|
|
+ this.coupon_show = false
|
|
|
+ },
|
|
|
+ // 点击展示优惠券pop
|
|
|
+ openCouponshow() {
|
|
|
+ this.coupon_show = true
|
|
|
+ },
|
|
|
+ // 选择优惠券 点击确定按钮
|
|
|
+ handlerSelectCoupon() {
|
|
|
+ this.coupon_show = false
|
|
|
+ },
|
|
|
+ valChange(item, e) {
|
|
|
+ editGoodsNumb(item.id, {
|
|
|
+ quantity: e.value
|
|
|
+ }).then(res => {
|
|
|
+ console.log('@@@2res', res)
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -243,7 +262,7 @@
|
|
|
<style lang="scss" scoped>
|
|
|
.container {
|
|
|
min-height: calc(100vh - 40rpx);
|
|
|
- background: linear-gradient(to bottom, #bacff5, #F2F4FA, #fff);
|
|
|
+ background: linear-gradient(to bottom, #bacff5, #F2F4FA, #fff);
|
|
|
padding: 20rpx;
|
|
|
|
|
|
.content-box {
|
|
@@ -365,7 +384,7 @@
|
|
|
|
|
|
.message-text {
|
|
|
margin-top: 20rpx;
|
|
|
- color: #bcbfc3;
|
|
|
+ color: #bcbfc3;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -389,32 +408,38 @@
|
|
|
.pop-box {
|
|
|
height: 850rpx;
|
|
|
background-color: #F4F4F4;
|
|
|
- position: relative;
|
|
|
+ position: relative;
|
|
|
+
|
|
|
.pop-title {
|
|
|
font-weight: bold;
|
|
|
font-size: 36rpx;
|
|
|
text-align: center;
|
|
|
padding: 20rpx;
|
|
|
- background: linear-gradient(to bottom, #fff,#fff, #F4F4F4);
|
|
|
+ background: linear-gradient(to bottom, #fff, #fff, #F4F4F4);
|
|
|
}
|
|
|
- .pop-coupon-box{
|
|
|
- max-height: 650rpx;
|
|
|
- overflow-y: scroll;
|
|
|
- }
|
|
|
+
|
|
|
+ .pop-coupon-box {
|
|
|
+ max-height: 650rpx;
|
|
|
+ overflow-y: scroll;
|
|
|
+ }
|
|
|
+
|
|
|
.pop-item {
|
|
|
padding: 20rpx;
|
|
|
- margin-bottom:10rpx;
|
|
|
+ margin-bottom: 10rpx;
|
|
|
+
|
|
|
.item-box {
|
|
|
padding: 20rpx;
|
|
|
border-radius: 20rpx 20rpx 0 0;
|
|
|
background-color: #fff;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- box-shadow: 0rpx 7rpx 20rpx 10rpx rgba(0,0,0,0.1);
|
|
|
- background-image: radial-gradient(circle at left bottom, #F4F4F4, #F4F4F4 40rpx, transparent 16rpx), radial-gradient(circle at right bottom, #F4F4F4, #F4F4F4 55rpx, transparent 16rpx),radial-gradient(circle at right top, #F4F4F4, #F4F4F4 35rpx, transparent 16rpx);
|
|
|
+ box-shadow: 0rpx 7rpx 20rpx 10rpx rgba(0, 0, 0, 0.1);
|
|
|
+ background-image: radial-gradient(circle at left bottom, #F4F4F4, #F4F4F4 40rpx, transparent 16rpx), radial-gradient(circle at right bottom, #F4F4F4, #F4F4F4 55rpx, transparent 16rpx), radial-gradient(circle at right top, #F4F4F4, #F4F4F4 35rpx, transparent 16rpx);
|
|
|
+
|
|
|
.item-left {
|
|
|
display: flex;
|
|
|
width: 70%;
|
|
|
+
|
|
|
.img-box,
|
|
|
.left-img {
|
|
|
width: 160rpx;
|
|
@@ -461,52 +486,55 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .item-bottom{
|
|
|
- padding: 20rpx 50rpx 20rpx 30rpx;
|
|
|
- background-color: #fff;
|
|
|
- border-radius: 0 0 20rpx 20rpx;
|
|
|
- box-shadow: 0rpx 10rpx 15rpx 0rpx rgba(0,0,0,0.1);
|
|
|
- background-image: radial-gradient(circle at left top, #F4F4F4, #F4F4F4 40rpx, transparent 16rpx), radial-gradient(circle at right top, #F4F4F4, #F4F4F4 55rpx, transparent 16rpx);
|
|
|
- border-top: 1px dashed #F4F4F4;
|
|
|
- color: #b1b4b9;
|
|
|
- font-size:26rpx;
|
|
|
- font-style:oblique;
|
|
|
- text-indent:32.4px;
|
|
|
- }
|
|
|
+
|
|
|
+ .item-bottom {
|
|
|
+ padding: 20rpx 50rpx 20rpx 30rpx;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 0 0 20rpx 20rpx;
|
|
|
+ box-shadow: 0rpx 10rpx 15rpx 0rpx rgba(0, 0, 0, 0.1);
|
|
|
+ background-image: radial-gradient(circle at left top, #F4F4F4, #F4F4F4 40rpx, transparent 16rpx), radial-gradient(circle at right top, #F4F4F4, #F4F4F4 55rpx, transparent 16rpx);
|
|
|
+ border-top: 1px dashed #F4F4F4;
|
|
|
+ color: #b1b4b9;
|
|
|
+ font-size: 26rpx;
|
|
|
+ font-style: oblique;
|
|
|
+ text-indent: 32.4px;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- .pop-bottom{
|
|
|
- position: absolute;
|
|
|
- bottom: 0;
|
|
|
- width: 100%;
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- .coupon-btn{
|
|
|
- width: 100%;
|
|
|
- background-color: #FFDE21 !important;
|
|
|
- color: #000;
|
|
|
- font-size:28rpx;
|
|
|
- // height:80rpx;
|
|
|
- // line-height: 80rpx;
|
|
|
- border-radius: 20rpx;
|
|
|
- }
|
|
|
- }
|
|
|
+ .pop-bottom {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 0;
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+
|
|
|
+ .coupon-btn {
|
|
|
+ width: 100%;
|
|
|
+ background-color: #FFDE21 !important;
|
|
|
+ color: #000;
|
|
|
+ font-size: 28rpx;
|
|
|
+ // height:80rpx;
|
|
|
+ // line-height: 80rpx;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- .btn-box{
|
|
|
+ .btn-box {
|
|
|
width: 100%;
|
|
|
position: fixed;
|
|
|
bottom: 5%;
|
|
|
- .btn{
|
|
|
+
|
|
|
+ .btn {
|
|
|
width: 90%;
|
|
|
background: linear-gradient(to right, #1d4350, #a43931);
|
|
|
color: #fff;
|
|
|
border-radius: 40rpx;
|
|
|
text-align: center;
|
|
|
font-size: 32rpx;
|
|
|
- padding: 20rpx;
|
|
|
+ padding: 20rpx;
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|