支付宝小程序代码修改

This commit is contained in:
Sliverber 2024-02-22 13:15:51 +08:00
parent fcf7b0bada
commit af31fc3a0c
16 changed files with 1849 additions and 249 deletions

View File

@ -81,7 +81,9 @@ export function orderComment(data) {
export function orderPay(data) { export function orderPay(data) {
return request.post('pay/payment', data); return request.post('pay/payment', data);
} }
export function orderPays(data) {
return request.post('user/aliPayRepayment', data);
}
/** /**
* 订单统计数据 * 订单统计数据
*/ */

View File

@ -1,7 +1,7 @@
//移动端商城API //移动端商城API
// let domain = 'http://117.50.163.143:20410' // let domain = 'http://117.50.163.143:20410'
// let domain = 'http://117.50.215.20:20410' // let domain = 'http://117.50.215.20:20410'
// let domain = 'http://192.168.2.14:8081' // let domain = 'http://192.168.2.26:20411'
// let domain = 'http://106.75.49.247:20410' // let domain = 'http://106.75.49.247:20410'
let domain = 'https://yruibao.com/prod' let domain = 'https://yruibao.com/prod'
module.exports = { module.exports = {

View File

@ -1,6 +1,6 @@
{ {
"name" : "先享后付", "name" : "先享后付",
"appid" : "__UNI__C7D69AA", //wxb74514b47a2f29d4 wx46c3a73d8c4f7051 __UNI__EB8A7B "appid" : "__UNI__EA8F22D", //wxb74514b47a2f29d4 wx46c3a73d8c4f7051 __UNI__EB8A7B
"description" : "crmeb商城", "description" : "crmeb商城",
"versionName" : "2.1", "versionName" : "2.1",
"versionCode" : 2, "versionCode" : 2,

View File

@ -820,6 +820,14 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }
,{
"path" : "alipay_returns/alipay_return",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{ ,{
"path" : "alipay_invoke/index", "path" : "alipay_invoke/index",
"style" : "style" :

View File

@ -108,20 +108,20 @@
</scroll-view> </scroll-view>
<view class='footer acea-row row-between-wrapper'> <view class='footer acea-row row-between-wrapper'>
<!-- #ifdef MP --> <!-- #ifdef MP -->
<button hover-class='none' class='item skeleton-rect' @click="onClickService" v-if="chatConfig.telephone_service_switch === '1'"> <!-- <button hover-class='none' class='item skeleton-rect' @click="onClickService" v-if="chatConfig.telephone_service_switch === '1'">
<view class='iconfont icon-kefu'></view> <view class='iconfont icon-kefu'></view>
<view>客服</view> <view>客服</view>
</button> </button> -->
<button open-type="contact" hover-class='none' class='item skeleton-rect' v-else> <!-- <button open-type="contact" hover-class='none' class='item skeleton-rect' v-else>
<view class='iconfont icon-kefu'></view> <view class='iconfont icon-kefu'></view>
<view>客服</view> <view>客服</view>
</button> </button> -->
<!-- #endif --> <!-- #endif -->
<!-- #ifndef MP --> <!-- #ifndef MP -->
<navigator hover-class="none" class="item skeleton-rect" @click="onClickService"> <!-- <navigator hover-class="none" class="item skeleton-rect" @click="onClickService">
<view class="iconfont icon-kefu"></view> <view class="iconfont icon-kefu"></view>
<view>客服</view> <view>客服</view>
</navigator> </navigator> -->
<!-- #endif --> <!-- #endif -->
<view @tap='setCollect' class='item skeleton-rect'> <view @tap='setCollect' class='item skeleton-rect'>
<view class='iconfont icon-shoucang1' v-if="userCollect"></view> <view class='iconfont icon-shoucang1' v-if="userCollect"></view>

View File

@ -200,10 +200,10 @@
</button> </button>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef MP --> <!-- #ifndef MP -->
<view class="item skeleton-rect" @click="onClickService"> <!-- <view class="item skeleton-rect" @click="onClickService">
<view class="iconfont icon-kefu"></view> <view class="iconfont icon-kefu"></view>
<view>客服</view> <view>客服</view>
</view> </view> -->
<!-- #endif --> <!-- #endif -->
<block v-if="type === 'normal'"> <block v-if="type === 'normal'">
<view @click="setCollect" class='item skeleton-rect'> <view @click="setCollect" class='item skeleton-rect'>

View File

@ -113,17 +113,17 @@
<!-- #ifndef MP --> <!-- #ifndef MP -->
<div class="goodCall borRadius14" @click="onClickService"> <div class="goodCall borRadius14" @click="onClickService">
<span class="iconfont icon-kefu"></span><span>联系客服</span> <!-- <span class="iconfont icon-kefu"></span><span>联系客服</span> -->
</div> </div>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP --> <!-- #ifdef MP -->
<div class="goodCall borRadius14"> <div class="goodCall borRadius14">
<button hover-class='none' @click="onClickService" v-if="chatConfig.telephone_service_switch === '1'"> <!-- <button hover-class='none' @click="onClickService" v-if="chatConfig.telephone_service_switch === '1'">
<span class="iconfont icon-kefu"></span><span>联系客服</span> <span class="iconfont icon-kefu"></span><span>联系客服</span>
</button> </button>
<button open-type='contact' hover-class='none' v-else> <button open-type='contact' hover-class='none' v-else>
<span class="iconfont icon-kefu"></span><span>联系客服</span> <span class="iconfont icon-kefu"></span><span>联系客服</span>
</button> </button> -->
</div> </div>
<!-- #endif --> <!-- #endif -->
</view> </view>

View File

@ -111,14 +111,14 @@
</view> </view>
</block> </block>
<!-- #ifndef MP --> <!-- #ifndef MP -->
<view class="item" @click="onClickService"> <!-- <view class="item" @click="onClickService">
<image :src="servicePic"></image> <image :src="servicePic"></image>
<text>联系客服</text> <text>联系客服</text>
</view> </view> -->
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP --> <!-- #ifdef MP -->
<!-- v-if="chatConfig.telephone_service_switch" --> <!-- v-if="chatConfig.telephone_service_switch" -->
<button class="item" hover-class='none' @click="onClickService" <!-- <button class="item" hover-class='none' @click="onClickService"
v-if="chatConfig.telephone_service_switch === '1'"> v-if="chatConfig.telephone_service_switch === '1'">
<image :src="servicePic"></image> <image :src="servicePic"></image>
<text>联系客服</text> <text>联系客服</text>
@ -126,7 +126,7 @@
<button class="item" open-type='contact' hover-class='none' v-else> <button class="item" open-type='contact' hover-class='none' v-else>
<image :src="servicePic"></image> <image :src="servicePic"></image>
<text>联系客服</text> <text>联系客服</text>
</button> </button> -->
<!-- #endif --> <!-- #endif -->
</view> </view>
</view> </view>

File diff suppressed because it is too large Load Diff

View File

@ -1110,7 +1110,7 @@
uid: this.$store.getters.uid uid: this.$store.getters.uid
} }
getidentity(data).then(res=>{ getidentity(data).then(res=>{
if (res.message == '操作成功') { if (res.message == '操作成功' && res.data!=null){
this.sfxx = '已完成' this.sfxx = '已完成'
this.identification = res.data this.identification = res.data
} }

View File

@ -76,8 +76,10 @@
</view> </view>
<view class='bottom acea-row row-right row-middle'> <view class='bottom acea-row row-right row-middle'>
<view class="bohui" v-if="item.status == -4">驳回原因:&nbsp;{{item.auditRejectReason}}</view> <view class="bohui" v-if="item.status == -4">驳回原因:&nbsp;{{item.auditRejectReason}}</view>
<!-- <view class='bnt bg_color' @click='goPay(item.payPrice,item.orderId)'>立即付款</view> -->
<!-- <view class='bnt cancelBnt' v-if="item.status == 6 || item.status== 7" @click='cancelOrder(index,item.id)'>取消订单</view> --> <!-- <view class='bnt cancelBnt' v-if="item.status == 6 || item.status== 7" @click='cancelOrder(index,item.id)'>取消订单</view> -->
<view class='bnt bg_color' v-if="item.status==7" @click='lijiqy(item.orderId,item.id)'>立即签约 <view class='bnt bg_color' v-if="item.status==7" @click='lijiqy(item.orderId,item.id)'>立即签约
<!-- <view class='bnt bg_color' v-if="item.status==7" @click='lijiali()'>立即签约 -->
</view> </view>
<view class='bnt bg_color' <view class='bnt bg_color'
v-else-if="item.status== 2 || item.status== 8 || item.status== 4 || item.status== -1" v-else-if="item.status== 2 || item.status== 8 || item.status== 4 || item.status== -1"
@ -216,8 +218,16 @@
// #ifdef H5 // #ifdef H5
if (this.$wechat.isWeixin()) this.payMode.pop(); if (this.$wechat.isWeixin()) this.payMode.pop();
// #endif // #endif
}, },
methods: { methods: {
lijiali(){
uni.webView.postMessage({
data: {
action: 'getqiany'
}
})
},
// //
lijiqy(id, ids) { lijiqy(id, ids) {
this.$Cache.set('qyids', id) this.$Cache.set('qyids', id)

View File

@ -1,5 +1,8 @@
<template> <template>
<view class="repaymentbox"> <view class="repaymentbox">
<!-- <view class="toreturn" @click="toreturn()">
111111111
</view> -->
<view class="repaymenttext"> <view class="repaymenttext">
<a href="javascript:;" :class="index == 0 ? 'active' : ''" v-model="index" @click="btnhk">待还款</a> <a href="javascript:;" :class="index == 0 ? 'active' : ''" v-model="index" @click="btnhk">待还款</a>
<a href="javascript:;" :class="index == 1 ? 'active' : ''" v-model="index" @click="btnjq">已结清</a> <a href="javascript:;" :class="index == 1 ? 'active' : ''" v-model="index" @click="btnjq">已结清</a>
@ -18,10 +21,14 @@
{{item.repaymentStatus == 'Pending'? '待还款' : 'Partial' ? '部分还款' : 'Paid' ? '已还款' : '逾期'}}</view> {{item.repaymentStatus == 'Pending'? '待还款' : 'Partial' ? '部分还款' : 'Paid' ? '已还款' : '逾期'}}</view>
<!-- 'Pending'? '待还款' : 'Partial' ? '部分还款' : 'Paid' ? '已还款' : '逾期' --> <!-- 'Pending'? '待还款' : 'Partial' ? '部分还款' : 'Paid' ? '已还款' : '逾期' -->
</view> </view>
</view> </view>
<view class="rt"> <view class="rt">
<a href="javascript:;">{{title}}</a> <a href="javascript:;" @click='goPay(item.repaymentAmount,item.id)'>{{title}}</a>
<!-- <view class='bnt bg_color' v-if="!item.paid" @click='goPay(item.payPrice,item.orderId)'>立即付款</view> -->
</view> </view>
<payment :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id" :totalPrice='totalPrice'>
</payment>
</view> </view>
</view> </view>
</template> </template>
@ -30,19 +37,49 @@
import { import {
getreceivable getreceivable
} from '@/api/api.js' } from '@/api/api.js'
import payment from '@/components/payments';
export default { export default {
data() { data() {
return { return {
index: 0, index: 0,
binglist: [], binglist: [],
title: '还款' title: '还款',
pay_close: false,
pay_order_id: '',
totalPrice: '0',
} }
}, },
components: {
payment,
},
onLoad() { onLoad() {
uni.webView.postMessage({
data: {
action: 'authorize'
}
})
this.getData() this.getData()
// console.log(this.$Cache.get('orderno')) // console.log(this.$Cache.get('orderno'))
// window.my.postMessage({ action: 'authorize' });
// step 4.
}, },
methods: { methods: {
toreturn(){
console.log('点击了');
// uni.navigateTo({
// url: '/pages/users/alipay_return/alipay_return'
// })
},
ispayok(num){
uni.navigateTo({
url: '/pages/users/alipay_return/alipay_return'
})
},
btnhk() { btnhk() {
this.index = 0 this.index = 0
this.title = '还款' this.title = '还款'
@ -57,13 +94,59 @@
getData: function() { getData: function() {
let data = { let data = {
uid:this.$store.getters.uid, uid:this.$store.getters.uid,
orderId:this.$Cache.get('ordernobh'), // orderId:this.$Cache.get('ordernobh'),
type: this.index type: this.index
} }
getreceivable(data).then(res => { getreceivable(data).then(res => {
this.binglist = res.data this.binglist = res.data
}) })
} },
/**
* 事件回调
*
*/
onChangeFun: function(e) {
let opt = e;
let action = opt.action || null;
let value = opt.value != undefined ? opt.value : null;
(action && this[action]) && this[action](value);
},
/**
* 关闭支付组件
*
*/
payClose: function() {
this.pay_close = false;
},
/**
* 打开支付组件
*
*/
goPay(pay_price, order_id) {
this.$set(this, 'pay_close', true);
this.$set(this, 'pay_order_id', order_id);
this.$set(this, 'totalPrice', pay_price);
},
/**
* 支付成功回调
*
*/
pay_complete: function() {
this.loadend = false;
this.page = 1;
this.$set(this, 'orderList', []);
this.$set(this, 'pay_close', false);
this.getOrderData();
this.getOrderList();
},
/**
* 支付失败回调
*
*/
pay_fail: function() {
this.pay_close = false;
},
} }
} }
</script> </script>

View File

@ -52,12 +52,17 @@
} }
}, },
onLoad(option) { onLoad(option) {
this.orderNo = this.$Cache.get('qyids') // this.orderNo = this.$Cache.get('qyids')
// console.log(this.id) // console.log(this.id)
// this.orderNo = option.orderId this.orderNo = option.orderId
let token =option.token
console.log(token,'tokentokentokentokentoken');
this.$store.commit("LOGIN", {
'token': token
});
// this.shopobj = JSON.parse(option.shopobj) // this.shopobj = JSON.parse(option.shopobj)
this.getnews(this.orderNo) // this.getnews()
this.logoflag = true // this.logoflag = true
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.getnews() this.getnews()
@ -67,14 +72,15 @@
}, },
methods: { methods: {
getnews(orderNo) { getnews() {
getqianyue(orderNo).then(res => { getqianyue(this.orderNo).then(res => {
console.log(res) console.log(res)
this.signStatus = res.data.signStatus this.signStatus = res.data.signStatus
if (this.signStatus == 2) { if (this.signStatus == 2) {
this.flag = true this.flag = true
this.text = '成功' this.text = '成功'
this.logoflag = false this.logoflag = false
clearInterval(this.timer);
} }
}) })
}, },

View File

@ -1,29 +1,48 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="apple-mobile-web-app-title" content="融合评价"> <title>
<title> <%= htmlWebpackPlugin.options.title %>
<%= htmlWebpackPlugin.options.title %> </title>
</title> <!-- Open Graph data -->
<!-- Open Graph data --> <!-- <meta property="og:title" content="Title Here" /> -->
<!-- <meta property="og:title" content="Title Here" /> --> <!-- <meta property="og:url" content="http://www.example.com/" /> -->
<!-- <meta property="og:url" content="http://www.example.com/" /> --> <!-- <meta property="og:image" content="http://example.com/image.jpg" /> -->
<!-- <meta property="og:image" content="http://example.com/image.jpg" /> --> <!-- <meta property="og:description" content="Description Here" /> -->
<!-- <meta property="og:description" content="Description Here" /> --> <script>
<script> var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)')) .supports(
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />') 'top: constant(a)'))
</script> document.write(
<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" /> '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
<link rel="apple-touch-icon" href="/static/favicon.png"> (coverSupport ? ', viewport-fit=cover' : '') + '" />')
</head> </script>
<body> <link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
<noscript> </head>
<strong>Please enable JavaScript to continue.</strong> <body>
</noscript> <noscript>
<div id="app"></div> <strong>Please enable JavaScript to continue.</strong>
<!-- built files will be auto injected --> </noscript>
</body> <div id="app"></div>
</html> <!-- built files will be auto injected -->
</body>
<script type="text/javascript">
var userAgent = navigator.userAgent;
if (userAgent.indexOf('AlipayClient') > -1) {
// 支付宝小程序的 JS-SDK 防止 404 需要动态加载,如果不需要兼容支付宝小程序,则无需引用此 JS 文件。
document.writeln('<script src="https://appx/web-view.min.js"' + '>' + '<' + '/' + 'script>');
}
</script>
<script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script>
<script type="text/javascript">
// 待触发 `UniAppJSBridgeReady` 事件后,即可调用 uni 的 API。
document.addEventListener('UniAppJSBridgeReady', function() {
uni.webView.getEnv(function(res) {
console.log('当前环境:' + JSON.stringify(res));
});
});
</script>
</html>

View File

@ -6,10 +6,10 @@ export function checkOverdue(data) {
url: Url + '/api/front/user', url: Url + '/api/front/user',
method: 'GET', method: 'GET',
header: header, header: header,
success:(res) =>{ // success:(res) =>{
if([410000, 410001, 410002, 401].indexOf(res.data.code) !== -1){ // if([410000, 410001, 410002, 401].indexOf(res.data.code) !== -1){
store.commit("LOGOUT"); // store.commit("LOGOUT");
} // }
} // }
}) })
} }

View File

@ -46,7 +46,7 @@ function baseRequest(url, method, data, {
else if (res.data.code == 200) else if (res.data.code == 200)
reslove(res.data, res); reslove(res.data, res);
else if ([410000, 410001, 410002, 401].indexOf(res.data.code) !== -1) { else if ([410000, 410001, 410002, 401].indexOf(res.data.code) !== -1) {
toLogin(); // toLogin();
reject(res.data); reject(res.data);
}else if (res.data.code == 500){ }else if (res.data.code == 500){
reject(res.data.message || '系统异常'); reject(res.data.message || '系统异常');