11111111
This commit is contained in:
@@ -52,17 +52,17 @@
|
||||
<input maxlength="20" placeholder="请输入/扫码"
|
||||
style="font-size: 30rpx;flex: 1;margin-right: 20px;padding-left: 10px;" type="number"
|
||||
:value="page.code" @input="onKeyInput1" />
|
||||
<view style="width: 1px;height: 20px;background: #ccc; margin-right: 10px;"></view>
|
||||
<!-- <view style="width: 1px;height: 20px;background: #ccc; margin-right: 10px;"></view>
|
||||
<uni-icons type="camera-filled" color="#c0c4cc" size="22" style="flex-shrink: 0;margin-right: 10px;"
|
||||
@click="scan" />
|
||||
@click="scan" /> -->
|
||||
</view>
|
||||
<text style="margin-left: 8px;font-size: 14px;color: #333;margin-top: 20px;">提货密码</text>
|
||||
<!-- <text style="margin-left: 8px;font-size: 14px;color: #333;margin-top: 20px;">提货密码</text>
|
||||
<view style="display: flex;flex-direction: row;justify-content: space-between;
|
||||
background: #F8F8F8;border-radius: 5px; padding:10px 0px;
|
||||
box-sizing: border-box;width: calc(100vw - 40px);align-items: center;margin-top: 10px;">
|
||||
<input maxlength="6" placeholder="请输入提货密码" style="font-size: 30rpx;flex: 1;padding-left: 10px;"
|
||||
type="number" :value="page.codeKey" @input="onKeyInput2" />
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view style="background: -webkit-linear-gradient(left,#FFB176,#FE923B); position: absolute; bottom: 30px;
|
||||
width: 90%;border-radius: 100rpx;height: 80rpx;display: flex;
|
||||
|
||||
@@ -55,17 +55,17 @@
|
||||
<input maxlength="20" placeholder="请输入/扫码"
|
||||
style="font-size: 30rpx;flex: 1;margin-right: 20px;padding-left: 10px;" type="number"
|
||||
:value="page.code" @input="onKeyInput1" />
|
||||
<view style="width: 1px;height: 20px;background: #ccc; margin-right: 10px;"></view>
|
||||
<!-- <view style="width: 1px;height: 20px;background: #ccc; margin-right: 10px;"></view>
|
||||
<uni-icons type="camera-filled" color="#c0c4cc" size="22" style="flex-shrink: 0;margin-right: 10px;"
|
||||
@click="scan" />
|
||||
@click="scan" /> -->
|
||||
</view>
|
||||
<text style="margin-left: 8px;font-size: 14px;color: #333;margin-top: 20px;">提货密码</text>
|
||||
<!-- <text style="margin-left: 8px;font-size: 14px;color: #333;margin-top: 20px;">提货密码</text>
|
||||
<view style="display: flex;flex-direction: row;justify-content: space-between;
|
||||
background: #F8F8F8;border-radius: 5px; padding:10px 0px;
|
||||
box-sizing: border-box;width: calc(100vw - 40px);align-items: center;margin-top: 10px;">
|
||||
<input maxlength="6" placeholder="请输入提货密码" style="font-size: 30rpx;flex: 1;padding-left: 10px;"
|
||||
type="number" :value="page.codeKey" @input="onKeyInput2" />
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view style="background: -webkit-linear-gradient(left,#FFB176,#FE923B); position: absolute; bottom: 30px;
|
||||
width: 90%;border-radius: 100rpx;height: 80rpx;display: flex;
|
||||
|
||||
@@ -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 => {
|
||||
// })
|
||||
|
||||
},
|
||||
|
||||
|
||||
@@ -110,8 +110,8 @@
|
||||
|
||||
<view class="bottom">
|
||||
|
||||
<view style="display: flex;flex-direction: row;align-items: center; padding-left: 30px;">
|
||||
<view style="width: 35px;height: 35px;position: relative; visibility: hidden; ">
|
||||
<view style="display: flex;flex-direction: row;align-items: center; justify-content: center;">
|
||||
<!-- <view style="width: 35px;height: 35px;position: relative; visibility: hidden; ">
|
||||
|
||||
<image style="width: 25px;height: 25px;margin-left: 5px; margin-top: 5px; "
|
||||
src="../../static/basket_icon.png" mode="aspectFill"></image>
|
||||
@@ -123,7 +123,7 @@
|
||||
padding: 2px 5px;
|
||||
width: auto;">{{page.count}}</view>
|
||||
|
||||
</view>
|
||||
</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;">
|
||||
@@ -135,6 +135,16 @@
|
||||
|
||||
<view style="color: #888;font-size: 10px;height: 10px;line-height: 10px;margin-top: 5px;">
|
||||
,{{data.brandVos[selectIndex2].qssl}}起订。</view>
|
||||
|
||||
<view style="display: flex;flex-direction: row;align-items: center;" @click="showPop2()">
|
||||
<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>
|
||||
|
||||
@@ -152,7 +162,7 @@
|
||||
<text
|
||||
style="font-size: 15px;color: #FF5006;margin-left: 10px;height: 20px;line-height: 20px;margin-top: 5px;font-weight: bold;">¥{{page.price}}</text>
|
||||
<text
|
||||
style="font-size: 10px;color: #666;margin-left: 10px; height: 10px;line-height: 10px;margin-bottom: 5px;">配送费:¥{{page.reduce}}</text>
|
||||
style="font-size: 10px;color: #666;margin-left: 10px; height: 10px;line-height: 10px;margin-bottom: 5px;">{{page.remarks}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -176,6 +186,12 @@
|
||||
:content="data.brandVos[selectIndex2].dgxy" :confirm-text="confirmText"></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
|
||||
<uni-popup ref="inputDialog2" type="dialog">
|
||||
<uni-popup-dialog ref="inputClose" mode="base" title="起订协议" :showConfirm="true"
|
||||
:beforeClose="dialogBeforeClose2" @confirm="dialogInputConfirm2"
|
||||
content="1、20斤起订量。\n2、新用户正好20斤5折。\n3、20-100斤加10%附加额。\n4、101斤-200斤加5%附加额。"></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
@@ -187,6 +203,7 @@
|
||||
dialogContent: "这里是协议内容,这里是协议内容,这里是协议内容,这里是协议内容,这里是协议内容,这里是协议内容,这里是协议内容,这里是协议内容这里是协议内容,这里是协议内容",
|
||||
confirmText: "我知道了(5s)",
|
||||
dialogBeforeClose: false,
|
||||
dialogBeforeClose2: false,
|
||||
countdown: 5,
|
||||
searchInfo: {
|
||||
sid: "0",
|
||||
@@ -212,6 +229,7 @@
|
||||
reduce: "0",
|
||||
weight: "0",
|
||||
count: "0",
|
||||
remarks: "",
|
||||
startHeight: 0,
|
||||
endHeight: 0
|
||||
},
|
||||
@@ -312,6 +330,7 @@
|
||||
|
||||
_this.page.price = resp.totalPrice
|
||||
_this.page.weight = resp.totalWeight
|
||||
_this.page.remarks = resp.remarks
|
||||
|
||||
_this.initPrice = resp.totalPrice
|
||||
_this.initWeight = resp.totalWeight
|
||||
@@ -474,19 +493,43 @@
|
||||
|
||||
},
|
||||
|
||||
dialogInputConfirm2(val) {
|
||||
this.dialogBeforeClose2 = true
|
||||
},
|
||||
|
||||
saveGoods() {
|
||||
|
||||
// var params = {
|
||||
// customerSid: getApp().globalData.sid,
|
||||
// brandId: this.data.brandVos[this.selectIndex2].id
|
||||
// }
|
||||
// // console.log("params", params);
|
||||
|
||||
// let _this = this
|
||||
// _this.$api.saveGoods(params).then((resp) => {
|
||||
|
||||
// _this.request()
|
||||
// }).catch(e => {})
|
||||
|
||||
|
||||
var params = {
|
||||
customerSid: getApp().globalData.sid,
|
||||
brandId: this.data.brandVos[this.selectIndex2].id
|
||||
// cardNumber: 1,
|
||||
brandId:this.data.brandVos[this.selectIndex2].id,
|
||||
totalTee: this.page.price,
|
||||
|
||||
// ordOrderDetailsVoList: list
|
||||
}
|
||||
// console.log("params", params);
|
||||
|
||||
console.log("params", params);
|
||||
|
||||
let _this = this
|
||||
_this.$api.saveGoods(params).then((resp) => {
|
||||
|
||||
_this.request()
|
||||
}).catch(e => {})
|
||||
// _this.$api.createVegeOrder(params).then((resp) => {
|
||||
|
||||
// // console.log("resp", resp);
|
||||
// this.$pay(resp)
|
||||
// }).catch(e => {
|
||||
// })
|
||||
|
||||
|
||||
},
|
||||
itemClick(goodsSid) {
|
||||
@@ -496,9 +539,16 @@
|
||||
},
|
||||
gotoCart() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/good/shoppCart?affiliation=' + this.data.brandVos[this.selectIndex2].id
|
||||
url: '/pages/good/shoppCart?affiliation=' + this.data.brandVos[this.selectIndex2].id +
|
||||
"&weight=" + this.data.brandVos[this.selectIndex2].qssl
|
||||
})
|
||||
},
|
||||
showPop2() {
|
||||
|
||||
this.$refs.inputDialog2.open()
|
||||
|
||||
},
|
||||
|
||||
onShareAppMessage: function(res) {
|
||||
console.log("res", res)
|
||||
console.log("data", res.target.dataset)
|
||||
|
||||
@@ -185,7 +185,7 @@
|
||||
|
||||
}
|
||||
this.getUserInfo()
|
||||
this.myRecommend()
|
||||
// this.myRecommend()
|
||||
},
|
||||
onLoad(options) {
|
||||
// this.request()
|
||||
|
||||
Reference in New Issue
Block a user