作者 xuqiang

提交

... ... @@ -2,7 +2,6 @@
import userlist from './commen/tim/user'
export default {
mounted() {
console.log('========================及时通讯预处理 开始 ======================')
/**官网有很多关于关于sdk 其他的监听方法(比如:有新的消息,用户资料更新等等)
* 详情可对照: https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html
* 监听的含义:服务端发生了数据变更---前端全局可以接收到变更通知--前端就可以自动触发某个事件来更新相应数据
... ... @@ -15,14 +14,12 @@
this.tim.on(this.$TIM.EVENT.CONVERSATION_LIST_UPDATED, event => {
this.$store.commit("updateConversationList", event.data);
});
console.log('========================及时通讯预处理 结束 ======================')
},
methods: {
onReadyStateUpdate({name}) {
const isSDKReady = name === this.$TIM.EVENT.SDK_READY ? true : false;
//自动监听并更新 sdk 的ready 状态 (未登录是 notReady 登录后是ready)
console.log('======================登录触发了SDK_READY 事件',isSDKReady)
this.$store.commit("toggleIsSDKReady", isSDKReady);
//sdk ready 后 肯定完成了登录操作 这里可以获取用户存储在im的基础信息/离线消息/黑名单列表
},
... ...
... ... @@ -12,8 +12,8 @@
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : false,
"waiting" : false,
"autoclose" : true,
"waiting" : true,
"autoclose" : false,
"delay" : 0
},
/* 模块配置 */
... ...
... ... @@ -64,7 +64,21 @@
{
"path": "pages/index/index",
"style": {
"navigationStyle": "custom"
"navigationStyle": "custom",
"app-plus": {
"subNVues": [{
"id": "landAlert", // 唯一标识
"path": "pages/index/subnvue/landAlert", // 页面路径
"type": "popup", //这里不需要
"style": {
"background": "transparent",
"margin": "auto",
"width": "588rpx",
"height": "836rpx",
"border-radius": "30rpx"
}
}]
}
}
},
{
... ...
<template>
<view>
<map id="around-food-map" @regionchange="regionchange" :style="{width: '100%',height:mapHeight + 'px'}" :scale="scale" :layer-style="'2'" :latitude="latitude" :longitude="longitude" :markers="covers"></map>
<!-- @markertap="markertap" -->
<map id="around-food-map" @regionchange="regionchange" :style="{width: '100%',height:mapHeight + 'px'}" :scale="scale" :layer-style="'2'" @markertap="markertap" :latitude="latitude" :longitude="longitude" :markers="covers"></map>
<!-- 查询地址区域 -->
<view class="searchWrap" :style="{top:statusBarHeight + 'rpx'}">
<view class="searchTab">
... ... @@ -30,7 +29,7 @@
<view class="positionWrap" @click="position" :style="{bottom:'400rpx'}">
<image style="width: 90rpx;height: 90rpx;" src="../../static/image/dingwei.png" mode=""></image>
</view>
<touch-slide v-if="landList.length > 0" style="background-color: #509d94;" :landIndex="0" :showSlide="landList[0].showSlide" @callback="callback" :top="mapHeight - 170" :bottom="mapHeight - (landList.length > 1 ? 40 : 0)" :titleHeight="30">
<touch-slide v-if="landList.length > 0" style="background-color: #509d94;" :landIndex="0" :showSlide="landList[0].showSlide" @callback="callback" :top="mapHeight - 180" :bottom="mapHeight - (landList.length > 1 ? 40 : 10)" :titleHeight="30">
<view class="handleLine" slot="title">
<view class="line"></view>
</view>
... ... @@ -96,7 +95,7 @@
</view>
</view>
</touch-slide>
<touch-slide v-if="landList.length > 1" style="background-color: #85cbc3;" :landIndex="1" :showSlide="landList[1].showSlide" @callback="callback" :top="mapHeight - 170" :bottom="mapHeight - (landList.length > 2 ? 10 : 0)" :titleHeight="30">
<touch-slide v-if="landList.length > 1" style="background-color: #85cbc3;" :landIndex="1" :showSlide="landList[1].showSlide" @callback="callback" :top="mapHeight - 180" :bottom="mapHeight - 10" :titleHeight="30">
<view class="handleLine" slot="title">
<view class="line"></view>
</view>
... ... @@ -162,7 +161,7 @@
</view>
</view>
</touch-slide>
<touch-slide v-for="(item,index) in landList" :key="index" v-if="index > 1 && landList.length > index && landList[index-1].showSlide" :style="{'background-color': (index)%2 == 0 ? '#509d94' : '#85cbc3'}" :landIndex="index" @callback="callback" :top="mapHeight - 170" :bottom="mapHeight - (landList.length > 3 ? 10 : 0)" :titleHeight="30">
<touch-slide v-for="(item,index) in landList" :key="index" v-if="index > 1 && landList.length > index && landList[index-1].showSlide" :style="{'background-color': (index)%2 == 0 ? '#509d94' : '#85cbc3'}" :landIndex="index" @callback="callback" :top="mapHeight - 180" :bottom="mapHeight - 10" :titleHeight="30">
<view class="handleLine" slot="title">
<view class="line"></view>
</view>
... ... @@ -242,20 +241,6 @@
</view>
</scroll-view>
</view>
<!-- 成为地主弹框区域 -->
<view class="becomeLandWrap" v-if="showBecomeLand" @click="showBecomeLand = false">
<view class="becomeLand">
<view class="becomeLandImg">
<image style="width: 588rpx;height: 656rpx;border-top-left-radius: 30rpx;border-top-right-radius: 30rpx;" :src="becomeLandImg" mode="aspectFill"></image>
<image @click="showBecomeLand = false" class="closeBtn" src="../../static/image/close.png" mode=""></image>
</view>
<view class="bottomBtnWrap">
<view class="bottomBtn" @click="agree">
<text style="text-align: center;line-height: 78rpx;color: #fff;font-size: 32rpx;">成为地主</text>
</view>
</view>
</view>
</view>
</view>
</template>
... ... @@ -282,7 +267,6 @@
statusBarHeight:'',
showSearchLand:false,//展示查询地主列表弹框
addressList:[],
showBecomeLand:false,//展示成为地主弹框
becomeLandImg:'',//成为地主弹框图片
showLandInfo:false
}
... ... @@ -397,30 +381,23 @@
}
},
onLoad(option) {
this.getAllData()
//地主列表页返回的首个地主的经纬度
if(option.longitude != undefined){
this.longitude = option.longitude
this.latitude = option.latitude
}
//如果登录人是游侠第一次登录弹出成为地主弹框
if(this.userinfo.group_id == '1' && uni.getStorageSync('landAlertFlag') != this.userinfo.id){
this.showBecomeLand = true
uni.setStorage({
key: 'landAlertFlag',
data: this.userinfo.id
});
//获取成为地主图片
uni.request({
url:apiUrl+'/common/getConfig',
method:'POST',
data:{type:'1'},
success: (res) => {
this.becomeLandImg = res.data.data.landlord_index
}
})
// #ifdef APP-PLUS
const subNVue = uni.getSubNVueById('landAlert');
subNVue.show('none', 250);
// #endif
}
this.getAllData()
//地主列表页返回的首个地主的经纬度
if(option.longitude != undefined){
this.longitude = option.longitude
this.latitude = option.latitude
}
//获取系统信息
uni.getSystemInfo({
... ... @@ -638,36 +615,39 @@
}
})
},
//成为地主
agree(){
this.showBecomeLand = false
uni.navigateTo({
url:'/pages/my/becomeLand'
})
},
//点击标记点
markertap(e){
this.showSlide = true
this.markerId = e.detail.markerId
if(e.detail.markerId != 'me'){
let changeLand
for(let i = 0; i < this.allLandList.length; i ++){
if(this.allLandList[i].id == e.detail.markerId){
this.latitude = this.allLandList[i].latitude
this.longitude = this.allLandList[i].longitude
changeLand = this.landList[i]
this.landList[i] = this.landList[0]
this.landList[0] = changeLand
}
}
this.allLandList.forEach(item=>{
if(item.id == e.detail.markerId){
this.latitude = item.latitude
this.longitude = item.longitude
this.landList[0] = item
}
let landArr = this.landList
console.log('=======变更前======',this.landList)
let coverArr = []
let index = 0
this.landList = []
coverArr.push(this.covers[0])
let changeLand
for(let i = 0; i < landArr.length; i ++){
coverArr.push({
id:landArr[i].id,
latitude:landArr[i].latitude,
longitude:landArr[i].longitude,
iconPath: landArr[i].id == e.detail.markerId ? '../../static/image/group_675_choose.png' : '../../static/image/Group_675.png'
})
if(landArr[i].id == e.detail.markerId){
changeLand = landArr[i]
landArr[i] = landArr[0]
landArr[0] = changeLand
landArr[i].showSlide = false
landArr[0].showSlide = true
}else{
landArr[i].showSlide = false
}
}
console.log('=======变更后======',landArr)
this.covers = coverArr
setTimeout(()=>{
this.landList = landArr
},200)
},
newsClick(){
uni.navigateTo({
... ... @@ -885,48 +865,6 @@
height: 90rpx;
right: 32rpx;
}
/* 成为地主弹框区域 */
.becomeLandWrap{
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0,0,0,0.5);
flex-direction: row;
justify-content: center;
padding-top: 230rpx;
.becomeLand{
width: 588rpx;
height: 756rpx;
background-color: #fff;
border-radius: 30rpx;
z-index:1;
.becomeLandImg{
position: relative;
width: 588rpx;height: 656rpx;
.closeBtn{
position: absolute;
width: 40rpx;
height: 40rpx;
top: 20rpx;
right: 20rpx;
}
}
.bottomBtnWrap{
height: 100rpx;
flex-direction: row;
justify-content: center;
align-items: center;
.bottomBtn{
height: 78rpx;
width: 250rpx;
border-radius: 50rpx;
background: #35655f;
}
}
}
}
.changeList{flex-direction: row;justify-content: flex-end;padding-right: 22rpx;height: 80rpx;}
.landInfoWrap{height: 496rpx;padding: 0 50rpx;position: relative;}
... ...
<template>
<view>
<view class="closeBtn">
<image style="width: 44rpx;height: 44rpx;" src="../../../static/image/guanbi-70_1@2x.png" mode=""></image>
</view>
<view class="becomeLand">
<view class="becomeLandImg">
<image style="width: 588rpx;height: 656rpx;border-top-left-radius: 30rpx;border-top-right-radius: 30rpx;" :src="becomeLandImg" mode="aspectFill"></image>
</view>
<view class="bottomBtnWrap">
<view class="bottomBtn" @click="agree">
<text style="text-align: center;line-height: 78rpx;color: #fff;font-size: 32rpx;">成为地主</text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data(){
return{
becomeLandImg:''
}
},
onLoad() {
//获取成为地主图片
uni.request({
url:'http://app.zhaodizhu.cn/api/common/getConfig',
method:'POST',
data:{type:'1'},
success: (res) => {
this.becomeLandImg = res.data.data.landlord_index
}
})
},
methods:{
agree(){
if(uni.getStorageSync("token")){
const subNVue = uni.getSubNVueById('landAlert')
// 关闭 nvue 子窗体
subNVue.hide('fade-out', 300)
uni.navigateTo({
url:'/pages/my/becomeLand'
})
}else{
uni.navigateTo({
url:"/pages/index/login"
})
}
}
}
}
</script>
<style>
/* 成为地主弹框 */
.closeBtn{flex-direction: row;height: 80rpx;align-items: center;justify-content: flex-end;}
.becomeLand{
width: 588rpx;
height: 756rpx;
background-color: #fff;
border-radius: 30rpx;
}
.becomeLandImg{
width: 588rpx;height: 656rpx;
}
.bottomBtnWrap{
height: 100rpx;
flex-direction: row;
justify-content: center;
align-items: center;
}
.bottomBtnWrap .bottomBtn{height: 78rpx;width: 250rpx;border-radius: 50rpx;background: #35655f;}
</style>
... ...
... ... @@ -27,7 +27,7 @@
<view class="recDol">¥</view><input type="number" @input="validateNumber" v-model="param.price" placeholder="请输入提现金额" placeholder-style="color:#c8c9cc"/>
</view>
<view class="turnTxt">
可提现金额{{wallet.gift_tx}}<text @click="param.price = wallet.gift_money">全部提现</text>
可提现金额{{wallet.gift_tx}}<text @click="param.price = wallet.gift_tx">全部提现</text>
</view>
</view>
<view class="bottomBtnWrap">
... ...