|
|
|
@ -162,7 +162,7 @@ |
|
|
|
<view class="voice-text">语音识别中...</view> |
|
|
|
</view> |
|
|
|
<!-- 弹出层 --> |
|
|
|
<uni-popup ref="shopPopup" background-color="#fff"> |
|
|
|
<uni-popup ref="shopPopup" background-color="#fff" @change="allChangeNum = 0"> |
|
|
|
<view class="shop-popup-content"> |
|
|
|
<view class="shop-popup-title"> |
|
|
|
<view class="shop-popup-title-left"> |
|
|
|
@ -175,18 +175,19 @@ |
|
|
|
<view class="shop-popup-title-right-box">{{goodsDetail.productSn}}</view> |
|
|
|
<view class="popup-title-right-box" style="color: darkorange;" |
|
|
|
@tap="inputDialogToggle('payDialog')"> |
|
|
|
<text style="margin-right:20rpx;color:#000;">¥{{purchasePrice}}</text> |
|
|
|
<text style="margin-right:20rpx;">修改价格</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="shop-popup-container" style="position: relative;"> |
|
|
|
|
|
|
|
<view class="shop-purchase-price" v-if="storageType == 0"> |
|
|
|
<!-- <view class="shop-purchase-price" v-if="storageType == 0"> |
|
|
|
<view style="margin-right: 20rpx;">实际价格</view> |
|
|
|
<uni-easyinput type="digit" v-model="purchasePrice" @blur="checkPay(purchasePrice)" placeholder="请输入实际价格" /> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
<view @tap="saveCheck" |
|
|
|
style="position: absolute;top: 110rpx;right: 20rpx;color: #088FEB;text-decoration: underline;"> |
|
|
|
style="position: absolute;top: 10rpx;right: 20rpx;color: #088FEB;text-decoration: underline;"> |
|
|
|
保存已选 |
|
|
|
</view> |
|
|
|
<ul style="border-top:20rpx;"> |
|
|
|
@ -197,9 +198,12 @@ |
|
|
|
<view class="shop-attrs"> |
|
|
|
<uni-data-checkbox v-model="value" :localdata="range" |
|
|
|
></uni-data-checkbox> |
|
|
|
<text v-for="(itemTag, index1) in items.value" :key="index1" |
|
|
|
<view class="suibian" v-for="(itemTag, index1) in items.value" :key="index1" |
|
|
|
@tap.stop="attrNameChange(index,itemTag.value,index1) " |
|
|
|
:class="itemTag.isChecked ? 'checkedText' : '' "> {{itemTag.value}}</text> |
|
|
|
:class="itemTag.isChecked ? 'checkedText' : '' " style="position: relative;"> |
|
|
|
{{itemTag.value}} |
|
|
|
<view class="kucun" v-if="itemTag.isKucun"></view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
@ -209,7 +213,16 @@ |
|
|
|
<text style="width: 300rpx;display: inline-block;font-size: 30rpx;font-weight: bold;padding-left: 40rpx;">规格</text> |
|
|
|
<text style="font-size: 30rpx;color: #000;font-weight: bold;width: 110rpx;display: inline-block;text-align: right;">库存</text> |
|
|
|
</view> |
|
|
|
<uni-number-box max='1000000' @minus='minusNum' @plus="plusNum" v-model="allChangeNum" @blur="allChange" /> |
|
|
|
<view class="zuni-numbox"> |
|
|
|
<view @tap="minusNum" class="zuni-numbox__minus zuni-numbox-btns" style="background: #f5f5f5;"> |
|
|
|
<text class="zuni-numbox--text">-</text> |
|
|
|
</view> |
|
|
|
<input v-model="allChangeNum" @blur="allChange" class="zuni-numbox__value" type="number" /> |
|
|
|
<view @tap="plusNum" class="zuni-numbox__plus zuni-numbox-btns" style="background: #f5f5f5;"> |
|
|
|
<text class="zuni-numbox--text">+</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- <uni-number-box max='1000000' @minus='minusNum' @plus="plusNum" v-model="allChangeNum" @blur="allChange" /> --> |
|
|
|
</view> |
|
|
|
<view class="shop-checkList" v-for="(item,index) in temporaryList" :key="index"> |
|
|
|
<view @tap.stop="delCarData(index)" style="margin-right: 20rpx;width: 7%;"> |
|
|
|
@ -246,6 +259,12 @@ |
|
|
|
<view class="popup-pay-container" @tap="checkPay(goodsDetail.wholesalePrice)"> |
|
|
|
<text style="display: inline-block">批发价:¥{{goodsDetail.wholesalePrice}}</text> |
|
|
|
</view> |
|
|
|
<view class="popup-pay-container" style="background: #fff;display: flex;width: 100%;"> |
|
|
|
<input type="digit" style="height: 100rpx;line-height: 100rpx;color:#000;width: 296rpx;" placeholder="请输入价格" |
|
|
|
@input="changePay"> |
|
|
|
<view style="flex: 1;color: #fff;background: #088FEB;border-radius: 10px;width: 144rpx;" |
|
|
|
@tap.stop="checkPay(purchasePrice)">确定</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
</view> |
|
|
|
@ -253,7 +272,8 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
var plugin = requirePlugin("WechatSI") |
|
|
|
let manager = plugin.getRecordRecognitionManager() |
|
|
|
let manager = plugin.getRecordRecognitionManager() |
|
|
|
import base from '@/utils/ossUploadFile/base64.js'; |
|
|
|
export default { |
|
|
|
components: {}, |
|
|
|
data() { |
|
|
|
@ -268,6 +288,7 @@ |
|
|
|
value: '', |
|
|
|
isInventory:true, |
|
|
|
temporaryNum: 0, |
|
|
|
customPrice: 0, //选择自定义金额 |
|
|
|
goodsDetail: [], |
|
|
|
attrNameList: [], |
|
|
|
temporaryList: [], |
|
|
|
@ -289,6 +310,8 @@ |
|
|
|
newTemList: [], |
|
|
|
pecsList: [], |
|
|
|
dataObj: new Map(), |
|
|
|
yanseList:new Map(), |
|
|
|
chimaList:new Map(), |
|
|
|
allChangeNum:0, |
|
|
|
isPlusAndMinus:false, |
|
|
|
shopName:'', |
|
|
|
@ -462,22 +485,23 @@ |
|
|
|
success: (res) => { |
|
|
|
that.hangId = item.id |
|
|
|
if(res.scanType == "QR_CODE"){ //二维码 |
|
|
|
|
|
|
|
let shopId = res.result.split(',')[1] |
|
|
|
let shopId = base.decode(res.result.split(',')[1]) |
|
|
|
if(shopId == uni.getStorageSync('shopId')){ |
|
|
|
that.productId = res.result.split(',')[0] |
|
|
|
that.toggle('bottom', res.result.split(',')[0]); |
|
|
|
that.productId = base.decode(res.result.split(',')[0]) |
|
|
|
that.toggle('bottom', base.decode(res.result.split(',')[0])); |
|
|
|
if (item.saleDetailDTOList) { |
|
|
|
for (let i = 0; i < item.saleDetailDTOList.length; i++) { |
|
|
|
that.carList.push(item.saleDetailDTOList[i]) |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
that.tui.toast('您的店铺中暂无该商品!') |
|
|
|
setTimeout(res=>{ |
|
|
|
that.tui.toast('您的店铺中暂无该商品!') |
|
|
|
},1000) |
|
|
|
} |
|
|
|
}else{ |
|
|
|
that.tui.request("/app/product/getByBarcode", "POST", { |
|
|
|
barcode:res.result |
|
|
|
barcode:base.decode(res.result) |
|
|
|
}, false, true).then((res1) => { |
|
|
|
if (res1.code == 200) { |
|
|
|
that.productId = res1.result[0].id |
|
|
|
@ -648,6 +672,10 @@ |
|
|
|
// } |
|
|
|
|
|
|
|
}, |
|
|
|
//输入商品自定义金额 |
|
|
|
changePay(e) { |
|
|
|
this.purchasePrice = e.detail.value |
|
|
|
}, |
|
|
|
temporaryChange(val) { |
|
|
|
this.zNum = 0 |
|
|
|
for (var i = 0; i < this.temporaryList.length; i++) { |
|
|
|
@ -943,15 +971,16 @@ |
|
|
|
this.$refs.payDialog.open() |
|
|
|
}, |
|
|
|
//通过商品id查询商品详细信息 |
|
|
|
getById(id) { |
|
|
|
async getById(id) { |
|
|
|
this.temporaryList = [] |
|
|
|
this.tui.request("/app/product/getById/" + id, "POST", {}, false, true).then((res) => { |
|
|
|
await this.tui.request("/app/product/getById/" + id, "POST", {}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
if(res.result.delFlag ==0 || res.result.purchasePrice==null || res.result.inStorageStatus == 0){ |
|
|
|
this.tui.toast("请将商品上架或入库后再操作!") |
|
|
|
return |
|
|
|
} |
|
|
|
this.goodsDetail = res.result; |
|
|
|
this.purchasePrice = this.goodsDetail.wholesalePrice |
|
|
|
this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", { |
|
|
|
categoryId: this.goodsDetail.categoryId |
|
|
|
}, false, true).then((res1) => { |
|
|
|
@ -996,11 +1025,43 @@ |
|
|
|
}, |
|
|
|
//库存商品详情 |
|
|
|
getKCList(id) { |
|
|
|
this.yanseList = new Map() |
|
|
|
this.chimaList = new Map() |
|
|
|
console.log('goodsDetail',this.goodsDetail) |
|
|
|
this.tui.request("/app/stock/productCount", "GET", { |
|
|
|
productId: id |
|
|
|
}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.pecsList = res.result |
|
|
|
|
|
|
|
for(let i=0;i<res.result.length;i++){ |
|
|
|
let attributeList = JSON.parse(res.result[i].attributeList) |
|
|
|
Object.keys(attributeList).forEach(key => { |
|
|
|
if(key == '颜色'){ |
|
|
|
if(this.yanseList.has(attributeList[key]) != true){ |
|
|
|
this.yanseList.set(attributeList[key],attributeList[key]) |
|
|
|
} |
|
|
|
|
|
|
|
}else{ |
|
|
|
if(this.chimaList.has(attributeList[key]) != true){ |
|
|
|
this.chimaList.set(attributeList[key],attributeList[key]) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
for(let i=0;i<this.goodsDetail.attributeList[0].value.length;i++){ //颜色 |
|
|
|
if(this.yanseList.has(this.goodsDetail.attributeList[0].value[i].value) == true){ |
|
|
|
this.goodsDetail.attributeList[0].value[i].isKucun = true |
|
|
|
} |
|
|
|
} |
|
|
|
for(let i=0;i<this.goodsDetail.attributeList[1].value.length;i++){ //尺码 |
|
|
|
if(this.chimaList.has(this.goodsDetail.attributeList[1].value[i].value) == true){ |
|
|
|
this.goodsDetail.attributeList[1].value[i].isKucun = true |
|
|
|
} |
|
|
|
} |
|
|
|
console.log('颜色',this.yanseList) |
|
|
|
console.log('尺码',this.chimaList) |
|
|
|
console.log('颜色',this.goodsDetail) |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
@ -1575,7 +1636,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
.shop-attrs { |
|
|
|
text { |
|
|
|
.suibian { |
|
|
|
display: inline-block; |
|
|
|
border: 1px solid #5fd9ee; |
|
|
|
margin: 20rpx; |
|
|
|
@ -1583,13 +1644,12 @@ |
|
|
|
margin-left: 0; |
|
|
|
background-color: #fff; |
|
|
|
color: #5fd9ee; |
|
|
|
padding: 0 10px; |
|
|
|
min-width: 100rpx; |
|
|
|
width: auto; |
|
|
|
line-height: 70rpx; |
|
|
|
line-height: 35px; |
|
|
|
height: 70rpx; |
|
|
|
text-align: center; |
|
|
|
border-radius: 20rpx; |
|
|
|
padding: 0 20rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.checkedText { |
|
|
|
@ -1650,5 +1710,52 @@ |
|
|
|
background-repeat: no-repeat; |
|
|
|
background-size: 100%; |
|
|
|
margin: 7px; |
|
|
|
} |
|
|
|
.kucun{ |
|
|
|
background: url(https://jewel-shop.oss-cn-beijing.aliyuncs.com/9428d632981647728829da336a1d24b3.png) no-repeat; |
|
|
|
width: 50rpx; |
|
|
|
height: 25rpx; |
|
|
|
position: absolute; |
|
|
|
top: -14rpx; |
|
|
|
right: -15rpx; |
|
|
|
background-size: 100%; |
|
|
|
} |
|
|
|
.zuni-numbox { |
|
|
|
height: 60rpx; |
|
|
|
display: flex; |
|
|
|
flex-direction: row; |
|
|
|
} |
|
|
|
|
|
|
|
.zuni-numbox-btns { |
|
|
|
display: flex; |
|
|
|
flex-direction: row; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
padding: 0 8px; |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
|
|
|
|
.zuni-numbox__value { |
|
|
|
margin: 0 2px; |
|
|
|
width: 40px; |
|
|
|
text-align: center; |
|
|
|
font-size: 20px; |
|
|
|
line-height: 30px; |
|
|
|
height: 60rpx; |
|
|
|
border-left-width: 0; |
|
|
|
border-right-width: 0; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.zuni-numbox--text { |
|
|
|
line-height: 20px; |
|
|
|
|
|
|
|
font-size: 32px; |
|
|
|
font-weight: 300; |
|
|
|
} |
|
|
|
|
|
|
|
.zuni-numbox .zuni-numbox--disabled { |
|
|
|
color: #c0c0c0 !important; |
|
|
|
cursor: not-allowed; |
|
|
|
} |
|
|
|
</style> |