1
0

4 Коміти b929565994 ... 85fc79af64

Автор SHA1 Опис Дата
  高敬炎 85fc79af64 Merge branch 'master' of http://git.zthymaoyi.com/zyw/tourism 1 рік тому
  高敬炎 d3a6dfc27f 前端 1 рік тому
  高敬炎 e621c3f5e5 Merge branch 'master' of http://git.zthymaoyi.com/zyw/tourism 1 рік тому
  高敬炎 a277672606 前端 1 рік тому

+ 164 - 75
uni_applet/pageA/enter/enter.vue

@@ -29,63 +29,26 @@
 			</u-swiper>
 		</view>
 		<view>
-			 <luyj-grid-link :list="list" @gridExc="clickGrid"></luyj-grid-link>
-			 <u-modal :show="showAuthorizePhone" :showConfirmButton="false">
-			 	<view class="slot-content">
-			 		<view class="auth-card">
-			 			<view class="img">
-			 				<img class="avatar-img" src="@/static/logo.png" mode="widthFix">
-			 			</view>
-			 			<view class="content">手机登录后才能查看名片哦~</view>
-			 		</view>
-			 		<view class="auth-btncard">
-			 			<view class="btn-unok">
-			 				<u-button :customStyle="customStyleUnOk" @click="showAuthorizePhone=false" :plain="true">
-			 					拒绝</u-button>
-			 			</view>
-			 			<view class="btn-ok">
-			 				<u-button :customStyle="customStyleOk" open-type="getPhoneNumber"
-			 					@getphonenumber="getPhoneNumber"> 立即登录</u-button>
-			 			</view>
-			 		</view>
-			 	</view>
-			 </u-modal>
-			<u-modal :show="showAuthorizeUser" :showConfirmButton="false">
-				<view class="slot-content">
-					<view class="auth-card">
-						<view class="img">
-							<img class="avatar-img" src="/static/image/logo.png" mode="widthFix">
-						</view>
-						<view class="content">邀请您补全个人信息<br></br>(昵称、头像)</view>
-						<view style="margin-left: 100rpx;margin-right: 100rpx">
-							<u-form :model="userInfo" ref="uForm">
-								<u-form-item label="头像">
-									<button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar"
-										slot="right">
-										<image class="avatar"
-											:src="userInfo.head?userInfo.head:'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'">
-										</image>
-									</button>
-								</u-form-item>
-								<u-form-item label="昵称">
-									<u-input inputAlign='right' v-model="userInfo.nickname" class="weui-input"
-										@blur="userNameInput" placeholder="请输入昵称" border="false" />
-									<!-- <input type="nickname" :value="userInfo.nickname" class="weui-input" @blur="userNameInput" placeholder="请输入昵称"/> -->
-								</u-form-item>
-							</u-form>
-						</view>
-					</view>
-					<view class="auth-btncard">
-						<view class="btn-unok"><u-button :customStyle="customStyleUnOk" @click="authUser(0)">
-								拒绝</u-button>
-						</view>
-						<view class="btn-ok">
-							<u-button :customStyle="customStyleOk" @click="authUser(1)"> 允许</u-button>
-						</view>
-					</view>
-				</view>
-			</u-modal>
+			 <luyj-grid-link :list="list" @gridExc="clickGrid" @switchChange='switchChange'></luyj-grid-link>
 		</view>
+		<u-modal :show="editshow"  @confirm="$u.debounce(confirm,500)" title="选择自动跳转内容" >
+					<view class="slot-content">
+						<u-radio-group
+						    v-model="radiovalue1"
+						    placement="column"
+						    @change="groupChange"
+						  >
+						    <u-radio
+						      :customStyle="{marginBottom: '8px'}"
+						      v-for="(item, index) in radiolist1"
+						      :key="index"
+						      :label="item.value"
+						      :name="item.value"
+						    >
+						    </u-radio>
+						  </u-radio-group>
+					</view>
+				</u-modal>
 		<u-tabbar
 			:value="tabbarCheck"
 			@change="name => tabbarCheck = name"
