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. 464
      mallplusui-uniapp-app/components/eonfox/fns.js
  4. 116
      mallplusui-uniapp-app/pages/order/orderDetail.vue
  5. 329
      mallplusui-uniapp-app/pagesU/user/coupon.vue
  6. 824
      mallplusui-uniapp-app/pagesU/user/deposit.vue

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

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

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

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

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

@ -8,14 +8,14 @@
<view class="i-top b-b">
<text class="state" :style="{ color: orderInfo.stateTipColor }">{{orderInfo.orderSn}}</text>
</view>
<view class="i-top b-b">
<text class="time">{{ orderInfo.createTime }}</text>
<!-- <text class="state" :style="{ color: orderInfo.stateTipColor }" @click="navToDetailPage(item)">{{ orderInfo.id }}--</text> -->
<text class="state"
:style="{ color: orderInfo.stateTipColor }">{{ orderInfo.stateTip }}</text>
</view>
<view v-if="goodsItem.type === 1" class="goods-box-single"
v-for="(goodsItem, goodsIndex) in orderInfo.orderItemList" :key="goodsIndex">
<img class="goods-img" :src="goodsItem.productPic" mode="aspectFill"></img>
@ -25,13 +25,13 @@
<text class="attr-box">x {{ goodsItem.productQuantity }}</text>
<text class="price">{{ goodsItem.productPrice }}</text>
</view>
<view style="display: flex;flex-direction: row;">
<text style="color: #c1c1c1;font-size: 13px;"
v-if="orderInfo.status === 5||orderInfo.status === 3">{{orderInfo.deliveryCompany}}</text>
<text style="color: #c1c1c1;font-size: 13px;"
v-if="orderInfo.status === 5||orderInfo.status === 3">{{ orderInfo.deliverySn }}</text>
</view>
<view style="display: flex;flex-direction: row;">
<text style="color: #c1c1c1;font-size: 13px;"
v-if="orderInfo.status === 5||orderInfo.status === 3">{{orderInfo.deliveryCompany}}</text>
<text style="color: #c1c1c1;font-size: 13px;"
v-if="orderInfo.status === 5||orderInfo.status === 3">{{ orderInfo.deliverySn }}</text>
</view>
</view>
</view>
<!-- <view class="i-top b-b">
@ -48,34 +48,34 @@
</view>
</view> -->
<view style="display: flex;flex-direction: column; margin-right: 13px;margin-bottom: 10px;">
<view class="price-box">
<text class="num">{{ orderInfo.orderItemList.length }}</text>
件商品, 会员折扣
<text class="price">{{ orderInfo.vipAmount }}</text>
, 优惠券抵扣
<text class="price">{{ orderInfo.couponAmount }}</text>
</view>
<view class="price-box">
积分抵扣
<text class="price">{{ orderInfo.integrationAmount }}</text>
, 运费
<text class="price">{{ orderInfo.freightAmount }}</text>
<!-- <view class="yt-list-cell b-b" v-if="groupActivity">
<view class="price-box">
<text class="num">{{ orderInfo.orderItemList.length }}</text>
件商品, 会员折扣
<text class="price">{{ orderInfo.vipAmount }}</text>
, 优惠券抵扣
<text class="price">{{ orderInfo.couponAmount }}</text>
</view>
<view class="price-box">
积分抵扣
<text class="price">{{ orderInfo.integrationAmount }}</text>
, 运费
<text class="price">{{ orderInfo.freightAmount }}</text>
<!-- <view class="yt-list-cell b-b" v-if="groupActivity">
<text class="cell-tit clamp">活动金额</text>
<text class="cell-tip">{{ groupActivity.price }}</text>
</view> -->
, 实付款
<text class="price">{{ orderInfo.payAmount }}</text>
</view>
, 实付款
<text class="price">{{ orderInfo.payAmount }}</text>
</view>
</view>
<view class="action-box b-t" v-if="orderInfo.status==12||orderInfo.status==3">
<button v-if="orderInfo.status == 12" class="action-btn"
@click="cancelOrder(orderInfo)">取消订单</button>
<button v-if="orderInfo.status == 12" class="action-btn recom"
@click="payOrder(orderInfo)">立即支付</button>
<!-- <button v-if="orderInfo.status <7" class="action-btn recom"
<!-- <button v-if="orderInfo.status <7" class="action-btn recom"
@click="applyRefund(orderInfo.id)">申请售后</button> -->
<button v-if="orderInfo.status == 3" class="action-btn recom"
@click="confimDelivery(orderInfo)">确认收货</button>
@ -112,7 +112,7 @@
return {
tabCurrentIndex: 0,
orderInfo: {
orderItemList:[]
orderItemList: []
},
navList: [{
status: 0,
@ -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();
},
@ -247,11 +253,11 @@
orderStateExp(value) {
let stateTip = '',
stateTipColor = '#fa436a';
if (value === 1) {
stateTipColor = '#909399';
stateTip= '支付成功,没有回掉';
}else if (value === 2) {
stateTip = '支付成功,没有回掉';
} else if (value === 2) {
stateTip = '待发货';
} else if (value === 3) {
stateTip = '待收货';
@ -266,9 +272,9 @@
stateTip = ' 维权已完成';
} else if (value === 8) {
stateTip = '待分享';
}else if (value === 12) {
} else if (value === 12) {
stateTipColor = '#909399';
stateTip= '待付款';
stateTip = '待付款';
} else if (value === 13) {
stateTip = '申请退款';
} else if (value === 14) {
@ -439,31 +445,31 @@
line-height: 1;
}
.num_price {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-top: 5px;
.attr-box {
flex: 1;
font-size: $font-sm + 2upx;
color: $font-color-light;
margin: 0 2upx 0 8upx;
}
.price {
font-size: $font-base + 2upx;
color: $font-color-dark;
&:before {
content: '¥';
font-size: $font-sm;
.num_price {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-top: 5px;
.attr-box {
flex: 1;
font-size: $font-sm + 2upx;
color: $font-color-light;
margin: 0 2upx 0 8upx;
}
.price {
font-size: $font-base + 2upx;
color: $font-color-dark;
&:before {
content: '¥';
font-size: $font-sm;
margin: 0 2upx 0 8upx;
}
}
}
}
}
}
.price-box {

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

@ -1,21 +1,26 @@
<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>
<view class="place"></view>
<view class="list">
<!-- 优惠券列表 -->
<view class="sub-list valid" :class="subState">
<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="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}}
@ -51,13 +56,16 @@
</view>
<view class="sub-list invalid" :class="subState">
<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="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}}
@ -100,159 +108,161 @@
</template>
<script>
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue';
import Api from '@/common/api';
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 {
data() {
return {
couponValidList:[
couponValidList: [
// {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: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使"}
],
couponinvalidList:[
couponinvalidList: [
// {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: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使"}
],
headerTop:0,
headerTop: 0,
//
typeClass:'valid',
subState:'',
theIndex:null,
oldIndex:null,
isStop:false
typeClass: 'valid',
subState: '',
theIndex: null,
oldIndex: null,
isStop: false
}
},
onPageScroll(e){
onPageScroll(e) {
},
//page.json "enablePullDownRefresh": true
onPullDownRefresh() {
setTimeout(function () {
uni.stopPullDownRefresh();
}, 1000);
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
onLoad() {
this.getData()
//H5
// #ifdef H5
//onLoadhead
let Timer = setInterval(()=>{
let uniHead = document.getElementsByTagName('uni-page-head');
if(uniHead.length>0){
this.headerTop = uniHead[0].offsetHeight+'px';
clearInterval(Timer);//
}
},1);
//onLoadhead
let Timer = setInterval(() => {
let uniHead = document.getElementsByTagName('uni-page-head');
if (uniHead.length > 0) {
this.headerTop = uniHead[0].offsetHeight + 'px';
clearInterval(Timer); //
}
}, 1);
// #endif
},
filters: {
formatCreateTime(time) {
let date = new Date(time);
return formatDate(date, 'yyyy-MM-dd')
},
},
formatCreateTime(time) {
let date = new Date(time);
return formatDate(date, 'yyyy-MM-dd')
},
},
methods: {
goUse(){
goUse() {
uni.switchTab({
url:'/pages/index/index'
url: '/pages/index/index'
})
},
async getData(){
let params = { };
let data = await Api.apiCall('get', Api.index.listMemberCoupon, params);
let viewList = data;
viewList.forEach(item => {
if(item.useStatus==0){
this.couponValidList.push(item);
}else{
this.couponinvalidList.push(item);
}
});
async getData() {
let params = {};
let data = await Api.apiCall('get', Api.index.listMemberCoupon, params);
let viewList = data;
viewList.forEach(item => {
if (item.useStatus == 0) {
this.couponValidList.push(item);
} else {
this.couponinvalidList.push(item);
}
});
},
switchType(type){
switchType(type) {
// console.log(type)
if(this.typeClass==type){
return ;
if (this.typeClass == type) {
return;
}
uni.pageScrollTo({
scrollTop:0,
duration:0
scrollTop: 0,
duration: 0
})
this.typeClass = type;
this.subState = this.typeClass==''?'':'show'+type;
setTimeout(()=>{
this.subState = this.typeClass == '' ? '' : 'show' + type;
setTimeout(() => {
this.oldIndex = null;
this.theIndex = null;
this.subState = this.typeClass=='valid'?'':this.subState;
},200)
this.subState = this.typeClass == 'valid' ? '' : this.subState;
}, 200)
},
//-begin
touchStart(index,event){
touchStart(index, event) {
//
if(event.touches.length>1){
if (event.touches.length > 1) {
this.isStop = true;
return ;
return;
}
this.oldIndex = this.theIndex;
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;
return ;
return;
}
let moveX = event.touches[0].pageX - this.initXY[0];
let moveY = event.touches[0].pageY - this.initXY[1];
if(this.isStop||Math.abs(moveX)<5){
return ;
if (this.isStop || Math.abs(moveX) < 5) {
return;
}
if (Math.abs(moveY) > Math.abs(moveX)){
if (Math.abs(moveY) > Math.abs(moveX)) {
// -
this.isStop = true;
return;
}
if(moveX<0){
if (moveX < 0) {
this.theIndex = index;
this.isStop = true;
}else if(moveX>0){
if(this.theIndex!=null&&this.oldIndex==this.theIndex){
} else if (moveX > 0) {
if (this.theIndex != null && this.oldIndex == this.theIndex) {
this.oldIndex = index;
this.theIndex = null;
this.isStop = true;
setTimeout(()=>{
setTimeout(() => {
this.oldIndex = null;
},150)
}, 150)
}
}
},
touchEnd(index,$event){
touchEnd(index, $event) {
//
this.isStop = false;
},
//
deleteCoupon(id,List){
deleteCoupon(id, List) {
let len = List.length;
for(let i=0;i<len;i++){
if(id==List[i].id){
for (let i = 0; i < len; i++) {
if (id == List[i].id) {
List.splice(i, 1);
break;
}
@ -270,20 +280,27 @@ import Api from '@/common/api';
}
</script>
<style lang="scss">
view{
view {
display: flex;
flex-wrap: wrap;
}
page{position: relative;background-color: #f5f5f5;}
.hidden{
page {
position: relative;
background-color: #f5f5f5;
}
.hidden {
display: none !important;
}
.place{
.place {
width: 100%;
height: 95upx;
}
.tabr{
.tabr {
background-color: #fff;
/* #ifdef H5 || MP-WEIXIN*/
width: 100% !important;
@ -295,7 +312,8 @@ import Api from '@/common/api';
position: fixed;
top: 0;
z-index: 10;
view{
view {
width: 50%;
height: 90upx;
justify-content: center;
@ -303,55 +321,79 @@ import Api from '@/common/api';
font-size: 32upx;
color: #999;
}
.on{
.on {
color: $uni-color-success;
}
.border{
.border {
height: 4upx;
background-color: $uni-color-success;
transition: all .3s ease-out;
&.invalid{
transform: translate3d(100%,0,0);
&.invalid {
transform: translate3d(100%, 0, 0);
}
}
}
.list{
.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{
.sub-list {
&.invalid {
position: absolute;
top: 0;
left:100%;
left: 100%;
display: none;
}
&.showvalid{
&.showvalid {
display: flex;
animation: showValid 0.20s linear both;
}
&.showinvalid{
&.showinvalid {
display: flex;
animation: showInvalid 0.20s linear both;
}
width: 100%;
padding: 20upx 0 120upx 0;
.tis{
.tis {
width: 100%;
height: 60upx;
justify-content: center;
align-items: center;
font-size: 32upx;
}
.row{
.row {
width: 92%;
height: 24vw;
margin: 20upx auto 10upx auto;
@ -362,11 +404,13 @@ import Api from '@/common/api';
overflow: hidden;
z-index: 4;
border: 0;
.menu{
.icon{
.menu {
.icon {
color: #fff;
font-size:50upx;
font-size: 50upx;
}
position: absolute;
width: 28%;
height: 100%;
@ -377,19 +421,36 @@ import Api from '@/common/api';
color: #fff;
z-index: 2;
}
.carrier{
.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{
&.open {
animation: showMenu 0.25s linear both;
}
&.close{
&.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{
.left {
width: 100%;
.title{
.title {
padding-top: 3vw;
width: 90%;
margin: 0 5%;
font-size: 36upx;
}
.term{
.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,52 +487,68 @@ import Api from '@/common/api';
border-radius: 100%;
background-color: #f5f5f5;
}
.gap-top{
.gap-top {
top: -10upx;
}
.gap-bottom{
.gap-bottom {
bottom: -10upx;
}
.shixiao{
.shixiao {
position: absolute;
right: 20upx;
font-size: 150upx;
z-index: 6;
color: rgba(153,153,153,0.2)
color: rgba(153, 153, 153, 0.2)
}
}
.right{
.right {
flex-shrink: 0;
width: 28%;
color: #fff;
background:linear-gradient(to right,#ec625c,#ee827f);
&.invalid{
background:linear-gradient(to right,#aaa,#999);
.use{
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{
.ticket,
.criteria {
width: 100%;
}
.ticket {
padding-top: 1vw;
justify-content: center;
align-items: baseline;
height: 6vw;
.num{
.num {
font-size: 42upx;
font-weight: 600;
}
.unit{
.unit {
font-size: 24upx;
}
}
.criteria{
.criteria {
justify-content: center;
font-size: 28upx;
}
.use{
.use {
width: 50%;
height: 40upx;
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="left">
@ -509,5 +593,4 @@ import Api from '@/common/api';
* */
}
}
</style>

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

File diff suppressed because it is too large
Loading…
Cancel
Save