【fix】优化代码

This commit is contained in:
黄少君
2024-02-22 18:37:23 +08:00
parent 17c043348a
commit f8fac0a5bc
246 changed files with 973 additions and 406 deletions

View File

@ -9,7 +9,7 @@
import Header from '@/components/Header/index.vue'
import { useScroll } from "@/hooks/useScroll";
import { useJump } from "@/hooks/useJump";
import { useMainStore } from "@/store/store";
import { useMainStore } from "@/store/modules/useMainStore";
import { storeToRefs } from "pinia";
import { usePaging } from "@/hooks/usePaging";
import { pageUserBill } from "@/api/account/balance";
@ -34,7 +34,7 @@ onLoad(() => {
otherParams.value.category = 'now_money'
})
onShow(()=>{
onShow(() => {
refreshPage()
})
</script>

View File

@ -16,7 +16,7 @@ import { pageIntegralBill } from "@/api/account/integral";
import { usePaging } from "@/hooks/usePaging";
import moment from "moment";
import Empty from '@/components/Empty/index.vue'
import { useMainStore } from "@/store/store";
import { useMainStore } from "@/store/modules/useMainStore";
import { storeToRefs } from "pinia";
const {scrollTop} = useScroll();
@ -24,7 +24,7 @@ onPageScroll(() => {
})
const mainStore = useMainStore()
const {user} = storeToRefs(mainStore);
const {user, integralName} = storeToRefs(mainStore);
const filterTabs = [
{label: '全部', value: 99},
@ -63,14 +63,14 @@ onLoad(() => {
<Header
:scroll-top="scrollTop"
system-bar-area-bg="#fff"
header-area-bg="#fff"> 我的积分
header-area-bg="#fff"> 我的{{ integralName }}
</Header>
<view class="integral">
<!-- 积分展示 -->
<view
class="num-card"
:style="{backgroundImage:`url(${accountIntegralBg})`}">
<view class="title">当前积分</view>
<view class="title">当前{{ integralName }}</view>
<view class="num"> {{ user.integral || '0.00' }}</view>
</view>
<!-- tabs -->

View File

@ -170,7 +170,7 @@ onLoad(async (options) => {
<view class="ver-card">
<view class="title">支付方式</view>
<u-radio-group
<uv-radio-group
activeColor="#EE6D46"
v-model="rechargeForm.type"
placement="column"
@ -189,16 +189,26 @@ onLoad(async (options) => {
<text class="text">{{ item.label }}</text>
</view>
</view>
<u-radio
<uv-radio
:customStyle="{marginBottom: '8px'}"
label=" "
:name="item.value"
/>
</view>
</template>
</u-radio-group>
</uv-radio-group>
</view>
<view class="tips-content">
<view class="title">充值说明</view>
<view
class="content"
v-html="rechargeConfig.content"></view>
</view>
<view style="width: 100%;height: 140rpx"></view>
<view
class="btn-row row animation-button"
:class="{disabled:rechargeForm.amount<=0}"
@ -331,6 +341,20 @@ onLoad(async (options) => {
}
}
.tips-content {
width: 100%;
color: #999999;
.title {
font-size: 28rpx;
}
.content {
padding: 16rpx 0;
font-size: 24rpx;
}
}
.row {
margin-top: 24rpx;
}

View File

@ -14,7 +14,7 @@ import { accountSignInBg, accountSignOk, accountSignStar, accountSignSuccessBg }
import { onMounted, ref } from "vue";
import { getIntegralRule, getSignInInfo, signIn } from "@/api/account/signIn";
import { useInterface } from "@/hooks/useInterface";
import { useMainStore } from "@/store/store";
import { useMainStore } from "@/store/modules/useMainStore";
import { storeToRefs } from "pinia";
import Popup from "@/components/Popup.vue";
import moment from "moment";
@ -24,7 +24,7 @@ onPageScroll(() => {
})
const mainStore = useMainStore()
const {user} = storeToRefs(mainStore);
const {user, integralName} = storeToRefs(mainStore);
const {toast} = useInterface()
// 签到信息
@ -115,7 +115,7 @@ onMounted(() => {
<!-- 积分显示 -->
<view class="header-row flex flex-ai__end">
{{ user.integral || '0.00' }}
<text class="sub">积分</text>
<text class="sub">{{ integralName }}</text>
</view>
<!-- 签到显示 -->
<view class="sign-btn-row">
@ -141,7 +141,8 @@ onMounted(() => {
class="item flex flex-column flex-ai__center flex-jc__center "
:class="{none:!date.isSign}">
<view class="item-box flex flex-column flex-ai__center flex-jc__center">
<text>+{{ date.integral }}</text>
<text v-if="date.integral!==null">+{{ date.integral }}</text>
<text v-else>&emsp;</text>
<image :src="date.isSign?accountSignOk:accountSignStar" />
</view>
{{ moment(date.createTime).format("MM-DD") }}
@ -166,7 +167,7 @@ onMounted(() => {
<view class="row-info flex flex-ai__center flex-jc__sb">
<view class="left">
<view class="name">{{ task.typeName }}</view>
<view class="name">{{ task.typeName }}{{ task.attribute1 ? `${ task.attribute1 }` : '' }}</view>
<view class="sub flex flex-ai__center">
</view>
@ -193,7 +194,7 @@ onMounted(() => {
<view
class="count-row flex">
<view class="count">{{ successIntegral }}</view>
积分
{{ integralName }}
</view>
<view class="info">
签到成功恭喜您获得

View File

@ -15,7 +15,7 @@ import Popup from "@/components/Popup.vue";
import { getWithDrawMethodList, updateWithDrawMethod, withDrawNow } from "@/api/account/integral";
import { onLoad } from "@dcloudio/uni-app";
import { useRouter } from "@/hooks/useRouter";
import { useMainStore } from "@/store/store";
import { useMainStore } from "@/store/modules/useMainStore";
import { storeToRefs } from "pinia";
import { aliIcon, balanceIcon } from "@/utils/images";
import { cloneDeep } from "loadsh";
@ -155,13 +155,13 @@ onLoad(async (options) => {
</text>
</view>
<view class="row">
可提现金额{{ maxMoney }}
可提现金额{{ maxMoney.toFixed(2) }}
</view>
</view>
<view class="ver-card">
<view class="title">提现至</view>
<u-radio-group
<uv-radio-group
activeColor="#EE6D46"
v-model="methodCurrent"
placement="column"
@ -186,14 +186,14 @@ onLoad(async (options) => {
更新账户
</text>
</view>
<u-radio
<uv-radio
:customStyle="{marginBottom: '8px'}"
label=" "
:name="item.id"
/>
</view>
</template>
</u-radio-group>
</uv-radio-group>
</view>
<view

View File

@ -126,7 +126,7 @@ function h5CancelQrScan() {
<div
class="cancel"
@click="h5CancelQrScan">
<u-icon
<uv-icon
name="close"
color="#fff"
size="28" />

View File

@ -17,7 +17,7 @@ import { SharePathKey, useShare } from "@/hooks/useShare";
import { useRouter } from "@/hooks/useRouter";
import { getGroupByDetailTeamworkId } from "@/api/goods";
import { getTimeAfterNow } from "@/utils/utils";
import { useMainStore } from "@/store/store";
import { useMainStore } from "@/store/modules/useMainStore";
import GoodAttrSelect from "@/components/good-attr-select/good-attr-select.vue";
import { getProductDetail } from "@/api/product";
import { useInterface } from "@/hooks/useInterface";
@ -92,7 +92,7 @@ const skuNum = ref(1) // 选中sku下单数量
async function doGetGoodsDetail() {
goodsDetail.value = await getProductDetail({productId: groupDetail.value.id, skuId: groupDetail.value.skuId});
canDoOrder.value = true
groupByInvitationShare({...groupDetail.value,cartInfo:[{productInfo:{image:groupDetail.value.image}}]});
groupByInvitationShare({...groupDetail.value, cartInfo: [{productInfo: {image: groupDetail.value.image}}]});
const {productValue} = goodsDetail.value
for (const skuName in productValue) {
const sku = productValue[skuName]
@ -263,7 +263,7 @@ function takePartInAGroup() {
// ============================ 邀请 ==================================================
const {shareInfo,groupByInvitationShare, shareH5, shareAppMessage, shareTimeline} = useShare()
const {shareInfo, groupByInvitationShare, shareH5, shareAppMessage, shareTimeline} = useShare()
onShareAppMessage(shareAppMessage)
onShareTimeline(shareTimeline)
@ -357,7 +357,7 @@ function handleShareConfirm(shareItem) {
v-for="item in residuePersonNum"
:key="item"
@click="inviteFriend">
<u-icon name="plus" />
<uv-icon name="plus" />
</view>
</view>
<!-- 如果自己已经在团内 -->

View File

@ -10,7 +10,7 @@ import Header from '@/components/Header/index.vue'
import AddressSelect from '@/components/AddressSelect/index.vue'
import { useScroll } from "@/hooks/useScroll";
import { onLoad, onPageScroll, onShow } from "@dcloudio/uni-app";
import { useMainStore } from "@/store/store";
import { useMainStore } from "@/store/modules/useMainStore";
import { storeToRefs } from "pinia";
import { nextTick, ref } from "vue";
import { distributionAudit, distributionError } from "@/utils/images";
@ -244,7 +244,7 @@ onLoad(async (options) => {
v-else>
{{ form.address }}
</text>
<u-icon name="arrow-right" />
<uv-icon name="arrow-right" />
</div>
</view>
<view class="row">
@ -270,15 +270,15 @@ onLoad(async (options) => {
@click="handleSubmit">提交审核
</view>
<view class="agreement tips flex flex-ai__center">
<u-checkbox-group
<uv-checkbox-group
activeColor="#ed6d47"
shape="circle"
v-model="agreementFlag"
>
<u-checkbox
<uv-checkbox
name=""
/>
</u-checkbox-group>
</uv-checkbox-group>
勾选代表同意
<text
class="primary-color"

View File

@ -9,7 +9,7 @@
import Header from "@/components/Header/index.vue";
import { useScroll } from "@/hooks/useScroll";
import { onLoad, onPageScroll, onShareAppMessage, onShareTimeline, onShow } from "@dcloudio/uni-app";
import { useMainStore } from "@/store/store";
import { useMainStore } from "@/store/modules/useMainStore";
import { storeToRefs } from "pinia";
import { computed, ref } from "vue";
import { distributionCenterCardList, distributionCenterInfoList } from "@/views/distribution/center/index.data";

View File

@ -16,6 +16,7 @@ import { checkIsDistribution, getMyCommissionDetail, pageCommission } from "@/ap
import { emptyOrderIcon } from "@/utils/images";
import Empty from "@/components/Empty/index.vue";
import { useJump } from "@/hooks/useJump";
import UvDatetimePicker from "@/uni_modules/uv-datetime-picker/components/uv-datetime-picker/uv-datetime-picker.vue";
// ================================= hooks ================================
const {scrollTop} = useScroll()
@ -63,13 +64,12 @@ async function doCheckIsDistribution() {
onShow(() => {
doCheckIsDistribution()
refreshPage()
})
onLoad(() => {
otherParams.value.createTime = [`${ selectTimeStr.value } 00:00:00`, `${ selectTimeStr.value } 23:59:59`]
refreshPage()
doGetMyCommissionDetail()
})
// ======================== level tab ====================
@ -101,17 +101,17 @@ function leverSelect(value) {
// ============================ time ===========================
const selectTimeStr = ref(moment(Date.now()).format('YYYY-MM-DD'))
const datetimePicker = ref()
const showTime = ref(false)
const timeModelValue = ref(Date.now())
function doShowTime() {
showTime.value = true
datetimePicker.value.open()
}
function dateTimeConfirm(e) {
selectTimeStr.value = moment(e.value).format('YYYY-MM-DD')
otherParams.value.createTime = [`${ selectTimeStr.value } 00:00:00`, `${ selectTimeStr.value } 23:59:59`]
showTime.value = false
refreshPage()
doGetMyCommissionDetail()
}
@ -169,7 +169,7 @@ const statusType = ['待入账', '已入账', '已取消', '提现中', '提现
class="date flex flex-ai__center"
@click="doShowTime">
{{ selectTimeStr }}
<u-icon
<uv-icon
name="arrow-down"
color="#333" />
</view>
@ -225,8 +225,8 @@ const statusType = ['待入账', '已入账', '已取消', '提现中', '提现
</view>
<!-- 时间选择器 -->
<u-datetime-picker
:show="showTime"
<uv-datetime-picker
ref="datetimePicker"
v-model="timeModelValue"
mode="date"
@confirm="dateTimeConfirm"

View File

@ -9,7 +9,7 @@
import Header from '@/components/Header/index.vue'
import { useScroll } from "@/hooks/useScroll";
import { onPageScroll } from "@dcloudio/uni-app";
import { useMainStore } from "@/store/store";
import { useMainStore } from "@/store/modules/useMainStore";
import { storeToRefs } from "pinia";
import { checkIsDistribution } from "@/api/distribution";
import { ref } from "vue";

View File

@ -14,10 +14,11 @@ import GoodsCom from "@/components/goodsComponents/Goods.vue";
import { usePage } from "@/hooks";
import { getProductList } from "@/api/product";
import { useRouter } from "@/hooks/useRouter";
import { useMainStore } from "@/store/store";
import { useMainStore } from "@/store/modules/useMainStore";
import { useShare } from "@/hooks/useShare";
import GoodsSharePopup from '@/components/Share/Goods.vue'
import GoodsPoster from '@/components/Poster/Goods.vue'
import { useGlobalRequestStore } from "@/store/modules/useGlobalRequestStore";
const mainStore = useMainStore();
const {scrollTop} = useScroll()
@ -25,7 +26,7 @@ onPageScroll(() => {
})
const {refresh, dataList, loadend, loading, listEmpty, otherQuery} = usePage(getProductList)
const {shareAppMessage, shareTimeline, distributionGoodsDetailShare, shareH5} = useShare();
const globalRequestStore = useGlobalRequestStore();
onShareAppMessage(shareAppMessage)
onShareTimeline(shareTimeline)
const {push, getParams} = useRouter()
@ -48,6 +49,7 @@ function doShare(goods) {
}
async function shareConfirm(shareItem, goods) {
await globalRequestStore.doShareToAddIntegral()
distributionGoodsDetailShare(goods, distributorId.value)
if (shareItem.value === 'photo') {
goodsPoster.value.open(goods)

View File

@ -60,7 +60,7 @@ function leverSelect(value) {
leverTabs.value[4].time = []
leverCurrent.value = value
otherParams.value.createTime = leverTabs.value[leverCurrent.value].time
if(!otherParams.value.createTime || otherParams.value.createTime.length<=0){
if (!otherParams.value.createTime || otherParams.value.createTime.length <= 0) {
delete otherParams.value.createTime
}
refreshPage()
@ -86,7 +86,7 @@ function timeChange(e) {
// ===================== data ==============================
const {otherParams, list, loading, refreshPage} = usePaging({
request: pageDistributionOrder,
load:false
load: false
});
const distributionDetail = ref({
@ -101,7 +101,7 @@ const distributionDetail = ref({
*/
async function doGetDistributionDetail() {
const data = {}
if(otherParams.value.createTime&&otherParams.value.createTime.length>0){
if (otherParams.value.createTime && otherParams.value.createTime.length > 0) {
data.createTime = otherParams.value.createTime
}
distributionDetail.value = await getDistributionDetail(data);
@ -109,7 +109,7 @@ async function doGetDistributionDetail() {
onLoad(() => {
otherParams.value.createTime = leverTabs.value[leverCurrent.value].time
if(!otherParams.value.createTime || otherParams.value.createTime.length<=0){
if (!otherParams.value.createTime || otherParams.value.createTime.length <= 0) {
delete otherParams.value.createTime
}
refreshPage()
@ -161,7 +161,9 @@ onLoad(() => {
v-for="item in list"
:data="item" />
</template>
<Empty :icon-src="emptyOrderIcon" />
<Empty
v-else
:icon-src="emptyOrderIcon" />
</view>
</view>
<!-- 时间选择器 -->
@ -256,9 +258,10 @@ onLoad(() => {
<style>
// #ifdef MP-WEIXIN
.uni-date{
.uni-date {
position: absolute;
top: -500px!important;
top: -500px !important;
}
// #endif
</style>

View File

@ -16,7 +16,7 @@ import InviteFriends from "@/components/Share/InviteFriends.vue";
import InviteFriendsPoster from "@/components/Poster/InviteFriends.vue";
import { useShare } from "@/hooks/useShare";
import { useMainStore } from "@/store/store";
import { useMainStore } from "@/store/modules/useMainStore";
import { onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app";
const {scrollTop} = useScroll();