diff --git a/common/http.interceptor.js b/common/http.interceptor.js
index 8d19cd7..bdae802 100644
--- a/common/http.interceptor.js
+++ b/common/http.interceptor.js
@@ -1,26 +1,6 @@
const install = (Vue, vm) => {
-
- // Vue.prototype.$u.http.setConfig({
-
- // baseURL: 'https://yruibao.com/admin',
-
- // // baseUrl: 'http://192.168.10.104:8088',
- // method: 'POST',
- // // 设置为json,返回后会对数据进行一次JSON.parse()
- // dataType: 'json',
- // showLoading: true, // 是否显示请求中的loading
- // loadingText: '...', // 请求loading中的文字提示
- // loadingTime: 800, // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
- // originalData: false, // 是否在拦截器中返回服务端的原始数据
- // loadingMask: true, // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
- // // 配置请求头信息
- // header: {
- // 'content-type': 'application/json;charset=UTF-8',
-
- // },
- // });
Vue.prototype.$u.http.setConfig({
- baseUrl: 'http://192.168.2.23/dev-api',
+ baseUrl: 'http://192.168.2.243:3100/dev-api',
// baseUrl: 'https://znb.ccttiot.com',
loadingText: '努力加载中~',
loadingTime: 800,
@@ -34,23 +14,7 @@ const install = (Vue, vm) => {
// 请求拦截部分,如配置,每次请求前都会执行
Vue.prototype.$u.http.interceptor.request = (config) => {
- // 引用token
- // 方式一,存放在vuex的token,假设使用了uView封装的vuex方式
- // 见:https://uviewui.com/components/globalVariable.html
- // config.header.token = vm.token;
-
- // 方式二,如果没有使用uView封装的vuex方法,那么需要使用$store.state获取
- // config.header.token = vm.$store.state.token;
-
- // 方式三,如果token放在了globalData,通过getApp().globalData获取
-
- // 方式四,如果token放在了Storage本地存储中,拦截是每次请求都执行的
- // 所以哪怕您重新登录修改了Storage,下一次的请求将会是最新值
const token = uni.getStorageSync('token');
-
- // const token = " eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImE1ZmE2YzM0LWM0Y2YtNGEwMS05YjY2LTE1M2M4YWY1YzU1YSJ9.Wze_tAjY7cCfw2K6mtDpTSd-QFLRF4A49Fx7bq7g2tVLKL4v5bqqHfpG0VQy7_a_CUQch5RPBTBIKMVCDupIqg"
-
- // console.log("我是token", token)
config.header.Authorization = token;
// config.header.Tenant-Id=1
// #ifdef H5
@@ -67,42 +31,10 @@ const install = (Vue, vm) => {
// 响应拦截,如配置,每次请求结束都会执行本方法
Vue.prototype.$u.http.interceptor.response = (res) => {
- // if(res.code == 10022 || res.code == 10023) {
- // // res为服务端返回值,可能有code,result等字段
- // // 这里对res.result进行返回,将会在this.$u.post(url).then(res => {})的then回调中的res的到
- // // 如果配置了originalData为true,请留意这里的返回值
- // uni.redirectTo({
- // url:"/pages/login/login",
- // fail:function(mes){
- // console.log(mes)
- // },
- // success:function(mes){
- // console.log(mes)
- // }
- // })
- // // return res.result;
- // }
if(res.code == 401) {
- // res为服务端返回值,可能有code,result等字段
- // 这里对res.result进行返回,将会在this.$u.post(url).then(res => {})的then回调中的res的到
- // 如果配置了originalData为true,请留意这里的返回值
-
- // return res.result;
-
uni.login({
success: function(ret) {
console.log("main.js==>res", ret)
- // vm.$u.post('/user/login',{"js_code": ret.code}).then(res=>{
- // if (res.code == 10003) {
- // // console.log("新用户登录")
- // uni.setStorageSync('token', res.data);
-
- // } else if (res.code == 200) {
- // // console.log("老用户登录",res.data)
- // uni.setStorageSync('token', res.data);
-
- // }
- // });
}
});
wx.login({
@@ -134,19 +66,6 @@ const install = (Vue, vm) => {
}
return res;
- // else if(res.code == 201) {
- // // 假设201为token失效,这里跳转登录
- // vm.$u.toast('验证失败,请重新登录');
- // setTimeout(() => {
- // // 此为uView的方法,详见路由相关文档
- // vm.$u.route('/pages/user/login')
- // }, 1500)
- // return false;
- // } else {
- // // 如果返回false,则会调用Promise的reject回调,
- // // 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中,res为服务端的返回值
- // return false;
- // }
}
}
diff --git a/manifest.json b/manifest.json
index 58d727e..69005af 100644
--- a/manifest.json
+++ b/manifest.json
@@ -17,7 +17,13 @@
"delay" : 0
},
/* 模块配置 */
- "modules" : {},
+ "modules" : {
+ "Geolocation" : {},
+ "Maps" : {},
+ "Payment" : {},
+ "Barcode" : {},
+ "Camera" : {}
+ },
/* 应用发布信息 */
"distribute" : {
/* android打包配置 */
@@ -43,7 +49,28 @@
/* ios打包配置 */
"ios" : {},
/* SDK配置 */
- "sdkConfigs" : {}
+ "sdkConfigs" : {
+ "geolocation" : {
+ "baidu" : {
+ "__platform__" : [ "ios", "android" ],
+ "appkey_ios" : "",
+ "appkey_android" : ""
+ }
+ },
+ "maps" : {
+ "baidu" : {
+ "appkey_ios" : "",
+ "appkey_android" : ""
+ }
+ },
+ "payment" : {
+ "weixin" : {
+ "__platform__" : [ "ios", "android" ],
+ "appid" : "wx0fec9148db16a4bc",
+ "UniversalLinks" : ""
+ }
+ }
+ }
}
},
/* 快应用特有相关 */
@@ -51,9 +78,10 @@
/* 小程序特有相关 */
"mp-weixin" : {
"libVersion" : "latest",
- "appid" : "wx3914d4d7441fb438",
+ "appid" : "wxbbe52b5414ab65ac",
"setting" : {
- "urlCheck" : false
+ "urlCheck" : false,
+ "minified" : true
},
"usingComponents" : true,
"optimization" : {
@@ -63,7 +91,8 @@
"scope.userLocation" : {
"desc" : "获取位置查看周围的充电宝设备"
}
- }
+ },
+ "requiredPrivateInfos" : [ "getLocation", "chooseAddress", "chooseLocation" ]
},
"mp-alipay" : {
"usingComponents" : true
diff --git a/page_user/about.vue b/page_user/about.vue
new file mode 100644
index 0000000..27033f8
--- /dev/null
+++ b/page_user/about.vue
@@ -0,0 +1,92 @@
+
+
+
+
+
+ {{obj.title}}
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/page_user/ditu.vue b/page_user/ditu.vue
new file mode 100644
index 0000000..dcbe8a5
--- /dev/null
+++ b/page_user/ditu.vue
@@ -0,0 +1,393 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{listobj.name}}
+
+
+ {{listobj.address}}
+
+
+ 营业时间:{{listobj.businessTimeStart}}-{{listobj.businessTimeEnd}}
+
+
+
+
+ 可租借
+ 可归还
+ 已还满
+
+
+
+ 到这去
+
+
+ 扫码充电
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/page_user/hezuo/index.vue b/page_user/hezuo/index.vue
new file mode 100644
index 0000000..a726edf
--- /dev/null
+++ b/page_user/hezuo/index.vue
@@ -0,0 +1,155 @@
+
+
+
+
+
+
+
+ 您的手机号
+
+
+
+
+ 验证码
+
+ 获取验证码
+
+
+
+ 合作意向
+
+
+
+
+ 马上加盟
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/page_user/jifei.vue b/page_user/jifei.vue
new file mode 100644
index 0000000..8eac787
--- /dev/null
+++ b/page_user/jifei.vue
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+ 计费模式
+
+
+ {{item.name}}
+
+
+
+
+ 计费金额 元/小时
+
+
+ 封顶金额 元/天
+
+
+ 免费时长 分钟
+
+
+
+ 保存
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/page_user/shopdetail.vue b/page_user/shopdetail.vue
new file mode 100644
index 0000000..5bcfc67
--- /dev/null
+++ b/page_user/shopdetail.vue
@@ -0,0 +1,228 @@
+
+
+
+
+
+ {{listobj.name}}
+
+
+
+ 基本信息
+
+
+ 绑定设备: {{listobj.deviceCount}}
+
+
+ 营业时间: {{listobj.businessTimeStart}}~{{listobj.businessTimeEnd}}
+
+
+ 详细地址: {{listobj.address}}
+
+
+ 创建时间: {{listobj.createTime}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/page_user/shopedit.vue b/page_user/shopedit.vue
new file mode 100644
index 0000000..57ae2ce
--- /dev/null
+++ b/page_user/shopedit.vue
@@ -0,0 +1,164 @@
+
+
+
+
+
+
+ 店铺名称
+
+
+ 店铺类型
+
+
+ 营业时间
+
+
+ 省市区
+
+
+
+ 经纬度
+
+
+
+
+
+
+
+ 详细地址
+
+
+ 联系人
+
+
+ 联系电话
+
+
+ 保存修改
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/page_user/shuju/index.vue b/page_user/shuju/index.vue
index 4162608..24c238f 100644
--- a/page_user/shuju/index.vue
+++ b/page_user/shuju/index.vue
@@ -8,10 +8,10 @@
流水分析
-
+
门店收益
@@ -33,11 +33,15 @@
methods: {
btnpage(num){
if(num == 1){
-
+ uni.navigateTo({
+ url:'/page_user/shuju/lsfx'
+ })
}else if(num == 2){
}else if(num == 3){
-
+ uni.navigateTo({
+ url:'/pages/income/index'
+ })
}
}
}
@@ -66,13 +70,14 @@
background: #FFFFFF;
border-radius: 24rpx 24rpx 24rpx 24rpx;
display: flex;
- justify-content: space-between;
+ // justify-content: space-between;
padding: 54rpx 78rpx;
box-sizing: border-box;
margin: auto;
.lisy_val{
width: 94rpx;
text-align: center;
+ margin-right: 60rpx;
image{
width: 48rpx;
height: 48rpx;
diff --git a/page_user/shuju/lsfx.vue b/page_user/shuju/lsfx.vue
new file mode 100644
index 0000000..fe2a4b8
--- /dev/null
+++ b/page_user/shuju/lsfx.vue
@@ -0,0 +1,209 @@
+
+
+
+
+
+ {{firsTime}} -- {{lasTime}}
+
+
+
+
+ 总流水
+ 589
+
+
+ 总收益
+ 589
+
+
+ 总订单
+ 589
+
+
+
+
+ 日期
+ {{tit}}
+
+
+ 04/05
+ 115 元
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/page_user/yajin/index.vue b/page_user/yajin/index.vue
new file mode 100644
index 0000000..7f9c9b3
--- /dev/null
+++ b/page_user/yajin/index.vue
@@ -0,0 +1,395 @@
+
+
+
+
+
+ 适用接口
+
+
+
+
+ 支持免押服务
+
+
+
+ 3元/小时,租借5分钟内免费
+
+
+
+ 不足一小时按一小时计算
+
+
+
+ 每24小时封顶30元,总分顶99元
+
+
+ 免押金租借
+
+
+
+ 微信支付分 | 550分以上优享
+
+
+ 点击即同意《委托扣款授权书》
+
+
+
+
+
+
+
+
+
+ X
+ 你的微信支付分未达标
+ 微信支付分要求:550分以上
+ 需支付押金
+ ¥99.00
+
+ 服务商家
+ 创特
+
+
+
+ 服务说明
+ 归还后从押金扣除实际产生的费用
+
+
+ 请仔细阅读《微信支付分押金规则》,同意协议请 点击按钮
+
+
+ 确认并支付
+
+
+
+
+ X
+
+
+ 611
+
+ 你的微信支付分已达标
+ 可享租借充电宝免押金¥99.00
+
+
+ 服务商家
+ 创特
+
+
+ 服务说明
+ 租借充电宝时免除押金,归还后自动支付实际产生的费用
+
+
+ 请仔细阅读《微信支付分押金规则》,同意协议请 点击按钮
+
+
+ 确认并支付
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages.json b/pages.json
index da42899..93e504d 100644
--- a/pages.json
+++ b/pages.json
@@ -406,10 +406,68 @@
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
+ },{
+ "path": "shuju/lsfx",
+ "style": {
+ "navigationBarTitleText": "",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
+ },{
+ "path": "ditu",
+ "style": {
+ "navigationBarTitleText": "",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
+ },{
+ "path": "yajin/index",
+ "style": {
+ "navigationBarTitleText": "",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
+ },{
+ "path": "shopdetail",
+ "style": {
+ "navigationBarTitleText": "",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
+ },{
+ "path": "shopedit",
+ "style": {
+ "navigationBarTitleText": "",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
+ },{
+ "path": "jifei",
+ "style": {
+ "navigationBarTitleText": "",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
+ },{
+ "path": "hezuo/index",
+ "style": {
+ "navigationBarTitleText": "",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
+ },{
+ "path": "about",
+ "style": {
+ "navigationBarTitleText": "",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
}
+
+
// 其他 userpages 目录下的页面...
]
}
diff --git a/pages/agentpages/shopguanli/myshop/index.vue b/pages/agentpages/shopguanli/myshop/index.vue
index 4aeaaf9..e47bbbc 100644
--- a/pages/agentpages/shopguanli/myshop/index.vue
+++ b/pages/agentpages/shopguanli/myshop/index.vue
@@ -10,17 +10,17 @@
-
+
星途自助台球棋 牌室
-
+
+
计费规则
-
+
@@ -64,7 +64,16 @@
}
},
methods: {
-
+ btnxq(){
+ uni.navigateTo({
+ url:'/page_user/shopdetail'
+ })
+ },
+ btnjifei(){
+ uni.navigateTo({
+ url:'/page_user/jifei'
+ })
+ }
}
}
@@ -164,7 +173,7 @@
padding-bottom: 12rpx;
box-sizing: border-box;
.tit{
- width: 236rpx;
+ width: 350rpx;
background: #DBFAED;
border-radius: 16rpx 16rpx 16rpx 16rpx;
font-weight: 600;
@@ -174,7 +183,7 @@
box-sizing: border-box;
}
.bd{
- margin-top: 28rpx;
+ margin-top: 18rpx;
height:100%;
font-size: 20rpx;
color: #FFFFFF;
@@ -184,7 +193,7 @@
border-radius: 6rpx 6rpx 6rpx 6rpx;
}
.yuan{
- margin-top: 20rpx;
+ margin-top: 10rpx;
}
}
}
diff --git a/pages/agentpages/user/index.vue b/pages/agentpages/user/index.vue
index 9f4c681..fe6b332 100644
--- a/pages/agentpages/user/index.vue
+++ b/pages/agentpages/user/index.vue
@@ -50,14 +50,14 @@
-
+
@@ -249,7 +249,7 @@
margin: auto;
padding: 18rpx 54rpx;
box-sizing: border-box;
- height: 290rpx;
+ height: 240rpx;
background: #FFFFFF;
box-shadow: 0rpx 10rpx 64rpx 0rpx rgba(0, 0, 0, 0.08);
border-radius: 34rpx 34rpx 34rpx 34rpx;
diff --git a/pages/income/index.vue b/pages/income/index.vue
index 3d5c2f4..cdd4d5f 100644
--- a/pages/income/index.vue
+++ b/pages/income/index.vue
@@ -23,7 +23,8 @@
店铺名称
- ¥收益金额(元)
+ ¥收益金额(元)
+
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 34d73c5..ce500c0 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -9,8 +9,8 @@
-
+
@@ -33,7 +33,7 @@
-
+
扫码充电
@@ -57,12 +57,34 @@
},
dateindex: 1,
- latitude: 27.109017527965676, // 初始纬度
- longitude: 120.25287434763894, // 初始经度
+ latitude: '', // 初始纬度
+ longitude: '', // 初始经度
covers: [], // 覆盖物数组
+ jinweidu: ''
};
},
methods: {
+ scanQRCode() {
+ uni.navigateTo({
+ url: '/page_user/yajin/index'
+ })
+ // uni.scanCode({
+ // onlyFromCamera: true,
+ // scanType: ['qrCode'],
+ // success: res => {
+ // console.log('扫描结果:', res);
+ // },
+ // fail: err => {
+ // console.error('扫描失败:', err);
+ // uni.showToast({
+ // title: '扫描失败',
+ // icon: 'none'
+ // });
+ // }
+ // });
+ },
+
+
btnindex(num) {
if (num == 2) {
uni.navigateTo({
@@ -91,86 +113,74 @@
} else if (num == 4) {
- }
+ }
},
getMyLocation() {
- const self = this;
uni.getLocation({
type: 'wgs84',
success: (res) => {
console.log('我的位置:', res);
- self.latitude = res.latitude;
- self.longitude = res.longitude;
- // 创建表示当前位置的覆盖物对象
- const myLocationCover = {
- latitude: res.latitude,
- longitude: res.longitude,
- width: 20,
- height: 40,
- iconPath: '../../static/image/icon1.png' // 替换为你的图标路径
- };
- // 将当前位置的覆盖物添加到covers数组中
- self.covers.push(myLocationCover);
- // 如果需要刷新地图或覆盖物,可以在这里调用相应的方法
+ this.latitude = res.latitude;
+ this.longitude = res.longitude;
+ this.jinweidu = this.longitude + ',' + this.latitude;
+ // 请求附近的店铺
+ this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then(
+ res => {
+ if (res.code == 200) {
+ res.data.forEach(item => {
+ const shopCover = {
+ id: parseFloat(item.storeId),
+ latitude: item.lat,
+ longitude: item.lng,
+ width: 25,
+ height: 30,
+ iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uI3B6yPwtiUBD3vafLtw'
+ };
+ this.covers.push(shopCover);
+ });
+ }
+ })
},
fail: (err) => {
console.error('获取位置失败:', err);
}
});
},
- // 假设这个方法用于初始化其他覆盖物(如充电宝图标)
- initOtherCovers() {
- this.covers = [{
- latitude: 27.1040175279,
- longitude: 120.22287435634,
- width: 40,
- height: 50,
- iconPath: '../../static/image/tb.png'
+ // 未登录调静默获取token
+ jmlogin() {
+ let taht = this
+ wx.login({
+ success(res) {
+ if (res.code) {
+ let data = {
+ loginCode: res.code,
+ };
+ taht.$u.post('/app/auth/wxLogin', data).then(res => {
+ if (res.code == 10003) {
+ // uni.navigateTo({
+ // url: '/pages/login/login'
+ // })
+ } else if (res.code == 200) {
+ uni.setStorageSync('token', res.token);
+ taht.getMyLocation()
+ }
+ });
+ }
},
- {
- latitude: 27.10801752796,
- longitude: 120.26287434763,
- width: 40,
- height: 50,
- iconPath: '../../static/image/tb.png'
- }
- ];
+ })
},
- handleMapClick(e) {
- const {
- latitude,
- longitude
- } = e.detail;
- const clickedCover = this.covers.find(cover => {
- // 假设覆盖物是以其中心点为基准的矩形
- const left = cover.longitude - cover.width / 2;
- const right = cover.longitude + cover.width / 2;
- const top = cover.latitude + cover.height / 2;
- const bottom = cover.latitude - cover.height / 2;
-
- // 检查点击的经纬度是否在覆盖物的矩形范围内
- return longitude >= left && longitude <= right && latitude >= bottom && latitude <= top;
- });
-
- if (clickedCover) {
- uni.showToast({
- title: `点击了店铺`,
- icon: 'success',
- duration: 2000
- });
- } else {
- uni.showToast({
- title: '点击了地图其他位置',
- icon: 'none',
- duration: 2000
- });
- }
+ handleMapClick(event) {
+ console.log(event);
+ const markerId = event.markerId;
+ uni.navigateTo({
+ url: '/page_user/ditu?markerId=' + markerId
+ })
},
+
},
mounted() {
- this.initOtherCovers(); // 初始化其他覆盖物
this.getMyLocation(); // 获取并设置自身位置的覆盖物
}
};
diff --git a/pages/login/login.vue b/pages/login/login.vue
index 3c311d6..c970629 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -10,7 +10,10 @@
授权登录
-
+
+
+
+
我已同意并阅读《服务条款》《法律条款及隐私政策》
@@ -21,12 +24,13 @@
data() {
return {
bgc: {
- backgroundColor: "#fff",
+ backgroundColor: "#25CE88",
},
tittxt:"登录",
chooseType:true,
usertype:'',
- login:false
+ login:false,
+ checked:false
}
},
methods: {
@@ -49,8 +53,7 @@
if (res.code) {
console.log('登录!', res);
let data = {
- wxOpenId: res.code,
- userType: that.usertype,
+ loginCode: res.code,
mobileCode: e.detail.code,
};
resolve(data);
@@ -67,14 +70,8 @@
wxLoginAsync()
.then(async (data) => {
this.$u.post("/app/auth/wxLogin",data).then((res) => {
-
-
-
-
- // this.$forceUpdate()
if (res.code == 200) {
- console.log(res,'resres');
- wx.setStorageSync('token', res.token);
+ uni.setStorageSync('token', res.token);
that.ceshi()
}
});
@@ -84,7 +81,7 @@
console.error(err);
});
},
- async ceshi() {
+ ceshi() {
this.$u.get("/app/user/userInfo").then((res) => {
console.log('进入跳转');
uni.switchTab({
@@ -119,7 +116,7 @@
margin-top: 200rpx;
width: 586rpx;
height: 90rpx;
- background: #4C97E7;
+ background: #25CE88;
border-radius: 54rpx 54rpx 54rpx 54rpx;
font-weight: 500;
font-size: 40rpx;
@@ -132,12 +129,8 @@
align-items: center;
justify-content: center;
font-weight: 400;
- font-size: 20rpx;
+ font-size: 24rpx;
color: #979797;
- image{
- width: 26rpx;
- height: 26rpx;
- }
}
diff --git a/pages/nearbystores/index.vue b/pages/nearbystores/index.vue
index 73c7423..78d29b3 100644
--- a/pages/nearbystores/index.vue
+++ b/pages/nearbystores/index.vue
@@ -1,34 +1,31 @@
-
+
-
+
-
- 可租借 可归还 全部门店
-
-
+
-
+
-
- 老福鼎传统菜
+
+ {{item.name}}
- 育贤路太姥商住楼东侧约160米
+ {{item.address}}
- 营业时间:08:00-21:00
-
-
- 可租借可归还即将还满不可还
+ 营业时间:{{item.businessTimeStart}}-{{item.businessTimeEnd}}
+ 可租借
+ 可归还
+ 已还满
-
- 337m
+
+ {{String(item.distance).split('.')[0]}}m
@@ -40,34 +37,98 @@
export default {
data() {
return {
- latitude: 31.02,
- longitude:112.12,
- covers: [{
- latitude: 31.02,
- longitude: 112.12,
- width: '50rpx'
- }],
- index:1
+ latitude: '',
+ longitude: '',
+ covers: [],
+ isMch:false,
+ gxlist:[]
}
},
onLoad() {
+ },
+ onShow() {
+ this.getshanghu()
},
methods: {
- mapFun() {
+ // 跳转导航
+ mapFun(item) {
uni.openLocation({
- latitude: this.latitude,
- //纬度 - 目的地/坐标点
- longitude: this.longitude,
- //经度 - 目的地/坐标点
- name: "荆门市",
- address: "一夜城"
+ latitude: item.lat,
+ longitude: item.lng,
+ name: item.county,
+ address: item.address
});
},
+ getshanghu(){
+ this.$u.get("/app/user/userInfo").then((res) => {
+ if (res.code == 200) {
+ this.isMch = res.data.isMch
+ }
+ })
+ },
+ getMyLocation() {
+ uni.getLocation({
+ type: 'wgs84',
+ success: (res) => {
+ this.latitude = res.latitude;
+ this.longitude = res.longitude;
+ this.jinweidu = this.longitude + ',' + this.latitude;
+ // 请求附近的店铺
+ this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then(response => {
+ if (response.code == 200) {
+ this.gxlist = response.data;
+ this.gxlist.forEach(item => {
+ // 计算距离
+ const distance = this.getDistance(this.latitude, this.longitude, item.lat, item.lng);
+ // 将距离添加到店铺对象中
+ item.distance = distance;
+ // 创建店铺覆盖物对象
+ const shopCover = {
+ id: parseFloat(item.storeId),
+ latitude: item.lat,
+ longitude: item.lng,
+ width: 25,
+ height: 30,
+ iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uI3B6yPwtiUBD3vafLtw',
+ distance: distance // 可以在这里也添加距离到覆盖物对象中,但通常只需要在店铺对象中
+ };
+ // console.log(this.gxlist);
+ this.covers.push(shopCover); // 将店铺覆盖物添加到数组中
+ });
+ }
+ }).catch(error => {
+ console.error('请求店铺列表失败:', error);
+ });
+ },
+ fail: (err) => {
+ console.error('获取位置失败:', err);
+ }
+ });
+ },
- btntab(num){
- this.index = num
- }
+ getDistance(lat1, lon1, lat2, lon2) {
+ const R = 6371000; // 地球半径,单位:米
+ const phi1 = lat1 * Math.PI / 180; // φ, 纬度转为弧度
+ const phi2 = lat2 * Math.PI / 180;
+ const deltaPhi = (lat2 - lat1) * Math.PI / 180;
+ const deltaLambda = (lon2 - lon1) * Math.PI / 180;
+ const a = Math.sin(deltaPhi / 2) * Math.sin(deltaPhi / 2) + Math.cos(phi1) * Math.cos(phi2) * Math.sin(deltaLambda / 2) * Math.sin(deltaLambda / 2);
+ const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
+ const distance = R * c;
+ return distance;
+ },
+
+ handleMarkerClick(event) {
+ const markerId = event.markerId;
+ uni.navigateTo({
+ url: '/page_user/mapditu/index?markerId=' + markerId
+ })
+ },
+
+ },
+ mounted() {
+ this.getMyLocation();
}
}
@@ -78,8 +139,7 @@
height: 100%;
}
page {
- // background-color: ;
- background: linear-gradient(180deg, #25CE88 0%, rgba(255, 255, 255, 0) 100%);
+ background: linear-gradient(180deg, #25D088 0%, rgba(255, 255, 255, 0) 100%);
border-radius: 0rpx 0rpx 0rpx 0rpx;
}
@@ -90,24 +150,38 @@
left: 0;
.dtxs{
width: 100%;
- height: 40vh;
+ height: 50vh;
position: fixed;
top: 0;
left: 0;
z-index: -1;
}
.listbox{
- margin-top: 450rpx;
+ margin-top: 480rpx;
background: #FFFFFF;
border-radius: 64rpx 64rpx 0 0;
box-shadow: 0rpx 10rpx 64rpx 0rpx rgba(0,0,0,0.08);
- padding-top: 140rpx;
+ padding-top: 40rpx;
padding-left: 32rpx;
padding-right: 32rpx;
box-sizing: border-box;
height: 70vh;
overflow-y: scroll;
- padding-bottom: 140rpx;
+ padding-bottom: 400rpx;
+ .moshi{
+ position: fixed;
+ top: 570rpx;
+ left: 30rpx;
+ z-index: 99;
+ image{
+ width: 210rpx;
+ height: 62rpx;
+ }
+ .img{
+ height: 50rpx;
+ margin-bottom: 8rpx;
+ }
+ }
.title{
border-radius: 64rpx 64rpx 0 0;
display: flex;
@@ -121,20 +195,20 @@
background-color: #fff;
position: fixed;
height: 160rpx;
- top: 35vh;
+ top: 40vh;
left: 0;
padding-bottom: 20rpx;
}
.list{
display: flex;
- justify-content: space-between;
+ // justify-content: space-between;
margin-top: 44rpx;
border-bottom: 1px solid #eee;
padding-bottom: 16rpx;
.pic{
width: 134rpx;
height: 134rpx;
- background-color: #25CE88;
+ background-color: #D9D8FF;
border-radius: 10rpx;
margin-right: 20rpx;
image{
@@ -143,7 +217,7 @@
}
}
.cen{
- // margin-right: 140rpx;
+ width: 488rpx;
.cena{
font-weight: 500;
font-size: 28rpx;
@@ -163,39 +237,31 @@
color: #3D3D3D;
line-height: 32rpx;
margin-top: 14rpx;
- }
- .rt{
- font-weight: 500;
- font-size: 20rpx;
- margin-top: 24rpx;
+ display: flex;
+ .wz{
+ margin-left: 5rpx;
+ padding: 4rpx;
+ box-sizing: border-box;
+ width:100rpx;
+ border-radius: 30rpx;
+ text-align: center;
+ }
text{
display: inline-block;
padding: 4rpx 18rpx;
box-sizing: border-box;
- // border: 1px solid #ccc;
border-radius: 20rpx;
- margin-right: 10rpx;
- }
- .ke{
- background: #B7FFE1;
- color: #109F64;
- }
- .gui{
- background: #B7FFE1;
- color: #109F64;
- }
- .man{
- background:#FFEFEF;
- color: #FF4444;
}
.bu{
- background:#E1E1E1;
- color: #666666;
+ margin-left: 10rpx;
+ background:#D9D8FF;
+ color: #4D48B5;
}
}
}
.right{
padding-top: 40rpx;
+ text-align: center;
image{
width: 40rpx;
height: 40rpx;
@@ -212,7 +278,7 @@
}
}
.active{
- border-bottom: 10rpx solid #3AEEA3;
+ border-bottom: 10rpx solid #D9D8FF;
border-radius: 7rpx;
padding-bottom: 10rpx;
font-weight: 700;
diff --git a/pages/personal/index.vue b/pages/personal/index.vue
index 79bd3ed..160eb0c 100644
--- a/pages/personal/index.vue
+++ b/pages/personal/index.vue
@@ -17,9 +17,9 @@
-
+
@@ -100,7 +100,7 @@
}
},
- onLoad() {
+ onLoad() {
},
methods: {
@@ -117,6 +117,22 @@
uni.navigateTo({
url:'/pages/agentpages/index/index'
})
+ }else if(num == 6){
+ uni.navigateTo({
+ url:'/page_user/hezuo/index'
+ })
+ }else if(num == 3){
+ uni.navigateTo({
+ url:'/page_user/about?tit=' + '用户协议'
+ })
+ }else if(num == 4){
+ uni.navigateTo({
+ url:'/page_user/about?tit=' + '隐私政策'
+ })
+ }else if(num == 5){
+ uni.navigateTo({
+ url:'/page_user/about?tit=' + '关于我们'
+ })
}
}
}