Commit ece1c945 authored by mengcuiguang2's avatar mengcuiguang2

Merge branch 'dev_1.0.0' of http://39.97.65.143:81/android/android_street into dev_1.0.0

parents 32cbdbf8 20f466f9
...@@ -76,7 +76,7 @@ var vm = new Vue({ ...@@ -76,7 +76,7 @@ var vm = new Vue({
point = B_MAP.getCenter(); point = B_MAP.getCenter();
} }
console.log(this.NOWUSEBAIDU,point) console.log(this.NOWUSEBAIDU, point)
getLocation(point, function (res) { getLocation(point, function (res) {
if (res.c) { if (res.c) {
...@@ -107,9 +107,13 @@ var vm = new Vue({ ...@@ -107,9 +107,13 @@ var vm = new Vue({
} }
}, },
initZsMap: function (pointStr) { initZsMap: function (pointStr) {
console.log(">>>>>>",pointStr) console.log(">>>>>>>>>>>>>>",pointStr)
var th = this; var th = this;
var inMsg = JSON.parse(pointStr) var inMsg = JSON.parse(pointStr)
if (inMsg.lat == 0 || inMsg.lng == 0 ||
inMsg.lat == '0' || inMsg.lng == '0') {
inMsg = {"lat": 39.90960456049752, "lng": 116.3972282409668, "inner": 0};
}
var point = {lat: parseFloat(inMsg.lat), lng: parseFloat(inMsg.lng)}; var point = {lat: parseFloat(inMsg.lat), lng: parseFloat(inMsg.lng)};
if (inMsg.inner == null) { if (inMsg.inner == null) {
getLocation(point, function (res) { getLocation(point, function (res) {
...@@ -211,13 +215,12 @@ var vm = new Vue({ ...@@ -211,13 +215,12 @@ var vm = new Vue({
}, },
B_initmap: function (point, zoomLevel) { B_initmap: function (point, zoomLevel) {
this.NOWUSEBAIDU = true; this.NOWUSEBAIDU = true;
console.log("initB==>", point, zoomLevel)
// setTimeout(function () { // setTimeout(function () {
if (zoomLevel == undefined || zoomLevel == null) if (zoomLevel == undefined || zoomLevel == null)
zoomLevel = 6; zoomLevel = 6;
var th = vm; var th = vm;
if (th.B_MAPINITED == false) { if (th.B_MAPINITED == false) {
console.log(">>>>>>>initB==>", point, zoomLevel)
th.B_MAPINITED = true; th.B_MAPINITED = true;
// 百度地图API功能 // 百度地图API功能
// $("#map").hide(); // $("#map").hide();
...@@ -247,15 +250,13 @@ var vm = new Vue({ ...@@ -247,15 +250,13 @@ var vm = new Vue({
}); });
} else { } else {
B_MAP.centerAndZoom(new BMap.Point(point.lng, point.lat), zoomLevel); // 初始化地图,设置中心点坐标和地图级别 B_MAP.centerAndZoom(new BMap.Point(point.lng, point.lat), zoomLevel); // 初始化地图,设置中心点坐标和地图级别
setTimeout(function(){ setTimeout(function(){
B_MAP.centerAndZoom(new BMap.Point(point.lng, point.lat), zoomLevel); // 初始化地图,设置中心点坐标和地图级别 B_MAP.centerAndZoom(new BMap.Point(point.lng, point.lat), zoomLevel); // 初始化地图,设置中心点坐标和地图级别
},500) },500)
console.log(">>>>>>>", point, B_MAP.getCenter())
//console.log(">>>>>>>", point, B_MAP.getCenter())
console.log(">>>>>>>cB==>", B_MAP.getCenter().lat, B_MAP.getCenter().lng, zoomLevel)
} }
// },500) // },500)
}, },
...@@ -293,11 +294,11 @@ var vm = new Vue({ ...@@ -293,11 +294,11 @@ var vm = new Vue({
G_MAP.setCenter(point) G_MAP.setCenter(point)
} }
// if (!this.NOWUSEBAIDU && this.B_MAPINITED) { if (!this.NOWUSEBAIDU && this.B_MAPINITED) {
// var bpoint = toBPoint(point) var bpoint = toBPoint(point)
// console.log("同步百度中心") console.log("同步百度中心")
// B_MAP.setCenter(bpoint) B_MAP.setCenter(bpoint)
// } }
} }
} }
}) })
...@@ -306,7 +307,6 @@ var vm = new Vue({ ...@@ -306,7 +307,6 @@ var vm = new Vue({
window.onload = function () { window.onload = function () {
// console.log("window.load_+++++++++++=")170.89184781519282,-9.108152184807182 // console.log("window.load_+++++++++++=")170.89184781519282,-9.108152184807182
allIsOk(); allIsOk();
//vm.initZsMap('{"lat": 39.30336768549658, "lng": 350.8918478151928}')
} }
......
...@@ -47,9 +47,13 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel ...@@ -47,9 +47,13 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
private var gps = GPS(39.915121, 116.403947,0) private var gps = GPS(39.915121, 116.403947,0)
inner class MyLocationListener : BDLocationListener { inner class MyLocationListener : BDLocationListener {
override fun onReceiveLocation(location: BDLocation?) { override fun onReceiveLocation(location: BDLocation?) {//4.9E-324 4.9E-324
if( location?.latitude == 4.9E-324 ||location?.longitude == 4.9E-324){
return
}
gps.lat = location?.latitude?:39.915121 gps.lat = location?.latitude?:39.915121
gps.lng = location?.longitude?:116.403947 gps.lng = location?.longitude?:116.403947
KLog.e("onReceiveLocation","${location?.latitude} --- ${location?.longitude}")
} }
} }
......
...@@ -261,40 +261,43 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE ...@@ -261,40 +261,43 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE
var positioningBean: PositioningBean? = null var positioningBean: PositioningBean? = null
inner class MyLocationListener : BDLocationListener { inner class MyLocationListener : BDLocationListener {
override fun onReceiveLocation(location: BDLocation) { override fun onReceiveLocation(location: BDLocation?) {
if( location?.latitude == 4.9E-324 ||location?.longitude == 4.9E-324){
return
}
if (sp == null) { if (sp == null) {
sp = SPUtils.getInstance(SPUtils.POSITIONING_MAP) sp = SPUtils.getInstance(SPUtils.POSITIONING_MAP)
} }
if (positioningBean == null) { if (positioningBean == null) {
positioningBean = PositioningBean() positioningBean = PositioningBean()
} }
positioningBean?.latitude = location.latitude positioningBean?.latitude = location?.latitude
positioningBean?.longitude = location.longitude positioningBean?.longitude = location?.longitude
positioningBean?.countryCode = location.countryCode positioningBean?.countryCode = location?.countryCode
positioningBean?.country = location.country positioningBean?.country = location?.country
positioningBean?.province = location.province positioningBean?.province = location?.province
positioningBean?.city = location.city positioningBean?.city = location?.city
positioningBean?.district = location.district positioningBean?.district = location?.district
positioningBean?.town = location.town positioningBean?.town = location?.town
positioningBean?.street = location.street positioningBean?.street = location?.street
positioningBean?.addrStr = location.addrStr positioningBean?.addrStr = location?.addrStr
sp?.encode(SPUtils.POSITIONING_MAP, Gson().toJson(positioningBean).toString()) sp?.encode(SPUtils.POSITIONING_MAP, Gson().toJson(positioningBean).toString())
// MapView 销毁后不在处理新接收的位置 // MapView 销毁后不在处理新接收的位置
mBaiduMap?.apply { mBaiduMap?.apply {
mCurrentLat = location.latitude mCurrentLat = location?.latitude?:0.0
mCurrentLon = location.longitude mCurrentLon = location?.longitude?:0.0
mCurrentAccracy = location.radius mCurrentAccracy = location?.radius?:0f
myLocationData = MyLocationData.Builder() myLocationData = MyLocationData.Builder()
.accuracy(location.radius) // 设置定位数据的精度信息,单位:米 .accuracy(location?.radius?:0f) // 设置定位数据的精度信息,单位:米
.direction(mCurrentDirection.toFloat()) // 此处设置开发者获取到的方向信息,顺时针0-360 .direction(mCurrentDirection.toFloat()) // 此处设置开发者获取到的方向信息,顺时针0-360
.latitude(location.latitude) .latitude(location?.latitude?:0.0)
.longitude(location.longitude) .longitude(location?.longitude?:0.0)
.build() .build()
this.setMyLocationData(myLocationData) this.setMyLocationData(myLocationData)
if (isFirstLoc) { if (isFirstLoc) {
isFirstLoc = false isFirstLoc = false
val ll = LatLng(location.latitude, location.longitude) val ll = LatLng(location?.latitude?:0.0, location?.longitude?:0.0)
val builder = MapStatus.Builder() val builder = MapStatus.Builder()
builder.target(ll).zoom(18.0f) builder.target(ll).zoom(18.0f)
this.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build())) this.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()))
......
...@@ -2,7 +2,6 @@ package com.mints.street.main.my ...@@ -2,7 +2,6 @@ package com.mints.street.main.my
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.Dialog import android.app.Dialog
import android.content.Intent
import android.graphics.Color import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.text.TextUtils import android.text.TextUtils
...@@ -22,21 +21,15 @@ import com.mints.street.bean.PaymentBean ...@@ -22,21 +21,15 @@ import com.mints.street.bean.PaymentBean
import com.mints.street.bean.VipBean import com.mints.street.bean.VipBean
import com.mints.street.bean.WxPayParamBean import com.mints.street.bean.WxPayParamBean
import com.mints.street.databinding.ActivityOpenvipBinding import com.mints.street.databinding.ActivityOpenvipBinding
import com.mints.street.main.MainActivity
import com.mints.street.manager.UserManager import com.mints.street.manager.UserManager
import com.mints.street.utils.json.JsonUtil
import com.mints.street.widget.dialog.DialogListener import com.mints.street.widget.dialog.DialogListener
import com.mints.street.widget.dialog.DialogUtils import com.mints.street.widget.dialog.DialogUtils
import com.mints.street.widget.dialog.WxLoginDialog import com.mints.street.widget.dialog.WxLoginDialog
import kotlinx.android.synthetic.main.activity_openvip.* import kotlinx.android.synthetic.main.activity_openvip.*
import kotlinx.android.synthetic.main.activity_openvip.bt_try
import kotlinx.android.synthetic.main.fragment_my.*
import kotlinx.android.synthetic.main.include_header.* import kotlinx.android.synthetic.main.include_header.*
import me.goldze.mvvmhabit.base.AppManager
import me.goldze.mvvmhabit.utils.AppUtils import me.goldze.mvvmhabit.utils.AppUtils
import me.goldze.mvvmhabit.utils.KLog import me.goldze.mvvmhabit.utils.KLog
import me.goldze.mvvmhabit.utils.ToastUtils import me.goldze.mvvmhabit.utils.ToastUtils
import me.goldze.mvvmhabit.utils.systembar.StatusBarUtil
class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>(), View.OnClickListener { class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>(), View.OnClickListener {
...@@ -59,10 +52,10 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>() ...@@ -59,10 +52,10 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
override fun initData() { override fun initData() {
super.initData() super.initData()
//获取vip福利信息 //获取vip福利信息
viewModel.getVipProductsByType() viewModel.getVipProductsByType()
//获取支付方式 //获取支付方式
viewModel.getpaymentwey("android") viewModel.getpaymentwey("android")
initView() initView()
initListener() initListener()
...@@ -81,7 +74,7 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>() ...@@ -81,7 +74,7 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
ly_weixin.setOnClickListener(this) ly_weixin.setOnClickListener(this)
ly_alipay.setOnClickListener(this) ly_alipay.setOnClickListener(this)
loginDialog.setListener(object:WxLoginDialog.WxLoginListener{ loginDialog.setListener(object : WxLoginDialog.WxLoginListener {
override fun loginSuc(wxInfo: String) { override fun loginSuc(wxInfo: String) {
viewModel.wechatlogin(wxInfo) viewModel.wechatlogin(wxInfo)
} }
...@@ -113,6 +106,13 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>() ...@@ -113,6 +106,13 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
list.add(page5) list.add(page5)
list.add(page8) list.add(page8)
// page1.setOnClickListener {
// if (UserManager.INSTANCE.userIsLogin()) {
// payVip()
// } else {
// loginDialog.show()
// }
// }
//设置显示的数据 //设置显示的数据
cfp_data_viewpager.setViewList(list) cfp_data_viewpager.setViewList(list)
...@@ -165,6 +165,17 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>() ...@@ -165,6 +165,17 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
mAdapter = DelegateAdapter(vLayout, false) mAdapter = DelegateAdapter(vLayout, false)
binding.listview.adapter = mAdapter binding.listview.adapter = mAdapter
binding.listview.layoutManager = vLayout binding.listview.layoutManager = vLayout
}
//添加page点击时间
fun pageOnClick(view: View?) {
if (UserManager.INSTANCE.userIsLogin()) {
payVip()
} else {
loginDialog.show()
}
} }
override fun initViewObservable() { override fun initViewObservable() {
...@@ -191,7 +202,7 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>() ...@@ -191,7 +202,7 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
} }
}) })
viewModel.isPaySuc.observe(this, Observer<Boolean> { viewModel.isPaySuc.observe(this, Observer<Boolean> {
if(it){ if (it) {
finish() finish()
} }
}) })
...@@ -217,6 +228,13 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>() ...@@ -217,6 +228,13 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
} }
}) })
viewModel.isloginSuc.observe(this, Observer {
if (it) {
payVip()
} else {
ToastUtils.showLong("登录失败")
}
})
} }
...@@ -359,7 +377,7 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>() ...@@ -359,7 +377,7 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
KLog.e("OpenvipActivity","onResume") KLog.e("OpenvipActivity", "onResume")
// if(userManager.userIsLogin()&&userManager.getVipFlag()){ // if(userManager.userIsLogin()&&userManager.getVipFlag()){
// finish() // finish()
// } // }
......
...@@ -110,6 +110,7 @@ class OpenvipViewModel(application: Application) : BaseViewModel(application) { ...@@ -110,6 +110,7 @@ class OpenvipViewModel(application: Application) : BaseViewModel(application) {
) )
} }
var isloginSuc: MutableLiveData<Boolean> = MutableLiveData()
fun wechatlogin(wxInfo: String) { fun wechatlogin(wxInfo: String) {
val vo = HashMap<String, Any>() val vo = HashMap<String, Any>()
vo["wxInfo"] = wxInfo vo["wxInfo"] = wxInfo
...@@ -125,11 +126,13 @@ class OpenvipViewModel(application: Application) : BaseViewModel(application) { ...@@ -125,11 +126,13 @@ class OpenvipViewModel(application: Application) : BaseViewModel(application) {
KLog.e("wechatlogin","微信登录接口成功") KLog.e("wechatlogin","微信登录接口成功")
ToastUtils.showLong("登录成功") ToastUtils.showLong("登录成功")
isloginSuc.value=true
} }
override fun onError(e: Throwable) { override fun onError(e: Throwable) {
super.onError(e) super.onError(e)
KLog.e("wechatlogin", "微信登录接口失败") KLog.e("wechatlogin", "微信登录接口失败")
isloginSuc.value=false
} }
}) })
} }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
android:background="@mipmap/icon_card" android:background="@mipmap/icon_card"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingTop="20dp"> android:paddingTop="20dp"
android:onClick="pageOnClick">
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
android:background="@mipmap/icon_card1" android:background="@mipmap/icon_card1"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingTop="20dp"> android:paddingTop="20dp"
android:onClick="pageOnClick">
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -5,5 +5,6 @@ ...@@ -5,5 +5,6 @@
android:background="@mipmap/icon_card2" android:background="@mipmap/icon_card2"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingTop="20dp"> android:paddingTop="20dp"
android:onClick="pageOnClick">
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -5,5 +5,6 @@ ...@@ -5,5 +5,6 @@
android:background="@mipmap/icon_card3" android:background="@mipmap/icon_card3"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingTop="20dp"> android:paddingTop="20dp"
android:onClick="pageOnClick">
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
android:background="@mipmap/icon_card4" android:background="@mipmap/icon_card4"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingTop="20dp"> android:paddingTop="20dp"
android:onClick="pageOnClick">
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
android:background="@mipmap/icon_card5" android:background="@mipmap/icon_card5"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingTop="20dp"> android:paddingTop="20dp"
android:onClick="pageOnClick">
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
android:background="@mipmap/icon_card6" android:background="@mipmap/icon_card6"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingTop="20dp"> android:paddingTop="20dp"
android:onClick="pageOnClick">
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
android:background="@mipmap/icon_card7" android:background="@mipmap/icon_card7"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingTop="20dp"> android:paddingTop="20dp"
android:onClick="pageOnClick">
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment