This commit is contained in:
Mr.jiang 2024-06-25 20:23:11 +08:00
parent afb296cc5f
commit 80256c7069
9 changed files with 251 additions and 36 deletions

View File

@ -6,6 +6,10 @@ const ROOTPATH3 = "wss://192.168.2.222:8187/wss/websocket/";
const ROOTPATH = "http://192.168.2.222:8187/sqx_fast";
const ROOTPATH1 = "http://192.168.2.222:8187/sqx_fast";
// const ROOTPATH3 = "wss://47.75.182.93:8090/wss/websocket/";
// const ROOTPATH = "http://47.75.182.93:8090/sqx_fast";
// const ROOTPATH1 = "http://47.75.182.93:8090/sqx_fast";
// const ROOTPATH = "http://192.168.2.13:8187/sqx_fast";
// const ROOTPATH1 = "http://192.168.2.13:8187/sqx_fast";
@ -40,7 +44,7 @@ const TX_MAP_KEY = 'VIWBZ-5OM3F-CV7JZ-NLKJY-AXSYV-TMFM6';
//const TX_MAP_KEY = '55UBZ-STNK4-DSNUM-F4A75-Q7BC5-FRBMS';
//ws基础连接地址
// const WS_BASE_PATH = 'ws://192.168.2.13:8187/sqx_fast/';
// const WS_BASE_PATH = 'ws://47.75.182.93:8090/sqx_fast/';
const WS_BASE_PATH = 'ws://192.168.2.222:8187/sqx_fast/';
// const WS_BASE_PATH = 'ws://120.46.52.165/sqx_fast/';
// const WS_BASE_PATH = 'wss://admin.sjajk.com/sqx_fast/';//生产需替换

View File

@ -21,14 +21,14 @@ module.exports = {
// return 'https://admin.sjajk.com'//生产需替换
// return 'http://120.46.52.165'
return 'http://192.168.2.222:8187'
// return 'http://192.168.2.13:8187'
// return 'http://47.75.182.93:8090:8187'
},
//全局域名 部分html中需要单独替换 需要修改config中的网络请求域名
publicYuMingApp() {
// return 'https://wx.sjajk.com'//生产需替换
// return 'http://120.46.52.165'
return 'http://192.168.2.222:8187'
// return 'http://192.168.2.13:8187'
// return 'http://47.75.182.93:8090:8187'
},
logout() {
this.remove("token");

View File

@ -185,8 +185,8 @@
"securityJsCode" : "2b07c8496878c327a8ae7a19de33e2a7",
// "serviceHost" : "http://wx.sjajk.com/_AMapService"//
// "serviceHost" : "http://120.46.52.165/_AMapService"
"serviceHost" : "http://192.168.2.222:8187/_AMapService"
// "serviceHost" : "http://192.168.2.13:8187/_AMapService"
"serviceHost" : "http://192.168.2.222:8187/_AMapService"
// "serviceHost" : "http://47.75.182.93:8090/_AMapService"
}
}
},

View File

