Bladeren bron

改了很多东西

hmp 4 jaren geleden
bovenliggende
commit
90503bcae6

+ 1 - 1
assets/colorui/app.css

@@ -27,7 +27,7 @@
 }
 
 .text-base{
-	color: #dc311c;
+	color: #FF9447;
 }
 
 .bg-gradual-base {

+ 2 - 2
assets/http/global.js

@@ -1,7 +1,7 @@
 let global = {}
 
-global.baseUrl='http://192.168.1.244:1888/api/'
-// global.baseUrl='https://ldt.guosen-fumao.cn/api/'
+// global.baseUrl='http://192.168.1.244:1888/api/'
+global.baseUrl='https://ldt.guosen-fumao.cn/api/'
 
 global.tokenUrl=global.baseUrl+ 'blade-auth/oauth/token?tenantId=000000&password=f67e0b29283bb804f96e28f43ddce79f&username=admin'
 

+ 4 - 2
components/login.vue

@@ -127,7 +127,6 @@
 					//将openid
 					let resp = await this.$api.loginUser.login(params)
 					if (resp.success) {
-						this.$u.toast('登录成功')
 						//登录成功
 						let obj = {
 							openId,
@@ -172,8 +171,11 @@
 			showPhoneModal() {
 				this.phoneShow = true
 			},
-			getphonenumber(e) {
+			async getphonenumber(e) {
 				this.$emit('getphonenumber')
+				if (this.$isEmpty(this.sessionKey)) {
+					this.sessionKey =this.$cache.get('userInfo').sessionKey
+				}
 				let params = {
 					sessionKey: this.sessionKey,
 					encryptedData: e.detail.encryptedData,

+ 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/agent/empty1.png", // 图标路径 (建议放入static目录, 如 /static/img/mescroll-empty.png )
 			tip: '数据为空' // 提示
 		}
 	}

+ 11 - 0
main.js

@@ -53,6 +53,17 @@ Vue.prototype.$verify = verify
 import global from './assets/http/global.js'
 Vue.prototype.$global = global
 
+//判断是不是微信浏览器
+Vue.prototype.$isWxBrowser = () => {
+	let flag=false
+	try{
+		let na = navigator.userAgent.toLowerCase();
+		flag=na.indexOf('micromessenger') !== -1
+	}catch(e){
+		flag=false
+	}
+	return flag;
+}
 
 
 //跳转

+ 11 - 0
manifest.json

@@ -72,5 +72,16 @@
     },
     "uniStatistics" : {
         "enable" : false
+    },
+    "h5" : {
+        "title" : "联兑通",
+        "domain" : "ldt.guosen-fumao.cn",
+        "router" : {
+            "mode" : "hash",
+            "base" : "/h5/"
+        },
+        "devServer" : {
+            "https" : true
+        }
     }
 }

+ 21 - 2
pages.json

@@ -80,6 +80,7 @@
 		}, {
 			"path": "pages/checkstand/index",
 			"style": {
+				"navigationStyle":"custom",
 				"navigationBarTitleText": "收银台",
 				"enablePullDownRefresh": false
 			}
@@ -190,7 +191,25 @@
 				"enablePullDownRefresh": false
 			}
 		}
-	],
+        ,{
+            "path" : "pages/consume/detail/shop-detail",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "商户详情",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/gain/test",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "test",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+    ],
 	"tabBar": {
 		"color": "#555555",
 		"backgroundColor": "#FFFFFF",
@@ -220,7 +239,7 @@
 	},
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
-		"navigationBarTitleText": "国信数字",
+		"navigationBarTitleText": "联兑通",
 		"navigationBarBackgroundColor": "#fff",
 		"backgroundColor": "#fff"
 	}

+ 3 - 61
pages/agent/myIncome/myIncome.vue

@@ -1,39 +1,6 @@
 <template>
 	<view>
-		<view class="flex justify-center align-center bg-white" style="padding-top: 80upx;">
-			<view class="flex justify-center align-center" style="width: 320upx;height: 80upx;background-color: #f6f6f6;border-radius: 12upx;" @click="changeTime">
-				<view class="text-lg text-bold text-black">{{time}}</view>
-				<view class="text-gray padding-lr">|</view>
-				<view class="cuIcon-calendar" style="font-size: 40upx;"></view>
-			</view>
-		</view>
-		<u-picker mode="selector" v-model="timeShow"  :default-selector="[0]" :range="selector" @confirm="confirm"></u-picker>
-		<view class="text-center bg-white">
-			<view class="theme-color text-bold padding-top padding-bottom-xs" style="font-size: 34upx;">推广总收益</view>
-			<view class="theme-color text-bold" style="font-size: 60upx;">88947.01</view>
-			<view class="text-gray padding-sm" style="font-size: 34upx;">未到账2671.49</view>
-		</view>
-		<view class="flex justify-center align-center bg-white padding-bottom" @click="todayIncome">
-			<view class="flex justify-center theme-color text-bold" style="width: 220upx;line-height: 60upx;background-color: #f6f6f6;border-radius: 12upx;">
-				<text>今日收益</text><text class="cuIcon-right"></text>
-			</view>
-		</view>
-		<view class="margin-top bg-white">
-			<view class="padding">{{time}}收益记录</view>
-			<block v-for="(item, index) in incomeList" :key="index">
-				<view class="flex justify-between align-center padding" @click="detail(item.id)">
-					<view class="flex align-center">
-						<view class="text-center" style="width: 30upx;">{{index + 1}}</view>
-						<image class="margin-lr" src="/static/agent/icon-withdraw.png" style="width: 70upx;height: 70upx;"></image>
-						<view>{{item.type}}</view>
-					</view>
-					<view>
-						<view class="text-bold text-lg margin-bottom-xs text-black flex justify-end">+{{item.income}}</view>
-						<view class="text-gray text-sm flex justify-end">{{item.time}}</view>
-					</view>
-				</view>
-			</block>
-		</view>
+		
 	</view>
 </template>
 
