hmp 4 éve
szülő
commit
5cb2db44f9

+ 139 - 61
assets/colorui/app.css

@@ -1,31 +1,36 @@
-.btn-color{
+.btn-color {
 	color: #FF9447;
 }
 
+.tag-bg {
+	background-color: #FFA66D;
+	color: #FFFFFF;
+}
+
 
 
-.hoverClass{
+.hoverClass {
 	opacity: 0.9;
 	background-color: #ebebeb;
 }
 
-.center{
+.center {
 	display: flex;
 	justify-content: center;
 	align-items: center;
 }
 
-.btn-bg-color{
+.btn-bg-color {
 	background-color: #FF9447;
 	color: #FFFFFF;
 }
 
-.btn-line-color{
+.btn-line-color {
 	border: 1rpx solid #FF9447;
 	color: #DA3F33;
 }
 
-.text-base{
+.text-base {
 	color: #dc311c;
 }
 
@@ -34,183 +39,256 @@
 	color: #ffffff;
 }
 
-.line-base{
+.line-base {
 	border: 1rpx solid #FF9447;
 	color: #FF9447;
 }
 
-.line-btn-base{
+.line-btn-base {
 	border: 1rpx solid #FF9447;
 	color: #FF9447;
 }
 
 
-.bg-base{
+.bg-base {
 	background-color: #FF9447;
 	color: #FFFFFF;
 }
 
-.bg-white{
+.bg-white {
 	background-color: #FFFFFF;
 	color: #333333;
 }
+
 /* ===========padding=========== */
-.padding-10,.padding-sm{
+.padding-10,
+.padding-sm {
 	padding: 10rpx;
 }
-.padding-20,.padding-df{
+
+.padding-20,
+.padding-df {
 	padding: 20rpx;
 }
-.padding-30,.padding-lg{
+
+.padding-30,
+.padding-lg {
 	padding: 30rpx;
 }
-.padding-40{
+
+.padding-40 {
 	padding: 40rpx;
 }
-.padding-50{
+
+.padding-50 {
 	padding: 50rpx;
 }
-.padding-left-10,.padding-left-sm{
+
+.padding-left-10,
+.padding-left-sm {
 	padding-left: 10rpx;
 }
-.padding-left-20,.padding-left-df{
+
+.padding-left-20,
+.padding-left-df {
 	padding-left: 20rpx;
 }
-.padding-left-30,.padding-left-lg{
+
+.padding-left-30,
+.padding-left-lg {
 	padding-left: 30rpx;
 }
-.padding-left-40{
+
+.padding-left-40 {
 	padding-left: 40rpx;
 }
-.padding-left-50{
+
+.padding-left-50 {
 	padding-left: 50rpx;
 }
 
-.padding-right-10,.padding-right-sm{
+.padding-right-10,
+.padding-right-sm {
 	padding-right: 10rpx;
 }
-.padding-right-20,.padding-right-df{
+
+.padding-right-20,
+.padding-right-df {
 	padding-right: 20rpx;
 }
-.padding-right-30,.padding-right-lg{
+
+.padding-right-30,
+.padding-right-lg {
 	padding-right: 30rpx;
 }
-.padding-right-40{
+
+.padding-right-40 {
 	padding-right: 40rpx;
 }
-.padding-right-50{
+
+.padding-right-50 {
 	padding-right: 50rpx;
 }
 
-.padding-top-10,.padding-top-sm{
+.padding-top-10,
+.padding-top-sm {
 	padding-top: 10rpx;
 }
-.padding-top-20,.padding-top-df{
+
+.padding-top-20,
+.padding-top-df {
 	padding-top: 20rpx;
 }
-.padding-top-30,.padding-top-lg{
+
+.padding-top-30,
+.padding-top-lg {
 	padding-top: 30rpx;
 }
-.padding-top-40{
+
+.padding-top-40 {
 	padding-top: 40rpx;
 }
-.padding-top-50{
+
+.padding-top-50 {
 	padding-top: 50rpx;
 }
 
-.padding-bottom-10,.padding-bottom-sm{
+.padding-bottom-10,
+.padding-bottom-sm {
 	padding-bottom: 10rpx;
 }
-.padding-bottom-20,.padding-bottom-df{
+
+.padding-bottom-20,
+.padding-bottom-df {
 	padding-bottom: 20rpx;
 }
-.padding-bottom-30,.padding-bottom-lg{
+
+.padding-bottom-30,
+.padding-bottom-lg {
 	padding-bottom: 30rpx;
 }
-.padding-bottom-40{
+
+.padding-bottom-40 {
 	padding-bottom: 40rpx;
 }
-.padding-bottom-50{
+
+.padding-bottom-50 {
 	padding-bottom: 50rpx;
 }
 
 /* ===========margin=========== */
-.margin-10,.margin-sm{
+.margin-10,
+.margin-sm {
 	margin: 10rpx;
 }
-.margin-20,.margin-df{
+
+.margin-20,
+.margin-df {
 	margin: 20rpx;
 }
-.margin-30,.margin-lg{
+
+.margin-30,
+.margin-lg {
 	margin: 30rpx;
 }
-.margin-40{
+
+.margin-40 {
 	margin: 40rpx;
 }
-.margin-50{
+
+.margin-50 {
 	margin: 50rpx;
 }
-.margin-left-10,.margin-left-sm{
+
+.margin-left-10,
+.margin-left-sm {
 	margin-left: 10rpx;
 }
-.margin-left-20,.margin-left-df{
+
+.margin-left-20,
+.margin-left-df {
 	margin-left: 20rpx;
 }
-.margin-left-30,.margin-left-lg{
+
+.margin-left-30,
+.margin-left-lg {
 	margin-left: 30rpx;
 }
-.margin-left-40{
+
+.margin-left-40 {
 	margin-left: 40rpx;
 }
-.margin-left-50{
+
+.margin-left-50 {
 	margin-left: 50rpx;
 }
 
-.margin-right-10,.margin-right-sm{
+.margin-right-10,
+.margin-right-sm {
 	margin-right: 10rpx;
 }
-.margin-right-20,.margin-right-df{
+
+.margin-right-20,
+.margin-right-df {
 	margin-right: 20rpx;
 }
-.margin-right-30,.margin-right-lg{
+
+.margin-right-30,
+.margin-right-lg {
 	margin-right: 30rpx;
 }
-.margin-right-40{
+
+.margin-right-40 {
 	margin-right: 40rpx;
 }
-.margin-right-50{
+
+.margin-right-50 {
 	margin-right: 50rpx;
 }
 
-.margin-top-10,.margin-top-sm{
+.margin-top-10,
+.margin-top-sm {
 	margin-top: 10rpx;
 }
-.margin-top-20,.margin-top-df{
+
+.margin-top-20,
+.margin-top-df {
 	margin-top: 20rpx;
 }
-.margin-top-30,.margin-top-lg{
+
+.margin-top-30,
+.margin-top-lg {
 	margin-top: 30rpx;
 }
-.margin-top-40{
+
+.margin-top-40 {
 	margin-top: 40rpx;
 }
-.margin-top-50{
+
+.margin-top-50 {
 	margin-top: 50rpx;
 }
 
-.margin-bottom-10,.margin-bottom-sm{
+.margin-bottom-10,
+.margin-bottom-sm {
 	margin-bottom: 10rpx;
 }
-.margin-bottom-20,.margin-bottom-df{
+
+.margin-bottom-20,
+.margin-bottom-df {
 	margin-bottom: 20rpx;
 }
-.margin-bottom-30,.margin-bottom-lg{
+
+.margin-bottom-30,
+.margin-bottom-lg {
 	margin-bottom: 30rpx;
 }
-.margin-bottom-40{
+
+.margin-bottom-40 {
 	margin-bottom: 40rpx;
 }
-.margin-bottom-50{
+
+.margin-bottom-50 {
 	margin-bottom: 50rpx;
 }
 
@@ -254,4 +332,4 @@
 	flex-direction: row;
 	justify-content: center;
 	padding: 30rpx;
-} */
+} */

+ 33 - 13
assets/http/api.js

@@ -2,24 +2,44 @@ import {http} from './service.js'
 
 
 //文件上传
-let uploadFileUrl='/upload/putfile'
-const uploadFile={
-	submit:p => http.upload(uploadFileUrl, {name:'file',filePath:p}),
+const uploadFile =(p)=> http.upload('blade-resource/oss/endpoint/put-file', {name:'file',filePath:p})
+
+//手机验证码
+const sms={
+	send:p => http.post('huawei/sms/sendSms'+p),
+	validCode:(p)=> http.post('huawei/sms/validCode'+p)
+}
+//商场管理
+const mall={
+	getListByPhone:p => http.get("cyzh-ldt/app/mall/getMyMallList", {params:p}),
+	getShopLabelByMallId:p => http.get("cyzh-ldt/app/mall/getShopLabelByMallId?mallId="+p),
+	getMallAreaByMallId:p => http.get("cyzh-ldt/app/mall/getMallAreaByMallId?mallId="+p),
+	getShopList:p => http.get("cyzh-ldt/app/mall/getShopList",{params:p}),
+	statistic:p => http.get("cyzh-ldt/app/mall/statistic?mallId="+p),
 }
 
-//园区api
-let agencyUrl={
-	page:'/agency/agency/getAgencyList',
-	submit:'/agency/agency/submit'
+const shop={
+	stop:p => http.post('cyzh-ldt/shop/update',p),
+	detail:p => http.get("cyzh-ldt/shop/detail", {params:p}),
 }
-const agency = {
-	page:p => http.get(agencyUrl.page, {params:p}),
-	submit:p => http.post(agencyUrl.submit, p),
+
+const activity={
+	publish:(p)=> http.post('/cyzh-ldt/activity/submit',p),
+	list:p => http.get("cyzh-ldt/app/mall/getActivity", {params:p}),
+	//结束活动
+	stop:(p)=> http.post('/cyzh-ldt/activity/updateBatch',p),
+	//退出活动
+	exit:(p)=> http.post('cyzh-ldt/activityjoinrecord/exitBatch',p),
+	//参加活动
+	join:(p)=> http.post('cyzh-ldt/activityjoinrecord/joinBatch',p),
+	//活动详情
+	detail:p => http.get("/cyzh-ldt/activity/detail", {params:p}),
 }
-const test=	(p) => http.get("cyzh_userGoods/usergoods/page", {params:p})
 
 export const api={
-	test,
 	uploadFile,
-	agency
+	sms,
+	mall,
+	shop,
+	activity
 }

+ 71 - 65
assets/http/service.js

@@ -1,83 +1,89 @@
 import Request from 'luch-request'
 
-let	baseURL = 'http://localhost:80/'
+let baseURL = 'http://localhost:2539/'
 
-let tokenUrl=baseURL+"blade-auth/oauth/token?tenantId=804981&password=ea3c40c0df5477c525543b0e85548004&username=wpadmin"
+let tokenUrl = baseURL +
+	"blade-auth/oauth/token?tenantId=000000&password=21232f297a57a5a743894a0e4a801fc3&username=admin"
 
 //获取token
 const getTokenStorage = () => {
-  let token = ''
-  try {
-    token = uni.getStorageSync('token')
-  } catch (e) {
-  }
-  return token
+	let token = ''
+	try {
+		token = uni.getStorageSync('token')
+	} catch (e) {}
+	return token
 }
 const http = new Request()
-http.setConfig((config) => { /* 设置全局配置 */
-  config.baseURL = baseURL  /* 根域名不同 */
-  config.header = {
-    ...config.header,
-  }
-  return config
+http.setConfig((config) => {
+	/* 设置全局配置 */
+	config.baseURL = baseURL /* 根域名不同 */
+	config.header = {
+		...config.header,
+	}
+	return config
 })
-http.interceptors.request.use((config) => { /* 请求之前拦截器。可以使用async await 做异步操作 */
-  config.header = {
-    ...config.header,
-    "Blade-Auth": getTokenStorage()
-  }
-  return config
+http.interceptors.request.use((config) => {
+	/* 请求之前拦截器。可以使用async await 做异步操作 */
+	config.header = {
+		...config.header,
+		"Blade-Auth": getTokenStorage()
+	}
+	return config
 }, (config) => {
-  return Promise.reject(config)
+	return Promise.reject(config)
 })
 // 是否正在刷新的标记
 let isRefreshing = false
 // 重试队列,每一项将是一个待执行的函数形式
 let requests = []
-http.interceptors.response.use(async (response) => { /* 请求之后拦截器。可以使用async await 做异步操作  */
+http.interceptors.response.use(async (response) => {
+	/* 请求之后拦截器。可以使用async await 做异步操作  */
 	//toekn过期处理 
-      if (response.data.code == 401) {
-          let {config} = response
-          if (!isRefreshing) {
-              isRefreshing = true
-              let token = uni.getStorageSync('token')
-              let [,res] = await uni.request({
-                  url: tokenUrl,
-                  method: 'POST',
-                  header:{
-                  	Authorization:"Basic c2FiZXI6c2FiZXJfc2VjcmV0"
-                  },
-              })
-              //否则保存新的token
-              token=res.data.token_type+" "+res.data.access_token
-              uni.setStorageSync('token', token)
-              requests.forEach(cb => cb())
-              // 重试完了清空这个队列
-              requests = []
-              isRefreshing = false
-              return http.request(config)
-          } else {
-              return new Promise((resolve) => {
-                  // 将resolve放进队列,用一个函数形式来保存,等token刷新后直接执行
-                  requests.push(() => {
-                      resolve(http.request(config))
-                  })
-              })
-          }
-      }
-	  //200 返回数据成功 0
-      if (response.data.code != 200) {
-        return Promise.reject(response)
-      }
-      return response.data
-  }, (err) => { // 请求错误做点什么
-      uni.showToast({
-          icon: 'none',
-          position: 'bottom',
-          title: '网络异常'
-      })
-      return Promise.reject(err)
-  })
+
+	//200 返回数据成功 0
+	if (response.data.code != 200) {
+		return Promise.reject(response)
+	}
+	return response.data
+}, async (err) => { // 请求错误做点什么
+	if (err.data.code == 401) {
+		let {
+			config
+		} = err
+		if (!isRefreshing) {
+			isRefreshing = true
+			let token = uni.getStorageSync('token')
+			let [, res] = await uni.request({
+				url: tokenUrl,
+				method: 'POST',
+				header: {
+					Authorization: "Basic c2FiZXI6c2FiZXJfc2VjcmV0"
+				},
+			})
+			//否则保存新的token
+			token = res.data.token_type + " " + res.data.access_token
+			uni.setStorageSync('token', token)
+			requests.forEach(cb => cb())
+			// 重试完了清空这个队列
+			requests = []
+			isRefreshing = false
+			return http.request(config)
+		} else {
+			return new Promise((resolve) => {
+				// 将resolve放进队列,用一个函数形式来保存,等token刷新后直接执行
+				requests.push(() => {
+					resolve(http.request(config))
+				})
+			})
+		}
+	}
+	uni.showToast({
+		icon: 'none',
+		position: 'bottom',
+		title: '网络异常'
+	})
+	return Promise.reject(err)
+})
 export {
-  http
+	http
 }

+ 2 - 2
components/mescroll-body/components/mescroll-empty.vue

@@ -63,8 +63,8 @@ export default {
 }
 
 .mescroll-empty .empty-icon {
-	width: 280rpx;
-	height: 280rpx;
+	width: 230rpx;
+	height: 230rpx;
 }
 
 .mescroll-empty .empty-tip {

+ 1 - 1
components/mescroll-body/mescroll-uni-option.js

@@ -27,7 +27,7 @@ const GlobalOption = {
 		},
 		empty: {
 			use: true, // 是否显示空布局
-			icon: "http://139.9.103.171:1888/miniofile/xlyq/empty/empty.png", // 图标路径 (建议放入static目录, 如 /static/img/mescroll-empty.png )
+			icon: "/static/icon/empty.png", // 图标路径 (建议放入static目录, 如 /static/img/mescroll-empty.png )
 			tip: '数据为空' // 提示
 		}
 	}

+ 85 - 74
pages.json

@@ -3,88 +3,99 @@
 		"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
 	},
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
+		{
+			"path": "pages/login/account-login",
+			"style": {
+				"navigationStyle": "custom",
+				"enablePullDownRefresh": false
+			}
+		},
 		{
 			"path": "pages/index/index",
 			"style": {
-				"navigationStyle":"custom",
+				"navigationStyle": "custom",
 				"navigationBarTitleText": "uni-app"
 			}
+		}, {
+			"path": "pages/member-center/member-center",
+			"style": {
+				"navigationBarTitleText": "会员中心",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/recharge/recharge",
+			"style": {
+				"navigationBarTitleText": "充值",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/recharge/records",
+			"style": {
+				"navigationBarTitleText": "开票记录",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/publish/publish",
+			"style": {
+				"navigationBarTitleText": "发起活动",
+				"navigationStyle": "custom",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/activity/activity",
+			"style": {
+				"navigationBarTitleText": "活动列表",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/publish/detail",
+			"style": {
+				"navigationStyle": "custom",
+				"navigationBarTitleText": "活动详情",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/stores/stores",
+			"style": {
+				"navigationStyle": "custom",
+				"navigationBarTitleText": "门店",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/stores/detail",
+			"style": {
+				"navigationBarTitleText": "详情",
+				"enablePullDownRefresh": false
+			}
+
 		}
-	    ,{
-            "path" : "pages/member-center/member-center",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "会员中心",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-        ,{
-            "path" : "pages/recharge/recharge",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "充值",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-        ,{
-            "path" : "pages/recharge/records",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "开票记录",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-        ,{
-            "path" : "pages/publish/publish",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "发起活动",
-				"navigationStyle":"custom",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-        ,{
-            "path" : "pages/activity/activity",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "活动列表",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-        ,{
-            "path" : "pages/publish/detail",
-            "style" :                                                                                    
-            {
+		,{
+		    "path" : "pages/login/login",
+		    "style" :                                                                                    
+		    {
 				"navigationStyle":"custom",
-                "navigationBarTitleText": "活动详情",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-        ,{
-            "path" : "pages/stores/stores",
-            "style" :                                                                                    
-            {
+		        "navigationBarTitleText": "",
+		        "enablePullDownRefresh": false
+		    }
+		    
+		}
+		,{
+		    "path" : "pages/login/forget",
+		    "style" :                                                                                    
+		    {
 				"navigationStyle":"custom",
-                "navigationBarTitleText": "门店",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-        ,{
-            "path" : "pages/stores/detail",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "详情",
-                "enablePullDownRefresh": false
-            }
-            
-        }
+		        "navigationBarTitleText": "",
+		        "enablePullDownRefresh": false
+		    }
+		    
+		}
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",

+ 116 - 23
pages/activity/activity.vue

@@ -11,60 +11,153 @@
 				</view>
 			</view>
 		</u-sticky>
-		<card :current="current" @checkboxChange="checkboxChange" @checkAllChange="checkAllChange" :cardList="cardList" ref="cardRef"></card>
+		<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption"
+			:up="upOption">
+			<card @operate="operate" :current="current" @checkboxChange="checkboxChange" @checkAllChange="checkAllChange" :cardList="dataList" ref="cardRef"></card>
+		</mescroll-body>
 	</view>
 </template>
 
 <script>
+	import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
 	import card from "./comps/card.vue"
 	export default {
+		mixins: [MescrollMixin],
 		components:{
 			card
 		},
 		data() {
 			return {
 				list: [{
-					name: '发起'
+					name: '发起',
+					value:1
 				}, {
-					name: '可参加'
+					name: '可参加',
+					value:2
 				},
 				{
-					name:'已参加'
+					name:'已参加',
+					value:3
 				}],
 				current: 0,
-				cardList: [{
-						id: "1",
-						checked: false,
-						status:0
-					},
-					{
-						id: "2",
-						checked: false,
-						status:1
-					},
-					{
-						id: "3",
-						checked: false,
-						status:2
-					},
-				],
+				dataList:[]
 			}
 		},
+		onShow() {
+			this.$util.reload(this.mescroll)
+		},
 		methods:{
 			checkboxChange(e){
 				let index=e.name
-				this.cardList[index].checked=e.value
+				this.dataList[index].checked=e.value
+				this.$forceUpdate()
 			},
 			checkAllChange(e){
-				this.cardList.forEach(item=>{
+				this.dataList.forEach(item=>{
 					item.checked = e.value
 				})
+				this.$forceUpdate()
 			},
 			change(index) {
 				this.current = index
+				this.mescroll.resetUpScroll();
 			},
 			checkAll(){
-				this.$refs.cardRef.showCheckAll()
+				if (!this.$isEmpty(this.dataList) && this.current !=1) {
+					this.$refs.cardRef.showCheckAll()	
+				}
+			},
+			operate(){
+				if (this.current==0) {
+					this.stop()
+				}else if (this.current==1) {
+					this.join()
+				}else if (this.current==2) {
+					this.exit()
+				}
+			},
+			
+			exit(){
+				this.$dialog.showModal("确定退出?").then(res=>{
+					let ids= this.dataList.filter(item=>item.checked==true).map(item=>item.id)
+					let operateList=[]
+					ids.forEach(item=>{
+						let tmp={
+							activityId:item,
+							joinType:1,
+							joinId:this.vuex_mallId
+						}
+						operateList.push(tmp)
+					})
+					this.$api.activity.exit(operateList).then(res=>{
+						if (res.success) {
+							this.$refs.cardRef.hideCheckAll()
+							this.mescroll.resetUpScroll();
+						}
+					})
+				})
+			},
+			join(){
+				this.$dialog.showModal("确定参加?").then(res=>{
+					let ids= this.dataList.filter(item=>item.checked==true).map(item=>item.id)
+					let operateList=[]
+					ids.forEach(item=>{
+						let tmp={
+							activityId:item,
+							joinType:1,
+							joinId:this.vuex_mallId
+						}
+						operateList.push(tmp)
+					})
+					this.$api.activity.join(operateList).then(res=>{
+						if (res.success) {
+							this.$refs.cardRef.hideCheckAll()
+							this.mescroll.resetUpScroll();
+						}
+					})
+				})
+			},
+			stop(){
+				this.$dialog.showModal('确定停用活动?').then(res=>{
+					let tmp=this.$u.deepClone(this.dataList)
+					let operateList= tmp.filter(item=>item.checked==true)
+					operateList.forEach(item=>{
+						item.auditStatus=3
+					})
+					this.$api.activity.stop(operateList).then(res=>{
+						if (res.success) {
+							this.$refs.cardRef.hideCheckAll()
+							this.mescroll.resetUpScroll();
+						}
+					})
+				})
+			},
+			downCallback(){
+				this.$refs.cardRef.hideCheckAll()
+				this.mescroll.resetUpScroll();
+			},
+			upCallback(mescroll) {
+				let params = {
+					selectType:this.list[this.current].value,
+					mallId:this.vuex_mallId,
+					current:mescroll.num,
+					size:mescroll.size,
+				}
+				try {
+					this.$api.activity.list(params).then(res => {
+						let data = res.data.records
+						let total = res.data.total
+						mescroll.endBySize(data.length, total);
+						if (mescroll.num == 1) this.dataList = []; //如果是第一页需手动制空列表
+						this.dataList = this.dataList.concat(data); //追加新数据
+						this.dataList.forEach(item=>{
+							item.checked=false
+							item.labels=item.labelNames.split(',')
+						})
+					})
+				} catch (e) {
+					this.mescroll.endErr()
+				}
 			}
 		}
 	}

+ 19 - 15
pages/activity/comps/card.vue

@@ -4,36 +4,34 @@
 			<view v-if="checkAllShow" class="center" style="width: 10%;background-color: #F1F1F1;">
 				<u-checkbox shape="circle" @change="checkboxChange" v-model="item.checked" :name="index"></u-checkbox>
 			</view>
-			<navigator url="/pages/publish/detail" hover-class="none" class="" >
-				<image class="bg" src="@/static/del/del.png"></image>
+			<navigator :url="`/pages/publish/detail?id=${item.id}&current=${current}`" hover-class="none" class="" >
+				<image class="bg" :src="item.pic"></image>
 				<view class="content">
-					<text class="text-cut-1 title">消费新势能 老品牌向新网红的跃迁之路!{{item.id}}</text>
-					<block>
-						<view class="cu-tag btn-bg-color round sm tag" v-for="(item,index) in 3" :key="index">
-							天河区
-						</view>
-						<!-- <text class="text-gray margin-top-10">...</text> -->
-					</block>
+					<text class="text-cut-1 title">{{item.title}}</text>
+					<view class="cu-tag btn-bg-color round sm tag" v-for="(item1,index1) in item.labels" :key="index1">
+						{{item1}}
+					</view>
 		
 					<view class="time">
-						<text>报名截至时间:2021.07.08</text>
+						<text>报名截至时间:{{item.endTime}}</text>
 					</view>
 				</view>
-				<image v-if="item.status==0" class="status" src="@/static/icon/fail.png" mode="widthFix"></image>
-				<image v-if="item.status==1" class="status" src="@/static/icon/pass1.png" mode="widthFix"></image>
-				<image v-if="item.status==2" class="status" src="@/static/icon/await.png" mode="widthFix"></image>
+				<image v-if="item.auditStatus==0" class="status" src="@/static/icon/await.png" mode="widthFix"></image>
+				<image v-if="item.auditStatus==1" class="status" src="@/static/icon/pass1.png" mode="widthFix"></image>
+				<image v-if="item.auditStatus==2" class="status" src="@/static/icon/fail.png" mode="widthFix"></image>
 			</navigator>
 		</view>
 		
-		<block v-if="checkAllShow & current!=2">
+		<block v-if="checkAllShow">
 			<view class="" style="height: 110rpx;"></view>
 			<view class="bottom-bar" >
 				<view class="left">
 					<u-checkbox @change="checkAllChange" shape="circle" v-model="checkAll" >全选</u-checkbox>
 				</view>
-				<view class="btn-bg-color center right">
+				<view @click="operate" class="btn-bg-color center right">
 					<text v-if="current==0">结束活动</text>
 					<text v-if="current==1">参加活动</text>
+					<text v-if="current==2">退出活动</text>
 				</view>
 			</view>
 		</block>
@@ -69,11 +67,17 @@
 			showCheckAll(){
 				this.checkAllShow=!this.checkAllShow
 			},
+			hideCheckAll(){
+				this.checkAllShow=false
+			},
 			checkboxChange(e) {
 				this.$emit('checkboxChange',e)
 			},
 			checkAllChange(e){
 				this.$emit('checkAllChange',e)
+			},
+			operate(){
+				this.$emit('operate')
 			}
 		}
 		

+ 57 - 14
pages/index/index.vue

@@ -4,15 +4,19 @@
 			<image src="../../static/icon/bg.png"  style="width: 100vw;height: 400rpx"></image>
 			<view class="card-top" >
 				<view class="top">
-					<text class="name">商场名称</text>
+					<view @click="mallShow=true">
+						<text class="name" >{{mallLable}}</text>
+						<u-icon v-if="mallShow" name="arrow-up-fill" style="margin-left: 10rpx;"></u-icon>
+						<u-icon v-else name="arrow-down-fill" style="margin-left: 10rpx;"></u-icon>
+					</view>
 					<view class="btn">
 						<view class="image">
-							<image src="../../static/icon/chongzhi.png" mode=""></image>
+							<image src="@/static/icon/logout.png" mode=""></image>
 						</view>
-						<navigator url="../recharge/recharge" class="center padding-left-10" >
-							<text>充值</text>
+						<view @click="logout" class="center padding-left-10" >
+							<text>退出</text>
 							<text class="cuIcon-right"></text>
-						</navigator>
+						</view>
 					</view>
 				</view>
 				
@@ -26,7 +30,7 @@
 						</view>
 						<view class="padding-top-20 text-df">
 							<text>门店数量</text>
-							<text class="padding-left-20">1066</text>
+							<text class="padding-left-20">{{statistic.shopCount}}</text>
 						</view>
 					</view>
 					<view class="menu menu2" @click="$jump('/pages/member-center/member-center')">
@@ -38,22 +42,22 @@
 						</view>
 						<view class="padding-top-20 text-df">
 							<text>会员总数</text>
-							<text class="padding-left-20">106600</text>
+							<text class="padding-left-20">{{statistic.memberCount}}</text>
 						</view>
 					</view>
 				</view>
 				
 				<view class="cu-list grid col-3 no-border" style="border-radius:20rpx ;">
 					<view class="cu-item" >
-						<text style="color: #FF9447;font-size: 34rpx;font-weight: 800;">4100.00</text>
+						<text style="color: #FF9447;font-size: 34rpx;font-weight: 800;">{{statistic.todayIncome}}</text>
 						<text  style="color: #242424;font-size: 26rpx;" >今日营收</text>
 					</view>
 					<view class="cu-item" >
-						<text style="color: #FF9447;font-size: 34rpx;font-weight: 800;">330</text>
+						<text style="color: #FF9447;font-size: 34rpx;font-weight: 800;">{{statistic.todayOrderCount}}</text>
 						<text  style="color: #242424;font-size: 26rpx;" >交易笔数</text>
 					</view>
 					<view class="cu-item" >
-						<text style="color: #FF9447;font-size: 34rpx;font-weight: 800;">88</text>
+						<text style="color: #FF9447;font-size: 34rpx;font-weight: 800;">{{statistic.todayMemberIn}}</text>
 						<text  style="color: #242424;font-size: 26rpx;" >新增会员</text>
 					</view>
 				</view>
@@ -84,7 +88,7 @@
 				</view>
 			</view>
 			<view class="cu-list grid col-4 no-border" style="border-radius:20rpx;margin-top: 50rpx;">
-				<view class="cu-item" @click="$jump(item.path)" v-for="(item,index) in mallList" :key="index">
+				<view class="cu-item" @click="$jump(item.path)" v-for="(item,index) in mallMenuList" :key="index">
 					<view class="grid-icon" >
 						<image  style="width: 60rpx;height: 60rpx" :src="item.icon"/>
 					</view>
@@ -94,6 +98,8 @@
 		</view>
 		
 		<view class="" style="height: 60rpx;" v-if="safeAreaBottom == 0"></view>
+		
+		<u-select @confirm="mallConfirm" v-model="mallShow" value-name="id" label-name="name" :list="mallList"></u-select>
 	</view>
 </template>
 
@@ -101,6 +107,14 @@
 	export default {
 		data() {
 			return {
+				mallShow:false,
+				mallList:[],
+				mallId:'',
+				mallLable:'',
+				
+				//统计数据
+				statistic:{},
+				
 				marketList:[
 					{
 						icon:'/static/icon/publish.png',
@@ -115,7 +129,7 @@
 						path:'/pages/activity/activity'
 					},
 				],
-				mallList:[
+				mallMenuList:[
 					{
 						icon:'/static/icon/mall.png',
 						name:'商家管理',
@@ -140,10 +154,39 @@
 			}
 		},
 		onLoad() {
-			
+			this.init()
 		},
 		methods: {
-
+			logout(){
+				uni.clearStorage()
+				this.$jump('/pages/login/account-login')
+			},
+			init(){
+				this.mallList=this.$cache.get('mallList')
+				this.mallId=this.mallList[0].id
+				this.mallLable=this.mallList[0].name
+				this.cacheSelectedMall()
+				this.getStatistic()
+			
+			},
+			getStatistic(){
+				this.$api.mall.statistic(this.mallId).then(res=>{
+					this.statistic=res.data
+				})
+			},
+			mallConfirm(e){
+				this.mallId=e[0].value
+				this.mallLable=e[0].label
+				this.cacheSelectedMall()
+			},
+			cacheSelectedMall(){
+				let selectedMall={
+					id:this.mallId,
+					label:this.mallLable
+				}
+				this.$cache.put("selectedMall",selectedMall)
+				this.$u.vuex('vuex_mallId',this.mallId)
+			}
 		}
 	}
 </script>

+ 192 - 0
pages/login/account-login.vue

@@ -0,0 +1,192 @@
+<template>
+	<view style="position: relative;">
+		<view class="bg"></view>
+		<view class="bg1"></view>
+		<view class="content">
+			<view class="top">
+				<view class="logo">
+					<image src="@/static/icon/logo.png" mode=""></image>
+				</view>
+			</view>
+			
+			<view  style="width: 76%;margin-top: 30rpx;">
+				<u-form :model="form" :error-type="['message']"  ref="uForm">
+					<u-form-item  label-position="top" label="账号" prop="phone" label-width="150">
+						<view style="border-bottom: 1rpx solid #DDDDDD;">
+							<u-input :border="false" placeholder="请输入账号" v-model="form.phone" type="number"></u-input>
+						</view>
+					</u-form-item>
+					<u-form-item   label-position="top" label="密码" prop="password" label-width="150">
+						<view  style="border-bottom: 1rpx solid #DDDDDD;">
+							<u-input :border="false" placeholder="请输入登录密码" type="password" v-model="form.password"></u-input>
+						</view>
+					</u-form-item>
+				</u-form>
+				<view  class="text-right margin-top-10 text-sm">
+					<text @click="$jump('/pages/login/forget')" style="text-decoration: underline;">忘记密码</text>
+					<text @click="$jump('/pages/login/login')" style="margin-left: 20rpx;text-decoration: underline;">手机号快捷登录</text>
+				</view>
+			</view>
+			
+			<view  style="width: 86%;margin-top: 120rpx;">
+				<view @click="login" class="btn cu-btn round" style="width:100%;height: 90rpx;font-size: 36rpx;">
+					立即登录
+				</view>
+			
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				customStyle:{
+					'backgroundColor':'#d18c42',
+					'color':'#ffffff'
+				},
+				form:{
+					phone:'',
+					password:''
+				},
+				rules: {
+					phone: [
+						{ 
+							required: true, 
+							message: '请输入账号', 
+							trigger: ['change','blur'],
+						}
+					],
+					password: [
+						{ 
+							required: true, 
+							message: '请输入密码', 
+							trigger: ['change','blur'],
+						}
+					],
+				}
+			}
+		},
+		onReady() {
+			this.$refs.uForm.setRules(this.rules);
+		},
+		onLoad() {
+			 if (this.$cache.get('mallList')) {
+			 	uni.reLaunch({
+			 		url:"/pages/index/index"
+			 	})
+			 }
+		},
+		methods: {
+			login() {
+				this.$refs.uForm.validate(valid => {
+					if (valid) {
+						this.$dialog.showLoading('登录中..')
+						setTimeout(()=>{
+							this.doLogin()
+						},500)
+					}
+				});
+			},
+			async doLogin(){
+				let params={
+					phone:this.form.phone
+				}
+				let res=await this.$api.mall.getListByPhone(params)
+				if (this.$isEmpty(res.data)){
+					this.$u.toast('账号或者密码错误!')
+					return
+				}else{
+					this.$cache.put('mallList',res.data)
+					uni.reLaunch({
+						url:"/pages/index/index"
+					})
+				}
+				uni.hideLoading()
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	$color:#d18c42;
+	
+	page{
+		background-color: #FFFFFF;
+	}
+	
+	.btn{
+		background-color: $color;
+		color:#FFFFFF;
+	}
+	
+	.bg{
+		z-index: 99;
+		height: 440rpx;
+		width: 440rpx;
+		position: absolute;
+		right: -240rpx;
+		top: -240rpx;
+		background-color: #d18c42;
+		border-radius: 50%;
+		box-shadow: 0rpx 0rpx 50rpx #c5803b;
+	}
+	
+	.bg1{
+		height: 500rpx;
+		width: 500rpx;
+		position: absolute;
+		right: -240rpx;
+		top: -240rpx;
+		background-color: #d18c42;
+		border-radius: 50%;
+		box-shadow: #c6813b;
+	}
+	
+	.content{
+		height: 84vh;
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		
+		.top{
+			display: flex;
+			.logo{
+				background-color: $color;
+				width: 160rpx;
+				height: 160rpx;
+				border-radius: 40rpx;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				
+				image{
+					width: 100rpx;
+					height: 100rpx;
+				}
+			}
+			
+			.title{
+				margin-right: 20rpx;
+				display: flex;
+				flex-direction: column;
+				text-align: left;
+				
+				text:first-child{
+					font-size: 46rpx;
+					color: #000;
+					margin-bottom: 20rpx;
+				}
+				
+				text:last-child{
+					font-size: 28rpx;
+					color: #7f7f7f;
+				}
+			}
+			
+			
+		}
+	}
+</style>

+ 180 - 0
pages/login/forget.vue

@@ -0,0 +1,180 @@
+<template>
+	<view style="position: relative;">
+		<view class="bg"></view>
+		<view class="bg1"></view>
+		<view class="back" @click="$back">
+			<u-icon name="arrow-left" size="50" color="#919191"></u-icon>
+		</view>
+		
+		<view class="content">
+			<view class="top">
+				<view class="title">
+					<text>忘记登录密码</text>
+					<text>输入手机号进行找回密码</text>
+				</view>
+			</view>
+			
+			<view  style="width: 76%;margin-top: 80rpx;">
+				<u-form >
+					<u-form-item    label="手机号" prop="phone" label-width="150">
+						<view style="border-bottom: 1rpx solid #DDDDDD;">
+							<u-input :border="false" placeholder="请输入手机号" v-model="phone" type="number"></u-input>
+						</view>
+					</u-form-item>
+					<u-form-item    label="验证码" prop="code" label-width="150">
+						<view class="flex" style="border-bottom: 1rpx solid #DDDDDD;">
+							<u-input style="width: 100%;" :border="false" placeholder="请输入验证码" v-model="code" type="text"></u-input>
+							<u-button shape="circle" slot="right" :custom-style="customStyle" size="mini" @click="getCode">{{codeTips}}</u-button>
+						</view>
+					</u-form-item>
+					<u-form-item    label="密码" prop="phone" label-width="150">
+						<view style="border-bottom: 1rpx solid #DDDDDD;">
+							<u-input :border="false" placeholder="请设置新的登录密码" v-model="phone" type="number"></u-input>
+						</view>
+					</u-form-item>
+					<u-form-item    label="确认密码" prop="phone" label-width="150">
+						<view style="border-bottom: 1rpx solid #DDDDDD;">
+							<u-input :border="false" placeholder="请再次输入密码" v-model="phone" type="number"></u-input>
+						</view>
+					</u-form-item>
+				</u-form>
+			</view>
+			
+			<view  style="width: 86%;margin-top: 80rpx;">
+				<view @click="login" class="btn cu-btn round" style="width:100%;height: 90rpx;font-size: 34rpx;">
+					确认修改并登录
+				</view>
+			</view>
+		</view>
+		
+		<u-verification-code seconds="60" ref="uCode" @change="codeChange"></u-verification-code>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				customStyle:{
+					'backgroundColor':'#d18c42',
+					'color':'#ffffff'
+				},
+				codeTips: '',
+				phone:'',
+				code:'',
+			}
+		},
+		methods: {
+			login(){
+				uni.reLaunch({
+					url:"/pages/index/index"
+				})
+			},
+			codeChange(text) {
+				this.codeTips = text;
+			},
+			// 获取验证码
+			getCode() {
+				if(this.$refs.uCode.canGetCode) {
+					// 模拟向后端请求验证码
+					uni.showLoading({
+						title: '正在获取验证码',
+						mask: true
+					})
+					setTimeout(() => {
+						uni.hideLoading();
+						// 这里此提示会被this.start()方法中的提示覆盖
+						this.$u.toast('验证码已发送');
+						// 通知验证码组件内部开始倒计时
+						this.$refs.uCode.start();
+					}, 2000);
+				} else {
+					this.$u.toast('倒计时结束后再发送');
+				}
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	$color:#d18c42;
+	
+	page{
+		background-color: #FFFFFF;
+	}
+	
+	.btn{
+		background-color: $color;
+		color:#FFFFFF;
+	}
+	
+	.btn{
+		background-color: $color;
+		color:#FFFFFF;
+	}
+	
+	.bg{
+		z-index: 99;
+		height: 440rpx;
+		width: 440rpx;
+		position: absolute;
+		right: -240rpx;
+		top: -240rpx;
+		background-color: #d18c42;
+		border-radius: 50%;
+		box-shadow: 0rpx 0rpx 50rpx #c5803b;
+	}
+	
+	.bg1{
+		height: 500rpx;
+		width: 500rpx;
+		position: absolute;
+		right: -240rpx;
+		top: -240rpx;
+		background-color: #d18c42;
+		border-radius: 50%;
+		box-shadow: #c6813b;
+	}
+	
+	.back{
+		position: absolute;
+		top: var(--status-bar-height);
+		left: 20rpx;
+		padding-top: var(--status-bar-height);
+	}
+	
+	.content{
+		height: 90vh;
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		
+		.top{
+			width: 76%;
+			display: flex;
+			.title{
+				margin-right: 20rpx;
+				display: flex;
+				flex-direction: column;
+				justify-content: center;
+				align-items: flex-start;
+				text-align: left;
+				
+				text:first-child{
+					font-weight: 800;
+					font-size: 60rpx;
+					color: #000;
+					margin-bottom: 20rpx;
+				}
+				
+				text:last-child{
+					font-size: 28rpx;
+					color: #7f7f7f;
+				}
+			}
+			
+			
+		}
+	}
+</style>

+ 256 - 0
pages/login/login.vue

@@ -0,0 +1,256 @@
+<template>
+	<view style="position: relative;">
+		<view class="bg"></view>
+		<view class="bg1"></view>
+		<view class="back" @click="$back">
+			<u-icon name="arrow-left" size="50" color="#919191"></u-icon>
+		</view>
+
+		<view class="content">
+			<view class="top">
+				<view class="logo">
+					<image src="@/static/icon/logo.png" mode=""></image>
+				</view>
+				<view class="title">
+					<text>欢迎进入联兑通</text>
+					<text>输入手机号快捷登录</text>
+				</view>
+			</view>
+
+			<view style="width: 76%;margin-top: 80rpx;">
+				<u-form ref="uForm" label-width="150" :model="form" label-position="top" :error-type="['message']">
+					<u-form-item   label="手机号" prop="phone"
+						label-width="150">
+						<view style="border-bottom: 1rpx solid #DDDDDD;">
+							<u-input :border="false" placeholder="请输入手机号" v-model="form.phone" type="number"></u-input>
+						</view>
+					</u-form-item>
+					<u-form-item  label="验证码" prop="code" >
+						<view class="flex" style="border-bottom: 1rpx solid #DDDDDD;">
+							<u-input style="width: 100%;" :border="false" placeholder="请输入验证码" v-model="form.code"
+								type="text"></u-input>
+							<u-button shape="circle" slot="right" :custom-style="customStyle" size="mini"
+								@click="getCode">{{codeTips}}</u-button>
+						</view>
+					</u-form-item>
+				</u-form>
+			</view>
+
+			<view style="width: 86%;margin-top: 80rpx;">
+				<view @click="login" class="btn cu-btn round" style="width:100%;height: 90rpx;font-size: 34rpx;">
+					立即登录
+				</view>
+				<view class="center" style="margin-top: 100rpx;">
+					<text style="color: #949494;">登录即代表已阅读并同意</text>
+					<text style="color: #0000ff;">《软件服务协议》</text>
+				</view>
+			</view>
+		</view>
+
+		<u-verification-code seconds="60" ref="uCode" @change="codeChange"></u-verification-code>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				customStyle: {
+					'backgroundColor': '#d18c42',
+					'color': '#ffffff'
+				},
+				codeTips: '',
+				form:{
+					phone:'19124812874',
+					code:''
+				},
+				rules: {
+					phone: [{
+						required: true,
+						message: '请输入账号',
+						trigger: ['change', 'blur'],
+					}],
+					code: [{
+						required: true,
+						message: '请输入验证码',
+						trigger: ['change', 'blur'],
+					}],
+				}
+			}
+		},
+		onReady() {
+			this.$refs.uForm.setRules(this.rules);
+		},
+		methods: {
+			login() {
+				this.$refs.uForm.validate(valid => {
+					if (valid) {
+						this.$dialog.showLoading('登录中..')
+						setTimeout(()=>{
+							this.doLogin()
+						},500)
+					}
+				});
+			},
+			async doLogin(){
+				let flag=await this.verifyCode()
+				if (!flag) {
+					return
+				}
+				let params={
+					phone:this.form.phone
+				}
+				let res=await this.$api.mall.getListByPhone(params)
+				if (this.$isEmpty(res.data)){
+					this.$u.toast('账号或者密码错误!')
+					return
+				}else{
+					this.$cache.put('mallList',res.data)
+					uni.reLaunch({
+						url:"/pages/index/index"
+					})
+				}
+				uni.hideLoading()
+			},
+			codeChange(text) {
+				this.codeTips = text;
+			},
+			async verifyCode(){
+				let p=this.$u.queryParams(this.form)
+				let res=await this.$api.sms.validCode(p)
+				if (res.data == "success") {
+					return true
+				}else{
+					this.$u.toast(res.data)
+					return false
+				}
+			}, 
+			// 获取验证码
+			getCode() {
+				if (this.$isEmpty(this.form.phone)) {
+					this.$u.toast('请输入手机号')
+					return
+				}
+				if (this.$refs.uCode.canGetCode) {
+					// 模拟向后端请求验证码
+					uni.showLoading({
+						title: '正在获取验证码',
+						mask: true
+					})
+					setTimeout(() => {
+						uni.hideLoading();
+						let params={
+							phone:this.form.phone
+						}
+						let p=this.$u.queryParams(params)
+						this.$api.sms.send(p).then(res=>{
+							if (res.data=="success") {
+								this.$u.toast('验证码已发送');
+								// 通知验证码组件内部开始倒计时
+							}else{
+								this.$u.toast(res.data);
+							}
+							this.$refs.uCode.start();
+						})
+					}, 2000);
+				} else {
+					this.$u.toast('倒计时结束后再发送');
+				}
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	$color:#d18c42;
+
+	page {
+		background-color: #FFFFFF;
+	}
+
+	.btn {
+		background-color: $color;
+		color: #FFFFFF;
+	}
+
+	.bg {
+		z-index: 99;
+		height: 440rpx;
+		width: 440rpx;
+		position: absolute;
+		right: -240rpx;
+		top: -240rpx;
+		background-color: #d18c42;
+		border-radius: 50%;
+		box-shadow: 0rpx 0rpx 50rpx #c5803b;
+	}
+
+	.bg1 {
+		height: 500rpx;
+		width: 500rpx;
+		position: absolute;
+		right: -240rpx;
+		top: -240rpx;
+		background-color: #d18c42;
+		border-radius: 50%;
+		box-shadow: #c6813b;
+	}
+
+	.back {
+		position: absolute;
+		top: var(--status-bar-height);
+		left: 20rpx;
+		padding-top: var(--status-bar-height);
+	}
+
+	.content {
+		height: 90vh;
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+
+		.top {
+			display: flex;
+
+			.logo {
+				background-color: $color;
+				width: 130rpx;
+				height: 130rpx;
+				border-radius: 30rpx;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				margin-right: 20rpx;
+
+				image {
+					width: 90rpx;
+					height: 90rpx;
+				}
+			}
+
+			.title {
+				margin-right: 20rpx;
+				display: flex;
+				flex-direction: column;
+				justify-content: center;
+				align-items: flex-start;
+				text-align: left;
+
+				text:first-child {
+					font-weight: 800;
+					font-size: 50rpx;
+					color: #000;
+					margin-bottom: 20rpx;
+				}
+
+				text:last-child {
+					font-size: 28rpx;
+					color: #7f7f7f;
+				}
+			}
+
+
+		}
+	}
+</style>

+ 132 - 45
pages/publish/detail.vue

@@ -2,63 +2,73 @@
 	<view class="safe-area-inset-bottom">
 		<my-bar title="发布活动" :transparent="transparent">
 			<view slot="content" class="publish">
-				<image src="@/static/del/del1.png" style="height: 380rpx;width: 100%;" ></image>
+				<image :src="detail.pic" style="height: 380rpx;width: 100%;"></image>
 			</view>
 		</my-bar>
 		<view class="clock">
-			<view class="cu-btn round sm" style="background-color: #dcdcdc;">
+			<!-- <view class="cu-btn round sm" style="background-color: #dcdcdc;">
 				<u-icon name="clock"></u-icon>
 				<text class="margin-left-10">设置响应倒计时</text>
 			</view>
 			<view class="tips">
 				<text>*</text>
 				<text>如未在限定时间内响应,系统默认自动推送给旗下商户。</text>
-			</view>
+			</view> -->
 		</view>
-		
+
 		<view class="content">
-			<text class="title" >消费新势能老品牌向新网红的跃迁之路一新消费品牌创造营广州食饮专场</text>
+			<text class="title">{{detail.title}}</text>
 			<view class="data" style="margin-top: 30rpx;">
 				<u-icon name="clock"></u-icon>
-				<text  class="margin-left-10">06/24 14:00 - 17:30</text>
+				<text class="margin-left-10">{{detail.beginTime | date('mm/dd hh:MM:ss')}} 至 {{detail.endTime | date('mm/dd hh:MM:ss')}}</text>
 			</view>
 			<view class="data">
 				<u-icon name="map"></u-icon>
-				<text  class="margin-left-10">仅限全天河区内报名</text>
+				<text class="margin-left-10">仅限全天河区内报名</text>
 			</view>
 			<view class="data flex">
 				<view class="flex">
 					<u-icon name="grid"></u-icon>
-					<text  class="margin-left-10">餐饮类</text>
+					<text class="margin-left-10">{{detail.labelNames}}</text>
 				</view>
 				<view class="flex margin-left-50">
 					<u-icon name="bag"></u-icon>
-					<text  class="margin-left-10">活动供应价80%</text>
+					<text class="margin-left-10">活动供应价{{detail.supplyPrice}}%</text>
 				</view>
 			</view>
 			<view class="data">
-				<u-icon name="coupon"></u-icon>
-				<text  class="margin-left-10">联营积分全场通用</text>
+				<u-icon name="home-fill"></u-icon>
+				<text class="margin-left-10">联营积分全场通用</text>
 			</view>
 		</view>
 		
+		<view class="intro" v-if="current==1">
+			<view class="flex">
+				<u-icon name="coupon"></u-icon>
+				<text class="margin-left-10">商场活动补贴</text>
+			</view>
+			<view class="desc" style="display: flex;border-bottom: 1rpx solid #DDDDDD;align-items: center;">
+				<u-input v-model="value" placeholder="请输入折扣" style="width: 90%;"/>
+				<text class="padding-left-20">%</text>
+			</view>
+		</view>
+
 		<view class="intro">
 			<view class="flex">
 				<u-icon name="bookmark"></u-icon>
 				<text class="margin-left-10">活动介绍</text>
 			</view>
 			<view class="desc">
-				2021年爆发生长了一大批新消费食饮品牌,食品饮料赛道也频频传出新品牌融资、上市的故事,新人群、新渠道、新营销崛起,让新品类、新产品得以迅速切入巿场。
-				那么经典品牌如何快速打入新人群、投入新渠道,玩转新营销.Topcamp新消费品牌创造营--广州食饮专场会给到你答案。
+				{{detail.detail}}
 			</view>
 		</view>
-		
+
 		<view class="attend">
 			<view class="margin-bottom-20">
 				<u-icon name="calendar-fill"></u-icon>
 				<text class="margin-left-10">已参加</text>
 			</view>
-			
+
 			<view class="flex">
 				<view class="flex " style="width: 90%;">
 					<view class="data" v-for="(item,index) in 3" :key="index">
@@ -76,10 +86,21 @@
 				</view>
 			</view>
 		</view>
-		
-		<view class="center" style="margin:50rpx 0rpx 20rpx;">
+
+		<view @click="operate" class="center" style="margin:50rpx 0rpx 20rpx;">
 			<view class="cu-btn btn-bg-color" style="width: 90%;height: 86rpx;border-radius: 12rpx;">
-				已通过
+				<block v-if="current==0">
+					<text v-if="detail.auditStatus==0">待审核</text>
+					<text v-if="detail.auditStatus==1">审核通过</text>
+					<text v-if="detail.auditStatus==2">审核不通过</text>
+					<text v-if="detail.auditStatus==3">已停用</text>
+				</block>
+				<block v-if="current==1">
+					<text>参加活动</text>
+				</block>
+				<block v-if="current==2">
+					<text>退出活动</text>
+				</block>
 			</view>
 		</view>
 	</view>
@@ -106,12 +127,75 @@
 		},
 		data() {
 			return {
-				transparent:'',
-				name:'星巴克'
+				id: '',
+				current: 0, //0 发起活动详情,1可参加活动详情,2已参加活动详情
+				transparent: '',
+				name: '星巴克',
+				detail: {}
 			}
 		},
+		onLoad(options) {
+			this.id = options.id
+			this.current = options.current || 0
+			if (!this.id) {
+				this.$u.toast('系统错误')
+				return
+			}
+			this.fetchDetail()
+		},
 		methods: {
+			fetchDetail() {
+				this.$api.activity.detail({
+					id: this.id
+				}).then(res => {
+					this.detail = res.data
+				})
+			},
+			operate() {
+				if (this.current == 0) {
+					return
+				}
+				if (this.current == 1) {
+					//参加活动
+					this.join()
+				} else if (this.current == 2) {
+					//退出活动
+					this.exit()
+				}
 
+			},
+			join() {
+				this.$dialog.showModal("确定参加?").then(res => {
+					let operateList = [{
+						activityId: this.id,
+						joinType: 1,
+						joinId: this.vuex_mallId
+					}]
+					this.$api.activity.join(operateList).then(res => {
+						if (res.success) {
+							this.$dialog.showModal("参加成功", false).then(() => {
+								this.$util.isReloadAndBack()
+							})
+						}
+					})
+				})
+			},
+			exit() {
+				this.$dialog.showModal("确定退出?").then(res => {
+					let operateList = [{
+						activityId: this.id,
+						joinType: 1,
+						joinId: this.vuex_mallId
+					}]
+					this.$api.activity.exit(operateList).then(res => {
+						if (res.success) {
+							this.$dialog.showModal("退出成功", false).then(() => {
+								this.$util.isReloadAndBack()
+							})
+						}
+					})
+				})
+			},
 		}
 	}
 </script>
@@ -128,7 +212,7 @@
 		width: 92%;
 		margin: 0 auto -120rpx;
 		border-radius: 10rpx;
-		box-shadow:0rpx 16rpx 8rpx -8rpx #a8a8a8;
+		box-shadow: 0rpx 16rpx 8rpx -8rpx #a8a8a8;
 
 		display: flex;
 		justify-content: center;
@@ -140,79 +224,82 @@
 			color: #797979;
 		}
 	}
-	
+
 	.clock {
 		background-color: #FFFFFF;
-		height: 240rpx;
+		height: 120rpx;
 		padding-bottom: 20rpx;
-	
+
 		display: flex;
 		flex-direction: column;
 		justify-content: flex-end;
 		align-items: center;
-	
+
 		.tips {
 			margin-top: 10rpx;
 			font-size: 24rpx;
 			color: #FF9447;
 		}
 	}
-	
-	.content{
+
+	.content {
 		padding: 15rpx 30rpx;
 		background-color: #FFFFFF;
-		
-		.title{
+
+		.title {
 			line-height: 50rpx;
 			font-weight: 800;
 			font-size: 32rpx;
 		}
-		
-		.data{
+
+		.data {
 			margin: 20rpx 0;
 			color: #787878;
 		}
 	}
-	
-	.intro{
+
+	.intro {
 		margin-top: 15rpx;
 		padding: 15rpx 30rpx;
 		background-color: #FFFFFF;
-		
-		.desc{
+
+		.desc {
 			color: #9a9a9a;
 			margin-top: 20rpx;
 			line-height: 46rpx;
 			font-size: 28rpx;
 		}
 	}
-	
-	.attend{
+
+	.attend {
 		margin-top: 15rpx;
 		padding: 15rpx 0 15rpx 30rpx;
 		background-color: #FFFFFF;
-		
-		.data{
+
+		.data {
 			margin: 10rpx 20rpx 10rpx 0;
-			$width:80rpx;
-			.item{
+			$width: 80rpx;
+
+			.item {
 				width: 190rpx;
 				height: $width;
 				background-color: #eeeeee;
 				border-radius: 50rpx;
 				display: flex;
-				image{
+
+				image {
 					width: $width;
 					height: $width;
 				}
-				view{
+
+				view {
 					padding-left: 10rpx;
 					display: flex;
 					flex-direction: column;
 					justify-content: center;
 					font-size: 22rpx;
-					
-					text:first-child{
+
+					text:first-child {
 						font-weight: 800;
 						margin-bottom: 4rpx;
 					}

+ 191 - 81
pages/publish/publish.vue

@@ -1,85 +1,90 @@
 <template>
 	<view>
 		<my-bar title="发布活动" :transparent="transparent">
-			<view slot="content"  class="publish" @click="chooseImage">
-				<block v-if="!form.image">
+			<view slot="content" class="publish" @click="chooseImage">
+				<block v-if="!form.pic">
 					<u-icon name="photo" size="100" color="#cecece"></u-icon>
 					<text>上传活动封面</text>
 				</block>
-				<image  :src="form.image"  style="height: 380rpx;" v-else mode="heightFix"></image>
+				<image :src="form.pic" style="height: 380rpx;" v-else mode="heightFix"></image>
 			</view>
 		</my-bar>
 
 		<view class="clock">
-			<view class="cu-btn round sm" style="background-color: #dcdcdc;">
+			<!-- <view class="cu-btn round sm" style="background-color: #dcdcdc;">
 				<u-icon name="clock"></u-icon>
 				<text class="margin-left-10">设置响应倒计时</text>
 			</view>
 			<view class="tips">
 				<text>*</text>
 				<text>如未在限定时间内响应,系统默认自动推送给旗下商户。</text>
-			</view>
+			</view> -->
 		</view>
 
 		<view class="form">
-			<u-form :model="form" ref="uForm" label-width="140">
-				<u-form-item label="标题" left-icon="bookmark">
-					<u-input v-model="form.name" placeholder="请输入标题"/>
+			<u-form :model="form" :error-type="['message']" :rules="rules" ref="uForm" label-width="140">
+				<u-form-item prop="title" label="标题" left-icon="bookmark">
+					<u-input v-model="form.title" placeholder="请输入标题" />
+				</u-form-item>
+				<u-form-item label="地区" prop="address" left-icon="map">
+					<u-input type="select" :select-open="regionShow" v-model="form.address" placeholder="请选择地区"
+						@click="regionShow = true"></u-input>
 				</u-form-item>
-				<u-form-item label="地址" left-icon="map">
-					<u-input v-model="form.intro" placeholder="请输入地址"/>
+				<u-form-item v-if="form.address" prop="title" label="详细地址">
+					<u-input v-model="addressDetail" placeholder="请输入详细地址" />
 				</u-form-item>
-				<u-form-item label-width="200" label="建议供应价" left-icon="rmb-circle">
+				<u-form-item prop="supplyPrice" label-width="250" label="建议供应价" left-icon="rmb-circle">
 					<view class="flex justify-between">
-						<u-input v-model="form.intro" placeholder="请输入建议供应价"/>
+						<u-input v-model="form.supplyPrice" placeholder="请输入建议供应价" />
 						<text style="color: #737373;">(%)</text>
 					</view>
 				</u-form-item>
-				<u-form-item  @click="showCheckBox" label-width="200" label="行业类目" left-icon="grid" >
-					<view @click="checkboxShow=true" class="flex justify-between "  >
+				<u-form-item prop="labelIds" @click="showCheckBox" label-width="200" label="行业类目" left-icon="grid">
+					<view @click="checkboxShow=true" class="flex justify-between ">
 						<view @click.stop="" style="display: flex;flex-direction: column;justify-content: center;">
 							<u-checkbox-group>
-								<u-checkbox v-model="item.checked" v-if="index<=1" v-for="(item, index) in checkboxList" :key="index"
-									:name="item.name">
+								<u-checkbox @change="checkboxChange" v-model="item.checked" v-if="index<=1"
+									v-for="(item, index) in checkboxList" :key="index" :name="index">
 									{{ item.name }}
 								</u-checkbox>
 							</u-checkbox-group>
 						</view>
-						<view >
+						<view>
 							<u-icon name="arrow-right" color="#737373"></u-icon>
 						</view>
 					</view>
 				</u-form-item>
-				
-				<u-form-item  label="时间" left-icon="clock">
-					<view class="flex ">
-						<u-input type="select" @click="timeShow=true;timeType=1" v-model="form.startTime" placeholder="开始时间"/>
-						<text style="margin: 0 40rpx;">至</text>
-						<u-input type="select" @click="timeShow=true;timeType=2" v-model="form.endTime" placeholder="结束时间"/>
-					</view>
+
+				<u-form-item prop="beginTime" label="开始时间" left-icon="clock" label-width="180">
+					<u-input type="select" @click="timeShow=true;timeType=1" v-model="form.beginTime"
+						placeholder="请选择开始时间" />
 				</u-form-item>
-				<u-form-item label-width="200"	 label="活动补贴" left-icon="coupon">
+				<u-form-item prop="endTime" label="结束时间" left-icon="clock" label-width="180">
+					<u-input type="select" @click="timeShow=true;timeType=2" v-model="form.endTime"
+						placeholder="请选择结束时间" />
+				</u-form-item>
+				<u-form-item prop="subsidy" label-width="200" label="活动补贴" left-icon="coupon">
 					<view class="flex justify-between">
-						<u-input v-model="form.intro" placeholder="请输入折扣"/>
+						<u-input v-model="form.subsidy" placeholder="请输入折扣" />
 						<text style="color: #737373;">(%)</text>
 					</view>
 				</u-form-item>
-				<u-form-item label-width="200" label="积分通兑" left-icon="coupon">
-					<u-input v-model="form.intro" placeholder="100 积分 = 10 元"/>
+				<u-form-item prop="hundredPointValue" label-width="200" label="积分通兑" left-icon="coupon">
+					<u-input v-model="form.hundredPointValue" placeholder="100 积分 = ? 元" />
 				</u-form-item>
-				</u-form>
+			</u-form>
 		</view>
-		
+
 		<view class="form">
-			<u-form label-position="top" :model="form" ref="uForm" label-width="160">
+			<u-form label-position="top" label-width="160">
 				<u-form-item label-width="200" label="活动详情" left-icon="coupon">
-					<u-input type="area" height="150" v-model="form.intro" placeholder="不少于100字"/>
+					<u-input type="area" height="150" v-model="form.detail" placeholder="不少于100字" />
 				</u-form-item>
 			</u-form>
 		</view>
-		
+
 		<view class="center" style="margin: 50rpx 0;">
-			<view class="flex flex-direction" style="width: 94%;">
+			<view @click="publish" class="flex flex-direction" style="width: 94%;">
 				<view class="radius cu-btn btn-bg-color" style="height: 90rpx;">
 					提交审核
 				</view>
@@ -89,19 +94,20 @@
 				</view>
 			</view>
 		</view>
-		
+
 		<u-popup v-model="checkboxShow" mode="bottom" height="50%" border-radius="12">
 			<view class="padding-30">
 				<u-checkbox-group>
-					<u-checkbox v-model="item.checked"  v-for="(item, index) in checkboxList" :key="index"
-						:name="item.name">
+					<u-checkbox @change="checkboxChange" v-model="item.checked" v-for="(item, index) in checkboxList"
+						:key="index" :name="index">
 						{{ item.name }}
 					</u-checkbox>
 				</u-checkbox-group>
 			</view>
 		</u-popup>
-		
-		<u-picker v-model="timeShow" mode="time" @confirm="timeConfirm"></u-picker>
+
+		<u-picker v-model="timeShow" mode="time" @confirm="timeConfirm" :params="params"></u-picker>
+		<u-picker mode="region" v-model="regionShow" @confirm="regionConfirm"></u-picker>
 	</view>
 </template>
 
@@ -113,56 +119,159 @@
 		},
 		data() {
 			return {
-				transparent:0,
+				transparent: 0,
 				form: {
-					image:''
+					pic: '',
+					title: '',
+					address: '',
+					supplyPrice: '',
+					labelIds: '',
+					beginTime: '',
+					endTime: '',
+					detail: '',
+					subsidy: '',
+					hundredPointValue: '',
+					sponsorType:1,
+					auditStatus:0
 				},
-				checkboxShow:false,
-				timeShow:false,
-				timeType:1,
-				checkboxList: [{
-						name: '餐饮业',
-						checked: false,
-					},
-					{
-						name: '服饰业',
-						checked: false,
-					},
-					{
-						name: '美妆业',
-						checked: false,
-					},
-					{
-						name: '机械业',
-						checked: false,
-					},
-					{
-						name: '日用业',
-						checked: false,
-					}
-				],
+				addressDetail: '',
+
+				checkboxShow: false,
+				timeShow: false,
+				timeType: 1,
+				params: {
+					year: true,
+					month: true,
+					day: true,
+					hour: true,
+					minute: true,
+					second: true
+				},
+				checkboxList: [],
+
+				regionShow: false,
+
+				rules: {
+					title: [{
+						required: true,
+						message: '请输入标题',
+						trigger: ['blur', 'change']
+					}],
+					address: [{
+						required: true,
+						message: '请选择地区',
+						trigger: 'change',
+					}],
+					beginTime: [{
+						required: true,
+						message: '请选择开始时间',
+						trigger: 'change',
+					}],
+					endTime: [{
+						required: true,
+						message: '请选择结束时间',
+						trigger: 'change',
+					}],
+					supplyPrice: [{
+						required: true,
+						message: '请输入建议供应价',
+						trigger: ['blur', 'change']
+					}],
+					subsidy: [{
+						required: true,
+						message: '请输入活动补贴',
+						trigger: ['blur', 'change']
+					}],
+					hundredPointValue: [{
+						required: true,
+						message: '请输入积分通兑',
+						trigger: ['blur', 'change']
+					}],
+
+				}
 			}
 		},
-		onPageScroll(obj){
-			this.transparent = obj.scrollTop*0.006;
+		onPageScroll(obj) {
+			this.transparent = obj.scrollTop * 0.006;
+		},
+		onReady() {
+			this.$refs.uForm.setRules(this.rules);
+		},
+		onLoad() {
+			this.getShopLabelByMallId()
 		},
 		methods: {
-			showCheckBox(){
-				console.log("1111");
-				this.checkboxShow=true
+			//显示多选框
+			showCheckBox() {
+				this.checkboxShow = true
 			},
-			timeConfirm(e){
-				let date=e.year +'-'+ e.month +'-'+e.day
-				if (this.timeType==1) {
-					this.form.startTime=date
-				}else{
-					this.form.endTime=date
+			//时间回调
+			timeConfirm(e) {
+				console.log(e);
+				let date = e.year + '-' + e.month + '-' + e.day+ ' ' + e.hour+ ':' + e.minute+ ':' + e.second
+				if (this.timeType == 1) {
+					this.form.beginTime = date
+				} else {
+					this.form.endTime = date
 				}
 			},
-			async chooseImage(){
-				let res=await this.$mpi.chooseImage()
-				this.form.image=res[0]
-				console.log(this.form.image);
+			//选择地址回调
+			regionConfirm(e) {
+				this.form.address = e.province.label + '-' + e.city.label + '-' + e.area.label;
+			},
+			//获取多选的标签
+			getShopLabelByMallId() {
+				this.$api.mall.getShopLabelByMallId(this.vuex_mallId).then(res => {
+					res.data.forEach(item => {
+						item.checked = false
+					})
+					this.checkboxList = res.data
+				})
+			},
+			//多选确认
+			checkboxChange(e) {
+				this.checkboxList[e.name].checked = e.value
+				this.$forceUpdate()
+			},
+			//选择图片
+			async chooseImage() {
+				let res = await this.$mpi.chooseImage()
+				this.$api.uploadFile(res[0]).then(res => {
+					this.form.pic = res.data.link
+				})
+			},
+			//确认发布
+			publish() {
+				this.$refs.uForm.validate(valid => {
+					if (valid) {
+						this.doPublish()
+					} else {
+						console.log('验证失败');
+					}
+				});
+			},
+			doPublish() {
+				if (!this.form.pic) {
+					this.$u.toast('请上传封面图')
+					return
+				}
+				let tmp = this.checkboxList.filter(item => item.checked == true).map(item => item.id)
+				this.form.labelIds = tmp.join(',')
+				if (!this.form.labelIds) {
+					this.$u.toast('请选择行业类目')
+					return
+				}
+				if (this.addressDetail) {
+					this.form.address = this.form.address + ' ' + this.addressDetail
+				}
+				this.form.sponsorId=this.vuex_mallId
+				this.$api.activity.publish(this.form).then(res=>{
+					if (res.success) {
+						this.$dialog.showModal('发布成功,请耐心等待平台审核',false).then(()=>{
+							this.$back()
+						})
+					}
+				})
 			}
 		}
 	}
@@ -194,7 +303,8 @@
 
 	.clock {
 		background-color: #FFFFFF;
-		height: 230rpx;
+		// height: 230rpx;
+		height: 130rpx;
 		padding-bottom: 20rpx;
 
 		display: flex;

+ 72 - 58
pages/stores/comps/card.vue

@@ -1,26 +1,30 @@
 <template>
 	<view class="">
 		<view class="cu-list menu-avatar">
-			<view @click="$jump('detail')" hover-class="none" style="margin: 15rpx 10rpx 15rpx 15rpx;border-radius: 20rpx 0 0 20rpx;padding: 10rpx;" class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"  v-for="(item,index) in 20" :key="index"
-			 @touchstart="ListTouchStart" @touchmove="ListTouchMove" @touchend="ListTouchEnd" :data-target="'move-box-' + index">
-				<view class="cu-avatar  xl" style="background-image: url(../../../static/del/del3.png);"></view>
+			<view @click="goDetail(item.id)" hover-class="none"
+				style="margin: 15rpx 10rpx 15rpx 15rpx;border-radius: 20rpx 0 0 20rpx;padding: 10rpx;" class="cu-item"
+				:class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in list" :key="index"
+				@touchstart="ListTouchStart" @touchmove="ListTouchMove" @touchend="ListTouchEnd"
+				:data-target="'move-box-' + index">
+				<view class="cu-avatar  xl" :style="'background-image: url('+item.cover+')'"></view>
 				<view class="content">
-					<view class="flex-direction flex">
-						<text class="text-cut-1" style="width: 96%;font-size: 32rpx;">茶百道(花城汇中区店)</text>
+					<view class="flex-direction flex">	
+						<text class="text-cut-1" style="width: 96%;font-size: 32rpx;">{{item.fullName}}</text>
 						<view class="" style="width: 96%;">
-							<text class="sub-title text-cut-1" >活动公告:桃里萄气,“莓”有烦恼!</text>
+							<text class="sub-title text-cut-1">{{item.slogan}}</text>
 						</view>
 					</view>
 					<view class="margin-bottom-10">
-						<view class="cu-tag tag-bg round sm" style="font-size: 24rpx;padding: 0rpx 40rpx;height: 40rpx;line-height: 42rpx;">
-							天河区A区
+						<view class="cu-tag tag-bg round sm"
+							style="font-size: 24rpx;padding: 0rpx 40rpx;height: 40rpx;line-height: 42rpx;">
+							{{item.mallAreaName}}
 						</view>
 					</view>
 				</view>
 				<!-- <view class="action">
 					<view class="cuIcon-right" style="color: #D2D2D2;"></view>
 				</view> -->
-				<view class="move" @click.stop="stop">
+				<view class="move" @click.stop="stop(item.id)">
 					<view class="bg-red">停用</view>
 				</view>
 			</view>
@@ -29,28 +33,35 @@
 </template>
 
 <script>
-	export default{
-		data(){
-			return{
+	export default {
+		props: {
+			list: Array
+		},
+		data() {
+			return {
 				listTouchStart: 0,
-				modalName:null
+				modalName: null
 			}
 		},
-		methods:{
-			stop(){
-				this.$u.toast('停用')
+		methods: {
+			stop(id) {
+				this.$emit('stop',id)
+			},
+			goDetail(id){
+				uni.navigateTo({
+					url:"/pages/stores/detail?id="+id
+				})
 			},
-			
 			// ListTouch触摸开始
 			ListTouchStart(e) {
 				this.listTouchStart = e.touches[0].pageX
 			},
-			
+
 			// ListTouch计算方向
 			ListTouchMove(e) {
 				this.listTouchDirection = e.touches[0].pageX - this.listTouchStart > 0 ? 'right' : 'left'
 			},
-			
+
 			// ListTouch计算滚动
 			ListTouchEnd(e) {
 				if (this.listTouchDirection == 'left') {
@@ -65,69 +76,72 @@
 </script>
 
 <style lang="scss" scoped>
-	.tag-bg{
+	.tag-bg {
 		background-color: #FFA66D;
 		color: #FFFFFF;
 	}
-	
+
 	.cu-list>.cu-item .move {
-	    position: absolute;
-	    right: 0rpx;
-	    display: -webkit-box;
-	    display: -webkit-flex;
-	    display: flex;
-	    width: 170rpx;
-	    height: 100%;
-	    -webkit-transform: translateX(100%);
-	    transform: translateX(100%);
+		position: absolute;
+		right: 0rpx;
+		display: -webkit-box;
+		display: -webkit-flex;
+		display: flex;
+		width: 170rpx;
+		height: 100%;
+		-webkit-transform: translateX(100%);
+		transform: translateX(100%);
 	}
-	
+
 	.cu-list.menu-avatar>.cu-item .content {
-	    position: absolute;
-	    left: 220rpx;
+		position: absolute;
+		left: 220rpx;
 		height: 90%;
-	    width: calc(100% - 96rpx - 60rpx - 100rpx - 20rpx);
+		width: calc(100% - 96rpx - 60rpx - 100rpx - 20rpx);
 		display: flex;
 		justify-content: space-between;
 		flex-direction: column;
 	}
+
 	.cu-list.menu-avatar>.cu-item .action {
-	    width: 60rpx;
-	    text-align: center;
+		width: 60rpx;
+		text-align: center;
 	}
-	
+
 	.cu-list.menu-avatar>.cu-item {
-	    position: relative;
-	    display: -webkit-box;
-	    display: -webkit-flex;
-	    display: flex;
-	    padding-right: 10rpx;
-	    height: 180rpx;
-	    background-color: #ffffff;
-	    -webkit-box-pack: end;
-	    -webkit-justify-content: flex-end;
-	    justify-content: flex-end;
-	    -webkit-box-align: center;
-	    -webkit-align-items: center;
-	    align-items: center;
+		position: relative;
+		display: -webkit-box;
+		display: -webkit-flex;
+		display: flex;
+		padding-right: 10rpx;
+		height: 180rpx;
+		background-color: #ffffff;
+		-webkit-box-pack: end;
+		-webkit-justify-content: flex-end;
+		justify-content: flex-end;
+		-webkit-box-align: center;
+		-webkit-align-items: center;
+		align-items: center;
 	}
-	
+
 	.cu-list>.cu-item.move-cur {
 		transform: translateX(-160upx)
 	}
+
 	.cu-list.menu-avatar>.cu-item>.cu-avatar {
-	    position: absolute;
-	    left: 10rpx;
+		position: absolute;
+		left: 10rpx;
 	}
+
 	.cu-avatar.xl {
 		border-radius: 10rpx;
-	    width: 200rpx;
+		width: 200rpx;
 		height: 90%;
 	}
-	
-	
-	
-	.sub-title{
+
+
+
+	.sub-title {
 		margin-top: 5rpx;
 		color: #6C6C6C;
 		font-size: 24rpx;

+ 17 - 9
pages/stores/detail.vue

@@ -2,28 +2,28 @@
 	<view>
 		<view class="card">
 			<view class="center" >
-				<image style="width: 140rpx;height: 140rpx;margin-top: -80rpx;border-radius: 50%;" src="../../static/del/del2.png" mode=""></image>
+				<image style="width: 140rpx;height: 140rpx;margin-top: -80rpx;border-radius: 50%;" :src="detail.cover" mode=""></image>
 			</view>
 			<view class="content">
 				<view class="item" >
 					<text >商户名称</text>
-					<text>星巴克</text>
+					<text>{{detail.fullName}}</text>
 				</view>
 				<view class="item" >
 					<text >手机号码</text>
-					<text>154****4122</text>
+					<text>{{detail.personTel}}</text>
 				</view>
 				<view class="item" >
 					<text >联系人</text>
-					<text>李建国</text>
+					<text>{{detail.personName}}</text>
 				</view>
 				<view class="item" >
 					<text >地址</text>
-					<text>广州市天河区</text>
+					<text>{{detail.address || '暂无数据'}}</text>
 				</view>
 				<view class="item" >
 					<text >行业</text>
-					<text>餐饮</text>
+					<text>{{detail.labelNames}}</text>
 				</view>
 			</view>
 		</view>
@@ -34,11 +34,11 @@
 		<view class="data-board">
 			<view class="content">
 				<view class="item">
-					<text>1660</text>
+					<text>{{detail.memberCount}}</text>
 					<text>会员数量</text>
 				</view>
 				<view class="item">
-					<text>1660</text>
+					<text>{{detail.totalPointValue}}</text>
 					<text>积分总价值</text>
 				</view>
 				<view class="item">
@@ -58,10 +58,18 @@
 	export default {
 		data() {
 			return {
+				detail:{}
 			}
 		},
+		onLoad(options) {
+			this.getDtail(options.id)
+		},
 		methods: {
-			
+			getDtail(id){
+				this.$api.shop.detail({id}).then(res=>{
+					this.detail=res.data
+				})
+			}
 		}
 	}
 </script>

+ 117 - 26
pages/stores/stores.vue

@@ -3,59 +3,150 @@
 		<u-navbar title=" " :border-bottom="false">
 			<view style="width: 100%;padding:0 20rpx;">
 				<view class="">
-					<u-search disabled :show-action="false" height="56"></u-search>
+					<u-search v-model="keyword"  :show-action="false" height="56"></u-search>
 				</view>
 			</view>
 		</u-navbar>
-		
-		
+
+
 		<view class="bg-white padding-20">
-			<u-tabs :list="list" active-color="#FF9447" :is-scroll="true" :current="current" @change="change"></u-tabs>
+			<u-tabs :list="tagsList" active-color="#FF9447" :is-scroll="true" :current="current" @change="change">
+			</u-tabs>
 			<view class="padding-top-10">
-			<scroll-view  scroll-x class="bg-white" style="white-space: nowrap;" scroll-with-animation >
-				<view v-for="(item,index) in 8" :key="index" class="cu-tag" style="border-radius: 12rpx;background-color: #F5F5F6;color: #6C6C6C;">
-					时尚天河
-				</view>
-			</scroll-view>
+				<scroll-view scroll-x class="bg-white" style="white-space: nowrap;" scroll-with-animation>
+					<view @click="selectArea(index)" v-for="(item,index) in areaList" :key="index" class="cu-tag"
+						:style="areaIndex==index?'background-color: #FFA66D;color: #FFFFFF;':'background-color: #F5F5F6;color: #6C6C6C;'"
+						style="border-radius: 12rpx;">
+						{{item.name}}
+					</view>
+				</scroll-view>
 			</view>
 		</view>
-		
-		<card></card>
+
+		<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption"
+			:up="upOption">
+			<card :list="list" @stop="stop"></card>
+		</mescroll-body>
+
 	</view>
 </template>
 
 <script>
+	import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
 	import card from "./comps/card.vue"
 	export default {
-		components:{
+		mixins: [MescrollMixin],
+		components: {
 			card
 		},
 		data() {
 			return {
-				list: [{
-					name: '饮品'
-				}, {
-					name: '可口食品'
-				}, {
-					name: '服饰',
-				}, {
-					name: '美妆',
-				}, {
-					name: '日用品',
-				}, {
-					name: '冰淇淋',
+				//区域id
+				mallAreaId: '',
+				labelId: '',
+				//商场店铺标签
+				tagsList: [{
+					name: '全部',
+					id: ''
 				}],
-				current: 0
+				current: 0,
+				//商场区域列表
+				areaList: [{
+					name: '全部',
+					id: ''
+				}],
+				//列表数据
+				list: [],
+				keyword:null,
+
+				areaIndex: 0
 			}
 		},
+		watch:{
+			keyword(){
+				let that=this
+				//节流函数
+				if (this.timer){
+					clearTimeout(this.timer)//阻止setTimeout函数的执行
+				}
+				this.timer = setTimeout(() => {
+					that.list=[]
+					this.mescroll.resetUpScroll();
+				}, 500)
+			},
+		},
+		onLoad() {
+			this.getShopLabelByMallId()
+			this.getMallAreaByMallId()
+		},
 		methods: {
+			stop(id) {
+				this.$dialog.showModal("确认停用该商户?").then(() => {
+					let params = {
+						id,
+						auditStatus: 3
+					}
+					this.$api.shop.stop(params).then(res => {
+						if (res.success) {
+							this.mescroll.resetUpScroll();
+						}
+					})
+				})
+			},
+			getShopLabelByMallId() {
+				this.$api.mall.getShopLabelByMallId(this.vuex_mallId).then(res => {
+					this.tagsList = this.tagsList.concat(res.data)
+				})
+			},
+			getMallAreaByMallId() {
+				this.$api.mall.getMallAreaByMallId(this.vuex_mallId).then(res => {
+					this.areaList = this.areaList.concat(res.data)
+				})
+			},
 			change(index) {
 				this.current = index;
+				this.labelId = this.tagsList[index].id
+				this.mescroll.resetUpScroll()
+			},
+			selectArea(index) {
+				this.areaIndex = index
+				this.mallAreaId = this.areaList[index].id
+				this.mescroll.resetUpScroll()
+			},
+			downCallback() {
+				setTimeout(() => {
+					this.mescroll.resetUpScroll();
+				}, 800)
+			},
+			upCallback(mescroll) {
+				if (!this.vuex_mallId) {
+					return
+				}
+				let params = {
+					fullName:this.keyword,
+					mallId: this.vuex_mallId,
+					auditStatus: 1,
+					labelId: this.labelId,
+					mallAreaId: this.mallAreaId,
+					current:mescroll.num,
+					size:mescroll.size,
+				}
+				try {
+					this.$api.mall.getShopList(params).then(res => {
+						let data = res.data.records
+						let total = res.data.total
+						mescroll.endBySize(data.length, total);
+						if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
+						this.list = this.list.concat(data); //追加新数据
+					})
+				} catch (e) {
+					this.mescroll.endErr()
+				}
 			}
 		}
 	}
 </script>
 
-<style>
+<style lang="scss" scoped>
 
 </style>

BIN
static/del/del4.png


BIN
static/icon/empty.png


BIN
static/icon/logo.png


BIN
static/icon/logout.png


BIN
static/logo.png


+ 2 - 1
store/index.js

@@ -12,7 +12,7 @@ try{
 }
 
 // 需要永久存储,且下次APP启动需要取出的,在state中的变量名
-let saveStateKeys = ['vuex_audit'];
+let saveStateKeys = ['vuex_audit','vuex_mallId'];
 
 // 保存变量到本地存储中
 const saveLifeData = function(key, value){
@@ -33,6 +33,7 @@ const store = new Vuex.Store({
 		// 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
 		// 加上vuex_前缀,是防止变量名冲突,也让人一目了然
 		vuex_audit: lifeData.vuex_audit ? lifeData.vuex_audit : 0,
+		vuex_mallId: lifeData.vuex_mallId ? lifeData.vuex_mallId : null,
 	},
 	mutations: {
 		$uStore(state, payload) {

+ 49 - 26
utils/mixin.js

@@ -2,32 +2,55 @@
  * 全局注入器
  */
 let page = {
-  data() {
-    return {
-		
-    }
-  },
-  computed: {
-    //ios底部安全区域
-    safeAreaBottom() {
-      let info = uni.getSystemInfoSync()
-      let safe = 20
-      if (
-        info &&
-        ['devtools', 'ios'].includes(info.platform) &&
-        info.statusBarHeight > safe
-      ) {
-        return info.statusBarHeight - safe + 'px'
-      }
-      return 0
-    }
-  },
-  methods: {
-    
-  },
-  onLoad(options) {
-	 
-  }
+	data() {
+		return {
+
+		}
+	},
+	computed: {
+		//ios底部安全区域
+		safeAreaBottom() {
+			let info = uni.getSystemInfoSync()
+			let safe = 20
+			if (
+				info && ['devtools', 'ios'].includes(info.platform) &&
+				info.statusBarHeight > safe
+			) {
+				return info.statusBarHeight - safe + 'px'
+			}
+			return 0
+		}
+	},
+	methods: {
+
+	},
+	onLoad(options) {
+		let currentPage = this.$util.getCurrentRoute()
+		//全局登录拦截
+		let WHiTE_LIST = ['pages/login/login',
+			'pages/login/forget',
+			'pages/login/account-login',
+			'pages/test/test',
+		]
+		if (!WHiTE_LIST.includes(currentPage)) {
+			if (!this.$cache.get('mallList')) {
+				uni.reLaunch({
+					url: "/pages/login/login"
+				})
+				return
+			}
+		}
+		//判断商场id是否为空
+		WHiTE_LIST.push('pages/index/index')
+		if (!WHiTE_LIST.includes(currentPage)) {
+			if (!this.vuex_mallId) {
+				uni.reLaunch({
+					url:"/pages/index/index"
+				})
+				return
+			}
+		}
+	}
 }
 
 export default page

+ 10 - 0
utils/util.js

@@ -105,6 +105,16 @@ util.isReloadAndBack = () => {
 		delta:1
 	})
 }
+
+//等待刷新页面
+util.waitReload = () => {
+    let prePage=util.getPageCtx(1)
+	prePage.setData({
+		"reload":true
+	})
+}
+
+
 //onshow方法通过刷新mescroll数据
 util.reload = (mescroll) => {
     let page= util.getPageCtx()