2023-3-8
完善功能
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import store from '../store/index';
|
import store from '../store/index';
|
||||||
export default {
|
export default {
|
||||||
// qq 237524947 wx15d4269d3210863d
|
// qq 237524947 wx15d4269d3210863d
|
||||||
// BASEURI: 'http://5rygzr.natappfree.cc/api/',
|
// BASEURI: 'http://br68s5.natappfree.cc/api/',
|
||||||
BASEURI: 'http://mall.yyundong.com/portalapi/api/',
|
BASEURI: 'http://mall.yyundong.com/portalapi/api/',
|
||||||
// BASEURI: 'http://192.168.31.52:8083/api/',
|
// BASEURI: 'http://192.168.31.52:8083/api/',
|
||||||
ADMINURI: 'http://mall.yyundong.com/adminapi/',
|
ADMINURI: 'http://mall.yyundong.com/adminapi/',
|
||||||
@@ -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;
|
||||||
|
|||||||
@@ -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',
|
||||||
|
|||||||
@@ -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,229 +56,232 @@ 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)
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
console.log(title + ' :', data)
|
||||||
},
|
uni.showToast({
|
||||||
//成功信息处理
|
title: title + ' : ' + data,
|
||||||
success(title,fun){
|
icon: 'none',
|
||||||
if(fun){
|
duration: 1500,
|
||||||
fun();
|
|
||||||
}
|
|
||||||
uni.hideLoading();
|
|
||||||
/* uni.showToast({
|
|
||||||
title:title,
|
|
||||||
icon:'success',
|
|
||||||
success() {
|
success() {
|
||||||
if(fun){
|
if (fun) {
|
||||||
fun();
|
fun();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}) */
|
})
|
||||||
},
|
} else {
|
||||||
//敬请期待
|
console.log(title)
|
||||||
waiting:function(){
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title:'敬请期待',
|
title: title,
|
||||||
icon:'none'
|
icon: 'none',
|
||||||
})
|
duration: 1500,
|
||||||
},
|
|
||||||
//授权验证
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
,
|
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
,
|
|
||||||
toast(tit,url,time){
|
|
||||||
if(!time){
|
|
||||||
time=1500
|
|
||||||
}
|
|
||||||
uni.showToast({
|
|
||||||
title:tit,
|
|
||||||
success() {
|
success() {
|
||||||
setTimeout(function(){
|
if (fun) {
|
||||||
uni.reLaunch({
|
fun();
|
||||||
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('接收到参数');
|
|
||||||
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('获取缓存');
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//------------------------
|
|
||||||
|
},
|
||||||
|
//成功信息处理
|
||||||
|
success(title, fun) {
|
||||||
|
if (fun) {
|
||||||
|
fun();
|
||||||
|
}
|
||||||
|
uni.hideLoading();
|
||||||
|
/* uni.showToast({
|
||||||
|
title:title,
|
||||||
|
icon:'success',
|
||||||
|
success() {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//获取指定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;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 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;
|
||||||
|
},
|
||||||
|
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('接收到参数');
|
||||||
|
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;
|
export default fns;
|
||||||
|
|||||||
@@ -25,12 +25,12 @@
|
|||||||
<text class="attr-box">x {{ goodsItem.productQuantity }}</text>
|
<text class="attr-box">x {{ goodsItem.productQuantity }}</text>
|
||||||
<text class="price">{{ goodsItem.productPrice }}</text>
|
<text class="price">{{ goodsItem.productPrice }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view style="display: flex;flex-direction: row;">
|
<view style="display: flex;flex-direction: row;">
|
||||||
<text style="color: #c1c1c1;font-size: 13px;"
|
<text style="color: #c1c1c1;font-size: 13px;"
|
||||||
v-if="orderInfo.status === 5||orderInfo.status === 3">{{orderInfo.deliveryCompany}}:</text>
|
v-if="orderInfo.status === 5||orderInfo.status === 3">{{orderInfo.deliveryCompany}}:</text>
|
||||||
<text style="color: #c1c1c1;font-size: 13px;"
|
<text style="color: #c1c1c1;font-size: 13px;"
|
||||||
v-if="orderInfo.status === 5||orderInfo.status === 3">{{ orderInfo.deliverySn }}</text>
|
v-if="orderInfo.status === 5||orderInfo.status === 3">{{ orderInfo.deliverySn }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -49,33 +49,33 @@
|
|||||||
</view> -->
|
</view> -->
|
||||||
<view style="display: flex;flex-direction: column; margin-right: 13px;margin-bottom: 10px;">
|
<view style="display: flex;flex-direction: column; margin-right: 13px;margin-bottom: 10px;">
|
||||||
|
|
||||||
<view class="price-box">
|
<view class="price-box">
|
||||||
共
|
共
|
||||||
<text class="num">{{ orderInfo.orderItemList.length }}</text>
|
<text class="num">{{ orderInfo.orderItemList.length }}</text>
|
||||||
件商品, 会员折扣
|
件商品, 会员折扣
|
||||||
<text class="price">{{ orderInfo.vipAmount }}</text>
|
<text class="price">{{ orderInfo.vipAmount }}</text>
|
||||||
, 优惠券抵扣
|
, 优惠券抵扣
|
||||||
<text class="price">{{ orderInfo.couponAmount }}</text>
|
<text class="price">{{ orderInfo.couponAmount }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="price-box">
|
<view class="price-box">
|
||||||
积分抵扣
|
积分抵扣
|
||||||
<text class="price">{{ orderInfo.integrationAmount }}</text>
|
<text class="price">{{ orderInfo.integrationAmount }}</text>
|
||||||
, 运费
|
, 运费
|
||||||
<text class="price">{{ orderInfo.freightAmount }}</text>
|
<text class="price">{{ orderInfo.freightAmount }}</text>
|
||||||
<!-- <view class="yt-list-cell b-b" v-if="groupActivity">
|
<!-- <view class="yt-list-cell b-b" v-if="groupActivity">
|
||||||
<text class="cell-tit clamp">活动金额</text>
|
<text class="cell-tit clamp">活动金额</text>
|
||||||
<text class="cell-tip">¥{{ groupActivity.price }}</text>
|
<text class="cell-tip">¥{{ groupActivity.price }}</text>
|
||||||
</view> -->
|
</view> -->
|
||||||
, 实付款
|
, 实付款
|
||||||
<text class="price">{{ orderInfo.payAmount }}</text>
|
<text class="price">{{ orderInfo.payAmount }}</text>
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
<view class="action-box b-t" v-if="orderInfo.status==12||orderInfo.status==3">
|
<view class="action-box b-t" v-if="orderInfo.status==12||orderInfo.status==3">
|
||||||
<button v-if="orderInfo.status == 12" class="action-btn"
|
<button v-if="orderInfo.status == 12" class="action-btn"
|
||||||
@click="cancelOrder(orderInfo)">取消订单</button>
|
@click="cancelOrder(orderInfo)">取消订单</button>
|
||||||
<button v-if="orderInfo.status == 12" class="action-btn recom"
|
<button v-if="orderInfo.status == 12" class="action-btn recom"
|
||||||
@click="payOrder(orderInfo)">立即支付</button>
|
@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> -->
|
@click="applyRefund(orderInfo.id)">申请售后</button> -->
|
||||||
<button v-if="orderInfo.status == 3" class="action-btn recom"
|
<button v-if="orderInfo.status == 3" class="action-btn recom"
|
||||||
@click="confimDelivery(orderInfo)">确认收货</button>
|
@click="confimDelivery(orderInfo)">确认收货</button>
|
||||||
@@ -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) {
|
||||||
@@ -439,31 +445,31 @@
|
|||||||
line-height: 1;
|
line-height: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.num_price {
|
.num_price {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
|
|
||||||
.attr-box {
|
.attr-box {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
font-size: $font-sm + 2upx;
|
font-size: $font-sm + 2upx;
|
||||||
color: $font-color-light;
|
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;
|
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 {
|
.price-box {
|
||||||
|
|||||||
@@ -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,159 +108,161 @@
|
|||||||
</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);
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.getData()
|
this.getData()
|
||||||
//兼容H5下排序栏位置
|
//兼容H5下排序栏位置
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
//定时器方式循环获取高度为止,这么写的原因是onLoad中head未必已经渲染出来。
|
//定时器方式循环获取高度为止,这么写的原因是onLoad中head未必已经渲染出来。
|
||||||
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: {
|
||||||
formatCreateTime(time) {
|
formatCreateTime(time) {
|
||||||
let date = new Date(time);
|
let date = new Date(time);
|
||||||
return formatDate(date, 'yyyy-MM-dd')
|
return formatDate(date, 'yyyy-MM-dd')
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
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%);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: translateX(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&.open{
|
|
||||||
|
&.open {
|
||||||
animation: showMenu 0.25s linear both;
|
animation: showMenu 0.25s linear both;
|
||||||
}
|
}
|
||||||
&.close{
|
|
||||||
|
&.close {
|
||||||
animation: closeMenu 0.15s linear both;
|
animation: closeMenu 0.15s linear both;
|
||||||
}
|
}
|
||||||
|
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -397,22 +458,28 @@ import Api from '@/common/api';
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
.left{
|
|
||||||
|
.left {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
.title{
|
|
||||||
|
.title {
|
||||||
padding-top: 3vw;
|
padding-top: 3vw;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
margin: 0 5%;
|
margin: 0 5%;
|
||||||
font-size: 36upx;
|
font-size: 36upx;
|
||||||
}
|
}
|
||||||
.term{
|
|
||||||
|
.term {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
margin: 0 5%;
|
margin: 0 5%;
|
||||||
font-size: 26upx;
|
font-size: 26upx;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
position: relative;
|
position: relative;
|
||||||
.gap-top,.gap-bottom{
|
|
||||||
|
.gap-top,
|
||||||
|
.gap-bottom {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 20upx;
|
width: 20upx;
|
||||||
height: 20upx;
|
height: 20upx;
|
||||||
@@ -420,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>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user