master
yujialong 11 months ago
parent 8a67e00e54
commit fbbef11a37
  1. 54
      apis/modules/client.js
  2. 24
      apis/modules/goods.js
  3. 159
      components/order/order.vue
  4. 2
      config/request.js
  5. 264
      other/addGoods/addGoods.vue
  6. 201
      other/goods/goods.vue
  7. 4
      other/supplierDetail/supplierDetail.vue
  8. 16
      pages.json
  9. 2
      pages/person/person.vue
  10. 27
      pages/supplier/supplier.vue

@ -1,54 +0,0 @@
import request from '@/apis/request.js'
const { get, post } = request
export const queryCustomer = (data) => {
return post('nakadai/nakadai/customer/queryCustomer', data)
}
export const list = (data) => {
return post('nakadai/nakadai/applets/customer/getCustomerListBasedOnBusinessManagerId', data)
}
export const all = (data) => {
return post('nakadai/nakadai/applets/customer/customerList', data)
}
export const queryCustomerDetails = (data) => {
return get('nakadai/nakadai/customer/queryCustomerDetails', data)
}
export const querySchool = (data) => {
return get('nakadai/nakadai/school/querySchool', data)
}
export const queryIndustryClass = (data) => {
return get('nakadai/nakadai/hrIndustryClass/queryIndustryClass', data)
}
export const queryIndustry = (data) => {
return get('nakadai/nakadai/hrIndustry/queryIndustry', data)
}
export const queryCustomerIsExists = (data) => {
return get('nakadai/nakadai/customer/queryCustomerIsExists', data)
}
export const addCustomer = (data) => {
return post('nakadai/nakadai/customer/addCustomer', data)
}
export const updateCustomer = (data) => {
return post('nakadai/nakadai/customer/updateCustomer', data)
}
export const getProductsSubscribedByCustomers = (data) => {
return get('nakadai/nakadai/customer/getProductsSubscribedByCustomers', data)
}
export const getTeamsByAccountId = (data) => {
return post('nakadai/nakadai/applets/customer/getTeamsByAccountId', data)
}
export const getTheBusinessManagerIdsUnderTheTeam = id => {
return post(`nakadai/nakadai/applets/customer/getTheBusinessManagerIdsUnderTheTeam?id=${id}`)
}

@ -0,0 +1,24 @@
import request from '@/apis/request.js'
const { get, post } = request
export const batchDelete = (data) => {
return post('nakadai/prod/batchDelete', data)
}
export const info = (data) => {
return get('nakadai/prod/info', data)
}
export const page = (data) => {
return get('nakadai/prod/page', data)
}
export const prodStatus = (prodId, prodStatus) => {
return post(`nakadai/prod/prodStatus?prodId=${prodId}&prodStatus=${prodStatus}`)
}
export const save = (data) => {
return post('nakadai/prod/save', data)
}
export const update = (data) => {
return post('nakadai/prod/update', data)
}
export const categoryList = (data) => {
return get('nakadai/category/list', data)
}

@ -0,0 +1,159 @@
<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>

