余额支付

main
123456 3 weeks ago
parent 16c2610037
commit de36f27994
  1. 2
      manifest.json
  2. 54
      pages/index/index.vue
  3. 37
      pages/peiwan/confirm.vue
  4. 31
      pages/users/center/index.vue
  5. 62
      pages/users/chat/index.vue
  6. 2
      pages/users/edit/index.vue
  7. 39
      pages/users/recharge/index.vue
  8. 30
      pages/users/task/index.vue
  9. BIN
      static/yue.png
  10. 2
      unpackage/dist/dev/app-plus/app-config-service.js
  11. 2530
      unpackage/dist/dev/app-plus/app-service.js
  12. 387
      unpackage/dist/dev/app-plus/app-view.js
  13. 2
      unpackage/dist/dev/app-plus/manifest.json
  14. BIN
      unpackage/dist/dev/app-plus/static/yue.png
  15. BIN
      unpackage/dist/dev/app-plus/static/余额.png

@ -1,5 +1,5 @@
{ {
"name" : "chunwan", "name" : "纯玩",
"appid" : "__UNI__7C06BEE", "appid" : "__UNI__7C06BEE",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",

@ -220,13 +220,27 @@
}, },
methods: { methods: {
// //
trackUpload(res){ async trackUpload(res,type){
this.$api.trackUpload({ const {code, data,} = await this.$api.trackUpload({
userId: uni.getStorageSync("userInfo").id, userId: uni.getStorageSync("userInfo").id,
lat: res.latitude, lat: res.latitude,
lon: res.longitude, lon: res.longitude,
}); });
if(code == 200){
if(type==1){
uni.navigateTo({
url: "/pages/pipei/tongcheng/index"
})
}else if(type == 2){
uni.navigateTo({
url: "/pages/pipei/yuyin/index"
})
}else if(type == 3){
uni.navigateTo({
url: "/pages/pipei/shipin/index"
})
}
}
}, },
// //
async userBalance() { async userBalance() {
@ -383,15 +397,20 @@
} }
}) })
}, },
openPage(index,id){ openPage(index,id){
const that = this;
if(index == 1){ if(index == 1){
if(this.userInfo.realnameFlag == 0){ if(this.userInfo.realnameFlag == 0){
this.isPopup = true this.isPopup = true
return ; return ;
} }
uni.navigateTo({ uni.getLocation({
url: "/pages/pipei/tongcheng/index" type: 'gcj02',
}) success(res) {
that.trackUpload(res,1)
}
})
}else if(index == 2){ }else if(index == 2){
if(this.userInfo.realnameFlag == 0){ if(this.userInfo.realnameFlag == 0){
this.isPopup = true this.isPopup = true
@ -413,10 +432,14 @@
}) })
return ; return ;
} }
} }
uni.navigateTo({ uni.getLocation({
url: "/pages/pipei/yuyin/index" type: 'gcj02',
success(res) {
that.trackUpload(res,2)
}
}) })
}else if(index == 3){ }else if(index == 3){
if(this.userInfo.realnameFlag == 0){ if(this.userInfo.realnameFlag == 0){
this.isPopup = true this.isPopup = true
@ -438,9 +461,12 @@
}) })
return ; return ;
} }
} }
uni.navigateTo({ uni.getLocation({
url: "/pages/pipei/shipin/index" type: 'gcj02',
success(res) {
that.trackUpload(res,3)
}
}) })
}else if(index == 4){ }else if(index == 4){
uni.navigateTo({ uni.navigateTo({

@ -86,9 +86,10 @@
<view class="title">支付方式</view> <view class="title">支付方式</view>
<view class="pay" v-if="payInfo && payInfo.length >= 1"> <view class="pay" v-if="payInfo && payInfo.length >= 1">
<template v-for="(a,i) in payInfo"> <template v-for="(a,i) in payInfo">
<view class="item" v-if="a=='wx-1' || a=='ali-1'" :key="i" :class="tabIndex == i?'item-on':''" @click="tabItem(i,a)"> <view class="item" v-if="a=='wx-1' || a=='ali-1' || a=='integral-1'" :key="i" :class="tabIndex == i?'item-on':''" @click="tabItem(i,a)">
<view class="a" v-if="a=='wx-1'"><image src="@/static/wxpay.png"></image>微信支付</view> <view class="a" v-if="a=='wx-1'"><image src="@/static/wxpay.png"></image>微信支付</view>
<view class="a" v-if="a=='ali-1'"><image src="@/static/zfb.png"></image>支付宝支付</view> <view class="a" v-if="a=='ali-1'"><image src="@/static/zfb.png"></image>支付宝支付</view>
<view class="a" v-if="a=='integral-1'"><image src="@/static/yue.png"></image>余额支付<text>账户余额{{userInfo.money}}</text></view>
<view class="b"> <view class="b">
<image class="img1" src="@/static/icon-check.png"></image> <image class="img1" src="@/static/icon-check.png"></image>
<image class="img2" src="@/static/icon-check-on.png"></image> <image class="img2" src="@/static/icon-check-on.png"></image>
@ -127,7 +128,8 @@
lat: "", lat: "",
lon: "", lon: "",
lufeiTotal: 0, lufeiTotal: 0,
distance: 0, distance: 0,
userInfo: {},
sellerServiceList: [], sellerServiceList: [],
params: { params: {
year: true, year: true,
@ -144,9 +146,25 @@
onLoad(o) { onLoad(o) {
this.id = o.id; this.id = o.id;
this.userSellerServiceList(); this.userSellerServiceList();
this.getConfigData(); this.getConfigData();
this.getUserInfo();
}, },
methods: { methods: {
//
async getUserInfo() {
const { code, data , msg } = await this.$api.findUserInfo({userId: uni.getStorageSync("userInfo").id});
if(code == 200){
this.userInfo = data;
uni.setStorageSync("userInfo",data);
}else{
uni.showToast({
title: msg,
position: "bottom",
icon: "none",
})
}
},
calculateDistance(lat1, lon1, lat2, lon2) { calculateDistance(lat1, lon1, lat2, lon2) {
const radius = 6371; // const radius = 6371; //
@ -277,7 +295,7 @@
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
position: "bottom", position: "bottom",
title: "见面位置" title: "请选择见面位置"
}) })
return ; return ;
} }
@ -446,7 +464,12 @@
.a{ .a{
flex: 1; flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
text{
margin-left: 20rpx;
font-size: 22rpx;
color: #999999;
}
image{ image{
width: 60rpx; width: 60rpx;
height: 60rpx; height: 60rpx;

@ -111,9 +111,10 @@
<view class="title">支付方式</view> <view class="title">支付方式</view>
<view class="pay" v-if="payInfo && payInfo.length >= 1"> <view class="pay" v-if="payInfo && payInfo.length >= 1">
<template v-for="(a,i) in payInfo"> <template v-for="(a,i) in payInfo">
<view class="item" v-if="a=='wx-1' || a=='ali-1'" :key="i" :class="payIndex == i?'item-on':''" @click="tabPay(i,a)"> <view class="item" v-if="a=='wx-1' || a=='ali-1' || a=='integral-1'" :key="i" :class="payIndex == i?'item-on':''" @click="tabPay(i,a)">
<view class="a" v-if="a=='wx-1'"><image src="@/static/wxpay.png"></image>微信支付</view> <view class="a" v-if="a=='wx-1'"><image src="@/static/wxpay.png"></image>微信支付</view>
<view class="a" v-if="a=='ali-1'"><image src="@/static/zfb.png"></image>支付宝支付</view> <view class="a" v-if="a=='ali-1'"><image src="@/static/zfb.png"></image>支付宝支付</view>
<view class="a" v-if="a=='integral-1'"><image src="@/static/yue.png"></image>余额支付<text>账户余额{{userInfo.money}}</text></view>
<view class="b"> <view class="b">
<image class="img1" src="@/static/icon-check.png"></image> <image class="img1" src="@/static/icon-check.png"></image>
<image class="img2" src="@/static/icon-check-on.png"></image> <image class="img2" src="@/static/icon-check-on.png"></image>
@ -239,7 +240,16 @@
}) })
return ; return ;
} }
if(this.payType == 'integral-1'){
if(this.list[this.tabIndex].presentPrice > this.userInfo.money){
uni.showToast({
icon: "none",
position: "bottom",
title: "账户余额不足"
})
return ;
}
}
uni.showLoading({ uni.showLoading({
title: "正在支付" title: "正在支付"
}) })
@ -262,12 +272,21 @@
async toPay(outTradeNo) { async toPay(outTradeNo) {
const that = this; const that = this;
const {code, data, msg} = await that.$api.paymentOrder({ const {code, data, msg} = await that.$api.paymentOrder({
payType: that.payType =='wx-1'?1:2, payType: that.payType =='wx-1'?1:(that.payType=='ali-1'?2:3),
outTradeNo outTradeNo
}) })
if(code == 200){ if(code == 200){
console.log(data) console.log(data)
uni.hideLoading() uni.hideLoading()
if(that.payType == 'integral-1'){
uni.showToast({
title: "支付成功"
})
that.payType = ""
that.getUserInfo();
that.getList();
return ;
}
uni.requestPayment({ uni.requestPayment({
provider: that.payType == 'ali-1'?'alipay':'wxpay', provider: that.payType == 'ali-1'?'alipay':'wxpay',
orderInfo: that.payType == 'ali-1'?data.orderInfo:JSON.parse(data.orderInfo), // orderInfo: that.payType == 'ali-1'?data.orderInfo:JSON.parse(data.orderInfo), //
@ -438,7 +457,11 @@
} }
.a{ .a{
flex: 1; flex: 1;
text{
margin-left: 20rpx;
font-size: 22rpx;
color: #999999;
}
display: flex; display: flex;
align-items: center; align-items: center;
image{ image{

@ -121,10 +121,18 @@
</view> </view>
</view> </view>
<view class="b" v-if="isOpen"> <view class="b" v-if="isOpen">
<image @click="uploadImg()" src="@/static/chat-zhaopian.png"></image> <view class="dt" @click="uploadImg()">
<image @click="uploadVideo()" src="@/static/chat-xiangji.png"></image> <image src="@/static/chat-zhaopian.png"></image>
<image @click="openShiping()" src="@/static/chat-yinshipin.png"></image> </view>
<image @click="openGift()" src="@/static/chat-liwu.png"></image> <view class="dt" @click="uploadVideo()">
<image src="@/static/chat-xiangji.png"></image>
</view>
<view class="dt" @click="openShiping()">
<image src="@/static/chat-yinshipin.png"></image>
</view>
<view class="dt" @click="openGift()">
<image src="@/static/chat-liwu.png"></image>
</view>
</view> </view>
<view class="c" v-if="isBiaoqing"> <view class="c" v-if="isBiaoqing">
<image @click="toClick(i)" v-for="i in 75" :key="i" :src="'https://api.lyiyuan.cn/profile/upload/static/face/'+i+'.gif'"></image> <image @click="toClick(i)" v-for="i in 75" :key="i" :src="'https://api.lyiyuan.cn/profile/upload/static/face/'+i+'.gif'"></image>
@ -692,19 +700,23 @@
num: type == 5?that.count:(that.count+1), num: type == 5?that.count:(that.count+1),
message: type == 3?that.content: that.img message: type == 3?that.content: that.img
}) })
if(code == 200){ if(code == 200){
let svgaSrc = null
if(that.giftList && that.giftList.length > 0){
svgaSrc = that.giftList[that.tabIndex].specialEffects
}
uni.sendSocketMessage({data:JSON.stringify({ uni.sendSocketMessage({data:JSON.stringify({
"userId": uni.getStorageSync("userInfo").id, "userId": uni.getStorageSync("userInfo").id,
sellerId:that.id, sellerId:that.id,
type, type,
num: (that.count+1), num: (that.count+1),
message: (type == 3?that.content: that.img), message: (type == 3?that.content: that.img),
svgaSrc: that.giftList[that.tabIndex].specialEffects, svgaSrc: svgaSrc?svgaSrc:'',
"topic":"message" "topic":"message"
})}) })})
if(type==5){ if(type==5){
that.svgaSrc = that.giftList[that.tabIndex].specialEffects if(svgaSrc){
if(that.svgaSrc){ that.svgaSrc = svgaSrc
that.isSvga = true; that.isSvga = true;
that.$refs.cSvgaRef.call("clear"); that.$refs.cSvgaRef.call("clear");
that.$refs.cSvgaRef.call("startAnimation") that.$refs.cSvgaRef.call("startAnimation")
@ -715,7 +727,6 @@
} }
that.isOpen = false; that.isOpen = false;
that.isBiaoqing = false; that.isBiaoqing = false;
that.isToggle = true;
that.show1 = false; that.show1 = false;
that.userBalance(); that.userBalance();
that.editorCtx.clear(); that.editorCtx.clear();
@ -1111,13 +1122,13 @@
/* #endif */ /* #endif */
height: calc(100vh - 190rpx - 88rpx - 70rpx); height: calc(100vh - 190rpx - 88rpx - 70rpx);
&-on{ &-on{
height: calc(100vh - 190rpx - 88rpx - 70rpx - 160rpx); height: calc(100vh - 190rpx - 88rpx - 70rpx - 260rpx);
} }
&-active{ &-active{
height: calc(100vh - 120rpx - 88rpx - 70rpx); height: calc(100vh - 120rpx - 88rpx - 70rpx);
} }
&-active1{ &-active1{
height: calc(100vh - 120rpx - 88rpx - 70rpx - 160rpx); height: calc(100vh - 120rpx - 88rpx - 70rpx - 260rpx);
} }
.changyong{ .changyong{
overflow: hidden; overflow: hidden;
@ -1487,22 +1498,27 @@
} }
.b{ .b{
width: 100%; width: 100%;
height: 160rpx; height: 260rpx;
display: flex; display: flex;
align-items: center;
justify-content: space-between; justify-content: space-between;
border-top: 1px solid #E2E2E2; border-top: 1px solid #E2E2E2;
padding: 0 45rpx; padding: 0 45rpx;
box-sizing: border-box; box-sizing: border-box;
image{ .dt{
width: 100rpx; flex: 1;
height: 100rpx; display: flex;
display: block; justify-content: center;
margin-top: 30rpx;
image{
width: 100rpx;
height: 100rpx;
display: block;
}
} }
} }
.c{ .c{
width: 100%; width: 100%;
height: 160rpx; height: 260rpx;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
border-top: 1px solid #E2E2E2; border-top: 1px solid #E2E2E2;
@ -1515,12 +1531,12 @@
opacity: 0; opacity: 0;
} }
image{ image{
width: 70rpx; width: 24px;
height: 70rpx; height: 24px;
float: left; float: left;
margin-top: 6rpx; margin-top: 5rpx;
margin-bottom: 6rpx; margin-bottom: 5rpx;
margin-right: 5rpx; margin-right: 7rpx;
} }
} }
} }

@ -120,7 +120,7 @@
<view class="b"> <view class="b">
<view class="txt" @click="show = true" v-if="!userInfo.sexFlag">请选择</view> <view class="txt" @click="show = true" v-if="!userInfo.sexFlag">请选择</view>
<view class="list" v-else> <view class="list" v-else>
<view class="li" v-for="(a,i) in userInfo.sexFlag" @click="show = true">{{a}}</view> <view class="li" v-for="(a,i) in userInfo.sexFlag" :key="i" @click="show = true">{{a}}</view>
</view> </view>
<image src="@/static/icon-arrow.png"></image> <image src="@/static/icon-arrow.png"></image>
</view> </view>

@ -19,9 +19,10 @@
<view class="title">选择充值方式</view> <view class="title">选择充值方式</view>
<view class="content"> <view class="content">
<template v-for="(a,i) in payInfo"> <template v-for="(a,i) in payInfo">
<view class="item" v-if="a=='wx-1' || a=='ali-1'" :key="i" :class="tabIndex == i?'item-on':''" @click="tabItem(i,a)"> <view class="item" v-if="a=='wx-1' || a=='ali-1' || a=='integral-1'" :key="i" :class="tabIndex == i?'item-on':''" @click="tabItem(i,a)">
<view class="a" v-if="a=='wx-1'"><image src="@/static/wxpay.png"></image>微信支付</view> <view class="a" v-if="a=='wx-1'"><image src="@/static/wxpay.png"></image>微信支付</view>
<view class="a" v-if="a=='ali-1'"><image src="@/static/zfb.png"></image>支付宝支付</view> <view class="a" v-if="a=='ali-1'"><image src="@/static/zfb.png"></image>支付宝支付</view>
<view class="a" v-if="a=='integral-1'"><image src="@/static/yue.png"></image>余额支付<text>账户余额{{userInfo.money}}</text></view>
<view class="b"> <view class="b">
<image class="img1" src="@/static/icon-check.png"></image> <image class="img1" src="@/static/icon-check.png"></image>
<image class="img2" src="@/static/icon-check-on.png"></image> <image class="img2" src="@/static/icon-check-on.png"></image>
@ -92,6 +93,16 @@
title: "请选择支付方式" title: "请选择支付方式"
}) })
return ; return ;
}
if(this.payType == 'integral-1'){
if(this.obj.giveCoins > this.userInfo.money){
uni.showToast({
icon: "none",
position: "bottom",
title: "账户余额不足"
})
return ;
}
} }
that.show = false; that.show = false;
that.tabIndex = -1; that.tabIndex = -1;
@ -116,11 +127,22 @@
async toPay(outTradeNo) { async toPay(outTradeNo) {
const that = this; const that = this;
const {code, data, msg} = await that.$api.paymentOrder({ const {code, data, msg} = await that.$api.paymentOrder({
payType: that.payType =='wx-1'?1:2, payType: that.payType =='wx-1'?1:(that.payType=='ali-1'?2:3),
outTradeNo outTradeNo
}) })
if(code == 200){ if(code == 200){
uni.hideLoading() uni.hideLoading()
if(that.payType == 'integral-1'){
uni.showToast({
title: "支付成功"
})
that.payType = ""
setTimeout(()=>{
that.getUserInfo();
that.getList();
},2000)
return ;
}
uni.requestPayment({ uni.requestPayment({
provider: that.payType == 'ali-1'?'alipay':'wxpay', provider: that.payType == 'ali-1'?'alipay':'wxpay',
orderInfo: that.payType == 'ali-1'?data.orderInfo:JSON.parse(data.orderInfo), // orderInfo: that.payType == 'ali-1'?data.orderInfo:JSON.parse(data.orderInfo), //
@ -129,7 +151,7 @@
title: "支付成功" title: "支付成功"
}) })
setTimeout(()=>{ setTimeout(()=>{
that.getUserInfo(); that.getUserInfo();
that.getList(); that.getList();
},2000) },2000)
}, },
@ -228,7 +250,12 @@
.a{ .a{
flex: 1; flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
text{
margin-left: 20rpx;
font-size: 22rpx;
color: #999999;
}
image{ image{
width: 60rpx; width: 60rpx;
height: 60rpx; height: 60rpx;

@ -8,7 +8,7 @@
<view class="content" v-if="info.noviceList && info.noviceList.length > 0"> <view class="content" v-if="info.noviceList && info.noviceList.length > 0">
<view class="item" v-for="(a,i) in info.noviceList" :key="i"> <view class="item" v-for="(a,i) in info.noviceList" :key="i">
<view class="a">{{a.name}}<view class="num">金币<text>+{{a.coins}}</text></view></view> <view class="a">{{a.name}}<view class="num">金币<text>+{{a.coins}}</text></view></view>
<view class="b" v-if="a.isFinish == 0">去完成</view> <view class="b" v-if="a.isFinish == 0" @click="openPage(a)">去完成</view>
<view class="b b-on" v-else>已完成</view> <view class="b b-on" v-else>已完成</view>
</view> </view>
</view> </view>
@ -16,7 +16,7 @@
<view class="content" v-if="info.dayList && info.dayList.length > 0"> <view class="content" v-if="info.dayList && info.dayList.length > 0">
<view class="item" v-for="(a,i) in info.dayList" :key="i"> <view class="item" v-for="(a,i) in info.dayList" :key="i">
<view class="a">{{a.name}}<view class="num">金币<text>+{{a.coins}}</text></view></view> <view class="a">{{a.name}}<view class="num">金币<text>+{{a.coins}}</text></view></view>
<view class="b" v-if="a.isFinish == 0" @click="toPage()">去完成</view> <view class="b" v-if="a.isFinish == 0" @click="openPage(a)">去完成</view>
<view class="b b-on" v-else>已完成</view> <view class="b b-on" v-else>已完成</view>
</view> </view>
</view> </view>
@ -41,10 +41,28 @@
this.getList(); this.getList();
}, },
methods: { methods: {
toPage() { openPage(a) {
uni.switchTab({ if(a.id==1002 || a.id==1003|| a.id==1004){
url: "/pages/index/index" uni.switchTab({
}) url: "/pages/index/index"
})
}else if(a.id==1000){
uni.switchTab({
url: "/pages/user/index"
})
}else if(a.id==1001){
uni.navigateTo({
url: "/pages/dongtai/add"
})
}else if(a.id==1||a.id==2||a.id==4){
uni.navigateTo({
url: "/pages/users/edit/index"
})
}else if(a.id==3){
uni.navigateTo({
url: "/pages/users/renzheng/index"
})
}
}, },
async getList() { async getList() {
const { code, data } = await this.$api.taskList({ const { code, data } = await this.$api.taskList({

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Loading…
Cancel
Save