2023-3-8
完善功能
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import store from '../store/index';
|
import store from '../store/index';
|
||||||
export default {
|
export default {
|
||||||
// qq 237524947 wx15d4269d3210863d
|
// qq 237524947 wx15d4269d3210863d
|
||||||
// BASEURI: 'http://5rygzr.natappfree.cc/api/',
|
// BASEURI: 'http://br68s5.natappfree.cc/api/',
|
||||||
BASEURI: 'http://mall.yyundong.com/portalapi/api/',
|
BASEURI: 'http://mall.yyundong.com/portalapi/api/',
|
||||||
// BASEURI: 'http://192.168.31.52:8083/api/',
|
// BASEURI: 'http://192.168.31.52:8083/api/',
|
||||||
ADMINURI: 'http://mall.yyundong.com/adminapi/',
|
ADMINURI: 'http://mall.yyundong.com/adminapi/',
|
||||||
@@ -281,11 +281,18 @@ export default {
|
|||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('error', error);
|
||||||
|
console.log('res', res);
|
||||||
if (undefined == res || 'undefined' == res) {
|
if (undefined == res || 'undefined' == res) {
|
||||||
console.log('index');
|
console.log('index');
|
||||||
uni.navigateTo({
|
uni.showToast({
|
||||||
url: `/pages/public/login`
|
title: '网络错误',
|
||||||
})
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url: `/pages/public/login`
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
if (res.data.msg == 'User token expired!') {
|
if (res.data.msg == 'User token expired!') {
|
||||||
console.log('User token expired');
|
console.log('User token expired');
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ eonfox.prototype = {
|
|||||||
|
|
||||||
//接口地址 应用ID
|
//接口地址 应用ID
|
||||||
api_server_url : 'http://server.test.eapie.com/',
|
api_server_url : 'http://server.test.eapie.com/',
|
||||||
application : "test",
|
application : "wxa66597d50184d027",
|
||||||
|
|
||||||
//会话名称
|
//会话名称
|
||||||
session_name : 'Eonfox_API_Engine_Session',
|
session_name : 'Eonfox_API_Engine_Session',
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ var fns = {
|
|||||||
//api接口验证
|
//api接口验证
|
||||||
checkError: function(data, ids, error) {
|
checkError: function(data, ids, error) {
|
||||||
if (typeof(error) != 'function') {
|
if (typeof(error) != 'function') {
|
||||||
error=function(){
|
error = function() {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (data.errno) {
|
if (data.errno) {
|
||||||
error(data.errno, data.error);
|
error(data.errno, data.error);
|
||||||
@@ -182,20 +181,23 @@ var fns = {
|
|||||||
}
|
}
|
||||||
return urlObj;
|
return urlObj;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
,
|
|
||||||
// url参数解析
|
// url参数解析
|
||||||
getUrlkey: function(url) {
|
getUrlkey: function(url) {
|
||||||
var params = {};
|
var params = {};
|
||||||
var urls = url.split("?"); console.log('1_分割url:', urls)
|
var urls = url.split("?");
|
||||||
var arr = urls[1].split("&"); console.log('2_分割urls[1]:', arr)
|
console.log('1_分割url:', urls)
|
||||||
|
var arr = urls[1].split("&");
|
||||||
|
console.log('2_分割urls[1]:', arr)
|
||||||
for (var i = 0, l = arr.length; i < l; i++) {
|
for (var i = 0, l = arr.length; i < l; i++) {
|
||||||
var a = arr[i].split("="); console.log('3_遍历 arr 并分割后赋值给a:', a[0], a[1])
|
var a = arr[i].split("=");
|
||||||
params[a[0]] = a[1]; console.log('4_a给params对象赋值:', params)
|
console.log('3_遍历 arr 并分割后赋值给a:', a[0], a[1])
|
||||||
} console.log('5_结果:', params)
|
params[a[0]] = a[1];
|
||||||
return params;
|
console.log('4_a给params对象赋值:', params)
|
||||||
}
|
}
|
||||||
,
|
console.log('5_结果:', params)
|
||||||
|
return params;
|
||||||
|
},
|
||||||
toast(tit, url, time) {
|
toast(tit, url, time) {
|
||||||
if (!time) {
|
if (!time) {
|
||||||
time = 1500
|
time = 1500
|
||||||
|
|||||||
@@ -212,6 +212,12 @@
|
|||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
this.$api.msg(data);
|
this.$api.msg(data);
|
||||||
|
let params = {
|
||||||
|
id: item.id
|
||||||
|
};
|
||||||
|
this.orderInfo = await Api.apiCall('get', Api.order.orderDetail, params);
|
||||||
|
this.orderInfo = Object.assign(this.orderInfo, this.orderStateExp(this.orderInfo.status));
|
||||||
|
this.orderInfo.createTime = this.dateFormat(this.orderInfo.createTime);
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="tabr" :style="{top:headerTop}">
|
<view class="tabr" :style="{top:headerTop}">
|
||||||
<view :class="{on:typeClass=='valid'}" @tap="switchType('valid')">可用({{couponValidList.length}})</view><view :class="{on:typeClass=='invalid'}" @tap="switchType('invalid')">已失效({{couponinvalidList.length}})</view>
|
<view :class="{on:typeClass=='valid'}" @tap="switchType('valid')">可用({{couponValidList.length}})</view>
|
||||||
|
<view :class="{on:typeClass=='invalid'}" @tap="switchType('invalid')">已失效({{couponinvalidList.length}})
|
||||||
|
</view>
|
||||||
<view class="border" :class="typeClass"></view>
|
<view class="border" :class="typeClass"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="place"></view>
|
<view class="place"></view>
|
||||||
@@ -15,7 +17,10 @@
|
|||||||
<view class="icon shanchu"></view>
|
<view class="icon shanchu"></view>
|
||||||
</view>
|
</view>
|
||||||
<!-- content -->
|
<!-- content -->
|
||||||
<view class="carrier" :class="[typeClass=='valid'?theIndex==index?'open':oldIndex==index?'close':'':'']" @touchstart="touchStart(index,$event)" @touchmove="touchMove(index,$event)" @touchend="touchEnd(index,$event)">
|
<view class="carrier"
|
||||||
|
:class="[typeClass=='valid'?theIndex==index?'open':oldIndex==index?'close':'':'']"
|
||||||
|
@touchstart="touchStart(index,$event)" @touchmove="touchMove(index,$event)"
|
||||||
|
@touchend="touchEnd(index,$event)">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
{{row.note}}
|
{{row.note}}
|
||||||
@@ -57,7 +62,10 @@
|
|||||||
<view class="icon shanchu"></view>
|
<view class="icon shanchu"></view>
|
||||||
</view>
|
</view>
|
||||||
<!-- content -->
|
<!-- content -->
|
||||||
<view class="carrier" :class="[typeClass=='invalid'?theIndex==index?'open':oldIndex==index?'close':'':'']" @touchstart="touchStart(index,$event)" @touchmove="touchMove(index,$event)" @touchend="touchEnd(index,$event)">
|
<view class="carrier"
|
||||||
|
:class="[typeClass=='invalid'?theIndex==index?'open':oldIndex==index?'close':'':'']"
|
||||||
|
@touchstart="touchStart(index,$event)" @touchmove="touchMove(index,$event)"
|
||||||
|
@touchend="touchEnd(index,$event)">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
{{row.note}}
|
{{row.note}}
|
||||||
@@ -104,7 +112,9 @@ import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue
|
|||||||
import Api from '@/common/api';
|
import Api from '@/common/api';
|
||||||
import eonfox from '@/components/eonfox/eonfox.js';
|
import eonfox from '@/components/eonfox/eonfox.js';
|
||||||
import fns from '@/components/eonfox/fns.js';
|
import fns from '@/components/eonfox/fns.js';
|
||||||
import { formatDate } from '@/common/date';
|
import {
|
||||||
|
formatDate
|
||||||
|
} from '@/common/date';
|
||||||
|
|
||||||
var ef = new eonfox();
|
var ef = new eonfox();
|
||||||
export default {
|
export default {
|
||||||
@@ -275,14 +285,21 @@ import Api from '@/common/api';
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
}
|
}
|
||||||
page{position: relative;background-color: #f5f5f5;}
|
|
||||||
|
page {
|
||||||
|
position: relative;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
.hidden {
|
.hidden {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.place {
|
.place {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 95upx;
|
height: 95upx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabr {
|
.tabr {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
/* #ifdef H5 || MP-WEIXIN*/
|
/* #ifdef H5 || MP-WEIXIN*/
|
||||||
@@ -295,6 +312,7 @@ import Api from '@/common/api';
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
|
|
||||||
view {
|
view {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
height: 90upx;
|
height: 90upx;
|
||||||
@@ -303,30 +321,49 @@ import Api from '@/common/api';
|
|||||||
font-size: 32upx;
|
font-size: 32upx;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.on {
|
.on {
|
||||||
color: $uni-color-success;
|
color: $uni-color-success;
|
||||||
}
|
}
|
||||||
|
|
||||||
.border {
|
.border {
|
||||||
height: 4upx;
|
height: 4upx;
|
||||||
background-color: $uni-color-success;
|
background-color: $uni-color-success;
|
||||||
transition: all .3s ease-out;
|
transition: all .3s ease-out;
|
||||||
|
|
||||||
&.invalid {
|
&.invalid {
|
||||||
transform: translate3d(100%, 0, 0);
|
transform: translate3d(100%, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.list {
|
.list {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes showValid {
|
@keyframes showValid {
|
||||||
0% {transform: translateX(-100%);}100% {transform: translateX(0);}
|
0% {
|
||||||
|
transform: translateX(-100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: translateX(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes showInvalid {
|
@keyframes showInvalid {
|
||||||
0% {transform: translateX(0);}100% {transform: translateX(-100%);}
|
0% {
|
||||||
|
transform: translateX(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: translateX(-100%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.sub-list {
|
.sub-list {
|
||||||
&.invalid {
|
&.invalid {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -334,16 +371,20 @@ import Api from '@/common/api';
|
|||||||
left: 100%;
|
left: 100%;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.showvalid {
|
&.showvalid {
|
||||||
display: flex;
|
display: flex;
|
||||||
animation: showValid 0.20s linear both;
|
animation: showValid 0.20s linear both;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.showinvalid {
|
&.showinvalid {
|
||||||
display: flex;
|
display: flex;
|
||||||
animation: showInvalid 0.20s linear both;
|
animation: showInvalid 0.20s linear both;
|
||||||
}
|
}
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 20upx 0 120upx 0;
|
padding: 20upx 0 120upx 0;
|
||||||
|
|
||||||
.tis {
|
.tis {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 60upx;
|
height: 60upx;
|
||||||
@@ -351,6 +392,7 @@ import Api from '@/common/api';
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 32upx;
|
font-size: 32upx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.row {
|
.row {
|
||||||
width: 92%;
|
width: 92%;
|
||||||
height: 24vw;
|
height: 24vw;
|
||||||
@@ -362,11 +404,13 @@ import Api from '@/common/api';
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
z-index: 4;
|
z-index: 4;
|
||||||
border: 0;
|
border: 0;
|
||||||
|
|
||||||
.menu {
|
.menu {
|
||||||
.icon {
|
.icon {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 50upx;
|
font-size: 50upx;
|
||||||
}
|
}
|
||||||
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 28%;
|
width: 28%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -377,19 +421,36 @@ import Api from '@/common/api';
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.carrier {
|
.carrier {
|
||||||
@keyframes showMenu {
|
@keyframes showMenu {
|
||||||
0% {transform: translateX(0);}100% {transform: translateX(-28%);}
|
0% {
|
||||||
|
transform: translateX(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: translateX(-28%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes closeMenu {
|
@keyframes closeMenu {
|
||||||
0% {transform: translateX(-28%);}100% {transform: translateX(0);}
|
0% {
|
||||||
|
transform: translateX(-28%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: translateX(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&.open {
|
&.open {
|
||||||
animation: showMenu 0.25s linear both;
|
animation: showMenu 0.25s linear both;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.close {
|
&.close {
|
||||||
animation: closeMenu 0.15s linear both;
|
animation: closeMenu 0.15s linear both;
|
||||||
}
|
}
|
||||||
|
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -397,22 +458,28 @@ import Api from '@/common/api';
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
padding-top: 3vw;
|
padding-top: 3vw;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
margin: 0 5%;
|
margin: 0 5%;
|
||||||
font-size: 36upx;
|
font-size: 36upx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.term {
|
.term {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
margin: 0 5%;
|
margin: 0 5%;
|
||||||
font-size: 26upx;
|
font-size: 26upx;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
position: relative;
|
position: relative;
|
||||||
.gap-top,.gap-bottom{
|
|
||||||
|
.gap-top,
|
||||||
|
.gap-bottom {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 20upx;
|
width: 20upx;
|
||||||
height: 20upx;
|
height: 20upx;
|
||||||
@@ -420,12 +487,15 @@ import Api from '@/common/api';
|
|||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gap-top {
|
.gap-top {
|
||||||
top: -10upx;
|
top: -10upx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gap-bottom {
|
.gap-bottom {
|
||||||
bottom: -10upx;
|
bottom: -10upx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.shixiao {
|
.shixiao {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 20upx;
|
right: 20upx;
|
||||||
@@ -434,37 +504,50 @@ import Api from '@/common/api';
|
|||||||
color: rgba(153, 153, 153, 0.2)
|
color: rgba(153, 153, 153, 0.2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.right {
|
.right {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
width: 28%;
|
width: 28%;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background: linear-gradient(to right, #ec625c, #ee827f);
|
background: linear-gradient(to right, #ec625c, #ee827f);
|
||||||
|
|
||||||
&.invalid {
|
&.invalid {
|
||||||
background: linear-gradient(to right, #aaa, #999);
|
background: linear-gradient(to right, #aaa, #999);
|
||||||
|
|
||||||
.use {
|
.use {
|
||||||
color: #aaa;
|
color: #aaa;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
.ticket,.criteria{width: 100%;}
|
|
||||||
|
.ticket,
|
||||||
|
.criteria {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.ticket {
|
.ticket {
|
||||||
padding-top: 1vw;
|
padding-top: 1vw;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
height: 6vw;
|
height: 6vw;
|
||||||
|
|
||||||
.num {
|
.num {
|
||||||
font-size: 42upx;
|
font-size: 42upx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.unit {
|
.unit {
|
||||||
font-size: 24upx;
|
font-size: 24upx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.criteria {
|
.criteria {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
font-size: 28upx;
|
font-size: 28upx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.use {
|
.use {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
height: 40upx;
|
height: 40upx;
|
||||||
@@ -478,6 +561,7 @@ import Api from '@/common/api';
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
<view class="carrier" :class="[theIndex==index?'open':oldIndex==index?'close':'']" @touchstart="touchStart(index,$event)" @touchmove="touchMove(index,$event)" @touchend="touchEnd(index,$event)">
|
<view class="carrier" :class="[theIndex==index?'open':oldIndex==index?'close':'']" @touchstart="touchStart(index,$event)" @touchmove="touchMove(index,$event)" @touchend="touchEnd(index,$event)">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
@@ -509,5 +593,4 @@ import Api from '@/common/api';
|
|||||||
* */
|
* */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="block">
|
<view class="block">
|
||||||
<view class="title">
|
<!-- <view class="title">
|
||||||
<text>我的账户</text>
|
<text>我的账户</text>
|
||||||
<text style="font-size: 28rpx;padding-left: 60rpx;color: #007AFF;" @click="gominxi">交易明细</text>
|
<text style="font-size: 28rpx;padding-left: 60rpx;color: #007AFF;" @click="gominxi">交易明细</text>
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="my">
|
<view class="my">
|
||||||
@@ -19,7 +19,8 @@
|
|||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="amount">
|
<view class="amount">
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view class="box" v-for="(amount,index) in amountList" :key="index" @tap="select(amount)" :class="{'on':amount == inputAmount}">
|
<view class="box" v-for="(amount,index) in amountList" :key="index" @tap="select(amount)"
|
||||||
|
:class="{'on':amount == inputAmount}">
|
||||||
{{amount}}元
|
{{amount}}元
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -43,7 +44,7 @@
|
|||||||
<!-- #ifdef APP-PLUS -->
|
<!-- #ifdef APP-PLUS -->
|
||||||
<view class="row" @tap="paytype='alipay'">
|
<view class="row" @tap="paytype='alipay'">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<image src="../../static/img/alipay.png"></image>
|
<image style="width: 30px;height: 30px;" src="../../static/img/alipay.png"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="center">
|
<view class="center">
|
||||||
支付宝支付
|
支付宝支付
|
||||||
@@ -55,7 +56,7 @@
|
|||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<view class="row" @tap="paytype='wxpay'">
|
<view class="row" @tap="paytype='wxpay'">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<image src="../../static/image/wechatpay.png"></image>
|
<image style="width: 30px;height: 30px;" src="../../static/image/wechatpay.png"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="center">
|
<view class="center">
|
||||||
微信支付
|
微信支付
|
||||||
@@ -75,9 +76,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="pay">
|
<!-- <view class="pay">
|
||||||
<view class="btn btn-tixi" @click="gopage">去提现</view>
|
<view class="btn btn-tixi" @click="gopage">去提现</view>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -123,15 +124,24 @@ import Api from '@/common/api';
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (parseFloat(this.inputAmount).toString() == "NaN") {
|
if (parseFloat(this.inputAmount).toString() == "NaN") {
|
||||||
uni.showToast({title:'请输入正确金额',icon:'none'});
|
uni.showToast({
|
||||||
|
title: '请输入正确金额',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.inputAmount <= 0) {
|
if (this.inputAmount <= 0) {
|
||||||
uni.showToast({title:'请输入大于100的金额',icon:'none'});
|
uni.showToast({
|
||||||
|
title: '请输入大于100的金额',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (parseFloat(this.inputAmount).toFixed(2) != parseFloat(this.inputAmount)) {
|
if (parseFloat(this.inputAmount).toFixed(2) != parseFloat(this.inputAmount)) {
|
||||||
uni.showToast({title:'最多只能输入两位小数哦~',icon:'none'});
|
uni.showToast({
|
||||||
|
title: '最多只能输入两位小数哦~',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//模板模拟支付,实际应用请调起微信/支付宝
|
//模板模拟支付,实际应用请调起微信/支付宝
|
||||||
@@ -231,31 +241,18 @@ import Api from '@/common/api';
|
|||||||
// 微信充值
|
// 微信充值
|
||||||
WeChatPay() {
|
WeChatPay() {
|
||||||
var _this = this
|
var _this = this
|
||||||
// if (!/^\d+(\.\d+)?$/.test(_this.pay_money) || _this.pay_money <= 0) {
|
|
||||||
// uni.showToast({
|
|
||||||
// title: '请输入正确金额',
|
|
||||||
// icon: 'none'
|
|
||||||
// });
|
|
||||||
// }else{
|
|
||||||
var money_fen = _this.inputAmount * 100
|
var money_fen = _this.inputAmount * 100
|
||||||
// if(_this.tabIndex!=0){
|
|
||||||
// money_fen=_this.tabIndex*100
|
|
||||||
// }else{
|
|
||||||
// money_fen=_this.pay_money*100
|
|
||||||
// }
|
|
||||||
// APP充值
|
// APP充值
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
ef.submit({
|
ef.submit({
|
||||||
request: {
|
request: {
|
||||||
s: [
|
s: [
|
||||||
'APPLICATIONORDERSELFBUYUSERMONEY',
|
'APPLICATIONORDERSELFBUYUSERMONEY',
|
||||||
[
|
[{
|
||||||
{
|
|
||||||
money_fen: money_fen, //必须|要购买余额(人民币,分)
|
money_fen: money_fen, //必须|要购买余额(人民币,分)
|
||||||
pay_method: 'weixinpay', //支付方式 weixinpay 微信支付、alipay 支付宝支付
|
pay_method: 'weixinpay', //支付方式 weixinpay 微信支付、alipay 支付宝支付
|
||||||
weixin_trade_type: 'APP'
|
weixin_trade_type: 'APP'
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
callback: function(data) {
|
callback: function(data) {
|
||||||
@@ -300,8 +297,7 @@ import Api from '@/common/api';
|
|||||||
request: {
|
request: {
|
||||||
s: [
|
s: [
|
||||||
'APPLICATIONORDERSELFBUYUSERMONEY',
|
'APPLICATIONORDERSELFBUYUSERMONEY',
|
||||||
[
|
[{
|
||||||
{
|
|
||||||
money_fen: money_fen, //必须|要购买余额(人民币,分)
|
money_fen: money_fen, //必须|要购买余额(人民币,分)
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
weixin_login_code: _this.code,
|
weixin_login_code: _this.code,
|
||||||
@@ -313,8 +309,7 @@ import Api from '@/common/api';
|
|||||||
pay_method: 'weixinpay', //支付方式 weixinpay 微信支付、alipay 支付宝支付
|
pay_method: 'weixinpay', //支付方式 weixinpay 微信支付、alipay 支付宝支付
|
||||||
weixin_trade_type: 'APP'
|
weixin_trade_type: 'APP'
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
callback: function(data) {
|
callback: function(data) {
|
||||||
@@ -376,14 +371,12 @@ import Api from '@/common/api';
|
|||||||
ef.submit({
|
ef.submit({
|
||||||
request: {
|
request: {
|
||||||
s: ['APPLICATIONORDERSELFBUYUSERMONEY',
|
s: ['APPLICATIONORDERSELFBUYUSERMONEY',
|
||||||
[
|
[{
|
||||||
{
|
|
||||||
money_fen: money_fen, //必须|要购买余额(人民币,分)
|
money_fen: money_fen, //必须|要购买余额(人民币,分)
|
||||||
pay_method: 'weixinpay', //支付方式 weixinpay 微信支付、alipay 支付宝支付
|
pay_method: 'weixinpay', //支付方式 weixinpay 微信支付、alipay 支付宝支付
|
||||||
weixin_trade_type: 'MPJSAPI',
|
weixin_trade_type: 'MPJSAPI',
|
||||||
weixin_login_openid: dataList.s.openid
|
weixin_login_openid: dataList.s.openid
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -401,9 +394,11 @@ import Api from '@/common/api';
|
|||||||
|
|
||||||
var getBrandWCPayRequest = {
|
var getBrandWCPayRequest = {
|
||||||
appId: ress.appid,
|
appId: ress.appid,
|
||||||
timeStamp: String(ress.time_stamp), // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
|
timeStamp: String(ress
|
||||||
|
.time_stamp), // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
|
||||||
nonceStr: ress.nonce_str, // 支付签名随机串,不长于 32 位
|
nonceStr: ress.nonce_str, // 支付签名随机串,不长于 32 位
|
||||||
package: 'prepay_id=' + ress.prepay_id, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
|
package: 'prepay_id=' + ress
|
||||||
|
.prepay_id, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
|
||||||
signType: ress.sign_type, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
|
signType: ress.sign_type, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
|
||||||
paySign: ress.pay_sign, // 支付签名
|
paySign: ress.pay_sign, // 支付签名
|
||||||
};
|
};
|
||||||
@@ -426,13 +421,15 @@ import Api from '@/common/api';
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (res.err_msg == "get_brand_wcpay_request:fail") {
|
if (res.err_msg ==
|
||||||
|
"get_brand_wcpay_request:fail") {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '支付失败',
|
title: '支付失败',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (res.err_msg == "get_brand_wcpay_request:cancel") {
|
if (res.err_msg ==
|
||||||
|
"get_brand_wcpay_request:cancel") {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '已取消支付',
|
title: '已取消支付',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
@@ -450,10 +447,12 @@ import Api from '@/common/api';
|
|||||||
|
|
||||||
if (typeof WeixinJSBridge == "undefined") {
|
if (typeof WeixinJSBridge == "undefined") {
|
||||||
if (document.addEventListener) {
|
if (document.addEventListener) {
|
||||||
document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
|
document.addEventListener('WeixinJSBridgeReady',
|
||||||
|
onBridgeReady, false);
|
||||||
} else if (document.attachEvent) {
|
} else if (document.attachEvent) {
|
||||||
document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
|
document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
|
||||||
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
|
document.attachEvent('onWeixinJSBridgeReady',
|
||||||
|
onBridgeReady);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
onBridgeReady();
|
onBridgeReady();
|
||||||
@@ -480,7 +479,8 @@ import Api from '@/common/api';
|
|||||||
//当 ACCESSTOKEN 不存在
|
//当 ACCESSTOKEN 不存在
|
||||||
ef.left_token(function(left_token) {
|
ef.left_token(function(left_token) {
|
||||||
var notify_url = encodeURIComponent(location.href);
|
var notify_url = encodeURIComponent(location.href);
|
||||||
var url = ef.api_server_url + "?" + encodeURI('data=[["SESSIONWEIXINAUTHORIZE",[{"notify_url":"' +
|
var url = ef.api_server_url + "?" + encodeURI(
|
||||||
|
'data=[["SESSIONWEIXINAUTHORIZE",[{"notify_url":"' +
|
||||||
notify_url + '"}]]]') + "&token=" + left_token;
|
notify_url + '"}]]]') + "&token=" + left_token;
|
||||||
console.log(url);
|
console.log(url);
|
||||||
location.href = url;
|
location.href = url;
|
||||||
@@ -503,13 +503,11 @@ import Api from '@/common/api';
|
|||||||
request: {
|
request: {
|
||||||
s: [
|
s: [
|
||||||
'APPLICATIONORDERSELFBUYUSERMONEY',
|
'APPLICATIONORDERSELFBUYUSERMONEY',
|
||||||
[
|
[{
|
||||||
{
|
|
||||||
money_fen: _this.pay_money * 100, //必须|要购买余额(人民币,分)
|
money_fen: _this.pay_money * 100, //必须|要购买余额(人民币,分)
|
||||||
pay_method: 'weixinpay', //支付方式 weixinpay 微信支付、alipay 支付宝支付
|
pay_method: 'weixinpay', //支付方式 weixinpay 微信支付、alipay 支付宝支付
|
||||||
weixin_trade_type: 'APP'
|
weixin_trade_type: 'APP'
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
callback: function(data) {
|
callback: function(data) {
|
||||||
@@ -555,8 +553,7 @@ import Api from '@/common/api';
|
|||||||
request: {
|
request: {
|
||||||
s: [
|
s: [
|
||||||
'APPLICATIONORDERSELFBUYUSERMONEY',
|
'APPLICATIONORDERSELFBUYUSERMONEY',
|
||||||
[
|
[{
|
||||||
{
|
|
||||||
money_fen: _this.pay_money * 100, //必须|要购买余额(人民币,分)
|
money_fen: _this.pay_money * 100, //必须|要购买余额(人民币,分)
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
weixin_login_code: _this.code,
|
weixin_login_code: _this.code,
|
||||||
@@ -568,8 +565,7 @@ import Api from '@/common/api';
|
|||||||
pay_method: 'weixinpay', //支付方式 weixinpay 微信支付、alipay 支付宝支付
|
pay_method: 'weixinpay', //支付方式 weixinpay 微信支付、alipay 支付宝支付
|
||||||
weixin_trade_type: 'APP'
|
weixin_trade_type: 'APP'
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
callback: function(data) {
|
callback: function(data) {
|
||||||
@@ -692,11 +688,9 @@ import Api from '@/common/api';
|
|||||||
request: {
|
request: {
|
||||||
s: [
|
s: [
|
||||||
'APPLICATIONORDERSELFPAYSTATE',
|
'APPLICATIONORDERSELFPAYSTATE',
|
||||||
[
|
[{
|
||||||
{
|
|
||||||
order_id: order_id
|
order_id: order_id
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
callback: function(data) {
|
callback: function(data) {
|
||||||
@@ -736,10 +730,12 @@ import Api from '@/common/api';
|
|||||||
.block {
|
.block {
|
||||||
width: 94%;
|
width: 94%;
|
||||||
padding: 20upx 3%;
|
padding: 20upx 3%;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-size: 34upx;
|
font-size: 34upx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
.my {
|
.my {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -749,6 +745,7 @@ import Api from '@/common/api';
|
|||||||
font-size: 30upx;
|
font-size: 30upx;
|
||||||
border-bottom: solid 1upx #eee;
|
border-bottom: solid 1upx #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
.amount {
|
.amount {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
@@ -756,6 +753,7 @@ import Api from '@/common/api';
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 20upx 0;
|
padding: 20upx 0;
|
||||||
|
|
||||||
.box {
|
.box {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
height: 120upx;
|
height: 120upx;
|
||||||
@@ -767,27 +765,32 @@ import Api from '@/common/api';
|
|||||||
font-size: 36upx;
|
font-size: 36upx;
|
||||||
background-color: #f1f1f1;
|
background-color: #f1f1f1;
|
||||||
color: 333;
|
color: 333;
|
||||||
|
|
||||||
&.on {
|
&.on {
|
||||||
background-color: $uni-color-success;
|
background-color: $uni-color-success;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.num {
|
.num {
|
||||||
margin-top: 10upx;
|
margin-top: 10upx;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
padding-right: 10upx;
|
padding-right: 10upx;
|
||||||
font-size: 30upx;
|
font-size: 30upx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input {
|
.input {
|
||||||
width: 28.2vw;
|
width: 28.2vw;
|
||||||
border-bottom: solid 2upx #999;
|
border-bottom: solid 2upx #999;
|
||||||
|
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
input {
|
input {
|
||||||
margin: 0 20upx;
|
margin: 0 20upx;
|
||||||
height: 60upx;
|
height: 60upx;
|
||||||
@@ -799,28 +802,34 @@ import Api from '@/common/api';
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.pay-list {
|
.pay-list {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-bottom: solid 1upx #eee;
|
border-bottom: solid 1upx #eee;
|
||||||
|
|
||||||
.row {
|
.row {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 120upx;
|
height: 120upx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
width: 100upx;
|
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 80upx;
|
width: 80upx;
|
||||||
height: 80upx;
|
height: 80upx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.center {
|
.center {
|
||||||
|
margin-left: 15px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-size: 30upx;
|
font-size: 30upx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.right {
|
.right {
|
||||||
width: 100upx;
|
width: 100upx;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
@@ -831,12 +840,14 @@ import Api from '@/common/api';
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.pay {
|
.pay {
|
||||||
margin-top: 20upx;
|
margin-top: 20upx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
width: 70%;
|
width: 70%;
|
||||||
height: 80upx;
|
height: 80upx;
|
||||||
@@ -848,11 +859,13 @@ import Api from '@/common/api';
|
|||||||
background-color: $uni-color-success;
|
background-color: $uni-color-success;
|
||||||
box-shadow: 0upx 5upx 10upx rgba(0, 0, 0, 0.2);
|
box-shadow: 0upx 5upx 10upx rgba(0, 0, 0, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-tixi {
|
.btn-tixi {
|
||||||
color: $uni-color-success;
|
color: $uni-color-success;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
border: 1upx solid $uni-color-success;
|
border: 1upx solid $uni-color-success;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tis {
|
.tis {
|
||||||
margin-top: 10upx;
|
margin-top: 10upx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -861,6 +874,7 @@ import Api from '@/common/api';
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
color: #999;
|
color: #999;
|
||||||
|
|
||||||
.terms {
|
.terms {
|
||||||
color: #5a9ef7;
|
color: #5a9ef7;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user