ソースを参照

feat:删除分组

zhanghui 2 年 前
コミット
6afacd78c5
5 ファイル変更75 行追加40 行削除
  1. 9 0
      common/js/service.js
  2. 3 5
      main.js
  3. 23 17
      pages/my/my.vue
  4. 35 18
      pages/myGroup/module/mescrollUni-item.vue
  5. 5 0
      pages/myGroup/myGroup.vue

+ 9 - 0
common/js/service.js

@@ -143,6 +143,15 @@ export default {
         })
     },
 
+    // 修改分组成员
+    deleteGroup(data) {
+        return request({
+            url: '/member/wechat/deleteGroup',
+            method: 'GET',
+            data: data
+        })
+    },
+
     // 修改分组成员
     updateGroupUser(data) {
         return request({

+ 3 - 5
main.js

@@ -7,8 +7,8 @@ import './uni.promisify.adaptor'
 import uView from "uview-ui";
 // #ifdef H5
 // 提交前需要注释  本地调试使用 使用vconsole
-const vconsole = require('vconsole')
-Vue.prototype.$vconsole = new vconsole()
+// const vconsole = require('vconsole')
+// Vue.prototype.$vconsole = new vconsole()
 // #endif
 import api from './common/js/api'
 import env from './common/js/env.js';
@@ -25,8 +25,6 @@ Vue.use(uView);
 Vue.config.productionTip = false
 App.mpType = 'app'
 const app = new Vue({
-  ...App
+	...App
 })
 app.$mount()
-
-

+ 23 - 17
pages/my/my.vue

@@ -7,7 +7,8 @@
 			<view class="flex-col justify-evenly useMsg">
 				<view class="flex-row">
 					<text class="name">{{userInfo.name}}</text>
-					<view class="tag">{{userInfo.isManager === 1? '拓客经理': userInfo.roleTag == '0' ? '拓客专员':'合作伙伴'}}</view>
+					<view class="tag">{{userInfo.isManager === 1? '拓客经理': userInfo.roleTag == '0' ? '拓客专员':'合作伙伴'}}
+					</view>
 				</view>
 				<view>
 					<text class="phone">电话:{{userInfo.phone}}</text>
@@ -18,12 +19,13 @@
 		<view class="statistics flex-col">
 			<view class="flex-row justify-around" v-if="userInfo.isManager == '1'">
 				<view class="flex-row justify-center out ">
-					<view class="flex-col  statisticsItem " @click="navigateTo('/pages/specialistsList/specialistsList')">
+					<view class="flex-col  statisticsItem "
+						@click="navigateTo('/pages/specialistsList/specialistsList')">
 						<view>
 							<image src="/static/my/fuwuNmber.png" class="statisticsImg"></image>
 						</view>
 						<text class="statisticsKey">我的专员(人)</text>
-						<text class="statisticsValue">300</text>
+						<text class="statisticsValue">0</text>
 					</view>
 				</view>
 				<view class="flex-row justify-center out leftBorder">
@@ -32,19 +34,20 @@
 							<image src="/static/my/hezuohuoban.png" class="statisticsImg"></image>
 						</view>
 						<text class="statisticsKey">合作伙伴(人)</text>
-						<text class="statisticsValue">300</text>
+						<text class="statisticsValue">0</text>
 					</view>
 				</view>
 			</view>
 
 			<view class="flex-row justify-around " v-else>
 				<view class="flex-row justify-center out ">
-					<view class="flex-col  statisticsItem " @click="navigateTo('/pages/directPromotionList/directPromotionList')">
+					<view class="flex-col  statisticsItem "
+						@click="navigateTo('/pages/directPromotionList/directPromotionList')">
 						<view>
 							<image src="/static/my/fuwuTimeLong.png" class="statisticsImg"></image>
 						</view>
 						<text class="statisticsKey">我的直推(人)</text>
-						<text class="statisticsValue">300</text>
+						<text class="statisticsValue">0</text>
 					</view>
 				</view>
 				<view class="flex-row justify-center out leftBorder">
@@ -53,7 +56,7 @@
 							<image src="/static/my/benyuerenwu.png" class="statisticsImg"></image>
 						</view>
 						<text class="statisticsKey">推广收益(人)</text>
-						<text class="statisticsValue">300</text>
+						<text class="statisticsValue">0</text>
 					</view>
 				</view>
 			</view>
@@ -61,8 +64,11 @@
 
 		<view class="flex-col justify-start list">
 			<uni-list :border="false">
-				<uni-list-item v-if="userInfo.isManager == 1"  :clickable="true" title="我的分组" to="/pages/myGroup/myGroup" showArrow thumb="/static/my/fenzu.png" thumb-size="sm" rightText=""/>
-				<uni-list-item v-if="userInfo.roleTag == 1"  :clickable="true" title="购买优惠券" to="/pages/purchaseCoupon/purchaseCoupon" showArrow thumb="/static/my/coupon.png" thumb-size="sm" rightText=""/>
+				<uni-list-item v-if="userInfo.isManager == 1" :clickable="true" title="我的分组" to="/pages/myGroup/myGroup"
+					showArrow thumb="/static/my/fenzu.png" thumb-size="sm" rightText="" />
+				<uni-list-item v-if="userInfo.roleTag == 1" :clickable="true" title="购买优惠券"
+					to="/pages/purchaseCoupon/purchaseCoupon" showArrow thumb="/static/my/coupon.png" thumb-size="sm"
+					rightText="" />
 			</uni-list>
 		</view>
 	</view>
@@ -72,9 +78,9 @@
 	export default {
 		data() {
 			return {
-				staticsData:{},
-				userInfo:{},
-				height:''
+				staticsData: {},
+				userInfo: {},
+				height: ''
 			}
 		},
 		onLoad() {
@@ -82,16 +88,16 @@
 			this.height = sysInfo.windowHeight + 'px'
 		},
 
-		onShow(){
+		onShow() {
 			this.userInfo = uni.getStorageSync('spreadUserInfo')
 			this.getImgUrlByOssId(this.userInfo.img)
 		},
 
 		methods: {
 
-			navigateTo(url){
+			navigateTo(url) {
 				uni.navigateTo({
-					url:url
+					url: url
 				})
 			},
 
@@ -104,13 +110,13 @@
 				}
 			},
 
-			navigateTo(url){
+			navigateTo(url) {
 				uni.navigateTo({
 					url: url
 				})
 			},
 
-			goUserInfo(){
+			goUserInfo() {
 				uni.navigateTo({
 					url: '/pages/userInfo/userInfo'
 				})

+ 35 - 18
pages/myGroup/module/mescrollUni-item.vue

@@ -8,8 +8,9 @@
 	<mescroll-uni :ref="'mescrollRef' + i" @init="mescrollInit" :height="height" :down="downOption" @down="downCallback"
 		:up="upOption" @up="upCallback" @emptyclick="emptyClick">
 
-			<view>
-				<view class="flex-col  item" v-for="(item,index) in list" :key="index" @click="groupDetail(item)">
+		<view>
+			<view class="flex-col  item" v-for="(item,index) in list" :key="index" @click="groupDetail(item)">
+				<next-swipe-action ref="nextSwipeAction" :index="index" @btnClick="btnClick">
 					<view class="flex-row justify-between">
 						<text class="storeName">{{item.name}}</text>
 						<text class="time">{{item.createTime}}</text>
@@ -25,9 +26,12 @@
 						<text class="key">成员:</text>
 						<text class="number">{{item.memberCount}}人</text>
 					</view>
-					<u-icon size="30" name="/static/group/xiugai.png" class="xiugai" @click.native.stop="updateGroup(item)"></u-icon>
-				</view>
+					<u-icon size="30" name="/static/group/xiugai.png" class="xiugai"
+						@click.native.stop="updateGroup(item)"></u-icon>
+				</next-swipe-action>
+
 			</view>
+		</view>
 	</mescroll-uni>
 </template>
 
@@ -60,7 +64,7 @@
 					},
 					textNoMore: '没有更多了'
 				},
-				list:[],
+				list: [],
 			}
 		},
 		props: {
@@ -75,11 +79,11 @@
 			height: [Number, String], // mescroll的高度
 
 		},
-		watch:{
+		watch: {
 
 		},
 
-		created(){
+		created() {
 
 
 		},
@@ -94,18 +98,24 @@
 			},
 			/*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
 			upCallback(page) {
+				console.log('nextSwipeAction=>', this.$refs.nextSwipeAction)
+				if (this.$refs.nextSwipeAction) {
+					this.$refs.nextSwipeAction.forEach(item => {
+						item.reset()
+					})
+				}
 				//联网加载数据
-				this.$api.service.groupList( {
-					pageNum:page.num,
-					pageSize:10
+				this.$api.service.groupList({
+					pageNum: page.num,
+					pageSize: 10
 				}).then((res) => {
 					//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
-					this.mescroll.endSuccess(res.data.data.length,res.data.data.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.data); //追加新数据
-					this.getImgUrlByOssId(this.list)
 					console.log(this.list)
+
 				}).catch((err) => {
 					//联网失败, 结束加载
 					this.mescroll.endErr();
@@ -126,22 +136,29 @@
 				this.mescroll.resetUpScroll();
 			},
 
-			updateGroup(item){
+			updateGroup(item) {
 				uni.navigateTo({
-					url:'/pages/updateGroup/updateGroup?item=' + JSON.stringify(item)
+					url: '/pages/updateGroup/updateGroup?item=' + JSON.stringify(item)
 				})
 			},
 
-			groupDetail(item){
+			groupDetail(item) {
 				uni.navigateTo({
-					url:'/pages/groupDetail/groupDetail?item=' + JSON.stringify(item)
+					url: '/pages/groupDetail/groupDetail?item=' + JSON.stringify(item)
 				})
 			},
+			btnClick(e) {
+				console.log(e)
+				this.$api.service.deleteGroup({
+					groupId: this.list[e.index].id
+				}).then(res => {
+					this.downCallback()
+				})
+			}
 		}
 	}
 </script>
 <style>
 	@import '/common/css/common.css';
 	@import './index.rpx.css';
-
-</style>
+</style>

+ 5 - 0
pages/myGroup/myGroup.vue

@@ -27,6 +27,11 @@
 			let sysInfo = uni.getSystemInfoSync()
 			this.height = sysInfo.windowHeight  - 120 + 'px' //除标题栏栏外的屏幕可用高度
 		},
+		onShow(){
+			if (this.$refs.MescrollItem){
+				this.$refs.MescrollItem.downCallback()
+			}
+		},
 		methods: {
 			back() {
 				uni.navigateBack({