From 1489deb6180a642284944eb56a52f5de1c9ab137 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?lemon=E6=A9=AA?= <17633066053@163.com>
Date: Tue, 22 Jun 2021 18:12:35 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A7=BB=E5=8A=A8=E7=AB=AF?=
=?UTF-8?q?=E6=8E=88=E6=9D=83=E7=99=BB=E5=BD=95bug,=E6=B2=A1=E6=9C=89?=
=?UTF-8?q?=E5=B1=95=E7=A4=BA=E8=87=AA=E8=90=A5=E6=A0=87=E5=BF=97=EF=BC=8C?=
=?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=96=B0=E5=A2=9E=E5=95=86=E5=93=81=E8=AF=A6?=
=?UTF-8?q?=E6=83=85=20=E8=87=AA=E8=90=A5=E4=BB=A5=E5=8F=8A=E5=95=86?=
=?UTF-8?q?=E5=93=81=E6=95=B0=E9=87=8F=E6=94=B6=E8=97=8F=E6=95=B0=E9=87=8F?=
=?UTF-8?q?=E5=B1=95=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 5 +-
config/api.js | 8 +-
pages.json | 4 +-
pages/navigation/search/searchPage.vue | 12 +-
pages/passport/onClickLogin.vue | 6 +-
pages/passport/wechatMPLogin.vue | 426 +++++++++++++------------
pages/product/goods.vue | 5 +
pages/product/product/shop/-shop.vue | 53 ++-
pages/product/shopPage.vue | 7 +-
pages/tabbar/cart/cartList.vue | 6 +
pages/tabbar/category/category.vue | 10 +-
pages/tabbar/home/views.vue | 10 +-
utils/Foundation.js | 28 +-
13 files changed, 324 insertions(+), 256 deletions(-)
diff --git a/App.vue b/App.vue
index ab1f660..8a71a42 100644
--- a/App.vue
+++ b/App.vue
@@ -51,8 +51,8 @@ export default {
onLaunch: function () {
// #ifdef APP-PLUS
this.checkArguments(); // 检测启动参数
- APPUpdate();
-
+ APPUpdate();
+
// 重点是以下: 一定要监听后台恢复 !一定要
plus.globalEvent.addEventListener("newintent", (e) => {
this.checkArguments(); // 检测启动参数
@@ -65,7 +65,6 @@ export default {
this.getClipboard();
// #endif
},
-
methods: {
// TODO 开屏广告 后续优化添加
launch() {
diff --git a/config/api.js b/config/api.js
index d5568e5..2bf60da 100644
--- a/config/api.js
+++ b/config/api.js
@@ -4,10 +4,10 @@
*/
// 开发环境
const dev = {
- common: "http://192.168.0.100:8890",
- buyer: "http://192.168.0.100:8888",
- // common: "https://common-api.pickmall.cn",
- // buyer: "https://buyer-api.pickmall.cn",
+ // common: "http://192.168.0.100:8890",
+ // buyer: "http://192.168.0.100:8888",
+ common: "https://common-api.pickmall.cn",
+ buyer: "https://buyer-api.pickmall.cn",
};
// 生产环境
const prod = {
diff --git a/pages.json b/pages.json
index 96517d0..676b6da 100644
--- a/pages.json
+++ b/pages.json
@@ -408,7 +408,9 @@
{
"path": "wechatMPLogin",
"style": {
- "navigationBarTitleText": "小程序登录"
+ "navigationBarTitleText": "小程序登录",
+ "navigationStyle": "custom",
+ "navigationBarTextStyle": "black"
}
}
]
diff --git a/pages/navigation/search/searchPage.vue b/pages/navigation/search/searchPage.vue
index 35d4133..ff405d2 100644
--- a/pages/navigation/search/searchPage.vue
+++ b/pages/navigation/search/searchPage.vue
@@ -179,7 +179,7 @@
-
+
{{ item.storeName || "暂无" }}
@@ -314,7 +314,7 @@ export default {
isSWitch: false,
params: {
- pageNumber: 0,
+ pageNumber: 1,
pageSize: 10,
// sort: 'grade_asc',
sort: "releaseTime",
@@ -324,7 +324,7 @@ export default {
minPrice: "",
maxPrice: "",
sortParams: {
- pageNumber: 0,
+ pageNumber: 1,
pageSize: 10,
// price: "", //价格,示例值(10_30)
@@ -474,7 +474,7 @@ export default {
this.minPrice = "";
this.maxPrice = "";
this.params = {
- pageNumber: 0,
+ pageNumber: 1,
pageSize: 10,
};
this.loadData();
@@ -545,7 +545,7 @@ export default {
},
tabClick(index, type) {
- this.params.pageNumber = 0;
+ this.params.pageNumber = 1;
this.params.pageSize = 10;
// this.params.order = "desc";
if (this.params.sort == type) {
@@ -687,7 +687,7 @@ export default {
this.isShowSeachGoods = true;
this.$refs.mSearch.isShowSeachGoods = true;
this.params.keyword = keyword;
- this.params.pageNumber = 0;
+ this.params.pageNumber = 1;
this.$set(this.sortParams, "keyword", keyword);
this.loadData("refresh", 1);
diff --git a/pages/passport/onClickLogin.vue b/pages/passport/onClickLogin.vue
index 0190b8c..761fbc7 100644
--- a/pages/passport/onClickLogin.vue
+++ b/pages/passport/onClickLogin.vue
@@ -13,10 +13,10 @@
-
+.btns {
+ margin-top: 100rpx;
+ display: flex;
+ width: 100%;
+ justify-content: center;
+}
+
diff --git a/pages/product/goods.vue b/pages/product/goods.vue
index 7d51752..ec6ec8d 100644
--- a/pages/product/goods.vue
+++ b/pages/product/goods.vue
@@ -442,6 +442,11 @@ export default {
},
async onLoad(options) {
this.routerVal = options;
+
+ // #ifdef MP-WEIXIN
+ // 小程序默认分享
+ uni.showShareMenu({ withShareTicket: true });
+ // #endif
},
async onShow() {
this.goodsDetail = {};
diff --git a/pages/product/product/shop/-shop.vue b/pages/product/product/shop/-shop.vue
index dcaeed9..de42716 100644
--- a/pages/product/product/shop/-shop.vue
+++ b/pages/product/product/shop/-shop.vue
@@ -1,26 +1,26 @@
-
+
- {{ storeDetail.storeName }}
-
-
-
-
-
-
-
+
+ {{ storeDetail.storeName }}
+ 自营
+
+
+
{{ storeDetail.collectionNum || 0 }}人关注
+
{{ storeDetail.goodsNum || 0 }}件商品
+
进店逛逛
-
+
商品推荐
@@ -57,10 +57,9 @@ export default {
},
// 点击商品
clickGoods(val) {
- uni.navigateTo({
- url: `/pages/product/goods?id=${val.id}&goodsId=${val.goodsId}`
+ uni.navigateTo({
+ url: `/pages/product/goods?id=${val.id}&goodsId=${val.goodsId}`,
});
-
},
tostorePage(val) {
@@ -73,7 +72,6 @@ export default {
diff --git a/pages/product/shopPage.vue b/pages/product/shopPage.vue
index 747f88e..cc81740 100644
--- a/pages/product/shopPage.vue
+++ b/pages/product/shopPage.vue
@@ -59,7 +59,12 @@ export default {
this.storeId = options.id;
},
- mounted() {},
+ mounted() {
+ // #ifdef MP-WEIXIN
+ // 小程序默认分享
+ uni.showShareMenu({ withShareTicket: true });
+ // #endif
+ },
methods: {
// 点击分享
diff --git a/pages/tabbar/cart/cartList.vue b/pages/tabbar/cart/cartList.vue
index a02abea..6c07064 100644
--- a/pages/tabbar/cart/cartList.vue
+++ b/pages/tabbar/cart/cartList.vue
@@ -192,6 +192,12 @@ export default {
WEIXIN_num: "", //购物车兼容微信步进器
};
},
+ mounted() {
+ // #ifdef MP-WEIXIN
+ // 小程序默认分享
+ uni.showShareMenu({ withShareTicket: true });
+ // #endif
+ },
/**
* 初始化信息
*/
diff --git a/pages/tabbar/category/category.vue b/pages/tabbar/category/category.vue
index 656b0c8..4c7feeb 100644
--- a/pages/tabbar/category/category.vue
+++ b/pages/tabbar/category/category.vue
@@ -5,7 +5,7 @@
-
+
{{ item.name }}
@@ -47,6 +47,10 @@ export default {
},
onLoad() {
this.loadData();
+ // #ifdef MP-WEIXIN
+ // 小程序默认分享
+ uni.showShareMenu({ withShareTicket: true });
+ // #endif
},
methods: {
/**
@@ -112,8 +116,8 @@ uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
display: none;
}
/* #endif */
-.s-list{
- box-shadow: 0 4rpx 12rpx 0 rgba(0, 0, 0, 0.05);
+.s-list {
+ box-shadow: 0 4rpx 12rpx 0 rgba(0, 0, 0, 0.05);
}
.nav-search {
padding-left: 30rpx !important;
diff --git a/pages/tabbar/home/views.vue b/pages/tabbar/home/views.vue
index 79ae09d..16d9ddb 100644
--- a/pages/tabbar/home/views.vue
+++ b/pages/tabbar/home/views.vue
@@ -94,6 +94,10 @@ export default {
mounted() {
this.init();
+ // #ifdef MP-WEIXIN
+ // 小程序默认分享
+ uni.showShareMenu({ withShareTicket: true });
+ // #endif
},
methods: {
/**
@@ -121,9 +125,9 @@ export default {
let path = encodeURIComponent(res.result);
config.scanAuthNavigation.forEach((src) => {
if (res.result.indexOf(src) != -1) {
- uni.navigateTo({
- url: `/${res.result.substring(src.length)}`,
- });
+ uni.navigateTo({
+ url: `/${res.result.substring(src.length)}`,
+ });
} else {
setTimeout(() => {
uni.navigateTo({
diff --git a/utils/Foundation.js b/utils/Foundation.js
index f9a23b2..3b54829 100644
--- a/utils/Foundation.js
+++ b/utils/Foundation.js
@@ -14,21 +14,19 @@
* 计算出当前router路径
* 1.如果跳转的链接为登录页面或跳转的链接为空页面。则会重新跳转到首页
* 2.都不满足返回跳转页面
+ * @param type 'default' || 'wx' //返回地址会做判断默认为default
*/
-export function whetherNavigate() {
+
+export function whetherNavigate(type = "default") {
if (getCurrentPages().length > 1) {
if ((getCurrentPages().length - 2).route == "pages/passport/login") {
- uni.switchTab({
- url: "/pages/tabbar/home/index",
- });
+ navigationToBack(type);
} else {
if (
!(getCurrentPages().length - 2).route ||
(getCurrentPages().length - 2).route == "undefined"
) {
- uni.switchTab({
- url: "/pages/tabbar/home/index",
- });
+ navigationToBack(type);
} else {
uni.navigateBack({
delta: getCurrentPages().length - 2,
@@ -156,6 +154,20 @@ export function countTimeDown(seconds) {
};
}
+
+function navigationToBack(type) {
+ if (type == "wx") {
+ // console.log(getCurrentPages().length - 3)
+ uni.navigateBack({
+ delta: getCurrentPages().length ,
+ });
+ } else {
+ uni.switchTab({
+ url: "/pages/tabbar/home/index",
+ });
+ }
+}
+
/**
* 计算当前时间到第二天0点的倒计时[秒]
* @returns {number}
@@ -181,5 +193,5 @@ module.exports = {
randomString,
countTimeDown,
theNextDayTime,
- whetherNavigate
+ whetherNavigate,
};