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