This commit is contained in:
3321822538@qq.com 2024-08-30 18:00:37 +08:00
parent b599de9d4d
commit 2c70612ac8
11 changed files with 393 additions and 192 deletions

View File

@ -20,7 +20,7 @@ const install = (Vue, vm) => {
// }, // },
// }); // });
Vue.prototype.$u.http.setConfig({ Vue.prototype.$u.http.setConfig({
baseUrl: 'http://192.168.2.8:3302', baseUrl: 'http://192.168.2.157:3302',
// baseUrl: 'https://kang.chuangtewl.com/prod-api', // baseUrl: 'https://kang.chuangtewl.com/prod-api',
loadingText: '努力加载中~', loadingText: '努力加载中~',
loadingTime: 800, loadingTime: 800,

View File

@ -35,16 +35,16 @@
</view> </view>
<view class="" style="display: flex;justify-content: space-between;position: relative;"> <view class="" style="display: flex;justify-content: space-between;position: relative;">
<input type="number" style="height: 50rpx; <input type="number" style="height: 50rpx;
line-height: 50rpx;" v-model="value" placeholder="输入使用时长" /> <view class="" style="margin-left: 5rpx;">/</view> line-height: 50rpx;" v-model="value" placeholder="输入使用时长" /> <view class="" style="margin-left: 5rpx;">/</view>
<!-- <view class="picker" @click="btnxz"> <view class="picker" @click="btnxz">
{{array[index]}} <u-icon v-if="arrflag" name="arrow-down" color="#000" size="24"></u-icon> {{txt}} <u-icon v-if="arrflag" name="arrow-down" color="#000" size="24"></u-icon>
<u-icon v-else name="arrow-right" color="#000" size="24"></u-icon> <u-icon v-else name="arrow-right" color="#000" size="24"></u-icon>
</view> --> </view>
<!-- <view class="arr_list" v-if="arrflag"> <view class="arr_list" v-if="arrflag">
<view class="arr_item" v-for="(item,index) in array" :key="index" @click="btnxl(index)"> <view class="arr_item" v-for="(item,index) in array" :key="index" @click="btnxl(index)">
{{item}} {{item}}
</view> </view>
</view> --> </view>
</view> </view>
</view> </view>
<view class="title" style="margin-top: 30rpx;margin-bottom: 20rpx;"> <view class="title" style="margin-top: 30rpx;margin-bottom: 20rpx;">
@ -99,7 +99,7 @@
price: '', price: '',
title: '', title: '',
suitId: '', suitId: '',
array: ['天', '时', '分钟', '秒'], array: ['时', '分钟'],
gmsj: [{ gmsj: [{
name: '时', name: '时',
disabled: false disabled: false
@ -107,10 +107,6 @@
{ {
name: '分', name: '分',
disabled: false disabled: false
},
{
name: '秒',
disabled: false
} }
], ],
index: 2, index: 2,
@ -132,7 +128,9 @@
titaoc: [], titaoc: [],
newobj: [], newobj: [],
listflag: false, listflag: false,
storeList:[] storeList:[],
timeUnit:2,
txt:''
} }
}, },
onLoad(option) { onLoad(option) {
@ -242,6 +240,13 @@
btnxl(index) { btnxl(index) {
this.index = index this.index = index
this.arrflag = false this.arrflag = false
if(index == 0){
this.timeUnit = 2
this.txt = '时'
}else{
this.timeUnit = 3
this.txt = '分钟'
}
}, },
btnxz() { btnxz() {
if (this.arrflag == true) { if (this.arrflag == true) {
@ -259,6 +264,13 @@
this.value = res.data.value this.value = res.data.value
this.description = res.data.description this.description = res.data.description
this.deviceList = res.data.storeList this.deviceList = res.data.storeList
if(res.data.timeUnit == 2){
this.txt = '时'
this.timeUnit = 2
}else{
this.txt = '分钟'
this.timeUnit = 3
}
this.deviceList.forEach(item => { this.deviceList.forEach(item => {
this.tcidlist.push(item.storeId) this.tcidlist.push(item.storeId)
}) })
@ -319,7 +331,7 @@
value:this.value, value:this.value,
price: this.price, price: this.price,
description: this.description, description: this.description,
timeUnit:2, timeUnit:this.timeUnit,
storeIds: arrs, storeIds: arrs,
feeMode: 1, feeMode: 1,
feeType: 1, feeType: 1,
@ -355,7 +367,7 @@
value: this.value, value: this.value,
price: this.price, price: this.price,
description: this.description, description: this.description,
timeUnit: 2, timeUnit: this.timeUnit,
storeIds: arrs, storeIds: arrs,
feeMode: 1, feeMode: 1,
feeType:1, feeType:1,
@ -668,7 +680,7 @@
right: -20rpx; right: -20rpx;
background: #FFFFFF; background: #FFFFFF;
width: 140rpx; width: 140rpx;
height: 245rpx; height: 126rpx;
box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(42, 130, 228, 0.1); box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(42, 130, 228, 0.1);
padding: 5rpx 0; padding: 5rpx 0;
box-sizing: border-box; box-sizing: border-box;

View File

@ -1,33 +1,36 @@
<template> <template>
<view class="pages"> <view class="pages">
<u-navbar title="首页" :border-bottom="false" :background="bgc" back-icon-color="#3D3D3D" title-color='#3D3D3D' <u-navbar title="首页" @custom-back="back" :border-bottom="false" :background="bgc" back-icon-color="#3D3D3D" title-color='#3D3D3D'
title-size='36' height='44'></u-navbar> title-size='36' height='44'></u-navbar>
<view class="my"> <view class="my">
<view class="mylt"> <view class="mylt">
<view class=""> <view class="">
<view class="myname"> <view class="" style="display: flex;align-items: center;">
{{infoobj.nickName == undefined ?'--' : infoobj.nickName}} <view class="myname">
</view> {{infoobj.realName == undefined ?'--' : infoobj.realName}}
</view>
<view class="myrt" @click="btnshiming">
{{infoobj.isReal == true ? '已实名' : '去实名'}}
</view>
</view>
<view class="mytel"> <view class="mytel">
{{infoobj.phonenumber == undefined ? '--' :infoobj.phonenumber}} {{infoobj.phonenumber == undefined ? '--' :infoobj.phonenumber}}
</view> </view>
</view> </view>
<view class="" v-if="infoobj.type == 2">
当前角色合作伙伴
</view>
<view class="" v-if="infoobj.type == 3">
当前角色渠道商
</view>
<view class="" v-if="infoobj.type == 4">
当前角色创业者
</view>
<view class="" v-if="infoobj.type == 5">
当前角色经营场所
</view>
</view> </view>
<view class="myrt" @click="btnshiming">
{{infoobj.isReal == true ? '已实名' : '去实名'}} <view class="onewz" v-if="infoobj.type == 2">
当前角色合作伙伴
</view>
<view class="onewz" v-if="infoobj.type == 3">
当前角色渠道商
</view>
<view class="onewz" v-if="infoobj.type == 4">
当前角色创业者
</view>
<view class="onewz" v-if="infoobj.type == 5">
当前角色经营场所
</view> </view>
</view> </view>
@ -158,7 +161,9 @@
} }
}, },
onLoad() { onLoad() {
let today = new Date()
this.firsTime = this.formatDate(today)
this.lasTime = this.formatDate(today)
}, },
// //
onShareAppMessage: function() { onShareAppMessage: function() {
@ -168,9 +173,6 @@
} }
}, },
onShow() { onShow() {
let today = new Date()
this.firsTime = this.formatDate(today)
this.lasTime = this.formatDate(today)
this.getinfo() this.getinfo()
}, },
// //
@ -182,6 +184,11 @@
} }
}, },
methods: { methods: {
back(){
uni.reLaunch({
url:'/pages/index/index'
})
},
// //
getinfo(){ getinfo(){
this.$u.get(`/app/user/userInfo`).then(res => { this.$u.get(`/app/user/userInfo`).then(res => {
@ -315,7 +322,9 @@
/deep/ .u-icon__icon { /deep/ .u-icon__icon {
padding-bottom: 15rpx; padding-bottom: 15rpx;
} }
.onewz{
font-size: 28rpx;
}
.pages { .pages {
width: 750rpx; width: 750rpx;
padding: 0 46rpx; padding: 0 46rpx;
@ -482,12 +491,14 @@
.my{ .my{
display: flex; display: flex;
align-items: center; align-items: center;
// margin-top: 20rpx; justify-content: space-between;
margin-top: 20rpx;
.mylt{ .mylt{
margin-right: 34rpx; margin-right: 34rpx;
.myname{ .myname{
font-size: 36rpx; font-size: 36rpx;
color: #3D3D3D; color: #3D3D3D;
margin-right: 10rpx;
} }
.mytel{ .mytel{
font-size: 28rpx; font-size: 28rpx;
@ -495,14 +506,16 @@
} }
} }
.myrt{ .myrt{
width: 138rpx; width: 110rpx;
height: 50rpx; height: 50rpx;
background: #7E90E7; background: #7E90E7;
border-radius: 30rpx 30rpx 30rpx 30rpx; border-radius: 30rpx 30rpx 30rpx 30rpx;
text-align: center; text-align: center;
line-height: 50rpx; // line-height: 40rpx;
font-size: 28rpx; font-size: 24rpx;
color: #FFFFFF; color: #FFFFFF;
padding: 10rpx;
box-sizing: border-box;
} }
} }
} }

View File

@ -114,7 +114,7 @@
}, },
// //
onShareTimeline: function() { onShareTimeline: function() {
return { return {
title: '创亿康', title: '创亿康',
query: '', query: '',

View File

@ -3,9 +3,9 @@
<u-navbar title="推广码" :border-bottom="false" :background="bgc" back-icon-color="#fff" title-color='#fff' <u-navbar title="推广码" :border-bottom="false" :background="bgc" back-icon-color="#fff" title-color='#fff'
title-size='36' height='44'></u-navbar> title-size='36' height='44'></u-navbar>
<image class="pic" src="https://api.ccttiot.com/smartmeter/img/static/umgY9Xj3E8fWw7Lh2pSQ" mode=""></image> <image class="pic" src="https://api.ccttiot.com/smartmeter/img/static/umgY9Xj3E8fWw7Lh2pSQ" mode="" @longpress="saveCanvas"></image>
<view class="img"> <view class="img">
<canvas canvas-id="qrcode" style="width: 300rpx;margin: 0 auto;" /> <canvas canvas-id="qrcode" style="width:100%;height: 100%;margin: 0 auto;background-color: #000;"/>
</view> </view>
<view class="tuixx"> <view class="tuixx">
<view class="">角色{{txt}}</view> <view class="">角色{{txt}}</view>
@ -52,6 +52,33 @@
} }
}, },
methods: { methods: {
drawCanvas() {
const ctx = uni.createCanvasContext('qrcode', this);
ctx.setFillStyle('red');
ctx.fillRect(10, 10, 150, 75);
ctx.draw();
},
saveCanvas() {
uni.canvasToTempFilePath({
canvasId: 'qrcode',
success: (res) => {
console.log(res.tempFilePath); //
//
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function () {
uni.showToast({
title: '保存成功',
icon: 'success'
});
}
});
},
fail: (err) => {
console.error(err);
}
});
},
// access_token // access_token
// getAccessToken() { // getAccessToken() {
// let appid = 'wx992e3b549e0f879f', // let appid = 'wx992e3b549e0f879f',
@ -120,7 +147,10 @@
}) })
} }
} },
mounted() {
this.drawCanvas();
}
} }
</script> </script>
@ -139,25 +169,25 @@
width: 100%; width: 100%;
padding: 48rpx 44rpx; padding: 48rpx 44rpx;
box-sizing: border-box; box-sizing: border-box;
position: relative;
.pic { .pic {
width: 660rpx; width: 660rpx;
height: 1306rpx; height: 1306rpx;
position: fixed; position: absolute;
top: 230rpx; top: 230rpx;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
} }
.img { .img {
// width: 311rpx; width: 311rpx;
// height: 311rpx; height: 311rpx;
position: fixed; position: absolute;
top: 750rpx; top: 750rpx;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
padding-left: 40rpx; // padding-left: 40rpx;
padding-right: 20rpx; // padding-right: 20rpx;
box-sizing: border-box; box-sizing: border-box;
// border: 1px dashed #ccc; // border: 1px dashed #ccc;
} }

