Commit 5eecc271 authored by 黄奎's avatar 黄奎

页面修改

parent a38ab5d0
...@@ -16,8 +16,7 @@ ...@@ -16,8 +16,7 @@
</view> </view>
</view> </view>
</view> </view>
<scroll-view scroll-y class="sku-box" <scroll-view scroll-y class="sku-box" :style="{'max-height':x.isdateformat==1?'400px':'300px'}">
:style="{'max-height':x.isdateformat==1?'400px':'300px'}">
<view class="sku-item" v-for="(x, i) in g.attr_groups" :key="i" v-if="x.isdateformat==0"> <view class="sku-item" v-for="(x, i) in g.attr_groups" :key="i" v-if="x.isdateformat==0">
<view class="sku-title">{{ x.attr_group_name }} </view> <view class="sku-title">{{ x.attr_group_name }} </view>
<view> <view>
...@@ -31,7 +30,7 @@ ...@@ -31,7 +30,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="sku-item" v-for="(x, i) in g.attr_groups" v-if="x.isdateformat==1"> <!-- <view class="sku-item" v-for="(x, i) in g.attr_groups" v-if="x.isdateformat==1">
<view class="sku-title">{{ x.attr_group_name }} </view> <view class="sku-title">{{ x.attr_group_name }} </view>
<view> <view>
<view class="sku-chi" :style="{ <view class="sku-chi" :style="{
...@@ -43,15 +42,12 @@ ...@@ -43,15 +42,12 @@
<text class="val">{{ y.attr_name }}</text> <text class="val">{{ y.attr_name }}</text>
</view> </view>
</view> </view>
</view> </view> -->
<view class="sku-item" v-for="(x, i) in g.attr_groups" v-if="x.isdateformat==1"> <view class="sku-item" v-for="(x, i) in g.attr_groups" v-if="x.isdateformat==1">
<!--x.isdateformat=1 改成日历模式 --> <!--x.isdateformat=1 改成日历模式 -->
<view class="sku-title">{{ x.attr_group_name }} </view> <view class="sku-title">{{ x.attr_group_name }} </view>
<view> <view>
<calendar @finish="chosenDateResult" <calendar @finish="chosenDateResult" :defaultDate="x.attr_list[0].attr_name" :immediately="true" :priceList="x.attr_list"></calendar>
:defaultDate="x.attr_list[0].attr_name"
:immediately="true"
:priceList="x.attr_list"></calendar>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
...@@ -250,11 +246,10 @@ ...@@ -250,11 +246,10 @@
}, },
methods: { methods: {
chosenDateResult(result) { chosenDateResult(result) {
console.log(result,'---') for (let index = 0; index < this.g.attr_groups.length; index++) {
for(let index=0;index<this.g.attr_groups.length;index++){ for (let j = 0; j < this.g.attr_groups[index].attr_list.length; j++) {
for(let j=0;j<this.g.attr_groups[index].attr_list.length;j++){ if (this.g.attr_groups[index].attr_list[j].attr_name == result.start) {
if(this.g.attr_groups[index].attr_list[j].attr_name==result.start){ this.clickSkuItemHandler(j, index)
this.clickSkuItemHandler(j,index)
} }
} }
} }
...@@ -420,8 +415,6 @@ ...@@ -420,8 +415,6 @@
} }
}); });
} }
if (unchosen != '') { if (unchosen != '') {
this.sku = unchosen; this.sku = unchosen;
this.skuObj = null; this.skuObj = null;
...@@ -493,15 +486,13 @@ ...@@ -493,15 +486,13 @@
} }
}); });
} }
console.log("priceSign", priceSign);
console.log("sign", sign);
if (this.g.attr_groups && this.g.attr_groups.length > 0) { if (this.g.attr_groups && this.g.attr_groups.length > 0) {
this.g.attr_groups.forEach((x, index) => { this.g.attr_groups.forEach((x, index) => {
if (x.isdateformat == 1) { if (x.isdateformat == 1) {
if (x.attr_list && x.attr_list.length > 0) { if (x.attr_list && x.attr_list.length > 0) {
x.attr_list.forEach((subItem,subIndex) => { x.attr_list.forEach((subItem, subIndex) => {
var newSign = (subIndex + 1) + ":" + priceSign; var newSign = (subIndex + 1) + ":" + priceSign;
console.log("subItem",subItem);
if (this.g.attr && this.g.attr.length) { if (this.g.attr && this.g.attr.length) {
this.g.attr.forEach(y => { this.g.attr.forEach(y => {
if (y.sign_id == newSign) { if (y.sign_id == newSign) {
...@@ -512,13 +503,10 @@ ...@@ -512,13 +503,10 @@
} }
}) })
} }
console.log("x", x)
} }
}); });
} }
console.log("this.g.attr_groups", this.g.attr_groups) console.log("this.g.attr_groups", this.g.attr_groups)
if (this.g.attr && this.g.attr.length) { if (this.g.attr && this.g.attr.length) {
this.g.attr.forEach(x => { this.g.attr.forEach(x => {
if (x.sign_id == sign) { if (x.sign_id == sign) {
...@@ -526,12 +514,9 @@ ...@@ -526,12 +514,9 @@
} }
}); });
} }
if (this.skuObj != null) { if (this.skuObj != null) {
this.goodimage = this.skuObj.pic_url || this.g.cover_pic; this.goodimage = this.skuObj.pic_url || this.g.cover_pic;
this.goodprice = (parseFloat(this.skuObj.price) * parseFloat(this.gc)).toFixed(2); this.goodprice = (parseFloat(this.skuObj.price) * parseFloat(this.gc)).toFixed(2);
console.log("this.goodprice2", this.goodprice);
this.goodamount = this.skuObj.stock; this.goodamount = this.skuObj.stock;
} }
}, },
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment