From bb3c0ab9e924ebb1619b976fd9b48b8571084cd8 Mon Sep 17 00:00:00 2001 From: fanfan Date: Mon, 15 Apr 2024 15:57:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=A6=E6=83=85=E7=9A=84=E5=9C=B0=E5=8C=BA?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/goods/index.js | 4 + manifest.json | 2 +- pages.json | 7 - pages/cart/index.vue | 32 +- pages/goods/detail.vue | 95 ++- pages/goods/list.vue | 85 +-- pages/index/index.vue | 97 ++- pages/news1/wallet.vue | 2 +- pages/serve/install.vue | 3 +- utils/qqmap-wx-jssdk.js | 1122 +++++++++++++++++++++++++++++++++++ utils/qqmap-wx-jssdk.min.js | 1 + 11 files changed, 1294 insertions(+), 156 deletions(-) create mode 100644 utils/qqmap-wx-jssdk.js create mode 100644 utils/qqmap-wx-jssdk.min.js diff --git a/api/goods/index.js b/api/goods/index.js index 0f08f28..ffe6ee8 100644 --- a/api/goods/index.js +++ b/api/goods/index.js @@ -89,4 +89,8 @@ export const poster = param => { // 店长设置秒杀价 export const editGoodsSeckillPrice = param => { return request.post('StoreKeeper/editGoodsSeckillPrice', param) +} +// 是否有货 +export const getGoodsStock = param => { + return request.get('goods/getGoodsStock', param) } \ No newline at end of file diff --git a/manifest.json b/manifest.json index 3651cea..2f9cbcc 100644 --- a/manifest.json +++ b/manifest.json @@ -141,7 +141,7 @@ "sdkConfigs" : { "maps" : { "qqmap" : { - "key" : "ZWEBZ-R7N3U-BJSVH-4TCR3-66MDQ-S3FDJ" + "key" : "ZDBBZ-QQX66-YVYSB-M56JB-FGSS5-EIBI4" } } }, diff --git a/pages.json b/pages.json index 879b0b2..4030922 100644 --- a/pages.json +++ b/pages.json @@ -751,13 +751,6 @@ "navigationStyle": "custom" // "navigationBarTitleText": "商品详情页" } - }, - { - "path": "city", - "style": { - "navigationBarTitleText": "城市列表", - "enablePullDownRefresh": true - } } ] }, diff --git a/pages/cart/index.vue b/pages/cart/index.vue index af020df..9f7d97b 100644 --- a/pages/cart/index.vue +++ b/pages/cart/index.vue @@ -99,20 +99,8 @@ - - JD - - - SN - - - GC - - - CC - - - ZC + + {{item.goods_source}} {{Number(item.discount)}}折 @@ -160,20 +148,8 @@ - - JD - - - SN - - - GC - - - CC - - - ZC + + {{item.goods_source}} {{Number(item.discount)}}折 diff --git a/pages/goods/detail.vue b/pages/goods/detail.vue index 563c10a..8196a85 100644 --- a/pages/goods/detail.vue +++ b/pages/goods/detail.vue @@ -102,29 +102,17 @@ - 南京:有货 + {{addressResult.city}}:{{stockValue}} - - - JD - - - SN - - - GC - - - CC - - - ZC + + + {{goods.goods_source}} {{goods.unicode}} + style="width: 27rpx;height: 27rpx;margin-left: 8rpx;"> @@ -158,7 +146,7 @@ - + 发货 预计 @@ -516,13 +504,21 @@ }], selectSku: '', selectShop: 1, - multiIndex: [0, 0], + multiIndex: [0, 0, 0], multiArray: [], - multiData: [] + multiData: [], + stockValue: '南京市', + addressResult: { + province: '江苏省', + city: '南京市', + district: '玄武区' + } } }, onLoad(options) { const that = this; + let result = uni.getStorageSync("addressResult") + this.addressResult = result.address_component || '' this.isPre = options.isPre ? options.isPre : null // 记录query参数 // this.onRecordQuery(options) @@ -537,9 +533,9 @@ this.getServeList() this.getGoodsDetail() this.cityInfo = uni.getStorageSync("cityInfo"); + this.getGoodsStockInfor() this.getCartTotal() this.getProvinceAll() - this.getAdressLocation() uni.$on("onenPrice", function(selectShop) { that.openPirce(); that.isTodo = false; @@ -573,19 +569,21 @@ } }, methods: { - getAdressLocation() { - const that = this - uni.getLocation({ //只能获取到经纬度 - type: 'gcj02', - success(res) { - let longitude = res.longitude - let latitude = res.latitude - console.log(res, 'AAAAAAAAAAAAAA') - }, - fail(err) { - console.log(err, '获取经纬度失败') - }, - }) + async getGoodsStockInfor() { + let params = { + goods_id: this.goodsId, + province: this.addressResult ? this.addressResult.province : '江苏省', + city: this.addressResult ? this.addressResult.city : '南京市', + district: this.addressResult ? this.addressResult.district : '玄武区' + } + let { + status, + message, + data + } = await GoodsApi.getGoodsStock(params); + if (status == 200) { + this.stockValue = data.stock + } }, async getProvinceAll() { let { @@ -599,26 +597,20 @@ this.multiArray = [ this.multiData, this.multiData[0].children, + this.multiData[0].children[0].children ] } }, // 获取多列的索引 multiChange: function(e) { this.multiIndex = e.detail.value; - let a_name = this.multiArray[0][e.detail.value[0]].name; - let a_id = this.multiArray[0][e.detail.value[0]].id; - let b_name = this.multiArray[1][e.detail.value[1]].name; - let b_id = this.multiArray[1][e.detail.value[1]].id; - // this.cityInfo.province = a_name; - // this.cityInfo.city = b_name; - let region = [{ - value: a_id, - label: a_name - }, { - value: b_id, - label: b_name - }]; - console.log(region) + let province = this.multiArray[0][e.detail.value[0]].name; + let city = this.multiArray[1][e.detail.value[1]].name; + let district = this.multiArray[2][e.detail.value[2]].name; + this.addressResult.province = province; + this.addressResult.city = city + this.addressResult.district = district + this.getGoodsStockInfor() }, // 选择列 @@ -630,6 +622,7 @@ this.multiArray = [ _this.multiData, _this.multiData[_this.multiIndex[0]].children, + _this.multiData[_this.multiIndex[0]].children[_this.multiIndex[1]].children ] }, // 记录query参数 @@ -2211,13 +2204,13 @@ .left_1 { height: 100%; - width: 50rpx; + margin-right: 8rpx; line-height: 36.5rpx; font-family: PingFang SC, PingFang SC; font-weight: bold; font-size: 30rpx; color: #F21A1C; text-align: center; - margin-right: 5rpx; + margin-right: 10rpx; } diff --git a/pages/goods/list.vue b/pages/goods/list.vue index 2d2f37c..405f60c 100644 --- a/pages/goods/list.vue +++ b/pages/goods/list.vue @@ -51,8 +51,12 @@ + - 同城达 + + 类型 +