@ -5,7 +5,7 @@
*/ */
export default { export default {
// baseURL: 'http://192.168.31.217:10010/', // baseURL: 'http://192.168.31.51:10010/',
baseURL: 'http://124.71.79.122/', baseURL: 'http://124.71.79.122/',
headers: { headers: {
'Content-Type': 'application/json;charset=UTF-8' 'Content-Type': 'application/json;charset=UTF-8'

@ -0,0 +1,264 @@
<template>
<view class="page">
<view class="block">
<view class="form-list edit-form">
<view class="line">
<view class="name">商品名称</view>
<input type="text" placeholder="请输入商品名称" v-model="form.prodName" />
</view>
<view class="line">
<view class="name">产品分类</view>
<view class="inline">
<uni-data-picker class="picker-input" :clear-icon="false" placeholder="请选择产品分类" popup-title="请选择产品分类" preload :localdata="provinces" :map="{text: 'provinceName', value: 'provinceName'}" v-model="form.categoryId"></uni-data-picker>
</view>
</view>
<view class="py">
<uni-file-picker v-model="pic" limit="5" title="请上传封面图片,至少一张" :auto-upload="false" @select="uploadDes"></uni-file-picker>
</view>
</view>
</view>
<view class="block">
<view class="form-list edit-form">
<view class="line textarea-line no-bd">
<textarea placeholder="描述一下宝贝的品牌型号、货品来源..." v-model="form.brief"></textarea>
</view>
<view class="py">
<uni-file-picker v-model="pic" limit="10" title="添加优质图片" :auto-upload="false" @select="uploadDes"></uni-file-picker>
</view>
</view>
</view>
<view class="title">产品规格</view>
<view v-for="(item, i) in form.skuList" :key="i" class="block">
<view class="form-list edit-form">
<view class="line">
<view class="name">规格名称</view>
<input type="text" placeholder="请输入规格名称" v-model="item.skuName" />
</view>
<view class="line">
<view class="name">价格</view>
<view class="price-select" @click="showPrice">请选择</view>
</view>
<view class="line">
<view class="name">库存</view>
<uni-number-box v-model="item.stocks" :max="100" :min="1"></uni-number-box>
</view>
</view>
</view>
<view class="plus-sku">
<uni-icons class="icon" type="plus" size="30" color="#007eff" @click="addSku"></uni-icons>
</view>
<view class="btns">
<view class="btn" @click="submit(3)">存草稿</view>
<view class="btn publish" @click="submit(0)">发布</view>
</view>
<uni-popup ref="popup" background-color="#fff" type="bottom">
<view class="block">
<view class="form-list edit-form">
<view class="line">
<view class="name">售价</view>
<input type="text" placeholder="请输入售价" v-model="form.prodName" />
</view>
<view class="line">
<view class="name">优惠价</view>
<input type="text" placeholder="请输入优惠价" v-model="form.prodName" />
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import { queryProvince, queryCity, queryTeamInfo, updateTeamInfo, enterpriseCertificationStatus } from '@/apis/modules/user.js'
import { save, update, info, categoryList } from '@/apis/modules/goods.js'
import OSS from '@/libs/Oss/upload'
export default {
data() {
return {
openId: uni.getStorageSync('openId'),
info: {},
form: {
brief: '',
categoryId: '',
content: '',
oriPrice: '',
pic: '',
price: '',
prodName: '',
skuList: [
{
actualStocks: '',
oriPrice: '',
price: '',
skuName: '',
stocks: '',
}
],
totalStocks: ''
},
originSku: {},
pic: [],
submiting: false,
uploading: false,
classifications: [],
}
},
computed: {
//
platformName() {
return this.info.platformSource === '6' ? '供应商' : this.info.platformSource === '5' ? '幼儿园' : ''
},
},
onLoad() {
this.originSku = JSON.parse(JSON.stringify(this.form.skuList[0]))
this.getCategory()
// this.getProvince()
},
methods: {
//
async getEnterInfo() {
const { data } = await enterpriseCertificationStatus(this.openId)
if (data) {
this.info = data
data.platformSource === '6' && this.getClassification()
}
},
//
async getCategory() {
const { data } = await categoryList()
this.classifications = data
},
//
async getProvince() {
const { list } = await queryProvince()
this.provinces = list
this.getInfo()
},
//
async getCity() {
const { list } = await queryCity({
provinceId: this.provinces.find(e => e.provinceName == this.form.province).provinceId
})
this.cities = list
this.cityId = ''
},
// logo
uploadLogo() {
const that = this
uni.chooseImage({
success: (res) => {
const file = res.tempFilePaths[0];
OSS(file, ({ url }) => {
that.form.logoUrl = url
})
}
});
},
//
uploadDes(e){
OSS(e.tempFilePaths[0], (res) => {
this.pic.push({
name: res.name,
extname: res.ext,
url: res.url,
})
})
},
//
showPrice() {
this.$refs.popup.open()
},
// sku
addSku() {
this.form.skuList.push(this.originSku)
},
//
async submit(status) {
if (this.submiting) return false
const { form } = this
if (!form.prodName) return this.$util.errMsg(`请输入商品名称!`)
if (!this.pic.length) return this.$util.errMsg(`请上传封面图片!`)
if (!form.brief) return this.$util.errMsg(`请输入商品描述!`)
if (!form.skuList.length) return this.$util.errMsg(`请输入产品规格!`)
this.submiting = true
form.pic = this.pic.map(e => e.url).join()
form.status = status
try {
if (this.id) {
await update(form)
this.$util.sucMsg('保存成功!')
} else {
await save(form)
this.$util.sucMsg('发布成功!')
}
setTimeout(() => {
uni.navigateBack()
}, 1500)
} catch(e) {
this.submiting = false
}
}
}
}
</script>
<style scoped lang="scss">
.page {
padding-bottom: 170rpx;
-webkit-overflow-scrolling: touch;
}
/deep/.picker-input {
.arrow-area {
display: none;
}
.input-value, .selected-list {
padding: 0;
}
}
.price-select {
font-size: 24rpx;
color: #333;
}
.title {
margin: 40rpx 24rpx 24rpx;
font-size: 30rpx;
font-weight: 600;
color: #333;
}
.plus-sku {
text-align: center;
}
.btns {
z-index: 10;
position: fixed;
bottom: env(safe-area-inset-bottom);
bottom: 0;
width: 100%;
padding: 20rpx;
display: flex;
justify-content: center;
box-sizing: border-box;
background-color: #fff;
box-shadow: 0px 0px 7rpx 0px rgba(203, 203, 203, 0.55);
.btn {
padding: 16rpx 60rpx;
margin-left: 20rpx;
font-size: 28rpx;
color: #333;
background-color: #d8d8d8;
border-radius: 20px;
}
.publish {
color: #fff;
background-color: $uni-primary;
}
}
</style>

@ -0,0 +1,201 @@
<template>
<view>
<view class="page">
<ul class="tab">
<li :class="{active: curTab === ''}" @click="tabChange('')">全部</li>
<li :class="{active: curTab === 0}" @click="tabChange(0)">已上架</li>
<li :class="{active: curTab === 2}" @click="tabChange(2)">已下架</li>
<li :class="{active: curTab === 3}" @click="tabChange(3)">草稿</li>
<li :class="{active: curTab === 4}" @click="tabChange(4)">审核中</li>
</ul>
<template v-if="list.length">
<view class="list">
<view v-for="item in list" @click="toDetail(item)">
<view class="metas">
<view class="time">2313</view>
<view class="status">上架中</view>
</view>
<view class="info">
<image class="pic" :src="item.coverUrl"></image>
<view class="texts">
<view class="name">{{ item.customerName }}</view>
<view class="meta">
市场价20.00
<text class="sell">售价10</text>
</view>
<view class="meta">
库存1000
已售500
</view>
<view class="btns">
<!-- <view class="btn" @click.stop="toDetail(item)">查看</view> -->
<view class="btn off" @click.stop="changeStatus(item, 0)">下架</view>
<view class="btn del" @click.stop="del(item)">删除</view>
<view class="btn" @click.stop="toEdit(item)">编辑</view>
</view>
</view>
</view>
</view>
</view>
<uni-load-more :status="status" />
</template>
<empty v-else text="暂无商品"></empty>
<uni-icons class="plus" type="plus-filled" size="60" color="#007eff" @click="$util.to('../addGoods/addGoods')"></uni-icons>
</view>
</view>
</template>
<script>
import { page, batchDelete, prodStatus } from '@/apis/modules/goods.js'
export default {
data() {
return {
curTab: '',
tabs: [],
reachBottom: 0, // 0->,1->,-1->
status: 'more', // more|loading|noMore
searchTimer: null,
keyword: '',
list: [],
page: 1,
pageSize: 10
}
},
watch: {
keyword () {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initList()
}, 500)
}
},
//
onPullDownRefresh() {
this.initList()
setTimeout(() => {
uni.stopPullDownRefresh()
}, 1500)
},
//
onReachBottom() {
if (this.reachBottom >= 0) {
this.reachBottom = 1
this.status = 'loading'
this.getList()
}
},
onShow() {
this.initList()
},
methods: {
//
getList() {
uni.showLoading({
title: '加载中'
})
page({
status: this.curTab
}).then(({ data }) => {
uni.hideLoading()
// list
this.list = this.reachBottom > 0 ? [...this.list, ...data.records] : data.records
this.page++ // page+1
const noMore = this.list.length === data.total //
this.status = noMore ? 'noMore' : 'more' // noMore
this.reachBottom = noMore ? -1 : 0 // -1
}).catch(e => {
uni.hideLoading()
})
},
initList() {
this.page = 1
this.reachBottom = 0
this.getList()
},
// tab
tabChange(id) {
this.curTab = id
this.initList()
},
//
async changeStatus(item, status) {
await prodStatus(item.prodId, status)
this.initList()
},
//
toDetail(item) {
this.$util.to(`../addGoods/addGoods?id=${item.prodId}&show=1`)
},
//
toEdit(item) {
this.$util.to(`../addGoods/addGoods?id=${item.prodId}`)
},
}
}
</script>
<style scoped lang="scss">
.page {
padding-bottom: 90px;
}
.list {
margin-top: 20rpx;
li {
padding: 20rpx;
margin-bottom: 20rpx;
// border-bottom: 1px solid #f1f1f1;
background-color: #fff;
}
.metas {
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
}
.time {
font-size: 24rpx;
color: #333;
}
.status {
font-size: 24rpx;
color: #333;
}
.info {
display: flex;
align-items: center;
}
.pic {
width: 150rpx;
height: 150rpx;
margin-right: 20rpx;
}
.name {
font-size: 30rpx;
color: #333;
}
.meta {
display: flex;
margin: 10rpx 0;
font-size: 28rpx;
color: #999;
}
.btns {
text-align: right;
}
.btn {
padding: 8rpx 20rpx;
margin-left: 20rpx;
font-size: 28rpx;
color: #fff;
background-color: $uni-primary;
border-radius: 4px;
&.del {
background-color: #f00;
}
&.off {
background-color: #ccc;
}
}
}
</style>

@ -60,11 +60,11 @@
<view class="title">联系我们</view> <view class="title">联系我们</view>
<view class="info address"> <view class="info address">
<image class="icon" src="https://occupationlab.com/images/preschoolEdu/address.png" mode="widthFix" /> <image class="icon" src="https://occupationlab.com/images/preschoolEdu/address.png" mode="widthFix" />
地址{{ form.address }} 地址{{ form.address || '' }}
</view> </view>
<view class="info"> <view class="info">
<image class="icon" src="https://occupationlab.com/images/preschoolEdu/tel.png" mode="widthFix" /> <image class="icon" src="https://occupationlab.com/images/preschoolEdu/tel.png" mode="widthFix" />
联系电话{{ form.phone }} 联系电话{{ form.phone || '' }}
</view> </view>
<view class="qrcodes"> <view class="qrcodes">

@ -68,6 +68,22 @@
"navigationBarTitleText" : "已报名活动", "navigationBarTitleText" : "已报名活动",
"enablePullDownRefresh" : true "enablePullDownRefresh" : true
} }
},
{
"path" : "goods/goods",
"style" :
{
"navigationBarTitleText" : "商品管理",
"enablePullDownRefresh" : true
}
},
{
"path" : "addGoods/addGoods",
"style" :
{
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false
}
} }
] ]
}, },

