Compare commits

...

26 Commits

Author SHA1 Message Date
Lee 5dfc284bf4 购物车优化 2022-09-26 10:50:57 +08:00
Lee 839262c25e 购物车优化 2022-09-26 10:35:33 +08:00
Lee1203 15d62e14ad 去除正式版打印 2022-08-10 14:10:15 +08:00
Lee1203 9bd9c2993a 分类优化-0809 2022-08-09 15:49:07 +08:00
Lee-1203 cb5f4ecf6b 反馈修改-0808 2022-08-08 18:55:27 +08:00
chen a3c5e79aa7 反馈修改-0715 2022-07-15 11:10:06 +08:00
chen b798f65596 反馈调整0620 2022-06-20 09:00:35 +08:00
chen c0e7afbd82 订单页调整 2022-06-14 14:50:48 +08:00
chen ebecce786d 分类页改版、购物车删除功能、提交订单表单验证修改完成 2022-06-13 17:58:28 +08:00
chen 47d0c1f1b3 分类页改版、购物车删除功能、提交订单表单验证修改完成 2022-06-13 16:13:03 +08:00
chen 3f920deb8b 反馈修改完成 2022-06-10 15:16:56 +08:00
chen f4d80df8ca 登录修改 2022-06-10 11:26:10 +08:00
chen 8f0859622d ios下拉优化 2022-06-08 14:00:10 +08:00
chen 35a6df9620 新增保存二维码成功提示,更改个人中心样式 2022-06-07 15:25:01 +08:00
chen 6b83051dfe 提交订单提示信息修改 2022-06-07 11:09:43 +08:00
chen cc9bd441d8 反馈问题修改 2022-06-06 14:15:31 +08:00
chen f3fa995d7d 分类页面加入购物车数量变化 2022-06-06 13:49:21 +08:00
chen bdbc2b4a19 修改首页分类跳转没有数据问题 2022-06-06 10:49:27 +08:00
chen 1bd8e6489f 接口调取完成 2022-06-02 16:55:16 +08:00
chen c037848d0f 对接订单提交接口、完善添加微信接口、调取宫格接口、优化订单提交完成后的操作、优化分类选择 2022-05-27 19:59:47 +08:00
chen d722273096 对接底部导航icon接口、对接购物车系列接口、对接轮播图接口 2022-05-27 17:43:21 +08:00
chen 4f36f99210 对接首页列表数据,添加购物车接口 2022-05-27 14:57:50 +08:00
chen d9a876a4ce 调整授权登录接口 2022-05-27 10:21:12 +08:00
chen 3401446e65 新增加载更多动画 2022-05-26 18:35:10 +08:00
chen a7b08fcf73 修改不需要提交的文件 2022-05-25 18:11:34 +08:00
chen 3fca2dd839 不知道干了啥 2022-05-25 18:07:57 +08:00
38 changed files with 2530 additions and 736 deletions

9
.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
/vendor
/node_modules
/public/storage
/unpackage
/.hbuilderx
Homestead.yaml
Homestead.json
.env
.idea

27
App.vue
View File