View File

@ -73,7 +73,9 @@
}) })
setTimeout(()=>{ setTimeout(()=>{
this.flag = false this.flag = false
uni.navigateBack() uni.reLaunch({
url:'/page_user/homepage'
})
},1500) },1500)
}else{ }else{
uni.showToast({ uni.showToast({

View File

@ -3,27 +3,27 @@
<u-navbar title="商家合作" :border-bottom="false" :background="bgc" back-icon-color="#3D3D3D" title-color='#3D3D3D' <u-navbar title="商家合作" :border-bottom="false" :background="bgc" back-icon-color="#3D3D3D" title-color='#3D3D3D'
title-size='36' height='44'></u-navbar> title-size='36' height='44'></u-navbar>
<view class="addmeng"> <view class="addmeng" :id="type == 1 ? 'active' : ''" @click.stop="blur">
<view class="addname"> <view class="addname">
<view class=""> <view class="">
<image src="https://api.ccttiot.com/smartmeter/img/static/uduwg26lodmeSs8K4AF3" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uduwg26lodmeSs8K4AF3" mode=""></image>
您的姓名 您的姓名
</view> </view>
<input type="text" placeholder="请输入您的真实姓名" v-model="name"/> <input type="text" placeholder="请输入您的真实姓名" @click.stop="inp" @confirm="confirm" v-model="name"/>
</view> </view>
<view class="addname"> <view class="addname">
<view class=""> <view class="">
<image src="https://api.ccttiot.com/smartmeter/img/static/uduwg26lodmeSs8K4AF3" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uduwg26lodmeSs8K4AF3" mode=""></image>
您的手机号 您的手机号
</view> </view>
<input type="text" placeholder="请输入您的手机号" v-model="tel"/> <input type="text" placeholder="请输入您的手机号" @click.stop="inp" @confirm="confirm" v-model="tel"/>
</view> </view>
<view class="addname"> <view class="addname">
<view class=""> <view class="">
<image src="https://api.ccttiot.com/smartmeter/img/static/uduwg26lodmeSs8K4AF3" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uduwg26lodmeSs8K4AF3" mode=""></image>
了解信息 了解信息
</view> </view>
<input type="text" placeholder="请输入您想了解的信息" v-model="msg"/> <input type="text" placeholder="请输入您想了解的信息" @click.stop="inp" @blur="blur" @confirm="confirm" v-model="msg"/>
</view> </view>
<view class="tit"> <view class="tit">
请输入您的真实有效信息我们将在第一时间联系您 请输入您的真实有效信息我们将在第一时间联系您
@ -37,7 +37,7 @@
</view> </view>
<view class="" style="position: fixed;top: 0;left: 0;width: 100%;height: 100vh;z-index: -1;"> <view class="" style="position: fixed;top: 0;left: 0;width: 100%;height: 100vh;z-index: -1;" @click.stop="blur">
<image style="width: 100%;height: 100vh;" <image style="width: 100%;height: 100vh;"
src="https://api.ccttiot.com/smartmeter/img/static/ufnAAnuAD7GhhA1EFXXL" mode=""></image> src="https://api.ccttiot.com/smartmeter/img/static/ufnAAnuAD7GhhA1EFXXL" mode=""></image>
</view> </view>
@ -54,7 +54,8 @@
name:'', name:'',
tel:'', tel:'',
msg:'', msg:'',
tjflag:true tjflag:true,
type:''
} }
}, },
onLoad() { onLoad() {
@ -77,6 +78,15 @@
} }
}, },
methods: { methods: {
confirm(){
this.type = ''
},
inp(){
this.type = 1
},
blur(){
this.type = ''
},
getuserinfo() { getuserinfo() {
this.$u.get("/app/user/userInfo").then((res) => { this.$u.get("/app/user/userInfo").then((res) => {
if (res.code == 200) { if (res.code == 200) {
@ -156,6 +166,12 @@
page { page {
background-color: #F7FAFE; background-color: #F7FAFE;
} }
#active{
position: fixed;
bottom: 300rpx !important;
left: 50%;
transform: translateX(-50%);
}
.addmeng{ .addmeng{
width: 750rpx; width: 750rpx;
height: 715rpx; height: 715rpx;

View File

@ -9,7 +9,7 @@
<map class='map' id="map" :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick" <map class='map' id="map" :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick"
:show-location="true" :markers="covers" :scale="mapScale" @regionchange="regionchange" /> :show-location="true" :markers="covers" :scale="mapScale" @regionchange="regionchange" />
<image class="picimg" v-if="iconflag" <image class="picimg" v-if="iconflag"
src="https://api.ccttiot.com/smartmeter/img/static/uApyHD7rov66zGOzwUX1" mode=""></image> src="https://api.ccttiot.com/smartmeter/img/static/uEAmNMMt65U10qwijrsJ" mode=""></image>
</view> </view>
<!-- 正在进行中的订单 --> <!-- 正在进行中的订单 -->
<view class="ongoing_order" v-if="sylist.length > 0"> <view class="ongoing_order" v-if="sylist.length > 0">
@ -65,7 +65,7 @@
:interval="interval" :duration="duration"> :interval="interval" :duration="duration">
<swiper-item v-for="(item,index) in imgad" :key="index" @click="btnswiper(item)"> <swiper-item v-for="(item,index) in imgad" :key="index" @click="btnswiper(item)">
<view class="swiper-item uni-bg-red"> <view class="swiper-item uni-bg-red">
<image style="height: 218rpx;" :src="item.picture" mode=""></image> <image style="height: 218rpx;" :src="item.picture" mode="aspectFit"></image>
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
@ -87,7 +87,15 @@
</view> </view>
<view class="bd"> <view class="bd">
<view class="xiao"> <view class="xiao">
<view class="">推广用户角色:</view> <view class="">您的推广人:</view>
<view class="">{{tgobj.userName == undefined ? '--' : tgobj.userName}}<text
v-if="tgobj.creatorUserType == 2">合作伙伴商</text><text
v-if="tgobj.creatorUserType == 3">渠道商</text><text
v-if="tgobj.creatorUserType == 4">创业者</text><text
v-if="tgobj.creatorUserType == 5">场所负责人</text></view>
</view>
<view class="xiao">
<view class="">您的角色:</view>
<view class="" v-if="tgobj.userType == 2">合作伙伴商</view> <view class="" v-if="tgobj.userType == 2">合作伙伴商</view>
<view class="" v-if="tgobj.userType == 3">渠道商</view> <view class="" v-if="tgobj.userType == 3">渠道商</view>
<view class="" v-if="tgobj.userType == 4">创业者</view> <view class="" v-if="tgobj.userType == 4">创业者</view>
@ -99,7 +107,7 @@
</view> </view>
<view class="xiao"> <view class="xiao">
<view class="">分成比例:</view> <view class="">分成比例:</view>
<view class="">{{tgobj.point == undefined ? '--' : tgobj.point}}</view> <view class="">{{tgobj.point == undefined ? '--' : tgobj.point}}%</view>
</view> </view>
</view> </view>
<view class="bot"> <view class="bot">
@ -170,7 +178,8 @@
shows: false, shows: false,
xztxt: '点击选择', xztxt: '点击选择',
clickPosition: null, // clickPosition: null, //
iconflag: false iconflag: false,
isReal: ''
}; };
}, },
onLoad(option) { onLoad(option) {
@ -191,6 +200,14 @@
this.czflag = true this.czflag = true
} }
}) })
}else if(option.c){
this.c = option.c
this.$u.get(`/app/shareCode/byCode/${this.c}`).then((res) => {
if (res.code == 200) {
this.tgobj = res.data
this.czflag = true
}
})
} }
}, },
// //
@ -288,6 +305,20 @@
duration: 1500 duration: 1500
}) })
this.czflag = false this.czflag = false
} else if (res.code == 401) {
uni.showModal({
title: '提示',
content: '您当前还未登录,是否去登录?',
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: '/pages/login/login?ids=' + 2
})
} else if (res.cancel) {
}
}
})
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
@ -374,7 +405,7 @@
const totalLength = chineseLength + englishLength * 2 const totalLength = chineseLength + englishLength * 2
return -totalLength * 6.5 // anchorX -6.5 return -totalLength * 6.5 // anchorX -6.5
}, },
//
scanQRCode() { scanQRCode() {
this.$u.get('/app/user/userInfo').then(res => { this.$u.get('/app/user/userInfo').then(res => {
if (res.code == 200) { if (res.code == 200) {
@ -383,48 +414,73 @@
onlyFromCamera: true, onlyFromCamera: true,
scanType: ['qrCode'], scanType: ['qrCode'],
success: res => { success: res => {
function getQueryParam(url, paramName) { let sceneValue = res.result;
let regex = new RegExp(`[?&]${paramName}=([^&]*)`) let decodedValue = decodeURIComponent(sceneValue);
let results = regex.exec(url); console.log(decodedValue);
return results ? decodeURIComponent(results[1].replace(/\+/g,' ')) : null // decodedValue'c''s'
} if (decodedValue.includes('?c')) {
let sceneValue = res.result function getQueryParam(url, paramName) {
let decodedValue = decodeURIComponent(sceneValue) let regex = new RegExp(`[?&]${paramName}=([^&]*)`)
let id = getQueryParam(decodedValue, 's') let results = regex.exec(url);
uni.navigateTo({ return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null
url: '/page_user/fuwu?id=' + id }
}) let sceneValue = res.result
// console.log(res, id) let decodedValue = decodeURIComponent(sceneValue)
let that = this let id = getQueryParam(decodedValue, 'c')
let data = { this.c = id
deviceNo: id // console.log(':', this.c)
} this.$u.get(`/app/shareCode/byCode/${this.c}`).then((res) => {
that.$u.get(`/app/device/isBind?deviceNo=${id}`).then(res => { if (res.code == 200) {
if (res.data == 2) { this.tgobj = res.data
that.$u.get(`/app/device/${id}/withSuitList`).then( this.czflag = true
(res) => { }
if (res.code == 200) { })
uni.navigateTo({ } else if (decodedValue.includes('?s')) {
url: '/page_user/fuwu?id=' + id function getQueryParam(url, paramName) {
}) let regex = new RegExp(`[?&]${paramName}=([^&]*)`)
let results = regex.exec(url);
return results ? decodeURIComponent(results[1].replace(/\+/g,' ')) : null
}
let sceneValue = res.result
let decodedValue = decodeURIComponent(sceneValue)
let id = getQueryParam(decodedValue, 's')
uni.navigateTo({
url: '/page_user/fuwu?id=' + id
})
// console.log(res, id)
let that = this
let data = {
deviceNo: id
}
that.$u.get(`/app/device/isBind?deviceNo=${id}`).then(res => {
if (res.data == 2) {
that.$u.get(`/app/device/${id}/withSuitList`).then(
(res) => {
if (res.code == 200) {
uni.navigateTo({
url: '/page_user/fuwu?id=' + id
})
}
})
} else if (res.data == 0) {
uni.showModal({
title: '提示',
content: '该设备未录入,你需进行录入吗?',
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: '/pages/zhuce?sn=' + id
})
} else if (res.cancel) {
}
} }
}) })
} else if (res.data == 0) { }
uni.showModal({ })
title: '提示', } else {
content: '该设备未录入,你需进行录入吗?', console.log('既不包含c也不包含s'); //
success: function(res) { }
if (res.confirm) {
uni.navigateTo({
url: '/pages/zhuce?sn=' + id
})
} else if (res.cancel) {
}
}
})
}
})
}, },
fail: err => { fail: err => {
console.error('扫描失败:', err) console.error('扫描失败:', err)
@ -486,9 +542,16 @@
url: '/page_user/guzhang' url: '/page_user/guzhang'
}) })
} else if (num == 5) { } else if (num == 5) {
uni.navigateTo({ if (this.isReal == true) {
url: '/page_user/homepage' uni.navigateTo({
}) url: '/page_user/homepage'
})
} else {
uni.navigateTo({
url: '/page_user/shiming'
})
}
} else if (num == 6) { } else if (num == 6) {
uni.navigateTo({ uni.navigateTo({
url: '/page_user/sjhezuo' url: '/page_user/sjhezuo'
@ -522,39 +585,37 @@
this.iconflag = true this.iconflag = true
if (e.type == 'end') { if (e.type == 'end') {
this.jinweidu = e.detail.centerLocation.longitude + ',' + e.detail.centerLocation.latitude this.jinweidu = e.detail.centerLocation.longitude + ',' + e.detail.centerLocation.latitude
this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then(res => { this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 5000).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.covers = [] this.covers = []
this.listmap = res.data this.listmap = res.data
this.listmap.forEach(item => { this.listmap.forEach(item => {
// if (item.deviceCount !== null && item.deviceCount > 0) { // if (item.deviceCount !== null && item.deviceCount > 0) {
const shopCover = { const shopCover = {
id: parseFloat(item.storeId), id: parseFloat(item.storeId),
latitude: item.lat, latitude: item.lat,
longitude: item.lng, longitude: item.lng,
width: 25, width: 25,
height: 30, height: 30,
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/u0yXGqCqoDjuK4QPJHZY', iconPath: 'https://api.ccttiot.com/smartmeter/img/static/u0yXGqCqoDjuK4QPJHZY',
// iconPath:item.picture // iconPath:item.picture
label: { label: {
content: item.name, content: item.name,
anchorX: this.calculateAnchorX(item.name), anchorX: this.calculateAnchorX(item.name),
fontWeight: 700, fontWeight: 700,
color: '#8883F0', color: '#8883F0',
borderColor: '#fff', borderColor: '#fff',
borderRadius: 5, borderRadius: 5,
bgColor: '#fff' bgColor: '#fff'
}
} }
this.covers.push(shopCover) }
// console.log(this.covers); this.covers.push(shopCover)
// } // console.log(this.covers);
}) // }
} })
}) }
setTimeout(()=>{ })
this.iconflag = false this.iconflag = false
},500)
} else { } else {
// this.iconflag = false // this.iconflag = false
} }
@ -590,7 +651,7 @@
this.longitude = Number(res.longitude.toFixed(5)) + 0.005 this.longitude = Number(res.longitude.toFixed(5)) + 0.005
this.setMapScale() this.setMapScale()
// //
this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then( this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 5000).then(
res => { res => {
if (res.code == 200) { if (res.code == 200) {
this.listmap = res.data this.listmap = res.data
@ -697,12 +758,13 @@
getuserinfo() { getuserinfo() {
this.$u.get("/app/user/userInfo").then((res) => { this.$u.get("/app/user/userInfo").then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.isReal = res.data.isReal
this.userId = res.data.userId this.userId = res.data.userId
this.isMch = res.data.isMch this.isMch = res.data.isMch
uni.setStorageSync('userType', res.data) uni.setStorageSync('userType', res.data)
this.userType = res.data.type this.userType = res.data.type
this.deviceCount = res.data.deviceCount this.deviceCount = res.data.deviceCount
} else if(res.code == 401){ } else if (res.code == 401) {
this.jmlogin() this.jmlogin()
} }
}) })
@ -1069,9 +1131,11 @@
.guangg { .guangg {
// margin-top: 10rpx; // margin-top: 10rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
border-radius: 20rpx !important;
overflow: hidden;
image { image {
border-radius: 30rpx; border-radius: 20rpx;
width: 680rpx; width: 680rpx;
height: 218rpx; height: 218rpx;
} }
@ -1210,8 +1274,8 @@
position: relative; position: relative;
.picimg { .picimg {
width: 80rpx; width: 120rpx;
height: 100rpx; height: 120rpx;
position: absolute; position: absolute;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);

View File

@ -64,13 +64,17 @@
id:'', id:'',
dlflag:false, dlflag:false,
zh:'', zh:'',
mm:'' mm:'',
ids:''
} }
}, },
onLoad(option) { onLoad(option) {
if(option.id){ if(option.id){
this.id = option.id this.id = option.id
}else if(option.ids){
this.ids = option.ids
} }
}, },
// //
onShareAppMessage: function () { onShareAppMessage: function () {
@ -160,7 +164,9 @@
uni.reLaunch({ uni.reLaunch({
url:'/page_user/fuwu?id=' + this.id url:'/page_user/fuwu?id=' + this.id
}) })
}else{ }else if(this.ids == 2){
uni.navigateBack()
} else{
uni.reLaunch({ uni.reLaunch({
url: '/pages/index/index' url: '/pages/index/index'
}) })

View File

@ -6,7 +6,7 @@
<map class='map' id="map" :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick" <map class='map' id="map" :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick"
:show-location="true" :markers="covers" :scale="mapScale" @regionchange="regionchange"/> :show-location="true" :markers="covers" :scale="mapScale" @regionchange="regionchange"/>
<image class="picimg" v-if="iconflag" <image class="picimg" v-if="iconflag"
src="https://api.ccttiot.com/smartmeter/img/static/uApyHD7rov66zGOzwUX1" mode=""></image> src="https://api.ccttiot.com/smartmeter/img/static/uEAmNMMt65U10qwijrsJ" mode=""></image>
</view> </view>
<view class="listbox" v-if="falga"> <view class="listbox" v-if="falga">
<!-- <view class="moshi"> <!-- <view class="moshi">
@ -203,34 +203,96 @@
}, },
scanQRCode() { scanQRCode() {
uni.scanCode({ this.$u.get('/app/user/userInfo').then(res => {
onlyFromCamera: true, if (res.code == 200) {
scanType: ['qrCode'], uni.scanCode({
success: res => { onlyFromCamera: true,
function getQueryParam(url, paramName) { scanType: ['qrCode'],
let regex = new RegExp(`[?&]${paramName}=([^&]*)`) success: res => {
let results = regex.exec(url); let sceneValue = res.result;
return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null let decodedValue = decodeURIComponent(sceneValue);
} // console.log(decodedValue);
let sceneValue = res.result // decodedValue'c''s'
let decodedValue = decodeURIComponent(sceneValue) if (decodedValue.includes('?c')) {
let id = getQueryParam(decodedValue, 's') function getQueryParam(url, paramName) {
this.$u.get(`/app/device/${id}/withSuitList`).then((res) => { let regex = new RegExp(`[?&]${paramName}=([^&]*)`)
if (res.code == 200) { let results = regex.exec(url);
uni.navigateTo({ return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null
url: '/page_components/fuwu/index?id=' + id }
}) let sceneValue = res.result
} let decodedValue = decodeURIComponent(sceneValue)
let id = getQueryParam(decodedValue, 'c')
let c = id
uni.reLaunch({
url:'/pages/index/index?c=' + c
})
// console.log(':', this.c)
} else if (decodedValue.includes('?s')) {
function getQueryParam(url, paramName) {
let regex = new RegExp(`[?&]${paramName}=([^&]*)`)
let results = regex.exec(url);
return results ? decodeURIComponent(results[1].replace(/\+/g,
' ')) : null
}
let sceneValue = res.result
let decodedValue = decodeURIComponent(sceneValue)
let id = getQueryParam(decodedValue, 's')
uni.navigateTo({
url: '/page_user/fuwu?id=' + id
})
// console.log(res, id)
let that = this
let data = {
deviceNo: id
}
that.$u.get(`/app/device/isBind?deviceNo=${id}`).then(res => {
if (res.data == 2) {
that.$u.get(`/app/device/${id}/withSuitList`).then(
(res) => {
if (res.code == 200) {
uni.navigateTo({
url: '/page_user/fuwu?id=' +
id
})
}
})
} else if (res.data == 0) {
uni.showModal({
title: '提示',
content: '该设备未录入,你需进行录入吗?',
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: '/pages/zhuce?sn=' +
id
})
} else if (res.cancel) {
}
}
})
}
})
} else {
console.log('既不包含c也不包含s'); //
}
},
fail: err => {
console.error('扫描失败:', err)
uni.showToast({
title: '扫描失败',
icon: 'none'
})
}
})
} else {
uni.navigateTo({
url: '/pages/login/login'
}) })
},
fail: err => {
console.error('扫描失败:', err)
uni.showToast({
title: '扫描失败',
icon: 'none'
});
} }
}); })
}, },
btnchak(id) { btnchak(id) {
@ -291,7 +353,7 @@
regionchange(e){ regionchange(e){
if (e.type == 'end') { if (e.type == 'end') {
this.jinweidu = e.detail.centerLocation.longitude + ',' + e.detail.centerLocation.latitude this.jinweidu = e.detail.centerLocation.longitude + ',' + e.detail.centerLocation.latitude
this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then(res => { this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 5000).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.covers = [] this.covers = []
this.listmap = res.data this.listmap = res.data
@ -320,9 +382,7 @@
}) })
} }
}) })
setTimeout(()=>{ this.iconflag = false
this.iconflag = false
},500)
} else { } else {
this.iconflag = true this.iconflag = true
} }
@ -331,13 +391,13 @@
getMyLocation() { getMyLocation() {
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'wgs84',
success: (res) => { success: (res) => {
this.jinweidu = res.longitude + ',' + res.latitude this.jinweidu = res.longitude + ',' + res.latitude
this.latitude = Number(res.latitude.toFixed(5)) - 0.005 this.latitude = Number(res.latitude.toFixed(5)) - 0.005
this.longitude = Number(res.longitude.toFixed(5)) + 0.005 this.longitude = Number(res.longitude.toFixed(5)) + 0.005
this.setMapScale() this.setMapScale()
// //
this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then( this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 5000).then(
res => { res => {
if (res.code == 200) { if (res.code == 200) {
this.listmap = res.data this.listmap = res.data
@ -587,8 +647,8 @@
left: 0; left: 0;
z-index: -1; z-index: -1;
.picimg { .picimg {
width: 80rpx; width: 120rpx;
height: 100rpx; height: 120rpx;
position: absolute; position: absolute;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);

View File

@ -6,7 +6,7 @@
<map class='map' id="map" :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick" <map class='map' id="map" :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick"
:show-location="true" :markers="covers" :scale="mapScale" @regionchange="regionchange" /> :show-location="true" :markers="covers" :scale="mapScale" @regionchange="regionchange" />
<image class="picimg" v-if="iconflag" <image class="picimg" v-if="iconflag"
src="https://api.ccttiot.com/smartmeter/img/static/uApyHD7rov66zGOzwUX1" mode=""></image> src="https://api.ccttiot.com/smartmeter/img/static/uEAmNMMt65U10qwijrsJ" mode=""></image>
</view> </view>
<view class="listbox"> <view class="listbox">
<view class="moshi"> <view class="moshi">
@ -107,7 +107,7 @@
if (e.type == 'end') { if (e.type == 'end') {
// this.gxlist = [] // this.gxlist = []
this.jinweidu = e.detail.centerLocation.longitude + ',' + e.detail.centerLocation.latitude this.jinweidu = e.detail.centerLocation.longitude + ',' + e.detail.centerLocation.latitude
this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then( this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 5000).then(
res => { res => {
if (res.code == 200) { if (res.code == 200) {
this.gxlist = res.data this.gxlist = res.data
@ -142,9 +142,7 @@
}) })
} }
}) })
setTimeout(() => { this.iconflag = false
this.iconflag = false
}, 500)
} else { } else {
this.iconflag = true this.iconflag = true
} }
@ -277,7 +275,7 @@
this.longitude = Number(res.longitude.toFixed(5)) + 0.005 this.longitude = Number(res.longitude.toFixed(5)) + 0.005
this.setMapScale() this.setMapScale()
// //
this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then( this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 5000).then(
response => { response => {
if (response.code == 200) { if (response.code == 200) {
this.listmap = response.data this.listmap = response.data
@ -406,8 +404,8 @@
left: 0; left: 0;
z-index: -1; z-index: -1;
.picimg { .picimg {
width: 80rpx; width: 120rpx;
height: 100rpx; height: 120rpx;
position: absolute; position: absolute;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);