Przeglądaj źródła

测试币相关操作API,和其他杂的修改

joe 4 lat temu
rodzic
commit
e15e98f487

+ 1 - 0
.gitignore

@@ -2,3 +2,4 @@
 runtime/
 public/uploads/
 public/install/install.lock
+*.log

+ 0 - 18
app/api/controller/BaiduController.php

@@ -1,18 +0,0 @@
-<?php
-
-namespace app\api\controller;
-
-/**
- * 百度小程序
- * Class BaiduController
- * @package app\api\controller
- */
-class BaiduController
-{
-
-    public function auth()
-    {
-
-    }
-
-}

+ 0 - 18
app/api/controller/DouYiCantroller.php

@@ -1,18 +0,0 @@
-<?php
-
-namespace app\api\controller;
-
-/**
- * 抖音小程序
- * Class DouYiCantroller
- * @package app\api\controller
- */
-class DouYiCantroller
-{
-
-    public function auth()
-    {
-
-    }
-
-}

+ 47 - 30
app/api/controller/coin/UserCoinController.php

@@ -17,41 +17,58 @@ class UserCoinController {
      */
     public function boot(Request $request) {
         $uid = 1000; //TODO
-        // 是否开启
+        // 是否开启活动
         $symbol = Config::get('app.mining_symbo');
         if (!$symbol) {
-            return JsonService::fail('本活动未开启');
+            return app('json')->fail('本活动未开启');
         }
+        // 是否已经开启
+        $mining = UserHash::mining_get($uid);
+        if ($mining) {
+            if (isset($mining['progress']) && $mining['progress'] > 0.0) {
+                return app('json')->fail('已启动');
+            }
+        }
+
         // 是否有订单
         $orderId = StoreOrderCartInfo::getMiningOrderId($uid);
         if (!$orderId) {
-            return JsonService::fail('下单后可启动');
+            return app('json')->fail('下单后可启动');
         }
         // 标记订单
         if (!StoreOrderCartInfo::setMining($orderId)) {
-            return JsonService::fail('执行失败');
+            return app('json')->fail('执行失败');
         }
         // 开启
         $secs_unit = Config::get('app.mining_sec_unit');
         $reward_unit = Config::get('app.mining_num_per_unit');
         $progress = floatval(bcdiv($reward_unit, $secs_unit, 8));
-        $total = UserCoin::where(['uid' => $uid, 'symbol' => $symbol])->value('balance');
-        $icon = DictCoin::where('symbol', $symbol)->value('icon');
+        $icon = DictCoin::getIcon($symbol);
+        $balance = UserCoin::where('uid', $uid)->where('symbol', $symbol)->value('balance') ?? 0.0;
+
         $suc = UserHash::mining_set($uid, [
             'symbol'=> $symbol,
             'icon' => $icon,
             'price' => 0,
             'progress' => $progress,
-            'total' => $total,
+            'total' => $balance,
             'ts' => time(),
             'order_id' => $orderId,
         ]);
 
-        if (!$suc) {
-            return JsonService::fail('未成功执行');
+        if ($suc != 0 && $suc != 1) {
+            StoreOrderCartInfo::setMining($orderId, 0);
+            return app('json')->fail('未成功执行');
         }
 
-        return JsonService::successful();
+        return app('json')->successful([
+            "symbol" => $symbol,
+            'icon' => $icon,
+            'price' => 0,
+            'step' => $progress,
+            'progress' => $progress,
+            'total' => $balance,
+        ]);
     }
 
     /**
@@ -62,9 +79,9 @@ class UserCoinController {
             ['page', 1],
             ['limit', 20],
         ], $request, true);
-        $uid = 1; // TODO
+        $uid = 1000; // TODO
         $rows = UserCoinTransfer::getUserTransferred($uid, $page, $limit);
-        return JsonService::successful($rows);
+        return app('json')->successful($rows);
     }
 
     /*
@@ -76,18 +93,18 @@ class UserCoinController {
             ['addr', ''],
         ], $request, true);
         if (!$symbol || !$addr) {
-            return JsonService::fail('参数不可为空');
+            return app('json')->fail('参数不可为空');
         }
-        if (!DictCoin::where('symbol', $symbol)->select()) {
-            return JsonService::fail('未找到目标');
+        if (!DictCoin::where('symbol', $symbol)->select()->toArray()) {
+            return app('json')->fail('未找到目标');
         }
 
-        $uid = $request->uid();
+        $uid = 1000; //TODO $request->uid();
         $suc = UserCoin::upsertAddr($uid, $symbol, $addr);
         if (!$suc) {
-            return JsonService::fail('执行失败');
+            return app('json')->fail('执行失败');
         }
-        return JsonService::successful();
+        return app('json')->successful();
     }
 
     /*
@@ -100,31 +117,31 @@ class UserCoinController {
         ], $request, true);
 
         if(!$symbol) {
-            return JsonService::fail('参数不可为空');
+            return app('json')->fail('参数不可为空');
         }
-        $meta = DictCoin::where('symbol', $symbol)->select();
+        $meta = DictCoin::where('symbol', $symbol)->find();
         if (!$meta) {
-            return JsonService::fail('未找到目标');
+            return app('json')->fail('未找到目标');
         }
         $meta = $meta->toArray();
         if ($amount < $meta['min_withdrawal']){
-            return JsonService::fail('未达到最低限额');
+            return app('json')->fail('未达到最低限额');
         }
-        $uid = $request->uid();
-        $userCoin = UserCoin::where(['uid'=>$uid, 'symbol'=>$symbol])->select();
+        $uid = 1000; // TODO $request->uid();
+        $userCoin = UserCoin::where(['uid'=>$uid, 'symbol'=>$symbol])->find();
         if (!$userCoin) {
-            return JsonService::fail('不适用的用户');
+            return app('json')->fail('不适用的用户');
         }
         $userCoin = $userCoin->toArray();
         if(!$userCoin['addr']) {
-            return JsonService::fail('地址未设置');
+            return app('json')->fail('地址未设置');
         }
         if ($userCoin['balance'] < $amount) {
-            return JsonService::fail('余额不足');
+            return app('json')->fail('余额不足');
         }
         $transferred = UserCoinTransfer::hasTransferred($uid, $symbol, $userCoin['addr']);
         if (!$transferred) {
-            return JsonService::fail('首次操作需联系客服进行');
+            return app('json')->fail('首次操作需联系客服进行');
         }
         // transfer
         UserCoin::beginTrans();
@@ -135,8 +152,8 @@ class UserCoinController {
         $ok = $res1 && $res2;
         UserCoin::checkTrans($ok);
         if (!$ok) {
-            return JsonService::fail('执行失败');
+            return app('json')->fail('执行失败');
         }
-        return JsonService::successful('成功,已开始审核');
+        return app('json')->successful('成功,已开始审核');
     }
 }

+ 15 - 7
app/api/controller/user/UserController.php

@@ -4,13 +4,13 @@ namespace app\api\controller\user;
 
 use app\http\validates\user\AddressValidate;
 use app\models\system\SystemCity;
+use app\models\user\UserCoin;
 use think\exception\ValidateException;
 use app\Request;
 use app\models\user\UserLevel;
 use app\models\user\UserSign;
 use app\models\store\StoreBargain;
 use app\models\store\StoreCombination;
-use app\models\store\StoreCouponUser;
 use app\models\store\StoreOrder;
 use app\models\store\StoreProductRelation;
 use app\models\store\StoreSeckill;
@@ -19,7 +19,6 @@ use app\models\user\UserAddress;
 use app\models\user\UserBill;
 use app\models\user\UserExtract;
 use app\models\user\UserNotice;
-use crmeb\services\GroupDataService;
 use crmeb\services\UtilService;
 
 /**
@@ -71,9 +70,15 @@ class UserController
     public function balance(Request $request)
     {
         $uid = $request->uid();
+
         $user['now_money'] = User::getUserInfo($uid, 'now_money')['now_money'];//当前总资金
         $user['recharge'] = UserBill::getRecharge($uid);//累计充值
         $user['orderStatusSum'] = StoreOrder::getOrderStatusSum($uid);//累计消费
+        $coins = UserCoin::alias('uc')
+            ->join('dict_coin dc', 'uc.symbol=dc.symbol')->field('uc.symbol, dc.icon, uc.addr, uc.balance as total')
+            ->where('uid', $uid)->select();
+        $user['coins'] = $coins ? $coins->toArray() : [];
+
         return app('json')->successful($user);
     }
 
@@ -86,7 +91,7 @@ class UserController
     {
         $user = $request->user();
         $user = $user->toArray();
-        $user['couponCount'] = StoreCouponUser::getUserValidCouponCount($user['uid']);
+        $user['couponCount'] = 0; //StoreCouponUser::getUserValidCouponCount($user['uid']);
         $user['like'] = StoreProductRelation::getUserIdCollect($user['uid']);
         $user['orderStatusNum'] = StoreOrder::getOrderData($user['uid']);
         $user['notice'] = UserNotice::getNotice($user['uid']);
@@ -98,14 +103,14 @@ class UserController
         $user['statu'] = (int)sys_config('store_brokerage_statu');
         $broken_time = intval(sys_config('extract_time'));
         $search_time = time() - 86400 * $broken_time;
-        if (!$user['is_promoter'] && $user['statu'] == 2) {
+        if (!$user['is_promoter'] && $user['statu'] == 2) {     // 人人分销
             $price = StoreOrder::where(['paid' => 1, 'refund_status' => 0, 'uid' => $user['uid']])->sum('pay_price');
             $status = is_brokerage_statu($price);
             if ($status) {
                 User::where('uid', $user['uid'])->update(['is_promoter' => 1]);
                 $user['is_promoter'] = 1;
             } else {
-                $storeBrokeragePrice = sys_config('store_brokerage_price', 0);
+                $storeBrokeragePrice = sys_config('store_brokerage_price', 0);  // 分銷滿足金額
                 $user['promoter_price'] = bcsub($storeBrokeragePrice, $price, 2);
             }
         }
@@ -133,8 +138,11 @@ class UserController
             $user['vip'] = $vipId !== false ? true : false;
             if ($user['vip']) {
                 $user['vip_id'] = $vipId;
-                $user['vip_icon'] = UserLevel::getUserLevelInfo($vipId, 'icon');
-                $user['vip_name'] = UserLevel::getUserLevelInfo($vipId, 'name');
+                $vipInfo = UserLevel::getUserLevelInfo($vipId);
+                if ($vipInfo) {
+                    $user['vip_icon'] = $vipInfo['icon'];
+                    $user['vip_name'] = $vipInfo['name'];
+                }
             }
         }
         $user['yesterDay'] = UserBill::yesterdayCommissionSum($user['uid']);

+ 1 - 1
app/api/controller/user/UserNotificationController.php

@@ -58,7 +58,7 @@ class UserNotificationController {
         // 跑马灯
         $carousel = SystemCarousel::getFirst(20);
 
-        return JsonService::successful(compact('unread', 'mining', 'carousel'));
+        return app('json')->successful(compact('unread', 'mining', 'carousel'));
     }
 
     /**

+ 8 - 5
app/models/coin/UserCoinTransfer.php

@@ -59,7 +59,7 @@ class UserCoinTransfer extends BaseModel {
     }
 
     /**
-     * 取得用户记录
+     * 取得用户币变动记录
      *
      * @param $uid
      * @param $page
@@ -73,20 +73,23 @@ class UserCoinTransfer extends BaseModel {
         $res = self::where('uid', $uid)->order('ts desc')
             ->alias('t')->join('dict_coin c', 'c.symbol=t.symbol')
             ->field('t.symbol, c.icon, t.from, t.to, t.amount, t.out, t.ts')
-            ->limit(($page-1) * $limit, $limit)->select();
-        return $res ? $res->toArray() : [];
+            ->limit(($page-1) * $limit, $limit)->select()->toArray();
+        return $res;
     }
 
     /**
+     * $uid 的 $symbol 币, $addr 这个地址是否提现过
+     *
      * @param $uid
      * @param $symbol
-     * @return \think\Collection
+     * @param $addr
+     * @return object|null
      * @throws \think\db\exception\DataNotFoundException
      * @throws \think\db\exception\DbException
      * @throws \think\db\exception\ModelNotFoundException
      */
     public static function hasTransferred($uid, $symbol, $addr) {
-        $row = self::where(['uid'=>$uid, 'symbol'=>$symbol, 'to'=>$addr, 'out'=>1])->limit(1)->select();
+        $row = self::where(['uid'=>$uid, 'symbol'=>$symbol, 'to'=>$addr, 'out'=>1])->limit(1)->find();
         return $row;
     }
 }

+ 0 - 3
app/models/redis/SystemCarousel.php

@@ -25,12 +25,10 @@ class SystemCarousel {
             'uri' => $uri,
         ]);
 
