diff --git a/api/api.js b/api/api.js index 10788941..3654846f 100644 --- a/api/api.js +++ b/api/api.js @@ -220,5 +220,5 @@ export function getLiveList(page,limit) { * 获取小程序二维码 */ export function getQrcode(data) { - return request.post('qrcode/get',data); + return request.post('qrcode/get',data,{ noAuth: true }); } diff --git a/api/order.js b/api/order.js index c57b1870..53f57659 100644 --- a/api/order.js +++ b/api/order.js @@ -5,14 +5,16 @@ import request from "@/utils/request.js"; * @param numType boolean true 购物车数量,false=购物车产品数量 */ export function getCartCounts(numType) { - return request.get("cart/count", { numType: numType === undefined ? true : numType }); + return request.get("cart/count", { + numType: numType === undefined ? true : numType + }); } /** * 获取购物车列表 * */ export function getCartList(data) { - return request.get("cart/list",data); + return request.get("cart/list", data); } /** @@ -21,108 +23,121 @@ export function getCartList(data) { * @param int number 修改数量 */ export function changeCartNum(cartId, number) { - return request.post("cart/num", { id: cartId, number: number },{},1); + return request.post("cart/num", { + id: cartId, + number: number + }, {}, 1); } /** * 清除购物车 * @param object ids join(',') 切割成字符串 -*/ -export function cartDel(ids){ - if (typeof ids === 'object') - ids = ids.join(','); - return request.post('cart/delete', { ids: ids},{},1); + */ +export function cartDel(ids) { + if (typeof ids === 'object') + ids = ids.join(','); + return request.post('cart/delete', { + ids: ids + }, {}, 1); } /** * 购物车重选提交 * -*/ -export function getResetCart(data){ - return request.post('cart/resetcart', data); + */ +export function getResetCart(data) { + return request.post('cart/resetcart', data); } /** * 订单列表 * @param object data -*/ -export function getOrderList(data){ - return request.get('order/list',data); + */ +export function getOrderList(data) { + return request.get('order/list', data); } /** * 订单产品信息 * @param string unique -*/ -export function orderProduct(data){ - return request.post('order/product', data); + */ +export function orderProduct(data) { + return request.post('order/product', data); } /** * 订单评价 * @param object data * -*/ -export function orderComment(data){ - return request.post('order/comment',data); + */ +export function orderComment(data) { + return request.post('order/comment', data); } /** * 订单支付 * @param object data -*/ -export function orderPay(data){ - return request.post('order/pay',data); + */ +export function orderPay(data) { + return request.post('order/pay', data); } /** * 订单统计数据 -*/ -export function orderData(){ - return request.get('order/data') + */ +export function orderData() { + return request.get('order/data') } /** * 订单取消 * @param string id * -*/ -export function orderCancel(id){ - return request.post('order/cancel',{id:id},{},1); + */ +export function orderCancel(id) { + return request.post('order/cancel', { + id: id + }, {}, 1); } /** * 删除已完成订单 * @param string uni * -*/ -export function orderDel(uni){ - return request.post('order/del',{id:uni},{},1); + */ +export function orderDel(uni) { + return request.post('order/del', { + id: uni + }, {}, 1); } /** * 订单详情 * @param string uni -*/ -export function getOrderDetail(uni){ - return request.get('order/detail/'+uni); + */ +export function getOrderDetail(uni) { + return request.get('order/detail/' + uni); } /** * 再次下单 * @param string uni * -*/ -export function orderAgain(uni){ - return request.post('order/again',{nui:uni}); + */ +export function orderAgain(uni) { + return request.post('order/again', { + nui: uni + }); } /** * 订单收货 * @param string uni * -*/ -export function orderTake(uni){ - return request.post('order/take',{id:uni},{},1); + */ +export function orderTake(uni) { + return request.post('order/take', { + id: uni + }, {}, 1); } /** @@ -130,40 +145,43 @@ export function orderTake(uni){ * @returns {*} */ export function express(uni) { - return request.get("order/express/" + uni); + return request.get("order/express/" + uni); } /** * 获取退款理由 * -*/ -export function ordeRefundReason(){ - return request.get('order/refund/reason'); + */ +export function ordeRefundReason() { + return request.get('order/refund/reason'); } /** * 订单退款审核 * @param object data -*/ -export function orderRefundVerify(data){ - return request.post('order/refund/verify',data); + */ +export function orderRefundVerify(data) { + return request.post('order/refund/verify', data); } /** * 订单确认获取订单详细信息 * @param string cartId -*/ -export function orderConfirm(cartId,isNew){ - return request.post('order/confirm', { cartIds: cartId,isNew:isNew}, {}, 1); + */ +export function orderConfirm(cartId, isNew) { + return request.post('order/confirm', { + cartIds: cartId, + isNew: isNew + }, {}, 1); } /** * 获取当前金额能使用的优惠卷 * @param string price * -*/ -export function getCouponsOrderPrice( data){ - return request.get('coupons/order', data) + */ +export function getCouponsOrderPrice(data) { + return request.get('coupons/order', data) } /** @@ -171,9 +189,9 @@ export function getCouponsOrderPrice( data){ * @param string key * @param object data * -*/ -export function orderCreate(key,data){ - return request.post('order/create/'+key,data); + */ +export function orderCreate(key, data) { + return request.post('order/create/' + key, data); } /** @@ -183,5 +201,5 @@ export function orderCreate(key,data){ * @returns {*} */ export function postOrderComputed(key, data) { - return request.post("order/computed/" + key, data); -} \ No newline at end of file + return request.post("order/computed/" + key, data); +} diff --git a/api/public.js b/api/public.js index 45a18ae2..b1f19994 100644 --- a/api/public.js +++ b/api/public.js @@ -5,22 +5,18 @@ import wechat from "@/libs/wechat.js"; * 获取微信公众号js配置 * @returns {*} */ +export function getWechatConfig() { + return request.get("wechat/config",{ url: encodeURIComponent(wechat.signLink()) },{ noAuth: true }); +} + // export function getWechatConfig() { // return request.get( -// "wechat/config?t="+ Date.parse(new Date()), -// { url: encodeURIComponent(wechat.signLink()) }, +// "wechat/config", +// { url: encodeURIComponent(location.href.split('#')[0]) }, // { noAuth: true } // ); // } -export function getWechatConfig() { - return request.get( - "wechat/config", - { url: encodeURIComponent(location.href.split('#')[0]) }, - { noAuth: true } - ); -} - /** * 获取微信sdk配置 * @returns {*} @@ -71,7 +67,7 @@ export function follow() { * @retins {*} * */ export function imageBase64(image) { - return request.post("qrcode/base64",image,{},1); + return request.post("qrcode/base64",image,{ noAuth: true },1); } /** diff --git a/api/store.js b/api/store.js index ce0d4b8f..a7b16d3b 100644 --- a/api/store.js +++ b/api/store.js @@ -131,7 +131,9 @@ export function getCollectUserList(data) { * */ export function getReplyList(id, data) { - return request.get('reply/list/' + id, data) + return request.get('reply/list/' + id, data,{ + noAuth: true + }) } /** @@ -139,7 +141,9 @@ export function getReplyList(id, data) { * @param int id */ export function getReplyConfig(id) { - return request.get('reply/config/' + id); + return request.get('reply/config/' + id,{},{ + noAuth: true + }); } /** diff --git a/components/payment/index.vue b/components/payment/index.vue index 84181342..597ac21d 100644 --- a/components/payment/index.vue +++ b/components/payment/index.vue @@ -131,7 +131,7 @@ let data = res.data; if (data.status == "WECHAT_H5_PAY") { uni.hideLoading(); - location.replace(data.result.jsConfig.mweb_url); + location.replace(data.result.jsConfig.h5PayUrl); return that.$util.Tips({ title: "支付成功", icon: 'success' diff --git a/components/productWindow/index.vue b/components/productWindow/index.vue index 3a79c64b..54fe8939 100644 --- a/components/productWindow/index.vue +++ b/components/productWindow/index.vue @@ -110,7 +110,6 @@ this.$emit('ChangeCartNum', true); }, tapAttr: function(indexw, indexn) { - console.log('45454555'); let that = this; that.$emit("attrVal", { indexw: indexw, @@ -119,7 +118,7 @@ this.$set(this.attr.productAttr[indexw], 'index', this.attr.productAttr[indexw].attrValues[indexn]); let value = that .getCheckedValue() - .sort() + // .sort() .join(","); that.$emit("ChangeAttr", value); diff --git a/components/tabNav.vue b/components/tabNav.vue index a0ef7997..f57b3f91 100644 --- a/components/tabNav.vue +++ b/components/tabNav.vue @@ -11,7 +11,7 @@ - + {{item.name}} diff --git a/libs/wechat.js b/libs/wechat.js index d34a965a..cebadf86 100644 --- a/libs/wechat.js +++ b/libs/wechat.js @@ -37,11 +37,12 @@ class AuthWechat { signLink() { if (typeof window.entryUrl === 'undefined' || window.entryUrl === '') { - window.entryUrl = document.location.href + window.entryUrl = location.href.split('#')[0] } - return /(Android)/i.test(navigator.userAgent) ? document.location.href : window.entryUrl; + return /(Android)/i.test(navigator.userAgent) ? location.href.split('#')[0] : window.entryUrl; } + /** * 初始化wechat(分享配置) */ diff --git a/pages/columnGoods/HotNewGoods/index.vue b/pages/columnGoods/HotNewGoods/index.vue index f16627b3..cd586455 100644 --- a/pages/columnGoods/HotNewGoods/index.vue +++ b/pages/columnGoods/HotNewGoods/index.vue @@ -6,7 +6,7 @@ indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff"> - + diff --git a/pages/goods_details/index.vue b/pages/goods_details/index.vue index 4c8f92ac..371043ee 100644 --- a/pages/goods_details/index.vue +++ b/pages/goods_details/index.vue @@ -221,7 +221,6 @@ } from '@/config/app.js'; import { getProductDetail, - getProductCode, collectAdd, collectDel, postCartAdd, @@ -229,8 +228,7 @@ getReplyConfig } from '@/api/store.js'; import { - getUserInfo, - userShare + getUserInfo } from '@/api/user.js'; import { getCoupons @@ -653,8 +651,8 @@ that.$set(that, 'storeImage', that.storeInfo.image); if (that.isLogin) { that.getCartCount(); + that.ShareInfo(); }; - this.ShareInfo(); // #endif if (that.isLogin) { that.getUserInfo(); @@ -762,7 +760,7 @@ this.$set(productAttr[i], "index", value[i]); } //sort();排序函数:数字-英文-汉字; - let productSelect = this.productValue[value.sort().join(",")]; + let productSelect = this.productValue[value.join(",")]; if (productSelect && productAttr.length) { this.$set( this.attr.productSelect, @@ -774,7 +772,7 @@ this.$set(this.attr.productSelect, "stock", productSelect.stock); this.$set(this.attr.productSelect, "unique", productSelect.id); this.$set(this.attr.productSelect, "cart_num", 1); - this.$set(this, "attrValue", value.sort().join(",")); + this.$set(this, "attrValue", value.join(",")); this.$set(this, "attrTxt", "已选择"); } else if (!productSelect && productAttr.length) { this.$set( diff --git a/pages/index/index.vue b/pages/index/index.vue index aa86702a..227fe70b 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -144,7 +144,7 @@ - {{item.title}} {{item.info}} diff --git a/pages/index/index001.vue b/pages/index/index001.vue index c3b0adb9..cdc0bbdb 100644 --- a/pages/index/index001.vue +++ b/pages/index/index001.vue @@ -249,7 +249,7 @@ - {{item.title}} {{item.info2}} diff --git a/pages/order_details/index.vue b/pages/order_details/index.vue index 01a62fc6..6033dc2e 100644 --- a/pages/order_details/index.vue +++ b/pages/order_details/index.vue @@ -164,7 +164,7 @@ - 配送方式:: + 配送方式: 送货 diff --git a/pages/user/index.vue b/pages/user/index.vue index 84079f52..c19bd888 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -15,8 +15,8 @@ {{userInfo.nickname}} - - {{userInfo.vip_name}} + + {{userInfo.vipName}} @@ -388,6 +388,7 @@ border-radius: 18px; font-size: 20rpx; margin-left: 12rpx; + margin-top: 2rpx; image { width: 27rpx; diff --git a/pages/users/goods_comment_con/index.vue b/pages/users/goods_comment_con/index.vue index 1c40c355..b35de0af 100644 --- a/pages/users/goods_comment_con/index.vue +++ b/pages/users/goods_comment_con/index.vue @@ -7,7 +7,7 @@ - {{productInfo.store_name}} + {{productInfo.storeName}} ¥{{productInfo.price}} x{{cart_num}} diff --git a/pages/users/login/index.vue b/pages/users/login/index.vue index 84e9df2d..8c921c40 100644 --- a/pages/users/login/index.vue +++ b/pages/users/login/index.vue @@ -221,8 +221,8 @@ }); const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index"; that.$Cache.clear(BACK_URL); - getUserInfo().then(res => { - that.$store.commit("SETUID", res.data.uid); + // getUserInfo().then(res => { + that.$store.commit("SETUID", res.data.user.uid); if (backUrl === '/pages/index/index' || backUrl === '/pages/order_addcart/order_addcart' || backUrl === '/pages/user/index') { @@ -235,7 +235,7 @@ url: '/pages/index/index' }); } - }) + // }) }) .catch(res => { that.$util.Tips({ diff --git a/pages/users/order_confirm/index.vue b/pages/users/order_confirm/index.vue index 54bbc70c..0151d2eb 100644 --- a/pages/users/order_confirm/index.vue +++ b/pages/users/order_confirm/index.vue @@ -61,7 +61,7 @@ 快递费用 - +¥{{priceGroup.storePostage}} + +¥{{priceGroup.storePostage}} 免运费 @@ -293,8 +293,6 @@ this.cartId = options.cartId; this.is_address = options.is_address ? true : false; this.news = options.new || true; - console.log('options.new'); - console.log(options.new); this.again = options.again || false; if (this.isLogin) { this.getaddressInfo(); @@ -572,16 +570,14 @@ let that = this; if (that.addressId) { getAddressDetail(that.addressId).then(res => { - // res.data.isDefault = parseInt(res.data.isDefault); + res.data.isDefault = parseInt(res.data.isDefault); that.addressInfo = res.data || {}; that.addressId = res.data.id || 0; that.address.addressId = res.data.id || 0; }) } else { getAddressDefault().then(res => { - // res.data.isDefault = parseInt(res.data.isDefault); - console.log('大家发挥绝代风华'); - console.log(res.data.id); + res.data.isDefault = parseInt(res.data.isDefault); that.addressInfo = res.data || {}; that.addressId = res.data.id || 0; that.address.addressId = res.data.id || 0; @@ -779,7 +775,16 @@ break; case "WECHAT_H5_PAY": //网页版公众号支付 setTimeout(() => { - location.href = jsConfig.mweb_url; + let domain = encodeURIComponent(location.href); + let urls = jsConfigAgain.h5PayUrl + '&redirect_url='+ domain; + location.href = urls; + return that.$util.Tips({ + title: '支付成功', + icon: 'success' + }, { + tab: 5, + url: goPages + }); }, 100); break; } diff --git a/pages/users/user_payment/index.vue b/pages/users/user_payment/index.vue index 494f2882..ce859812 100644 --- a/pages/users/user_payment/index.vue +++ b/pages/users/user_payment/index.vue @@ -214,33 +214,11 @@ tab: 5, url: '/pages/users/user_money/index' }); + }).catch(err=>{ + return that.$util.Tips({ + title: err + }); }) - // // #ifdef MP || APP-PLUS - // rechargeRoutine({ - // price: parseFloat(value), - // type: 1 - // }) - // // #endif - // // #ifdef H5 - // rechargeWechat({ - // price: parseFloat(value), - // from: that.from, - // type: 1 - // }) - // // #endif - // .then(res => { - // return that.$util.Tips({ - // title: '转入成功', - // icon: 'success' - // }, { - // tab: 5, - // url: '/pages/users/user_money/index' - // }); - // }).catch(err => { - // return that.$util.Tips({ - // title: err - // }) - // }); } else if (res.cancel) { return that.$util.Tips({ title: '已取消' @@ -252,7 +230,6 @@ uni.showLoading({ title: '正在支付', }) - // #ifdef MP || APP-PLUS let money = parseFloat(this.money); if (this.rechar_id == 0) { if (Number.isNaN(money)) { @@ -268,7 +245,7 @@ } else { money = this.numberPic } - + // #ifdef MP || APP-PLUS rechargeRoutine({ price: money, type: 0, @@ -294,7 +271,6 @@ }); }, fail: function(err) { - console.log(err); return that.$util.Tips({ title: '支付失败' }); @@ -314,7 +290,7 @@ // #endif // #ifdef H5 rechargeWechat({ - price: that.rechar_id == 0 ? that.money : that.numberPic, + price: money, from: that.from, rechar_id: that.rechar_id, payType: 0 @@ -353,12 +329,16 @@ }); }) .catch(function(err) { - console.log(err); return that.$util.Tips({ title: '支付失败' }); }); } + }).catch(res=>{ + uni.hideLoading(); + return that.$util.Tips({ + title: res + }); }) // #endif } diff --git a/pages/users/user_vip/index.vue b/pages/users/user_vip/index.vue index e50bdc9d..6e532aaa 100644 --- a/pages/users/user_vip/index.vue +++ b/pages/users/user_vip/index.vue @@ -29,7 +29,7 @@ - {{item.experience}} + {{item.experience}} @@ -108,7 +108,7 @@ 经验值明细 - + {{item.title}} {{item.add_time}}