@@ -41,36 +8,11 @@
 	export default {
 		data() {
 			return {
-				timeShow: false,
-				time: '2021年6月',
-				selector: ['2021年6月', '2021年5月', '2021年4月', '2021年3月', '2021年2月', '2021年1月'],
-				incomeList: [
-					{type: '代理收益', time: '6月11日 10:42', income: '5700.00'},
-					{type: '代理收益', time: '6月11日 10:42', income: '5700.00'},
-					{type: '代理收益', time: '6月11日 10:42', income: '5700.00'},
-					{type: '代理收益', time: '6月11日 10:42', income: '5700.00'},
-					{type: '代理收益', time: '6月11日 10:42', income: '5700.00'},
-					{type: '代理收益', time: '6月11日 10:42', income: '5700.00'}
-				],
+				
 			}
 		},
 		methods: {
-			changeTime() {
-				this.timeShow = true;
-			},
-			confirm(index) {
-				this.time = this.selector[index];
-			},
-			todayIncome() {
-				uni.navigateTo({
-					url: "/pages/activityList/mine/agent/myIncome/todayIncome"
-				})
-			},
-			detail(id) {
-				uni.navigateTo({
-					url: "/pages/activityList/mine/agent/myIncome/detail?id=" + id
-				})
-			}
+			
 		}
 	}
 </script>

+ 46 - 27
pages/agent/myPromote.vue

@@ -1,19 +1,30 @@
 <template>
 	<view>
-		<view class="cu-bar search bg-white">
-			<view class="search-form round">
-				<text class="cuIcon-search"></text>
-				<input v-model="keyword" :adjust-position="false" type="text" placeholder="输入用户/商家/商场名称"
-					confirm-type="search"></input>
-			</view>
-			<view class="action">
-				搜索
-			</view>
+		<view class="search">
+			<u-search border-color="#fff" bg-color="#fff" placeholder="输入商家/商场/用户名称" v-model="keyword"></u-search>
 		</view>
-		<view class="tag">
-			<view @click="selectedIndex=index" class="cu-tag round sm margin-right-40" :class="selectedIndex==index?'selected':'in_selected'"
-				v-for="(item,index) in keywordList" :key="index">
-				{{item}}
+		<view class="content">
+			<view class="flex text-bold" style="padding:0 20rpx 0 40rpx">
+				<view class="area1">
+					加入时间
+				</view>
+				<view class="area2">
+					名称
+				</view>
+				<view class="area3">
+					推广类型
+				</view>
+			</view>
+			<view class="item" v-for="(item,index) in 4" :key="index">
+				<view class="area1 flex flex-direction justify-end padding-left-20" >
+					2021-08-10 18:10:32
+				</view>
+				<view class="area2">
+					黄明潘
+				</view>
+				<view class="area3">
+					推广商户
+				</view>
 			</view>
 		</view>
 	</view>
