yll 4 년 전
부모
커밋
7211286222
8개의 변경된 파일60개의 추가작업 그리고 268개의 파일을 삭제
  1. 2 0
      docs/TODO
  2. 0 1
      route/api/route.php
  3. 38 35
      view/xcx/api/api.js
  4. 1 2
      view/xcx/api/message.js
  5. 0 160
      view/xcx/components/mine/index.js
  6. 17 44
      view/xcx/pages/leader_board/index.js
  7. 1 1
      view/xcx/pages/leader_board/index.wxml
  8. 1 25
      view/xcx/pages/message/index.js

+ 2 - 0
docs/TODO

@@ -2,3 +2,5 @@
 # automatic backup data
 
 # 优化排行榜为 5m 刷新一次 ,存入redis
+
+# 定时删除多余跑马灯

+ 0 - 1
route/api/route.php

@@ -31,7 +31,6 @@ Route::any('wechat/serve', 'wechat.WechatController/serve');//公众号服务
 Route::any('wechat/notify', 'wechat.WechatController/notify');//公众号支付回调
 Route::any('routine/notify', 'wechat.AuthController/notify');//小程序支付回调
 
-
 //管理员订单操作类
 Route::group(function () {
     Route::get('admin/order/statistics', 'admin.StoreOrderController/statistics')->name('adminOrderStatistics');//订单数据统计

+ 38 - 35
view/xcx/api/api.js

@@ -2,24 +2,24 @@ import request from "./../utils/request.js";
 /**
  * 公共接口 ,优惠券接口 , 行业此讯 , 手机号码注册
  * 
-*/
+ */
 
 /**
  * 获取主页数据 无需授权
  * 
-*/
+ */
 export function getIndexData()
 {
-  return request.get("index",{},{ noAuth : true});
+  return request.get("index",{},{ noAuth : true})
 }
 
 /**
  * 获取登录授权login
  * 
-*/
+ */
 export function getLogo()
 {
-  return request.get('wechat/get_logo', {}, { noAuth : true});
+  return request.get('wechat/get_logo', {}, { noAuth : true})
 }
 
 /**
@@ -27,21 +27,21 @@ export function getLogo()
  * @param string formId 
  */
 export function setFormId(formId) {
-  return request.post("wechat/set_form_id", { formId: formId});
+  return request.post("wechat/set_form_id", { formId: formId})
 }
 
 /**
  * 领取优惠卷
  * @param int couponId
  * 
-*/
+ */
 export function setCouponReceive(couponId){
-  return request.post('coupon/receive', { couponId: couponId});
+  return request.post('coupon/receive', { couponId: couponId})
 }
 /**
  * 优惠券列表
  * @param object data
-*/
+ */
 export function getCoupons(data){
   return request.get('coupons',data,{noAuth:true})
 }
@@ -49,7 +49,7 @@ export function getCoupons(data){
 /**
  * 我的优惠券
  * @param int types 0全部  1未使用 2已使用
-*/
+ */
 export function getUserCoupons(types){
   return request.get('coupons/user/'+types)
 }
@@ -57,7 +57,7 @@ export function getUserCoupons(types){
 /**
  * 文章分类列表
  * 
-*/
+ */
 export function getArticleCategoryList(){
   return request.get('article/category/list',{},{noAuth:true})
 }
@@ -66,7 +66,7 @@ export function getArticleCategoryList(){
  * 文章列表
  * @param int cid
  * 
-*/
+ */
 export function getArticleList(cid,data){
   return request.get('article/list/' + cid, data,{noAuth:true})
 }
@@ -74,15 +74,15 @@ export function getArticleList(cid,data){
 /**
  * 文章 热门列表
  * 
-*/
+ */
 export function getArticleHotList(){
-  return request.get('article/hot/list',{},{noAuth:true});
+  return request.get('article/hot/list',{},{noAuth:true})
 }
 
 /**
  * 文章 轮播列表
  * 
-*/
+ */
 export function getArticleBannerList(){
   return request.get('article/banner/list',{},{noAuth:true})
 }
@@ -91,15 +91,15 @@ export function getArticleBannerList(){
  * 文章详情
  * @param int id 
  * 
-*/
+ */
 export function getArticleDetails(id){
-  return request.get('article/details/'+id,{},{noAuth:true});
+  return request.get('article/details/'+id,{},{noAuth:true})
 }
 
 /**
  * 手机号+验证码登录接口
  * @param object data
-*/
+ */
 export function loginMobile(data){
   return request.post('login/mobile',data,{noAuth:true})
 }
@@ -107,7 +107,7 @@ export function loginMobile(data){
 /**
  * 验证码发送
  * @param object phone
-*/
+ */
 export function registerVerify(code, key, phone, reset){
   return request.post('register/verify', { code: code, key: key, phone: phone, type: reset === undefined ? 'reset' : reset },{noAuth:true})
 }
@@ -116,16 +116,16 @@ export function registerVerify(code, key, phone, reset){
  * 手机号注册
  * @param object data
  * 
-*/
+ */
 export function phoneRegister(data){
-  return request.post('register',data,{noAuth:true});
+  return request.post('register',data,{noAuth:true})
 }
 
 /**
  * 手机号修改密码
  * @param object data
  * 
-*/
+ */
 export function phoneRegisterReset(data){
   return request.post('register/reset',data,{noAuth:true})
 }
@@ -134,7 +134,7 @@ export function phoneRegisterReset(data){
  * 手机号+密码登录
  * @param object data
  * 
-*/
+ */
 export function phoneLogin(data){
   return request.post('login',data,{noAuth:true})
 }
@@ -142,25 +142,25 @@ export function phoneLogin(data){
 /**
  * 切换H5登录
  * @param object data
-*/
+ */
 export function switchH5Login(){
-  return request.post('switch_h5', { 'from':'routine'});
+  return request.post('switch_h5', { 'from':'routine'})
 }
 
 /**
  * 绑定手机号
  * 
-*/
+ */
 export function bindingPhone(data){
-  return request.post('binding',data);
+  return request.post('binding',data)
 }
 
 /**
  * 退出登錄
  * 
-*/
+ */
 export function logout(){
-  return request.get('logout');
+  return request.get('logout')
 }
 
 /**
@@ -168,31 +168,34 @@ export function logout(){
  */
 export function getTemlIds()
 {
-  return request.get('wechat/teml_ids', {}, { noAuth:true});
+  return request.get('wechat/teml_ids', {}, { noAuth:true})
 }
 
 /**
  * 获取小程序直播列表
  */
 export function getLiveList(page,limit) {
-  return request.get('wechat/live', { page, limit}, { noAuth: true });
+  return request.get('wechat/live', { page, limit }, { noAuth: true })
 }
 
 /**
  * 获取key值
  */
 export function verifyCode() {
-  return request.get('verify_code', {}, { noAuth: true });
+  return request.get('verify_code', {}, { noAuth: true })
 }
 /**
  * 获取城市信息
  */
 export function getCity() {
-  return request.get('city_list', { }, { noAuth: true });
+  return request.get('city_list', {}, { noAuth: true })
 }
 
-
-
 export function getNotifications() {
   return request.get('user/notifications', {}, { noAuth: true })
+}
+
+// 获取排行榜
+export function getLeaderBoard() {
+  return request.get('boards', {}, { noAuth: true })
 }

+ 1 - 2
view/xcx/api/message.js

@@ -4,7 +4,6 @@ import request from "./../utils/request.js";
  * 
 */
 
-
 /**
  * 获取列表
 */
@@ -24,4 +23,4 @@ export function readMessage(ids, state) {
 */
 export function delMessage(ids) {
   return request.delete("user/messages", {ids: ids});
-}
+}

+ 0 - 160
view/xcx/components/mine/index.js

@@ -31,166 +31,6 @@ Component({
       "from": "abcde034345dd",
       "to": "aabde2343df34",
       "out": -1,
-    },{
-      "symbol": "DOGE",
-      "icon": "/images/one.png",
-      "amount": 1,
-      "ts": "2021-05-10",
-      "from": "abcde034345dd",
-      "to": "aabde2343df34",
-      "out": 0,
-    },{
-      "symbol": "DOGE",
-      "icon": "/images/one.png",
-      "amount": 12.00034,
-      "ts": "2021-05-10",
-      "from": "abcde034345dd",
-      "to": "aabde2343df34",
-      "out": -1,
-    },{
-      "symbol": "DOGE",
-      "icon": "/images/one.png",
-      "amount": 12.00034,
-      "ts": "2021-05-10",
-      "from": "abcde034345dd",
-      "to": "aabde2343df34",
-      "out": 0,
-    },{
-      "symbol": "DOGE",
-      "icon": "/images/one.png",
-      "amount": 12.00034,
-      "ts": "2021-05-10",
-      "from": "abcde034345dd",
-      "to": "aabde2343df34",
-      "out": -1,
-    },{
-      "symbol": "DOGE",
-      "icon": "/images/one.png",
-      "amount": 12.00034,
-      "ts": "2021-05-10",
-      "from": "abcde034345dd",
-      "to": "aabde2343df34",
-      "out": 0,
-    },{
-      "symbol": "DOGE",
-      "icon": "/images/one.png",
-      "amount": 12.00034,
-      "ts": "2021-05-10",
-      "from": "abcde034345dd",
-      "to": "aabde2343df34",
-      "out": -1,
-    },{
-      "symbol": "DOGE",
-      "icon": "/images/one.png",
-      "amount": 12.00034,
-      "ts": "2021-05-10",
-      "from": "abcde034345dd",
-      "to": "aabde2343df34",
-      "out": 0,
-    },{
-      "symbol": "DOGE",
-      "icon": "/images/one.png",
-      "amount": 12.00034,
-      "ts": "2021-05-10",
-      "from": "abcde034345dd",
-      "to": "aabde2343df34",
-      "out": -1,
-    },{
-      "symbol": "DOGE",
-      "icon": "/images/one.png",
-      "amount": 12.00034,
-      "ts": "2021-05-10",
-      "from": "abcde034345dd",
-      "to": "aabde2343df34",
-      "out": 0,
-    },{
-      "symbol": "DOGE",
-      "icon": "/images/one.png",
-      "amount": 12.00034,
-      "ts": "2021-05-10",
-      "from": "abcde034345dd",
-      "to": "aabde2343df34",
-      "out": -1,
-    },{
-      "symbol": "DOGE",
-      "icon": "/images/one.png",
-      "amount": 12.00034,
-      "ts": "2021-05-10",
-      "from": "abcde034345dd",
-      "to": "aabde2343df34",
-      "out": 0,
-    },{
-      "symbol": "DOGE",
-      "icon": "/images/one.png",
-      "amount": 12.00034,
-      "ts": "2021-05-10",
-      "from": "abcde034345dd",
-      "to": "aabde2343df34",
-      "out": -1,
-    },{
-      "symbol": "DOGE",
-      "icon": "/images/one.png",
-      "amount": 12.00034,
-      "ts": "2021-05-10",
-      "from": "abcde034345dd",
-      "to": "aabde2343df34",
-      "out": 0,
-    },{
-      "symbol": "DOGE",
-      "icon": "/images/one.png",
-      "amount": 12.00034,
-      "ts": "2021-05-10",
-      "from": "abcde034345dd",
-      "to": "aabde2343df34",
-      "out": -1,
-    },{
-      "symbol": "DOGE",
-      "icon": "/images/one.png",
-      "amount": 12.00034,
-      "ts": "2021-05-10",
-      "from": "abcde034345dd",
-      "to": "aabde2343df34",
-      "out": 0,
-    },{
-      "symbol": "DOGE",
-      "icon": "/images/one.png",
-      "amount": 12.00034,
-      "ts": "2021-05-10",
-      "from": "abcde034345dd",
-      "to": "aabde2343df34",
-      "out": -1,
-    },{
-      "symbol": "DOGE",
-      "icon": "/images/one.png",
-      "amount": 12.00034,
-      "ts": "2021/05/10 15:50",
-      "from": "abcde034345dd",
-      "to": "aabde2343df34",
-      "out": 0,
-    },{
-      "symbol": "DOGE",
-      "icon": "/images/one.png",
-      "amount": 12.00034,
-      "ts": "2021/05/10 17:12",
-      "from": "abcde034345dd",
-      "to": "aabde2343df34",
-      "out": -1,
-    },{
-      "symbol": "DOGE",
-      "icon": "/images/one.png",
-      "amount": 12.00034,
-      "ts": "2021/05/10 15:50",
-      "from": "abcde034345dd",
-      "to": "aabde2343df34",
-      "out": 0,
-    },{
-      "symbol": "DOGE",
-      "icon": "/images/one.png",
-      "amount": 12.00034,
-      "ts": "2021/05/10 17:12",
-      "from": "abcde034345dd",
-      "to": "aabde2343df34",
-      "out": -1,
     }],
     symbol: "DOGE",
     icon: "/images/one.png",

+ 17 - 44
view/xcx/pages/leader_board/index.js

@@ -1,59 +1,32 @@
 // pages/leader_board/index.js
+import {getLeaderBoard} from '../../api/api.js'
+
 Page({
   data: {
     parameter: {
       'navbar': '1',
       'return': '1',
       'title': '排行榜',
-      'color': true,
+      'color': false,
       'class':'0'
     },
     banner: "http://twongstatic.shotshock.shop/banner_bargin.jpg",
     name: "",
-    board: [{
-      "uid": 12343,
-      "nickname": "fdsf",
-      "avatar": "http://twongstatic.shotshock.shop/tmp/23fe31842b.jpg",
-      "border": 1,
-      "level": 1, 
-      "vip": 0,
-      "value": 102.14
-    },{
-      "uid": 12343,
-      "nickname": "fdsf",
-      "avatar": "http://twongstatic.shotshock.shop/tmp/23fe31842b.jpg",
-      "border": 1,
-      "level": 1, 
-      "vip": 0,
-      "value": 102.14
-    },{
-      "uid": 12343,
-      "nickname": "司马当成活马伊发",
-      "avatar": "http://twongstatic.shotshock.shop/tmp/23fe31842b.jpg",
-      "border": 1,
-      "level": 1, 
-      "vip": 0,
-      "value": 102
-    },{
-      "uid": 12343,
-      "nickname": "国强乱书生",
-      "avatar": "http://twongstatic.shotshock.shop/tmp/23fe31842b.jpg",
-      "border": 1,
-      "level": 1, 
-      "vip": 0,
-      "value": 1.14
-    },{
-      "uid": 12343,
-      "nickname": "fdsf",
-      "avatar": "http://twongstatic.shotshock.shop/tmp/23fe31842b.jpg",
-      "border": 1,
-      "level": 1, 
-      "vip": 0,
-      "value": 102.14
-    }]
+    board: []
   },
 
   onLoad: function (options) {
-
-  },
+    var that = this
+    getLeaderBoard().then(res => {
+      that.setData({
+        banner: res.data.banner,
+        name: res.data.name,
+        board: res.data.board,
+      })
+      console.log(res.data)
+    },
+    err => {
+      console.log(err)
+    })
+  }
 })

+ 1 - 1
view/xcx/pages/leader_board/index.wxml

@@ -8,7 +8,7 @@
     <text class="h2">名单</text>
     <text class="h3">返金</text>
   </view>
-  <scroll-view class="list">
+  <scroll-view enable-flex="true" class="list">
     <view wx:for="{{ board }}" wx:key="index" class="item">
       <view class="seq">
         <text class="{{ index < 3 ? 'color-' + index : 'color-gray'}}">{{ index + 1 }}</text> 

+ 1 - 25
view/xcx/pages/message/index.js

@@ -1,5 +1,4 @@
 // pages/message/index.js
-
 import { getProductHot } from '../../api/store.js';
 import { getMessages } from "../../api/message"
 import { SplitArray } from "../../utils/util"
@@ -22,27 +21,7 @@ Page({
     host_product:[],
     iShidden: false,
     page: 0,
-    messages: [{
-      "id": 1,
-      "icon": "/images/one.png",
-      "from": "系统消息",
-      "subject": "优惠活动",
-      "body": "<p>here is html code</p><p style='color:red;'>some code</p>",
-      "ts": "2021/3/12 12:43:12",  
-      "expiresAt": 1234354545,
-      "type": 0,
-      "read": 0
-    },{
-      "id": 1,
-      "icon": "/images/two.png",
-      "from": "美天旺客服",
-      "subject": "退货通知",
-      "body": "<p>here is html code</p><p style='color:red;'>some code</p>",
-      "ts": "2021/3/12 12:43:12",  
-      "expiresAt": 1234354545,
-      "type": 0,
-      "read": 0
-    }]
+    messages: []
   },
 
   /**
@@ -89,9 +68,6 @@ Page({
       console.log(res);
     }, err=> {
       console.log(err);
-      // that.setData({
-      //   messages: [ 1 ]
-      // });
     });
   },