Prechádzať zdrojové kódy

feat: 我的规则 我的角色 优惠券使用情况

xuyunhui 1 rok pred
rodič
commit
c78229e0f2

+ 1 - 1
common/js/env.js

@@ -13,4 +13,4 @@ export default { //存放变量的容器
 	baseUrl,
 	uploadUrl: '/v1/file/put-file'
 
-}
+}

+ 8 - 1
common/js/service.js

@@ -361,5 +361,12 @@ export default {
             data: data
         })
     },
-
+    //查询用券情况
+    useCouponCondition(data) {
+        return request({
+            url: '/expand/app/useCouponCondition',
+            method: 'GET',
+            data: data
+        })
+    },
 }

+ 14 - 0
pages.json

@@ -212,6 +212,20 @@
 			{
 				"navigationBarTitleText" : "拓客排行榜"
 			}
+		},
+		{
+			"path" : "pages/myRules/index",
+			"style" :
+			{
+				"navigationBarTitleText" : "我的规则"
+			}
+		},
+		{
+			"path" : "pages/myRole/index",
+			"style" :
+			{
+				"navigationBarTitleText" : "我的角色"
+			}
 		}
 	],
 	"tabBar": {

+ 1 - 1
pages/directPromotionList/module/index.rpx.css

@@ -1,6 +1,6 @@
 .item{
     padding: 20rpx 32rpx;
-    background: #FFFFFF;
+    background: #b1aeae;
     margin-top: 24rpx;
     border-radius: 15rpx;
 }

+ 1 - 1
pages/index/attach/attach.vue

@@ -10,7 +10,7 @@
 						<text>{{homeStaticsData.totalInvite || 0}}</text>
 					</view>
 				</view>
-				<view class="flex-col gridItem leftBorder">
+				<view class="flex-col gridItem leftBorder" @click="navigateToPage('/pages/todaySpecialistsList/todaySpecialistsList')">
 					<view  class="title flex-row justify-center">
 						<text>用券情况</text>
 					</view>

+ 3 - 1
pages/my/my.vue

@@ -24,7 +24,7 @@
 			</view>
 		</view>
 
-		<view class="statistics flex-col">
+		<view  class="statistics flex-col" v-if="false">
 			<view class="flex-row justify-around" v-if="userInfo.isManager == '1'">
 				<view class="flex-row justify-center out ">
 					<view class="flex-col  statisticsItem "
@@ -79,6 +79,8 @@
 				<uni-list-item v-if="userInfo.isExtensionWorker == 1" :clickable="true" title="推广码" showArrow thumb="/static/my/qr.png" thumb-size="sm" @click="openQrCord" />
 				<uni-list-item v-if="userInfo.roleTag == 1" :clickable="true" title="购买优惠券" to="/pages/purchaseCoupon/purchaseCoupon" showArrow thumb="/static/my/coupon.png" thumb-size="sm" />
 				<uni-list-item v-if="userInfo.isManager == 1" :clickable="true" title="拓客排行榜" to="/pages/spreadRankingList/spreadRankingList" showArrow thumb="/static/my/ranking.png" thumb-size="sm"/>
+				<uni-list-item :clickable="true" title="我的规则" to="/pages/myRules/index" showArrow thumb="/static/my/ranking.png" thumb-size="sm"/>
+				<uni-list-item v-if="userInfo.isManager == 1" :clickable="true" title="我的角色" to="/pages/myRole/index" showArrow thumb="/static/my/ranking.png" thumb-size="sm"/>
 			</uni-list>
 		</view>
 

+ 82 - 0
pages/myRole/index.rpx.css

@@ -0,0 +1,82 @@
+.page {
+	background: #F7F7F7;
+	padding: 0 10rpx 32rpx 32rpx;
+	min-height: 98vh;
+}
+.addGroup{
+	width: 686rpx;
+	height: 84rpx;
+	background: #FFE05C;
+	border-radius: 54rpx;
+	font-size: 28rpx;
+	font-weight: 400;
+	color: #333333;
+	line-height: 84rpx;
+	text-align: center;
+	margin-top: 24rpx;
+}
+.item{
+	width: 638rpx;
+	font-size: 40rpx;
+	background: #FFFFFF;
+	border-radius: 16rpx;
+	margin-top: 24rpx;
+	padding: 10rpx 24rpx;
+	position: relative;
+}
+.storeName{
+	height: 48rpx;
+	font-size: 28rpx;
+	font-weight: 400;
+	color: #666666;
+	line-height: 48rpx;
+	margin-top: 24rpx;
+}
+.time{
+	height: 48rpx;
+	font-size: 28rpx;
+	font-weight: 400;
+	color: #999999;
+	line-height: 48rpx;
+	margin-top: 24rpx;
+}
+.name{
+	height: 48rpx;
+	font-size: 28rpx;
+	font-weight: 700;
+	color: #333333;
+	line-height: 48rpx;
+}
+.icon-num{
+	margin-top: 24rpx;
+}
+.key{
+	width: 120rpx;
+	height: 44rpx;
+	font-size: 28rpx;
+	font-weight: 400;
+	color: #999999;
+	line-height: 44rpx;
+	margin-left: 12rpx;
+}
+.number{
+	height: 44rpx;
+	font-size: 28rpx;
+	font-weight: 700;
+	color: #333333;
+	line-height: 44rpx;
+	margin-left: 12rpx;
+}
+.phone{
+	height: 44rpx;
+	font-size: 28rpx;
+	color: #979595;
+	line-height: 44rpx;
+	margin-left: 12rpx;
+}
+.xiugai{
+	position:absolute;
+	top: 26rpx;
+	right: 26rpx;
+}
+

+ 75 - 0
pages/myRole/index.vue

@@ -0,0 +1,75 @@
+<template>
+  <view class="page">
+    <!-- #ifdef H5-->
+    <uni-nav-bar v-if="!$isWxBrowser()" :fixed="true" background-color="#FFE05C" :border="false" :statusBar="false"
+                 left-icon="left" title="我的角色" @clickLeft="back"/>
+    <!-- #endif -->
+    <view class="flex-col item" v-for="(item,index) in list" :key="index" @click="JumpRules(item)">
+      <view class="flex-row">
+        <text class="key">角色名称:</text>
+        <view>
+          <view class="phone">{{ item.name }}</view>
+        </view>
+      </view>
+    </view>
+    <!--#ifdef H5-->
+    <liu-drag-button v-if="$isWxBrowser()" @clickBtn="back">返回</liu-drag-button>
+    <!--#endif-->
+  </view>
+</template>
+
+<script>
+
+export default {
+
+  data() {
+    return {
+      height: '',
+      list: []
+    }
+  },
+  onLoad(e) {
+    this.getInfo()
+    let sysInfo = uni.getSystemInfoSync()
+    this.height = sysInfo.windowHeight - 120 + 'px' //除标题栏栏外的屏幕可用高度
+  },
+  methods: {
+    back() {
+      let pages = getCurrentPages()
+      if (pages.length > 1) {
+        uni.navigateBack({
+          delta: 1,
+          fail: err => {
+            console.log(err)
+          }
+        })
+      } else {
+        uni.switchTab({
+          url: '/pages/my/my'
+        });
+      }
+    },
+    JumpRules(item){
+      uni.navigateTo({
+        url: `/pages/myRules/index?id=${item.id}`
+      });
+
+    },
+    getInfo() {
+      this.$api.service.getRoleList().then((res) => {
+        this.list = res.data.data
+      })
+    },
+    goAddGroup() {
+      uni.navigateTo({
+        url: '/pages/addGroup/addGroup'
+      })
+    }
+  }
+}
+</script>
+
+
+<style lang="scss" scoped>
+@import './index.rpx.css';
+</style>

+ 81 - 0
pages/myRules/index.rpx.css

@@ -0,0 +1,81 @@
+.page {
+	background: #F7F7F7;
+	padding: 0 10rpx 32rpx 32rpx;
+	min-height: 98vh;
+}
+.addGroup{
+	width: 686rpx;
+	height: 84rpx;
+	background: #FFE05C;
+	border-radius: 54rpx;
+	font-size: 28rpx;
+	font-weight: 400;
+	color: #333333;
+	line-height: 84rpx;
+	text-align: center;
+	margin-top: 24rpx;
+}
+.item{
+	width: 638rpx;
+	background: #FFFFFF;
+	border-radius: 16rpx;
+	margin: 24rpx 0;
+	padding: 0 24rpx;
+	position: relative;
+}
+.storeName{
+	height: 48rpx;
+	font-size: 28rpx;
+	font-weight: 400;
+	color: #666666;
+	line-height: 48rpx;
+	margin-top: 24rpx;
+}
+.time{
+	height: 48rpx;
+	font-size: 28rpx;
+	font-weight: 400;
+	color: #999999;
+	line-height: 48rpx;
+	margin-top: 24rpx;
+}
+.name{
+	height: 48rpx;
+	font-size: 28rpx;
+	font-weight: 700;
+	color: #333333;
+	line-height: 48rpx;
+}
+.icon-num{
+	margin-top: 24rpx;
+}
+.key{
+	width: 120rpx;
+	height: 44rpx;
+	font-size: 28rpx;
+	font-weight: 400;
+	color: #999999;
+	line-height: 44rpx;
+	margin-left: 12rpx;
+}
+.number{
+	height: 44rpx;
+	font-size: 28rpx;
+	font-weight: 700;
+	color: #333333;
+	line-height: 44rpx;
+	margin-left: 12rpx;
+}
+.phone{
+	height: 44rpx;
+	font-size: 28rpx;
+	color: #979595;
+	line-height: 44rpx;
+	margin-left: 12rpx;
+}
+.xiugai{
+	position:absolute;
+	top: 26rpx;
+	right: 26rpx;
+}
+

+ 100 - 0
pages/myRules/index.vue

@@ -0,0 +1,100 @@
+<template>
+  <view class="page">
+    <!-- #ifdef H5-->
+    <uni-nav-bar v-if="!$isWxBrowser()" :fixed="true" background-color="#FFE05C" :border="false" :statusBar="false"
+                 left-icon="left" title="我的规则" @clickLeft="back"/>
+    <!-- #endif -->
+
+    <view class="flex-col item" v-for="(item,index) in list" :key="index">
+      <view class="flex-row justify-between">
+        <text class="storeName">{{ item.title }}</text>
+        <text class="time">{{ item.createTime }}</text>
+      </view>
+      <view class="flex-row">
+        <text class="key">直推:</text>
+        <view>
+          <view class="phone">注册现金:{{ item.awardAmount }}元</view>
+          <view class="flex-row">
+            <view class="phone">消费现金:{{ item.consumeAmount }}元</view>
+            <view class="phone">消费比例:{{ item.consumeRatio * 100 }}%</view>
+          </view>
+        </view>
+      </view>
+      <view class="flex-row">
+        <text class="key">间推:</text>
+        <view>
+          <view class="flex-row">
+            <view class="phone">间推现金:{{ item.indirectRechargeAmount }}元</view>
+            <view class="phone">间推比例:{{ item.indirectRechargeRatio * 100 }}%</view>
+          </view>
+        </view>
+      </view>
+      <view class="flex-row" v-for="i in item.strategyList">
+        <text class="key">优惠券:</text>
+        <view>
+          <view class="phone">{{i.name}} <span style="font-size: 16rpx"> ({{ i.startTime }}至{{ i.endTime }})</span></view>
+        </view>
+      </view>
+    </view>
+
+    <!--#ifdef H5-->
+    <liu-drag-button v-if="$isWxBrowser()" @clickBtn="back">返回</liu-drag-button>
+    <!--#endif-->
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      height: '',
+      list: [],
+      roleId:null,
+    }
+  },
+  onLoad(options) {
+    if(options.id){
+      this.roleId = options.id
+      this.getInfoById()
+    }else {
+     this.roleId = uni.getStorageSync('spreadUserInfo').roleId
+      console.log(this.roleId)
+      this.getInfoById()
+    }
+    let sysInfo = uni.getSystemInfoSync()
+    this.height = sysInfo.windowHeight - 120 + 'px' //除标题栏栏外的屏幕可用高度
+  },
+  methods: {
+    back() {
+      let pages = getCurrentPages()
+      if (pages.length > 1) {
+        uni.navigateBack({
+          delta: 1,
+          fail: err => {
+            console.log(err)
+          }
+        })
+      } else {
+        uni.switchTab({
+          url: '/pages/my/my'
+        });
+      }
+    },
+    getInfo() {
+      this.$api.service.getRuleList( {roleId:this.roleId}).then((res) => {
+        this.list = res.data.data
+      })
+    },
+    getInfoById(){
+      this.$api.service.getRuleByRoleId({roleId:this.roleId}).then((res) => {
+        this.list = res.data.data
+      })
+    }
+  }
+}
+</script>
+
+
+<style lang="scss" scoped>
+@import './index.rpx.css';
+</style>

