You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
159 lines
3.1 KiB
159 lines
3.1 KiB
11 months ago
|
<template>
|
||
|
<view>
|
||
|
<!-- 选择规格弹窗 -->
|
||
|
<uni-popup ref="popup" background-color="#fff" type="bottom" @change="change">
|
||
|
<view class="goodsPopup">
|
||
|
<view class="title">发送询价单给商家</view>
|
||
|
<view class="tips">请填写您需要采购的数量及需求,方便商家更好地为你造型报价</view>
|
||
|
|
||
|
<ul class="tab">
|
||
|
<li v-for="(tab, i) in tabs" :key="i" :class="{active: curTab === tab.id}" @click="tabChange(tab)">{{ tab.name }}</li>
|
||
|
</ul>
|
||
|
|
||
|
<view class="content">
|
||
|
<scroll-view v-if="!curTab" class="goods-wrap" scroll-y :show-scrollbar="false">
|
||
|
<view class="goods" v-for="(item, i) in goods" :key="i">
|
||
|
<view class="info">
|
||
|
<view class="item">
|
||
|
<view class="name">{{ item.name }}</view>
|
||
|
<view class="meta">¥23.00</view>
|
||
|
</view>
|
||
|
<view class="item">
|
||
|
<view class="name">{{ item.name }}</view>
|
||
|
<view class="meta">库存12</view>
|
||
|
</view>
|
||
|
</view>
|
||
|
|
||
|
<u-number-box :value="item.price" :max="100" :min="1"></u-number-box>
|
||
|
</view>
|
||
|
</scroll-view>
|
||
|
<textarea v-else class="msg" placeholder="请输入"></textarea>
|
||
|
</view>
|
||
|
|
||
|
<view class="btns">
|
||
|
<view class="btn" @click="nextStep">个人采购</view>
|
||
|
<view class="btn" @click="nextStep">组织采购</view>
|
||
|
<view class="btn back" @click="back">返回</view>
|
||
|
</view>
|
||
|
</view>
|
||
|
</uni-popup>
|
||
|
</view>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
import { page } from '@/apis/modules/goods.js'
|
||
|
export default {
|
||
|
name:"order",
|
||
|
props: {
|
||
|
goodsPopup: {
|
||
|
type: Boolean,
|
||
|
default: false
|
||
|
},
|
||
|
},
|
||
|
data() {
|
||
|
return {
|
||
|
tabs: [
|
||
|
{
|
||
|
id: 0,
|
||
|
name: '按产品'
|
||
|
},
|
||
|
{
|
||
|
id: 1,
|
||
|
name: '留言商家'
|
||
|
},
|
||
|
],
|
||
|
curTab: 0,
|
||
|
goods: [],
|
||
|
};
|
||
|
},
|
||
|
onShow() {
|
||
|
// this.getGoods()
|
||
|
},
|
||
|
methods: {
|
||
|
// 获取商品列表
|
||
|
async getGoods() {
|
||
|
const { data } = await page()
|
||
|
this.goods = data.records
|
||
|
},
|
||
|
change() {
|
||
|
|
||
|
},
|
||
|
// 返回
|
||
|
back() {
|
||
|
this.$refs.popup.close()
|
||
|
},
|
||
|
// tab切换
|
||
|
tabChange(tab) {
|
||
|
this.curTab = tab.id
|
||
|
},
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style scoped lang="scss">
|
||
|
.goodsPopup {
|
||
|
position: relative;
|
||
|
padding: 30rpx;
|
||
|
.title {
|
||
|
font-size: 30rpx;
|
||
|
color: #333;
|
||
|
}
|
||
|
.tips {
|
||
|
margin: 20rpx 0 40rpx;
|
||
|
font-size: 24rpx;
|
||
|
color: #a0a0a0;
|
||
|
}
|
||
|
.content {
|
||
|
height: 50vh;
|
||
|
}
|
||
|
.goods-wrap {
|
||
|
height: 100%;
|
||
|
margin-bottom: 100rpx;
|
||
|
}
|
||
|
.goods {
|
||
|
display: flex;
|
||
|
justify-content: space-between;
|
||
|
align-items: center;
|
||
|
}
|
||
|
.info {
|
||
|
display: inline-flex;
|
||
|
margin-bottom: 20rpx;
|
||
|
.name {
|
||
|
font-size: 26rpx;
|
||
|
color: #333;
|
||
|
}
|
||
|
.meta {
|
||
|
font-size: 24rpx;
|
||
|
color: #ccc;
|
||
|
}
|
||
|
}
|
||
|
.msg {
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
padding: 30rpx;
|
||
|
font-size: 24rpx;
|
||
|
color: #333;
|
||
|
border: 1px solid #dedede;
|
||
|
border-radius: 4px;
|
||
|
box-sizing: border-box;
|
||
|
}
|
||
|
.btns {
|
||
|
display: flex;
|
||
|
justify-content: space-between;
|
||
|
margin-top: 30rpx;
|
||
|
.btn {
|
||
|
padding: 12rpx 40rpx;
|
||
|
font-size: 28rpx;
|
||
|
color: #fff;
|
||
|
background-color: $uni-primary;
|
||
|
border-radius: 20px;
|
||
|
}
|
||
|
.back {
|
||
|
padding: 12rpx 26rpx;
|
||
|
color: #333;
|
||
|
background-color: #fff;
|
||
|
border: 1px solid #ccc;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</style>
|