@ -1,14 +1,34 @@
<script>
import { themeEv } from '@/jsFile/public-api.js';
export default {
globalData:{
projectname:'', //
lat:'', //
lng:'' ,//
hostapi:'https://www.baidu.com' //
hostapi:'https://www.cdxidoudou.cn' ,//
// hostapi:'https:caimall.scdxtc.cn',//
},
// show
onLaunch: function() {
uni.login({
success: (res) => {
uni.request({
url: this.globalData.hostapi +'/api/user/login',
data:{code:res.code},
success: (result) => {
if(result.data.data.is_active) {
uni.setStorageSync('userId',result.data.account_id);
uni.setStorageSync('token',result.data.data.token);//token
uni.setStorageSync('openid',result.data.data.openid);//openid
uni.setStorageSync('expire',result.data.data.expire);//
uni.setStorageSync('phone_active',result.data.data.phone_active);//
uni.setStorageSync('is_active',result.data.data.is_active);//
uni.setStorageSync('invite_code',result.data.data.invite_code);//
}
}
})
}
})
},
onShow: function() {
if(uni.getStorageSync('token')){
@ -17,7 +37,7 @@
},
onHide: function() {
}
},
};
</script>
@ -37,6 +57,7 @@
/* 动画样式 start */
@import url("./commons/animate.min.css");
/* 动画样式 end */
@import url("./commons/loading.css");
page {background-color: #f4f4f4;}
.textc{

View File

@ -329,11 +329,18 @@ button:after{content: none!important;}
.pad-s10{padding-top: 10rpx;}
.pad-s20{padding-top: 20rpx;}
.pad-s25{padding-top: 25rpx;}
.pad-s28{padding-top: 28rpx;}
.pad-s30{padding-top: 30rpx;}
.pad-s32{padding-top: 32rpx;}
.pad-s36{padding-top: 36rpx;}
.pad-s40{padding-top: 40rpx;}
.pad-s50{padding-top: 50rpx;}
.pad-s60{padding-top: 60rpx;}
.pad-s70{padding-top: 70rpx;}
.pad-s80{padding-top: 80rpx;}
.pad-s90{padding-top: 90rpx;}
.pad-s100{padding-top: 100rpx;}
.pad-s110{padding-top: 110rpx;}
.pad-s120{padding-top: 120rpx;}
.pad-s140{padding-top: 140rpx;}
.pad-s160{padding-top: 160rpx;}

874
commons/loading.css Normal file
View File

@ -0,0 +1,874 @@
.loading-box {
display: flex;
justify-content: center;
width: 100%;
padding-top: 20px;
font-size: 30px;
color: rgba(253, 82, 75, 1);
vertical-align: top;
-webkit-transition: .3s color, .3s border;
transition: .3s color, .3s border;
}
/* .loading-box:hover {
color: #d60b52;
font-size: 0;
padding: 0;
border-width: 3px;
line-height: 200px;
}
.loading-box:hover [class*="loader-"] {
font-size: 70px;
line-height: 200px;
} */
[class*="loader-"] {
display: inline-block;
width: 1em;
height: 1em;
color: inherit;
vertical-align: middle;
pointer-events: none;
}
.loader-01 {
border: .2em dotted currentcolor;
border-radius: 50%;
-webkit-animation: 1s loader-01 linear infinite;
animation: 1s loader-01 linear infinite;
}
@-webkit-keyframes loader-01 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes loader-01 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
.loader-02 {
border: .2em solid transparent;
border-left-color: currentcolor;
border-right-color: currentcolor;
border-radius: 50%;
-webkit-animation: 1s loader-02 linear infinite;
animation: 1s loader-02 linear infinite;
}
@-webkit-keyframes loader-02 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes loader-02 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
.loader-03 {
border: .2em solid currentcolor;
border-bottom-color: transparent;
border-radius: 50%;
-webkit-animation: 1s loader-03 linear infinite;
animation: 1s loader-03 linear infinite;
position: relative;
}
@-webkit-keyframes loader-03 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes loader-03 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
.loader-04 {
border: 1px solid currentcolor;
border-radius: 50%;
-webkit-animation: 1s loader-04 linear infinite;
animation: 1s loader-04 linear infinite;
position: relative;
}
.loader-04:before {
content: '';
display: block;
width: 0;
height: 0;
position: absolute;
top: -.2em;
left: 50%;
border: .2em solid currentcolor;
border-radius: 50%;
}
@-webkit-keyframes loader-04 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes loader-04 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
.loader-05 {
border: .2em solid transparent;
border-top-color: currentcolor;
border-radius: 50%;
-webkit-animation: 1s loader-05 linear infinite;
animation: 1s loader-05 linear infinite;
position: relative;
}
.loader-05:before {
content: '';
display: block;
width: inherit;
height: inherit;
position: absolute;
top: -.2em;
left: -.2em;
border: .2em solid currentcolor;
border-radius: 50%;
opacity: .5;
}
@-webkit-keyframes loader-05 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes loader-05 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
.loader-06 {
border: .2em solid currentcolor;
border-radius: 50%;
-webkit-animation: loader-06 1s ease-out infinite;
animation: loader-06 1s ease-out infinite;
}
@-webkit-keyframes loader-06 {
0% {
-webkit-transform: scale(0);
transform: scale(0);
opacity: 0;
}
50% {
opacity: 1;
}
100% {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 0;
}
}
@keyframes loader-06 {
0% {
-webkit-transform: scale(0);
transform: scale(0);
opacity: 0;
}
50% {
opacity: 1;
}
100% {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 0;
}
}
.loader-07 {
border: 0 solid transparent;
border-radius: 50%;
position: relative;
}
.loader-07:before,
.loader-07:after {
content: '';
border: .2em solid currentcolor;
border-radius: 50%;
width: inherit;
height: inherit;
position: absolute;
top: 0;
left: 0;
-webkit-animation: loader-07 1s linear infinite;
animation: loader-07 1s linear infinite;
opacity: 0;
}
.loader-07:before {
-webkit-animation-delay: 1s;
animation-delay: 1s;
}
.loader-07:after {
-webkit-animation-delay: .5s;
animation-delay: .5s;
}
@-webkit-keyframes loader-07 {
0% {
-webkit-transform: scale(0);
transform: scale(0);
opacity: 0;
}
50% {
opacity: 1;
}
100% {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 0;
}
}
@keyframes loader-07 {
0% {
-webkit-transform: scale(0);
transform: scale(0);
opacity: 0;
}
50% {
opacity: 1;
}
100% {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 0;
}
}
.loader-08 {
position: relative;
}
.loader-08:before,
.loader-08:after {
content: '';
width: inherit;
height: inherit;
border-radius: 50%;
background-color: currentcolor;
opacity: 0.6;
position: absolute;
top: 0;
left: 0;
-webkit-animation: loader-08 2.0s infinite ease-in-out;
animation: loader-08 2.0s infinite ease-in-out;
}
.loader-08:after {
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}
@-webkit-keyframes loader-08 {
0%, 100% {
-webkit-transform: scale(0);
transform: scale(0);
}
50% {
-webkit-transform: scale(1);
transform: scale(1);
}
}
@keyframes loader-08 {
0%, 100% {
-webkit-transform: scale(0);
transform: scale(0);
}
50% {
-webkit-transform: scale(1);
transform: scale(1);
}
}
.loader-09 {
background-color: currentcolor;
border-radius: 50%;
-webkit-animation: loader-09 1.0s infinite ease-in-out;
animation: loader-09 1.0s infinite ease-in-out;
}
@-webkit-keyframes loader-09 {
0% {
-webkit-transform: scale(0);
transform: scale(0);
}
100% {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 0;
}
}
@keyframes loader-09 {
0% {
-webkit-transform: scale(0);
transform: scale(0);
}
100% {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 0;
}
}
.loader-10 {
position: relative;
-webkit-animation: loader-10-1 2.0s infinite linear;
animation: loader-10-1 2.0s infinite linear;
}
.loader-10:before,
.loader-10:after {
content: '';
width: 0;
height: 0;
border: .5em solid currentcolor;
display: block;
position: absolute;
border-radius: 100%;
-webkit-animation: loader-10-2 2s infinite ease-in-out;
animation: loader-10-2 2s infinite ease-in-out;
}
.loader-10:before {
top: 0;
left: 50%;
}
.loader-10:after {
bottom: 0;
right: 50%;
-webkit-animation-delay: -1s;
animation-delay: -1s;
}
@-webkit-keyframes loader-10-1 {
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes loader-10-1 {
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@-webkit-keyframes loader-10-2 {
0%, 100% {
-webkit-transform: scale(0);
transform: scale(0);
}
50% {
-webkit-transform: scale(1);
transform: scale(1);
}
}
@keyframes loader-10-2 {
0%, 100% {
-webkit-transform: scale(0);
transform: scale(0);
}
50% {
-webkit-transform: scale(1);
transform: scale(1);
}
}
.loader-11 {
background-color: currentcolor;
-webkit-animation: loader-11 1.2s infinite ease-in-out;
animation: loader-11 1.2s infinite ease-in-out;
}
@-webkit-keyframes loader-11 {
0% {
-webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg);
transform: perspective(120px) rotateX(0deg) rotateY(0deg);
}
50% {
-webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
}
100% {
-webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
}
}
@keyframes loader-11 {
0% {
-webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg);
transform: perspective(120px) rotateX(0deg) rotateY(0deg);
}
50% {
-webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
}
100% {
-webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
}
}
.loader-12 {
position: relative;
}
.loader-12:before,
.loader-12:after {
content: '';
display: block;
position: absolute;
background-color: currentcolor;
left: 50%;
right: 0;
top: 0;
bottom: 50%;
box-shadow: -.5em 0 0 currentcolor;
-webkit-animation: loader-12 1s linear infinite;
animation: loader-12 1s linear infinite;
}
.loader-12:after {
top: 50%;
bottom: 0;
-webkit-animation-delay: .25s;
animation-delay: .25s;
}
@-webkit-keyframes loader-12 {
0%, 100% {
box-shadow: -.5em 0 0 transparent;
background-color: currentcolor;
}
50% {
box-shadow: -.5em 0 0 currentcolor;
background-color: transparent;
}
}
@keyframes loader-12 {
0%, 100% {
box-shadow: -.5em 0 0 transparent;
background-color: currentcolor;
}
50% {
box-shadow: -.5em 0 0 currentcolor;
background-color: transparent;
}
}
.loader-13:before,
.loader-13:after,
.loader-13 {
border-radius: 50%;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
-webkit-animation: loader-13 1.8s infinite ease-in-out;
animation: loader-13 1.8s infinite ease-in-out;
}
.loader-13 {
color: currentcolor;
position: relative;
-webkit-transform: translateZ(0);
transform: translateZ(0);
-webkit-animation-delay: -0.16s;
animation-delay: -0.16s;
top: -1em;
}
.loader-13:before {
right: 100%;
-webkit-animation-delay: -0.32s;
animation-delay: -0.32s;
}
.loader-13:after {
left: 100%;
}
.loader-13:before,
.loader-13:after {
content: '';
display: block;
position: absolute;
top: 0;
width: inherit;
height: inherit;
}
@-webkit-keyframes loader-13 {
0%, 80%, 100% {
box-shadow: 0 1em 0 -1em;
}
40% {
box-shadow: 0 1em 0 -.2em;
}
}
@keyframes loader-13 {
0%, 80%, 100% {
box-shadow: 0 1em 0 -1em;
}
40% {
box-shadow: 0 1em 0 -.2em;
}
}
.loader-14 {
border-radius: 50%;
box-shadow: 0 1em 0 -.2em currentcolor;
position: relative;
-webkit-animation: loader-14 0.8s ease-in-out alternate infinite;
animation: loader-14 0.8s ease-in-out alternate infinite;
-webkit-animation-delay: 0.32s;
animation-delay: 0.32s;
top: -1em;
}
.loader-14:after,
.loader-14:before {
content: '';
position: absolute;
width: inherit;
height: inherit;
border-radius: inherit;
box-shadow: inherit;
-webkit-animation: inherit;
animation: inherit;
}
.loader-14:before {
left: -1em;
-webkit-animation-delay: 0.48s;
animation-delay: 0.48s;
}
.loader-14:after {
right: -1em;
-webkit-animation-delay: 0.16s;
animation-delay: 0.16s;
}
@-webkit-keyframes loader-14 {
0% {
box-shadow: 0 2em 0 -.2em currentcolor;
}
100% {
box-shadow: 0 1em 0 -.2em currentcolor;
}
}
@keyframes loader-14 {
0% {
box-shadow: 0 2em 0 -.2em currentcolor;
}
100% {
box-shadow: 0 1em 0 -.2em currentcolor;
}
}
.loader-15 {
background: currentcolor;
position: relative;
-webkit-animation: loader-15 1s ease-in-out infinite;
animation: loader-15 1s ease-in-out infinite;
-webkit-animation-delay: 0.4s;
animation-delay: 0.4s;
width: .25em;
height: .5em;
}
.loader-15:after,
.loader-15:before {
content: '';
position: absolute;
width: inherit;
height: inherit;
background: inherit;
-webkit-animation: inherit;
animation: inherit;
}
.loader-15:before {
right: .5em;
-webkit-animation-delay: 0.2s;
animation-delay: 0.2s;
}
.loader-15:after {
left: .5em;
-webkit-animation-delay: 0.6s;
animation-delay: 0.6s;
}
@-webkit-keyframes loader-15 {
0%, 100% {
box-shadow: 0 0 0 currentcolor, 0 0 0 currentcolor;
}
50% {
box-shadow: 0 -.25em 0 currentcolor, 0 .25em 0 currentcolor;
}
}
@keyframes loader-15 {
0%, 100% {
box-shadow: 0 0 0 currentcolor, 0 0 0 currentcolor;
}
50% {
box-shadow: 0 -.25em 0 currentcolor, 0 .25em 0 currentcolor;
}
}
.loader-16 {
-webkit-transform: rotateZ(45deg);
transform: rotateZ(45deg);
-webkit-perspective: 1000px;
perspective: 1000px;
border-radius: 50%;
}
.loader-16:before,
.loader-16:after {
content: '';
display: block;
position: absolute;
top: 0;
left: 0;
width: inherit;
height: inherit;
border-radius: 50%;
-webkit-animation: 1s spin linear infinite;
animation: 1s spin linear infinite;
}
.loader-16:before {
-webkit-transform: rotateX(70deg);
transform: rotateX(70deg);
}
.loader-16:after {
-webkit-transform: rotateY(70deg);
transform: rotateY(70deg);
-webkit-animation-delay: .4s;
animation-delay: .4s;
}
@-webkit-keyframes rotate {
0% {
-webkit-transform: translate(-50%, -50%) rotateZ(0deg);
transform: translate(-50%, -50%) rotateZ(0deg);
}
100% {
-webkit-transform: translate(-50%, -50%) rotateZ(360deg);
transform: translate(-50%, -50%) rotateZ(360deg);
}
}
@keyframes rotate {
0% {
-webkit-transform: translate(-50%, -50%) rotateZ(0deg);
transform: translate(-50%, -50%) rotateZ(0deg);
}
100% {
-webkit-transform: translate(-50%, -50%) rotateZ(360deg);
transform: translate(-50%, -50%) rotateZ(360deg);
}
}
@-webkit-keyframes rotateccw {
0% {
-webkit-transform: translate(-50%, -50%) rotate(0deg);
transform: translate(-50%, -50%) rotate(0deg);
}
100% {
-webkit-transform: translate(-50%, -50%) rotate(-360deg);
transform: translate(-50%, -50%) rotate(-360deg);
}
}
@keyframes rotateccw {
0% {
-webkit-transform: translate(-50%, -50%) rotate(0deg);
transform: translate(-50%, -50%) rotate(0deg);
}
100% {
-webkit-transform: translate(-50%, -50%) rotate(-360deg);
transform: translate(-50%, -50%) rotate(-360deg);
}
}
@-webkit-keyframes spin {
0%, 100% {
box-shadow: .2em 0px 0 0px currentcolor;
}
12% {
box-shadow: .2em .2em 0 0 currentcolor;
}
25% {
box-shadow: 0 .2em 0 0px currentcolor;
}
37% {
box-shadow: -.2em .2em 0 0 currentcolor;
}
50% {
box-shadow: -.2em 0 0 0 currentcolor;
}
62% {
box-shadow: -.2em -.2em 0 0 currentcolor;
}
75% {
box-shadow: 0px -.2em 0 0 currentcolor;
}
87% {
box-shadow: .2em -.2em 0 0 currentcolor;
}
}
@keyframes spin {
0%, 100% {
box-shadow: .2em 0px 0 0px currentcolor;
}
12% {
box-shadow: .2em .2em 0 0 currentcolor;
}
25% {
box-shadow: 0 .2em 0 0px currentcolor;
}
37% {
box-shadow: -.2em .2em 0 0 currentcolor;
}
50% {
box-shadow: -.2em 0 0 0 currentcolor;
}
62% {
box-shadow: -.2em -.2em 0 0 currentcolor;
}
75% {
box-shadow: 0px -.2em 0 0 currentcolor;
}
87% {
box-shadow: .2em -.2em 0 0 currentcolor;
}
}
.loader-17 {
position: relative;
background-color: currentcolor;
border-radius: 50%;
}
.loader-17:after,
.loader-17:before {
content: "";
position: absolute;
width: .25em;
height: .25em;
border-radius: 50%;
opacity: .8;
}
.loader-17:after {
left: -.5em;
top: -.25em;
background-color: currentcolor;
-webkit-transform-origin: .75em 1em;
transform-origin: .75em 1em;
-webkit-animation: loader-17 1s linear infinite;
animation: loader-17 1s linear infinite;
opacity: .6;
}
.loader-17:before {
left: -1.25em;
top: -.75em;
background-color: currentcolor;
-webkit-transform-origin: 1.5em 1em;
transform-origin: 1.5em 1em;
-webkit-animation: loader-17 2s linear infinite;
animation: loader-17 2s linear infinite;
}
@-webkit-keyframes loader-17 {
0% {
-webkit-transform: rotateZ(0deg) translate3d(0, 0, 0);
transform: rotateZ(0deg) translate3d(0, 0, 0);
}
100% {
-webkit-transform: rotateZ(360deg) translate3d(0, 0, 0);
transform: rotateZ(360deg) translate3d(0, 0, 0);
}
}
@keyframes loader-17 {
0% {
-webkit-transform: rotateZ(0deg) translate3d(0, 0, 0);
transform: rotateZ(0deg) translate3d(0, 0, 0);
}
100% {
-webkit-transform: rotateZ(360deg) translate3d(0, 0, 0);
transform: rotateZ(360deg) translate3d(0, 0, 0);
}
}
.loader-18 {
position: relative;
}
.loader-18:before,
.loader-18:after {
content: '';
display: block;
position: absolute;
border-radius: 50%;
border: .1em solid transparent;
border-bottom-color: currentcolor;
top: 0;
left: 0;
-webkit-animation: 1s loader-18 linear infinite;
animation: 1s loader-18 linear infinite;
}
.loader-18:before {
width: 1em;
height: 1em;
}
.loader-18:after {
width: .8em;
height: .8em;
top: .1em;
left: .1em;
-webkit-animation-direction: reverse;
animation-direction: reverse;
}
@-webkit-keyframes loader-18 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes loader-18 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
.loader-19 {
border-top: .2em solid currentcolor;
border-right: .2em solid transparent;
-webkit-animation: loader-19 1s linear infinite;
animation: loader-19 1s linear infinite;
border-radius: 100%;
position: relative;
}
@-webkit-keyframes loader-19 {
to {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes loader-19 {
to {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}

View File

@ -59,7 +59,7 @@
animation: scale_name 1s linear alternate infinite;
}
@keyframes scale_name{
from{transform: scale(1);}
to{transform: scale(1.2);}
from{transform: scale(.9);}
to{transform: scale(1);}
}
</style>

View File

@ -5,9 +5,9 @@
boxShadow: `-10rpx 0rpx 20rpx rgba( 0, 0, 0, ${boxShadowNum})`
}">
<!-- 后台动态改变的icon与标题 start -->
<view @tap="choosefoot(index)" class="item-box" v-for="(item,index) in footList" :key="index">
<view @tap="choosefoot(index)" class="item-box" v-for="(item,index) in onLineList || footList" :key="index">
<view class="item-image-box disjcac" :class="current*1===index ? 'activeImg' : 'moImg'">
<view class="item-spot disjcac fon24" v-if="index==2 && num*1">{{num}}</view>
<view class="item-spot disjcac fon24" v-if="index==2 && cartNum*1">{{cartNum}}</view>
<image :class="isIcon==index ? 'bulge' : ''" :style="{width:[39,41,39,32][index]+'rpx',height:[40,41,38,38][index]+'rpx'}" :src="current == index ? item.selectedIconPath : item.iconPath" mode="widthFix"></image>
</view>
<view class="clips1 fon24" :class="current==index ? 'activeclass' : 'defaultclass'">{{item.title}}</view>
@ -16,6 +16,8 @@
</view>
</template>
<script>
import {themeEv,getCartNum} from '@/jsFile/public-api.js';
import { mapState } from 'vuex'//mapState
export default {
name:'foot-tab',
props:{
@ -24,11 +26,6 @@
type:String,
default:'0'
},
//
num: {
type:String,
default:'10'
},
//
isIcon:{
type:String,
@ -103,18 +100,27 @@
query.select('.foot-box').boundingClientRect((rect) => {
this.$store.commit('footHeightEv',rect.height);
}).exec()
//
themeEv();
//
getCartNum();
},
computed:{
...mapState({
onLineList: state => state.moduleA.onLineList,
cartNum: state=> state.moduleA.cartNum
}),
},
methods:{
choosefoot(index){
if(index==0){
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
}else if(index==1){
uni.reLaunch({url:'/pages/tabbar/cate/cate'})
}else {
// if(!this.$toolAll.tools.judgeAuth()) {
if(this.$toolAll.tools.judgeAuth()) {
//
switch (index){
case 1:
uni.reLaunch({url:'/pages/tabbar/cate/cate'})
break;
case 2:
uni.reLaunch({url:'/pages/tabbar/cart/cart'})
break;
@ -122,12 +128,7 @@
uni.reLaunch({url:'/pages/tabbar/my/my'})
break;
}
// } else {
// //
// uni.navigateTo({
// url:'/pages/login/login'
// })
// }
}
}
}
}

View File

@ -2,10 +2,11 @@
<view class="disac fw" :style="{paddingBottom:itemTop,backgroundColor: backc}">
<block v-for="(item,index) in list" :key="index">
<view @tap="chooseGe(item.url,index)" class="disjcac fc pad-s30" :style="{width:['50%','50%','50%','33.3%','25%','20%'][rowNum],paddingTop:itemTop}">
<view class="disjcac icon-box" :style="{width:iconwh,height:iconwh}" :class="ifShadow ? 'haveShadow' : ''">
<view class="disjcac icon-box posir" :style="{width:iconwh,height:iconwh}" :class="ifShadow ? 'haveShadow' : ''">
<image :src="item.iconsrc" mode="aspectFill" :style="{width: item.iconWidth +'rpx',height: item.iconHeight +'rpx'}"></image>
<!-- <view class="posia fon24 textc bacf" v-if="item.num" style="right: -54rpx;bottom: -39rpx;border-radius: 100%; color: #666;">({{item.num}})</view> -->
</view>
<view class="clips1" :style="{color:titlec,fontSize:fonts,marginTop:titleTop}">{{item.title}}</view>
<view class="clips1" :style="{color:titlec,fontSize:fonts,marginTop:titleTop}">{{item.title}}<text v-if="item.num" style="margin-left:3px; color:#666">({{item.num}})</text></view>
</view>
</block>
</view>
@ -18,13 +19,13 @@
type:Array,
default:()=>{
return [
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题一'},
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题二'},
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题三'},
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题四'},
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题五'},
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题五'},
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题五'},
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题一',num:0},
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题二',num:0},
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题三',num:0},
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题四',num:0},
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题五',num:0},
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题五',num:0},
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题五',num:0},
]
}
},
@ -77,8 +78,11 @@
//
maxHeight() {
let arr = [];
let max = '';
this.list.forEach(item=>{arr.push(item.iconHeight);})
let max = arr.reduce((a,b)=>{return b > a ? b : a})
if(arr.length) {
max = arr.reduce((a,b)=>{return b > a ? b : a})
}
return max;
},
},

View File

@ -2,7 +2,7 @@
<view>
<view class="fon36 colb bold mar-x40" v-if="ifTitle">{{title}}</view>
<view class="disjbac fw">
<view class="width48_5 fon30 mar-x30" @tap="goDetail(index)" v-for="(item,index) in dataList" :key="index">
<view class="width48_5 fon30 mar-x30" @tap="goDetail(item.id)" v-for="(item,index) in dataList" :key="index">
<view class="" style="height: 342rpx;">
<image class="radius30 width100" :src="item.imgsrc" mode="aspectFill" style="height: 342rpx;"></image>
</view>
@ -10,17 +10,28 @@
<view class="line-h50 mar-sx25 clips2" style="height: 90rpx;">{{item.title}}</view>
<view class="textc disjbac">
<view class="">{{item.price}}</view>
<i @tap.stop="addCartEv(index)" class="icon icon-shop-cart" style="font-size: 40rpx;"></i>
<i @tap.stop="addCartEv(item.skuId)" class="icon icon-shop-cart" style="font-size: 40rpx;"></i>
</view>
</view>
</view>
</view>
<view class="mar-s60" v-if="total==dataList.length">
<pitera textStr="—— 到底啦 ——"></pitera>
</view>
<view class="loading-box mar-s60" v-show="ifLoading">
<view class="loader-16"></view>
</view>
</view>
</template>
<script>
import pitera from '@/components/nothing/pitera';
import {getCartNum} from '@/jsFile/public-api.js';
export default {
name:"list-one",
components:{
pitera
},
props:{
//
ifTitle:{
@ -36,29 +47,80 @@
data() {
return {
dataList:[
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖入海盐太妃糖入海盐太妃糖入海盐太妃糖入海盐太妃糖',price:'2,000'},
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
]
// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'-16',price:'2,000'},
// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'-16',price:'2,000'},
// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'-16',price:'2,000'},
// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'-16',price:'2,000'},
// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'-16',price:'2,000'},
// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'-16',price:'2,000'},
// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'-16',price:'2,000'},
// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'-16',price:'2,000'},
// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'-16',price:'2,000'},
// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'-16',price:'2,000'},
// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'-16',price:'2,000'},
],
ifLoading:false,
total:0,
page:1,
size:10
};
},
mounted() {
this.getList();
},
methods:{
moreEv() {
if(this.total!=this.dataList.length) {
this.page++;
this.getList();
}
},
//
getList(){
this.ifLoading = true;
let params = {
keyword:'',
page:this.page,
size:this.size
}
this.$requst.post('/api/spu/home',params).then(res=>{
if(res.code==0) {
this.total = res.data.total;
if(this.page==1) this.dataList = [];
if(res.data.list.length) {
res.data.list.forEach(item=>{
let obj = {
id:item.id,
skuId:item.skuId,
imgsrc:item.cover,
title:item.name,
price:item.original_price
}
this.dataList.push(obj);
})
}
}
this.ifLoading = false;
})
},
//
addCartEv(id) {
this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)')
if(this.$toolAll.tools.judgeAuth()) {
this.$requst.post('/api/order/shopping-cart-add',{sku_id:id,num:1}).then(res=>{
if(res.code==0) {
this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)');
getCartNum();
} else {
this.$toolAll.tools.showToast(res.msg)
}
})
}
},
//
goDetail(id) {
uni.navigateTo({
url:'/pagesB/shop-detail/shop-detail'
url:`/pagesB/shop-detail/shop-detail?id=${id}`
})
}
}

View File

@ -1,26 +1,21 @@
<template>
<view class="pad-x120">
<view class="slide-box mar-x20 animated" v-for="(item, index) in listData" :key="index" :class="item.ifExit ? 'fadeInUp' : 'fadeOutDown'" :style="{display: item.ifShow ? 'flex' : 'none'}">
<view class="slide-list"
@touchstart="touchStart($event, index)"
@touchend="touchEnd($event, index)"
@touchmove="touchMove($event, index)"
@tap="recover(index)"
:style="{ transform: 'translate3d(' + item.slide_x + 'px, 0, 0)' }">
<view class="now-message-info" :style="{ width: windowWidth + 'px' }" @click="clickItemMethod(item)">
<view class="slide-box mar-x20 animated" v-for="(item, index) in listData" :key="index" :class="item.ifExit ? 'fadeIn' : 'fadeOutDown'" :style="{display: item.ifShow ? 'flex' : 'none'}">
<view class="slide-list" :style="{ transform: 'translate3d(' + item.slide_x + 'px, 0, 0)' }">
<view class="now-message-info" :style="{ width: windowWidth + 'px' }">
<!-- <view class="mo-item flexs" @tap.stop="chooseEv(index)" :class="item.ifcheck ? 'active-item' : ''"></view> -->
<label class="radio"><radio :checked="item.ifcheck" color="#ff3673" style="transform: scale(.8);"/></label>
<view class="shopp-img imgH mar-y20 mar-z10" @tap.stop="chooseEv(index)">
<label class="radio"><radio :checked="item.ifcheck" @tap.stop="chooseEv(index)" color="#ff3673" style="transform: scale(.8);"/></label>
<view class="shopp-img imgH mar-y20 mar-z10" @tap="goDetail(item.spuId)">
<image class="shopp-img imgH width100" :src="item.image" mode="aspectFill"></image>
</view>
<view class="imgH disjb fc fon24 width100">
<view class="">
<view class="" @tap="goDetail(item.spuId)">
<view class="fon28 bold clips2">{{item.title}}</view>
<view class="clips2 line-h40">单位{{item.content}}</view>
</view>
<view class="disjbac">
<!-- 商品价格 -->
<view class="fon24 textc bold"><span class="fon28 ">{{$toolAll.tools.changeNum(item.price)}}</span></view>
<view class="fon24 textc bold"><span class="fon28 ">{{item.price}}</span></view>
<!-- 商品数量 -->
<view class="disac">
<!-- 减数量 -->
@ -33,30 +28,28 @@
</view>
</view>
</view>
<view class="group-btn">
<view class="btn-div" v-for="(value, key) in button" :key="key"
@tap.stop="clickMethod(item, value, index,key)" :style="{background: value.background}">
{{value.title}}
</view>
</view>
</view>
</view>
<!-- 底部导航 -->
<!-- 全选 -->
<view class="disjbac cart-foot-box fon24" :style="{bottom: footHeight+'px'}">
<label class="disac" @tap="chooseAll"><radio :checked="allChoose" color="#ff3673" style="transform: scale(.8);"/><text>全选</text></label>
<view class="disac">
<view class="fon24 mar-y30">合计<span>{{$toolAll.tools.changeNum(allPrice)}}</span></view>
<view class="fon32 cart-submit-btn" :style="{background: !buyNum ? '#cccccc' : 'linear-gradient(to right,#ff3771 0%,#fd5549 100%)'}" @tap="submitEv">{{allPrice==0 ? '' : ` (${buyNum})`}}</view>
<view class="fon24 mar-y30">合计<span>{{allPrice}}</span></view>
<view class="fon32" :style="{background: !buyNum ? '#cccccc' : 'linear-gradient(to right,#ff3771 0%,#fd5549 100%)'}" @tap="submitEv">{{allPrice==0 ? '' : ` (${buyNum})`}}</view>
</view>
</view>
<view class="" v-if="listData.length!=0 && total==listData.length"><pitera textStr="—— 到底啦 ——"></pitera></view>
<nothing-page v-if="!ifLoading && !listData.length" content="你的购物车:这也空空,那也空空(*^▽^*)"></nothing-page>
<pitera textStr="——到底啦——"></pitera>
<view class="loading-box" v-show="ifMore">
<view class="loader-16"></view>
</view>
</view>
</template>
<script>
import { mapState,mapGetters,mapMutations } from 'vuex'//mapState
import pitera from '@/components/nothing/pitera';
import {getCartNum} from '@/jsFile/public-api.js';
export default {
components:{
pitera
@ -67,12 +60,12 @@
type: Array,
default () {
return [
{id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '标题',content: '描述描述描述描述描述描述',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true},
{id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '标题',content: '描述描述描述描述描述描述',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true},
{id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '标题',content: '描述描述描述描述描述描述',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true},
{id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '标题',content: '描述描述描述描述描述描述',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true},
{id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '标题',content: '描述描述描述描述描述描述',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true},
{id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '标题',content: '描述描述描述描述描述描述',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true},
// {id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '',content: '',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true},
// {id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '',content: '',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true},
// {id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '',content: '',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true},
// {id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '',content: '',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true},
// {id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '',content: '',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true},
// {id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '',content: '',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true},
];
}
},
@ -85,9 +78,9 @@
];
}
},
customB:{
skuId:{
type:String,
default:'0'
default:0
}
},
computed: {
@ -99,12 +92,13 @@
let allPrice = 0;
this.listData.forEach(item=>{
if(item.ifcheck) {
allPrice += this.$toolAll.tools.operationEv(item.price,item.num,'*',2)*1;
allPrice += item.price*item.num;
}
})
// return this.$toolAll.tools.addXiaoShu(allPrice);
return allPrice.toString();
},
//
buyNum() {
let buyNum = 0;
@ -115,6 +109,7 @@
})
return buyNum;
},
//
allChoose() {
let ifAll = false;
@ -138,17 +133,57 @@
startTime: 0,
itemIndex: 0,
originalNum:0,//
maxNum:20,//
maxNum:99999,//
minNum:1,//
ifLoading:true,
page:1,
size:10,
total:0,
ifMore:false
};
},
mounted() {
this.listData = this.list;
this.ifLoading = false;
this.getList();
},
methods: {
getList(){
console.log('触底');
this.total = 0;
this.ifMore = true;
let params = {
page:this.page,
size:this.size
}
this.$requst.post('/api/order/shopping-cart',params).then(res=>{
if(res.code==0){
this.total = res.data.total;
if(this.page==1) this.listData = [];
if(res.data.list.length){
res.data.list.forEach(item=>{
let obj = {
id: item.id,
spuId:item.spu.id,
skuId:item.sku_id,
coding:item.sku.coding,
image: item.spu.spu_cover,
title: item.spu.spu_name,
content: item.spu.unit,
slide_x: 0,
price:item.spu.original_price,
num:item.num,
ifcheck:this.skuId==item.sku_id ? true : false,
ifExit:true,
ifShow:true,
}
this.listData.push(obj);
console.log(this.listData);
})
}
}
this.ifMore = false;
this.ifLoading = false;
})
// for (let i = 0; i < 10; i++) {
// this.listData.push({id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '',content: '',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true})
// }
@ -167,9 +202,23 @@
if(this.allPrice==0) {
//
console.log('去购物');
uni.reLaunch({
url:`/pages/tabbar/cate/cate?index=0`
})
} else {
//
console.log('去结算');
let buyList = [];
this.listData.forEach(item=>{
if(item.ifcheck) {
let obj = {
sku_coding: item.coding,
num: item.num
}
buyList.push(obj);
}
})
uni.setStorageSync('buyList',buyList);
uni.navigateTo({
url:'/pagesB/settlement/settlement'
})
@ -179,12 +228,6 @@
chooseEv(index) {
this.listData[index].ifcheck = !this.listData[index].ifcheck;
},
//
goDetail(id) {
uni.navigateTo({
url:'/pagesB/shop-detail/shop-detail'
})
},
//
addCutEv(index,num) {
if(this.listData[index].slide_x==0){
@ -197,11 +240,44 @@
//
if(this.listData[index].num > this.minNum) {
this.listData[index].num--;
}else{
uni.showModal({
title: '提示',
content: '是否将该商品移除购物车?',
success: (res)=> {
if (res.confirm) {
this.delShopEv(this.listData[index].id);
}
}
console.log(this.allPrice,'总价');
});
}
}
this.$requst.post('/api/order/shopping-cart-change-num',{id:this.listData[index].id,num:this.listData[index].num}).then(res=>{
if(res.code!=0){
this.$toolAll.tools.showToast(res.msg);
}
})
}
},
//
delShopEv(id){
this.$requst.post('/api/order/shopping-cart-del',{id:id}).then(res=>{
if(res.code==0){
this.$toolAll.tools.showToast('删除成功');
this.getList();
}else{
this.$toolAll.tools.showToast(res.msg)
}
})
},
//
goDetail(id) {
uni.navigateTo({
url:'/pagesB/shop-detail/shop-detail?id='+id
})
},
//
focusEv(num) {
//
@ -214,133 +290,6 @@
// 0 =
this.listData[index].num = currentNum ? currentNum > this.maxNum ? this.maxNum : currentNum : this.originalNum;
},
clone(data) {
const type = typeof data
let obj;
if (type === 'array') {
obj = [];
} else if (type === 'object') {
obj = {};
} else {
//
return data;
}
if (type === 'array') {
for (let i = 0, len = data.length; i < len; i++) {
obj.push(this.clone(data[i]));
}
} else if (type === 'object') {
// ....
for (const key in data) {
obj[key] = this.clone(data[key]);
}
}
return obj;
},
//
touchStart(e, index) {
if (this.itemIndex == index) {
this.itemIndex = index
}
//
this.startTime = e.timeStamp;
//
this.start_slide_x = this.listData[index].slide_x;
//
//#ifdef MP-WEIXIN
uni.createSelectorQuery().in(this).selectAll('.group-btn').boundingClientRect(res => {
if (res != null) {
this.btnWidth = res[index].width * -1;
}
}).exec();
//#endif
//#ifdef H5 || APP-PLUS
uni.createSelectorQuery()
.selectAll('.group-btn')
.boundingClientRect()
.exec(res => {
if (res[0] != null) {
this.btnWidth = res[0][index].width * -1;
}
});
//#endif
//
this.startX = e.touches[0].pageX;
//
this.lastX = this.startX;
//
for (var i in this.listData) {
if (index != i) {
this.listData[i].slide_x = 0;
}
}
},
//
touchMove(e, index) {
const endX = e.touches[0].pageX;
const distance = endX - this.lastX;
//
const duang = this.listData[index].slide_x + distance;
//
if (duang <= 0 && duang >= this.btnWidth) {
this.listData[index].slide_x = duang;
}
//
this.lastX = endX;
},
//
touchEnd(e, index) {
let distance = 10;
const endTime = e.timeStamp;
const x_end_distance = this.startX - this.lastX;
if (Math.abs(endTime - this.startTime) > 200) {
distance = this.btnWidth / -2;
}
//
if (x_end_distance > distance) {
this.listData[index].slide_x = this.btnWidth;
} else if (x_end_distance < distance * -1) {
this.listData[index].slide_x = 0;
} else {
this.listData[index].slide_x = this.start_slide_x;
}
},
//
recover(index) {
this.listData[index].slide_x = 0;
},
/**
* 点击按钮触发事件
* @param {Object} item 列表数据
* @param {Object} buttonItem 按钮数据
* @param {Object} index 列表数据key
*/
clickMethod(item, buttonItem, index,key) {
// this.$emit("change", item, buttonItem, index);
// if(key) {
//
//
this.listData[index].ifExit = false;
//
this.listData[index].ifcheck = false;
setTimeout(()=>{
//
this.listData[index].ifShow = false;
},1000)
setTimeout(()=>{
//
this.listData = this.listData.filter(item=>item.ifExit==true);
},1000)
// }
},
/**
* 点击按钮触发事件
* @param {Object} item 列表数据
*/
clickItemMethod(item) {
this.$emit("click", item)
}
}
};
</script>
@ -398,7 +347,7 @@
}
.countBtn{font-size: 36rpx;width: 40rpx;height: 40rpx;background-color: #000000;color: #FFFFFF; border-radius: 10rpx;}
.countInput{background-color: #FFFFFF;width: 80rpx;height: 40rpx!important; border-radius: 10rpx;padding: 0rpx 0;margin: 0 10rpx;}
.cart-foot-box{position: fixed;bottom: 0;right: 0;left: 0;background-color: #FFFFFF; padding: 20rpx 20rpx;box-shadow: -6rpx 0rpx 10rpx rgba(0, 0, 0, 0);}
.cart-foot-box{position: fixed;bottom: 0;right: 0;left: 0;background-color: #FFFFFF;z-index: 2; padding: 20rpx 20rpx;box-shadow: -6rpx 0rpx 10rpx rgba(0, 0, 0, 0);}
.cart-submit-btn{
color: #FFFFFF;

View File

@ -132,7 +132,14 @@
},
//
backEv(){
uni.navigateBack({delta:1})
uni.navigateBack({
delta:1,
fail: () => {
uni.reLaunch({
url:'/pages/tabbar/pagehome/pagehome'
})
}
})
}
}
}

View File

@ -13,7 +13,7 @@
</view>
<!-- 下划线 -->
<view class="tab__line"
:style="{background: lineColor, width: lineStyle.width, transform: lineStyle.transform,transitionDuration: lineStyle.transitionDuration}">
:style="{background: lineColor, width: lineStyle.width, transform: lineStyle.transform}">
</view>
</scroll-view>
</view>
@ -159,9 +159,10 @@
}
}
.tab__line {
display: block;
display: inline-block;
// height: 6rpx;
position: absolute;
width: 0;
height: 64rpx;
bottom: 0rpx;
left: 0;

View File

@ -112,7 +112,6 @@
};
},
mounted() {
// +
const query = wx.createSelectorQuery().in(this)
query.select('.posi-sticky').boundingClientRect((rect) => {
console.log(rect.height);

View File

@ -75,7 +75,7 @@
methods:{
//
chooseImg(index,url){
// console.log('banner',index);
console.log('当前banner图',index,url);
this.bcurrent = index
if(this.browseP){
let imgList = []
@ -104,11 +104,13 @@
current:this.bcurrent,
sources:imgList
})
} else {
}
if(url){
//
uni.navigateTo({
url:`/${url}`
})
console.log(`/${url}`,'跳转链接');
}
},
//

View File

@ -1,4 +1,47 @@
import request from './requst.js';
export function uploadImg(data) {
return request.upload("/universal/api.upload/upload", data);
import requst from './requst.js';
import store from '@/store/index.js'
// 查询轮播位置
export function slidePosition(data) {
return requst.get("/api/common/slide-positions");
}
//查询主题色,图标配置
export function themeEv(){
return requst.get('/api/index/mini-program-setting').then(res=>{
if(res.code==0){
let list = [];
if(res.data.footBar.length){//底部导航
res.data.footBar.forEach(item=>{
let obj = {
iconPath: item.icon,
selectedIconPath: item.icon,
title:item.name
}
list.push(obj);
})
store.commit('updateState', {list})
}
let geList = [];
if(res.data.recommend.length){//底部导航
res.data.recommend.forEach((item,index)=>{
let obj = {
url:item.link,
iconsrc:item.icon,
iconWidth:[48,56,64,48,56,58,48,44,54,52][index],
iconHeight:[50,54,46,48,58,52,54,56,50,52][index],
title:item.name
}
geList.push(obj);
})
store.commit('setGe', {geList})
}
}
})
}
// 查询购物车数量
export function getCartNum(){
return requst.get('/api/order/shopping-cart-count').then(res=>{
if(res.code==0){
store.commit('setNum', res.data.count)
}
})
}

View File

@ -2,36 +2,27 @@
const goLogin = () => {
uni.clearStorageSync();
uni.navigateTo({
url: '/pages/login/login'
url: '/pagesB/login/login'
})
}
let flag = true;
// 刷新token并跳转到当前页面
var authTimer = null;
const refreshTokenPage = () => {
uni.login({
provider: 'weixin',
success: (result)=> {
uni.request({
url: `${getApp().globalData.hostapi}user/login`,
method: 'post',
data: {code:result.code},
success: res => {
if(res.data.data.token!=''){
flag = true;
uni.setStorageSync('token',res.data.data.token); // 缓存token
uni.setStorageSync('openid',res.data.data.openid)//缓存openid
uni.setStorageSync('expire',res.data.data.expire); // 缓存失效时间(时间戳格式)
uni.reLaunch({ // 重新进入当前页面
url:uni.getStorageSync('page-path-options')
})
}
}
})
},
clearTimeout(authTimer);
uni.showToast({
title: `请授权登录`,
icon:'none',
duration: 1000
});
authTimer = setTimeout(()=>{
uni.reLaunch({url:'/pagesB/login/login'});
},1000)
flag = true;
}
// 请求错误处理
const checkError = (e) => {
console.log('500接口错误');
// console.error("----接口错误----", e)
if (e.data) {
if (e.data.code) {
@ -111,10 +102,8 @@ const request = (method, url, options) => {
success: res => {
console.log(`${url}返的结果===>`,res);
if (res.statusCode == 200) {
if (res.data.code == 0) {
// 接口调用成功
resolve(res.data);
} else {
if(res.data.code !== 0){
// 接口返回错误信息
checkError(res);
}

View File

@ -270,7 +270,7 @@ const tools = {
})
.replace('<section', '<div')
.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, (match, p1) => {
return `<img mode="widthFix" style="max-width:100%!important;height:auto" src='${p1.indexOf('http') > -1 ? p1 : 'https://oss.hmzfyy.cn' + p1}' />`
return `<img mode="widthFix" style="max-width:100%!important;height:auto" src='${p1.indexOf('http') > -1 ? p1 : 'https://www.cdxidoudou.cn' + p1}' />`
})
},
/**
@ -384,9 +384,9 @@ const tools = {
let auth = false;
clearTimeout(this.authTimer);
if(!uni.getStorageSync('token')) {
this.showToast('请登录');
this.showToast('请授权登录');
this.authTimer = setTimeout(()=>{
uni.navigateTo({url:'/pages/login/login'});
uni.reLaunch({url:'/pagesB/login/login'});
},2000)
} else {
auth = true;
@ -578,7 +578,9 @@ const tools = {
success: (res) => {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: ()=> {},
success: ()=> {
uni.showToast({title:'保存成功',icon:'error'})
},
fail: () => {
uni.showToast({title:'保存失败',icon:'error'})
}

View File

@ -17,10 +17,16 @@ Vue.prototype.$toolAll = tools;
import requst from '@/jsFile/requst.js';
Vue.prototype.$requst = requst;
//不显示console.log
if (uni.getSystemInfoSync().platform !== "devtools") {
console.log = () => {}
}
App.mpType = 'app';
const app = new Vue({
store,
...App
})
app.$mount()

View File

@ -1,5 +1,5 @@
{
"name" : "app适配微信小程序",
"name" : "喜兜兜",
"appid" : "__UNI__768F35C",
"description" : "这是一款基于uniapp开发的app和微信小程序的模板框架",
"versionName" : "1.0.0",
@ -69,7 +69,7 @@
/* */
"mp-weixin" : {
/* */
"appid" : "wxa02e44170bc722cd",
"appid" : "wx9cfa3ee7718b714e",
"setting" : {
"urlCheck" : true,
"es6" : true

View File

@ -38,15 +38,6 @@
"root": "pagesA",
"pages": [
{
"path" : "shopping-cart-slide/shopping-cart-slide",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "order-list/order-list",
"style" :
{

View File

@ -1,41 +1,456 @@
<template>
<view class="pad-x160">
<status-container :ifReturn="false" titlet="购物车" :ifCustomer='false'>
<view slot="content" style="margin: 0rpx -20rpx 0 -20rpx;">
<cart-slide ref="cart"></cart-slide>
<status-nav :ifReturn="true" navBarTitle="购物车" :marginBottom="0"></status-nav>
<view class="cart-content">
<!-- <view class="cart-admin" v-if="listData.length>0" @tap="showDel=!showDel"><text>购物车信息</text>{{showDel?'取消':'管理'}}</view> -->
<view class="slide-list">
<view class="slide-item" v-for="(item, index) in listData" :key="index">
<view class="slide-item-li" @click="clickItemMethod(item)">
<label class="radio"><radio :checked="item.ifcheck" @tap.stop="chooseEv(index)" color="#ff3673"/></label>
<view class="shop-img" @tap="goDetail(item.spuId,item.is_series)">
<image :src="item.image" mode="widthFix"></image>
</view>
<view class="shop-txt">
<view class="shop-txt-top" @tap="goDetail(item.spuId,item.is_series)">
<view class="fon28 bold clips2">{{item.title}}</view>
<view class="fon24 clips2 line-h40">单位{{item.content}}</view>
</view>
<view class="shop-txt-bottom">
<!-- 商品价格 -->
<view class="fon24 textc bold"><span class="fon28 ">{{item.price}}</span></view>
<!-- 商品数量 -->
<view class="num">
<!-- 减数量 -->
<i class="icon icon-cut count-btn" @tap.stop="addCutEv(index,0)" :style="{backgroundColor: item.num==minNum || item.slide_x!=0 ? '#d3d3d3' : '#ff3673'}"></i>
<!-- 实际数量 -->
<input class="input" type="digit" @blur="blurEv(index,$event)" @focus="focusEv(item.num)" :disabled="item.slide_x!=0" v-model="item.num">
<!-- 加数量 -->
<i class="icon icon-add count-btn" @tap.stop="addCutEv(index,1)" :style="{backgroundColor: item.num==maxNum || item.slide_x!=0 ? '#d3d3d3' : '#ff3673'}"></i>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 全选 -->
<view class="change-all">
<label class="label" @tap="chooseAll"><radio :checked="allChoose" color="#ff3673" style="transform: scale(.8);margin-left: -6rpx;"/><text>全选</text></label>
<view class="all-price" v-if="showDel">
<view class="btn" style="background-color: #ff3673;" @tap="delShopEv"></view>
</view>
<view class="all-price" v-else>
<view class="price">合计<span>{{allPrice}}</span></view>
<view class="btn cart-submit-btn" :style="{background: !buyNum?'#cccccc':'linear-gradient(to right,#ff3771 0%,#fd5549 100%)'}" @tap="submitEv">{{allPrice==0 ? '' : ` (${buyNum})`}}</view>
</view>
</view>
<!-- 暂无更多内容 -->
<view class="more-txt" v-if="listData.length!==0 && noMore"><pitera textStr="—— 到底啦 ——"></pitera></view>
<nothing-page v-if="isLoading && listData.length==0" content="您的购物车,空空如也(*^▽^*)"></nothing-page>
</view>
</status-container>
<!-- 底部tab -->
<view class="foot-box"><foot-tab current="2"></foot-tab></view>
</view>
</template>
<script>
//
import footTab from '@/components/foot-tabs/foot-tab.vue';
import cartSlide from '@/components/shopping-carts/cart-slide';
import statusNav from '@/components/status-navs/status-nav.vue';
import {getCartNum} from '@/jsFile/public-api.js';
import pitera from '@/components/nothing/pitera';
import {mapState} from 'vuex'//mapState
export default {
components:{
'foot-tab' :footTab,
cartSlide
statusNav,
pitera
},
data() {
return {
statusHeight:uni.getSystemInfoSync().statusBarHeight,
originalNum:0,//
maxNum:99999,//
minNum:1,//
skuId:'',
listData: [],
page:1,
size:1000,
total:0,
delIds:'', //ids
noMore:false, //
isLoading:true,
flag:true,
showDel:false,
}
},
onShow() {
uni.removeStorageSync('buyList');
this.listData = [];
//
this.getList();
},
onReachBottom() {
this.$refs.cart.getList();
if(!this.noMore){
this.page++;
//
this.getList();
}
},
computed: {
//
windowWidth() {
return uni.getSystemInfoSync().windowWidth;
},
onLoad() {
//
allPrice() {
let allPrice = 0;
this.listData.forEach(item=>{
if(item.ifcheck) {
allPrice += item.price*item.num;
}
})
return this.$toolAll.tools.addXiaoShu(allPrice);
// return allPrice;
},
//
buyNum() {
let buyNum = 0;
this.listData.forEach(item=>{
if(item.ifcheck) {
buyNum += 1;
}
})
return buyNum;
},
//
allChoose() {
let ifAll = false;
if(this.listData.length) {
let temparr = this.listData.filter(item=>{return item.ifcheck==false})
temparr.length==0 ? ifAll = true : ifAll = false;
let delTemparr = this.listData.filter(item=>{return item.ifcheck==true})
let delArr = [];
delTemparr.forEach(item=>{
delArr.push(item.id)
})
//
this.delIds = delArr.join(',');
}
return ifAll
},
},
methods: {
//
getList(){
uni.showLoading();
this.total = 0;
let params = {
page:this.page,
size:this.size
}
this.$requst.post('/api/order/shopping-cart',params).then(res=>{
if(res.code==0){
console.log(res,'购物车列表');
this.total = res.data.total;
let cartArr = [];
res.data.list.forEach(item=>{
let obj = {
id: item.id,
spuId:item.spu.id,
skuId:item.sku_id,
coding:item.sku.coding,
image: item.spu.spu_cover,
title: item.spu.spu_name,
content: item.spu.unit,
slide_x: 0,
price:item.spu.original_price,
num:item.num,
ifcheck:this.skuId==item.sku_id ? true : false,
ifExit:true,
ifShow:true,
}
cartArr.push(obj);
})
this.listData = this.listData.concat(cartArr);
if(this.listData.length == this.total){
this.noMore = true;
}
}
uni.hideLoading();
this.isLoading = true;
})
},
//
chooseEv(index) {
this.listData[index].ifcheck = !this.listData[index].ifcheck;
},
//
chooseAll(){
let exit = this.listData.filter(item=>item.ifcheck==false);
if(exit.length){
this.listData.forEach(item=>item.ifcheck = true);
} else {
this.listData.forEach(item=>{item.ifcheck = false});
}
},
//
submitEv(){
if(this.allPrice==0) {
//
uni.reLaunch({
url:`/pages/tabbar/cate/cate?index=0`
})
} else {
//
let buyList = [];
this.listData.forEach(item=>{
if(item.ifcheck) {
let obj = {
sku_coding: item.coding,
num: item.num
}
buyList.push(obj);
}
})
uni.setStorageSync('buyList',buyList);
uni.navigateTo({
url:'/pagesB/settlement/settlement'
})
}
},
//
addCutEv(index,num) {
if(this.listData[index].slide_x==0){
if(num) {
//
if(this.listData[index].num != this.maxNum) {
this.listData[index].num++;
}
} else {
//
if(this.listData[index].num > this.minNum) {
this.listData[index].num--;
}else{
//
uni.showModal({
title: '提示',
content: '是否将该商品移除购物车?',
success: (res)=> {
if (res.confirm) {
this.delShopEv(this.listData[index].id);
}
}
});
}
}
this.$requst.post('/api/order/shopping-cart-change-num',{id:this.listData[index].id,num:this.listData[index].num}).then(res=>{
if(res.code!=0){
this.$toolAll.tools.showToast(res.msg);
}
})
}
},
//
delShopEv(id){
this.$requst.post('/api/order/shopping-cart-del',{id:id}).then(res=>{
if(res.code==0){
this.listData = this.listData.filter(item => item.id !== id);
this.$toolAll.tools.showToast('删除成功');
// this.getList();
}else{
this.$toolAll.tools.showToast(res.msg)
}
})
},
//
// delShopEv(){
// if(this.delIds!==''){
// uni.showModal({
// title: '',
// content: '',
// success: (res)=> {
// if (res.confirm) {
// //
// this.confirmDel();
// } else if (res.cancel) {
// console.log('');
// }
// }
// });
// }
// },
//
// confirmDel(){
// this.$requst.post('/api/order/shopping-cart-del',{id:this.delIds.toString()}).then(res=>{
// if(res.code==0){
// this.listData = this.listData.filter(item=>item.ifcheck==false)
// this.$toolAll.tools.showToast('');
// }else{
// this.$toolAll.tools.showToast(res.msg)
// }
// })
// },
//
goDetail(id) {
uni.navigateTo({
url:'/pagesB/shop-detail/shop-detail?id='+id
})
},
//
focusEv(num) {
//
this.originalNum = num;
},
//
blurEv(index,e) {
//
let currentNum = e.detail.value*1;
// 0 =
this.listData[index].num = currentNum ? currentNum > this.maxNum ? this.maxNum : currentNum : this.originalNum;
},
}
};
</script>
<style>
<style scoped>
.cart-admin{
box-sizing: border-box;
display: flex;
justify-content: space-between;
padding: 20rpx 30rpx;
font-size: 30rpx;
background-color: #FFFFFF;
border-bottom: 2rpx solid #eaeaea;
margin-top: 20rpx;
color: #666666;
}
.cart-admin>text{
color: #000000;
}
.slide-item{
margin-top: 25rpx;
}
.slide-item-li{
box-sizing: border-box;
display: flex;
align-items: center;
padding: 20rpx 30rpx;
background-color: #FFFFFF;
}
.slide-item-li .radio>radio{
transform: scale(.8);
margin-left: -6rpx;
}
.slide-item-li .shop-img{
width: 230rpx;
height: 150rpx;
border-radius: 10rpx;
margin: 0 24rpx 0 6rpx;
overflow: hidden;
}
.slide-item-li .shop-img image{
width: 230rpx;
min-height: 150rpx;
}
.slide-item-li .shop-txt{
width: calc(100% - 300rpx);
}
.shop-txt-top{
min-height: 100rpx;
}
.shop-txt-top .title{
font-size: 30rpx;
line-height: 1.5;
color: #000000;
font-weight: bold;
}
.shop-txt-top .specs{
font-size: 24rpx;
line-height: 1.5;
color: #8c8c9b;
margin: 3rpx;
}
.shop-txt-bottom{
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
height: 50rpx;
}
.shop-txt-bottom .price{
font-size: 30rpx;
line-height: 1.5;
color: #f81c1c;
}
.shop-txt-bottom .num{
display: flex;
justify-content: space-between;
align-items: center;
width: 170rpx;
font-size: 24rpx;
}
.shop-txt-bottom .num>.count-btn{
display: flex;
justify-content: center;
align-items: center;
font-size: 24rpx;
width: 40rpx;
height: 40rpx;
background-color: #000000;
color: #FFFFFF;
border-radius: 10rpx;
}
.shop-txt-bottom .num>.input{
box-sizing: border-box;
width: 78rpx;
height: 40rpx;
border: 2rpx solid #d3d3d3;
border-radius: 10rpx;
text-align: center;
}
.change-all{
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
width: 100vw;
height: 130rpx;
padding: 0 30rpx;
position: fixed;
left: 0;
bottom: 0;
z-index: 99;
background-color: #FFFFFF;
}
.change-all .label{
display: flex;
align-items: center;
font-size: 24rpx;
}
.all-price{
display: flex;
align-items: center;
}
.all-price .price{
font-size: 24rpx;
margin-right: 25rpx;
color: #000000;
}
.all-price .btn{
line-height: 84rpx;
padding: 0 30rpx;
border-radius: 10rpx;
font-size: 32rpx;
color: #FFFFFF;
}
</style>

View File

@ -1,35 +1,43 @@
<template>
<view>
<view v-if="isLoding">
<status-container :ifReturn="false" titlet="分类">
<view slot="content" style="margin: -20rpx -20rpx 0 -20rpx;">
<view class="dis">
<view>
<view class="cate-left-box">
<scroll-view scroll-y :style="{height: scrollHeight +'px'}" class="bacf">
<view class="pad-x160">
<view>
<view class="flexs clips1 pad-z20 fon24"
@tap="chooseCate(index)" :style="{backgroundColor: current==index ? '#ff3673' : '#FFFFFF',color: current==index ? '#FFFFFF' : '#000000'}"
v-for="(item,index) in cateList" :key="index" style="min-width: 160rpx;height: 86rpx;line-height: 86rpx;box-sizing: border-box;" >{{item.title}}</view>
</view>
</scroll-view>
</view>
<view class="pad-zy20">
<view class="pad-sx20" :style="{width: newWidth+'px'}">
<swiper-tab-jl :list="secendCateList" v-model="activeIndex" @changeEv="clickTab" itemColor="#FFFFFF"></swiper-tab-jl>
</view>
<view class="disac bbt-d9 pad-sx30" @tap="goDetail(index)" v-for="(item,index) in dataList" :key="index">
<image class="radius30 flexs borbot-cc" :src="item.imgsrc" mode="aspectFill" style="width: 240rpx;height: 240rpx;"></image>
<view class="pad-zy20" style="width: 100%;position: relative;">
<view class="cate-title">{{cateList[current].title}}</view>
<scroll-view :style="{height: scrollHeight +'px'}" style="padding-top: 60rpx;box-sizing: border-box;"
scroll-y="true"
:scroll-into-view="doms"
scroll-with-animation
@scroll="scrolls"
@scrolltolower="scrollBottomEv">
<view class="posir" :id="'product'+index" v-for="(item,index) in dataList" :key="index">
<view class="disac bbt-d9 pad-sx30" @tap="goDetail(item1.id)" v-for="(item1,index1) in item" :key="index1">
<view class="cate-txt">
<image class="radius30 flexs borbot-cc" :src="item1.imgsrc" mode="aspectFill" style="width: 240rpx;height: 240rpx;"></image>
<view class="width100 disjb fc mar-z20" style="height: 240rpx;">
<view class="fon30 colb clips2">{{item.title}}</view>
<view class="fon30 colb clips2">{{item1.title}}</view>
<view class="">
<view class="fon36 textc mar-x36">{{$toolAll.tools.changeNum(item.price)}}</view>
<view @tap.stop="addCartEv(index)" class="colf disjcac fon24 radius30 cate-btn">
<view class="fon36 textc mar-x36">{{item1.price}}</view>
<view @tap.stop="addCartEv(item1.skuId)" class="colf disjcac fon24 radius30 cate-btn">
<i class="icon icon-shop-cart mar-y10" style="font-size: 36rpx;"></i>
立即选购
</view>
</view>
</view>
</view>
<view class="mar-s40"><pitera textStr="——到底啦——"></pitera></view>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
@ -45,6 +53,8 @@
import swiperTabJl from '@/components/swiper-tab/swiper-tab-jl.vue';
//
import footTab from '@/components/foot-tabs/foot-tab.vue';
import {getCartNum} from '@/jsFile/public-api.js';
import { mapState } from 'vuex'//mapState
export default {
components:{
'foot-tab' :footTab,
@ -56,78 +66,193 @@
return {
current:0,
scrollHeight:uni.getSystemInfoSync().windowHeight - uni.getSystemInfoSync().statusBarHeight - 50,
newWidth:uni.getSystemInfoSync().windowWidth - 100,
cateList:[
{id:1,title:'推荐套装'},
{id:1,title:'推荐套装'},
{id:1,title:'推荐套装'},
{id:1,title:'推荐套装'},
{id:1,title:'推荐套装'},
{id:1,title:'推荐套装'},
{id:1,title:'推荐套装'},
{id:1,title:'推荐套装'},
{id:1,title:'推荐套装'},
{id:1,title:'推荐套装'},
],
secendCateList:[
{title:'标题一'},
{title:'标题二标题二'},
{title:'标题三'},
{title:'标题四'},
{title:'标题五'},
{title:'标题六标题六标题六'},
{title:'标题七'},
{title:'标题八'},
{title:'标题九'},
],
newWidth:uni.getSystemInfoSync().windowWidth,
cateList:[], //
activeIndex:0,
dataList:[
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题',price:199},
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
],
ifloading:false,
flag:true
secendCateList:[],
dataList:[], //
total:0,
flag:true,
ifLoading:false,
pid:'',//id
doms:'',
topList:[],
heightData: 0,
scroll:true,
cateCurrent:0,
isLoding:false,
}
},
computed:{
...mapState({
footHeight: state => state.moduleA.footHeight,
}),
},
onLoad(op) {
this.scrollHeight = this.scrollHeight - this.footHeight;
if(op.index) {
this.current = op.index;
this.cateCurrent = op.index;
}
this.checkShopCate();
},
onShareAppMessage() {
return {
title:'喜兜兜-分类',
path:uni.getStorageSync('page-path-options'),
imageUrl:'/static/public/xdd-logo.png'
}
},
methods: {
scrollBottomEv(e){
if(this.flag){
this.flag = false;
this.ifloading = true;
setTimeout(()=>{
for (let i = 0; i < 2; i++) {
//
checkShopList(){
uni.showLoading({
title:'加载中'
})
for(let i=0;i<this.cateList.length;i++){
this.ifLoading = true;
let params = {
page:1,
size:9999,
category_id:this.cateList[i].id
}
this.$requst.post('/api/spu/list',params).then(res=>{
if(res.code==0) {
this.total = res.data.total;
let newArr = [];
res.data.list.forEach(item=>{
let obj = {
title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99
id:item.id,
skuId:item.skuId,
imgsrc:item.cover,
title:item.name,
price:item.price
}
this.dataList[e].push(obj);
newArr.push(obj);
})
this.dataList[i] = newArr;
if(i == this.cateList.length-1){
this.current = this.cateCurrent;
this.doms = 'product'+this.current;
setTimeout(()=>{
const query = uni.createSelectorQuery().in(this);
query.select('.cate-title').boundingClientRect(data => {
this.heightData = data.height
}).exec();
},200)
this.getNodesInfo();
this.ifLoading = false;
uni.hideLoading();
this.isLoding =true;
}
this.ifloading = false;
this.flag = true;
},1000)
//
this.$forceUpdate();
}
})
}
},
//
chooseCate(index) {
this.current = index;
},
goDetail(id) {
uni.navigateTo({
url:'/pagesB/shop-detail/shop-detail'
//
checkShopCate(){
this.$requst.post('/api/spu/category',{hasChildren:1}).then(res=>{
if(res.code==0) {
this.cateList = res.data;
setTimeout(()=>{
//
const query = wx.createSelectorQuery().in(this)
query.select('.cate-left-box').boundingClientRect((rect) => {
this.newWidth = this.newWidth - rect.width - 20;
}).exec()
},200)
this.checkShopList();
}
})
},
addCartEv(id) {
this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)')
scrollBottomEv(){
console.log('触底了');
// setTimeout(()=>{
// this.current =this.cateList.length - 1;
// },80)
},
// tab
clickTab(index){
this.activeIndex = index;
//
chooseCate(index) {
if(this.scroll){
if(this.current !== index){
this.scroll =false;
this.current =index
this.doms = 'product'+index
}
this.scroll = true;
}
},
//
scrolls(e){
this.scroll =false;
let scrollTop = e.target.scrollTop
for(let i =0;i<this.topList.length;i++){
let h1 = this.topList[i];
let h2 = this.topList[i+1];
if(scrollTop>=h1&&scrollTop<h2-5){
this.current = i
}
}
this.scroll =true;
},
// topList
getNodesInfo(){
setTimeout(()=>{
const query = uni.createSelectorQuery().in(this);
query.selectAll('.posir').boundingClientRect().exec((res)=>{
let nodes = res[0]
let rel =[];
nodes.map(item=>{
rel.push(item.top-uni.getSystemInfoSync().statusBarHeight-50-this.heightData)
})
this.topList = rel
// console.log(this.topList,234)
})
},200)
},
//
setTop(){
this.getElementData('#index-cate-bg', (res) => {
let el = res[0];
this.scrollTop = el.top;
if(this.scrollTop==this.statusHeight+35){
this.isShow = false;
}else{
this.isShow = true;
}
})
},
// DOM
getElementData(el, callback) {
uni.createSelectorQuery().in(this).selectAll(el).boundingClientRect().exec((data) => {
callback(data[0]);
});
},
//
goDetail(id) {
uni.navigateTo({
url:'/pagesB/shop-detail/shop-detail?id='+id
})
},
//
addCartEv(id) {
this.$requst.post('/api/order/shopping-cart-add',{sku_id:id,num:1}).then(res=>{
if(res.code==0) {
this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)');
getCartNum();
} else {
this.$toolAll.tools.showToast(res.msg)
}
})
},
}
}
@ -135,4 +260,9 @@
<style>
.cate-btn{background: linear-gradient(to right,#ff3772 0%,#fd5549 100%);width: 170rpx;height: 60rpx;box-shadow: 0rpx 6rpx 10rpx rgba(255, 55, 114, .3);}
.disac {flex-wrap: wrap;}
.cate-txt{
display: flex;
}
.cate-title{position: absolute;left:0; top:0; width: 100%; background-color: #fff; font-size: 24rpx;line-height: 60rpx;color: #666; z-index: 9;text-indent: 20rpx;}
</style>

View File

@ -1,13 +1,13 @@
<template>
<view class="pad-x180">
<status-nav :ifReturn="false" titleColor="#FFFFFF" navBarTitle="个人中心" backgroudColor="transparent"></status-nav>
<view class="head-box" :style="{paddingTop: padt+'px'}" style="background: linear-gradient( to top, #ff3574 0%, #fd5646 100%);position: fixed;top: 0;left: 0;right: 0;z-index: 2;">
<status-nav :ifReturn="false" titleColor="#FFFFFF" navBarTitle="个人中心" backgroudColor="#fe4b57"></status-nav>
<view class="head-box" style="background: linear-gradient( to top, #ff3574 0%, #fe4b57 100%); padding: 0 0 20px; margin-top: -20rpx;">
<view class="mar-zy40 mar-s20 mar-x90 disac colf fon36">
<image src="https://s6.jpg.cm/2022/02/14/L4oDhy.jpg" mode="aspectFill" style="width: 126rpx;height: 126rpx;border-radius: 100%;border: 6rpx solid #FFFFFF;"></image>
<view class="mar-z30">Anita Rose</view>
<image :src="userImg" mode="aspectFill" style="width: 126rpx;height: 126rpx;border-radius: 100%;border: 6rpx solid #FFFFFF;"></image>
<view class="mar-z30">{{userName}}</view>
</view>
</view>
<view class="pad-zy40" :style="{paddingTop: headHeight+'px'}" style="position: relative;z-index: 3;">
<view class="pad-zy40" style="position: relative;z-index: 3;">
<view class="bacf radius20" style="margin-top: -80rpx;">
<view class="pad-zy30">
<column-function :ifLine="false" :list="list1" fonts="36" @chooseEv="chooseEv"></column-function>
@ -21,15 +21,16 @@
</view>
</view>
<!-- 添加微信 -->
<view class="" v-if="ifWx" :style="{top: padt+'px'}" @tap="ifWx=false" style="position: fixed;right: 0;bottom: 0;left: 0;background-color: rgba(0, 0, 0, 0.86);z-index: 4;">
<view class="pad-s120 pad-zy50">
<view class="addwxpop" v-if="ifWx" :style="{top: padt+'px'}" @tap="ifWx=false">
<view class="pad-s80 pad-zy50">
<view class="bacf pad20 disjcac" style="width: 420rpx;height: 420rpx;margin: 0 auto;">
<image :src="imgsrc" style="width: 380rpx;height: 380rpx;" mode="aspectFill"></image>
<image :src="imgsrc" style="" mode="aspectFill"></image>
</view>
<view class="colf line-h56 mar30">
<view class="fon36">请扫描二维码添加微信告知您的订单号并支付定金 发货前请支付尾款</view>
<view class="colf line-h56 mar-sx30">
<!-- <view class="fon36">请扫描二维码添加微信告知您的订单号并支付定金 发货前请支付尾款</view>
<view class="fon24 tcenter">支付定金后我们才会开始制作哦如您有特别的要求可以在微信上提出哦</view>
<view class="fon36 tcenter">祝您幸福美满</view>
<view class="fon36 tcenter">祝您幸福美满</view> -->
<rich-text :nodes="addwxcontent"></rich-text>
</view>
<view @tap.stop="saveImg" class="navigate-to-where radius30 colf fon36 tcenter mar-s50 bold mar-zy30">保存二维码</view>
</view>
@ -59,10 +60,10 @@
padt:uni.getSystemInfoSync().statusBarHeight + 50,
headHeight:'',//
list:[
{url:'',iconsrc:'/static/public/icon-payment.png',iconWidth:50,iconHeight:44,title:'已下单'},
{url:'',iconsrc:'/static/public/icon-send-goods.png',iconWidth:46,iconHeight:40,title:'制作中'},
{url:'',iconsrc:'/static/public/icon-take.png',iconWidth:48,iconHeight:42,title:'已发货'},
{url:'',iconsrc:'/static/public/icon-finish.png',iconWidth:49,iconHeight:44,title:'已完成'},
{url:'',iconsrc:'/static/public/icon-payment.png',iconWidth:50,iconHeight:44,title:'已下单',num:0},
{url:'',iconsrc:'/static/public/icon-send-goods.png',iconWidth:46,iconHeight:40,title:'制作中',num:0},
{url:'',iconsrc:'/static/public/icon-take.png',iconWidth:48,iconHeight:42,title:'已发货',num:0},
{url:'',iconsrc:'/static/public/icon-finish.png',iconWidth:49,iconHeight:44,title:'已送达',num:0},
],
list1: [
{url:'/pagesA/order-list/order-list',iconsrc:'',iconWidth:60,iconHeight:60,title:'我的订单',content:'全部订单',contentColor:'#999999',ifNext:true},
@ -74,7 +75,10 @@
{url:'/pagesB/business-profile/business-profile',iconsrc:'/static/public/icon-aboutus.png',iconWidth:34,iconHeight:32,title:'商家简介',content:'',contentColor:'#999999',ifNext:true},
],
ifWx:false,
imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg'
imgsrc:'',
userImg:'',
userName:'',
addwxcontent:''
}
},
onReachBottom() {
@ -83,14 +87,36 @@
onHide() {
this.ifWx = false;
},
onShow() {
this.getUserInfo();
},
onLoad() {
// +
const query = wx.createSelectorQuery().in(this)
query.select('.head-box').boundingClientRect((rect) => {
this.headHeight = rect.height - this.padt;
}).exec()
}).exec();
this.$requst.get('/api/index/add-wechat').then(res=>{
if(res.code==0) {
this.addwxcontent = this.$toolAll.tools.escape2Html(res.data.content);
this.imgsrc = res.data.wechat;
}
})
},
methods: {
getUserInfo(){
this.$requst.get('/api/user/info').then(res=>{
console.log(res,'用户信息')
if(res.code==0) {
this.userImg = res.data.headimgurl;
this.userName = res.data.nickname;
this.list[0].num = res.data.order_count.order_placed;
this.list[1].num = res.data.order_count.makeing;
this.list[2].num = res.data.order_count.shipped;
this.list[3].num = res.data.order_count.arrived;
}
})
},
chooseEv(obj) {
if(obj.url) {
uni.navigateTo({
@ -106,7 +132,6 @@
uni.navigateTo({
url:`/pagesA/order-list/order-list?index=${[1,2,3,4][obj.index]}`
})
console.log(obj);
},
//
saveImg(){
@ -119,4 +144,6 @@
<style>
page{background-color: #f7f7f7;}
.navigate-to-where {height: 98rpx;line-height: 98rpx;background: linear-gradient(to right, #ff3772 0%,#fd5548 100%);box-shadow: 0rpx 6rpx 10rpx rgba(255, 55, 114, .6);}
.addwxpop{position: fixed;right: 0;bottom: 0;left: 0;background-color: rgba(0, 0, 0, 0.86);z-index: 4;overflow: hidden;overflow-y: scroll;padding-bottom: 180rpx;}
.addwxpop::-webkit-scrollbar{display: none;}
</style>

View File

@ -1,27 +1,24 @@
<template>
<view class="pad-x180">
<status-nav :ifReturn="false" titleColor="#FFFFFF" navBarTitle="首页" backgroudColor="transparent"></status-nav>
<view class="head-box" :style="{paddingTop: padt+'px'}" style="background: linear-gradient( to top, #ff3574 0%, #fd5745 100%);position: fixed;top: 0;left: 0;right: 0;z-index: 2;">
<view class=" mar-zy40 radius30 pad-zy30 mar-x30 disac" style="background-color: rgba(255, 255, 255, 0.2);">
<status-nav :ifReturn="false" titleColor="#FFFFFF" navBarTitle="首页" backgroudColor="#fe4b57"></status-nav>
<view class="head-box" style="background: linear-gradient( to top, #ff3574 0%, #fe4b57 100%); padding: 0 0 20px; margin-top: -20rpx;">
<view class=" mar-zy40 radius30 pad-zy30 disac" style="background-color: rgba(255, 255, 255, 0.2);">
<image src="/static/public/icon-search.png" mode="widthFix" style="width: 40rpx;height: 40rpx;"></image>
<input @confirm="goSearch" v-model="keyword" class="width100 colf fon30 mar-z20" type="text" placeholder="搜索" style="height: 90rpx;" placeholder-style="color: #FFFFFF">
</view>
</view>
<view class="pad-zy20" :style="{paddingTop: headHeight+'px'}">
<view class="pad-zy20" :style="{paddingTop: 15+'px'}">
<!-- 轮播图 -->
<swiper-pu newRadius="40rpx" newHeight="400rpx" newBottom="20rpx" :isplay='isplay'></swiper-pu>
<swiper-pu newRadius="40rpx" :bannerList="bannerList" newHeight="400rpx" newBottom="20rpx" :isplay='isplay'></swiper-pu>
</view>
<view class="pad-sx20">
<!-- 分类宫格 -->
<gong-ge-function itemTop="40rpx" @chooseGe="chooseGe" :list="list"></gong-ge-function>
<gong-ge-function itemTop="40rpx" @chooseGe="chooseGe" :list="geList"></gong-ge-function>
</view>
<view class="pad-zy20">
<list-one :ifTitle="true"></list-one>
<list-one ref="listhome" :ifTitle="true"></list-one>
</view>
<view class="mar-s60">
<pitera textStr="——到底啦——"></pitera>
</view>
<customer-one></customer-one>
<customer-one :nbottom="150"></customer-one>
<!-- 底部tab -->
<foot-tab></foot-tab>
</view>
@ -33,8 +30,9 @@
import footTab from '@/components/foot-tabs/foot-tab.vue';
import gongGeFunction from '@/components/function-list/gong-ge/gong-ge-function.vue';
import listOne from '@/components/list/list-one';
import pitera from '@/components/nothing/pitera';
import customerOne from '@/components/customer/customer-one';
import {slidePosition} from '@/jsFile/public-api.js';
import { mapState } from 'vuex'//mapState
export default {
components:{
'foot-tab' :footTab,
@ -42,7 +40,6 @@
statusNav,
swiperPu,
listOne,
pitera,
customerOne
},
data() {
@ -50,34 +47,54 @@
padt:uni.getSystemInfoSync().statusBarHeight + 50,
headHeight:'',//
list:[
{url:'/pages/tabbar/cate/cate?index=0',iconsrc:'/static/deleteImg/icon-ge-01.png',iconWidth:60,iconHeight:60,title:'推荐套装'},
{url:'/pages/tabbar/cate/cate?index=1',iconsrc:'/static/deleteImg/icon-ge-02.png',iconWidth:60,iconHeight:60,title:'喜糖组合'},
{url:'/pages/tabbar/cate/cate?index=2',iconsrc:'/static/deleteImg/icon-ge-03.png',iconWidth:60,iconHeight:60,title:'喜盒自选'},
{url:'/pages/tabbar/cate/cate?index=3',iconsrc:'/static/deleteImg/icon-ge-04.png',iconWidth:60,iconHeight:60,title:'喜糖自选'},
{url:'/pages/tabbar/cate/cate?index=4',iconsrc:'/static/deleteImg/icon-ge-05.png',iconWidth:60,iconHeight:60,title:'迎宾糖散糖'},
{url:'/pages/tabbar/cate/cate?index=5',iconsrc:'/static/deleteImg/icon-ge-06.png',iconWidth:60,iconHeight:60,title:'瓜子花生'},
{url:'/pages/tabbar/cate/cate?index=6',iconsrc:'/static/deleteImg/icon-ge-07.png',iconWidth:60,iconHeight:60,title:'伴手礼'},
{url:'/pagesB/buy-read/buy-read',iconsrc:'/static/deleteImg/icon-ge-08.png',iconWidth:60,iconHeight:60,title:'购买须知'},
{url:'/pagesB/business-profile/business-profile',iconsrc:'/static/deleteImg/icon-ge-09.png',iconWidth:60,iconHeight:60,title:'商家简介'},
{url:'/pages/tabbar/cate/cate?index=0',iconsrc:'/static/deleteImg/icon-ge-10.png',iconWidth:60,iconHeight:60,title:'其他推荐'},
{url:'/pages/tabbar/cate/cate?index=0',iconsrc:'/static/deleteImg/icon-ge-01.png',iconWidth:48,iconHeight:50,title:'推荐套装'},
{url:'/pages/tabbar/cate/cate?index=1',iconsrc:'/static/deleteImg/icon-ge-02.png',iconWidth:56,iconHeight:54,title:'喜糖组合'},
{url:'/pages/tabbar/cate/cate?index=2',iconsrc:'/static/deleteImg/icon-ge-03.png',iconWidth:64,iconHeight:46,title:'喜盒自选'},
{url:'/pages/tabbar/cate/cate?index=3',iconsrc:'/static/deleteImg/icon-ge-04.png',iconWidth:48,iconHeight:48,title:'喜糖自选'},
{url:'/pages/tabbar/cate/cate?index=4',iconsrc:'/static/deleteImg/icon-ge-05.png',iconWidth:56,iconHeight:58,title:'迎宾糖散糖'},
{url:'/pages/tabbar/cate/cate?index=5',iconsrc:'/static/deleteImg/icon-ge-06.png',iconWidth:58,iconHeight:52,title:'瓜子花生'},
{url:'/pages/tabbar/cate/cate?index=6',iconsrc:'/static/deleteImg/icon-ge-07.png',iconWidth:48,iconHeight:54,title:'伴手礼'},
{url:'/pagesB/buy-read/buy-read',iconsrc:'/static/deleteImg/icon-ge-08.png',iconWidth:44,iconHeight:56,title:'购买须知'},
{url:'/pagesB/business-profile/business-profile',iconsrc:'/static/deleteImg/icon-ge-09.png',iconWidth:54,iconHeight:50,title:'商家简介'},
{url:'/pages/tabbar/cate/cate?index=0',iconsrc:'/static/deleteImg/icon-ge-10.png',iconWidth:52,iconHeight:52,title:'其他推荐'},
],
keyword:'',
isplay:false,
playTimer:null
playTimer:null,
bannerList:[]
}
},
onReachBottom() {
computed:{
...mapState({
geList: state => state.moduleA.geList,
}),
},
onShareAppMessage() {
return {
title:'喜兜兜',
path:uni.getStorageSync('page-path-options'),
imageUrl:'/static/public/xdd-logo.png'
}
},
onReachBottom(e) {
this.$refs.listhome.moreEv();
},
onHide() {
clearTimeout(this.playTimer);
this.isplay = false;
},
onShow() {
slidePosition().then(res=>{
if(res.code==0) {
console.log(res.data,74);
}
})
this.playTimer = setTimeout(()=>{
this.isplay = true;
},2000)
},
onLoad() {
this.getBanner();
// +
const query = wx.createSelectorQuery().in(this)
query.select('.head-box').boundingClientRect((rect) => {
@ -85,6 +102,25 @@
}).exec()
},
methods: {
//
getBanner(){
this.$requst.get('/api/common/slides',{position:'home-banner'}).then(res=>{
if(res.data.length!=0){
res.data.forEach(item=>{
let isVideo = false
if(item.type!='img') isVideo = true
let banObj = {
imgSrc:item.src,
url:item.url,
isVideo:isVideo,
poster:item.src,
}
this.bannerList.push(banObj)
})
}
})
},
//
chooseGe(obj) {
let exist = obj.url.slice(0,18);
if(exist=='/pages/tabbar/cate') {
@ -97,11 +133,12 @@
})
}
},
//
goSearch(){
uni.navigateTo({
url:`/pagesB/search/search?keyword=${this.keyword}`
})
}
},
}
}
</script>

View File

@ -2,8 +2,47 @@
<view>
<status-container titlet="订单管理" :ifCustomer='false'>
<view slot="content" style="margin: -20rpx -20rpx 0 -20rpx;">
<view class="bacf">
<swiperTabSlide @scrollBottom="scrollBottomEv" :list="dataList" :ifloading="ifloading" :tagList="tagList" :tagIndex="tagIndex"></swiperTabSlide>
<view class="bacf posir">
<view class="posi-sticky pad-x20 pad-zy20" :style="{top: newTop +'px'}">
<!-- <scrollTextSlide @changeEv="tabTap" :list="tagList" :activeIndex="activeIndex"></scrollTextSlide> -->
<swiper-tab-jl :list="tagList" v-model="activeIndex" @changeEv="tabTap" itemColor="#FFFFFF"></swiper-tab-jl>
</view>
<swiper :style="{height: swiperHeight + 'px'}" class="fon30" style="background-color: #f4f4f4;" :current="activeIndex" @change="swiperChange">
<swiper-item v-for="(item,index) in dataList" :key="index" class="pad-sx30">
<scroll-view scroll-y @scrolltolower="scrollBottomEv" style="height: 100%;">
<!-- 列表数据 -->
<view class="radius20 bacf pad-zy30 mar-x25 mar-zy40" @tap="goDetail(item1.id)" v-for="(item1,index1) in dataList[index]" :key="index1">
<view class="disjbac bbot pad30" style="margin: 0 -30rpx;">
<view class="">订单号{{item1.coding}}</view>
<view class="" :style="{color: ['#f83030','#f83030','#f83030','#a0a0a0','#a0a0a0'][0]}">{{item1.status_text}}</view>
</view>
<view class="disjb borbot pad-sx30" v-for="(item2,index2) in item1.skus" :key="index2">
<image class="mar-y30 flexs radius40" :src="item2.spu_cover" mode="" style="width: 210rpx;height: 210rpx;"></image>
<view class="width100 disjb fc" style="height: 210rpx;">
<view class="clips2 fon24">{{item2.spu_name}}</view>
<view class="">
<view class="fon24 mar-x30" style="color: #8c8c9b;">单位{{item2.sku_unit}}</view>
<view class="disjbac ">
<view class="textc bold">{{item2.price}}</view>
<view class="fon24" style="color: #8c8c9b;">x{{item2.num}}</view>
</view>
</view>
</view>
</view>
<view class="disjbac tbot pad30" style="margin: 0 -30rpx;">
<view class="bold" style="color: #f83030;">合计{{item1.original_price}}</view>
<view class="btn" @tap.stop="cancleEv(item1.coding)" v-if="item1.status == 'order_placed'"></view>
<view class="btn csbtn" @tap.stop="buyEv(index1)" v-if="item1.status == 'completed' || item1.status == 'cancel'"></view>
<!-- <view class="btn csbtn" @tap.stop="affirmEv(item1.id)" v-if="item1.status == 'shipped' || item1.status == 'arrived'"></view> -->
</view>
</view>
<view class="pad-x40" v-if="total==totalAll"><pitera textStr="—— 到底啦 ——"></pitera></view>
</scroll-view>
</swiper-item>
</swiper>
<view class="loading-box" v-show="ifLoading" style="position: absolute;bottom: 20rpx; left: 50%;transform: translateX(-50%);">
<view class="loader-16"></view>
</view>
</view>
</view>
</status-container>
@ -11,89 +50,175 @@
</template>
<script>
import swiperTabSlide from '@/components/swiper-tab/swiper-tab-slide.vue';
//
import footTab from '@/components/foot-tabs/foot-tab.vue';
import swiperTabJl from '@/components/swiper-tab/swiper-tab-jl.vue';
import pitera from '@/components/nothing/pitera';
export default {
components:{
'foot-tab' :footTab,
swiperTabSlide
swiperTabJl,
pitera
},
data() {
return {
tagList:[
{title:'全部'},
{title:'已下单'},
{title:'制作中'},
{title:'已发货'},
{title:'已完成'},
{title:'已取消'},
{title:'全部',tag:'all'},
{title:'已下单',tag:'order_placed'},
{title:'制作中',tag:'makeing'},
{title:'已发货',tag:'shipped'},
{title:'已送达',tag:'arrived'},
{title:'已取消',tag:'cancel'},
],
tagIndex:0,
dataList:[
[
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
],
[
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
],
[
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
],
[
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
],
[
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
],
[
{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99},
],
],
ifloading:false,
flag:true
activeIndex:0,
dataList:[[],[],[],[],[],[]],
flag:true,
swiperHeight:uni.getSystemInfoSync().windowHeight,
newTop:uni.getSystemInfoSync().statusBarHeight + 50,
ifLoading:false,
total:0,
totalAll:0,
page: 1,
size: 10,
tag: 'all'
}
},
onLoad(op) {
const query = wx.createSelectorQuery().in(this)
query.select('.posi-sticky').boundingClientRect((rect) => {
this.swiperHeight = this.swiperHeight - this.newTop - rect.height;
}).exec()
if(op.index) {
this.tagIndex = op.index;
this.activeIndex = op.index;
}
this.getOrderList();
},
methods: {
tabTap(e) {
this.activeIndex = e;
this.page = 1;
this.dataList = [[],[],[],[],[],[]];
this.getOrderList();
},
swiperChange(e) {
this.activeIndex = e.detail.current;
},
scrollBottomEv(e) {
if(this.flag){
this.flag = false;
this.ifloading = true;
console.log('到底了...')
this.ifLoading = true;
let pageSize = Math.floor(this.totalAll/this.size)
if(this.page <= pageSize){
this.page++;
this.getOrderList();
}else{
this.ifLoading = false;
return false;
}
setTimeout(()=>{
for (let i = 0; i < 2; i++) {
this.ifLoading = false;
},2000)
},
//
getOrderList(){
let params = {
page: this.page,
size: this.size,
tag: this.tagList[this.activeIndex].tag
}
this.$requst.get('/api/user/order',params).then(res=>{
if(res.data.length!=0){
this.totalAll = res.data.total;
res.data.list.forEach(item=>{
let dataObj = {
id: item.id, //id
coding: item.coding, //
original_price: item.original_price, //
status: item.status, //
status_text: item.status_text, //
skus: item.skus //
}
this.dataList[this.activeIndex].push(dataObj)
})
console.log(this.dataList[this.activeIndex],'订单列表')
if(this.page == Math.floor(this.totalAll/this.size)+1){
this.total = this.totalAll;
}
}
})
},
//
goDetail(id){
uni.navigateTo({
url:'/pagesB/order-detail/order-detail?id='+id
})
},
//
cancleEv(coding){
let params = {
order_coding: coding //
}
this.$requst.post('/api/order/cancel',params).then(res=>{
if(res.code==0) {
this.$toolAll.tools.showToast('取消订单成功(*^▽^*)');
this.dataList = [[],[],[],[],[],[]];
this.page = 1;
this.getOrderList();
} else {
this.$toolAll.tools.showToast(res.msg)
}
})
},
//
affirmEv(id){
let params = {
order_id: id //
}
this.$requst.post('/api/order/accepted',params).then(res=>{
if(res.code==0) {
this.$toolAll.tools.showToast('确认收货成功(*^▽^*)');
this.dataList = [[],[],[],[],[],[]];
this.page = 1;
this.getOrderList();
} else {
this.$toolAll.tools.showToast(res.msg)
}
})
},
//
buyEv(index){
let buyList = [];
let newArr = this.dataList[this.activeIndex][index];
newArr.skus.forEach(item=>{
let obj = {
title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99
}
this.dataList[e].push(obj);
}
this.ifloading = false;
this.flag = true;
},1000)
//
this.$forceUpdate();
sku_coding: item.coding,
num: item.num
}
buyList.push(obj);
})
uni.setStorageSync('buyList',buyList);
uni.navigateTo({
url:'/pagesB/settlement/settlement'
})
}
}
}
</script>
<style>
.btn{
width: 150rpx;
height: 64rpx;
line-height: 64rpx;
color: #8c8c9b;
border: 2rpx solid #d3d3d3;
border-radius: 20rpx;
text-align: center;
box-sizing: border-box;
}
.csbtn{
border: none;
background: linear-gradient(to right,#ff3772 0%,#fd5549 100%);
color: #FFFFFF;
box-shadow: 0rpx 6rpx 10rpx rgba(255, 55, 114, .3);
}
</style>

View File

@ -1,75 +0,0 @@
<template>
<view>
<status-container titlet="购物车">
<view slot="content">
<cart-slide :list="list" :button="buttonList" :border="true" @click="clickMethod" @change="changeMethod"></cart-slide>
</view>
</status-container>
</view>
</template>
<script>
import cartSlide from '@/components/shopping-carts/cart-slide';
export default {
components:{
cartSlide
},
data() {
return {
list : [
{
id: 1,
image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
title: '张三',
rightDetail: '2019-03-18',
detail: 'XXXXXXXXXXXXXXXXXXX公司',
slide_x: 0
},
{
id: 2,
surname: '李',
title: '李二',
rightDetail: '2019-03-17',
detail: 'XXXXXXXXXXXXXXXXXXX公司',
slide_x: 0
},
{
id: 3,
title: '王五',
rightDetail: '2019-03-18',
slide_x: 0
},
{
id: 4,
surname: '李',
detail: 'XXXXXXXXXXXXXXXXXXX公司',
slide_x: 0
}
],
buttonList: [
{
title: '分享',
background: '#c4c7cd'
},
{
title: '删除',
background: '#ff3b32'
}
]
}
},
methods: {
changeMethod(data, button, index){
console.log('滑动按钮回调', data)
console.log('滑动按钮回调', button)
},
clickMethod(data){
console.log('点击行回调', data)
}
}
}
</script>
<style>
</style>

View File

@ -3,8 +3,8 @@
<status-container titlet="关于我们" :ifCustomer='false'>
<view slot="content">
<view class="pad20">
<view class="radius30 bacf pad-sx40 pad-zy40 mar-x30" v-if="username">
<view class="fon36 colb">{{name}}</view>
<view class="radius30 bacf pad-sx40 pad-zy40 mar-x30" v-if="company_name">
<view class="fon36 colb">{{company_name}}</view>
<view class="fon30 colb mar-s20 mar-x10">{{phone}}{{username}}</view>
<view class="fon24" style="color: #8c8c9b;">{{address}}</view>
</view>
@ -27,26 +27,33 @@
richText:'',
lat:'',
lng:'',
name:'',
company_name:'',
address:''
}
},
onLoad() {
this.checkAboutUs();
},
methods: {
//
checkAboutUs(){
this.$requst.post('/api/index/about').then(res=>{
if(res.code==0){
this.lat = res.data.lat;
this.lng = res.data.lon;
this.richText = this.$toolAll.tools.escape2Html(res.data.content);
this.address = res.data.address;
let obj = res.data;
this.lat = obj.lat;
this.lng = obj.lon;
this.phone = obj.phone
this.username = obj.contacts;
this.richText = this.$toolAll.tools.escape2Html(obj.content);
this.address = obj.address;
this.company_name = obj.company_name;
} else {
this.$toolAll.tools.showToast(res.msg);
}
})
},
goThere(){
this.$toolAll.tools.goThere(this.lat,this.lng,this.name,this.address);
this.$toolAll.tools.goThere(this.lat,this.lng,this.company_name,this.address);
}
}
}

View File

@ -2,7 +2,7 @@
<view>
<status-container titlet="购买须知" :ifCustomer='false'>
<view slot="content">
<rich-text :nodes="content"></rich-text>
<rich-text :nodes="richText" class="fon24 colpeili line-h46"></rich-text>
</view>
</status-container>
</view>
@ -12,11 +12,17 @@
export default {
data(){
return {
richText:''
}
},
onLoad() {
this.$requst.post('/api/index/purchaseinstructions').then(res=>{
if(res.code==0){
this.richText = this.$toolAll.tools.escape2Html(res.data.content);
} else {
this.$toolAll.tools.showToast(res.msg);
}
})
}
}
</script>

View File

@ -16,7 +16,7 @@
}
},
onLoad() {
this.checkDisclaimerEv();
},
methods: {
//

View File

@ -1,5 +1,5 @@
<template>
<view class="pad-x50">
<view class="pad-x50" style="background-color: #fff;">
<status-container titlet="完成">
<view slot="content">
<view class="pad-zy40 fon30">
@ -8,10 +8,11 @@
</view>
<view class="tcenter" style="color: #0c0c0c;">已完成提交</view>
<view class="col9 tcenter mar-sx50 line-h50">
请扫描二维码添加微信告知您的订单<br />
<rich-text :nodes="richText"></rich-text>
<!-- 请扫描二维码添加微信告知您的订单<br />
号并支付定金 发货前请支付尾款<br />
支付定金后我们才会开始制作哦如您有特<br />
别的要求可以在微信上提出哦<br /> 祝您幸福美满
别的要求可以在微信上提出哦<br /> 祝您幸福美满 -->
</view>
<view @tap="saveImg" class="navigate-to-where radius30 colf fon36 tcenter">保存二维码</view>
<view @tap="goShop" class="navigate-to-where radius30 colf fon36 tcenter mar-s50" style="background: #e00c34;">继续购物</view>
@ -25,11 +26,17 @@
export default {
data() {
return {
imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg'
imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
richText:''
}
},
onLoad() {
onLoad(op) {
this.$requst.get('/api/order/orderQrCode',{id:op.id}).then(res=>{
if(res.code==0) {
this.imgsrc = res.data.path;
this.richText = this.$toolAll.tools.escape2Html(res.data.content);
}
})
},
methods: {
//

View File

@ -1,15 +1,15 @@
<template>
<view>
<status-nav :titleVal="'登录'" :tabcolor="'rgba(244, 244, 244,1)'" :whereCome="1*1" :statusTitle="true" :backgroudColor="'rgba(244, 244, 244,1)'"></status-nav>
<!-- <view class='login-header'>
<image class="infoImg" :style="{boxShadow: '0px 0px 20px '+ publicColor}" mode="aspectFit" :src="userInfo.avatarUrl || imgSrc"></image>
<view class="logo-name">恒美植发</view>
<view class='login-header'>
<image class="infoImg" :style="{boxShadow: '0px 0px 20px rgba(0,0,0,.8)'}" mode="aspectFill" :src="userInfo.avatarUrl || imgSrc"></image>
<view class="logo-name">{{appletName}}</view>
</view>
<view class="login-box">
<button class='login-btn' :style="{background:publicColor}" type='primary' @click="bindGetUserInfo"></button>
<view class="xie-box">登录代表您已同意<text @tap="goXie" class="xieCon">用户服务协议</text></view>
<button class='login-btn' :style="{background:publicColor || 'linear-gradient(to right, #ff3772 0%,#fd5548 100%)'}" type='primary' @click="bindGetUserInfo"></button>
<view class="xie-box">登录代表您已同意<text @tap="goXie" class="xieCon" style="color: #ff3772;">用户服务协议</text></view>
</view>
<view v-if="isShowP" class="disjcac posAll">
<!-- <view v-if="isShowP" class="disjcac posAll">
<view class="bacf radius20 width100 tank-box">
<view class="tc tank-box-itemone">请授权绑定手机号</view>
<view class="fon28 colf pad-x30 pad-zy30 tc disjb">
@ -21,13 +21,13 @@
</view>
</view>
</view> -->
<view class='login-header'>
<image class="infoImg" :style="{boxShadow: '0px 0px 20px '+ publicColor}" mode="aspectFit" :src="userInfo.avatarUrl || imgSrc"></image>
<!-- <view class='login-header'>
<image class="infoImg" :style="{boxShadow: '0px 0px 20px rgba(0,0,0,.8)'}" mode="aspectFill" :src="userInfo.avatarUrl || imgSrc"></image>
<view class="logo-name">{{appletName}}</view>
</view>
<view class="login-box">
<view @tap="setMiniColor">
<button class='login-btn' open-type="getPhoneNumber" @getphonenumber="getphonenumber" :style="{background:publicColor}" type='primary'>手机号授权登录</button>
<view>
<button class='login-btn' open-type="getPhoneNumber" @getphonenumber="getphonenumber" :style="{background:publicColor || 'linear-gradient(to right, #ff3772 0%,#fd5548 100%)'}" type='primary'>手机号授权登录</button>
</view>
<view class="xie-box">登录代表您已同意<text @tap="goXie" class="xieCon">用户服务协议</text></view>
</view>
@ -42,7 +42,7 @@
</view>
</view>
</view>
</view>
</view> -->
</view>
</template>
<script>
@ -51,37 +51,16 @@
return {
userInfo: {},//
canIGetUserProfile: false,
imgSrc: '/static/public/logo.png',//logo
appletName:'恒美植发',//
imgSrc: '/static/public/login-cover.png',//logo
appletName:'商城小程序',//
isShowP:false,
};
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onLoad(options) {
//
this.$toolAll.tools.currentContext();
this.setLogo();
this.$toolAll.tools.isVedio();
// let ya = this;
// // ,
// if (options && options.q) {
// let arr = decodeURIComponent(options.q).split('?')[1].split('&')
// let obj = {}
// arr.forEach(item => {
// let brr = item.split('=')
// obj[brr[0]] = brr[1]
// })
// // console.log(obj) //
// ya.invite_code = obj.invite_code
// }
onLoad() {
if (uni.getUserProfile) {
this.canIGetUserProfile = true;
}
// this.setLogo();
},
methods: {
// logo
@ -96,18 +75,11 @@
this.$toolAll.tools.showToast('登录成功','success')
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
},
//
setMiniColor(){
this.$requst.get(`index/mini-program-setting`).then(res=>{
this.publicColor = res.data.mainColor;
uni.setStorageSync('publicColor', res.data.mainColor) //#3875F6 #2E8B57
})
},
getphonenumber(e){//
let ya = this;
wx.login({
success:(res)=>{
this.$requst.post('user/login',{code:res.code}).then(result => {
this.$requst.post('/api/user/login',{code:res.code}).then(result => {
if(e.detail.errMsg=="getPhoneNumber:ok"){
this.$requst.post('user/bind-phone',{openid: result.data.openid,session_key:result.data.session_key, iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{
console.log('手机号信息:',res);
@ -128,7 +100,7 @@
},
goXie(){
uni.navigateTo({
url:'/pages/login/xiey'
url:'/pagesB/login/xiey'
})
},
//
@ -176,30 +148,24 @@
language:ya.userInfo.language,//
is_active:1
}
this.$requst.post('user/login',params).then(res => {
if(res.data.token!=''){
uni.setStorageSync('params',params)
this.$requst.post('/api/user/login',params).then(res => {
if(res.code == 0){
uni.setStorageSync('userId',res.data.account_id)
uni.setStorageSync('token',res.data.token)//token
uni.setStorageSync('openid',res.data.openid)//openid
uni.setStorageSync('expire',res.data.expire)//
uni.setStorageSync('phone_active',res.data.phone_active)//
uni.setStorageSync('is_active',res.data.is_active)//
uni.setStorageSync('invite_code',res.data.invite_code)
uni.hideToast()
// if(res.data.phone_active!=1){
// this.isShowP = true;
// } else {
if(uni.getStorageSync('urlparams')) {
uni.setStorageSync('phone_active',res.data.phone_active)//
uni.setStorageSync('is_active',res.data.is_active)//
uni.setStorageSync('invite_code',res.data.invite_code)//
if(uni.getStorageSync('page-path-options')) {
uni.reLaunch({ //
url:uni.getStorageSync('urlparams')
url:uni.getStorageSync('page-path-options')
})
} else {
uni.reLaunch({
url:'/pages/tabbar/pagehome/pagehome'
})
}
// }
}
},error => {})
}
@ -211,9 +177,9 @@
@tcolorp:#3875F6;
.login-header {display: flex;justify-content: center;align-items: center;flex-direction: column;margin-top: 40%;}
.infoImg {width: 192rpx;height: 192rpx;border-radius: 100%;}
.logo-name {font-size: 30rpx;font-weight: bold;margin-top: 20rpx;color: @tcolor;}
.logo-name {font-size: 30rpx;font-weight: bold;margin-top: 30rpx;color: @tcolor;}
.login-box {margin-top: 60rpx;text-align: center;}
.login-btn {width: 80%;margin-top: 50%;}
.login-btn {width: 80%;margin-top: 50%;box-shadow: 0rpx 6rpx 10rpx rgba(255, 55, 114, .6);}
.xie-box{display: flex;justify-content: center;align-items: center;color: @tcolor;margin-top: 30rpx;}
.xieCon{color: @tcolorp;}
</style>

View File

@ -1,49 +1,35 @@
<template>
<view>
<status-nav :titleVal="'用户协议及隐私声明'" :statusTitle="true"></status-nav>
<view :style="{paddingTop: statusHeight+'px'}" class="mar20 line-h50 fon30">
<!-- <rich-text :nodes="content"></rich-text> -->
<view class="text2">本协议为您与本小程序管理者之间所订立的契约具有合同的法律效力请您仔细阅读</view>
<view>本协议内容生效变更本协议内容包括协议正文及所有本小程序已经发布的或将来可能发布的各类规则所有规则为本协议不可分割的组成部分与协议正文具有同等法律效力如您对协议有任何疑问应向本小程序咨询您在同意所有协议条款并完成注册程序才能成为本站的正式用户您登录即代表同意用户服务协议本协议即生效对双方产生约束力只要您使用本小程序平台服务则本协议即对您产生约束届时您不应以未阅读本协议的内容或者未获得本小程序对您问询的解答等理由主张本协议无效或要求撤销本协议您确认本协议条款是处理双方权利义务的契约始终有效法律另有强制性规定或双方另有特别约定的依其规定 您承诺接受并遵守本协议的约定如果您不同意本协议的约定您应立即停止注册程序或停止使用本小程序平台服务本小程序有权根据需要不定期地制订修改本协议及/或各类规则并在本小程序平台公示不再另行单独通知用户变更后的协议和规则一经在网站公布立即生效如您不同意相关变更应当立即停止使用本小程序平台服务您继续使用本小程序平台服务的即表明您接受修订后的协议和规则</view>
<view>注册资格用户须具有法定的相应权利能力和行为能力的自然人法人或其他组织能够独立承担法律责任您完成注册程序或其他本小程序平台同意的方式实际使用本平台服务时即视为您确认自己具备主体资格能够独立承担法律责任若因您不具备主体资格而导致的一切后果由您及您的监护人自行承担</view>
<view class="text2">
<view class="text2">2.1用户应自行诚信向本站提供注册资料用户同意其提供的注册资料真实准确完整合法有效用户注册资料如有变动的应及时更新其注册资料如果用户提供的注册资料不合法不真实不准确不详尽的用户需承担因此引起的相应责任及后果并且本小程序保留终止用户使用本平台各项服务的权利</view>
<view class="text2">2.2用户在本站进行浏览等活动时涉及用户真实姓名/名称通信地址联系电话电子邮箱等隐私信息的本站将予以严格保密除非得到用户的授权或法律另有规定本站不会向外界披露用户隐私信息为完成创建账号用户需提供以下信息用户的微信昵称性别姓名手机号等信息用户提供的上述信息将在用户使用本服务期间持续授权我们使用在用户注销账号时我们将停止使用并删除上述信息上述信息将存储于中华人民共和国境内如需跨境传输我们将会单独征得用户的授权同意</view>
</view>
<view>账户</view>
<view>
<view class="text2">3.1您注册成功后即成为本小程序平台的用户将持有本小程序平台唯一编号的账户信息</view>
<view class="text2">3.2您设置的姓名为真实姓名不得侵犯或涉嫌侵犯他人合法权益否则本小程序有权终止向您提供服务注销您的账户</view>
<view class="text2">3.3您应谨慎合理的保存使用您的会员名和密码应对通过您的会员名和密码实施的行为负责除非有法律规定或司法裁定且征得本小程序的同意否则会员名和密码不得以任何方式转让赠与或继承与账户相关的财产权益除外</view>
<view class="text2">3.4用户不得将在本站注册获得的账户借给他人使用否则用户应承担由此产生的全部责任并与实际使用人承担连带责任</view>
<view class="text2">3.5如果发现任何非法使用等可能危及您的账户安全的情形时您应当立即以有效方式通知本小程序要求暂停相关服务并向公安机关报案您理解本小程序对您的请求采取行动需要合理时间本小程序对在采取行动前已经产生的后果包括但不限于您的任何损失不承担任何责任</view>
</view>
<view>用户信息的合理使用</view>
<view>
<view class="text2">4.1您同意本小程序平台拥有通过短信电话微信消息提醒等形式向在本站注册用户发送信息等告知信息的权利</view>
<view class="text2">4.2您了解并同意本小程序有权应国家司法行政等主管部门的要求向其提供您在本小程序平台填写的注册信息和交易记录等必要信息如您涉嫌侵犯他人知识产权则本小程序亦有权在初步判断涉嫌侵权行为存在的情况下向权利人提供您必要的身份信息</view>
<view class="text2">4.3用户同意本小程序有权使用用户的注册信息用户名密码等信息登陆进入用户的注册账户进行证据保全包括但不限于公证见证等</view>
</view>
<view>免责条款</view>
<view class="text2">5.1 本平台仅提供信息对接发生一切纠纷问题皆与本平台无关请通过仲裁部门维护各自权益</view>
<status-container titlet="用户服务协议" :ifCustomer='false'>
<view slot="content">
<rich-text :nodes="richText" class="fon30 line-h50" style="color: #8c8c9b;"></rich-text>
</view>
</status-container>
</view>
</template>
<script>
export default {
data() {
return {
richText:'',
}
},
computed:{
statusHeight() {
return this.$store.state.statusHeight
methods: {
//
checkAboutUs(){
this.$requst.post('/api/index/about').then(res=>{
if(res.code==0){
this.lat = res.data.lat;
this.lng = res.data.lon;
this.richText = this.$toolAll.tools.escape2Html(res.data.content);
this.address = res.data.address;
} else {
this.$toolAll.tools.showToast(res.msg);
}
})
},
onLoad() {
// this.$toolAll.tools.escape2Html(this.content)
}
}
</script>

View File

@ -1,51 +1,48 @@
<template>
<view class="pad-x140">
<view>
<status-container titlet="订单详情">
<view slot="content">
<view class="pad-zy20">
<view class="bacf radius30 pad-sx30 pad-zy40 fon30 mar-x25">
<view class="disjbac">
<view class="">订单编号</view>
<view class="bold">2928392832</view>
<view class="bold">{{orderDetail.coding}}</view>
</view>
<view class="disjbac mar-sx30">
<view class="">下单时间</view>
<view class="bold">2021-11-30 2330</view>
<view class="bold">{{orderDetail.status_text}}</view>
</view>
<view class="disjbac">
<view class="">订单状态</view>
<view class="bold">已发货</view>
<view class="bold">{{orderDetail.coding}}</view>
</view>
</view>
<view class="bacf radius30 pad-sx30 pad-zy40 fon30 mar-x25">
<view class="">订单信息</view>
<view class="disjb bbot pad-sx30" v-for="(item,index) in 2" :key="index">
<image class="mar-y30 flexs radius30" src="https://s6.jpg.cm/2022/05/06/Lx4T45.jpg" mode="" style="width: 210rpx;height: 210rpx;"></image>
<view class="disjb bbot pad-sx30" v-for="(item,index) in orderDetail.skus" :key="index">
<image class="mar-y30 flexs radius30" :src="item.sku_cover" mode="widthFix" style="width: 210rpx;height: 210rpx;"></image>
<view class="width100 disjb fc line-h40" style="height: 210rpx;">
<view class="clips2 fon24">于亿年宝藏中臻选1的宝石级钻石每年开采数LOVE100 星座光的原石挑选 </view>
<view class="clips2 fon24">{{item.spu_name}} </view>
<view class="">
<view class="fon24 mar-x30" style="color: #8c8c9b;">单位</view>
<view class="fon24 mar-x30" style="color: #8c8c9b;">单位{{item.sku_unit}}</view>
<view class="disjbac ">
<view class="textc bold">{{$toolAll.tools.changeNum(2000)}}</view>
<view class="fon24" style="color: #8c8c9b;">x1</view>
<view class="textc bold">{{item.price}}</view>
<view class="fon24" style="color: #8c8c9b;">x{{item.num}}</view>
</view>
</view>
</view>
</view>
<view class="disje pad-s30">总计<text class="fon36 bold textc" style="margin-top: -6rpx;">4000</text></view>
<view class="disje pad-s30">总计<text class="fon36 bold textc" style="margin-top: -6rpx;">{{orderDetail.original_price}}</text></view>
</view>
<view class="bacf radius30 pad-sx30 pad-zy40 fon30 mar-x25">
<view class="mar-x30">联系信息</view>
<view class="bold">徐卫 546546515315</view>
<view class="bold">{{orderDetail.contacts}} {{orderDetail.phone}}</view>
<view class="fon24">
<view class="mar-sx10" style="color: #8c8c9b;">四川省成都市双店路奥园广场3期1419号</view>
<view class="" style="color: #8c8c9b;">婚期2022-12-23</view>
<view class="mar-s10" style="color: #8c8c9b;">希望到货时间2022-12-21</view>
<view class="mar-sx10" style="color: #8c8c9b;">{{orderDetail.address}}</view>
<view class="" style="color: #8c8c9b;">婚期{{orderDetail.wedding_date}}</view>
<view class="mar-s10" style="color: #8c8c9b;">希望到货时间{{orderDetail.expected_delivery_date}}</view>
</view>
</view>
<view class="posixzy bacf pad-sx20 pad-zy50" style="box-shadow: 0rpx -2rpx 10rpx rgba(0, 0, 0, 0.06);">
<view class="navigate-to-where radius30 colf fon36 tcenter">确认收货</view>
</view>
</view>
</view>
</status-container>
@ -56,7 +53,7 @@
export default {
data() {
return {
orderDetail: []
}
},
onShareAppMessage(res) {
@ -67,11 +64,30 @@
  };
  return shareObj;
},
onLoad() {
onLoad(op) {
this.getDetail(op.id);
},
methods: {
getDetail(id){
this.$requst.post('/api/user/order-detail',{id}).then(res=>{
if(res.code==0) {
let dataObj = {
coding: res.data.coding, //
created_at: res.data.created_at, //
status_text: res.data.status_text, //
expected_delivery_date: res.data.expected_delivery_date, //
wedding_date: res.data.wedding_date, //
original_price: res.data.original_price, //
contacts: res.data.contacts, //
address: res.data.address, //
phone: res.data.phone, //
skus: res.data.skus //
}
this.orderDetail = dataObj;
console.log(this.orderDetail,'订单详情2')
}
})
}
}
}
</script>

View File

@ -7,12 +7,28 @@
<image src="/static/public/icon-searcht.png" mode="widthFix" style="width: 40rpx;height: 40rpx;"></image>
<input @confirm="goSearch" @focus="ifResult=false" v-model="keyword" class="width100 fon30 mar-z20" type="text" placeholder="搜索" style="height: 90rpx;color: #8c8c9b;" placeholder-style="color: #8c8c9b">
</view>
<view class="fon30 bold" v-if="keyword && ifResult">结果:{{keyword}}<text v-if="num" class="textc">{{num}}</text></view>
<view class="fon30 bold" v-if="keyword && ifResult">结果:{{keyword}}<text class="textc">{{total}}</text></view>
</view>
<list-one></list-one>
<view class="mar-s60">
<view class="disjbac fw">
<view class="width48_5 fon30 mar-x30" @tap="goDetail(item.id)" v-for="(item,index) in dataList" :key="index">
<view class="" style="height: 342rpx;">
<image class="radius30 width100" :src="item.imgsrc" mode="aspectFill" style="height: 342rpx;"></image>
</view>
<view class="pad-zy20">
<view class="line-h50 mar-sx25 clips2" style="height: 90rpx;">{{item.title}}</view>
<view class="textc disjbac">
<view class="">{{item.price}}</view>
<i @tap.stop="addCartEv(item.skuId)" class="icon icon-shop-cart" style="font-size: 40rpx;"></i>
</view>
</view>
</view>
</view>
<view class="mar-s60" v-if="total==dataList.length">
<pitera textStr="—— 到底啦 ——"></pitera>
</view>
<view class="loading-box mar-s60" v-show="ifLoading">
<view class="loader-16"></view>
</view>
</view>
</status-container>
</view>
@ -21,6 +37,7 @@
<script>
import listOne from '@/components/list/list-one';
import pitera from '@/components/nothing/pitera';
import {getCartNum} from '@/jsFile/public-api.js';
export default {
components:{
listOne,
@ -29,17 +46,76 @@
data() {
return {
padt:uni.getSystemInfoSync().statusBarHeight + 50,
windowHeigh:uni.getSystemInfoSync().windowHeight,
keyword:'',
num:11,
ifResult:true
ifResult:true,
dataList:[],
ifLoading:false,
total:0,
page:1,
size:10
}
},
onReachBottom(e) {
this.$refs.list.moreEv();
},
onLoad(op) {
if(op.keyword) this.keyword = op.keyword;
this.getList();
},
methods: {
goSearch(){
this.ifResult = true;
//
this.getList()
},
//
getList(){
this.ifLoading = true;
let params = {
keyword:this.keyword,
page:this.page,
size:this.size
}
this.$requst.post('/api/spu/list',params).then(res=>{
if(res.code==0) {
this.total = res.data.total;
if(this.page==1) this.dataList = [];
if(res.data.list.length) {
res.data.list.forEach(item=>{
let obj = {
id:item.id,
skuId:item.skuId,
imgsrc:item.cover,
title:item.name,
price:item.original_price
}
this.dataList.push(obj);
})
}
}
this.ifLoading = false;
})
},
//
addCartEv(id) {
if(this.$toolAll.tools.judgeAuth()) {
this.$requst.post('/api/order/shopping-cart-add',{sku_id:id,num:1}).then(res=>{
if(res.code==0) {
this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)')
getCartNum();
} else {
this.$toolAll.tools.showToast(res.msg)
}
})
}
},
//
goDetail(id) {
uni.navigateTo({
url:`/pagesB/shop-detail/shop-detail?id=${id}`
})
}
}
}

View File

@ -17,15 +17,15 @@
</picker>
</view>
<view class="posir fon30 mar-x50">
<text class="col9 posia pad-zy10 input-title">收货地址</text>
<text class="col9 posia pad-zy10 input-title">收货地址(必填)</text>
<input type="text" v-model="address" @tap="chooseEv(2)" class="input-box width100 radius20 pad-zy30" :class="current==2 ? 'focusc' : ''" placeholder="请填写收货地址" placeholder-style="color:#000000">
</view>
<view class="posir fon30 mar-x50">
<text class="col9 posia pad-zy10 input-title">收货联系人</text>
<text class="col9 posia pad-zy10 input-title">收货联系人(必填)</text>
<input type="text" v-model="name" @tap="chooseEv(3)" class="input-box width100 radius20 pad-zy30" :class="current==3 ? 'focusc' : ''" placeholder="请填写联系人" placeholder-style="color:#000000">
</view>
<view class="posir fon30 mar-x50">
<text class="col9 posia pad-zy10 input-title">收货电话</text>
<text class="col9 posia pad-zy10 input-title">收货电话(必填)</text>
<input type="number" v-model="phone" maxlength="11" @tap="chooseEv(4)" class="input-box width100 radius20 pad-zy30" :class="current==4 ? 'focusc' : ''" placeholder="请填写联系电话" placeholder-style="color:#000000">
</view>
<view @tap="submit" class="navigate-to-where radius30 colf fon36 tcenter">提交完成</view>
@ -49,21 +49,55 @@
}
},
onLoad() {
console.log(uni.getStorageSync('buyList'),'缓存数组')
},
onShow() {
this.getUserInfo()
},
methods: {
//
getUserInfo(){
this.$requst.get('/api/user/info').then(res=>{
console.log(res,'用户信息')
if(res.code==0) {
this.address = res.data.address; //
this.name = res.data.contacts; //
this.phone = res.data.mobile; //
}
})
},
//
submit(){
if(this.checkEmpty() && this.flag){
this.flag = false;
uni.navigateTo({
url:'/pagesB/finish/finish'
let params = {
sku_list: uni.getStorageSync('buyList'),
phone: this.phone,
contacts: this.name,
address: this.address,
expected_delivery_date: this.totime,
wedding_date: this.lasttime,
}
this.$requst.post('/api/order/create',params).then(res=>{
if(res.code==0) {
uni.reLaunch({
url:`/pagesB/finish/finish?id=${res.data.id}`
})
}else{
console.log(res.msg,'提示信息')
this.$toolAll.tools.showToast(res.msg);
this.flag = true;
}
})
}
},
checkEmpty(){
let result = false;
if(!this.address) {
if(!this.lasttime) {
this.$toolAll.tools.showToast('请选择婚期');
} else if(!this.totime) {
this.$toolAll.tools.showToast('请选择希望送到日期');
} else if(!this.address) {
this.$toolAll.tools.showToast('请填写收货地址');
} else if(!this.name) {
this.$toolAll.tools.showToast('请填写联系人');

View File

@ -1,12 +1,12 @@
<template>
<view class="pad-x140">
<view class="pad-x180">
<status-container titlet="详情">
<view slot="content" style="margin: -20rpx -20rpx 0 -20rpx;">
<swiper-pu newRadius="0rpx" :newHeight="swiperH+'px'" newBottom="40rpx" :isplay="isplay"></swiper-pu>
<swiper-pu newRadius="0rpx" :bannerList="bannerList" :newHeight="swiperH+'px'" newBottom="40rpx" :isplay="isplay"></swiper-pu>
<view class="pad-zy20 bacf pad-sx20">
<view class="fon42 colb mar-x10">如意饼</view>
<view class="fon24 col6 mar-x20">如意饼 事事如意</view>
<view class="textc bold fon30 ">46,854/<text class="fon24"></text></view>
<view class="fon42 colb mar-x10">{{shopObj.name}}</view>
<view class="fon24 col6 mar-x20">{{shopObj.subtitle}}</view>
<view class="textc bold fon30 ">{{shopObj.original_price}}/<text class="fon24">{{shopObj.unit}}</text></view>
</view>
<view class="fon36 colb tcenter pad-sx30 bold">商品介绍</view>
<view class="pad-zy20">
@ -15,14 +15,15 @@
</view>
</status-container>
<view class="disjbac posixzy bacf pad-sx20 pad-zy50">
<view class="btn buy-btn" @tap="buyEv"></view>
<view class="btn" @tap="addCartEv"></view>
<view class="btn buy-btn" @tap="buyEv(shopObj.skuId)"></view>
<view class="btn" @tap="addCartEv(shopObj.skuId)"></view>
</view>
</view>
</template>
<script>
import swiperPu from '@/components/swipers/swiper-pu';
import {getCartNum} from '@/jsFile/public-api.js';
export default {
components:{
swiperPu
@ -32,27 +33,82 @@
swiperH:uni.getSystemInfoSync().windowWidth,
richText:'',
isplay:false,
playTimer:null
playTimer:null,
shopObj:'',
bannerList:[
// {imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',url:'',isVideo:false,poster:''},
// {imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',url:'',isVideo:false,poster:''},
// {imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',url:'',isVideo:false,poster:''},
]
}
},
onHide() {
clearTimeout(this.playTimer);
},
onShareAppMessage() {
return {
title:this.shopObj.name,
path:uni.getStorageSync('page-path-options'),
imageUrl:this.bannerList[0].imgSrc
}
},
onShow() {
this.playTimer = setTimeout(()=>{
this.isplay = true;
},2000)
},
onLoad(op) {
this.getDetail(op.id);
},
methods: {
//
buyEv(){
uni.reLaunch({
url:'/pages/tabbar/cart/cart'
//
getDetail(id){
this.$requst.post('/api/spu/detail',{id}).then(res=>{
if(res.code==0) {
this.shopObj = res.data.detail;
this.richText = this.$toolAll.tools.escape2Html(this.shopObj.content);
if(this.shopObj.images.length){
this.shopObj.images.forEach(item=>{
let obj = {
imgSrc:item,
url:'',
isVideo:false,
poster:''
}
this.bannerList.push(obj);
})
}
}
})
},
//
buyEv(id){
this.$requst.post('/api/order/shopping-cart-add',{sku_id:id,num:1}).then(res=>{
if(res.code==0) {
uni.reLaunch({
url:`/pages/tabbar/cart/cart?skuId=${id}`
})
getCartNum();
} else {
this.$toolAll.tools.showToast(res.msg)
}
})
},
//
addCartEv(id) {
this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)')
if(this.$toolAll.tools.judgeAuth()) {
this.$requst.post('/api/order/shopping-cart-add',{sku_id:id,num:1}).then(res=>{
if(res.code==0) {
this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)');
getCartNum();
} else {
this.$toolAll.tools.showToast(res.msg)
}
})
}
},
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

BIN
static/public/xdd-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@ -21,10 +21,21 @@ export default {
obj:{
a:'吃鸡腿',
b:'吃自助餐'
}
},
titleList:[],
imgList:[],
onLineList:[],
cartNum:0,
geList:[]
},
// Vuex中store数据改变的唯一方法就是mutations 不适合异步方法
mutations: {
setNum(state,num){
state.cartNum = num;
},
setGe(state,payload){
state.geList = payload.geList;
},
footHeightEv(state,str){
state.footHeight = str;
},
@ -46,6 +57,9 @@ export default {
// 新增字段方法
newProp(state,payload) {
state.obj = { ...state.obj, c: payload.c };
},
updateState(state, payload) {
state.onLineList = payload.list;
}
},
// 可以执行任意的同步和异步操作