|
@@ -22,12 +22,34 @@ Component({
|
|
|
methods: {
|
|
methods: {
|
|
|
init() {
|
|
init() {
|
|
|
this.getList()
|
|
this.getList()
|
|
|
- this.selectComponent("#ListBox").setHeight(".head", this);
|
|
|
|
|
this.setData({
|
|
this.setData({
|
|
|
- hidePrice: wx.getStorageSync('hidePrice'),
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ hidePrice: wx.getStorageSync('hidePrice'),
|
|
|
|
|
+ })
|
|
|
|
|
+ getApp().globalData.customizedProduct = this.customizedProduct.bind(this);
|
|
|
return true;
|
|
return true;
|
|
|
},
|
|
},
|
|
|
|
|
+ customizedProduct(item) {
|
|
|
|
|
+ return new Promise((resolve) => {
|
|
|
|
|
+ console.log(item)
|
|
|
|
|
+ _Http.basic({
|
|
|
|
|
+ "id": 20220924104302,
|
|
|
|
|
+ "content": {
|
|
|
|
|
+ "sa_shoppingcartid": item.sa_shoppingcartid,
|
|
|
|
|
+ "qty": item.qty,
|
|
|
|
|
+ "width": item.width,
|
|
|
|
|
+ "length": item.length
|
|
|
|
|
+ },
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ console.log("修改定制", res)
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ title: res.msg != '成功' ? res.msg : '修改成功',
|
|
|
|
|
+ icon: "none"
|
|
|
|
|
+ });
|
|
|
|
|
+ this.getList()
|
|
|
|
|
+ resolve(true)
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
/* 获取列表 */
|
|
/* 获取列表 */
|
|
|
getList() {
|
|
getList() {
|
|
|
_Http.basic({
|
|
_Http.basic({
|
|
@@ -44,6 +66,7 @@ Component({
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
console.log('购物车列表', res)
|
|
console.log('购物车列表', res)
|
|
|
this.selectComponent('#ListBox').RefreshToComplete();
|
|
this.selectComponent('#ListBox').RefreshToComplete();
|
|
|
|
|
+ this.selectComponent("#ListBox").setHeight(".head", this);
|
|
|
if (res.msg != '成功') return wx.showToast({
|
|
if (res.msg != '成功') return wx.showToast({
|
|
|
title: res.msg,
|
|
title: res.msg,
|
|
|
icon: "none"
|
|
icon: "none"
|
|
@@ -178,6 +201,12 @@ Component({
|
|
|
})
|
|
})
|
|
|
this.computeSum();
|
|
this.computeSum();
|
|
|
},
|
|
},
|
|
|
|
|
+ customization(e) {
|
|
|
|
|
+ const {
|
|
|
|
|
+ item
|
|
|
|
|
+ } = e.target.dataset;
|
|
|
|
|
+ if (item) this.selectComponent("#Custom").onClick(item)
|
|
|
|
|
+ },
|
|
|
/* 计算总价/产品领域分类 */
|
|
/* 计算总价/产品领域分类 */
|
|
|
computeSum() {
|
|
computeSum() {
|
|
|
let results = this.data.results,
|
|
let results = this.data.results,
|