mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2026-06-24 02:40:13 +08:00
refactor:项目升级Vue3+uView Plus
- 改造入口文件、全量替换组件引入 - 过滤器迁移混入,更新忽略配置,新增迁移文档
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<u-popup v-model="enableShowCoupon" mode="center" width="550rpx" height="400px">
|
||||
<u-popup v-model:show="enableShowCoupon" mode="center" width="550rpx" height="400px">
|
||||
<view style="height: 130rpx">
|
||||
<view
|
||||
style="
|
||||
@@ -32,14 +32,13 @@
|
||||
>{{ item.discount }}折</view
|
||||
>
|
||||
<view v-else
|
||||
>优惠金额:<span style="color: red; font-size: 32rpx">{{
|
||||
item.price | unitPrice
|
||||
>优惠金额:<span style="color: red; font-size: 32rpx">{{unitPrice(item.price)
|
||||
}}</span
|
||||
>元</view
|
||||
>
|
||||
<view
|
||||
>满<span style="color: red; font-size: 32rpx"
|
||||
>{{ item.consumeThreshold | unitPrice }}元</span
|
||||
>{{unitPrice(item.consumeThreshold) }}元</span
|
||||
>可用</view
|
||||
>
|
||||
<view v-if="item.scopeType == 'ALL' && item.storeId == '0'"
|
||||
@@ -100,7 +99,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
firstGetAuto() {
|
||||
if(!this.$options.filters.isLogin('auth')) return false
|
||||
if(!this.isLogin('auth')) return false
|
||||
let data = new Date();
|
||||
let now = data.getDate();
|
||||
let hours = data.getHours();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="layout">
|
||||
<div class="box">
|
||||
<u-swiper @click="clickSwiper" interval="5000" duration="500" height="350" v-if="res" name="img" :list="res.list">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
<template #loading><u-loading></u-loading></template>
|
||||
</u-swiper>
|
||||
</div>
|
||||
</div>
|
||||
@@ -16,7 +16,7 @@ export default {
|
||||
watch: {
|
||||
res: {
|
||||
handler(newValue, oldValue) {
|
||||
this.$set(this, "res", newValue);
|
||||
this["res"] = newValue;
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<u-image width="140rpx" mode="aspectFit" height="140rpx" @click="modelNavigateTo(item)" class="image-mode" v-for="(item,index) in res.list" :key="index" :src="item.img" alt="">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
<template #loading><u-loading></u-loading></template>
|
||||
</u-image>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<u-image height="175rpx" mode="aspectFit" width="175rpx" @click="modelNavigateTo(item)" class="image-mode" :src="item.img" v-for="(item,index) in res.list" :key="index">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
<template #loading><u-loading></u-loading></template>
|
||||
</u-image>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<u-image @click="modelNavigateTo(item)" height="240rpx" width="240rpx" class="image-mode" :src="item.img" v-for="(item, index) in res.list" :key="index">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
<template #loading><u-loading></u-loading></template>
|
||||
</u-image>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -3,23 +3,21 @@
|
||||
<div class="flex-two">
|
||||
<div class="flex-item" @click="modelNavigateTo(res.list[0])">
|
||||
<u-image height="250rpx" width="100%" mode="scaleToFill" :src="res.list[0].img" alt>
|
||||
<u-loading slot="loading"></u-loading>
|
||||
<template #loading><u-loading></u-loading></template>
|
||||
</u-image>
|
||||
</div>
|
||||
<div class="flex-item" @click="modelNavigateTo(res.list[1])">
|
||||
<u-image height="250rpx" width="100%" mode="scaleToFill" :src="res.list[1].img" alt>
|
||||
<u-loading slot="loading"></u-loading>
|
||||
<template #loading><u-loading></u-loading></template>
|
||||
</u-image>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import uImage from "@/uview-ui/components/u-image/u-image.vue";
|
||||
import { modelNavigateTo } from "./tpl";
|
||||
export default {
|
||||
components: { uImage },
|
||||
title: "两张横图",
|
||||
title: "两张横图",
|
||||
props: ["res"],
|
||||
mounted() {
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
mode="aspectFit"
|
||||
width="100%"
|
||||
>
|
||||
<u-loading slot="loading"></u-loading>
|
||||
<template #loading><u-loading></u-loading></template>
|
||||
</u-image>
|
||||
</div>
|
||||
<div class="goods-desc">
|
||||
@@ -43,8 +43,8 @@
|
||||
<div class="goods-bottom">
|
||||
<div class="goods-price">
|
||||
¥<span
|
||||
>{{ $options.filters.goodsFormatPrice(item.price)[0] }} </span
|
||||
>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
|
||||
>{{ goodsFormatPrice(item.price)[0] }} </span
|
||||
>.{{ goodsFormatPrice(item.price)[1] }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -64,7 +64,7 @@
|
||||
mode="aspectFit"
|
||||
width="100%"
|
||||
>
|
||||
<u-loading slot="loading"></u-loading>
|
||||
<template #loading><u-loading></u-loading></template>
|
||||
</u-image>
|
||||
</div>
|
||||
<div class="goods-desc">
|
||||
@@ -74,8 +74,8 @@
|
||||
<div class="goods-bottom">
|
||||
<div class="goods-price">
|
||||
¥<span
|
||||
>{{ $options.filters.goodsFormatPrice(item.price)[0] }} </span
|
||||
>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
|
||||
>{{ goodsFormatPrice(item.price)[0] }} </span
|
||||
>.{{ goodsFormatPrice(item.price)[1] }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
<div class="layout">
|
||||
<div class="view-height-150" @click="modelNavigateTo(res.list[0])">
|
||||
<u-image width="100%" height="340rpx" class="image-mode" :src="res.list[0].img">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
<template #loading><u-loading></u-loading></template>
|
||||
</u-image>
|
||||
</div>
|
||||
<div class="view-height-150">
|
||||
<div class="view-height-75" @click="modelNavigateTo(res.list[1])">
|
||||
<u-image width="100%" height="170rpx" class="image-mode" :src="res.list[1].img" alt>
|
||||
<u-loading slot="loading"></u-loading>
|
||||
<template #loading><u-loading></u-loading></template>
|
||||
</u-image>
|
||||
</div>
|
||||
<div class="view-height-75" @click="modelNavigateTo(res.list[2])">
|
||||
<u-image width="100%" height="170rpx" class="image-mode" :src="res.list[2].img" alt>
|
||||
<u-loading slot="loading"></u-loading>
|
||||
<template #loading><u-loading></u-loading></template>
|
||||
</u-image>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
class="menu-img"
|
||||
:src="item.img"
|
||||
>
|
||||
<u-loading slot="loading"></u-loading>
|
||||
<template #loading><u-loading></u-loading></template>
|
||||
</u-image>
|
||||
</div>
|
||||
<div class="menu-title">{{ item.title }}</div>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<u-icon name="search"></u-icon>
|
||||
{{ res.list[0].title }}
|
||||
</div>
|
||||
<div slot="right" open-type="contact" class="navbar-right message" @click="linkMsgDetail" style="border-style:none;background:rgb(234,234,234);" >
|
||||
<div class="navbar-right message" @click="linkMsgDetail" style="border-style:none;background:rgb(234,234,234);">
|
||||
<image style="width:53rpx;height:53rpx;margin-top:6rpx;" src="@/static/img/title.png"></image>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
<div class="layout">
|
||||
<div class="view-width-100" @click="modelNavigateTo(res.list[0])">
|
||||
<u-image class="image-mode" width="100%" height="200rpx" :src="res.list[0].img">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
<template #loading><u-loading></u-loading></template>
|
||||
</u-image>
|
||||
</div>
|
||||
<div class="view-width-100" @click="modelNavigateTo(res.list[1])">
|
||||
<div class="view-height-85">
|
||||
<u-image class="image-mode" width="100%" height="170rpx" :src="res.list[1].img">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
<template #loading><u-loading></u-loading></template>
|
||||
</u-image>
|
||||
</div>
|
||||
<div class="view-height-85" @click="modelNavigateTo(res.list[2])">
|
||||
<u-image class="image-mode" width="100%" height="170rpx" :src="res.list[2].img">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
<template #loading><u-loading></u-loading></template>
|
||||
</u-image>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
width="100%"
|
||||
:src="res.list[0].img"
|
||||
alt
|
||||
><u-loading slot="loading"></u-loading
|
||||
><u-loading #loading></u-loading
|
||||
></u-image>
|
||||
</div>
|
||||
<div class="view-height-85" @click="modelNavigateTo(res.list[1])">
|
||||
@@ -18,7 +18,7 @@
|
||||
width="100%"
|
||||
:src="res.list[1].img"
|
||||
alt
|
||||
><u-loading slot="loading"></u-loading
|
||||
><u-loading #loading></u-loading
|
||||
></u-image>
|
||||
</div>
|
||||
</div>
|
||||
@@ -28,7 +28,7 @@
|
||||
height="200rpx"
|
||||
width="100%"
|
||||
:src="res.list[2].img"
|
||||
><u-loading slot="loading"></u-loading
|
||||
><u-loading #loading></u-loading
|
||||
></u-image>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
</view>
|
||||
<u-cell-group v-if="current == 0">
|
||||
<view v-for="(item,index) in lists" :key="index">
|
||||
<u-cell-item :arrow="false" v-if="item.status =='UN_READY'" style="position: relative;"
|
||||
<u-cell :isLink="false" v-if="item.status =='UN_READY'" style="position: relative;"
|
||||
@click="linkMsgDetail(item)">
|
||||
<template slot="label">
|
||||
<template #label>
|
||||
<view style="display: inline-block;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
@@ -26,15 +26,15 @@
|
||||
</view>
|
||||
</template>
|
||||
<!-- <button style="width:100rpx;height:60rpx;float:right;font-size:20rpx;line-height:60rpx;background:#000000;color:white;">未读</button> -->
|
||||
</u-cell-item>
|
||||
</u-cell>
|
||||
</view>
|
||||
|
||||
</u-cell-group>
|
||||
<u-cell-group v-if="current == 1">
|
||||
<view v-for="(item,index) in lists" :key="index">
|
||||
<u-cell-item :arrow="false" v-if="item.status == 'ALREADY_READY'" style="position: relative;"
|
||||
<u-cell :isLink="false" v-if="item.status == 'ALREADY_READY'" style="position: relative;"
|
||||
@click="linkMsgDetail(item)">
|
||||
<template slot="label">
|
||||
<template #label>
|
||||
<view style="display: inline-block;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
@@ -51,7 +51,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<!-- <button style="width:100rpx;height:60rpx;float:right;font-size:20rpx;line-height:60rpx;background:#F3F3FA;color:black;">已读</button> -->
|
||||
</u-cell-item>
|
||||
</u-cell>
|
||||
</view>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
@@ -150,7 +150,7 @@
|
||||
this.getMessage()
|
||||
},
|
||||
getMessage() {
|
||||
this.params.memberId = this.$options.filters.isLogin().id;
|
||||
this.params.memberId = this.isLogin().id;
|
||||
|
||||
messages(this.params).then(res => {
|
||||
console.log(res)
|
||||
|
||||
@@ -3,13 +3,15 @@
|
||||
<!-- uni 中不能使用 vue component 所以用if判断每个组件 -->
|
||||
<div v-for="(item, index) in pageData.list" :key="index">
|
||||
<!-- 搜索栏,如果在楼层装修顶部则会自动浮动,否则不浮动 -->
|
||||
<u-navbar class="navbar" v-if="item.type == 'search'" :is-back="false" :is-fixed="index === 1 ? false : true">
|
||||
<u-navbar class="navbar" v-if="item.type == 'search'" :auto-back="false" :fixed="index === 1 ? false : true">
|
||||
<search style="width: 100%" :res="item.options" />
|
||||
<!-- #ifndef H5 -->
|
||||
<!-- 扫码功能 不兼容h5 详情文档: https://uniapp.dcloud.io/api/system/barcode?id=scancode -->
|
||||
<div slot="right" class="navbar-right">
|
||||
<u-icon name="scan" @click="scan()" color="#666" size="50"></u-icon>
|
||||
</div>
|
||||
<template #right>
|
||||
<div class="navbar-right">
|
||||
<u-icon name="scan" @click="scan()" color="#666" size="50"></u-icon>
|
||||
</div>
|
||||
</template>
|
||||
<!-- #endif -->
|
||||
</u-navbar>
|
||||
<carousel v-if="item.type == 'carousel'" :res="item.options" />
|
||||
|
||||
Reference in New Issue
Block a user