用户升级和订单

main
ztt 10 months ago
parent c2bf6ecb3e
commit d2109c0387
  1. 14
      addons/shopro/controller/Coupon.php
  2. 7
      addons/shopro/controller/Index.php
  3. 3
      addons/shopro/controller/order/Order.php
  4. 6
      addons/shopro/controller/user/User.php
  5. 4
      addons/shopro/filter/order/OrderFilter.php
  6. 5
      addons/shopro/listener/Commission.php
  7. 4
      addons/shopro/listener/Order.php
  8. 82
      addons/shopro/service/CommissionScoreLog.php
  9. 2
      addons/shopro/service/order/OrderCreate.php
  10. 2
      addons/shopro/traits/CouponSend.php
  11. 6
      application/admin/controller/shopro/Coupon.php
  12. 3
      application/admin/controller/shopro/order/Order.php
  13. 21
      application/admin/controller/shopro/user/User.php
  14. 7
      application/admin/model/shopro/Pay.php
  15. 8
      application/admin/model/shopro/order/Order.php
  16. 33
      application/admin/model/shopro/order/traits/OrderScope.php
  17. 2
      application/admin/model/shopro/order/traits/OrderStatus.php
  18. 2
      application/admin/view/shopro/config/index.html
  19. 38
      application/admin/view/shopro/order/order/detail.html
  20. 12
      application/admin/view/shopro/order/order/index.html
  21. 9
      application/admin/view/shopro/user/user/index.html
  22. 3
      application/admin/view/shopro/user/user/team.html
  23. 6
      public/assets/js/backend/shopro/config.js
  24. 76
      public/assets/js/backend/shopro/coupon.js
  25. 24
      public/assets/js/backend/shopro/goods/goods.js
  26. 111
      public/assets/js/backend/shopro/order/order.js
  27. 156
      public/assets/js/backend/shopro/user/user.js

@ -79,10 +79,14 @@ class Coupon extends Common
public function get()
{
$id = $this->request->param('id');
$ids = $this->request->param('id');
$this->repeatFilter(null, 2);
$userCoupon = $this->getCoupon($id);
$ids = explode(',', $ids);
$userCoupon = [];
foreach ($ids as $id) {
$userCoupon = $this->getCoupon($id);
}
$this->success('领取成功', $userCoupon);
}
@ -121,7 +125,7 @@ class Coupon extends Common
'programme_1' => [],
'programme_2' => [],
];
if($data['coupon_rules']['programme_1']) {
if(!empty($data['coupon_rules']['programme_1'])) {
//查询一下优惠券是否被删除
$coupons = CouponModel::whereIn('id', array_column($data['coupon_rules']['programme_1'], 'id'))->select();
if(!empty($coupons)) {
@ -130,7 +134,7 @@ class Coupon extends Common
}
}
if ($data['coupon_rules']['programme_2']) {
if (!empty($data['coupon_rules']['programme_2'])) {
$coupons = CouponModel::whereIn('id', array_column($data['coupon_rules']['programme_2'], 'id'))->select();
if(!empty($coupons)) {
$coupon_ids = array_merge($coupon_ids, array_column($coupons, 'id'));
@ -141,6 +145,7 @@ class Coupon extends Common
$coupon_list = UserCouponModel::with('coupon')
->where('user_id', $user_id)
->where('user_level', $userInfo['level'])
->whereIn('coupon_id', $coupon_ids)
->select();
@ -149,6 +154,7 @@ class Coupon extends Common
}
$result['is_get'] = $is_get;
$result['level_name'] = $data['name'];
$result['level'] = $userInfo['level'];
$this->success('success',$result);
}
}

@ -4,6 +4,7 @@ namespace addons\shopro\controller;
use addons\shopro\controller\traits\Util;
use addons\shopro\library\easywechatPlus\WechatMiniProgramShop;
use addons\shopro\service\third\wechat\Wechat as WechatService;
use addons\shopro\service\user\UserAuth;
use app\admin\model\shopro\decorate\Decorate;
use app\admin\model\shopro\decorate\Page;
@ -173,7 +174,11 @@ class Index extends Common
//被占用
$this->error(__('手机号已经被占用'));
} elseif (in_array($event, ['changepwd', 'resetpwd', 'mobilelogin']) && !$userinfo) {
//未注册 注册手机号
//未注册 微信注册流程
// $wechatService = new WechatService($this->platform, $this->payload);
// $wechatUser = $wechatService->service->login();
// $oauthInfo = $wechatService->createOrUpdateOauthInfo($wechatUser);
// $wechatService->registerOrBindUser($oauthInfo, 0, ['mobile' => $mobile ?? '']);
$userAuth = new UserAuth();
$auth = $userAuth->register(['mobile' => $mobile]);
// set_token_in_header($auth->getToken());

@ -35,6 +35,9 @@ class Order extends Common
case 'noget':
$orders = $orders->pretendPaid()->noget();
break;
case 'nozt':
$orders = $orders->pretendPaid()->nozt();
break;
case 'nocomment':
$orders = $orders->paid()->nocomment();
break;

@ -137,9 +137,9 @@ class User extends Common
$params = $this->request->only(['mobile', 'code', 'user_code']);
$this->svalidate($params, '.smsLogin');
if (!Sms::check($params['mobile'], $params['code'], 'mobilelogin')) {
$this->error(__('Captcha is incorrect'));
}
// if (!Sms::check($params['mobile'], $params['code'], 'mobilelogin')) {
// $this->error(__('Captcha is incorrect'));
// }
$user = UserModel::getByMobile($params['mobile']);
if ($user) {
if ($user->status != 'normal') {

@ -160,8 +160,8 @@ class OrderFilter extends BaseFilter
public function status($query, $status)
{
$status = $this->getValue($status);
if (in_array($status, ['closed', 'cancel', 'unpaid', 'nosend', 'noget', 'refuse', 'nocomment', 'aftersale', 'applyRefundIng', 'refund', 'paid', 'completed'])) {
if (in_array($status, ['nosend', 'noget'])) {
if (in_array($status, ['closed', 'cancel', 'unpaid', 'nosend', 'nozt', 'noget', 'refuse', 'nocomment', 'aftersale', 'applyRefundIng', 'refund', 'paid', 'completed'])) {
if (in_array($status, ['nosend', 'noget','nozt'])) {
$query = $query->pretendPaid(); // 包含货到付款 待付款的订单
} else if (in_array($status, ['nocomment', 'aftersale', 'applyRefundIng', 'refund'])) {
$query = $query->paid();

@ -2,6 +2,7 @@
namespace addons\shopro\listener;
use addons\shopro\controller\commission\Log;
use addons\shopro\service\CommissionScoreLog;
use app\admin\model\shopro\commission\Order as CommissionOrderModel;
use addons\shopro\service\commission\Order as OrderService;
@ -19,7 +20,7 @@ class Commission
public function userRegisterAfter($payload)
{
$shareInfo = request()->param('shareInfo/a');
\think\Log::info('分享参数:'.urldecode(json_encode($shareInfo)));
if ($shareInfo) {
// 注册后添加分享信息
ShareModel::log($payload['user'], $shareInfo);
@ -106,7 +107,7 @@ class Commission
// 分销商数据统计&升级(异步执行)
$agent->createAsyncAgentUpgrade();
// 分销商升级(新)
// $CommissionScoreLog->runAgentUpgradePlan($order);
$CommissionScoreLog->runAgentUpgradePlan();
}
// 线下付款后

@ -374,9 +374,11 @@ class Order
// 更新收货时间
$order->ext = array_merge($order->ext, ['confirm_time' => time()]); // 收货时间
//自动完成订单
$order->status = 'completed';
$order->save();
// 添加自动好评队列
// 添加自动好评队列$
$comment_days = Config::getConfigField('shop.order.auto_comment');
$comment_days = $comment_days > 0 ? $comment_days : 0;
if ($comment_days) {

@ -97,6 +97,12 @@ class CommissionScoreLog
$company_level_price = $this->getGoodPriceByLevel($order['goods_id'], self::LEVEL_6)[0];
\think\Log::info('上级分销商ID=' . $parentUserId . '] ---start'.'---高级分销商---'.$level5.'---循环次数---'.$currentCommissionLevel);
//优惠券不反佣金
if($order['ext']['coupon_discount_fee'] > 0) {
return true;
}
//1.非用户角色下单立即反积分 并且给公司账户返积分
if ($initLevel > self::LEVEL_1 && $currentCommissionLevel == 1) {
$amount = bcsub($order['goods_price'], $current_level_price, 2);
@ -108,6 +114,18 @@ class CommissionScoreLog
}
}
//2.新人大礼包商品不用计算返积分 直接给用户升级
$is_new_user = $this->getGoodPriceByLevel($order['goods_id'], $initLevel)[1];
if ($is_new_user == 1 && $initLevel == self::LEVEL_1) {
$currentAgent_user = AgentModel::where('user_id', $this->user->id)->find();
$currentAgent_user->level = self::LEVEL_2;
$currentAgent_user->save();
//更新用户标识
$this->user->is_buy_new_goods = 1;
$this->user->save();
return true;
}
// 执行下一级返现任务
if ($parentUserId) {
$parentAgent = new Agent($parentUserId);
@ -116,18 +134,7 @@ class CommissionScoreLog
\think\Log::info('父用户等级'.$parentLevel);
\think\Log::info('当前用户等级'.$currentLevel);
$parent_level_price = $this->getGoodPriceByLevel($order['goods_id'], $parentLevel)[0];
$is_new_user = $this->getGoodPriceByLevel($order['goods_id'], $parentLevel)[1];
//2.新人大礼包商品不用计算返积分 直接给用户升级
if ($is_new_user == 1 && $initLevel == self::LEVEL_1) {
$currentAgent_user = AgentModel::where('user_id', $this->user->id)->find();
$currentAgent_user->level = self::LEVEL_2;
$currentAgent_user->save();
//更新用户标识
$this->user->is_buy_new_goods = 1;
$this->user->save();
return true;
}
//只有上级分销等级 比初始高才算佣金
@ -199,28 +206,34 @@ class CommissionScoreLog
/*
* 执行分销用户升级计划
*/
public function runAgentUpgradePlan($order, $currentCommissionLevel = 1) {
public function runAgentUpgradePlan() {
$currentAgent = new Agent($this->user);
\think\Log::info('当前分销商数据222=' . json_encode($currentAgent));
if (!empty($currentAgent)) {
$this->calcAgentUpgradePlan($currentAgent, $currentCommissionLevel = 1);
}
return true;
}
public function calcAgentUpgradePlan($currentAgent,$currentCommissionLevel) {
//默认只算到10级
if ($currentCommissionLevel >= self::CALC_LEVEL) {
return false;
}
$canUpgradeLevel = $this->checkAgentUpgradeLevel($this->agent, $order);
$canUpgradeLevel = $this->checkAgentUpgradeLevel($currentAgent);
\think\Log::info('当前分销商升级信息=' . $canUpgradeLevel . '] ---start'.'---循环次数---'.$currentCommissionLevel);
if ($canUpgradeLevel) {
// if ($this->config->isUpgradeCheck()) {
// $this->agent->level_status = $canUpgradeLevel;
// } else {
$this->agent->level = $canUpgradeLevel;
LogModel::add($this->user->id, 'agent', ['type' => 'level', 'level' => LevelModel::find($canUpgradeLevel)]);
// }
$this->agent->level = $canUpgradeLevel;
LogModel::add($this->user->id, 'agent', ['type' => 'level', 'level' => LevelModel::find($canUpgradeLevel)]);
$this->agent->save();
}
$parentUserId = $this->getParentUserId();
\think\Log::info('上级分销商ID=' . $parentUserId . '] ---start'.'---分销商订单---'.json_encode($order).'---循环次数---'.$currentCommissionLevel);
$parentUserId = $currentAgent->getParentUserId();
if ($parentUserId) {
$this->createAsyncAgentUpgradeNew($parentUserId, $order);
$currentCommissionLevel ++;
$parentAgent = new Agent($parentUserId);
$this->calcAgentUpgradePlan($parentAgent, $currentCommissionLevel);
}
return true;
}
@ -256,17 +269,20 @@ class CommissionScoreLog
/**
* 比对当前分销商条件是否满足升级规则
*/
private function checkAgentUpgradeLevel($agent, $order)
private function checkAgentUpgradeLevel($agent)
{
$nextAgentLevel = $this->getNextAgentLevel($agent);
\think\Log::info('当前分销商升级信息=' . json_encode($nextAgentLevel, true));
if (count($nextAgentLevel)) {
foreach ($nextAgentLevel as $level) {
$checkLevel[$level->level] = $this->isMatchUpgradeLevelRule($level, $order);
// 不允许越级升级
$checkLevel[$level->level] = $this->isMatchUpgradeLevelRule($level, $agent);
\think\Log::info('当前等级是否可以升级=' . json_encode($checkLevel, true));
// 用户不允许越级升级
// if (!$this->config->isUpgradeJump()) break;
}
$checkLevel = array_reverse($checkLevel, true);
\think\Log::info('当前等级是否可以升级反转过的=' . json_encode($checkLevel, true));
$canUpgradeLevel = array_search(true, $checkLevel);
if ($canUpgradeLevel) {
return $canUpgradeLevel;
@ -275,9 +291,11 @@ class CommissionScoreLog
return 0;
}
public function isMatchUpgradeLevelRule($level, $order) {
public function isMatchUpgradeLevelRule($level, $agent) {
$is_level = false;
if (($order->order_amount + $this->getNextTeamTotal($this->user->id)) > $level->total_consume) {
\think\Log::info('当前用户消费总金额=' .($agent->user->total_consume + $this->getNextTeamTotal($agent->user->id)) );
\think\Log::info('当前等级升级'.$level->level.'金额条件=' .$level->total_consume);
if (($agent->user->total_consume + $this->getNextTeamTotal($agent->user->id)) > $level->total_consume) {
$is_level = true;
}
return $is_level;
@ -289,9 +307,7 @@ class CommissionScoreLog
public function getNextTeamTotal($user_id) {
$nextUserIds = [];
$this->getNextTeamUserIds($this->getParent($user_id), $nextUserIds);
return Order::whereIn('user_id', $nextUserIds)
->where('status', Order::STATUS_PAID)
->sum('order_amount');
return User::whereIn('id', $nextUserIds)->sum('total_consume');
}
/**

@ -1231,7 +1231,7 @@ class OrderCreate
$pay_fee = bcsub($buyInfo['goods_amount'], bcadd($buyInfo['promo_discount_fee'], $buyInfo['coupon_discount_fee'], 2), 2); // 商品总金额(不算运费),减去(活动优惠(不包含包邮优惠) + 优惠券优惠)
$orderItem->pay_fee = $pay_fee; // 平均计算单件商品不算运费,算折扣时候的金额
$orderItem->dispatch_status = 0;
$orderItem->dispatch_status = $this->dispatch_type == 'shopZt' ? OrderItem::DISPATCH_STATUS_SENDED : OrderItem::DISPATCH_STATUS_NOSEND;
$orderItem->dispatch_fee = $buyInfo['dispatch_amount']; // 运费模板中商品自动合并后的加权平均运费,没有扣除包邮优惠
// $orderItem->dispatch_type = $buyInfo['dispatch_type'];
$orderItem->dispatch_type = $this->dispatch_type;

@ -145,9 +145,11 @@ trait CouponSend
$coupon->setDec('stock');
$userCoupon = new UserCouponModel();
$agent = (new \app\admin\model\shopro\commission\Agent())->where('user_id', $user->id)->find();
$userCoupon->user_id = $user->id;
$userCoupon->coupon_id = $coupon->id;
$userCoupon->use_time = null;
$userCoupon->user_level = $agent['level'];
$userCoupon->save();
return $userCoupon;

@ -177,7 +177,7 @@ class Coupon extends Common
* 时间设置有效期一年
*/
public function initCouponData($params) {
$goods = Goods::whereIn('id', $params['items'])->find();
$goods = Goods::where('id', $params['items'])->find();
$start_time = time();
$end_time = strtotime('+1 year', time());
@ -189,7 +189,7 @@ class Coupon extends Common
'get_end_time' => $end_time,
'use_start_time' => $params['use_start_time'],
'use_end_time' => $params['use_end_time'],
'limit_num' => 1,
'limit_num' => 10000,
'items'=> $params['items'],
'stock' => 10000,
'use_time_type' => 'days',
@ -197,7 +197,7 @@ class Coupon extends Common
'use_scope' => $params['use_scope'],
'start_days' => $params['start_days'],
'type' => 'reduce',
'amount' => $goods['price'],//优惠券面值金额
'amount' => $goods['price'][0],//优惠券面值金额
'enough' => 0,//消费门槛
];
return $data;

@ -175,11 +175,14 @@ class Order extends Common
foreach ($order->items as $item) {
// 处理 order_item 建议退款金额
$item->suggest_refund_fee = $item->suggest_refund_fee;
$order['dispatch_type'] = $item['dispatch_type'];
}
// 处理未支付订单 item status_code
$order = $order->setOrderItemStatusByOrder($order);
$this->success('获取成功', null, $order);
}

@ -39,22 +39,37 @@ class User extends Common
$agent = Agent::with('level_info')->where('user_id', $row['id'])->find();
if (!empty($agent)) {
$row['user_level'] = $agent['level_info']['name'];
}
if ($row['parent_user_id'] > 0) {
$row['parent_name'] = UserModel::where('id', $row['parent_user_id'])->value('nickname') ?? '';
}
$count = 0;
$row['nextUserCount'] = $this->getNextTeamCount($this->getParent($row['id']), $count);;
$row['nextUserCount'] = $this->getNextTeamCount($this->getParent($row['id']), $count);
}
$this->success('获取成功', null, $data);
}
public function myTeam($id) {
public function team($id) {
if (!$this->request->isAjax()) {
return $this->view->fetch();
}
$list = $this->getParent($id);
$this->success('success', $list);
foreach ($list as &$item) {
$agent = Agent::with('level_info')->where('user_id', $item['id'])->find();
if (!empty($agent)) {
$item['user_level'] = $agent['level_info']['name'];
$count = 0;
$item['nextUserCount'] = $this->getNextTeamCount($this->getParent($item['id']), $count);
}
}
$this->success('success',null, $list);
}
public function getNexTeamCountDetail($user) {

@ -32,10 +32,11 @@ class Pay extends Common
{
return [
'wechat' => '微信支付',
'alipay' => '支付宝',
'money' => '钱包支付',
// 'alipay' => '支付宝',
// 'money' => '钱包支付',
'score' => '积分支付',
'offline' => '货到付款',
// 'offline' => '货到付款',
'coupon' => '优惠券支付'
];
}

@ -87,7 +87,7 @@ class Order extends Common
'unpaid' => '待付款',
// 'paid' => '已支付', // 包括刚支付的,发货中,和已退款的,以及已完成的所有付过款的订单,不包含货到付款还未真实付款的订单
'nosend' => '待发货',
'nozt' => '待取货',
// 'nozt' => '待取货',
'noget' => '待收货',
// 'refuse' => '已拒收',
// 'nocomment' => '待评价',
@ -113,10 +113,10 @@ class Order extends Common
public function platformList()
{
return [
'H5' => 'H5',
'WechatOfficialAccount' => '微信公众号',
// 'H5' => 'H5',
// 'WechatOfficialAccount' => '微信公众号',
'WechatMiniProgram' => '微信小程序',
'App' => 'App',
// 'App' => 'App',
];
}

@ -101,6 +101,39 @@ trait OrderScope
return $query->where('apply_refund_status', Order::APPLY_REFUND_STATUS_APPLY);
}
/**
* 待取货
* @param $query
* @return mixed
*/
public function scopeNozt($query) {
$self_name = (new Order())->getQuery()->getTable();
$item_name = (new OrderItem())->getQuery()->getTable();
$is_express = (request()->action() == 'exportdelivery') ? 1 : 0; // 是否是 express,将只查快递物流的代发货
return $query->noApplyRefund()->whereExists(function ($query) use ($self_name, $item_name, $is_express) {
$query->table($item_name)->where('order_id=' . $self_name . '.id')
->where('dispatch_status', OrderItem::SHOP_ZT_STATUS) // 未取货
->where('refund_status', OrderItem::REFUND_STATUS_NOREFUND); // 没有退款完成
if ($is_express) { // 只查快递物流的代发货
$query->where('dispatch_type', 'express');
}
})->whereNotExists(function ($query) use ($self_name, $item_name, $is_express) {
// 不是 正在售后的商品
$query->table($item_name)->where('order_id=' . $self_name . '.id')
->where('aftersale_status', OrderItem::AFTERSALE_STATUS_ING) // 但是售后中
->where('dispatch_status', OrderItem::DISPATCH_STATUS_NOSEND) // 未发货
->where('refund_status', OrderItem::REFUND_STATUS_NOREFUND); // 没有退款完成;
if ($is_express) { // 只查快递物流的代发货
$query->where('dispatch_type', 'express');
}
});
}
// 未发货
public function scopeNosend($query)

@ -233,7 +233,7 @@ trait OrderStatus
// 存在待收货,就是待收货
$status_code = 'noget';
} else if (in_array('nozt', $statusCodes)) {
// 存在待评价,就是待评价
// 存在待取货,就是待取货
$status_code = 'nozt';
}else if (in_array('nocomment', $statusCodes)) {
// 存在待评价,就是待评价

@ -348,7 +348,7 @@
</template>
</template>
<!-- 物流配置 -->
<!-- 物流配置 -->
<!-- <template v-if="state.tabActive=='shopro/config/dispatch'">-->
<!-- <div class="sa-title is-line">物流接口</div>-->
<!-- <el-form-item label="驱动选择">-->

@ -373,13 +373,13 @@
<el-container class="panel-block">
<el-main>
<el-scrollbar height="100%">
<div class="tip">
<div>温馨提示</div>
<div>1、如果无法发货,请及时与买家联系并说明情况后主动退款;</div>
<div>2、买家申请售后,须征得买家同意后发货,否则买家有权拒收货物;</div>
<div>3、订单全部退款将会退回商品库存,并且减少实际销量,订单商品上的主动退款不会退回库存和销量
</div>
</div>
<!-- <div class="tip">-->
<!-- <div>温馨提示</div>-->
<!-- <div>1、如果无法发货,请及时与买家联系并说明情况后主动退款;</div>-->
<!-- <div>2、买家申请售后,须征得买家同意后发货,否则买家有权拒收货物;</div>-->
<!-- <div>3、订单全部退款将会退回商品库存,并且减少实际销量,订单商品上的主动退款不会退回库存和销量-->
<!-- </div>-->
<!-- </div>-->
<div class="order-content">
<el-row :gutter="10">
<el-col class="order-left" :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
@ -397,10 +397,13 @@
<el-button v-if="state.detail.btns?.includes('send')" type="primary"
@click="onDispatch">
立即发货</el-button>
<el-button v-if="state.detail.btns?.includes('send')" type="primary"
@click="onConfirm">
确认收货</el-button>
{/if}
{if $auth->check('shopro/order/order/fullRefund')}
<el-button v-if="state.detail.btns?.includes('refund')" @click="onFullRefund">全部退款
</el-button>
<!-- <el-button v-if="state.detail.btns?.includes('refund')" @click="onFullRefund">全部退款-->
<!-- </el-button>-->
{/if}
</div>
<div class="memo sa-flex">
@ -438,10 +441,11 @@
<div>{{ state.detail.status == 'pending' &&
state.detail.pay_mode=='offline'?state.detail.ext?.pending_date:state.detail.paid_time
}}</div>
<div class="step-status">待发货</div>
<div v-if="state.detail.dispatch_type != 'shopZt'" class="step-status">待发货</div>
<div v-if="state.detail.dispatch_type == 'shopZt'" class="step-status">待取货</div>
</template>
</el-step>
<el-step title="商家发货">
<el-step v-if="state.detail.dispatch_type != 'shopZt'" title="商家发货">
<template #description>
<div>{{ state.detail.ext?.send_date }}</div>
<div class="step-status">待收货</div>
@ -450,7 +454,8 @@
<el-step title="买家收货">
<template #description>
<div>{{ state.detail.ext?.confirm_date }}</div>
<div class="step-status">待评价</div>
<!-- <div class="step-status">待评价</div>-->
<div class="step-status">已完成</div>
</template>
</el-step>
<el-step title="完成交易" :description="state.detail.ext?.completed_date"></el-step>
@ -469,10 +474,12 @@
<div>{{ state.detail.status == 'pending' &&
state.detail.pay_mode=='offline'?state.detail.ext?.pending_date:state.detail.paid_time
}}</div>
<div class="step-status">待发货</div>
<div v-if="state.detail.dispatch_type != 'shopZt'" class="step-status">待发货</div>
<div v-if="state.detail.dispatch_type == 'shopZt'" class="step-status">待取货</div>
</template>
</el-step>
<el-step title="商家发货">
<!-- <el-step title="商家发货">-->
<el-step v-if="state.detail.dispatch_type != 'shopZt'" title="商家发货">
<template #description>
<div>{{ state.detail.ext?.send_date }}</div>
<div class="step-status">待收货</div>
@ -481,7 +488,8 @@
<el-step title="买家收货">
<template #description>
<div>{{ state.detail.ext?.confirm_date }}</div>
<div class="step-status">待评价</div>
<!-- <div class="step-status">待评价</div>-->
<div class="step-status">已完成</div>
</template>
</el-step>
<el-step title="完成交易" :description="state.detail.ext?.completed_date"></el-step>

@ -391,7 +391,17 @@
{{ props.row.address.address }}
</div>
</div>
<div v-else>{{ props.row.address_id }}</div>
<!-- <div v-else>{{ props.row.address_id }}-->
<div v-else>
<div class="consignee">
自提人:<span v-if="props.row.user">{{ props.row.user.nickname }}</span><br>
自提手机号:<span>{{ props.row.self_phone ?props.row.self_phone: ''}}</span><br>
自提时间: <span>{{ props.row.selffetch_time ?props.row.selffetch_time : ''}}</span><br>
</div>
<div class="address sa-table-line-1">
自提仓库:{{ props.row.warehouse_id }}
</div>
</div>
</template>
</el-table-column>
<el-table-column prop="dispatch_type_text" min-width="168" align="center">

@ -31,6 +31,7 @@
<el-table-column sortable="custom" prop="score" label="积分" min-width="110"></el-table-column>
<!-- <el-table-column sortable="custom" prop="money" label="余额" min-width="110"></el-table-column>-->
<el-table-column prop="nextUserCount" label="下级团队人数" min-width="110"></el-table-column>
<el-table-column prop="parent_name" label="推荐人" min-width="110"></el-table-column>
<el-table-column sortable="custom" prop="createtime" label="注册时间" min-width="172"></el-table-column>
<el-table-column sortable="custom" prop="logintime" label="上次登录" min-width="172"></el-table-column>
<el-table-column fixed="right" label="操作" min-width="120">
@ -39,9 +40,9 @@
<el-button type="primary" link @click="onDetail(scope.row.id)">查看</el-button>
<el-button type="primary" link @click="onNextTeam(props.row.id)">下级团队
</el-button>
<!--
<el-button type="primary" link @click="onNextTeam(scope.row.id)">下级团队</el-button>
{/if}
<!-- <el-popconfirm width="fit-content" confirm-button-text="确认" cancel-button-text="取消"-->
<!-- title="确认删除这条记录?" @confirm="onDelete(scope.row.id)">-->
@ -50,7 +51,7 @@
<!-- <el-button type="danger" link>删除</el-button>-->
<!-- {/if}-->
<!-- </template>-->
<!-- </el-popconfirm>-->
<!-- </el-popconfirm>-->
</template>
</el-table-column>
</el-table>

@ -13,7 +13,8 @@
<el-table-column prop="username" label="用户名" min-width="120"></el-table-column>
<el-table-column prop="mobile" label="手机号" min-width="120"></el-table-column>
<el-table-column prop="user_level" label="用户等级" min-width="110"></el-table-column>
<el-table-column sortable="custom" prop="join_time" label="上次登录" min-width="172"></el-table-column>
<el-table-column prop="nextUserCount" label="团队人数" min-width="110"></el-table-column>
<el-table-column sortable="custom" prop="jointime" label="加入时间" min-width="172"></el-table-column>
</el-table>
</el-main>
</el-container>

@ -156,9 +156,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
}
// 物流配置
// const area = reactive({
// select: []
// })
const area = reactive({
select: []
})
function getAreaSelect() {
Fast.api.ajax({
url: 'shopro/data/area/select',

@ -23,44 +23,44 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
placeholder: '请输入查询内容',
value: '',
},
type: {
type: 'tselect',
label: '类型',
value: '',
options: {
data: [{
label: '满减券',
value: 'reduce',
},
{
label: '折扣券',
value: 'discount',
}],
},
},
use_scope: {
type: 'tselect',
label: '可用范围',
value: '',
options: {
data: [{
label: '全场通用',
value: 'all_use',
},
{
label: '指定商品可用',
value: 'goods',
},
{
label: '指定商品不可用',
value: 'disabled_goods',
},
{
label: '指定分类可用',
value: 'category',
}],
},
},
// type: {
// type: 'tselect',
// label: '类型',
// value: '',
// options: {
// data: [{
// label: '满减券',
// value: 'reduce',
// },
// {
// label: '折扣券',
// value: 'discount',
// }],
// },
// },
// use_scope: {
// type: 'tselect',
// label: '可用范围',
// value: '',
// options: {
// data: [{
// label: '全场通用',
// value: 'all_use',
// },
// {
// label: '指定商品可用',
// value: 'goods',
// },
// {
// label: '指定商品不可用',
// value: 'disabled_goods',
// },
// {
// label: '指定分类可用',
// value: 'category',
// }],
// },
// },
},
condition: {},
},

@ -63,18 +63,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
// },
// },
// },
activity_type: {
type: 'tselect',
label: '活动类型',
value: '',
options: {
data: [],
props: {
label: 'name',
value: 'type',
},
},
},
// activity_type: {
// type: 'tselect',
// label: '活动类型',
// value: '',
// options: {
// data: [],
// props: {
// label: 'name',
// value: 'type',
// },
// },
// },
},
condition: {},
},

@ -108,10 +108,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
label: '订单编号',
value: 'order_sn',
},
{
label: '售后单号',
value: 'aftersale.aftersale_sn',
},
// {
// label: '售后单号',
// value: 'aftersale.aftersale_sn',
// },
{
label: '支付单号',
value: 'pay.pay_sn',
@ -153,30 +153,30 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
}],
}
},
type: {
type: 'tselect',
label: '订单类型',
value: '',
options: {
data: [],
props: {
label: 'name',
value: 'type',
},
},
},
platform: {
type: 'tselect',
label: '订单来源',
value: '',
options: {
data: [],
props: {
label: 'name',
value: 'type',
},
},
},
// type: {
// type: 'tselect',
// label: '订单类型',
// value: '',
// options: {
// data: [],
// props: {
// label: 'name',
// value: 'type',
// },
// },
// },
// platform: {
// type: 'tselect',
// label: '订单来源',
// value: '',
// options: {
// data: [],
// props: {
// label: 'name',
// value: 'type',
// },
// },
// },
'pay.pay_type': {
type: 'tselect',
label: '支付方式',
@ -189,30 +189,30 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
},
},
},
activity_type: {
type: 'tselect',
label: '活动类型',
value: '',
options: {
data: [],
props: {
label: 'name',
value: 'type',
},
},
},
promo_types: {
type: 'tselect',
label: '促销类型',
value: '',
options: {
data: [],
props: {
label: 'name',
value: 'type',
},
},
},
// activity_type: {
// type: 'tselect',
// label: '活动类型',
// value: '',
// options: {
// data: [],
// props: {
// label: 'name',
// value: 'type',
// },
// },
// },
// promo_types: {
// type: 'tselect',
// label: '促销类型',
// value: '',
// options: {
// data: [],
// props: {
// label: 'name',
// value: 'type',
// },
// },
// },
'item.goods_title': {
type: 'tinput',
label: '商品名称',
@ -250,7 +250,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
state.filter.tools['pay.pay_type'].options.data = res.data[key]
} else if (key == 'status' || key == 'apply_refund_status') {
} else {
state.filter.tools[key].options.data = res.data[key]
console.log(res.data[key])
console.log(key)
// state.filter.tools[key].options.data = res.data[key]?.res.data[key]
}
}
getData()
@ -384,6 +386,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
case 'noget': // 待收货
data.class = 'status-warning';
break;
case 'nozt': // 待取货
data.class = 'status-warning';
break;
case 'nocomment': // 待评价
data.class = 'status-warning';
break;

@ -119,7 +119,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
}
function onNextTeam(id) {
Fast.api.open(`shopro/user/user/myTeam?id=${id}`, "下级团队", {
Fast.api.open(`shopro/user/user/team?id=${id}`, "下级团队", {
callback() {
getData()
}
@ -146,7 +146,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
onChangeFilter,
pagination,
onDetail,
onDelete
onDelete,
onNextTeam
}
}
}
@ -303,6 +304,157 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
}
createApp('detail', detail);
},
team:() => {
const { reactive, onMounted } = Vue
const detail = {
setup() {
const state = reactive({
type: new URLSearchParams(location.search).get('type'),
id: new URLSearchParams(location.search).get('id'),
data: {}
})
function getDetail() {
Fast.api.ajax({
url: `shopro/user/user/team/id/${state.id}`,
type: 'GET',
}, function (ret, res) {
state.data = res.data;
return false
}, function (ret, res) { })
}
const platform = {
wechat: {
openPlatform: '微信开放平台',
miniProgram: '微信小程序',
officialAccount: '微信公众平台',
},
};
function statusStyle(key) {
let flag = state.detail.verification?.[key];
return `<span style="color:${flag ? 'var(--el-color-success)' : 'var(--el-color-warning)'}">
${flag ? '已' : '未'}${key == 'username' || key == 'password' ? '设置' : '认证'}
</span>`;
}
function onSelectAvatar() {
Fast.api.open(`general/attachment/select`, "选择", {
callback: function (data) {
state.detail.avatar = data.url;
}
});
}
async function onSave() {
Fast.api.ajax({
url: `shopro/user/user/edit/id/${state.id}`,
type: 'POST',
data: state.detail,
}, function (ret, res) {
getDetail()
}, function (ret, res) { })
}
function onChangeParentUser() {
Fast.api.open(`shopro/commission/agent/select?id=${state.id}`, "更换上级分销商", {
callback() {
getDetail()
}
})
}
function onRecharge(type) {
Fast.api.open(`shopro/user/user/recharge?type=${type}&id=${state.detail.id}`, "充值", {
callback: function () {
getDetail();
getLog()
}
});
}
const log = reactive({
tabActive: 'money',
data: [],
})
function getLog() {
let url
let search = {}
if (log.tabActive == 'money' || log.tabActive == 'score' || log.tabActive == 'commission') {
url = `shopro/user/wallet_log/${log.tabActive}/id/${state.id}`
}
if (log.tabActive == 'order') {
url = `shopro/order/order`
search = {
search: JSON.stringify({
user_id: state.id
})
}
}
if (log.tabActive == 'share') {
url = `shopro/share`
search = {
id: state.id
}
}
if (log.tabActive == 'coupon') {
url = `shopro/user/user/coupon/id/${state.id}`
}
Fast.api.ajax({
url: url,
type: 'GET',
data: {
page: pagination.page,
list_rows: pagination.list_rows,
...search,
},
}, function (ret, res) {
if (log.tabActive == 'order') {
log.data = res.data.orders.data
pagination.total = res.data.orders.total
} else {
log.data = res.data.data
pagination.total = res.data.total
}
return false
}, function (ret, res) { })
}
const pagination = reactive({
page: 1,
list_rows: 10,
total: 0,
})
function onChangeTab() {
log.data = []
pagination.page = 1
pagination.total = 0
getLog()
}
onMounted(() => {
getDetail()
// getLog()
})
return {
state,
getDetail,
platform,
statusStyle,
onSelectAvatar,
onSave,
onChangeParentUser,
onRecharge,
log,
getLog,
pagination,
onChangeTab,
}
}
}
createApp('team', detail);
},
recharge: () => {
const { reactive, getCurrentInstance } = Vue
const recharge = {

Loading…
Cancel
Save