diff --git a/manifest.json b/manifest.json index 0eebeee..3b81b26 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "惠农生活", "appid" : "__UNI__3A527D1", "description" : "", - "versionName" : "2.0.34", - "versionCode" : 2034, + "versionName" : "2.0.35", + "versionCode" : 2035, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { diff --git a/pages/columnGoods/goods_search/index.vue b/pages/columnGoods/goods_search/index.vue index b77e85b..6478b9e 100644 --- a/pages/columnGoods/goods_search/index.vue +++ b/pages/columnGoods/goods_search/index.vue @@ -218,22 +218,22 @@ }, methods: { getHistoryList(){ - userLog({ - type: this.isShop ? 2 : 1, // 1是商品搜索记录, 2是店铺搜索记录 - }).then(res=>{ - this.historyList = res.data; - }) - // try { - // this.historyList = [] - // this.tempStorage = [] - // let arr = uni.getStorageSync('historyList') - // if (arr.length > 0) { - // this.historyList = arr - // } else { - // this.historyList = [] - // } - // this.tempStorage = this.historyList - // } catch (e) {} + // userLog({ + // type: this.isShop ? 2 : 1, // 1是商品搜索记录, 2是店铺搜索记录 + // }).then(res=>{ + // this.historyList = res.data; + // }) + try { + this.historyList = [] + this.tempStorage = [] + let arr = uni.getStorageSync('historyList') + if (arr.length > 0) { + this.historyList = arr + } else { + this.historyList = [] + } + this.tempStorage = this.historyList + } catch (e) {} }, // 清空历史记录 remove() { @@ -245,12 +245,13 @@ if (res.confirm) { self.tempStorage = [] try { - userLogDelete({ - type: this.isShop ? 2 : 1, - }).then(res=>{ - console.log(res); - }) + // userLogDelete({ + // type: this.isShop ? 2 : 1, + // }).then(res=>{ + // console.log(res); + // }) self.historyList = [] + uni.setStorageSync('historyList', self.historyList); } catch (e) {} } else if (res.cancel) { console.log('用户点击取消'); @@ -292,6 +293,12 @@ this.$set(this, 'searchValue', event.detail.value); }, searchBut: function() { + if(this.searchValue!='') { + this.historyList.unshift({ + word: this.searchValue + }); + uni.setStorageSync('historyList', this.historyList); + } if (this.back) { return uni.navigateBack({ success: () => { diff --git a/pages/order_addcart/order_addcart.vue b/pages/order_addcart/order_addcart.vue index f1abdf0..1f9487d 100644 --- a/pages/order_addcart/order_addcart.vue +++ b/pages/order_addcart/order_addcart.vue @@ -176,7 +176,7 @@ @ChangCouponsUseState="ChangCouponsUseState"> - @@ -254,6 +254,7 @@ import { Toast } from '../../libs/uniApi'; }], tabsCurr: 1, subsecCurr: 0, + addcartKey: 0, domain: HTTP_REQUEST_URL, loading: false, //是否加载中 loadend: false, //是否加载完毕 @@ -299,6 +300,7 @@ import { Toast } from '../../libs/uniApi'; currSku: '', newData: {}, activeRouter: '', + attrTxt: '', userInfo: {}, mer_info: { mer_settlement_agree_status: 0 @@ -505,7 +507,7 @@ import { Toast } from '../../libs/uniApi'; // that.DefaultSelect(goods) cartProductAttr(id).then(res => { if(res.data.attr.length==0)return Toast('此商品为单规格商品'); - const sku = {} + const sku = {}; res.data.attrValue.forEach((itemn) => { if(this.tabsCurr==2) itemn.price = itemn.wholesale_price; //把价格设置为批发价 sku[itemn.sku] = itemn; @@ -520,6 +522,7 @@ import { Toast } from '../../libs/uniApi'; that.$set(that, 'productValue', sku); let productSelect = sku[that.attrValue]; that.isOpen = that.attr.cartAttr = true; + this.newVal = sku[goods.productAttr.sku] || Object.keys(sku)[0]; that.DefaultSelect(goods) }).catch(err => { return that.$util.Tips({