幼教产品B2B生态平台小程序端
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.

169 lines
3.3 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>
11 months ago
<uni-number-box :value="item.price" :min="1"></uni-number-box>
11 months ago
</view>
</scroll-view>
<textarea v-else class="msg" placeholder="请输入"></textarea>
</view>
<view class="btns">
11 months ago
<view class="btn" @click="procure(1)">个人采购</view>
<view v-if="platformId === 5" class="btn" @click="procure(2)">组织采购</view>
11 months ago
<view class="btn back" @click="back">返回</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
11 months ago
import { list } from '@/apis/modules/goods.js'
11 months ago
export default {
name:"order",
11 months ago
// props: {
// prodId: {
// type: Number,
// },
// },
11 months ago
data() {
return {
11 months ago
platformId: uni.getStorageSync('platformId'),
11 months ago
tabs: [
{
id: 0,
name: '按产品'
},
{
id: 1,
name: '留言商家'
},
],
curTab: 0,
goods: [],
};
},
onShow() {
// this.getGoods()
},
methods: {
// 获取商品列表
11 months ago
async getGoods(shopId) {
const { data } = await list({
shopId
})
this.goods = data
11 months ago
},
change() {
},
// 返回
back() {
this.$refs.popup.close()
},
// tab切换
tabChange(tab) {
this.curTab = tab.id
},
11 months ago
// 采购
procure(type) {
confirm({
})
},
11 months ago
}
}
</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 {
11 months ago
width: 35%;
padding: 15rpx 0;
11 months ago
font-size: 28rpx;
color: #fff;
11 months ago
text-align: center;
11 months ago
background-color: $uni-primary;
border-radius: 20px;
}
.back {
11 months ago
width: 20%;
11 months ago
color: #333;
background-color: #fff;
border: 1px solid #ccc;
}
}
}
</style>