hmp 4 лет назад
Родитель
Сommit
32a10c0c13

+ 45 - 13
assets/http/api.js

@@ -2,24 +2,56 @@ 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={
+	//获取商场列表
+	list:p => http.get('cyzh-ldt/mall/list',{params:p}),
+	//获取商场区域
+	getMallAreaByMallId:p => http.get('cyzh-ldt/app/mall/getMallAreaByMallId?mallId='+p),
+	//获取标签
+	getShopLabelByMallId:p => http.get("cyzh-ldt/app/mall/getShopLabelByMallId?mallId="+p),
 }
 
-//园区api
-let agencyUrl={
-	page:'/agency/agency/getAgencyList',
-	submit:'/agency/agency/submit'
+//商户管理
+const shop={
+	//获取商户列表
+	list:p => http.get('cyzh-ldt/shop/list',{params:p}),
+	detail:p => http.get('cyzh-ldt/shop/detail',{params:p}),
+	submit:(p)=> http.post('cyzh-ldt/shop/submit',p),
+	statistic:p => http.get('cyzh-ldt/app/shop/statistic?shopId='+p),
 }
-const agency = {
-	page:p => http.get(agencyUrl.page, {params:p}),
-	submit:p => http.post(agencyUrl.submit, p),
+
+const memberCenter={
+	list:p => http.get('cyzh-ldt/app/shop/getMembersByShopId',{params:p}),
+	create:(p)=> http.post('cyzh-ldt/app/shop/createMemberCenter',p),
+}
+
+
+const activity={
+	publish:(p)=> http.post('/cyzh-ldt/activity/submit',p),
+	list:p => http.get("cyzh-ldt/app/shop/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/submit',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,
+	memberCenter,
+	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: '数据为空' // 提示
 		}
 	}

+ 9 - 0
pages.json

@@ -114,6 +114,15 @@
             }
             
         }
+        ,{
+            "path" : "pages/member/add",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "创建会员中心",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",

+ 97 - 24
pages/activity/activity.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="safe-area-inset-bottom">
-		<u-sticky style="margin-top: -4rpx;">
+		<u-sticky>
 			<view class="flex">
 				<view class="" style="width: 85%;">
 					<u-tabs active-color="#FF9447" :list="list" :is-scroll="false" :current="current" @change="change">
@@ -11,60 +11,133 @@
 				</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();
+						}
+					})
+				})
+			},
+			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,
+					sponsorId:this.vuex_shopId,
+					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')
 			}
 		}
 		

+ 156 - 105
pages/index/index.vue

@@ -7,19 +7,23 @@
 					<image src="@/static/icon/dianpu.png" mode=""></image>
 				</view>
 				<view class="center margin-left-10">
-					<text>店铺名称</text>
+					<view @click="shopShow=true">
+						<text class="name" >{{shopLable}}</text>
+						<u-icon v-if="shopShow" 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>
 			</view>
-			
-			<view class="cu-list grid col-3 no-border top-menu" >
-				<view class="cu-item"  @click="$jump(item.path)" v-for="(item,index) in menuList" :key="index">
-					<view class="grid-icon margin-top-20" >
-						<image  style="width: 66rpx;height: 66rpx;" :src="item.icon"/>
+
+			<view class="cu-list grid col-3 no-border top-menu">
+				<view class="cu-item" @click="$jump(item.path)" v-for="(item,index) in menuList" :key="index">
+					<view class="grid-icon margin-top-20">
+						<image style="width: 66rpx;height: 66rpx;" :src="item.icon" />
 					</view>
-					<text  style="color: #fff;font-size: 26rpx;" >{{item.name}}</text>
+					<text style="color: #fff;font-size: 26rpx;">{{item.name}}</text>
 				</view>
 			</view>
-			
+
 			<view class="menu-list">
 				<view @click="$jump('/pages/bill/bill')" class="menu menu1">
 					<view class="menu-top">
@@ -31,11 +35,11 @@
 					<view class="menu-bottom">
 						<view class="">
 							<text>今日营收</text>
-							<text>1888.00</text>
+							<text>{{statistic.todayIncome}}</text>
 						</view>
 						<view class="">
 							<text>总资产</text>
-							<text>1888.00</text>
+							<text>{{statistic.totalAccount}}</text>
 						</view>
 					</view>
 				</view>
@@ -49,44 +53,46 @@
 					<view class="menu-bottom">
 						<view class="">
 							<text>新增会员</text>
-							<text>888</text>
+							<text>{{statistic.todayMemberIn}}</text>
 						</view>
 						<view class="">
 							<text>会员总数</text>
-							<text>18888</text>
+							<text>{{statistic.memberCount}}</text>
 						</view>
 					</view>
 				</view>
 			</view>
-			
-			<view class="market" >
+
+			<view class="market">
 				<text class="title">营销管理</text>
-				<view class="cu-list grid col-2 no-border margin-top-30" >
-					<view class="cu-item"  @click="$jump(item.path)" v-for="(item,index) in marketList" :key="index">
+				<view class="cu-list grid col-2 no-border margin-top-30">
+					<view class="cu-item" @click="$jump(item.path)" v-for="(item,index) in marketList" :key="index">
 						<view class="center">
 							<view class="icon" :style="item.background">
 								<image :src="item.icon" mode=""></image>
 							</view>
 						</view>
-						<text  style="color: #222222;font-size: 26rpx;margin-top: 20rpx;" >{{item.name}}</text>
+						<text style="color: #222222;font-size: 26rpx;margin-top: 20rpx;">{{item.name}}</text>
 						<view class="cu-tag bg-red badge" v-if="item.count>0">{{item.count}}</view>
 					</view>
 				</view>
 			</view>
-			
+
 			<view class="system">
 				<text class="title">数字化系统</text>
 				<view class="cu-list grid col-4 no-border margin-top-30" style="border-radius:20rpx ;">
 					<view class="cu-item" @click="$jump(item.path)" v-for="(item,index) in systemList" :key="index">
-						<view class="grid-icon" >
-							<image mode="heightFix" style="height: 56rpx;" :src="item.icon"/>
+						<view class="grid-icon">
+							<image mode="heightFix" style="height: 56rpx;" :src="item.icon" />
 						</view>
