diff --git a/mallplusui-uniapp-app/common/api.js b/mallplusui-uniapp-app/common/api.js index d3055c2..5b7e8bd 100644 --- a/mallplusui-uniapp-app/common/api.js +++ b/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; diff --git a/mallplusui-uniapp-app/components/eonfox/eonfox.js b/mallplusui-uniapp-app/components/eonfox/eonfox.js index 9b0d082..b7269d4 100644 --- a/mallplusui-uniapp-app/components/eonfox/eonfox.js +++ b/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', diff --git a/mallplusui-uniapp-app/components/eonfox/fns.js b/mallplusui-uniapp-app/components/eonfox/fns.js index 34164b6..a35a2a0 100644 --- a/mallplusui-uniapp-app/components/eonfox/fns.js +++ b/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; diff --git a/mallplusui-uniapp-app/pages/order/orderDetail.vue b/mallplusui-uniapp-app/pages/order/orderDetail.vue index 012b097..830fbc8 100644 --- a/mallplusui-uniapp-app/pages/order/orderDetail.vue +++ b/mallplusui-uniapp-app/pages/order/orderDetail.vue @@ -8,14 +8,14 @@ {{orderInfo.orderSn}} - + {{ orderInfo.createTime }} {{ orderInfo.stateTip }} - + @@ -25,13 +25,13 @@ x {{ goodsItem.productQuantity }} {{ goodsItem.productPrice }} - - {{orderInfo.deliveryCompany}}: - {{ orderInfo.deliverySn }} - - + + {{orderInfo.deliveryCompany}}: + {{ orderInfo.deliverySn }} + + - - - 共 - {{ orderInfo.orderItemList.length }} - 件商品, 会员折扣 - {{ orderInfo.vipAmount }} - , 优惠券抵扣 - {{ orderInfo.couponAmount }} - - - 积分抵扣 - {{ orderInfo.integrationAmount }} - , 运费 - {{ orderInfo.freightAmount }} - - , 实付款 - {{ orderInfo.payAmount }} - + , 实付款 + {{ orderInfo.payAmount }} + - @@ -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 { diff --git a/mallplusui-uniapp-app/pagesU/user/coupon.vue b/mallplusui-uniapp-app/pagesU/user/coupon.vue index 3071f6a..6b89be2 100644 --- a/mallplusui-uniapp-app/pagesU/user/coupon.vue +++ b/mallplusui-uniapp-app/pagesU/user/coupon.vue @@ -1,21 +1,26 @@ diff --git a/mallplusui-uniapp-app/pagesU/user/deposit.vue b/mallplusui-uniapp-app/pagesU/user/deposit.vue index 1a9b5c6..2f4ed2f 100644 --- a/mallplusui-uniapp-app/pagesU/user/deposit.vue +++ b/mallplusui-uniapp-app/pagesU/user/deposit.vue @@ -1,10 +1,10 @@