111
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
<loading-state ref="pageView" @request="request">
|
||||
<view
|
||||
style="background: #fff; height: calc(100vh - 45px - 50vw);width: 100%; border-radius: 15px;display: flex;flex-direction: column; box-sizing: border-box;margin-top: -15px;box-sizing: border-box;">
|
||||
|
||||
@@ -39,11 +39,12 @@
|
||||
style="display: flex;flex-direction: column; justify-content: center;align-items: center;margin-right: 10px;"
|
||||
@click.stop="brandClick(index2)">
|
||||
|
||||
<image src="https://supervise.yxtsoft.com/lpk/image/family_icon.png" mode="aspectFill"
|
||||
:class="selectIndex2 == index2?'top_img1':'top_img2'"
|
||||
<image src="https://supervise.yxtsoft.com/lpk/image/family_icon.png"
|
||||
mode="aspectFill" :class="selectIndex2 == index2?'top_img1':'top_img2'"
|
||||
style="width: 60px;height:60px;border-radius: 50%;padding:5px;"></image>
|
||||
|
||||
<text :class="selectIndex2 == index2?'top_text1':'top_text2'">{{item.brandName}}</text>
|
||||
<text
|
||||
:class="selectIndex2 == index2?'top_text1':'top_text2'">{{item.brandName}}</text>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
@@ -65,7 +66,8 @@
|
||||
|
||||
<text style="font-size: 13px;color: #000;">{{item.name}}</text>
|
||||
|
||||
<text style="font-size: 10px;color: #999;margin-top: 5px;">{{item.remark}}</text>
|
||||
<text
|
||||
style="font-size: 10px;color: #999;margin-top: 5px;">{{item.remark}}</text>
|
||||
|
||||
<view
|
||||
style="display: flex;flex-direction: row;align-items: center;margin-top: 8px;">
|
||||
@@ -126,13 +128,14 @@
|
||||
<view id="bomView"
|
||||
style="display: flex;flex-direction: row;align-items: center; margin-left: 15px;">
|
||||
<view style="color: #888;font-size: 10px;height: 10px;line-height: 10px;margin-top: 5px;">
|
||||
温馨提示:已定制了</view>
|
||||
<view style="color: #FF5006;font-size: 15px;height: 15px;line-height: 15px;font-weight: bold;">
|
||||
温馨提示:已订</view>
|
||||
<view
|
||||
style="color: #FF5006;font-size: 15px;height: 15px;line-height: 15px;font-weight: bold;">
|
||||
{{page.weight}}斤
|
||||
</view>
|
||||
|
||||
<view style="color: #888;font-size: 10px;height: 10px;line-height: 10px;margin-top: 5px;">
|
||||
,100-200斤有配送费,200斤以上免运费。</view>
|
||||
,100起订,200斤以上免配送费</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -162,9 +165,12 @@
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
</loading-state>
|
||||
|
||||
|
||||
|
||||
<uni-popup ref="inputDialog" type="dialog">
|
||||
<uni-popup-dialog ref="inputClose" mode="base" title="订购协议" :showConfirm="true"
|
||||
:beforeClose="dialogBeforeClose" @confirm="dialogInputConfirm" :content="dialogContent"
|
||||
@@ -228,6 +234,7 @@
|
||||
initReduce: "0",
|
||||
initWeight: "0",
|
||||
shareSid: "",
|
||||
baseDataSuccess: false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
@@ -237,8 +244,10 @@
|
||||
})
|
||||
|
||||
}
|
||||
this.getAllPriceOrWeight()
|
||||
// 状态对才获取
|
||||
if (this.changeLoading) {
|
||||
this.getgoods()
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
@@ -279,30 +288,34 @@
|
||||
},
|
||||
|
||||
brandClick(val) {
|
||||
|
||||
this.selectIndex2 = val
|
||||
this.request()
|
||||
|
||||
this.getgoods()
|
||||
},
|
||||
request() {
|
||||
|
||||
if (this.baseDataSuccess) {
|
||||
this.getgoods()
|
||||
} else {
|
||||
let _this = this
|
||||
_this.$api.getGoodsTypeAndBrand(_this.brandType).then((resp) => {
|
||||
console.log("------------", resp);
|
||||
_this.data = resp
|
||||
_this.searchInfo.sid = _this.data[0].sid
|
||||
_this.selectIndex = 0
|
||||
console.log("======", resp);
|
||||
_this.baseDataSuccess = true
|
||||
_this.getgoods()
|
||||
_this.getAllPriceOrWeight()
|
||||
_this.scrollLeftTop = _this.scrollLeftTop == 0 ? -1 : 0
|
||||
_this.scrollRightTop = _this.scrollRightTop == 0 ? -1 : 0
|
||||
}).catch(e => {})
|
||||
}).catch(e => {
|
||||
_this.$nextTick(() => {
|
||||
_this.$refs.pageView.setLoadState(1)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
getAllPriceOrWeight() {
|
||||
let _this = this
|
||||
|
||||
var params = {
|
||||
customerSid: getApp().globalData.sid,
|
||||
affiliation: this.brandType,
|
||||
affiliation: this.data.brandVos[this.selectIndex2].id,
|
||||
}
|
||||
|
||||
_this.$api.getGoodsWeight(params).then((resp) => {
|
||||
@@ -314,17 +327,31 @@
|
||||
_this.initPrice = resp.totalPrice
|
||||
_this.initWeight = resp.totalWeight
|
||||
|
||||
}).catch(e => {})
|
||||
_this.$nextTick(() => {
|
||||
_this.$refs.pageView.setLoadState(2)
|
||||
})
|
||||
|
||||
}).catch(e => {
|
||||
_this.$nextTick(() => {
|
||||
_this.$refs.pageView.setLoadState(1)
|
||||
})
|
||||
})
|
||||
},
|
||||
getgoods() {
|
||||
let _this = this
|
||||
|
||||
_this.searchInfo.customerSid = getApp().globalData.sid
|
||||
_this.searchInfo.affiliation = this.brandType
|
||||
_this.searchInfo.brandId = this.data.brandVos[this.selectIndex2].id
|
||||
_this.searchInfo.categoryId = this.data.typeVos[this.selectIndex].id
|
||||
|
||||
_this.$api.getGoodsByType(_this.searchInfo).then((resp) => {
|
||||
_this.goods = resp
|
||||
}).catch(e => {})
|
||||
_this.getAllPriceOrWeight()
|
||||
}).catch(e => {
|
||||
_this.$nextTick(() => {
|
||||
_this.$refs.pageView.setLoadState(1)
|
||||
})
|
||||
})
|
||||
},
|
||||
itemShow(item) {
|
||||
item.showCart = true
|
||||
@@ -370,8 +397,7 @@
|
||||
console.log('用户点击确定')
|
||||
item.goodsNumber = 0
|
||||
item.subtotal = 0
|
||||
that.getallPrice()
|
||||
that.getweight()
|
||||
|
||||
that.upDateShoppCart(item)
|
||||
} else if (res.cancel) {
|
||||
|
||||
@@ -385,8 +411,7 @@
|
||||
}
|
||||
|
||||
item.subtotal = Number(item.goodsNumber) * Number(item.mefenPrice)
|
||||
that.getallPrice()
|
||||
that.getweight()
|
||||
|
||||
that.upDateShoppCart(item)
|
||||
}
|
||||
},
|
||||
@@ -395,8 +420,6 @@
|
||||
item.goodsNumber = Number(item.goodsNumber) + 1
|
||||
item.subtotal = Number(item.goodsNumber) * Number(item.mefenPrice)
|
||||
|
||||
this.getallPrice()
|
||||
this.getweight()
|
||||
this.upDateShoppCart(item)
|
||||
},
|
||||
|
||||
@@ -453,7 +476,7 @@
|
||||
goodsSid: item.goodsSid,
|
||||
goodsName: item.name,
|
||||
goodsNumber: item.goodsNumber,
|
||||
affiliation: this.brandType,
|
||||
affiliation: this.data.brandVos[this.selectIndex2].id,
|
||||
price: item.mefenPrice,
|
||||
weight: item.weight,
|
||||
customerSid: getApp().globalData.sid
|
||||
@@ -461,8 +484,10 @@
|
||||
|
||||
let _this = this
|
||||
_this.$api.addShoppingCart(good).then((resp) => {
|
||||
|
||||
}).catch(e => {})
|
||||
_this.getgoods()
|
||||
}).catch(e => {
|
||||
_this.getgoods()
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user