|
@@ -96,7 +96,8 @@
|
|
|
:show="showPopu"
|
|
|
:round="true"
|
|
|
:z-index="100"
|
|
|
- position="bottom"
|
|
|
+ position="center"
|
|
|
+ customStyle="right: 0; left: 0; top: 0; bottom: 0; margin: auto 10%;width: fit-content;height: fit-content;border-radius:15px;"
|
|
|
@afterleave="closePopu">
|
|
|
<view class="popu-content" v-if="detail">
|
|
|
<view class="popu-close" @click="showPopu=false">
|
|
@@ -115,19 +116,19 @@
|
|
|
¥<text>{{detail.priceStr[0]}}</text>.{{detail.priceStr[1]}}
|
|
|
</view>
|
|
|
<view class="popu-content-price" v-else>¥***</view>
|
|
|
- <view class="flex align_center rebate-tag" v-if="detail.promoType=='BUY_PROD_GIVE_VALID'">
|
|
|
+ <view class="flex align_center rebate-tag" v-if="hasLogin&&detail.promoType=='BUY_PROD_GIVE_VALID'">
|
|
|
返<text>{{detail.resultValue}}</text>元
|
|
|
</view>
|
|
|
- <view class="flex align_center rebate-tag" v-if="detail.promoType=='BUY_PROD_GIVE_PROD'">
|
|
|
+ <view class="flex align_center rebate-tag" v-if="hasLogin&&detail.promoType=='BUY_PROD_GIVE_PROD'">
|
|
|
买{{detail.conditionValue}}赠{{detail.resultValue}}
|
|
|
</view>
|
|
|
- <view class="flex align_center tejia-tag" v-if="detail.promoType=='PROMO_PROD'">
|
|
|
+ <view class="flex align_center tejia-tag" v-if="hasLogin&&detail.promoType=='PROMO_PROD'">
|
|
|
特价<text>¥{{detail.orginPrice}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="popu-content-num flex align_center justify_end">
|
|
|
+ <view class="popu-content-num flex align_center justify_between">
|
|
|
<text>数量</text>
|
|
|
- <uni-number-box v-model="qty" :min="1" :max="999999"></uni-number-box>
|
|
|
+ <u-number-box v-model="qty" :input-width="100" :input-height="60" :min="1" :max="999"></u-number-box>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -151,9 +152,9 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="popu-content-btn">
|
|
|
- <view class="popu-content-btn-item" @click="toBuy">确定采购</view>
|
|
|
+ <view class="popu-content-btn-item cancelBtn" @click="showPopu=false">取消</view>
|
|
|
+ <view class="popu-content-btn-item okbtn" @click="toBuy">确定采购</view>
|
|
|
</view>
|
|
|
- <view :style="{height:safeAreaBottom+'px'}"></view>
|
|
|
</view>
|
|
|
</page-container>
|
|
|
</view>
|
|
@@ -254,10 +255,14 @@
|
|
|
}).then(res => {
|
|
|
if(res.status == 200){
|
|
|
this.detail = res.data
|
|
|
- if(res.data && res.data.productPicList){
|
|
|
- res.data.productPicList.forEach(item => {
|
|
|
- this.imgList.push(item.imageUrl||'/static/def_imgs.png')
|
|
|
- })
|
|
|
+ if(res.data){
|
|
|
+ if(res.data.productPicList){
|
|
|
+ res.data.productPicList.forEach(item => {
|
|
|
+ this.imgList.push(item.imageUrl||'/static/def_imgs.png')
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.imgList.push(res.data.productMsg||'/static/def_imgs.png')
|
|
|
+ }
|
|
|
const a = res.data.shopPromoProduct
|
|
|
let bprice = res.data.price
|
|
|
if(a){
|
|
@@ -281,8 +286,6 @@
|
|
|
}
|
|
|
}
|
|
|
res.data.priceStr = Number(bprice).toFixed(2).toString().split('.')
|
|
|
- }else{
|
|
|
- this.imgList.push(res.data.productMsg||'/static/def_imgs.png')
|
|
|
}
|
|
|
}
|
|
|
uni.hideLoading()
|
|
@@ -372,41 +375,41 @@
|
|
|
qty: this.qty,
|
|
|
price:this.detail.price,
|
|
|
}]}).then(res => {
|
|
|
- uni.hideLoading()
|
|
|
- if(res.status == 200){
|
|
|
- const successList = res.data.successList.map(item => {
|
|
|
- return {
|
|
|
- productSn:item.productSn,
|
|
|
- productCode: item.productCode,
|
|
|
- qty: item.qty,
|
|
|
- price:item.price
|
|
|
- }
|
|
|
- })
|
|
|
- const removeList = res.data.removeList.map(item => item.productCode)
|
|
|
- const selloutList = res.data.selloutList.map(item => item.productCode)
|
|
|
- // 有已下架或已售罄产品提示
|
|
|
- if(removeList.length || selloutList.length){
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: (removeList.length ? `产品${removeList.join(',')}已下架,`:'')+(selloutList.length?`产品${selloutList.join(',')}已售罄,`:'')+`不可采购。`+(successList.length?'是否继续采购其他产品?':''),
|
|
|
- showCancel: successList.length,
|
|
|
- confirmText: successList.length?'确定':'知道了',
|
|
|
- success(ret) {
|
|
|
- if(ret.confirm && successList.length){
|
|
|
- _this.submitForm(successList)
|
|
|
+ uni.hideLoading()
|
|
|
+ if(res.status == 200){
|
|
|
+ const successList = res.data.successList.map(item => {
|
|
|
+ return {
|
|
|
+ productSn:item.productSn,
|
|
|
+ productCode: item.productCode,
|
|
|
+ qty: item.qty,
|
|
|
+ price:item.price
|
|
|
}
|
|
|
+ })
|
|
|
+ const removeList = res.data.removeList.map(item => item.productCode)
|
|
|
+ const selloutList = res.data.selloutList.map(item => item.productCode)
|
|
|
+ // 有已下架或已售罄产品提示
|
|
|
+ if(removeList.length || selloutList.length){
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: (removeList.length ? `产品${removeList.join(',')}已下架,`:'')+(selloutList.length?`产品${selloutList.join(',')}已售罄,`:'')+`不可采购。`+(successList.length?'是否继续采购其他产品?':''),
|
|
|
+ showCancel: successList.length,
|
|
|
+ confirmText: successList.length?'确定':'知道了',
|
|
|
+ success(ret) {
|
|
|
+ if(ret.confirm && successList.length){
|
|
|
+ _this.submitForm(successList)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ // 直接提交
|
|
|
+ _this.submitForm(successList)
|
|
|
}
|
|
|
- })
|
|
|
- }else{
|
|
|
- // 直接提交
|
|
|
- _this.submitForm(successList)
|
|
|
- }
|
|
|
- }else{
|
|
|
- uni.showToast({
|
|
|
- title: res.message,
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
- }
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title: res.message,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
submitForm(detailList){
|
|
@@ -677,7 +680,6 @@
|
|
|
}
|
|
|
.pupu-box{
|
|
|
display: flex;
|
|
|
- align-items: center;
|
|
|
justify-content: space-between;
|
|
|
margin-top: 35px;
|
|
|
width: 100%;
|
|
@@ -686,12 +688,14 @@
|
|
|
border-radius: 6px;
|
|
|
border: 1px solid #eee;
|
|
|
overflow: hidden;
|
|
|
+ width: 80px;
|
|
|
+ height: 80px;
|
|
|
}
|
|
|
.popu-content-info{
|
|
|
padding: 0 0 0 10px;
|
|
|
flex-grow: 1;
|
|
|
overflow: hidden;
|
|
|
- width: 80%;
|
|
|
+ width: 50%;
|
|
|
.popu-content-info-title{
|
|
|
font-size: 14px;
|
|
|
}
|
|
@@ -735,7 +739,7 @@
|
|
|
.popu-content-num{
|
|
|
font-size: 12px;
|
|
|
color: #999999;
|
|
|
- padding: 0 10px;
|
|
|
+ padding: 10px 0;
|
|
|
> text{
|
|
|
margin-right: 10px;
|
|
|
font-size: 10px;
|
|
@@ -745,19 +749,25 @@
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- justify-content: center;
|
|
|
- margin-top: 20px;
|
|
|
+ justify-content: space-around;
|
|
|
+ margin: 20px 0 10px;
|
|
|
.popu-content-btn-item{
|
|
|
- width: 60%;
|
|
|
- height: 40px;
|
|
|
- background-color: #f70000;
|
|
|
- color: #FFFFFF;
|
|
|
+ width: 45%;
|
|
|
+ height: 36px;
|
|
|
font-size: 14px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
border-radius: 100px;
|
|
|
}
|
|
|
+ .cancelBtn{
|
|
|
+ background-color: #f8f8f8;
|
|
|
+ color: #666;
|
|
|
+ }
|
|
|
+ .okbtn{
|
|
|
+ background-color: #f70000;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|