Przeglądaj źródła

feat: 拓客排行榜接口

xuyunhui 1 rok temu
rodzic
commit
b28070f0b6

+ 8 - 0
common/js/service.js

@@ -258,5 +258,13 @@ export default {
             data: data
         })
     },
+    // 查询拓客排行榜
+    getRank(data) {
+        return request({
+            url: '/member/app/rank',
+            method: 'GET',
+            data: data
+        })
+    },
 
 }

+ 19 - 1
package-lock.json

@@ -5,6 +5,7 @@
   "packages": {
     "": {
       "dependencies": {
+        "@dcloudio/uni-ui": "^1.5.5",
         "uview-ui": "^2.0.36",
         "vconsole": "^3.15.1"
       }
@@ -20,19 +21,31 @@
         "node": ">=6.9.0"
       }
     },
+    "node_modules/@dcloudio/uni-ui": {
+      "version": "1.5.5",
+      "resolved": "https://registry.npmmirror.com/@dcloudio/uni-ui/-/uni-ui-1.5.5.tgz",
+      "integrity": "sha512-DTr8o4lcRgu4JJclA2eT7UFVKtglK63OUtcDGysrSeZhgAJAC2gBYm/pYbv0BFxKqxfbdoAFGAFCigCVY9+NAQ=="
+    },
     "node_modules/copy-text-to-clipboard": {
       "version": "3.2.0",
       "resolved": "https://registry.npmmirror.com/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.0.tgz",
       "integrity": "sha512-RnJFp1XR/LOBDckxTib5Qjr/PMfkatD0MUCQgdpqS8MdKiNUzBjAQBEN6oUy+jW7LI93BBG3DtMB2KOOKpGs2Q==",
       "engines": {
         "node": ">=12"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
       }
     },
     "node_modules/core-js": {
       "version": "3.35.1",
       "resolved": "https://registry.npmmirror.com/core-js/-/core-js-3.35.1.tgz",
       "integrity": "sha512-IgdsbxNyMskrTFxa9lWHyMwAJU5gXOPP+1yO+K59d50VLVAIDAbs7gIv705KzALModfK3ZrSZTPNpC0PQgIZuw==",
-      "hasInstallScript": true
+      "hasInstallScript": true,
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/core-js"
+      }
     },
     "node_modules/mutation-observer": {
       "version": "1.0.3",
@@ -73,6 +86,11 @@
         "regenerator-runtime": "^0.14.0"
       }
     },
