This commit is contained in:
Mr.jiang 2024-07-03 09:21:00 +08:00
parent 0c0da011a5
commit 91cf5ce400
6 changed files with 265 additions and 211 deletions

View File

@ -1,10 +1,10 @@
// const ROOTPATH = "http://120.46.52.165/sqx_fast";
// const ROOTPATH1 = "http://120.46.52.165/sqx_fast";
// const ROOTPATH3 = "wss://120.46.52.165/wss/websocket/";
const ROOTPATH = "http://120.46.52.165/sqx_fast";
const ROOTPATH1 = "http://120.46.52.165/sqx_fast";
const ROOTPATH3 = "wss://120.46.52.165/wss/websocket/";
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://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://1.92.152.160/wss/websocket/";
// const ROOTPATH = "http://1.92.152.160/sqx_fast";

View File

@ -344,7 +344,11 @@
couponId:'',
artificerId:'',
artificerIdMy:false,
ordersId:''
ordersId:'',
getJishi:[],
textMoney:'',
getList:[],
activeMoney:''
}
},
onLoad(d) {
@ -362,13 +366,17 @@
} else {
this.tabIndex = 0;
}
this.getList=d;
this.wxTxSel = this.$queue.getData('wxTxSel');
this.ylTxSel = this.$queue.getData('ylTxSel');
this.jsczSel = this.$queue.getData('jsczSel');
this.txMsg = this.$queue.getData('txMsg');
this.avatar = uni.getStorageSync('avatar')
this.renzheng = uni.getStorageSync("renzheng")
this.renzheng = uni.getStorageSync("renzheng");
this.getJishi=this.$queue.getData('getJishi');
console.log('this.getJishi',this.getJishi)
this.nameTxt=d.text;
this.ordersId=d.ordersId
this.getMoneyList();
@ -573,7 +581,7 @@
})
},
active(e) {
console.log("sadsadsadsadsad",e)
this.activeMoney=e.price
this.wallet.forEach(res => {
if (res.payClassifyId == e.payClassifyId) {
res.isSelect = true
@ -597,183 +605,201 @@
},
pay() {
if (this.openWay == 2) {
// #ifdef APP-PLUS
// APP id
let data = {
payClassifyId: this.thisSelect.payClassifyId,
type: 1,
userId: uni.getStorageSync('userId'),
}
if(this.artificerId){
data.artificerId=this.artificerId
}
if(this.ordersId){
data.ordersId=this.ordersId
}
this.$Request.post("/app/wxPay/payMoney", data).then(ret => {
console.log(ret)
this.isCheckPay(ret.code, 'wxpay', JSON.stringify(ret.data));
});
// #endif
// #ifdef MP-WEIXIN
//
let data = {
payClassifyId: this.thisSelect.payClassifyId,
type: 3,
userId: uni.getStorageSync('userId')
}
if(this.artificerId){
data.artificerId=this.artificerId
}
if(this.ordersId){
data.ordersId=this.ordersId
}
this.$Request.post('/app/wxPay/payMoney', data).then(ret => {
uni.hideLoading()
uni.requestPayment({
provider: 'wxpay',
timeStamp: ret.data.timestamp,
nonceStr: ret.data.noncestr,
package: ret.data.package,
signType: ret.data.signType,
paySign: ret.data.sign,
success: function(suc) {
console.log('success:' + JSON.stringify(suc));
uni.showToast({
title: '支付成功',
icon: 'success'
})
this.getMoney()
setTimeout(d => {
uni.navigateBack(1)
}, 1000);
},
fail: function(err) {
console.log('fail:' + JSON.stringify(err));
uni.showToast({
title: '支付失败',
icon: 'none'
})
}
});
});
// #endif
// #ifdef H5
let ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('micromessenger') !== -1) {
let data = {
payClassifyId: this.thisSelect.payClassifyId,
type: 2,
userId: uni.getStorageSync('userId')
}
if(this.artificerId){
data.artificerId=this.artificerId
}
if(this.ordersId){
data.ordersId=this.ordersId
}
this.$Request.post('/app/wxPay/payMoney', data).then(res => {
if (res.code == 0) {
this.callPay(res.data);
this.getMoney()
} else {
uni.showToast({
icon: 'none',
title: '支付失败!'
});
}
});
} else {
let data = {
payClassifyId: this.thisSelect.payClassifyId,
type: 4,
userId: uni.getStorageSync('userId')
}
if(this.artificerId){
data.artificerId=this.artificerId
}
if(this.ordersId){
data.ordersId=this.ordersId
}
this.$Request.post('/app/wxPay/payMoney', data).then(res => {
if (res.code == 0) {
const urlArr = window.location.href;
const hostUrl = urlArr.split("/");
const callBack = hostUrl[0] + "//" + hostUrl[2] + "/";
const url = '&redirect_url=' + callBack + 'my/wallet/index';
window.location = res.data.mweb_url + url
this.getMoney()
} else {
uni.showToast({
icon: 'none',
title: '支付失败!'
});
}
});
}
// #endif
} else {
// #ifdef H5
let data = {
payClassifyId: this.thisSelect.payClassifyId,
type: 2,
userId: uni.getStorageSync('userId'),
}
if(this.artificerId){
data.artificerId=this.artificerId
}
if(this.ordersId){
data.ordersId=this.ordersId
}
this.$Request.post('/app/aliPay/payOrderMoney', data).then(
res => {
if (res.code == 0) {
uni.showToast({
title: '支付成功!'
});
this.getMoney()
// const div = document.createElement('div')
// div.innerHTML = res.data //form
// document.body.appendChild(div)
// document.forms[0].submit()
// setTimeout(d => {
// uni.navigateBack(1)
// }, 1000);
} else {
uni.showToast({
icon: 'none',
title: '支付失败!'
});
}
});
// #endif
// #ifdef APP-PLUS
// APP
let data = {
payClassifyId: this.thisSelect.payClassifyId,
type: 1,
userId: uni.getStorageSync('userId')
}
if(this.artificerId){
data.artificerId=this.artificerId
}
if(this.ordersId){
data.ordersId=this.ordersId
}
this.$Request.post("/app/aliPay/payOrderMoney", data).then(ret => {
console.log(ret)
this.getMoney()
this.isCheckPay(ret.code, 'alipay', ret.data);
});
// #endif
var that=this;
if(that.getList.text=='my'&&that.getList.artificerId){
that.textMoney='是否确定为技师'+ that.getJishi.artificerName +'充值'+'吗?'
}else{
that.textMoney='是否确定为充值!'
}
uni.showModal({
title: '提示',
content: that.textMoney,
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
if (that.openWay == 2) {
// #ifdef APP-PLUS
// APP id
let data = {
payClassifyId: that.thisSelect.payClassifyId,
type: 1,
userId: uni.getStorageSync('userId'),
}
if(that.artificerId){
data.artificerId=that.artificerId
}
if(that.ordersId){
data.ordersId=that.ordersId
}
that.$Request.post("/app/wxPay/payMoney", data).then(ret => {
console.log(ret)
that.isCheckPay(ret.code, 'wxpay', JSON.stringify(ret.data));
});
// #endif
// #ifdef MP-WEIXIN
//
let data = {
payClassifyId: that.thisSelect.payClassifyId,
type: 3,
userId: uni.getStorageSync('userId')
}
if(that.artificerId){
data.artificerId=that.artificerId
}
if(that.ordersId){
data.ordersId=that.ordersId
}
that.$Request.post('/app/wxPay/payMoney', data).then(ret => {
uni.hideLoading()
uni.requestPayment({
provider: 'wxpay',
timeStamp: ret.data.timestamp,
nonceStr: ret.data.noncestr,
package: ret.data.package,
signType: ret.data.signType,
paySign: ret.data.sign,
success: function(suc) {
console.log('success:' + JSON.stringify(suc));
uni.showToast({
title: '支付成功',
icon: 'success'
})
that.getMoney()
setTimeout(d => {
uni.navigateBack(1)
}, 1000);
},
fail: function(err) {
console.log('fail:' + JSON.stringify(err));
uni.showToast({
title: '支付失败',
icon: 'none'
})
}
});
});
// #endif
// #ifdef H5
let ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('micromessenger') !== -1) {
let data = {
payClassifyId: that.thisSelect.payClassifyId,
type: 2,
userId: uni.getStorageSync('userId')
}
if(that.artificerId){
data.artificerId=that.artificerId
}
if(that.ordersId){
data.ordersId=that.ordersId
}
that.$Request.post('/app/wxPay/payMoney', data).then(res => {
if (res.code == 0) {
that.callPay(res.data);
that.getMoney()
} else {
uni.showToast({
icon: 'none',
title: '支付失败!'
});
}
});
} else {
let data = {
payClassifyId: that.thisSelect.payClassifyId,
type: 4,
userId: uni.getStorageSync('userId')
}
if(that.artificerId){
data.artificerId=that.artificerId
}
if(that.ordersId){
data.ordersId=that.ordersId
}
that.$Request.post('/app/wxPay/payMoney', data).then(res => {
if (res.code == 0) {
const urlArr = window.location.href;
const hostUrl = urlArr.split("/");
const callBack = hostUrl[0] + "//" + hostUrl[2] + "/";
const url = '&redirect_url=' + callBack + 'my/wallet/index';
window.location = res.data.mweb_url + url
that.getMoney()
} else {
uni.showToast({
icon: 'none',
title: '支付失败!'
});
}
});
}
// #endif
} else {
// #ifdef H5
let data = {
payClassifyId: this.thisSelect.payClassifyId,
type: 2,
userId: uni.getStorageSync('userId'),
}
if(this.artificerId){
data.artificerId=this.artificerId
}
if(this.ordersId){
data.ordersId=this.ordersId
}
this.$Request.post('/app/aliPay/payOrderMoney', data).then(
res => {
if (res.code == 0) {
uni.showToast({
title: '支付成功!'
});
this.getMoney()
// const div = document.createElement('div')
// div.innerHTML = res.data //form
// document.body.appendChild(div)
// document.forms[0].submit()
// setTimeout(d => {
// uni.navigateBack(1)
// }, 1000);
} else {
uni.showToast({
icon: 'none',
title: '支付失败!'
});
}
});
// #endif
// #ifdef APP-PLUS
// APP
let data = {
payClassifyId: this.thisSelect.payClassifyId,
type: 1,
userId: uni.getStorageSync('userId')
}
if(this.artificerId){
data.artificerId=this.artificerId
}
if(this.ordersId){
data.ordersId=this.ordersId
}
this.$Request.post("/app/aliPay/payOrderMoney", data).then(ret => {
console.log(ret)
this.getMoney()
this.isCheckPay(ret.code, 'alipay', ret.data);
});
// #endif
}
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
callPay: function(response) {
if (typeof WeixinJSBridge === "undefined") {
@ -940,6 +966,9 @@
</script>
<style scoped>
/deep/.uni-modal__bd :nth-child(3) {
color: red !important;
}
/deep/uni-checkbox .uni-checkbox-input{
width: 26px;
height: 26px;
@ -1012,7 +1041,7 @@
/deep/uni-radio .uni-radio-input{
width: 31.86rpx;
height: 31.86rpx;
margin: -4px 0px 0px -8px;
margin: -4px 4px 0px -8px;
}
.chong-list-radio{
width: 29.86rpx;
@ -1161,7 +1190,7 @@
background: #fff;
border-radius: 15px;
width: 95%;
margin: 0 auto;
margin: 9px auto 70px auto;
}
.chongzhi span:nth-child(2){
color: #019c88;

View File

@ -1088,12 +1088,13 @@
"pagePath": "pages/index/index",
"iconPath": "static/tabbar/tabrNav.png",
"selectedIconPath": "static/tabbar/tabrNav.png"
},{
"pagePath": "pages/videoCircle/index",
"iconPath": "static/tabbar/bottom1_1.png",
"selectedIconPath": "static/tabbar/bottom1_2.png",
"text": "视频圈"
},
// {
// "pagePath": "pages/videoCircle/index",
// "iconPath": "static/tabbar/bottom1_1.png",
// "selectedIconPath": "static/tabbar/bottom1_2.png",
// "text": "视频圈"
// },
{
"pagePath": "pages/therapist/therapist",
"iconPath": "static/tabbar/bottom2_1.png",

View File

@ -3,7 +3,6 @@
<view class="index-head">
<view class="index-top">
<view class="index-top-left font-size-34">盛安到家</view>
<!-- <view class="index-top-left font-size-34">11111-{{latitude}}-11111111111-{{longitude}}-</view> -->
<view class="index-top-mian">
<view class="index-top-mian-text">
@ -128,7 +127,7 @@
<view class="index-fujin-jie">
<view class="index-fujin-jie-view">
<span class="index-fujin-jie-name">{{item.artificerName}}</span>
<span class="index-fujin-jie-id">{{item.content}}</span>
<!-- <span class="index-fujin-jie-id">{{item.content}}</span> -->
</view>
</view>
</view>
@ -380,7 +379,6 @@
}
}
})
console.log(11)
uni.getLocation({
type: 'wgs84',
// geocode: true, //true
@ -451,6 +449,7 @@
this.getIsVip()
this.getKTCityList();
this.getHomeArtificerList();
this.getHomeNearbyList();
this.latitude = uni.getStorageSync('latitude')
this.longitude = uni.getStorageSync('longitude')
}else{
@ -755,6 +754,7 @@
uni.setStorageSync('city', this.city)
this.getKTCityList();
this.getHomeArtificerList();
this.getHomeNearbyList();
// this.page = 1
// this.getlist()
},
@ -826,7 +826,7 @@
}
return status;
},
getHomeArtificerList(){
getHomeNearbyList(){//
var data={
isStart: 1,
status: 1,
@ -838,7 +838,6 @@
}
this.$Request.get("/app/artificer/getHomeArtificerList",data).then(res => {
if (res.code == 0) {
this.starTechnician = res.startData.list;
this.nearbyTechnician=res.nearData.list;
// const myLatitude = this.latitude; //
// const myLongitude = this.longitude; //
@ -856,6 +855,35 @@
this.nearbyTechnician[i].dingwei= distance.toFixed(1)
console.log(`距离为: ${distance.toFixed(1)} km`);
}
this.nearbyTechnician.sort((a, b) => a.dingwei - b.dingwei);
// this.classifyId = res.data[0].id;
// this.getorderlist('')
}
});
},
getHomeArtificerList(){//
var data={
isStart: 1,
status: 1,
city: this.city,
longitude:this.longitude,
latitude:this.latitude,
page: 1,
limit: 6
}
this.$Request.get("/app/artificer/getHomeArtificerList",data).then(res => {
if (res.code == 0) {
this.starTechnician = res.startData.list;
for(var i=0;i<this.nearbyTechnician.length;i++){
const distance = this.calculateDistance(
this.latitude,
this.longitude,
this.nearbyTechnician[i].latitude,
this.nearbyTechnician[i].longitude
);
this.nearbyTechnician[i].dingwei= distance.toFixed(1)
console.log(`距离为: ${distance.toFixed(1)} km`);
}
console.log("starTechnician===>",this.nearbyTechnician)
// this.classifyId = res.data[0].id;
// this.getorderlist('')

View File

@ -30,23 +30,19 @@
</view>
<view class="item-view-xiangmu">
<span class="xiaoer item-view-biao">{{item.classifyName}}</span>
<span>已售{{item.sales}}w+ | 好评{{item.esteemRate}}%</span>
<view class="item-view-bottom-qian">
<span></span>
<span style="color: #F95900;">{{item.price}}</span>
<span>/</span>
<span></span>
<span style="text-decoration: line-through;">{{item.oldPrice}}</span>
</view>
</view>
<view class="item-view-jianjie">
{{item.jianjie}}
</view>
<view class="item-view-bottom">
<view class="item-view-bottom-qian">
<span></span>
<span>{{item.price}}</span>
<<<<<<< .mine
<span>/</span>
=======
<span>/</span>
>>>>>>> .theirs
<span></span>
<span style="text-decoration: line-through;">{{item.oldPrice}}</span>
</view>
<span>已售{{item.sales}}w+ | 好评{{item.esteemRate}}%</span>
<view class="item-view-bottom-btn">
查看
</view>

View File

@ -576,7 +576,7 @@
padding: 12px 14px;
display: flex;
flex-direction: column;
margin: 0px auto 10px auto;
margin: 0px auto 70px auto;
}
.my-use-view{
width: 100%;