This commit is contained in:
DESKTOP-GMUNQ1B\k 2024-03-26 17:07:02 +08:00
commit 4a407b8ecc
15 changed files with 73 additions and 41 deletions
App.vue
api
components/payment
manifest.json
pages
cloud_warehouse
columnGoods/goods_search
index
order_details
payment
whole_sale
uni_modules/guyue-updater
utils

10
App.vue

@ -77,10 +77,10 @@
visible: false visible: false
}) })
// #ifdef H5 // #ifdef H5
// uni.setTabBarItem({ uni.setTabBarItem({
// index: 2, index: 2,
// visible: false visible: false
// }) })
// #endif // #endif
this.globalData.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'; this.globalData.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
@ -401,7 +401,7 @@
@import 'static/css/base.css'; @import 'static/css/base.css';
@import 'static/iconfont/iconfont.css'; @import 'static/iconfont/iconfont.css';
@import 'static/css/style.scss'; @import 'static/css/style.scss';
.bg-color-red { .bg-color-red {
background-color: #e93323 !important; background-color: #e93323 !important;
} }

@ -100,7 +100,7 @@ export function getCategoryIndexList() {
* 获取产品列表 * 获取产品列表
* @param object data * @param object data
*/ */
export function getProductslist(data) { export function getProductslist(data, enLoad=false) {
if (data.brand_id && Array.isArray(data.brand_id)) { if (data.brand_id && Array.isArray(data.brand_id)) {
data = { data = {
...data ...data
@ -108,7 +108,8 @@ export function getProductslist(data) {
data.brand_id = data.brand_id.toString() data.brand_id = data.brand_id.toString()
} }
return request.get('product/spu/lst', data, { 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", { return request.get("product/spu/recommend", {
page: page === undefined ? 1 : page, page: page === undefined ? 1 : page,
limit: limit === undefined ? 10 : limit, limit: limit === undefined ? 10 : limit,
sale_type: sale_type || null sale_type: sale_type || null
}, { }, {
noAuth: true noAuth: true,
enLoad: enLoad
}); });
} }
/** /**

@ -126,6 +126,8 @@
// #endif // #endif
} else if (paytype == 'public') { } else if (paytype == 'public') {
type = 'public'; type = 'public';
} else if (paytype == 'merBalance') {
type = 'merBalance';
} }
if (!that.order_id) return that.$util.Tips({ if (!that.order_id) return that.$util.Tips({
title: '请选择要支付的订单' title: '请选择要支付的订单'

@ -2,8 +2,8 @@
"name" : "惠农生活", "name" : "惠农生活",
"appid" : "__UNI__3A527D1", "appid" : "__UNI__3A527D1",
"description" : "", "description" : "",
"versionName" : "2.0.10", "versionName" : "2.0.11",
"versionCode" : 2010, "versionCode" : 2011,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

@ -219,7 +219,7 @@
class="search_content flex_a_c_j_sb"> class="search_content flex_a_c_j_sb">
<view class="flex_a_c search_content_wrap"> <view class="flex_a_c search_content_wrap">
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view> <view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
<input type="text" placeholder="搜索您需要批发进货的产品名称" :value="where.keyword" placeholder-style="font-size: 30rpx;color:#999;" <input type="text" placeholder="搜索品名称" :value="where.keyword" placeholder-style="font-size: 30rpx;color:#999;"
disabled style="pointer-events: none;"> disabled style="pointer-events: none;">
</view> </view>
<!-- <button class="search_btn">搜索</button> --> <!-- <button class="search_btn">搜索</button> -->

@ -315,11 +315,11 @@
<view class="wholeSale-nav"> <view class="wholeSale-nav">
<!-- <u-icon class="icon" name="arrow-left" size="20" @click="navBack"></u-icon> --> <!-- <u-icon class="icon" name="arrow-left" size="20" @click="navBack"></u-icon> -->
<!-- 搜索 --> <!-- 搜索 -->
<view @click="navTo(`/pages/columnGoods/goods_search/index?back=true&searchVal=${where.keyword}`)" hover-class="none" <view @click="navTo(`/pages/columnGoods/goods_search/index?back=true&searchVal=${where.keyword}&shop=true`)" hover-class="none"
class="search_content flex_a_c_j_sb"> class="search_content flex_a_c_j_sb">
<view class="flex_a_c search_content_wrap"> <view class="flex_a_c search_content_wrap">
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view> <view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
<input type="text" placeholder="搜索您需要批发进货的产品名称" :value="where.keyword" placeholder-style="font-size: 30rpx;color:#999;" <input type="text" placeholder="搜索店铺名称" :value="where.keyword" placeholder-style="font-size: 30rpx;color:#999;"
disabled style="pointer-events: none;"> disabled style="pointer-events: none;">
</view> </view>
<!-- <button class="search_btn">搜索</button> --> <!-- <button class="search_btn">搜索</button> -->

@ -219,7 +219,7 @@
class="search_content flex_a_c_j_sb"> class="search_content flex_a_c_j_sb">
<view class="flex_a_c search_content_wrap"> <view class="flex_a_c search_content_wrap">
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view> <view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
<input type="text" placeholder="搜索您需要批发进货的产品名称" :value="where.keyword" placeholder-style="font-size: 30rpx;color:#999;" <input type="text" placeholder="搜索品名称" :value="where.keyword" placeholder-style="font-size: 30rpx;color:#999;"
disabled style="pointer-events: none;"> disabled style="pointer-events: none;">
</view> </view>
<!-- <button class="search_btn">搜索</button> --> <!-- <button class="search_btn">搜索</button> -->

@ -4,7 +4,7 @@
<view class='search acea-row row-between-wrapper'> <view class='search acea-row row-between-wrapper'>
<view class='input acea-row row-between-wrapper'> <view class='input acea-row row-between-wrapper'>
<text class='iconfont icon-sousuo2'></text> <text class='iconfont icon-sousuo2'></text>
<input type='text' :value='searchValue' :focus="focus" placeholder='点击搜索商品、店铺名称' placeholder-class='placeholder' <input type='text' :value='searchValue' :focus="focus" :placeholder="isShop?'点击搜索店铺名称':'点击搜索商品名称'" placeholder-class='placeholder'
@input="setValue"></input> @input="setValue"></input>
</view> </view>
<view class='bnt' @tap='searchBut'>搜索</view> <view class='bnt' @tap='searchBut'>搜索</view>
@ -172,11 +172,18 @@
mainWidth: 960, mainWidth: 960,
isShow: true, isShow: true,
back: false, back: false,
isShop: false,
}; };
}, },
onLoad(options) { onLoad(options) {
this.searchValue = options.searchVal || '' this.searchValue = options.searchVal || ''
this.back = options.back; this.back = options.back;
this.isShop = options.shop || false;
if(options.shop=='true'){
uni.setNavigationBarTitle({
title: '搜索店铺'
})
}
}, },
onShow: function() { onShow: function() {
try { try {

@ -1016,28 +1016,28 @@
this.loadGoods(e); this.loadGoods(e);
}, },
loadGoods(e = 1) { 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({ if (e == 2) return this.get_host_home({
mer_type: 1 mer_type: 1
}); }, true);
if (e == 3) return this.get_host_home({ if (e == 3) return this.get_host_home({
mer_type: 2 mer_type: 2
}); }, true);
if (e == 4) return this.get_host_home({ if (e == 4) return this.get_host_home({
mer_type: 3 mer_type: 3
}); }, true);
}, },
/** /**
* 获取我的推荐 * 获取我的推荐
*/ */
get_host_product: function() { get_host_product: function(reload=false) {
let that = this; let that = this;
let num = that.hotLimit; let num = that.hotLimit;
if (!that.hotScroll) return; if (!that.hotScroll) return;
if (that.hotLoading) return; if (that.hotLoading) return;
that.hotLoading = true; that.hotLoading = true;
that.hotTitle = '加载中'; 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 list = res.data.list;
let productList = that.$util.SplitArray(list, that.hostProduct); let productList = that.$util.SplitArray(list, that.hostProduct);
let hotScroll = list.length <= num && list.length != 0; 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 that = this;
let num = that.hotLimit; let num = that.hotLimit;
if (!that.hotScroll) return; if (!that.hotScroll) return;
@ -1063,7 +1063,7 @@
query.sale_type = 1; query.sale_type = 1;
getProductslist({ getProductslist({
...query ...query
}).then(res => { }, true).then(res => {
let list = res.data.list; let list = res.data.list;
let productList = that.$util.SplitArray(list, that.hostProduct); let productList = that.$util.SplitArray(list, that.hostProduct);
let hotScroll = list.length <= num && list.length != 0; let hotScroll = list.length <= num && list.length != 0;

@ -281,19 +281,23 @@
</view> </view>
<view class='item acea-row row-between' v-if='orderInfo.coupon_price > 0'> <view class='item acea-row row-between' v-if='orderInfo.coupon_price > 0'>
<view>优惠券抵扣</view> <view>优惠券抵扣</view>
<view class='conter'>-{{orderInfo.coupon_price}}</view> <view class='conter' style="color: #F55726;">-{{orderInfo.coupon_price}}</view>
</view> </view>
<view class='item acea-row row-between' v-if='orderInfo.platform_coupon_price > 0'>
<view>平台优惠抵扣</view>
<view class='conter' style="width: auto;color: #F55726;">-{{orderInfo.platform_coupon_price}}</view>
</view>
<view class='item acea-row row-between' v-if='orderInfo.integral'> <view class='item acea-row row-between' v-if='orderInfo.integral'>
<view>积分抵扣</view> <view>积分抵扣</view>
<view class='conter'>-{{orderInfo.integral_price}}</view> <view class='conter'>-{{orderInfo.integral_price}}</view>
</view> </view>
<view class='item acea-row row-between' v-if="orderInfo.activity_type == 2"> <view class='item acea-row row-between' v-if="orderInfo.activity_type == 2">
<view>实付款</view> <view>实付款</view>
<view class='conter'>{{orderInfo.presell_price}}</view> <view class='conter' style="color: #F55726;">{{orderInfo.presell_price}}</view>
</view> </view>
<view class='item acea-row row-between' v-else> <view class='item acea-row row-between' v-else>
<view>实付款</view> <view>实付款</view>
<view class='conter'>{{orderInfo.pay_price}}</view> <view class='conter' style="color: #F55726;">{{orderInfo.pay_price}}</view>
</view> </view>
<view class='item acea-row row-between' <view class='item acea-row row-between'
v-if="orderInfo.order_extend && orderInfo.order_extend.corporate_voucher && orderInfo.pay_type == 10"> v-if="orderInfo.order_extend && orderInfo.order_extend.corporate_voucher && orderInfo.pay_type == 10">

@ -384,7 +384,7 @@
"icon": "icon-yinhangqia", "icon": "icon-yinhangqia",
value: 'public', value: 'public',
title: '对公转账', title: '对公转账',
payStatus: 1, payStatus: 2,
} }
], ],
tagStyle: { tagStyle: {
@ -663,9 +663,9 @@
if (this.userInfo.service && this.userInfo.service.mer_id) getAdminApplyAPI(this.userInfo if (this.userInfo.service && this.userInfo.service.mer_id) getAdminApplyAPI(this.userInfo
.service.mer_id).then(res => { .service.mer_id).then(res => {
this.moneyInfo = res.data; this.moneyInfo = res.data;
this.cartArr.forEach(item => { // this.cartArr.forEach(item => {
if (item.value == 'merBalance') item.payStatus = 1; // if (item.value == 'merBalance') item.payStatus = 1;
}) // })
}) })
}) })
}, },

