Commit 13fca3da by LJM

「爱智小程序」—业务验收问题合集fix

parent 3613d455
.confirmQuotePage{ .confirmQuotePage {
background: #f8f8f8; background: #f8f8f8;
padding-top:75rpx; padding-top: 75rpx;
padding-bottom: 175rpx; padding-bottom: 175rpx;
.cons{ .cons {
width:700rpx; width: 700rpx;
margin:0 auto; margin: 0 auto;
.top-box{ .top-box {
background: #fff; background: #fff;
padding:30rpx 22rpx; padding: 30rpx 22rpx;
border-radius: 20rpx; border-radius: 20rpx;
padding-top:15rpx; padding-top: 15rpx;
.tit{ .tit {
font-size: 26rpx; font-size: 26rpx;
color: #000000; color: #000000;
height:92rpx; height: 92rpx;
line-height: 92rpx; line-height: 92rpx;
border-bottom: 1rpx solid #E7E7E7; border-bottom: 1rpx solid #e7e7e7;
} &:last-child {
.address-box{ border-bottom: none;
display: block; }
padding-top: 10rpx; }
.addbx{ .address-box {
.iconfont{ display: block;
font-size: 16rpx; padding-top: 10rpx;
color:#898989; .addbx {
} .iconfont {
.ad{height:62rpx;} font-size: 16rpx;
.csq{ color: #898989;
font-size: 26rpx; }
color: #000000; .ad {
} height: 62rpx;
.ad1{ }
font-size: 30rpx; .csq {
color: #000000; font-size: 26rpx;
height:35rpx; color: #000000;
line-height: 35rpx; }
font-weight: bold; .ad1 {
margin-top:4rpx; font-size: 30rpx;
} color: #000000;
.cnnk{ height: 35rpx;
font-size: 24rpx; line-height: 35rpx;
color: #666666; font-weight: bold;
line-height: 40rpx; margin-top: 4rpx;
height:40rpx; }
margin-top:8rpx; .cnnk {
text{margin-right:20rpx;} font-size: 24rpx;
} color: #666666;
.mr{ line-height: 40rpx;
width: 70rpx; height: 40rpx;
height: 35rpx; margin-top: 8rpx;
background: #FFF5F5; text {
border-radius: 5rpx; margin-right: 20rpx;
border: 1rpx solid #D0121B; }
text-align: center; }
line-height: 35rpx; .mr {
font-size: 24rpx; width: 70rpx;
color: #D0121B; height: 35rpx;
margin-left:20rpx; background: #fff5f5;
} border-radius: 5rpx;
} border: 1rpx solid #d0121b;
} text-align: center;
} line-height: 35rpx;
.goods-box{ font-size: 24rpx;
margin-top:25rpx; color: #d0121b;
background: #fff; margin-left: 20rpx;
padding:30rpx 23rpx; }
padding-top:0rpx; }
border-radius: 20rpx; }
image{width:190rpx;height:190rpx;margin-right: 29rpx;border: 2rpx solid #F6F6F6;border-radius: 5rpx;} }
.goods-box {
.group{ margin-top: 25rpx;
padding-bottom: 38rpx; background: #fff;
padding-top:30rpx; padding: 30rpx 23rpx;
border-bottom: 1rpx solid #E7E7E7; padding-top: 0rpx;
.ganme{ border-radius: 20rpx;
font-size: 26rpx; image {
color: #000000; width: 190rpx;
line-height: 45rpx; height: 190rpx;
height:90rpx; margin-right: 29rpx;
width:440rpx; border: 2rpx solid #f6f6f6;
} border-radius: 5rpx;
.hqs{ }
font-size: 26rpx;
color: #666666; .group {
height:40rpx; padding-bottom: 38rpx;
line-height: 40rpx; padding-top: 30rpx;
margin-top:20rpx; border-bottom: 1rpx solid #e7e7e7;
} .ganme {
.price{ font-size: 26rpx;
font-size: 30rpx; color: #000000;
color: #000000; line-height: 45rpx;
line-height: 40rpx; height: 90rpx;
height:40rpx; width: 440rpx;
line-height: 40rpx; }
margin-top:10rpx; .hqs {
} font-size: 26rpx;
} color: #666666;
} height: 40rpx;
.coupo-box{ line-height: 40rpx;
border-radius: 20rpx; margin-top: 20rpx;
margin-top:25rpx; }
height:62rpx; .price {
font-size: 26rpx; font-size: 30rpx;
color: #000000; color: #000000;
line-height: 62rpx; line-height: 40rpx;
.r{ height: 40rpx;
font-size: 26rpx; line-height: 40rpx;
color: #D0121B; margin-top: 10rpx;
height:62rpx; }
.icon{ }
font-size: 16rpx; }
color:#D0121B; .coupo-box {
margin-left:25rpx; border-radius: 20rpx;
position: relative; margin-top: 25rpx;
top:-3rpx; height: 62rpx;
} font-size: 26rpx;
.not{ color: #000000;
color: #999999; line-height: 62rpx;
.icon{ .r {
color:#898989; font-size: 26rpx;
} color: #d0121b;
} height: 62rpx;
} .icon {
} font-size: 16rpx;
.pur-sn-box{ color: #d0121b;
background: #fff; margin-left: 25rpx;
margin-top:25rpx; position: relative;
padding:20rpx; top: -3rpx;
padding-bottom:32rpx; }
border-radius: 20rpx; .not {
.tit{ color: #999999;
font-size: 26rpx; .icon {
color: #000000; color: #898989;
line-height: 62rpx; }
height:62rpx; }
} }
.pur-sn-val{ }
height: 80rpx; .pur-sn-box {
background: #F8F8F8; background: #fff;
line-height: 80rpx; margin-top: 25rpx;
border-radius: 5rpx; padding: 20rpx;
border: 1rpx solid #E7E7E7; padding-bottom: 32rpx;
font-size: 26rpx; border-radius: 20rpx;
color: #000000; .tit {
padding:0 20rpx; font-size: 26rpx;
&:hover{ color: #000000;
border: 1rpx solid #D0121B; line-height: 62rpx;
} height: 62rpx;
&.placeholder-class{ }
color: #808080; .pur-sn-val {
font-size: 26rpx; height: 80rpx;
} background: #f8f8f8;
} line-height: 80rpx;
} border-radius: 5rpx;
.price-infos{ border: 1rpx solid #e7e7e7;
padding:30rpx 20rpx; font-size: 26rpx;
background: #fff; color: #000000;
margin-top:25rpx; padding: 0 20rpx;
border-radius: 20rpx; &:hover {
.item{ border: 1rpx solid #d0121b;
font-size: 26rpx; }
color: #000000; &.placeholder-class {
line-height: 62rpx; color: #808080;
height:62rpx; font-size: 26rpx;
} }
.top{border-bottom:1rpx solid #E7E7E7;padding-bottom:20rpx;} }
.bottom{ }
padding-top:25rpx; .price-infos {
.price-pay{ padding: 30rpx 20rpx;
color:#D0121B; background: #fff;
} margin-top: 25rpx;
} border-radius: 20rpx;
} .item {
.rules{ font-size: 26rpx;
height:86rpx; color: #000000;
.icon{ line-height: 62rpx;
font-size: 30rpx; height: 62rpx;
color:#e5e5e5; }
} .top {
.icon-checked{ border-bottom: 1rpx solid #e7e7e7;
color:#D0121B; padding-bottom: 20rpx;
} }
.tklink{ .bottom {
font-size: 24rpx; padding-top: 25rpx;
color: #000000; .price-pay {
margin-left: 16rpx; color: #d0121b;
} }
} }
}
} .rules {
height: 86rpx;
.foot{ .icon {
height:175rpx; font-size: 30rpx;
width:100%; color: #e5e5e5;
position: fixed; }
left:0rpx; .icon-checked {
right:0rpx; color: #d0121b;
bottom:0rpx; }
z-index: 2; .tklink {
background: #fff; font-size: 24rpx;
padding-left:40rpx; color: #000000;
padding-right:25rpx; margin-left: 16rpx;
border-top:1rpx solid #E7E7E7; }
.l{ }
font-size: 24rpx; }
color: #000000;
text{ .foot {
font-size: 32rpx; height: 175rpx;
color: #D91800; width: 100%;
} position: fixed;
} left: 0rpx;
.submit-btn{ right: 0rpx;
width: 288rpx; bottom: 0rpx;
height: 70rpx; z-index: 2;
background: linear-gradient( 90deg, #F66F15 0%, #FE3014 100%); background: #fff;
border-radius: 100rpx; padding-left: 40rpx;
font-size: 26rpx; padding-right: 25rpx;
color: #FFFFFF; border-top: 1rpx solid #e7e7e7;
text-align: center; .l {
line-height: 70rpx; font-size: 24rpx;
} color: #000000;
text {
} font-size: 32rpx;
color: #d91800;
}
}
.submit-btn {
width: 288rpx;
height: 70rpx;
background: linear-gradient(90deg, #f66f15 0%, #fe3014 100%);
border-radius: 100rpx;
font-size: 26rpx;
color: #ffffff;
text-align: center;
line-height: 70rpx;
}
}
} }
/**温馨提示输入邮箱**/ /**温馨提示输入邮箱**/
.pop-tips{ .pop-tips {
width: 100%; width: 100%;
background: #FFFFFF; background: #ffffff;
border-radius: 10rpx 10rpx 0rpx 0rpx; border-radius: 10rpx 10rpx 0rpx 0rpx;
padding:24rpx 30rpx; padding: 24rpx 30rpx;
position: relative; position: relative;
padding-bottom: 150rpx; padding-bottom: 150rpx;
.trt{ .trt {
text-align: right; text-align: right;
.icon{color:#898989;font-size: 25rpx;} .icon {
} color: #898989;
.ttit{ font-size: 25rpx;
width: 520rpx; }
height: 53rpx; }
font-size: 26rpx; .ttit {
color: #000000; width: 520rpx;
line-height: 53rpx; height: 53rpx;
text-align: center; font-size: 26rpx;
margin:0 auto; color: #000000;
} line-height: 53rpx;
.tipjk{ text-align: center;
font-size: 22rpx; margin: 0 auto;
color: #666666; }
text-align: center; .tipjk {
} font-size: 22rpx;
.cons{ color: #666666;
padding-bottom:80rpx; text-align: center;
padding-top:60rpx; }
.label{ .cons {
font-size: 24rpx; padding-bottom: 80rpx;
color: #000000; padding-top: 60rpx;
width: 620rpx; .label {
margin:0 auto; font-size: 24rpx;
text{ color: #000000;
font-size: 24rpx; width: 620rpx;
color: #D0121B; margin: 0 auto;
} text {
} font-size: 24rpx;
.inputv{ color: #d0121b;
display: block; }
width: 620rpx; }
padding-left:20rpx; .inputv {
margin:0 auto; display: block;
margin-top:15rpx; width: 620rpx;
height: 80rpx; padding-left: 20rpx;
background: #FFFFFF; margin: 0 auto;
border-radius: 5rpx; margin-top: 15rpx;
border: 1rpx solid #CACACA; height: 80rpx;
font-size: 24rpx; background: #ffffff;
color: #000000; border-radius: 5rpx;
} border: 1rpx solid #cacaca;
} font-size: 24rpx;
color: #000000;
.sure{ }
width: 100%; }
height: 110rpx;
background: #D0121B;
line-height: 110rpx;
text-align: center;
font-size: 30rpx;
color: #FFFFFF;
position: absolute;
bottom:0rpx;
left:0rpx;
}
.sure {
width: 100%;
height: 110rpx;
background: #d0121b;
line-height: 110rpx;
text-align: center;
font-size: 30rpx;
color: #ffffff;
position: absolute;
bottom: 0rpx;
left: 0rpx;
}
} }
/**优惠券弹窗**/ /**优惠券弹窗**/
.pop-yhq{ .pop-yhq {
width: 100%; width: 100%;
background: #FFFFFF; background: #ffffff;
border-radius: 10rpx 10rpx 0rpx 0rpx; border-radius: 10rpx 10rpx 0rpx 0rpx;
padding:24rpx 30rpx; padding: 24rpx 30rpx;
position: relative; position: relative;
padding-bottom: 150rpx; padding-bottom: 150rpx;
.trt{ .trt {
text-align: right; text-align: right;
.icon{color:#898989;font-size: 25rpx;} .icon {
} color: #898989;
.tit{ font-size: 25rpx;
font-size: 24rpx; }
color: #000000; }
margin-bottom: 25rpx; .tit {
text-align: center; font-size: 24rpx;
} color: #000000;
.cons{ margin-bottom: 25rpx;
margin-top:68rpx; text-align: center;
max-height:800rpx; }
overflow-y: auto; .cons {
.group{ margin-top: 68rpx;
height:180rpx; max-height: 800rpx;
margin-bottom:25rpx; overflow-y: auto;
background: url('https://img.ichunt.com/images/ichunt/202502/24/435bcc261a434392135ee0846ac99d60.png') no-repeat; .group {
background-size: 100% 100%; height: 180rpx;
padding-left: 27rpx; margin-bottom: 25rpx;
padding-right: 30rpx; background: url('https://img.ichunt.com/images/ichunt/202502/24/435bcc261a434392135ee0846ac99d60.png') no-repeat;
border-radius: 20rpx; background-size: 100% 100%;
border:1rpx solid #fff; padding-left: 27rpx;
&.act{ padding-right: 30rpx;
border:1rpx solid #D0121B; border-radius: 20rpx;
} border: 1rpx solid #fff;
.l{ &.act {
.price{ border: 1rpx solid #d0121b;
font-weight: 600; }
font-size: 30rpx; .l {
color: #FF3000; .price {
.textp{ font-weight: 600;
font-size: 60rpx; font-size: 30rpx;
color: #FF3000; color: #ff3000;
} .textp {
margin-right: 68rpx; font-size: 60rpx;
.tips{ color: #ff3000;
font-size: 22rpx; }
color: #FF6300; margin-right: 68rpx;
font-weight: normal; .tips {
} font-size: 22rpx;
} color: #ff6300;
.yhld{ font-weight: normal;
font-size: 22rpx; }
color: #FF6300; }
view{ .yhld {
font-size: 35rpx; font-size: 22rpx;
color: #3B2C1B; color: #ff6300;
height:72rpx; view {
line-height: 65rpx; font-size: 35rpx;
} color: #3b2c1b;
} height: 72rpx;
line-height: 65rpx;
} }
.rbtn{ }
width: 146rpx; }
height: 58rpx; .rbtn {
background: linear-gradient( 180deg, #F6491D 0%, #F52A1B 100%); width: 146rpx;
border-radius: 5rpx; height: 58rpx;
font-size: 26rpx; background: linear-gradient(180deg, #f6491d 0%, #f52a1b 100%);
color: #FFFFFF; border-radius: 5rpx;
font-size: 26rpx;
text{ color: #ffffff;
background: url('https://img.ichunt.com/images/ichunt/202502/24/4ab2a242f3e45c0bafe3fb3207263ed2.png') no-repeat;
background-size: 100% 100%; text {
height:25rpx; background: url('https://img.ichunt.com/images/ichunt/202502/24/4ab2a242f3e45c0bafe3fb3207263ed2.png') no-repeat;
width:25rpx; background-size: 100% 100%;
margin-left: 10rpx; height: 25rpx;
} width: 25rpx;
} margin-left: 10rpx;
} }
} }
.add-btn{ }
width: 100%; }
height: 110rpx; .add-btn {
background: #D0121B; width: 100%;
line-height: 110rpx; height: 110rpx;
text-align: center; background: #d0121b;
font-size: 30rpx; line-height: 110rpx;
color: #FFFFFF; text-align: center;
position: absolute; font-size: 30rpx;
bottom:0rpx; color: #ffffff;
left:0rpx; position: absolute;
} bottom: 0rpx;
} left: 0rpx;
\ No newline at end of file }
}
.classNavPage{ .classNavPage {
.bugc-ceng{ .bugc-ceng {
position: relative; position: relative;
z-index: 1; z-index: 1;
background: #fff; background: #fff;
} }
.cons{ .cons {
padding-top:23rpx; padding-top: 23rpx;
.one-c-box{ .one-c-box {
padding-left:18rpx; padding-left: 18rpx;
position: relative; position: relative;
padding-right:90rpx; padding-right: 90rpx;
height:63rpx; height: 63rpx;
.lb{
height:100%;
width:100%;
overflow-x: auto;
.itemo{
height: 45rpx;
line-height: 45rpx;
padding:0 17rpx;
border-radius: 5rpx;
border: 1rpx solid #fff;
margin-right:25rpx;
font-size: 24rpx;
color: #000000;
flex-shrink: 0;
&.act{
border: 1rpx solid #D0121B;
background: #FFF5F5;
color: #D0121B;
}
}
}
.rb{
width:90rpx;
height:45rpx;
position: absolute;
top:0rpx;
right:0rpx;
text-align: center;
.icon{
font-size: 16rpx;
color:#000;
}
}
.one-c-hide-cons{
position: absolute;
z-index: 1;
width: 100%;
background: #FFFFFF;
border-radius: 0rpx 0rpx 20rpx 20rpx;
top:-24rpx;
left:0rpx;
transition: max-height 0.5s;
max-height: 0;
overflow: hidden;
.tit{
padding: 11rpx 30rpx;
font-size: 24rpx;
color: #000000;
margin-bottom: 35rpx;
}
.hide-sec{
flex-wrap: wrap;
padding-left:60rpx;
padding-bottom:40rpx;
.itemh{
margin-bottom: 40rpx;
margin-right: 33rpx;
&:nth-child(4n){
margin-right: 0rpx;
}
image{
display: block;
width:106rpx;
height:106rpx;
margin:0 auto;
}
text{
margin-top:8rpx;
display: block;
width:135rpx;
text-align: center;
font-size: 24rpx;
color: #666666;
height:30rpx;
line-height: 30rpx;
}
&.act{
text{color:#D0121B;}
}
}
}
.foot{
height:87rpx;
font-size: 24rpx;
color: #000000;
border-top:1rpx solid #D1D1D1;
border-radius: 0rpx 0rpx 20rpx 20rpx;
.icon{
font-size: 16rpx;
margin-left: 20rpx;
}
}
}
&.show{
.one-c-hide-cons{max-height: 700rpx;}
&::after{
content:"";
position: fixed;
left:0;
top:0;
right:0;
bottom:0;
background: rgba(0,0,0,0.3);
}
}
}
.two-c-box{
margin-top:20rpx;
height:calc(100vh - 175rpx - 130rpx);
.lc{
width:225rpx;
height:100%;
padding-top:40rpx;
font-size: 24rpx;
color: #666666;
overflow-y: auto;
background: #f8f8f8;
.item{
padding:15rpx 0;
padding-left:35rpx;
padding-right:50rpx;
margin-bottom: 10rpx;
height:92rpx;
&.act{
color: #000000;
background: #fff;
border-radius: 100rpx 0 0 100rpx;
}
}
}
.rc{
width:525rpx;
height:100%;
overflow-y: auto;
padding-left:35rpx;
.item{
margin-right: 35rpx;
width: 130rpx;
padding-bottom:20rpx;
//margin-bottom:10rpx;
display: inline-block;
height:227rpx;
&:nth-child(3n){
margin-right: 0rpx;
}
image{
width: 130rpx;
height: 130rpx;
margin-bottom: 12rpx;
display: block;
}
text{
color: #000000;
width: 130rpx;
display: block;
line-height: 30rpx;
height:30rpx;
text-align: center;
font-size: 24rpx;
color: #000000;
}
}
}
}
}
.lb {
height: 100%;
width: 100%;
overflow-x: auto;
.itemo {
height: 45rpx;
line-height: 45rpx;
padding: 0 17rpx;
border-radius: 5rpx;
border: 1rpx solid #fff;
margin-right: 25rpx;
font-size: 24rpx;
color: #000000;
flex-shrink: 0;
&.act {
border: 1rpx solid #d0121b;
background: #fff5f5;
color: #d0121b;
}
}
}
.rb {
width: 90rpx;
height: 45rpx;
position: absolute;
top: 0rpx;
right: 0rpx;
text-align: center;
.icon {
font-size: 16rpx;
color: #000;
}
}
.one-c-hide-cons {
position: absolute;
z-index: 1;
width: 100%;
background: #ffffff;
border-radius: 0rpx 0rpx 20rpx 20rpx;
top: -24rpx;
left: 0rpx;
transition: max-height 0.5s;
max-height: 0;
overflow: hidden;
.tit {
padding: 11rpx 30rpx;
font-size: 24rpx;
color: #000000;
margin-bottom: 35rpx;
}
.hide-sec {
flex-wrap: wrap;
padding-left: 60rpx;
padding-bottom: 40rpx;
.itemh {
margin-bottom: 40rpx;
margin-right: 33rpx;
&:nth-child(4n) {
margin-right: 0rpx;
}
image {
display: block;
width: 106rpx;
height: 106rpx;
margin: 0 auto;
}
text {
margin-top: 8rpx;
display: block;
width: 135rpx;
text-align: center;
font-size: 24rpx;
color: #666666;
height: 30rpx;
line-height: 30rpx;
}
&.act {
text {
color: #d0121b;
}
}
}
}
.foot {
height: 87rpx;
font-size: 24rpx;
color: #000000;
border-top: 1rpx solid #d1d1d1;
border-radius: 0rpx 0rpx 20rpx 20rpx;
.icon {
font-size: 16rpx;
margin-left: 20rpx;
}
}
}
&.show {
.one-c-hide-cons {
max-height: 800rpx;
overflow-y: auto;
}
&::after {
content: '';
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.3);
}
}
}
.two-c-box {
margin-top: 20rpx;
height: calc(100vh - 175rpx - 130rpx);
.lc {
width: 225rpx;
height: 100%;
padding-top: 40rpx;
font-size: 24rpx;
color: #666666;
overflow-y: auto;
background: #f8f8f8;
.item {
padding: 15rpx 0;
padding-left: 35rpx;
padding-right: 50rpx;
margin-bottom: 10rpx;
height: 92rpx;
&.act {
color: #000000;
background: #fff;
border-radius: 100rpx 0 0 100rpx;
}
}
}
.rc {
width: 525rpx;
height: 100%;
overflow-y: auto;
padding-left: 35rpx;
.item {
margin-right: 35rpx;
width: 130rpx;
padding-bottom: 20rpx;
//margin-bottom:10rpx;
display: inline-block;
height: 227rpx;
&:nth-child(3n) {
margin-right: 0rpx;
}
image {
width: 130rpx;
height: 130rpx;
margin-bottom: 12rpx;
display: block;
}
text {
color: #000000;
width: 130rpx;
display: block;
line-height: 30rpx;
height: 30rpx;
text-align: center;
font-size: 24rpx;
color: #000000;
}
}
}
}
}
} }
/* #ifdef H5 */ /* #ifdef H5 */
.classNavPage{ .classNavPage {
.two-c-box{ .two-c-box {
height:calc(100vh - 90rpx - 130rpx); height: calc(100vh - 90rpx - 130rpx);
} }
} }
/* #endif */ /* #endif */
\ No newline at end of file
<template> <template>
<view class="rulePage"> <view class="rulePage">
<barX /> <barX />
<view class="header row verCenter"> <view class="header row verCenter">
<text class="icon iconfont icon-arrowleft" @click="$goBack"></text> <text class="icon iconfont icon-arrowleft" @click="$goBack"></text>
<view>{{id==1?'爱智网站服务协议':'爱智网隐私政策'}}</view> <view>{{id==1?'爱智网站服务协议':'爱智隐私政策'}}</view>
</view> </view>
<view class="content" v-html="content"></view> <view class="content" v-html="content"></view>
</view> </view>
</template> </template>
<script> <script>
import { import {
Api_Url Api_Url
} from '@/util/api.js' } from '@/util/api.js'
import barX from '@/components/barx.vue'; import barX from '@/components/barx.vue';
export default { export default {
data() { data() {
return { return {
id:1, id: 1,
content:"" content: ""
} }
}, },
onLoad: function(option) { onLoad: function(option) {
this.id=option.id this.id = option.id
this.getData() this.getData()
}, },
methods: { methods: {
getData(){ getData() {
this.request(Api_Url + '/api/xcx/newsPage', 'GET', {type:this.id}, true).then(res => { this.request(Api_Url + '/api/xcx/newsPage', 'GET', { type: this.id }, true).then(res => {
if(res.code==0){ if (res.code == 0) {
this.content=res.data.content this.content = res.data.content
}else{ } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'error' icon: 'error'
}); });
} }
}); });
} }
}, },
components: { components: {
barX, barX,
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.rulePage{ .rulePage {
.header{ .header {
height:110rpx; height: 110rpx;
padding-left:33rpx; padding-left: 33rpx;
.icon{
font-size: 35rpx; .icon {
color: #898989; font-size: 35rpx;
margin-right:160rpx; color: #898989;
} margin-right: 160rpx;
view{ }
font-weight: 600;
font-size: 32rpx; view {
color: #000000; font-weight: 600;
} font-size: 32rpx;
} color: #000000;
.content{ }
padding:33rpx; }
padding-top:0rpx;
font-size: 26rpx; .content {
color: #000000; padding: 33rpx;
line-height: 50rpx; padding-top: 0rpx;
letter-spacing: 1px; font-size: 26rpx;
overflow-y: auto; color: #000000;
height:calc(100vh - 285rpx); line-height: 50rpx;
/* #ifdef H5 */ letter-spacing: 1px;
height:calc(100vh - 200rpx); overflow-y: auto;
/* #endif */ height: calc(100vh - 285rpx);
} /* #ifdef H5 */
} height: calc(100vh - 200rpx);
/* #endif */
}
}
</style> </style>
\ No newline at end of file
<template> <template>
<view class="confirmQuotePage"> <view class="confirmQuotePage">
<barX /> <barX />
<titleNav :title="'确认报价单'"/> <titleNav :title="'确认报价单'" />
<view class="cons"> <view class="cons">
<view class="top-box"> <view class="top-box">
<view class="tit">询价人:{{create_name}}</view> <view class="tit">询价人:{{create_name}}</view>
<navigator :url="'/pages/user/address?form=confirmQuote&address_id='+address_id+'&coupon_id='+coupon_id" class="address-box"> <view class="tit">公司名称:{{priceInfo.company_name}}</view>
<!-- <navigator :url="'/pages/user/address?form=confirmQuote&address_id='+address_id+'&coupon_id='+coupon_id" class="address-box">
<view class="addbx row bothSide verCenter"> <view class="addbx row bothSide verCenter">
<view class="l"> <view class="l">
<view class="ad row verCenter"> <view class="ad row verCenter">
...@@ -17,278 +18,264 @@ ...@@ -17,278 +18,264 @@
</view> </view>
<text class="icon iconfont icon-arrowright"></text> <text class="icon iconfont icon-arrowright"></text>
</view> </view>
</navigator> </navigator> -->
</view> </view>
<view class="goods-box" v-if="carList.length>0"> <view class="goods-box" v-if="carList.length>0">
<view class="group row" v-for="(item,index) in carList" :key="index"> <view class="group row" v-for="(item,index) in carList" :key="index">
<image :src="item.goods_images||'https://www.iedge.net/assets/images/common/defaultnew.png'" /> <image :src="item.goods_images||'https://www.iedge.net/assets/images/common/defaultnew.png'" />
<view class="infos"> <view class="infos">
<view class="ganme elep2">{{item.sku_name}}</view> <view class="ganme elep2">{{item.sku_name}}</view>
<view class="hqs row verCenter bothSide"><text>货期:{{item.delivery_time}}</text><text>x{{item.goods_num}}</text></view> <view class="hqs row verCenter bothSide"><text>货期:{{item.delivery_time}}</text><text>x{{item.goods_num}}</text></view>
<view class="price">{{isCompany?(item.company_price||item.origin_price):item.origin_price}}</view> <view class="price">{{isCompany?(item.company_price||item.origin_price):item.origin_price}}</view>
</view> </view>
</view> </view>
<view class="coupo-box row bothSide verCenter" @click="chooseUp()"> <view class="coupo-box row bothSide verCenter" @click="chooseUp()">
<view class="l">选择您的优惠券</view> <view class="l">选择您的优惠券</view>
<view class="r row verCenter"> <view class="r row verCenter">
<view class="not" v-if="coupon_list.length==0"> <view class="not" v-if="coupon_list.length==0">
<text>未识别到可用优惠券</text> <text>未识别到可用优惠券</text>
<text class="icon iconfont icon-arrowright"></text> <text class="icon iconfont icon-arrowright"></text>
</view> </view>
<view v-else> <view v-else>
<text v-if="priceInfo">-{{priceInfo.currency_sign}}{{priceInfo.discount_fee||"0.00"}}</text> <text v-if="priceInfo">-{{priceInfo.currency_sign}}{{priceInfo.discount_fee||"0.00"}}</text>
<text class="icon iconfont icon-arrowright"></text> <text class="icon iconfont icon-arrowright"></text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="pur-sn-box"> <!-- <view class="pur-sn-box">
<view class="tit">客户采购单号</view> <view class="tit">客户采购单号</view>
<input type="text" class="pur-sn-val" v-model="purchase_sn" placeholder-class="placeholder-class" placeholder="请输入采购单号"/> <input type="text" class="pur-sn-val" v-model="purchase_sn" placeholder-class="placeholder-class" placeholder="请输入采购单号" />
</view> </view> -->
<view class="price-infos" v-if="priceInfo"> <view class="price-infos" v-if="priceInfo">
<view class="top "> <view class="top ">
<view class="item row bothSide"><text>商品含税总额</text><text>{{priceInfo.currency_sign}}{{priceInfo.all_amount}}</text></view> <view class="item row bothSide"><text>商品含税总额</text><text>{{priceInfo.currency_sign}}{{priceInfo.all_amount}}</text></view>
<view class="item row bothSide"><text>运费(未税)</text><text>{{priceInfo.currency_sign}}{{priceInfo.discovery_fee}}</text></view> <view class="item row bothSide"><text>运费(未税)</text><text>{{priceInfo.currency_sign}}{{priceInfo.discovery_fee}}</text></view>
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="item row bothSide"><text>总金额(未税)</text><text>{{priceInfo.currency_sign}}{{priceInfo.total_amount}}</text></view> <view class="item row bothSide"><text>总金额(未税)</text><text>{{priceInfo.currency_sign}}{{priceInfo.total_amount}}</text></view>
<view class="item row bothSide"><text>总税额</text><text>{{priceInfo.currency_sign}}{{priceInfo.tax_rate_amount||0}}</text></view> <view class="item row bothSide"><text>总税额</text><text>{{priceInfo.currency_sign}}{{priceInfo.tax_rate_amount||0}}</text></view>
<view class="item row bothSide"><text>应付金额(含税)</text><text class="price-pay">{{priceInfo.currency_sign}}{{priceInfo.pay_amount}}</text></view> <view class="item row bothSide"><text>应付金额(含税)</text><text class="price-pay">{{priceInfo.currency_sign}}{{priceInfo.pay_amount}}</text></view>
</view> </view>
</view> </view>
<view class="rules row verCenter"> <view class="rules row verCenter">
<text class="icon iconfont icon-checked1" :class="{'icon-checked':isTest}" <text class="icon iconfont icon-checked1" :class="{'icon-checked':isTest}" @click="isTest=!isTest"></text>
@click="isTest=!isTest"></text> <navigator url="/pages/car/confirmRule" class="tklink">查看交易条款</navigator>
<navigator url="/pages/car/confirmRule" class="tklink">查看交易条款</navigator> </view>
</view> </view>
</view> <view class="foot row verCenter bothSide ">
<view class="foot row verCenter bothSide " > <view class="l row verCenter">含税总额:<text v-if="priceInfo">{{priceInfo.currency_sign}}{{priceInfo.pay_amount}}</text> </view>
<view class="l row verCenter">含税总额:<text v-if="priceInfo">{{priceInfo.currency_sign}}{{priceInfo.pay_amount}}</text> </view> <view class="submit-btn" @click="openTipsx">完成报价</view>
<view class="submit-btn" @click="openTipsx">完成报价</view> </view>
</view>
<!--温馨提示-->
<!--温馨提示--> <uni-popup ref="popuptips" type="bottom" :safe-area="false">
<uni-popup ref="popuptips" type="bottom" :safe-area="false"> <view class="pop-tips">
<view class="pop-tips"> <view class="trt"><text class="icon iconfont icon-caca" @click="closeTipsx"></text></view>
<view class="trt"><text class="icon iconfont icon-caca" @click="closeTipsx"></text></view> <view class="ttit elep">温馨提示</view>
<view class="ttit elep">温馨提示</view> <view class="tipjk">请确认邮箱地址,爱智将以PDF格式报价单</view>
<view class="tipjk">请确认邮箱地址,爱智将以PDF格式报价单</view> <view class="cons">
<view class="cons"> <view class="label"><text>*</text>邮箱</view>
<view class="label"><text>*</text>邮箱</view> <input type="text" class="inputv" v-model="pdf_email" placeholder="请输入邮箱" />
<input type="text" class="inputv" v-model="pdf_email" placeholder="请输入邮箱" /> </view>
</view> <view class="sure" @click="createQuote">确认</view>
<view class="sure" @click="createQuote">确认</view> </view>
</view> </uni-popup>
</uni-popup>
<!--优惠券-->
<!--优惠券--> <uni-popup ref="popupyhq" type="bottom" :safe-area="false">
<uni-popup ref="popupyhq" type="bottom" :safe-area="false"> <view class="pop-yhq">
<view class="pop-yhq"> <view class="trt"><text class="icon iconfont icon-caca" @click="closePop"></text></view>
<view class="trt"><text class="icon iconfont icon-caca" @click="closePop"></text></view> <view class="ttit elep">优惠券</view>
<view class="ttit elep">优惠券</view> <view class="cons" v-if="coupon_list.length>0">
<view class="cons" v-if="coupon_list.length>0"> <view class="group row bothSide verCenter" :class="{'act':coupon_id==item.coupon_id}" v-for="(item,index) in coupon_list" :key="index" @click="chooseYhq(item.coupon_id)">
<view class="group row bothSide verCenter" :class="{'act':coupon_id==item.coupon_id}" v-for="(item,index) in coupon_list" :key="index" @click="chooseYhq(item.coupon_id)"> <view class="l row ">
<view class="l row "> <view class="price">
<view class="price"> <text v-if="item.coupon_type==2"><text class="textp">{{item.sale_amount*10}}</text></text>
<text v-if="item.coupon_type==2"><text class="textp">{{item.sale_amount*10}}</text></text> <text v-else>{{item.currency_sign}}<text class="textp">{{item.sale_amount}}</text></text>
<text v-else>{{item.currency_sign}}<text class="textp">{{item.sale_amount}}</text></text> <view class="tips">{{item.require_amount <= 0.01 ? '无门槛优惠券' : item.coupon_name}}</view>
<view class="tips">{{item.require_amount <= 0.01 ? '无门槛优惠券' : item.coupon_name}}</view>
</view>
</view> <view class="yhld">
<view class="yhld"> <view>商品优惠券</view>
<view>商品优惠券</view> <text>{{item.start_time}} - {{item.end_time}}</text>
<text>{{item.start_time}} - {{item.end_time}}</text> </view>
</view> </view>
</view> <!-- <view class="r">
<!-- <view class="r">
<view class="rbtn row verCenter rowCenter"> <view class="rbtn row verCenter rowCenter">
<view>选择</view> <view>选择</view>
<text ></text> <text ></text>
</view> </view>
</view> --> </view> -->
</view> </view>
</view> </view>
<view class="add-btn" @click="confirmYhq">确认</view> <view class="add-btn" @click="confirmYhq">确认</view>
</view> </view>
</uni-popup> </uni-popup>
</view> </view>
</template> </template>
<script> <script>
import {Api_Url} from '@/util/api.js' import { Api_Url } from '@/util/api.js'
import barX from '@/components/barx.vue'; import barX from '@/components/barx.vue';
import titleNav from '@/components/title_nav.vue'; import titleNav from '@/components/title_nav.vue';
export default { export default {
data() { data() {
return { return {
isTest:true, isTest: true,
pdf_email:"", pdf_email: "",
purchase_sn:"", purchase_sn: "",
userInfo:"", userInfo: "",
create_name:"", create_name: "",
address_id:"", address_id: "",
addressInfo:"", addressInfo: "",
carList:[], carList: [],
coupon_list:[], coupon_list: [],
coupon_id:"", coupon_id: "",
priceInfo:"", priceInfo: "",
isCompany:(uni.getStorageSync('user_info')&&JSON.parse(uni.getStorageSync('user_info')).company_name)?true:false isCompany: (uni.getStorageSync('user_info') && JSON.parse(uni.getStorageSync('user_info')).company_name) ? true : false
} }
}, },
onLoad: function(options) { onLoad: function(options) {
this.address_id=options.address_id||"" this.address_id = options.address_id || ""
this.coupon_id=options.coupon_id||"" this.coupon_id = options.coupon_id || ""
this.userInfo=JSON.parse(uni.getStorageSync('user_info')) this.userInfo = JSON.parse(uni.getStorageSync('user_info'))
this.create_name=this.userInfo.wx_nickname||this.userInfo.phone||this.userInfo.email this.create_name = this.userInfo.wx_nickname || this.userInfo.phone || this.userInfo.email
}, },
onShow(){ onShow() {
this.getCarList() this.getCarList()
this.getAddress() //this.getAddress()
}, },
methods: { methods: {
chooseYhq(coupon_id){ chooseYhq(coupon_id) {
this.coupon_id=coupon_id this.coupon_id = coupon_id
}, },
chooseUp(){ chooseUp() {
if(this.coupon_list==0){return} if (this.coupon_list == 0) { return }
this.openPop() this.openPop()
}, },
confirmYhq(){ confirmYhq() {
this.calPrice() this.calPrice()
this.closePop() this.closePop()
}, },
calPrice(){ calPrice() {
let sku_=[] let sku_ = []
this.carList.forEach(item=>{ this.carList.forEach(item => {
sku_.push({ sku_.push({
sku_id:item.goods_id, sku_id: item.goods_id,
num:item.goods_num num: item.goods_num
}) })
}) })
this.request(Api_Url + '/api/order/calQuotePrice', 'post', {sku_json:JSON.stringify(sku_),user_coupon_id:(this.coupon_id||"")}, true,true).then(res => { this.request(Api_Url + '/api/order/calQuotePrice', 'post', { sku_json: JSON.stringify(sku_), user_coupon_id: (this.coupon_id || "") }, true, true).then(res => {
if(res.code==0){ if (res.code == 0) {
this.priceInfo=res.data this.priceInfo = res.data;
} this.pdf_email = res.data.recent_quote_email;
}
})
}, })
getCarList(){ },
this.carList=[] getCarList() {
this.request(Api_Url + '/api/cart/getCartGoodsInfo', 'GET', {sku_ids:uni.getStorageSync('car_ids')}, true,true).then(res => { this.carList = []
if(res.code==0){ this.request(Api_Url + '/api/cart/getCartGoodsInfo', 'GET', { sku_ids: uni.getStorageSync('car_ids') }, true, true).then(res => {
let arr_=res.data.goods_list if (res.code == 0) {
arr_.forEach(item=>{ let arr_ = res.data.goods_list
item.delivery_list.forEach(item1=>{ arr_.forEach(item => {
this.carList.push(item1) item.delivery_list.forEach(item1 => {
}) this.carList.push(item1)
}) })
this.coupon_list=res.data.coupon_list||[] })
this.calPrice() this.coupon_list = res.data.coupon_list || []
} this.calPrice()
}) }
}, })
getAddress(){ },
this.request(Api_Url + '/api/address/getList', 'GET', {}, true).then(res => { getAddress() {
if(res.code==0){ this.request(Api_Url + '/api/address/getList', 'GET', {}, true).then(res => {
let arr_=res.data.list||[] if (res.code == 0) {
arr_.forEach(item=>{ let arr_ = res.data.list || []
if(this.address_id){ arr_.forEach(item => {
if(item.address_id==this.address_id){ if (this.address_id) {
this.addressInfo=item if (item.address_id == this.address_id) {
} this.addressInfo = item
}else{ }
if(item.is_default==1){ } else {
this.addressInfo=item if (item.is_default == 1) {
} this.addressInfo = item
} }
}) }
if(arr_.length>0&&(!this.addressInfo)){ })
this.addressInfo=arr_[0] if (arr_.length > 0 && (!this.addressInfo)) {
} this.addressInfo = arr_[0]
if(this.addressInfo){ }
this.address_id=this.addressInfo.address_id if (this.addressInfo) {
} this.address_id = this.addressInfo.address_id
} }
}) }
}, })
createQuote(){ },
createQuote() {
let goods_json_arr=[]
this.carList.forEach(item=>{ let goods_json_arr = []
goods_json_arr.push({ this.carList.forEach(item => {
sku_id:item.goods_id, goods_json_arr.push({
num:item.goods_num sku_id: item.goods_id,
}) num: item.goods_num
}) })
let obj_={ })
create_name:this.create_name, let obj_ = {
pdf_email:this.pdf_email, create_name: this.create_name,
sku_json:JSON.stringify(goods_json_arr), pdf_email: this.pdf_email,
user_coupon_id:this.coupon_id, sku_json: JSON.stringify(goods_json_arr),
address_id:this.address_id, user_coupon_id: this.coupon_id,
purchase_sn:this.purchase_sn address_id: this.address_id,
} purchase_sn: this.purchase_sn
this.request(Api_Url + '/api/xcx/confirmQuote', 'post', obj_, true).then(res => { }
if(res.code==0){ this.request(Api_Url + '/api/xcx/confirmQuote', 'post', obj_, true).then(res => {
uni.setStorageSync('quoteInfo',JSON.stringify(res.data)) if (res.code == 0) {
uni.navigateTo({ uni.setStorageSync('quoteInfo', JSON.stringify(res.data))
url: '/pages/car/confirmQuoteSuccess' uni.navigateTo({
}); url: '/pages/car/confirmQuoteSuccess'
}else{ });
uni.showToast({ } else {
title: res.msg, uni.showToast({
icon: 'nonde' title: res.msg,
}); icon: 'nonde'
} });
}
})
}, })
openTipsx() { },
if(!this.address_id){ openTipsx() {
uni.showToast({ if (!this.isTest) {
title: '请选择地址', uni.showToast({
icon: 'none' title: '请勾选并确认交易条款',
}); icon: 'none'
return });
} return
if(!this.purchase_sn){ }
uni.showToast({ this.$refs.popuptips.open('bottom');
title: '请输入客户采购单号', },
icon: 'none' closeTipsx() {
}); this.$refs.popuptips.close('bottom');
return },
} openPop() {
if(!this.isTest){ this.$refs.popupyhq.open('bottom');
uni.showToast({ },
title: '请勾选并确认交易条款', closePop() {
icon: 'none' this.$refs.popupyhq.close('bottom');
}); },
return },
} components: {
this.$refs.popuptips.open('bottom'); barX,
}, titleNav
closeTipsx() { }
this.$refs.popuptips.close('bottom'); }
},
openPop() {
this.$refs.popupyhq.open('bottom');
},
closePop() {
this.$refs.popupyhq.close('bottom');
},
},
components: {
barX,
titleNav
}
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '../../assets/css/car/confirmQuote.scss'; @import '../../assets/css/car/confirmQuote.scss';
</style> </style>
\ No newline at end of file
<template> <template>
<view class="classNavPage"> <view class="classNavPage">
<barX /> <barX />
<view class="bugc-ceng"> <view class="bugc-ceng">
<searchHead @confirm="onConfirm" @goUrl="goUrl"/> <searchHead @confirm="onConfirm" @goUrl="goUrl" />
</view> </view>
<view class="cons"> <view class="cons">
<view class="one-c-box" :class="{'show':isShowClassOne}"> <view class="one-c-box" :class="{'show':isShowClassOne}">
<view class="lb row"> <view class="lb row">
<view class="itemo" :class="{'act':item.checkedx}" v-for="(item,index) in pageData" :key="index" @click="tab(1,item.base_id)">{{item.title}}</view> <view class="itemo" :class="{'act':item.checkedx}" v-for="(item,index) in pageData" :key="index" @click="tab(1,item.base_id)">{{item.title}}</view>
</view> </view>
<view class="rb row verCenter rowCenter" @click="isShowClassOne=!isShowClassOne"> <view class="rb row verCenter rowCenter" @click="isShowClassOne=!isShowClassOne">
<text :class="['icon','iconfont','icon-arrowxia']" ></text> <text :class="['icon','iconfont','icon-arrowxia']"></text>
</view> </view>
<view class="one-c-hide-cons"> <view class="one-c-hide-cons">
<view class="tit">全部分类</view> <view class="tit">全部分类</view>
<view class="hide-sec row"> <view class="hide-sec row">
<view class="itemh" :class="{'act':item.checkedx}" v-for="(item,index) in pageData" :key="index" @click="tab(1,item.base_id)"> <view class="itemh" :class="{'act':item.checkedx}" v-for="(item,index) in pageData" :key="index" @click="tab(1,item.base_id)">
<image :src="item.images||'https://www.iedge.net/assets/images/common/defaultnew.png'" mode="aspectFit" ></image> <image :src="item.images||'https://www.iedge.net/assets/images/common/defaultnew.png'" mode="aspectFit"></image>
<text class="elep">{{item.title}}</text> <text class="elep">{{item.title}}</text>
</view> </view>
</view> </view>
<view class="foot row verCenter rowCenter" @click="isShowClassOne=!isShowClassOne">收起<text <view class="foot row verCenter rowCenter" @click="isShowClassOne=!isShowClassOne">收起<text class="icon iconfont icon-arrowshang"></text></view>
class="icon iconfont icon-arrowshang"></text></view> </view>
</view>
<view class="two-c-box row bothSide">
<view class="lc">
<view class="item row verCenter" :class="{'act':item.checkedx}" v-for="(item,index) in erJList" :key="index" @click="tab(2,item.class_id)">{{item.class_name}}</view>
</view>
<view class="rc ">
<navigator :url="'/pages/class/list?class_id2='+item.class_id" class="item" v-for="(item,index) in sanJlist" :key="index">
<image :src="item.class_icon||'https://www.iedge.net/assets/images/common/defaultnew.png'" mode="aspectFit"></image>
<text class="elep">{{item.class_name}}</text>
</navigator>
</view> </view>
</view> </view>
<view class="two-c-box row bothSide">
<view class="lc">
<view class="item row verCenter" :class="{'act':item.checkedx}" v-for="(item,index) in erJList" :key="index" @click="tab(2,item.class_id)">{{item.class_name}}</view>
</view>
<view class="rc ">
<navigator :url="'/pages/class/list?class_id2='+item.class_id" class="item" v-for="(item,index) in sanJlist" :key="index">
<image :src="item.class_icon||'https://www.iedge.net/assets/images/common/defaultnew.png'" mode="aspectFit" ></image>
<text class="elep">{{item.class_name}}</text>
</navigator>
</view> </view>
</view> <bottomNav actval="2" />
</view>
</view>
<bottomNav actval="2" />
</view>
</template> </template>
<script> <script>
import { import {
Api_Url Api_Url
} from '@/util/api.js' } from '@/util/api.js'
import searchHead from '@/components/search_head.vue'; import searchHead from '@/components/search_head.vue';
import barX from '@/components/barx.vue'; import barX from '@/components/barx.vue';
import bottomNav from '@/components/bottom_nav'; import bottomNav from '@/components/bottom_nav';
export default {
data() {
return {
isShowClassOne: false, //是否展示一级分类浮层
pageData: [],
erJList: [],
sanJlist: [],
class_id1: "",
class_id2: ""
}
},
onLoad: function(option) {
this.class_id1 = option.class_id1 ? option.class_id1 : ''
this.class_id2 = option.class_id2 ? option.class_id2 : ''
this.getData()
},
methods: {
tab(type, id) {
if (type == 1) {
this.pageData.forEach(item => {
if (item.base_id == id) {
item.checkedx = true
this.erJList = item.right_cate_list || []
} else {
item.checkedx = false
}
(this.erJList || []).forEach((item1, index1) => {
if (index1 == 0) {
item1.checkedx = true
this.sanJlist = item1.children
} else {
item1.checkedx = false
}
})
})
} else {
this.erJList.forEach((item1, index1) => {
if (item1.class_id == id) {
item1.checkedx = true
this.sanJlist = item1.children
} else {
item1.checkedx = false
}
})
}
},
getData() {
this.request(Api_Url + '/api/xcx/category', 'GET', {}, true).then(res => {
if (res.code == 0) {
this.pageData = res.data.category_list || []
this.pageData.forEach((item, index) => {
if (this.class_id1) {
if (this.class_id1 == item.base_id) {
item.checkedx = true
this.erJList = item.right_cate_list || []
} else {
item.checkedx = false
}
} else {
if (index == 0) {
item.checkedx = true
this.erJList = item.right_cate_list || []
} else {
item.checkedx = false
}
}
(this.erJList || []).forEach((item1, index1) => {
if (this.class_id2) {
if (this.class_id2 == item1.class_id) {
item1.checkedx = true
this.sanJlist = item1.children
} else {
item1.checkedx = false
}
} else {
if (index1 == 0) {
item1.checkedx = true
this.sanJlist = item1.children
} else {
item1.checkedx = false
}
}
export default { })
data() { })
return { } else {
isShowClassOne: false, //是否展示一级分类浮层 uni.showToast({
pageData: [], title: res.msg,
erJList:[], icon: 'error'
sanJlist:[], });
class_id1:"", }
class_id2:""
}
},
onLoad: function(option) {
this.class_id1=option.class_id1?option.class_id1:''
this.class_id2=option.class_id2?option.class_id2:''
this.getData()
},
methods: { });
tab(type,id){ },
if(type==1){ onConfirm(e) {
this.pageData.forEach(item=>{ let key_ = e.detail.value
if(item.base_id==id){ if (key_.length < 2) {
item.checkedx=true uni.showToast({
this.erJList=item.right_cate_list||[] title: '关键字不能小于2个字符',
}else{ duration: 2000,
item.checkedx=false icon: "none"
} })
(this.erJList||[]).forEach((item1, index1) => { return
if (index1 == 0) { }
item1.checkedx = true
this.sanJlist=item1.children
} else {
item1.checkedx = false
}
})
})
}else{
this.erJList.forEach((item1, index1) => {
if (item1.class_id == id) {
item1.checkedx = true
this.sanJlist=item1.children
} else {
item1.checkedx = false
}
})
}
},
getData() {
this.request(Api_Url + '/api/xcx/category', 'GET', {}, true).then(res => {
if(res.code==0){
this.pageData = res.data.category_list || []
this.pageData.forEach((item, index) => {
if(this.class_id1){
if(this.class_id1==item.base_id){
item.checkedx = true
this.erJList=item.right_cate_list||[]
}else{
item.checkedx = false
}
}else{
if (index == 0) {
item.checkedx = true
this.erJList=item.right_cate_list||[]
} else {
item.checkedx = false
}
}
(this.erJList||[]).forEach((item1, index1) => {
if(this.class_id2){
if(this.class_id2==item1.class_id){
item1.checkedx = true
this.sanJlist=item1.children
}else{
item1.checkedx = false
}
}else{
if (index1 == 0) {
item1.checkedx = true
this.sanJlist=item1.children
} else {
item1.checkedx = false
}
}
})
})
}else{
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
onConfirm(e) {
let key_ = e.detail.value
if (key_.length < 2) {
uni.showToast({
title: '关键字不能小于2个字符',
duration: 2000,
icon: "none"
})
return
}
uni.navigateTo({ uni.navigateTo({
url: '/pages/search/list?k=' + key_ url: '/pages/search/list?k=' + key_
}); });
}, },
goUrl(){ goUrl() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/search/nav' url: '/pages/search/nav'
}); });
}, },
}, },
components: { components: {
searchHead, searchHead,
barX, barX,
bottomNav bottomNav
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '../../assets/css/class/nav.scss'; @import '../../assets/css/class/nav.scss';
</style> </style>
\ No newline at end of file
<template> <template>
<view class="goodsDetailPage" v-if="goods_info"> <view class="goodsDetailPage" v-if="goods_info">
<barX /> <barX />
<view class="header row verCenter" > <view class="header row verCenter">
<text class="icon iconfont icon-arrowleft" @click="$goBack"></text> <text class="icon iconfont icon-arrowleft" @click="$goBack"></text>
<text class="tab-item" :class="{'act':pageTab==1}" @click="tab(1)">商品</text> <text class="tab-item" :class="{'act':pageTab==1}" @click="tab(1)">商品</text>
<text class="tab-item " :class="{'act':pageTab==2}" @click="tab(2)">详情</text> <text class="tab-item " :class="{'act':pageTab==2}" @click="tab(2)">详情</text>
</view> </view>
<view class="goods_info"> <view class="goods_info">
<view class="swiper-box" v-if="images.length>0"> <view class="swiper-box" v-if="images.length>0">
<swiper class="swiper" @change="handleSwiperChange" :indicator-dots="false" :autoplay="false" <swiper class="swiper" @change="handleSwiperChange" :indicator-dots="false" :autoplay="false" :interval="3000" :duration="500">
:interval="3000" :duration="500"> <swiper-item class="swiper-item" v-for="(item, index) in images" :key="index">
<swiper-item class="swiper-item" v-for="(item, index) in images" :key="index"> <image class="swiper-image" :src="item.thumbnail||'https://www.iedge.net/assets/images/common/defaultnew.png'" mode="aspectFit" />
<image class="swiper-image" :src="item.thumbnail||'https://www.iedge.net/assets/images/common/defaultnew.png'" mode="aspectFit" /> </swiper-item>
</swiper-item> </swiper>
</swiper> <text class="page-indicator">{{ currentPage + 1 }}/{{ images.length }}</text>
<text class="page-indicator">{{ currentPage + 1 }}/{{ images.length }}</text> </view>
</view> <view class="info-box">
<view class="info-box"> <view class="price-box row verCenter" v-if="goods_info.ladder_price&&goods_info.ladder_price.length>0">
<view class="price-box row verCenter" v-if="goods_info.ladder_price&&goods_info.ladder_price.length>0"> <text class="price1" v-if="goods_info.ladder_price[0]['price_cn']">¥
<text class="price1" v-if="goods_info.ladder_price[0]['price_cn']">¥ {{goods_info.ladder_price[0]['price_cn']}}</text>
{{goods_info.ladder_price[0]['price_cn']}}</text> <text class="price1" v-else>¥立即咨询</text>
<text class="price1" v-else>¥立即咨询</text>
<view v-if="isLogin">
<view class="row verCenter" v-if="goods_info.ladder_price[1]['price_cn']">
<text class="price2">¥ {{goods_info.ladder_price[1]['price_cn']||'立即咨询'}}</text>
<text class="qy">企业价</text>
</view>
</view>
<view class="row verCenter" v-else>
<text class="price2">¥ ****</text>
<text class="qy">企业价</text>
<text class="qytip">登录后查看企业价</text>
</view>
</view>
<view class="price-box row verCenter" v-else>
<text class="price1 price1no">¥立即咨询</text>
</view>
<view v-if="isLogin">
<view class="row verCenter" v-if="goods_info.ladder_price[1]['price_cn']">
<text class="price2">¥ {{goods_info.ladder_price[1]['price_cn']||'立即咨询'}}</text>
<text class="qy">企业价</text>
</view>
</view>
<view class="row verCenter" v-else>
<text class="price2">¥ ****</text>
<text class="qy">企业价</text>
<text class="qytip">登录后查看企业价</text>
</view>
</view>
<view class="price-box row verCenter" v-else>
<text class="price1 price1no">¥立即咨询</text>
</view>
<view class="tag-box row"
v-if="goods_info.goods_tag&&goods_info.goods_tag.goods_tag_names&&goods_info.goods_tag.goods_tag_names.length>0">
<view class="tag" :class="{'tag1': index % 2 != 0, 'tag2': index % 2 == 0}"
v-for="(item,index) in goods_info.goods_tag.goods_tag_names" :key="index">{{item}}</view>
</view>
<view class="goods-name elep2">{{goods_info.sku_name}}</view>
<view class="attr-box">
<view class="item row">
<text>品牌</text>
<view>{{goods_info.brand_name}}</view>
</view>
<view class="item row">
<text>型号</text>
<view>{{goods_info.goods_name}}</view>
</view>
<view class="item row">
<text>分类</text>
<view>{{goods_info.class_name}}</view>
</view>
<view class="item row">
<text>商品编码</text>
<view>{{goods_info.goods_id}}</view>
</view>
<view class="item row">
<text>描述</text>
<view>{{goods_info.spu_brief}}</view>
</view>
<view class="item row">
<text>货期</text>
<view>{{goods_info.cn_delivery_time}}</view>
</view>
<view class="item row">
<text>库存</text>
<view>{{goods_info.stock}}</view>
</view>
</view>
</view> <view class="tag-box row" v-if="goods_info.goods_tag&&goods_info.goods_tag.goods_tag_names&&goods_info.goods_tag.goods_tag_names.length>0">
<view class="product-box" ref="productBox"> <view class="tag" :class="{'tag1': index % 2 != 0, 'tag2': index % 2 == 0}" v-for="(item,index) in goods_info.goods_tag.goods_tag_names" :key="index">{{item}}</view>
<view class="tab row verCenter"> </view>
<text :class="{'act':productType==1}" @click="productType=1">商品介绍</text> <view class="goods-name elep2">{{goods_info.sku_name}}</view>
<text @click="pdfPre" v-if="goods_info.pdf">数据手册</text> <view class="attr-box">
</view> <view class="item row">
<view class="tabcon tabcon1 row verCenter rowCenter" :class="{'act':productType==1}" v-html="goods_info.sku_detail"></view> <text>品牌</text>
</view> <view>{{goods_info.brand_name}}</view>
</view>
<view class="item row">
<text>型号</text>
<view>{{goods_info.goods_name}}</view>
</view>
<view class="item row">
<text>分类</text>
<view>{{goods_info.class_name}}</view>
</view>
<view class="item row">
<text>商品编码</text>
<view>{{goods_info.goods_id}}</view>
</view>
<view class="item row">
<text>描述</text>
<view>{{goods_info.spu_brief}}</view>
</view>
<view class="item row">
<text>货期</text>
<view>{{goods_info.cn_delivery_time}}</view>
</view>
<view class="item row">
<text>库存</text>
<view>{{goods_info.stock}}</view>
</view>
</view>
</view> </view>
<view class="product-box" ref="productBox">
<view class="tab row verCenter">
<text :class="{'act':productType==1}" @click="productType=1">商品介绍</text>
<text @click="pdfPre" v-if="goods_info.pdf">数据手册</text>
</view>
<view class="tabcon tabcon1 row verCenter rowCenter" :class="{'act':productType==1}" v-html="goods_info.sku_detail"></view>
</view>
</view>
<view class="foot row verCenter bothSide" >
<navigator class="item" :url='$globalData.KFQQ'>
<text class="icon iconfont icon-kfd"></text>
<view>客服</view>
</navigator>
<navigator class="item" url="/pages/car/list" >
<text class="icon iconfont icon-card"></text>
<view>购物车</view>
</navigator>
<navigator class="kefzx" :url='$globalData.KFQQ' v-if="goods_info.is_buy!=1">
立即咨询
</navigator>
<view class="item" @click="openAddList()" v-if="goods_info.is_buy==1">
<text class="icon iconfont icon-qdd"></text>
<view>加入清单</view>
</view>
<view class="row" v-if="goods_info.is_buy==1">
<view class="add-car" @click="open(1)">加入购物车</view>
<view class="add-confirm" @click="open(2)">立即订购</view>
</view>
</view>
<!--加入购物车 立即订购--> <view class="foot row verCenter bothSide">
<uni-popup ref="popupcar" type="bottom" :safe-area="false"> <navigator class="item" :url='$globalData.KFQQ'>
<view class="pop-detail-car"> <text class="icon iconfont icon-kfd"></text>
<view class="trt"><text class="icon iconfont icon-caca" @click="close"></text></view> <view>客服</view>
<view class="handle row"> </navigator>
<image :src="goods_info.goods_images||'https://www.iedge.net/assets/images/common/defaultnew.png'" /> <navigator class="item" url="/pages/car/list">
<view class="hbox"> <text class="icon iconfont icon-card"></text>
<view class="price1">¥ {{buyPrice}}</view> <view>购物车</view>
<view class="hbha row verCenter bothSide"> </navigator>
<text class="icon iconfont icon-jian" @click="addjNum(goods_info.sku_id,1)"></text> <navigator class="kefzx" :url='$globalData.KFQQ' v-if="goods_info.is_buy!=1">
<input type="number" v-model="goods_numberx" @input="changeNum(goods_info.sku_id)"/> 立即咨询
<text class="icon iconfont icon-jia" @click="addjNum(goods_info.sku_id,2)"></text> </navigator>
</view> <view class="item" @click="openAddList()" v-if="goods_info.is_buy==1">
</view> <text class="icon iconfont icon-qdd"></text>
</view> <view>加入清单</view>
<view class="goods-box"> </view>
<view class="tit">型号</view> <view class="row" v-if="goods_info.is_buy==1">
<view class="item" :class="{'act':goods_id==item.goods_id}" v-for="(item,index) in goods_series" :key="index" > <view class="add-car" @click="open(1)">加入购物车</view>
<text @click="changeSku(item.goods_id)">{{item.goods_name}}</text> <view class="add-confirm" @click="open(2)">立即订购</view>
</view> </view>
</view>
</view>
<navigator :url='$globalData.KFQQ' class="xunjia" v-if="goods_info.is_buy!=1">立即询价</navigator> <!--加入购物车 立即订购-->
<view class="add-btn" @click="gocar" v-if="goods_info.is_buy==1">{{addType==1?'加入购物车':'立即订购'}}</view> <uni-popup ref="popupcar" type="bottom" :safe-area="false">
</view> <view class="pop-detail-car">
</uni-popup> <view class="trt"><text class="icon iconfont icon-caca" @click="close"></text></view>
<!--加入清单--> <view class="handle row">
<uni-popup ref="popupaddlist" type="bottom" :safe-area="false"> <image :src="goods_info.goods_images||'https://www.iedge.net/assets/images/common/defaultnew.png'" />
<view class="pop-add-list"> <view class="hbox">
<view class="trt"><text class="icon iconfont icon-caca" @click="closeAddList"></text></view> <view class="price1">¥ {{buyPrice}}</view>
<view class="ttit elep">{{goods_info.goods_name}}</view> <view class="hbha row verCenter bothSide">
<view class="new-box row"> <text class="icon iconfont icon-jian" @click="addjNum(goods_info.sku_id,1)"></text>
<text class="new-btn row verCenter" @click="openNewList">新建清单<text <input type="number" v-model="goods_numberx" @input="changeNum(goods_info.sku_id)" />
class="icon iconfont icon-jia"></text></text> <text class="icon iconfont icon-jia" @click="addjNum(goods_info.sku_id,2)"></text>
</view> </view>
<view class="list-box" v-if="qDList.length>0"> </view>
<view class="item row verCenter bothSide" v-for="(item,index) in qDList" :key="index"> </view>
<view class="row verCenter" @click.stop="chooseQd(item.list_id)"> <view class="goods-box">
<view class="l"> <view class="tit">型号</view>
<text class="icon iconfont icon-checked1" :class="{'icon-checked':item.checked}" ></text> <view class="item" :class="{'act':goods_id==item.goods_id}" v-for="(item,index) in goods_series" :key="index">
</view> <text @click="changeSku(item.goods_id)">{{item.goods_name}}</text>
<view class="c"> </view>
<view class="elep">{{item.list_name}}</view>
<text>{{item.create_time}}</text> </view>
</view> <navigator :url='$globalData.KFQQ' class="xunjia" v-if="goods_info.is_buy!=1">立即询价</navigator>
</view> <view class="add-btn" @click="gocar" v-if="goods_info.is_buy==1">{{addType==1?'加入购物车':'立即订购'}}</view>
<navigator :url="'/pages/user/qdDetail?list_id='+item.list_id"> </view>
<view class="r row verCenter"> </uni-popup>
<text>{{item.list_goods_count}}个商品</text> <!--加入清单-->
<text class="icon iconfont icon-arrowright"></text> <uni-popup ref="popupaddlist" type="bottom" :safe-area="false">
</view> <view class="pop-add-list">
</navigator> <view class="trt"><text class="icon iconfont icon-caca" @click="closeAddList"></text></view>
</view> <view class="ttit elep">{{goods_info.goods_name}}</view>
</view> <view class="new-box row">
<view class="list-box" v-else> <text class="new-btn row verCenter" @click="openNewList">新建清单<text class="icon iconfont icon-jia"></text></text>
<view class="no-data"> </view>
<image src="https://img.ichunt.com/images/ichunt/202502/24/07a360187d83ccf80a9d835029c27446.png" /> <view class="list-box" v-if="qDList.length>0">
<view>暂无清单数据,先去创建清单吧!</view> <view class="item row verCenter bothSide" v-for="(item,index) in qDList" :key="index">
</view> <view class="row verCenter" @click.stop="chooseQd(item.list_id)">
</view> <view class="l">
<view class="add-list" @click="addQdList()">确认</view> <text class="icon iconfont icon-checked1" :class="{'icon-checked':item.checked}"></text>
</view> </view>
</uni-popup> <view class="c">
<!--新建清单--> <view class="elep">{{item.list_name}}</view>
<uni-popup ref="popupnewlist" type="bottom" :safe-area="false"> <text>{{item.create_time}}</text>
<view class="pop-new-list"> </view>
<view class="trt"><text class="icon iconfont icon-caca" @click="closeNewList"></text></view> </view>
<view class="ttit elep">新建清单</view> <navigator :url="'/pages/user/qdDetail?list_id='+item.list_id">
<view class="cons"> <view class="r row verCenter">
<input type="text" class="inputv" v-model="list_name" placeholder="请输入清单名称,若未输入则显示商品编码;" /> <text>{{item.list_goods_count}}个商品</text>
</view> <text class="icon iconfont icon-arrowright"></text>
<view class="add-list" @click="createList()">确认</view> </view>
</view> </navigator>
</uni-popup> </view>
</view> </view>
<view class="list-box" v-else>
<view class="no-data">
<image src="https://img.ichunt.com/images/ichunt/202502/24/07a360187d83ccf80a9d835029c27446.png" />
<view>暂无清单数据,先去创建清单吧!</view>
</view>
</view>
<view class="add-list" @click="addQdList()">确认</view>
</view>
</uni-popup>
<!--新建清单-->
<uni-popup ref="popupnewlist" type="bottom" :safe-area="false">
<view class="pop-new-list">
<view class="trt"><text class="icon iconfont icon-caca" @click="closeNewList"></text></view>
<view class="ttit elep">新建清单</view>
<view class="cons">
<input type="text" class="inputv" v-model="list_name" placeholder="请输入清单名称,若未输入则显示商品分类;" />
</view>
<view class="add-list" @click="createList()">确认</view>
</view>
</uni-popup>
</view>
</template> </template>
<script> <script>
import { import {
Api_Url Api_Url
} from '@/util/api.js' } from '@/util/api.js'
import barX from '@/components/barx.vue';
export default {
data() {
return {
isLogin: uni.getStorageSync('token') ? true : false,
goods_id_page: "",
buyPrice: "",
isCompany: (uni.getStorageSync('user_info') && JSON.parse(uni.getStorageSync('user_info')).company_name) ? true : false,
productType: 1,
pageTab: 1,
productTop: 0,
goBuyType: 1,
images: [],
positions: "",
currentPage: 0,
goods_numberx: 1, //购买数量
goods_id: "",
goods_info: "",
goods_series: [],
addType: 1,
list_name: "", //清单名字
qDList: [],
miniShareOptions: {
title: '爱智工业平台',
path: '/pages/goods/detail?goods_id=',
imageUrl: 'https://img.ichunt.com/images/ichunt/202503/11/8bd43dcc1b28a3fd8c417ac0c6410406.png',
desc: ''
}
}
},
onShareAppMessage() {
return {
...this.miniShareOptions,
success: () => {
uni.showToast({
title: '分享成功',
icon: 'success'
});
},
fail: () => {
uni.showToast({
title: '分享失败',
icon: 'none'
});
}
};
},
onShareTimeline() {
return {
...this.miniShareOptions,
success: () => {
uni.showToast({
title: '分享成功',
icon: 'success'
});
},
fail: () => {
uni.showToast({
title: '分享失败',
icon: 'none'
});
}
};
},
onLoad(option) {
this.goods_id_page = option.goods_id
this.goods_id = option.goods_id
this.getData()
this.getQdList()
this.miniShareOptions.path = '/pages/goods/detail?goods_id=' + option.goods_id
},
onPageScroll(e) {
this.pageTab = 1
if (e.scrollTop >= 300) {
this.pageTab = 2
}
},
methods: {
gocar() {
if (!uni.getStorageSync('token')) {
uni.navigateTo({
url: "/pages/auth/login?referer=" + encodeURIComponent(`/pages/goods/detail?goods_id=${this.goods_id_page}`)
})
return
}
let obj_ = {
sku_id: this.goods_id,
goods_num: this.goods_numberx,
price: this.buyPrice,
guid_: this.addType,
}
if (this.addType == 2) {
obj_.is_cover_goods_num = 1
}
this.request(Api_Url + '/api/cart/addCart', 'GET', obj_, true).then(res => {
if (res.code == 0) {
if (this.addType == 1) {
uni.showToast({
title: "添加购物车成功",
icon: 'success'
});
this.close()
} else {
uni.setStorageSync('car_ids', this.goods_id);
uni.setStorageSync('confirmOrderBackUrl', `/pages/goods/detail?goods_id=${this.goods_id_page}`)
uni.navigateTo({
url: '/pages/car/confirmOrder'
});
}
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
changeNum(sku_id, type) {
clearTimeout(this.timeout);
this.timeout = setTimeout(() => {
let result = this.goods_info
let mpl = Number(result.multiple || result.mpl); //倍数 加减的数量基数
let stock = Number(result.stock); //库存
let moq = Number(result.moq); //起订量
let value_ = Number(this.goods_numberx); //当前的数量
value_ = Math.ceil(value_ / mpl) * mpl; //失去焦点数量
this.goods_numberx = value_; //最终的数量
if (value_ < moq) {
this.goods_numberx = moq
}
if (value_ > stock) {
this.goods_numberx = Math.floor(stock / mpl) * mpl;
}
}, 800);
},
addjNum(sku_id, type) {
let result = this.goods_info
let mpl = Number(result.multiple || result.mpl); //倍数 加减的数量基数
let stock = Number(result.stock); //库存
let moq = Number(result.moq); //起订量
let value_ = Number(this.goods_numberx); //当前的数量
if (type == 1) {
//减法
var down_value = value_ - mpl; //减过后的值
if (down_value < moq) {
this.goods_numberx = moq;
uni.showToast({
title: '数量不能小于起订量',
duration: 2000,
icon: "none"
})
} else {
this.goods_numberx = down_value
}
} else {
//加法
var up_value = value_ + mpl; //加过后的值
if (up_value > stock) {
uni.showToast({
title: '数量不能大于库存',
duration: 2000,
icon: "none"
})
this.goods_numberx = Math.floor(stock / mpl) * mpl;
} else {
this.goods_numberx = up_value
}
}
},
changeSku(sku_id) {
this.goods_id = sku_id
this.getData(1)
},
pdfPre() {
uni.downloadFile({
url: this.goods_info.pdf,
success: function(res) {
uni.openDocument({
filePath: res.tempFilePath,
showMenu: true,
success: function(res) {
console.log('打开文档成功');
}
});
}
});
},
getData(type) {
this.request(Api_Url + '/api/xcx/goodsDetail', 'GET', {
goods_id: this.goods_id
}, true).then(res => {
if (res.code == 0) {
this.goods_info = res.data.goods_info
this.miniShareOptions.title = this.goods_info.goods_name + " " + this.goods_info.class_name
if (this.goods_info.sku_detail) {
this.goods_info.sku_detail = this.goods_info.sku_detail.replace(/<img/gi, '<img class="img-style"')
}
this.goods_numberx = Number(this.goods_info.moq)
this.buyPrice = 0;
if (this.goods_info.ladder_price && this.goods_info.ladder_price.length > 0) {
this.buyPrice = this.isCompany ? (this.goods_info['ladder_price'][1]['price_cn'] || 0) : (this.goods_info['ladder_price'][0]['price_cn'] || 0)
}
if (!type) {
this.goods_series = res.data.goods_series || []
this.goods_series.sort((a, b) => {
if (a.goods_id == this.goods_id) return -1;
if (b.goods_id == this.goods_id) return 1;
return 0;
});
}
this.images = [{ name: "default.png", thumbnail: res.data.goods_info.goods_images || "" }, ...(res.data.goods_info.spu_extra.image_list || [])]
setTimeout(() => {
this.calculatePositions();
}, 100)
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
calculatePositions() {
const query = uni.createSelectorQuery();
query.select('.product-box').boundingClientRect();
query.exec((rects) => {
if (rects[0]) {
this.productTop = rects[0].top;
}
});
},
tab(page) {
this.pageTab = page
uni.pageScrollTo({
scrollTop: page == 2 ? this.productTop - 140 : 0,
duration: 300
});
},
handleSwiperChange(e) {
this.currentPage = e.detail.current;
setTimeout(() => {
this.calculatePositions();
}, 100)
},
getQdList() {
if (!uni.getStorageSync('token')) { return }
this.request(Api_Url + '/api/xcx/getGoodsList', 'get', { page: 1, limit: 100 }, false).then(res => {
this.qDList = []
if (res.code == 0) {
let arr_ = res.data.list || []
arr_.forEach(item => {
item.checked = false
})
this.qDList = arr_
}
})
},
chooseQd(list_id) {
this.qDList.forEach(item => {
if (item.list_id == list_id) {
item.checked = !item.checked
}
})
},
createList() {
this.request(Api_Url + '/api/xcx/createGoodsList', 'post', { list_name: (this.list_name || this.goods_info.class_name) }, true).then(res => {
if (res.code == 0) {
uni.showToast({
title: "创建清单成功",
icon: 'success'
});
this.closeNewList()
this.getQdList()
} else {
uni.showToast({
title: res.msg,
icon: 'nonde'
});
}
})
},
addQdList() {
let checkList = this.qDList.filter(item => item.checked)
let ids_ = checkList.map(item => item.list_id)
if (checkList.length == 0) {
uni.showToast({
title: "请选择一条清单",
icon: 'none'
});
return
}
let sku_json = [{
sku_id: this.goods_id,
qty: this.goods_numberx
}]
this.request(Api_Url + '/api/xcx/addGoodsList', 'post', {
list_id: ids_.join(","),
sku_json: JSON.stringify(sku_json)
}, true).then(res => {
if (res.code == 0) {
uni.showToast({
title: "加入清单成功",
icon: 'success'
});
this.closeAddList()
this.getQdList()
} else {
uni.showToast({
title: res.msg,
icon: 'nonde'
});
}
})
},
open(type) {
this.addType = type
this.$refs.popupcar.open('bottom');
},
close() {
this.$refs.popupcar.close('bottom');
},
openAddList() {
if (!uni.getStorageSync('token')) {
uni.navigateTo({
url: "/pages/auth/login?referer=" + encodeURIComponent(`/pages/goods/detail?goods_id=${this.goods_id_page}`)
})
return
}
import barX from '@/components/barx.vue'; this.$refs.popupaddlist.open('bottom');
export default { },
data() { closeAddList() {
return { this.$refs.popupaddlist.close('bottom');
isLogin:uni.getStorageSync('token')?true:false, },
goods_id_page:"", openNewList() {
buyPrice:"", this.closeAddList()
isCompany:(uni.getStorageSync('user_info')&&JSON.parse(uni.getStorageSync('user_info')).company_name)?true:false, this.$refs.popupnewlist.open('bottom');
productType: 1, },
pageTab: 1, closeNewList() {
productTop: 0, this.$refs.popupnewlist.close('bottom');
goBuyType: 1, },
images: [],
positions: "",
currentPage: 0,
goods_numberx: 1, //购买数量
goods_id: "",
goods_info: "",
goods_series:[],
addType: 1,
list_name:"",//清单名字
qDList:[],
miniShareOptions: {
title: '爱智工业平台',
path: '/pages/goods/detail?goods_id=',
imageUrl: 'https://img.ichunt.com/images/ichunt/202503/11/8bd43dcc1b28a3fd8c417ac0c6410406.png',
desc: ''
}
}
},
onShareAppMessage() {
return {
...this.miniShareOptions,
success: () => {
uni.showToast({
title: '分享成功',
icon: 'success'
});
},
fail: () => {
uni.showToast({
title: '分享失败',
icon: 'none'
});
}
};
},
onShareTimeline() {
return {
...this.miniShareOptions,
success: () => {
uni.showToast({
title: '分享成功',
icon: 'success'
});
},
fail: () => {
uni.showToast({
title: '分享失败',
icon: 'none'
});
}
};
},
onLoad(option) {
this.goods_id_page=option.goods_id
this.goods_id = option.goods_id
this.getData()
this.getQdList()
this.miniShareOptions.path='/pages/goods/detail?goods_id='+option.goods_id
},
onPageScroll(e) {
this.pageTab = 1
if (e.scrollTop >=300) {
this.pageTab = 2
}
},
methods: {
gocar(){
if(!uni.getStorageSync('token')){
uni.navigateTo({
url:"/pages/auth/login?referer="+encodeURIComponent(`/pages/goods/detail?goods_id=${this.goods_id_page}`)
})
return
}
let obj_={
sku_id: this.goods_id,
goods_num:this.goods_numberx,
price:this.buyPrice,
guid_:this.addType,
}
if(this.addType==2){
obj_.is_cover_goods_num=1
}
this.request(Api_Url + '/api/cart/addCart', 'GET', obj_, true).then(res => {
if (res.code == 0) {
if(this.addType==1){
uni.showToast({
title: "添加购物车成功",
icon: 'success'
});
this.close()
}else{
uni.setStorageSync('car_ids',this.goods_id);
uni.setStorageSync('confirmOrderBackUrl',`/pages/goods/detail?goods_id=${this.goods_id_page}`)
uni.navigateTo({
url:'/pages/car/confirmOrder'
});
}
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
changeNum(sku_id,type){
clearTimeout(this.timeout);
this.timeout = setTimeout(() => {
let result=this.goods_info
let mpl = Number(result.multiple||result.mpl);//倍数 加减的数量基数
let stock = Number(result.stock);//库存
let moq = Number(result.moq);//起订量
let value_ = Number(this.goods_numberx);//当前的数量
value_ = Math.ceil(value_ / mpl) * mpl;//失去焦点数量
this.goods_numberx = value_;//最终的数量
if (value_ < moq) {
this.goods_numberx = moq
}
if (value_ > stock) {
this.goods_numberx = Math.floor(stock / mpl) * mpl;
}
}, 800);
},
addjNum(sku_id,type){
let result=this.goods_info
let mpl = Number(result.multiple||result.mpl);//倍数 加减的数量基数
let stock = Number(result.stock);//库存
let moq = Number(result.moq);//起订量
let value_ = Number(this.goods_numberx);//当前的数量
if(type==1){
//减法
var down_value = value_ - mpl;//减过后的值
if (down_value < moq) {
this.goods_numberx = moq;
uni.showToast({
title: '数量不能小于起订量',
duration: 2000,
icon:"none"
})
} else {
this.goods_numberx=down_value
}
}else{
//加法
var up_value = value_ + mpl;//加过后的值
if (up_value > stock) {
uni.showToast({
title: '数量不能大于库存',
duration: 2000,
icon:"none"
})
this.goods_numberx = Math.floor(stock / mpl) * mpl;
} else {
this.goods_numberx = up_value
}
}
},
changeSku(sku_id){
this.goods_id=sku_id
this.getData(1)
},
pdfPre(){
uni.downloadFile({
url: this.goods_info.pdf,
success: function (res) {
uni.openDocument({
filePath: res.tempFilePath,
showMenu: true,
success: function (res) {
console.log('打开文档成功');
}
});
}
});
},
getData(type) {
this.request(Api_Url + '/api/xcx/goodsDetail', 'GET', {
goods_id: this.goods_id
}, true).then(res => {
if (res.code == 0) {
this.goods_info = res.data.goods_info
this.miniShareOptions.title=this.goods_info.goods_name+" "+this.goods_info.class_name
if(this.goods_info.sku_detail){
this.goods_info.sku_detail=this.goods_info.sku_detail.replace(/<img/gi, '<img class="img-style"')
}
this.goods_numberx=Number(this.goods_info.moq)
this.buyPrice=0;
if(this.goods_info.ladder_price&&this.goods_info.ladder_price.length>0){
this.buyPrice=this.isCompany?(this.goods_info['ladder_price'][1]['price_cn']||0):(this.goods_info['ladder_price'][0]['price_cn']||0)
}
if(!type){
this.goods_series=res.data.goods_series||[]
this.goods_series.sort((a, b) => {
if (a.goods_id == this.goods_id) return -1;
if (b.goods_id == this.goods_id) return 1;
return 0;
});
}
this.images =[{name:"default.png",thumbnail:res.data.goods_info.goods_images||""},...(res.data.goods_info.spu_extra.image_list || [])]
setTimeout(()=>{
this.calculatePositions();
},100)
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
calculatePositions() {
const query = uni.createSelectorQuery();
query.select('.product-box').boundingClientRect();
query.exec((rects) => {
if (rects[0]) {
this.productTop = rects[0].top;
}
});
},
tab(page) {
this.pageTab = page
uni.pageScrollTo({
scrollTop: page == 2 ? this.productTop - 140 : 0,
duration: 300
});
},
handleSwiperChange(e) {
this.currentPage = e.detail.current;
setTimeout(()=>{
this.calculatePositions();
},100)
},
getQdList(){
if(!uni.getStorageSync('token')){return}
this.request(Api_Url + '/api/xcx/getGoodsList', 'get', {page:1,limit:100}, false).then(res => {
this.qDList=[]
if(res.code==0){
let arr_=res.data.list||[]
arr_.forEach(item=>{
item.checked=false
})
this.qDList=arr_
}
})
},
chooseQd(list_id){
this.qDList.forEach(item=>{
if(item.list_id==list_id){
item.checked=!item.checked
}
})
},
createList(){
this.request(Api_Url + '/api/xcx/createGoodsList', 'post', {list_name:(this.list_name||this.goods_info.class_name)}, true).then(res => {
if(res.code==0){
uni.showToast({
title: "创建清单成功",
icon: 'success'
});
this.closeNewList()
this.getQdList()
}else{
uni.showToast({
title: res.msg,
icon: 'nonde'
});
}
})
},
addQdList(){
let checkList=this.qDList.filter(item=>item.checked)
let ids_=checkList.map(item=>item.list_id)
if(checkList.length==0){
uni.showToast({
title: "请选择一条清单",
icon: 'none'
});
return
}
let sku_json=[
{
sku_id:this.goods_id,
qty:this.goods_numberx
}
]
this.request(Api_Url + '/api/xcx/addGoodsList', 'post', {
list_id:ids_.join(","),
sku_json:JSON.stringify(sku_json)
}, true).then(res => {
if(res.code==0){
uni.showToast({
title: "加入清单成功",
icon: 'success'
});
this.closeAddList()
this.getQdList()
}else{
uni.showToast({
title: res.msg,
icon: 'nonde'
});
}
})
},
open(type) {
this.addType = type
this.$refs.popupcar.open('bottom');
},
close() {
this.$refs.popupcar.close('bottom');
},
openAddList() {
if(!uni.getStorageSync('token')){
uni.navigateTo({
url:"/pages/auth/login?referer="+encodeURIComponent(`/pages/goods/detail?goods_id=${this.goods_id_page}`)
})
return
}
this.$refs.popupaddlist.open('bottom');
},
closeAddList() {
this.$refs.popupaddlist.close('bottom');
},
openNewList() {
this.closeAddList()
this.$refs.popupnewlist.open('bottom');
},
closeNewList() {
this.$refs.popupnewlist.close('bottom');
},
}, },
components: { components: {
barX barX
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '../../assets/css/goods/detail.scss'; @import '../../assets/css/goods/detail.scss';
</style> </style>
\ No newline at end of file
<template> <template>
<view class="addressPage"> <view class="addressPage">
<barX /> <barX />
<titleNav title="收货地址" /> <titleNav title="收货地址" />
<view class="cons"> <view class="cons">
<view class="data-box"> <view class="data-box">
<view class="group " :class="{'hkk':item.checkedx}" v-for="(item,index) in list" :key="index" @click="setChoose(item.address_id)"> <view class="group " :class="{'hkk':item.checkedx}" v-for="(item,index) in list" :key="index" @click="setChoose(item.address_id)">
<view class="t row verCenter"> <view class="t row verCenter">
<text class="tet">{{item.nation_cn!="中国"?item.nation_cn:''}} {{item.province_val}} <text class="tet">{{item.nation_cn!="中国"?item.nation_cn:''}} {{item.province_val}}
{{item.city_val}} {{item.district_val}} {{item.consignee}}</text> {{item.city_val}} {{item.district_val}} {{item.consignee}}</text>
<text class="mr row verCenter rowCenter" v-if="item.is_default==1">默认</text> <text class="mr row verCenter rowCenter" v-if="item.is_default==1">默认</text>
</view> </view>
<view class="c">{{item.detail_address}}</view> <view class="c">{{item.detail_address}}</view>
<view class="b row bothSide"> <view class="b row bothSide">
<view class="l row verCenter" @click="setdefault(item.address_id)" v-if="!form"> <view class="l row verCenter" @click="setdefault(item.address_id)" v-if="!form">
<text class="icon iconfont icon-checked1" <text class="icon iconfont icon-checked1" :class="{'icon-checked':item.is_default==1}"></text>
:class="{'icon-checked':item.is_default==1}"></text> <text>{{item.is_default==1?"已默认":"设为默认"}}</text>
<text>{{item.is_default==1?"已默认":"设为默认"}}</text> </view>
</view> <view v-else></view>
<view v-else></view> <!-- <view class="l row verCenter" @click="setChoose(item.address_id)" v-else>
<!-- <view class="l row verCenter" @click="setChoose(item.address_id)" v-else>
<text class="icon iconfont icon-checked1" <text class="icon iconfont icon-checked1"
:class="{'icon-checked':item.checkedx==1}"></text> :class="{'icon-checked':item.checkedx==1}"></text>
<text>{{item.checkedx==1?"已选择":"选择"}}</text> <text>{{item.checkedx==1?"已选择":"选择"}}</text>
</view> --> </view> -->
<view class="r row verCenter">
<text @click.stop="deleteAdress(item.address_id)">删除</text>
<text @click.stop="copy(item)">复制</text>
<view @click.stop="goUpdate(item.address_id)">修改</view>
</view>
</view>
</view>
</view>
<view class="no-data" v-if="isInit&&list.length==0">
<image src="https://img.ichunt.com/images/ichunt/202502/07/676f987065320e89a68d473ec62c8cea.png" />
<view>暂无地址信息!</view>
</view>
</view>
<view class="foot">
<navigator url="/pages/user/addressAdd" class="btn">新增收货地址</navigator>
</view>
</view> <view class="r row verCenter">
<text @click.stop="deleteAdress(item.address_id)">删除</text>
<!-- <text @click.stop="copy(item)">复制</text> -->
<view @click.stop="goUpdate(item.address_id)">修改</view>
</view>
</view>
</view>
</view>
<view class="no-data" v-if="isInit&&list.length==0">
<image src="https://img.ichunt.com/images/ichunt/202502/07/676f987065320e89a68d473ec62c8cea.png" />
<view>暂无地址信息!</view>
</view>
</view>
<view class="foot">
<navigator url="/pages/user/addressAdd" class="btn">新增收货地址</navigator>
</view>
</view>
</template> </template>
<script> <script>
import { import {
Api_Url Api_Url
} from '@/util/api.js' } from '@/util/api.js'
import barX from '@/components/barx.vue'; import barX from '@/components/barx.vue';
import titleNav from '@/components/title_nav.vue'; import titleNav from '@/components/title_nav.vue';
export default { export default {
data() { data() {
return { return {
isInit: false, //记录是否加载了数据 isInit: false, //记录是否加载了数据
form:"", form: "",
address_id:"", address_id: "",
invoice_id:"", invoice_id: "",
coupon_id:"", coupon_id: "",
list: [], list: [],
} }
}, },
onLoad: function(options) { onLoad: function(options) {
this.form=options.form||"" this.form = options.form || ""
this.address_id=options.address_id||"" this.address_id = options.address_id || ""
this.invoice_id=options.invoice_id||"" this.invoice_id = options.invoice_id || ""
this.coupon_id=options.coupon_id||"" this.coupon_id = options.coupon_id || ""
}, },
onShow() { onShow() {
this.getData(); this.getData();
}, },
methods: { methods: {
goUpdate(address_id){ goUpdate(address_id) {
uni.navigateTo({ uni.navigateTo({
url:'/pages/user/addressEdit?address_id=' + address_id url: '/pages/user/addressEdit?address_id=' + address_id
}) })
}, },
setChoose(address_id){ setChoose(address_id) {
if(!this.form){return} if (!this.form) { return }
let address_id_go="" let address_id_go = ""
this.list.forEach(item=>{ this.list.forEach(item => {
item.checkedx=false item.checkedx = false
if(address_id==item.address_id){ if (address_id == item.address_id) {
item.checkedx=true item.checkedx = true
address_id_go=item.address_id address_id_go = item.address_id
} }
}) })
setTimeout(()=>{ setTimeout(() => {
if(this.form=="confirmQuote"){ if (this.form == "confirmQuote") {
//报价过来 //报价过来
uni.navigateTo({ uni.navigateTo({
url: '/pages/car/confirmQuote?address_id='+address_id_go+'&coupon_id='+this.coupon_id url: '/pages/car/confirmQuote?address_id=' + address_id_go + '&coupon_id=' + this.coupon_id
}); });
return return
} }
uni.navigateTo({ uni.navigateTo({
url: '/pages/car/confirmOrder?address_id='+address_id_go+'&coupon_id='+this.coupon_id+'&invoice_id='+this.invoice_id url: '/pages/car/confirmOrder?address_id=' + address_id_go + '&coupon_id=' + this.coupon_id + '&invoice_id=' + this.invoice_id
}); });
},200); }, 200);
}, },
copy(item){ copy(item) {
uni.setClipboardData({ uni.setClipboardData({
data: (item.nation_cn!="中国"?item.nation_cn:'')+item.province_val+' '+item.city_val+' '+item.district_val+' '+item.detail_address, data: (item.nation_cn != "中国" ? item.nation_cn : '') + item.province_val + ' ' + item.city_val + ' ' + item.district_val + ' ' + item.detail_address,
success: function () { success: function() {
uni.showToast({ uni.showToast({
title: '复制成功', title: '复制成功',
icon: 'success' icon: 'success'
}); });
} }
}); });
}, },
deleteAdress(address_id) { deleteAdress(address_id) {
uni.showModal({ uni.showModal({
title: '', title: '',
content: '您确定删除该地址嘛', content: '您确定删除该地址嘛',
success: res => { success: res => {
if (res.confirm) { if (res.confirm) {
this.request(Api_Url + '/api/address/del', 'POST', { this.request(Api_Url + '/api/address/del', 'POST', {
address_id: address_id address_id: address_id
}, true).then(res => { }, true).then(res => {
if (res.code === 0) { if (res.code === 0) {
uni.showToast({ uni.showToast({
title: '删除成功', title: '删除成功',
icon: 'success' icon: 'success'
}); });
this.getData(1); this.getData(1);
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none' icon: 'none'
}); });
} }
}); });
} }
} }
}); });
}, },
setdefault(address_id) { setdefault(address_id) {
this.request(Api_Url + '/api/address/default', 'POST', { this.request(Api_Url + '/api/address/default', 'POST', {
address_id: address_id address_id: address_id
}, true).then(res => { }, true).then(res => {
if (res.code === 0) { if (res.code === 0) {
uni.showToast({ uni.showToast({
title: '设置成功', title: '设置成功',
icon: 'success' icon: 'success'
}); });
this.getData(1); this.getData(1);
} else { } else {
uni.showToast({ uni.showToast({
title: res.err_msg, title: res.err_msg,
icon: 'none' icon: 'none'
}); });
} }
}); });
}, },
getData(loading) { getData(loading) {
let obj_ = { let obj_ = {
p: 1 p: 1
} }
this.request(Api_Url + '/api/address/getList', 'GET', obj_, (loading?false:true)).then(res => { this.request(Api_Url + '/api/address/getList', 'GET', obj_, (loading ? false : true)).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.isInit = 1; this.isInit = 1;
let arr_ = res.data.list || [] let arr_ = res.data.list || []
arr_.forEach(item=>{ arr_.forEach(item => {
item.checkedx=false item.checkedx = false
if(item.address_id==this.address_id){ if (item.address_id == this.address_id) {
item.checkedx=true item.checkedx = true
} }
}) })
this.list = arr_ this.list = arr_
} else { } else {
this.isInit = 1; this.isInit = 1;
this.list = [] this.list = []
} }
}); });
}, },
}, },
components: { components: {
barX, barX,
titleNav titleNav
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '../../assets/css/user/address.scss'; @import '../../assets/css/user/address.scss';
</style> </style>
\ No newline at end of file
<template> <template>
<view class="addressAddPage"> <view class="addressAddPage">
<barX /> <barX />
<titleNav title="新增收货地址" /> <titleNav title="新增收货地址" />
<view class="cons"> <view class="cons">
<view class="input-box"> <view class="input-box">
<view class="input-group row verCenter"> <view class="input-group row verCenter">
<text class="label">收货人</text> <text class="label">收货人</text>
<input type="text" placeholder="请输入收货人" v-model="formParams.consignee" placeholder-class="placeholder-class" /> <input type="text" placeholder="请输入收货人" v-model="formParams.consignee" placeholder-class="placeholder-class" />
</view> </view>
<view class="input-group row verCenter"> <view class="input-group row verCenter">
<text class="label">手机号</text> <text class="label">手机号</text>
<picker @change="bindPickerChange($event)" :value="areaIndex" :range="areaArray" <picker @change="bindPickerChange($event)" :value="areaIndex" :range="areaArray" :range-key="'name'">
:range-key="'name'"> <view class="areabox-but ">
<text class="areabox-but "><text class="but-val">{{areaArray[areaIndex].value}}</text><text <text class="but-val">{{areaArray[areaIndex].value}}</text>
class="icon iconfont icon-arrowxia"></text></text> <text class="icon iconfont icon-arrowxia"></text>
</picker> </view>
</picker>
<input type="number" v-model="formParams.mobile" placeholder="请输入手机号" placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter">
<text class="label">收货地区</text>
<picker mode="multiSelector" @change="pickerChange" @columnchange="bindMultiPickerColumnChange" :value="multiIndex" :range="multiArray" :range-key="'name'">
<view class="uni-input" :class="{'color666':selectText=='请选择省市区'}">{{ selectText }}</view>
</picker>
</view>
<view class="input-group row verCenter">
<text class="label">详细地址</text>
<input type="text" v-model="formParams.detail_address" placeholder="请输入详细地址" placeholder-class="placeholder-class" />
</view>
<input type="number" v-model="formParams.mobile" placeholder="请输入手机号" placeholder-class="placeholder-class" /> </view>
</view> <view class="setting-default row verCenter bothSide">
<view class="input-group row verCenter"> <view class="tt">
<text class="label">收货地区</text> <view>设为默认地址</view>
<picker mode="multiSelector" @change="pickerChange" @columnchange="bindMultiPickerColumnChange" :value="multiIndex" :range="multiArray" :range-key="'name'"> 下单时会优先使用该地址
<view class="uni-input" :class="{'color666':selectText=='请选择省市区'}">{{ selectText }}</view> </view>
</picker> <view>
</view> <switch @change="onSwitchChange" color="#D0121B" style="transform:scale(0.8)" />
<view class="input-group row verCenter"> </view>
<text class="label">详细地址</text> </view>
<input type="text" v-model="formParams.detail_address" placeholder="请输入详细地址" placeholder-class="placeholder-class" /> </view>
</view> <view class="foot">
<view class="btn" @click="create">确认</view>
</view>
</view> </view>
<view class="setting-default row verCenter bothSide">
<view class="tt">
<view>设为默认地址</view>
下单时会优先使用该地址
</view>
<view>
<switch @change="onSwitchChange" color="#D0121B" style="transform:scale(0.8)" />
</view>
</view>
</view>
<view class="foot">
<view class="btn" @click="create">确认</view>
</view>
</view>
</template> </template>
<script> <script>
import { import {
Api_Url Api_Url
} from '@/util/api.js' } from '@/util/api.js'
import barX from '@/components/barx.vue'; import barX from '@/components/barx.vue';
import titleNav from '@/components/title_nav.vue'; import titleNav from '@/components/title_nav.vue';
export default { export default {
data() { data() {
return { return {
multiArray: [ multiArray: [
[], [],
[], [],
[] []
], ],
multiIndex: [0, 0, 0], multiIndex: [0, 0, 0],
selectText: '请选择省市区', selectText: '请选择省市区',
formParams: { formParams: {
consignee: '', consignee: '',
province_id: '', province_id: '',
city_id: '', city_id: '',
district_id: '', district_id: '',
detail_address: '', detail_address: '',
is_default: 1, is_default: 1,
mobile: '', mobile: '',
intl_code: '0086', intl_code: '0086',
}, },
areaIndex: 0, areaIndex: 0,
areaArray: [{ areaArray: [{
name: "0086(中国大陆)", name: "0086(中国大陆)",
value: '0086' value: '0086'
}, }
{ // {
name: "00852(中国香港)", // name: "00852(中国香港)",
value: '00852' // value: '00852'
}, // },
{ // {
name: "00853(中国澳门)", // name: "00853(中国澳门)",
value: '00853' // value: '00853'
}, // },
{ // {
name: "00886(中国台湾)", // name: "00886(中国台湾)",
value: '00886' // value: '00886'
}, // },
{ // {
name: "0066(泰国)", // name: "0066(泰国)",
value: '0066' // value: '0066'
}, // },
{ // {
name: "0084(越南)", // name: "0084(越南)",
value: '0084' // value: '0084'
} // }
], ],
} }
}, },
onLoad: function() { onLoad: function() {
}, },
onShow() { onShow() {
this.getProvince(); this.getProvince();
}, },
methods: { methods: {
bindPickerChange: function(e, type) { bindPickerChange: function(e, type) {
this.areaIndex = e.detail.value this.areaIndex = e.detail.value
this.formParams.intl_code = this.areaArray[e.detail.value].value this.formParams.intl_code = this.areaArray[e.detail.value].value
}, },
onSwitchChange(e) { onSwitchChange(e) {
this.formParams.is_default = e.detail.value ? 1 : 0; this.formParams.is_default = e.detail.value ? 1 : 0;
}, },
/** /**
* 省市区联动监听 * 省市区联动监听
* @param {Object} e * @param {Object} e
*/ */
bindMultiPickerColumnChange(e) { bindMultiPickerColumnChange(e) {
console.log(e.detail); console.log(e.detail);
if (e.detail.column === 0) { if (e.detail.column === 0) {
// 第一列滑动 // 第一列滑动
this.multiIndex[0] = e.detail.value; this.multiIndex[0] = e.detail.value;
this.getCity(this.multiArray[0][e.detail.value].value, true); this.getCity(this.multiArray[0][e.detail.value].value, true);
// 第一列滑动之后 第二列 和第三列 都变为第一个 // 第一列滑动之后 第二列 和第三列 都变为第一个
this.multiIndex.splice(1, 1, 0); this.multiIndex.splice(1, 1, 0);
this.multiIndex.splice(2, 1, 0); this.multiIndex.splice(2, 1, 0);
} else if (e.detail.column === 1) { } else if (e.detail.column === 1) {
// 第二列滑动 // 第二列滑动
this.multiIndex[1] = e.detail.value; this.multiIndex[1] = e.detail.value;
this.getDistrict(this.multiArray[1][e.detail.value].value); this.getDistrict(this.multiArray[1][e.detail.value].value);
// 第二列滑动之后 第三列 变成第一个 // 第二列滑动之后 第三列 变成第一个
this.multiIndex.splice(2, 1, 0); this.multiIndex.splice(2, 1, 0);
} else if (e.detail.column === 2) { } else if (e.detail.column === 2) {
// 第三列滑动 // 第三列滑动
this.multiIndex[2] = e.detail.value; this.multiIndex[2] = e.detail.value;
} }
this.$forceUpdate(); this.$forceUpdate();
}, },
/** /**
* 省市区选择确定 * 省市区选择确定
* @param {Object} e * @param {Object} e
*/ */
pickerChange(e) { pickerChange(e) {
this.multiIndex = e.detail.value; this.multiIndex = e.detail.value;
this.formParams.province_id = this.multiArray[0][this.multiIndex[0]].value; this.formParams.province_id = this.multiArray[0][this.multiIndex[0]].value;
this.formParams.city_id = this.multiArray[1][this.multiIndex[1]].value; this.formParams.city_id = this.multiArray[1][this.multiIndex[1]].value;
this.formParams.district_id = this.multiArray[2][this.multiIndex[2]].value; this.formParams.district_id = this.multiArray[2][this.multiIndex[2]].value;
this.selectText = this.selectText =
`${this.multiArray[0][this.multiIndex[0]].name + ',' + this.multiArray[1][this.multiIndex[1]].name + ',' + this.multiArray[2][this.multiIndex[2]].name}`; `${this.multiArray[0][this.multiIndex[0]].name + ',' + this.multiArray[1][this.multiIndex[1]].name + ',' + this.multiArray[2][this.multiIndex[2]].name}`;
}, },
/** /**
* 获取省数据 * 获取省数据
*/ */
getProvince(id = 1) { getProvince(id = 1) {
console.log('获取省数据id:' + id); console.log('获取省数据id:' + id);
this.request(Api_Url + '/api/address/getOptions', 'GET', { this.request(Api_Url + '/api/address/getOptions', 'GET', {
id: id id: id
}, false, true).then(res => { }, false, true).then(res => {
if (res.code === 0) { if (res.code === 0) {
var arr = []; var arr = [];
for (var key in res.data) { for (var key in res.data) {
arr.push({ arr.push({
name: res.data[key], name: res.data[key],
value: parseInt(key) value: parseInt(key)
}); });
} }
this.multiArray[0] = arr; this.multiArray[0] = arr;
this.getCity(2, true); this.getCity(2, true);
this.$forceUpdate(); this.$forceUpdate();
} }
}); });
}, },
/** /**
* @param {Object} id * @param {Object} id
* @param {Object} default * @param {Object} default
*/ */
getCity(id, defaultParms) { getCity(id, defaultParms) {
console.log('获取市数据id:' + id); console.log('获取市数据id:' + id);
this.request(Api_Url + '/api/address/getOptions', 'GET', { this.request(Api_Url + '/api/address/getOptions', 'GET', {
id: id id: id
}, false, true).then(res => { }, false, true).then(res => {
if (res.code === 0) { if (res.code === 0) {
var arr = []; var arr = [];
for (var key in res.data) { for (var key in res.data) {
arr.push({ arr.push({
name: res.data[key], name: res.data[key],
value: parseInt(key) value: parseInt(key)
}); });
} }
this.multiArray[1] = arr; this.multiArray[1] = arr;
if (defaultParms) { if (defaultParms) {
this.getDistrict(arr[0].value); this.getDistrict(arr[0].value);
} }
this.$forceUpdate(); this.$forceUpdate();
} }
}); });
}, },
/** /**
* 获取区数据 * 获取区数据
* @param {Object} id * @param {Object} id
*/ */
getDistrict(id) { getDistrict(id) {
console.log('获取区数据id:' + id); console.log('获取区数据id:' + id);
this.request(Api_Url + '/api/address/getOptions', 'GET', { this.request(Api_Url + '/api/address/getOptions', 'GET', {
id: id id: id
}, false, true).then(res => { }, false, true).then(res => {
if (res.code === 0) { if (res.code === 0) {
var arr = []; var arr = [];
for (var key in res.data) { for (var key in res.data) {
arr.push({ arr.push({
name: res.data[key], name: res.data[key],
value: parseInt(key) value: parseInt(key)
}); });
} }
this.multiArray[2] = arr; this.multiArray[2] = arr;
this.$forceUpdate(); this.$forceUpdate();
} }
}); });
}, },
/** /**
* 保存地址 * 保存地址
*/ */
create() { create() {
if (!this.formParams.consignee) { if (!this.formParams.consignee) {
uni.showToast({ uni.showToast({
title: '请输入收货人', title: '请输入收货人',
icon: 'none' icon: 'none'
}); });
return false; return false;
} }
let reg = /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/; let reg = /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/;
if ((!this.formParams.mobile) || ((this.formParams.intl_code=="0086")&&!reg.test(this.formParams.mobile))) { if ((!this.formParams.mobile) || ((this.formParams.intl_code == "0086") && !reg.test(this.formParams.mobile))) {
uni.showToast({ uni.showToast({
title: '请输入正确的手机号', title: '请输入正确的手机号',
icon: 'none' icon: 'none'
}); });
return false; return false;
} }
if (!this.formParams.province_id) { if (!this.formParams.province_id) {
uni.showToast({ uni.showToast({
title: '请选择省市区', title: '请选择省市区',
icon: 'none' icon: 'none'
}); });
return false; return false;
} }
if (!this.formParams.detail_address) { if (!this.formParams.detail_address) {
uni.showToast({ uni.showToast({
title: '请输入详细街道地址', title: '请输入详细街道地址',
icon: 'none' icon: 'none'
}); });
return false; return false;
} }
this.request(Api_Url + '/api/address/add', 'POST', this.formParams, true).then(res => { this.request(Api_Url + '/api/address/add', 'POST', this.formParams, true).then(res => {
if (res.code === 0) { if (res.code === 0) {
uni.showToast({ uni.showToast({
title: '新增地址成功', title: '新增地址成功',
icon: 'success' icon: 'success'
}); });
setTimeout(() => { setTimeout(() => {
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}); });
}, 2000); }, 2000);
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none' icon: 'none'
}); });
} }
}); });
} }
}, },
components: { components: {
barX, barX,
titleNav titleNav
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '../../assets/css/user/addressAdd.scss'; @import '../../assets/css/user/addressAdd.scss';
</style> </style>
\ No newline at end of file
<template> <template>
<view class="companyInfoPage"> <view class="companyInfoPage">
<barX /> <barX />
<titleNav title="资料管理" /> <titleNav title="资料管理" />
<view class="cons">
<view class="input-box">
<view class="input-group row verCenter" >
<text class="label required">公司名称</text>
<input type="text" v-model="formParams.com_name" placeholder="请输入公司名称" placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter" >
<text class="label required ">公司税号</text>
<input type="text" v-model="formParams.tax_no" placeholder="系统自动查询后补充" placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter" >
<text class="label required">公司电话</text>
<input type="text" v-model="formParams.com_tel" placeholder="系统自动查询后补充" placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter" >
<text class="label required">注册地址</text>
<input type="text" v-model="formParams.com_addr" placeholder="系统自动查询后补充" placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter">
<text class="label required" >联系人</text>
<input type="text" v-model="formParams.contact_person" placeholder="请输入联系人" placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter">
<text class="label required" >联系电话</text>
<input type="text" v-model="formParams.contact_phone" placeholder="请输入联系电话" placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter">
<text class="label required">邮箱</text>
<input type="text" v-model="formParams.email" placeholder="请输入邮箱" placeholder-class="placeholder-class" />
</view>
</view>
</view>
<view class="foot">
<view class="btn" @click="submitI()">{{id?'编辑':'新增'}}企业资料</view>
</view>
</view> <view class="cons">
<view class="input-box">
<view class="input-group row verCenter">
<text class="label required">公司名称</text>
<input type="text" v-model="formParams.com_name" placeholder="请输入公司名称" placeholder-class="placeholder-class" @blur="tianyancha()" />
</view>
<view class="input-group row verCenter">
<text class="label required ">公司税号</text>
<input type="text" v-model="formParams.tax_no" placeholder="系统自动查询后补充" placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter">
<text class="label required">公司电话</text>
<input type="text" v-model="formParams.com_tel" placeholder="系统自动查询后补充" placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter">
<text class="label required">注册地址</text>
<input type="text" v-model="formParams.com_addr" placeholder="系统自动查询后补充" placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter">
<text class="label required">联系人</text>
<input type="text" v-model="formParams.contact_person" placeholder="请输入联系人" placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter">
<text class="label required">联系电话</text>
<input type="text" v-model="formParams.contact_phone" placeholder="请输入联系电话" placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter">
<text class="label required">邮箱</text>
<input type="text" v-model="formParams.email" placeholder="请输入邮箱" placeholder-class="placeholder-class" />
</view>
</view>
</view>
<view class="foot">
<view class="btn" @click="submitI()">{{id?'编辑':'新增'}}企业资料</view>
</view>
</view>
</template> </template>
<script> <script>
import { import {
Api_Url Api_Url
} from '@/util/api.js' } from '@/util/api.js'
import barX from '@/components/barx.vue'; import barX from '@/components/barx.vue';
import titleNav from '@/components/title_nav.vue'; import titleNav from '@/components/title_nav.vue';
export default { export default {
data() { data() {
return { return {
id:"", id: "",
formParams:{ formParams: {
com_name: "", com_name: "",
tax_no:"" , tax_no: "",
com_tel: "", com_tel: "",
com_addr: "", com_addr: "",
contact_person:"", contact_person: "",
contact_phone:"", contact_phone: "",
email:"" email: ""
}, },
certification:[] certification: []
} }
}, },
onLoad: function(options) { onLoad: function(options) {
this.id=options.id||"" this.id = options.id || ""
if(this.id){ if (this.id) {
this.getData() this.getData()
} }
}, },
onShow() { onShow() {
}, },
methods: { methods: {
getData(){ getData() {
//获取用户信息 //获取用户信息
this.request(Api_Url + '/api/user/info', 'GET', {}, true).then(res => { this.request(Api_Url + '/api/user/info', 'GET', {}, true).then(res => {
if (res.code == 0) { if (res.code == 0) {
let arr_=res.data.certification||[] let arr_ = res.data.certification || []
this.certification=arr_.filter(item=>item.id==this.id) this.certification = arr_.filter(item => item.id == this.id)
this.formParams={ this.formParams = {
...this.certification[0] ...this.certification[0]
} }
} }
}); });
}, },
changeTab(inv_type){ /**
this.formParams.inv_type=inv_type * 天眼查
console.log(this.formParams.inv_type) */
}, tianyancha() {
onSwitchChange(e) { if (!this.formParams.com_name) { return }
this.formParams.is_default = e.detail.value ? 1 : 0; this.request(Api_Url + '/api/user/tianyancha', 'GET', { company_name: this.formParams.com_name }, false).then(res => {
}, if (res.code == 0) {
submitI(){ if (!res.data.com_name) {
uni.showToast({
title: '天眼查没有查到该公司信息',
if(!this.formParams.com_name){ icon: 'none'
uni.showToast({ });
title: '公司名称不能为空', }
icon: 'none' this.formParams.com_name = res.data.com_name;
}); this.formParams.tax_no = res.data.tax_number;
return; this.formParams.com_tel = res.data.phone_number;
} this.formParams.com_addr = res.data.com_address;
if(!this.formParams.tax_no){ } else {
uni.showToast({ uni.showToast({
title: '公司税号不能为空', title: res.msg,
icon: 'none' icon: 'none'
}); });
return; }
} });
if(!this.formParams.com_tel){ },
uni.showToast({ changeTab(inv_type) {
title: '公司电话不能为空', this.formParams.inv_type = inv_type
icon: 'none' console.log(this.formParams.inv_type)
}); },
return; onSwitchChange(e) {
} this.formParams.is_default = e.detail.value ? 1 : 0;
if(!this.formParams.com_addr){ },
uni.showToast({ submitI() {
title: '注册地址不能为空',
icon: 'none'
}); if (!this.formParams.com_name) {
return; uni.showToast({
} title: '公司名称不能为空',
if(!this.formParams.contact_person){ icon: 'none'
uni.showToast({ });
title: '联系人不能为空', return;
icon: 'none' }
}); if (!this.formParams.tax_no) {
return; uni.showToast({
} title: '公司税号不能为空',
if(!this.formParams.contact_phone){ icon: 'none'
uni.showToast({ });
title: '联系电话不能为空', return;
icon: 'none' }
}); if (!this.formParams.com_tel) {
return; uni.showToast({
} title: '公司电话不能为空',
if(!this.formParams.email){ icon: 'none'
uni.showToast({ });
title: '邮箱不能为空', return;
icon: 'none' }
}); if (!this.formParams.com_addr) {
return; uni.showToast({
} title: '注册地址不能为空',
let url='/api/com/add' icon: 'none'
if(this.id){ });
this.formParams.id=this.id return;
url='/api/com/edit' }
} if (!this.formParams.contact_person) {
this.request(Api_Url + url, 'POST', this.formParams, true).then(res => { uni.showToast({
if (res.code == 0) { title: '联系人不能为空',
uni.showToast({ icon: 'none'
title: this.id?'编辑成功':'新增成功', });
icon: 'success' return;
}); }
setTimeout(() => { if (!this.formParams.contact_phone) {
uni.navigateBack({ uni.showToast({
delta: 1 title: '联系电话不能为空',
}); icon: 'none'
}, 2000); });
} else { return;
uni.showToast({ }
title: res.msg, if (!this.formParams.email) {
icon: 'none' uni.showToast({
}); title: '邮箱不能为空',
} icon: 'none'
}); });
return;
}, }
}, let url = '/api/com/add'
components: { if (this.id) {
barX, this.formParams.id = this.id
titleNav url = '/api/com/edit'
} }
} this.request(Api_Url + url, 'POST', this.formParams, true).then(res => {
if (res.code == 0) {
uni.showToast({
title: this.id ? '编辑成功' : '新增成功',
icon: 'success'
});
setTimeout(() => {
uni.navigateBack({
delta: 1
});
}, 2000);
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
},
},
components: {
barX,
titleNav
}
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '../../assets/css/user/companyInfo.scss'; @import '../../assets/css/user/companyInfo.scss';
</style> </style>
\ No newline at end of file
let _env = "" let _env = ""
let api_url="" let api_url = ""
if (process.env.UNI_PLATFORM === 'h5') { // 判断是否为 H5 平台 if (process.env.UNI_PLATFORM === 'h5') { // 判断是否为 H5 平台
if (process.env.NODE_ENV === 'production') { // H5 生产环境 if (process.env.NODE_ENV === 'production') { // H5 生产环境
_env = 'release' _env = 'release'
} else { } else {
_env = 'develop' _env = 'develop'
} }
api_url = _env == 'release' ? 'https://www.iedge.net' : '' api_url = _env == 'release' ? 'https://www.iedge.net' : ''
console.log(api_url,_env) console.log(api_url, _env)
} else if (process.env.UNI_PLATFORM === 'mp-weixin') { // 判断是否为微信小程序平台 } else if (process.env.UNI_PLATFORM === 'mp-weixin') { // 判断是否为微信小程序平台
_env = uni.getAccountInfoSync().miniProgram.envVersion //develop: trial: release: _env = uni.getAccountInfoSync().miniProgram.envVersion //develop: trial: release:
// if (_env != 'develop') { // if (_env != 'develop') {
// _env = 'release' // _env = 'release'
// } // }
api_url = _env == 'release' ? 'https://www.iedge.net' : 'http://iedge.liexindev.net' api_url = _env == 'release' ? 'https://www.iedge.net' : 'http://iedge.liexindev.net'
//api_url ='https://www.iedge.net' //api_url = 'https://www.iedge.net'
console.log(api_url,_env) console.log(api_url, _env)
} else { // 其他平台(如 App 等) } else { // 其他平台(如 App 等)
} }
export const Api_Url=api_url export const Api_Url = api_url
\ No newline at end of file
export default { export default {
data() { data() {
return { return {
miniShareOptions: { miniShareOptions: {
title: '爱智工业平台', title: '爱智工业平台',
path: '/pages/index/index', path: '/pages/index/index',
imageUrl: 'https://img.ichunt.com/images/ichunt/202503/11/8bd43dcc1b28a3fd8c417ac0c6410406.png', imageUrl: 'https://img.ichunt.com/images/ichunt/202503/19/cdaebc710d636541b8d9916210b46a49.png',
desc: '' desc: ''
} }
}; };
}, },
onShareAppMessage() { onShareAppMessage() {
return { return {
...this.miniShareOptions, ...this.miniShareOptions,
success: () => { success: () => {
uni.showToast({ title: '分享成功', icon: 'success' }); uni.showToast({ title: '分享成功', icon: 'success' });
}, },
fail: () => { fail: () => {
uni.showToast({ title: '分享失败', icon: 'none' }); uni.showToast({ title: '分享失败', icon: 'none' });
} }
}; };
}, },
onShareTimeline() { onShareTimeline() {
return { return {
title: '爱智工业平台', title: '爱智工业平台',
path: '/pages/index/index', path: '/pages/index/index',
imageUrl: 'https://img.ichunt.com/images/ichunt/202503/11/8bd43dcc1b28a3fd8c417ac0c6410406.png', imageUrl: 'https://img.ichunt.com/images/ichunt/202503/19/cdaebc710d636541b8d9916210b46a49.png',
success: () => { success: () => {
uni.showToast({ title: '分享成功', icon: 'success' }); uni.showToast({ title: '分享成功', icon: 'success' });
}, },
fail: () => { fail: () => {
uni.showToast({ title: '分享失败', icon: 'none' }); uni.showToast({ title: '分享失败', icon: 'none' });
} }
}; };
} }
}; };
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment