feat(custom): \!
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-09-03 22:17:38 +08:00
parent d57f9cc53e
commit 962d7a2b19
16 changed files with 287 additions and 314 deletions

View File

@@ -15,6 +15,7 @@ interface CardList {
number: string; number: string;
price: number; price: number;
exchange: number; exchange: number;
discount_integral: number;
} }
const show = ref(false); const show = ref(false);
@@ -38,7 +39,11 @@ const openModal = async () => {
show.value = !show.value; 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 { try {
const res = await addCart({ const res = await addCart({
Bid: item.bid, Bid: item.bid,
@@ -49,7 +54,7 @@ const add_cart = async (item: CardList, num: number = 1) => {
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
}); });
await get_cart_list(); await get_cart_list(bid);
} catch (e) { } catch (e) {
Taro.showToast({ Taro.showToast({
title: e.msg, title: e.msg,
@@ -73,12 +78,13 @@ const cartInfo = ref({
count: 0, count: 0,
price: 0, price: 0,
exchange: 0, exchange: 0,
discount_integral: 0,
}); });
const get_cart_list = async () => { const get_cart_list = async (bid: string = props.merInfo.bid) => {
try { try {
const res = await getCart({ const res = await getCart({
Bid: props.merInfo.bid, Bid: bid,
}); });
card_list.value = res.data.data || []; card_list.value = res.data.data || [];
@@ -86,11 +92,13 @@ const get_cart_list = async () => {
count: 0, count: 0,
price: 0, price: 0,
exchange: 0, exchange: 0,
discount_integral: 0,
}; };
card_list.value.forEach((item: CardList) => { card_list.value.forEach((item: CardList) => {
cartInfo.value.count += Number(item.number); cartInfo.value.count += Number(item.number);
cartInfo.value.price += Number(item.price); cartInfo.value.price += Number(item.price);
cartInfo.value.exchange += Number(item.exchange); cartInfo.value.exchange += Number(item.exchange);
cartInfo.value.discount_integral += Number(item.discount_integral);
}); });
emit('updateCart', res.data.data || []); emit('updateCart', res.data.data || []);
} catch (e) { } 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}`, url: `/pages/admin/add_order/pending_order/pending_order_detail/index?oid=${res.data.oid}&bid=${props.merInfo.bid}`,
}); });
} else { } else {
const mer_info = Taro.getStorageSync('mer_info');
const user_info = Taro.getStorageSync('userInfo'); const user_info = Taro.getStorageSync('userInfo');
const data = await getUserPoint({ const data = await getUserPoint({
phone: user_info.data.phone, phone: user_info.data.phone,
bid: mer_info.bid, bid: props.merInfo.bid,
}); });
res = await createActiveOrder({ res = await createActiveOrder({
Bid: [props.merInfo.bid], Bid: [props.merInfo.bid],
@@ -159,7 +166,7 @@ const create_order = async () => {
}; };
// isShowPay.value = true; // isShowPay.value = true;
Taro.navigateTo({ 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> <text>{{ cartInfo.count }}</text>
</view> </view>
</view> </view>
<view class="ml-1"> <view class="ml-1 text-[25px]">
<text>总金额: {{ cartInfo.price.toFixed(2) }}</text> <text>总金额: {{ cartInfo.price.toFixed(2) }}</text>
<text v-if="!IsPendingOrder" <text v-if="!IsPendingOrder"
>积分: {{ cartInfo.exchange.toFixed(2) }}</text >积分抵扣: {{ cartInfo.discount_integral.toFixed(2) }}
> </text>
</view> </view>
</view> </view>
<view v-if="cartInfo.count > 0" class="payBtn" @click.stop="create_order" <view v-if="cartInfo.count > 0" class="payBtn" @click.stop="create_order"
>去结算</view >去结算
> </view>
</view> </view>
<!-- 购物车弹窗 --> <!-- 购物车弹窗 -->
<nut-popup <nut-popup
@@ -295,10 +302,12 @@ $h-border-radius: 50px;
.cardImg { .cardImg {
position: relative; position: relative;
image { image {
width: 60px; width: 60px;
height: 60px; height: 60px;
} }
.count-text { .count-text {
position: absolute; position: absolute;
top: -10px; top: -10px;
@@ -310,6 +319,7 @@ $h-border-radius: 50px;
height: 35px; height: 35px;
text-align: center; text-align: center;
line-height: 35px; line-height: 35px;
text { text {
margin: auto; margin: auto;
font-size: 25px; font-size: 25px;

View File

@@ -253,6 +253,9 @@ Taro.useReachBottom(() => {
.icon { .icon {
display: inline-block; display: inline-block;
font-size: 30px; font-size: 30px;
width: 25px;
height: 25px;
margin-right: 10px;
} }
.desc { .desc {

View File

@@ -9,10 +9,10 @@ defineExpose({
}); });
const props = defineProps({ const props = defineProps({
src: { imgArr: {
required: true, required: true,
type: String, type: Array,
default: '', default: () => [],
}, },
type: Number, type: Number,
cb: { cb: {
@@ -21,13 +21,21 @@ const props = defineProps({
}, },
}); });
const imgs = ref(props.imgArr);
const clickFn = type => { const clickFn = type => {
if (props.cb) props.cb(type); if (props.cb) props.cb(type);
else isShow.value = false; else isShow.value = false;
}; };
const closeFn = () => {
isShow.value = false;
imgs.value.shift(0);
if (imgs.value.length !== 0) isShow.value = true;
};
Taro.useLoad(() => { Taro.useLoad(() => {
if (Taro.getStorageSync('token')) isShow.value = true; isShow.value = true;
}); });
</script> </script>
@@ -40,12 +48,13 @@ Taro.useLoad(() => {
<view @click.stop="clickFn(type)"> <view @click.stop="clickFn(type)">
<image <image
:style="{ :style="{
width: src.naturalWidth, width: imgs[0]?.naturalWidth,
height: src.naturalHeight < 600 ? src.naturalHeight : '480px', height:
imgs[0]?.naturalHeight < 600 ? imgs[0]?.naturalHeight : '480px',
}" }"
:src="src" /> :src="imgs[0]" />
</view> </view>
<view @click.stop="isShow = false"> <view @click.stop="closeFn">
<image class="icon" src="../static/index/close.png" /> <image class="icon" src="../static/index/close.png" />
</view> </view>
</view> </view>

View File

@@ -1,4 +1,4 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: '收益提现', navigationBarTitleText: '余额提现',
enablePullDownRefresh: true, enablePullDownRefresh: true,
}); });

View File

@@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import {ref, h} from 'vue'; import {ref} from 'vue';
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
import {getWithdrawList, addWithdraw} from '@/api/admin'; import {getWithdrawList, addWithdraw} from '@/api/admin';
@@ -81,31 +81,19 @@ const rules = ref({
{ {
message: '请填写提现积分', message: '请填写提现积分',
validator: (value, _) => { validator: (value, _) => {
if (!value) { return value;
return false;
} else {
return true;
}
}, },
}, },
{ {
message: '提现积分最低为100', message: '提现积分最低为100',
validator: (value, _) => { validator: (value, _) => {
if (Number(value) < 100) { return Number(value) >= 100;
return false;
} else {
return true;
}
}, },
}, },
{ {
message: '提现积分不能大于可提现积分', message: '提现积分不能大于可提现积分',
validator: (value, _) => { validator: (value, _) => {
if (Number(value) > row.value) { return Number(value) <= row.value;
return false;
} else {
return true;
}
}, },
}, },
], ],
@@ -144,7 +132,7 @@ Taro.useReachBottom(() => {
<view class="container"> <view class="container">
<view class=""> <view class="">
<view class="font-bold text-[35px]">{{ row }}</view> <view class="font-bold text-[35px]">{{ row }}</view>
<view class="text-[25px] mt-2">可提现积分</view> <view class="text-[25px] mt-2">可提现余额</view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class=""> <view class="">
@@ -164,7 +152,7 @@ Taro.useReachBottom(() => {
</view> </view>
<view class="formCard"> <view class="formCard">
<view class="flex justify-between mb-[25px]"> <view class="flex justify-between mb-[25px]">
<text>积分提现</text> <text>余额提现</text>
<!-- <view class="flex items-center" @click="visible1 = true"> <!-- <view class="flex items-center" @click="visible1 = true">
<image <image
class="w-[26px] h-[26px]" class="w-[26px] h-[26px]"
@@ -177,7 +165,7 @@ Taro.useReachBottom(() => {
<nut-input <nut-input
v-model="basicData.num" v-model="basicData.num"
class="nut-input-text" class="nut-input-text"
placeholder="请输入提现积分" placeholder="请输入提现余额"
type="text"> type="text">
<template #right> <template #right>
<text <text
@@ -221,7 +209,7 @@ Taro.useReachBottom(() => {
</view> </view>
<view> <view>
<view class="mt-3 mb-3 text-[35px]">{{ item.number }}</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" <view class="text-[25px] mb-1"
>信息服务费{{ item.commission }}</view >信息服务费{{ item.commission }}</view
> >

View File

@@ -6,7 +6,7 @@
<nut-checkbox <nut-checkbox
v-model="itm.state.checkbox" v-model="itm.state.checkbox"
:indeterminate="itm.state.indeterminate" :indeterminate="itm.state.indeterminate"
@change="(val: boolean) => changeBoxAll(val,idx)" @change="(val: boolean) => changeBoxAll(val, idx)"
>{{ itm.StoreName }} >{{ itm.StoreName }}
</nut-checkbox> </nut-checkbox>
</nut-cell> </nut-cell>
@@ -187,18 +187,19 @@ const isShowPay = ref(false);
const orderData = ref<any>([]); const orderData = ref<any>([]);
const sub = async () => { const sub = async () => {
const arr: any = list.value.filter(
(item: any) => item.state.checkboxgroup.length > 0,
);
console.log(arr);
if (arr.length === 0) {
Taro.showToast({
title: '请选择商品',
icon: 'none',
});
return;
}
try { try {
console.log('sub');
const arr: any = list.value.filter(
(item: any) => item.state.checkboxgroup.length > 0,
);
console.log(arr);
if (arr.length === 0) {
Taro.showToast({
title: '请选择商品',
icon: 'none',
});
return;
}
const {data: res} = await createActiveOrder({ const {data: res} = await createActiveOrder({
Bid: arr.map((item: any) => item.StoreBid), Bid: arr.map((item: any) => item.StoreBid),
}); });
@@ -212,7 +213,7 @@ const sub = async () => {
} }
} catch (e) { } catch (e) {
Taro.showToast({ Taro.showToast({
title: e.msg, title: e.msg || '订单创建失败',
icon: 'none', icon: 'none',
}); });
} }

View File

@@ -21,12 +21,11 @@
<view class="flex items-center justify-between"> <view class="flex items-center justify-between">
<view class="flex items-center"> <view class="flex items-center">
<nut-price size="large" :price="goodInfo.number"></nut-price> <nut-price size="large" :price="goodInfo.number"></nut-price>
<view class="ml-5 line"></view>
<nut-price <nut-price
class="ml-5" v-if="goodInfo.exchange"
size="large" size="large"
:price="goodInfo.exchange" :price="goodInfo.exchange"
symbol="积分"></nut-price> symbol="+积分"></nut-price>
</view> </view>
<nut-button <nut-button
size="small" size="small"
@@ -38,15 +37,17 @@
</nut-button> </nut-button>
</view> </view>
<view class="flex items-center justify-between mt-3"> <view class="flex items-center justify-between mt-3">
<view class="title text-lg">{{ goodInfo.name }}</view> <view class="title text-[25px]">{{ goodInfo.name }}</view>
<view class="stock text-[#9E9E9E]"> 库存:{{ goodInfo.stock }}</view>
</view> </view>
<view class="stock text-[#9E9E9E] text-[25px] mt-[10px]"
>库存: {{ goodInfo.stock }}</view
>
<view class="line1"></view> <view class="line1"></view>
<view class="sub">{{ goodInfo.profile }}</view> <view class="sub">{{ goodInfo.profile }}</view>
</view> </view>
<!-- 商品详情 --> <!-- 商品详情 -->
<view class="rich-box"> <view class="rich-box">
<view class="title">-----商品详情-----</view> <view class="title">商品详情</view>
<rich-text <rich-text
v-if="goodInfo.details" v-if="goodInfo.details"
class="rich" class="rich"
@@ -64,7 +65,7 @@
import {Ref, ref} from 'vue'; import {Ref, ref} from 'vue';
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
import {Home, Left} from '@nutui/icons-vue-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 Cart from '@/components/Cart.vue';
import {Cart2} from '@nutui/icons-vue-taro'; import {Cart2} from '@nutui/icons-vue-taro';
import {nextTick} from 'vue'; import {nextTick} from 'vue';
@@ -90,14 +91,23 @@ interface GoodInfo {
const goodInfo = ref<GoodInfo>({}); const goodInfo = ref<GoodInfo>({});
const bid = ref('');
Taro.useLoad(async options => { Taro.useLoad(async options => {
await get_good_detail(options.gid); await get_good_detail(options.gid);
mer_info.value = Taro.getStorageSync('mer_info'); bid.value = options.bid;
await getMerInfo();
await nextTick(async () => { 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(() => ({ Taro.useShareAppMessage(() => ({
title: `捷兑通-${goodInfo.value.name}`, title: `捷兑通-${goodInfo.value.name}`,
path: `/pages/goods/goods_detail/index?gid=${goodInfo.value.gid}&type=1`, 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 add_cart = async (item: any) => {
const num = item.cartNum ? Number(item.cartNum) + 1 : 1; const num = item.cartNum ? Number(item.cartNum) + 1 : 1;
await nextTick(async () => { 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; margin: auto;
.sub { .sub {
font-size: 30px; font-size: 25px;
color: #999; color: #999;
} }
} }
@@ -227,7 +237,7 @@ page {
.rich-box { .rich-box {
background-color: #fff; background-color: #fff;
margin-top: 20px; margin-top: 20px;
width: 100vw; //width: 100vw;
box-sizing: border-box; box-sizing: border-box;
text-align: center; text-align: center;
padding: 15px 0; padding: 15px 0;
@@ -239,10 +249,6 @@ page {
font-weight: bold; font-weight: bold;
color: #333; color: #333;
} }
.rich {
width: 100%;
}
} }
.nut-sku { .nut-sku {

View File

@@ -1,3 +1,3 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: '支付订单', navigationBarTitleText: '确认订单',
}); });

View File

@@ -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;
}
}
}
}

View File

@@ -1,17 +1,57 @@
<template> <template>
<view class="flex flex-col items-center justify-center"> <view class="flex flex-col items-center justify-center">
<view class="mt-6 text-[#8C8C8C] text-[25px]" <!-- <view class="mt-6 text-[#8C8C8C] text-[25px]"-->
>交易剩余时间{{ tStr }} <!-- >交易剩余时间{{ tStr }}-->
</view> <!-- </view>-->
<view class="flex items-center mt-5 mb-5"> <!-- <view class="flex items-center mt-5 mb-5">-->
<nut-price :price="a" size="large" /> <!-- <nut-price :price="a" size="large" />-->
<view class="line"></view> <!-- <view class="line"></view>-->
<nut-price position="after" symbol="积分" :price="b" size="large" /> <!-- <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> </view>
<!-- {{ payVal }} --> <!-- {{ payVal }} -->
<nut-radio-group class="w-[95%]" v-model="payVal"> <nut-radio-group class="w-[95%]" v-model="payVal">
<nut-cell-group class="w-full"> <nut-cell-group class="w-full">
<nut-cell class="text-[#333333]" title="支付方式"></nut-cell> <nut-cell class="text-[#333333]" title="选择积分抵扣"></nut-cell>
<nut-cell <nut-cell
v-for="(item, index) in payList" v-for="(item, index) in payList"
:key="index" :key="index"
@@ -26,34 +66,6 @@
<nut-radio :label="item.ID"></nut-radio> <nut-radio :label="item.ID"></nut-radio>
</template> </template>
</nut-cell> </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-cell-group>
</nut-radio-group> </nut-radio-group>
<view class="w-[90%] mt-[100px]"> <view class="w-[90%] mt-[100px]">
@@ -66,36 +78,6 @@
>确认支付 >确认支付
</nut-button> </nut-button>
</view> </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> </view>
</template> </template>
@@ -103,10 +85,9 @@
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
import {IconFont} from '@nutui/icons-vue-taro'; import {IconFont} from '@nutui/icons-vue-taro';
import {onUnmounted, ref} from 'vue'; import {onUnmounted, ref} from 'vue';
import {getActiveOrderDetail, checkTradePwd, getPayList} from '@/api/goods'; import {getActiveOrderDetail, getPayList} from '@/api/goods';
import {getUserPoint} from '@/api/admin'; import {getUserPoint} from '@/api/admin';
import {payOrder} from '@/api/order'; import {payOrder} from '@/api/order';
import {isCheckTradePwd} from '@/api/user';
import * as dayjs from 'dayjs'; import * as dayjs from 'dayjs';
const payVal = ref(); const payVal = ref();
@@ -115,20 +96,10 @@ const t_id = ref();
const tStr = ref('00:00'); const tStr = ref('00:00');
const error_msg = ref('');
const shortVal = ref('');
const orderData = ref<any>({}); const orderData = ref<any>({});
const visible = ref(false);
const showKeyboard = ref(false);
const isLoading = ref(false); const isLoading = ref(false);
const visible2 = ref(false);
const opt = ref<any>({}); const opt = ref<any>({});
Taro.useLoad(e => { Taro.useLoad(e => {
@@ -145,8 +116,8 @@ const payList = ref<any>([]);
const get_pay_list = async () => { const get_pay_list = async () => {
const res = await getPayList({}); const res = await getPayList({});
// console.log(res);
payList.value = res.data.data || []; payList.value = res.data.data || [];
payVal.value = payList.value[0].ID;
}; };
const getData = async (oid: string, bid: string, OrderType: number) => { 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, phone: user_info.data.phone,
bid, bid,
}); });
const res = await getActiveOrderDetail({ const res = await getActiveOrderDetail({
oid, oid,
OrderType: Number(OrderType), OrderType: Number(OrderType),
@@ -173,10 +145,9 @@ const getData = async (oid: string, bid: string, OrderType: number) => {
res.data.data.forEach(item => { res.data.data.forEach(item => {
a.value += item.price; a.value += item.price;
b.value += item.exchange; b.value += item.discount_integral;
}); });
// console.log(orderData.value);
if (!orderData.value.oid) if (!orderData.value.oid)
return Taro.showToast({ return Taro.showToast({
title: '未获取到订单信息~', title: '未获取到订单信息~',
@@ -190,100 +161,51 @@ const pay = async () => {
isLoading.value = true; isLoading.value = true;
if (!payVal.value) if (!payVal.value)
return Taro.showToast({title: '请选择支付方式', icon: 'none'}); return Taro.showToast({title: '请选择支付方式', icon: 'none'});
if (payVal.value !== 1) {
const res = await isCheckTradePwd(); await confirmPay();
if (res.data.pay_password) {
visible.value = true;
showKeyboard.value = true;
} else {
isLoading.value = false;
visible2.value = true;
}
} else {
await confirmPay();
}
} catch (error) { } catch (error) {
isLoading.value = false;
Taro.showToast({ Taro.showToast({
title: error.msg, title: error.msg,
icon: 'none', icon: 'none',
}); });
} } finally {
}; isLoading.value = false;
const shortComplete = async value => {
try {
await checkTradePwd({
pay_password: value,
});
shortClose(false);
await confirmPay();
} catch (error) {
error_msg.value = error.msg;
shortVal.value = '';
} }
}; };
const confirmPay = async () => { const confirmPay = async () => {
try { try {
const res = await payOrder({ const res = await payOrder({
// oid: opt.value.oid.map(item => item.oid),
oid: opt.value.oid, oid: opt.value.oid,
OrderType: payVal.value, OrderType: payVal.value,
PayType: payVal.value, PayType: payVal.value,
}); });
switch (payVal.value) { Taro.requestPayment({
case 1: timeStamp: res.data.data.timeStamp,
if (typeof res.data.data === 'object') { nonceStr: res.data.data.nonceStr,
Taro.requestPayment({ package: res.data.data.package,
timeStamp: res.data.data.timeStamp, signType: res.data.data.signType,
nonceStr: res.data.data.nonceStr, paySign: res.data.data.paySign,
package: res.data.data.package, success: function () {
signType: res.data.data.signType,
paySign: res.data.data.paySign,
success: function () {
Taro.showToast({
title: '支付成功',
icon: 'success',
});
},
fail: function () {
Taro.showToast({
title: '支付失败',
icon: 'none',
});
},
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({ Taro.showToast({
title: res.msg, title: '支付成功',
icon: 'success',
});
},
fail: function () {
Taro.showToast({
title: '支付失败',
icon: 'none', icon: 'none',
}); });
},
complete: function () {
setTimeout(() => { setTimeout(() => {
// Taro.redirectTo({
// url: `/pages/users/order_list_detail/index?orderId=${opt.value.oid}&OrderType=1`,
// });
Taro.redirectTo({ Taro.redirectTo({
url: `/pages/users/order_list/index?type=0`, url: `/pages/users/order_list/index?type=0`,
}); });
}, 2000); }, 2000);
break; },
} });
isLoading.value = false; isLoading.value = false;
} catch (err) { } catch (err) {
isLoading.value = false; 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) => { const cellClick = (val: number) => {
payVal.value = val; payVal.value = val;
}; };
@@ -317,12 +230,6 @@ const countdownTime = () => {
}, 1000); }, 1000);
}; };
const onTips = () => {
Taro.redirectTo({
url: '/pages/users/pwd/index',
});
};
Taro.useDidHide(() => { Taro.useDidHide(() => {
clearInterval(t_id.value); clearInterval(t_id.value);
}); });

View File

@@ -48,7 +48,7 @@
hover-class="none"> hover-class="none">
</navigator> </navigator>
<MerList :get-user-location="getUserLocal" /> <MerList :get-user-location="getUserLocal" />
<Popup :src="require('../../static/popTip.png')" /> <Popup :imgArr="imgList" />
</view> </view>
</template> </template>
@@ -72,6 +72,11 @@ interface navigationType {
const navigationList = ref<Array<navigationType>>([]); const navigationList = ref<Array<navigationType>>([]);
const imgList = ref([
require('../../static/popTip.png'),
require('../../static/popTip2.png'),
]);
Taro.useShareAppMessage(() => ({ Taro.useShareAppMessage(() => ({
title: '捷兑通', title: '捷兑通',
path: `/pages/index/index?scene=${Taro.getStorageSync('token')}`, path: `/pages/index/index?scene=${Taro.getStorageSync('token')}`,

View File

@@ -29,8 +29,8 @@
v-model="mer_info.rate" /> v-model="mer_info.rate" />
<view class="text-[#9E9E9E] text-[25px]">销量10000</view> <view class="text-[#9E9E9E] text-[25px]">销量10000</view>
<view class="text-[#9E9E9E] text-[25px]" <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>
<view class="line"></view> <view class="line"></view>
<view class="bom"> <view class="bom">
@@ -86,17 +86,21 @@
<image :src="item.cover" lazy-load /> <image :src="item.cover" lazy-load />
<view class="right"> <view class="right">
<view class="name">{{ item.name }}</view> <view class="name">{{ item.name }}</view>
<view class="stock text-[25px]">剩余:{{ item.stock }}</view> <view class="bom">
<view class="price">
<text style="font-size: 15px"
>{{ item.number }}
<text style="font-size: 15px" v-if="item.exchange"
>+{{ item.exchange }}积分
</text>
</text>
</view>
</view>
<view class="bom"> <view class="bom">
<view> <view>
<view class="price"> <view class="stock text-[25px]"
<text style="font-size: 15px">{{ item.number }}</text> >剩余:{{ item.stock }}</view
</view> >
<view class="price">
<text style="font-size: 15px"
>{{ item.exchange }}积分</text
>
</view>
</view> </view>
<view class="flex items-center justify-between"> <view class="flex items-center justify-between">
<view <view
@@ -156,7 +160,7 @@ Taro.useLoad(opt => {
bid.value = opt.bid; bid.value = opt.bid;
}); });
Taro.useDidShow(opt => { Taro.useDidShow(() => {
if (!Taro.getStorageSync('token')) { if (!Taro.getStorageSync('token')) {
Taro.navigateTo({ Taro.navigateTo({
url: '/pages/users/login/index?isBack=1', url: '/pages/users/login/index?isBack=1',
@@ -265,7 +269,7 @@ const get_good_list = async (id: number) => {
const toGoodDetails = (id: string, type: number) => { const toGoodDetails = (id: string, type: number) => {
Taro.navigateTo({ 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}`,
}); });
}; };

View File

@@ -154,7 +154,7 @@
<IconFont <IconFont
size="42" size="42"
name="http://p0.meituan.net/csc/bd9aca457a109b4d69a692a9109a73ed9045.png"></IconFont> name="http://p0.meituan.net/csc/bd9aca457a109b4d69a692a9109a73ed9045.png"></IconFont>
<view class="label">订单统计</view> <view class="label">订单管理</view>
</view> </view>
<view <view
v-if="userInfo.data.permission.tx" v-if="userInfo.data.permission.tx"
@@ -163,7 +163,7 @@
<IconFont <IconFont
size="42" size="42"
name="http://p0.meituan.net/csc/f85d7dc1bf9eda8977e9089b260a586b7440.png"></IconFont> name="http://p0.meituan.net/csc/f85d7dc1bf9eda8977e9089b260a586b7440.png"></IconFont>
<view class="label">收益提现</view> <view class="label">余额提现</view>
</view> </view>
</view> </view>
</view> </view>

View File

@@ -4,7 +4,6 @@ import Taro from '@tarojs/taro';
import Pay from '@/components/Pay.vue'; import Pay from '@/components/Pay.vue';
import {getActiveOrderList, deleteActiveOrder} from '@/api/goods'; import {getActiveOrderList, deleteActiveOrder} from '@/api/goods';
import {getOrderStatistics} from '@/api/order'; import {getOrderStatistics} from '@/api/order';
import {getUserPoint} from '@/api/admin';
import UQRCode from 'uqrcodejs'; import UQRCode from 'uqrcodejs';
const tabValue = ref(0); const tabValue = ref(0);
@@ -58,6 +57,8 @@ interface OrderList {
price: number; price: number;
joint_oid: string; joint_oid: string;
bid: string; bid: string;
discount_price: number;
discount_integral: number;
} }
interface GoodsItem { interface GoodsItem {
@@ -169,35 +170,6 @@ const delOrder = async (oid: string) => {
await getList(); 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 t_id = ref();
const openCode = item => { const openCode = item => {
@@ -272,8 +244,8 @@ const closed = () => {
:style="{ :style="{
color: tabValue === item.value ? '#000' : '#9C9C9C', color: tabValue === item.value ? '#000' : '#9C9C9C',
}" }"
>{{ item.title }}</view >{{ item.title }}
> </view>
<!-- <view>{{ item.num }}</view> --> <!-- <view>{{ item.num }}</view> -->
<view class="line" :class="{lineColor: item.value === tabValue}"></view> <view class="line" :class="{lineColor: item.value === tabValue}"></view>
</view> </view>
@@ -315,8 +287,12 @@ const closed = () => {
<view class="flex flex-col justify-between flex-1"> <view class="flex flex-col justify-between flex-1">
<view class="title">{{ itm.Goods?.name }}</view> <view class="title">{{ itm.Goods?.name }}</view>
<view class="text-[#F83D3D] mt-5"> <view class="text-[#F83D3D] mt-5">
<view>{{ itm.pay_price }}</view> <view
<view>{{ itm.pay_integral }}积分</view> >{{ itm.pay_price }}
<text v-if="itm.pay_integral > 0"
>+{{ itm.pay_integral }}积分</text
>
</view>
</view> </view>
</view> </view>
<view class="right"> <view class="right">
@@ -330,13 +306,15 @@ const closed = () => {
v-if="item.status !== 0" v-if="item.status !== 0"
style="text-align: right"> style="text-align: right">
<text class="text-[#9C9C9C] text-[28px]" <text class="text-[#9C9C9C] text-[28px]"
>{{ item.count }}件商品</text >{{ item.count }}件商品
> </text>
<text class="text-[26px]" <text class="text-[26px]"
>{{ item.status !== 0 ? '实' : '应' }}付款{{ >{{ item.status !== 0 ? '实' : '应' }}付款:
item.pay_type === 1 ? '(元): ' : '(积分): ' {{ item.discount_price }}()
}}{{ item.pay_type === 1 ? item.price : item.exchange }}</text <text v-if="item.exchange > 0"
> >积分抵扣: {{ item.exchange }}</text
>
</text>
<!-- <view class="line"></view> --> <!-- <view class="line"></view> -->
</view> </view>
<view class="btn"> <view class="btn">

View File

@@ -28,9 +28,10 @@
<IconFont name="rect-right" size="15" color="#333333"></IconFont> <IconFont name="rect-right" size="15" color="#333333"></IconFont>
</view> </view>
<view class="text-[#9C9C9C] text-[20px]" <view class="text-[#9C9C9C] text-[20px]"
>订单剩余<text class="text-[#FF0000]">{{ timeStr }}</text >订单剩余
>过期请尽快核销</view <text class="text-[#FF0000]">{{ timeStr }} </text>
> 过期请尽快核销
</view>
</view> </view>
<view v-if="goodInfo.status === 2"> <view v-if="goodInfo.status === 2">
<view class="flex text-[#333333] items-center mb-1"> <view class="flex text-[#333333] items-center mb-1">
@@ -99,8 +100,12 @@
<view class="flex flex-col justify-between flex-1"> <view class="flex flex-col justify-between flex-1">
<view class="title">{{ item.Goods?.name }}</view> <view class="title">{{ item.Goods?.name }}</view>
<view class="text-[#F83D3D] mt-5"> <view class="text-[#F83D3D] mt-5">
<view>{{ item.pay_price }}</view> <view
<view>{{ item.pay_integral }}积分</view> >{{ item.pay_price }}
<text v-if="item.pay_integral > 0"
>+{{ item.pay_integral }}积分</text
>
</view>
</view> </view>
</view> </view>
<view class="right"> <view class="right">
@@ -109,16 +114,16 @@
</view> </view>
<view <view
class="flex justify-between items-center mt-2 mb-2 text-[25px]"> class="flex justify-between items-center mt-2 mb-2 text-[25px]">
<view class="text-[#9C9C9C]">{{ <view class="text-[#9C9C9C]"
`${goodInfo.count}件商品` >{{ `${goodInfo.count}件商品` }}
}}</view> </view>
<text <text class="text-[26px]"
>{{ goodInfo.status !== 0 ? '实' : '应' }}付款{{ >{{ goodInfo.status !== 0 ? '实' : '应' }}付款:
goodInfo.pay_type === 1 ? '(元): ' : '(积分): ' {{ goodInfo.discount_price }}()
}}{{ <text v-if="goodInfo.exchange > 0"
goodInfo.pay_type === 1 ? goodInfo.price : goodInfo.exchange >积分抵扣: {{ goodInfo.exchange }}</text
}}</text >
> </text>
</view> </view>
</view> </view>
</template> </template>
@@ -155,16 +160,16 @@
type="primary" type="primary"
block block
@click="openPay()" @click="openPay()"
>继续付款</nut-button >继续付款
> </nut-button>
<nut-button <nut-button
v-if="goodInfo.status === 1" v-if="goodInfo.status === 1"
shape="square" shape="square"
type="primary" type="primary"
block block
@click="openCode()" @click="openCode()"
>出示核销码</nut-button >出示核销码
> </nut-button>
</view> </view>
<!-- <view class="btn"> <!-- <view class="btn">
@@ -231,7 +236,6 @@ import {onUnmounted, ref} from 'vue';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import duration from 'dayjs/plugin/duration'; import duration from 'dayjs/plugin/duration';
import Pay from '@/components/Pay.vue'; import Pay from '@/components/Pay.vue';
import {getUserPoint} from '@/api/admin';
import {calculateDistance} from '@/utils'; import {calculateDistance} from '@/utils';
import {IconFont} from '@nutui/icons-vue-taro'; import {IconFont} from '@nutui/icons-vue-taro';
import {getActiveOrderDetail} from '@/api/goods'; import {getActiveOrderDetail} from '@/api/goods';

BIN
src/static/popTip2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB