Merge branch 'test'
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-09-06 21:39:16 +08:00
34 changed files with 558 additions and 1013 deletions

5
.idea/.gitignore generated vendored
View File

@@ -1,5 +0,0 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/

View File

@@ -1,57 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<HTMLCodeStyleSettings>
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
</HTMLCodeStyleSettings>
<JSCodeStyleSettings version="0">
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
<option name="USE_DOUBLE_QUOTES" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
<option name="SPACES_WITHIN_OBJECT_TYPE_BRACES" value="false" />
</JSCodeStyleSettings>
<TypeScriptCodeStyleSettings version="0">
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
<option name="USE_DOUBLE_QUOTES" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
<option name="SPACES_WITHIN_OBJECT_TYPE_BRACES" value="false" />
</TypeScriptCodeStyleSettings>
<VueCodeStyleSettings>
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
</VueCodeStyleSettings>
<codeStyleSettings language="HTML">
<option name="SOFT_MARGINS" value="80" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="SOFT_MARGINS" value="80" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="TypeScript">
<option name="SOFT_MARGINS" value="80" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="Vue">
<option name="SOFT_MARGINS" value="80" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</component>

View File

@@ -1,5 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GitToolBoxBlameSettings">
<option name="version" value="2" />
</component>
</project>

View File

@@ -1,7 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="Stylelint" enabled="true" level="ERROR" enabled_by_default="true" />
</profile>
</component>

12
.idea/jdt-user.iml generated
View File

@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

8
.idea/modules.xml generated
View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/jdt-user.iml" filepath="$PROJECT_DIR$/.idea/jdt-user.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml generated
View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectTasksOptions" suppressed-tasks="SCSS" />
</project>

98
components.d.ts vendored
View File

@@ -1,59 +1,57 @@
// generated by unplugin-vue-components // generated by unplugin-vue-components
// We suggest you to commit this file into source control // We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399 // Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'; import '@vue/runtime-core'
export {}; export {}
declare module '@vue/runtime-core' { declare module '@vue/runtime-core' {
export interface GlobalComponents { export interface GlobalComponents {
Auth: typeof import('./src/components/Auth.vue')['default']; Auth: typeof import('./src/components/Auth.vue')['default']
Back: typeof import('./src/components/Back.vue')['default']; Back: typeof import('./src/components/Back.vue')['default']
Cart: typeof import('./src/components/Cart.vue')['default']; Cart: typeof import('./src/components/Cart.vue')['default']
MerList: typeof import('./src/components/MerList.vue')['default']; MerList: typeof import('./src/components/MerList.vue')['default']
NutAvatar: typeof import('@nutui/nutui-taro')['Avatar']; NutAvatar: typeof import('@nutui/nutui-taro')['Avatar']
NutBacktop: typeof import('@nutui/nutui-taro')['Backtop']; NutBacktop: typeof import('@nutui/nutui-taro')['Backtop']
NutButton: typeof import('@nutui/nutui-taro')['Button']; NutButton: typeof import('@nutui/nutui-taro')['Button']
NutCalendar: typeof import('@nutui/nutui-taro')['Calendar']; NutCalendar: typeof import('@nutui/nutui-taro')['Calendar']
NutCell: typeof import('@nutui/nutui-taro')['Cell']; NutCell: typeof import('@nutui/nutui-taro')['Cell']
NutCellGroup: typeof import('@nutui/nutui-taro')['CellGroup']; NutCellGroup: typeof import('@nutui/nutui-taro')['CellGroup']
NutCheckbox: typeof import('@nutui/nutui-taro')['Checkbox']; NutCheckbox: typeof import('@nutui/nutui-taro')['Checkbox']
NutCheckboxGroup: typeof import('@nutui/nutui-taro')['CheckboxGroup']; NutCheckboxGroup: typeof import('@nutui/nutui-taro')['CheckboxGroup']
NutDialog: typeof import('@nutui/nutui-taro')['Dialog']; NutDialog: typeof import('@nutui/nutui-taro')['Dialog']
NutEllipsis: typeof import('@nutui/nutui-taro')['Ellipsis']; NutEllipsis: typeof import('@nutui/nutui-taro')['Ellipsis']
NutEmpty: typeof import('@nutui/nutui-taro')['Empty']; NutEmpty: typeof import('@nutui/nutui-taro')['Empty']
NutForm: typeof import('@nutui/nutui-taro')['Form']; NutForm: typeof import('@nutui/nutui-taro')['Form']
NutFormItem: typeof import('@nutui/nutui-taro')['FormItem']; NutFormItem: typeof import('@nutui/nutui-taro')['FormItem']
NutGrid: typeof import('@nutui/nutui-taro')['Grid']; NutGrid: typeof import('@nutui/nutui-taro')['Grid']
NutGridItem: typeof import('@nutui/nutui-taro')['GridItem']; NutGridItem: typeof import('@nutui/nutui-taro')['GridItem']
NutImagePreview: typeof import('@nutui/nutui-taro')['ImagePreview']; NutImagePreview: typeof import('@nutui/nutui-taro')['ImagePreview']
NutInput: typeof import('@nutui/nutui-taro')['Input']; NutInput: typeof import('@nutui/nutui-taro')['Input']
NutInputNumber: typeof import('@nutui/nutui-taro')['InputNumber']; NutInputNumber: typeof import('@nutui/nutui-taro')['InputNumber']
NutNumberKeyboard: typeof import('@nutui/nutui-taro')['NumberKeyboard']; NutOverlay: typeof import('@nutui/nutui-taro')['Overlay']
NutOverlay: typeof import('@nutui/nutui-taro')['Overlay']; NutPagination: typeof import('@nutui/nutui-taro')['Pagination']
NutPagination: typeof import('@nutui/nutui-taro')['Pagination']; NutPicker: typeof import('@nutui/nutui-taro')['Picker']
NutPicker: typeof import('@nutui/nutui-taro')['Picker']; NutPopover: typeof import('@nutui/nutui-taro')['Popover']
NutPopover: typeof import('@nutui/nutui-taro')['Popover']; NutPopup: typeof import('@nutui/nutui-taro')['Popup']
NutPopup: typeof import('@nutui/nutui-taro')['Popup']; NutPrice: typeof import('@nutui/nutui-taro')['Price']
NutPrice: typeof import('@nutui/nutui-taro')['Price']; NutRadio: typeof import('@nutui/nutui-taro')['Radio']
NutRadio: typeof import('@nutui/nutui-taro')['Radio']; NutRadioGroup: typeof import('@nutui/nutui-taro')['RadioGroup']
NutRadioGroup: typeof import('@nutui/nutui-taro')['RadioGroup']; NutRate: typeof import('@nutui/nutui-taro')['Rate']
NutRate: typeof import('@nutui/nutui-taro')['Rate']; NutSwiper: typeof import('@nutui/nutui-taro')['Swiper']
NutShortPassword: typeof import('@nutui/nutui-taro')['ShortPassword']; NutSwiperItem: typeof import('@nutui/nutui-taro')['SwiperItem']
NutSwiper: typeof import('@nutui/nutui-taro')['Swiper']; NutSwitch: typeof import('@nutui/nutui-taro')['Switch']
NutSwiperItem: typeof import('@nutui/nutui-taro')['SwiperItem']; NutTable: typeof import('@nutui/nutui-taro')['Table']
NutSwitch: typeof import('@nutui/nutui-taro')['Switch']; NutTabPane: typeof import('@nutui/nutui-taro')['TabPane']
NutTable: typeof import('@nutui/nutui-taro')['Table']; NutTabs: typeof import('@nutui/nutui-taro')['Tabs']
NutTabPane: typeof import('@nutui/nutui-taro')['TabPane']; NutTextarea: typeof import('@nutui/nutui-taro')['Textarea']
NutTabs: typeof import('@nutui/nutui-taro')['Tabs']; NutUploader: typeof import('@nutui/nutui-taro')['Uploader']
NutTextarea: typeof import('@nutui/nutui-taro')['Textarea']; Pay: typeof import('./src/components/Pay.vue')['default']
NutUploader: typeof import('@nutui/nutui-taro')['Uploader']; Popup: typeof import('./src/components/Popup.vue')['default']
Pay: typeof import('./src/components/Pay.vue')['default']; RichEditor: typeof import('./src/components/RichEditor.vue')['default']
Popup: typeof import('./src/components/Popup.vue')['default']; StoreList: typeof import('./src/components/StoreList.vue')['default']
RichEditor: typeof import('./src/components/RichEditor.vue')['default']; Ucharts: typeof import('./src/components/Ucharts.vue')['default']
StoreList: typeof import('./src/components/StoreList.vue')['default']; Upload: typeof import('./src/components/Upload.vue')['default']
Ucharts: typeof import('./src/components/Ucharts.vue')['default']; UserModal: typeof import('./src/components/UserModal.vue')['default']
Upload: typeof import('./src/components/Upload.vue')['default'];
UserModal: typeof import('./src/components/UserModal.vue')['default'];
} }
} }

View File

@@ -38,7 +38,7 @@ const config = {
375: 2, 375: 2,
}, },
sourceRoot: 'src', sourceRoot: 'src',
outputRoot: 'dist', outputRoot: `dist/${process.env.TARO_ENV}`,
plugins: ['@tarojs/plugin-html', ['@tarojs/plugin-mini-ci', CIPluginOptFn]], plugins: ['@tarojs/plugin-html', ['@tarojs/plugin-mini-ci', CIPluginOptFn]],
defineConstants: {}, defineConstants: {},
copy: { copy: {

View File

@@ -1,6 +1,6 @@
{ {
"name": "jdt-user", "name": "jdt-user",
"version": "4.0.4", "version": "4.0.5",
"private": true, "private": true,
"description": "", "description": "",
"templateInfo": { "templateInfo": {
@@ -9,7 +9,7 @@
"css": "sass" "css": "sass"
}, },
"taroConfig": { "taroConfig": {
"version": "4.0.4" "version": "4.0.5"
}, },
"scripts": { "scripts": {
"build:weapp": "taro build --type weapp", "build:weapp": "taro build --type weapp",

View File

@@ -1,14 +1,14 @@
{ {
"miniprogramRoot": "./dist", "miniprogramRoot": "./dist",
"projectname": "taroApp", "projectname": "捷兑通",
"description": "", "description": "",
"setting": { "setting": {
"urlCheck": true, "urlCheck": true,
"es6": false, "es6": true,
"enhance": false, "enhance": true,
"compileHotReLoad": false, "compileHotReLoad": false,
"postcss": false, "postcss": true,
"minified": false "minified": true
}, },
"compileType": "miniprogram" "compileType": "miniprogram"
} }

View File

@@ -1,10 +1,10 @@
<script setup lang="ts"> <script setup lang="ts">
import {ref} from 'vue'; import { ref } from 'vue';
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
import {addCart, getCart, clearCart} from '@/api/cart'; import { addCart, getCart, clearCart } from '@/api/cart';
import {Plus, Minus} from '@nutui/icons-vue-taro'; import { Plus, Minus } from '@nutui/icons-vue-taro';
import {createActiveOrder} from '@/api/goods'; import { createActiveOrder } from '@/api/goods';
import {createAfterOrder, getUserPoint} from '@/api/admin'; import { createAfterOrder, getUserPoint } from '@/api/admin';
import Pay from '@/components/Pay.vue'; import Pay from '@/components/Pay.vue';
interface CardList { interface CardList {
@@ -13,8 +13,10 @@ interface CardList {
bid: string; bid: string;
gid: string; gid: string;
number: string; number: string;
discount_price: string;
price: number; price: number;
exchange: number; exchange: number;
discount_integral: number;
} }
const show = ref(false); const show = ref(false);
@@ -38,7 +40,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 +55,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,
@@ -72,25 +78,29 @@ const card_list = ref<CardList[]>([]);
const cartInfo = ref({ const cartInfo = ref({
count: 0, count: 0,
price: 0, price: 0,
discount_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 || [];
cartInfo.value = { cartInfo.value = {
count: 0, count: 0,
price: 0, price: 0,
discount_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.discount_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 +152,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 +168,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`,
}); });
} }
} }
@@ -192,39 +201,28 @@ defineExpose({
<view class="container flex items-center"> <view class="container flex items-center">
<!-- <view>购物车数量: {{ cartInfo.count }}</view> --> <!-- <view>购物车数量: {{ cartInfo.count }}</view> -->
<view class="cardImg"> <view class="cardImg">
<image <image src="http://p1.meituan.net/csc/929f447a96a44b09a09b2e0055433222717.png">
src="http://p1.meituan.net/csc/929f447a96a44b09a09b2e0055433222717.png">
</image> </image>
<view class="count-text" v-if="cartInfo.count > 0"> <view class="count-text" v-if="cartInfo.count > 0">
<text>{{ cartInfo.count }}</text> <text>{{ cartInfo.count }}</text>
</view> </view>
</view> </view>
<view class="ml-1"> <view class="ml-1 text-[28px]">
<text>总金额: {{ cartInfo.price.toFixed(2) }}</text> <text>总金额: {{ cartInfo.discount_price.toFixed(2) }}</text>
<text v-if="!IsPendingOrder" <text v-if="!IsPendingOrder">积分抵扣: {{ cartInfo.discount_integral.toFixed(2) }}
>总积分: {{ cartInfo.exchange.toFixed(2) }}</text </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 :style="{ padding: '15px' }" round position="bottom" z-index="1" :catch-move="true"
:style="{padding: '15px'}" :safe-area-inset-bottom="true" v-model:visible="show">
round
position="bottom"
z-index="1"
:catch-move="true"
:safe-area-inset-bottom="true"
v-model:visible="show">
<view class="list-header"> <view class="list-header">
<view class="left" @click.stop="clear_cart"> <view class="left" @click.stop="clear_cart">
<!-- <Del2 color="#666666" /> --> <!-- <Del2 color="#666666" /> -->
<image <image class="w-[20px] h-[20px]" src="http://p0.meituan.net/csc/db4d11fd744b69435c6ffdc6bfc868c5684.png" />
class="w-[20px] h-[20px]"
src="http://p0.meituan.net/csc/db4d11fd744b69435c6ffdc6bfc868c5684.png" />
<text class="text-[20px]" style="color: #666666">清空购物车</text> <text class="text-[20px]" style="color: #666666">清空购物车</text>
</view> </view>
</view> </view>
@@ -237,15 +235,11 @@ defineExpose({
<view class="price flex"> <view class="price flex">
<view>现金:{{ item.price }}</view> <view>现金:{{ item.price }}</view>
<view class="ml-2">积分:{{ item.exchange }}</view> <view v-if="item.discount_integral > 0" class="ml-2">积分:{{ item.discount_integral }}</view>
</view> </view>
</view> </view>
</view> </view>
<nut-input-number <nut-input-number v-model="item.number" readonly :min="-1" @add="() => onAdd(item)"
v-model="item.number"
readonly
:min="-1"
@add="() => onAdd(item)"
@reduce="() => onReduce(item)"> @reduce="() => onReduce(item)">
<template #left-icon> <template #left-icon>
<view class="btn" @click.stop="onReduce(item)"> <view class="btn" @click.stop="onReduce(item)">
@@ -263,11 +257,7 @@ defineExpose({
<view style="height: 140px"></view> <view style="height: 140px"></view>
</nut-popup> </nut-popup>
<!-- 支付 --> <!-- 支付 -->
<Pay <Pay :is-show-pay="isShowPay" v-model:jfInfo="orderData" @closePay="closePay" @successPay="closePay" />
:is-show-pay="isShowPay"
v-model:jfInfo="orderData"
@closePay="closePay"
@successPay="closePay" />
</view> </view>
</template> </template>
@@ -295,10 +285,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 +302,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

@@ -2,19 +2,9 @@
<view> <view>
<!-- 商品列表 --> <!-- 商品列表 -->
<view class="good-class" v-if="class_list.length > 0"> <view class="good-class" v-if="class_list.length > 0">
<nut-tabs <nut-tabs v-model="value" title-scroll size="large" direction="vertical" title-gutter="5" animated-time="0"
v-model="value"
title-scroll
size="large"
direction="vertical"
title-gutter="5"
animated-time="0"
name="tabName"> name="tabName">
<nut-tab-pane <nut-tab-pane v-for="(itm, index) in good_list" :key="index" :title="itm.name" :pane-key="index">
v-for="(itm, index) in good_list"
:key="index"
:title="itm.name"
:pane-key="index">
<view v-if="itm.Goods.length > 0"> <view v-if="itm.Goods.length > 0">
<view class="list" v-for="(item, index) in itm.Goods" :key="index"> <view class="list" v-for="(item, index) in itm.Goods" :key="index">
<view class="item" @click.stop="toGoodDetails(item.gid, 1)"> <view class="item" @click.stop="toGoodDetails(item.gid, 1)">
@@ -27,16 +17,13 @@
<view class="price"> <view class="price">
<text style="font-size: 15px">{{ item.number }}</text> <text style="font-size: 15px">{{ item.number }}</text>
</view> </view>
<view class="price"> <!-- <view class="price">
<text style="font-size: 15px" <text style="font-size: 15px"
>{{ item.exchange }}积分</text >{{ item.exchange }}积分</text
> >
</view> -->
</view> </view>
</view> <nut-button size="mini" type="primary" @click.stop="add_cart(item)">
<nut-button
size="mini"
type="primary"
@click.stop="add_cart(item)">
<template #icon> <template #icon>
<Cart2 /> <Cart2 />
</template> </template>
@@ -53,20 +40,16 @@
</view> </view>
<nut-empty v-else description="该商家暂无商品"></nut-empty> <nut-empty v-else description="该商家暂无商品"></nut-empty>
<!-- 购物车 --> <!-- 购物车 -->
<cart <cart ref="cartRef" :mer-info="mer_info" @update-cart="updateCartNum" :IsPendingOrder="true" />
ref="cartRef"
:mer-info="mer_info"
@update-cart="updateCartNum"
:IsPendingOrder="true" />
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {Ref, ref} from 'vue'; import { Ref, ref } from 'vue';
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
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 {getGoodList, getMerCategory} from '../../../../api/goods'; import { getGoodList, getMerCategory } from '../../../../api/goods';
interface goodList { interface goodList {
ID: number; ID: number;

View File

@@ -5,30 +5,26 @@
<nut-cell> <nut-cell>
<template #default> <template #default>
<view class="center-box"> <view class="center-box">
<view <view class="top" v-for="(item, index) in info.OrderGoods" :key="index">
class="top"
v-for="(item, index) in info.OrderGoods"
:key="index">
<image class="mr-10" :src="item.Goods?.cover" /> <image class="mr-10" :src="item.Goods?.cover" />
<view class="flex-1"> <view class="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>{{ item.pay_price }}
<view>{{ item.pay_integral }}积分</view> <text v-if="item.pay_integral > 0">+{{ item.pay_integral }}积分</text>
</view>
</view> </view>
</view> </view>
<view class="right"> <view class="right">
<view>x{{ item.number }}</view> <view>x{{ item.number }}</view>
</view> </view>
</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]">{{ `${info.count}件商品` }}</view> <view class="text-[#9C9C9C]">{{ `${info.count}件商品` }}</view>
<view <text class="text-[26px] flex-1 text-right">{{ info.status !== 0 ? '实' : '应' }}付款:
>{{ info.status !== 0 ? '实' : '应' }}付款{{ {{ info.discount_price }} ()
info.pay_type === 1 ? '(元): ' : '(积分): ' <text v-if="info.exchange > 0">积分抵扣: {{ info.exchange }}</text>
}}{{ info.pay_type === 1 ? info.price : info.exchange }}</view </text>
>
</view> </view>
</view> </view>
</template> </template>
@@ -36,10 +32,7 @@
</nut-cell-group> </nut-cell-group>
<nut-cell-group> <nut-cell-group>
<nut-cell title="订单号:" :desc="info.oid"></nut-cell> <nut-cell title="订单号:" :desc="info.oid"></nut-cell>
<nut-cell <nut-cell title="订单状态:" :desc="info.status === 0
title="订单状态:"
:desc="
info.status === 0
? '待付款' ? '待付款'
: info.status === 1 : info.status === 1
? '待使用' ? '待使用'
@@ -51,25 +44,16 @@
<nut-cell title="下单用户:" :desc="info.User?.nickName"></nut-cell> <nut-cell title="下单用户:" :desc="info.User?.nickName"></nut-cell>
<nut-cell title="用户手机号:" :desc="info.User?.phone"></nut-cell> <nut-cell title="用户手机号:" :desc="info.User?.phone"></nut-cell>
<nut-cell title="下单时间:" :desc="info.add_time"></nut-cell> <nut-cell title="下单时间:" :desc="info.add_time"></nut-cell>
<nut-cell <nut-cell v-if="info.status === 2" title="核销时间:" :desc="info.cancel_time"></nut-cell>
v-if="info.status === 2" <nut-cell v-if="info.status === 2" title="核销人员:" :desc="info.CancelUser?.nickName"></nut-cell>
title="核销时间:" <nut-cell v-if="info.status === 2" title="核销人手机号:" :desc="info.CancelUser?.phone"></nut-cell>
:desc="info.cancel_time"></nut-cell>
<nut-cell
v-if="info.status === 2"
title="核销人员:"
:desc="info.CancelUser?.nickName"></nut-cell>
<nut-cell
v-if="info.status === 2"
title="核销人手机号:"
:desc="info.CancelUser?.phone"></nut-cell>
</nut-cell-group> </nut-cell-group>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
import {ref} from 'vue'; import { ref } from 'vue';
const info = ref<any>({}); const info = ref<any>({});

View File

@@ -1,34 +1,20 @@
<template> <template>
<view> <view>
<view class="tabs-1"> <view class="tabs-1">
<view <view class="item" v-for="(item, index) in opt" :key="index" @click="tabChange(item.value)">
class="item" <view :style="{
v-for="(item, index) in opt"
:key="index"
@click="tabChange(item.value)">
<view
:style="{
color: item.value === tabVal ? '#333333' : '#9C9C9C', color: item.value === tabVal ? '#333333' : '#9C9C9C',
}" }">{{ item.text }}</view>
>{{ item.text }}</view <view class="line" :style="{
>
<view
class="line"
:style="{
backgroundColor: item.value === tabVal ? '#FFD940' : '', backgroundColor: item.value === tabVal ? '#FFD940' : '',
}"></view> }"></view>
</view> </view>
</view> </view>
<view v-if="dataList.length > 0"> <view v-if="dataList.length > 0">
<view <view class="order-card" v-for="(item, index) in dataList" :key="index" @click="toDetailPage(item)">
class="order-card"
v-for="(item, index) in dataList"
:key="index"
@click="toDetailPage(item)">
<view class="top"> <view class="top">
<view class="text-[#9C9C9C] text-[25px]">订单号{{ item.oid }}</view> <view class="text-[#9C9C9C] text-[25px]">订单号{{ item.oid }}</view>
<view <view :style="{
:style="{
color: color:
item.status === 0 item.status === 0
? '#FF850A' ? '#FF850A'
@@ -37,8 +23,7 @@
: item.status === 2 : item.status === 2
? '#333333' ? '#333333'
: '#9C9C9C', : '#9C9C9C',
}" }">{{
>{{
item.status === 0 item.status === 0
? '待付款' ? '待付款'
: item.status === 1 : item.status === 1
@@ -56,8 +41,9 @@
<view class="flex-1"> <view class="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>{{ itm.pay_price }}
<view>{{ itm.pay_integral }}积分</view> <text v-if="itm.pay_integral > 0">+{{ itm.pay_integral }}积分</text>
</view>
</view> </view>
</view> </view>
<view class="right"> <view class="right">
@@ -65,15 +51,12 @@
</view> </view>
</view> </view>
</view> </view>
<view <view class="flex justify-between items-center mt-2 mb-2 text-[25px]" v-if="item.status !== 0">
class="flex justify-between items-center mt-2 mb-2 text-[25px]"
v-if="item.status !== 0">
<text class="text-[#9C9C9C]">{{ item.count }}件商品</text> <text class="text-[#9C9C9C]">{{ item.count }}件商品</text>
<view <text class="text-[26px] flex-1 text-right">{{ item.status !== 0 ? '实' : '应' }}付款:
>{{ item.status !== 0 ? '实' : '应' }}付款{{ {{ item.discount_price }} ()
item.pay_type === 1 ? '(元): ' : '(积分): ' <text v-if="item.exchange > 0">积分抵扣: {{ item.exchange }}</text>
}}{{ item.pay_type === 1 ? item.price : item.exchange }}</view </text>
>
</view> </view>
</view> </view>
</view> </view>
@@ -82,9 +65,9 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {ref} from 'vue'; import { ref } from 'vue';
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
import {getActiveOrderList} from '../../../../api/admin'; import { getActiveOrderList } from '../../../../api/admin';
const opt = ref([ const opt = ref([
{ {

View File

@@ -3,10 +3,7 @@
<view class="card"> <view class="card">
<view class="text-[#7A7A7A]">订单号{{ goodInfo.oid }}</view> <view class="text-[#7A7A7A]">订单号{{ goodInfo.oid }}</view>
<view class="line"></view> <view class="line"></view>
<view <view class="container" v-for="(item, index) in goodInfo.OrderGoods" :key="index">
class="container"
v-for="(item, index) in goodInfo.OrderGoods"
:key="index">
<image class="image" :src="item.Goods.cover"></image> <image class="image" :src="item.Goods.cover"></image>
<view class="info"> <view class="info">
<view class="title">{{ item.Goods.name }}</view> <view class="title">{{ item.Goods.name }}</view>
@@ -17,19 +14,12 @@
<view class="text-[#9C9C9C]">x{{ item.number }}</view> <view class="text-[#9C9C9C]">x{{ item.number }}</view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view <view class="flex justify-between items-center mt-3 mb-2 text-[25px]" style="text-align: right">
class="flex justify-between items-center mt-3 mb-2 text-[25px]" <text class="text-[#9C9C9C] text-left">{{ goodInfo.count }}件商品</text>
style="text-align: right"> <text class="text-[26px] flex-1">实付款:
<text class="text-[#9C9C9C] text-left" {{ goodInfo.discount_price }} ()
>{{ goodInfo.count }}件商品</text <text v-if="goodInfo.exchange > 0">积分抵扣: {{ goodInfo.exchange }}</text>
> </text>
<text class="flex-1"
>{{ goodInfo.status !== 0 ? '实' : '应' }}付款{{
goodInfo.pay_type === 1 ? '(元): ' : '(积分): '
}}{{
goodInfo.pay_type === 1 ? goodInfo.price : goodInfo.exchange
}}</text
>
</view> </view>
<!-- <view class="line"></view> --> <!-- <view class="line"></view> -->
<!-- <view class="cz"> <!-- <view class="cz">
@@ -40,28 +30,22 @@
</view> </view>
<nut-cell-group> <nut-cell-group>
<nut-cell title="订单信息"></nut-cell> <nut-cell title="订单信息"></nut-cell>
<nut-cell <nut-cell title="下单时间:" :desc="goodInfo.add_time?.slice(0, 19)"></nut-cell>
title="下单时间:"
:desc="goodInfo.add_time?.slice(0, 19)"></nut-cell>
<nut-cell title="下单号码:" :desc="goodInfo.User?.phone"></nut-cell> <nut-cell title="下单号码:" :desc="goodInfo.User?.phone"></nut-cell>
<nut-cell title="下单用户:" :desc="goodInfo.User?.nickName"></nut-cell> <nut-cell title="下单用户:" :desc="goodInfo.User?.nickName"></nut-cell>
<nut-cell <nut-cell title="付款方式:" :desc="getPayType(goodInfo.pay_type)"></nut-cell>
title="付款方式:"
:desc="getPayType(goodInfo.pay_type)"></nut-cell>
</nut-cell-group> </nut-cell-group>
<view class="w-[90%] mt-[40px] m-auto"> <view class="w-[90%] mt-[40px] m-auto">
<nut-button type="primary" shape="square" block @click="subVerify" <nut-button type="primary" shape="square" block @click="subVerify">确定核销</nut-button>
>确定核销</nut-button
>
</view> </view>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
import {getActiveVerifyList, activeOrderVerify} from '@/api/admin'; import { getActiveVerifyList, activeOrderVerify } from '@/api/admin';
import {ref} from 'vue'; import { ref } from 'vue';
const opt = ref<any>({}); const opt = ref<any>({});

View File

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

View File

@@ -54,7 +54,7 @@
color: #fff; color: #fff;
padding: 45px 100px; padding: 45px 100px;
display: flex; display: flex;
justify-content: space-between; justify-content: center;
align-items: center; align-items: center;
text-align: center; text-align: center;

View File

@@ -1,7 +1,7 @@
<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';
const user_info = ref<any>({}); const user_info = ref<any>({});
@@ -57,7 +57,7 @@ const getData = async () => {
const add = async () => { const add = async () => {
try { try {
formRef.value?.validate().then(async ({valid}) => { formRef.value?.validate().then(async ({ valid }) => {
if (valid) { if (valid) {
const res = await addWithdraw({ const res = await addWithdraw({
Bid: user_info.value.data.bid, Bid: user_info.value.data.bid,
@@ -79,33 +79,21 @@ const add = async () => {
const rules = ref({ const rules = ref({
num: [ num: [
{ {
message: '请填写提现积分', message: '请填写提现余额',
validator: (value, _) => { validator: (value, _) => {
if (!value) { return value;
return false;
} else {
return true;
}
}, },
}, },
{ {
message: '提现积分最低为100', message: '提现余额最低为1',
validator: (value, _) => { validator: (value, _) => {
if (Number(value) < 100) { return Number(value) >= 1;
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;
}
}, },
}, },
], ],
@@ -142,15 +130,15 @@ Taro.useReachBottom(() => {
<view> <view>
<view class="card"> <view class="card">
<view class="container"> <view class="container">
<view class=""> <view>
<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="">
<view class="font-bold text-[35px]">{{ str }}</view> <view class="font-bold text-[35px]">{{ str }}</view>
<view class="text-[25px] mt-2">实际到账</view> <view class="text-[25px] mt-2">实际到账</view>
</view> </view> -->
</view> </view>
<view class="footer"> <view class="footer">
<text>到账方式</text> <text>到账方式</text>
@@ -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]"
@@ -174,17 +162,9 @@ Taro.useReachBottom(() => {
</view> </view>
<nut-form ref="formRef" :model-value="basicData" :rules="rules"> <nut-form ref="formRef" :model-value="basicData" :rules="rules">
<nut-form-item prop="num"> <nut-form-item prop="num">
<nut-input <nut-input v-model="basicData.num" class="nut-input-text" placeholder="请输入提现余额" type="text">
v-model="basicData.num"
class="nut-input-text"
placeholder="请输入提现积分"
type="text">
<template #right> <template #right>
<text <text class="text-[#EC4443] text-[26px]" @tap="basicData.num = row.toString()">全部</text>
class="text-[#EC4443] text-[26px]"
@tap="basicData.num = row.toString()"
>全部</text
>
</template> </template>
</nut-input> </nut-input>
</nut-form-item> </nut-form-item>
@@ -201,67 +181,41 @@ Taro.useReachBottom(() => {
<view class="item" v-for="(item, index) in data" :key="index"> <view class="item" v-for="(item, index) in data" :key="index">
<view class="flex justify-between items-center"> <view class="flex justify-between items-center">
<view class="text-[25px] text-[#9C9C9C]">到账金额</view> <view class="text-[25px] text-[#9C9C9C]">到账金额</view>
<view <view class="text-[27px]" :class="item.status === 1
class="text-[27px]"
:class="
item.status === 1
? 'success' ? 'success'
: item.status === 1 : item.status === 1
? 'danger' ? 'danger'
: 'warning' : 'warning'
" ">{{
>{{
item.status === 1 item.status === 1
? '已打款' ? '已打款'
: item.status === 2 : item.status === 2
? '已拒绝' ? '已拒绝'
: '待审核' : '待审核'
}}</view }}</view>
>
</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 class="text-[25px] mb-1">手续{{ item.commission_number }}%</view>
>
<view class="text-[25px] mb-1"
>手续费{{ item.commission_number }}%</view
>
<view class="text-[25px] mb-1">时间{{ item.add_time }}</view> <view class="text-[25px] mb-1">时间{{ item.add_time }}</view>
<view v-if="item.status === 2" class="text-[25px] text-[#9C9C9C]" <view v-if="item.status === 2" class="text-[25px] text-[#9C9C9C]">备注</view>
>备注</view <view v-if="item.status === 1" class="text-[23px] mt-2 text-[#df3526]" @click="openPreview(item)">点我查看回执单
> </view>
<view
v-if="item.status === 1"
class="text-[23px] mt-2 text-[#df3526]"
@click="openPreview(item)"
>点我查看回执单</view
>
</view> </view>
</view> </view>
</view> </view>
<nut-empty v-else description="暂无提现记录"></nut-empty> <nut-empty v-else description="暂无提现记录"></nut-empty>
<!-- 图片预览 --> <!-- 图片预览 -->
<nut-image-preview <nut-image-preview :show="showPreview" :images="imgData" @close="closePreview" />
:show="showPreview"
:images="imgData"
@close="closePreview" />
<nut-dialog <nut-dialog title="提现疑问?" content="这是基础弹框。" ok-text="我已知晓" :no-cancel-btn="true" v-model:visible="visible1">
title="提现疑问?"
content="这是基础弹框。"
ok-text="我已知晓"
:no-cancel-btn="true"
v-model:visible="visible1">
<template #default> <template #default>
<text> <text>
积分和人民币兑换比例为 积分和人民币兑换比例为
<text class="text-[#F83D3D]">100:1</text> <text class="text-[#F83D3D]">100:1</text>
平台收取<text class="text-[#F83D3D]">10%服务费</text><text 平台收取<text class="text-[#F83D3D]">10%服务费</text><text class="text-[#F83D3D]">0.038%手续费</text>
class="text-[#F83D3D]"
>0.038%手续费</text
>
</text> </text>
</template> </template>
</nut-dialog> </nut-dialog>

View File

@@ -3,16 +3,11 @@
<view v-if="list.length > 0"> <view v-if="list.length > 0">
<nut-cell-group v-for="(itm, idx) in list" :key="idx"> <nut-cell-group v-for="(itm, idx) in list" :key="idx">
<nut-cell> <nut-cell>
<nut-checkbox <nut-checkbox v-model="itm.state.checkbox" :indeterminate="itm.state.indeterminate"
v-model="itm.state.checkbox" @change="(val: boolean) => changeBoxAll(val, idx)">{{ itm.StoreName }}
:indeterminate="itm.state.indeterminate"
@change="(val: boolean) => changeBoxAll(val,idx)"
>{{ itm.StoreName }}
</nut-checkbox> </nut-checkbox>
</nut-cell> </nut-cell>
<nut-checkbox-group <nut-checkbox-group v-model="itm.state.checkboxgroup" :ref="el => getGroup(el, idx)"
v-model="itm.state.checkboxgroup"
:ref="el => getGroup(el, idx)"
@change="label => changeBox(label, itm)"> @change="label => changeBox(label, itm)">
<nut-cell v-for="(item, idx1) in itm.Goods" :key="idx1"> <nut-cell v-for="(item, idx1) in itm.Goods" :key="idx1">
<nut-checkbox :label="item.gid" style="width: 10%"></nut-checkbox> <nut-checkbox :label="item.gid" style="width: 10%"></nut-checkbox>
@@ -22,16 +17,13 @@
<view class="center"> <view class="center">
<view>{{ item.name }}</view> <view>{{ item.name }}</view>
<view class="price"> <view class="price">
<view>{{ item.price }} </view> <view>{{ item.price }}
<view>{{ item.exchange }} 积分</view> <text v-if="item.discount_integral > 0">+{{ item.discount_integral }}积分</text>
</view> </view>
</view> </view>
</view> </view>
<nut-input-number </view>
v-model="item.number" <nut-input-number v-model="item.number" readonly :min="-1" @add.stop="() => onAdd(item)"
readonly
:min="-1"
@add.stop="() => onAdd(item)"
@reduce.stop="() => onReduce(item)" /> @reduce.stop="() => onReduce(item)" />
</view> </view>
</nut-cell> </nut-cell>
@@ -50,36 +42,26 @@
<view> <view>
<view class="text-box"> <view class="text-box">
总金额 总金额
<nut-price <nut-price v-model:price="localCount.price" size="normal" :need-symbol="false" />
v-model:price="localCount.price"
size="normal"
:need-symbol="false" />
</view> </view>
<view class="text-box"> <view class="text-box">
总积分 总积分
<nut-price <nut-price v-model:price="localCount.exchange" size="normal" :need-symbol="false" />
v-model:price="localCount.exchange"
size="normal"
:need-symbol="false" />
</view> </view>
</view> </view>
</view> </view>
<nut-button type="primary" @click="sub">去结算</nut-button> <nut-button type="primary" @click="sub">去结算</nut-button>
</view> </view>
<!-- 支付 --> <!-- 支付 -->
<Pay <Pay :is-show-pay="isShowPay" :interval="true" v-model:jfInfo="orderData" @closePay="closePay" />
:is-show-pay="isShowPay"
:interval="true"
v-model:jfInfo="orderData"
@closePay="closePay" />
</view> </view>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import {nextTick, ref} from 'vue'; import { nextTick, ref } from 'vue';
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
import {addCart, getAllCart} from '@/api/cart'; import { addCart, getAllCart } from '@/api/cart';
import {createActiveOrder} from '@/api/goods'; import { createActiveOrder } from '@/api/goods';
import Pay from '@/components/Pay.vue'; import Pay from '@/components/Pay.vue';
interface CardList { interface CardList {
@@ -90,6 +72,8 @@ interface CardList {
number: string; number: string;
price: number; price: number;
exchange: number; exchange: number;
pay_price: number;
discount_integral: number;
} }
// const selectAllVal = ref(false); // const selectAllVal = ref(false);
@@ -139,7 +123,7 @@ const changeBox = (label: string[], item: any) => {
item.Goods.forEach((itm: any) => { item.Goods.forEach((itm: any) => {
if (itm.gid === id) { if (itm.gid === id) {
item['Count'].priceCount += itm.price; item['Count'].priceCount += itm.price;
item['Count'].exchangeCount += itm.exchange; item['Count'].exchangeCount += itm.discount_integral;
} }
}); });
}); });
@@ -187,6 +171,8 @@ const isShowPay = ref(false);
const orderData = ref<any>([]); const orderData = ref<any>([]);
const sub = async () => { const sub = async () => {
try {
console.log('sub');
const arr: any = list.value.filter( const arr: any = list.value.filter(
(item: any) => item.state.checkboxgroup.length > 0, (item: any) => item.state.checkboxgroup.length > 0,
); );
@@ -198,8 +184,7 @@ const sub = async () => {
}); });
return; return;
} }
try { const { data: res } = await createActiveOrder({
const {data: res} = await createActiveOrder({
Bid: arr.map((item: any) => item.StoreBid), Bid: arr.map((item: any) => item.StoreBid),
}); });
if (res.oid) { if (res.oid) {
@@ -212,7 +197,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,23 +1,48 @@
<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 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 }}</text>
</text>
<!-- <view class="line"></view> -->
</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> </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" :key="index" class="flex items-center" :title="item.name"
v-for="(item, index) in payList" :desc="item.number > 0 ? `可用积分:${item.number}` : item.name.includes('微信') ? '微信全额支付' : ''"
:key="index"
class="flex items-center"
:title="item.name"
:desc="item.number > 0 ? `可用积分:${item.number}` : ''"
@click="cellClick(item.ID)"> @click="cellClick(item.ID)">
<template #icon> <template #icon>
<IconFont size="30" :name="item.icon" /> <IconFont size="30" :name="item.icon" />
@@ -26,87 +51,22 @@
<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]">
<nut-button <nut-button shape="square" :loading="isLoading" type="primary" block @click="pay">确认支付
shape="square"
:loading="isLoading"
type="primary"
block
@click="pay"
>确认支付
</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>
<script setup lang="ts"> <script setup lang="ts">
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,24 +75,14 @@ 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 => {
const {oid, bid, OrderType} = e; const { oid, bid, OrderType } = e;
opt.value = e; opt.value = e;
get_pay_list(); get_pay_list();
getData(oid, bid, OrderType); getData(oid, bid, OrderType);
@@ -145,8 +95,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 +105,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 +124,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: '未获取到订单信息~',
@@ -189,52 +139,26 @@ const pay = async () => {
try { try {
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();
if (res.data.pay_password) {
visible.value = true;
showKeyboard.value = true;
} else {
isLoading.value = false;
visible2.value = true;
}
} else {
await confirmPay(); 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) {
case 1:
if (typeof res.data.data === 'object') {
Taro.requestPayment({ Taro.requestPayment({
timeStamp: res.data.data.timeStamp, timeStamp: res.data.data.timeStamp,
nonceStr: res.data.data.nonceStr, nonceStr: res.data.data.nonceStr,
@@ -254,36 +178,13 @@ const confirmPay = async () => {
}); });
}, },
complete: function () { 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(() => { 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 +195,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 +209,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

@@ -1,14 +1,12 @@
<template> <template>
<view> <view>
<view :style="{marginTop: BarHeight + 'px'}"></view> <view :style="{ marginTop: BarHeight + 'px' }"></view>
<view class="local"> <view class="local">
<view class="iconfont icon-dizhi" style="font-size: 20px"></view> <view class="iconfont icon-dizhi" style="font-size: 20px"></view>
<text class="text-[28px]">{{ address }}</text> <text class="text-[28px]">{{ address }}</text>
</view> </view>
<view class="search"> <view class="search">
<view <view class="iconfont icon-sousuo" style="color: #8f8f8f; margin-right: 8px"></view>
class="iconfont icon-sousuo"
style="color: #8f8f8f; margin-right: 8px"></view>
<input placeholder="请输入商家名称搜索" v-model="searchVal" /> <input placeholder="请输入商家名称搜索" v-model="searchVal" />
<view class="search-btn" @click="clickSearch">搜索</view> <view class="search-btn" @click="clickSearch">搜索</view>
</view> </view>
@@ -16,46 +14,28 @@
<view class="title"></view> <view class="title"></view>
<navigator class="jf-btn" hover-class="none"></navigator> <navigator class="jf-btn" hover-class="none"></navigator>
<view class="footer"> <view class="footer">
<navigator <navigator hover-class="none" class="btn-1" url="/pages/fastBuy/index?type=1"></navigator>
hover-class="none" <navigator hover-class="none" openType="switchTab" url="/pages/game/gamehome/index" class="btn-2"></navigator>
class="btn-1" <navigator hover-class="none" class="btn-3" url="/pages/fastBuy/index?type=2"></navigator>
url="/pages/fastBuy/index?type=1"></navigator>
<navigator
hover-class="none"
openType="switchTab"
url="/pages/game/gamehome/index"
class="btn-2"></navigator>
<navigator
hover-class="none"
class="btn-3"
url="/pages/fastBuy/index?type=2"></navigator>
</view> </view>
</view> </view>
<view class="navigation"> <view class="navigation">
<view <view class="item" v-for="(item, index) in navigationList" :key="index" @click="toPage(item)">
class="item"
v-for="(item, index) in navigationList"
:key="index"
@click="toPage(item)">
<image class="icon" :src="item.icon" /> <image class="icon" :src="item.icon" />
<view class="text">{{ item.name }}</view> <view class="text">{{ item.name }}</view>
</view> </view>
</view> </view>
<navigator <navigator class="ad" url="/pages/marketing/yq/index" open-type="navigate" hover-class="none">
class="ad"
url="/pages/marketing/yq/index"
open-type="navigate"
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>
<script setup lang="ts"> <script setup lang="ts">
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
import {ref} from 'vue'; import { ref } from 'vue';
import {getHomeList} from '@/api/home'; import { getHomeList } from '@/api/home';
import MerList from '@/components/MerList.vue'; import MerList from '@/components/MerList.vue';
import Popup from '@/components/Popup.vue'; import Popup from '@/components/Popup.vue';
@@ -72,6 +52,10 @@ interface navigationType {
const navigationList = ref<Array<navigationType>>([]); const navigationList = ref<Array<navigationType>>([]);
const imgList = ref([
require('../../static/popTip.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

@@ -1,46 +1,32 @@
<template> <template>
<view> <view>
<view class="head-wrapper" :style="{top: BarHeight + 'px'}"> <view class="head-wrapper" :style="{ top: BarHeight + 'px' }">
<view class="head-menu"> <view class="head-menu">
<Left class="iconfont" @click="returns" /> <Left class="iconfont" @click="returns" />
<Home class="iconfont" @click="goHome" /> <Home class="iconfont" @click="goHome" />
</view> </view>
</view> </view>
<!-- 幻灯片 --> <!-- 幻灯片 -->
<nut-swiper <nut-swiper :init-page="0" :pagination-visible="false" pagination-color="red" auto-play="3000">
:init-page="0"
:pagination-visible="false"
pagination-color="red"
auto-play="3000">
<nut-swiper-item v-for="(itm, idx) in swiperList" :key="idx"> <nut-swiper-item v-for="(itm, idx) in swiperList" :key="idx">
<img <img style="width: 100%; height: 100%" :src="itm" :alt="idx.toString()" />
style="width: 100%; height: 100%"
:src="itm"
:alt="idx.toString()" />
</nut-swiper-item> </nut-swiper-item>
</nut-swiper> </nut-swiper>
<!-- 商家信息 --> <!-- 商家信息 -->
<view class="infoBox"> <view class="infoBox">
<view class="title text-[#333333]">{{ mer_info.name }}</view> <view class="title text-[#333333]">{{ mer_info.name }}</view>
<view class="flex items-center justify-between mt-3"> <view class="flex items-center justify-between mt-3">
<nut-rate <nut-rate spacing="1" active-color="rgba(252, 207, 10, 1)" v-model="mer_info.rate" />
spacing="1"
active-color="rgba(252, 207, 10, 1)"
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 }}
>营业时间{{ mer_info.week_start }}-{{ mer_info.week_end }}</view </view>
>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="bom"> <view class="bom">
<view <view class="iconfont icon-dizhi text-[#C4C4C4]" style="width: 15px; height: 15px; margin-right: 15px"></view>
class="iconfont icon-dizhi text-[#C4C4C4]"
style="width: 15px; height: 15px; margin-right: 15px"></view>
<view class="left"> <view class="left">
<view>{{ mer_info.address || '暂无商家地址' }}</view> <view>{{ mer_info.address || '暂无商家地址' }}</view>
<view class="sub mt-1" <view class="sub mt-1">距离您{{
>距离您{{
calculateDistance( calculateDistance(
userLocalNum.t, userLocalNum.t,
userLocalNum.l, userLocalNum.l,
@@ -52,57 +38,39 @@
</view> </view>
<view class="right"> <view class="right">
<view @click="clickMap"> <view @click="clickMap">
<image <image class="w-[50px] h-[50px]" src="http://p1.meituan.net/csc/92ee8512c90527169b44e07fd11d250d924.png" />
class="w-[50px] h-[50px]"
src="http://p1.meituan.net/csc/92ee8512c90527169b44e07fd11d250d924.png" />
</view> </view>
<view @click="clickPhone"> <view @click="clickPhone">
<image <image class="w-[50px] h-[50px]" src="http://p0.meituan.net/csc/ab0493b124a6bb858bf82a2340767c0d919.png" />
class="w-[50px] h-[50px]"
src="http://p0.meituan.net/csc/ab0493b124a6bb858bf82a2340767c0d919.png" />
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- 商品列表 --> <!-- 商品列表 -->
<view class="good-class" v-if="class_list.length > 0"> <view class="good-class" v-if="class_list.length > 0">
<nut-tabs <nut-tabs v-model="value" title-scroll size="large" direction="vertical" title-gutter="5" animated-time="0"
v-model="value" type="" name="tabName">
title-scroll <nut-tab-pane v-for="(itm, index) in good_list" :key="index" :title="itm.name" :pane-key="index">
size="large"
direction="vertical"
title-gutter="5"
animated-time="0"
type=""
name="tabName">
<nut-tab-pane
v-for="(itm, index) in good_list"
:key="index"
:title="itm.name"
:pane-key="index">
<view v-if="itm.Goods.length > 0"> <view v-if="itm.Goods.length > 0">
<view class="list" v-for="(item, index) in itm.Goods" :key="index"> <view class="list" v-for="(item, index) in itm.Goods" :key="index">
<view class="item" @click.stop="toGoodDetails(item.gid, 1)"> <view class="item" @click.stop="toGoodDetails(item.gid, 1)">
<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.discount_price }}
<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]">剩余:{{ item.stock }}</view>
<text style="font-size: 15px">{{ item.number }}</text>
</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 v-if="item.cartNum > 0" class="btn" @click.stop="add_cart(item, 1)">
v-if="item.cartNum > 0"
class="btn"
@click.stop="add_cart(item, 1)">
<Minus /> <Minus />
</view> </view>
<view v-if="item.cartNum > 0" style="margin: 0 10px"> <view v-if="item.cartNum > 0" style="margin: 0 10px">
@@ -130,10 +98,10 @@
<script setup lang="ts"> <script setup lang="ts">
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
import {Left, Home, Plus, Minus} from '@nutui/icons-vue-taro'; import { Left, Home, Plus, Minus } from '@nutui/icons-vue-taro';
import {Ref, ref} from 'vue'; import { Ref, ref } from 'vue';
import {calculateDistance} from '@/utils'; import { calculateDistance } from '@/utils';
import {getGoodList, getMerCategory, getMerDetail} from '@/api/goods'; import { getGoodList, getMerCategory, getMerDetail } from '@/api/goods';
import Cart from '@/components/Cart.vue'; import Cart from '@/components/Cart.vue';
const statusBarHeight = Taro.getSystemInfoSync()?.statusBarHeight; const statusBarHeight = Taro.getSystemInfoSync()?.statusBarHeight;
@@ -156,7 +124,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',
@@ -232,6 +200,7 @@ interface GoodsType {
cover: string; cover: string;
name: string; name: string;
number: number; number: number;
discount_price: number;
stock: number; stock: number;
cartNum: number; cartNum: number;
exchange: number; exchange: number;
@@ -265,7 +234,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

@@ -1,10 +1,9 @@
<script lang="ts" setup> <script lang="ts" setup>
import {ref} from 'vue'; import { ref } from 'vue';
import Taro from '@tarojs/taro'; 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,12 +57,16 @@ 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 {
Goods: { Goods: {
name: string; name: string;
cover: string; cover: string;
discount_price: number;
exchange: number;
}; };
ID: number; ID: number;
gid: string; gid: string;
@@ -159,7 +162,7 @@ const toDetail = (item: any) => {
const delOrder = async (oid: string) => { const delOrder = async (oid: string) => {
try { try {
await deleteActiveOrder({oid}); await deleteActiveOrder({ oid });
} catch (error) { } catch (error) {
Taro.showToast({ Taro.showToast({
title: error.msg, title: error.msg,
@@ -169,35 +172,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 => {
@@ -263,31 +237,20 @@ const closed = () => {
<image src="../static/user/order_list_top.png" /> <image src="../static/user/order_list_top.png" />
</view> --> </view> -->
<view class="tabs-box"> <view class="tabs-box">
<view <view v-for="item in tabsList" :key="item.value" @click="tabChange(item.value)">
v-for="item in tabsList" <view class="text" :style="{
:key="item.value"
@click="tabChange(item.value)">
<view
class="text"
:style="{
color: tabValue === item.value ? '#000' : '#9C9C9C', color: tabValue === item.value ? '#000' : '#9C9C9C',
}" }">{{ item.title }}
>{{ item.title }}</view </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>
</view> </view>
<view v-if="orderList.length > 0"> <view v-if="orderList.length > 0">
<view <view class="order-card" v-for="(item, index) in orderList" :key="index" @click="toDetail(item)">
class="order-card"
v-for="(item, index) in orderList"
:key="index"
@click="toDetail(item)">
<view class="top"> <view class="top">
<view class="text-[#9C9C9C] text-[28px]">订单号{{ item.oid }}</view> <view class="text-[#9C9C9C] text-[28px]">订单号{{ item.oid }}</view>
<view <view :style="{
:style="{
color: color:
item.status === 0 item.status === 0
? '#FF850A' ? '#FF850A'
@@ -296,8 +259,7 @@ const closed = () => {
: item.status === 2 : item.status === 2
? '#333333' ? '#333333'
: '#9C9C9C', : '#9C9C9C',
}" }">{{
>{{
item.status === 0 item.status === 0
? '待付款' ? '待付款'
: item.status === 1 : item.status === 1
@@ -315,8 +277,9 @@ 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>{{ itm.Goods.discount_price }}
<view>{{ itm.pay_integral }}积分</view> <text v-if="itm.Goods.exchange > 0">+{{ itm.Goods.exchange }}积分</text>
</view>
</view> </view>
</view> </view>
<view class="right"> <view class="right">
@@ -325,28 +288,18 @@ const closed = () => {
</view> </view>
</view> </view>
<!-- <view class="line"></view> --> <!-- <view class="line"></view> -->
<view <view class="flex justify-between items-center mt-2 mb-2 text-[25px]" v-if="item.status !== 0"
class="flex justify-between items-center mt-2 mb-2 text-[25px]"
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 }}件商品
>{{ item.count }}件商品</text </text>
> <text class="text-[26px]">{{ item.status !== 0 ? '实' : '应' }}付款:
<text class="text-[26px]" {{ item.discount_price }} ()
>{{ item.status !== 0 ? '实' : '应' }}付款{{ <text v-if="item.exchange > 0">积分抵扣: {{ item.exchange }}</text>
item.pay_type === 1 ? '(元): ' : '(积分): ' </text>
}}{{ item.pay_type === 1 ? item.price : item.exchange }}</text
>
<!-- <view class="line"></view> --> <!-- <view class="line"></view> -->
</view> </view>
<view class="btn"> <view class="btn">
<nut-button <nut-button v-if="item.status === 0" plain size="mini" type="primary" @click.stop="delOrder(item.oid)">取消订单
v-if="item.status === 0"
plain
size="mini"
type="primary"
@click.stop="delOrder(item.oid)"
>取消订单
</nut-button> </nut-button>
<!-- <nut-button <!-- <nut-button
style="margin-left: 5px" style="margin-left: 5px"
@@ -355,55 +308,29 @@ const closed = () => {
@click="toDetail(item)" @click="toDetail(item)"
>查看详情 >查看详情
</nut-button> --> </nut-button> -->
<nut-button <nut-button style="margin-left: 5px" size="mini" type="primary" v-if="item.status === 0"
style="margin-left: 5px" @click.stop="openPay(item)">立即付款
size="mini"
type="primary"
v-if="item.status === 0"
@click.stop="openPay(item)"
>立即付款
</nut-button> </nut-button>
<nut-button <nut-button style="margin-left: 5px" size="mini" type="primary" v-if="item.status === 1"
style="margin-left: 5px" @click.stop="openCode(item)">出示核销码
size="mini"
type="primary"
v-if="item.status === 1"
@click.stop="openCode(item)"
>出示核销码
</nut-button> </nut-button>
</view> </view>
</view> </view>
</view> </view>
<nut-empty v-else description="暂无订单"></nut-empty> <nut-empty v-else description="暂无订单"></nut-empty>
<!-- 核销码弹窗 --> <!-- 核销码弹窗 -->
<nut-popup <nut-popup v-model:visible="isShowCode" position="center" style="padding: 20px; border-radius: 15px"
v-model:visible="isShowCode" :maskClosable="true" safe-area-inset-bottom @click-overlay="closed" @closed="closed">
position="center"
style="padding: 20px; border-radius: 15px"
:maskClosable="true"
safe-area-inset-bottom
@click-overlay="closed"
@closed="closed">
<view class="code-box"> <view class="code-box">
<view>核销码</view> <view>核销码</view>
<!-- <image class="qrcode" :src="url"></image> --> <!-- <image class="qrcode" :src="url"></image> -->
<!-- <view class="qrcode"> --> <!-- <view class="qrcode"> -->
<canvas <canvas ref="qrcode" id="qrcode" style="width: 200px; height: 200px" canvas-id="qrcode"></canvas>
ref="qrcode"
id="qrcode"
style="width: 200px; height: 200px"
canvas-id="qrcode"></canvas>
<!-- </view> --> <!-- </view> -->
</view> </view>
</nut-popup> </nut-popup>
<pay <pay :isShowPay="isShowPay" :interval="false" :jfInfo="jfInfo" :OrderType="2" @errPay="errPay"
:isShowPay="isShowPay" @successPay="successPay" @closePay="closePay" />
:interval="false"
:jfInfo="jfInfo"
:OrderType="2"
@errPay="errPay"
@successPay="successPay"
@closePay="closePay" />
</view> </view>
</template> </template>

View File

@@ -27,10 +27,10 @@
<view class="font-bold">订单待使用</view> <view class="font-bold">订单待使用</view>
<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 <text class="text-[#FF0000]">{{ timeStr }} </text>
>过期请尽快核销</view 过期请尽快核销
> </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">
@@ -49,21 +49,15 @@
</view> </view>
<!-- 商家信息 --> <!-- 商家信息 -->
<view class="mer-info"> <view class="mer-info">
<image <image class="w-[150px] h-[150px] rounded-lg mr-2" :src="goodInfo.Store?.head_photo" />
class="w-[150px] h-[150px] rounded-lg mr-2"
:src="goodInfo.Store?.head_photo" />
<view class="right"> <view class="right">
<view class="text-[#333333]">{{ goodInfo.Store?.name }}</view> <view class="text-[#333333]">{{ goodInfo.Store?.name }}</view>
<view <view class="flex mt-2 items-center text-[#999999] text-[23px] text-ellipsis line-clamp-3">
class="flex mt-2 items-center text-[#999999] text-[23px] text-ellipsis line-clamp-3"> <view style="font-size: 15px" class="iconfont icon-dizhi text-[#C4C4C4]"></view>
<view
style="font-size: 15px"
class="iconfont icon-dizhi text-[#C4C4C4]"></view>
<view>{{ goodInfo.Store?.address }}</view> <view>{{ goodInfo.Store?.address }}</view>
</view> </view>
<view class="w-full flex items-center justify-between mt-1"> <view class="w-full flex items-center justify-between mt-1">
<view class="ml-3 text-[23px] text-[#999999]" <view class="ml-3 text-[23px] text-[#999999]">距离您{{
>距离您{{
calculateDistance( calculateDistance(
userLocalNum.t, userLocalNum.t,
userLocalNum.l, userLocalNum.l,
@@ -73,13 +67,9 @@
}} }}
</view> </view>
<view class="flex items-center"> <view class="flex items-center">
<image <image @tap="toPhone()" class="w-[50px] h-[50px]"
@tap="toPhone()"
class="w-[50px] h-[50px]"
src="http://p0.meituan.net/csc/ab0493b124a6bb858bf82a2340767c0d919.png" /> src="http://p0.meituan.net/csc/ab0493b124a6bb858bf82a2340767c0d919.png" />
<image <image @tap="toAdder()" class="w-[50px] h-[50px] ml-2"
@tap="toAdder()"
class="w-[50px] h-[50px] ml-2"
src="http://p1.meituan.net/csc/92ee8512c90527169b44e07fd11d250d924.png" /> src="http://p1.meituan.net/csc/92ee8512c90527169b44e07fd11d250d924.png" />
</view> </view>
</view> </view>
@@ -91,34 +81,27 @@
<nut-cell> <nut-cell>
<template #default> <template #default>
<view class="center-box"> <view class="center-box">
<view <view class="top" v-for="(item, index) in goodInfo.OrderGoods" :key="index">
class="top"
v-for="(item, index) in goodInfo.OrderGoods"
:key="index">
<image :src="item.Goods?.cover" /> <image :src="item.Goods?.cover" />
<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>{{ item.Goods.discount_price }}
<view>{{ item.pay_integral }}积分</view> <text v-if="item.Goods.exchange > 0">+{{ item.Goods.exchange }}积分</text>
</view>
</view> </view>
</view> </view>
<view class="right"> <view class="right">
<view>x{{ item.number }}</view> <view>x{{ item.number }}</view>
</view> </view>
</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]">{{ `${goodInfo.count}件商品` }}
<view class="text-[#9C9C9C]">{{ </view>
`${goodInfo.count}件商品` <text class="text-[26px]">{{ goodInfo.status !== 0 ? '实' : '应' }}付款:
}}</view> {{ goodInfo.discount_price }} ()
<text <text v-if="goodInfo.exchange > 0">积分抵扣: {{ goodInfo.exchange }}</text>
>{{ goodInfo.status !== 0 ? '实' : '应' }}付款{{ </text>
goodInfo.pay_type === 1 ? '(元): ' : '(积分): '
}}{{
goodInfo.pay_type === 1 ? goodInfo.price : goodInfo.exchange
}}</text
>
</view> </view>
</view> </view>
</template> </template>
@@ -126,19 +109,14 @@
</nut-cell-group> </nut-cell-group>
<nut-cell-group> <nut-cell-group>
<nut-cell title="订单号:" :desc="goodInfo.oid"></nut-cell> <nut-cell title="订单号:" :desc="goodInfo.oid"></nut-cell>
<nut-cell <nut-cell title="下单时间:" :desc="goodInfo.add_time?.slice(0, 19)"></nut-cell>
title="下单时间:"
:desc="goodInfo.add_time?.slice(0, 19)"></nut-cell>
<!-- <nut-cell <!-- <nut-cell
v-if="goodInfo.expires !== 0" v-if="goodInfo.expires !== 0"
title="订单过期时间:" title="订单过期时间:"
:desc=" :desc="
dayjs.unix(goodInfo.expires).format('YYYY-MM-DD HH:mm:ss') dayjs.unix(goodInfo.expires).format('YYYY-MM-DD HH:mm:ss')
"></nut-cell> --> "></nut-cell> -->
<nut-cell <nut-cell title="订单状态:" :desc="goodInfo.status === 0
title="订单状态:"
:desc="
goodInfo.status === 0
? '待付款' ? '待付款'
: goodInfo.status === 1 : goodInfo.status === 1
? '待使用' ? '待使用'
@@ -149,22 +127,10 @@
</nut-cell-group> </nut-cell-group>
<view class="mt-[30px] m-auto"> <view class="mt-[30px] m-auto">
<nut-button <nut-button v-if="goodInfo.status === 0" shape="square" type="primary" block @click="openPay()">继续付款
v-if="goodInfo.status === 0" </nut-button>
shape="square" <nut-button v-if="goodInfo.status === 1" shape="square" type="primary" block @click="openCode()">出示核销码
type="primary" </nut-button>
block
@click="openPay()"
>继续付款</nut-button
>
<nut-button
v-if="goodInfo.status === 1"
shape="square"
type="primary"
block
@click="openCode()"
>出示核销码</nut-button
>
</view> </view>
<!-- <view class="btn"> <!-- <view class="btn">
@@ -194,47 +160,30 @@
</view> --> </view> -->
<!-- 核销码弹窗 --> <!-- 核销码弹窗 -->
<nut-popup <nut-popup v-model:visible="isShowCode" position="center" style="padding: 20px; border-radius: 15px"
v-model:visible="isShowCode" :maskClosable="true" safe-area-inset-bottom @click-overlay="closed" @closed="closed">
position="center"
style="padding: 20px; border-radius: 15px"
:maskClosable="true"
safe-area-inset-bottom
@click-overlay="closed"
@closed="closed">
<view class="code-box"> <view class="code-box">
<view>核销码</view> <view>核销码</view>
<!-- <image class="qrcode" :src="url"></image> --> <!-- <image class="qrcode" :src="url"></image> -->
<!-- <view class="qrcode"> --> <!-- <view class="qrcode"> -->
<canvas <canvas ref="qrcode" id="qrcode" style="width: 200px; height: 200px" canvas-id="qrcode"></canvas>
ref="qrcode"
id="qrcode"
style="width: 200px; height: 200px"
canvas-id="qrcode"></canvas>
<!-- </view> --> <!-- </view> -->
</view> </view>
</nut-popup> </nut-popup>
<pay <pay :isShowPay="isShowPay" :interval="false" :jfInfo="jfInfo" :OrderType="2" @errPay="errPay"
:isShowPay="isShowPay" @successPay="successPay" @closePay="closePay" />
:interval="false"
:jfInfo="jfInfo"
:OrderType="2"
@errPay="errPay"
@successPay="successPay"
@closePay="closePay" />
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
import {onUnmounted, ref} from 'vue'; 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';
import UQRCode from 'uqrcodejs'; import UQRCode from 'uqrcodejs';
dayjs.extend(duration); dayjs.extend(duration);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 KiB

After

Width:  |  Height:  |  Size: 187 KiB