【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

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