1111
This commit is contained in:
@@ -24,11 +24,21 @@
|
||||
</view>
|
||||
|
||||
<view
|
||||
style="background: #FFFFFF;border-radius: 20rpx;z-index: 1;height: 14vw;margin-left: 15px;margin-right: 15px;margin-top: 4vw;display: flex;align-items: center;">
|
||||
<image src="../../static/pName.png" style="width: 15px;height: 15px;margin-left: 15px;"></image>
|
||||
<view style="margin-left: 15px;font-size: 14px;">{{data.pname}}</view>
|
||||
style="background: #FFFFFF;border-radius: 20rpx;z-index: 1;min-height: 14vw;margin-left: 15px;margin-right: 15px;margin-top: 4vw;">
|
||||
<view style="display: flex;align-items: center;margin-top: 8px;">
|
||||
<text style="flex-shrink: 0;font-size: 13px;margin-left: 10px;">提货地点</text>
|
||||
<zxz-uni-data-select v-model="data.value" filterable :localdata="data.select" @showing='showing'
|
||||
style="flex: 1;padding-left: 10px;padding-right: 10px;"></zxz-uni-data-select>
|
||||
</view>
|
||||
<view
|
||||
style="display: flex;align-items: center;padding-right: 10px;margin-top: 6px;margin-bottom: 8px;">
|
||||
<text style="flex-shrink: 0;font-size: 13px;margin-left: 10px;margin-right: 10px;">提货时间</text>
|
||||
<uni-datetime-picker type="date" v-model="data.reserveDate" style="flex: 1;" :start="data.start"
|
||||
:end="data.end" @showing='showing' />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view style="background: #FFFFFF;border-radius: 20rpx;padding: 15px;margin: 10px 15px;">
|
||||
|
||||
<view
|
||||
@@ -39,12 +49,13 @@
|
||||
<view v-for="(item,index) in data.goodsVos"
|
||||
style="display: flex;flex-direction: row;margin-top: 15px;">
|
||||
<image :src="item.pic" style="width: 60px;height: 60px;flex-shrink: 0;"></image>
|
||||
<view style="margin-left: 10px;margin-right: 10px;flex: 1;">
|
||||
<text class="text" style="font-weight: 500;">{{item.goods}}
|
||||
<view
|
||||
style="margin-left: 10px;margin-right: 10px;flex: 1;display: flex;flex-direction: column;justify-content: space-between;align-items: flex-end;">
|
||||
<text class="text" style="font-weight: 500;width: 100%;">{{item.goods}}
|
||||
</text>
|
||||
<view style="font-size: 12px;color: #666666;">剩余数量:{{item.lnum}}</view>
|
||||
<uni-number-box ref="box" :min="0" :max="item.lnum" v-model="item.select"
|
||||
:showTextView="page.showTextView"></uni-number-box>
|
||||
</view>
|
||||
<view style="flex-shrink: 0;font-size: 12px;color: #666666;">x{{item.num}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -53,10 +64,8 @@
|
||||
<view v-if="data.showBtn||data.showRecord"
|
||||
style="position: fixed;bottom: 0;height: 50px;background: #f3f4f6;border-top: 1rpx #cacaca solid;width: 100%;display: flex;flex-direction: row;box-sizing: border-box;align-items: center;padding-right: 15px;">
|
||||
<view style="flex: 1;"></view>
|
||||
<view v-if="data.showRecord" class="btn" style="flex-shrink: 0;font-size: 22rpx;color: #191919;">
|
||||
预约记录</view>
|
||||
<view v-if="data.showBtn" class="btn" style="flex-shrink: 0;font-size: 22rpx;color: royalblue;">预约提货
|
||||
</view>
|
||||
<view v-if="data.showRecord" class="btn" style="flex-shrink: 0;color: #191919;" @click="save">
|
||||
提交预约</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -68,7 +77,8 @@
|
||||
data() {
|
||||
return {
|
||||
page: {
|
||||
sid: ''
|
||||
sid: '',
|
||||
showTextView: false
|
||||
},
|
||||
data: {
|
||||
time: "",
|
||||
@@ -77,7 +87,9 @@
|
||||
state: "",
|
||||
showBtn: false,
|
||||
showRecord: false,
|
||||
goodsVos: []
|
||||
goodsVos: [],
|
||||
value: "",
|
||||
select: []
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -86,9 +98,13 @@
|
||||
this.request()
|
||||
},
|
||||
methods: {
|
||||
showing(e) {
|
||||
this.page.showTextView = e
|
||||
},
|
||||
request() {
|
||||
let _this = this
|
||||
_this.$api.cardDetail(this.page.sid).then((resp) => {
|
||||
_this.$api.cardBooking(this.page.sid).then((resp) => {
|
||||
console.log(resp);
|
||||
_this.data = resp
|
||||
_this.$nextTick(() => {
|
||||
_this.$refs.pageView.setLoadState(2)
|
||||
@@ -98,6 +114,34 @@
|
||||
_this.$refs.pageView.setLoadState(1)
|
||||
})
|
||||
})
|
||||
},
|
||||
save() {
|
||||
if (this.stringIsEmpty(this.data.value)) {
|
||||
this.shortToast('请选择提货地点')
|
||||
return
|
||||
}
|
||||
if (this.stringIsEmpty(this.data.reserveDate)) {
|
||||
this.shortToast('请选择提货时间')
|
||||
return
|
||||
}
|
||||
let num = 0;
|
||||
for (var i = 0; i < this.data.goodsVos.length; i++) {
|
||||
num += Number(this.data.goodsVos[i].select);
|
||||
}
|
||||
if (num == 0) {
|
||||
this.shortToast('您未选择任何商品')
|
||||
return
|
||||
}
|
||||
|
||||
let _this = this
|
||||
_this.$api.cardBookingSave(this.data).then((resp) => {
|
||||
uni.navigateBack()
|
||||
uni.$emit('order', {})
|
||||
uni.$emit('order2', {})
|
||||
}).catch(e => {
|
||||
_this.shortToast('发生异常')
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -124,10 +168,11 @@
|
||||
border: 1px solid;
|
||||
padding-left: 30rpx;
|
||||
padding-right: 30rpx;
|
||||
padding-top: 10rpx;
|
||||
padding-bottom: 10rpx;
|
||||
padding-top: 12rpx;
|
||||
padding-bottom: 12rpx;
|
||||
border-radius: 50rpx;
|
||||
height: 15px;
|
||||
margin-left: 25rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user