+ 1 - 1
pages/specialistsDetail/specialistsDetail.vue

@@ -12,7 +12,7 @@
 
         <swiper class="swiper" :style="{height:height}" :current="current" @change="swiperChange">
             <swiper-item>
-                <view class="msg bord" :style="{height:height}">
+                <view class="msg" :style="{height:height}">
                     <view class="flex-row justify-between msgItem">
                         <view>
                             <text>头像</text>

+ 0 - 2
pages/specialistsList/module/mescrollUni-item.vue

@@ -104,8 +104,6 @@
 				this.$emit('openAddRemarkPopup',e)
 			},
 
-
-
 			navigateToPage(url){
 				uni.navigateTo({
 					url:url

+ 0 - 1
pages/spreadRankingList/spreadRankingList.vue

@@ -7,7 +7,6 @@
 
     <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" :startDate='startDate' :endDate='endDate' :height="height">

+ 2 - 1
pages/todaySpecialistsList/module/index.rpx.css

@@ -2,7 +2,8 @@
     background: #F7F7F7;
 }
 .item{
-    background: white;
+    margin: 20rpx;
+    background: #d7d2d2;
     padding: 10rpx 32rpx;
     border-bottom: 2rpx solid #f7f7f7;
 

+ 6 - 28
pages/todaySpecialistsList/module/mescrollUni-item.vue

@@ -11,17 +11,12 @@
 			<view class="flex-col justify-between item" v-for="(item,index) in list" :key="index">
 				<view class="flex-row justify-between listItemMsg">
 					<view class="memberNo">
-						<text>{{item.name}}</text>
+						<text>{{ item.couponName }}</text>
 					</view>
-					<view class="flex-row justify-between msg">
-						<text>{{item.phone}}</text>
-						<text class="detail" @click="navigateToPage('/pages/specialistsDetail/specialistsDetail?id=' + item.id)">详情</text>
+					<view class="flex-row justify-between">
+						<text>{{item.useCoupon}}/{{item.totalUseCoupon}}</text>
 					</view>
 				</view>
-				<view class="flex-row justify-between">
-					<text class="time">{{item.createTime}}</text>
-					<text class="remark" @click="openAddRemarkPopup(item.id)">备注</text>
-				</view>
 			</view>
 		</view>
 	</mescroll-uni>
@@ -90,21 +85,12 @@
 			},
 			/*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
 			upCallback(page) {
-
 				//联网加载数据
-				let httpData = {
-					pageNum:page.num,
-					pageSize:10,
-					orderByColumn:'createTime',
-					isAsc:'desc'
-				}
-
-				this.$api.service.getTodayAttacheList(httpData).then((res) => {
+				this.$api.service.useCouponCondition().then((res) => {
 					//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
-					this.mescroll.endSuccess(res.data.rows.length,res.data.rows.length === 10);
+					this.mescroll.endSuccess(res.data.data.length,res.data.data.length === 10);
 					//设置列表数据
-					if (page.num === 1) this.list = []; //如果是第一页需手动制空列表
-					this.list = this.list.concat(res.data.rows); //追加新数据
+					this.list = res.data.data; //追加新数据
 				}).catch((err) => {
 					//联网失败, 结束加载
 					this.mescroll.endErr();
@@ -136,14 +122,6 @@
 				console.log(e)
 				this.$emit('openAddRemarkPopup',e)
 			},
-
-
-
-			goOrderDetail(item){
-				uni.navigateTo({
-					url:'/myPages/transactionRecordDetail/index?item='+JSON.stringify(item)
-				})
-			},
 		}
 	}
 </script>

+ 1 - 1
pages/todaySpecialistsList/todaySpecialistsList.vue

@@ -37,7 +37,7 @@
         },
 
         onShow(){
-            this.$refs.MescrollItem.downCallback()
+
         },
 
         methods: {