Your Name 8 months ago
parent a1ff64ada3
commit 33bb0968ef
  1. 1
      addons/shopro/controller/Category.php
  2. 4
      application/admin/controller/Warehouse.php
  3. 3
      application/admin/controller/shopro/goods/Goods.php
  4. 10
      application/admin/model/shopro/goods/Goods.php
  5. 48
      application/admin/view/shopro/category/add.html
  6. 82
      application/admin/view/shopro/goods/goods/add.html
  7. 6
      application/admin/view/shopro/user/user/detail.html
  8. 28
      application/api/controller/Warehouse.php
  9. 35
      public/assets/js/backend/shopro/goods/goods.js

@ -49,6 +49,7 @@ class Category extends Common
foreach ($row['goods_list'] as $v) {
$v->image = formatImage($v->image);
$v->images = array_map('formatImage', $v->images);
$v->back_score = 40;
}
}
$this->success('商城分类', $category);

@ -33,5 +33,9 @@ class Warehouse extends Backend
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
public function getList() {
$data= $this->model->field('id, name')->select();
$this->success('仓库地址列表', null, $data);
}
}

@ -183,7 +183,8 @@ class Goods extends Common
$params = $this->request->only([
'type', 'title', 'subtitle', 'image', 'images', 'image_wh', 'params',
'original_price', 'price', 'is_sku', 'limit_type', 'limit_num', 'sales_show_type',
'stock_show_type', 'show_sales', 'service_ids', 'dispatch_type', 'dispatch_id', 'is_offline', 'status', 'weigh',
'stock_show_type', 'show_sales', 'service_ids','dispatch_type', 'dispatch_id', 'is_offline', 'status', 'weigh',
'user_price', 'level1_price', 'level2_price', 'level3_price', 'company_price', 'is_new_user', 'warehouse_ids'
]); // likes, views, sales,
$this->request->has('content') && $params['content'] = $this->request->param('content', '', null); // content 不经过全局过滤
$this->svalidate($params);

