Commit 13fca3da by LJM

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

parent 3613d455
.confirmQuotePage{
background: #f8f8f8;
padding-top:75rpx;
padding-bottom: 175rpx;
.cons{
width:700rpx;
margin:0 auto;
.top-box{
background: #fff;
padding:30rpx 22rpx;
border-radius: 20rpx;
padding-top:15rpx;
.tit{
font-size: 26rpx;
color: #000000;
height:92rpx;
line-height: 92rpx;
border-bottom: 1rpx solid #E7E7E7;
}
.address-box{
display: block;
padding-top: 10rpx;
.addbx{
.iconfont{
font-size: 16rpx;
color:#898989;
}
.ad{height:62rpx;}
.csq{
font-size: 26rpx;
color: #000000;
}
.ad1{
font-size: 30rpx;
color: #000000;
height:35rpx;
line-height: 35rpx;
font-weight: bold;
margin-top:4rpx;
}
.cnnk{
font-size: 24rpx;
color: #666666;
line-height: 40rpx;
height:40rpx;
margin-top:8rpx;
text{margin-right:20rpx;}
}
.mr{
width: 70rpx;
height: 35rpx;
background: #FFF5F5;
border-radius: 5rpx;
border: 1rpx solid #D0121B;
text-align: center;
line-height: 35rpx;
font-size: 24rpx;
color: #D0121B;
margin-left:20rpx;
}
}
}
}
.goods-box{
margin-top:25rpx;
background: #fff;
padding:30rpx 23rpx;
padding-top:0rpx;
border-radius: 20rpx;
image{width:190rpx;height:190rpx;margin-right: 29rpx;border: 2rpx solid #F6F6F6;border-radius: 5rpx;}
.group{
padding-bottom: 38rpx;
padding-top:30rpx;
border-bottom: 1rpx solid #E7E7E7;
.ganme{
font-size: 26rpx;
color: #000000;
line-height: 45rpx;
height:90rpx;
width:440rpx;
}
.hqs{
font-size: 26rpx;
color: #666666;
height:40rpx;
line-height: 40rpx;
margin-top:20rpx;
}
.price{
font-size: 30rpx;
color: #000000;
line-height: 40rpx;
height:40rpx;
line-height: 40rpx;
margin-top:10rpx;
}
}
}
.coupo-box{
border-radius: 20rpx;
margin-top:25rpx;
height:62rpx;
font-size: 26rpx;
color: #000000;
line-height: 62rpx;
.r{
font-size: 26rpx;
color: #D0121B;
height:62rpx;
.icon{
font-size: 16rpx;
color:#D0121B;
margin-left:25rpx;
position: relative;
top:-3rpx;
}
.not{
color: #999999;
.icon{
color:#898989;
}
}
}
}
.pur-sn-box{
background: #fff;
margin-top:25rpx;
padding:20rpx;
padding-bottom:32rpx;
border-radius: 20rpx;
.tit{
font-size: 26rpx;
color: #000000;
line-height: 62rpx;
height:62rpx;
}
.pur-sn-val{
height: 80rpx;
background: #F8F8F8;
line-height: 80rpx;
border-radius: 5rpx;
border: 1rpx solid #E7E7E7;
font-size: 26rpx;
color: #000000;
padding:0 20rpx;
&:hover{
border: 1rpx solid #D0121B;
}
&.placeholder-class{
color: #808080;
font-size: 26rpx;
}
}
}
.price-infos{
padding:30rpx 20rpx;
background: #fff;
margin-top:25rpx;
border-radius: 20rpx;
.item{
font-size: 26rpx;
color: #000000;
line-height: 62rpx;
height:62rpx;
}
.top{border-bottom:1rpx solid #E7E7E7;padding-bottom:20rpx;}
.bottom{
padding-top:25rpx;
.price-pay{
color:#D0121B;
}
}
}
.rules{
height:86rpx;
.icon{
font-size: 30rpx;
color:#e5e5e5;
}
.icon-checked{
color:#D0121B;
}
.tklink{
font-size: 24rpx;
color: #000000;
margin-left: 16rpx;
}
}
}
.foot{
height:175rpx;
width:100%;
position: fixed;
left:0rpx;
right:0rpx;
bottom:0rpx;
z-index: 2;
background: #fff;
padding-left:40rpx;
padding-right:25rpx;
border-top:1rpx solid #E7E7E7;
.l{
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;
}
}
.confirmQuotePage {
background: #f8f8f8;
padding-top: 75rpx;
padding-bottom: 175rpx;
.cons {
width: 700rpx;
margin: 0 auto;
.top-box {
background: #fff;
padding: 30rpx 22rpx;
border-radius: 20rpx;
padding-top: 15rpx;
.tit {
font-size: 26rpx;
color: #000000;
height: 92rpx;
line-height: 92rpx;
border-bottom: 1rpx solid #e7e7e7;
&:last-child {
border-bottom: none;
}
}
.address-box {
display: block;
padding-top: 10rpx;
.addbx {
.iconfont {
font-size: 16rpx;
color: #898989;
}
.ad {
height: 62rpx;
}
.csq {
font-size: 26rpx;
color: #000000;
}
.ad1 {
font-size: 30rpx;
color: #000000;
height: 35rpx;
line-height: 35rpx;
font-weight: bold;
margin-top: 4rpx;
}
.cnnk {
font-size: 24rpx;
color: #666666;
line-height: 40rpx;
height: 40rpx;
margin-top: 8rpx;
text {
margin-right: 20rpx;
}
}
.mr {
width: 70rpx;
height: 35rpx;
background: #fff5f5;
border-radius: 5rpx;
border: 1rpx solid #d0121b;
text-align: center;
line-height: 35rpx;
font-size: 24rpx;
color: #d0121b;
margin-left: 20rpx;
}
}
}
}
.goods-box {
margin-top: 25rpx;
background: #fff;
padding: 30rpx 23rpx;
padding-top: 0rpx;
border-radius: 20rpx;
image {
width: 190rpx;
height: 190rpx;
margin-right: 29rpx;
border: 2rpx solid #f6f6f6;
border-radius: 5rpx;
}
.group {
padding-bottom: 38rpx;
padding-top: 30rpx;
border-bottom: 1rpx solid #e7e7e7;
.ganme {
font-size: 26rpx;
color: #000000;
line-height: 45rpx;
height: 90rpx;
width: 440rpx;
}
.hqs {
font-size: 26rpx;
color: #666666;
height: 40rpx;
line-height: 40rpx;
margin-top: 20rpx;
}
.price {
font-size: 30rpx;
color: #000000;
line-height: 40rpx;
height: 40rpx;
line-height: 40rpx;
margin-top: 10rpx;
}
}
}
.coupo-box {
border-radius: 20rpx;
margin-top: 25rpx;
height: 62rpx;
font-size: 26rpx;
color: #000000;
line-height: 62rpx;
.r {
font-size: 26rpx;
color: #d0121b;
height: 62rpx;
.icon {
font-size: 16rpx;
color: #d0121b;
margin-left: 25rpx;
position: relative;
top: -3rpx;
}
.not {
color: #999999;
.icon {
color: #898989;
}
}
}
}
.pur-sn-box {
background: #fff;
margin-top: 25rpx;
padding: 20rpx;
padding-bottom: 32rpx;
border-radius: 20rpx;
.tit {
font-size: 26rpx;
color: #000000;
line-height: 62rpx;
height: 62rpx;
}
.pur-sn-val {
height: 80rpx;
background: #f8f8f8;
line-height: 80rpx;
border-radius: 5rpx;
border: 1rpx solid #e7e7e7;
font-size: 26rpx;
color: #000000;
padding: 0 20rpx;
&:hover {
border: 1rpx solid #d0121b;
}
&.placeholder-class {
color: #808080;
font-size: 26rpx;
}
}
}
.price-infos {
padding: 30rpx 20rpx;
background: #fff;
margin-top: 25rpx;
border-radius: 20rpx;
.item {
font-size: 26rpx;
color: #000000;
line-height: 62rpx;
height: 62rpx;
}
.top {
border-bottom: 1rpx solid #e7e7e7;
padding-bottom: 20rpx;
}
.bottom {
padding-top: 25rpx;
.price-pay {
color: #d0121b;
}
}
}
.rules {
height: 86rpx;
.icon {
font-size: 30rpx;
color: #e5e5e5;
}
.icon-checked {
color: #d0121b;
}
.tklink {
font-size: 24rpx;
color: #000000;
margin-left: 16rpx;
}
}
}
.foot {
height: 175rpx;
width: 100%;
position: fixed;
left: 0rpx;
right: 0rpx;
bottom: 0rpx;
z-index: 2;
background: #fff;
padding-left: 40rpx;
padding-right: 25rpx;
border-top: 1rpx solid #e7e7e7;
.l {
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{
width: 100%;
background: #FFFFFF;
border-radius: 10rpx 10rpx 0rpx 0rpx;
padding:24rpx 30rpx;
position: relative;
padding-bottom: 150rpx;
.trt{
text-align: right;
.icon{color:#898989;font-size: 25rpx;}
}
.ttit{
width: 520rpx;
height: 53rpx;
font-size: 26rpx;
color: #000000;
line-height: 53rpx;
text-align: center;
margin:0 auto;
}
.tipjk{
font-size: 22rpx;
color: #666666;
text-align: center;
}
.cons{
padding-bottom:80rpx;
padding-top:60rpx;
.label{
font-size: 24rpx;
color: #000000;
width: 620rpx;
margin:0 auto;
text{
font-size: 24rpx;
color: #D0121B;
}
}
.inputv{
display: block;
width: 620rpx;
padding-left:20rpx;
margin:0 auto;
margin-top:15rpx;
height: 80rpx;
background: #FFFFFF;
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;
}
.pop-tips {
width: 100%;
background: #ffffff;
border-radius: 10rpx 10rpx 0rpx 0rpx;
padding: 24rpx 30rpx;
position: relative;
padding-bottom: 150rpx;
.trt {
text-align: right;
.icon {
color: #898989;
font-size: 25rpx;
}
}
.ttit {
width: 520rpx;
height: 53rpx;
font-size: 26rpx;
color: #000000;
line-height: 53rpx;
text-align: center;
margin: 0 auto;
}
.tipjk {
font-size: 22rpx;
color: #666666;
text-align: center;
}
.cons {
padding-bottom: 80rpx;
padding-top: 60rpx;
.label {
font-size: 24rpx;
color: #000000;
width: 620rpx;
margin: 0 auto;
text {
font-size: 24rpx;
color: #d0121b;
}
}
.inputv {
display: block;
width: 620rpx;
padding-left: 20rpx;
margin: 0 auto;
margin-top: 15rpx;
height: 80rpx;
background: #ffffff;
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;
}
}
/**优惠券弹窗**/
.pop-yhq{
width: 100%;
background: #FFFFFF;
border-radius: 10rpx 10rpx 0rpx 0rpx;
padding:24rpx 30rpx;
position: relative;
padding-bottom: 150rpx;
.trt{
text-align: right;
.icon{color:#898989;font-size: 25rpx;}
}
.tit{
font-size: 24rpx;
color: #000000;
margin-bottom: 25rpx;
text-align: center;
}
.cons{
margin-top:68rpx;
max-height:800rpx;
overflow-y: auto;
.group{
height:180rpx;
margin-bottom:25rpx;
background: url('https://img.ichunt.com/images/ichunt/202502/24/435bcc261a434392135ee0846ac99d60.png') no-repeat;
background-size: 100% 100%;
padding-left: 27rpx;
padding-right: 30rpx;
border-radius: 20rpx;
border:1rpx solid #fff;
&.act{
border:1rpx solid #D0121B;
}
.l{
.price{
font-weight: 600;
font-size: 30rpx;
color: #FF3000;
.textp{
font-size: 60rpx;
color: #FF3000;
}
margin-right: 68rpx;
.tips{
font-size: 22rpx;
color: #FF6300;
font-weight: normal;
}
}
.yhld{
font-size: 22rpx;
color: #FF6300;
view{
font-size: 35rpx;
color: #3B2C1B;
height:72rpx;
line-height: 65rpx;
}
}
}
.rbtn{
width: 146rpx;
height: 58rpx;
background: linear-gradient( 180deg, #F6491D 0%, #F52A1B 100%);
border-radius: 5rpx;
font-size: 26rpx;
color: #FFFFFF;
text{
background: url('https://img.ichunt.com/images/ichunt/202502/24/4ab2a242f3e45c0bafe3fb3207263ed2.png') no-repeat;
background-size: 100% 100%;
height:25rpx;
width:25rpx;
margin-left: 10rpx;
}
}
}
}
.add-btn{
width: 100%;
height: 110rpx;
background: #D0121B;
line-height: 110rpx;
text-align: center;
font-size: 30rpx;
color: #FFFFFF;
position: absolute;
bottom:0rpx;
left:0rpx;
}
}
\ No newline at end of file
.pop-yhq {
width: 100%;
background: #ffffff;
border-radius: 10rpx 10rpx 0rpx 0rpx;
padding: 24rpx 30rpx;
position: relative;
padding-bottom: 150rpx;
.trt {
text-align: right;
.icon {
color: #898989;
font-size: 25rpx;
}
}
.tit {
font-size: 24rpx;
color: #000000;
margin-bottom: 25rpx;
text-align: center;
}
.cons {
margin-top: 68rpx;
max-height: 800rpx;
overflow-y: auto;
.group {
height: 180rpx;
margin-bottom: 25rpx;
background: url('https://img.ichunt.com/images/ichunt/202502/24/435bcc261a434392135ee0846ac99d60.png') no-repeat;
background-size: 100% 100%;
padding-left: 27rpx;
padding-right: 30rpx;
border-radius: 20rpx;
border: 1rpx solid #fff;
&.act {
border: 1rpx solid #d0121b;
}
.l {
.price {
font-weight: 600;
font-size: 30rpx;
color: #ff3000;
.textp {
font-size: 60rpx;
color: #ff3000;
}
margin-right: 68rpx;
.tips {
font-size: 22rpx;
color: #ff6300;
font-weight: normal;
}
}
.yhld {
font-size: 22rpx;
color: #ff6300;
view {
font-size: 35rpx;
color: #3b2c1b;
height: 72rpx;
line-height: 65rpx;
}
}
}
.rbtn {
width: 146rpx;
height: 58rpx;
background: linear-gradient(180deg, #f6491d 0%, #f52a1b 100%);
border-radius: 5rpx;
font-size: 26rpx;
color: #ffffff;
text {
background: url('https://img.ichunt.com/images/ichunt/202502/24/4ab2a242f3e45c0bafe3fb3207263ed2.png') no-repeat;
background-size: 100% 100%;
height: 25rpx;
width: 25rpx;
margin-left: 10rpx;
}
}
}
}
.add-btn {
width: 100%;
height: 110rpx;
background: #d0121b;
line-height: 110rpx;
text-align: center;
font-size: 30rpx;
color: #ffffff;
position: absolute;
bottom: 0rpx;
left: 0rpx;
}
}
.classNavPage{
.bugc-ceng{
position: relative;
z-index: 1;
background: #fff;
}
.cons{
padding-top:23rpx;
.one-c-box{
padding-left:18rpx;
position: relative;
padding-right:90rpx;
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;
}
}
}
}
}
.classNavPage {
.bugc-ceng {
position: relative;
z-index: 1;
background: #fff;
}
.cons {
padding-top: 23rpx;
.one-c-box {
padding-left: 18rpx;
position: relative;
padding-right: 90rpx;
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: 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 */
.classNavPage{
.two-c-box{
height:calc(100vh - 90rpx - 130rpx);
}
.classNavPage {
.two-c-box {
height: calc(100vh - 90rpx - 130rpx);
}
}
/* #endif */
\ No newline at end of file
/* #endif */
<template>
<view class="rulePage">
<barX />
<view class="header row verCenter">
<text class="icon iconfont icon-arrowleft" @click="$goBack"></text>
<view>{{id==1?'爱智网站服务协议':'爱智网隐私政策'}}</view>
</view>
<view class="content" v-html="content"></view>
</view>
<view class="rulePage">
<barX />
<view class="header row verCenter">
<text class="icon iconfont icon-arrowleft" @click="$goBack"></text>
<view>{{id==1?'爱智网站服务协议':'爱智隐私政策'}}</view>
</view>
<view class="content" v-html="content"></view>
</view>
</template>
<script>
import {
Api_Url
} from '@/util/api.js'
import barX from '@/components/barx.vue';
import {
Api_Url
} from '@/util/api.js'
import barX from '@/components/barx.vue';
export default {
data() {
return {
id:1,
content:""
}
},
onLoad: function(option) {
this.id=option.id
this.getData()
},
methods: {
getData(){
this.request(Api_Url + '/api/xcx/newsPage', 'GET', {type:this.id}, true).then(res => {
if(res.code==0){
this.content=res.data.content
}else{
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
}
},
components: {
barX,
}
}
export default {
data() {
return {
id: 1,
content: ""
}
},
onLoad: function(option) {
this.id = option.id
this.getData()
},
methods: {
getData() {
this.request(Api_Url + '/api/xcx/newsPage', 'GET', { type: this.id }, true).then(res => {
if (res.code == 0) {
this.content = res.data.content
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
}
},
components: {
barX,
}
}
</script>
<style scoped lang="scss">
.rulePage{
.header{
height:110rpx;
padding-left:33rpx;
.icon{
font-size: 35rpx;
color: #898989;
margin-right:160rpx;
}
view{
font-weight: 600;
font-size: 32rpx;
color: #000000;
}
}
.content{
padding:33rpx;
padding-top:0rpx;
font-size: 26rpx;
color: #000000;
line-height: 50rpx;
letter-spacing: 1px;
overflow-y: auto;
height:calc(100vh - 285rpx);
/* #ifdef H5 */
height:calc(100vh - 200rpx);
/* #endif */
}
}
.rulePage {
.header {
height: 110rpx;
padding-left: 33rpx;
.icon {
font-size: 35rpx;
color: #898989;
margin-right: 160rpx;
}
view {
font-weight: 600;
font-size: 32rpx;
color: #000000;
}
}
.content {
padding: 33rpx;
padding-top: 0rpx;
font-size: 26rpx;
color: #000000;
line-height: 50rpx;
letter-spacing: 1px;
overflow-y: auto;
height: calc(100vh - 285rpx);
/* #ifdef H5 */
height: calc(100vh - 200rpx);
/* #endif */
}
}
</style>
\ No newline at end of file
<template>
<view class="confirmQuotePage">
<barX />
<titleNav :title="'确认报价单'"/>
<view class="cons">
<view class="top-box">
<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="confirmQuotePage">
<barX />
<titleNav :title="'确认报价单'" />
<view class="cons">
<view class="top-box">
<view class="tit">询价人:{{create_name}}</view>
<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="l">
<view class="ad row verCenter">
......@@ -17,278 +18,264 @@
</view>
<text class="icon iconfont icon-arrowright"></text>
</view>
</navigator>
</view>
<view class="goods-box" v-if="carList.length>0">
<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'" />
<view class="infos">
<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="price">{{isCompany?(item.company_price||item.origin_price):item.origin_price}}</view>
</view>
</view>
<view class="coupo-box row bothSide verCenter" @click="chooseUp()">
<view class="l">选择您的优惠券</view>
<view class="r row verCenter">
<view class="not" v-if="coupon_list.length==0">
<text>未识别到可用优惠券</text>
<text class="icon iconfont icon-arrowright"></text>
</view>
<view v-else>
<text v-if="priceInfo">-{{priceInfo.currency_sign}}{{priceInfo.discount_fee||"0.00"}}</text>
<text class="icon iconfont icon-arrowright"></text>
</view>
</view>
</view>
</view>
<view class="pur-sn-box">
<view class="tit">客户采购单号</view>
<input type="text" class="pur-sn-val" v-model="purchase_sn" placeholder-class="placeholder-class" placeholder="请输入采购单号"/>
</view>
<view class="price-infos" v-if="priceInfo">
<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.discovery_fee}}</text></view>
</view>
<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.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>
</view>
<view class="rules row verCenter">
<text class="icon iconfont icon-checked1" :class="{'icon-checked':isTest}"
@click="isTest=!isTest"></text>
<navigator url="/pages/car/confirmRule" class="tklink">查看交易条款</navigator>
</view>
</view>
<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="submit-btn" @click="openTipsx">完成报价</view>
</view>
<!--温馨提示-->
<uni-popup ref="popuptips" type="bottom" :safe-area="false">
<view class="pop-tips">
<view class="trt"><text class="icon iconfont icon-caca" @click="closeTipsx"></text></view>
<view class="ttit elep">温馨提示</view>
<view class="tipjk">请确认邮箱地址,爱智将以PDF格式报价单</view>
<view class="cons">
<view class="label"><text>*</text>邮箱</view>
<input type="text" class="inputv" v-model="pdf_email" placeholder="请输入邮箱" />
</view>
<view class="sure" @click="createQuote">确认</view>
</view>
</uni-popup>
<!--优惠券-->
<uni-popup ref="popupyhq" type="bottom" :safe-area="false">
<view class="pop-yhq">
<view class="trt"><text class="icon iconfont icon-caca" @click="closePop"></text></view>
<view class="ttit elep">优惠券</view>
<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="l row ">
<view class="price">
<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>
<view class="tips">{{item.require_amount <= 0.01 ? '无门槛优惠券' : item.coupon_name}}</view>
</view>
<view class="yhld">
<view>商品优惠券</view>
<text>{{item.start_time}} - {{item.end_time}}</text>
</view>
</view>
<!-- <view class="r">
</navigator> -->
</view>
<view class="goods-box" v-if="carList.length>0">
<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'" />
<view class="infos">
<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="price">{{isCompany?(item.company_price||item.origin_price):item.origin_price}}</view>
</view>
</view>
<view class="coupo-box row bothSide verCenter" @click="chooseUp()">
<view class="l">选择您的优惠券</view>
<view class="r row verCenter">
<view class="not" v-if="coupon_list.length==0">
<text>未识别到可用优惠券</text>
<text class="icon iconfont icon-arrowright"></text>
</view>
<view v-else>
<text v-if="priceInfo">-{{priceInfo.currency_sign}}{{priceInfo.discount_fee||"0.00"}}</text>
<text class="icon iconfont icon-arrowright"></text>
</view>
</view>
</view>
</view>
<!-- <view class="pur-sn-box">
<view class="tit">客户采购单号</view>
<input type="text" class="pur-sn-val" v-model="purchase_sn" placeholder-class="placeholder-class" placeholder="请输入采购单号" />
</view> -->
<view class="price-infos" v-if="priceInfo">
<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.discovery_fee}}</text></view>
</view>
<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.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>
</view>
<view class="rules row verCenter">
<text class="icon iconfont icon-checked1" :class="{'icon-checked':isTest}" @click="isTest=!isTest"></text>
<navigator url="/pages/car/confirmRule" class="tklink">查看交易条款</navigator>
</view>
</view>
<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="submit-btn" @click="openTipsx">完成报价</view>
</view>
<!--温馨提示-->
<uni-popup ref="popuptips" type="bottom" :safe-area="false">
<view class="pop-tips">
<view class="trt"><text class="icon iconfont icon-caca" @click="closeTipsx"></text></view>
<view class="ttit elep">温馨提示</view>
<view class="tipjk">请确认邮箱地址,爱智将以PDF格式报价单</view>
<view class="cons">
<view class="label"><text>*</text>邮箱</view>
<input type="text" class="inputv" v-model="pdf_email" placeholder="请输入邮箱" />
</view>
<view class="sure" @click="createQuote">确认</view>
</view>
</uni-popup>
<!--优惠券-->
<uni-popup ref="popupyhq" type="bottom" :safe-area="false">
<view class="pop-yhq">
<view class="trt"><text class="icon iconfont icon-caca" @click="closePop"></text></view>
<view class="ttit elep">优惠券</view>
<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="l row ">
<view class="price">
<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>
<view class="tips">{{item.require_amount <= 0.01 ? '无门槛优惠券' : item.coupon_name}}</view>
</view>
<view class="yhld">
<view>商品优惠券</view>
<text>{{item.start_time}} - {{item.end_time}}</text>
</view>
</view>
<!-- <view class="r">
<view class="rbtn row verCenter rowCenter">
<view>选择</view>
<text ></text>
</view>
</view> -->
</view>
</view>
<view class="add-btn" @click="confirmYhq">确认</view>
</view>
</uni-popup>
</view>
</view>
</view>
<view class="add-btn" @click="confirmYhq">确认</view>
</view>
</uni-popup>
</view>
</template>
<script>
import {Api_Url} from '@/util/api.js'
import barX from '@/components/barx.vue';
import titleNav from '@/components/title_nav.vue';
export default {
data() {
return {
isTest:true,
pdf_email:"",
purchase_sn:"",
userInfo:"",
create_name:"",
address_id:"",
addressInfo:"",
carList:[],
coupon_list:[],
coupon_id:"",
priceInfo:"",
isCompany:(uni.getStorageSync('user_info')&&JSON.parse(uni.getStorageSync('user_info')).company_name)?true:false
}
},
onLoad: function(options) {
this.address_id=options.address_id||""
this.coupon_id=options.coupon_id||""
this.userInfo=JSON.parse(uni.getStorageSync('user_info'))
this.create_name=this.userInfo.wx_nickname||this.userInfo.phone||this.userInfo.email
},
onShow(){
this.getCarList()
this.getAddress()
},
methods: {
chooseYhq(coupon_id){
this.coupon_id=coupon_id
},
chooseUp(){
if(this.coupon_list==0){return}
this.openPop()
},
confirmYhq(){
this.calPrice()
this.closePop()
},
calPrice(){
let sku_=[]
this.carList.forEach(item=>{
sku_.push({
sku_id:item.goods_id,
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 => {
if(res.code==0){
this.priceInfo=res.data
}
})
},
getCarList(){
this.carList=[]
this.request(Api_Url + '/api/cart/getCartGoodsInfo', 'GET', {sku_ids:uni.getStorageSync('car_ids')}, true,true).then(res => {
if(res.code==0){
let arr_=res.data.goods_list
arr_.forEach(item=>{
item.delivery_list.forEach(item1=>{
this.carList.push(item1)
})
})
this.coupon_list=res.data.coupon_list||[]
this.calPrice()
}
})
},
getAddress(){
this.request(Api_Url + '/api/address/getList', 'GET', {}, true).then(res => {
if(res.code==0){
let arr_=res.data.list||[]
arr_.forEach(item=>{
if(this.address_id){
if(item.address_id==this.address_id){
this.addressInfo=item
}
}else{
if(item.is_default==1){
this.addressInfo=item
}
}
})
if(arr_.length>0&&(!this.addressInfo)){
this.addressInfo=arr_[0]
}
if(this.addressInfo){
this.address_id=this.addressInfo.address_id
}
}
})
},
createQuote(){
let goods_json_arr=[]
this.carList.forEach(item=>{
goods_json_arr.push({
sku_id:item.goods_id,
num:item.goods_num
})
})
let obj_={
create_name:this.create_name,
pdf_email:this.pdf_email,
sku_json:JSON.stringify(goods_json_arr),
user_coupon_id:this.coupon_id,
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){
uni.setStorageSync('quoteInfo',JSON.stringify(res.data))
uni.navigateTo({
url: '/pages/car/confirmQuoteSuccess'
});
}else{
uni.showToast({
title: res.msg,
icon: 'nonde'
});
}
})
},
openTipsx() {
if(!this.address_id){
uni.showToast({
title: '请选择地址',
icon: 'none'
});
return
}
if(!this.purchase_sn){
uni.showToast({
title: '请输入客户采购单号',
icon: 'none'
});
return
}
if(!this.isTest){
uni.showToast({
title: '请勾选并确认交易条款',
icon: 'none'
});
return
}
this.$refs.popuptips.open('bottom');
},
closeTipsx() {
this.$refs.popuptips.close('bottom');
},
openPop() {
this.$refs.popupyhq.open('bottom');
},
closePop() {
this.$refs.popupyhq.close('bottom');
},
},
components: {
barX,
titleNav
}
}
import { Api_Url } from '@/util/api.js'
import barX from '@/components/barx.vue';
import titleNav from '@/components/title_nav.vue';
export default {
data() {
return {
isTest: true,
pdf_email: "",
purchase_sn: "",
userInfo: "",
create_name: "",
address_id: "",
addressInfo: "",
carList: [],
coupon_list: [],
coupon_id: "",
priceInfo: "",
isCompany: (uni.getStorageSync('user_info') && JSON.parse(uni.getStorageSync('user_info')).company_name) ? true : false
}
},
onLoad: function(options) {
this.address_id = options.address_id || ""
this.coupon_id = options.coupon_id || ""
this.userInfo = JSON.parse(uni.getStorageSync('user_info'))
this.create_name = this.userInfo.wx_nickname || this.userInfo.phone || this.userInfo.email
},
onShow() {
this.getCarList()
//this.getAddress()
},
methods: {
chooseYhq(coupon_id) {
this.coupon_id = coupon_id
},
chooseUp() {
if (this.coupon_list == 0) { return }
this.openPop()
},
confirmYhq() {
this.calPrice()
this.closePop()
},
calPrice() {
let sku_ = []
this.carList.forEach(item => {
sku_.push({
sku_id: item.goods_id,
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 => {
if (res.code == 0) {
this.priceInfo = res.data;
this.pdf_email = res.data.recent_quote_email;
}
})
},
getCarList() {
this.carList = []
this.request(Api_Url + '/api/cart/getCartGoodsInfo', 'GET', { sku_ids: uni.getStorageSync('car_ids') }, true, true).then(res => {
if (res.code == 0) {
let arr_ = res.data.goods_list
arr_.forEach(item => {
item.delivery_list.forEach(item1 => {
this.carList.push(item1)
})
})
this.coupon_list = res.data.coupon_list || []
this.calPrice()
}
})
},
getAddress() {
this.request(Api_Url + '/api/address/getList', 'GET', {}, true).then(res => {
if (res.code == 0) {
let arr_ = res.data.list || []
arr_.forEach(item => {
if (this.address_id) {
if (item.address_id == this.address_id) {
this.addressInfo = item
}
} else {
if (item.is_default == 1) {
this.addressInfo = item
}
}
})
if (arr_.length > 0 && (!this.addressInfo)) {
this.addressInfo = arr_[0]
}
if (this.addressInfo) {
this.address_id = this.addressInfo.address_id
}
}
})
},
createQuote() {
let goods_json_arr = []
this.carList.forEach(item => {
goods_json_arr.push({
sku_id: item.goods_id,
num: item.goods_num
})
})
let obj_ = {
create_name: this.create_name,
pdf_email: this.pdf_email,
sku_json: JSON.stringify(goods_json_arr),
user_coupon_id: this.coupon_id,
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) {
uni.setStorageSync('quoteInfo', JSON.stringify(res.data))
uni.navigateTo({
url: '/pages/car/confirmQuoteSuccess'
});
} else {
uni.showToast({
title: res.msg,
icon: 'nonde'
});
}
})
},
openTipsx() {
if (!this.isTest) {
uni.showToast({
title: '请勾选并确认交易条款',
icon: 'none'
});
return
}
this.$refs.popuptips.open('bottom');
},
closeTipsx() {
this.$refs.popuptips.close('bottom');
},
openPop() {
this.$refs.popupyhq.open('bottom');
},
closePop() {
this.$refs.popupyhq.close('bottom');
},
},
components: {
barX,
titleNav
}
}
</script>
<style scoped lang="scss">
@import '../../assets/css/car/confirmQuote.scss';
@import '../../assets/css/car/confirmQuote.scss';
</style>
\ No newline at end of file
<template>
<view class="classNavPage">
<barX />
<view class="bugc-ceng">
<searchHead @confirm="onConfirm" @goUrl="goUrl"/>
</view>
<view class="classNavPage">
<barX />
<view class="bugc-ceng">
<searchHead @confirm="onConfirm" @goUrl="goUrl" />
</view>
<view class="cons">
<view class="one-c-box" :class="{'show':isShowClassOne}">
<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>
<view class="rb row verCenter rowCenter" @click="isShowClassOne=!isShowClassOne">
<text :class="['icon','iconfont','icon-arrowxia']" ></text>
</view>
<view class="one-c-hide-cons">
<view class="tit">全部分类</view>
<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)">
<image :src="item.images||'https://www.iedge.net/assets/images/common/defaultnew.png'" mode="aspectFit" ></image>
<text class="elep">{{item.title}}</text>
</view>
</view>
<view class="foot row verCenter rowCenter" @click="isShowClassOne=!isShowClassOne">收起<text
class="icon iconfont icon-arrowshang"></text></view>
<view class="cons">
<view class="one-c-box" :class="{'show':isShowClassOne}">
<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>
<view class="rb row verCenter rowCenter" @click="isShowClassOne=!isShowClassOne">
<text :class="['icon','iconfont','icon-arrowxia']"></text>
</view>
<view class="one-c-hide-cons">
<view class="tit">全部分类</view>
<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)">
<image :src="item.images||'https://www.iedge.net/assets/images/common/defaultnew.png'" mode="aspectFit"></image>
<text class="elep">{{item.title}}</text>
</view>
</view>
<view class="foot row verCenter rowCenter" @click="isShowClassOne=!isShowClassOne">收起<text 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 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>
<bottomNav actval="2" />
</view>
</view>
<bottomNav actval="2" />
</view>
</template>
<script>
import {
Api_Url
} from '@/util/api.js'
import searchHead from '@/components/search_head.vue';
import barX from '@/components/barx.vue';
import bottomNav from '@/components/bottom_nav';
import {
Api_Url
} from '@/util/api.js'
import searchHead from '@/components/search_head.vue';
import barX from '@/components/barx.vue';
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 {
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()
},
})
})
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
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
}
}
})
})
}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
}
});
},
onConfirm(e) {
let key_ = e.detail.value
if (key_.length < 2) {
uni.showToast({
title: '关键字不能小于2个字符',
duration: 2000,
icon: "none"
})
return
}
uni.navigateTo({
url: '/pages/search/list?k=' + key_
});
},
goUrl(){
uni.navigateTo({
url: '/pages/search/nav'
});
},
},
components: {
searchHead,
barX,
bottomNav
}
}
uni.navigateTo({
url: '/pages/search/list?k=' + key_
});
},
goUrl() {
uni.navigateTo({
url: '/pages/search/nav'
});
},
},
components: {
searchHead,
barX,
bottomNav
}
}
</script>
<style scoped lang="scss">
@import '../../assets/css/class/nav.scss';
@import '../../assets/css/class/nav.scss';
</style>
\ No newline at end of file
<template>
<view class="goodsDetailPage" v-if="goods_info">
<barX />
<view class="header row verCenter" >
<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==2}" @click="tab(2)">详情</text>
</view>
<view class="goods_info">
<view class="swiper-box" v-if="images.length>0">
<swiper class="swiper" @change="handleSwiperChange" :indicator-dots="false" :autoplay="false"
:interval="3000" :duration="500">
<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" />
</swiper-item>
</swiper>
<text class="page-indicator">{{ currentPage + 1 }}/{{ images.length }}</text>
</view>
<view class="info-box">
<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']">¥
{{goods_info.ladder_price[0]['price_cn']}}</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 class="goodsDetailPage" v-if="goods_info">
<barX />
<view class="header row verCenter">
<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==2}" @click="tab(2)">详情</text>
</view>
<view class="goods_info">
<view class="swiper-box" v-if="images.length>0">
<swiper class="swiper" @change="handleSwiperChange" :indicator-dots="false" :autoplay="false" :interval="3000" :duration="500">
<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" />
</swiper-item>
</swiper>
<text class="page-indicator">{{ currentPage + 1 }}/{{ images.length }}</text>
</view>
<view class="info-box">
<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']">¥
{{goods_info.ladder_price[0]['price_cn']}}</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 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="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 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>
<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>
<!--加入购物车 立即订购-->
<uni-popup ref="popupcar" type="bottom" :safe-area="false">
<view class="pop-detail-car">
<view class="trt"><text class="icon iconfont icon-caca" @click="close"></text></view>
<view class="handle row">
<image :src="goods_info.goods_images||'https://www.iedge.net/assets/images/common/defaultnew.png'" />
<view class="hbox">
<view class="price1">¥ {{buyPrice}}</view>
<view class="hbha row verCenter bothSide">
<text class="icon iconfont icon-jian" @click="addjNum(goods_info.sku_id,1)"></text>
<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>
</view>
</view>
</view>
<view class="goods-box">
<view class="tit">型号</view>
<view class="item" :class="{'act':goods_id==item.goods_id}" v-for="(item,index) in goods_series" :key="index" >
<text @click="changeSku(item.goods_id)">{{item.goods_name}}</text>
</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>
</view>
</uni-popup>
<!--加入清单-->
<uni-popup ref="popupaddlist" type="bottom" :safe-area="false">
<view class="pop-add-list">
<view class="trt"><text class="icon iconfont icon-caca" @click="closeAddList"></text></view>
<view class="ttit elep">{{goods_info.goods_name}}</view>
<view class="new-box row">
<text class="new-btn row verCenter" @click="openNewList">新建清单<text
class="icon iconfont icon-jia"></text></text>
</view>
<view class="list-box" v-if="qDList.length>0">
<view class="item row verCenter bothSide" v-for="(item,index) in qDList" :key="index">
<view class="row verCenter" @click.stop="chooseQd(item.list_id)">
<view class="l">
<text class="icon iconfont icon-checked1" :class="{'icon-checked':item.checked}" ></text>
</view>
<view class="c">
<view class="elep">{{item.list_name}}</view>
<text>{{item.create_time}}</text>
</view>
</view>
<navigator :url="'/pages/user/qdDetail?list_id='+item.list_id">
<view class="r row verCenter">
<text>{{item.list_goods_count}}个商品</text>
<text class="icon iconfont icon-arrowright"></text>
</view>
</navigator>
</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>
<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>
<!--加入购物车 立即订购-->
<uni-popup ref="popupcar" type="bottom" :safe-area="false">
<view class="pop-detail-car">
<view class="trt"><text class="icon iconfont icon-caca" @click="close"></text></view>
<view class="handle row">
<image :src="goods_info.goods_images||'https://www.iedge.net/assets/images/common/defaultnew.png'" />
<view class="hbox">
<view class="price1">¥ {{buyPrice}}</view>
<view class="hbha row verCenter bothSide">
<text class="icon iconfont icon-jian" @click="addjNum(goods_info.sku_id,1)"></text>
<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>
</view>
</view>
</view>
<view class="goods-box">
<view class="tit">型号</view>
<view class="item" :class="{'act':goods_id==item.goods_id}" v-for="(item,index) in goods_series" :key="index">
<text @click="changeSku(item.goods_id)">{{item.goods_name}}</text>
</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>
</view>
</uni-popup>
<!--加入清单-->
<uni-popup ref="popupaddlist" type="bottom" :safe-area="false">
<view class="pop-add-list">
<view class="trt"><text class="icon iconfont icon-caca" @click="closeAddList"></text></view>
<view class="ttit elep">{{goods_info.goods_name}}</view>
<view class="new-box row">
<text class="new-btn row verCenter" @click="openNewList">新建清单<text class="icon iconfont icon-jia"></text></text>
</view>
<view class="list-box" v-if="qDList.length>0">
<view class="item row verCenter bothSide" v-for="(item,index) in qDList" :key="index">
<view class="row verCenter" @click.stop="chooseQd(item.list_id)">
<view class="l">
<text class="icon iconfont icon-checked1" :class="{'icon-checked':item.checked}"></text>
</view>
<view class="c">
<view class="elep">{{item.list_name}}</view>
<text>{{item.create_time}}</text>
</view>
</view>
<navigator :url="'/pages/user/qdDetail?list_id='+item.list_id">
<view class="r row verCenter">
<text>{{item.list_goods_count}}个商品</text>
<text class="icon iconfont icon-arrowright"></text>
</view>
</navigator>
</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>
<script>
import {
Api_Url
} from '@/util/api.js'
import {
Api_Url
} 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';
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
}
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');
},
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: {
barX
}
}
},
components: {
barX
}
}
</script>
<style scoped lang="scss">
@import '../../assets/css/goods/detail.scss';
@import '../../assets/css/goods/detail.scss';
</style>
\ No newline at end of file
<template>
<view class="addressPage">
<barX />
<titleNav title="收货地址" />
<view class="addressPage">
<barX />
<titleNav title="收货地址" />
<view class="cons">
<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="t row verCenter">
<text class="tet">{{item.nation_cn!="中国"?item.nation_cn:''}} {{item.province_val}}
{{item.city_val}} {{item.district_val}} {{item.consignee}}</text>
<text class="mr row verCenter rowCenter" v-if="item.is_default==1">默认</text>
</view>
<view class="c">{{item.detail_address}}</view>
<view class="b row bothSide">
<view class="l row verCenter" @click="setdefault(item.address_id)" v-if="!form">
<text class="icon iconfont icon-checked1"
:class="{'icon-checked':item.is_default==1}"></text>
<text>{{item.is_default==1?"已默认":"设为默认"}}</text>
</view>
<view v-else></view>
<!-- <view class="l row verCenter" @click="setChoose(item.address_id)" v-else>
<view class="cons">
<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="t row verCenter">
<text class="tet">{{item.nation_cn!="中国"?item.nation_cn:''}} {{item.province_val}}
{{item.city_val}} {{item.district_val}} {{item.consignee}}</text>
<text class="mr row verCenter rowCenter" v-if="item.is_default==1">默认</text>
</view>
<view class="c">{{item.detail_address}}</view>
<view class="b row bothSide">
<view class="l row verCenter" @click="setdefault(item.address_id)" v-if="!form">
<text class="icon iconfont icon-checked1" :class="{'icon-checked':item.is_default==1}"></text>
<text>{{item.is_default==1?"已默认":"设为默认"}}</text>
</view>
<view v-else></view>
<!-- <view class="l row verCenter" @click="setChoose(item.address_id)" v-else>
<text class="icon iconfont icon-checked1"
:class="{'icon-checked':item.checkedx==1}"></text>
<text>{{item.checkedx==1?"已选择":"选择"}}</text>
</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>
<script>
import {
Api_Url
} from '@/util/api.js'
import barX from '@/components/barx.vue';
import titleNav from '@/components/title_nav.vue';
export default {
data() {
return {
isInit: false, //记录是否加载了数据
form:"",
address_id:"",
invoice_id:"",
coupon_id:"",
list: [],
}
},
onLoad: function(options) {
this.form=options.form||""
this.address_id=options.address_id||""
this.invoice_id=options.invoice_id||""
this.coupon_id=options.coupon_id||""
},
onShow() {
this.getData();
},
methods: {
goUpdate(address_id){
uni.navigateTo({
url:'/pages/user/addressEdit?address_id=' + address_id
})
},
setChoose(address_id){
if(!this.form){return}
let address_id_go=""
this.list.forEach(item=>{
item.checkedx=false
if(address_id==item.address_id){
item.checkedx=true
address_id_go=item.address_id
}
})
setTimeout(()=>{
if(this.form=="confirmQuote"){
//报价过来
uni.navigateTo({
url: '/pages/car/confirmQuote?address_id='+address_id_go+'&coupon_id='+this.coupon_id
});
return
}
uni.navigateTo({
url: '/pages/car/confirmOrder?address_id='+address_id_go+'&coupon_id='+this.coupon_id+'&invoice_id='+this.invoice_id
});
},200);
},
copy(item){
uni.setClipboardData({
data: (item.nation_cn!="中国"?item.nation_cn:'')+item.province_val+' '+item.city_val+' '+item.district_val+' '+item.detail_address,
success: function () {
uni.showToast({
title: '复制成功',
icon: 'success'
});
}
});
},
deleteAdress(address_id) {
uni.showModal({
title: '',
content: '您确定删除该地址嘛',
success: res => {
if (res.confirm) {
this.request(Api_Url + '/api/address/del', 'POST', {
address_id: address_id
}, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '删除成功',
icon: 'success'
});
this.getData(1);
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
}
}
});
},
import {
Api_Url
} from '@/util/api.js'
import barX from '@/components/barx.vue';
import titleNav from '@/components/title_nav.vue';
export default {
data() {
return {
isInit: false, //记录是否加载了数据
form: "",
address_id: "",
invoice_id: "",
coupon_id: "",
list: [],
}
},
onLoad: function(options) {
this.form = options.form || ""
this.address_id = options.address_id || ""
this.invoice_id = options.invoice_id || ""
this.coupon_id = options.coupon_id || ""
},
onShow() {
this.getData();
},
methods: {
goUpdate(address_id) {
uni.navigateTo({
url: '/pages/user/addressEdit?address_id=' + address_id
})
},
setChoose(address_id) {
if (!this.form) { return }
let address_id_go = ""
this.list.forEach(item => {
item.checkedx = false
if (address_id == item.address_id) {
item.checkedx = true
address_id_go = item.address_id
}
})
setTimeout(() => {
if (this.form == "confirmQuote") {
//报价过来
uni.navigateTo({
url: '/pages/car/confirmQuote?address_id=' + address_id_go + '&coupon_id=' + this.coupon_id
});
return
}
uni.navigateTo({
url: '/pages/car/confirmOrder?address_id=' + address_id_go + '&coupon_id=' + this.coupon_id + '&invoice_id=' + this.invoice_id
});
}, 200);
},
copy(item) {
uni.setClipboardData({
data: (item.nation_cn != "中国" ? item.nation_cn : '') + item.province_val + ' ' + item.city_val + ' ' + item.district_val + ' ' + item.detail_address,
success: function() {
uni.showToast({
title: '复制成功',
icon: 'success'
});
}
});
},
deleteAdress(address_id) {
uni.showModal({
title: '',
content: '您确定删除该地址嘛',
success: res => {
if (res.confirm) {
this.request(Api_Url + '/api/address/del', 'POST', {
address_id: address_id
}, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '删除成功',
icon: 'success'
});
this.getData(1);
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
}
}
});
},
setdefault(address_id) {
this.request(Api_Url + '/api/address/default', 'POST', {
address_id: address_id
}, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '设置成功',
icon: 'success'
});
this.getData(1);
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
},
getData(loading) {
setdefault(address_id) {
this.request(Api_Url + '/api/address/default', 'POST', {
address_id: address_id
}, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '设置成功',
icon: 'success'
});
this.getData(1);
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
},
getData(loading) {
let obj_ = {
p: 1
}
let obj_ = {
p: 1
}
this.request(Api_Url + '/api/address/getList', 'GET', obj_, (loading?false:true)).then(res => {
if (res.code == 0) {
this.isInit = 1;
let arr_ = res.data.list || []
arr_.forEach(item=>{
item.checkedx=false
if(item.address_id==this.address_id){
item.checkedx=true
}
})
this.list = arr_
} else {
this.isInit = 1;
this.list = []
}
this.request(Api_Url + '/api/address/getList', 'GET', obj_, (loading ? false : true)).then(res => {
if (res.code == 0) {
this.isInit = 1;
let arr_ = res.data.list || []
arr_.forEach(item => {
item.checkedx = false
if (item.address_id == this.address_id) {
item.checkedx = true
}
})
this.list = arr_
} else {
this.isInit = 1;
this.list = []
}
});
});
},
},
},
components: {
barX,
titleNav
}
}
},
components: {
barX,
titleNav
}
}
</script>
<style scoped lang="scss">
@import '../../assets/css/user/address.scss';
@import '../../assets/css/user/address.scss';
</style>
\ No newline at end of file
<template>
<view class="addressAddPage">
<barX />
<titleNav title="新增收货地址" />
<view class="addressAddPage">
<barX />
<titleNav title="新增收货地址" />
<view class="cons">
<view class="input-box">
<view class="input-group row verCenter">
<text class="label">收货人</text>
<input type="text" placeholder="请输入收货人" v-model="formParams.consignee" placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter">
<text class="label">手机号</text>
<picker @change="bindPickerChange($event)" :value="areaIndex" :range="areaArray"
:range-key="'name'">
<text class="areabox-but "><text class="but-val">{{areaArray[areaIndex].value}}</text><text
class="icon iconfont icon-arrowxia"></text></text>
</picker>
<view class="cons">
<view class="input-box">
<view class="input-group row verCenter">
<text class="label">收货人</text>
<input type="text" placeholder="请输入收货人" v-model="formParams.consignee" placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter">
<text class="label">手机号</text>
<picker @change="bindPickerChange($event)" :value="areaIndex" :range="areaArray" :range-key="'name'">
<view class="areabox-but ">
<text class="but-val">{{areaArray[areaIndex].value}}</text>
<text class="icon iconfont icon-arrowxia"></text>
</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 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>
</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>
<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>
</view>
</template>
<script>
import {
Api_Url
} from '@/util/api.js'
import barX from '@/components/barx.vue';
import titleNav from '@/components/title_nav.vue';
export default {
data() {
return {
multiArray: [
[],
[],
[]
],
multiIndex: [0, 0, 0],
selectText: '请选择省市区',
formParams: {
consignee: '',
province_id: '',
city_id: '',
district_id: '',
detail_address: '',
is_default: 1,
mobile: '',
intl_code: '0086',
},
areaIndex: 0,
areaArray: [{
name: "0086(中国大陆)",
value: '0086'
},
{
name: "00852(中国香港)",
value: '00852'
},
{
name: "00853(中国澳门)",
value: '00853'
},
{
name: "00886(中国台湾)",
value: '00886'
},
{
name: "0066(泰国)",
value: '0066'
},
{
name: "0084(越南)",
value: '0084'
}
],
}
},
onLoad: function() {
import {
Api_Url
} from '@/util/api.js'
import barX from '@/components/barx.vue';
import titleNav from '@/components/title_nav.vue';
export default {
data() {
return {
multiArray: [
[],
[],
[]
],
multiIndex: [0, 0, 0],
selectText: '请选择省市区',
formParams: {
consignee: '',
province_id: '',
city_id: '',
district_id: '',
detail_address: '',
is_default: 1,
mobile: '',
intl_code: '0086',
},
areaIndex: 0,
areaArray: [{
name: "0086(中国大陆)",
value: '0086'
}
// {
// name: "00852(中国香港)",
// value: '00852'
// },
// {
// name: "00853(中国澳门)",
// value: '00853'
// },
// {
// name: "00886(中国台湾)",
// value: '00886'
// },
// {
// name: "0066(泰国)",
// value: '0066'
// },
// {
// name: "0084(越南)",
// value: '0084'
// }
],
}
},
onLoad: function() {
},
onShow() {
this.getProvince();
},
methods: {
bindPickerChange: function(e, type) {
this.areaIndex = e.detail.value
this.formParams.intl_code = this.areaArray[e.detail.value].value
},
onSwitchChange(e) {
this.formParams.is_default = e.detail.value ? 1 : 0;
},
/**
* 省市区联动监听
* @param {Object} e
*/
bindMultiPickerColumnChange(e) {
console.log(e.detail);
if (e.detail.column === 0) {
// 第一列滑动
this.multiIndex[0] = e.detail.value;
this.getCity(this.multiArray[0][e.detail.value].value, true);
},
onShow() {
this.getProvince();
},
methods: {
bindPickerChange: function(e, type) {
this.areaIndex = e.detail.value
this.formParams.intl_code = this.areaArray[e.detail.value].value
},
onSwitchChange(e) {
this.formParams.is_default = e.detail.value ? 1 : 0;
},
/**
* 省市区联动监听
* @param {Object} e
*/
bindMultiPickerColumnChange(e) {
console.log(e.detail);
if (e.detail.column === 0) {
// 第一列滑动
this.multiIndex[0] = e.detail.value;
this.getCity(this.multiArray[0][e.detail.value].value, true);
// 第一列滑动之后 第二列 和第三列 都变为第一个
this.multiIndex.splice(1, 1, 0);
this.multiIndex.splice(2, 1, 0);
} else if (e.detail.column === 1) {
// 第二列滑动
this.multiIndex[1] = e.detail.value;
this.getDistrict(this.multiArray[1][e.detail.value].value);
// 第一列滑动之后 第二列 和第三列 都变为第一个
this.multiIndex.splice(1, 1, 0);
this.multiIndex.splice(2, 1, 0);
} else if (e.detail.column === 1) {
// 第二列滑动
this.multiIndex[1] = e.detail.value;
this.getDistrict(this.multiArray[1][e.detail.value].value);
// 第二列滑动之后 第三列 变成第一个
this.multiIndex.splice(2, 1, 0);
} else if (e.detail.column === 2) {
// 第三列滑动
this.multiIndex[2] = e.detail.value;
}
this.$forceUpdate();
},
/**
* 省市区选择确定
* @param {Object} e
*/
pickerChange(e) {
this.multiIndex = e.detail.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.district_id = this.multiArray[2][this.multiIndex[2]].value;
// 第二列滑动之后 第三列 变成第一个
this.multiIndex.splice(2, 1, 0);
} else if (e.detail.column === 2) {
// 第三列滑动
this.multiIndex[2] = e.detail.value;
}
this.$forceUpdate();
},
/**
* 省市区选择确定
* @param {Object} e
*/
pickerChange(e) {
this.multiIndex = e.detail.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.district_id = this.multiArray[2][this.multiIndex[2]].value;
this.selectText =
`${this.multiArray[0][this.multiIndex[0]].name + ',' + this.multiArray[1][this.multiIndex[1]].name + ',' + this.multiArray[2][this.multiIndex[2]].name}`;
},
/**
* 获取省数据
*/
getProvince(id = 1) {
console.log('获取省数据id:' + id);
this.request(Api_Url + '/api/address/getOptions', 'GET', {
id: id
}, false, true).then(res => {
if (res.code === 0) {
var arr = [];
for (var key in res.data) {
arr.push({
name: res.data[key],
value: parseInt(key)
});
}
this.multiArray[0] = arr;
this.getCity(2, true);
this.$forceUpdate();
}
});
},
/**
* @param {Object} id
* @param {Object} default
*/
getCity(id, defaultParms) {
console.log('获取市数据id:' + id);
this.request(Api_Url + '/api/address/getOptions', 'GET', {
id: id
}, false, true).then(res => {
if (res.code === 0) {
var arr = [];
for (var key in res.data) {
arr.push({
name: res.data[key],
value: parseInt(key)
});
}
this.multiArray[1] = arr;
if (defaultParms) {
this.getDistrict(arr[0].value);
}
this.$forceUpdate();
}
});
},
/**
* 获取区数据
* @param {Object} id
*/
getDistrict(id) {
console.log('获取区数据id:' + id);
this.request(Api_Url + '/api/address/getOptions', 'GET', {
id: id
}, false, true).then(res => {
if (res.code === 0) {
var arr = [];
for (var key in res.data) {
arr.push({
name: res.data[key],
value: parseInt(key)
});
}
this.multiArray[2] = arr;
this.$forceUpdate();
}
});
},
/**
* 保存地址
*/
create() {
if (!this.formParams.consignee) {
uni.showToast({
title: '请输入收货人',
icon: 'none'
});
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}$/;
if ((!this.formParams.mobile) || ((this.formParams.intl_code=="0086")&&!reg.test(this.formParams.mobile))) {
uni.showToast({
title: '请输入正确的手机号',
icon: 'none'
});
return false;
}
if (!this.formParams.province_id) {
uni.showToast({
title: '请选择省市区',
icon: 'none'
});
return false;
}
if (!this.formParams.detail_address) {
uni.showToast({
title: '请输入详细街道地址',
icon: 'none'
});
return false;
}
this.request(Api_Url + '/api/address/add', 'POST', this.formParams, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '新增地址成功',
icon: 'success'
});
setTimeout(() => {
uni.navigateBack({
delta: 1
});
}, 2000);
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
}
this.selectText =
`${this.multiArray[0][this.multiIndex[0]].name + ',' + this.multiArray[1][this.multiIndex[1]].name + ',' + this.multiArray[2][this.multiIndex[2]].name}`;
},
/**
* 获取省数据
*/
getProvince(id = 1) {
console.log('获取省数据id:' + id);
this.request(Api_Url + '/api/address/getOptions', 'GET', {
id: id
}, false, true).then(res => {
if (res.code === 0) {
var arr = [];
for (var key in res.data) {
arr.push({
name: res.data[key],
value: parseInt(key)
});
}
this.multiArray[0] = arr;
this.getCity(2, true);
this.$forceUpdate();
}
});
},
/**
* @param {Object} id
* @param {Object} default
*/
getCity(id, defaultParms) {
console.log('获取市数据id:' + id);
this.request(Api_Url + '/api/address/getOptions', 'GET', {
id: id
}, false, true).then(res => {
if (res.code === 0) {
var arr = [];
for (var key in res.data) {
arr.push({
name: res.data[key],
value: parseInt(key)
});
}
this.multiArray[1] = arr;
if (defaultParms) {
this.getDistrict(arr[0].value);
}
this.$forceUpdate();
}
});
},
/**
* 获取区数据
* @param {Object} id
*/
getDistrict(id) {
console.log('获取区数据id:' + id);
this.request(Api_Url + '/api/address/getOptions', 'GET', {
id: id
}, false, true).then(res => {
if (res.code === 0) {
var arr = [];
for (var key in res.data) {
arr.push({
name: res.data[key],
value: parseInt(key)
});
}
this.multiArray[2] = arr;
this.$forceUpdate();
}
});
},
/**
* 保存地址
*/
create() {
if (!this.formParams.consignee) {
uni.showToast({
title: '请输入收货人',
icon: 'none'
});
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}$/;
if ((!this.formParams.mobile) || ((this.formParams.intl_code == "0086") && !reg.test(this.formParams.mobile))) {
uni.showToast({
title: '请输入正确的手机号',
icon: 'none'
});
return false;
}
if (!this.formParams.province_id) {
uni.showToast({
title: '请选择省市区',
icon: 'none'
});
return false;
}
if (!this.formParams.detail_address) {
uni.showToast({
title: '请输入详细街道地址',
icon: 'none'
});
return false;
}
this.request(Api_Url + '/api/address/add', 'POST', this.formParams, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '新增地址成功',
icon: 'success'
});
setTimeout(() => {
uni.navigateBack({
delta: 1
});
}, 2000);
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
}
},
components: {
barX,
titleNav
}
}
},
components: {
barX,
titleNav
}
}
</script>
<style scoped lang="scss">
@import '../../assets/css/user/addressAdd.scss';
@import '../../assets/css/user/addressAdd.scss';
</style>
\ No newline at end of file
<template>
<view class="companyInfoPage">
<barX />
<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 class="companyInfoPage">
<barX />
<titleNav title="资料管理" />
</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>
<script>
import {
Api_Url
} from '@/util/api.js'
import barX from '@/components/barx.vue';
import titleNav from '@/components/title_nav.vue';
export default {
data() {
return {
id:"",
formParams:{
com_name: "",
tax_no:"" ,
com_tel: "",
com_addr: "",
contact_person:"",
contact_phone:"",
email:""
},
certification:[]
}
},
onLoad: function(options) {
this.id=options.id||""
if(this.id){
this.getData()
}
},
onShow() {
},
methods: {
getData(){
//获取用户信息
this.request(Api_Url + '/api/user/info', 'GET', {}, true).then(res => {
if (res.code == 0) {
let arr_=res.data.certification||[]
this.certification=arr_.filter(item=>item.id==this.id)
this.formParams={
...this.certification[0]
}
}
});
},
changeTab(inv_type){
this.formParams.inv_type=inv_type
console.log(this.formParams.inv_type)
},
onSwitchChange(e) {
this.formParams.is_default = e.detail.value ? 1 : 0;
},
submitI(){
if(!this.formParams.com_name){
uni.showToast({
title: '公司名称不能为空',
icon: 'none'
});
return;
}
if(!this.formParams.tax_no){
uni.showToast({
title: '公司税号不能为空',
icon: 'none'
});
return;
}
if(!this.formParams.com_tel){
uni.showToast({
title: '公司电话不能为空',
icon: 'none'
});
return;
}
if(!this.formParams.com_addr){
uni.showToast({
title: '注册地址不能为空',
icon: 'none'
});
return;
}
if(!this.formParams.contact_person){
uni.showToast({
title: '联系人不能为空',
icon: 'none'
});
return;
}
if(!this.formParams.contact_phone){
uni.showToast({
title: '联系电话不能为空',
icon: 'none'
});
return;
}
if(!this.formParams.email){
uni.showToast({
title: '邮箱不能为空',
icon: 'none'
});
return;
}
let url='/api/com/add'
if(this.id){
this.formParams.id=this.id
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
}
}
import {
Api_Url
} from '@/util/api.js'
import barX from '@/components/barx.vue';
import titleNav from '@/components/title_nav.vue';
export default {
data() {
return {
id: "",
formParams: {
com_name: "",
tax_no: "",
com_tel: "",
com_addr: "",
contact_person: "",
contact_phone: "",
email: ""
},
certification: []
}
},
onLoad: function(options) {
this.id = options.id || ""
if (this.id) {
this.getData()
}
},
onShow() {
},
methods: {
getData() {
//获取用户信息
this.request(Api_Url + '/api/user/info', 'GET', {}, true).then(res => {
if (res.code == 0) {
let arr_ = res.data.certification || []
this.certification = arr_.filter(item => item.id == this.id)
this.formParams = {
...this.certification[0]
}
}
});
},
/**
* 天眼查
*/
tianyancha() {
if (!this.formParams.com_name) { return }
this.request(Api_Url + '/api/user/tianyancha', 'GET', { company_name: this.formParams.com_name }, false).then(res => {
if (res.code == 0) {
if (!res.data.com_name) {
uni.showToast({
title: '天眼查没有查到该公司信息',
icon: 'none'
});
}
this.formParams.com_name = res.data.com_name;
this.formParams.tax_no = res.data.tax_number;
this.formParams.com_tel = res.data.phone_number;
this.formParams.com_addr = res.data.com_address;
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
},
changeTab(inv_type) {
this.formParams.inv_type = inv_type
console.log(this.formParams.inv_type)
},
onSwitchChange(e) {
this.formParams.is_default = e.detail.value ? 1 : 0;
},
submitI() {
if (!this.formParams.com_name) {
uni.showToast({
title: '公司名称不能为空',
icon: 'none'
});
return;
}
if (!this.formParams.tax_no) {
uni.showToast({
title: '公司税号不能为空',
icon: 'none'
});
return;
}
if (!this.formParams.com_tel) {
uni.showToast({
title: '公司电话不能为空',
icon: 'none'
});
return;
}
if (!this.formParams.com_addr) {
uni.showToast({
title: '注册地址不能为空',
icon: 'none'
});
return;
}
if (!this.formParams.contact_person) {
uni.showToast({
title: '联系人不能为空',
icon: 'none'
});
return;
}
if (!this.formParams.contact_phone) {
uni.showToast({
title: '联系电话不能为空',
icon: 'none'
});
return;
}
if (!this.formParams.email) {
uni.showToast({
title: '邮箱不能为空',
icon: 'none'
});
return;
}
let url = '/api/com/add'
if (this.id) {
this.formParams.id = this.id
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>
<style scoped lang="scss">
@import '../../assets/css/user/companyInfo.scss';
@import '../../assets/css/user/companyInfo.scss';
</style>
\ No newline at end of file
let _env = ""
let api_url=""
let api_url = ""
if (process.env.UNI_PLATFORM === 'h5') { // 判断是否为 H5 平台
if (process.env.NODE_ENV === 'production') { // H5 生产环境
_env = 'release'
} else {
_env = 'develop'
}
api_url = _env == 'release' ? 'https://www.iedge.net' : ''
console.log(api_url,_env)
if (process.env.NODE_ENV === 'production') { // H5 生产环境
_env = 'release'
} else {
_env = 'develop'
}
api_url = _env == 'release' ? 'https://www.iedge.net' : ''
console.log(api_url, _env)
} else if (process.env.UNI_PLATFORM === 'mp-weixin') { // 判断是否为微信小程序平台
_env = uni.getAccountInfoSync().miniProgram.envVersion //develop: trial: release:
// if (_env != 'develop') {
// _env = 'release'
// }
api_url = _env == 'release' ? 'https://www.iedge.net' : 'http://iedge.liexindev.net'
//api_url ='https://www.iedge.net'
console.log(api_url,_env)
_env = uni.getAccountInfoSync().miniProgram.envVersion //develop: trial: release:
// if (_env != 'develop') {
// _env = 'release'
// }
api_url = _env == 'release' ? 'https://www.iedge.net' : 'http://iedge.liexindev.net'
//api_url = 'https://www.iedge.net'
console.log(api_url, _env)
} else { // 其他平台(如 App 等)
}
export const Api_Url=api_url
export const Api_Url = api_url
\ No newline at end of file
export default {
data() {
return {
miniShareOptions: {
title: '爱智工业平台',
path: '/pages/index/index',
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 {
title: '爱智工业平台',
path: '/pages/index/index',
imageUrl: 'https://img.ichunt.com/images/ichunt/202503/11/8bd43dcc1b28a3fd8c417ac0c6410406.png',
success: () => {
uni.showToast({ title: '分享成功', icon: 'success' });
},
fail: () => {
uni.showToast({ title: '分享失败', icon: 'none' });
}
};
}
data() {
return {
miniShareOptions: {
title: '爱智工业平台',
path: '/pages/index/index',
imageUrl: 'https://img.ichunt.com/images/ichunt/202503/19/cdaebc710d636541b8d9916210b46a49.png',
desc: ''
}
};
},
onShareAppMessage() {
return {
...this.miniShareOptions,
success: () => {
uni.showToast({ title: '分享成功', icon: 'success' });
},
fail: () => {
uni.showToast({ title: '分享失败', icon: 'none' });
}
};
},
onShareTimeline() {
return {
title: '爱智工业平台',
path: '/pages/index/index',
imageUrl: 'https://img.ichunt.com/images/ichunt/202503/19/cdaebc710d636541b8d9916210b46a49.png',
success: () => {
uni.showToast({ title: '分享成功', icon: 'success' });
},
fail: () => {
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