-        Redis::instance();
         return Redis::lPush(self::$KEY, $val);
     }
 
     public static function getFirst($n) {
-        Redis::instance();
         $arrStr = Redis::lRange(self::$KEY, 0, $n) ?? '[]';
         $rv = [];
         foreach ($arrStr as $str) {
@@ -40,7 +38,6 @@ class SystemCarousel {
     }
 
     public static function removeTrash($start) {
-        Redis::instance();
         return Redis::lTrim(self::$KEY, 0, $start);
     }
 }

+ 0 - 4
app/models/redis/UserHash.php

@@ -17,12 +17,10 @@ class UserHash {
     }
 
     public static function unread_get($uid) {
-        Redis::instance();
         return intval(Redis::hGet(self::key($uid), self::$FIELD_UNREAD)??0);
     }
 
     public static function unread_incr($uid, $by=1) {
-        Redis::instance();
         return Redis::hIncrBy(self::key($uid), self::$FIELD_UNREAD, $by);
     }
 
@@ -39,7 +37,6 @@ class UserHash {
             }
      */
     public static function mining_get($uid) {
-        Redis::instance();
         $sval = Redis::hGet(self::key($uid), self::$FIELD_MINING);
         if ($sval) {
             return json_decode($sval, true);
@@ -54,7 +51,6 @@ class UserHash {
             return false;
         }
 
-        Redis::instance();
         return Redis::hSet(self::key($uid), self::$FIELD_MINING, json_encode($mining));
     }
 }

+ 2 - 2
app/models/store/StoreOrderCartInfo.php

@@ -60,7 +60,7 @@ class StoreOrderCartInfo extends BaseModel
      * @param $orderId
      * @return StoreOrderCartInfo
      */
-    public static function setMining($orderId) {
-        return self::where('oid', $orderId)->update(['mine'=>1]);
+    public static function setMining($orderId, $mine=1) {
+        return self::where('oid', $orderId)->update(['mine'=>$mine]);
     }
 }

+ 11 - 0
app/models/system/DictCoin.php

@@ -3,8 +3,19 @@ namespace app\models\system;
 
 use crmeb\traits\ModelTrait;
 use crmeb\basic\BaseModel;
+use think\facade\Cache;
 
 class DictCoin extends BaseModel {
 
     use ModelTrait;
+
+    public static function getIcon($symbol) {
+        $icon = Cache::get('icon_' . $symbol);
+        if ($icon) {
+            return $icon;
+        }
+        $icon = self::where('symbol', $symbol)->value('icon');
+        Cache::set('icon_' . $symbol, $icon, 86400);
+        return $icon;
+    }
 }

+ 1 - 1
app/models/user/UserCoin.php

@@ -10,7 +10,7 @@ class UserCoin extends BaseModel {
 
     public static function upsertAddr($uid, $symbol, $addr) {
         $cond = ['uid'=>$uid, 'symbol'=>$symbol];
-        $row = self::where($cond)->select();
+        $row = self::where($cond)->find();
         if ($row) {
             return self::where($cond)->update(['addr'=>$addr]);
         }else{

+ 2 - 1
app/models/user/UserLevel.php

@@ -150,7 +150,8 @@ class UserLevel extends BaseModel
     {
         $vipinfo = self::valiWhere('a')->where('a.id', $id)->field('l.id,a.add_time,l.discount,a.level_id,l.name,l.money,l.icon,l.is_pay,l.grade')
             ->join('system_user_level l', 'l.id=a.level_id')->find();
-        if ($keyName) if (isset($vipinfo[$keyName])) return $vipinfo[$keyName]; else return '';
+        if ($keyName)
+            return isset($vipinfo[$keyName]) ? $vipinfo[$keyName] : '';
         return $vipinfo;
     }
 

+ 16 - 0
app/services/user/UserCoinService.php

@@ -0,0 +1,16 @@
+<?php
+namespace app\services\user;
+
+class UserCoinService {
+    /**
+     *
+     * @param $fromId
+     * @param $toAddr
+     * @param $symbol
+     * @param $has
+     * @param $amount
+     */
+    public static function transferTo($fromId, $toAddr, $symbol, $has, $amount) {
+
+    }
+}

+ 7 - 5
config/app.php

@@ -42,16 +42,18 @@ return [
     'error_message'    => '页面错误!请稍后再试~',
     // 显示错误信息
     'show_error_msg'   => false,
-    // 企业微信机器人
+
+    /// 企业微信机器人
     'redis_robot_msg_key' => 'qywechatpush',
     // 亚里士多得
     'qy_weixin_robot_aristotle' => 'a17b9d56-b566-404b-904e-4476b95dc8d7',
-    // 自动发消息的消息发送者
+
+    /// 自动发消息的消息发送者
     'notice_sender' => '运营管理员',
-    // 挖矿配置, 每次更新币种后需要重新配置
+
+    /// 挖矿配置, 每次更新币种后需要重新配置
     // 单次挖矿时长
-    'mining_symbo' => 'doge',
-    'mining_symbo_icon' => '',
+    'mining_symbo' => 'DOGE',
     'mining_time' => [12, 24],
     // 每 @mining_sec_unit 挖币 @mining_num_per_unit
     'mining_sec_unit' => 5,

+ 2 - 1
config/cache.php

@@ -16,7 +16,7 @@ use think\facade\Env;
 
 return [
     // 默认缓存驱动
-    'default' => Env::get('cache.driver', 'file'),
+    'default' => Env::get('cache.driver', 'redis'),
 
     // 缓存连接方式配置
     'stores'  => [
@@ -41,6 +41,7 @@ return [
             'port' => '6379',
             'password' => '123456',
             'select' => 1,
+            'prefix' => 'cc:',
         ],
     ],
 ];

+ 1 - 3
crmeb/utils/Redis.php

@@ -145,8 +145,6 @@ class Redis
      */
     public static function __callStatic($name, $arguments)
     {
-        if (method_exists(self::$instance->redis, $name)) {
-            return self::instance()->redis->{$name}(...$arguments);
-        }
+        return self::instance()->redis->{$name}(...$arguments);
     }
 }

+ 288 - 0
docs/已有协议分析/index.json

@@ -0,0 +1,288 @@
+{
+  "filing_info": "",
+  "banner": [
+    {
+      "id": 104,
+      "name": "banenr2",
+      "url": "/pages/pink-list/index?id=2",
+      "pic": "http://datong.crmeb.net/public/uploads/attach/2019/03/29/5c9e015bdc6f5.jpg"
+    }
+  ],
+  "menus": [
+    {
+      "id": 99,
+      "name": "商品分类",
+      "pic": "http://datong.crmeb.net/public/uploads/attach/2019/03/29/5c9ddc9f34bfd.png",
+      "url": "/pages/goods_cate/goods_cate",
+      "show": "1",
+      "wap_url": "/category"
+    },
+    {
+      "id": 100,
+      "name": "领优惠券",
+      "pic": "http://datong.crmeb.net/public/uploads/attach/2019/03/29/5c9ddccecb7f3.png",
+      "url": "/pages/user_get_coupon/index",
+      "show": "2",
+      "wap_url": "/user/get_coupon"
+    },
+    {
+      "id": 101,
+      "name": "行业资讯",
+      "pic": "http://datong.crmeb.net/public/uploads/attach/2019/03/29/5c9ddcec57a80.png",
+      "url": "/pages/news_list/index",
+      "show": "2",
+      "wap_url": "/news_list"
+    }
+  ],
+  "roll": [
+    {
+      "id": 121,
+      "info": "CRMEB电商系统 V 3.0 即将上线!",
+      "url": "/pages/news_list/index",
+      "show": "2",
+      "wap_url": "/news_list"
+    },
+    {
+      "id": 122,
+      "info": "CRMEB电商系统 V 3.0 即将上线!",
+      "url": "/pages/news_list/index",
+      "show": "2",
+      "wap_url": "/news_list"
+    },
+    {
+      "id": 123,
+      "info": "CRMEB电商系统 V 3.0 即将上线!",
+      "url": "/pages/news_list/index",
+      "show": "2",
+      "wap_url": "/news_list"
+    }
+  ],
+  "info": {
+    "fastInfo": "上百种商品分类任您选择",
+    "bastInfo": "诚意推荐品质商品",
+    "firstInfo": "多个优质商品最新上架",
+    "salesInfo": "库存商品优惠促销活动",
+    "fastList": [
+      {
+        "id": 31,
+        "cate_name": "洗衣机",
+        "pid": 9,
+        "pic": "http://kaifa.crmeb.net/uploads/attach/2020/03/20200318/f1c66db0b9bb23d7b36013d794492d67.jpg"
+      },
+      {
+        "id": 29,
+        "cate_name": "电视",
+        "pid": 9,
+        "pic": "http://kaifa.crmeb.net/uploads/attach/2020/03/20200318/2c9fd486092555d91efff5c6e5e383d6.jpg"
+      },
+      {
+        "id": 30,
+        "cate_name": "空调",
+        "pid": 9,
+        "pic": "http://kaifa.crmeb.net/uploads/attach/2020/03/20200318/2ab5ea85f26c5bcdf2559136c7a3b22d.jpg"
+      }
+    ],
+    "bastList": [
+      {
+        "id": 74,
+        "image": "http://kaifa.crmeb.net/uploads/attach/2020/03/20200319/8e18311a1b2ca1b98a5782a252b7dd50.png",
+        "store_name": "小黄鸭5.6KG迷你洗衣机全自动家用波轮宝宝小型加热洗烘干一体机",
+        "cate_id": "31",
+        "price": "1399.00",
+        "ot_price": "1699.00",
+        "sales": "169",
+        "unit_name": "",
+        "activity": [],
+        "vip_price": "1399.00"
+      },
+      {
+        "id": 73,
+        "image": "http://kaifa.crmeb.net/uploads/attach/2020/03/20200319/cc87880018d90a9bed9dc9e9eef5f660.png",
+        "store_name": "尔给polo衫短袖日系运动休闲套装女2020年夏宽松韩版学生两件套",
+        "cate_id": "49",
+        "price": "399.00",
+        "ot_price": "599.00",
+        "sales": "58",
+        "unit_name": "套",
+        "activity": [],
+        "vip_price": "399.00"
+      },
+      {
+        "id": 67,
+        "image": "http://kaifa.crmeb.net/uploads/attach/2020/03/20200319/df7d1e12f50f0dea71c0df180321a001.jpg",
+        "store_name": "【官方正品】TOM FORD汤姆福特烈焰幻魅唇膏 TF口红黑管16 80",
+        "cate_id": "46",
+        "price": "398.00",
+        "ot_price": "400.00",
+        "sales": "42",
+        "unit_name": "件",
+        "activity": [],
+        "vip_price": "398.00"
+      },
+      {
+        "id": 62,
+        "image": "http://kaifa.crmeb.net/uploads/attach/2020/03/20200319/dde87485d40d1cea1a951727af07cb04.jpg",
+        "store_name": "春季2020年春秋装时尚上衣洋气雪纺衬衫女装新款打底春款女士小衫",
+        "cate_id": "44",
+        "price": "326.00",
+        "ot_price": "380.00",
+        "sales": "64",
+        "unit_name": "件",
+        "activity": [],
+        "vip_price": "326.00"
+      }
+    ],
+    "firstList": [
+      {
+        "id": 75,
+        "image": "http://kaifa.crmeb.net/uploads/attach/2020/03/20200319/2905acfd6dc8a708629e9e7462294cf6.png",
+        "store_name": "奥克斯空调立式大2匹家用定频圆筒柜机空调冷暖二级能效 wifi智能",
+        "cate_id": "30",
+        "price": "2899.00",
+        "unit_name": "",
+        "sales": "100",
+        "activity": [],
+        "vip_price": "2899.00"
+      },
+      {
+        "id": 74,
+        "image": "http://kaifa.crmeb.net/uploads/attach/2020/03/20200319/8e18311a1b2ca1b98a5782a252b7dd50.png",
+        "store_name": "小黄鸭5.6KG迷你洗衣机全自动家用波轮宝宝小型加热洗烘干一体机",
+        "cate_id": "31",
+        "price": "1399.00",
+        "unit_name": "",
+        "sales": "169",
+        "activity": [],
+        "vip_price": "1399.00"
+      }
+    ],
+    "bastBanner": [
+      {
+        "id": 127,
+        "img": "http://datong.crmeb.net/public/uploads/attach/2019/04/13/5cb18e247a1a9.jpg",
+        "comment": "精品推荐750*282",
+        "link": "/pages/first-new-product/index",
+        "wap_link": "/hot_new_goods/1"
+      },
+      {
+        "id": 128,
+        "img": "http://datong.crmeb.net/public/uploads/attach/2019/03/29/5c9e015bdc6f5.jpg",
+        "comment": "精品推荐750*282",
+        "link": "/pages/first-new-product/index",
+        "wap_link": "/hot_new_goods/1"
+      }
+    ]
+  },
+  "activity": [
+    {
+      "id": 124,
+      "pic": "http://datong.crmeb.net/public/uploads/attach/2019/03/28/5c9ccf7e9f4d0.jpg",
+      "title": "一起来拼团",
+      "info": "优惠多多",
+      "link": "/pages/activity/goods_combination/index",
+      "wap_link": "/activity/group"
+    },
+    {
+      "id": 125,
+      "pic": "http://datong.crmeb.net/public/uploads/attach/2019/03/28/5c9ccf7e97660.jpg",
+      "title": "秒杀专区",
+      "info": "新能源汽车火热销售",
+      "link": "/pages/activity/goods_seckill/index",
+      "wap_link": "/activity/goods_seckill"
+    },
+    {
+      "id": 126,
+      "pic": "http://datong.crmeb.net/public/uploads/attach/2019/03/28/5c9ccfc86a6c1.jpg",
+      "title": "砍价活动",
+      "info": "呼朋唤友来砍价~~~",
+      "link": "/pages/activity/goods_bargain/index",
+      "wap_link": "/activity/bargain"
+    }
+  ],
+  "lovely": [
+    {
+      "id": 155,
+      "img": "http://datong.crmeb.net/public/uploads/attach/2019/03/28/5c9cd03224d59.jpg",
+      "comment": "1",
+      "link": "#",
+      "wap_link": "#"
+    }
+  ],
+  "benefit": [
+    {
+      "id": 74,
+      "image": "http://kaifa.crmeb.net/uploads/attach/2020/03/20200319/8e18311a1b2ca1b98a5782a252b7dd50.png",
+      "store_name": "小黄鸭5.6KG迷你洗衣机全自动家用波轮宝宝小型加热洗烘干一体机",
+      "cate_id": "31",
+      "price": "1399.00",
+      "ot_price": "1699.00",
+      "stock": 35,
+      "unit_name": "",
+      "activity": []
+    },
+    {
+      "id": 69,
+      "image": "http://kaifa.crmeb.net/uploads/attach/2020/03/20200319/50f773037d7e4a68d652291e22bfb31b.jpg",
+      "store_name": "【官方正品】CHANEL 香奈儿邂逅系列香水 粉色柔情 持久淡香",
+      "cate_id": "46",
+      "price": "1200.00",
+      "ot_price": "1600.00",
+      "stock": 366,
+      "unit_name": "瓶",
+      "activity": []
+    },
+    {
+      "id": 67,
+      "image": "http://kaifa.crmeb.net/uploads/attach/2020/03/20200319/df7d1e12f50f0dea71c0df180321a001.jpg",
+      "store_name": "【官方正品】TOM FORD汤姆福特烈焰幻魅唇膏 TF口红黑管16 80",
+      "cate_id": "46",
+      "price": "398.00",
+      "ot_price": "400.00",
+      "stock": 261,
+      "unit_name": "件",
+      "activity": []
+    }
+  ],
+  "likeInfo": [
+    {
+      "id": 75,
+      "image": "http://kaifa.crmeb.net/uploads/attach/2020/03/20200319/2905acfd6dc8a708629e9e7462294cf6.png",
+      "store_name": "奥克斯空调立式大2匹家用定频圆筒柜机空调冷暖二级能效 wifi智能",
+      "cate_id": "30",
+      "price": "2899.00",
+      "ot_price": "3999.00",
+      "unit_name": "",
+      "activity": [],
+      "vip_price": "2899.00"
+    },
+    {
+      "id": 74,
+      "image": "http://kaifa.crmeb.net/uploads/attach/2020/03/20200319/8e18311a1b2ca1b98a5782a252b7dd50.png",
+      "store_name": "小黄鸭5.6KG迷你洗衣机全自动家用波轮宝宝小型加热洗烘干一体机",
+      "cate_id": "31",
+      "price": "1399.00",
+      "ot_price": "1699.00",
+      "unit_name": "",
+      "activity": [],
+      "vip_price": "1399.00"
+    },
+    {
+      "id": 73,
+      "image": "http://kaifa.crmeb.net/uploads/attach/2020/03/20200319/cc87880018d90a9bed9dc9e9eef5f660.png",
+      "store_name": "尔给polo衫短袖日系运动休闲套装女2020年夏宽松韩版学生两件套",
+      "cate_id": "49",
+      "price": "399.00",
+      "ot_price": "599.00",
+      "unit_name": "套",
+      "activity": [],
+      "vip_price": "399.00"
+    }
+  ],
+  "logoUrl": "http://kaifa.crmeb.net/uploads/attach/2019/08/20190801/deb30359d22c0b80f3cece86cb462104.png",
+  "couponList": [],
+  "site_name": "",
+  "subscribe": true,
+  "newGoodsBananr": "",
+  "tengxun_map_key": "",
+  "explosive_money": []
+}

+ 75 - 0
docs/已有协议分析/user.json

@@ -0,0 +1,75 @@
+{
+    "uid": 1000,
+    "real_name": "zg",
+    "birthday": 0,
+    "card_id": "",
+    "partner_id": 0,
+    "group_id": 0,
+    "nickname": "zg",
+    "avatar": "http://a.png",
+    "phone": "12122223333",
+    "now_money": "98876.00",
+    "brokerage_price": "200.00",
+    "integral": "30.00",
+    "sign_num": 0,
+    "level": 0,
+    "spread_uid": 0,
+    "spread_time": 0,
+    "user_type": "h5",
+    "is_promoter": 1,
+    "pay_count": 2,
+    "spread_count": 0,
+    "addres": "",
+    "adminid": false,   // 是否是客服
+    "login_type": "",
+    "couponCount": 0,       // 优惠券
+    "like": 0,              // 商品收藏个数
+    "orderStatusNum": {
+        "order_count": 1,   //单支付没有退款 数量
+        "sum_price": 1124,  //订单支付没有退款 支付总金额
+        "unpaid_count": 0,  //订单待支付 数量
+        "unshipped_count": 1,   //订单待发货 数量
+        "received_count": 0,    //订单待收货 数量
+        "evaluated_count": 0,   //订单待评价 数量
+        "complete_count": 0,    // 订单已完成 数量
+        "refund_count": 0   //订单退款数量
+    },
+    "notice": 1,    // 未读消息
+    "recharge": 0,  // 累计充值
+    "orderStatusSum": 1124, // 累计消费
+    "extractTotalPrice": 0, // 累计提现
+    "extractPrice": "200.00",   // 可体现金额
+    "statu": 2,
+    "broken_commission": "0.00",
+    "commissionCount": "200.00",
+    "vip": false,
+    "yesterDay": 0,     // 昨日傭金
+    "recharge_switch": 1,   // 充值开关
+    "switchUserInfo": [
+        {
+            "uid": 1000,
+            "real_name": "zg",
+            "birthday": 0,
+            "card_id": "",
+            "partner_id": 0,
+            "group_id": 0,
+            "nickname": "zg",
+            "avatar": "http://a.png",
+            "phone": "12122223333",
+            "now_money": "98876.00",
+            "brokerage_price": "200.00",
+            "integral": "30.00",
+            "sign_num": 0,
+            "level": 0,
+            "spread_uid": 0,
+            "spread_time": 0,
+            "user_type": "h5",
+            "is_promoter": 1,
+            "pay_count": 2,
+            "spread_count": 0,
+            "addres": "",
+            "adminid": 0,
+            "login_type": ""
+        }
+    ]
+}

+ 15 - 9
docs/通信协议/activities_mine.md

@@ -113,16 +113,22 @@ returns
 
 钱包协议增加字段
 
+GET api/usr/balance
+
+returns
 ```json
 {
-"coins": [
-    {
-        "symbol": "doge",
-        "icon": "http://a.png",
-        "total": 123.43,
-        "addr": "1243434345"
-    }
-]
-}
+    "now_money": "98876.00",
+    "recharge": 0,
+    "orderStatusSum": 1124,
+    "coins": [      // 新增
+        {
+            "symbol": "doge",
+            "icon": "http://a.png",
+            "total": 123.43,
+            "addr": "1243434345"
+        }
+    ]
+  }
 
 ```

+ 1 - 1
view/xcx/README.md

@@ -19,7 +19,7 @@
   │ ├─api.js 公共接口
   │ ├─order.js 订单接口
   │ ├─store.js 产品接口
-  │ └─user.js 用户接口
+  │ └─user.json 用户接口
   ├─components 组件目录
   │ ├─address-window 订单页选择地址组件
   │ ├─authorize 授权组件