@@ -145,9 +108,12 @@
 		data() {
 			return {
 				fileList:[],
+				editshow:false,
 				tabbarCheck:'team',
 				showAuthorizePhone:false,
 				showAuthorizeUser:false,
+				radiolist1:[],
+				radiovalue1:'',
 				userInfo: {
 					head: '',
 					nickname: '',
@@ -182,18 +148,21 @@
 								cuIcon: '1_canyin-35',
 								color: 'blue',
 								name: '餐饮',
+								status:true,
 								url: '/pageA/enter/cateringindustry'
 							},
 							{
 								cuIcon: 'zufang',
 								color: 'blue',
 								name: '民宿',
+								status:true,
 								url: '/pageA/enter/homestay'
 							},
 							{
 				                cuIcon: 'jiudian-38',
 				                color: 'blue',
 				                name: '酒店',
+								status:true,
 				                 url: '/pageA/enter/hotel'
 				            }
 				        ]
@@ -204,25 +173,33 @@
 						bgColor: '', // 背景颜色
 						color: 'blue',
 						title_show: true,
+						foodEntry:0,
+						homeEntry:0,
+						hotelEntry:0,
+						switch:true,
 						showAll: false,
+						switch_status:true,
 						colNumber: 4, // 显示的列数
 						iconsList: [
 							{
 								cuIcon: '1_canyin-35',
 								color: 'blue',
 								name: '餐饮',
+								status:true,
 								url: '/pageA/enter/myCateringdustry/index'
 							},
 							{
 								cuIcon: 'zufang',
 								color: 'blue',
 								name: '民宿',
+								status:true,
 								url: '/pageA/enter/myHomestay/index'
 							},
 							{
 						        cuIcon: 'jiudian-38',
 						        color: 'blue',
 						        name: '酒店',
+								status:true,
 						         url: '/pageA/enter/hotel'
 						    }
 						]
@@ -232,35 +209,136 @@
 		},
 		onLoad(){
 			that = this
+			this.userInfo=uni.getStorageSync("userInfo")
+			if(uni.getStorageSync("userInfo").phone&&uni.getStorageSync("userInfo").automaticSkip){
+				if(uni.getStorageSync("userInfo").autoModule=='foodEntry'){
+					uni.navigateTo({
+						url:'/pageA/enter/myCateringdustry/index'
+					})
+				}else if(uni.getStorageSync("userInfo").autoModule=='homeEntry'){
+					uni.navigateTo({
+						url:'/pageA/enter/myHomestay/index'
+					})
+				}else if(uni.getStorageSync("userInfo").autoModule=='hotelEntry'){
+					uni.navigateTo({
+						url:'/pageA/enter/hotel'
+					})
+				}
+			}
 			this.getList()
 		},
 		onShow: function() {
 			let _isLoad = uni.getStorageSync("scanAddCardToIndex")
 			if (uni.getStorageSync("userInfo").phone) {
-				// that.$request.baseRequest('admin.unimall.cardNewsInfo', 'list', {
-				// 	receiveId: uni.getStorageSync("userInfo").id,
-				// }, failres => {
-				// 	console.log('res+++++', failres.errmsg)
-				// 	that.$refs.uToast.show({
-				// 		type: 'error',
-				// 		message: failres.errmsg,
-				// 	})
-				// }).then(res => {
-				// 	that.noticeList = res.data.items
-				// 	if (that.noticeList.length > 0) {
-				// 		var data = that.noticeList.filter((item) => {
-				// 			return item.newsFlag == 0
-				// 		})
-				// 		that.unread = data ? data.length : 0
-				// 	}
-				// 	console.log(that.unread)
-				// })
+				if(uni.getStorageSync("userInfo").foodEntry==0&&uni.getStorageSync("userInfo").homeEntry==0&&uni.getStorageSync("userInfo").hotelEntry==0){
+					this.list[1].switch_status=false
+				}else{
+					this.list[1].switch_status=uni.getStorageSync("userInfo").automaticSkip?true:false
+				}
+				if(uni.getStorageSync("userInfo").foodEntry>0){
+					this.list[1].iconsList[0].status=true
+				}else{
+					this.list[1].iconsList[0].status=false
+				}
+				if(uni.getStorageSync("userInfo").homeEntry>0){
+					this.list[1].iconsList[1].status=true
+					this.list[0].iconsList[1].status=false
+				}else{
+					this.list[1].iconsList[1].status=false
+					this.list[0].iconsList[1].status=true
+				}
+				if(uni.getStorageSync("userInfo").hotelEntry>0){
+					this.list[1].iconsList[2].status=true
+					this.list[0].iconsList[2].status=false
+				}else{
+					this.list[1].iconsList[2].status=false
+					this.list[0].iconsList[2].status=true
+				}
 			} else {
-				this.showAuthorizePhone = true
 			}
 		
 		},
 		methods: {
+			async confirm(){
+				var data1=await this.updateUser()
+				if(data1.errno==200){
+					uni.setStorageSync("userInfo",this.userInfo)
+					return
+				}
+			},
+			
+			groupChange(e){
+				console.log(e)
+				if(e=='餐饮'){
+					this.userInfo.autoModule='foodEntry'
+				}else if(e=='民宿'){
+					this.userInfo.autoModule='homeEntry'
+				}else if(e=='酒店'){
+					this.userInfo.autoModule='hotelEntry'
+				}
+				
+			},
+			
+			async switchChange(e){
+				var status=e?1:0
+				console.log(e,111111)
+				this.userInfo.automaticSkip=status
+				var data=await this.updateUser()
+				console.log(data)
+				if(data.errno==200){
+					uni.setStorageSync("userInfo",this.userInfo)
+					uni.showToast({
+						icon: "none",
+						title: '已开启自动跳转',
+						duration: 3000
+					});	
+					if(uni.getStorageSync("userInfo").foodEntry!=0&&uni.getStorageSync("userInfo").homeEntry==0&&uni.getStorageSync("userInfo").hotelEntry==0){
+						this.userInfo.autoModule='foodEntry'
+						var data1=await this.updateUser()
+						if(data1.errno==200){
+							uni.setStorageSync("userInfo",this.userInfo)
+							return
+						}
+							
+					}
+					if(uni.getStorageSync("userInfo").foodEntry==0&&uni.getStorageSync("userInfo").homeEntry!=0&&uni.getStorageSync("userInfo").hotelEntry==0){
+						this.userInfo.autoModule='homeEntry'
+						var data1=await this.updateUser()
+						if(data1.errno==200){
+							uni.setStorageSync("userInfo",this.userInfo)
+							return
+						}
+					}
+					if(uni.getStorageSync("userInfo").foodEntry==0&&uni.getStorageSync("userInfo").homeEntry==0&&uni.getStorageSync("userInfo").hotelEntry!=0){
+						this.userInfo.autoModule='hotelEntry'
+						var data1=await this.updateUser()
+						if(data1.errno==200){
+							uni.setStorageSync("userInfo",this.userInfo)
+							return
+						}
+					}
+					this.radiolist1=[]
+					if(uni.getStorageSync("userInfo").foodEntry!=0){
+						this.radiolist1.push({value:'餐饮'})
+					}
+					if(uni.getStorageSync("userInfo").homeEntry!=0){
+						this.radiolist1.push({value:'民宿'})
+					}
+					if(uni.getStorageSync("userInfo").hotelEntry!=0){
+						this.radiolist1.push({value:'酒店'})
+					}
+					if(e){
+						this.editshow = true
+					}
+				}else{
+					uni.showToast({
+						icon: "none",
+						title: '自动跳转开启失败',
+						duration: 3000
+					});	
+					this.userInfo.automaticSkip = status == 0 ? false : true
+				}
+			},
 			getList(){
 				 this.$request.baseRequest('admin.tourism.carouselManagement', 'list', {
 					page: 1,
@@ -281,6 +359,17 @@
 					url:url
 				})
 			},
+			updateUser(){
+				return new Promise((resolve, reject) => {
+					that.$request.baseRequest('admin.unimall.commonUserInfo', 'list', {
+					commonUserInfo:JSON.stringify(this.userInfo)
+				}, failres => {
+						reject(failres)
+					}).then(res => {
+						resolve(res)
+					})
+				})
+			},
 			async getPhoneNumber(e) {
 				that.userInfo = await this.$request.wxlogin()
 				that.userInfo.phone = await this.$request.getPhone(e, that.userInfo)

+ 1 - 1
uni_applet/pageA/login/index.vue

@@ -15,7 +15,7 @@
 					<u--image @click='value= !value' width='16' height='16' :src="value?'/static/image/login/checked.png':'/static/image/login/no-checked.png'" radius='10' shape="square"></u--image>
 				</view>
 				登录代表您已同意<navigator
-							url="/pageA/webview?can_share=false&url=https://liangxin.zthymaoyi.com/youyuquan.html"
+							url="/pageA/webview?can_share=false&url=liangxin.zthymaoyi.com/youyuquan.html"
 							class="path" hover-class="navigator-hover">用户服务协议和隐私政策</navigator>
 			</view>
 		</view>

+ 3 - 3
uni_applet/pageA/webview.vue

@@ -1,16 +1,16 @@
 <template>
-    <web-view :src="url"></web-view>
+    <web-view :src="url1"></web-view>
 </template>
 
 <script>
 	export default {
         data() {
             return {
-                url:""
+                url1:""
             }
         },
         onLoad(option) {
-            this.url = option.url;
+            this.url1 = option.url;
         },
         methods: {
         }

+ 49 - 6
uni_applet/pages/my/my.vue

@@ -25,7 +25,7 @@
 					</view>
 				</view>
 				<view>
-					<u-icon name="bell" color="#eaad1a" size="28"></u-icon>
+					<u-icon @click='todetail' name="bell" color="#eaad1a" size="28"></u-icon>
 				</view>
 			</view>
 
@@ -98,9 +98,10 @@
 				</u-cell-group>
 			</view>
 		</view>
-		<view class="exit" @click="exit" v-if="userInfo.phone">
+		<view v-if='userInfo.nickname' class='quit-login' @click='quitLogin'>退出账号</view>
+		<!-- <view class="exit" @click="exit" v-if="userInfo.phone">
 			退出账号
-		</view>
+		</view> -->
 		<login-pop-up ref='loginpopup' :content='"手机登录后才能查看我的哦~"'></login-pop-up>
 	</view>
 </template>
@@ -138,6 +139,39 @@
 			}
 		},
 		methods: {
+			todetail(){
+				uni.navigateTo({
+					url:"/pageA/notice/index"
+				})
+			},
+			quitLogin(){
+				uni.showModal({
+					title: '提示',
+					content: '确定退出当前账号?',
+					success (res) {
+					    if (res.confirm) {
+							uni.removeStorageSync("userInfo")
+							that.userInfo = {}
+							setTimeout(()=>{
+								that.reload()
+							},500)
+					    } else if (res.cancel) {
+					      console.log('用户点击取消')
+					    }
+					  }
+				})
+			},
+			reload() {
+			       // 页面重载
+			       const pages = getCurrentPages()
+			       // 声明一个pages使用getCurrentPages方法
+			       const curPage = pages[pages.length - 1]
+			       // 声明一个当前页面
+			       curPage.onLoad(curPage.options) // 传入参数
+			       curPage.onShow()
+			       curPage.onReady()
+			       // 执行刷新
+			   },
 			editNickName() {
 				this.$request.baseRequest('admin.unimall.commonUserInfo', 'update', {
 					commonUserInfo: JSON.stringify(this.userInfo)
@@ -235,9 +269,9 @@
 		font-size: 36rpx;
 		color: #8f8f94;
 	}
-
-	.wrap {
-		width: 92vw;
+	.wrap{
+		width:92vw;
+		padding:0 20rpx;
 	}
 
 	.orderList {
@@ -306,4 +340,13 @@
 		text-align: center;
 		padding: 20rpx;
 	}
+	.quit-login{
+		background:#fff;
+		width:91%;
+		padding:10rpx 20rpx;
+		text-align:center;
+		margin:10rpx 20rpx;
+		border-radius:10rpx;
+	}
+
 </style>

+ 30 - 0
uni_applet/uni_modules/lxm-fold-link/luyj-grid-link/components/luyj-grid-link/luyj-grid-link.vue

@@ -6,6 +6,9 @@
 				<view class="action">
 					<!-- <text class="cuIcon-title " :class="'text-'+item.color"></text> -->{{ item.title}}
 				</view>
+				<view  class='flex switchwrap' v-if='item.switch'>
+					<view style='margin-right:10rpx;'>自动跳转</view> <u-switch @change='switchChange'  v-model="item.switch_status" size="20" ></u-switch>
+				</view>
 			</view>
 			<!-- 宫格 -->
 			<view v-if="item.iconsList.length > 0" class="cu-list grid no-border solid-bottom "
@@ -58,8 +61,28 @@
 		data(){
 			return{
 				tabber_list : this.list,		// 列表 , 由于参数不可改变值
+				tabber_list1: [],
 			}
 		},
+		watch:{
+			"list": {
+			  handler: function () {
+				for(var i=0;i<this.list.length;i++){
+					var arr=[]
+					for(var q=0;q<this.list[i].iconsList.length;q++){
+						if(this.list[i].iconsList[q].status){
+							arr.push(this.list[i].iconsList[q])
+						}
+					}
+					this.list[i].iconsList = arr
+				}
+				console.log(this.list)
+				this.tabber_list= this.list
+			  },
+			  // 立即以obj.name的当前值触发回调
+			  immediate: true
+        }
+		},
 		created:function(){
 			
 		},
@@ -79,6 +102,10 @@
 					this.$emit("gridExc" ,e);			// 点击某一宫格时执行方法
 				}
 			},
+			switchChange(e){
+				console.log(e)
+				this.$emit("switchChange" ,e);
+			},
 			/** 展开或折叠当前宫格
 			 * @param {Object} e
 			 */
@@ -99,4 +126,7 @@
 .iconfont{
 	font-size:100rpx;
 }
+.switchwrap{
+	margin-right:20rpx;
+}
 </style>