From 5a25680bf7e62e8f23c3a2fdf426306e63f16266 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 16 Aug 2023 22:43:54 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E9=A6=96=E9=A1=B5=E3=80=91=201?= =?UTF-8?q?=E3=80=81=E6=8E=A5=E5=85=A5=E8=A3=85=E4=BF=AE=202=E3=80=81?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E9=85=8D=E7=BD=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/promotion/coupon.js | 2 + api/promotion/decorate.js | 9 ++ api/trade/order.js | 6 ++ config/app.js | 4 +- pages/index/index.vue | 141 +++++++++++++++----------- pages/order_details/index.vue | 4 +- pages/users/goods_logistics/index.vue | 139 +++++++++++-------------- 7 files changed, 159 insertions(+), 146 deletions(-) create mode 100644 api/promotion/decorate.js diff --git a/api/promotion/coupon.js b/api/promotion/coupon.js index c40c9a3d..a9e0e475 100644 --- a/api/promotion/coupon.js +++ b/api/promotion/coupon.js @@ -19,6 +19,8 @@ export function getCouponTemplateList(spuId, useType) { return request.get("app-api/promotion/coupon-template/list", { spuId, useType + }, { + noAuth: true // TODO 芋艿:后续要做调整 }); } diff --git a/api/promotion/decorate.js b/api/promotion/decorate.js new file mode 100644 index 00000000..d06af5cb --- /dev/null +++ b/api/promotion/decorate.js @@ -0,0 +1,9 @@ +import request from "@/utils/request.js"; + +export function getDecorateComponentListByPage(page) { + return request.get("app-api/promotion/decorate/list", { + page + }, { + noAuth: true // TODO 芋艿:后续要做调整 + }); +} diff --git a/api/trade/order.js b/api/trade/order.js index 4f362975..336fb195 100644 --- a/api/trade/order.js +++ b/api/trade/order.js @@ -53,3 +53,9 @@ export function getOrderItem(id) { export function createOrderItemComment(data) { return request.post("app-api/trade/order/item/create-comment", data); } + +export function getOrderExpressTrackList(id) { + return request.get("app-api/trade/order/get-express-track-list", { + id + }); +} diff --git a/config/app.js b/config/app.js index 9258bde2..4f38a907 100644 --- a/config/app.js +++ b/config/app.js @@ -1,6 +1,6 @@ -// let domain = 'http://apif.java.crmeb.net' -let domain = 'http://127.0.0.1:48080' +let domain = 'http://apif.java.crmeb.net' +// let domain = 'http://127.0.0.1:48080' module.exports = { // 请求域名 格式: https://您的域名 diff --git a/pages/index/index.vue b/pages/index/index.vue index 14e50efd..9a3f2639 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -31,15 +31,15 @@ - - + + - + - + @@ -47,7 +47,7 @@ - + @@ -55,10 +55,10 @@ - + - {{item.info}} + {{ item.name }} @@ -67,19 +67,19 @@ - + - + {{item.name}} - + {{item.name}} @@ -124,9 +124,9 @@ :scroll-left="tabsScrollLeft" @scroll="scroll"> + v-for="(item, index) in productRecommends" :key="index" @click="ProductNavTab(item,index)"> {{item.name}} - {{item.info}} + {{item.tag}} @@ -168,8 +168,6 @@ import Cache from '../../utils/cache'; const statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'; let app = getApp(); - import { getIndexData } from '@/api/api.js'; - import { getShare } from '@/api/public.js'; import a_seckill from './components/a_seckill'; import b_combination from './components/b_combination'; import c_bargain from './components/c_bargain'; @@ -184,9 +182,9 @@ import * as ProductSpuApi from '@/api/product/spu.js'; import * as PromotionActivityApi from '@/api/promotion/activity.js'; import * as CouponApi from '@/api/promotion/coupon.js'; + import * as DecorateApi from '@/api/promotion/decorate.js'; import * as ProductUtil from '@/utils/product.js'; import * as Util from '@/utils/util.js'; - const arrTemp = ["beforePay", "afterPay", "refundApply", "beforeRecharge", "createBargain", "pink"]; export default { computed: mapGetters(['isLogin', 'uid']), components: { @@ -204,23 +202,25 @@ statusBarHeight: statusBarHeight, navIndex: 0, navTop: [], - logoUrl: "", - imgUrls: [], - menus: [], - indicatorDots: false, - circular: true, - autoplay: true, - interval: 3000, - duration: 500, - couponList: [], marTop: 0, - explosiveMoney: [], - roll: [], // 新闻简报 - site_name: '', //首页title - configApi: {}, //分享类容配置 - tabsScrollLeft: 0, // tabs当前偏移量 + configApi: {}, // 分享类容配置 + tabsScrollLeft: 0, // tabs 当前偏移量 scrollLeft: 0, + slideShows: [], // 轮播图 + circular: true, + interval: 3000, + duration: 500, + menus: [], // 菜单 + scrollingNews: [], // 新闻简报 + indicatorDots: false, + autoplay: true, + couponList: [], // 优惠劵列表 + productRecommends: [], // 商品推荐 + + site_name: '首页', // 首页 title + logoUrl: "", + // ========== 精品推荐 =========== goodScroll: true, // 精品推荐开关 listActive: 0, // 当前选中项 @@ -273,9 +273,8 @@ this.getIndexConfig(); }, onShow() { - let self = this uni.setNavigationBarTitle({ - title: self.site_name + title: this.site_name }) }, methods: { @@ -310,34 +309,60 @@ // 首页数据 getIndexConfig: function() { let that = this; - getIndexData().then(res => { + DecorateApi.getDecorateComponentListByPage(1).then(res => { + // TODO 芋艿:暂时写死 uni.setNavigationBarTitle({ title: '首页' }) - that.$set(that, "logoUrl", res.data.logoUrl); - that.$set(that, "site_name", '首页'); - that.$set(that, "imgUrls", res.data.banner); - that.$set(that, "menus", res.data.menus); - that.$set(that, "roll", res.data.roll ? res.data.roll : []); - // #ifdef H5 - that.$store.commit("SET_CHATURL", res.data.yzfUrl); - Cache.set('chatUrl', res.data.yzfUrl); - // #endif - that.$set(that, "explosiveMoney", res.data.explosiveMoney); - that.goodType = parseInt(res.data.explosiveMoney[0].type) - this.getGroomList(); - this.shareApi(); - this.getcouponList(); + this.$set(this, "logoUrl", 'https://static.iocoder.cn/ruoyi-vue-pro-logo.png'); + this.$set(this, "site_name", '首页'); + // #ifdef H5 + this.$store.commit("SET_CHATURL", 'https://cschat.antcloud.com.cn/index.htm?tntInstId=jm7_c46J&scene=SCE01197657'); + Cache.set('chatUrl', 'https://cschat.antcloud.com.cn/index.htm?tntInstId=jm7_c46J&scene=SCE01197657'); + // #endif + + // 轮播图 + const slideShow = res.data.find(item => item.code === 'slide-show'); + if (slideShow) { + this.$set(this, "slideShows", JSON.parse(slideShow.value)); + } + // 菜单 + const menu = res.data.find(item => item.code === 'menu'); + if (menu) { + this.$set(this, "menus", JSON.parse(menu.value)); + } + // 滚动新闻 + const scrollingNews = res.data.find(item => item.code === 'scrolling-news'); + if (scrollingNews) { + this.$set(this, "scrollingNews", JSON.parse(scrollingNews.value)); + } + // 商品推荐 + const productRecommend = res.data.find(item => item.code === 'product-recommend'); + if (productRecommend) { + this.$set(this, "productRecommends", JSON.parse(productRecommend.value)); + if (this.productRecommends.length > 0) { + this.goodType = this.productRecommends[0].type + this.getGroomList(); + } + } }) + // 获得分享配置 + this.shareApi(); + // 获得优惠劵列表 + this.getcouponList(); }, shareApi: function() { - getShare().then(res => { - this.$set(this, 'configApi', res.data); - // #ifdef H5 - this.setOpenShare(res.data); - // #endif - }) + // TODO 芋艿:写死 + const configApi = { + "title": "芋道商城", + "synopsis": "芋道商城,好用!", + "img": "https://api.java.crmeb.net/crmebimage/public/operation/2021/09/23/61fc3e4a49844fa69c12812ce5d57641bfkfzjqh1q.png" + } + this.$set(this, 'configApi', configApi); + // #ifdef H5 + this.setOpenShare(configApi); + // #endif }, // 微信分享; setOpenShare: function(data) { @@ -349,8 +374,7 @@ link: location.href, imgUrl: data.img }; - that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"], - configAppMessage); + that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"], configAppMessage); } }, @@ -389,7 +413,7 @@ */ ProductNavTab(item, index) { this.listActive = index - this.goodType = parseInt(item.type) + this.goodType = item.type this.listActive = index this.tempArr = [] this.params.page = 1 @@ -407,13 +431,8 @@ this.iSshowH = true } this.loading = true - const type = this.goodType === 1 ? 'best' : - this.goodType === 2 ? 'hot' : - this.goodType === 3 ? 'new' : - this.goodType === 4 ? 'benefit': - this.goodType === 5 ? 'good': '' ProductSpuApi.getSpuPage({ - recommendType: type, + recommendType: this.goodType, pageNo: this.params.page, pageSize: this.params.limit }).then(res => { diff --git a/pages/order_details/index.vue b/pages/order_details/index.vue index f9bbcc42..d2b8fbe5 100644 --- a/pages/order_details/index.vue +++ b/pages/order_details/index.vue @@ -271,8 +271,7 @@ 查看拼团 - - 查看物流 @@ -305,7 +304,6 @@ import { mapGetters } from "vuex"; import dayjs from '@/plugin/dayjs/dayjs.min.js'; import * as Util from '@/utils/util.js'; - import {receiveOrder} from "../../api/trade/order"; export default { components: { payment, diff --git a/pages/users/goods_logistics/index.vue b/pages/users/goods_logistics/index.vue index 7155ddd1..15c00148 100644 --- a/pages/users/goods_logistics/index.vue +++ b/pages/users/goods_logistics/index.vue @@ -29,6 +29,8 @@ 复制单号 + + @@ -37,38 +39,22 @@ - + - - - -