@ -98,6 +98,16 @@ class Goods extends Common
return $service_ids;
}
public function setWarehouseIdsAttr($value, $data)
{
return is_array($value) ? join(',', $value) : $value;
}
public function getWarehouseIdsAttr($value, $data) {
$ids = $this->attrFormatComma($value, $data, 'warehouse_ids', true);
return $ids ? array_values(array_filter(array_map("intval", $ids))) : $ids;
}
public function setIsOfflineAttr($value, $data)
{

@ -135,32 +135,32 @@
<el-form-item label="分类类型">
<el-radio-group v-model="state.level" :disabled="state.type=='edit'" @change="onChangeLevel">
<el-radio :label="1">一级分类</el-radio>
<el-radio :label="2">二级分类</el-radio>
<el-radio :label="3">三级分类</el-radio>
<!-- <el-radio :label="2">二级分类</el-radio>-->
<!-- <el-radio :label="3">三级分类</el-radio>-->
</el-radio-group>
</el-form-item>
<el-form-item label="分类样式">
<div class="style-item" v-for="(item, index) in state.styleList[state.level]" :key="index"
@click="form.model.style = item.type">
<div class="top" :class="form.model.style == item.type ? 'is-active' : ''">
<img :src="`/assets/addons/shopro/img/category/${item.type}.png`" />
<el-icon>
<circle-check-filled />
</el-icon>
</div>
<div class="sa-flex sa-row-center">
<div class="style-title">样式{{ item.name }}</div>
<el-popover popper-class="style-popover sa-popper" placement="right" trigger="hover">
<img :src="`/assets/addons/shopro/img/category/${item.type}.png`" />
<template #reference>
<el-icon class="warning">
<warning />
</el-icon>
</template>
</el-popover>
</div>
</div>
</el-form-item>
<!-- <el-form-item label="分类样式">-->
<!-- <div class="style-item" v-for="(item, index) in state.styleList[state.level]" :key="index"-->
<!-- @click="form.model.style = item.type">-->
<!-- <div class="top" :class="form.model.style == item.type ? 'is-active' : ''">-->
<!-- <img :src="`/assets/addons/shopro/img/category/${item.type}.png`" />-->
<!-- <el-icon>-->
<!-- <circle-check-filled />-->
<!-- </el-icon>-->
<!-- </div>-->
<!-- <div class="sa-flex sa-row-center">-->
<!-- <div class="style-title">样式{{ item.name }}</div>-->
<!-- <el-popover popper-class="style-popover sa-popper" placement="right" trigger="hover">-->
<!-- <img :src="`/assets/addons/shopro/img/category/${item.type}.png`" />-->
<!-- <template #reference>-->
<!-- <el-icon class="warning">-->
<!-- <warning />-->
<!-- </el-icon>-->
<!-- </template>-->
<!-- </el-popover>-->
<!-- </div>-->
<!-- </div>-->
<!-- </el-form-item>-->
<el-form-item label="分类名称" prop="name">
<el-input class="sa-w-360" v-model="form.model.name" placeholder="请输入分类名称"></el-input>
</el-form-item>

@ -285,7 +285,7 @@
<el-tab-pane :name="2">
<template #label>
<div class="sa-flex" :class="validateData['2']?'is-error':''">
发货设
其他配
<el-icon v-if="validateData['2']" class="ml-1">
<warning-filled />
</el-icon>
@ -312,6 +312,16 @@
</div>
</template>
</el-tab-pane>
<el-tab-pane :name="5">
<template #label>
<div class="sa-flex" :class="validateData['5']?'is-error':''">
等级价格配置
<el-icon v-if="validateData['5']" class="ml-1">
<warning-filled />
</el-icon>
</div>
</template>
</el-tab-pane>
</el-tabs>
</el-header>
<el-main>
@ -321,9 +331,9 @@
<div class="sa-flex mb-4">
<img v-if="!(state.type=='edit' && form.model.type=='virtual')" class="goods-type" :class="form.model.type=='normal'?'is-active':''"
src="/assets/addons/shopro/img/goods/normal.png" @click="onChangeGoodsType('normal')" />
<img v-if="!(state.type=='edit' && form.model.type=='normal')" class="goods-type" :class="form.model.type=='virtual'?'is-active':''"
src="/assets/addons/shopro/img/goods/virtual.png"
@click="onChangeGoodsType('virtual')" />
<!-- <img v-if="!(state.type=='edit' && form.model.type=='normal')" class="goods-type" :class="form.model.type=='virtual'?'is-active':''"-->
<!-- src="/assets/addons/shopro/img/goods/virtual.png"-->
<!-- @click="onChangeGoodsType('virtual')" />-->
</div>
<el-form-item label="商品标题" prop="title">
<el-input class="sa-w-360" v-model="form.model.title" placeholder="请输入商品标题"></el-input>
@ -414,11 +424,11 @@
<div class="sa-flex">
<el-radio-group :disabled="state.type == 'edit'" v-model="form.model.is_sku">
<el-radio :label="0">单规格</el-radio>
<el-radio :label="1">多规格</el-radio>
<!-- <el-radio :label="1">多规格</el-radio>-->
</el-radio-group>
<div class="warning">
如商品参与了拼团、秒杀、积分等活动,切换规格,可能导致活动规格不可用
</div>
<!-- <div class="warning">-->
<!-- 如商品参与了拼团、秒杀、积分等活动,切换规格,可能导致活动规格不可用-->
<!-- </div>-->
</div>
</el-form-item>
<template v-if="form.model.is_sku == 1">
@ -788,18 +798,13 @@
</el-form-item>
<el-form-item v-if="form.model.dispatch_type == 'shopZt'" label="自提地址" prop="dispatch_id">
<div class="sa-w-360">
<el-checkbox-group v-model="ruleForm.type">
<el-checkbox value="Online activities" name="type">
南京仓
</el-checkbox>
<el-checkbox value="Promotion activities" name="type">
江宁仓
</el-checkbox>
<el-checkbox value="Offline activities" name="type">
南站仓
</el-checkbox>
<el-checkbox value="Simple brand exposure" name="type">
雨花仓
<el-checkbox-group v-model="form.model.warehouse_ids">
<el-checkbox style="width: 230px;"
v-for="item in form.model.shop_name_list"
:key="item.id"
:label="item.id"
>
{{item.name}}
</el-checkbox>
</el-checkbox-group>
</div>
@ -897,6 +902,43 @@
</el-form-item>
</div>
</el-form>
<el-form :model="form.model" :rules="form.rules" ref="formRef5" label-width="100px">
<div v-show="state.activeStep==5">
<el-form-item label="会员用户" prop="user_price">
<el-input class="sa-w-360" v-model="form.model.user_price" placeholder="请输入会员价格" type="number">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item label="初级代理" prop="level1_price">
<el-input class="sa-w-360" v-model="form.model.level1_price" placeholder="请输入初级代理价格" type="number">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item label="中级代理" prop="level2_price">
<el-input class="sa-w-360" v-model="form.model.level2_price" placeholder="请输入中级代理价格" type="number">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item label="高级代理" prop="level3_price">
<el-input class="sa-w-360" v-model="form.model.level3_price" placeholder="请输入高级代理价格" type="number">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item label="公司账号" prop="company_price">
<el-input class="sa-w-360" v-model="form.model.company_price" placeholder="请输入高级代理价格" type="number">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item label="设为新人大礼包">
<el-radio-group v-model="form.model.is_new_user">
<el-radio :label=1></el-radio>
<el-radio :label=0></el-radio>
</el-radio-group>
</el-form-item>
</div>
</el-form>
</el-scrollbar>
</el-main>
<el-footer class="sa-footer--submit sa-flex sa-row-right">

@ -282,11 +282,11 @@
<div class="title sa-flex"> 用户动态 </div>
<div class="bottom">
<el-tabs v-model="log.tabActive" @tab-change="onChangeTab">
<el-tab-pane label="余额记录" name="money"></el-tab-pane>
<!-- <el-tab-pane label="余额记录" name="money"></el-tab-pane>-->
<el-tab-pane label="积分记录" name="score"></el-tab-pane>
<el-tab-pane label="佣金记录" name="commission"></el-tab-pane>
<!-- <el-tab-pane label="佣金记录" name="commission"></el-tab-pane>-->
<el-tab-pane label="订单记录" name="order"></el-tab-pane>
<el-tab-pane label="分享记录" name="share"></el-tab-pane>
<!-- <el-tab-pane label="分享记录" name="share"></el-tab-pane>-->
<el-tab-pane label="优惠券明细" name="coupon"></el-tab-pane>
</el-tabs>
<el-table

@ -0,0 +1,28 @@
<?php
namespace app\api\controller;
use app\common\controller\Api;
use app\admin\model\Warehouse as warehouseModel;
class Warehouse extends Api
{
protected $noNeedLogin = ['*'];
protected $noNeedRight = ['*'];
protected $model;
public function _initialize() {
parent::_initialize();
$this->model = new warehouseModel();
}
/**
* 仓库列表
* @return
*/
public function list() {
$list = $this->model->paginate(10);
$this->success('success', $list);
}
}

@ -413,6 +413,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
is_offline: 0,
is_sku: 0,
price: '',
user_price: '',
level1_price: '',
level2_price: '',
level3_price: '',
company_price: 700,
is_new_user: 1,
original_price: 0,
cost_price: 0,
stock_show_type: 'exact',
@ -442,14 +448,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
service_ids: [],
params: [],
content: '',
shop_name_arr: [
{
1:'南京仓',
2:'南京仓',
3:'南京仓',
4:'南京仓',
}
]
shop_name_list:[
{ name: '南京仓', id: '1' },
{ name: '江宁仓', id: '2' },
{ name: '建邺仓', id: '3' }
],
warehouse_ids: [],
},
rules: {
image: [{ required: true, message: '请选择商品主图', trigger: 'blur' }],
@ -489,6 +493,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
$('#goodsContent').html(form.model.content)
getDispatchSelect()
getWareHouseList()
return false
}, function (ret, res) { })
}
@ -607,6 +612,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
return false
}, function (ret, res) { })
}
function getWareHouseList() {
Fast.api.ajax({
url: 'warehouse/getList',
type: 'GET',
}, function (ret, res) {
console.log('仓库ID',form.model.warehouse_ids)
form.model.shop_name_list = res.data
return false
}, function (ret, res) { })
}
function onAddDispatch(dispatch_type) {
Fast.api.open(`shopro/dispatch/dispatch/add?type=add&dispatch_type=${dispatch_type}`, "添加", {
callback() {
@ -953,6 +970,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
}
submitForm.category_ids = idsArr.join(',');
console.log('仓库地址',form.model.warehouse_ids)
if (submitForm.is_sku == 0) {
if (!state.tempData.isStockWarning) {
submitForm.stock_warning = null

Loading…
Cancel
Save