Commit 6cc461e1 authored by DPFly's avatar DPFly

Merge branch 'feature/20190730-some-bug' into 'test'

代码格式化

See merge request !8
parents e0b094a1 4a50ad57
This diff is collapsed.
<template>
<view class="container">
<view class="container">
<view class="goods-wrapper" v-if="goods">
<block v-for="(item, index) in goods" :key="item.id">
<view class="item">
<image class="goods-image" :src="(item.image ? item.image : 'https://img-shop.qmimg.cn/s16/images/2018/05/30/4b9e33114bb29a76.jpeg') + '?imageView2/1/w/200/h/200/q/100'"></image>
<image
class="goods-image"
:src="
(item.image
? item.image
: 'https://img-shop.qmimg.cn/s16/images/2018/05/30/4b9e33114bb29a76.jpeg') +
'?imageView2/1/w/200/h/200/q/100'
"
></image>
<view class="goods-info">
<view class="goods-name">
<text v-if="item.is_gift">【赠】</text>
<text>{{item.name}}</text>
<text>{{ item.name }}</text>
</view>
<view class="spec-wrap" v-if="item.spec || item.property_str">
<text class="label" v-for="(specItem, specIndex) in item.spec" :key="specItem">{{specItem}}</text><text class="label" v-if="item.spec && item.property_str">+</text><text class="label" v-if="item.property_str">{{item.property_str}}</text>
<text class="label" v-for="(specItem, specIndex) in item.spec" :key="specItem">{{
specItem
}}</text
><text class="label" v-if="item.spec && item.property_str">+</text
><text class="label" v-if="item.property_str">{{ item.property_str }}</text>
</view>
<view class="spec-wrap" v-if="item.sideDish">
<text class="label">{{item.sideDish}}</text>
<text class="label">{{ item.sideDish }}</text>
</view>
</view>
<view class="goods-price">
<text class="goods-num">×{{item.qty}}</text>
<text class="goods-num">×{{ item.qty }}</text>
</view>
<view class="item-right">
<text class="goods-price text-right" :class="{'text-bold': item.qty > 1}">¥{{item.is_gift ? '0.00' : item.subtotal}}</text>
<text class="goods-price text-right" :class="{ 'text-bold': item.qty > 1 }"
>¥{{ item.is_gift ? '0.00' : item.subtotal }}</text
>
<text class="goods-price text-delete"></text>
</view>
</view>
......@@ -30,138 +44,137 @@
</template>
<script>
import native from '@/utils/basic/native'
export default {
data() {
return {
goods: []
}
},
onLoad(options) {
// 获取全局存储的商品列表数据
this._getGoodsList()
},
onUnload() {
// 页面返回或关闭 清除全局中存储商品的数据
this.$store.commit('SET_CREATE_ORDER_GOODS')
},
methods: {
_getGoodsList() {
const goods = this.$store.state.createOrderGoods
if (goods.length > 0) {
this.goods = goods
} else {
native.navigateBack({
delta: 1
})
}
import native from '@/utils/basic/native'
export default {
data() {
return {
goods: [],
}
},
onLoad(options) {
// 获取全局存储的商品列表数据
this._getGoodsList()
},
onUnload() {
// 页面返回或关闭 清除全局中存储商品的数据
this.$store.commit('SET_CREATE_ORDER_GOODS')
},
methods: {
_getGoodsList() {
const goods = this.$store.state.createOrderGoods
if (goods.length > 0) {
this.goods = goods
} else {
native.navigateBack({
delta: 1,
})
}
}
}
},
},
}
</script>
<style>
page {
background: #f5f5f5;
box-sizing: border-box;
}
page {
background: #f5f5f5;
box-sizing: border-box;
}
</style>
<style scoped lang="scss">
.goods-wrapper {
width: 740rpx;
margin: 0 auto;
padding-bottom: 2rpx;
}
.goods-wrapper .item {
display: flex;
align-items: center;
width: 100%;
padding: 40rpx 0;
position: relative;
background: #fff;
margin-bottom: 2rpx;
}
.goods-wrapper .item:first-child {
margin-top: 0;
}
.goods-wrapper .item-left {
width: 80%;
display: flex;
justify-content: flex-start;
}
.goods-wrapper .item-right {
flex-shrink: 0;
margin-right: 20rpx;
}
.goods-wrapper .goods-image {
flex-shrink: 0;
width: 110rpx;
height: 110rpx;
margin-left: 20rpx;
}
.goods-wrapper .goods-info {
flex-grow: 1;
overflow: hidden;
}
.goods-wrapper .goods-name {
white-space: nowrap;
font-size: 30rpx;
padding-left: 20rpx;
overflow: hidden;
color: #282828;
text-overflow: ellipsis;
}
.goods-wrapper .spec-wrap {
padding-left: 20rpx;
line-height: 32rpx;
color: #999;
}
.goods-wrapper .spec-wrap .label {
color: #999;
font-size: 24rpx;
word-break: break-all;
}
.goods-wrapper .goods-price {
flex-shrink: 0;
display: block;
font-size: 30rpx;
color: #232323;
padding-left: 20rpx;
}
.goods-wrapper .text-right {
text-align: right;
}
.goods-wrapper .text-right.text-bold {
font-weight: bold;
}
.goods-wrapper .goods-num {
text-align: right;
color: #999;
font-size: 24rpx;
font-weight: 500;
}
.goods-wrapper .text-delete {
display: block;
text-align: right;
font-size: 24rpx;
color: #999;
text-decoration: line-through;
}
.goods-wrapper {
width: 740rpx;
margin: 0 auto;
padding-bottom: 2rpx;
}
.goods-wrapper .item {
display: flex;
align-items: center;
width: 100%;
padding: 40rpx 0;
position: relative;
background: #fff;
margin-bottom: 2rpx;
}
.goods-wrapper .item:first-child {
margin-top: 0;
}
.goods-wrapper .item-left {
width: 80%;
display: flex;
justify-content: flex-start;
}
.goods-wrapper .item-right {
flex-shrink: 0;
margin-right: 20rpx;
}
.goods-wrapper .goods-image {
flex-shrink: 0;
width: 110rpx;
height: 110rpx;
margin-left: 20rpx;
}
.goods-wrapper .goods-info {
flex-grow: 1;
overflow: hidden;
}
.goods-wrapper .goods-name {
white-space: nowrap;
font-size: 30rpx;
padding-left: 20rpx;
overflow: hidden;
color: #282828;
text-overflow: ellipsis;
}
.goods-wrapper .spec-wrap {
padding-left: 20rpx;
line-height: 32rpx;
color: #999;
}
.goods-wrapper .spec-wrap .label {
color: #999;
font-size: 24rpx;
word-break: break-all;
}
.goods-wrapper .goods-price {
flex-shrink: 0;
display: block;
font-size: 30rpx;
color: #232323;
padding-left: 20rpx;
}
.goods-wrapper .text-right {
text-align: right;
}
.goods-wrapper .text-right.text-bold {
font-weight: bold;
}
.goods-wrapper .goods-num {
text-align: right;
color: #999;
font-size: 24rpx;
font-weight: 500;
}
.goods-wrapper .text-delete {
display: block;
text-align: right;
font-size: 24rpx;
color: #999;
text-decoration: line-through;
}
</style>
......@@ -1294,7 +1294,7 @@ export default {
if (this.store_info.store_type === 31) {
params.type_cate = this.cateringDiningWayType === 1 ? 1 : 3
}
if(this.guestsNumber) {
if (this.guestsNumber) {
params.guests_number = this.guestsNumber
}
this.$navigate('/pages/order/create/index', params)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment