no message
This commit is contained in:
174
pages/home/index.js
Normal file
174
pages/home/index.js
Normal file
@@ -0,0 +1,174 @@
|
||||
var e = require("../../common/vendor.js"),
|
||||
n = require("../../hooks/onMounted.js"),
|
||||
t = require("../../hooks/onShow.js"),
|
||||
r = require("../../hooks/onShareAppMessage.js"),
|
||||
u = require("../../hooks/useState.js"),
|
||||
o = require("../../data/index.js"),
|
||||
i = require("../../utils/navigate.js"),
|
||||
a = require("../../service/index.js"),
|
||||
c = require("../../enums/index.js");
|
||||
require("../../utils/util.js"),
|
||||
require("../../constant/index.js"),
|
||||
require("../../config/index.js"),
|
||||
require("../../store/app/index.js"),
|
||||
require("../../utils/request.js"),
|
||||
Math || (e.unref(s) + e.unref(f))();
|
||||
var s = function () {
|
||||
return "../../components/popup-order/index.js";
|
||||
},
|
||||
f = function () {
|
||||
return "../../components/popup-coupon/index.js";
|
||||
},
|
||||
d = {
|
||||
__name: "index",
|
||||
setup: function (s) {
|
||||
var f = u.useState(),
|
||||
d = f.totalOrderNum,
|
||||
p = f.setTotalOrderNum,
|
||||
l = f.actionList,
|
||||
m = e.ref(!1),
|
||||
v = e.ref(""),
|
||||
h = e.ref(!1),
|
||||
g = e.ref(0),
|
||||
T = function () {
|
||||
var e = m.value || h.value;
|
||||
return "height: 100%; overflow: "
|
||||
.concat(e ? "hidden" : "visible", "; position: ")
|
||||
.concat(e ? "fixed" : "relative");
|
||||
},
|
||||
E = function () {
|
||||
a.getOrderNum().then(function (n) {
|
||||
var t = n.num;
|
||||
p({ totalOrderNum: t }),
|
||||
t > 0 && e.index.showTabBarRedDot({ index: 1 });
|
||||
});
|
||||
},
|
||||
j = function (e) {
|
||||
var n = e.url,
|
||||
t = e.params;
|
||||
i.navigateTo({ url: n, params: t });
|
||||
},
|
||||
x = function () {
|
||||
m.value = !1;
|
||||
},
|
||||
S = function () {
|
||||
(h.value = !1), g.value++;
|
||||
};
|
||||
return (
|
||||
n.onMounted(function () {
|
||||
e.index.$on("refreshOrderDetail", function (n) {
|
||||
return (function (n) {
|
||||
a.getOrderDetail({ order_no: n })
|
||||
.then(function (n) {
|
||||
var t = e._.find(n.productIdList, function (e) {
|
||||
return e.status === c.ProductStatusEnum.TO_BE_UPLOADED;
|
||||
});
|
||||
n.status === c.OrderStatusEnum.UNPAID
|
||||
? (v.value = "存在一笔待支付订单")
|
||||
: (v.value = t ? "存在待上传行驶证订单" : ""),
|
||||
(m.value = !!v.value);
|
||||
})
|
||||
.catch(function () {
|
||||
m.value = !1;
|
||||
});
|
||||
})(n);
|
||||
}),
|
||||
e.index.$on("refreshOrderNum", function () {
|
||||
0 === d.value && E();
|
||||
}),
|
||||
E(),
|
||||
g.value++;
|
||||
}, !1),
|
||||
t.onShow(function () {
|
||||
(!e.index.getStorageSync("fisrtIn") ||
|
||||
e.index.getStorageSync("fisrtIn") < 2) &&
|
||||
1 === g.value &&
|
||||
(setTimeout(function () {
|
||||
h.value = !0;
|
||||
}, 500),
|
||||
console.log("onShow"));
|
||||
}),
|
||||
r.onShareAppMessage(),
|
||||
function (n, t) {
|
||||
return e.e(
|
||||
{ a: T(), b: 0 === e.unref(l).length },
|
||||
0 === e.unref(l).length
|
||||
? {
|
||||
c: e.f([1, 2, 3, 4, 5, 6, 7, 8], function (e, n, t) {
|
||||
return { a: n };
|
||||
}),
|
||||
}
|
||||
: {},
|
||||
{ d: e.unref(l).length > 0 },
|
||||
e.unref(l).length > 0
|
||||
? {
|
||||
e: e.f(e.unref(l), function (n, t, r) {
|
||||
return e.e(
|
||||
{
|
||||
a: n.icon,
|
||||
b: e.t(n.name),
|
||||
c:
|
||||
n.params.productType ===
|
||||
e.unref(c.ProductTypeEnum).OVERALL,
|
||||
},
|
||||
(n.params.productType,
|
||||
e.unref(c.ProductTypeEnum).OVERALL,
|
||||
{}),
|
||||
{
|
||||
d:
|
||||
n.params.productType ===
|
||||
e.unref(c.ProductTypeEnum).VEHICLE_INFO,
|
||||
},
|
||||
(n.params.productType,
|
||||
e.unref(c.ProductTypeEnum).VEHICLE_INFO,
|
||||
{}),
|
||||
{
|
||||
e:
|
||||
n.params.productType ===
|
||||
e.unref(c.ProductTypeEnum).VEHICLE_STATUS,
|
||||
},
|
||||
(n.params.productType,
|
||||
e.unref(c.ProductTypeEnum).VEHICLE_STATUS,
|
||||
{}),
|
||||
{
|
||||
f: t,
|
||||
g: e.o(function (e) {
|
||||
return j(n);
|
||||
}, t),
|
||||
}
|
||||
);
|
||||
}),
|
||||
}
|
||||
: {},
|
||||
{
|
||||
f: e.f(e.unref(o.theActionList2), function (n, t, r) {
|
||||
return e.e(
|
||||
{ a: e.t(n.name), b: e.t(n.desc), c: n.icon, d: 0 === t },
|
||||
{},
|
||||
{ e: 1 === t },
|
||||
{},
|
||||
{
|
||||
f: t,
|
||||
g: e.n(t >= 2 ? "action-content2-item-top" : ""),
|
||||
h: e.n(0 === t ? "action-content2-item-0" : ""),
|
||||
i: e.n(1 === t ? "action-content2-item-1" : ""),
|
||||
j: e.n(2 === t ? "action-content2-item-2" : ""),
|
||||
k: e.n(3 === t ? "action-content2-item-3" : ""),
|
||||
l: e.o(function (e) {
|
||||
return j(n);
|
||||
}, t),
|
||||
}
|
||||
);
|
||||
}),
|
||||
g: e.o(x),
|
||||
h: e.p({ visible: m.value, title: v.value }),
|
||||
i: e.o(S),
|
||||
j: e.p({ visible: h.value }),
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
},
|
||||
},
|
||||
p = e._export_sfc(d, [["__scopeId", "data-v-45f75add"]]);
|
||||
(d.__runtimeHooks = 2), wx.createPage(p);
|
9
pages/home/index.json
Normal file
9
pages/home/index.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"navigationBarTitleText": "首页",
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarBackgroundColor": "#ffffff",
|
||||
"usingComponents": {
|
||||
"popup-order": "../../components/popup-order/index",
|
||||
"popup-coupon": "../../components/popup-coupon/index"
|
||||
}
|
||||
}
|
86
pages/home/index.wxml
Normal file
86
pages/home/index.wxml
Normal file
@@ -0,0 +1,86 @@
|
||||
<page-meta class="data-v-45f75add" pageStyle="{{a}}"></page-meta>
|
||||
<view class="content data-v-45f75add">
|
||||
<image
|
||||
class="banner data-v-45f75add"
|
||||
src="/static/images/banner_home.png"
|
||||
></image>
|
||||
<text class="title data-v-45f75add">常用工具</text>
|
||||
<view class="action-skeletons data-v-45f75add" wx:if="{{b}}">
|
||||
<view
|
||||
class="action-skeletons-item data-v-45f75add"
|
||||
hoverClass="default-hover-class"
|
||||
hoverStayTime="100"
|
||||
wx:for="{{c}}"
|
||||
wx:key="a"
|
||||
>
|
||||
<view class="action-skeletons-item-image data-v-45f75add"></view>
|
||||
<view class="action-skeletons-item-name data-v-45f75add"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="action-content1 data-v-45f75add" wx:if="{{d}}">
|
||||
<view
|
||||
bindtap="{{item.g}}"
|
||||
class="action-content1-item data-v-45f75add"
|
||||
hoverClass="default-hover-class"
|
||||
hoverStayTime="100"
|
||||
wx:for="{{e}}"
|
||||
wx:key="f"
|
||||
>
|
||||
<view class="action-content1-item-image-content data-v-45f75add">
|
||||
<image
|
||||
class="action-content1-item-image data-v-45f75add"
|
||||
mode="widthFix"
|
||||
src="{{item.a}}"
|
||||
></image>
|
||||
</view>
|
||||
<text class="action-content1-item-name data-v-45f75add">{{item.b}}</text>
|
||||
<text class="tip tip-discount data-v-45f75add" wx:if="{{item.c}}"
|
||||
>优惠</text
|
||||
>
|
||||
<text class="tip tip-free data-v-45f75add" wx:if="{{item.d}}">限免</text>
|
||||
<text class="tip tip-info data-v-45f75add" wx:if="{{item.e}}"
|
||||
>违法+抵押</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<text class="title data-v-45f75add">热门工具</text>
|
||||
<view class="action-content2 data-v-45f75add">
|
||||
<view
|
||||
bindtap="{{item.l}}"
|
||||
class="{{['action-content2-item','data-v-45f75add',item.g,item.h,item.i,item.j,item.k]}}"
|
||||
hoverClass="default-hover-class"
|
||||
hoverStayTime="100"
|
||||
wx:for="{{f}}"
|
||||
wx:key="f"
|
||||
>
|
||||
<text class="action-content2-item-name data-v-45f75add">{{item.a}}</text>
|
||||
<text class="action-content2-item-desc data-v-45f75add">{{item.b}}</text>
|
||||
<image
|
||||
class="action-content2-item-image data-v-45f75add"
|
||||
src="{{item.c}}"
|
||||
></image>
|
||||
<view class="label data-v-45f75add" wx:if="{{item.d}}">
|
||||
<text class="label-text label-hot data-v-45f75add">热门</text>
|
||||
</view>
|
||||
<view class="label data-v-45f75add" wx:if="{{item.e}}">
|
||||
<text class="label-text label-free data-v-45f75add">限免</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<popup-order
|
||||
bind:__l="__l"
|
||||
bindclose="{{g}}"
|
||||
class="data-v-45f75add"
|
||||
uI="45f75add-0"
|
||||
uP="{{h}}"
|
||||
wx:if="{{h}}"
|
||||
></popup-order>
|
||||
<popup-coupon
|
||||
bind:__l="__l"
|
||||
bindclose="{{i}}"
|
||||
class="data-v-45f75add"
|
||||
uI="45f75add-1"
|
||||
uP="{{j}}"
|
||||
wx:if="{{j}}"
|
||||
></popup-coupon>
|
||||
</view>
|
211
pages/home/index.wxss
Normal file
211
pages/home/index.wxss
Normal file
@@ -0,0 +1,211 @@
|
||||
label,
|
||||
scroll-view,
|
||||
swiper-item,
|
||||
view {
|
||||
align-content: flex-start;
|
||||
align-items: stretch;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
flex-basis: auto;
|
||||
flex-direction: column;
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
image,
|
||||
input,
|
||||
scroll-view,
|
||||
swiper,
|
||||
swiper-item,
|
||||
text,
|
||||
textarea,
|
||||
video,
|
||||
view {
|
||||
border: 0 solid #000;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
swiper-item {
|
||||
position: absolute;
|
||||
}
|
||||
button {
|
||||
margin: 0;
|
||||
}
|
||||
.content.data-v-45f75add {
|
||||
padding: 30rpx;
|
||||
}
|
||||
.banner.data-v-45f75add {
|
||||
border-radius: 12rpx;
|
||||
height: 258rpx;
|
||||
width: 690rpx;
|
||||
}
|
||||
.title.data-v-45f75add {
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
margin: 30rpx 10rpx;
|
||||
}
|
||||
.action-skeletons.data-v-45f75add {
|
||||
background-color: #fff;
|
||||
border-radius: 12rpx;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
padding: 30rpx 0 10rpx;
|
||||
}
|
||||
.action-skeletons-item.data-v-45f75add {
|
||||
align-items: center;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 155rpx;
|
||||
position: relative;
|
||||
width: 171rpx;
|
||||
}
|
||||
.action-skeletons-item-image.data-v-45f75add {
|
||||
background: #f1f2f4;
|
||||
border-radius: 10rpx;
|
||||
height: 100rpx;
|
||||
width: 100rpx;
|
||||
}
|
||||
.action-skeletons-item-name.data-v-45f75add {
|
||||
background: #f1f2f4;
|
||||
border-radius: 5rpx;
|
||||
height: 20rpx;
|
||||
margin-top: 10rpx;
|
||||
width: 100rpx;
|
||||
}
|
||||
.action-content1.data-v-45f75add {
|
||||
background-color: #fff;
|
||||
border-radius: 12rpx;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
padding: 10rpx 0 30rpx;
|
||||
}
|
||||
.action-content1-item.data-v-45f75add {
|
||||
align-items: center;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 155rpx;
|
||||
justify-content: flex-end;
|
||||
position: relative;
|
||||
width: 171rpx;
|
||||
}
|
||||
.action-content1-item-image-content.data-v-45f75add {
|
||||
align-items: center;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
height: 100rpx;
|
||||
justify-content: center;
|
||||
width: 100rpx;
|
||||
}
|
||||
.action-content1-item-image.data-v-45f75add {
|
||||
width: 100rpx;
|
||||
}
|
||||
.action-content1-item-name.data-v-45f75add {
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
height: 30rpx;
|
||||
}
|
||||
.tip.data-v-45f75add {
|
||||
border-radius: 6rpx;
|
||||
color: #fff;
|
||||
font-size: 20rpx;
|
||||
font-weight: 400;
|
||||
height: 28rpx;
|
||||
left: 57rpx;
|
||||
line-height: 28rpx;
|
||||
padding: 0 8rpx;
|
||||
position: absolute;
|
||||
top: 12rpx;
|
||||
}
|
||||
.tip-free.data-v-45f75add {
|
||||
background-color: #fe902e;
|
||||
}
|
||||
.tip-discount.data-v-45f75add {
|
||||
background-color: #f06a62;
|
||||
}
|
||||
.tip-info.data-v-45f75add {
|
||||
background-color: #ffa39e;
|
||||
left: 35rpx;
|
||||
}
|
||||
.action-content2.data-v-45f75add {
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.action-content2-item.data-v-45f75add {
|
||||
background-color: #fff;
|
||||
border-radius: 12rpx;
|
||||
height: 200rpx;
|
||||
overflow: hidden;
|
||||
padding: 30rpx;
|
||||
position: relative;
|
||||
width: 335rpx;
|
||||
}
|
||||
.action-content2-item-0.data-v-45f75add {
|
||||
background-color: #f1f0fd;
|
||||
}
|
||||
.action-content2-item-1.data-v-45f75add {
|
||||
background-color: rgba(255, 249, 244, 0.886);
|
||||
}
|
||||
.action-content2-item-2.data-v-45f75add {
|
||||
background-color: rgba(140, 222, 162, 0.1);
|
||||
}
|
||||
.action-content2-item-3.data-v-45f75add {
|
||||
background-color: rgba(202, 234, 248, 0.255);
|
||||
}
|
||||
.action-content2-item-top.data-v-45f75add {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.action-content2-item-name.data-v-45f75add {
|
||||
color: #444;
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
.action-content2-item-desc.data-v-45f75add {
|
||||
color: #9a9a9a;
|
||||
font-size: 28rpx;
|
||||
margin-top: 5rpx;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
.action-content2-item-image.data-v-45f75add {
|
||||
bottom: 0;
|
||||
height: 90rpx;
|
||||
opacity: 0.8;
|
||||
position: absolute;
|
||||
right: 10rpx;
|
||||
width: 90rpx;
|
||||
z-index: 1;
|
||||
}
|
||||
.label.data-v-45f75add {
|
||||
align-items: flex-start;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.label-text.data-v-45f75add {
|
||||
background-color: #fcdede;
|
||||
border-radius: 6rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
height: 36rpx;
|
||||
line-height: 36rpx;
|
||||
padding: 0 6rpx;
|
||||
}
|
||||
.label-free.data-v-45f75add {
|
||||
color: #fe902e;
|
||||
}
|
||||
.label-hot.data-v-45f75add {
|
||||
color: #f06a62;
|
||||
}
|
||||
.default-hover-class.data-v-45f75add {
|
||||
opacity: 0.8;
|
||||
}
|
Reference in New Issue
Block a user