@ -482,7 +482,8 @@
} }
if (this.isLoading == -1) return; if (this.isLoading == -1) return;
this.isLoading = 1; 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.hostProduct = [...this.hostProduct, ...res.data.list];
this.isLoading = 0; this.isLoading = 0;
if (res.data.list.length < this.where.limit) this.isLoading = -1; if (res.data.list.length < this.where.limit) this.isLoading = -1;

@ -2,15 +2,14 @@
import { download, install } from "./updater"; import { download, install } from "./updater";
export default class Updater { export default class Updater {
static async update(options ) { static async update(options) {
// #ifdef APP-PLUS // #ifdef APP-PLUS
// 静默更新 // 静默更新
console.log('更新');
if (options.quiet) { if (options.quiet) {
download({ download({
url: options.downUrl, url: options.downUrl,
onSuccess(filePath) { onSuccess(filePath) {
install(filePath, false, options.versionName); install(filePath, options.quiet&&options.force, options.versionName);
}, },
}); });
} else if (options.downUrl) { } else if (options.downUrl) {

@ -22,7 +22,6 @@ export const install = (filePath, restart = false, version='') => {
}, () => { }, () => {
console.log('install success...'); console.log('install success...');
if (restart) { if (restart) {
uni.setStorageSync('wgt_version', version);
plus.runtime.restart(); plus.runtime.restart();
} }
}, (e) => { }, (e) => {

@ -58,12 +58,16 @@ function atob(input) {
return output; return output;
} }
var HTTP_list = new Map();
/** /**
* 发送请求 * 发送请求
*/ */
function baseRequest(url, method, data, { function baseRequest(url, method, data, {
noAuth = false, noAuth = false,
noVerify = false noVerify = false,
enLoad = false //终止上一个接口相同类型正在请求的接口, 防止快速切换tab时页面抖动
}) { }) {
let Url = HTTP_REQUEST_URL, let Url = HTTP_REQUEST_URL,
header = HEADER; header = HEADER;
@ -76,11 +80,20 @@ 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();
}
}
HTTP_list.delete(URL);
if (store.state.app.token) header[TOKENNAME] = 'Bearer ' + store.state.app.token; 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) => { return new Promise((reslove, reject) => {
uni.request({ let http = uni.request({
url: Url + '/api/' + url, url: URL,
method: method || 'GET', method: method || 'GET',
header: header, header: header,
data: data || {}, data: data || {},
@ -110,8 +123,12 @@ function baseRequest(url, method, data, {
}, },
fail: (message) => { fail: (message) => {
reject('请求失败'); reject('请求失败');
} },
complete: () => {
// if(enLoad) HTTP_list.delete(URL);
}
}) })
if(enLoad) HTTP_list.set(URL, http);
}); });
} }
const request = {}; const request = {};