@@ -23,10 +34,7 @@
 	export default {
 		data() {
 			return {
-				keyword: '',
-				keywordList: ['全部', '推广用户', '推广商家', '推广商场'],
-				selectedIndex: 0,
-
+				
 			}
 		},
 		methods: {
@@ -36,18 +44,29 @@
 </script>
 
 <style lang="scss" scoped>
-	.tag {
-		background-color: #FFFFFF;
-		padding: 0 30rpx 20rpx;
-
-		.selected {
-			background-color: #FCE7D2;
-			color: #F39248
+	.search{
+		padding: 40rpx 30rpx 50rpx;
+	}
+	
+	.content{
+		.area1 {
+			width: 50%;
+		}
+		
+		.area2 {
+			width: 30%;
+		}
+		
+		.area3 {
+			width: 20%;
 		}
 		
-		.in_selected{
-			background-color: #f0f0f0;
-			color: #999999;
+		.item{
+			margin-top: 20rpx;
+			background-color: #FFFFFF;
+			display: flex;
+			padding-top: 20rpx;
+			padding-bottom: 20rpx;
 		}
 	}
 </style>

+ 1 - 2
pages/agent/promote.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<u-image :src="src" mode="widthFix"></u-image>
+		
 	</view>
 </template>
 
@@ -8,7 +8,6 @@
 	export default {
 		data() {
 			return {
-				src: 'https://music.nanyue6688.com/obsfile/a5725b251f404b189e3e833ed0619532-promote.png',
 			}
 		},
 		methods: {

+ 126 - 56
pages/checkstand/index.vue

@@ -1,23 +1,43 @@
 <template>
-	<view class="check-panel flex-direction">
-		<image :src="shopDetail.cover" class="buyer-logo"></image>
-		<view class="title center">{{shopDetail.name}}</view>
-		<view class="input-content">
-			<view class="tips">交易金额</view>
-			<view class="input-bar center" @tap="show=true">
-				<view class="icon center">¥</view>
-				<view class="input center">
-					<view>{{orderAmount}}</view>
-					<view class="cusor"></view>
+	<view class="">
+		<!-- #ifdef  MP-WEIXIN-->
+		<view class="">
+			<u-navbar title="收银台"></u-navbar>
+		</view>
+		<!-- #endif -->
+
+		<view class="check-panel flex-direction">
+			<image :src="shopDetail.cover" class="buyer-logo"></image>
+			<view class="title center">{{shopDetail.name}}</view>
+			<view class="input-content">
+				<view class="tips">交易金额</view>
+				<view class="input-bar center" @tap="show=true">
+					<view class="icon center">¥</view>
+					<view class="input center">
+						<view :style="!$isEmpty(orderAmount)?'margin-left: -15%;':''">{{orderAmount}}</view>
+						<view class="cusor" :style="$isEmpty(orderAmount)?'margin-left: -15%;':''"></view>
+					</view>
+				</view>
+				<view style="height: 50rpx;"></view>
+				<view class="" style="z-index: 99;">
+					<u-button throttle-time="1200"  class="button" type="warning" @click="pay">付款</u-button>
 				</view>
 			</view>
-			<view style="height: 50rpx;"></view>
-			<u-button  class="button" type="warning" @click="pay">付款</u-button>
+
+			<view class="bottom-line center"> -- 联兑通提供技术支持 --</view>
+			<u-keyboard z-index="9" ref="uKeyboard" :show-tips="false" :safe-area-inset-bottom="true" :mask="false"
+				v-model="show" @change="handleInput" @confirm="pay" @backspace="handleDelete"></u-keyboard>
 		</view>
+		
+		<u-modal v-model="payModalShow" :showCancelButton="true" confirm-color="#FF9447">
+			<view class="center flex-direction text-df" style="padding: 30rpx 40rpx;">
+				<view>您的积分可足额抵扣支付</view>
+				<view class="padding-top-10">本次支付不会扣除您的现金</view>
+			</view>
+		</u-modal>
 
-		<view class="bottom-line center"> -- 联兑通提供技术支持 --</view>
-		<u-keyboard ref="uKeyboard" :show-tips="false" :safe-area-inset-bottom="true" :mask="false" v-model="show"
-			@change="handleInput" @backspace="handleDelete"></u-keyboard>
+		<u-modal v-model="modalShow"  :showCancelButton="true" @cancel="payOfh5"  @confirm="jumpLDT" cancel-text="直接付款" confirm-color="#FF9447"
+			confirmText="去联兑通支付" content="去联兑通小程序付款会有更多优惠哟~"></u-modal>
 	</view>
 </template>
 
@@ -26,34 +46,46 @@
 		onLoad(option) {},
 		data() {
 			return {
-				show: true,
+				payModalShow:false,
+				modalShow: false,
+				show: false,
 				logo: "/static/bank/CMBCHINA.png",
 				buyer: "联兑通",
 				orderAmount: '',
-				shopId:'',
-				shopDetail:{}
+				shopId: '',
+				shopDetail: {}
 			}
 		},
 		onLoad(options) {
-			this.shopId=options.shopId || '-1'
+			this.shopId = options.id
+			if (this.$isEmpty(this.shopId)) {
+				this.$dialog.showModal('商户id不能为空', false).then(() => {
+					uni.navigateBack()
+				})
+				return
+			}
 			this.fetchShopDetail()
 		},
 		methods: {
-			fetchShopDetail(){
-				this.$api.shop.detail({id:this.shopId}).then(res=>{
+			fetchShopDetail() {
+				this.$api.shop.detail({
+					id: this.shopId
+				}).then(res => {
 					if (this.$isEmpty(res.data)) {
-						this.$dialog.showModal('获取不到商户信息',false).then(()=>{
+						this.$dialog.showModal('获取不到商户信息', false).then(() => {
+							this.show = false
 							uni.navigateBack({
-								delta:1
+								delta: 1
 							})
 						})
-					}else{
-						this.shopDetail=res.data
+					} else {
+						this.show = true
+						this.shopDetail = res.data
 					}
-				}).catch(err=>{
-					this.$dialog.showModal('获取不到商户信息',false).then(()=>{
+				}).catch(err => {
+					this.$dialog.showModal('获取不到商户信息', false).then(() => {
 						uni.navigateBack({
-							delta:1
+							delta: 1
 						})
 					})
 				})
@@ -70,31 +102,71 @@
 				}
 				this.orderAmount = this.orderAmount.substr(0, this.orderAmount.length - 1)
 			},
-			async pay(){
-				let expireTime= this.$dateTime.getExpireTime(5)
-				
+			jumpLDT() {
+				location.href = "weixin://dl/business/?t=X2CyIQDbgtm"
+			},
+			async payOfh5() {
+				let expireTime=this.$dateTime.getExpireTime(5)
 				let params={
-					shopId:this.shopId,
-					loginUserId:this.vuex_userId,
 					money:this.orderAmount,
-					billsTitle:'用户支付',
-					expireTime,
-					appId:this.$global.wxParams.APPID,
-					openId:this.$cache.get('userInfo').openId,
-					type:1 //type: 1-用户扫商户收款码支付 2-商户扫用户付款码支付
+					shopId:this.shopId,
+					billsTitle:'用户微信扫码支付',
+					expireTime
 				}
-				let resp=await this.$api.loginUser.payBefore(params)
-				let obj={
+				let resp=await this.$api.loginUser.payBeforeForNormal(params)
+				let payObj={
 					orderType:this.$global.orderType.USER_PAY,
-					orderId:resp.data.id,
-					payStatus:this.$global.payStatus.IS_WAIT
+					orderId:resp.data.id
 				}
-				let res=await this.$api.pay.payOrder(obj)
-				let prePayTn= JSON.parse(res.data.prePayTn)
-				this.$mpi.requestPayment(prePayTn).then(()=>{
-					uni.navigateTo({
-						url:"/pages/checkstand/order-res?orderId="+resp.data.id
-					})
+				let res=await this.$api.pay.payOrderOfscanCode(payObj)
+				if (!this.$isEmpty(res.data.qrCodeUrl)) {
+					location.href=res.data.qrCodeUrl
+				}
+				this.$u.toast('支付失败')
+			},
+			async pay() {
+				if (this.$isEmpty(this.orderAmount)) {
+					this.$u.toast('请输入交易金额')
+					return
+				}
+				// #ifdef  H5
+				this.modalShow = true
+				// #endif
+
+				// #ifdef MP-WEIXIN
+				let flag=false
+				if (flag) {
+					//可以足额支付
+					this.payModalShow=true
+				}else{
+					//积分不足额支付,调易宝支付
+					this.toWXPay()
+				}
+				// #endif
+			},
+			async toWXPay(){
+				let expireTime = this.$dateTime.getExpireTime(5)
+				let params = {
+					shopId: this.shopId,
+					loginUserId: this.vuex_userId,
+					money: this.orderAmount,
+					billsTitle: '用户支付',
+					expireTime,
+					appId: this.$global.wxParams.APPID,
+					openId: this.$cache.get('userInfo').openId,
+					type: 1 //type: 1-用户扫商户收款码支付 2-商户扫用户付款码支付
+				}
+				let resp = await this.$api.loginUser.payBefore(params)
+				let obj = {
+					orderType: this.$global.orderType.USER_PAY,
+					orderId: resp.data.id,
+					payStatus: this.$global.payStatus.IS_WAIT
+				}
+				let res = await this.$api.pay.payOrder(obj)
+				let prePayTn = JSON.parse(res.data.prePayTn)
+				await this.$mpi.requestPayment(prePayTn)
+				uni.navigateTo({
+					url: "/pages/checkstand/order-res?orderId=" + resp.data.id
 				})
 			}
 		}
@@ -104,25 +176,23 @@
 <style lang="scss" scoped>
 	.check-panel {
 		.buyer-logo {
-			width: 100rpx;
-			height: 100rpx;
+			width: 130rpx;
+			height: 130rpx;
 			margin-top: 50rpx;
-			margin-left: calc(50% - 50rpx);
+			margin-left: calc(50% - 65rpx);
+			border-radius: 50%;
 		}
 
 		.title {
+			font-weight: 800;
 			height: 70rpx;
 			letter-spacing: 3rpx;
 			color: #5D5D5D;
 		}
 
 		.input-content {
+			margin-top: 50rpx;
 			padding: 50rpx;
-			position: absolute;
-			top: 280rpx;
-			bottom: 0;
-			left: 0;
-			right: 0;
 			background-color: #FFFFFF;
 			width: 100%;
 			border-radius: 25rpx 25rpx 0 0;

+ 4 - 4
pages/checkstand/order-res.vue

@@ -10,8 +10,8 @@
 	<view v-else class="check-panel flex-direction">
 		<image src="../../static/pay/success.png"></image>
 		<view class="text-status center">付款成功</view>
-		<view class="order-des center">{{orderDes}}</view>
-		<view class=" fee center">¥{{amount}}</view>
+		<view class="order-des center">{{orderDetail.billsTitle}}</view>
+		<view class=" fee center">¥{{orderDetail.payAmount}}</view>
 		<button class="finish" @click="backToHome">完成</button>
 		<view class="bottom-line center">联兑通提供技术支持</view>
 	</view>
@@ -29,8 +29,7 @@
 				counter: 0,
 				timer: null,
 				loading: true,
-				amount: 100,
-				orderDes: '扫码付款',
+				orderDetail:{},
 				paySuccess:false
 			}
 		},
@@ -38,6 +37,7 @@
 			async queryOrderStatus(){
 				let res=await this.$api.billRecord.detail({id:this.orderId})
 				if(res.data.payStatus==this.$global.payStatus.IS_PAY){
+					this.orderDetail=res.data
 					//已支付
 					clearInterval(this.timer)
 					this.loading = false

+ 11 - 1
pages/consume/comps/card1.vue

@@ -10,7 +10,7 @@
 			</view>
 		</view>
 		<view class="item">
-			<view class="card" v-for="(item,index) in list" :key="index">
+			<view class="card" @click="goDetail(item.id)" v-for="(item,index) in list" :key="index">
 				<view class="left">
 					<image :src="item.cover" mode=""></image>
 				</view>
@@ -75,6 +75,16 @@
 					desc: '全部分类'
 				}]
 			}
+		},
+		methods:{
+			goDetail(id){
+				uni.navigateTo({
+					url:"/pages/consume/detail/shop-detail?id="+id,
+					fail(err) {
+						console.log(err);
+					}
+				})
+			}
 		}
 	}
 </script>

+ 5 - 6
pages/consume/comps/card2.vue

@@ -3,8 +3,7 @@
 		<view class="cu-card case card" v-for="(item,index) in list" :key="index">
 			<view class="cu-item shadow">
 				<view class="image">
-					<image :src="item.pic"
-					 mode="widthFix"></image>
+					<image style="width: 100%;height: 450rpx;" :src="item.pic"></image>
 				</view>
 				<view class="content">
 					<view class="top">
@@ -19,12 +18,12 @@
 							<text>距此3.5km</text>
 						</view>
 						<view class="">
-							<image src="../../../static/del/activitys.png" mode=""></image>
-							<text>18个活动</text>
+							<image style="width: 40rpx;height: 40rpx;" src="../../../static/del/lx.png" mode=""></image>
+							<text>查看路线</text>
 						</view>
 						<view class="">
-							<image src="../../../static/del/diancan.png" mode=""></image>
-							<text>去点餐</text>
+							<image src="../../../static/del/activitys.png" mode=""></image>
+							<text>18个活动</text>
 						</view>
 					</view>
 				</view>

+ 133 - 0
pages/consume/detail/comps/shop-activity.vue

@@ -0,0 +1,133 @@
+<template>
+	<view class="content">
+		<view class="item" v-if="!$isEmpty(list)">
+			<view class="card" @click="goDetail(item.id)" v-for="(item,index) in list" :key="index">
+				<view class="left">
+					<image :src="item.pic" mode=""></image>
+				</view>
+				<view class="right">
+					<view class="title text-cut-1">
+						<text class="">{{item.title}}</text>
+					</view>
+					<view class="data">
+						<view class="">
+							<view style="display: flex;">
+								<u-icon name="bag"  size="30"></u-icon>
+								<view class="" style="margin-right: 20rpx;font-size: 26rpx;">
+									<text class="text-red" style="margin: 0 10rpx;">{{item.supplyPrice/10}}</text>
+									<text>折优惠</text>
+								</view>
+							</view>
+						</view>
+					</view>
+					
+					<view  class="flex justify-start"
+						style="margin-top: 18rpx;width: 100%;color: #999;font-size: 26rpx;">
+						<view class="center margin-right-10" >
+							<text class="cuIcon-time"></text>
+						</view>
+						<view class=" flex flex-direction justify-end">{{item.beginTime | date('mm/dd hh:MM')}}</view>
+						<view class="" style="padding: 0 20rpx;">至</view>
+						<view class=" flex flex-direction justify-end">{{item.endTime | date('mm/dd hh:MM')}}</view>
+					</view>
+					<view class="text-cut-2" style="width: 100%;height: 32rpx;margin-top: 14rpx;">
+						<view v-for="(item1,index1) in item.labelNames.split(',')" :key="index1" class="cu-tag sm "
+							style="background-color: #fff0d9;color: #ff7001;">
+							{{item1}}
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view style="margin-top: 300rpx;" v-else>
+			<u-empty icon-size="300" text="暂无活动" src="/static/agent/empty.png"></u-empty>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		props:{
+			shopId: String
+		},
+		data() {
+			return {
+				list:[]
+			}
+		},
+		created() {
+			this.fetchList()
+		},
+		methods: {
+			fetchList(){
+				let params={
+					sponsorId:this.shopId,
+					sponsorType:2
+				}
+				this.$api.activity.shop_list(params).then(res=>{
+					this.list=res.data.records
+				})
+			},
+			goDetail(id){
+				
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.item {
+		background-color: #FFFFFF;
+		padding:20rpx 30rpx;
+		display: flex;
+		flex-direction: column;
+		margin-top: 20rpx;
+	
+		.card {
+			margin-bottom: 20rpx;
+			display: flex;
+			border-bottom: 1rpx solid #ececec;
+			padding-bottom: 20rpx;
+	
+			.left {
+				width: 30%;
+	
+				image {
+					width: 100%;
+					border-radius: 12rpx;
+					height: 180rpx;
+				}
+			}
+	
+			.right {
+				margin-left: 20rpx;
+				display: flex;
+				width: 70%;
+				flex-direction: column;
+	
+				.title {
+					font-size: 30rpx;
+					font-weight: 800;
+				}
+	
+				.data {
+					margin-top: 20rpx;
+					display: flex;
+					justify-content: space-between;
+					font-size: 24rpx;
+					color: #666666;
+				}
+	
+				.label {
+					margin-top: 10rpx;
+				}
+			}
+		}
+	
+		.card:last-child {
+			border: none;
+			margin-bottom: 0;
+			padding-bottom: 0;
+		}
+	}
+</style>

+ 103 - 0
pages/consume/detail/comps/shop-info.vue

@@ -0,0 +1,103 @@
+<template>
+	<view class="safe-area-inset-bottom">
+		<view class="card">
+			<view class="item" >
+				<text  class="left">商户名</text>
+				<text class="right">{{detail.name}}</text>
+			</view>
+			<view class="item">
+				<text  class="left">业务处理人</text>
+				<text class="right">{{detail.personName}}</text>
+			</view>
+			<view class="item">
+				<text  class="left">门店地区</text>
+				<text class="right">{{detail.province}} - {{detail.city}} - {{detail.area}}</text>
+			</view>
+			<view class="item">
+				<text class="left" style="width: 40%;">具体地址</text>
+				<text class="right">{{detail.address || '暂无'}}</text>
+			</view>
+			<view class="item">
+				<text class="left">所属商场</text>
+				<text class="right">{{detail.mallName}}</text>
+			</view>
+			<view class="item">
+				<text class="left">商场区域</text>
+				<text class="right">{{detail.mallAreaName}}</text>
+			</view>
+			<view class="item">
+				<text class="left">店铺类型</text>
+				<view class="right">
+					<view class="cu-tag tag-bg round sm" v-for="(item,index) in tags" :key="index">
+						{{item}}
+					</view>
+				</view>
+			</view>
+			<view class="item" style="justify-content: flex-start;flex-direction: column;">
+				<text class="left">店铺实况</text>
+				<view class="flex justify-start padding-top-20 flex-wrap">
+					<image @click="$util.preview(detail.businessLicense)" style="width: 30%;height: 120rpx;margin: 10rpx;" :src="detail.businessLicense" mode=""></image>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		props:{
+			shopId: String
+		},
+		
+		data() {
+			return {
+				detail:{},
+				tags:[],
+			}
+		},
+		created() {
+			this.fetchDetail()
+		},
+		methods: {
+			fetchDetail(){
+				this.$api.shop.detail({id:this.shopId}).then(res=>{
+					this.detail=res.data
+					this.tags=this.detail.labelNames.split(',')
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.tag-bg{
+		background-color: #FF9447;
+		color: #FFFFFF;
+	}
+	.card{
+		margin: 20rpx;
+		padding: 20rpx;
+		border-radius: 20rpx;
+		background-color: #FFFFFF;
+		
+		.title{
+			font-size: 32rpx;
+			font-weight: 800;
+			padding-bottom: 10rpx;
+		}
+		
+		.item{
+			padding: 30rpx 0;
+			display: flex;
+			justify-content: space-between;
+			
+			.left{
+				color: #999999;
+			}
+			
+			.right{
+				color: #252525;
+			}
+		}
+	}
+</style>

+ 97 - 0
pages/consume/detail/shop-detail.vue

@@ -0,0 +1,97 @@
+<template>
+	<view class="container">
+		<view class="tabs">
+			<scroll-view scroll-x class="bg-white nav">
+				<view class="flex text-center">
+					<view class="cu-item flex-sub" :class="index==current?'text-base cur text-xl text-bold ':'text-lg'"
+						v-for="(item,index) in tabs" :key="index" @tap="tabChange(index)">
+						{{item.name}}
+					</view>
+				</view>
+			</scroll-view>
+		</view>
+		<view style="height: 100%;">
+			<swiper style="height: 100%;" :current="current" @change="swiperChange" @animationfinish="animationfinish">
+				<swiper-item v-for="(item,index) in tabs" :key="index">
+					<scroll-view scroll-y style="height: 100%;">
+						<shop-info v-if="current==0&&id!=''" ref="shopInfo" :shopId="id"></shop-info>
+						<shop-activity v-if="current==1&&id!=''" ref="mallInfo" :shopId="id"></shop-activity>
+					</scroll-view>
+				</swiper-item>
+			</swiper>
+		</view>
+	</view>
+</template>
+<script>
+	import shopActivity from "./comps/shop-activity.vue"
+	import shopInfo from "./comps/shop-info.vue"
+	export default {
+		components:{
+			shopInfo,shopActivity
+		},
+		data() {
+			return {
+				id: '',
+				detail: {},
+				tags: [],
+
+				current: 0,
+				swiperCurrent: 0,
+				tabs: [{
+						name: '商户信息',
+						value: 0
+					},
+					{
+						name: '商户活动',
+						value: 1
+					}
+				],
+			}
+		},
+		onLoad(options) {
+			this.id=options.id
+		},
+		methods: {
+			tabChange(index) {
+				this.current = index
+			},
+			swiperChange(e) {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 0
+				});
+				this.current = e.detail.current
+			},
+			animationfinish({
+				detail: {
+					current
+				}
+			}) {
+				this.swiperCurrent = current;
+				this.current = current;
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.text-xl {
+		font-size: 34rpx;
+	}
+
+	.container {
+		height: calc(100vh);
+		background-color: #F6F6F6;
+		padding: 78rpx 0rpx 0rpx;
+
+		.tabs {
+			position: fixed;
+			top: -12rpx;
+			left: 0;
+			width: 100%;
+			background-color: #FFFFFF;
+			box-sizing: border-box;
+			z-index: 3;
+		}
+	}
+</style>

+ 1 - 1
pages/gain/comps/card1.vue

@@ -61,7 +61,7 @@
 		},
 		methods: {
 			getActivityList() {
-				this.$api.activity.list().then(res => {
+				this.$api.activity.yyzs_list().then(res => {
 					this.activityList = res.data.records
 				})
 			},

+ 10 - 10
pages/gain/comps/card2.vue

@@ -27,9 +27,9 @@
 			<view class="card">
 				<view class="top">
 					<image src="https://thirdwx.qlogo.cn/mmopen/vi_32/q6EwR5U6zFp8bYbUWb9HmFc5Q3R88x13Q0ZtOcVK5lO8AmtibQDRcuMA2Y7CmyuMCr6icceM3QibIKN2icAAxSvjpA/132" ></image>
-					<view class="center text-xl" style="margin-left: 20rpx;margin-right: 10rpx;">黄明潘</view>
+					<view class="center text-lg" style="margin-left: 20rpx;margin-right: 10rpx;">黄明潘</view>
 					<view class="center margin-left-10">
-						<view class="cu-tag btn-bg-color sm" style="border-radius: 20rpx 20rpx 20rpx 0;">
+						<view class="cu-tag btn-bg-color sm" style="border-radius: 20rpx 20rpx 20rpx 0;padding: 10rpx;">
 							代理商
 						</view>
 					</view>
@@ -53,9 +53,9 @@
 			<view class="menu">
 				<view class="title">推广服务</view>
 				<view class="margin-top-30">
-					<view class="item" v-for="(item,index) in menuList" :key="index">
+					<view @click="$jump(item.path)" class="item" v-for="(item,index) in menuList" :key="index">
 						<view class="center">
-							<image style="width: 40rpx;height: 40rpx;margin-right: 10rpx;" :src="item.icon"></image>
+							<image style="width: 38rpx;height: 38rpx;margin-right: 10rpx;" :src="item.icon"></image>
 							<text>{{item.name}}</text>
 						</view>
 						<view class="center">
@@ -75,17 +75,17 @@
 			return{
 				menuList:[
 					{
-						icon:'/static/icon/card.png',
+						icon:'/static/agent/topromote.png',
 						name:'去推广',
 						path:''
 					},
 					{
-						icon:'/static/icon/card.png',
+						icon:'/static/agent/mypromote.png',
 						name:'我的推广',
-						path:''
+						path:'/pages/agent/myPromote'
 					},
 					{
-						icon:'/static/icon/card.png',
+						icon:'/static/agent/myearnings.png',
 						name:'我的收益',
 						path:''
 					},
@@ -135,7 +135,7 @@
 		align-items: center;
 		
 		.card{
-			padding: 40rpx;
+			padding:30rpx 40rpx;
 			width: 100%;
 			border-radius: 20rpx;
 			background-image: linear-gradient(#1F2349,#465274);
@@ -157,7 +157,7 @@
 			
 			.bottom{
 				width: 100%;
-				padding-top: 50rpx;
+				padding-top: 30rpx;
 				display: flex;
 				text-align: center;
 				justify-content: space-around;

+ 86 - 32
pages/gain/gain.vue

@@ -1,10 +1,25 @@
 <template>
-	<view class="page">
-		<u-sticky>
-			<u-tabs active-color="#EF9944" :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
-		</u-sticky>
-		<card1 v-if="current==0"></card1>
-		<card2 @login="showLogin" v-else></card2>
+	<view class="container">
+		<view class="tabs">
+			<scroll-view scroll-x class="bg-white nav">
+				<view class="flex text-center">
+					<view class="cu-item flex-sub" :class="index==current?'text-base cur text-xl text-bold ':'text-lg'"
+						v-for="(item,index) in tabs" :key="index" @tap="tabChange(index)">
+						{{item.name}}
+					</view>
+				</view>
+			</scroll-view>
+		</view>
+		<view style="height: 100%;">
+			<swiper style="height: 100%;" :current="current" @change="swiperChange" @animationfinish="animationfinish">
+				<swiper-item v-for="(item,index) in tabs" :key="index">
+					<scroll-view scroll-y style="height: 100%;">
+						<card1 v-if="current==0"></card1>
+						<card2 @login="showLogin" v-else></card2>
+					</scroll-view>
+				</swiper-item>
+			</swiper>
+		</view>
 		
 		<login ref="login" @signIn="signIn"></login>
 	</view>
@@ -19,21 +34,23 @@
 		},
 		data() {
 			return {
-				list: [{
-					name: '参与活动'
-				}, {
-					name: '代理推广'
-				}],
-				current: 0
+				current: 0,
+				swiperCurrent: 0,
+				tabs: [{
+						name: '参与活动',
+						value: 0
+					},
+					{
+						name: '代理推广',
+						value: 1
+					}
+				],
 			}
 		},
 		onLoad(options) {
 			this.current=options.current || 0
 		},
-		mounted() {
-			
-		},
-		methods:{
+		methods: {
 			showLogin(){
 				this.$refs.login.show()
 			},
@@ -46,16 +63,6 @@
 					this.showPhoneModal()
 				}
 			},
-			change(e){
-				this.current=e
-				if (this.current==1 && this.$isEmpty(this.vuex_userId)) {
-					this.showLogin()
-					return
-				}
-				if (this.current==1 && this.$isEmpty(this.vuex_phone)) {
-					this.showPhoneModal()
-				}
-			},
 			judgeAgenterType(){
 				let params={
 					userId:this.vuex_userId,
@@ -68,15 +75,62 @@
 						this.$u.vuex('vuex_agenter_type',type)
 					}
 				})
-			}
-			
+			},
+			showModal(){
+				if (this.current==1 && this.$isEmpty(this.vuex_userId)) {
+					this.showLogin()
+					return
+				}
+				if (this.current==1 && this.$isEmpty(this.vuex_phone)) {
+					this.showPhoneModal()
+				}
+			},
+			tabChange(index) {
+				this.current = index
+				this.showModal()
+			},
+			swiperChange(e) {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 0
+				});
+				this.current = e.detail.current
+				this.showModal()
+			},
+			animationfinish({
+				detail: {
+					current
+				}
+			}) {
+				this.swiperCurrent = current;
+				this.current = current;
+			},
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
-	.page{
-		background-color: #f6f6f6;
-		min-height: 100vh;
+	.text-xl {
+		font-size: 34rpx;
+	}
+	
+	.text-base{
+		color: #EF9944;
+	}
+
+	.container {
+		height: calc(100vh);
+		background-color: #F6F6F6;
+		padding: 78rpx 0rpx 0rpx;
+
+		.tabs {
+			position: fixed;
+			top: -16rpx;
+			left: 0;
+			width: 100%;
+			background-color: #FFFFFF;
+			box-sizing: border-box;
+			z-index: 3;
+		}
 	}
-</style>
+</style>

+ 83 - 0
pages/gain/test.vue

@@ -0,0 +1,83 @@
+<template>
+	<view class="page">
+		<u-sticky>
+			<u-tabs active-color="#EF9944" :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
+		</u-sticky>
+		<card1 v-if="current==0"></card1>
+		<card2 @login="showLogin" v-else></card2>
+		
+		<login ref="login" @signIn="signIn"></login>
+	</view>
+</template>
+<script>
+	import card1 from "./comps/card1.vue"
+	import card2 from "./comps/card2.vue"
+	import login from "@/components/login.vue"
+	export default {
+		components:{
+			card1,card2,login
+		},
+		data() {
+			return {
+				list: [{
+					name: '参与活动'
+				}, {
+					name: '代理推广'
+				}],
+				current: 0
+			}
+		},
+		onLoad(options) {
+			this.current=options.current || 0
+		},
+		mounted() {
+			
+		},
+		methods:{
+			showLogin(){
+				this.$refs.login.show()
+			},
+			showPhoneModal(){
+				this.$refs.login.showPhoneModal()
+			},
+			signIn(resp){
+				this.judgeAgenterType()
+				if (!this.vuex_phone) {
+					this.showPhoneModal()
+				}
+			},
+			change(e){
+				this.current=e
+				if (this.current==1 && this.$isEmpty(this.vuex_userId)) {
+					this.showLogin()
+					return
+				}
+				if (this.current==1 && this.$isEmpty(this.vuex_phone)) {
+					this.showPhoneModal()
+				}
+			},
+			judgeAgenterType(){
+				let params={
+					userId:this.vuex_userId,
+					enabled:1
+				}
+				this.$api.agenter.list(params).then(res=>{
+					if (!this.$isEmpty(res.data.records)) {
+						let item=res.data.records[0]
+						let type=this.$isEmpty(item.agenterTypeId)?1:2
+						this.$u.vuex('vuex_agenter_type',type)
+					}
+				})
+			}
+			
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.page{
+		background-color: #f6f6f6;
+		min-height: 100vh;
+	}
+</style>
+

+ 39 - 29
pages/mine/mine.vue

@@ -3,7 +3,6 @@
 		
 		<!-- 扫一扫错误回调 -->
 		<u-modal title="扫描异常"  confirm-color="#dc9b21"  v-model="scanNotify.scan" :content="scanNotify.scanMessage"></u-modal>
-		
 		<view style="position: relative;">
 			<image src="@/static/icon/bg.png" class="bg-img"></image>
 			<image src="@/static/icon/bg-yin.png" class="shuiyin" mode=""></image>
@@ -124,7 +123,7 @@
 		
 		<view class="consume" @click="jump('/pages/gain/gain',1)">
 			<view class="top" style="padding: 20rpx 30rpx 10rpx;">
-				<text>花积分</text>
+				<text>花积分</text>
 				<text>更多 ></text>
 			</view>
 			
@@ -169,35 +168,38 @@
 			this.login()
 		},
 		methods: {
-			init(){
-				this.fetchUserInfo()
-				this.judgeAgenterType()
+			async init(){
+				await this.fetchUserInfo()
+				await this.judgeAgenterType()
 			},
-			judgeAgenterType(){
+			async judgeAgenterType(){
 				let params={
 					userId:this.vuex_userId,
 					enabled:1
 				}
-				this.$api.agenter.list(params).then(res=>{
-					if (!this.$isEmpty(res.data.records)) {
-						let item=res.data.records[0]
-						let type=this.$isEmpty(item.agenterTypeId)?1:2
-						this.$u.vuex('vuex_agenter_type',type)
-					}
-				})
+				let res=await this.$api.agenter.list(params)
+				if (!this.$isEmpty(res.data.records)) {
+					let item=res.data.records[0]
+					let type=this.$isEmpty(item.agenterTypeId)?1:2
+					this.$u.vuex('vuex_agenter_type',type)
+				}
 			},
-			fetchUserInfo(){
+			async fetchUserInfo(){
 				let params={
 					id:this.vuex_userId
 				}
-				this.$api.loginUser.detail(params).then(res=>{
-					if (this.$isEmpty(res.data)) {
-						this.$cache.clear()
-						this.showLogin()
-					}else{
-						this.userInfo=res.data
-					}
-				})
+				let res=await this.$api.loginUser.detail(params)
+				if (this.$isEmpty(res.data)) {
+					//清除userId和手机号
+					this.$u.vuex('vuex_userId',null)
+					this.$u.vuex('vuex_phone',null)
+					this.$cache.remove('lifeData')
+					this.$cache.remove('userInfo')
+					//刷新当前页
+					this.login()
+				}else{
+					this.userInfo=res.data
+				}
 			},
 			// 登录 begin
 			showLogin(){
@@ -207,17 +209,23 @@
 				this.$refs.login.showPhoneModal()
 			},
 			signIn(resp){
-				if (!this.vuex_phone) {
+				//获取手机号
+				if (this.$isEmpty(this.vuex_phone)) {
 					this.showPhoneModal()
+				}else{
+					this.$u.toast('登录成功')
 				}
+				//获取数据
 				this.init()
 			},
-			login(e){
+			async login(e){
 				if (this.$isEmpty(this.vuex_userId)) {
 					this.showLogin()
 					return
 				}
+				//获取数据
 				this.init()
+				//获取手机号
 				if (this.$isEmpty(this.vuex_phone)) {
 					this.showPhoneModal()
 				}
@@ -225,11 +233,11 @@
 			// 登录 end
 			scanCode(){
 				const _this = this;
-				// this.jump('/pages/checkstand/index')
 				uni.scanCode({
 				    success: function (res) {
-						console.log(res,1236456);
-						_this.jump('/pages/checkstand/index?shopId='+res.result)
+						let result=res.result
+						let url=result.split("#")[1]
+						_this.jump(url)
 				    },
 					fail: (res) => {
 						if(res.errMsg!='scanCode:fail cancel'){
@@ -324,7 +332,6 @@
 		color: #FFFFFF;
 		background-color: #EA3723;
 	}
-	
 	.shuiyin{
 		overflow: hidden;
 		width: 260rpx;
@@ -387,10 +394,13 @@
 		background-color: #FFFFFF;
 		
 		.title{
-			padding-left: 30rpx;
+			padding-left: 20rpx;
 			font-weight: 800;
+			font-size: 34rpx;
+			color: #26272F;
 		}
 		
+		
 		.menu{
 			display: flex;
 			justify-content: space-around;

+ 5 - 10
pages/mine/myInfo.vue

@@ -128,16 +128,11 @@
 						birthday: this.userData.birthday,
 						avatar: this.userData.avatar
 					}
-					this.$u.api.loginUser.submit(data).then(res => {
-						uni.showToast({
-							icon: "none",
-							title: "修改成功",
-							duration: 2000,
-							success() {
-								uni.navigateBack({
-									delta: 1
-								})
-							}
+					this.$api.loginUser.submit(data).then(res => {
+						this.$dialog.showModal('修改成功',false).then(()=>{
+							uni.navigateBack({
+								delta: 1
+							})
 						})
 					})
 				}

BIN
static/agent/empty1.png


BIN
static/agent/myearnings.png


BIN
static/agent/mypromote.png


BIN
static/agent/topromote.png


BIN
static/del/lx.png


+ 2 - 1
utils/dateTime.js

@@ -34,7 +34,8 @@ dateTime.createDate = (value)=>{
   return new Date(date)
 } 
 
-dateTime.getExpireTime=(value)=>{
+//默认五分钟
+dateTime.getExpireTime=(value=5)=>{
 	let now=new Date()
 	let min=now.getMinutes()
 	now.setMinutes(min + value)

+ 7 - 16
utils/util.js

@@ -115,25 +115,16 @@ util.reload = (mescroll) => {
 }
 
 // 刷新当前页面
-util.refreshPage = () => {
+util.refreshPage = (vm) => {
 	const pages = getCurrentPages()
 	const currentPage = pages[pages.length - 1]
 	const path = '/' + currentPage.route + vm.$u.queryParams(currentPage.options)
-	if (vm.$u.test.contains(currentPage.route, 'tabbar')) {
-		uni.reLaunch({
-			url: path,
-			fail: (err) => {
-				console.log(err)
-			}
-		})
-	} else {
-		uni.redirectTo({
-			url: path,
-			fail: (err) => {
-				console.log(err)
-			}
-		})
-	}
+	uni.reLaunch({
+		url: path,
+		fail: (err) => {
+			console.log(err)
+		}
+	})
 }