master
yujialong 11 months ago
parent fbbef11a37
commit 620d47a75d
  1. 13
      apis/modules/goods.js
  2. 40
      components/order/order.vue
  3. 27
      config/goods.js
  4. 4
      config/request.js
  5. 129
      other/addGoods/addGoods.vue
  6. 104
      other/goods/goods.vue
  7. 2
      other/registeredActivity/registeredActivity.vue
  8. 185
      other/vouchers/vouchers.vue
  9. 8
      pages.json
  10. 4
      pages/index/index.vue
  11. 2
      pages/person/person.vue
  12. 3
      pages/supplier/supplier.vue
  13. 7
      team/auth/auth.vue

@ -19,6 +19,15 @@ export const save = (data) => {
export const update = (data) => {
return post('nakadai/prod/update', data)
}
export const categoryList = (data) => {
return get('nakadai/category/list', data)
export const categoryInfo = (data) => {
return get('nakadai/category/categoryInfo', data)
}
export const list = (data) => {
return get('nakadai/prod/list', data)
}
export const confirm = (data) => {
return get('nakadai/order/order/confirm', data)
}
export const orderSubmit = (data) => {
return get('nakadai/order/order/submit', data)
}

@ -24,15 +24,15 @@
</view>
</view>
<u-number-box :value="item.price" :max="100" :min="1"></u-number-box>
<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="nextStep">个人采购</view>
<view class="btn" @click="nextStep">组织采购</view>
<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>
@ -41,17 +41,17 @@
</template>
<script>
import { page } from '@/apis/modules/goods.js'
import { list } from '@/apis/modules/goods.js'
export default {
name:"order",
props: {
goodsPopup: {
type: Boolean,
default: false
},
},
// props: {
// prodId: {
// type: Number,
// },
// },
data() {
return {
platformId: uni.getStorageSync('platformId'),
tabs: [
{
id: 0,
@ -71,9 +71,11 @@
},
methods: {
//
async getGoods() {
const { data } = await page()
this.goods = data.records
async getGoods(shopId) {
const { data } = await list({
shopId
})
this.goods = data
},
change() {
@ -86,6 +88,12 @@
tabChange(tab) {
this.curTab = tab.id
},
//
procure(type) {
confirm({
})
},
}
}
</script>
@ -142,14 +150,16 @@
justify-content: space-between;
margin-top: 30rpx;
.btn {
padding: 12rpx 40rpx;
width: 35%;
padding: 15rpx 0;
font-size: 28rpx;
color: #fff;
text-align: center;
background-color: $uni-primary;
border-radius: 20px;
}
.back {
padding: 12rpx 26rpx;
width: 20%;
color: #333;
background-color: #fff;
border: 1px solid #ccc;

@ -0,0 +1,27 @@
/**
/**
* 商品配置
* @author yujialong
*/
export default {
// 商品状态
goodsStatus: [
{
id: 0,
name: '上架中'
},
{
id: 2,
name: '已下架'
},
{
id: 3,
name: '草稿'
},
{
id: 4,
name: '审核中'
},
],
}

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

@ -9,11 +9,11 @@
<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>
<uni-data-picker class="picker-input" :clear-icon="false" placeholder="请选择产品分类" popup-title="请选择产品分类" preload :localdata="classifications" :map="{text: 'categoryName', value: 'categoryId'}" 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>
<uni-file-picker v-model="pic" limit="5" title="请上传封面图片,至少一张" :auto-upload="false" @select="uploadPic"></uni-file-picker>
</view>
</view>
@ -25,7 +25,7 @@
<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>
<uni-file-picker v-model="imgs" limit="10" title="添加优质图片" :auto-upload="false" @select="uploadImgs"></uni-file-picker>
</view>
</view>
</view>
@ -39,11 +39,11 @@
</view>
<view class="line">
<view class="name">价格</view>
<view class="price-select" @click="showPrice">请选择</view>
<view class="price-select" @click="showPrice(item)">{{ item.price || '请选择' }}</view>
</view>
<view class="line">
<view class="name">库存</view>
<uni-number-box v-model="item.stocks" :max="100" :min="1"></uni-number-box>
<uni-number-box v-model.number="item.stocks" :max="100" :min="1"></uni-number-box>
</view>
</view>
</view>
@ -51,23 +51,21 @@
<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" />
<input type="text" placeholder="请输入售价" v-model="curSku.price" />
</view>
<view class="line">
<view class="name">优惠</view>
<input type="text" placeholder="请输入优惠价" v-model="form.prodName" />
<view class="name">市场</view>
<input type="text" placeholder="请输入市场价" v-model="curSku.oriPrice" />
</view>
</view>
</view>
@ -77,94 +75,98 @@
<script>
import { queryProvince, queryCity, queryTeamInfo, updateTeamInfo, enterpriseCertificationStatus } from '@/apis/modules/user.js'
import { save, update, info, categoryList } from '@/apis/modules/goods.js'
import { save, update, info, categoryInfo } from '@/apis/modules/goods.js'
import OSS from '@/libs/Oss/upload'
export default {
data() {
return {
openId: uni.getStorageSync('openId'),
info: {},
prodId: '',
form: {
brief: '',
categoryId: '',
content: '',
oriPrice: '',
pic: '',
imgs: '',
price: '',
prodName: '',
skuList: [
{
actualStocks: '',
status: 1,
oriPrice: '',
price: '',
skuName: '',
stocks: '',
}
],
totalStocks: ''
},
originSku: {},
curSku: {},
pic: [],
imgs: [],
submiting: false,
uploading: false,
classifications: [],
}
},
computed: {
//
platformName() {
return this.info.platformSource === '6' ? '供应商' : this.info.platformSource === '5' ? '幼儿园' : ''
},
},
onLoad() {
onShow() {
const pages = getCurrentPages()
const { options } = pages[pages.length - 1]
this.prodId = options.prodId
this.originSku = JSON.parse(JSON.stringify(this.form.skuList[0]))
this.getCategory()
// this.getProvince()
this.getInfo()
},
methods: {
//
async getEnterInfo() {
const { data } = await enterpriseCertificationStatus(this.openId)
//
async getInfo() {
const { data } = await info({
prodId: this.prodId
})
if (data) {
this.info = data
data.platformSource === '6' && this.getClassification()
if (data.pic) {
const pic = data.pic.split(',')
this.pic = pic.map(e => {
return {
url: e
}
})
}
if (data.imgs) {
const imgs = data.imgs.split(',')
this.imgs = imgs.map(e => {
return {
url: e
}
})
}
this.form = data
}
},
//
async getCategory() {
const { data } = await categoryList()
const { data } = await categoryInfo({
parentId: 0
})
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
//
uploadPic(e){
OSS(e.tempFilePaths[0], (res) => {
this.pic.push({
name: res.name,
extname: res.ext,
url: res.url,
})
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){
//
uploadImgs(e){
OSS(e.tempFilePaths[0], (res) => {
this.pic.push({
this.imgs.push({
name: res.name,
extname: res.ext,
url: res.url,
@ -172,7 +174,8 @@
})
},
//
showPrice() {
showPrice(item) {
this.curSku = item
this.$refs.popup.open()
},
// sku
@ -189,15 +192,23 @@
if (!form.skuList.length) return this.$util.errMsg(`请输入产品规格!`)
this.submiting = true
form.pic = this.pic.map(e => e.url).join()
form.imgs = this.imgs.map(e => e.url).join()
form.oriPrice = form.skuList[0].oriPrice
form.price = form.skuList[0].price
let stocks = 0
form.skuList.map(e => {
if (e.stocks) stocks += e.stocks
})
form.totalStocks = stocks
form.status = status
try {
if (this.id) {
if (this.prodId) {
await update(form)
this.$util.sucMsg('保存成功!')
} else {
await save(form)
this.$util.sucMsg('发布成功!')
}
this.$util.sucMsg(status ? '保存成功!' : '发布成功!')
setTimeout(() => {
uni.navigateBack()

@ -3,23 +3,23 @@
<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>
<li :class="{active: curTab === 0}" @click="tabChange(0)">已上架({{ status0 }})</li>
<li :class="{active: curTab === 2}" @click="tabChange(2)">已下架({{ status2 }})</li>
<li :class="{active: curTab === 3}" @click="tabChange(3)">草稿({{ status3 }})</li>
<li :class="{active: curTab === 4}" @click="tabChange(4)">审核中({{ status4 }})</li>
</ul>
<template v-if="list.length">
<view class="list">
<view v-for="item in list" @click="toDetail(item)">
<view class="item" v-for="item in list" @click="toDetail(item)">
<view class="metas">
<view class="time">2313</view>
<view class="status">上架中</view>
<view class="time">{{ item.putawayTime }}</view>
<view :class="['status', {grounding: !item.status}]">{{ Goods.goodsStatus.find(e => e.id === item.status).name }}</view>
</view>
<view class="info">
<image class="pic" :src="item.coverUrl"></image>
<image class="pic" :src="item.pic"></image>
<view class="texts">
<view class="name">{{ item.customerName }}</view>
<view class="name">{{ item.prodName }}</view>
<view class="meta">
市场价20.00
<text class="sell">售价10</text>
@ -30,9 +30,11 @@
</view>
<view class="btns">
<!-- <view class="btn" @click.stop="toDetail(item)">查看</view> -->
<view class="btn off" @click.stop="changeStatus(item, 0)">下架</view>
<template v-if="item.status === 2 || item.status === 3">
<view class="btn del" @click.stop="del(item)">删除</view>
<view class="btn" @click.stop="toEdit(item)">编辑</view>
</template>
<view v-else-if="!item.status" class="btn off" @click.stop="changeStatus(item)">下架</view>
</view>
</view>
</view>
@ -49,9 +51,11 @@
<script>
import { page, batchDelete, prodStatus } from '@/apis/modules/goods.js'
import Goods from '@/config/goods.js'
export default {
data() {
return {
Goods,
curTab: '',
tabs: [],
reachBottom: 0, // 0->,1->,-1->
@ -60,7 +64,11 @@
keyword: '',
list: [],
page: 1,
pageSize: 10
pageSize: 10,
status0: 0,
status2: 0,
status3: 0,
status4: 0,
}
},
watch: {
@ -87,6 +95,10 @@
}
},
onShow() {
this.status0 = 0
this.status2 = 0
this.status3 = 0
this.status4 = 0
this.initList()
},
methods: {
@ -100,7 +112,11 @@
}).then(({ data }) => {
uni.hideLoading()
// list
this.list = this.reachBottom > 0 ? [...this.list, ...data.records] : data.records
const list = data.records
list.forEach(e => {
if (e.pic) e.pic = e.pic.split(',')[0]
})
this.list = this.reachBottom > 0 ? [...this.list, ...list] : list
this.page++ // page+1
const noMore = this.list.length === data.total //
this.status = noMore ? 'noMore' : 'more' // noMore
@ -119,18 +135,42 @@
this.curTab = id
this.initList()
},
//
async changeStatus(item, status) {
await prodStatus(item.prodId, status)
this.initList()
//
async changeStatus(row, status) {
const that = this
uni.showModal({
title: '提示',
content: `确定要下架吗?`,
async success(res) {
if (res.confirm) {
await prodStatus(row.prodId, 2)
that.initList()
}
}
})
},
//
del(row) {
const that = this
uni.showModal({
title: '提示',
content: '确定要删除吗?',
async success(res) {
if (res.confirm) {
await batchDelete([row.prodId])
that.$util.sucMsg('删除成功')
that.initList()
}
}
})
},
//
toDetail(item) {
this.$util.to(`../addGoods/addGoods?id=${item.prodId}&show=1`)
this.$util.to(`../addGoods/addGoods?prodId=${item.prodId}&show=1`)
},
//
toEdit(item) {
this.$util.to(`../addGoods/addGoods?id=${item.prodId}`)
this.$util.to(`../addGoods/addGoods?prodId=${item.prodId}`)
},
}
}
@ -142,7 +182,8 @@
}
.list {
margin-top: 20rpx;
li {
padding: 20rpx;
.item {
padding: 20rpx;
margin-bottom: 20rpx;
// border-bottom: 1px solid #f1f1f1;
@ -161,14 +202,21 @@
font-size: 24rpx;
color: #333;
}
.grounding {
color: #1fc133;
}
.info {
display: flex;
align-items: center;
}
.pic {
width: 150rpx;
height: 150rpx;
width: 280rpx;
height: 180rpx;
margin-right: 20rpx;
border-radius: 8px;
}
.texts {
width: calc(100% - 300rpx);
}
.name {
font-size: 30rpx;
@ -177,24 +225,26 @@
.meta {
display: flex;
margin: 10rpx 0;
font-size: 28rpx;
font-size: 24rpx;
color: #999;
}
.btns {
text-align: right;
display: flex;
justify-content: flex-end;
margin-top: 20rpx;
}
.btn {
padding: 8rpx 20rpx;
padding: 10rpx 50rpx;
margin-left: 20rpx;
font-size: 28rpx;
color: #fff;
background-color: $uni-primary;
border-radius: 4px;
border-radius: 20px;
&.del {
background-color: #f00;
background-color: #ff982e;
}
&.off {
background-color: #ccc;
background-color: #e23636;
}
}
}

@ -7,7 +7,7 @@
<view class="wrap">
<sideSelect :menus="menus" @menuClick="menuClick" />
<view class="list">
<view v-if="list.length" class="list">
<uni-swipe-action>
<uni-swipe-action-item
v-for="item in list"

@ -0,0 +1,185 @@
<template>
<view class="page">
<ul class="tab-wrap">
<scroll-view scroll-x :scroll-left="scrollLeft" class="tab tab-scroll">
<li v-for="(tab, i) in tabs" :key="i" :class="{active: curTab === tab.id}" @click="tabChange(tab)">{{ tab.name }}</li>
</scroll-view>
</ul>
<view class="list">
<view v-for="(item, i) in list" :key="i" class="item">
<view class="texts">
<view class="name ell">{{ item.competitionName }}</view>
<view class="meta">有效期 {{ item.playEndTime.substr(0, 16) }}</view>
</view>
<view :class="['use', {ing: item.playing}]" @click.stop="presign(item)">使用</view>
</view>
</view>
</view>
</template>
<script>
import { postLoginActivity } from '@/apis/modules/activity.js'
import Util from '@/libs/util'
export default {
data() {
return {
teamId: uni.getStorageSync('teamId') || '',
reachBottom: 0, // 0->,1->,-1->
status: 'more', // more|loading|noMore
keyword: '',
list: [],
page: 1,
pageSize: 5,
total: 0,
curTab: 1,
curItem: null,
submiting: false,
tabs: [
{
id: 1,
name: '活动券票'
},
{
id: 2,
name: '品牌福利'
},
{
id: 3,
name: '会员福利'
},
],
scrollLeft: 0,
timer: null,
now: '',
}
},
//
onPullDownRefresh() {
this.initList()
setTimeout(() => {
uni.stopPullDownRefresh()
}, 1500)
},
//
onReachBottom() {
if (this.reachBottom >= 0) {
this.reachBottom = 1
this.status = 'loading'
this.getList()
}
},
onShow() {
this.keyword = ''
this.initList()
},
methods: {
getList() {
postLoginActivity({
pageNum: this.page,
pageSize: this.pageSize,
listType: 1,
keyWord: this.keyword,
platformSource: ''
}).then(async ({ data }) => {
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
this.now = await Util.getNow()
this.statusInterval()
uni.hideLoading()
this.timer = setInterval(() => {
this.now = new Date(this.now.setSeconds(this.now.getSeconds() + 1))
this.statusInterval()
}, 1000)
}).catch(e => {})
},
async statusInterval () {
this.list.map(item => {
if (item.signUpStartTime && item.signUpEndTime) {
this.handleStatus(item)
}
})
},
//
handleStatus (item) {
let playing = 0
const playStartTime = new Date(item.playStartTime) //
const playEndTime = new Date(item.playEndTime) //
const { now } = this
// (whetherToSignUp 0 1)
if (now > playStartTime && now < playEndTime) {
playing = 1
}
this.$set(item, 'playing', playing)
},
initList() {
this.page = 1
this.reachBottom = 0
this.getList()
},
//
toDetail(item) {
this.$util.to('/other/activityDetail/activityDetail?id=' + item.id)
},
// tab
tabChange(tab) {
this.curTab = tab.id
this.initList()
},
}
}
</script>
<style scoped lang="scss">
.page {
padding: 20rpx;
}
.tab-wrap {
display: flex;
.tab-scroll {
width: calc(100% - 100rpx);
white-space: nowrap;
li {
display: inline-block;
}
}
}
.list {
.item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx;
margin-bottom: 28rpx;
background-color: #fff;
overflow: hidden;
border-radius: 8px;
}
.name {
font-size: 30rpx;
font-weight: 600;
color: #333;
}
.meta {
margin: 10rpx 0;
font-size: 24rpx;
color: #999;
}
.use {
padding: 8rpx 28rpx;
font-size: 28rpx;
color: #fff;
background-color: #afafaf;
border-radius: 4px;
}
.ing {
font-size: 28rpx;
background-color: $uni-primary;
}
}
</style>

@ -84,6 +84,14 @@
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false
}
},
{
"path" : "vouchers/vouchers",
"style" :
{
"navigationBarTitleText" : "电子券",
"enablePullDownRefresh" : true
}
}
]
},

@ -66,8 +66,8 @@
<view v-if="!per" class="per-mask">功能升级中敬请期待...</view>
<!-- <uni-popup ref="popup" type="dialog">
<uni-popup-dialog mode="input" placeholder="请输入4位数邀请码" :duration="2000" :before-close="true" @close="closePopup" @confirm="codeSubmit"></uni-popup-dialog> -->
</uni-popup>
<uni-popup-dialog mode="input" placeholder="请输入4位数邀请码" :duration="2000" :before-close="true" @close="closePopup" @confirm="codeSubmit"></uni-popup-dialog>
</uni-popup> -->
</view>
</template>

@ -32,7 +32,7 @@
<view class="title">基础功能</view>
<ul class="func">
<li @click="tips">
<li @click="toPage('/other/vouchers/vouchers')">
<image src="https://occupationlab.com/images/preschoolEdu/icon1.png" />
<view class="text ell">我的电子券</view>
</li>

@ -48,6 +48,7 @@
<script>
import { selectEnterpriseCertificationList, treeStructureList } from '@/apis/modules/supplier.js'
import { confirm, orderSubmit } from '@/apis/modules/goods.js'
export default {
data() {
return {
@ -188,7 +189,7 @@
toOrder(row) {
// console.log(33, this.$refs.order.popup)
const el = this.$refs.order
el.getGoods()
el.getGoods(row.teamId)
el.$refs.popup.open()
}
}

@ -80,6 +80,13 @@
this.form.companyName = data.companyName || ''
this.form.creditCode = data.creditCode || ''
this.form.legalPerson = data.legalPerson || ''
this.form.address = data.address || ''
this.form.business = data.business || ''
this.form.capital = data.capital || ''
this.form.establishDate = data.establishDate || ''
this.form.type = data.type || ''
this.form.validPeriod = data.validPeriod || ''
this.form.platformSource = this.platformId
}
},
//

Loading…
Cancel
Save