|
@@ -757,12 +757,11 @@
|
|
|
},
|
|
|
async onLoad(options) {
|
|
|
if(!uni.getStorageSync('diyProduct')){
|
|
|
- const diyDetail = await this.getdiyProduct()
|
|
|
+ this.diyProduct = await this.getdiyProduct()
|
|
|
+ }else{
|
|
|
+ this.diyProduct = JSON.parse(uni.getStorageSync('diyProduct'))
|
|
|
}
|
|
|
- this.diyProduct = JSON.parse(uni.getStorageSync('diyProduct'))
|
|
|
- console.log(this.diyProduct, 'this.diyProduct')
|
|
|
this.diyProduct.price_type = this.diyProduct.price_type + ''
|
|
|
- console.log(this.diyProduct.price_type, 'this.diyProduct.price_type')
|
|
|
let that = this;
|
|
|
var pages = getCurrentPages();
|
|
|
that.returnShow = pages.length === 1 ? false : true;
|
|
@@ -934,11 +933,14 @@
|
|
|
methods: {
|
|
|
// div商品详情 用于处理bug
|
|
|
getdiyProduct() {
|
|
|
- diyProduct().then(res => {
|
|
|
- // console.log(JSON.stringify(res.data.product_detail))
|
|
|
- uni.setStorageSync('diyProduct', JSON.stringify(res.data.product_detail));
|
|
|
- Promise.resolve(res.data.product_detail)
|
|
|
+ return new Promise((resolve,reject)=>{
|
|
|
+ diyProduct().then(res => {
|
|
|
+ // console.log(JSON.stringify(res.data.product_detail))
|
|
|
+ uni.setStorageSync('diyProduct', JSON.stringify(res.data.product_detail));
|
|
|
+ resolve(res.data.product_detail);
|
|
|
+ })
|
|
|
})
|
|
|
+
|
|
|
},
|
|
|
// 获取配送方式
|
|
|
deliveryFun(e) {
|