bug修复

This commit is contained in:
2024-04-18 00:37:43 +08:00
parent b87c8e8292
commit 6c4c2ac85d
16 changed files with 110 additions and 32 deletions

View File

@@ -19,7 +19,16 @@ onLaunch((options) => {
if(options.query.storeId) {
setRegisterStoreId(options.query.storeId);
}
if(options?.query.scene) {
//保存注册门店id
const params = decodeURIComponent(options?.query.scene);
if(params.split('=')[0] === 'storeId') {
setRegisterStoreId(params.split('=')[1]);
}
}
}
// #ifdef MP
mpUpdate();
// #endif

View File

@@ -6,7 +6,7 @@ export const getGroupBuyList = (data: {
pageNum: number,
pageSize: number,
obj: {
status: number,
timeStatus: number,
}
}) => post({ url: '/group/coupons/wx_query', data });

View File

@@ -30,7 +30,8 @@ enum URL {
couponList = '/wechat/coupons/coupons/pageList',
integralList = '/ext/member/integral_query',
tradeList = '/memberIncoming/wx_balance_records',
terminal = 'wechat/coupons/terminal?companyId='
terminal = 'wechat/coupons/terminal?companyId=',
cardLink = '/wc/wechat/get_card_url'
}
export const getUserProfile = () => get<UserBean>({ url: URL.profile });
@@ -67,3 +68,5 @@ export const getIntegralList = (data: any) => get({ url: URL.integralList, data
export const getTerminal = (companyId: string) => get<TerminalBean>({ url: URL.terminal + companyId });
export const getTradeList = (data: any) => post<any>({ url: URL.tradeList, data });
export const getCardLink = () => get<string>({ url: URL.cardLink });

View File

@@ -66,7 +66,7 @@ const buildSignParams = computed(() => {
return sortASCII({
client_sn: props.payParams.client_sn || '',
return_url: props.payParams.return_url,
total_amount: (props.payParams.total_amount * 100).toString(),
total_amount: Number((props.payParams.total_amount * 100).toFixed(2)),
terminal_sn: props.payParams.terminal_sn,
subject: props.payParams.subject,
subject_img: props.payParams.subject_img,

View File

@@ -5,7 +5,8 @@
<image class='goods-image' :src='goodsDetailBean?.images||defaultImage' />
<view class='c-flex-column' style='flex: 1;display: inline-grid'>
<text class='goods-name'>{{ goodsDetailBean?.name || '未知' }}</text>
<text class='goods-price'>{{ flashPrice > 0 ? `${flashPrice}` : `${goodsDetailBean?.consumePrice || 0}` || 0
<text class='goods-price'>
{{ flashPrice > 0 ? `${flashPrice}` : `${goodsDetailBean?.consumePrice || 0}` || 0
}}
</text>
</view>

View File

@@ -19,7 +19,7 @@
<image :src='assetsUrl("ic_decline.png")' />
<text>直降¥{{ (item.price - item.payPrice).toFixed(2) }}</text>
</view>
<text>{{ tabIndex == 0 ? '即将恢复' : '即将开始'}}</text>
<text>{{ tabIndex == 0 ? '即将恢复' : '即将开始' }}</text>
</view>
<view class='bottom-price c-flex-row' :class='{"bottom-price-disabled":tabIndex==1}'>
<text>{{ item.payPrice }}</text>
@@ -62,7 +62,7 @@ const fetchData = async (refresh: boolean = true) => {
pageNum: currentPageNum.value,
pageSize: 100,
obj: {
status: tabIndex.value
timeStatus: tabIndex.value + 1
}
});
groupbuyList.value = list;

View File

@@ -65,7 +65,7 @@ const buildSqbParams = computed(() => {
const params = sortASCII({
client_sn: orderBean.value?.id || '',
return_url: '/pages/common/payresult/index',
total_amount: ((orderBean.value?.totalPrice || 0) * 100).toString(),
total_amount: Number(((orderBean.value?.totalPrice || 0) * 100).toFixed(2)),
terminal_sn: terminalInfo.value.terminalSn,
subject: '商品团购券',
subject_img: orderBean?.value?.orderGoods[0].images || '',

View File

@@ -1,12 +1,12 @@
<template>
<web-view class="h-full" :src="url" />
<web-view class='h-full' :src='url' />
</template>
<script setup lang="ts">
<script setup lang='ts'>
const url = ref<string>('');
onLoad((params: any) => {
if (params.url)
url.value = params.url;
if(params.url)
url.value = decodeURIComponent(params.url);
});
</script>

View File

@@ -122,9 +122,7 @@ onShow(async () => {
if(isLogin()) {
// userStore.getProfile();
if(userInfo.value.maOpenId) {
if(getCompanyId() === '') {
switchCompany();
}
fetchCompanyList();
} else {
await userStore.getProfile();
}
@@ -134,18 +132,52 @@ onShow(async () => {
});
const switchCompany = () => {
getCompanyList(userInfo.value.maOpenId).then(res => {
const companyList = res.map((res: { company: any }) => res.company);
const userList = res.map((res: { user: any }) => res.user);
// getCompanyList(userInfo.value.maOpenId).then(res => {
// const companyList = res.map((res: { company: any }) => res.company);
// const userList = res.map((res: { user: any }) => res.user);
// uni.showActionSheet({
// itemList: companyList.map((res: { companyName: string }) => res.companyName),
// success: (res) => {
// userStore.setUserInfo(userList[res.tapIndex]);
// userStore.setCompanyInfo(companyList[res.tapIndex]);
// }
// });
// });
fetchCompanyList((companyList: any[], userList: any[]) => {
uni.showActionSheet({
itemList: companyList.map((res: { companyName: string }) => res.companyName),
success: (res) => {
userStore.setUserInfo(userList[res.tapIndex]);
userStore.setCompanyInfo(companyList[res.tapIndex]);
}
});
});
};
const fetchCompanyList = (fn: any = undefined) => {
getCompanyList(userInfo.value.maOpenId).then(res => {
const companyList = res.map((res: { company: any }) => res.company);
const userList = res.map((res: { user: any }) => res.user);
if(fn != undefined && fn instanceof Function) {
fn(companyList, userList);
} else {
let index = companyList.findIndex((res: { id: string }) => res.id === getCompanyId());
if(index < 0) {
index = 0;
}
userStore.setUserInfo(userList[index]);
userStore.setCompanyInfo(companyList[index]);
}
// uni.showActionSheet({
// itemList: companyList.map((res: { companyName: string }) => res.companyName),
// success: (res) => {
// userStore.setUserInfo(userList[res.tapIndex]);
// userStore.setCompanyInfo(companyList[res.tapIndex]);
// }
// });
});
};
const swiperChange = (e: any) => {
currentBannerIndex.value = e.detail.current;
};

View File

@@ -21,7 +21,7 @@
¥{{ goodsBean?.price || 0 }}
</text>
</text>
<text>销量{{ goodsBean?.send_num || 0 }}</text>
<text>销量{{ goodsBean?.salesCount || 0 }}</text>
</view>
<view class='c-flex-row'>

View File

@@ -159,7 +159,7 @@ const buildSqbParams = computed(() => {
const params = sortASCII({
client_sn: orderBean.value?.id || '',
return_url: '/pages/common/payresult/index',
total_amount: ((orderBean.value?.totalPrice || 0) * 100).toString(),
total_amount: Number(((orderBean.value?.totalPrice || 0) * 100).toFixed(2)),
terminal_sn: terminalInfo.value.terminalSn,
subject: orderBean?.value?.orderGoods[0].name,
subject_img: orderBean?.value?.orderGoods[0].images || '',

View File

@@ -34,7 +34,7 @@
<view class='integral-add-view'>
<text>将会员卡放入微信卡包及时了解积分变动</text>
<text>去添加</text>
<text @click.stop='openCard'>去添加</text>
<image :src='assetsUrl("ic_arrow_right_yellow.png")' />
</view>
@@ -68,6 +68,7 @@
import { assetsUrl, defaultAvatar } from '@/utils/assets';
import { goLogin, goPath, isLogin } from '@/utils';
import { isPending } from '@/utils/order';
import { getCardLink } from '@/api/user';
import { getOrderList } from '@/api/order';
import OfficialAccountDialog from '@/components/official-account-dialog.vue';
import { useUserStore } from '@/store';
@@ -111,7 +112,7 @@ const serviceList = [
}, {
title: '联系商家',
icon: assetsUrl('ic_member_service_contact.png'),
path: ''
path: 'call'
}
// ,{
// title: '推广中心',
@@ -120,14 +121,13 @@ const serviceList = [
// }
];
const title = ref<string>();
title.value = import.meta.env.VITE_APP_TITLE;
const store = useUserStore();
const { userInfo, companyConfigInfo } = storeToRefs(store);
const { userInfo, companyInfo, companyConfigInfo } = storeToRefs(store);
const cardLink = ref('');
const unPaidOrderCount = ref(0);
onLoad(() => {
if(!isLogin()) {
goLogin();
@@ -142,8 +142,29 @@ onShow(async () => {
obj: { payStatus: 1 }
});
unPaidOrderCount.value = list.filter((item: any) => isPending(item))?.length || 0;
const { cardurl } = await getCardLink();
cardLink.value = cardurl;
});
const openCard = () => {
// const url = 'https://mp.weixin.qq.com/bizmall/activatemembercard?action=preshow&&encrypt_card_id=LI%2FNyDp0x3z8XXorvvrHzSR4VUPa2vlioBg2xkDT3HqybiAFNsNgjH7pBpyKGrSA&outer_str=1702887425732870145&biz=MzU2MTg5MjgxMg%3D%3D#wechat_redirect';
goPath(`/pages/common/webview/index?url=${encodeURIComponent(cardLink.value)}`);
// uni.openCard({
// cardList: [{
// cardId: 'pzCtO1PD40kHdvcAU8kTfVILoebE',
// code: '261422541418'
// }
// // {
// // cardId: '',
// // code: ''
// // }
// ],
// success(res) {
//
// }
// });
};
const gotoPath = (path: string) => {
if(path === 'follow_official_account') {
showOfficialAccountDialog();
@@ -151,6 +172,10 @@ const gotoPath = (path: string) => {
uni.switchTab({
url: '/pages/qrcode/index'
});
} else if(path === 'call') {
uni.makePhoneCall({
phoneNumber: companyInfo.value.telphone
});
} else {
goPath(path);
}

View File

@@ -4,7 +4,7 @@
<image class='goods-image' :src='item?.orderGoods[0].images||defaultImage' />
<view class='c-flex-column' style='flex: 1;'>
<view class='c-flex-row'>
<text class='goods-name'>{{ item?.orderGoods[0].goodsName||'未知' }}</text>
<text class='goods-name'>{{ item?.orderGoods[0].goodsName || '未知' }}</text>
<text class='status'>
<text v-if='item?.payStatus == 2'>已支付</text>
<text v-else-if='isPending(item)'>待支付</text>
@@ -33,7 +33,8 @@
<view class='c-flex-row'>
<text class='add-shoppingcart secondary-text-color' @click.stop='add(item?.orderGoods[0])'>加入购物车</text>
<text class='payment accent-text-color' v-if='isPending(item)' @click.stop='goPath(`/pages/mine/subs/order/detail?orderId=${item?.id}`)'>立即支付
<text class='payment accent-text-color' v-if='isPending(item)'
@click.stop='goPath(`/pages/mine/subs/order/detail?orderId=${item?.id}`)'>立即支付
</text>
</view>
</view>
@@ -155,13 +156,14 @@ const pay = (orderId: string | undefined) => {
}
.add-shoppingcart {
border: 1rpx solid #ACACAC;
border: 2rpx solid #ACACAC;
}
.payment {
border: 1rpx solid #F32B2B;
border: 2rpx solid #F32B2B;
margin-left: 20rpx;
box-sizing: border-box;
}
}
}

View File

@@ -164,7 +164,7 @@ const buildSqbParams = computed(() => {
const params = sortASCII({
client_sn: orderBean.value?.order?.id || '',
return_url: '/pages/common/payresult/index',
total_amount: ((orderBean.value?.order?.totalPrice || 0) * 100).toString(),
total_amount: Number(((orderBean.value?.order?.totalPrice || 0) * 100).toFixed(2)),
terminal_sn: terminalInfo.value.terminalSn,
subject: '商品支付',
merchant_name: terminalInfo.value.companyName,
@@ -441,11 +441,12 @@ const payment = () => {
sqb-pay button {
padding: 0 45rpx;
border-radius: 50rpx;
border: 1rpx solid #F32B2B;
border: 2rpx solid #F32B2B;
font-weight: bold;
background: #FFFFFF;
font-size: 30rpx;
color: #F32B2B;
box-sizing: border-box;
}
}
</style>

View File

@@ -83,7 +83,7 @@ const buildSqbParams = computed(() => {
const params = sortASCII({
client_sn: preRechargeOrderId.value,
return_url: '/pages/common/payresult/index',
total_amount: ((rechargeItems.value[currentIndex.value]?.rechargeamount || 0) * 100).toString(),
total_amount: Number(((rechargeItems.value[currentIndex.value]?.rechargeamount || 0) * 100).toFixed(2)),
terminal_sn: terminalInfo.value.terminalSn,
subject: '充值',
merchant_name: terminalInfo.value.companyName,

View File

@@ -9,6 +9,7 @@ const useUserStore = defineStore('user', {
state: () => ({
userInfo: {} as UserBean,
terminalInfo: {} as TerminalBean,
companyInfo: {} as any,
companyConfigInfo: {
bannerhot: [] as any[],
bannerinx: [] as any[],
@@ -58,6 +59,10 @@ const useUserStore = defineStore('user', {
await this.fetchCompanyInfo();
},
setCompanyInfo(partial: Partial<any>) {
this.companyInfo = partial as any;
},
setDeliveryAddress(partial: Partial<any>) {
this.deliveryAddress = partial as any;
},