Merge branch 'dev' into 'master'

uniapp【优化】: 适配支付宝和app端

See merge request jianweie/coreshoppro!56
This commit is contained in:
花城
2024-10-25 09:18:29 +00:00
32 changed files with 182 additions and 228 deletions

View File

@@ -2,6 +2,10 @@
// launchtype项可配置值为local或remote, local代表前端连本地云函数remote代表前端连云端云函数
"version": "0.0",
"configurations": [{
"app-plus" :
{
"launchtype" : "local"
},
"default" :
{
"launchtype" : "local"

View File

@@ -1,6 +1,6 @@
<template>
<uv-button :text="props.title" :loading="props.loading"
:custom-style="{'border-radius':radiusComp,'height':'100%','width':'100%','background-color':props.backgroundColor,'color':props.color,...customStyleComp}"
:custom-style="{'border-radius':radiusComp,'height':'100%' ,'background-color':props.backgroundColor,'color':props.color,...customStyleComp}"
@click="onClick()"></uv-button>
</template>

View File

@@ -1,7 +1,15 @@
<template>
<view class="fix-bottom-btn">
<!-- #ifdef MP-ALIPAY -->
<view class="btn">
<coreshop-button class="btn" v-bind="$attrs" @onClick="onClick()"></coreshop-button>
</view>
<!-- #endif -->
<!-- #ifndef MP-ALIPAY -->
<coreshop-button class="btn" v-bind="$attrs" @onClick="onClick()"></coreshop-button>
<!-- #endif -->
</view>
</template>
<script setup lang="ts">

View File

@@ -35,6 +35,8 @@
<!-- #ifdef MP-WEIXIN -->
<uv-button v-if="state.agreement" :customStyle="{ 'width': '100%' }" openType="getPhoneNumber"
@getphonenumber="getPhoneNumber" type="success" size="normal" text="确定授权"></uv-button>
<uv-button v-else @click="handleClickOk" :customStyle="{ 'width': '100%' }" type="success"
size="normal" text="确定授权"></uv-button>
<!-- #endif -->
<!-- #ifdef MP-ALIPAY -->
<uv-button v-if="state.agreement" :customStyle="{ 'width': '100%' ,'position':'relative'}"
@@ -44,9 +46,9 @@
<view class="btn-tit">确定授权</view>
</button>
</uv-button>
<!-- #endif -->
<uv-button v-else @click="handleClickOk" :customStyle="{ 'width': '100%' }" type="success"
size="normal" text="确定授权"></uv-button>
<!-- #endif -->
</view>
</view>
</view>
@@ -57,7 +59,7 @@
import { useShopConfigStore, useUserInfoStore } from '@/core/store';
import type { Response } from '@/core/models';
import { Invitecode, UserToken } from '@/core/consts';
import { queryLoginPhoneNumber, queryLogin, queryAliPayAppAuthTokenBYCode ,queryDecryptPhoneNumberByAli} from '@/core/api';
import { queryLoginPhoneNumber, queryLogin, queryAliPayAppAuthTokenBYCode, queryDecryptPhoneNumberByAli } from '@/core/api';
import { loginGetCode, handleShowToast, handleRouteNavigateTo } from '@/core/utils';
/** 获取项目配置 */
@@ -86,7 +88,13 @@
watch(() => props.show, (newVal : boolean) => {
if (newVal) {
// #ifdef MP-ALIPAY || MP-WEIXIN
loginPopup.value.open();
// #endif
// #ifndef MP-WEIXIN || MP-ALIPAY
handleRouteNavigateTo(`/pages/login/login`)
// #endif
} else {
loginPopup.value.close();
}

View File

@@ -12,11 +12,15 @@ export const useSystemInfo = () => {
});
onMounted(async () => {
const menuButton = uni.getMenuButtonBoundingClientRect();
const systemInfo = await uni.getSystemInfo();
onMounted(() => {
const systemInfo = uni.getSystemInfoSync();
state.systemInfo = systemInfo;
// #ifndef APP
const menuButton = uni.getMenuButtonBoundingClientRect();
state.menuButtonHeight = menuButton.height + (menuButton.top - systemInfo.statusBarHeight) * 2;
// #endif
state.statusBarHeight = systemInfo.statusBarHeight + state.menuButtonHeight;
})

View File

@@ -4,7 +4,6 @@
display: flex;
align-items: center;
justify-content: space-between;
max-width: 500rpx;
.page-name {
font-size: 32rpx;
margin-right: 20rpx;

View File

@@ -5,10 +5,16 @@
<!-- #ifndef MP-ALIPAY -->
<uv-navbar bgColor="#EEF3F7" :height="menuButtonHeight+'px'">
<template #left>
<view class="search-box">
<!-- #ifdef MP -->
<view class="search-box" style="max-width: 500rpx;">
<!-- #endif -->
<!-- #ifdef APP -->
<view class="search-box" style="width: 700rpx;">
<!-- #endif -->
<view class="page-name">分类</view>
<uv-input v-model="state.keyWord" @confirm="handleSearch" shape="circle" placeholder="请输入关键词"
prefixIcon="search" :customStyle="{ 'background-color': '#fff' ,'padding':'3px 9px'}"
<uv-input v-model="state.keyWord" @confirm="handleSearch" shape="circle"
placeholder="请输入关键词" prefixIcon="search"
:customStyle="{ 'background-color': '#fff' ,'padding':'3px 9px'}"
prefixIconStyle="font-size: 22px;color: #909399">
<template #suffix>
<view class="search-tit" @click.stop="handleSearch">搜索</view>
@@ -38,7 +44,7 @@
</template>
<script setup lang="ts">
import { onMounted, reactive, nextTick, watchEffect, ref } from 'vue';
import { onMounted, reactive, watchEffect, ref } from 'vue';
import { onHide, onPullDownRefresh } from '@dcloudio/uni-app';
import { useShopConfigStore } from '@/core/store';
import { queryAllCategories } from '@/core/api';
@@ -78,7 +84,7 @@
})
watchEffect(() => {
state.height = systemInfo.value.screenHeight - statusBarHeight.value - systemInfo.value.safeAreaInsets?.bottom - 50;
state.height = systemInfo.value.windowHeight - statusBarHeight.value ;
})
onHide(() => {

View File

@@ -48,7 +48,7 @@
code: null,
intervalTime: null,
codeText: '获取验证码',
codeTime: 3,
codeTime: 60,
isCounting: false,
})

View File

@@ -408,8 +408,9 @@
left: 0;
bottom: 0;
padding-bottom: calc(calc(env(safe-area-inset-bottom) / 2));
background-color: #eef2f6;
background-color: #fff;
width: 100%;
box-shadow: 0 0 15rpx #eee;
z-index: 9;
.fixed-btn {
padding: 20rpx;

View File

@@ -210,14 +210,13 @@
left: 0;
border-top: solid 1px #f2f2f2;
background-color: #ffffff;
height: calc(50px + env(safe-area-inset-bottom) / 2);
padding-bottom: calc(env(safe-area-inset-bottom) / 2);
z-index: 99;
display: flex;
align-items: center;
justify-content: space-between;
.btn-box {
padding: 0 20rpx;
padding: 20rpx;
width: calc(100% - 40rpx);
display: flex;
align-items: center;

View File

@@ -27,8 +27,12 @@
display: flex;
justify-content: space-between;
align-items: center;
gap: 20rpx;
.order{
margin-right: 10rpx;
}
.order_price{
margin-left: 10rpx;
}
.order_price,
.order {
padding: 20rpx;
@@ -49,8 +53,12 @@
display: flex;
justify-content: space-between;
margin-top: 20rpx;
gap: 20rpx;
.statistics_order{
margin-right: 10rpx;
}
.statistics_price{
margin-left: 10rpx;
}
.statistics_order,
.statistics_price {
padding: 20rpx;

View File

@@ -1,7 +1,7 @@
<template>
<coreshop-page title="分销订单" mode="left">
<view class="content-box">
<view class="content" :style="{'top':`${statusBarHeight}px`}">
<view class="content">
<view class="header">
<view class="team">
<view class="order">
@@ -118,12 +118,8 @@
import { queryAgentOrderSum, queryAgentMyOrder } from '@/core/api';
import type { Response } from '@/core/models';
import { timeFormat } from '@/uni_modules/uv-ui-tools/libs/function/index.js';
import { useSystemInfo } from '@/core/hooks';
import { EmptyEnum } from '@/core/enum';
/** 获取自定义导航栏高度 */
const { statusBarHeight } = useSystemInfo();
const state = reactive<{
orderStatus : Array<{ name : string, id : number }>;
orderInfo : any;

View File

@@ -1,8 +1,5 @@
.list {
padding: 25rpx;
display: flex;
flex-direction: column;
gap: 20rpx;
.item {
display: flex;
@@ -11,7 +8,7 @@
background-color: #ffffff;
border-radius: 16rpx;
padding: 20rpx;
margin-bottom: 20rpx;
.rank {
display: flex;
align-items: center;

View File

@@ -15,13 +15,17 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: 20rpx;
.label {
font-size: 28rpx;
color: #6e737d;
}
.left{
margin-right: 10rpx;
}
.right{
margin-left: 10rpx;
}
.left,
.right {
background-color: #ffffff;

View File

@@ -123,7 +123,7 @@
<style scoped lang="scss">
.form {
padding: 30rpx 25rpx 0;
padding: 30rpx 25rpx;
margin-top: 50rpx;
.item {

View File

@@ -21,12 +21,12 @@
<rich-text :nodes="shopConfigStore.config?.distributionNotes"></rich-text>
</view>
</view>
<view class="btn-box">
<coreshop-button v-if="state.info?.conditionStatus" class="btn" title="申请" :radius="50"
@onClick="onApplyFormVisible()"></coreshop-button>
<coreshop-button v-else backgroundColor="rgba(211,49,35,.5)" class="btn" title="您的条件暂不满足"
:radius="50"></coreshop-button>
</view>
<coreshop-fixed-bottom-button v-if="state.info?.conditionStatus" :radius="100" title="申请"
@onClick="onApplyFormVisible()"></coreshop-fixed-bottom-button>
<coreshop-fixed-bottom-button v-else :radius="100" title="您的条件暂不满足"
ackgroundColor="rgba(211,49,35,.5)"></coreshop-fixed-bottom-button>
<uv-popup ref="applyFormPopupRef" mode="bottom" :round="8" :closeOnClickOverlay="false" closeable>
<ApplyForm @onSave="onApply()" />
</uv-popup>
@@ -141,24 +141,4 @@
margin-top: 20rpx;
}
}
.btn-box {
position: fixed;
left: 0;
bottom: 0;
width: calc(100% - 40rpx);
padding-left: 20rpx;
padding-right: 20rpx;
border-top: solid 1px #f2f2f2;
background-color: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
height: calc(50px + env(safe-area-inset-bottom) / 2);
padding-bottom: calc(env(safe-area-inset-bottom) / 2);
.btn {
width: 100%;
}
}
</style>

View File

@@ -27,8 +27,12 @@
display: flex;
justify-content: space-between;
align-items: center;
gap: 20rpx;
.order{
margin-right: 10rpx;
}
.order_price{
margin-left: 10rpx;
}
.order_price,
.order {
padding: 20rpx;
@@ -49,8 +53,12 @@
display: flex;
justify-content: space-between;
margin-top: 20rpx;
gap: 20rpx;
.statistics_order{
margin-right: 10rpx;
}
.statistics_price{
margin-left: 10rpx;
}
.statistics_order,
.statistics_price {
padding: 20rpx;

View File

@@ -1,7 +1,7 @@
<template>
<coreshop-page title="分销订单" mode="left">
<view class="content-box">
<view class="content" :style="{'top':`${statusBarHeight}px`}">
<view class="content" >
<view class="header">
<view class="team">
<view class="order">
@@ -119,9 +119,6 @@
import { useSystemInfo } from '@/core/hooks';
import { EmptyEnum } from '@/core/enum';
/** 获取自定义导航栏高度 */
const { statusBarHeight } = useSystemInfo();
const state = reactive<{
orderStatus : Array<{ name : string, id : number }>;
orderInfo : any;

View File

@@ -1,8 +1,5 @@
.list {
padding: 25rpx;
display: flex;
flex-direction: column;
gap: 20rpx;
.item {
display: flex;
@@ -11,7 +8,7 @@
background-color: #ffffff;
border-radius: 16rpx;
padding: 20rpx;
margin-bottom: 20rpx;
.rank {
display: flex;
align-items: center;

View File

@@ -15,13 +15,17 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: 20rpx;
.label {
font-size: 28rpx;
color: #6e737d;
}
.left{
margin-right: 10rpx;
}
.right{
margin-left: 10rpx;
}
.left,
.right {
background-color: #ffffff;

View File

@@ -109,30 +109,3 @@
font-size: 28rpx;
}
}
.btn-box {
position: fixed;
bottom: 0;
left: 0;
width: calc(100% - 40rpx);
padding-left: 20rpx;
padding-right: 20rpx;
border-top: solid 1px #f2f2f2;
background-color: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
height: calc(50px + env(safe-area-inset-bottom) / 2);
padding-bottom: calc(env(safe-area-inset-bottom) / 2);
z-index: 99;
.btn {
width: 100%;
height: 90rpx;
text-align: center;
line-height: 90rpx;
background-color: #d33123;
border-radius: 200px;
color: #fff;
font-size: 27rpx;
}
}

View File

@@ -91,9 +91,6 @@
</view>
<!-- 按钮 -->
<!-- <view class="btn-box">
<view class="btn" @click="handlesubmit">提交</view>
</view> -->
<coreshop-fixed-bottom-button :loading="loading" title="提交"
@onClick="handlesubmit()"></coreshop-fixed-bottom-button>
</view>

View File

@@ -128,11 +128,13 @@
padding-right: 20rpx;
border-top: solid 1px #f2f2f2;
background-color: #ffffff;
padding-bottom: calc(env(safe-area-inset-bottom) / 2);
.btn-padding{
padding: 20rpx 0;
display: flex;
align-items: center;
justify-content: space-between;
height: calc(50px + env(safe-area-inset-bottom) / 2);
padding-bottom: calc(env(safe-area-inset-bottom) / 2);
}
.btn {
width: 100%;
text-align: center;

View File

@@ -145,11 +145,15 @@
<!-- 底部按钮 -->
<view class="btn-box"
v-if="state.aftersalesInfo?.status == AftersalesStatusEnum.approvedReview && state.aftersalesInfo?.billReship?.status == AftersalesBillReshipStatusEnum.awaiting">
<view class="btn-padding">
<view class="btn" @click="handleSubmit">提交</view>
</view>
</view>
<view class="btn-box" v-if="isShowAgainApplyAftersalesBtn">
<view class="btn-padding">
<view class="btn" @click="handleAgainApply">再次申请售后</view>
</view>
</view>
</view>
</coreshop-page>

View File

@@ -185,13 +185,13 @@
<style scoped lang="scss">
.form {
padding: 40rpx 40rpx 0;
padding: 40rpx;
.tip {
text-align: center;
font-size: 38rpx;
color: #292B2E;
margin-bottom: 80rpx;
margin-bottom: 40rpx;
}
.item {
@@ -212,7 +212,7 @@
.save {
display: block;
margin-top: 100rpx;
margin-top: 50rpx;
}
}
</style>

View File

@@ -36,8 +36,6 @@
.recharge-type {
display: flex;
flex-wrap: wrap;
gap: 20rpx 4%;
.recharge-item {
background-color: #f3f1f1;
display: flex;
@@ -48,12 +46,16 @@
border-radius: 8rpx;
font-size: 28rpx;
color: #292b2e;
margin-bottom: 20rpx;
margin-right: 20rpx;
&.recharge-item-activated {
background-color: #d33123;
color: #ffffff;
}
}
.recharge-item:nth-of-type(2n) {
margin-right: 0;
}
}
}
@@ -64,22 +66,3 @@
margin-top: 32rpx;
}
}
.pay {
position: fixed;
left: 0;
bottom: 0;
width: calc(100% - 40rpx);
padding-left: 20rpx;
padding-right: 20rpx;
border-top: solid 1px #f2f2f2;
background-color: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
height: calc(50px + env(safe-area-inset-bottom) / 2);
padding-bottom: calc(env(safe-area-inset-bottom) / 2);
.btn {
width: 100%;
}
}

View File

@@ -53,7 +53,6 @@
left: 0;
border-top: solid 1px #f2f2f2;
background-color: #ffffff;
height: calc(50px + env(safe-area-inset-bottom) / 2);
padding-bottom: calc(env(safe-area-inset-bottom) / 2);
z-index: 99;
display: flex;
@@ -61,7 +60,7 @@
justify-content: space-between;
.btn-box {
padding: 0 20rpx;
padding:20rpx;
width: calc(100% - 40rpx);
display: flex;
align-items: center;

View File

@@ -291,12 +291,14 @@
padding-right: 20rpx;
border-top: solid 1px #f2f2f2;
background-color: #ffffff;
padding-bottom: calc(env(safe-area-inset-bottom) / 2);
.btn-box{
width: 100%;
padding: 20rpx 0;
display: flex;
align-items: center;
justify-content: space-between;
height: calc(50px + env(safe-area-inset-bottom) / 2);
padding-bottom: calc(env(safe-area-inset-bottom) / 2);
}
.bottom-btn-box {
flex: 1;
display: flex;

View File

@@ -303,6 +303,7 @@
<!-- 底部按钮信息 -->
<view class="layout-btn-box" v-if="!state.data">
<view class="btn-box">
<view class="bottom-btn-box"
v-if="state.orderDetail?.status == OrderStatusEnum.pending || state.orderDetail?.status == OrderStatusEnum.complete">
<view class="m-r-20" v-if="state.orderDetail?.status == OrderStatusEnum.pending &&
@@ -350,6 +351,7 @@
text="联系客服"></uv-button>
</view>
</view>
</view>
</coreshop-page>
</template>
<script setup lang="ts">

View File

@@ -19,29 +19,3 @@
}
}
}
.btn-box {
position: fixed;
left: 0;
bottom: 0;
width: calc(100% - 40rpx);
padding-left: 20rpx;
padding-right: 20rpx;
border-top: solid 1px #f2f2f2;
background-color: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
height: calc(50px + env(safe-area-inset-bottom) / 2);
padding-bottom: calc(env(safe-area-inset-bottom) / 2);
.btn {
background-color: #d33123;
text-align: center;
font-size: 28rpx;
width: 100%;
line-height: 80rpx;
color: #fff;
border-radius: 300px;
}
}

View File

@@ -34,9 +34,8 @@
</view>
</view>
<view class="btn-box">
<view class="btn" @click="handleSubmit">提交评价</view>
</view>
<coreshop-fixed-bottom-button :radius="100" title="提交评价"
@onClick="handleSubmit"></coreshop-fixed-bottom-button>
</view>
</coreshop-page>
</template>

View File

@@ -64,7 +64,6 @@
left: 0;
border-top: solid 1px #f2f2f2;
background-color: #ffffff;
height: calc(50px + env(safe-area-inset-bottom) / 2);
padding-bottom: calc(env(safe-area-inset-bottom) / 2);
z-index: 99;
display: flex;
@@ -72,7 +71,7 @@
justify-content: space-between;
.btn-box {
padding: 0 20rpx;
padding: 20rpx;
width: calc(100% - 40rpx);
display: flex;
align-items: center;