1
This commit is contained in:
parent
4d003d43c1
commit
a1f904e97c
@ -10,25 +10,44 @@
|
||||
<view class='item presell_item'>
|
||||
<view class="acea-row row-between-wrapper">
|
||||
<view class='pictrue' @click="jumpCon(item)">
|
||||
<image :src='(item.cart_info.productAttr && item.cart_info.productAttr.image) || item.cart_info.product.image' ></image>
|
||||
<image
|
||||
:src='(item.cart_info.productAttr && item.cart_info.productAttr.image) || item.cart_info.product.image'>
|
||||
</image>
|
||||
</view>
|
||||
<view class='text'>
|
||||
<view class='acea-row row-between-wrapper'>
|
||||
<view class='name line1' style="width: 360rpx;"><text class="event_name event_bg">预售</text>{{item.cart_info.product.store_name}}</view>
|
||||
<view class='num'><text class="p-color">¥{{item.cart_info.productPresellAttr.presell_price}}</text><br/>x {{item.product_num}}</view>
|
||||
<view class='name line1' style="width: 360rpx;"><text
|
||||
class="event_name event_bg">预售</text>{{item.cart_info.product.store_name}}
|
||||
</view>
|
||||
<view class='num'><text
|
||||
class="p-color">¥{{item.cart_info.productPresellAttr.presell_price}}</text><br />x
|
||||
{{item.product_num}}
|
||||
</view>
|
||||
</view>
|
||||
<view class='attr line1' v-if="item.cart_info.productAttr.sku" style="margin-top: 0;">{{item.cart_info.productAttr.sku}}</view>
|
||||
<view v-if="evaluate === 0 || evaluate === 10 || evaluate === 11" class="event_ship event_color">发货时间:
|
||||
<view class='attr line1' v-if="item.cart_info.productAttr.sku" style="margin-top: 0;">
|
||||
{{item.cart_info.productAttr.sku}}
|
||||
</view>
|
||||
<view v-if="evaluate === 0 || evaluate === 10 || evaluate === 11"
|
||||
class="event_ship event_color">发货时间:
|
||||
<!--全款预售-->
|
||||
<text v-if="item.cart_info.productPresell.presell_type === 1">{{ item.cart_info.productPresell.delivery_type === 1 ? '支付成功后' : '预售结束后' }}{{ item.cart_info.productPresell.delivery_day }}天内</text>
|
||||
<text
|
||||
v-if="item.cart_info.productPresell.presell_type === 1">{{ item.cart_info.productPresell.delivery_type === 1 ? '支付成功后' : '预售结束后' }}{{ item.cart_info.productPresell.delivery_day }}天内</text>
|
||||
<!--定金预售-->
|
||||
<text v-if="item.cart_info.productPresell.presell_type === 2">{{ item.cart_info.productPresell.delivery_type === 1 ? '支付尾款后' : '预售结束后' }}{{ item.cart_info.productPresell.delivery_day }}天内</text>
|
||||
<text
|
||||
v-if="item.cart_info.productPresell.presell_type === 2">{{ item.cart_info.productPresell.delivery_type === 1 ? '支付尾款后' : '预售结束后' }}{{ item.cart_info.productPresell.delivery_day }}天内</text>
|
||||
</view>
|
||||
<view class="right-btn-box event_box">
|
||||
<view class="btn-item" v-if="item.is_refund ==0 && (evaluate != 10 && evaluate != 11) && orderData.refund_status || item.refund_num > 0" @click.stop="refund(item)">申请退款</view>
|
||||
<view class="btn-item err" v-if="item.is_refund ==1">退款中 x {{item.product_num - item.refund_num}}</view>
|
||||
<view class='btn-item err' v-if="item.is_refund >1">已退款 x {{item.product_num - item.refund_num}}</view>
|
||||
<view class='btn-item' v-if='item.is_reply==0 && evaluate==2 && item.is_refund==0' @click.stop="evaluateTap(item.order_product_id,orderId)">去评价</view>
|
||||
<view class="btn-item"
|
||||
v-if="evaluate != 2 && item.is_refund ==0 && (evaluate != 10 && evaluate != 11) && orderData.refund_status || item.refund_num > 0"
|
||||
@click.stop="refund(item)">申请退款</view>
|
||||
<view class="btn-item err" v-if="item.is_refund ==1">退款中 x
|
||||
{{item.product_num - item.refund_num}}
|
||||
</view>
|
||||
<view class='btn-item err' v-if="item.is_refund >1">已退款 x
|
||||
{{item.product_num - item.refund_num}}
|
||||
</view>
|
||||
<view class='btn-item' v-if='item.is_reply==0 && evaluate==2 && item.is_refund==0'
|
||||
@click.stop="evaluateTap(item.order_product_id,orderId)">去评价</view>
|
||||
<view class='btn-item on' v-else-if="item.is_reply==1 && evaluate==2">已评价</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -37,44 +56,66 @@
|
||||
<view v-if="orderData.status >= 10" class="event_progress">
|
||||
<view class="progress_list">
|
||||
<view class="progress_name">阶段一: 买家已付款</view>
|
||||
<view class="progress_price">商品定金 <text class="align_right">¥{{ orderData.pay_price }}</text></view>
|
||||
<view class="progress_pay">定金实付款<text class="align_right t-color">¥{{ orderData.pay_price }}</text></view>
|
||||
<view class="progress_price">商品定金 <text
|
||||
class="align_right">¥{{ orderData.pay_price }}</text></view>
|
||||
<view class="progress_pay">定金实付款<text
|
||||
class="align_right t-color">¥{{ orderData.pay_price }}</text></view>
|
||||
</view>
|
||||
<view class="progress_list">
|
||||
<view class="progress_name">阶段二:
|
||||
<text v-if="orderData.status == 10 && orderData.presellOrder.activeStatus == 0">未开始</text>
|
||||
<text v-if="orderData.status == 10 && orderData.presellOrder.activeStatus == 1">等待买家付尾款</text>
|
||||
<text v-if="orderData.status == 11 || orderData.presellOrder.activeStatus == 2">交易已关闭</text>
|
||||
<text
|
||||
v-if="orderData.status == 10 && orderData.presellOrder.activeStatus == 0">未开始</text>
|
||||
<text
|
||||
v-if="orderData.status == 10 && orderData.presellOrder.activeStatus == 1">等待买家付尾款</text>
|
||||
<text
|
||||
v-if="orderData.status == 11 || orderData.presellOrder.activeStatus == 2">交易已关闭</text>
|
||||
</view>
|
||||
<view class="progress_price">商品尾款 <text class="align_right">¥{{ orderData.presellOrder.pay_price }}</text></view>
|
||||
<view class="progress_pay">尾款需付款<text class="align_right t-color">¥{{ orderData.presellOrder.pay_price }}</text></view>
|
||||
<view class="progress_price">商品尾款 <text
|
||||
class="align_right">¥{{ orderData.presellOrder.pay_price }}</text></view>
|
||||
<view class="progress_pay">尾款需付款<text
|
||||
class="align_right t-color">¥{{ orderData.presellOrder.pay_price }}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class='item'>
|
||||
<view class="acea-row row-between-wrapper">
|
||||
<view class='pictrue' @click="jumpCon(item)">
|
||||
<image :src='(item.cart_info.productAttr && item.cart_info.productAttr.image) || item.cart_info.product.image' ></image>
|
||||
<image
|
||||
:src='(item.cart_info.productAttr && item.cart_info.productAttr.image) || item.cart_info.product.image'>
|
||||
</image>
|
||||
</view>
|
||||
<view class='text'>
|
||||
<view class='acea-row row-between-wrapper'>
|
||||
<view class='name line1'><text v-if="item.product_type != 0 && item.product_type != 10" :class="'font_bg-red type'+item.product_type">{{item.product_type == 1 ? "秒杀" : item.product_type == 2 ? "预售" : item.product_type == 3 ? "助力" : item.product_type == 4 ? "拼团" : ""}}</text>{{item.cart_info.product.store_name}}</view>
|
||||
<view class='num'>x {{item.product_num}}</view>
|
||||
</view>
|
||||
<view class='attr line1' v-if="item.cart_info.productAttr.sku">{{item.cart_info.productAttr.sku}}</view>
|
||||
<view class='money p-color' v-if="item.cart_info.product_type ==3">¥{{item.cart_info.productAssistAttr.assist_price}}</view>
|
||||
<view class='money p-color' v-else-if="item.cart_info.product_type ==4">¥{{item.cart_info.activeSku.active_price}}</view>
|
||||
<view class='money acea-row row-middle' v-else>
|
||||
<text>¥{{item.cart_info.productAttr.price}}</text>
|
||||
<image v-if="item.cart_info.productAttr.show_svip_price" class="svip-img" :src="`${domain}/static/images/svip.png`"></image>
|
||||
<view class='acea-row row-between-wrapper'>
|
||||
<view class='name line1'><text v-if="item.product_type != 0 && item.product_type != 10"
|
||||
:class="'font_bg-red type'+item.product_type">{{item.product_type == 1 ? "秒杀" : item.product_type == 2 ? "预售" : item.product_type == 3 ? "助力" : item.product_type == 4 ? "拼团" : ""}}</text>{{item.cart_info.product.store_name}}
|
||||
</view>
|
||||
<view class='num'>x {{item.product_num}}</view>
|
||||
</view>
|
||||
<view class='attr line1' v-if="item.cart_info.productAttr.sku">
|
||||
{{item.cart_info.productAttr.sku}}
|
||||
</view>
|
||||
<view class='money p-color' v-if="item.cart_info.product_type ==3">
|
||||
¥{{item.cart_info.productAssistAttr.assist_price}}</view>
|
||||
<view class='money p-color' v-else-if="item.cart_info.product_type ==4">
|
||||
¥{{item.cart_info.activeSku.active_price}}</view>
|
||||
<view class='money acea-row row-middle' v-else>
|
||||
<text>¥{{item.cart_info.productAttr.price}}</text>
|
||||
<image v-if="item.cart_info.productAttr.show_svip_price" class="svip-img"
|
||||
:src="`${domain}/static/images/svip.png`"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right-btn-box">
|
||||
<view class="btn-item err" v-if="item.is_refund ==1">退款中 x {{item.product_num - item.refund_num}}</view>
|
||||
<view class='btn-item err' v-if="item.is_refund >1">已退款 x {{item.product_num - item.refund_num}}</view>
|
||||
<view class="btn-item" v-if="item.refund_switch==1 && (item.is_refund == 0 && evaluate != 9 && orderData.refund_status || item.refund_num > 0)" @click.stop="refund(item)">申请退款</view>
|
||||
<view class='btn-item' v-if='item.is_reply==0 && evaluate==2 && item.refund_num > 0' @click.stop="evaluateTap(item.order_product_id,orderId)">去评价</view>
|
||||
<view class="btn-item err" v-if="item.is_refund ==1">退款中 x
|
||||
{{item.product_num - item.refund_num}}
|
||||
</view>
|
||||
<view class='btn-item err' v-if="item.is_refund >1">已退款 x {{item.product_num - item.refund_num}}
|
||||
</view>
|
||||
<view class="btn-item"
|
||||
v-if="evaluate != 2 && item.refund_switch==1 && (item.is_refund == 0 && evaluate != 9 && orderData.refund_status || item.refund_num > 0)"
|
||||
@click.stop="refund(item)">申请退款</view>
|
||||
<view class='btn-item' v-if='item.is_reply==0 && evaluate==2 && item.refund_num > 0'
|
||||
@click.stop="evaluateTap(item.order_product_id,orderId)">去评价</view>
|
||||
<view class='btn-item on' v-else-if="item.is_reply==1 && evaluate==2">已评价</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -93,11 +134,21 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
import { openOrderRefundSubscribe } from '@/utils/SubscribeMessage.js';
|
||||
import { goShopDetail } from '@/libs/order.js'
|
||||
import { initiateAssistApi } from '@/api/activity.js';
|
||||
import { mapGetters } from "vuex";
|
||||
import { HTTP_REQUEST_URL } from '@/config/app';
|
||||
import {
|
||||
openOrderRefundSubscribe
|
||||
} from '@/utils/SubscribeMessage.js';
|
||||
import {
|
||||
goShopDetail
|
||||
} from '@/libs/order.js'
|
||||
import {
|
||||
initiateAssistApi
|
||||
} from '@/api/activity.js';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
import {
|
||||
HTTP_REQUEST_URL
|
||||
} from '@/config/app';
|
||||
export default {
|
||||
props: {
|
||||
evaluate: {
|
||||
@ -133,17 +184,21 @@
|
||||
data() {
|
||||
return {
|
||||
domain: HTTP_REQUEST_URL,
|
||||
totalNmu:'',
|
||||
totalNmu: '',
|
||||
isTimePay: false, //是否到支付时间
|
||||
};
|
||||
},
|
||||
watch:{
|
||||
cartInfo:function(nVal,oVal){
|
||||
watch: {
|
||||
cartInfo: function(nVal, oVal) {
|
||||
console.log(nVal);
|
||||
console.log(oVal);
|
||||
let num = 0
|
||||
nVal.forEach((item,index)=>{
|
||||
nVal.forEach((item, index) => {
|
||||
num += item.cart_num
|
||||
})
|
||||
this.totalNmu = num
|
||||
|
||||
console.log(nVal);
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
@ -151,52 +206,59 @@
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
evaluateTap:function(unique,orderId){
|
||||
evaluateTap: function(unique, orderId) {
|
||||
uni.navigateTo({
|
||||
url:`/pages/users/goods_comment_con/index?uni=${unique}&order_id=${orderId}`
|
||||
url: `/pages/users/goods_comment_con/index?uni=${unique}&order_id=${orderId}`
|
||||
})
|
||||
},
|
||||
// 判断是否到支付尾款时间
|
||||
isPayBalance(){
|
||||
isPayBalance() {
|
||||
let that = this;
|
||||
if(that.orderData.status === 10){
|
||||
if(new Date() < new Date(that.orderData.presellOrder.final_start_time)){
|
||||
if (that.orderData.status === 10) {
|
||||
if (new Date() < new Date(that.orderData.presellOrder.final_start_time)) {
|
||||
that.isTimePay = false; //未开始
|
||||
}else if((new Date() >= new Date(that.orderData.presellOrder.final_start_time)) && (new Date() <= new Date(that.orderData.presellOrder.final_start_time)) ){
|
||||
} else if ((new Date() >= new Date(that.orderData.presellOrder.final_start_time)) && (new Date() <=
|
||||
new Date(that.orderData.presellOrder.final_start_time))) {
|
||||
that.isTimePay = true; //立即支付
|
||||
}
|
||||
}
|
||||
},
|
||||
jumpCon:function(item){
|
||||
if(item.product_type == 4)item.activity_id = item.cart_info && item.cart_info.activeSku.product_group_id
|
||||
if(item.product_type == 3)item.activity_id = item.cart_info && item.cart_info.productAssistAttr.product_assist_id
|
||||
jumpCon: function(item) {
|
||||
if (item.product_type == 4) item.activity_id = item.cart_info && item.cart_info.activeSku
|
||||
.product_group_id
|
||||
if (item.product_type == 3) item.activity_id = item.cart_info && item.cart_info.productAssistAttr
|
||||
.product_assist_id
|
||||
goShopDetail(item).then(res => {
|
||||
initiateAssistApi(item.activity_id).then(res => {
|
||||
let id = res.data.product_assist_set_id;
|
||||
uni.hideLoading();
|
||||
uni.navigateTo({
|
||||
url: '/pages/activity/assist_detail/index?id=' + id
|
||||
});
|
||||
}).catch((err) => {
|
||||
uni.showToast({
|
||||
title: err,
|
||||
icon: 'none'
|
||||
})
|
||||
uni.hideLoading();
|
||||
uni.navigateTo({
|
||||
url: '/pages/activity/assist_detail/index?id=' + id
|
||||
});
|
||||
}).catch((err) => {
|
||||
uni.showToast({
|
||||
title: err,
|
||||
icon: 'none'
|
||||
})
|
||||
});
|
||||
})
|
||||
},
|
||||
// 退款
|
||||
refund(item){
|
||||
refund(item) {
|
||||
// #ifdef MP
|
||||
openOrderRefundSubscribe().then(() => {
|
||||
uni.hideLoading();
|
||||
if(this.evaluate == 0 || this.evaluate == 9 || this.orderData.is_virtual != 0){
|
||||
if (this.evaluate == 0 || this.evaluate == 9 || this.orderData.is_virtual != 0) {
|
||||
uni.navigateTo({
|
||||
url:'/pages/users/refund/confirm?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id+'&refund_type=1&order_type='+this.orderData.order_type
|
||||
url: '/pages/users/refund/confirm?order_id=' + this.orderId + '&type=1' +
|
||||
'&ids=' + item.order_product_id + '&refund_type=1&order_type=' + this
|
||||
.orderData.order_type
|
||||
})
|
||||
}else{
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url:'/pages/users/refund/select?order_id='+this.orderId+'&type=1&order_type='+this.orderData.order_type+'&ids='+item.order_product_id
|
||||
url: '/pages/users/refund/select?order_id=' + this.orderId +
|
||||
'&type=1&order_type=' + this.orderData.order_type + '&ids=' + item
|
||||
.order_product_id
|
||||
})
|
||||
}
|
||||
}).catch(() => {
|
||||
@ -204,13 +266,15 @@
|
||||
})
|
||||
// #endif
|
||||
// #ifdef H5 || APP-PLUS
|
||||
if(this.evaluate == 0 || this.evaluate == 9 || this.orderData.is_virtual != 0){
|
||||
if (this.evaluate == 0 || this.evaluate == 9 || this.orderData.is_virtual != 0) {
|
||||
uni.navigateTo({
|
||||
url:'/pages/users/refund/confirm?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id+'&refund_type=1&order_type='+this.orderData.order_type
|
||||
url: '/pages/users/refund/confirm?order_id=' + this.orderId + '&type=1' + '&ids=' + item
|
||||
.order_product_id + '&refund_type=1&order_type=' + this.orderData.order_type
|
||||
})
|
||||
}else{
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url:'/pages/users/refund/select?order_id='+this.orderId+'&type=1&order_type='+this.orderData.order_type+'&ids='+item.order_product_id
|
||||
url: '/pages/users/refund/select?order_id=' + this.orderId + '&type=1&order_type=' + this
|
||||
.orderData.order_type + '&ids=' + item.order_product_id
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
@ -223,22 +287,27 @@
|
||||
.orderGoods {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.p-color {
|
||||
color: var(--view-priceColor);
|
||||
}
|
||||
.t-color{
|
||||
|
||||
.t-color {
|
||||
color: var(--view-theme);
|
||||
}
|
||||
.svip-img{
|
||||
|
||||
.svip-img {
|
||||
width: 65rpx;
|
||||
height: 28rpx;
|
||||
margin: 4rpx 0 0 4rpx;
|
||||
}
|
||||
.title{
|
||||
|
||||
.title {
|
||||
height: 86rpx;
|
||||
position: relative;
|
||||
padding: 0 30rpx;
|
||||
&::after{
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
width: 750rpx;
|
||||
border-bottom: 2rpx dotted #D8D8D8;
|
||||
@ -246,60 +315,73 @@
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
.item-status{
|
||||
|
||||
.item-status {
|
||||
color: #999999;
|
||||
font-size: 30rpx;
|
||||
&.status0{
|
||||
|
||||
&.status0 {
|
||||
color: #2291F8;
|
||||
}
|
||||
}
|
||||
.item-date{
|
||||
|
||||
.item-date {
|
||||
color: #666666;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
.right-btn-box{
|
||||
}
|
||||
|
||||
.right-btn-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
&.event_box{
|
||||
|
||||
&.event_box {
|
||||
position: static;
|
||||
}
|
||||
.btn-item{
|
||||
|
||||
.btn-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width:140rpx;
|
||||
height:46rpx;
|
||||
width: 140rpx;
|
||||
height: 46rpx;
|
||||
margin-left: 10rpx;
|
||||
border:1px solid rgba(187,187,187,1);
|
||||
border-radius:23rpx;
|
||||
border: 1px solid rgba(187, 187, 187, 1);
|
||||
border-radius: 23rpx;
|
||||
font-size: 24rpx;
|
||||
color: #282828;
|
||||
&.on{
|
||||
background:rgba(220,220,220,1);
|
||||
border-color: rgba(220,220,220,1);
|
||||
|
||||
&.on {
|
||||
background: rgba(220, 220, 220, 1);
|
||||
border-color: rgba(220, 220, 220, 1);
|
||||
}
|
||||
&.err{
|
||||
background:rgba(247,247,247,1);
|
||||
border-color: rgba(247,247,247,1);
|
||||
|
||||
&.err {
|
||||
background: rgba(247, 247, 247, 1);
|
||||
border-color: rgba(247, 247, 247, 1);
|
||||
color: #AAAAAA;
|
||||
}
|
||||
}
|
||||
}
|
||||
.event_bg{
|
||||
|
||||
.event_bg {
|
||||
background: #FF7F00;
|
||||
}
|
||||
.event_color{
|
||||
|
||||
.event_color {
|
||||
color: #FF7F00;
|
||||
}
|
||||
.presell_item{
|
||||
|
||||
.presell_item {
|
||||
height: auto;
|
||||
padding-bottom: 15rpx;
|
||||
}
|
||||
.event_progress{
|
||||
|
||||
.event_progress {
|
||||
margin-top: 20rpx;
|
||||
background: #fff;
|
||||
|
||||
.progress_name {
|
||||
padding-left: 30rpx;
|
||||
height: 60rpx;
|
||||
@ -308,7 +390,8 @@
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
color: var(--view-theme);
|
||||
&::before{
|
||||
|
||||
&::before {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
width: 5rpx;
|
||||
@ -319,23 +402,27 @@
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
.align_right{
|
||||
|
||||
.align_right {
|
||||
float: right;
|
||||
font-weight: bold;
|
||||
}
|
||||
.progress_price{
|
||||
|
||||
.progress_price {
|
||||
padding: 20rpx 30rpx;
|
||||
color: #999999;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
.progress_pay{
|
||||
|
||||
.progress_pay {
|
||||
padding: 25rpx 30rpx;
|
||||
background: var(--view-minorColor);
|
||||
font-size: 26rpx;
|
||||
color: #282828;
|
||||
}
|
||||
}
|
||||
.event_name{
|
||||
|
||||
.event_name {
|
||||
display: inline-block;
|
||||
margin-right: 9rpx;
|
||||
color: #fff;
|
||||
@ -345,12 +432,14 @@
|
||||
text-align: center;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
.event_ship{
|
||||
|
||||
.event_ship {
|
||||
font-size: 20rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.goodWrapper.item1{
|
||||
&::after{
|
||||
|
||||
.goodWrapper.item1 {
|
||||
&::after {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 750rpx;
|
||||
|
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<uni-popup ref="popup" type="bottom" mask-background-color="rgba(0,0,0,0)" safeArea backgroundColor="#fff" :animation="true" @maskClick="maskClick">
|
||||
<uni-popup ref="popup" type="bottom" mask-background-color="rgba(0,0,0,0)" safeArea backgroundColor="#fff"
|
||||
:animation="true" @maskClick="maskClick">
|
||||
<view class="keyboard">
|
||||
<view class="keyboard-left">
|
||||
<block v-for="(item,indx) in keys" :key="indx">
|
||||
@ -30,6 +31,7 @@
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
// 键盘点击
|
||||
handleClick(item) {
|
||||
if (this.value.length >= 10) return;
|
||||
@ -68,9 +70,11 @@
|
||||
|
||||
// 付款
|
||||
handlePay() {
|
||||
if (this.value && this.value.lastIndexOf('.') + 1 == this.value.length) {
|
||||
this.value = this.value.substring(0, this.value.length - 1);
|
||||
// 如果最后一位是. 去除
|
||||
if (this.value && this.value.endsWith('.')) {
|
||||
this.value = this.value.replace('.', '');
|
||||
}
|
||||
|
||||
this.$emit('confirm', this.value);
|
||||
this.handleClose();
|
||||
},
|
||||
@ -84,9 +88,12 @@
|
||||
handleClose() {
|
||||
this.$refs.popup.close();
|
||||
},
|
||||
|
||||
|
||||
maskClick() {
|
||||
if (this.value && this.value.lastIndexOf('.') + 1 == this.value.length) {
|
||||
this.value = this.value.substring(0, this.value.length - 1);
|
||||
// 如果最后一位是. 去除
|
||||
if (this.value && this.value.endsWith('.')) {
|
||||
this.value = this.value.replace('.', '');
|
||||
}
|
||||
this.$emit('change', this.value);
|
||||
}
|
||||
|
@ -18,8 +18,7 @@
|
||||
<view class="v-con-input" @click="handleOpenKeyboard">
|
||||
<text style="color: #303133;font-size:32rpx;">¥</text>
|
||||
<u--input type="text" fontSize="23" height="112rpx" placeholder="请输入金额" border="none" readonly
|
||||
v-model="cartForm.total_amount" placeholderStyle="color:#999;font-size:32rpx"
|
||||
@input="validateDecimal">
|
||||
v-model="cartForm.total_amount" placeholderStyle="color:#999;font-size:32rpx">
|
||||
</u--input>
|
||||
<view class="placeholder"></view>
|
||||
</view>
|
||||
@ -50,19 +49,17 @@
|
||||
</view>
|
||||
|
||||
<!-- 登陆 -->
|
||||
<!-- <authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun">
|
||||
</authorize> -->
|
||||
<authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun" />
|
||||
</view>
|
||||
|
||||
<!-- 无商户信息提示 -->
|
||||
<!-- <view class="empty">
|
||||
<image src="/static/images/no_thing.png"></image>
|
||||
<text style="margin-top: 60rpx;">{{tips}}</text>
|
||||
<authorize v-show="!isWeixin" ref="authRef" :isAuto="isAuto" :isGoIndex="false" :isShowAuth="isShowAuth"
|
||||
@authColse="authColse" @onLoadFun="onLoadFun">
|
||||
</authorize>
|
||||
</view> -->
|
||||
|
||||
<authorize v-show="!isWeixin" ref="authRef" :isAuto="isAuto" :isGoIndex="false" :isShowAuth="isShowAuth"
|
||||
@authColse="authColse" @onLoadFun="onLoadFun">
|
||||
</authorize>
|
||||
</view> -->
|
||||
<!-- 键盘 -->
|
||||
<popups ref="popups" @confirm="handleConfirm" @clear="handleClear" @change="handleChange"></popups>
|
||||
</view>
|
||||
</template>
|
||||
@ -145,7 +142,7 @@
|
||||
}
|
||||
} else {
|
||||
this.checkForm.cart_id = [];
|
||||
this.getProductInfoByMerid(this.mer_id);
|
||||
this.getProductInfoByMerid();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -166,7 +163,7 @@
|
||||
}
|
||||
},
|
||||
|
||||
// 键盘回调
|
||||
// 键盘提交
|
||||
handleConfirm(e) {
|
||||
if (!e) return;
|
||||
this.cartForm.total_amount = e;
|
||||
@ -176,19 +173,13 @@
|
||||
// 清空
|
||||
handleClear() {
|
||||
this.cartForm.total_amount = '';
|
||||
this.merchantInfo = [];
|
||||
},
|
||||
|
||||
// 输入数字
|
||||
handleChange(e) {
|
||||
this.cartForm.total_amount = e;
|
||||
},
|
||||
|
||||
validateDecimal(event) {
|
||||
let val = (that.cartForm.total_amount.match(/^\d*(\.?\d{0,2})/g)[0]) || ''
|
||||
that.$nextTick(() => {
|
||||
that.cartForm.total_amount = val;
|
||||
uni.$u.throttle(that.getProductInfoByMerid, 30)
|
||||
})
|
||||
uni.$u.throttle(that.getProductInfoByMerid, 20)
|
||||
},
|
||||
|
||||
leftClick(e) {
|
||||
@ -215,9 +206,6 @@
|
||||
})
|
||||
}
|
||||
|
||||
if (this.cartForm.total_amount.endsWith('.')) this.cartForm.cartForm.total_amount = this.cartForm
|
||||
.cartForm.total_amount.replace('.', '');
|
||||
|
||||
// 循环加入购物车
|
||||
for (var i = 0; i < that.merchantInfo.length; i++) {
|
||||
let info = {
|
||||
@ -263,14 +251,12 @@
|
||||
});
|
||||
},
|
||||
|
||||
hide(e) {
|
||||
this.keyBoardShow = false;
|
||||
},
|
||||
|
||||
// 折叠商品
|
||||
handleOpen() {
|
||||
this.isOpen = !this.isOpen;
|
||||
},
|
||||
|
||||
// 根据店铺获取商品
|
||||
getProductInfoByMerid(merid, money) {
|
||||
getProductInfo({
|
||||
mer_id: that.mer_id,
|
||||
@ -298,49 +284,6 @@
|
||||
that.isEmpty = true;
|
||||
// #endif
|
||||
})
|
||||
},
|
||||
|
||||
// 图片保存
|
||||
handleSavePic() {
|
||||
// 获取要保存的图片路径或URL
|
||||
let imageUrl = this.qrcodeUrl; // 这里使用了网络上的图片作为示例
|
||||
|
||||
// #ifdef H5
|
||||
var a = document.createElement("a");
|
||||
a.download = imageUrl;
|
||||
a.href = imageUrl;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.remove();
|
||||
// #endif
|
||||
|
||||
// #ifndef H5
|
||||
let that = this;
|
||||
uni.downloadFile({
|
||||
url: imageUrl,
|
||||
success(res) {
|
||||
if (res.statusCode === 200) {
|
||||
let tempFilePath = res.tempFilePath; // 临时文件路径
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: tempFilePath,
|
||||
success() {
|
||||
return that.$util.Tips({
|
||||
title: '图片已保存至相册!'
|
||||
});
|
||||
},
|
||||
fail(err) {
|
||||
console.error('保存失败', err);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.error('下载失败', res.statusCode);
|
||||
}
|
||||
},
|
||||
fail(err) {
|
||||
console.error('下载失败', err);
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -294,7 +294,7 @@
|
||||
|
||||
let data = uni.getStorageSync("datas");
|
||||
this.productData = data.productData;
|
||||
this.platformConsumption = data.platformConsumption;
|
||||
this.platformConsumption = data.platformConsumption || [];
|
||||
|
||||
this.checkForm.cart_id = data.checkForm.cart_id;
|
||||
this.payForm.cart_id = this.checkForm.cart_id;
|
||||
|
@ -422,36 +422,25 @@
|
||||
limit: 20,
|
||||
domain: HTTP_REQUEST_URL,
|
||||
payMode: [{
|
||||
name: "微信支付",
|
||||
icon: "icon-weixinzhifu",
|
||||
value: 'wechat',
|
||||
title: '微信快捷支付',
|
||||
payStatus: 1
|
||||
},
|
||||
{
|
||||
name: "支付宝支付",
|
||||
icon: "icon-zhifubao",
|
||||
value: 'alipay',
|
||||
title: '支付宝支付',
|
||||
payStatus: this.$store.getters.globalData.alipay_open
|
||||
},
|
||||
{
|
||||
name: "余额支付",
|
||||
icon: "icon-yuezhifu",
|
||||
value: 'balance',
|
||||
title: '可用余额:',
|
||||
number: 0,
|
||||
payStatus: this.$store.getters.globalData.yue_pay_status
|
||||
},
|
||||
{
|
||||
name: "对公转账",
|
||||
icon: "icon-yuezhifu",
|
||||
value: 'public',
|
||||
title: '对公转账',
|
||||
number: 0,
|
||||
payStatus: 1
|
||||
}
|
||||
],
|
||||
name: "微信支付",
|
||||
icon: "icon-weixinzhifu",
|
||||
value: 'wechat',
|
||||
title: '微信快捷支付',
|
||||
payStatus: 1
|
||||
}, {
|
||||
name: "支付宝支付",
|
||||
icon: "icon-zhifubao",
|
||||
value: 'alipay',
|
||||
title: '支付宝支付',
|
||||
payStatus: this.$store.getters.globalData.alipay_open
|
||||
}, {
|
||||
name: "余额支付",
|
||||
icon: "icon-yuezhifu",
|
||||
value: 'balance',
|
||||
title: '可用余额:',
|
||||
number: 0,
|
||||
payStatus: this.$store.getters.globalData.yue_pay_status
|
||||
}],
|
||||
pay_close: false,
|
||||
pay_order_id: '',
|
||||
invoice_order_id: '',
|
||||
|
Loading…
x
Reference in New Issue
Block a user