|
|
@ -62,10 +62,22 @@ |
|
|
|
<view style="height: 15vw; width: 100%; display: flex;flex-direction: column;position: fixed;bottom: 0;overflow:hidden; |
|
|
|
justify-content: center;align-items: center; background: #fff;padding-top: 10px;padding-bottom: 10px;"> |
|
|
|
|
|
|
|
<view style="display: flex;flex-direction: row;align-items: center;"> |
|
|
|
<view style="color: #888;font-size: 10px;">温馨提示:已定制了</view> |
|
|
|
<view style="color: #FF5006;font-size: 15px;">{{page.weight}}斤</view> |
|
|
|
<view style="color: #888;font-size: 10px;">,满200斤可定制云菜窖</view> |
|
|
|
<view id="bomView" style="display: flex;flex-direction: row;align-items: center;"> |
|
|
|
<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;"> |
|
|
|
{{page.weight}}斤 |
|
|
|
</view> |
|
|
|
|
|
|
|
<view style="color: #888;font-size: 10px;height: 10px;line-height: 10px;margin-top: 5px;"> |
|
|
|
,{{page.qssl}}起订。</view> |
|
|
|
<view style="display: flex;flex-direction: row;align-items: center;" @click="showPop()"> |
|
|
|
<text |
|
|
|
style="color: #6190D8;font-size: 10px;height: 10px;line-height: 10px;margin-top: 5px;text-decoration:underline;font-style:oblique;"> |
|
|
|
起订协议</text> |
|
|
|
<text style="color: #6190D8;font-size: 10px;height: 10px;line-height: 10px;margin-top: 5px;"> |
|
|
|
>></text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view |
|
|
@ -73,14 +85,15 @@ |
|
|
|
|
|
|
|
|
|
|
|
<view |
|
|
|
style="border: 1px #FF5006 solid;margin-left: 5px;margin-right: 5px;padding: 5px 40px 5px 15px; |
|
|
|
display: flex;flex-direction: row;align-items: center;border-top-left-radius: 25px; border-bottom-left-radius: 25px;" |
|
|
|
@click="gotoCart()"> |
|
|
|
style="border: 1px #FF5006 solid;margin-left: 5px;margin-right: 5px;padding: 5px 40px 5px 15px; flex: 1; |
|
|
|
display: flex;flex-direction: row;align-items: center;border-top-left-radius: 25px; border-bottom-left-radius: 25px;"> |
|
|
|
<image src="../../static/shoppCart_icon.png" mode="aspectFill" |
|
|
|
style="height: 20px;width: 25px;"> |
|
|
|
style="height: 20px;width: 20px;flex-shrink: 0;"> |
|
|
|
</image> |
|
|
|
<text style="font-size: 15px;color: #FF5006;margin-left: 10px; ">¥{{page.price}}</text> |
|
|
|
<text style="font-size: 10px;color: #666;margin-left: 10px; ">共减:¥{{page.reduce}}</text> |
|
|
|
<view style="display: flex;flex-direction: column;flex: 1;"> |
|
|
|
<text style="font-size: 15px;color: #FF5006;margin-left: 10px; ">¥{{page.price}}</text> |
|
|
|
<text style="font-size: 10px;color: #666;margin-left: 10px; ">{{page.remarks}}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<text style="background: #FF9900; color: #fff;font-size: 13px; padding: 8px 15px; |
|
|
|
border: 1px #FF5006 solid; border-top-right-radius: 25px; border-bottom-right-radius: 25px;" |
|
|
@ -90,6 +103,13 @@ |
|
|
|
|
|
|
|
</view> |
|
|
|
</loading-state> |
|
|
|
|
|
|
|
<uni-popup ref="inputDialog" type="dialog"> |
|
|
|
<uni-popup-dialog ref="inputClose" mode="base" title="起订协议" :showConfirm="true" |
|
|
|
:beforeClose="dialogBeforeClose" @confirm="dialogInputConfirm" |
|
|
|
content="1、20斤起订量。\n2、新用户正好20斤5折。\n3、20-100斤加10%附加额。\n4、101斤-200斤加5%附加额。"></uni-popup-dialog> |
|
|
|
</uni-popup> |
|
|
|
|
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
@ -97,11 +117,14 @@ |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
dialogBeforeClose: false, |
|
|
|
page: { |
|
|
|
affiliation: '', |
|
|
|
weight: "0", |
|
|
|
price: "0", |
|
|
|
reduce: "0" |
|
|
|
reduce: "0", |
|
|
|
remarks: "", |
|
|
|
qssl: "" |
|
|
|
}, |
|
|
|
data: [ |
|
|
|
|
|
|
@ -110,10 +133,20 @@ |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
this.page.affiliation = options.affiliation |
|
|
|
this.page.qssl = options.weight |
|
|
|
console.log(" options", options); |
|
|
|
this.request() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
showPop() { |
|
|
|
|
|
|
|
this.$refs.inputDialog.open() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
dialogInputConfirm() { |
|
|
|
this.dialogBeforeClose = true |
|
|
|
}, |
|
|
|
request() { |
|
|
|
let _this = this |
|
|
|
|
|
|
@ -126,12 +159,10 @@ |
|
|
|
console.log("resp", resp); |
|
|
|
_this.data = resp |
|
|
|
|
|
|
|
_this.getallPrice() |
|
|
|
_this.getweight() |
|
|
|
// _this.getallPrice() |
|
|
|
// _this.getweight() |
|
|
|
_this.getAllPriceOrWeight() |
|
|
|
|
|
|
|
_this.$nextTick(() => { |
|
|
|
_this.$refs.pageView.setLoadState(2) |
|
|
|
}) |
|
|
|
// 无数据 |
|
|
|
if (_this.data.length == 0) { |
|
|
|
_this.$nextTick(() => { |
|
|
@ -169,8 +200,8 @@ |
|
|
|
const index = that.data.findIndex((info) => info.goodsSid === item.goodsSid) |
|
|
|
console.log("index》》》》", index) |
|
|
|
that.data.splice(index, 1) |
|
|
|
that.getallPrice() |
|
|
|
that.getweight() |
|
|
|
// that.getallPrice() |
|
|
|
// that.getweight() |
|
|
|
that.upDateShoppCart(item) |
|
|
|
} else if (res.cancel) { |
|
|
|
|
|
|
@ -184,8 +215,8 @@ |
|
|
|
} |
|
|
|
|
|
|
|
item.totalPrice = Number(item.goodsNumber) * Number(item.price) |
|
|
|
that.getallPrice() |
|
|
|
that.getweight() |
|
|
|
// that.getallPrice() |
|
|
|
// that.getweight() |
|
|
|
that.upDateShoppCart(item) |
|
|
|
} |
|
|
|
|
|
|
@ -195,12 +226,42 @@ |
|
|
|
item.goodsNumber = Number(item.goodsNumber) + 1 |
|
|
|
item.totalPrice = Number(item.goodsNumber) * Number(item.price) |
|
|
|
|
|
|
|
this.getallPrice() |
|
|
|
this.getweight() |
|
|
|
// this.getallPrice() |
|
|
|
// this.getweight() |
|
|
|
this.upDateShoppCart(item) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getAllPriceOrWeight() { |
|
|
|
let _this = this |
|
|
|
|
|
|
|
var params = { |
|
|
|
customerSid: getApp().globalData.sid, |
|
|
|
brandId: this.page.affiliation, |
|
|
|
} |
|
|
|
|
|
|
|
_this.$api.getGoodsWeight(params).then((resp) => { |
|
|
|
console.log("getGoodsWeight", resp); |
|
|
|
|
|
|
|
_this.page.price = resp.totalPrice |
|
|
|
_this.page.weight = resp.totalWeight |
|
|
|
_this.page.remarks = resp.remarks |
|
|
|
|
|
|
|
_this.initPrice = resp.totalPrice |
|
|
|
_this.initWeight = resp.totalWeight |
|
|
|
|
|
|
|
_this.$nextTick(() => { |
|
|
|
_this.$refs.pageView.setLoadState(2) |
|
|
|
}) |
|
|
|
|
|
|
|
}).catch(e => { |
|
|
|
_this.$nextTick(() => { |
|
|
|
_this.$refs.pageView.setLoadState(1) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getallPrice() { |
|
|
|
|
|
|
|
let num = 0; |
|
|
@ -236,54 +297,39 @@ |
|
|
|
|
|
|
|
let _this = this |
|
|
|
_this.$api.addShoppingCart(good).then((resp) => { |
|
|
|
|
|
|
|
}).catch(e => {}) |
|
|
|
_this.getAllPriceOrWeight() |
|
|
|
}).catch(e => { |
|
|
|
_this.$nextTick(() => { |
|
|
|
_this.$refs.pageView.setLoadState(1) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
settlement() { |
|
|
|
// 支付 |
|
|
|
|
|
|
|
if (this.page.weight < 200) { |
|
|
|
this.shortToast('满200斤才可定制云菜窖哦,请继续选菜吧。') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let list = [] |
|
|
|
|
|
|
|
for (var i = 0; i < this.goods.length; i++) { |
|
|
|
var item = this.data[i] |
|
|
|
if (item.goodsNumber > 0) |
|
|
|
list.push({ |
|
|
|
goodsSid: item.goodsSid, |
|
|
|
goodsName: item.name, |
|
|
|
partNumber: item.goodsNumber, |
|
|
|
numofPart: item.weight, |
|
|
|
priceUnit: item.jprice, |
|
|
|
pricePart: item.mefenPrice, |
|
|
|
}) |
|
|
|
} |
|
|
|
// console.log("ddd", list); |
|
|
|
|
|
|
|
if (list.length == 0) { |
|
|
|
this.shortToast('请添加商品') |
|
|
|
if (this.page.weight < parseInt(this.page.qssl)) { |
|
|
|
this.shortToast('满' + this.page.qssl + '斤才可定制云菜窖哦,请继续选菜吧。') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
var params = { |
|
|
|
customerSid: getApp().globalData.sid, |
|
|
|
cardNumber: 1, |
|
|
|
// cardNumber: 1, |
|
|
|
brandId: this.page.affiliation, |
|
|
|
totalTee: this.page.price, |
|
|
|
ordOrderDetailsVoList: list |
|
|
|
|
|
|
|
// ordOrderDetailsVoList: list |
|
|
|
} |
|
|
|
// console.log("params", params); |
|
|
|
console.log("params", params); |
|
|
|
|
|
|
|
let _this = this |
|
|
|
_this.$api.createOrder(params).then((resp) => { |
|
|
|
// _this.$api.createVegeOrder(params).then((resp) => { |
|
|
|
|
|
|
|
// console.log("resp", resp); |
|
|
|
this.$pay(resp) |
|
|
|
}).catch(e => {}) |
|
|
|
// // console.log("resp", resp); |
|
|
|
// this.$pay(resp) |
|
|
|
// }).catch(e => { |
|
|
|
// }) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|