@ -108,7 +108,7 @@
<image src="https://occupationlab.com/images/preschoolEdu/icon7.png" /> <image src="https://occupationlab.com/images/preschoolEdu/icon7.png" />
<view class="text ell">{{ platformName }}认证</view> <view class="text ell">{{ platformName }}认证</view>
</li> </li>
<li v-if="isSupplier" @click="tips"> <li v-if="isSupplier" @click="toPage('/other/goods/goods')">
<image src="https://occupationlab.com/images/preschoolEdu/icon8.png" /> <image src="https://occupationlab.com/images/preschoolEdu/icon8.png" />
<view class="text ell">商品管理</view> <view class="text ell">商品管理</view>
</li> </li>

@ -15,8 +15,9 @@
{{ item.companyName }} {{ item.companyName }}
</view> </view>
<view class="info"> <view class="info">
<view class="intro ell">{{ item.briefIntroduction }}</view> <view v-if="item.briefIntroduction" class="intro ell">{{ item.briefIntroduction }}</view>
<view class="meta">{{ item.province }}-{{ item.city }}</view> <view class="meta">{{ item.province }}-{{ item.city }}</view>
<view class="order" @click.stop="toOrder(item)">我想采购</view>
</view> </view>
</view> </view>
</view> </view>
@ -40,6 +41,8 @@
</view> </view>
</template> </template>
</view> </view>
<order ref="order" />
</view> </view>
</template> </template>
@ -181,6 +184,13 @@
this.curTab = tab.id this.curTab = tab.id
this.initList() this.initList()
}, },
//
toOrder(row) {
// console.log(33, this.$refs.order.popup)
const el = this.$refs.order
el.getGoods()
el.$refs.popup.open()
}
} }
} }
</script> </script>
@ -222,6 +232,7 @@
} }
} }
.info { .info {
position: relative;
padding: 12rpx 0; padding: 12rpx 0;
} }
.line { .line {
@ -251,11 +262,15 @@
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
} }
.toggle { .order {
margin-left: 10rpx; position: absolute;
white-space: nowrap; top: 14rpx;
font-size: 24rpx; right: 0;
color: #0e92ef; padding: 8rpx 28rpx;
font-size: 28rpx;
color: #fff;
background-color: $uni-primary;
border-radius: 20px;
} }
} }
</style> </style>

Loading…
Cancel
Save