This commit is contained in:
@@ -15,6 +15,7 @@ interface CardList {
|
||||
number: string;
|
||||
price: number;
|
||||
exchange: number;
|
||||
discount_integral: number;
|
||||
}
|
||||
|
||||
const show = ref(false);
|
||||
@@ -38,7 +39,11 @@ const openModal = async () => {
|
||||
show.value = !show.value;
|
||||
};
|
||||
|
||||
const add_cart = async (item: CardList, num: number = 1) => {
|
||||
const add_cart = async (
|
||||
item: CardList,
|
||||
num: number = 1,
|
||||
bid: string = props.merInfo.bid,
|
||||
) => {
|
||||
try {
|
||||
const res = await addCart({
|
||||
Bid: item.bid,
|
||||
@@ -49,7 +54,7 @@ const add_cart = async (item: CardList, num: number = 1) => {
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
});
|
||||
await get_cart_list();
|
||||
await get_cart_list(bid);
|
||||
} catch (e) {
|
||||
Taro.showToast({
|
||||
title: e.msg,
|
||||
@@ -73,12 +78,13 @@ const cartInfo = ref({
|
||||
count: 0,
|
||||
price: 0,
|
||||
exchange: 0,
|
||||
discount_integral: 0,
|
||||
});
|
||||
|
||||
const get_cart_list = async () => {
|
||||
const get_cart_list = async (bid: string = props.merInfo.bid) => {
|
||||
try {
|
||||
const res = await getCart({
|
||||
Bid: props.merInfo.bid,
|
||||
Bid: bid,
|
||||
});
|
||||
|
||||
card_list.value = res.data.data || [];
|
||||
@@ -86,11 +92,13 @@ const get_cart_list = async () => {
|
||||
count: 0,
|
||||
price: 0,
|
||||
exchange: 0,
|
||||
discount_integral: 0,
|
||||
};
|
||||
card_list.value.forEach((item: CardList) => {
|
||||
cartInfo.value.count += Number(item.number);
|
||||
cartInfo.value.price += Number(item.price);
|
||||
cartInfo.value.exchange += Number(item.exchange);
|
||||
cartInfo.value.discount_integral += Number(item.discount_integral);
|
||||
});
|
||||
emit('updateCart', res.data.data || []);
|
||||
} catch (e) {
|
||||
@@ -142,11 +150,10 @@ const create_order = async () => {
|
||||
url: `/pages/admin/add_order/pending_order/pending_order_detail/index?oid=${res.data.oid}&bid=${props.merInfo.bid}`,
|
||||
});
|
||||
} else {
|
||||
const mer_info = Taro.getStorageSync('mer_info');
|
||||
const user_info = Taro.getStorageSync('userInfo');
|
||||
const data = await getUserPoint({
|
||||
phone: user_info.data.phone,
|
||||
bid: mer_info.bid,
|
||||
bid: props.merInfo.bid,
|
||||
});
|
||||
res = await createActiveOrder({
|
||||
Bid: [props.merInfo.bid],
|
||||
@@ -159,7 +166,7 @@ const create_order = async () => {
|
||||
};
|
||||
// isShowPay.value = true;
|
||||
Taro.navigateTo({
|
||||
url: `/pages/goods/pay/index?oid=${res.data.oid}&bid=${mer_info.bid}&OrderType=1`,
|
||||
url: `/pages/goods/pay/index?oid=${res.data.oid}&bid=${props.merInfo.bid}&OrderType=1`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -199,16 +206,16 @@ defineExpose({
|
||||
<text>{{ cartInfo.count }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="ml-1">
|
||||
<view class="ml-1 text-[25px]">
|
||||
<text>总金额: {{ cartInfo.price.toFixed(2) }}元</text>
|
||||
<text v-if="!IsPendingOrder"
|
||||
>,总积分: {{ cartInfo.exchange.toFixed(2) }}</text
|
||||
>
|
||||
>,积分抵扣: {{ cartInfo.discount_integral.toFixed(2) }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="cartInfo.count > 0" class="payBtn" @click.stop="create_order"
|
||||
>去结算</view
|
||||
>
|
||||
>去结算
|
||||
</view>
|
||||
</view>
|
||||
<!-- 购物车弹窗 -->
|
||||
<nut-popup
|
||||
@@ -295,10 +302,12 @@ $h-border-radius: 50px;
|
||||
|
||||
.cardImg {
|
||||
position: relative;
|
||||
|
||||
image {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
.count-text {
|
||||
position: absolute;
|
||||
top: -10px;
|
||||
@@ -310,6 +319,7 @@ $h-border-radius: 50px;
|
||||
height: 35px;
|
||||
text-align: center;
|
||||
line-height: 35px;
|
||||
|
||||
text {
|
||||
margin: auto;
|
||||
font-size: 25px;
|
||||
|
||||
@@ -253,6 +253,9 @@ Taro.useReachBottom(() => {
|
||||
.icon {
|
||||
display: inline-block;
|
||||
font-size: 30px;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.desc {
|
||||
|
||||
@@ -9,10 +9,10 @@ defineExpose({
|
||||
});
|
||||
|
||||
const props = defineProps({
|
||||
src: {
|
||||
imgArr: {
|
||||
required: true,
|
||||
type: String,
|
||||
default: '',
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
type: Number,
|
||||
cb: {
|
||||
@@ -21,13 +21,21 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const imgs = ref(props.imgArr);
|
||||
|
||||
const clickFn = type => {
|
||||
if (props.cb) props.cb(type);
|
||||
else isShow.value = false;
|
||||
};
|
||||
|
||||
const closeFn = () => {
|
||||
isShow.value = false;
|
||||
imgs.value.shift(0);
|
||||
if (imgs.value.length !== 0) isShow.value = true;
|
||||
};
|
||||
|
||||
Taro.useLoad(() => {
|
||||
if (Taro.getStorageSync('token')) isShow.value = true;
|
||||
isShow.value = true;
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -40,12 +48,13 @@ Taro.useLoad(() => {
|
||||
<view @click.stop="clickFn(type)">
|
||||
<image
|
||||
:style="{
|
||||
width: src.naturalWidth,
|
||||
height: src.naturalHeight < 600 ? src.naturalHeight : '480px',
|
||||
width: imgs[0]?.naturalWidth,
|
||||
height:
|
||||
imgs[0]?.naturalHeight < 600 ? imgs[0]?.naturalHeight : '480px',
|
||||
}"
|
||||
:src="src" />
|
||||
:src="imgs[0]" />
|
||||
</view>
|
||||
<view @click.stop="isShow = false">
|
||||
<view @click.stop="closeFn">
|
||||
<image class="icon" src="../static/index/close.png" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: '收益提现',
|
||||
navigationBarTitleText: '余额提现',
|
||||
enablePullDownRefresh: true,
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import {ref, h} from 'vue';
|
||||
import {ref} from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {getWithdrawList, addWithdraw} from '@/api/admin';
|
||||
|
||||
@@ -81,31 +81,19 @@ const rules = ref({
|
||||
{
|
||||
message: '请填写提现积分',
|
||||
validator: (value, _) => {
|
||||
if (!value) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
return value;
|
||||
},
|
||||
},
|
||||
{
|
||||
message: '提现积分最低为100',
|
||||
validator: (value, _) => {
|
||||
if (Number(value) < 100) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
return Number(value) >= 100;
|
||||
},
|
||||
},
|
||||
{
|
||||
message: '提现积分不能大于可提现积分',
|
||||
validator: (value, _) => {
|
||||
if (Number(value) > row.value) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
return Number(value) <= row.value;
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -144,7 +132,7 @@ Taro.useReachBottom(() => {
|
||||
<view class="container">
|
||||
<view class="">
|
||||
<view class="font-bold text-[35px]">{{ row }}</view>
|
||||
<view class="text-[25px] mt-2">可提现积分</view>
|
||||
<view class="text-[25px] mt-2">可提现余额</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="">
|
||||
@@ -164,7 +152,7 @@ Taro.useReachBottom(() => {
|
||||
</view>
|
||||
<view class="formCard">
|
||||
<view class="flex justify-between mb-[25px]">
|
||||
<text>积分提现</text>
|
||||
<text>余额提现</text>
|
||||
<!-- <view class="flex items-center" @click="visible1 = true">
|
||||
<image
|
||||
class="w-[26px] h-[26px]"
|
||||
@@ -177,7 +165,7 @@ Taro.useReachBottom(() => {
|
||||
<nut-input
|
||||
v-model="basicData.num"
|
||||
class="nut-input-text"
|
||||
placeholder="请输入提现积分"
|
||||
placeholder="请输入提现余额"
|
||||
type="text">
|
||||
<template #right>
|
||||
<text
|
||||
@@ -221,7 +209,7 @@ Taro.useReachBottom(() => {
|
||||
</view>
|
||||
<view>
|
||||
<view class="mt-3 mb-3 text-[35px]">¥{{ item.number }}</view>
|
||||
<view class="text-[25px] mb-1">提现积分:{{ item.integral }}</view>
|
||||
<view class="text-[25px] mb-1">提现金额:{{ item.integral }}</view>
|
||||
<view class="text-[25px] mb-1"
|
||||
>信息服务费:{{ item.commission }}</view
|
||||
>
|
||||
|
||||
@@ -187,6 +187,8 @@ const isShowPay = ref(false);
|
||||
const orderData = ref<any>([]);
|
||||
|
||||
const sub = async () => {
|
||||
try {
|
||||
console.log('sub');
|
||||
const arr: any = list.value.filter(
|
||||
(item: any) => item.state.checkboxgroup.length > 0,
|
||||
);
|
||||
@@ -198,7 +200,6 @@ const sub = async () => {
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const {data: res} = await createActiveOrder({
|
||||
Bid: arr.map((item: any) => item.StoreBid),
|
||||
});
|
||||
@@ -212,7 +213,7 @@ const sub = async () => {
|
||||
}
|
||||
} catch (e) {
|
||||
Taro.showToast({
|
||||
title: e.msg,
|
||||
title: e.msg || '订单创建失败',
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -21,12 +21,11 @@
|
||||
<view class="flex items-center justify-between">
|
||||
<view class="flex items-center">
|
||||
<nut-price size="large" :price="goodInfo.number"></nut-price>
|
||||
<view class="ml-5 line"></view>
|
||||
<nut-price
|
||||
class="ml-5"
|
||||
v-if="goodInfo.exchange"
|
||||
size="large"
|
||||
:price="goodInfo.exchange"
|
||||
symbol="积分"></nut-price>
|
||||
symbol="+积分"></nut-price>
|
||||
</view>
|
||||
<nut-button
|
||||
size="small"
|
||||
@@ -38,15 +37,17 @@
|
||||
</nut-button>
|
||||
</view>
|
||||
<view class="flex items-center justify-between mt-3">
|
||||
<view class="title text-lg">{{ goodInfo.name }}</view>
|
||||
<view class="stock text-[#9E9E9E]"> 库存:{{ goodInfo.stock }}</view>
|
||||
<view class="title text-[25px]">{{ goodInfo.name }}</view>
|
||||
</view>
|
||||
<view class="stock text-[#9E9E9E] text-[25px] mt-[10px]"
|
||||
>库存: {{ goodInfo.stock }}</view
|
||||
>
|
||||
<view class="line1"></view>
|
||||
<view class="sub">{{ goodInfo.profile }}</view>
|
||||
</view>
|
||||
<!-- 商品详情 -->
|
||||
<view class="rich-box">
|
||||
<view class="title">-----商品详情-----</view>
|
||||
<view class="title">商品详情</view>
|
||||
<rich-text
|
||||
v-if="goodInfo.details"
|
||||
class="rich"
|
||||
@@ -64,7 +65,7 @@
|
||||
import {Ref, ref} from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {Home, Left} from '@nutui/icons-vue-taro';
|
||||
import {getActiveGoodsDetail} from '@/api/goods';
|
||||
import {getActiveGoodsDetail, getMerDetail} from '@/api/goods';
|
||||
import Cart from '@/components/Cart.vue';
|
||||
import {Cart2} from '@nutui/icons-vue-taro';
|
||||
import {nextTick} from 'vue';
|
||||
@@ -90,14 +91,23 @@ interface GoodInfo {
|
||||
|
||||
const goodInfo = ref<GoodInfo>({});
|
||||
|
||||
const bid = ref('');
|
||||
|
||||
Taro.useLoad(async options => {
|
||||
await get_good_detail(options.gid);
|
||||
mer_info.value = Taro.getStorageSync('mer_info');
|
||||
bid.value = options.bid;
|
||||
|
||||
await getMerInfo();
|
||||
await nextTick(async () => {
|
||||
await cartRef.value.get_cart_list();
|
||||
await cartRef.value.get_cart_list(bid.value);
|
||||
});
|
||||
});
|
||||
|
||||
const getMerInfo = async () => {
|
||||
const res = await getMerDetail({bid: bid.value});
|
||||
mer_info.value = res.data.data;
|
||||
};
|
||||
|
||||
Taro.useShareAppMessage(() => ({
|
||||
title: `捷兑通-${goodInfo.value.name}`,
|
||||
path: `/pages/goods/goods_detail/index?gid=${goodInfo.value.gid}&type=1`,
|
||||
@@ -149,7 +159,7 @@ const cartRef = ref(null) as Ref;
|
||||
const add_cart = async (item: any) => {
|
||||
const num = item.cartNum ? Number(item.cartNum) + 1 : 1;
|
||||
await nextTick(async () => {
|
||||
await cartRef.value.add_cart(item, num);
|
||||
await cartRef.value.add_cart(item, num, bid.value);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -219,7 +229,7 @@ page {
|
||||
margin: auto;
|
||||
|
||||
.sub {
|
||||
font-size: 30px;
|
||||
font-size: 25px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
@@ -227,7 +237,7 @@ page {
|
||||
.rich-box {
|
||||
background-color: #fff;
|
||||
margin-top: 20px;
|
||||
width: 100vw;
|
||||
//width: 100vw;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
padding: 15px 0;
|
||||
@@ -239,10 +249,6 @@ page {
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.rich {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.nut-sku {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: '支付订单',
|
||||
navigationBarTitleText: '确认订单',
|
||||
});
|
||||
|
||||
@@ -37,3 +37,61 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.order-card {
|
||||
width: 95%;
|
||||
box-sizing: border-box;
|
||||
margin: 20px auto;
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 20px;
|
||||
|
||||
.line {
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
background-color: #f5f5f5;
|
||||
margin: 20px auto;
|
||||
}
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.center {
|
||||
.top {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
|
||||
image {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 15px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.title {
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
text-overflow: ellipsis;
|
||||
width: 350px;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 10px;
|
||||
font-size: 28px;
|
||||
text-align: right;
|
||||
color: #9c9c9c;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,57 @@
|
||||
<template>
|
||||
<view class="flex flex-col items-center justify-center">
|
||||
<view class="mt-6 text-[#8C8C8C] text-[25px]"
|
||||
>交易剩余时间:{{ tStr }}
|
||||
<!-- <view class="mt-6 text-[#8C8C8C] text-[25px]"-->
|
||||
<!-- >交易剩余时间:{{ tStr }}-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="flex items-center mt-5 mb-5">-->
|
||||
<!-- <nut-price :price="a" size="large" />-->
|
||||
<!-- <view class="line"></view>-->
|
||||
<!-- <nut-price position="after" symbol="积分" :price="b" size="large" />-->
|
||||
<!-- </view>-->
|
||||
<!-- 商品信息 -->
|
||||
<view class="order-card">
|
||||
<view
|
||||
class="center mb-[20px]"
|
||||
v-for="(item, index) in orderData.OrderGoods"
|
||||
:key="index">
|
||||
<view class="top">
|
||||
<image :src="item.Goods.cover" />
|
||||
<view class="flex flex-col justify-between flex-1">
|
||||
<view class="title">{{ item.Goods?.name }}</view>
|
||||
<view class="text-[#F83D3D] mt-5">
|
||||
<view
|
||||
>¥{{ item.pay_price }}元
|
||||
<text v-if="item.pay_integral > 0"
|
||||
>+{{ item.pay_integral }}积分</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view>x{{ item.number }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="line"></view> -->
|
||||
<view
|
||||
class="flex justify-between items-center mt-2 mb-2 text-[25px]"
|
||||
style="text-align: right">
|
||||
<text class="text-[#9C9C9C] text-[28px]"
|
||||
>共{{ orderData.count }}件商品
|
||||
</text>
|
||||
<text class="text-[26px]"
|
||||
>应付款: ¥{{ orderData.discount_price }}元
|
||||
<text v-if="orderData.exchange > 0">
|
||||
积分抵扣: {{ (orderData.exchange / 100).toFixed(2) }}元</text
|
||||
>
|
||||
</text>
|
||||
<!-- <view class="line"></view> -->
|
||||
</view>
|
||||
<view class="flex items-center mt-5 mb-5">
|
||||
<nut-price :price="a" size="large" />
|
||||
<view class="line"></view>
|
||||
<nut-price position="after" symbol="积分" :price="b" size="large" />
|
||||
</view>
|
||||
<!-- {{ payVal }} -->
|
||||
<nut-radio-group class="w-[95%]" v-model="payVal">
|
||||
<nut-cell-group class="w-full">
|
||||
<nut-cell class="text-[#333333]" title="支付方式"></nut-cell>
|
||||
<nut-cell class="text-[#333333]" title="选择积分抵扣"></nut-cell>
|
||||
<nut-cell
|
||||
v-for="(item, index) in payList"
|
||||
:key="index"
|
||||
@@ -26,34 +66,6 @@
|
||||
<nut-radio :label="item.ID"></nut-radio>
|
||||
</template>
|
||||
</nut-cell>
|
||||
<!-- <nut-cell
|
||||
class="flex items-center"
|
||||
title="平台积分支付"
|
||||
:desc="`剩余积分:${orderData.User?.integral || 0}`"
|
||||
@click="cellClick(2, orderData.User?.integral === 0)">
|
||||
<template #icon>
|
||||
<IconFont size="30" :name="require('../../../static/pt.png')" />
|
||||
</template>
|
||||
<template #link>
|
||||
<nut-radio
|
||||
:disabled="orderData.User?.integral === 0"
|
||||
:label="2"></nut-radio>
|
||||
</template>
|
||||
</nut-cell>
|
||||
<nut-cell
|
||||
class="flex items-center"
|
||||
title="天才小猪积分支付"
|
||||
:desc="`剩余积分:${orderData.integral || 0}`"
|
||||
@click="cellClick(3, orderData.integral === 0)">
|
||||
<template #icon>
|
||||
<IconFont size="30" :name="require('../../../static/jh.png')" />
|
||||
</template>
|
||||
<template #link>
|
||||
<nut-radio
|
||||
:disabled="orderData.integral === 0"
|
||||
:label="3"></nut-radio>
|
||||
</template>
|
||||
</nut-cell> -->
|
||||
</nut-cell-group>
|
||||
</nut-radio-group>
|
||||
<view class="w-[90%] mt-[100px]">
|
||||
@@ -66,36 +78,6 @@
|
||||
>确认支付
|
||||
</nut-button>
|
||||
</view>
|
||||
|
||||
<nut-short-password
|
||||
title="请输入交易密码"
|
||||
tips="忘记密码"
|
||||
desc=" "
|
||||
:error-msg="error_msg"
|
||||
v-model="shortVal"
|
||||
v-model:visible="visible"
|
||||
:length="6"
|
||||
:close-on-click-overlay="false"
|
||||
@focus="showKeyboard = true"
|
||||
@complete="shortComplete"
|
||||
@close="shortClose"
|
||||
@tips="onTips">
|
||||
</nut-short-password>
|
||||
<nut-number-keyboard
|
||||
v-model="shortVal"
|
||||
v-model:visible="showKeyboard"
|
||||
@blur="showKeyboard = false">
|
||||
</nut-number-keyboard>
|
||||
|
||||
<nut-dialog
|
||||
title="设置交易密码"
|
||||
content="您还未设置交易密码,请前往设置"
|
||||
cancel-text="其他支付方式"
|
||||
ok-text="设置交易密码"
|
||||
v-model:visible="visible2"
|
||||
@cancel="visible2 = false"
|
||||
@ok="onTips">
|
||||
</nut-dialog>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -103,10 +85,9 @@
|
||||
import Taro from '@tarojs/taro';
|
||||
import {IconFont} from '@nutui/icons-vue-taro';
|
||||
import {onUnmounted, ref} from 'vue';
|
||||
import {getActiveOrderDetail, checkTradePwd, getPayList} from '@/api/goods';
|
||||
import {getActiveOrderDetail, getPayList} from '@/api/goods';
|
||||
import {getUserPoint} from '@/api/admin';
|
||||
import {payOrder} from '@/api/order';
|
||||
import {isCheckTradePwd} from '@/api/user';
|
||||
import * as dayjs from 'dayjs';
|
||||
|
||||
const payVal = ref();
|
||||
@@ -115,20 +96,10 @@ const t_id = ref();
|
||||
|
||||
const tStr = ref('00:00');
|
||||
|
||||
const error_msg = ref('');
|
||||
|
||||
const shortVal = ref('');
|
||||
|
||||
const orderData = ref<any>({});
|
||||
|
||||
const visible = ref(false);
|
||||
|
||||
const showKeyboard = ref(false);
|
||||
|
||||
const isLoading = ref(false);
|
||||
|
||||
const visible2 = ref(false);
|
||||
|
||||
const opt = ref<any>({});
|
||||
|
||||
Taro.useLoad(e => {
|
||||
@@ -145,8 +116,8 @@ const payList = ref<any>([]);
|
||||
|
||||
const get_pay_list = async () => {
|
||||
const res = await getPayList({});
|
||||
// console.log(res);
|
||||
payList.value = res.data.data || [];
|
||||
payVal.value = payList.value[0].ID;
|
||||
};
|
||||
|
||||
const getData = async (oid: string, bid: string, OrderType: number) => {
|
||||
@@ -155,6 +126,7 @@ const getData = async (oid: string, bid: string, OrderType: number) => {
|
||||
phone: user_info.data.phone,
|
||||
bid,
|
||||
});
|
||||
|
||||
const res = await getActiveOrderDetail({
|
||||
oid,
|
||||
OrderType: Number(OrderType),
|
||||
@@ -173,10 +145,9 @@ const getData = async (oid: string, bid: string, OrderType: number) => {
|
||||
|
||||
res.data.data.forEach(item => {
|
||||
a.value += item.price;
|
||||
b.value += item.exchange;
|
||||
b.value += item.discount_integral;
|
||||
});
|
||||
|
||||
// console.log(orderData.value);
|
||||
if (!orderData.value.oid)
|
||||
return Taro.showToast({
|
||||
title: '未获取到订单信息~',
|
||||
@@ -190,51 +161,25 @@ const pay = async () => {
|
||||
isLoading.value = true;
|
||||
if (!payVal.value)
|
||||
return Taro.showToast({title: '请选择支付方式', icon: 'none'});
|
||||
if (payVal.value !== 1) {
|
||||
const res = await isCheckTradePwd();
|
||||
if (res.data.pay_password) {
|
||||
visible.value = true;
|
||||
showKeyboard.value = true;
|
||||
} else {
|
||||
isLoading.value = false;
|
||||
visible2.value = true;
|
||||
}
|
||||
} else {
|
||||
|
||||
await confirmPay();
|
||||
}
|
||||
} catch (error) {
|
||||
isLoading.value = false;
|
||||
Taro.showToast({
|
||||
title: error.msg,
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const shortComplete = async value => {
|
||||
try {
|
||||
await checkTradePwd({
|
||||
pay_password: value,
|
||||
});
|
||||
shortClose(false);
|
||||
await confirmPay();
|
||||
} catch (error) {
|
||||
error_msg.value = error.msg;
|
||||
shortVal.value = '';
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const confirmPay = async () => {
|
||||
try {
|
||||
const res = await payOrder({
|
||||
// oid: opt.value.oid.map(item => item.oid),
|
||||
oid: opt.value.oid,
|
||||
OrderType: payVal.value,
|
||||
PayType: payVal.value,
|
||||
});
|
||||
switch (payVal.value) {
|
||||
case 1:
|
||||
if (typeof res.data.data === 'object') {
|
||||
Taro.requestPayment({
|
||||
timeStamp: res.data.data.timeStamp,
|
||||
nonceStr: res.data.data.nonceStr,
|
||||
@@ -254,36 +199,13 @@ const confirmPay = async () => {
|
||||
});
|
||||
},
|
||||
complete: function () {
|
||||
// Taro.redirectTo({
|
||||
// url: `/pages/users/order_list_detail/index?orderId=${opt.value.oid}&OrderType=1`,
|
||||
// });
|
||||
Taro.redirectTo({
|
||||
url: `/pages/users/order_list/index?type=0`,
|
||||
});
|
||||
},
|
||||
});
|
||||
} else {
|
||||
Taro.showToast({
|
||||
title: '参数获取失败,请重试~',
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Taro.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
});
|
||||
setTimeout(() => {
|
||||
// Taro.redirectTo({
|
||||
// url: `/pages/users/order_list_detail/index?orderId=${opt.value.oid}&OrderType=1`,
|
||||
// });
|
||||
Taro.redirectTo({
|
||||
url: `/pages/users/order_list/index?type=0`,
|
||||
});
|
||||
}, 2000);
|
||||
break;
|
||||
}
|
||||
},
|
||||
});
|
||||
isLoading.value = false;
|
||||
} catch (err) {
|
||||
isLoading.value = false;
|
||||
@@ -294,15 +216,6 @@ const confirmPay = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const shortClose = (isMsg: boolean = true) => {
|
||||
showKeyboard.value = false;
|
||||
visible.value = false;
|
||||
isLoading.value = false;
|
||||
shortVal.value = '';
|
||||
error_msg.value = '';
|
||||
if (isMsg) Taro.showToast({title: '支付取消', icon: 'none'});
|
||||
};
|
||||
|
||||
const cellClick = (val: number) => {
|
||||
payVal.value = val;
|
||||
};
|
||||
@@ -317,12 +230,6 @@ const countdownTime = () => {
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
const onTips = () => {
|
||||
Taro.redirectTo({
|
||||
url: '/pages/users/pwd/index',
|
||||
});
|
||||
};
|
||||
|
||||
Taro.useDidHide(() => {
|
||||
clearInterval(t_id.value);
|
||||
});
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
hover-class="none">
|
||||
</navigator>
|
||||
<MerList :get-user-location="getUserLocal" />
|
||||
<Popup :src="require('../../static/popTip.png')" />
|
||||
<Popup :imgArr="imgList" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -72,6 +72,11 @@ interface navigationType {
|
||||
|
||||
const navigationList = ref<Array<navigationType>>([]);
|
||||
|
||||
const imgList = ref([
|
||||
require('../../static/popTip.png'),
|
||||
require('../../static/popTip2.png'),
|
||||
]);
|
||||
|
||||
Taro.useShareAppMessage(() => ({
|
||||
title: '捷兑通',
|
||||
path: `/pages/index/index?scene=${Taro.getStorageSync('token')}`,
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
v-model="mer_info.rate" />
|
||||
<view class="text-[#9E9E9E] text-[25px]">销量:10000</view>
|
||||
<view class="text-[#9E9E9E] text-[25px]"
|
||||
>营业时间:{{ mer_info.week_start }}-{{ mer_info.week_end }}</view
|
||||
>
|
||||
>营业时间:{{ mer_info.week_start }}-{{ mer_info.week_end }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="bom">
|
||||
@@ -86,18 +86,22 @@
|
||||
<image :src="item.cover" lazy-load />
|
||||
<view class="right">
|
||||
<view class="name">{{ item.name }}</view>
|
||||
<view class="stock text-[25px]">剩余:{{ item.stock }}</view>
|
||||
<view class="bom">
|
||||
<view>
|
||||
<view class="price">
|
||||
<text style="font-size: 15px">{{ item.number }}元</text>
|
||||
</view>
|
||||
<view class="price">
|
||||
<text style="font-size: 15px"
|
||||
>{{ item.exchange }}积分</text
|
||||
>
|
||||
>{{ item.number }}元
|
||||
<text style="font-size: 15px" v-if="item.exchange"
|
||||
>+{{ item.exchange }}积分
|
||||
</text>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bom">
|
||||
<view>
|
||||
<view class="stock text-[25px]"
|
||||
>剩余:{{ item.stock }}</view
|
||||
>
|
||||
</view>
|
||||
<view class="flex items-center justify-between">
|
||||
<view
|
||||
v-if="item.cartNum > 0"
|
||||
@@ -156,7 +160,7 @@ Taro.useLoad(opt => {
|
||||
bid.value = opt.bid;
|
||||
});
|
||||
|
||||
Taro.useDidShow(opt => {
|
||||
Taro.useDidShow(() => {
|
||||
if (!Taro.getStorageSync('token')) {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/users/login/index?isBack=1',
|
||||
@@ -265,7 +269,7 @@ const get_good_list = async (id: number) => {
|
||||
|
||||
const toGoodDetails = (id: string, type: number) => {
|
||||
Taro.navigateTo({
|
||||
url: `/pages/goods/goods_detail/index?gid=${id}&type=${type}`,
|
||||
url: `/pages/goods/goods_detail/index?gid=${id}&type=${type}&bid=${bid.value}`,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
<IconFont
|
||||
size="42"
|
||||
name="http://p0.meituan.net/csc/bd9aca457a109b4d69a692a9109a73ed9045.png"></IconFont>
|
||||
<view class="label">订单统计</view>
|
||||
<view class="label">订单管理</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="userInfo.data.permission.tx"
|
||||
@@ -163,7 +163,7 @@
|
||||
<IconFont
|
||||
size="42"
|
||||
name="http://p0.meituan.net/csc/f85d7dc1bf9eda8977e9089b260a586b7440.png"></IconFont>
|
||||
<view class="label">收益提现</view>
|
||||
<view class="label">余额提现</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -4,7 +4,6 @@ import Taro from '@tarojs/taro';
|
||||
import Pay from '@/components/Pay.vue';
|
||||
import {getActiveOrderList, deleteActiveOrder} from '@/api/goods';
|
||||
import {getOrderStatistics} from '@/api/order';
|
||||
import {getUserPoint} from '@/api/admin';
|
||||
import UQRCode from 'uqrcodejs';
|
||||
|
||||
const tabValue = ref(0);
|
||||
@@ -58,6 +57,8 @@ interface OrderList {
|
||||
price: number;
|
||||
joint_oid: string;
|
||||
bid: string;
|
||||
discount_price: number;
|
||||
discount_integral: number;
|
||||
}
|
||||
|
||||
interface GoodsItem {
|
||||
@@ -169,35 +170,6 @@ const delOrder = async (oid: string) => {
|
||||
await getList();
|
||||
};
|
||||
|
||||
const countInfo = ref<{
|
||||
A?: number;
|
||||
B?: number;
|
||||
C?: number;
|
||||
D?: number;
|
||||
F?: number;
|
||||
ExchangeTotal?: number;
|
||||
PriceTotal?: number;
|
||||
}>({});
|
||||
|
||||
const getTj = async () => {
|
||||
try {
|
||||
const res = await getOrderStatistics({
|
||||
type: 2,
|
||||
});
|
||||
countInfo.value = res.data.data;
|
||||
tabsList.value[0].num = countInfo.value.A || 0;
|
||||
tabsList.value[1].num = countInfo.value.B || 0;
|
||||
tabsList.value[2].num = countInfo.value.C || 0;
|
||||
tabsList.value[3].num = countInfo.value.D || 0;
|
||||
tabsList.value[4].num = countInfo.value.F || 0;
|
||||
} catch (error) {
|
||||
Taro.showToast({
|
||||
title: error.msg,
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const t_id = ref();
|
||||
|
||||
const openCode = item => {
|
||||
@@ -272,8 +244,8 @@ const closed = () => {
|
||||
:style="{
|
||||
color: tabValue === item.value ? '#000' : '#9C9C9C',
|
||||
}"
|
||||
>{{ item.title }}</view
|
||||
>
|
||||
>{{ item.title }}
|
||||
</view>
|
||||
<!-- <view>{{ item.num }}</view> -->
|
||||
<view class="line" :class="{lineColor: item.value === tabValue}"></view>
|
||||
</view>
|
||||
@@ -315,8 +287,12 @@ const closed = () => {
|
||||
<view class="flex flex-col justify-between flex-1">
|
||||
<view class="title">{{ itm.Goods?.name }}</view>
|
||||
<view class="text-[#F83D3D] mt-5">
|
||||
<view>{{ itm.pay_price }}元</view>
|
||||
<view>{{ itm.pay_integral }}积分</view>
|
||||
<view
|
||||
>{{ itm.pay_price }}元
|
||||
<text v-if="itm.pay_integral > 0"
|
||||
>+{{ itm.pay_integral }}积分</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
@@ -330,13 +306,15 @@ const closed = () => {
|
||||
v-if="item.status !== 0"
|
||||
style="text-align: right">
|
||||
<text class="text-[#9C9C9C] text-[28px]"
|
||||
>共{{ item.count }}件商品</text
|
||||
>
|
||||
>共{{ item.count }}件商品
|
||||
</text>
|
||||
<text class="text-[26px]"
|
||||
>{{ item.status !== 0 ? '实' : '应' }}付款{{
|
||||
item.pay_type === 1 ? '(元): ' : '(积分): '
|
||||
}}{{ item.pay_type === 1 ? item.price : item.exchange }}</text
|
||||
>{{ item.status !== 0 ? '实' : '应' }}付款:
|
||||
{{ item.discount_price }}(元)
|
||||
<text v-if="item.exchange > 0"
|
||||
>积分抵扣: {{ item.exchange }}元</text
|
||||
>
|
||||
</text>
|
||||
<!-- <view class="line"></view> -->
|
||||
</view>
|
||||
<view class="btn">
|
||||
|
||||
@@ -28,9 +28,10 @@
|
||||
<IconFont name="rect-right" size="15" color="#333333"></IconFont>
|
||||
</view>
|
||||
<view class="text-[#9C9C9C] text-[20px]"
|
||||
>订单剩余<text class="text-[#FF0000]">{{ timeStr }}</text
|
||||
>过期,请尽快核销!</view
|
||||
>
|
||||
>订单剩余
|
||||
<text class="text-[#FF0000]">{{ timeStr }} </text>
|
||||
过期,请尽快核销!
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="goodInfo.status === 2">
|
||||
<view class="flex text-[#333333] items-center mb-1">
|
||||
@@ -99,8 +100,12 @@
|
||||
<view class="flex flex-col justify-between flex-1">
|
||||
<view class="title">{{ item.Goods?.name }}</view>
|
||||
<view class="text-[#F83D3D] mt-5">
|
||||
<view>{{ item.pay_price }}元</view>
|
||||
<view>{{ item.pay_integral }}积分</view>
|
||||
<view
|
||||
>{{ item.pay_price }}元
|
||||
<text v-if="item.pay_integral > 0"
|
||||
>+{{ item.pay_integral }}积分</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
@@ -109,16 +114,16 @@
|
||||
</view>
|
||||
<view
|
||||
class="flex justify-between items-center mt-2 mb-2 text-[25px]">
|
||||
<view class="text-[#9C9C9C]">{{
|
||||
`共${goodInfo.count}件商品`
|
||||
}}</view>
|
||||
<text
|
||||
>{{ goodInfo.status !== 0 ? '实' : '应' }}付款{{
|
||||
goodInfo.pay_type === 1 ? '(元): ' : '(积分): '
|
||||
}}{{
|
||||
goodInfo.pay_type === 1 ? goodInfo.price : goodInfo.exchange
|
||||
}}</text
|
||||
<view class="text-[#9C9C9C]"
|
||||
>{{ `共${goodInfo.count}件商品` }}
|
||||
</view>
|
||||
<text class="text-[26px]"
|
||||
>{{ goodInfo.status !== 0 ? '实' : '应' }}付款:
|
||||
{{ goodInfo.discount_price }}(元)
|
||||
<text v-if="goodInfo.exchange > 0"
|
||||
>积分抵扣: {{ goodInfo.exchange }}元</text
|
||||
>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -155,16 +160,16 @@
|
||||
type="primary"
|
||||
block
|
||||
@click="openPay()"
|
||||
>继续付款</nut-button
|
||||
>
|
||||
>继续付款
|
||||
</nut-button>
|
||||
<nut-button
|
||||
v-if="goodInfo.status === 1"
|
||||
shape="square"
|
||||
type="primary"
|
||||
block
|
||||
@click="openCode()"
|
||||
>出示核销码</nut-button
|
||||
>
|
||||
>出示核销码
|
||||
</nut-button>
|
||||
</view>
|
||||
|
||||
<!-- <view class="btn">
|
||||
@@ -231,7 +236,6 @@ import {onUnmounted, ref} from 'vue';
|
||||
import dayjs from 'dayjs';
|
||||
import duration from 'dayjs/plugin/duration';
|
||||
import Pay from '@/components/Pay.vue';
|
||||
import {getUserPoint} from '@/api/admin';
|
||||
import {calculateDistance} from '@/utils';
|
||||
import {IconFont} from '@nutui/icons-vue-taro';
|
||||
import {getActiveOrderDetail} from '@/api/goods';
|
||||
|
||||
BIN
src/static/popTip2.png
Normal file
BIN
src/static/popTip2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 73 KiB |
Reference in New Issue
Block a user