gukai 1 year ago
parent 5ca6372cb1
commit bef1bbfe40

@ -9,9 +9,8 @@
<u-icon name="arrow-right" color="#262626" size="15"></u-icon> <u-icon name="arrow-right" color="#262626" size="15"></u-icon>
</view> </view>
<view style="margin-top: 20rpx;"> <view style="margin-top: 20rpx;">
<u-icon @click="openLocation(mch)" name="map" <u-icon @click="openLocation(mch)" name="map" :label="mch.detail || mch.name"
:label="mch.detail || mch.name" labelColor="#a8a8a8" color="#a8a8a8" size="12" labelColor="#a8a8a8" color="#a8a8a8" size="12" label-size="12"></u-icon>
label-size="12"></u-icon>
</view> </view>
<!-- <view style="color: #999;margin-top: 20rpx;font-size: 28rpx;">距离您1km</view> <!-- <view style="color: #999;margin-top: 20rpx;font-size: 28rpx;">距离您1km</view>
<view> <view>
@ -43,7 +42,8 @@
<scroll-view scroll-y style="overflow-y: scroll;float: left;width: 100%;flex: 1;"> <scroll-view scroll-y style="overflow-y: scroll;float: left;width: 100%;flex: 1;">
<view style="padding: 20rpx;"> <view style="padding: 20rpx;">
<view v-if="cat_list && cat_list.length > 0" style="margin-bottom: 20rpx;"> <view v-if="cat_list && cat_list.length > 0" style="margin-bottom: 20rpx;">
{{ cat_list[cat_index].name }}</view> {{ cat_list[cat_index].name }}
</view>
<view v-for="(item, index) in goods_list" @click="show_goods_id = item.goods_id" <view v-for="(item, index) in goods_list" @click="show_goods_id = item.goods_id"
style="display: flex;width: 100%;background: #FFF;border-radius: 14rpx;box-shadow: 0px 0px 8rpx 0px rgba(0, 0, 0, 0.1);margin-bottom: 20rpx;overflow: hidden;"> style="display: flex;width: 100%;background: #FFF;border-radius: 14rpx;box-shadow: 0px 0px 8rpx 0px rgba(0, 0, 0, 0.1);margin-bottom: 20rpx;overflow: hidden;">
<view style="background: #F0F0F0;"> <view style="background: #F0F0F0;">
@ -73,6 +73,10 @@
</template> </template>
<template v-else> <template v-else>
<!-- 加载完毕 --> <!-- 加载完毕 -->
<view v-if="cat_list.length > (cat_index - 0 + 1)" @click="cat_index = (cat_index - 0 + 1)" style="display: flex;align-items: center;justify-content: center;color: #999;">
加载更多
<u-icon name="arrow-down" color="#999"></u-icon>
</view>
</template> </template>
</view> </view>
@ -100,7 +104,7 @@
</view> </view>
</view> </view>
<view @click="toSubmit" <view @click="toSubmit"
style="background: #A16222;color: #FFF;padding: 0 30rpx;line-height: 60rpx;border-radius: 30rpx;"> style="background: #A16222;color: #FFF;padding: 0 30rpx;line-height: 70rpx;border-radius: 35rpx;font-size: 32rpx;">
去下单 去下单
</view> </view>
</view> </view>
@ -124,7 +128,8 @@
style="flex: 1;padding: 10rpx 14rpx;display: flex;flex-direction: column;justify-content: space-between;"> style="flex: 1;padding: 10rpx 14rpx;display: flex;flex-direction: column;justify-content: space-between;">
<view> <view>
<view class="goods_name" style="-webkit-line-clamp: 1;font-size: 20rpx;"> <view class="goods_name" style="-webkit-line-clamp: 1;font-size: 20rpx;">
{{ item.goods.name }}</view> {{ item.goods.name }}
</view>
</view> </view>
<view class="item-desc" style="margin: 10rpx 0;"> <view class="item-desc" style="margin: 10rpx 0;">
<view class="goods_sky" style="color: #999;font-size: 24rpx;"> <view class="goods_sky" style="color: #999;font-size: 24rpx;">
@ -165,12 +170,13 @@
<logins v-if="wcCode != -1" :wcCode="wcCode" <logins v-if="wcCode != -1" :wcCode="wcCode"
:type="$utils.isInAliBrowser() || $utils.isInWeChatBrowser() ? 0 : 2"></logins> :type="$utils.isInAliBrowser() || $utils.isInWeChatBrowser() ? 0 : 2"></logins>
<pageSku v-if="goods.id" ref="pagesku" :goods="goods" @skuPopData="skuPopData"></pageSku> <pageSku v-if="goods.id" ref="pagesku" :goods="goods" @skuPopData="skuPopData"></pageSku>
<view v-if="show_donghua == 1" :animation="animationData" style="position: fixed;right: 32rpx;top: 600rpx;z-index: 10;" <view v-if="show_donghua == 1" :animation="animationData"
:style="{ style="position: fixed;right: 32rpx;top: 600rpx;z-index: 10;" :style="{
top: top + 'px' top: top + 'px'
}"> }">
<!-- <image style="width: 50rpx;height: 50rpx;" src="../my/images/av.png" mode=""></image> --> <!-- <image style="width: 50rpx;height: 50rpx;" src="../my/images/av.png" mode=""></image> -->
<u-icon size="50rpx" name="plus-circle-fill" color="#A16222" style="background: #fff;border-radius: 50%;"></u-icon> <u-icon size="50rpx" name="plus-circle-fill" color="#A16222"
style="background: #fff;border-radius: 50%;"></u-icon>
</view> </view>
<goods v-if="show_goods_id > 0" :goods_id="show_goods_id" @close="show_goods_id = 0"></goods> <goods v-if="show_goods_id > 0" :goods_id="show_goods_id" @close="show_goods_id = 0"></goods>
@ -293,7 +299,8 @@
} else { } else {
if (res.data.is_more && res.data.is_more > 0 && this.is_cont == 0) { if (res.data.is_more && res.data.is_more > 0 && this.is_cont == 0) {
uni.reLaunch({ uni.reLaunch({
url: '/pages/takeaway/orderAndSettlement/edit?n_id=' + query.n_id + '&mch_id=' + query.mch_id + '&store_id=' + query.store_id url: '/pages/takeaway/orderAndSettlement/edit?n_id=' + query.n_id + '&mch_id=' +
query.mch_id + '&store_id=' + query.store_id
}) })
} }
this.cat_list = res.data.cat_list this.cat_list = res.data.cat_list
@ -344,12 +351,14 @@
}, 0) }, 0)
}, },
async skuPopData(e) { async skuPopData(e) {
const goods = this.goodsArr.find(item => item.goods_sku_id === e.goods_sku_id && item.small_goods_json === const goods = this.goodsArr.find(item => item.goods_sku_id === e.goods_sku_id && item
.small_goods_json ===
e.small_goods_json) e.small_goods_json)
if (goods) { if (goods) {
let goodsArr = this.goodsArr let goodsArr = this.goodsArr
this.goodsArr.forEach((item, index) => { this.goodsArr.forEach((item, index) => {
if (item.goods_sku_id === e.goods_sku_id && item.small_goods_json === e.small_goods_json) { if (item.goods_sku_id === e.goods_sku_id && item.small_goods_json === e
.small_goods_json) {
this.goodsArr[index].num = (this.goodsArr[index].num - 0) + 1 this.goodsArr[index].num = (this.goodsArr[index].num - 0) + 1
} }
}) })
@ -388,8 +397,8 @@
toSubmit() { toSubmit() {
let goodsArr = this.goodsArr.filter(item => item.num > 0) let goodsArr = this.goodsArr.filter(item => item.num > 0)
if (!goodsArr.length) { if (!goodsArr.length) {
uni.$u.toast("请选择点餐商品") uni.$u.toast("请选择点餐商品")
return return
} }
let that = this let that = this
uni.setStorage({ uni.setStorage({
@ -397,7 +406,8 @@
data: goodsArr, data: goodsArr,
success() { success() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/takeaway/orderAndSettlement/index?" + "n_id=" + that.n_id + "&mch_id=" + that.mch_id + "&store_id=" + that.store_id, url: "/pages/takeaway/orderAndSettlement/index?" + "n_id=" + that.n_id +
"&mch_id=" + that.mch_id + "&store_id=" + that.store_id,
}); });
} }
}) })

Loading…
Cancel
Save