修复购物车多规格bug, 搜索记录bug
This commit is contained in:
parent
8850af2e9f
commit
4749269a09
@ -2,8 +2,8 @@
|
|||||||
"name" : "惠农生活",
|
"name" : "惠农生活",
|
||||||
"appid" : "__UNI__3A527D1",
|
"appid" : "__UNI__3A527D1",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "2.0.34",
|
"versionName" : "2.0.35",
|
||||||
"versionCode" : 2034,
|
"versionCode" : 2035,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
@ -218,22 +218,22 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getHistoryList(){
|
getHistoryList(){
|
||||||
userLog({
|
// userLog({
|
||||||
type: this.isShop ? 2 : 1, // 1是商品搜索记录, 2是店铺搜索记录
|
// type: this.isShop ? 2 : 1, // 1是商品搜索记录, 2是店铺搜索记录
|
||||||
}).then(res=>{
|
// }).then(res=>{
|
||||||
this.historyList = res.data;
|
// this.historyList = res.data;
|
||||||
})
|
// })
|
||||||
// try {
|
try {
|
||||||
// this.historyList = []
|
this.historyList = []
|
||||||
// this.tempStorage = []
|
this.tempStorage = []
|
||||||
// let arr = uni.getStorageSync('historyList')
|
let arr = uni.getStorageSync('historyList')
|
||||||
// if (arr.length > 0) {
|
if (arr.length > 0) {
|
||||||
// this.historyList = arr
|
this.historyList = arr
|
||||||
// } else {
|
} else {
|
||||||
// this.historyList = []
|
this.historyList = []
|
||||||
// }
|
}
|
||||||
// this.tempStorage = this.historyList
|
this.tempStorage = this.historyList
|
||||||
// } catch (e) {}
|
} catch (e) {}
|
||||||
},
|
},
|
||||||
// 清空历史记录
|
// 清空历史记录
|
||||||
remove() {
|
remove() {
|
||||||
@ -245,12 +245,13 @@
|
|||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
self.tempStorage = []
|
self.tempStorage = []
|
||||||
try {
|
try {
|
||||||
userLogDelete({
|
// userLogDelete({
|
||||||
type: this.isShop ? 2 : 1,
|
// type: this.isShop ? 2 : 1,
|
||||||
}).then(res=>{
|
// }).then(res=>{
|
||||||
console.log(res);
|
// console.log(res);
|
||||||
})
|
// })
|
||||||
self.historyList = []
|
self.historyList = []
|
||||||
|
uni.setStorageSync('historyList', self.historyList);
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
} else if (res.cancel) {
|
} else if (res.cancel) {
|
||||||
console.log('用户点击取消');
|
console.log('用户点击取消');
|
||||||
@ -292,6 +293,12 @@
|
|||||||
this.$set(this, 'searchValue', event.detail.value);
|
this.$set(this, 'searchValue', event.detail.value);
|
||||||
},
|
},
|
||||||
searchBut: function() {
|
searchBut: function() {
|
||||||
|
if(this.searchValue!='') {
|
||||||
|
this.historyList.unshift({
|
||||||
|
word: this.searchValue
|
||||||
|
});
|
||||||
|
uni.setStorageSync('historyList', this.historyList);
|
||||||
|
}
|
||||||
if (this.back) {
|
if (this.back) {
|
||||||
return uni.navigateBack({
|
return uni.navigateBack({
|
||||||
success: () => {
|
success: () => {
|
||||||
|
@ -176,7 +176,7 @@
|
|||||||
@ChangCouponsUseState="ChangCouponsUseState"></couponListWindow>
|
@ChangCouponsUseState="ChangCouponsUseState"></couponListWindow>
|
||||||
</block>
|
</block>
|
||||||
<!-- 组件 -->
|
<!-- 组件 -->
|
||||||
<addcartWindow :attr="attr" :isShow='1' :iSplus='1' :destri='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr"
|
<addcartWindow :key="addcartKey" :attr="attr" :isShow='1' :iSplus='1' :destri='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr"
|
||||||
@goCat="goCat" @attrVal="attrVal" id='product-window'></addcartWindow>
|
@goCat="goCat" @attrVal="attrVal" id='product-window'></addcartWindow>
|
||||||
<Authorize :isShowAuth="isShowAuth"></Authorize>
|
<Authorize :isShowAuth="isShowAuth"></Authorize>
|
||||||
<!--自定义底部tab栏-->
|
<!--自定义底部tab栏-->
|
||||||
@ -254,6 +254,7 @@ import { Toast } from '../../libs/uniApi';
|
|||||||
}],
|
}],
|
||||||
tabsCurr: 1,
|
tabsCurr: 1,
|
||||||
subsecCurr: 0,
|
subsecCurr: 0,
|
||||||
|
addcartKey: 0,
|
||||||
domain: HTTP_REQUEST_URL,
|
domain: HTTP_REQUEST_URL,
|
||||||
loading: false, //是否加载中
|
loading: false, //是否加载中
|
||||||
loadend: false, //是否加载完毕
|
loadend: false, //是否加载完毕
|
||||||
@ -299,6 +300,7 @@ import { Toast } from '../../libs/uniApi';
|
|||||||
currSku: '',
|
currSku: '',
|
||||||
newData: {},
|
newData: {},
|
||||||
activeRouter: '',
|
activeRouter: '',
|
||||||
|
attrTxt: '',
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
mer_info: {
|
mer_info: {
|
||||||
mer_settlement_agree_status: 0
|
mer_settlement_agree_status: 0
|
||||||
@ -505,7 +507,7 @@ import { Toast } from '../../libs/uniApi';
|
|||||||
// that.DefaultSelect(goods)
|
// that.DefaultSelect(goods)
|
||||||
cartProductAttr(id).then(res => {
|
cartProductAttr(id).then(res => {
|
||||||
if(res.data.attr.length==0)return Toast('此商品为单规格商品');
|
if(res.data.attr.length==0)return Toast('此商品为单规格商品');
|
||||||
const sku = {}
|
const sku = {};
|
||||||
res.data.attrValue.forEach((itemn) => {
|
res.data.attrValue.forEach((itemn) => {
|
||||||
if(this.tabsCurr==2) itemn.price = itemn.wholesale_price; //把价格设置为批发价
|
if(this.tabsCurr==2) itemn.price = itemn.wholesale_price; //把价格设置为批发价
|
||||||
sku[itemn.sku] = itemn;
|
sku[itemn.sku] = itemn;
|
||||||
@ -520,6 +522,7 @@ import { Toast } from '../../libs/uniApi';
|
|||||||
that.$set(that, 'productValue', sku);
|
that.$set(that, 'productValue', sku);
|
||||||
let productSelect = sku[that.attrValue];
|
let productSelect = sku[that.attrValue];
|
||||||
that.isOpen = that.attr.cartAttr = true;
|
that.isOpen = that.attr.cartAttr = true;
|
||||||
|
this.newVal = sku[goods.productAttr.sku] || Object.keys(sku)[0];
|
||||||
that.DefaultSelect(goods)
|
that.DefaultSelect(goods)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
return that.$util.Tips({
|
return that.$util.Tips({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user