+    "@dcloudio/uni-ui": {
+      "version": "1.5.5",
+      "resolved": "https://registry.npmmirror.com/@dcloudio/uni-ui/-/uni-ui-1.5.5.tgz",
+      "integrity": "sha512-DTr8o4lcRgu4JJclA2eT7UFVKtglK63OUtcDGysrSeZhgAJAC2gBYm/pYbv0BFxKqxfbdoAFGAFCigCVY9+NAQ=="
+    },
     "copy-text-to-clipboard": {
       "version": "3.2.0",
       "resolved": "https://registry.npmmirror.com/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.0.tgz",

+ 1 - 0
package.json

@@ -1,5 +1,6 @@
 {
   "dependencies": {
+    "@dcloudio/uni-ui": "^1.5.5",
     "uview-ui": "^2.0.36",
     "vconsole": "^3.15.1"
   }

+ 3 - 2
pages.json

@@ -1,7 +1,8 @@
 {
 
 	"easycom": {
-		"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
+		"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue",
+		"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"
 	},
 
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
@@ -200,7 +201,7 @@
 		},
 		{
 			"path" : "pages/spreadRankingList/spreadRankingList",
-			"style" : 
+			"style" :
 			{
 				"navigationBarTitleText" : "拓客排行榜"
 			}

+ 0 - 2
pages/myGroup/myGroup.vue

@@ -54,8 +54,6 @@
 				}
 			},
 
-
-
 			goAddGroup(){
 				uni.navigateTo({
 					url:'/pages/addGroup/addGroup'

+ 4 - 0
pages/spreadRankingList/index.rpx.css

@@ -35,3 +35,7 @@
 	font-weight: bold;
 	color: #4cd964;
 }
+.example-body {
+	background-color: #fff;
+	padding: 10px;
+}

+ 20 - 20
pages/spreadRankingList/module/mescrollUni-item.vue

@@ -8,32 +8,31 @@
     <mescroll-uni :ref="'mescrollRef' + i" @init="mescrollInit" :height="height" :down="downOption" @down="downCallback"
                   :up="upOption" @up="upCallback" @emptyclick="emptyClick">
 
-        <view class="flex-col list" v-for="(item,index) in 30">
+        <view class="flex-col list" v-for="(item,index) in rankDate">
 
 
-            <view class="flex-row justify-center" v-if="index === 0">
-                <view class="flex-col justify-evenly medal">
-                    <text>第一名:对对对</text>
-                    <text>3000</text>
-                </view>
-            </view>
+<!--            <view class="flex-row justify-center" v-if="index === 0">-->
+<!--                <view class="flex-col justify-evenly medal">-->
+<!--                    <text>第一名:对对对</text>-->
+<!--                    <text>3000</text>-->
+<!--                </view>-->
+<!--            </view>-->
 
-            <view class="flex-col justify-evenly medal medal2" v-if="index === 1">
-                <text>第二名:滴滴滴</text>
-                <text>2000</text>
-            </view>
+<!--            <view class="flex-col justify-evenly medal medal2" v-if="index === 1">-->
+<!--                <text>第二名:滴滴滴</text>-->
+<!--                <text>2000</text>-->
+<!--            </view>-->
 
-            <view class="flex-col justify-evenly medal medal3" v-if="index === 2">
-                <text>第三名:龙傲天</text>
-                <text>1000</text>
-            </view>
+<!--            <view class="flex-col justify-evenly medal medal3" v-if="index === 2">-->
+<!--                <text>第三名:龙傲天</text>-->
+<!--                <text>1000</text>-->
+<!--            </view>-->
 
 
-
-            <view class="flex-row justify-between listItem" :class="{listItemFirst:index === 3}" v-if="index > 2">
+            <view class="flex-row justify-between listItem" :class="{listItemFirst:index === 3}" >
                 <text>{{index + 1}}.</text>
-                <text>芝士蛋糕hi</text>
-                <text>12225</text>
+                <text>{{ item.expandUserName }}</text>
+                <text>{{ item.total }}</text>
             </view>
 
         </view>
@@ -45,6 +44,7 @@
     import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
     import MescrollMoreItemMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mixins/mescroll-more-item.js"
     import NextSwipeAction from "../../../components/next-swipe-action/next-swipe-action";
+    import {object} from "../../../uni_modules/uv-ui-tools/libs/function/test";
 
     export default {
         mixins: [MescrollMixin, MescrollMoreItemMixin], // 注意此处还需使用MescrollMoreItemMixin (必须写在MescrollMixin后面)
@@ -82,7 +82,7 @@
                     return 0
                 }
             },
-
+            rankDate: [],
             height: [Number, String], // mescroll的高度
 
         },

+ 22 - 3
pages/spreadRankingList/spreadRankingList.vue

@@ -5,8 +5,12 @@
 					 left-icon="left" title="拓客排行榜" @clickLeft="back"/>
 		<!-- #endif -->
 
+    <view class="example-body">
+      <uni-datetime-picker v-model="range" type="daterange"  @change="maskClick"/>
+
+    </view>
 		<view :style="{height:height}">
-			<mescroll-item ref="MescrollItem" :i="0"  :index="0"  :height="height">
+			<mescroll-item ref="MescrollItem" :i="0"  :index="0" :rankDate='rankDate' :height="height">
 			</mescroll-item>
 		</view>
 
@@ -18,9 +22,7 @@
 </template>
 
 <script>
-
 	import MescrollItem from "./module/mescrollUni-item.vue";
-
 	export default {
 		components: {
 			MescrollItem
@@ -28,14 +30,31 @@
 		data() {
 			return {
 				height:'',
+        rankDate:null,
+        range:null,
 			}
 		},
 		onLoad(e) {
+      this.getRanking()
 			let sysInfo = uni.getSystemInfoSync()
 			this.height = sysInfo.windowHeight  - 50 + 'px' //除标题栏栏外的屏幕可用高度
 		},
 		methods: {
+      getRanking(date){
+        this.$api.service.getRank(date).then((res)=>{
+          console.log(res)
+          this.rankDate = res.data.data
+        })
+      },
+      maskClick(e){
+        console.log('maskClick事件:', e,this.range);
+        const date = {
+          startDate:this.range[0],
+          endDate:this.range[1],
+        }
 
+        this.getRanking(date)
+      },
 			back() {
 				let pages = getCurrentPages()
 				if (pages.length > 1){