mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2026-08-06 19:07:23 +08:00
refactor: 更新u-tabs组件使用方式及样式调整
This commit is contained in:
@@ -1,24 +1,26 @@
|
|||||||
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
{
|
||||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
// launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||||
"version": "0.0",
|
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||||
"configurations": [{
|
"version" : "0.0",
|
||||||
"app-plus" :
|
"configurations" : [
|
||||||
{
|
{
|
||||||
"launchtype" : "remote"
|
"app-plus" : {
|
||||||
},
|
"launchtype" : "remote"
|
||||||
"default" :
|
},
|
||||||
{
|
"default" : {
|
||||||
"launchtype" : "remote"
|
"launchtype" : "remote"
|
||||||
},
|
},
|
||||||
"h5" :
|
"h5" : {
|
||||||
{
|
"launchtype" : "remote"
|
||||||
"launchtype" : "remote"
|
},
|
||||||
},
|
"mp-weixin" : {
|
||||||
"mp-weixin" :
|
"launchtype" : "remote"
|
||||||
{
|
},
|
||||||
"launchtype" : "remote"
|
"type" : "uniCloud"
|
||||||
},
|
},
|
||||||
"type" : "uniCloud"
|
{
|
||||||
}
|
"playground" : "standard",
|
||||||
|
"type" : "uni-app:app-android"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -415,8 +415,6 @@ export default {
|
|||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.formatSku(this.goodsSpec);
|
this.formatSku(this.goodsSpec);
|
||||||
|
|
||||||
console.log("goodsDetail",this.goodsDetail)
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -437,9 +435,9 @@ export default {
|
|||||||
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep.u-icon-plus,
|
::v-deep .u-icon-plus,
|
||||||
.u-icon-minus,
|
::v-deep .u-icon-minus,
|
||||||
.u-icon-disabled {
|
::v-deep .u-icon-disabled {
|
||||||
height: 30rpx !important;
|
height: 30rpx !important;
|
||||||
background: #fff !important;
|
background: #fff !important;
|
||||||
}
|
}
|
||||||
@@ -541,7 +539,7 @@ export default {
|
|||||||
color: #999;
|
color: #999;
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
|
|
||||||
::v-deep span {
|
.goods-price-bigshow {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,20 +79,15 @@ export default {
|
|||||||
this.$emit("input", !this.value);
|
this.$emit("input", !this.value);
|
||||||
},
|
},
|
||||||
getStatusBar() {
|
getStatusBar() {
|
||||||
let promise = new Promise((resolve, reject) => {
|
const windowInfo = uni.getWindowInfo();
|
||||||
uni.getSystemInfo({
|
// #ifdef H5
|
||||||
success: function (e) {
|
return Promise.resolve(
|
||||||
let customBar;
|
(windowInfo.statusBarHeight || 0) + (windowInfo.windowTop || 0)
|
||||||
// #ifdef H5
|
);
|
||||||
|
// #endif
|
||||||
customBar = e.statusBarHeight + e.windowTop;
|
// #ifndef H5
|
||||||
|
return Promise.resolve(windowInfo.statusBarHeight || 0);
|
||||||
// #endif
|
// #endif
|
||||||
resolve(customBar);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
return promise;
|
|
||||||
},
|
},
|
||||||
async popupsPosition() {
|
async popupsPosition() {
|
||||||
let statusBar = await this.getStatusBar();
|
let statusBar = await this.getStatusBar();
|
||||||
@@ -104,6 +99,10 @@ export default {
|
|||||||
size: true,
|
size: true,
|
||||||
},
|
},
|
||||||
(data) => {
|
(data) => {
|
||||||
|
if (!data) {
|
||||||
|
resolve();
|
||||||
|
return;
|
||||||
|
}
|
||||||
let width = data.width;
|
let width = data.width;
|
||||||
let height = data.height;
|
let height = data.height;
|
||||||
|
|
||||||
@@ -154,8 +153,7 @@ export default {
|
|||||||
return promise;
|
return promise;
|
||||||
},
|
},
|
||||||
getPlacement(x, y) {
|
getPlacement(x, y) {
|
||||||
let width = uni.getSystemInfoSync().windowWidth;
|
const { windowWidth: width, windowHeight: height } = uni.getWindowInfo();
|
||||||
let height = uni.getSystemInfoSync().windowHeight;
|
|
||||||
if (x > width / 2 && y > height / 2) {
|
if (x > width / 2 && y > height / 2) {
|
||||||
return "bottom-end";
|
return "bottom-end";
|
||||||
} else if (x < width / 2 && y < height / 2) {
|
} else if (x < width / 2 && y < height / 2) {
|
||||||
@@ -171,20 +169,21 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
dynamicGetY(y, gap) {
|
dynamicGetY(y, gap) {
|
||||||
let height = uni.getSystemInfoSync().windowHeight;
|
const { windowHeight: height } = uni.getWindowInfo();
|
||||||
y = y < gap ? gap : y;
|
y = y < gap ? gap : y;
|
||||||
y = height - y < gap ? height - gap : y;
|
y = height - y < gap ? height - gap : y;
|
||||||
|
|
||||||
return y;
|
return y;
|
||||||
},
|
},
|
||||||
dynamicGetX(x, gap) {
|
dynamicGetX(x, gap) {
|
||||||
let width = uni.getSystemInfoSync().windowWidth;
|
const { windowWidth: width } = uni.getWindowInfo();
|
||||||
x = x < gap ? gap : x;
|
x = x < gap ? gap : x;
|
||||||
x = width - x < gap ? width - gap : x;
|
x = width - x < gap ? width - gap : x;
|
||||||
return x;
|
return x;
|
||||||
},
|
},
|
||||||
transformRpx(params) {
|
transformRpx(params) {
|
||||||
return (params * uni.getSystemInfoSync().screenWidth) / 375;
|
const { screenWidth } = uni.getWindowInfo();
|
||||||
|
return (params * screenWidth) / 375;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
10
main.js
10
main.js
@@ -10,9 +10,7 @@ import * as filterUtils from './utils/filters.js'
|
|||||||
export function createApp() {
|
export function createApp() {
|
||||||
const app = createSSRApp(App)
|
const app = createSSRApp(App)
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
// uview-plus 内部会触发 Vue3 开发态告警(枚举组件实例 keys),不影响运行
|
||||||
// 微信开发者工具部分版本在输出 Vue warn 时会触发
|
|
||||||
// TypeError: Cannot read property '__global' of null,自定义 handler 绕过默认路径
|
|
||||||
app.config.warnHandler = (msg, _instance, trace) => {
|
app.config.warnHandler = (msg, _instance, trace) => {
|
||||||
if (
|
if (
|
||||||
typeof msg === 'string' &&
|
typeof msg === 'string' &&
|
||||||
@@ -23,10 +21,12 @@ export function createApp() {
|
|||||||
try {
|
try {
|
||||||
console.warn(`[Vue warn]: ${msg}${trace || ''}`)
|
console.warn(`[Vue warn]: ${msg}${trace || ''}`)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// 忽略开发者工具 console 代理异常
|
// #ifdef MP-WEIXIN
|
||||||
|
// 微信开发者工具部分版本在输出 Vue warn 时会触发
|
||||||
|
// TypeError: Cannot read property '__global' of null
|
||||||
|
// #endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// #endif
|
|
||||||
|
|
||||||
app.use(store)
|
app.use(store)
|
||||||
app.use(uviewPlus)
|
app.use(uviewPlus)
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<u-tabs
|
<u-tabs
|
||||||
|
class="coupon-tabs"
|
||||||
:list="list"
|
:list="list"
|
||||||
:is-scroll="false"
|
:scrollable="false"
|
||||||
:active-color="lightColor"
|
:lineColor="lightColor"
|
||||||
:current="current"
|
:activeStyle="{ color: lightColor }"
|
||||||
@change="
|
v-model:current="current"
|
||||||
(i) => {
|
|
||||||
current = i;
|
|
||||||
}
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
</u-tabs>
|
</u-tabs>
|
||||||
|
|
||||||
@@ -160,6 +157,11 @@ export default {
|
|||||||
.wrapper {
|
.wrapper {
|
||||||
background: #f9f9f9;
|
background: #f9f9f9;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
|
.coupon-tabs {
|
||||||
|
width: 100%;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.coupon-item {
|
.coupon-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
<u-tabs
|
<u-tabs
|
||||||
:list="list"
|
:list="list"
|
||||||
:is-scroll="false"
|
:scrollable="false"
|
||||||
:current="current"
|
v-model:current="current"
|
||||||
@change="change"
|
:lineColor="lightColor"
|
||||||
:active-color="$lightColor"
|
:activeStyle="{ color: lightColor }"
|
||||||
></u-tabs>
|
></u-tabs>
|
||||||
|
|
||||||
|
|
||||||
@@ -53,6 +53,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
current:0,
|
current:0,
|
||||||
|
lightColor: this.$lightColor,
|
||||||
list: [
|
list: [
|
||||||
{
|
{
|
||||||
name: "推广人资料",
|
name: "推广人资料",
|
||||||
|
|||||||
@@ -10,12 +10,12 @@
|
|||||||
<template #center>
|
<template #center>
|
||||||
<view class="slot-wrap">
|
<view class="slot-wrap">
|
||||||
<u-tabs
|
<u-tabs
|
||||||
:active-color="lightColor"
|
:lineColor="lightColor"
|
||||||
|
:activeStyle="{ color: lightColor }"
|
||||||
class="collect-tabs"
|
class="collect-tabs"
|
||||||
:list="navList"
|
:list="navList"
|
||||||
:is-scroll="true"
|
:scrollable="true"
|
||||||
:current="tabCurrentIndex"
|
v-model:current="tabCurrentIndex"
|
||||||
@change="tabClick"
|
|
||||||
></u-tabs>
|
></u-tabs>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -206,13 +206,6 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* 顶部tab点击
|
|
||||||
*/
|
|
||||||
tabClick(index) {
|
|
||||||
this.tabCurrentIndex = index;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查看商品详情
|
* 查看商品详情
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="u-tabs-box">
|
<view class="u-tabs-box">
|
||||||
<u-tabs
|
<u-tabs
|
||||||
bg-color="#fff"
|
|
||||||
:list="list"
|
:list="list"
|
||||||
:is-scroll="false"
|
:scrollable="false"
|
||||||
:current="current"
|
v-model:current="current"
|
||||||
@change="change"
|
@change="change"
|
||||||
:active-color="$lightColor"
|
:lineColor="$lightColor"
|
||||||
|
:activeStyle="{ color: $lightColor }"
|
||||||
></u-tabs>
|
></u-tabs>
|
||||||
</view>
|
</view>
|
||||||
<div class="u-tabs-search">
|
<div class="u-tabs-search">
|
||||||
@@ -272,7 +272,8 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 切换tab页时,初始化数据
|
* 切换tab页时,初始化数据
|
||||||
*/
|
*/
|
||||||
change(index) {
|
change(e) {
|
||||||
|
const index = typeof e === 'object' && e != null ? e.index : e;
|
||||||
this.current = index;
|
this.current = index;
|
||||||
this.params = {
|
this.params = {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
|
|||||||
@@ -2,8 +2,15 @@
|
|||||||
<view>
|
<view>
|
||||||
<view class="wrap">
|
<view class="wrap">
|
||||||
<view class="u-tabs-box">
|
<view class="u-tabs-box">
|
||||||
<u-tabs :list="list" :is-scroll="false" inactive-color="#333" :current="current" class="utabs"
|
<u-tabs
|
||||||
:active-color="$lightColor" @change="changeTab"></u-tabs>
|
:list="list"
|
||||||
|
:scrollable="false"
|
||||||
|
:inactiveStyle="{ color: '#333' }"
|
||||||
|
v-model:current="current"
|
||||||
|
class="utabs"
|
||||||
|
:lineColor="$lightColor"
|
||||||
|
:activeStyle="{ color: $lightColor }"
|
||||||
|
></u-tabs>
|
||||||
</view>
|
</view>
|
||||||
<swiper class="swiper-box" :current="current" @change="changeSwiper" duration="500">
|
<swiper class="swiper-box" :current="current" @change="changeSwiper" duration="500">
|
||||||
<swiper-item v-for="(item, listIndex) in list" :key="listIndex">
|
<swiper-item v-for="(item, listIndex) in list" :key="listIndex">
|
||||||
@@ -183,13 +190,6 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* 点击tab触发
|
|
||||||
*/
|
|
||||||
changeTab(index) {
|
|
||||||
this.current = index;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 点击swiper
|
* 点击swiper
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -219,14 +219,14 @@
|
|||||||
</u-col>
|
</u-col>
|
||||||
</u-row>
|
</u-row>
|
||||||
<u-row>
|
<u-row>
|
||||||
<u-col :offset="0" :span="4" class="tl" style="text-align: left"
|
<u-col :offset="0" :span="4" class="tl">备注信息</u-col>
|
||||||
>备注信息</u-col
|
<u-col :span="8" textAlign="right" class="remark-col">
|
||||||
>
|
|
||||||
<u-col :span="8" textAlign="right">
|
|
||||||
<u-input
|
<u-input
|
||||||
style="text-align: right"
|
|
||||||
class="uinput"
|
class="uinput"
|
||||||
v-model="remarkVal[index].remark"
|
v-model="remarkVal[index].remark"
|
||||||
|
border="none"
|
||||||
|
input-align="right"
|
||||||
|
placeholder="请输入备注信息"
|
||||||
/>
|
/>
|
||||||
</u-col>
|
</u-col>
|
||||||
</u-row>
|
</u-row>
|
||||||
@@ -239,12 +239,15 @@
|
|||||||
@callbackInvoice="callbackInvoice"
|
@callbackInvoice="callbackInvoice"
|
||||||
v-if="invoiceFlag"
|
v-if="invoiceFlag"
|
||||||
/>
|
/>
|
||||||
<u-select
|
<u-picker
|
||||||
@confirm="confirmDistribution"
|
|
||||||
v-model:show="shippingFlag"
|
v-model:show="shippingFlag"
|
||||||
v-if="shippingMethod.length != 0"
|
v-if="shippingMethod.length != 0"
|
||||||
:list="shippingMethod"
|
:columns="[shippingMethod]"
|
||||||
></u-select>
|
keyName="label"
|
||||||
|
valueName="value"
|
||||||
|
title="配送方式"
|
||||||
|
@confirm="confirmDistribution"
|
||||||
|
></u-picker>
|
||||||
|
|
||||||
<div class="box box5" v-if="orderMessage.priceDetailDTO">
|
<div class="box box5" v-if="orderMessage.priceDetailDTO">
|
||||||
<div>
|
<div>
|
||||||
@@ -284,9 +287,9 @@
|
|||||||
orderMessage.priceDetailDTO.goodsPrice != null
|
orderMessage.priceDetailDTO.goodsPrice != null
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<u-col :offset="0" :span="9" @click="GET_Discount()">优惠券</u-col>
|
<u-col :offset="0" :span="8" @click="GET_Discount()">优惠券</u-col>
|
||||||
<u-col
|
<u-col
|
||||||
:span="3"
|
:span="4"
|
||||||
v-if="
|
v-if="
|
||||||
orderMessage.priceDetailDTO &&
|
orderMessage.priceDetailDTO &&
|
||||||
orderMessage.priceDetailDTO.couponPrice
|
orderMessage.priceDetailDTO.couponPrice
|
||||||
@@ -299,9 +302,11 @@
|
|||||||
>
|
>
|
||||||
</u-col>
|
</u-col>
|
||||||
<!--unitPrice(orderMessage.priceDetailDTO.couponPrice) -->
|
<!--unitPrice(orderMessage.priceDetailDTO.couponPrice) -->
|
||||||
<u-col :span="3" v-else textAlign="right" @click="GET_Discount()">
|
<u-col :span="4" v-else textAlign="right" class="coupon-col" @click="GET_Discount()">
|
||||||
{{ orderMessage.canUseCoupons.length || "0" }} 张可用
|
<view class="coupon-col__content">
|
||||||
<u-icon name="arrow-right"></u-icon>
|
<text>{{ orderMessage.canUseCoupons.length || "0" }} 张可用</text>
|
||||||
|
<u-icon name="arrow-right" size="14" color="#909399"></u-icon>
|
||||||
|
</view>
|
||||||
</u-col>
|
</u-col>
|
||||||
</u-row>
|
</u-row>
|
||||||
<div>
|
<div>
|
||||||
@@ -759,12 +764,16 @@ export default {
|
|||||||
|
|
||||||
// 选择配送
|
// 选择配送
|
||||||
async confirmDistribution(val) {
|
async confirmDistribution(val) {
|
||||||
|
const selected = val?.value?.[0] || val?.[0];
|
||||||
|
if (!selected?.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let res = await API_Trade.setShipMethod({
|
let res = await API_Trade.setShipMethod({
|
||||||
shippingMethod: val[0].value,
|
shippingMethod: selected.value,
|
||||||
way: this.routerVal.way,
|
way: this.routerVal.way,
|
||||||
});
|
});
|
||||||
|
|
||||||
this.shippingText = val[0].value;
|
this.shippingText = selected.value;
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.getOrderList();
|
this.getOrderList();
|
||||||
}
|
}
|
||||||
@@ -868,9 +877,21 @@ page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.uinput {
|
.uinput {
|
||||||
::v-deep input {
|
width: 100%;
|
||||||
text-align: right;
|
|
||||||
|
::v-deep .u-input {
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
::v-deep .u-input__content__field-wrapper__field {
|
||||||
|
text-align: right;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.remark-col {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
.promotionNotice {
|
.promotionNotice {
|
||||||
@@ -967,6 +988,15 @@ page {
|
|||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.coupon-col__content {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
gap: 4rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
.bar {
|
.bar {
|
||||||
height: 4rpx;
|
height: 4rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|||||||
@@ -461,34 +461,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
const { windowHeight } = uni.getSystemInfoSync();
|
this.calcProductHeight();
|
||||||
let bottomHeight = 0;
|
|
||||||
let topHeight = 0;
|
|
||||||
uni.getSystemInfo({
|
|
||||||
success: function (res) {
|
|
||||||
// res - 各种参数
|
|
||||||
let bottom = uni.createSelectorQuery().select(".page-bottom");
|
|
||||||
bottom
|
|
||||||
.boundingClientRect(function (data) {
|
|
||||||
if (data && data.height) {
|
|
||||||
//data - 各种参数
|
|
||||||
bottomHeight = data.height; // 获取元素宽度
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.exec();
|
|
||||||
let top = uni.createSelectorQuery().select(".header");
|
|
||||||
top
|
|
||||||
.boundingClientRect(function (data) {
|
|
||||||
if (data && data.height) {
|
|
||||||
//data - 各种参数
|
|
||||||
topHeight = data.height; // 获取元素宽度
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.exec();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
this.productRefHeight = windowHeight - bottomHeight + "px";
|
|
||||||
},
|
},
|
||||||
async onLoad (options) {
|
async onLoad (options) {
|
||||||
this.routerVal = options;
|
this.routerVal = options;
|
||||||
@@ -516,6 +489,19 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
calcProductHeight () {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
const { windowHeight } = uni.getWindowInfo();
|
||||||
|
uni.createSelectorQuery()
|
||||||
|
.in(this)
|
||||||
|
.select('#pageBottom')
|
||||||
|
.boundingClientRect((data) => {
|
||||||
|
const bottomHeight = data && data.height ? data.height : 0;
|
||||||
|
this.productRefHeight = `${windowHeight - bottomHeight}px`;
|
||||||
|
})
|
||||||
|
.exec();
|
||||||
|
});
|
||||||
|
},
|
||||||
// 重新打开下架
|
// 重新打开下架
|
||||||
reStartTakeDownSale(){
|
reStartTakeDownSale(){
|
||||||
this.$refs.takeDownSale.show = true
|
this.$refs.takeDownSale.show = true
|
||||||
|
|||||||
@@ -82,7 +82,13 @@
|
|||||||
|
|
||||||
<!-- 基础店铺模式 -->
|
<!-- 基础店铺模式 -->
|
||||||
<div v-if="basePageData">
|
<div v-if="basePageData">
|
||||||
<u-tabs :list="tabs" :active-color="mainColor" :is-scroll="false" :current="current" @change="changeTab"></u-tabs>
|
<u-tabs
|
||||||
|
:list="tabs"
|
||||||
|
:lineColor="mainColor"
|
||||||
|
:activeStyle="{ color: mainColor }"
|
||||||
|
:scrollable="false"
|
||||||
|
v-model:current="current"
|
||||||
|
></u-tabs>
|
||||||
<div class="content" v-if="current == 0">
|
<div class="content" v-if="current == 0">
|
||||||
<u-empty style='margin-top:100rpx' v-if="goodsList.length == 0" class="empty" text='暂无商品信息'></u-empty>
|
<u-empty style='margin-top:100rpx' v-if="goodsList.length == 0" class="empty" text='暂无商品信息'></u-empty>
|
||||||
<goodsTemplate style="width:100%;" v-else :res="goodsList" :storeName="false" />
|
<goodsTemplate style="width:100%;" v-else :res="goodsList" :storeName="false" />
|
||||||
@@ -396,11 +402,6 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 点击tab */
|
|
||||||
changeTab(index) {
|
|
||||||
this.current = index;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺信息
|
* 店铺信息
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -9,7 +9,16 @@
|
|||||||
<u-swiper @click="clickSwiper" class="swiper" keyName="image" :list="swiperImg">
|
<u-swiper @click="clickSwiper" class="swiper" keyName="image" :list="swiperImg">
|
||||||
|
|
||||||
</u-swiper>
|
</u-swiper>
|
||||||
<u-tabs :is-scroll="false" @change="changeTabs" :current="current" :active-color="activeColor" inactive-color="#606266" ref="tabs" :list="tabs"></u-tabs>
|
<u-tabs
|
||||||
|
:scrollable="false"
|
||||||
|
v-model:current="current"
|
||||||
|
@change="changeTabs"
|
||||||
|
:lineColor="activeColor"
|
||||||
|
:activeStyle="{ color: activeColor }"
|
||||||
|
:inactiveStyle="{ color: '#606266' }"
|
||||||
|
ref="tabs"
|
||||||
|
:list="tabs"
|
||||||
|
></u-tabs>
|
||||||
|
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<!-- 直播中 全部 直播回放 -->
|
<!-- 直播中 全部 直播回放 -->
|
||||||
@@ -114,8 +123,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 点击标签栏切换
|
* 点击标签栏切换
|
||||||
*/
|
*/
|
||||||
changeTabs(index) {
|
changeTabs() {
|
||||||
this.current = index;
|
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<image src="/static/emptyCart.png" mode="aspectFit"></image>
|
<image src="/static/emptyCart.png" mode="aspectFit"></image>
|
||||||
<view class="empty-tips">
|
<view class="empty-tips">
|
||||||
空空如也
|
空空如也
|
||||||
<navigator class="navigator" url="/pages/tabbar/home/index" open-type="switchTab">随便逛逛></navigator>
|
<navigator class="navigator" url="/pages/tabbar/home/index" open-type="switchTab">随便逛逛</navigator>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 店铺商品信息 -->
|
<!-- 店铺商品信息 -->
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view>
|
<view>
|
||||||
<u-tabs :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
|
<u-tabs
|
||||||
|
:list="list"
|
||||||
|
:scrollable="false"
|
||||||
|
v-model:current="current"
|
||||||
|
@change="change"
|
||||||
|
></u-tabs>
|
||||||
<view v-if="showLoading" style="width:500rpx;margin:0 auto;text-align: center;height:800rpx;line-height: 800rpx;">
|
<view v-if="showLoading" style="width:500rpx;margin:0 auto;text-align: center;height:800rpx;line-height: 800rpx;">
|
||||||
<u-loading mode="flower" ></u-loading>
|
<u-loading mode="flower" ></u-loading>
|
||||||
<text>正在加载中</text>
|
<text>正在加载中</text>
|
||||||
@@ -136,13 +141,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
change(e) {
|
change(e) {
|
||||||
|
const index = typeof e === 'object' && e != null ? e.index : e;
|
||||||
this.showLoading = true;
|
this.showLoading = true;
|
||||||
console.log(e)
|
this.current = index;
|
||||||
this.current = e;
|
if (index == 0) {
|
||||||
if (e == 0) {
|
|
||||||
this.params.status = "UN_READY"
|
this.params.status = "UN_READY"
|
||||||
this.params.pageNumber = 1;
|
this.params.pageNumber = 1;
|
||||||
} else if (e == 1) {
|
} else if (index == 1) {
|
||||||
this.params.status = "ALREADY_READY"
|
this.params.status = "ALREADY_READY"
|
||||||
this.params.pageNumber = 1;
|
this.params.pageNumber = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -263,18 +263,85 @@ index 1ca7595..b1e4a3e 100644
|
|||||||
+ * 原有 page/body 标签选择器与 [data-up-theme] 属性选择器,
|
+ * 原有 page/body 标签选择器与 [data-up-theme] 属性选择器,
|
||||||
+ * 在微信小程序组件级 wxss 中不被允许,会触发编译告警,故移除。 */
|
+ * 在微信小程序组件级 wxss 中不被允许,会触发编译告警,故移除。 */
|
||||||
diff --git a/node_modules/uview-plus/components/u-tabs/u-tabs.vue b/node_modules/uview-plus/components/u-tabs/u-tabs.vue
|
diff --git a/node_modules/uview-plus/components/u-tabs/u-tabs.vue b/node_modules/uview-plus/components/u-tabs/u-tabs.vue
|
||||||
index 46caac2..5736483 100644
|
index 46caac2..0989e2e 100644
|
||||||
--- a/node_modules/uview-plus/components/u-tabs/u-tabs.vue
|
--- a/node_modules/uview-plus/components/u-tabs/u-tabs.vue
|
||||||
+++ b/node_modules/uview-plus/components/u-tabs/u-tabs.vue
|
+++ b/node_modules/uview-plus/components/u-tabs/u-tabs.vue
|
||||||
@@ -3,7 +3,7 @@
|
@@ -1,11 +1,11 @@
|
||||||
|
<template>
|
||||||
|
- <view class="u-tabs" :class="[customClass, shapeModeClass]">
|
||||||
|
+ <view class="u-tabs" :class="[customClass, shapeModeClass, scrollable ? '' : 'u-tabs--fixed']">
|
||||||
<view class="u-tabs__wrapper">
|
<view class="u-tabs__wrapper">
|
||||||
<slot name="left" />
|
<slot name="left" />
|
||||||
<view class="u-tabs__wrapper__scroll-view-wrapper">
|
<view class="u-tabs__wrapper__scroll-view-wrapper">
|
||||||
- <scroll-view :scroll-x="scrollable" :scroll-left="scrollLeft" scroll-with-animation
|
- <scroll-view :scroll-x="scrollable" :scroll-left="scrollLeft" scroll-with-animation
|
||||||
+ <scroll-view :scroll-x="scrollable" :scroll-left="scrollLeft" scroll-with-animation :enable-flex="true"
|
+ <scroll-view :scroll-x="scrollable" :scroll-left="scrollLeft" scroll-with-animation :enable-flex="true"
|
||||||
class="u-tabs__wrapper__scroll-view" :show-scrollbar="false" ref="u-tabs__wrapper__scroll-view">
|
class="u-tabs__wrapper__scroll-view" :show-scrollbar="false" ref="u-tabs__wrapper__scroll-view">
|
||||||
<view class="u-tabs__wrapper__nav" ref="u-tabs__wrapper__nav">
|
- <view class="u-tabs__wrapper__nav" ref="u-tabs__wrapper__nav">
|
||||||
|
+ <view class="u-tabs__wrapper__nav" ref="u-tabs__wrapper__nav" :style="[!scrollable && { width: '100%' }]">
|
||||||
<view class="u-tabs__wrapper__nav__item" v-for="(item, index) in tabList" :key="index"
|
<view class="u-tabs__wrapper__nav__item" v-for="(item, index) in tabList" :key="index"
|
||||||
|
@tap="clickHandler(item, index)" @longpress="longPressHandler(item,index)"
|
||||||
|
:ref="`u-tabs__wrapper__nav__item-${index}`"
|
||||||
|
@@ -236,7 +236,7 @@
|
||||||
|
addUnit,
|
||||||
|
setLineLeft() {
|
||||||
|
const tabItem = this.tabList[this.innerCurrent];
|
||||||
|
- if (!tabItem) {
|
||||||
|
+ if (!tabItem || !tabItem.rect) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 获取滑块该移动的位置
|
||||||
|
@@ -300,16 +300,22 @@
|
||||||
|
})
|
||||||
|
},
|
||||||
|
setScrollLeft() {
|
||||||
|
+ if (!this.scrollable) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
// 当前活动tab的布局信息,有tab菜单的width和left(为元素左边界到父元素左边界的距离)等信息
|
||||||
|
if (this.innerCurrent < 0) {
|
||||||
|
this.innerCurrent = 0;
|
||||||
|
}
|
||||||
|
const tabRect = this.tabList[this.innerCurrent]
|
||||||
|
+ if (!tabRect || !tabRect.rect) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
// 累加得到当前item到左边的距离
|
||||||
|
const offsetLeft = this.tabList
|
||||||
|
.slice(0, this.innerCurrent)
|
||||||
|
.reduce((total, curr) => {
|
||||||
|
- return total + curr.rect.width
|
||||||
|
+ return total + (curr.rect ? curr.rect.width : 0)
|
||||||
|
}, 0)
|
||||||
|
// 此处为屏幕宽度
|
||||||
|
const windowWidth = getWindowInfo().windowWidth
|
||||||
|
@@ -550,5 +556,27 @@
|
||||||
|
background-color: #2a6bf6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ &--fixed {
|
||||||
|
+ width: 100%;
|
||||||
|
+
|
||||||
|
+ .u-tabs__wrapper {
|
||||||
|
+ width: 100%;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ .u-tabs__wrapper__scroll-view-wrapper,
|
||||||
|
+ .u-tabs__wrapper__scroll-view {
|
||||||
|
+ width: 100%;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ .u-tabs__wrapper__nav {
|
||||||
|
+ width: 100%;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ .u-tabs__wrapper__nav__item {
|
||||||
|
+ flex: 1 !important;
|
||||||
|
+ min-width: 0;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
</style>
|
||||||
diff --git a/node_modules/uview-plus/components/u-tag/theme-vars.scss b/node_modules/uview-plus/components/u-tag/theme-vars.scss
|
diff --git a/node_modules/uview-plus/components/u-tag/theme-vars.scss b/node_modules/uview-plus/components/u-tag/theme-vars.scss
|
||||||
index bf38484..b1e4a3e 100644
|
index bf38484..b1e4a3e 100644
|
||||||
--- a/node_modules/uview-plus/components/u-tag/theme-vars.scss
|
--- a/node_modules/uview-plus/components/u-tag/theme-vars.scss
|
||||||
|
|||||||
Reference in New Issue
Block a user