|
|
@@ -30,8 +30,8 @@
|
|
|
</block>
|
|
|
</view>
|
|
|
<div class="app-footer footer-button">
|
|
|
- <button class="admin-button-com big default" @click="clearXj()">清除全部</button>
|
|
|
- <button class="admin-button-com big default" @click="goBack()" style="margin-left:58upx;padding:30upx 55upx 30upx 55upx;">返回</button>
|
|
|
+ <button class="admin-button-com big blue" @click="clearXj()">清除全部</button>
|
|
|
+ <button class="admin-button-com big blue" @click="goBack()" style="margin-left:58upx;padding:30upx 55upx 30upx 55upx;">返回</button>
|
|
|
<button class="admin-button-com big blue" @click="confirmXj()" style="margin-left:58upx;padding:30upx 65upx; 30upx 65upx;" >确认</button>
|
|
|
</div>
|
|
|
</view>
|
|
|
@@ -65,12 +65,23 @@ export default {
|
|
|
this.xjStock = this.option.stock
|
|
|
this.xjPrice = this.option.price
|
|
|
|
|
|
- let history = uni.getStorageSync("ghsColorItem"+this.option.ghsId+"_"+this.option.ptItemId)
|
|
|
- if(!this.$util.isEmpty(history)){
|
|
|
- history.forEach((item,index)=>{
|
|
|
- this.numList[item.id] = item.num
|
|
|
+ let that = this
|
|
|
+ let saveInfo = uni.getStorageSync("ghsColorItem"+this.option.ghsId)
|
|
|
+ let ptItemId = this.option.ptItemId ? this.option.ptItemId : 0
|
|
|
+ if(!this.$util.isEmpty(saveInfo)){
|
|
|
+ saveInfo.forEach((item,index)=>{
|
|
|
+ if(item.ptItemId == ptItemId){
|
|
|
+ let hasList = item.list ? item.list : []
|
|
|
+ if(!that.$util.isEmpty(hasList)){
|
|
|
+ hasList.forEach((hasItem,hasIndex)=>{
|
|
|
+ that.numList[hasItem.id] = hasItem.num
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
onPullDownRefresh() {
|
|
|
},
|
|
|
@@ -81,7 +92,13 @@ export default {
|
|
|
uni.previewImage({urls: [url]})
|
|
|
},
|
|
|
clearXj(){
|
|
|
- uni.removeStorageSync("ghsColorItem"+this.option.ghsId+"_"+this.option.ptItemId)
|
|
|
+ let that = this
|
|
|
+ this.$util.confirmModal({content:'确认全部清除?'},() => {
|
|
|
+ that.confirmClearXj()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ confirmClearXj(){
|
|
|
+ uni.removeStorageSync("ghsColorItem"+this.option.ghsId)
|
|
|
if(!this.$util.isEmpty(this.numList)){
|
|
|
this.numList.forEach((item,index,arr)=>{
|
|
|
arr[index]=''
|
|
|
@@ -153,7 +170,24 @@ export default {
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
- uni.setStorageSync("ghsColorItem"+this.option.ghsId+"_"+this.option.ptItemId, arr)
|
|
|
+ let ptItemId = this.option.ptItemId ? this.option.ptItemId : 0
|
|
|
+ let saveInfo = uni.getStorageSync("ghsColorItem"+this.option.ghsId)
|
|
|
+ if(!this.$util.isEmpty(saveInfo)){
|
|
|
+ let getIndex = -1
|
|
|
+ saveInfo.forEach((colorItem,colorIndex)=>{
|
|
|
+ if(colorItem.ptItemId == ptItemId){
|
|
|
+ getIndex = colorIndex
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(getIndex > -1){
|
|
|
+ saveInfo[getIndex].list = arr
|
|
|
+ }else{
|
|
|
+ saveInfo.push({ptItemId:ptItemId,list:arr})
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ saveInfo = [{ptItemId:ptItemId,list:arr}]
|
|
|
+ }
|
|
|
+ uni.setStorageSync("ghsColorItem"+this.option.ghsId, saveInfo)
|
|
|
|
|
|
//返回上一页带参数
|
|
|
let pages = getCurrentPages();
|
|
|
@@ -356,11 +390,5 @@ export default {
|
|
|
}
|
|
|
.footer-button{
|
|
|
height:120upx;
|
|
|
- & > button:nth-child(1){
|
|
|
- color:#999999;
|
|
|
- }
|
|
|
- & > button:nth-child(2){
|
|
|
- color:#999999;
|
|
|
- }
|
|
|
}
|
|
|
</style>
|