Browse Source

2023-3-8

完善功能
master
guoxing 2 years ago
parent
commit
419533df1f
  1. 15
      mallplusui-uniapp-app/common/api.js
  2. 2
      mallplusui-uniapp-app/components/eonfox/eonfox.js
  3. 24
      mallplusui-uniapp-app/components/eonfox/fns.js
  4. 6
      mallplusui-uniapp-app/pages/order/orderDetail.vue
  5. 107
      mallplusui-uniapp-app/pagesU/user/coupon.vue
  6. 120
      mallplusui-uniapp-app/pagesU/user/deposit.vue

15
mallplusui-uniapp-app/common/api.js

@ -1,7 +1,7 @@
import store from '../store/index';
export default {
// qq 237524947 wx15d4269d3210863d
// BASEURI: 'http://5rygzr.natappfree.cc/api/',
// BASEURI: 'http://br68s5.natappfree.cc/api/',
BASEURI: 'http://mall.yyundong.com/portalapi/api/',
// BASEURI: 'http://192.168.31.52:8083/api/',
ADMINURI: 'http://mall.yyundong.com/adminapi/',
@ -281,11 +281,18 @@ export default {
uni.hideLoading();
}
console.log('error', error);
console.log('res', res);
if (undefined == res || 'undefined' == res) {
console.log('index');
uni.navigateTo({
url: `/pages/public/login`
})
uni.showToast({
title: '网络错误',
icon: 'none'
});
return;
// uni.navigateTo({
// url: `/pages/public/login`
// })
}
if (res.data.msg == 'User token expired!') {
console.log('User token expired');

2
mallplusui-uniapp-app/components/eonfox/eonfox.js

@ -25,7 +25,7 @@ eonfox.prototype = {
//接口地址 应用ID
api_server_url : 'http://server.test.eapie.com/',
application : "test",
application : "wxa66597d50184d027",
//会话名称
session_name : 'Eonfox_API_Engine_Session',

24
mallplusui-uniapp-app/components/eonfox/fns.js

@ -3,8 +3,7 @@ var fns = {
//api接口验证
checkError: function(data, ids, error) {
if (typeof(error) != 'function') {
error=function(){
}
error = function() {}
}
if (data.errno) {
error(data.errno, data.error);
@ -182,20 +181,23 @@ var fns = {
}
return urlObj;
}
}
,
},
// url参数解析
getUrlkey: function(url) {
var params = {};
var urls = url.split("?"); console.log('1_分割url:', urls)
var arr = urls[1].split("&"); console.log('2_分割urls[1]:', arr)
var urls = url.split("?");
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++) {
var a = arr[i].split("="); console.log('3_遍历 arr 并分割后赋值给a:', a[0], a[1])
params[a[0]] = a[1]; console.log('4_a给params对象赋值:', params)
} console.log('5_结果:', params)
return params;
var a = arr[i].split("=");
console.log('3_遍历 arr 并分割后赋值给a:', a[0], a[1])
params[a[0]] = a[1];
console.log('4_a给params对象赋值:', params)
}
,
console.log('5_结果:', params)
return params;
},
toast(tit, url, time) {
if (!time) {
time = 1500

6
mallplusui-uniapp-app/pages/order/orderDetail.vue

@ -212,6 +212,12 @@
if (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();
},

107
mallplusui-uniapp-app/pagesU/user/coupon.vue

@ -1,7 +1,9 @@
<template>
<view>
<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>
<view class="place"></view>
@ -15,7 +17,10 @@
<view class="icon shanchu"></view>
</view>
<!-- 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="title">
{{row.note}}
@ -57,7 +62,10 @@
<view class="icon shanchu"></view>
</view>
<!-- 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="title">
{{row.note}}
@ -104,7 +112,9 @@ import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue
import Api from '@/common/api';
import eonfox from '@/components/eonfox/eonfox.js';
import fns from '@/components/eonfox/fns.js';
import { formatDate } from '@/common/date';
import {
formatDate
} from '@/common/date';
var ef = new eonfox();
export default {
@ -275,14 +285,21 @@ import Api from '@/common/api';
flex-wrap: wrap;
}
page{position: relative;background-color: #f5f5f5;}
page {
position: relative;
background-color: #f5f5f5;
}
.hidden {
display: none !important;
}
.place {
width: 100%;
height: 95upx;
}
.tabr {
background-color: #fff;
/* #ifdef H5 || MP-WEIXIN*/
@ -295,6 +312,7 @@ import Api from '@/common/api';
position: fixed;
top: 0;
z-index: 10;
view {
width: 50%;
height: 90upx;
@ -303,30 +321,49 @@ import Api from '@/common/api';
font-size: 32upx;
color: #999;
}
.on {
color: $uni-color-success;
}
.border {
height: 4upx;
background-color: $uni-color-success;
transition: all .3s ease-out;
&.invalid {
transform: translate3d(100%, 0, 0);
}
}
}
.list {
width: 100%;
display: block;
position: relative;
}
@keyframes showValid {
0% {transform: translateX(-100%);}100% {transform: translateX(0);}
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(0);
}
}
@keyframes showInvalid {
0% {transform: translateX(0);}100% {transform: translateX(-100%);}
0% {
transform: translateX(0);
}
100% {
transform: translateX(-100%);
}
}
.sub-list {
&.invalid {
position: absolute;
@ -334,16 +371,20 @@ import Api from '@/common/api';
left: 100%;
display: none;
}
&.showvalid {
display: flex;
animation: showValid 0.20s linear both;
}
&.showinvalid {
display: flex;
animation: showInvalid 0.20s linear both;
}
width: 100%;
padding: 20upx 0 120upx 0;
.tis {
width: 100%;
height: 60upx;
@ -351,6 +392,7 @@ import Api from '@/common/api';
align-items: center;
font-size: 32upx;
}
.row {
width: 92%;
height: 24vw;
@ -362,11 +404,13 @@ import Api from '@/common/api';
overflow: hidden;
z-index: 4;
border: 0;
.menu {
.icon {
color: #fff;
font-size: 50upx;
}
position: absolute;
width: 28%;
height: 100%;
@ -377,19 +421,36 @@ import Api from '@/common/api';
color: #fff;
z-index: 2;
}
.carrier {
@keyframes showMenu {
0% {transform: translateX(0);}100% {transform: translateX(-28%);}
0% {
transform: translateX(0);
}
100% {
transform: translateX(-28%);
}
}
@keyframes closeMenu {
0% {transform: translateX(-28%);}100% {transform: translateX(0);}
0% {
transform: translateX(-28%);
}
100% {
transform: translateX(0);
}
}
&.open {
animation: showMenu 0.25s linear both;
}
&.close {
animation: closeMenu 0.15s linear both;
}
background-color: #fff;
position: absolute;
width: 100%;
@ -397,22 +458,28 @@ import Api from '@/common/api';
height: 100%;
z-index: 3;
flex-wrap: nowrap;
.left {
width: 100%;
.title {
padding-top: 3vw;
width: 90%;
margin: 0 5%;
font-size: 36upx;
}
.term {
width: 90%;
margin: 0 5%;
font-size: 26upx;
color: #999;
}
position: relative;
.gap-top,.gap-bottom{
.gap-top,
.gap-bottom {
position: absolute;
width: 20upx;
height: 20upx;
@ -420,12 +487,15 @@ import Api from '@/common/api';
border-radius: 100%;
background-color: #f5f5f5;
}
.gap-top {
top: -10upx;
}
.gap-bottom {
bottom: -10upx;
}
.shixiao {
position: absolute;
right: 20upx;
@ -434,37 +504,50 @@ import Api from '@/common/api';
color: rgba(153, 153, 153, 0.2)
}
}
.right {
flex-shrink: 0;
width: 28%;
color: #fff;
background: linear-gradient(to right, #ec625c, #ee827f);
&.invalid {
background: linear-gradient(to right, #aaa, #999);
.use {
color: #aaa;
}
}
justify-content: center;
.ticket,.criteria{width: 100%;}
.ticket,
.criteria {
width: 100%;
}
.ticket {
padding-top: 1vw;
justify-content: center;
align-items: baseline;
height: 6vw;
.num {
font-size: 42upx;
font-weight: 600;
}
.unit {
font-size: 24upx;
}
}
.criteria {
justify-content: center;
font-size: 28upx;
}
.use {
width: 50%;
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="left">
@ -509,5 +593,4 @@ import Api from '@/common/api';
* */
}
}
</style>

120
mallplusui-uniapp-app/pagesU/user/deposit.vue

@ -1,10 +1,10 @@
<template>
<view>
<view class="block">
<view class="title">
<!-- <view class="title">
<text>我的账户</text>
<text style="font-size: 28rpx;padding-left: 60rpx;color: #007AFF;" @click="gominxi">交易明细</text>
</view>
</view> -->
<view class="content">
<view class="my">
@ -19,7 +19,8 @@
<view class="content">
<view class="amount">
<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}}
</view>
</view>
@ -43,7 +44,7 @@
<!-- #ifdef APP-PLUS -->
<view class="row" @tap="paytype='alipay'">
<view class="left">
<image src="../../static/img/alipay.png"></image>
<image style="width: 30px;height: 30px;" src="../../static/img/alipay.png"></image>
</view>
<view class="center">
支付宝支付
@ -55,7 +56,7 @@
<!-- #endif -->
<view class="row" @tap="paytype='wxpay'">
<view class="left">
<image src="../../static/image/wechatpay.png"></image>
<image style="width: 30px;height: 30px;" src="../../static/image/wechatpay.png"></image>
</view>
<view class="center">
微信支付
@ -75,9 +76,9 @@
</view>
</view> -->
</view>
<view class="pay">
<!-- <view class="pay">
<view class="btn btn-tixi" @click="gopage">去提现</view>
</view>
</view> -->
</view>
</template>
@ -123,15 +124,24 @@ import Api from '@/common/api';
return
}
if (parseFloat(this.inputAmount).toString() == "NaN") {
uni.showToast({title:'请输入正确金额',icon:'none'});
uni.showToast({
title: '请输入正确金额',
icon: 'none'
});
return;
}
if (this.inputAmount <= 0) {
uni.showToast({title:'请输入大于100的金额',icon:'none'});
uni.showToast({
title: '请输入大于100的金额',
icon: 'none'
});
return;
}
if (parseFloat(this.inputAmount).toFixed(2) != parseFloat(this.inputAmount)) {
uni.showToast({title:'最多只能输入两位小数哦~',icon:'none'});
uni.showToast({
title: '最多只能输入两位小数哦~',
icon: 'none'
});
return;
}
///
@ -231,31 +241,18 @@ import Api from '@/common/api';
//
WeChatPay() {
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
// if(_this.tabIndex!=0){
// money_fen=_this.tabIndex*100
// }else{
// money_fen=_this.pay_money*100
// }
// APP
// #ifdef APP-PLUS
ef.submit({
request: {
s: [
'APPLICATIONORDERSELFBUYUSERMONEY',
[
{
[{
money_fen: money_fen, //|()
pay_method: 'weixinpay', // weixinpay alipay
weixin_trade_type: 'APP'
}
]
}]
]
},
callback: function(data) {
@ -300,8 +297,7 @@ import Api from '@/common/api';
request: {
s: [
'APPLICATIONORDERSELFBUYUSERMONEY',
[
{
[{
money_fen: money_fen, //|()
// #ifdef MP-WEIXIN
weixin_login_code: _this.code,
@ -313,8 +309,7 @@ import Api from '@/common/api';
pay_method: 'weixinpay', // weixinpay alipay
weixin_trade_type: 'APP'
// #endif
}
]
}]
]
},
callback: function(data) {
@ -376,14 +371,12 @@ import Api from '@/common/api';
ef.submit({
request: {
s: ['APPLICATIONORDERSELFBUYUSERMONEY',
[
{
[{
money_fen: money_fen, //|()
pay_method: 'weixinpay', // weixinpay alipay
weixin_trade_type: 'MPJSAPI',
weixin_login_openid: dataList.s.openid
}
]
}]
]
},
@ -401,9 +394,11 @@ import Api from '@/common/api';
var getBrandWCPayRequest = {
appId: ress.appid,
timeStamp: String(ress.time_stamp), // jssdk使timestamp使timeStampS
timeStamp: String(ress
.time_stamp), // jssdk使timestamp使timeStampS
nonceStr: ress.nonce_str, // 32
package: 'prepay_id=' + ress.prepay_id, // prepay_idprepay_id=\*\*\*
package: 'prepay_id=' + ress
.prepay_id, // prepay_idprepay_id=\*\*\*
signType: ress.sign_type, // 'SHA1'使'MD5'
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({
title: '支付失败',
icon: 'none'
})
}
if (res.err_msg == "get_brand_wcpay_request:cancel") {
if (res.err_msg ==
"get_brand_wcpay_request:cancel") {
uni.showToast({
title: '已取消支付',
icon: 'none',
@ -450,10 +447,12 @@ import Api from '@/common/api';
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
document.addEventListener('WeixinJSBridgeReady',
onBridgeReady, false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
document.attachEvent('onWeixinJSBridgeReady',
onBridgeReady);
}
} else {
onBridgeReady();
@ -480,7 +479,8 @@ import Api from '@/common/api';
// ACCESSTOKEN
ef.left_token(function(left_token) {
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;
console.log(url);
location.href = url;
@ -503,13 +503,11 @@ import Api from '@/common/api';
request: {
s: [
'APPLICATIONORDERSELFBUYUSERMONEY',
[
{
[{
money_fen: _this.pay_money * 100, //|()
pay_method: 'weixinpay', // weixinpay alipay
weixin_trade_type: 'APP'
}
]
}]
]
},
callback: function(data) {
@ -555,8 +553,7 @@ import Api from '@/common/api';
request: {
s: [
'APPLICATIONORDERSELFBUYUSERMONEY',
[
{
[{
money_fen: _this.pay_money * 100, //|()
// #ifdef MP-WEIXIN
weixin_login_code: _this.code,
@ -568,8 +565,7 @@ import Api from '@/common/api';
pay_method: 'weixinpay', // weixinpay alipay
weixin_trade_type: 'APP'
// #endif
}
]
}]
]
},
callback: function(data) {
@ -692,11 +688,9 @@ import Api from '@/common/api';
request: {
s: [
'APPLICATIONORDERSELFPAYSTATE',
[
{
[{
order_id: order_id
}
]
}]
]
},
callback: function(data) {
@ -736,10 +730,12 @@ import Api from '@/common/api';
.block {
width: 94%;
padding: 20upx 3%;
.title {
width: 100%;
font-size: 34upx;
}
.content {
.my {
width: 100%;
@ -749,6 +745,7 @@ import Api from '@/common/api';
font-size: 30upx;
border-bottom: solid 1upx #eee;
}
.amount {
width: 100%;
@ -756,6 +753,7 @@ import Api from '@/common/api';
display: flex;
justify-content: space-between;
padding: 20upx 0;
.box {
width: 30%;
height: 120upx;
@ -767,27 +765,32 @@ import Api from '@/common/api';
font-size: 36upx;
background-color: #f1f1f1;
color: 333;
&.on {
background-color: $uni-color-success;
color: #fff;
}
}
}
.num {
margin-top: 10upx;
display: flex;
justify-content: flex-end;
align-items: center;
.text {
padding-right: 10upx;
font-size: 30upx;
}
.input {
width: 28.2vw;
border-bottom: solid 2upx #999;
justify-content: flex-end;
align-items: center;
input {
margin: 0 20upx;
height: 60upx;
@ -799,28 +802,34 @@ import Api from '@/common/api';
}
}
}
.pay-list {
width: 100%;
border-bottom: solid 1upx #eee;
.row {
width: 100%;
height: 120upx;
display: flex;
align-items: center;
.left {
width: 100upx;
flex-shrink: 0;
display: flex;
align-items: center;
image {
width: 80upx;
height: 80upx;
}
}
.center {
margin-left: 15px;
width: 100%;
font-size: 30upx;
}
.right {
width: 100upx;
flex-shrink: 0;
@ -831,12 +840,14 @@ import Api from '@/common/api';
}
}
}
.pay {
margin-top: 20upx;
width: 100%;
display: flex;
justify-content: center;
flex-wrap: wrap;
.btn {
width: 70%;
height: 80upx;
@ -848,11 +859,13 @@ import Api from '@/common/api';
background-color: $uni-color-success;
box-shadow: 0upx 5upx 10upx rgba(0, 0, 0, 0.2);
}
.btn-tixi {
color: $uni-color-success;
background: #FFFFFF;
border: 1upx solid $uni-color-success;
}
.tis {
margin-top: 10upx;
width: 100%;
@ -861,6 +874,7 @@ import Api from '@/common/api';
justify-content: center;
align-items: baseline;
color: #999;
.terms {
color: #5a9ef7;
}

Loading…
Cancel
Save