@ -236,9 +236,10 @@
import * as webMap from 'utils/webMap.js';
import permision from "@/components/permission.js";
//
// #ifdef APP-PLUS
import permision from "@/components/permission.js";
// import permision from "@/components/permission.js";
// #endif
export default {
data() {
@ -318,42 +319,247 @@
classifyId: '',
page:1,
limit:10,
arr: [],
txAppKey: '',
tpSel: 0,
tpCount: 0,
}
},
onLoad() {
onShareAppMessage(res) { //
return {
title: this.tuiguang,
path: '/pages/index/index?invitation=' + this.invitationCode,
imageUrl: this.tuiguangImg,
}
},
onShareTimeline(res) { //
return {
title: this.tuiguang,
path: '/pages/index/index?invitation=' + this.invitationCode,
imageUrl: this.tuiguangImg,
}
},
onLoad(e) {
let that = this
that.getBannerList()
that.getHomeArtificerList()
// that.getKTCityList();
that.remen()
that.getKTCityList();
//
if (e.invitation) {
that.$queue.setData('inviterCode', e.invitation);
}
// #ifdef MP-WEIXIN
if (e.scene) {
const scene = decodeURIComponent(e.scene);
this.$queue.setData('inviterCode', scene.split(',')[0]);
}
// #endif
that.$Request.getT('/app/common/type/250').then(res => { //
if (res.code == 0) {
if (res.data && res.data.value) {
that.arr.push(res.data.value)
}
}
})
that.$Request.getT('/app/common/type/248').then(res => { //
if (res.code == 0) {
if (res.data && res.data.value) {
that.arr.push(res.data.value)
}
}
})
that.$Request.getT('/app/common/type/217').then(res => { //key
if (res.code == 0) {
if (res.data && res.data.value) {
that.txAppKey = res.data.value;
}
}
})
console.log(11)
uni.getLocation({
type: 'gcj02',
geocode: true, //true
success: function(res) {
console.log(res, '地理位置')
that.latitude = res.latitude
that.longitude = res.longitude
uni.setStorageSync('latitude', res.latitude)
uni.setStorageSync('longitude', res.longitude)
// #ifdef APP-PLUS
that.city = res.address.city
that.selectCity(that.longitude, that.latitude);
uni.setStorageSync('city', res.address.city)
// that.page = 1
// that.getorderlist('')
that.getKTCityList();
// #endif
// #ifdef H5
that.selectCity(that.longitude, that.latitude);
// #endif
// #ifdef MP-WEIXIN
uni.request({
url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + that.latitude +
',' + that.longitude + '&key=' + that.txAppKey,
success(re) {
if (re.statusCode === 200) {
let citydata = re.data.result.address_component.city
// console.log("", citydata)/
that.city = citydata ? citydata : '未知'
uni.setStorageSync('city', citydata)
that.getKTCityList();
// that.page = 1
// that.getorderlist('')
} else {
console.log("获取信息失败,请重试!")
}
}
});
// #endif
},
fail: function() {
// #ifdef APP-PLUS
that.checkPermission();
// #endif
}
})
},
onShow() {
let that = this
that.XCXIsSelect = this.$queue.getData("XCXIsSelect");
that.city = uni.getStorageSync('city') ? uni.getStorageSync('city') : '请选择城市'
that.token = uni.getStorageSync('token');
that.getKTCityList();
if (uni.getStorageSync('token')) {
uni.getLocation({
type: 'gcj02',
geocode: true, //true
// geocode: true, //true
success: function(res) {
console.log('地理位置',res)
that.city=res.address.city
that.latitude = res.latitude
that.longitude = res.longitude
that.getBannerList()
that.getHomeArtificerList()
},
fail: function() {
console.log('获取地址失败2')
}
})
let userId = uni.getStorageSync('userId')
if (userId) {
this.getTpMy();
this.getTpCount();
// this.checkNewUser();
// #ifdef MP-WEIXIN
//
if (this.showModal) {
this.openMsg()
}
// #endif
this.city = uni.getStorageSync('city')
console.log(this.city)
this.getKTCityList();
this.getHomeArtificerList();
this.latitude = uni.getStorageSync('latitude')
this.longitude = uni.getStorageSync('longitude')
}
// that.myId = uni.getStorageSync('userId')
that.token = uni.getStorageSync('token');
// that.getKTCityList();
// if (uni.getStorageSync('token')) {
// console.log(22)
// if (that.latitude && that.longitude) {
// that.page = 1
// that.getHomeArtificerList()
// } else {
// console.log(33)
// uni.getLocation({
// type: 'wgs84',
// // highAccuracyExpireTime: 500,
// geocode: true, //true
// success: function(res) {
// console.log(44)
// console.log( '------>',res)
// that.latitude = res.latitude
// that.longitude = res.longitude
// that.page = 1
// that.getHomeArtificerList()
// },
// fail: function() {
// console.log(55)
// console.log('2')
// }
// })
// }
// }
},
methods: {
//
openMsg() {
console.log('订阅消息')
var that = this
uni.getSetting({
withSubscriptions: true, //false
success(ret) {
console.log(ret.subscriptionsSetting, '------------------')
// if (ret.subscriptionsSetting.itemSettings && Object.keys(ret.subscriptionsSetting.itemSettings).length == 2) {
if (ret.subscriptionsSetting.itemSettings) {
uni.setStorageSync('sendMsg', true)
uni.openSetting({ //
success(rea) {
console.log(rea.authSetting)
}
});
} else { //
uni.setStorageSync('sendMsg', false)
uni.showModal({
title: '提示',
content: '为了更好的体验,请绑定消息推送',
confirmText: '确定',
cancelText: '取消',
success: function(res) {
if (res.confirm) {
wx.requestSubscribeMessage({
tmplIds: that.arr,
success(re) {
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
// uni.setStorageSync('sendMsg', true)
}
},
fail: (res) => {
console.log(res)
}
})
// uni.setStorageSync('sendMsg', true)
that.showModal = false
} else if (res.cancel) {
console.log('取消')
// uni.setStorageSync('sendMsg', false)
that.showModal = true
}
}
})
}
}
})
},
getTpCount() {
this.$Request.getT('/app/message/selectCityCount?city=' + this.city).then(res => {
if (res.code == 0) {
this.tpCount = res.data ? res.data : 0;
}
});
},
getTpMy() {
this.$Request.getT('/app/message/selectMessageByUserId?page=1&limit=1&state=11').then(res => {
if (res.code == 0) {
if (res.data && res.data.list && res.data.list.length > 0) {
this.tpSel = 1;
} else {
this.tpSel = 2;
}
}
});
},
selectCity(longitude, latitude) {
this.$Request.get('/app/Login/selectCity?lat=' + latitude + '&lng=' + longitude).then(res => {
if (res.code == 0) {
this.city = res.data.city ? res.data.city : '未知'
uni.setStorageSync('city', res.data.city)
this.page = 1
this.getorderlist('')
this.getKTCityList();
}
});
},
chaoji(){//
uni.navigateTo({
url:'/my/wallet/index'
@ -453,6 +659,7 @@
url:'/pages/therapist/therapist'
})
},
getCity(e) {
console.log("得到的城市-------------》",e[0].label);
this.city = e[0].label;

View File

@ -357,6 +357,7 @@
}
// #endif
this.city = uni.getStorageSync('city')
console.log(this.city)
this.getKTCityList();
this.latitude = uni.getStorageSync('latitude')
this.longitude = uni.getStorageSync('longitude')

View File

@ -236,8 +236,10 @@
let data = {
userId: uni.getStorageSync('userId'),
couponId: that.couponId,
oldSumMoney: that.mainData.oldPrice*that.detailData.length,
sumMoney: that.mainData.price*that.detailData.length,
oldSumMoney: that.mainData.oldPrice,
sumMoney: that.mainData.price,
// oldSumMoney: that.mainData.oldPrice*that.detailData.length,
// sumMoney: that.mainData.price*that.detailData.length,
ordersPackageList:[
{packageId: that.mainData.id,num: that.detailData.length},
]

View File

@ -50,8 +50,9 @@
<button v-if="!weixinLogin" class='confirm-btn' @click="register">手机号登录</button>
<!-- #endif -->
<!-- #ifdef H5 -->
<button class='confirm-btn' v-if="isopen" @click="bingwx">微信一键登录</button>
<button v-if="!isopen" class='confirm-btn' @click="register">登录</button>
<!-- <button class='confirm-btn' v-if="isopen" @click="bingwx">微信一键登录</button> -->
<!-- <button v-if="!isopen" class='confirm-btn' @click="register">登录</button> -->
<button class='confirm-btn' @click="register">登录</button>
<!-- #endif -->
<view v-if="!isopen"
style="width: 100%;text-align: center;margin-top: 20upx;color: #096f4b;text-decoration:underline;"

View File

@ -236,7 +236,7 @@
import commonConfig from 'common/config.js';
import * as webMap from 'utils/webMap.js';
import permision from "@/components/permission.js";
import permision from "@/components/permission.js";
//
// #ifdef APP-PLUS
// import permision from "@/components/permission.js";

View File

@ -104,7 +104,7 @@ class Request {
// baseUrl: 'https://admin.sjajk.com/', // 请求的根域名//生产需替换
// baseUrl: 'http://120.46.52.165/', // 请求的根域名
baseUrl: 'http://192.168.2.222:8187/',
// baseUrl: 'http://192.168.2.27:8187/',
// baseUrl: 'http://47.75.182.93:8090/',
// 默认的请求头
header: {},
method: 'POST',