diff --git a/App.vue b/App.vue
index 6290180..4304ad7 100644
--- a/App.vue
+++ b/App.vue
@@ -189,7 +189,7 @@
url: path,
});
} else {
- this.$navigateTo({
+ uni.navigateTo({
url: path,
});
}
@@ -214,7 +214,7 @@
url: `/${path}`,
});
} else {
- this.$navigateTo({
+ uni.navigateTo({
url: `/${path}`,
});
}
diff --git a/components/m-buy/goods.vue b/components/m-buy/goods.vue
index e73204f..46f1678 100644
--- a/components/m-buy/goods.vue
+++ b/components/m-buy/goods.vue
@@ -263,7 +263,7 @@
buy(data) {
API_trade.addToCart(data).then((res) => {
if (res.data.success) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/order/fillorder?way=${
data.cartType
}&addr=${""}&parentOrder=${encodeURIComponent(
@@ -314,7 +314,7 @@
API_trade.addToCart(data).then((res) => {
if (res.data.code == 200) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
this.addr.id || ""
}&parentOrder=${encodeURIComponent(JSON.stringify(this.parentOrder))}`,
diff --git a/components/m-goods-list/promotion.vue b/components/m-goods-list/promotion.vue
new file mode 100644
index 0000000..361bbcb
--- /dev/null
+++ b/components/m-goods-list/promotion.vue
@@ -0,0 +1,160 @@
+
+
+
+
+
+
+
+
+
+
+
{{ item.goodsName }}
+
+
+
+
+ ¥{{ formatPrice(item.price )[0] }} .{{
+ formatPrice(item.price )[1]
+ }}
+
+
+
+ 最低:
+ ¥{{ formatPrice(item.purchasePrice )[0] }} .{{
+ formatPrice(item.purchasePrice )[1]
+ }}
+
+
+
+
+
+
+
+ 即将恢复{{ item.originalPrice}}元
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/m-goods-list/seckill.vue b/components/m-goods-list/seckill.vue
deleted file mode 100644
index 4e7b834..0000000
--- a/components/m-goods-list/seckill.vue
+++ /dev/null
@@ -1,190 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
{{ item.goodsName }}
-
-
- ¥{{ formatPrice(item.price )[0] }} .{{
- formatPrice(item.price )[1]
- }}
-
-
-
-
- 已售 {{ item.buyCount || '0' }}
- {{ item.commentNum || '0' }}条评论
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/components/m-goods-recommend/index.vue b/components/m-goods-recommend/index.vue
index dc19323..8f60967 100644
--- a/components/m-goods-recommend/index.vue
+++ b/components/m-goods-recommend/index.vue
@@ -62,7 +62,7 @@ export default {
this.goodsList.push(...goodsList.data.result.content);
},
handleClick(item) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
});
},
diff --git a/config/api.js b/config/api.js
index e8461b2..96131ba 100644
--- a/config/api.js
+++ b/config/api.js
@@ -4,14 +4,8 @@
*/
// 开发环境
const dev = {
- // common: "https://common-api.pickmall.cn",
- // buyer: "https://buyer-api.pickmall.cn",
-
- common: "http://192.168.0.106:8890",
- buyer: "http://192.168.0.106:8888",
-
-
-
+ common: "https://common-api.pickmall.cn",
+ buyer: "https://buyer-api.pickmall.cn",
};
// 生产环境
const prod = {
diff --git a/main.js b/main.js
index 3ea0c2b..9b47071 100644
--- a/main.js
+++ b/main.js
@@ -3,7 +3,7 @@ import App from "./App";
import * as filters from "./utils/filters.js"; // global filter
import uView from "uview-ui";
import store from "./store";
-import {navigateTo} from '@/utils/navigateRoute.js'
+
/**
* 仅在h5中显示唤醒app功能
@@ -32,8 +32,6 @@ Object.keys(filters).forEach((key) => {
Vue.prototype.$store = store;
-// // 引入Vuex
-Vue.prototype.$navigateTo = navigateTo;
Vue.use(uView);
Vue.config.productionTip = false;
diff --git a/pages.json b/pages.json
index 4d1a33f..115501b 100644
--- a/pages.json
+++ b/pages.json
@@ -465,7 +465,9 @@
"pages": [ {
"path": "seckill",
"style": {
- "navigationBarTitleText": "限时抢购",
+ "navigationBarTitleText": "限时抢购",
+ "navigationStyle": "custom", // 隐藏系统导航栏
+ "navigationBarTextStyle": "white" ,
"app-plus": {
"titleNView": {
"homeButton":true
@@ -478,7 +480,8 @@
"path": "joinGroup",
"style": {
"navigationBarTitleText": "拼团活动",
- "navigationStyle": "custom", // 隐藏系统导航栏
+ "navigationStyle": "custom", // 隐藏系统导航栏
+ "navigationBarTextStyle": "white" ,
"app-plus": {
// 将回弹属性关掉
"bounce": "none"
diff --git a/pages/cart/coupon/couponCenter.vue b/pages/cart/coupon/couponCenter.vue
index 5c8e818..e8806ad 100644
--- a/pages/cart/coupon/couponCenter.vue
+++ b/pages/cart/coupon/couponCenter.vue
@@ -145,7 +145,7 @@
},
},
onNavigationBarButtonTap(e) {
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/cart/coupon/couponIntro",
});
},
diff --git a/pages/cart/coupon/myCoupon.vue b/pages/cart/coupon/myCoupon.vue
index 1d63237..ac59a4a 100644
--- a/pages/cart/coupon/myCoupon.vue
+++ b/pages/cart/coupon/myCoupon.vue
@@ -189,7 +189,7 @@ export default {
*/
useItNow(item) {
if (item.storeId && item.storeId!='0') {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/product/shopPage?id=${item.storeId}`,
});
} else {
@@ -203,7 +203,7 @@ export default {
* 优惠券详情
*/
couponDetail(item) {
- this.$navigateTo({
+ uni.navigateTo({
url:
"/pages/cart/coupon/couponDetail?item=" +
encodeURIComponent(JSON.stringify(item)),
diff --git a/pages/cart/payment/payOrder.vue b/pages/cart/payment/payOrder.vue
index 179422b..71be635 100644
--- a/pages/cart/payment/payOrder.vue
+++ b/pages/cart/payment/payOrder.vue
@@ -120,7 +120,7 @@
* 支付成功后跳转
*/
callback(paymentMethod){
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/cart/payment/success?paymentMethod=" +
paymentMethod +
"&payPrice=" +
diff --git a/pages/mine/address/add.vue b/pages/mine/address/add.vue
index 08bac21..33723f9 100644
--- a/pages/mine/address/add.vue
+++ b/pages/mine/address/add.vue
@@ -162,7 +162,7 @@ export default {
delete this.form.updateTime;
editAddress(this.form).then((res) => {
if (res.data.success) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/${beforePage.route}`,
});
}
diff --git a/pages/mine/address/address.vue b/pages/mine/address/address.vue
index 22b4feb..e025746 100644
--- a/pages/mine/address/address.vue
+++ b/pages/mine/address/address.vue
@@ -129,7 +129,7 @@ export default {
//新建。编辑地址
addAddress(id) {
if (id) {
- this.$navigateTo({
+ uni.navigateTo({
url:
"/pages/mine/address/add?id=" +
id +
@@ -138,7 +138,7 @@ export default {
"&type=order",
});
} else {
- this.$navigateTo({
+ uni.navigateTo({
url:
"/pages/mine/address/add?way=" + this.routerVal.way + "&type=order",
});
diff --git a/pages/mine/address/addressManage.vue b/pages/mine/address/addressManage.vue
index 0d70500..f28382c 100644
--- a/pages/mine/address/addressManage.vue
+++ b/pages/mine/address/addressManage.vue
@@ -86,23 +86,9 @@ export default {
* 进入页面检测当前账户是否登录
*/
onShow() {
- let that = this;
- if (this.$options.filters.isLogin("auth")) {
+ if (this.$options.filters.tipsToLogin()) {
this.getAddressList();
- } else {
- uni.showModal({
- title: "提示",
- content: "检测到您的账号还未登录,是否去登录?",
- confirmColor: this.$lightColor,
- success: function (res) {
- if (res.confirm) {
- that.$options.filters.navigateToLogin();
- } else if (res.cancel) {
- uni.navigateBack();
- }
- },
- });
- }
+ }
},
methods: {
//获取地址列表
@@ -145,7 +131,7 @@ export default {
},
//新建。编辑地址
addAddress(id) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/mine/address/add${id ? "?id=" + id : ""}`,
});
},
diff --git a/pages/mine/deposit/operation.vue b/pages/mine/deposit/operation.vue
index 8832a3b..e9c8dff 100644
--- a/pages/mine/deposit/operation.vue
+++ b/pages/mine/deposit/operation.vue
@@ -50,7 +50,7 @@ export default {
* 跳转
*/
navgition(url) {
- this.$navigateTo({
+ uni.navigateTo({
url,
});
},
diff --git a/pages/mine/deposit/recharge.vue b/pages/mine/deposit/recharge.vue
index 0d16c8e..c9272d5 100644
--- a/pages/mine/deposit/recharge.vue
+++ b/pages/mine/deposit/recharge.vue
@@ -38,7 +38,7 @@ export default {
let res = await recharge({ price: this.price });
if (res.data.success) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/cart/payment/payOrder?orderType=RECHARGE&recharge_sn=${res.data.result.rechargeSn}`,
});
}
diff --git a/pages/mine/distribution/home.vue b/pages/mine/distribution/home.vue
index e2029a9..7dda626 100644
--- a/pages/mine/distribution/home.vue
+++ b/pages/mine/distribution/home.vue
@@ -58,12 +58,12 @@ export default {
},
methods: {
handleClick(url) {
- this.$navigateTo({
+ uni.navigateTo({
url,
});
},
queryGoods(src) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/mine/distribution/${src}`,
});
},
diff --git a/pages/mine/distribution/list.vue b/pages/mine/distribution/list.vue
index 852f523..989daf3 100644
--- a/pages/mine/distribution/list.vue
+++ b/pages/mine/distribution/list.vue
@@ -221,7 +221,7 @@ export default {
* 查看图片
*/
handleNavgationGoods(val) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/product/goods?id=${val.skuId}&goodsId=${val.goodsId}`,
});
},
diff --git a/pages/mine/msgTips/main.vue b/pages/mine/msgTips/main.vue
index 6ceed10..eb383da 100644
--- a/pages/mine/msgTips/main.vue
+++ b/pages/mine/msgTips/main.vue
@@ -56,7 +56,7 @@
methods: {
...mapMutations(["logout"]),
navigateTo(url) {
- this.$navigateTo({
+ uni.navigateTo({
url
});
},
diff --git a/pages/mine/msgTips/packageMsg/index.vue b/pages/mine/msgTips/packageMsg/index.vue
index aa2df11..619cf4e 100644
--- a/pages/mine/msgTips/packageMsg/index.vue
+++ b/pages/mine/msgTips/packageMsg/index.vue
@@ -45,7 +45,7 @@ export default {
},
methods: {
goDetail(sn,logi_id,ship_no){
- this.$navigateTo({
+ uni.navigateTo({
url:'/pages/msgTips/packagemsg/logisticsDetail?order_sn=' + sn +'&logi_id='+logi_id+'&ship_no='+ship_no,
})
},
diff --git a/pages/mine/myCollect.vue b/pages/mine/myCollect.vue
index e39c4e8..18ee619 100644
--- a/pages/mine/myCollect.vue
+++ b/pages/mine/myCollect.vue
@@ -174,7 +174,7 @@
*/
goGoodsDetail(val) {
//商品详情
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/product/goods?id=" + val.skuId + "&goodsId=" + val.goodsId,
});
},
@@ -184,7 +184,7 @@
*/
goStoreMainPage(id) {
//店铺主页
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/product/shopPage?id=" + id,
});
},
diff --git a/pages/mine/myTracks.vue b/pages/mine/myTracks.vue
index c6119f1..00a130f 100644
--- a/pages/mine/myTracks.vue
+++ b/pages/mine/myTracks.vue
@@ -84,7 +84,7 @@
* 导航到店铺
*/
navgaiteToStore(val) {
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/product/shopPage?id=" + val.storeId,
});
},
@@ -100,7 +100,7 @@
* 跳转详情
*/
navgaiteToDetail(item) {
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/product/goods?id=" + item.id + "&goodsId=" + item.goodsId,
});
},
diff --git a/pages/mine/set/editionIntro.vue b/pages/mine/set/editionIntro.vue
index 63b6056..4e90bdd 100644
--- a/pages/mine/set/editionIntro.vue
+++ b/pages/mine/set/editionIntro.vue
@@ -88,7 +88,7 @@ export default {
},
navigateTo(url) {
- this.$navigateTo({
+ uni.navigateTo({
url,
});
},
diff --git a/pages/mine/set/securityCenter/securityCenter.vue b/pages/mine/set/securityCenter/securityCenter.vue
index 956a0f1..64c07f4 100644
--- a/pages/mine/set/securityCenter/securityCenter.vue
+++ b/pages/mine/set/securityCenter/securityCenter.vue
@@ -16,7 +16,7 @@ export default {
methods: {
navigateTo(url) {
- this.$navigateTo({
+ uni.navigateTo({
url: url,
});
},
diff --git a/pages/mine/set/setUp.vue b/pages/mine/set/setUp.vue
index f09afcc..df48137 100644
--- a/pages/mine/set/setUp.vue
+++ b/pages/mine/set/setUp.vue
@@ -49,7 +49,7 @@ export default {
if (url == "/pages/set/securityCenter/securityCenter") {
url += `?mobile=${this.userInfo.mobile}`;
}
- this.$navigateTo({
+ uni.navigateTo({
url: url,
});
},
diff --git a/pages/navigation/search/searchPage.vue b/pages/navigation/search/searchPage.vue
index 7b76ac6..1d9fbf0 100644
--- a/pages/navigation/search/searchPage.vue
+++ b/pages/navigation/search/searchPage.vue
@@ -488,13 +488,13 @@ export default {
},
// 跳转到商品详情
navigateToDetailPage(item) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
});
},
// 跳转地址
navigateToStoreDetailPage(item) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/product/shopPage?id=${item.content.storeId}`,
});
},
diff --git a/pages/order/afterSales/afterSales.vue b/pages/order/afterSales/afterSales.vue
index 44bc5cc..9fcdac3 100644
--- a/pages/order/afterSales/afterSales.vue
+++ b/pages/order/afterSales/afterSales.vue
@@ -352,7 +352,7 @@ export default {
* 售后详情
*/
afterDetails(order) {
- this.$navigateTo({
+ uni.navigateTo({
url: "./applyDetail?sn=" + order.sn,
});
},
@@ -395,7 +395,7 @@ export default {
...sku,
};
storage.setAfterSaleData(data);
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/order/afterSales/afterSalesSelect?sn=${sn}`,
});
},
@@ -411,7 +411,7 @@ export default {
};
storage.setAfterSaleData(data);
- this.$navigateTo({
+ uni.navigateTo({
url: `./afterSalesDetailExpress?serviceSn=${order.sn}`,
});
},
@@ -422,13 +422,13 @@ export default {
onDetail(goods, sku) {
// 售后申请
if (this.current == 0) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/product/goods?id=${sku.skuId}&goodsId=${
sku.goodsId || sku.goodsId
}`,
});
} else {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/product/goods?id=${goods.skuId}&goodsId=${
goods.goodsId || goods.goodsId
}`,
diff --git a/pages/order/afterSales/afterSalesSelect.vue b/pages/order/afterSales/afterSalesSelect.vue
index fb8e3fc..d298151 100644
--- a/pages/order/afterSales/afterSalesSelect.vue
+++ b/pages/order/afterSales/afterSalesSelect.vue
@@ -94,7 +94,7 @@ export default {
* 跳转到商品信息
*/
navigateToGoodsDetail(id) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/product/goods?id=${id}&goodsId=${goodsId}`,
});
},
diff --git a/pages/order/afterSales/applyDetail.vue b/pages/order/afterSales/applyDetail.vue
index 54fce3a..c8564d9 100644
--- a/pages/order/afterSales/applyDetail.vue
+++ b/pages/order/afterSales/applyDetail.vue
@@ -381,7 +381,7 @@ export default {
* 访问商品详情
*/
navgiateToGoodsDetail(item) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
});
},
@@ -390,7 +390,7 @@ export default {
* 进度
*/
onProgress() {
- this.$navigateTo({
+ uni.navigateTo({
url: `./applyProgress?sn=${
this.serviceDetail.sn
}&createTime=${encodeURIComponent(this.serviceDetail.createTime)}
diff --git a/pages/order/complain/complainList.vue b/pages/order/complain/complainList.vue
index 45777d9..ccdec07 100644
--- a/pages/order/complain/complainList.vue
+++ b/pages/order/complain/complainList.vue
@@ -86,7 +86,7 @@ export default {
methods: {
// 点击跳转到商品
handleToGoods(val) {
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/product/goods?id=" + val.skuId + "&goodsId=" + val.goodsId,
});
},
@@ -120,7 +120,7 @@ export default {
* 查看详情
*/
handleInfo(val) {
- this.$navigateTo({
+ uni.navigateTo({
url: "./complainInfo?id=" + val.id,
});
},
diff --git a/pages/order/evaluate/myEvaluate.vue b/pages/order/evaluate/myEvaluate.vue
index 99c5798..35dc244 100644
--- a/pages/order/evaluate/myEvaluate.vue
+++ b/pages/order/evaluate/myEvaluate.vue
@@ -219,7 +219,7 @@ export default {
*/
talkCommont(sku) {
console.log(sku);
- this.$navigateTo({
+ uni.navigateTo({
url: `./releaseEvaluate?sn=${sku.sn}&sku=${encodeURIComponent(
JSON.stringify(sku)
)}`,
@@ -270,7 +270,7 @@ export default {
* 评价详情
*/
onDetail(comment) {
- this.$navigateTo({
+ uni.navigateTo({
url:
"./evaluateDetail?comment=" +
encodeURIComponent(JSON.stringify(comment)),
diff --git a/pages/order/fillorder.vue b/pages/order/fillorder.vue
index 71aa936..e0c03a8 100644
--- a/pages/order/fillorder.vue
+++ b/pages/order/fillorder.vue
@@ -481,7 +481,7 @@ export default {
// 跳转到店铺
navigateToStore(val) {
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/product/shopPage?id=" + val.storeId,
});
},
@@ -555,7 +555,7 @@ export default {
* 跳转
*/
navigateTo(url) {
- this.$navigateTo({
+ uni.navigateTo({
url,
});
},
diff --git a/pages/order/myOrder.vue b/pages/order/myOrder.vue
index 45ac708..2d1eb1c 100644
--- a/pages/order/myOrder.vue
+++ b/pages/order/myOrder.vue
@@ -326,10 +326,10 @@ export default {
// this.loadData(this.status);
},
onShow() {
- if (!this.tabCurrentIndex) {
- this.initData(0);
- } else {
-
+ if(this.$options.filters.tipsToLogin()){
+ if (!this.tabCurrentIndex) {
+ this.initData(0);
+ }
}
// this.loadData(this.status);
},
@@ -364,14 +364,14 @@ export default {
methods: {
// 售后
applyService(order) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/order/afterSales/afterSales?orderSn=${order.sn}`,
});
},
// 店铺详情
navigateToStore(val) {
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/product/shopPage?id=" + val.storeId,
});
},
@@ -423,7 +423,7 @@ export default {
}).pay();
// #endif
// #ifndef MP-WEIXIN
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/cart/payment/payOrder?order_sn=" + val.sn,
});
// #endif
@@ -522,7 +522,7 @@ export default {
* 跳转到订单详情
*/
navigateToOrderDetail(sn) {
- this.$navigateTo({
+ uni.navigateTo({
url: "./orderDetail?sn=" + sn,
});
},
@@ -588,7 +588,7 @@ export default {
* 评价商品
*/
onComment(sn) {
- this.$navigateTo({
+ uni.navigateTo({
url: "./evaluate/myEvaluate",
});
},
@@ -599,7 +599,7 @@ export default {
reBuy(order) {
console.log(order);
return;
- this.$navigateTo({
+ uni.navigateTo({
url:
"/pages/product/goods?id=" + order.id + "&goodsId=" + order.goodsId,
});
@@ -609,7 +609,7 @@ export default {
* 查看物流
*/
navigateToLogistics(order) {
- this.$navigateTo({
+ uni.navigateTo({
url:
"/pages/mine/msgTips/packageMsg/logisticsDetail?order_sn=" + order.sn,
});
diff --git a/pages/order/orderDetail.vue b/pages/order/orderDetail.vue
index d1b2e88..4014a7e 100644
--- a/pages/order/orderDetail.vue
+++ b/pages/order/orderDetail.vue
@@ -277,7 +277,7 @@ export default {
},
methods: {
tostore(val) {
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/product/shopPage?id=" + val.storeId,
});
},
@@ -294,7 +294,7 @@ export default {
},
// #TODO 这块需要写一下 目前没有拼团的详细信息
ByUserMessage(order) {
- this.$navigateTo({
+ uni.navigateTo({
url:
"/pages/cart/payment/shareOrderGoods?sn=" +
order.sn +
@@ -318,12 +318,12 @@ export default {
});
},
onReceipt(val) {
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/order/invoice/invoiceDetail?id=" + val.id,
});
},
gotoGoodsDetail(sku) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/product/goods?id=${sku.skuId}&goodsId=${sku.goodsId}`,
});
},
@@ -363,7 +363,7 @@ export default {
* 投诉
*/
complaint(sku) {
- this.$navigateTo({
+ uni.navigateTo({
url:
"/pages/order/complain/complain?sn=" +
this.sn +
@@ -373,7 +373,7 @@ export default {
},
//售后按钮
onAfterSales(sn, sku) {
- this.$navigateTo({
+ uni.navigateTo({
url: `./afterSales/afterSalesSelect?sn=${sn}&sku=${encodeURIComponent(
JSON.stringify(sku)
)}`,
@@ -382,7 +382,7 @@ export default {
// 去支付
toPay(val) {
val.sn
- ? this.$navigateTo({
+ ? uni.navigateTo({
url: "/pages/cart/payment/payOrder?order_sn=" + val.sn,
})
: false;
@@ -459,12 +459,12 @@ export default {
},
//评价商品
onComment(sn) {
- this.$navigateTo({
+ uni.navigateTo({
url: "./evaluate/myEvaluate",
});
}, //查看物流
onLogistics(order) {
- this.$navigateTo({
+ uni.navigateTo({
url:
"/pages/mine/msgTips/packageMsg/logisticsDetail?logi_id=" +
order.logi_id +
@@ -480,7 +480,7 @@ export default {
this.reason = reason;
},
reBuy(order) {
- this.$navigateTo({
+ uni.navigateTo({
url:
"/pages/product/goods?id=" + order.id + "&goodsId=" + order.goodsId,
});
diff --git a/pages/passport/login.vue b/pages/passport/login.vue
index b2e2d5d..227da4e 100644
--- a/pages/passport/login.vue
+++ b/pages/passport/login.vue
@@ -545,7 +545,7 @@ export default {
if (user.data.result.mobile) {
whetherNavigate();
} else {
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/passport/bindUserPhone",
});
}
@@ -639,13 +639,13 @@ export default {
},
// 跳转
navigateToPrivacy(val) {
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/mine/help/tips?type=" + val,
});
console.log(val)
},
navigateToPrivacys(val){
- this.$navigateTo({
+ uni.navigateTo({
url:"/pages/mine/help/tips?type="+ val,
})
},
diff --git a/pages/product/goods.vue b/pages/product/goods.vue
index 418295a..76ac9e1 100644
--- a/pages/product/goods.vue
+++ b/pages/product/goods.vue
@@ -710,13 +710,13 @@ export default {
linkMsgDetail() {
// lili 基础客服
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/tabbar/home/web-view?IM=${this.storeDetail.storeId}`,
});
// udesk 代码
// if (this.storeDetail.merchantEuid) {
- // this.$navigateTo({
+ // uni.navigateTo({
// url: `/pages/tabbar/home/web-view?src=${this.IM}`,
// });
// }
@@ -736,7 +736,7 @@ export default {
// sign: this.storeDetail.yzfSign,
// mpSign: this.storeDetail.yzfMpSign,
// };
- // this.$navigateTo({
+ // uni.navigateTo({
// url:
// "/pages/product/customerservice/index?params=" +
// encodeURIComponent(JSON.stringify(params)),
@@ -744,7 +744,7 @@ export default {
// // #endif
// // #ifndef MP-WEIXIN
// const sign = this.storeDetail.yzfSign;
- // this.$navigateTo({
+ // uni.navigateTo({
// url:
// "/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
// sign,
@@ -908,7 +908,7 @@ export default {
* 跳转到店铺页面
*/
navigateToStore(store_id) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/product/shopPage?id=` + store_id,
});
},
diff --git a/pages/product/product/evaluation/-evaluation.vue b/pages/product/product/evaluation/-evaluation.vue
index e19c39b..27ad2fd 100644
--- a/pages/product/product/evaluation/-evaluation.vue
+++ b/pages/product/product/evaluation/-evaluation.vue
@@ -94,7 +94,7 @@ export default {
);
},
toComment(id, grade) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/product/comment?id=${id}&grade=${grade}`,
});
},
diff --git a/pages/product/product/popup/address.vue b/pages/product/product/popup/address.vue
index a2a4829..50ce0b9 100644
--- a/pages/product/product/popup/address.vue
+++ b/pages/product/product/popup/address.vue
@@ -54,7 +54,7 @@ export default {
this.getShippingAddress()
}
else{
- this.$navigateTo({
+ uni.navigateTo({
url: 'pages/passport/login'
});
}
@@ -71,7 +71,7 @@ export default {
getpicker() {
// this.$refs.cityPicker.show();
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/mine/address/add",
});
this.closeAddress();
diff --git a/pages/product/product/shop/-shop.vue b/pages/product/product/shop/-shop.vue
index 2ab359c..3220628 100644
--- a/pages/product/product/shop/-shop.vue
+++ b/pages/product/product/shop/-shop.vue
@@ -57,13 +57,13 @@ export default {
},
// 点击商品
clickGoods(val) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/product/goods?id=${val.content.id}&goodsId=${val.content.goodsId}`,
});
},
tostorePage(val) {
- this.$navigateTo({
+ uni.navigateTo({
url: "../product/shopPage?id=" + val.storeId,
});
},
diff --git a/pages/product/shopList.vue b/pages/product/shopList.vue
index 8ba4ecc..c91daa8 100644
--- a/pages/product/shopList.vue
+++ b/pages/product/shopList.vue
@@ -74,7 +74,7 @@ export default {
},
methods: {
handleClickStore(val){
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/product/shopPage?id=${val.id}`
});
},
diff --git a/pages/product/shopPage.vue b/pages/product/shopPage.vue
index f7b018b..cbceb11 100644
--- a/pages/product/shopPage.vue
+++ b/pages/product/shopPage.vue
@@ -152,7 +152,7 @@ export default {
methods: {
getStoreLicencePhoto() {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/product/licencePhoto?id=${this.storeId}`,
});
},
@@ -190,7 +190,7 @@ export default {
// sign: this.storeInfo.yzfSign,
// mpSign: this.storeInfo.yzfMpSign,
// };
- // this.$navigateTo({
+ // uni.navigateTo({
// url:
// "/pages/product/customerservice/index?params=" +
// encodeURIComponent(JSON.stringify(params)),
@@ -198,14 +198,14 @@ export default {
// // #endif
// // #ifndef MP-WEIXIN
// const sign = this.storeInfo.yzfSign;
- // this.$navigateTo({
+ // uni.navigateTo({
// url:
// "/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
// sign,
// });
// // #endif
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/tabbar/home/web-view?IM=${this.storeId}`,
});
},
@@ -227,7 +227,7 @@ export default {
/**商品分类中商品集合 */
getCategoryGoodsList(val) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/product/shopPageGoods?title=${val.labelName}&id=${val.id}&storeId=${this.storeId}`,
});
},
@@ -237,7 +237,7 @@ export default {
*/
search() {
console.log("点击")
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/navigation/search/searchPage?storeId=${this.storeId}&keyword=${this.keyword}`,
});
},
diff --git a/pages/promotion/bargain/detail.vue b/pages/promotion/bargain/detail.vue
index 52cf0dc..185407d 100644
--- a/pages/promotion/bargain/detail.vue
+++ b/pages/promotion/bargain/detail.vue
@@ -3,7 +3,7 @@
-
+
@@ -106,10 +106,6 @@
-
-
-
-
@@ -352,11 +348,11 @@ page {
align-items: center;
padding: 10rpx 0;
}
-.wrapper {
- background: url("https://lilishop-oss.oss-cn-beijing.aliyuncs.com/aac88f4e8eff452a8010af42c4560b04.png");
+.wrapper-box {
+ background: url("https://lili-system.oss-cn-beijing.aliyuncs.com/kanjia.png");
background-repeat: no-repeat;
background-size: 100% 100%;
- height: 700rpx;
+ height: 506rpx;
width: 100%;
}
@@ -371,16 +367,16 @@ page {
}
}
.box1 {
- top: 750rpx;
+ top: 560rpx;
}
.box2 {
- top: 770rpx;
+ top: 580rpx;
}
.box3 {
- top: 790rpx;
+ top: 600rpx;
}
.box4 {
- top: 810rpx;
+ top: 620 rpx;
height: 200rpx;
}
.bargain-item {
diff --git a/pages/promotion/bargain/list.vue b/pages/promotion/bargain/list.vue
index b80f856..d553050 100644
--- a/pages/promotion/bargain/list.vue
+++ b/pages/promotion/bargain/list.vue
@@ -6,22 +6,7 @@
-
-
-
-
-
-
-
- {{item.goodsName}}
-
-
-
最低:¥{{item.purchasePrice | unitPrice}}
-
参与砍价
-
-
-
-
+
@@ -32,7 +17,9 @@
diff --git a/pages/promotion/lives.vue b/pages/promotion/lives.vue
index eeedaad..bd0a728 100644
--- a/pages/promotion/lives.vue
+++ b/pages/promotion/lives.vue
@@ -229,7 +229,7 @@ export default {
let customParams = encodeURIComponent(
JSON.stringify({ path: "pages/index/index", pid: 1 })
); // 开发者在直播间页面路径上携带自定义参数,后续可以在分享卡片链接和跳转至商详页时获取,详见【获取自定义参数】、【直播间到商详页面携带参数】章节(上限600个字符,超过部分会被截断)
- this.$navigateTo({
+ uni.navigateTo({
url:
"plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=" +
roomId +
diff --git a/pages/promotion/point/pointList.vue b/pages/promotion/point/pointList.vue
index c34799a..59ddfd6 100644
--- a/pages/promotion/point/pointList.vue
+++ b/pages/promotion/point/pointList.vue
@@ -23,8 +23,8 @@
{{ item.goodsName }}
-
- {{ item.points }}积分
+
+ {{ item.points }}积分
¥{{ item.originalPrice | unitPrice }}
@@ -137,14 +137,14 @@ export default {
methods: {
// 跳转
navigateTo(url) {
- this.$navigateTo({
+ uni.navigateTo({
url,
});
},
toGoods(item) {
//跳转详情
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/promotion/point/detail?id=${item.id}`,
});
},
@@ -194,46 +194,12 @@ page {
height: 100%;
}
.tipsMkt {
- float: right;
color: #c0c4cc;
- font-size: 24rpx;
+ font-size: 24rpx !important;
text-decoration: line-through;
- margin-right: 20rpx;
+ margin-right: 20rpx !important;
}
-.header {
- background: $light-color;
- position: relative;
- color: #fff;
- display: flex;
- height: 80rpx;
- align-items: center;
- justify-content: center;
- font-size: 26rpx;
- font-size: 34rpx;
-
- .left,
- .right {
- position: absolute;
- width: max-content;
- height: max-content;
- top: 0;
- bottom: 0;
- margin: auto;
- }
-
- .left {
- float: left;
- top: 0;
- bottom: 0;
- left: 20rpx;
- }
-
- .right {
- float: right;
- right: 20rpx;
- }
-}
.index {
height: 100vh;
@@ -341,15 +307,19 @@ page {
overflow: hidden;
}
-.index-item-title-desc {
- font-size: 25rpx;
- color: #999999;
- margin-top: 10rpx;
-}
+
.index-item-price {
font-size: 28rpx;
- color: #ff5a10;
+ overflow: hidden;
+ color: $main-color;
padding: 20rpx 0 0 20rpx;
+ >.point{
+ >span{
+ font-size: 42rpx;
+ font-weight: bold;
+ margin-right:10rpx;
+ }
+ }
}
diff --git a/pages/promotion/seckill.vue b/pages/promotion/seckill.vue
index 2f5a527..5d1566b 100644
--- a/pages/promotion/seckill.vue
+++ b/pages/promotion/seckill.vue
@@ -1,7 +1,8 @@
-
-
-
+
+
+
@@ -14,10 +15,7 @@
-
- {{ timeLine[nav].distanceStartTime === 0 ? (onlyOne ? '距结束' : '距下一轮') : '距开始' }}
- {{ times.hours == '00' ? '0' : times.hours }}小时{{ times.minutes }}分{{ times.seconds }}秒
-
+
@@ -39,7 +37,7 @@
getSeckillTimeGoods
} from "@/api/promotions.js";
import Foundation from "@/utils/Foundation.js";
- import goodsTemplate from '@/components/m-goods-list/seckill.vue'
+ import goodsTemplate from '@/components/m-goods-list/promotion.vue'
export default {
components: {
goodsTemplate
@@ -184,10 +182,15 @@
}
}
- .sale-head {
- image {
- width: 100%;
- height: 280rpx;
+ .header-wraper {
+ background: url('/static/bg.png');
+ height: 200rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ >image{
+ width: 300rpx;
+ height: 100rpx;
}
}
@@ -195,22 +198,8 @@
padding-top: 20rpx;
}
- .trailer {
- height: 100rpx;
- background: #ffffff;
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 22rpx;
- color: #666666;
- box-sizing: border-box;
- position: relative;
- z-index: 0;
- }
-
- .index-navs {
+ .index-navs {
+ background: #fff;
background-color: #f7f7f7;
display: -webkit-box;
display: -webkit-flex;
@@ -240,24 +229,26 @@
color: #bababa;
height: 115rpx;
line-height: 1em;
- position: relative;
+ position: relative;
+ font-size: 32rpx;
+ font-weight: bold;
&-active {
- background-image: url(/static/seckill/active.png);
- background-size: 100% 115rpx;
- background-repeat: no-repeat;
- color: #ffffff;
+ color: $main-color;
position: relative;
- z-index: 30;
-
+ z-index: 30;
.index-nav-desc {
- color: #ffffff;
+ color: #fff;
+ font-weight: bold;
+ background: $main-color;
+ padding: 6rpx 16rpx;
+ border-radius: 50px;
}
}
}
.index-nav-desc {
- margin-top: 8rpx;
+ margin-top: 8rpx;
font-size: 22rpx;
color: #bababa;
}
diff --git a/pages/tabbar/cart/cartList.vue b/pages/tabbar/cart/cartList.vue
index 097c700..0842a42 100644
--- a/pages/tabbar/cart/cartList.vue
+++ b/pages/tabbar/cart/cartList.vue
@@ -343,7 +343,7 @@ export default {
* 跳转到店铺
*/
navigateToStore(val) {
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/product/shopPage?id=" + val.storeId,
});
},
@@ -352,7 +352,7 @@ export default {
* 跳转到优惠券
*/
navigateToConpon(val) {
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/cart/coupon/couponCenter?storeId=" + val.storeId,
});
},
@@ -361,7 +361,7 @@ export default {
* 跳转到商品
*/
navigateToGoods(val) {
- this.$navigateTo({
+ uni.navigateTo({
url:
"/pages/product/goods?id=" +
val.goodsSku.id +
@@ -437,7 +437,7 @@ export default {
* 跳转
*/
navigateTo(url) {
- this.$navigateTo({
+ uni.navigateTo({
url,
});
},
diff --git a/pages/tabbar/category/category.vue b/pages/tabbar/category/category.vue
index 2eb7f92..4c7feeb 100644
--- a/pages/tabbar/category/category.vue
+++ b/pages/tabbar/category/category.vue
@@ -57,7 +57,7 @@ export default {
* 查询
*/
search() {
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/navigation/search/searchPage",
});
},
@@ -90,7 +90,7 @@ export default {
},
navigateToList(sid, tid) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/navigation/search/searchPage?category=${tid}`,
});
},
diff --git a/pages/tabbar/home/template/tpl_goods.vue b/pages/tabbar/home/template/tpl_goods.vue
index 57e6acc..5bcc728 100644
--- a/pages/tabbar/home/template/tpl_goods.vue
+++ b/pages/tabbar/home/template/tpl_goods.vue
@@ -24,7 +24,9 @@
{{ item.title }}
-
¥{{ item.price | unitPrice }}
+
¥{{ formatPrice(item.price )[0] }} .{{
+ formatPrice(item.price )[1]
+ }}
@@ -56,8 +58,15 @@ export default {
},
mounted() {},
methods: {
+ // 格式化金钱 1999 --> [1999,00]
+ formatPrice(val) {
+ if (typeof val == "undefined") {
+ return val;
+ }
+ return val.toFixed(2).split(".");
+ },
handleClick(item) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
});
},
@@ -163,13 +172,11 @@ $w_94: 94%;
> .goods-price {
line-height: 2;
color: $main-color;
+ >span{
+ font-size: 42rpx;
+ }
}
}
}
-.goods-icon {
- right: 10rpx;
- top: 10rpx;
- position: absolute;
-}
diff --git a/pages/tabbar/home/template/tpl_promotions_detail.vue b/pages/tabbar/home/template/tpl_promotions_detail.vue
index 7b411a8..bc146cc 100644
--- a/pages/tabbar/home/template/tpl_promotions_detail.vue
+++ b/pages/tabbar/home/template/tpl_promotions_detail.vue
@@ -147,22 +147,22 @@ export default {
goToDetail(type) {
switch(type) {
case "SECKILL":
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/promotion/seckill`,
});
break;
case "PINTUAN":
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/promotion/joinGroup`,
});
break;
case "LIVE":
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/promotion/lives`,
});
break;
case "KANJIA":
- this.$navigateTo({
+ uni.navigateTo({
url: `/pages/promotion/bargain/list`,
});
break;
diff --git a/pages/tabbar/home/template/tpl_search.vue b/pages/tabbar/home/template/tpl_search.vue
index ac3bcd6..2bbc598 100644
--- a/pages/tabbar/home/template/tpl_search.vue
+++ b/pages/tabbar/home/template/tpl_search.vue
@@ -12,7 +12,7 @@ export default {
props: ["res"],
methods: {
handleSearch() {
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/navigation/search/searchPage",
});
},
diff --git a/pages/tabbar/home/views.vue b/pages/tabbar/home/views.vue
index 4c4ef73..39c7e6d 100644
--- a/pages/tabbar/home/views.vue
+++ b/pages/tabbar/home/views.vue
@@ -150,18 +150,18 @@ export default {
// WX_CODE 为小程序码
if (res.scanType == "WX_CODE") {
console.log(res);
- this.$navigateTo({
+ uni.navigateTo({
url: `/${res.path}`,
});
} else {
config.scanAuthNavigation.forEach((src) => {
if (res.result.indexOf(src) != -1) {
- this.$navigateTo({
+ uni.navigateTo({
url: `/${res.result.substring(src.length)}`,
});
} else {
setTimeout(() => {
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/tabbar/home/web-view?src=" + path,
});
}, 100);
diff --git a/pages/tabbar/screen/fullScreen.vue b/pages/tabbar/screen/fullScreen.vue
index 0aeda05..f089fa2 100644
--- a/pages/tabbar/screen/fullScreen.vue
+++ b/pages/tabbar/screen/fullScreen.vue
@@ -45,14 +45,14 @@ export default {
// },
methods: {
gotoLink() {
- this.$navigateTo({
+ uni.navigateTo({
//点击跳转到浏览器
url:
"/pages/tabbar/home/web-view?src=https://pc-b2b2c.pickmall.cn/article/detail?id=1371992704333905920",
});
},
gotoB() {
- this.$navigateTo({
+ uni.navigateTo({
url:
"/pages/tabbar/home/web-view?src=https://pc-b2b2c.pickmall.cn/article/detail?id=1371779927900160000",
});
diff --git a/pages/tabbar/user/my.vue b/pages/tabbar/user/my.vue
index 4553e1d..ce2cb3f 100644
--- a/pages/tabbar/user/my.vue
+++ b/pages/tabbar/user/my.vue
@@ -122,7 +122,7 @@ export default {
* navigator标签现在默认没有转场动画,所以用view
*/
navigateTo(url) {
- this.$navigateTo({
+ uni.navigateTo({
url,
});
},
diff --git a/pages/tabbar/user/similarGoods.vue b/pages/tabbar/user/similarGoods.vue
index da7ff9c..b182475 100644
--- a/pages/tabbar/user/similarGoods.vue
+++ b/pages/tabbar/user/similarGoods.vue
@@ -73,7 +73,7 @@
})
},
goDetail(item) {
- this.$navigateTo({
+ uni.navigateTo({
url: '/pages/product/goods?id=' + item.content.id + "&goodsId=" +item.content.goodsId
})
},
diff --git a/pages/tabbar/user/utils/tool.vue b/pages/tabbar/user/utils/tool.vue
index f29e323..1e93b1b 100644
--- a/pages/tabbar/user/utils/tool.vue
+++ b/pages/tabbar/user/utils/tool.vue
@@ -69,7 +69,7 @@ import { distribution } from "@/api/goods";
export default {
methods: {
navigateTo(url) {
- this.$navigateTo({
+ uni.navigateTo({
url,
});
},
@@ -78,11 +78,11 @@ export default {
if (res.data.result) {
let type = res.data.result.distributionStatus;
if (type == "PASS") {
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/mine/distribution/home",
});
} else if (type == "REFUSE") {
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/mine/distribution/auth",
});
} else if (type == "RETREAT") {
@@ -106,7 +106,7 @@ export default {
});
} else {
// 没有资格申请 先去实名认证
- this.$navigateTo({
+ uni.navigateTo({
url: "/pages/mine/distribution/auth",
});
}
diff --git a/static/bg.png b/static/bg.png
new file mode 100644
index 0000000..d5c2b11
Binary files /dev/null and b/static/bg.png differ
diff --git a/static/bg1.png b/static/bg1.png
new file mode 100644
index 0000000..f2e5b72
Binary files /dev/null and b/static/bg1.png differ
diff --git a/static/join-buy.png b/static/join-buy.png
new file mode 100644
index 0000000..5928d53
Binary files /dev/null and b/static/join-buy.png differ
diff --git a/static/seckill.png b/static/seckill.png
new file mode 100644
index 0000000..795cb1c
Binary files /dev/null and b/static/seckill.png differ
diff --git a/static/seckill/active.png b/static/seckill/active.png
deleted file mode 100644
index f5293e0..0000000
Binary files a/static/seckill/active.png and /dev/null differ
diff --git a/uni.scss b/uni.scss
index 20c6fca..c8a7b34 100644
--- a/uni.scss
+++ b/uni.scss
@@ -149,6 +149,9 @@ $font-weight: 400;
}
.flex-a-c{
align-items: center;
+}
+.flex-j-sb{
+ justify-content: space-between;
}
.relative {
position: relative;
diff --git a/utils/filters.js b/utils/filters.js
index 312ae57..9635a05 100644
--- a/utils/filters.js
+++ b/utils/filters.js
@@ -1,5 +1,7 @@
import Foundation from "./Foundation.js";
import storage from "@/utils/storage.js";
+import { getUserInfo } from '@/api/members';
+import Vue from "vue";
/**
* 金钱单位置换 2999 --> 2,999.00
* @param val
@@ -99,12 +101,46 @@ export function clearStrComma(str) {
export function isLogin(val) {
let userInfo = storage.getUserInfo();
if (val == "auth") {
- return userInfo.id ? true : false;
+ return userInfo && userInfo.id ? true : false;
} else {
return storage.getUserInfo();
}
}
+
+export function tipsToLogin(){
+if(!isLogin('auth')){
+ uni.showModal({
+ title: "提示",
+ content: "当前用户未登录是否登录?",
+ confirmText: "确定",
+ cancelText: "取消",
+ confirmColor:Vue.prototype.$mainColor,
+ success: res => {
+ if (res.confirm) {
+ navigateToLogin()
+ } else if (res.cancel) {
+ uni.navigateBack()
+ }
+ },
+ })
+ return
+ }
+}
+
+
+
+/**
+ * 获取用户信息并重新添加到缓存里面
+ */
+export async function userInfo(){
+ let res = await getUserInfo();
+ if(res.data.success){
+ storage.setUserInfo(res.data.result);
+ return res.data.result
+ }
+}
+
/**
* 验证是否登录如果没登录则去登录
* @param {*} val
@@ -113,7 +149,7 @@ export function isLogin(val) {
export function forceLogin() {
let userInfo = storage.getUserInfo();
- if (!userInfo.id) {
+ if (!userInfo || !userInfo.id) {
// #ifdef MP-WEIXIN
uni.navigateTo({
diff --git a/utils/navigateRoute.js b/utils/navigateRoute.js
deleted file mode 100644
index 71df628..0000000
--- a/utils/navigateRoute.js
+++ /dev/null
@@ -1,24 +0,0 @@
-export function navigateTo({url}) {
- // #ifdef MP-WEIXIN
- //判断当前页面栈的长度
- if (getCurrentPages().length >= 8) {
- //超过八层的时候跳转销毁当前页面,十层的时候手机应该会很卡;
- uni.redirectTo({
- url: url,
- success: function (res) {},
- fail: function (res) {},
- complete: function (res) {},
- });
- } else {
- uni.navigateTo({
- url: url,
- });
- }
- // #endif
-
- // #ifndef MP-WEIXIN
- uni.navigateTo({
- url: url,
- });
- // #endif
-}
diff --git a/utils/request.js b/utils/request.js
index e7b0ccc..4e10df5 100644
--- a/utils/request.js
+++ b/utils/request.js
@@ -1,194 +1,206 @@
-import Request from "@/lib/request/index.js";
-import { refreshTokenFn } from "@/api/login.js";
-import storage from "@/utils/storage.js";
-import { md5 } from "@/utils/md5.js";
-import Foundation from "@/utils/Foundation.js";
-import api from "@/config/api.js";
-
-import uuid from "@/utils/uuid.modified.js";
-
-
-let isNavigateTo = false
-
-function cleanStorage() {
- uni.showToast({
- title: "你的登录状态已过期,请重新登录",
- icon: "none",
- duration: 1500,
- });
- if (uni.showLoading()) {
- uni.hideLoading();
- }
-
- storage.setHasLogin(false);
- storage.setAccessToken("");
- storage.setRefreshToken("");
- console.log("清空token");
- storage.setUuid("");
- storage.setUserInfo({});
-
-
- if(!isNavigateTo){
- isNavigateTo= true
- // 防抖处理跳转
- // #ifdef MP-WEIXIN
- uni.navigateTo({
- url: "/pages/passport/wechatMPLogin",
- });
- // #endif
- // #ifndef MP-WEIXIN
- uni.navigateTo({
- url: "/pages/passport/login",
- });
- // #endif
- }
-}
-
-let http = new Request();
-
-
-http.setConfig((config) => {
- // 没有uuid创建
- if (!storage.getUuid()) {
- storage.setUuid(uuid.v1());
- }
-
- /* 设置全局配置 */
- config.baseURL = api.buyer;
- config.header = {
- ...config.header,
- };
- config.validateStatus = (statusCode) => {
- // 不论什么状态,统一在正确中处理
- return true;
- };
- return config;
-});
-
-http.interceptors.request.use(
- (config) => {
- /* 请求之前拦截器。可以使用async await 做异步操作 */
- let accessToken = storage.getAccessToken();
- if (accessToken) {
- const nonce = Foundation.randomString(6);
- const timestamp = parseInt(new Date().getTime() / 1000);
- const sign = md5(nonce + timestamp + accessToken);
- const _params = {
- nonce,
- timestamp,
- sign,
- };
- let params = config.params || {};
- params = { ...params, ..._params };
-
- config.params = params;
- config.header.accessToken = accessToken;
-
-
- }
- config.header = {
- ...config.header,
- uuid: storage.getUuid() || uuid.v1(),
- };
- return config;
- },
- (config) => {
- return Promise.reject(config);
- }
-);
-
-
-// 是否正在刷新的标记
-let isRefreshing = false;
-//重试队列
-let requests = [];
-// 必须使用异步函数,注意
-http.interceptors.response.use(
- async (response) => {
- isNavigateTo = false
- /* 请求之后拦截器。可以使用async await 做异步操作 */
- // token存在并且token过期
- // if (isRefreshing && response.statusCode === 403) {
- // cleanStorage();
- // isRefreshing = false;
- // }
-
- let token = storage.getAccessToken();
- if (
- (token && response.statusCode === 403) ||
- response.data.status === 403
- ) {
- if (!isRefreshing) {
- console.log('旧token',token)
- isRefreshing = true;
- storage.setAccessToken('')
- let oldRefreshToken = storage.getRefreshToken();
- //调用刷新token的接口
- return refreshTokenFn(oldRefreshToken)
- .then((res) => {
- let { accessToken, refreshToken } = res.data.result;
- storage.setAccessToken(accessToken);
- storage.setRefreshToken(refreshToken);
-
- response.header.accessToken = `${accessToken}`;
- // token 刷新后将数组的方法重新执行
- console.log('接口队列',requests,'新token',accessToken)
- requests.forEach((cb) => cb(accessToken));
- requests = []; // 重新请求完清空
- return http.request(response.config);
- })
- .catch((err) => {
- console.log('刷新token报错'+oldRefreshToken,err)
- cleanStorage();
- return Promise.reject(err);
- })
- .finally(() => {
- isRefreshing = false;
- });
- } else {
- // 返回未执行 resolve 的 Promise
- return new Promise((resolve) => {
- // 用函数形式将 resolve 存入,等待刷新后再执行
- requests.push((token) => {
- response.header.accessToken = `${token}`;
- resolve(http.request(response.config));
- });
- });
- }
-
- // 如果当前返回没登录
- } else if (
- (!token && !storage.getRefreshToken() && response.statusCode === 403) ||
- response.data.code === 403
- ) {
- console.log('没有token 以及刷新token 内容',token,storage.getRefreshToken())
- cleanStorage();
-
- // 如果当前状态码为正常但是success为不正常时
- } else if (
- (response.statusCode == 200 && !response.data.success) ||
- response.statusCode == 400
- ) {
- if (response.data.message) {
- uni.showToast({
- title: response.data.message,
- icon: "none",
- duration: 1500,
- });
- }
- }
- return response;
- },
- (error) => {
- return error;
- }
-);
-
-export { http };
-
-export const Method = {
- GET: "GET",
- POST: "POST",
- PUT: "PUT",
- DELETE: "DELETE",
+import Request from "@/lib/request/index.js";
+import {
+ refreshTokenFn
+} from "@/api/login.js";
+import storage from "@/utils/storage.js";
+import {
+ md5
+} from "@/utils/md5.js";
+import Foundation from "@/utils/Foundation.js";
+import api from "@/config/api.js";
+
+import uuid from "@/utils/uuid.modified.js";
+
+
+let isNavigateTo = false
+
+function cleanStorage() {
+ uni.showToast({
+ title: "你的登录状态已过期,请重新登录",
+ icon: "none",
+ duration: 1500,
+ });
+ if (uni.showLoading()) {
+ uni.hideLoading();
+ }
+
+ storage.setHasLogin(false);
+ storage.setAccessToken("");
+ storage.setRefreshToken("");
+ console.log("清空token");
+ storage.setUuid("");
+ storage.setUserInfo({});
+
+
+ if (!isNavigateTo) {
+ isNavigateTo = true
+ // 防抖处理跳转
+ // #ifdef MP-WEIXIN
+ uni.navigateTo({
+ url: "/pages/passport/wechatMPLogin",
+ });
+ // #endif
+ // #ifndef MP-WEIXIN
+ uni.navigateTo({
+ url: "/pages/passport/login",
+ });
+ // #endif
+ }
+}
+
+let http = new Request();
+
+
+http.setConfig((config) => {
+ // 没有uuid创建
+ if (!storage.getUuid()) {
+ storage.setUuid(uuid.v1());
+ }
+
+ /* 设置全局配置 */
+ config.baseURL = api.buyer;
+ config.header = {
+ ...config.header,
+ };
+ config.validateStatus = (statusCode) => {
+ // 不论什么状态,统一在正确中处理
+ return true;
+ };
+ return config;
+});
+
+http.interceptors.request.use(
+ (config) => {
+ /* 请求之前拦截器。可以使用async await 做异步操作 */
+ let accessToken = storage.getAccessToken();
+ if (accessToken) {
+ const nonce = Foundation.randomString(6);
+ const timestamp = parseInt(new Date().getTime() / 1000);
+ const sign = md5(nonce + timestamp + accessToken);
+ const _params = {
+ nonce,
+ timestamp,
+ sign,
+ };
+ let params = config.params || {};
+ params = {
+ ...params,
+ ..._params
+ };
+
+ config.params = params;
+ config.header.accessToken = accessToken;
+
+
+ }
+ config.header = {
+ ...config.header,
+ uuid: storage.getUuid() || uuid.v1(),
+ };
+ return config;
+ },
+ (config) => {
+ return Promise.reject(config);
+ }
+);
+
+
+// 是否正在刷新的标记
+let isRefreshing = false;
+//重试队列
+let requests = [];
+// 必须使用异步函数,注意
+http.interceptors.response.use(
+ async (response) => {
+ isNavigateTo = false
+ /* 请求之后拦截器。可以使用async await 做异步操作 */
+ // token存在并且token过期
+ // if (isRefreshing && response.statusCode === 403) {
+ // cleanStorage();
+ // isRefreshing = false;
+ // }
+
+ let token = storage.getAccessToken();
+ if (
+ (token && response.statusCode === 403) ||
+ response.data.status === 403
+ ) {
+ if (!isRefreshing) {
+ console.log('旧token', token)
+ isRefreshing = true;
+ storage.setAccessToken('')
+ let oldRefreshToken = storage.getRefreshToken();
+ //调用刷新token的接口
+ return refreshTokenFn(oldRefreshToken)
+ .then((res) => {
+ let {
+ accessToken,
+ refreshToken
+ } = res.data.result;
+ storage.setAccessToken(accessToken);
+ storage.setRefreshToken(refreshToken);
+
+ response.header.accessToken = `${accessToken}`;
+ // token 刷新后将数组的方法重新执行
+ console.log('接口队列', requests, '新token', accessToken)
+ requests.forEach((cb) => cb(accessToken));
+ requests = []; // 重新请求完清空
+ return http.request(response.config);
+ })
+ .catch((err) => {
+ console.log('刷新token报错' + oldRefreshToken, err)
+ cleanStorage();
+ return Promise.reject(err);
+ })
+ .finally(() => {
+ isRefreshing = false;
+ });
+ } else {
+ // 返回未执行 resolve 的 Promise
+ return new Promise((resolve) => {
+ // 用函数形式将 resolve 存入,等待刷新后再执行
+ requests.push((token) => {
+ response.header.accessToken = `${token}`;
+ resolve(http.request(response.config));
+ });
+ });
+ }
+
+ // 如果当前返回没登录
+ } else if (
+ (!token && !storage.getRefreshToken() && response.statusCode === 403) ||
+ response.data.code === 403
+ ) {
+ console.log('没有token 以及刷新token 内容', token, storage.getRefreshToken())
+ cleanStorage();
+
+ // 如果当前状态码为正常但是success为不正常时
+ } else if (
+ (response.statusCode == 200 && !response.data.success) ||
+ response.statusCode == 400
+ ) {
+ if (response.data.message) {
+ uni.showToast({
+ title: response.data.message,
+ icon: "none",
+ duration: 1500,
+ });
+ }
+ }
+ return response;
+ },
+ (error) => {
+ return error;
+ }
+);
+
+export {
+ http
+};
+
+export const Method = {
+ GET: "GET",
+ POST: "POST",
+ PUT: "PUT",
+ DELETE: "DELETE",
};
diff --git a/uview-ui/components/u-parse/libs/trees.vue b/uview-ui/components/u-parse/libs/trees.vue
index a216649..0d6bac4 100644
--- a/uview-ui/components/u-parse/libs/trees.vue
+++ b/uview-ui/components/u-parse/libs/trees.vue
@@ -215,7 +215,7 @@
if (jump) {
// #ifdef MP
if (attrs['app-id']) {
- return this.$navigateToMiniProgram({
+ return uni.navigateToMiniProgram({
appId: attrs['app-id'],
path: attrs.path
})
@@ -241,7 +241,7 @@
})
// #endif
} else
- this.$navigateTo({
+ uni.navigateTo({
url: attrs.href,
fail() {
uni.switchTab({
diff --git a/uview-ui/components/u-parse/u-parse.vue b/uview-ui/components/u-parse/u-parse.vue
index 815a038..ec70d7c 100644
--- a/uview-ui/components/u-parse/u-parse.vue
+++ b/uview-ui/components/u-parse/u-parse.vue
@@ -331,7 +331,7 @@
} else if (href.indexOf('http') == 0 || href.indexOf('//') == 0)
return true;
else
- this.$navigateTo({
+ uni.navigateTo({
url: href
})
}
@@ -578,7 +578,7 @@
} else if (href.includes('://'))
plus.runtime.openWeb(href);
else
- this.$navigateTo({
+ uni.navigateTo({
url: href
})
}
diff --git a/uview-ui/components/u-toast/u-toast.vue b/uview-ui/components/u-toast/u-toast.vue
index 72ebd4a..6aad463 100644
--- a/uview-ui/components/u-toast/u-toast.vue
+++ b/uview-ui/components/u-toast/u-toast.vue
@@ -114,7 +114,7 @@
url: this.config.url
});
} else {
- this.$navigateTo({
+ uni.navigateTo({
url: this.config.url
});
}