-						<text  style="color: #222222;font-size: 26rpx;" >{{item.name}}</text>
+						<text style="color: #222222;font-size: 26rpx;">{{item.name}}</text>
 						<view class="cu-tag bg-red badge" v-if="item.count>0">{{item.count}}</view>
 					</view>
 				</view>
 			</view>
 		</view>
+		
+		<u-select @confirm="shopConfirm" v-model="shopShow" value-name="id" label-name="name" :list="shopList"></u-select>
 	</view>
 </template>
 
@@ -94,93 +100,131 @@
 	export default {
 		data() {
 			return {
-				menuList:[
-					{
-						icon:'/static/icon/scan.png',
-						name:'扫一扫',
-						path:'/pages/card/card'
+				//下拉选择商铺
+				shopShow:false,
+				//我的商铺列表
+				shopList:[],
+				//选中的商铺id
+				shopId:'',
+				//选中的商铺labe
+				shopLable:'',
+				//选中的商铺所属的商场
+				mallId:'',
+				
+				//统计数据
+				statistic:{},
+				
+				menuList: [{
+						icon: '/static/icon/scan.png',
+						name: '扫一扫',
+						path: '/pages/card/card'
 					},
 					{
-						icon:'/static/icon/pay.png',
-						name:'付款码',
-						path:'/pages/card/card'
+						icon: '/static/icon/pay.png',
+						name: '付款码',
+						path: '/pages/card/card'
 					},
 					{
-						icon:'/static/icon/card.png',
-						name:'卡包',
-						path:'/pages/card/card'
+						icon: '/static/icon/card.png',
+						name: '卡包',
+						path: '/pages/card/card'
 					}
 				],
-				marketList:[
-					{
-						icon:'/static/icon/publish.png',
-						name:'发起活动',
-						background:"background-image:linear-gradient(#FF9549,#FCB07B)",
-						path:'/pages/publish/publish',
-						count:0
+				marketList: [{
+						icon: '/static/icon/publish.png',
+						name: '发起活动',
+						background: "background-image:linear-gradient(#FF9549,#FCB07B)",
+						path: '/pages/publish/publish',
+						count: 0
 					},
 					{
-						icon:'/static/icon/list.png',
-						name:'活动清单',
-						background:"background-image:linear-gradient(#5892F7,#67BBF9)",
-						path:'/pages/activity/activity',
-						count:99
+						icon: '/static/icon/list.png',
+						name: '活动清单',
+						background: "background-image:linear-gradient(#5892F7,#67BBF9)",
+						path: '/pages/activity/activity',
+						count: 0
 					},
 				],
-				systemList:[
-					{
-						icon:'/static/icon/system1.png',
-						name:'外卖平台',
-						path:'/pages/mine/card/card'
+				systemList: [{
+						icon: '/static/icon/system1.png',
+						name: '外卖平台',
+						path: '/pages/mine/card/card'
 					},
 					{
-						icon:'/static/icon/system2.png',
-						name:'预约系统',
-						path:'/pages/mine/card/card'
+						icon: '/static/icon/system2.png',
+						name: '预约系统',
+						path: '/pages/mine/card/card'
 					},
 					{
-						icon:'/static/icon/system3.png',
-						name:'ERP系统',
-						path:'/pages/mine/card/card'
+						icon: '/static/icon/system3.png',
+						name: 'ERP系统',
+						path: '/pages/mine/card/card'
 					},
 					{
-						icon:'/static/icon/system4.png',
-						name:'线上商城',
-						path:'/pages/mine/card/card'
+						icon: '/static/icon/system4.png',
+						name: '线上商城',
+						path: '/pages/mine/card/card'
 					},
 					{
-						icon:'/static/icon/system5.png',
-						name:'门店管理',
-						path:'/pages/mine/card/card'
+						icon: '/static/icon/system5.png',
+						name: '门店管理',
+						path: '/pages/mine/card/card'
 					},
 					{
-						icon:'/static/icon/add.png',
-						name:'添加服务',
-						path:'/pages/mine/card/card'
+						icon: '/static/icon/add.png',
+						name: '添加服务',
+						path: '/pages/mine/card/card'
 					},
 				]
 			}
 		},
 		onLoad() {
-			
+			this.init()
 		},
 		methods: {
-
+			init() {
+				this.shopList = this.$cache.get('shopList')
+				let item=this.shopList[0]
+				this.shopId = item.id
+				this.shopLable = item.name
+				this.mallId=item.mallId
+				this.cacheSelectedShop()
+				this.getStatistic()
+			},
+			getStatistic(){
+				this.$api.shop.statistic(this.shopId).then(res=>{
+					this.statistic=res.data
+				})
+			},
+			cacheSelectedShop(item){
+				let selectedShop={
+					id:this.shopId,
+					label:this.shopLable
+				}
+				this.$cache.put("selectedShop",selectedShop)
+				this.$u.vuex('vuex_shopId',this.shopId)
+				this.$u.vuex('vuex_mallId',this.mallId)
+			},
+			shopConfirm(e){
+				this.mallId=e[0].value
+				this.mallLable=e[0].label
+				this.cacheSelectedShop()
+			},
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
-	
 	.cu-list.grid>.cu-item .cu-tag {
-	    right: auto;
-	    left: 54%;
-	    margin-left: 20rpx;
+		right: auto;
+		left: 54%;
+		margin-left: 20rpx;
 	}
-	
-	.title{
+
+	.title {
 		display: flex;
-		.icon{
+
+		.icon {
 			background-color: #FFFFFF;
 			border-radius: 50%;
 			display: flex;
@@ -188,58 +232,62 @@
 			align-items: center;
 			width: 50rpx;
 			height: 50rpx;
-			image{
+
+			image {
 				width: 36rpx;
 				height: 36rpx;
 			}
 		}
-		text{
+
+		text {
 			font-weight: 800;
 			font-size: 32rpx;
 			color: #303030;
 		}
 	}
-	
-	.top-menu{
+
+	.top-menu {
 		border-radius: 20rpx;
 		margin-top: 20rpx;
-		background-image: linear-gradient(to right,#FBA33D,#FF8D32);
+		background-image: linear-gradient(to right, #FBA33D, #FF8D32);
 	}
-	
-	.menu-list{
+
+	.menu-list {
 		display: flex;
 		justify-content: space-between;
-		padding-top: 20rpx;	
-		.menu{
+		padding-top: 20rpx;
+
+		.menu {
 			width: 48.8%;
 			color: #FFFFFF;
 			display: flex;
 			flex-direction: column;
 			align-items: center;
 			border-radius: 14rpx;
-			padding:30rpx 20rpx;
-			
-			.menu-top{
+			padding: 30rpx 20rpx;
+
+			.menu-top {
 				display: flex;
-				image{
+
+				image {
 					width: 70rpx;
 					height: 70rpx;
 				}
 			}
-			
-			.menu-bottom{
+
+			.menu-bottom {
 				padding-top: 20rpx;
 				font-size: 30rpx;
 				display: flex;
 				justify-content: space-around;
 				width: 100%;
-				
-				view{
+
+				view {
 					display: flex;
 					flex-direction: column;
 					text-align: center;
-					
-					text:first-child{
+
+					text:first-child {
 						margin-bottom: 10rpx;
 						font-size: 26rpx;
 						color: #E0E2F6;
@@ -247,25 +295,27 @@
 				}
 			}
 		}
-		
-		.menu1{
+
+		.menu1 {
 			background-color: #5C6186;
 		}
-		.menu2{
+
+		.menu2 {
 			background-color: #E19D5B;
 		}
 	}
-	
-	.market{
+
+	.market {
 		margin-top: 20rpx;
 		border-radius: 20rpx;
 		background-color: #FFFFFF;
 		padding: 30rpx 50rpx 20rpx;
-		.title{
+
+		.title {
 			font-weight: 800;
 		}
-		
-		.icon{
+
+		.icon {
 			width: 120rpx;
 			height: 120rpx;
 			display: flex;
@@ -273,20 +323,21 @@
 			align-items: center;
 			border-radius: 20rpx;
 			padding: 20rpx;
-			image{
+
+			image {
 				width: 60rpx;
 				height: 60rpx;
 			}
 		}
 	}
-	
-	.system{
+
+	.system {
 		margin-top: 20rpx;
 		border-radius: 20rpx;
 		background-color: #FFFFFF;
 		padding: 30rpx 50rpx 20rpx;
-		
-		.title{
+
+		.title {
 			font-weight: 800;
 		}
 	}

+ 64 - 15
pages/login/account-login.vue

@@ -10,31 +10,33 @@
 			</view>
 			
 			<view  style="width: 76%;margin-top: 30rpx;">
-				<u-form :model="form">
-					<u-form-item :rightIconStyle="{color: '#888', fontSize: '32rpx'}"  label-position="top" label="账号" prop="phone" label-width="150">
+				<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.account" type="number"></u-input>
+							<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="code" label-width="150">
+					<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 @click="$jump('/pages/login/login')" class="text-right margin-top-10 text-sm">
-					<text>手机号快捷登录</text>
+				<view  class="text-right margin-top-10 text-sm">
+					<text @click="$jump('/pages/login/login')" style="margin-left: 20rpx;text-decoration: underline;">手机号快捷登录</text>
 				</view>
 			</view>
 			
-			<view  style="width: 86%;margin-top: 80rpx;">
+			<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 class="flex justify-between margin-top-30 padding-20 text-sm">
-					<text @click="$jump('/pages/login/forget')">忘记密码</text>
-					<text @click="$jump('/pages/login/register')">注册账号</text>
+				
+				<view class="flex justify-between  text-sm" style="margin: 30rpx 30rpx 0;">
+					<text @click="$jump('/pages/login/forget')" >忘记密码</text>
+					<text @click="$jump('/pages/login/register')" >注册账号</text>
 				</view>
+			
 			</view>
 		</view>
 	</view>
@@ -49,16 +51,63 @@
 					'color':'#ffffff'
 				},
 				form:{
-					account:'',
+					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('shopList')) {
+			 	uni.reLaunch({
+			 		url:"/pages/index/index"
+			 	})
+			 }
+		},
 		methods: {
-			login(){
-				uni.reLaunch({
-					url:"/pages/index/index"
-				})
+			login() {
+				this.$refs.uForm.validate(valid => {
+					if (valid) {
+						this.$dialog.showLoading('登录中..')
+						setTimeout(()=>{
+							this.doLogin()
+						},500)
+					}
+				});
+			},
+			async doLogin(){
+				let params={
+					personTel:this.form.phone
+				}
+				let res=await this.$api.shop.list(params)
+				if (this.$isEmpty(res.data.records)){
+					this.$u.toast('账号或者密码错误!')
+					return
+				}else{
+					this.$cache.put('shopList',res.data.records)
+					uni.reLaunch({
+						url:"/pages/index/index"
+					})
+				}
+				uni.hideLoading()
 			}
 		}
 	}

+ 122 - 52
pages/login/login.vue

@@ -5,7 +5,7 @@
 		<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">
@@ -16,24 +16,27 @@
 					<text>输入手机号快捷登录</text>
 				</view>
 			</view>
-			
-			<view  style="width: 76%;margin-top: 80rpx;">
-				<u-form >
-					<u-form-item :rightIconStyle="{color: '#888', fontSize: '32rpx'}"  label-position="top" label="手机号" prop="phone" label-width="150">
+
+			<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="phone" type="number"></u-input>
+							<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="code" label-width="150">
+					<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="code" type="text"></u-input>
-							<u-button shape="circle" slot="right" :custom-style="customStyle" size="mini" @click="getCode">{{codeTips}}</u-button>
+							<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 style="width: 86%;margin-top: 80rpx;">
 				<view @click="login" class="btn cu-btn round" style="width:100%;height: 90rpx;font-size: 34rpx;">
 					立即登录
 				</view>
@@ -43,7 +46,7 @@
 				</view>
 			</view>
 		</view>
-		
+
 		<u-verification-code seconds="60" ref="uCode" @change="codeChange"></u-verification-code>
 	</view>
 </template>
@@ -52,27 +55,84 @@
 	export default {
 		data() {
 			return {
-				customStyle:{
-					'backgroundColor':'#d18c42',
-					'color':'#ffffff'
+				customStyle: {
+					'backgroundColor': '#d18c42',
+					'color': '#ffffff'
 				},
 				codeTips: '',
-				phone:'',
-				code:'',
+				form:{
+					phone:'',
+					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(){
-				uni.reLaunch({
-					url:"/pages/index/index"
-				})
+			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={
+					personTel:this.form.phone,
+					auditStatus:1 //审核通过
+				}
+				let res=await this.$api.shop.list(params)
+				if (this.$isEmpty(res.data.records)){
+					this.$u.toast('账号未注册!')
+					return
+				}else{
+					this.$cache.put('shopList',res.data.records)
+					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.$refs.uCode.canGetCode) {
+				if (this.$isEmpty(this.form.phone)) {
+					this.$u.toast('请输入手机号')
+					return
+				}
+				if (this.$refs.uCode.canGetCode) {
 					// 模拟向后端请求验证码
 					uni.showLoading({
 						title: '正在获取验证码',
@@ -80,10 +140,19 @@
 					})
 					setTimeout(() => {
 						uni.hideLoading();
-						// 这里此提示会被this.start()方法中的提示覆盖
-						this.$u.toast('验证码已发送');
-						// 通知验证码组件内部开始倒计时
-						this.$refs.uCode.start();
+						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('倒计时结束后再发送');
@@ -95,17 +164,17 @@
 
 <style lang="scss" scoped>
 	$color:#d18c42;
-	
-	page{
+
+	page {
 		background-color: #FFFFFF;
 	}
-	
-	.btn{
+
+	.btn {
 		background-color: $color;
-		color:#FFFFFF;
+		color: #FFFFFF;
 	}
-	
-	.bg{
+
+	.bg {
 		z-index: 99;
 		height: 440rpx;
 		width: 440rpx;
@@ -116,8 +185,8 @@
 		border-radius: 50%;
 		box-shadow: 0rpx 0rpx 50rpx #c5803b;
 	}
-	
-	.bg1{
+
+	.bg1 {
 		height: 500rpx;
 		width: 500rpx;
 		position: absolute;
@@ -127,24 +196,25 @@
 		border-radius: 50%;
 		box-shadow: #c6813b;
 	}
-	
-	.back{
+
+	.back {
 		position: absolute;
 		top: var(--status-bar-height);
 		left: 20rpx;
 		padding-top: var(--status-bar-height);
 	}
-	
-	.content{
+
+	.content {
 		height: 90vh;
 		display: flex;
 		flex-direction: column;
 		justify-content: center;
 		align-items: center;
-		
-		.top{
+
+		.top {
 			display: flex;
-			.logo{
+
+			.logo {
 				background-color: $color;
 				width: 130rpx;
 				height: 130rpx;
@@ -153,35 +223,35 @@
 				justify-content: center;
 				align-items: center;
 				margin-right: 20rpx;
-				
-				image{
+
+				image {
 					width: 90rpx;
 					height: 90rpx;
 				}
 			}
-			
-			.title{
+
+			.title {
 				margin-right: 20rpx;
 				display: flex;
 				flex-direction: column;
 				justify-content: center;
 				align-items: flex-start;
 				text-align: left;
-				
-				text:first-child{
+
+				text:first-child {
 					font-weight: 800;
 					font-size: 50rpx;
 					color: #000;
 					margin-bottom: 20rpx;
 				}
-				
-				text:last-child{
+
+				text:last-child {
 					font-size: 28rpx;
 					color: #7f7f7f;
 				}
 			}
-			
-			
+
+
 		}
 	}
 </style>

+ 70 - 21
pages/login/register.vue

@@ -13,29 +13,29 @@
 			</view>
 			
 			<view  style="width: 76%;margin-top: 80rpx;">
-				<u-form >
-					<u-form-item  label-position="top" label="手机号" prop="phone" label-width="150">
+				<u-form :model="form" ref="uForm" :rules="rules"  :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="phone" type="number"></u-input>
+							<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="code" label-width="150">
+					<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-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-item  label-position="top" label="密码" prop="phone" label-width="150">
+					<!-- <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="password" type="password"></u-input>
 						</view>
-					</u-form-item>
+					</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 @click="next" 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>
@@ -57,34 +57,83 @@
 					'color':'#ffffff'
 				},
 				codeTips: '',
-				phone:'',
-				password:'',
-				code:'',
+				form:{
+					phone:'',
+					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(){
-				uni.reLaunch({
-					url:"/pages/index/index"
+			next(){
+				this.$refs.uForm.validate(valid => {
+					if (valid) {
+						 this.doNext()
+					}
+				});
+			},
+			async doNext(){
+				let flag=await this.verifyCode()
+				if (!flag) {
+					return
+				}
+				uni.navigateTo({
+					url:"/pages/shop-info/shop-info?phone="+this.form.phone
 				})
 			},
 			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.$refs.uCode.canGetCode) {
+				if (this.$isEmpty(this.form.phone)) {
+					this.$u.toast('请输入手机号')
+					return
+				}
+				if (this.$refs.uCode.canGetCode) {
 					// 模拟向后端请求验证码
 					uni.showLoading({
 						title: '正在获取验证码',
 						mask: true
 					})
 					setTimeout(() => {
-						uni.hideLoading();
-						// 这里此提示会被this.start()方法中的提示覆盖
-						this.$u.toast('验证码已发送');
-						// 通知验证码组件内部开始倒计时
-						this.$refs.uCode.start();
+						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('倒计时结束后再发送');

+ 135 - 37
pages/member/member.vue

@@ -1,68 +1,166 @@
 <template>
 	<view>
-		<view class="top-menu">
-			<view class="">
-				<text>1600</text>
-				<text>会员数量</text>
-			</view>
+		<view class="empty-page" v-if="!isOpenMember">
+			<image src="../../static/icon/vip.png" mode=""></image>
+			<text>没有会员中心信息</text>
 
-			<view class="">
-				<text>1600.00</text>
-				<text>积分总价值</text>
+			<view class="cu-btn btn-bg-color round" style="width: 48%;height: 80rpx;position: fixed;bottom: 20%;">
+				<u-icon name="plus-circle" size="40"></u-icon>
+				<text class="margin-left-10 text-lg">创建会员中心</text>
 			</view>
 		</view>
-		<view class="padding-20 text-bold text-xl">
-			<text>会员列表</text>
-		</view>
 
-		<view class="card">
-			<view class="flex">
-				<view class="area1 title">
-					会员名称
+		<block v-else>
+			<view class="top-menu">
+				<view class="">
+					<text>{{detail.memberCount}}</text>
+					<text>会员数量</text>
 				</view>
-				<view class="area2 title">
-					积分数
-				</view>
-				<view class="area3 title">
-					价值
+
+				<view class="">
+					<text>{{detail.totalPointValue}}</text>
+					<text>积分总价值</text>
 				</view>
 			</view>
+			<view class="padding-20 text-bold text-xl">
+				<text>会员列表</text>
+			</view>
 
-			<view class="item" v-for="(item,index) in 4" :key="index">
-				<view class="area1 flex text-bold">
-					<image class="img-avatar" src="https://thirdwx.qlogo.cn/mmopen/vi_32/q6EwR5U6zFp8bYbUWb9HmFc5Q3R88x13Q0ZtOcVK5lO8AmtibQDRcuMA2Y7CmyuMCr6icceM3QibIKN2icAAxSvjpA/132"></image>
-					<view class="center padding-left-10">
-						<text>会员 123456</text>
+			<view class="card">
+				<view class="flex">
+					<view class="area1 title">
+						会员名称
+					</view>
+					<view class="area2 title">
+						积分数
+					</view>
+					<view class="area3 title">
+						价值
 					</view>
 				</view>
-				<view class="area2 center text-bold text-lg" style="justify-content: flex-start;margin-left: 10rpx;color: #F37A1E;">
-					<image class="img-points" src="../../static/icon/points-value.png"></image>
-					<text class="margin-left-10">-100</text>
-				</view>
-				
-				<view class="area3  center text-lg" >
-					<text class="text-price text-bold">10</text>
-				</view>
-			</view>
 
-		</view>
+				<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
+					:down="downOption" :up="upOption">
+					<view class="item" v-for="(item,index) in dataList" :key="index">
+						<view class="area1 flex text-bold">
+							<image class="img-avatar"
+								:src="item.avatar">
+							</image>
+							<view class="center padding-left-10">
+								<text>{{item.nickName}}</text>
+							</view>
+						</view>
+						<view class="area2 center text-bold text-lg"
+							style="justify-content: flex-start;margin-left: 10rpx;color: #F37A1E;">
+							<image class="img-points" src="../../static/icon/points-value.png"></image>
+							<text class="margin-left-10">{{item.pointTotal}}</text>
+						</view>
+
+						<view class="area3  center text-lg">
+							<text class="text-price text-bold">{{item.pointValue}}</text>
+						</view>
+					</view>
+				</mescroll-body>
+			</view>
+		</block>
 	</view>
 </template>
 
 <script>
+	import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
 	export default {
+		mixins: [MescrollMixin],
 		data() {
 			return {
-
+				isOpenMember: false,
+				detail: {},
+				dataList: [],
+				
+				downOption:{
+					use:false,
+					auto:false // 不自动加载
+				},
+				upOption:{
+					use:false,
+					auto:false // 不自动加载
+				},
 			}
 		},
+		onLoad() {
+			this.fetchShopDetail()
+		},
 		methods: {
-
+			fetchShopDetail() {
+				let params = {
+					id: this.vuex_shopId
+				}
+				this.$api.shop.detail(params).then(res => {
+					if (res.data.isOpenMember == 1) {
+						this.isOpenMember = true
+						this.detail = res.data
+						//加载会员中心
+						this.useOption()
+					}
+				})
+			},
+			downCallback() {
+				setTimeout(()=>{
+					this.mescroll.resetUpScroll();
+				},800)
+			},
+			useOption(){
+				this.downOption={
+					use:true,
+					auto:true
+				}
+				this.upOption={
+					use:true,
+					auto:true 
+				}
+			},
+			upCallback(mescroll) {
+				let params = {
+					shopId: this.vuex_shopId,
+					current: mescroll.num,
+					size: mescroll.size,
+				}
+				try {
+					this.$api.memberCenter.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); //追加新数据
+					})
+				} catch (e) {
+					this.mescroll.endErr()
+				}
+			}
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
+	.btn-bg-color {
+		background-color: #EE9230;
+		color: #FFFFFF;
+	}
+
+	.empty-page {
+		height: 50vh;
+		display: flex;
+		justify-content: center;
+		flex-direction: column;
+		align-items: center;
+		color: #CCCCCC;
+
+		image {
+			width: 120rpx;
+			height: 120rpx;
+			margin-bottom: 20rpx;
+		}
+	}
+
 	.top-menu {
 		border-radius: 20rpx;
 		margin: 30rpx 20rpx;

+ 141 - 53
pages/publish/detail.vue

@@ -2,84 +2,105 @@
 	<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">
+			<!-- <view class="data">
 				<u-icon name="map"></u-icon>
-				<text  class="margin-left-10">仅限全天河区内报名</text>
-			</view>
+				<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="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>
+				<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="appendSupplyPrice" 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="attend" v-if="!$isEmpty(detail.activityJoinRecords)">
 			<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">
+					<view class="data" v-for="(item,index) in detail.activityJoinRecords" :key="index">
 						<view class="item">
-							<image src="../../static/del/del2.png" mode=""></image>
+							<image :src="item.joinPic" mode=""></image>
 							<view>
-								<text>{{name | ellipsis}}</text>
-								<text>0.5折</text>
+								<text>{{item.joinName | ellipsis}}</text>
+								<text>{{item.finalSupplyPrice}}折</text>
 							</view>
 						</view>
 					</view>
 				</view>
-				<view class="center" style="width: 10%;margin-right: 15rpx;">
+				<view v-if="detail.activityJoinRecords.length>3" class="center" style="width: 10%;margin-right: 15rpx;">
 					<u-icon name="more-circle" size="80" color="#ababab"></u-icon>
 				</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,76 @@
 		},
 		data() {
 			return {
-				transparent:'',
-				name:'星巴克'
+				id: '',
+				current: 0, //0 发起活动详情,1可参加活动详情,2已参加活动详情
+				transparent: '',
+				detail: {},
+				appendSupplyPrice: 100
+			}
+		},
+		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: 2,
+						joinId: this.vuex_shopId,
+						appendSupplyPrice: this.appendSupplyPrice
+					}
+					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: 2,
+						joinId: this.vuex_shopId
+					}]
+					this.$api.activity.exit(operateList).then(res => {
+						if (res.success) {
+							this.$dialog.showModal("退出成功", false).then(() => {
+								this.$util.isReloadAndBack()
+							})
+						}
+					})
+				})
+			},
 		}
 	}
 </script>
@@ -128,7 +213,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 +225,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:2,
+					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_shopId
+				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;

+ 268 - 51
pages/shop-info/shop-info.vue

@@ -4,47 +4,64 @@
 		<view class="bg"></view>
 		<view class="card">
 			<view class="title">店铺资料</view>
-			<u-form :model="form" :label-width="labelWidth">
+			<u-form :model="form" :label-width="labelWidth"   ref="uForm">
 				<view class="border">
-					<u-form-item label="用户名" prop="phone">
-						<u-input :border="false" placeholder="请输入用户名" v-model="form.account" type="number"></u-input>
+					<u-form-item label="联系方式" prop="personTel">
+						<u-input disabled  placeholder="请输入联系方式" v-model="form.personTel" type="number"></u-input>
 					</u-form-item>
 				</view>
 				<view class="border">
-					<u-form-item label="业务联系人" prop="phone">
-						<u-input :border="false" placeholder="请输入业务联系人" v-model="form.account" type="number"></u-input>
+					<u-form-item label="所在商场" prop="phone">
+						<u-input @click="mallShow=true" :border="false" placeholder="请选择所在商场"  v-model="mallLabel"
+							type="select"></u-input>
+					</u-form-item>
+				</view>
+				<view class="border" v-if="form.mallId">
+					<u-form-item label="所在区域" prop="phone">
+						<u-input @click="mallAreaShow=true" :border="false" placeholder="请选择所在区域"  v-model="mallAreaLabel"
+							type="select"></u-input>
+					</u-form-item>
+				</view>
+				<view class="border">
+					<u-form-item label="店铺名" prop="name">
+						<u-input :border="false" placeholder="请输入店铺名" v-model="form.name" type="number"></u-input>
+					</u-form-item>
+				</view>
+				<view class="border">
+					<u-form-item label="业务联系人" prop="personName">
+						<u-input :border="false" placeholder="请输入业务联系人" v-model="form.personName" type="number"></u-input>
 					</u-form-item>
 				</view>
 				<view class="tips">
 					<text>*认证通过后,姓名将不可修改</text>
 				</view>
 				<view class="border">
-					<u-form-item label="身份证号码" prop="phone">
-						<u-input :border="false" placeholder="请输入身份证号码" v-model="form.account" type="number"></u-input>
+					<u-form-item label="身份证号码" prop="personIdCard">
+						<u-input :border="false" placeholder="请输入身份证号码" v-model="form.personIdCard" ></u-input>
 					</u-form-item>
 				</view>
 				<view class="photo border">
 					<text>请拿出本人有效二代身份证件准备拍摄</text>
 					<view class="box">
-						<view class="flex flex-direction">
-							<upload-img :width="$isEmpty(form.face)?430:430" :height="$isEmpty(form.face)?260:260"
-								:currentImage="form.face" bgsrc="/static/icon/photo.png">
+						<view @click="chooseImage('idCardFront')" class="flex flex-direction">
+							<upload-img width="430" height="260"
+								:currentImage="form.idCardFront" bgsrc="/static/icon/photo.png">
 							</upload-img>
 							<view class="text-center  padding-top-20 btn-color">
 								<text class="cuIcon-camera padding-right-sm" style="font-size: 30rpx;"></text>
-								<text v-if="$isEmpty(form.face)">请上传身份证正脸照</text>
+								<text v-if="$isEmpty(form.idCardFront)">请上传身份证正脸照</text>
 								<text style="margin-top: 40rpx;display: inline-block;" v-else>点击重新上传</text>
 							</view>
 						</view>
 					</view>
 					<view class="box">
-						<view class="flex flex-direction">
-							<upload-img :width="$isEmpty(form.face)?430:430" :height="$isEmpty(form.face)?260:260"
-								:currentImage="form.face" bgsrc="/static/icon/photo.png">
+						<view  @click="chooseImage('idCardContrary')" class="flex flex-direction">
+							<upload-img width="430" height="260"
+								:currentImage="form.idCardContrary" bgsrc="/static/icon/photo.png">
 							</upload-img>
 							<view class="text-center  padding-top-20 btn-color">
 								<text class="cuIcon-camera padding-right-sm" style="font-size: 30rpx;"></text>
-								<text v-if="$isEmpty(form.face)">请上传身份证正脸照</text>
+								<text v-if="$isEmpty(form.idCardContrary)">请上传身份证正脸照</text>
 								<text style="margin-top: 40rpx;display: inline-block;" v-else>点击重新上传</text>
 							</view>
 						</view>
@@ -54,74 +71,76 @@
 					</view>
 				</view>
 				<view class="border">
-					<u-form-item label="邮箱" prop="phone">
-						<u-input :border="false" placeholder="请输入邮箱" v-model="form.account" type="number"></u-input>
+					<u-form-item label="邮箱" prop="email">
+						<u-input :border="false" placeholder="请输入邮箱" v-model="form.email" ></u-input>
 					</u-form-item>
 				</view>
 				<view class="border">
-					<u-form-item label="联系方式" prop="phone">
-						<u-input :border="false" placeholder="请输入联系方式" v-model="form.account" type="number"></u-input>
-					</u-form-item>
-				</view>
-				<view class="border">
-					<u-form-item label="门店地址" prop="phone">
-						<u-input @click="regionShow=true" :border="false" placeholder="请选择门店地址" v-model="form.address"
+					<u-form-item label="门店地址" prop="area">
+						<u-input @click="regionShow=true" :border="false" placeholder="请选择门店地址" v-model="shopAddress"
 							type="select"></u-input>
 					</u-form-item>
 				</view>
 				<view class="border">
-					<u-form-item label="具体地址" prop="phone">
-						<u-input :border="false" placeholder="请输入具体地址" v-model="form.account" type="number"></u-input>
-					</u-form-item>
-				</view>
-				<view class="border">
-					<u-form-item label="单位名称" prop="phone">
-						<u-input :border="false" placeholder="请输入单位名称" v-model="form.account" type="number"></u-input>
+					<u-form-item label="具体地址" prop="adderess">
+						<u-input :border="false" placeholder="请输入具体地址" v-model="form.adderess" type="number"></u-input>
 					</u-form-item>
 				</view>
 				<view class="border">
-					<u-form-item label="公司网址" prop="phone">
-						<u-input :border="false" placeholder="请输入公司网址" v-model="form.account" type="number"></u-input>
+					<u-form-item label="单位全称" prop="fullName">
+						<u-input :border="false" placeholder="请输入单位全称" v-model="form.fullName" type="number"></u-input>
 					</u-form-item>
 				</view>
 				<view class="border">
-					<u-form-item label="公司法人姓名" prop="phone" label-position="top">
-						<u-input :border="false" placeholder="请输入公司法人姓名" v-model="form.account" type="number"></u-input>
+					<u-form-item label="公司网址" prop="webUrl">
+						<u-input :border="false" placeholder="请输入公司网址" v-model="form.webUrl" type="number"></u-input>
 					</u-form-item>
 				</view>
 				<view class="border">
-					<u-form-item label="公司种类" prop="phone">
-						<u-input :border="false" placeholder="请添加公司种类" v-model="form.account" type="number"></u-input>
+					<u-form-item label="公司法人姓名" prop="legalPersonName" label-position="top">
+						<u-input :border="false" placeholder="请输入公司法人姓名" v-model="form.legalPersonName" type="number"></u-input>
 					</u-form-item>
 				</view>
 				<view class="border">
-					<u-form-item label="统一社会信用代码" prop="phone" label-position="top">
-						<u-input :border="false" placeholder="请输入统一社会信用代码" v-model="form.account" type="number"></u-input>
+					<u-form-item @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 @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>
+								<u-icon name="arrow-right" color="#737373"></u-icon>
+							</view>
+						</view>
 					</u-form-item>
 				</view>
 				<view class="border">
-					<u-form-item label="上传营业执照" prop="phone" label-position="top">
-						<view class="flex-direction center margin-top-30">
-							<upload-img :width="$isEmpty(form.face)?480:480" :height="$isEmpty(form.face)?300:300"
-								:currentImage="form.face" bgsrc="/static/icon/upload.png">
+					<u-form-item label="上传营业执照" prop="businessLicense" label-position="top">
+						<view @click="chooseImage('businessLicense')" class="flex-direction center margin-top-30">
+							<upload-img width="480" height="300"
+								:currentImage="form.businessLicense" bgsrc="/static/icon/upload.png">
 							</upload-img>
 							<view class="text-center  padding-top-20 btn-color">
 								<text class="cuIcon-camera padding-right-sm" style="font-size: 30rpx;"></text>
-								<text v-if="$isEmpty(form.face)">请上传营业执照</text>
+								<text v-if="$isEmpty(form.businessLicense)">请上传营业执照</text>
 								<text style="margin-top: 40rpx;display: inline-block;" v-else>点击重新上传</text>
 							</view>
 						</view>
 					</u-form-item>
 				</view>
 				<view class="border">
-					<u-form-item label="店铺实况" prop="phone" label-position="top">
-						<view class="flex-direction center margin-top-30">
-							<upload-img :width="$isEmpty(form.face)?480:480" :height="$isEmpty(form.face)?300:300"
-								:currentImage="form.face" bgsrc="/static/icon/upload.png">
+					<u-form-item label="店铺实况" prop="shopPic" label-position="top">
+						<view @click="chooseImage('shopPic')" class="flex-direction center margin-top-30">
+							<upload-img width="480" height="300"
+								:currentImage="form.shopPic" bgsrc="/static/icon/upload.png">
 							</upload-img>
 							<view class="text-center  padding-top-20 btn-color">
 								<text class="cuIcon-camera padding-right-sm" style="font-size: 30rpx;"></text>
-								<text v-if="$isEmpty(form.face)">请上传店铺实况</text>
+								<text v-if="$isEmpty(form.shopPic)">请上传店铺实况</text>
 								<text style="margin-top: 40rpx;display: inline-block;" v-else>点击重新上传</text>
 							</view>
 						</view>
@@ -139,7 +158,35 @@
 			</view>
 		</view>
 		
+		<!-- 商场 -->
+		<u-popup  border-radius="60" height="60%"  mode="bottom" v-model="mallShow">
+			<view class="fixed cu-bar search bg-white">
+				<view class="search-form round">
+					<text class="cuIcon-search"></text>
+					<u-input style="width: 90%;" v-model="mallKeyWord" type="text" :adjust-position="false" placeholder="请输入关键字搜索" confirm-type="search"/>
+				</view>
+			</view>
+			<scroll-view v-if="!$isEmpty(mallList)"  style="padding-top: 110rpx;height: 100%;" :scroll-y="true" >
+				<view @click="selectMall(item)" hover-class="hoverClass" class="text-center padding-30 solid-bottom"  v-for="(item,index) in mallList" :key="index">
+					<text>{{item.name}}</text>
+				</view>
+				<u-divider v-if="mallList.length>=20" height="80">只显示20条数据</u-divider>
+			</scroll-view>
+			<u-empty v-else name="search"></u-empty>
+		</u-popup>
+		
 		
+		<u-popup v-model="checkboxShow" mode="bottom" height="50%" border-radius="12">
+			<view class="padding-30">
+				<u-checkbox-group>
+					<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-select v-model="mallAreaShow" label-name="name" value-name="id" mode="single-column" :list="mallAreaList" @confirm="mallAreaConfirm"></u-select>
 		<u-picker mode="region" @confirm="regionConfirm" v-model="regionShow"></u-picker>
 	</view>
 </template>
@@ -157,10 +204,81 @@
 					backgroundColor: '#D18C42',
 				},
 				labelWidth: 170,
-				form: {},
+				form: {
+					mallId:'',
+					mallAreaId:'',
+					name:'',
+					personName:'',
+					personIdCard:'',
+					idCardFront:'',
+					idCardContrary:'',
+					personTel:'',
+					adderess:'',
+					fullName:'',
+					webUrl:'',
+					legalPersonName:'',
+					businessLicense:'',
+					shopPic:'',
+					
+					province:'',
+					city:'',
+					area:'',
+					provinceCode:'',
+					cityCode:'',
+					areaCode:'',
+					
+					auditStatus:0,
+					labelIds:''
+				},
 				regionShow: false,
+				
+				//商场
+				mallShow:false,
+				mallKeyWord:'',
+				mallList:[],
+				mallLabel:'',
+				//区域
+				mallAreaShow:false,
+				mallAreaList:[],
+				mallAreaLabel:'',
+				//门店地址
+				shopAddress:'',
+				//公司总类
+				checkboxShow: false,
+				checkboxList: [],
+				
+				rules: {
+					name: [{
+						required: true,
+						message: '请输入店铺名',
+						trigger: ['change', 'blur'],
+					}],
+					personName: [{
+						required: true,
+						message: '请输入业务联系人',
+						trigger: ['change', 'blur'],
+					}],
+					personIdCard:[{
+						required: true,
+						message: '请输入身份证号码',
+						trigger: ['change', 'blur'],
+					}],
+					businessLicense:[{
+						required: true,
+						message: '请上传营业执照',
+						trigger: ['change', 'blur'],
+					}],
+					area:[{
+						required: true,
+						message: '请选择门店地址',
+						trigger: ['change', 'blur'],
+					}],
+				}
 			}
 		},
+		onReady() {
+			this.$refs.uForm.setRules(this.rules);
+		},
 		onPageScroll(e) {
 			if (e.scrollTop>100) {
 				this.title='店铺资料'
@@ -168,9 +286,108 @@
 				this.title=''
 			}
 		},
+		watch:{
+			mallKeyWord(){
+				let that=this
+				//节流函数
+				if (this.timer){
+					clearTimeout(this.timer)
+				}
+				this.timer = setTimeout(() => {
+					this.mallList=[]
+					that.fetchMallList()
+				}, 500)
+			}
+		},
+		onLoad(options) {
+			if (this.$isEmpty(options.phone)) {
+				this.$dialog.showModal('系统错误',false).then(()=>{
+					this.$back()
+				})
+				return
+			}
+			this.form.personTel=options.phone
+			this.fetchMallList()
+			this.getShopLabelByMallId()
+		},
 		methods: {
+			async chooseImage(name) {
+				let res = await this.$mpi.chooseImage()
+				this.$api.uploadFile(res[0]).then(res => {
+					this.form[name] = res.data.link
+				})
+			},
 			regionConfirm(e) {
-				this.form.address=e.province.label +'-'+e.city.label+'-'+e.area.label
+				this.form.province=e.province.label
+				this.form.city=e.city.label
+				this.form.area=e.area.label
+				this.form.provinceCode=e.province.value + "0000"
+				this.form.cityCode=e.city.value + "00"
+				this.form.areaCode=e.area.value
+				this.shopAddress=e.province.label +"-"+e.city.label+"-"+e.area.label
+			},
+			fetchMallList(){
+				let params={
+					name:this.mallKeyWord,
+					size:20
+				}
+				this.$api.mall.list(params).then(res=>{
+					this.mallList=res.data.records
+				})
+			},
+			fetchMallAreaList(){
+				this.$api.mall.getMallAreaByMallId(this.form.mallId).then(res=>{
+					this.mallAreaList=res.data
+				})
+			},
+			selectMall(item){
+				this.mallLabel=item.name
+				this.form.mallId=item.id
+				this.mallShow=false
+				this.fetchMallAreaList()
+				//重新获取标签
+				this.getShopLabelByMallId()
+			},
+			mallAreaConfirm(e){
+				this.mallAreaLabel=e[0].label
+				this.form.mallAreaId=e[0].value
+			},
+			//获取多选的标签
+			getShopLabelByMallId() {
+				this.$api.mall.getShopLabelByMallId(this.form.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()
+			},
+			submit(){
+				try{
+					this.form.labelIds= this.checkboxList.filter(item=>item.checked==true).map(item=>item.id).join(",")
+				}catch(e){
+					console.log(e);
+				}
+				
+				if (this.$isEmpty(this.form.labelIds)) {
+					this.$u.toast('请选择公司总类')
+					return
+				}
+				this.$refs.uForm.validate(valid => {
+					if (valid) {
+						this.$api.shop.submit(this.form).then(res=>{
+							if (res.success==true) {
+								this.$dialog.showModal('提交成功,请耐心等待商场管理员审核!',false).then(()=>{
+									this.$back()
+								})
+							}
+						})
+					}
+				});
 			}
 		}
 	}

+ 3 - 1
store/index.js

@@ -12,7 +12,7 @@ try{
 }
 
 // 需要永久存储,且下次APP启动需要取出的,在state中的变量名
-let saveStateKeys = ['vuex_audit'];
+let saveStateKeys = ['vuex_audit','vuex_mallId','vuex_shopId'];
 
 // 保存变量到本地存储中
 const saveLifeData = function(key, value){
@@ -33,6 +33,8 @@ 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,
+		vuex_shopId: lifeData.vuex_shopId ? lifeData.vuex_shopId : null,
 	},
 	mutations: {
 		$uStore(state, payload) {

+ 51 - 26
utils/mixin.js

@@ -2,32 +2,57 @@
  * 全局注入器
  */
 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/register',
+			'pages/login/account-login',
+			'pages/shop-info/shop-info',
+			'pages/test/test',
+		]
+		if (!WHiTE_LIST.includes(currentPage)) {
+			if (!this.$cache.get('shopList')) {
+				uni.reLaunch({
+					url: "/pages/login/login"
+				})
+				return
+			}
+		}
+		//判断商场id是否为空
+		WHiTE_LIST.push('pages/index/index')
+		if (!WHiTE_LIST.includes(currentPage)) {
+			if (!this.vuex_shopId) {
+				uni.reLaunch({
+					url:"/pages/index/index"
+				})
+				return
+			}
+		}
+	}
 }
 
 export default page