Browse Source

2023-3-8

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

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

@ -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/',
@ -78,8 +78,8 @@ export default {
memberTagList: 'single/user/memberTag/list', // 商户列表 memberTagList: 'single/user/memberTag/list', // 商户列表
addStoreComment: 'single/store/addStoreComment', // 商户addStoreComment addStoreComment: 'single/store/addStoreComment', // 商户addStoreComment
memberBlanceLogList: 'single/user/memberBlanceLog/list', memberBlanceLogList: 'single/user/memberBlanceLog/list',
mesList: 'sys/message/list',// GET 参数为空,获取用户消息通知列表,(需要先判断用户是已经登录状态) mesList: 'sys/message/list', // GET 参数为空,获取用户消息通知列表,(需要先判断用户是已经登录状态)
mesInfo: 'sys/message/info',// GET 参数为 id:消息ID,获取消息详情 mesInfo: 'sys/message/info', // GET 参数为 id:消息ID,获取消息详情
}, },
build: { build: {
getBuildNoticeByPage: 'single/build/getBuildNoticeByPage', // 所有社区和房间 getBuildNoticeByPage: 'single/build/getBuildNoticeByPage', // 所有社区和房间
@ -262,7 +262,7 @@ export default {
let token = uni.getStorageSync('token') || ''; let token = uni.getStorageSync('token') || '';
let fullurl = this.BASEURI + endpoint; let fullurl = this.BASEURI + endpoint;
console.log("fullurl",fullurl); console.log("fullurl", fullurl);
var contentType = 'application/x-www-form-urlencoded'; var contentType = 'application/x-www-form-urlencoded';
data.authorization = token; data.authorization = token;
@ -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');
@ -315,7 +322,7 @@ export default {
return res.data.data; return res.data.data;
} else { } else {
console.log(">>>>>="); console.log(">>>>>=");
console.log(">>>>>=",res.data); console.log(">>>>>=", res.data);
if (res.data) { if (res.data) {
if (!res.data.msg) { if (!res.data.msg) {
res.data.msg = res.data.data; res.data.msg = res.data.data;

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

@ -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',

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

@ -1,45 +1,44 @@
var fns = { 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);
return false; return false;
} }
if(!data.data){ if (!data.data) {
error(1, "未知错误"); error(1, "未知错误");
return false; return false;
} }
if(ids){ if (ids) {
if(typeof ids =='object'){ if (typeof ids == 'object') {
for( var i in ids){ for (var i in ids) {
if(typeof ids[i] != "undefined"){ if (typeof ids[i] != "undefined") {
var id = ids[i]; var id = ids[i];
if( data.data[id] && data.data[id].errno ){ if (data.data[id] && data.data[id].errno) {
error(data.data[id].errno, data.data[id].error); error(data.data[id].errno, data.data[id].error);
return false; return false;
} }
}else{ } else {
error(1, "“"+ids[i]+"”目标,未知错误"); error(1, "“" + ids[i] + "”目标,未知错误");
return false; return false;
} }
} }
}else if(typeof ids =='string' || typeof ids == 'number'){ } else if (typeof ids == 'string' || typeof ids == 'number') {
if(typeof data.data[ids] != "undefined" ){ if (typeof data.data[ids] != "undefined") {
if( data.data[ids].errno ){ if (data.data[ids].errno) {
error(data.data[ids].errno, data.data[ids].error); error(data.data[ids].errno, data.data[ids].error);
return false; return false;
} }
}else{ } else {
error(1, "“"+ids+"”目标,未知错误"); error(1, "“" + ids + "”目标,未知错误");
return false; return false;
} }
}else{ } else {
error(1, "“"+ids+"”目标,未知错误"); error(1, "“" + ids + "”目标,未知错误");
return false; return false;
} }
@ -47,9 +46,9 @@ var fns = {
var data_list = {}; var data_list = {};
if(data.data){ if (data.data) {
for(var i in data.data){ for (var i in data.data) {
if(typeof data.data[i].data != "undefined"){ if (typeof data.data[i].data != "undefined") {
data_list[i] = data.data[i].data; data_list[i] = data.data[i].data;
} }
} }
@ -57,46 +56,46 @@ var fns = {
return data_list; return data_list;
}, },
//数据处理 ceil向上取整 //数据处理 ceil向上取整
number_pre:function(number,pre){ number_pre: function(number, pre) {
switch(pre){ switch (pre) {
case 'ceil': case 'ceil':
return Math.ceil(number) return Math.ceil(number)
break; break;
} }
}, },
//保留两位小数 //保留两位小数
number_floor_2:function(number){ number_floor_2: function(number) {
var number = number * 100; var number = number * 100;
number = Math.floor(number) number = Math.floor(number)
number = number/100; number = number / 100;
return number.toFixed(2); return number.toFixed(2);
}, },
//错误信息处理 //错误信息处理
err:function(title,data,_json,fun){ err: function(title, data, _json, fun) {
if(data){ if (data) {
if(_json){ if (_json) {
data=JSON.stringify(data) data = JSON.stringify(data)
} }
console.log(title+' :',data) console.log(title + ' :', data)
uni.showToast({ uni.showToast({
title:title+' : '+data, title: title + ' : ' + data,
icon:'none', icon: 'none',
duration:1500, duration: 1500,
success() { success() {
if(fun){ if (fun) {
fun(); fun();
} }
} }
}) })
}else{ } else {
console.log(title) console.log(title)
uni.showToast({ uni.showToast({
title:title, title: title,
icon:'none', icon: 'none',
duration:1500, duration: 1500,
success() { success() {
if(fun){ if (fun) {
fun(); fun();
} }
} }
@ -105,8 +104,8 @@ var fns = {
}, },
//成功信息处理 //成功信息处理
success(title,fun){ success(title, fun) {
if(fun){ if (fun) {
fun(); fun();
} }
uni.hideLoading(); uni.hideLoading();
@ -121,149 +120,152 @@ var fns = {
}) */ }) */
}, },
//敬请期待 //敬请期待
waiting:function(){ waiting: function() {
uni.showToast({ uni.showToast({
title:'敬请期待', title: '敬请期待',
icon:'none' icon: 'none'
}) })
}, },
//授权验证 //授权验证
oauth_:function(){ oauth_: function() {
uni.setStorage({ uni.setStorage({
key:'oauth', key: 'oauth',
data:true data: true
}) })
}, },
noauth:function(){ noauth: function() {
uni.setStorage({ uni.setStorage({
key:'oauth', key: 'oauth',
data:false data: false
}) })
}, },
//绑定验证 //绑定验证
unionid:function(){ unionid: function() {
uni.setStorage({ uni.setStorage({
key:'unionid', key: 'unionid',
data:true data: true
}) })
}, },
nunionid:function(){ nunionid: function() {
uni.setStorage({ uni.setStorage({
key:'unionid', key: 'unionid',
data:false data: false
}) })
}, },
//绑定 //绑定
bind:function(){ bind: function() {
console.log('oauth'); console.log('oauth');
uni.getStorage({ uni.getStorage({
key:'oauth', key: 'oauth',
success(re) { success(re) {
console.log('oauth',re); console.log('oauth', re);
} }
}) })
}, },
//获取指定url参数 //获取指定url参数
getUrlQuery:function (urlStr) { getUrlQuery: function(urlStr) {
// var urlStr = location.search.substr(1) ? location.search.substr(1) : ""; // var urlStr = location.search.substr(1) ? location.search.substr(1) : "";
var urlArr = []; var urlArr = [];
for(var i = 0; i < urlStr.split("&").length; i++) { for (var i = 0; i < urlStr.split("&").length; i++) {
urlArr.push(urlStr.split("&")[i].split("=")[0] ? urlStr.split("&")[i].split("=")[0] : ""); urlArr.push(urlStr.split("&")[i].split("=")[0] ? urlStr.split("&")[i].split("=")[0] : "");
urlArr.push(urlStr.split("&")[i].split("=")[1] ? urlStr.split("&")[i].split("=")[1] : "onlyKey") urlArr.push(urlStr.split("&")[i].split("=")[1] ? urlStr.split("&")[i].split("=")[1] : "onlyKey")
} }
if(urlStr == "") { if (urlStr == "") {
return; return;
} else { } else {
var urlObj = {} var urlObj = {}
for(var i = 0; i < urlArr.length; i += 2) { for (var i = 0; i < urlArr.length; i += 2) {
if(urlArr[i] != "") { if (urlArr[i] != "") {
urlObj[urlArr[i]] = decodeURIComponent(urlArr[i + 1]); urlObj[urlArr[i]] = decodeURIComponent(urlArr[i + 1]);
} }
} }
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)
toast(tit,url,time){ return params;
if(!time){ },
time=1500 toast(tit, url, time) {
if (!time) {
time = 1500
} }
uni.showToast({ uni.showToast({
title:tit, title: tit,
success() { success() {
setTimeout(function(){ setTimeout(function() {
uni.reLaunch({ uni.reLaunch({
url:url url: url
}) })
},time) }, time)
} }
}) })
}, },
setSystemInfoSync(){ setSystemInfoSync() {
uni.getStorage({ uni.getStorage({
key:'SystemInfoSync', key: 'SystemInfoSync',
fail(err) { fail(err) {
console.log('设置缓存'); console.log('设置缓存');
try { try {
console.log('star'); console.log('star');
const res = uni.getSystemInfoSync(); const res = uni.getSystemInfoSync();
console.log('config'+JSON.stringify(res)); console.log('config' + JSON.stringify(res));
uni.setStorage({ uni.setStorage({
key:'SystemInfoSync', key: 'SystemInfoSync',
data:res data: res
}) })
console.log('ok'); console.log('ok');
} catch (e) { } catch (e) {
console.log('catch+'+JSON.stringify(e)); console.log('catch+' + JSON.stringify(e));
// error // error
} }
}, },
}) })
}, },
getCompare(Version,newVersion,fun){ getCompare(Version, newVersion, fun) {
if(Version==newVersion){ if (Version == newVersion) {
console.log('没有更新'); console.log('没有更新');
return return
} }
console.log('接收到参数'); console.log('接收到参数');
uni.getStorage({ uni.getStorage({
key:'SystemInfoSync', key: 'SystemInfoSync',
success(res) { success(res) {
console.log('缓存:'+JSON.stringify(res)); console.log('缓存:' + JSON.stringify(res));
if(res.data){ if (res.data) {
var SystemInfoSync=res.data; var SystemInfoSync = res.data;
console.log('json:'+JSON.stringify(SystemInfoSync)); console.log('json:' + JSON.stringify(SystemInfoSync));
console.log('设备:'+SystemInfoSync.platform); console.log('设备:' + SystemInfoSync.platform);
if(SystemInfoSync.platform=='android'){ if (SystemInfoSync.platform == 'android') {
console.log('设备:安卓'); console.log('设备:安卓');
fun(); fun();
} }
}else{ } else {
return this.setSystemInfo(); return this.setSystemInfo();
} }
}, },
fail(err) { fail(err) {
console.log('缓存获取失败'+JSON.stringify(err)); console.log('缓存获取失败' + JSON.stringify(err));
const res = uni.getSystemInfoSync(); const res = uni.getSystemInfoSync();
console.log('config'+JSON.stringify(res)); console.log('config' + JSON.stringify(res));
uni.setStorage({ uni.setStorage({
key:'SystemInfoSync', key: 'SystemInfoSync',
data:res, data: res,
success() { success() {
if(res.platform=='android'){ if (res.platform == 'android') {
console.log('设备:安卓'); console.log('设备:安卓');
fun(); fun();
} }

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

@ -112,7 +112,7 @@
return { return {
tabCurrentIndex: 0, tabCurrentIndex: 0,
orderInfo: { orderInfo: {
orderItemList:[] orderItemList: []
}, },
navList: [{ navList: [{
status: 0, status: 0,
@ -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();
}, },
@ -250,8 +256,8 @@
if (value === 1) { if (value === 1) {
stateTipColor = '#909399'; stateTipColor = '#909399';
stateTip= '支付成功,没有回掉'; stateTip = '支付成功,没有回掉';
}else if (value === 2) { } else if (value === 2) {
stateTip = '待发货'; stateTip = '待发货';
} else if (value === 3) { } else if (value === 3) {
stateTip = '待收货'; stateTip = '待收货';
@ -266,9 +272,9 @@
stateTip = ' 维权已完成'; stateTip = ' 维权已完成';
} else if (value === 8) { } else if (value === 8) {
stateTip = '待分享'; stateTip = '待分享';
}else if (value === 12) { } else if (value === 12) {
stateTipColor = '#909399'; stateTipColor = '#909399';
stateTip= '待付款'; stateTip = '待付款';
} else if (value === 13) { } else if (value === 13) {
stateTip = '申请退款'; stateTip = '申请退款';
} else if (value === 14) { } else if (value === 14) {

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

@ -1,21 +1,26 @@
<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>
<view class="list"> <view class="list">
<!-- 优惠券列表 --> <!-- 优惠券列表 -->
<view class="sub-list valid" :class="subState"> <view class="sub-list valid" :class="subState">
<view class="tis" v-if="couponValidList.length==0">没有数据~</view> <view class="tis" v-if="couponValidList.length==0">没有数据~</view>
<view class="row" v-for="(row,index) in couponValidList" :key="index" > <view class="row" v-for="(row,index) in couponValidList" :key="index">
<!-- 删除按钮 --> <!-- 删除按钮 -->
<view class="menu" @tap.stop="deleteCoupon(row.id,couponValidList)"> <view class="menu" @tap.stop="deleteCoupon(row.id,couponValidList)">
<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}}
@ -51,13 +56,16 @@
</view> </view>
<view class="sub-list invalid" :class="subState"> <view class="sub-list invalid" :class="subState">
<view class="tis" v-if="couponinvalidList.length==0">没有数据~</view> <view class="tis" v-if="couponinvalidList.length==0">没有数据~</view>
<view class="row" v-for="(row,index) in couponinvalidList" :key="index" > <view class="row" v-for="(row,index) in couponinvalidList" :key="index">
<!-- 删除按钮 --> <!-- 删除按钮 -->
<view class="menu" @tap.stop="deleteCoupon(row.id,couponinvalidList)"> <view class="menu" @tap.stop="deleteCoupon(row.id,couponinvalidList)">
<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}}
@ -100,44 +108,46 @@
</template> </template>
<script> <script>
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue'; 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 {
data() { data() {
return { return {
couponValidList:[ couponValidList: [
// {id:1,title:"10",termStart:"2019-04-01",termEnd:"2019-05-30",ticket:"10",criteria:"50使"}, // {id:1,title:"10",termStart:"2019-04-01",termEnd:"2019-05-30",ticket:"10",criteria:"50使"},
// {id:2,title:"100",termStart:"2019-04-01",termEnd:"2019-05-30",ticket:"100",criteria:"500使"}, // {id:2,title:"100",termStart:"2019-04-01",termEnd:"2019-05-30",ticket:"100",criteria:"500使"},
// {id:3,title:"10",termStart:"2019-04-01",termEnd:"2019-05-30",ticket:"10",criteria:""}, // {id:3,title:"10",termStart:"2019-04-01",termEnd:"2019-05-30",ticket:"10",criteria:""},
// {id:4,title:"50",termStart:"2019-04-01",termEnd:"2019-05-30",ticket:"50",criteria:"1000使"} // {id:4,title:"50",termStart:"2019-04-01",termEnd:"2019-05-30",ticket:"50",criteria:"1000使"}
], ],
couponinvalidList:[ couponinvalidList: [
// {id:1,title:"10",termStart:"2019-04-01",termEnd:"2019-05-30",ticket:"10",criteria:"50使"}, // {id:1,title:"10",termStart:"2019-04-01",termEnd:"2019-05-30",ticket:"10",criteria:"50使"},
// {id:2,title:"100",termStart:"2019-04-01",termEnd:"2019-05-30",ticket:"100",criteria:"500使"}, // {id:2,title:"100",termStart:"2019-04-01",termEnd:"2019-05-30",ticket:"100",criteria:"500使"},
// {id:3,title:"10",termStart:"2019-04-01",termEnd:"2019-05-30",ticket:"10",criteria:""}, // {id:3,title:"10",termStart:"2019-04-01",termEnd:"2019-05-30",ticket:"10",criteria:""},
// {id:4,title:"50",termStart:"2019-04-01",termEnd:"2019-05-30",ticket:"50",criteria:"1000使"} // {id:4,title:"50",termStart:"2019-04-01",termEnd:"2019-05-30",ticket:"50",criteria:"1000使"}
], ],
headerTop:0, headerTop: 0,
// //
typeClass:'valid', typeClass: 'valid',
subState:'', subState: '',
theIndex:null, theIndex: null,
oldIndex:null, oldIndex: null,
isStop:false isStop: false
} }
}, },
onPageScroll(e){ onPageScroll(e) {
}, },
//page.json "enablePullDownRefresh": true //page.json "enablePullDownRefresh": true
onPullDownRefresh() { onPullDownRefresh() {
setTimeout(function () { setTimeout(function() {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, 1000); }, 1000);
}, },
@ -146,13 +156,13 @@ import Api from '@/common/api';
//H5 //H5
// #ifdef H5 // #ifdef H5
//onLoadhead //onLoadhead
let Timer = setInterval(()=>{ let Timer = setInterval(() => {
let uniHead = document.getElementsByTagName('uni-page-head'); let uniHead = document.getElementsByTagName('uni-page-head');
if(uniHead.length>0){ if (uniHead.length > 0) {
this.headerTop = uniHead[0].offsetHeight+'px'; this.headerTop = uniHead[0].offsetHeight + 'px';
clearInterval(Timer);// clearInterval(Timer); //
} }
},1); }, 1);
// #endif // #endif
}, },
filters: { filters: {
@ -162,97 +172,97 @@ import Api from '@/common/api';
}, },
}, },
methods: { methods: {
goUse(){ goUse() {
uni.switchTab({ uni.switchTab({
url:'/pages/index/index' url: '/pages/index/index'
}) })
}, },
async getData(){ async getData() {
let params = { }; let params = {};
let data = await Api.apiCall('get', Api.index.listMemberCoupon, params); let data = await Api.apiCall('get', Api.index.listMemberCoupon, params);
let viewList = data; let viewList = data;
viewList.forEach(item => { viewList.forEach(item => {
if(item.useStatus==0){ if (item.useStatus == 0) {
this.couponValidList.push(item); this.couponValidList.push(item);
}else{ } else {
this.couponinvalidList.push(item); this.couponinvalidList.push(item);
} }
}); });
}, },
switchType(type){ switchType(type) {
// console.log(type) // console.log(type)
if(this.typeClass==type){ if (this.typeClass == type) {
return ; return;
} }
uni.pageScrollTo({ uni.pageScrollTo({
scrollTop:0, scrollTop: 0,
duration:0 duration: 0
}) })
this.typeClass = type; this.typeClass = type;
this.subState = this.typeClass==''?'':'show'+type; this.subState = this.typeClass == '' ? '' : 'show' + type;
setTimeout(()=>{ setTimeout(() => {
this.oldIndex = null; this.oldIndex = null;
this.theIndex = null; this.theIndex = null;
this.subState = this.typeClass=='valid'?'':this.subState; this.subState = this.typeClass == 'valid' ? '' : this.subState;
},200) }, 200)
}, },
//-begin //-begin
touchStart(index,event){ touchStart(index, event) {
// //
if(event.touches.length>1){ if (event.touches.length > 1) {
this.isStop = true; this.isStop = true;
return ; return;
} }
this.oldIndex = this.theIndex; this.oldIndex = this.theIndex;
this.theIndex = null; this.theIndex = null;
// //
this.initXY = [event.touches[0].pageX,event.touches[0].pageY]; this.initXY = [event.touches[0].pageX, event.touches[0].pageY];
}, },
touchMove(index,event){ touchMove(index, event) {
// //
if(event.touches.length>1){ if (event.touches.length > 1) {
this.isStop = true; this.isStop = true;
return ; return;
} }
let moveX = event.touches[0].pageX - this.initXY[0]; let moveX = event.touches[0].pageX - this.initXY[0];
let moveY = event.touches[0].pageY - this.initXY[1]; let moveY = event.touches[0].pageY - this.initXY[1];
if(this.isStop||Math.abs(moveX)<5){ if (this.isStop || Math.abs(moveX) < 5) {
return ; return;
} }
if (Math.abs(moveY) > Math.abs(moveX)){ if (Math.abs(moveY) > Math.abs(moveX)) {
// - // -
this.isStop = true; this.isStop = true;
return; return;
} }
if(moveX<0){ if (moveX < 0) {
this.theIndex = index; this.theIndex = index;
this.isStop = true; this.isStop = true;
}else if(moveX>0){ } else if (moveX > 0) {
if(this.theIndex!=null&&this.oldIndex==this.theIndex){ if (this.theIndex != null && this.oldIndex == this.theIndex) {
this.oldIndex = index; this.oldIndex = index;
this.theIndex = null; this.theIndex = null;
this.isStop = true; this.isStop = true;
setTimeout(()=>{ setTimeout(() => {
this.oldIndex = null; this.oldIndex = null;
},150) }, 150)
} }
} }
}, },
touchEnd(index,$event){ touchEnd(index, $event) {
// //
this.isStop = false; this.isStop = false;
}, },
// //
deleteCoupon(id,List){ deleteCoupon(id, List) {
let len = List.length; let len = List.length;
for(let i=0;i<len;i++){ for (let i = 0; i < len; i++) {
if(id==List[i].id){ if (id == List[i].id) {
List.splice(i, 1); List.splice(i, 1);
break; break;
} }
@ -270,20 +280,27 @@ import Api from '@/common/api';
} }
</script> </script>
<style lang="scss"> <style lang="scss">
view{ view {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
page{position: relative;background-color: #f5f5f5;}
.hidden{ page {
position: relative;
background-color: #f5f5f5;
}
.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*/
width: 100% !important; width: 100% !important;
@ -295,7 +312,8 @@ 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;
justify-content: center; justify-content: center;
@ -303,55 +321,79 @@ 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{
transform: translate3d(100%,0,0); &.invalid {
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{
&.invalid{ .sub-list {
&.invalid {
position: absolute; position: absolute;
top: 0; top: 0;
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;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-size: 32upx; font-size: 32upx;
} }
.row{
.row {
width: 92%; width: 92%;
height: 24vw; height: 24vw;
margin: 20upx auto 10upx auto; margin: 20upx auto 10upx auto;
@ -362,11 +404,13 @@ import Api from '@/common/api';
overflow: hidden; overflow: hidden;
z-index: 4; z-index: 4;
border: 0; border: 0;
.menu{
.icon{ .menu {
.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%);
} }
&.open{
100% {
transform: translateX(0);
}
}
&.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,52 +487,68 @@ 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;
font-size: 150upx; font-size: 150upx;
z-index: 6; z-index: 6;
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{
background:linear-gradient(to right,#aaa,#999); &.invalid {
.use{ background: linear-gradient(to right, #aaa, #999);
.use {
color: #aaa; color: #aaa;
} }
} }
justify-content: center; justify-content: center;
.ticket,.criteria{width: 100%;}
.ticket{ .ticket,
.criteria {
width: 100%;
}
.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;
justify-content: center; justify-content: center;
@ -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>

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

@ -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,90 +76,99 @@
</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>
<script> <script>
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue'; 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';
var ef=new eonfox() var ef = new eonfox()
export default { export default {
data() { data() {
return { return {
money:0, money: 0,
inputAmount:'',// inputAmount: '', //
amountList:[100,200,500],//3 amountList: [100, 200, 500], //3
paytype:'wxpay'// paytype: 'wxpay' //
}; };
}, },
onShow(){ onShow() {
this.load() this.load()
}, },
methods:{ methods: {
async load(){ async load() {
let params = { }; let params = {};
let data1 = await Api.apiCall('get', Api.member.currentMember, params); let data1 = await Api.apiCall('get', Api.member.currentMember, params);
this.money = data1.blance; this.money = data1.blance;
}, },
async onload() { async onload() {
let params = { }; let params = {};
let data1 = await Api.apiCall('get', Api.index.currentMember, params); let data1 = await Api.apiCall('get', Api.index.currentMember, params);
this.money = data1.blance; this.money = data1.blance;
}, },
select(amount){ select(amount) {
this.inputAmount = amount; this.inputAmount = amount;
}, },
doDeposit(){ doDeposit() {
if(this.paytype=='alipay'){ if (this.paytype == 'alipay') {
console.log('支付宝') console.log('支付宝')
return return
}else{ } else {
console.log('微信') console.log('微信')
return return
} }
if (parseFloat(this.inputAmount).toString() == "NaN") { if (parseFloat(this.inputAmount).toString() == "NaN") {
uni.showToast({title:'请输入正确金额',icon:'none'}); uni.showToast({
return ; title: '请输入正确金额',
icon: 'none'
});
return;
} }
if(this.inputAmount<=0){ if (this.inputAmount <= 0) {
uni.showToast({title:'请输入大于100的金额',icon:'none'}); uni.showToast({
return ; title: '请输入大于100的金额',
icon: 'none'
});
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({
return ; title: '最多只能输入两位小数哦~',
icon: 'none'
});
return;
} }
/// ///
uni.showLoading({ uni.showLoading({
title:'支付中...' title: '支付中...'
}); });
setTimeout(()=>{ setTimeout(() => {
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
title:'支付成功' title: '支付成功'
}); });
setTimeout(()=>{ setTimeout(() => {
uni.switchTab({ uni.switchTab({
url:'../../pages/index/user' url: '../../pages/index/user'
}); });
},300); }, 300);
},700) }, 700)
}, },
pay(){ pay() {
var _this=this var _this = this
if(!/^\d+(\.\d+)?$/.test(_this.inputAmount)||_this.inputAmount<=0){ if (!/^\d+(\.\d+)?$/.test(_this.inputAmount) || _this.inputAmount <= 0) {
uni.showToast({ uni.showToast({
title:'请输入正确金额', title: '请输入正确金额',
icon:'none' icon: 'none'
}) })
}else{ } else {
if(_this.paytype!='alipay'){ if (_this.paytype != 'alipay') {
_this.WeChatPay() _this.WeChatPay()
// // #ifdef MP-WEIXIN // // #ifdef MP-WEIXIN
// _this.pay_mp_weixin() // _this.pay_mp_weixin()
@ -167,11 +177,11 @@ import Api from '@/common/api';
// _this.pay_APP_weixin() // _this.pay_APP_weixin()
// // #endif // // #endif
} }
if(_this.paytype=='alipay'){ if (_this.paytype == 'alipay') {
// #ifdef H5 || MP-WEIXIN // #ifdef H5 || MP-WEIXIN
uni.showToast({ uni.showToast({
title: '开发中。。。', title: '开发中。。。',
icon:'none' icon: 'none'
}); });
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS
@ -182,80 +192,67 @@ import Api from '@/common/api';
} }
}, },
payAli(){ payAli() {
var _this=this; var _this = this;
ef.submit({ ef.submit({
request: { request: {
s: ['APPLICATIONORDERSELFBUYUSERMONEY', [{ s: ['APPLICATIONORDERSELFBUYUSERMONEY', [{
money_fen:_this.inputAmount*100,//|() money_fen: _this.inputAmount * 100, //|()
pay_method: 'alipay', // weixinpay alipay pay_method: 'alipay', // weixinpay alipay
alipay_trade_type:'APP' alipay_trade_type: 'APP'
} ]] }]]
}, },
callback(data){ callback(data) {
console.log('调起支付宝支付',data) console.log('调起支付宝支付', data)
fns.checkError(data,'s',function(errno,error){ fns.checkError(data, 's', function(errno, error) {
uni.showToast({ uni.showToast({
title:error, title: error,
icon:'none' icon: 'none'
}) })
}) })
var ali=data.data.s.data.alipay var ali = data.data.s.data.alipay
if(ali){ if (ali) {
uni.requestPayment({ uni.requestPayment({
provider: 'alipay', provider: 'alipay',
orderInfo:ali, orderInfo: ali,
success: function (res) { success: function(res) {
console.log('success:' + JSON.stringify(res)); console.log('success:' + JSON.stringify(res));
_this.onload() _this.onload()
uni.showToast({ uni.showToast({
title:'充值成功', title: '充值成功',
icon:'none' icon: 'none'
}) })
}, },
fail: function (err) { fail: function(err) {
console.log('fail:' + JSON.stringify(err)); console.log('fail:' + JSON.stringify(err));
} }
}); });
} }
}, },
error(err){ error(err) {
fns.err('提交订单失败',err,1) fns.err('提交订单失败', err, 1)
} }
}) })
}, },
// //
WeChatPay(){ WeChatPay() {
var _this=this var _this = this
// if (!/^\d+(\.\d+)?$/.test(_this.pay_money) || _this.pay_money <= 0) { var money_fen = _this.inputAmount * 100
// 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 // 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使timeStampS timeStamp: String(ress
.time_stamp), // jssdk使timestamp使timeStampS
nonceStr: ress.nonce_str, // 32 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' 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) {
@ -715,12 +709,12 @@ import Api from '@/common/api';
}); });
}, },
gominxi(){ gominxi() {
uni.navigateTo({ uni.navigateTo({
url: '../../pagesU/user/balance' url: '../../pagesU/user/balance'
}) })
}, },
gopage(){ gopage() {
uni.navigateTo({ uni.navigateTo({
url: '../../pagesU/user/myPurse' url: '../../pagesU/user/myPurse'
}) })
@ -733,15 +727,17 @@ import Api from '@/common/api';
</script> </script>
<style lang="scss"> <style lang="scss">
.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{
.my{ .content {
.my {
width: 100%; width: 100%;
height: 120upx; height: 120upx;
display: flex; display: flex;
@ -749,46 +745,53 @@ 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%;
.list{ .list {
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;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
border-radius: 10upx; border-radius: 10upx;
box-shadow: 0upx 5upx 20upx rgba(0,0,0,0.05); box-shadow: 0upx 5upx 20upx rgba(0, 0, 0, 0.05);
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;
font-size: 30upx; font-size: 30upx;
@ -799,29 +802,35 @@ 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{
width: 100upx; .left {
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;
display: flex; display: flex;
@ -831,13 +840,15 @@ 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;
border-radius: 80upx; border-radius: 80upx;
@ -846,14 +857,16 @@ import Api from '@/common/api';
align-items: center; align-items: center;
color: #fff; color: #fff;
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%;
font-size: 24upx; font-size: 24upx;
@ -861,7 +874,8 @@ 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;
} }
} }

Loading…
Cancel
Save