From 5c9b02ed3bda479c09aea16a89a84ffb6cb73094 Mon Sep 17 00:00:00 2001
From: weipengfei <2187978347@qq.com>
Date: Tue, 26 Mar 2024 14:28:26 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 10 +++----
api/store.js | 11 +++++---
manifest.json | 4 +--
pages/cloud_warehouse/home/home.vue | 2 +-
pages/cloud_warehouse/market/market.vue | 4 +--
pages/cloud_warehouse/specialty/specialty.vue | 2 +-
pages/columnGoods/goods_search/index.vue | 9 ++++++-
pages/index/index.vue | 16 ++++++------
pages/whole_sale/index.vue | 3 ++-
utils/request.js | 26 +++++++++++++++----
10 files changed, 57 insertions(+), 30 deletions(-)
diff --git a/App.vue b/App.vue
index 5cda3dd..91e8433 100644
--- a/App.vue
+++ b/App.vue
@@ -77,10 +77,10 @@
visible: false
})
// #ifdef H5
- // uni.setTabBarItem({
- // index: 2,
- // visible: false
- // })
+ uni.setTabBarItem({
+ index: 2,
+ visible: false
+ })
// #endif
this.globalData.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
@@ -401,7 +401,7 @@
@import 'static/css/base.css';
@import 'static/iconfont/iconfont.css';
@import 'static/css/style.scss';
-
+
.bg-color-red {
background-color: #e93323 !important;
}
diff --git a/api/store.js b/api/store.js
index 203c180..9f1c63d 100644
--- a/api/store.js
+++ b/api/store.js
@@ -100,7 +100,7 @@ export function getCategoryIndexList() {
* 获取产品列表
* @param object data
*/
-export function getProductslist(data) {
+export function getProductslist(data, enLoad=false) {
if (data.brand_id && Array.isArray(data.brand_id)) {
data = {
...data
@@ -108,7 +108,8 @@ export function getProductslist(data) {
data.brand_id = data.brand_id.toString()
}
return request.get('product/spu/lst', data, {
- noAuth: true
+ noAuth: true,
+ enLoad: enLoad
});
}
/**
@@ -139,13 +140,15 @@ export function getBrandlist(data) {
* 获取推荐产品
*
*/
-export function getProductHot(page, limit, sale_type) {
+export function getProductHot(page, limit, sale_type, enLoad=false) {
+ console.log(enLoad);
return request.get("product/spu/recommend", {
page: page === undefined ? 1 : page,
limit: limit === undefined ? 10 : limit,
sale_type: sale_type || null
}, {
- noAuth: true
+ noAuth: true,
+ enLoad: enLoad
});
}
/**
diff --git a/manifest.json b/manifest.json
index 549b3f3..d0cc3d5 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,8 +2,8 @@
"name" : "惠农生活",
"appid" : "__UNI__3A527D1",
"description" : "",
- "versionName" : "2.0.10",
- "versionCode" : 2010,
+ "versionName" : "2.0.11",
+ "versionCode" : 2011,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
diff --git a/pages/cloud_warehouse/home/home.vue b/pages/cloud_warehouse/home/home.vue
index 1041ab3..eeb8460 100644
--- a/pages/cloud_warehouse/home/home.vue
+++ b/pages/cloud_warehouse/home/home.vue
@@ -219,7 +219,7 @@
class="search_content flex_a_c_j_sb">
-
diff --git a/pages/cloud_warehouse/market/market.vue b/pages/cloud_warehouse/market/market.vue
index 06d5c88..6cd2085 100644
--- a/pages/cloud_warehouse/market/market.vue
+++ b/pages/cloud_warehouse/market/market.vue
@@ -315,11 +315,11 @@
-
-
diff --git a/pages/cloud_warehouse/specialty/specialty.vue b/pages/cloud_warehouse/specialty/specialty.vue
index cb0ff5d..f4801ae 100644
--- a/pages/cloud_warehouse/specialty/specialty.vue
+++ b/pages/cloud_warehouse/specialty/specialty.vue
@@ -219,7 +219,7 @@
class="search_content flex_a_c_j_sb">
-
diff --git a/pages/columnGoods/goods_search/index.vue b/pages/columnGoods/goods_search/index.vue
index 0c345d5..50564fd 100644
--- a/pages/columnGoods/goods_search/index.vue
+++ b/pages/columnGoods/goods_search/index.vue
@@ -4,7 +4,7 @@
-
搜索
@@ -172,11 +172,18 @@
mainWidth: 960,
isShow: true,
back: false,
+ isShop: false,
};
},
onLoad(options) {
this.searchValue = options.searchVal || ''
this.back = options.back;
+ this.isShop = options.shop || false;
+ if(options.shop=='true'){
+ uni.setNavigationBarTitle({
+ title: '搜索店铺'
+ })
+ }
},
onShow: function() {
try {
diff --git a/pages/index/index.vue b/pages/index/index.vue
index aaea4bd..10e7352 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -1016,28 +1016,28 @@
this.loadGoods(e);
},
loadGoods(e = 1) {
- if (e == 1) return this.get_host_product();
+ if (e == 1) return this.get_host_product(true);
if (e == 2) return this.get_host_home({
mer_type: 1
- });
+ }, true);
if (e == 3) return this.get_host_home({
mer_type: 2
- });
+ }, true);
if (e == 4) return this.get_host_home({
mer_type: 3
- });
+ }, true);
},
/**
* 获取我的推荐
*/
- get_host_product: function() {
+ get_host_product: function(reload=false) {
let that = this;
let num = that.hotLimit;
if (!that.hotScroll) return;
if (that.hotLoading) return;
that.hotLoading = true;
that.hotTitle = '加载中';
- getProductHot(that.hotPage, that.hotLimit, 1).then(res => {
+ getProductHot(that.hotPage, that.hotLimit, 1, true).then(res => {
let list = res.data.list;
let productList = that.$util.SplitArray(list, that.hostProduct);
let hotScroll = list.length <= num && list.length != 0;
@@ -1051,7 +1051,7 @@
/**
* 获取里海云仓, 云市场, 名优特产
*/
- get_host_home: function(query = {}) {
+ get_host_home: function(query = {}, reload) {
let that = this;
let num = that.hotLimit;
if (!that.hotScroll) return;
@@ -1063,7 +1063,7 @@
query.sale_type = 1;
getProductslist({
...query
- }).then(res => {
+ }, true).then(res => {
let list = res.data.list;
let productList = that.$util.SplitArray(list, that.hostProduct);
let hotScroll = list.length <= num && list.length != 0;
diff --git a/pages/whole_sale/index.vue b/pages/whole_sale/index.vue
index b0d624a..f968225 100644
--- a/pages/whole_sale/index.vue
+++ b/pages/whole_sale/index.vue
@@ -482,7 +482,8 @@
}
if (this.isLoading == -1) return;
this.isLoading = 1;
- getProductslist(this.where).then(res => {
+ getProductslist(this.where, true).then(res => {
+ if (reLoad) this.hostProduct = [];
this.hostProduct = [...this.hostProduct, ...res.data.list];
this.isLoading = 0;
if (res.data.list.length < this.where.limit) this.isLoading = -1;
diff --git a/utils/request.js b/utils/request.js
index 371b919..ec1cd8f 100644
--- a/utils/request.js
+++ b/utils/request.js
@@ -58,12 +58,16 @@ function atob(input) {
return output;
}
+
+var HTTP_list = new Map();
+
/**
* 发送请求
*/
function baseRequest(url, method, data, {
noAuth = false,
- noVerify = false
+ noVerify = false,
+ enLoad = false //终止上一个接口相同类型正在请求的接口, 防止快速切换tab时页面抖动
}) {
let Url = HTTP_REQUEST_URL,
header = HEADER;
@@ -76,11 +80,19 @@ function baseRequest(url, method, data, {
});
}
}
+ let URL = Url + '/api/' + url
+ console.log(enLoad, HTTP_list);
+ if(enLoad) {
+ let http = HTTP_list.get(URL);
+ if(http){
+ http.abort();
+ }
+ }
if (store.state.app.token) header[TOKENNAME] = 'Bearer ' + store.state.app.token;
- if(store.state.app.uuid)header['uuid'] = store.state.app.uuid
+ if(store.state.app.uuid) header['uuid'] = store.state.app.uuid
return new Promise((reslove, reject) => {
- uni.request({
- url: Url + '/api/' + url,
+ let http = uni.request({
+ url: URL,
method: method || 'GET',
header: header,
data: data || {},
@@ -110,8 +122,12 @@ function baseRequest(url, method, data, {
},
fail: (message) => {
reject('请求失败');
- }
+ },
+ complete: () => {
+ // if(enLoad) HTTP_list.delete(URL);
+ }
})
+ if(enLoad) HTTP_list.set(URL, http);
});
}
const request = {};
From 9e7b16a79b89174638873c0280e325c55c666fd2 Mon Sep 17 00:00:00 2001
From: weipengfei <2187978347@qq.com>
Date: Tue, 26 Mar 2024 16:55:50 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/payment/index.vue | 2 ++
pages/order_details/index.vue | 10 +++++++---
pages/payment/settlement.vue | 8 ++++----
uni_modules/guyue-updater/index.js | 5 ++---
uni_modules/guyue-updater/updater.js | 1 -
utils/request.js | 1 +
6 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/components/payment/index.vue b/components/payment/index.vue
index 3772cd8..a680c5b 100644
--- a/components/payment/index.vue
+++ b/components/payment/index.vue
@@ -126,6 +126,8 @@
// #endif
} else if (paytype == 'public') {
type = 'public';
+ } else if (paytype == 'merBalance') {
+ type = 'merBalance';
}
if (!that.order_id) return that.$util.Tips({
title: '请选择要支付的订单'
diff --git a/pages/order_details/index.vue b/pages/order_details/index.vue
index afff32a..1085504 100644
--- a/pages/order_details/index.vue
+++ b/pages/order_details/index.vue
@@ -281,19 +281,23 @@
优惠券抵扣:
- -¥{{orderInfo.coupon_price}}
+ -¥{{orderInfo.coupon_price}}
+
+ 平台优惠抵扣:
+ -¥{{orderInfo.platform_coupon_price}}
+
积分抵扣:
-¥{{orderInfo.integral_price}}
实付款:
- ¥{{orderInfo.presell_price}}
+ ¥{{orderInfo.presell_price}}
实付款:
- ¥{{orderInfo.pay_price}}
+ ¥{{orderInfo.pay_price}}
diff --git a/pages/payment/settlement.vue b/pages/payment/settlement.vue
index 06ec57c..5022476 100644
--- a/pages/payment/settlement.vue
+++ b/pages/payment/settlement.vue
@@ -384,7 +384,7 @@
"icon": "icon-yinhangqia",
value: 'public',
title: '对公转账',
- payStatus: 1,
+ payStatus: 2,
}
],
tagStyle: {
@@ -663,9 +663,9 @@
if (this.userInfo.service && this.userInfo.service.mer_id) getAdminApplyAPI(this.userInfo
.service.mer_id).then(res => {
this.moneyInfo = res.data;
- this.cartArr.forEach(item => {
- if (item.value == 'merBalance') item.payStatus = 1;
- })
+ // this.cartArr.forEach(item => {
+ // if (item.value == 'merBalance') item.payStatus = 1;
+ // })
})
})
},
diff --git a/uni_modules/guyue-updater/index.js b/uni_modules/guyue-updater/index.js
index 4359740..554cff3 100644
--- a/uni_modules/guyue-updater/index.js
+++ b/uni_modules/guyue-updater/index.js
@@ -2,15 +2,14 @@
import { download, install } from "./updater";
export default class Updater {
- static async update(options ) {
+ static async update(options) {
// #ifdef APP-PLUS
// 静默更新
- console.log('更新');
if (options.quiet) {
download({
url: options.downUrl,
onSuccess(filePath) {
- install(filePath, false, options.versionName);
+ install(filePath, options.quiet&&options.force, options.versionName);
},
});
} else if (options.downUrl) {
diff --git a/uni_modules/guyue-updater/updater.js b/uni_modules/guyue-updater/updater.js
index fbdf8b6..f46437c 100644
--- a/uni_modules/guyue-updater/updater.js
+++ b/uni_modules/guyue-updater/updater.js
@@ -22,7 +22,6 @@ export const install = (filePath, restart = false, version='') => {
}, () => {
console.log('install success...');
if (restart) {
- uni.setStorageSync('wgt_version', version);
plus.runtime.restart();
}
}, (e) => {
diff --git a/utils/request.js b/utils/request.js
index ec1cd8f..4239f95 100644
--- a/utils/request.js
+++ b/utils/request.js
@@ -88,6 +88,7 @@ function baseRequest(url, method, data, {
http.abort();
}
}
+ HTTP_list.delete(URL);
if (store.state.app.token) header[TOKENNAME] = 'Bearer ' + store.state.app.token;
if(store.state.app.uuid) header['uuid'] = store.state.app.uuid
return new Promise((reslove, reject) => {