From abf54b5a9a1c5ad1c9c495010d8f6f8f3b57ccc0 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Tue, 30 Nov 2021 19:43:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/community/communityApi.js | 19 ++ api/goods/goodsApi.js | 2 +- api/mall/mallApi.js | 213 ++++++++++++++++++ components/fixed-search/fixed-search.vue | 93 ++++++++ components/vc-ads/vc-ads.vue | 69 ++++++ .../vc-bottom-black/vc-bottom-black.vue | 15 ++ components/vc-category/vc-category.vue | 94 ++++++++ components/vc-recommend/vc-recommend.vue | 86 +++++++ components/vc-shop/vc-shop.vue | 110 +++++++++ constant/MappingConstant.js | 37 +++ constant/url.js | 6 +- pages/mall/mall.vue | 193 ++++++++++++---- style/main.css | 3 + utils/ArrayUtil.js | 18 ++ 14 files changed, 906 insertions(+), 52 deletions(-) create mode 100644 api/mall/mallApi.js create mode 100644 components/fixed-search/fixed-search.vue create mode 100644 components/vc-ads/vc-ads.vue create mode 100644 components/vc-bottom-black/vc-bottom-black.vue create mode 100644 components/vc-category/vc-category.vue create mode 100644 components/vc-recommend/vc-recommend.vue create mode 100644 components/vc-shop/vc-shop.vue create mode 100644 utils/ArrayUtil.js diff --git a/api/community/communityApi.js b/api/community/communityApi.js index 6724e56..08862e7 100755 --- a/api/community/communityApi.js +++ b/api/community/communityApi.js @@ -49,6 +49,25 @@ export function getCommunitys(dataObj) { }) } +export function getCommunityId(){ + + let _currentCommunity = uni.getStorageSync("currentCommunityInfo") + if(_currentCommunity){ + return _currentCommunity.communityId; + } + + return ""; + +} + +export function getCommunityName(){ + let _currentCommunity = uni.getStorageSync("currentCommunityInfo") + if(_currentCommunity){ + return _currentCommunity.communityName; + } + return ""; +} + /** * 查询当前小区 * diff --git a/api/goods/goodsApi.js b/api/goods/goodsApi.js index 17056c9..52d0d45 100644 --- a/api/goods/goodsApi.js +++ b/api/goods/goodsApi.js @@ -24,7 +24,7 @@ export function getRecommendProduct(dataObj) { return new Promise( (resolve, reject) => { requestNoAuth({ - url: url.queryProductLabel, + url: url.queryMainCategory, method: "GET", data: dataObj, //动态数据 diff --git a/api/mall/mallApi.js b/api/mall/mallApi.js new file mode 100644 index 0000000..e32a1f4 --- /dev/null +++ b/api/mall/mallApi.js @@ -0,0 +1,213 @@ +import { + request, + requestNoAuth +} from '../java110Request.js'; +import url from '../../constant/url.js'; + +/** + * 查询拼团产品 + */ +export function loadAdverts(dataObj) { + return new Promise( + (resolve, reject) => { + requestNoAuth({ + url: url.listAdvertPhoto, + method: "GET", + data: dataObj, + //动态数据 + success: function(res) { + if (res.statusCode == 200) { + let _products = res.data; + resolve(_products); + return; + } + reject(); + }, + fail: function(e) { + reject(); + } + }); + }) +} +/** + * 查询社区商家 + */ +export function loadCommunityShops(dataObj) { + return new Promise( + (resolve, reject) => { + requestNoAuth({ + url: url.queryShopCommunity, + method: "GET", + data: dataObj, + //动态数据 + success: function(res) { + if (res.statusCode == 200) { + let _shops = res.data.data; + resolve(_shops); + return; + } + reject(); + }, + fail: function(e) { + reject(); + } + }); + }) +} +/** + * 查询社区商家 + */ +export function getShops(dataObj) { + return new Promise( + (resolve, reject) => { + requestNoAuth({ + url: url.queryShop, + method: "GET", + data: dataObj, + //动态数据 + success: function(res) { + if (res.statusCode == 200) { + let _shops = res.data.data; + resolve(_shops); + return; + } + reject(); + }, + fail: function(e) { + reject(); + } + }); + }) +} +/** + * 查询便民菜单 + */ +export function getConMenus(dataObj) { + return new Promise( + (resolve, reject) => { + requestNoAuth({ + url: url.queryConMenus, + method: "GET", + data: dataObj, + //动态数据 + success: function(res) { + if (res.statusCode == 200) { + let _shops = res.data.data; + resolve(_shops); + return; + } + reject(); + }, + fail: function(e) { + reject(); + } + }); + }) +} + +/** + * 查询商家信息 + */ +export function getStoreInfo(dataObj) { + return new Promise( + (resolve, reject) => { + requestNoAuth({ + url: url.queryStoreInfo, + method: "GET", + data: dataObj, + //动态数据 + success: function(res) { + if (res.statusCode == 200) { + let _shops = res.data.data; + resolve(_shops); + return; + } + reject(); + }, + fail: function(e) { + reject(); + } + }); + }) +} + +/** + * 查询商家信息 + */ +export function getStoreBySeq(dataObj) { + return new Promise( + (resolve, reject) => { + requestNoAuth({ + url: url.queryStoreBySeq, + method: "GET", + data: dataObj, + //动态数据 + success: function(res) { + if (res.statusCode == 200) { + let _shops = res.data.data; + resolve(_shops); + return; + } + reject(); + }, + fail: function(e) { + reject(); + } + }); + }) +} + +/** + * 查询商铺ID + */ +export function getShopId(){ + let shopId = uni.getStorageSync(mapping.MALL_SHOP_ID); + return shopId; +} + + +export function queryShopType(_dataObj) { + return new Promise( + (resolve, reject) => { + requestNoAuth({ + url: url.queryShopType, + method: "GET", + data: _dataObj, + //动态数据 + success: function (res) { + if (res.statusCode == 200) { + let _data = res.data + resolve(_data) + return + } + reject() + }, + fail: function (e) { + reject() + } + }) + }) +} + +export function getMallIndexCategoryList(_dataObj) { + return new Promise( + (resolve, reject) => { + requestNoAuth({ + url: url.queryHousekeepingType, + method: "GET", + data: _dataObj, + //动态数据 + success: function (res) { + if (res.statusCode == 200) { + let _data = res.data + resolve(_data) + return + } + reject() + }, + fail: function (e) { + reject() + } + }) + }) +} diff --git a/components/fixed-search/fixed-search.vue b/components/fixed-search/fixed-search.vue new file mode 100644 index 0000000..9bb69f5 --- /dev/null +++ b/components/fixed-search/fixed-search.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/components/vc-ads/vc-ads.vue b/components/vc-ads/vc-ads.vue new file mode 100644 index 0000000..2cf1549 --- /dev/null +++ b/components/vc-ads/vc-ads.vue @@ -0,0 +1,69 @@ + + + + + diff --git a/components/vc-bottom-black/vc-bottom-black.vue b/components/vc-bottom-black/vc-bottom-black.vue new file mode 100644 index 0000000..de5ed74 --- /dev/null +++ b/components/vc-bottom-black/vc-bottom-black.vue @@ -0,0 +1,15 @@ + + + + + diff --git a/components/vc-category/vc-category.vue b/components/vc-category/vc-category.vue new file mode 100644 index 0000000..5648d68 --- /dev/null +++ b/components/vc-category/vc-category.vue @@ -0,0 +1,94 @@ + + + + + diff --git a/components/vc-recommend/vc-recommend.vue b/components/vc-recommend/vc-recommend.vue new file mode 100644 index 0000000..00f779a --- /dev/null +++ b/components/vc-recommend/vc-recommend.vue @@ -0,0 +1,86 @@ + + + + + diff --git a/components/vc-shop/vc-shop.vue b/components/vc-shop/vc-shop.vue new file mode 100644 index 0000000..92851fe --- /dev/null +++ b/components/vc-shop/vc-shop.vue @@ -0,0 +1,110 @@ + + + + + diff --git a/constant/MappingConstant.js b/constant/MappingConstant.js index f532e7e..b108630 100755 --- a/constant/MappingConstant.js +++ b/constant/MappingConstant.js @@ -33,4 +33,41 @@ class MappingConstant { } +/** + * 一些参数常量 + */ +export default { + // 店铺类型 + SHOP_TYPE: { + MARKET: "34004", // 超市 + RESTAURANT: "34005", // 餐厅 + FOOD_SHOP: "34006", // 菜铺 + PHARMACY: "34007", // 药店 + MOM_CHILD: "34008", // 母婴 + HOMEMAKING: "34009", // 家政 + }, + // 专区目录类别 + CATEGORY_TYPE: { + HOMEMAKING: "1", // 家政 + INDEX: "2", //商圈 + }, + // 菜单类型 + MENU_TYPE: { + HOMEMAKING: "1001", // 家政服务 + SHOP: "2002", // 商城 + SHOP_INDEX: "3003", // 商城 + }, + // 遇到全局数据查询传参shopId,使用该参数 + SHOP_ID_GLOBAL: "9999", + // 购物车(订单)类型 + CART_TYPE: { + HOMEMAKING: "3307", // 家政服务 + SHOP: "3306", // 商城 + }, + // 默认头像 + headImg: '/static/images/missing-face.png', + // 出错填充图片 + errorImage: '/static/images/errorImage.jpg', +} + module.exports = MappingConstant; \ No newline at end of file diff --git a/constant/url.js b/constant/url.js index 2d34534..7227a53 100755 --- a/constant/url.js +++ b/constant/url.js @@ -137,7 +137,11 @@ export default { queryOwnerAccount: baseUrl + "app/account/queryOwnerAccount", queryOwnerAccountDetail: baseUrl + "app/account/queryOwnerAccountDetail", ownerCommunity: baseUrl + "app/owner.ownerCommunity", - + queryShopType: baseUrl + 'app/shopType/queryShopType',//查询店铺类型 + // 家政服务类型(菜单) + queryHousekeepingType: baseUrl + 'app/housekeepingType/queryHousekeepingType', + queryMainCategory: baseUrl + "app/productCategory/queryMainCategoryAllGoods", + queryShopCommunity: baseUrl + "app/shop/queryShopCommunity", NEED_NOT_LOGIN_PAGE: [ '/pages/login/login', diff --git a/pages/mall/mall.vue b/pages/mall/mall.vue index cfdeb55..46f4535 100644 --- a/pages/mall/mall.vue +++ b/pages/mall/mall.vue @@ -1,73 +1,166 @@ - diff --git a/style/main.css b/style/main.css index 33da3a0..4f40fa6 100755 --- a/style/main.css +++ b/style/main.css @@ -3910,3 +3910,6 @@ scroll-view.cu-steps .cu-item { .lines-white { color: #ffffff; } +.c-radius{ + border-radius: 20upx; +} diff --git a/utils/ArrayUtil.js b/utils/ArrayUtil.js new file mode 100644 index 0000000..9001a19 --- /dev/null +++ b/utils/ArrayUtil.js @@ -0,0 +1,18 @@ +/** + * 数组集合工具类 + */ + +/* + * 将一个数组分成几个同等长度的数组 + * array[分割的原数组] + * size[每个子数组的长度] + */ +export function sliceArray(array, size) { + var result = [] + for (var x = 0; x < Math.ceil(array.length / size); x++) { + var start = x * size + var end = start + size + result.push(array.slice(start, end)) + } + return result +}