From 72385f8ed8c97c86102370038abc970a3039d714 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 26 Jun 2023 23:47:06 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=87=E7=AB=A0=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E3=80=91=201.=20=E5=8A=9F=E8=83=BD=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/admin.js | 89 -------------------- api/api.js | 24 ------ api/promotion/article.js | 22 +++++ pages/index/index.vue | 10 ++- pages/news_details/index.vue | 74 +++++++++-------- pages/news_list/index.vue | 157 ++++++++++++++++++++--------------- 6 files changed, 155 insertions(+), 221 deletions(-) delete mode 100644 api/admin.js create mode 100644 api/promotion/article.js diff --git a/api/admin.js b/api/admin.js deleted file mode 100644 index d037b427..00000000 --- a/api/admin.js +++ /dev/null @@ -1,89 +0,0 @@ -import request from "@/utils/request.js"; - -/** - * 统计数据 - */ -export function getStatisticsInfo() { - return request.get("/admin/order/statistics", {}, { login: true }); -} -/** - * 订单月统计 - */ -export function getStatisticsMonth(where) { - return request.get("/admin/order/data", where, { login: true }); -} -/** - * 订单月统计 - */ -export function getAdminOrderList(where) { - return request.get("/admin/order/list", where, { login: true }); -} -/** - * 订单改价 - */ -export function setAdminOrderPrice(data) { - return request.post("/admin/order/price", data, { login: true }); -} -/** - * 订单备注 - */ -export function setAdminOrderRemark(data) { - return request.post("/admin/order/remark", data, { login: true }); -} -/** - * 订单详情 - */ -export function getAdminOrderDetail(orderId) { - return request.get("/admin/order/detail/" + orderId, {}, { login: true }); -} -/** - * 订单发货信息获取 - */ -export function getAdminOrderDelivery(orderId) { - return request.get( - "/admin/order/delivery/gain/" + orderId, - {}, - { login: true } - ); -} - -/** - * 订单发货保存 - */ -export function setAdminOrderDelivery(data) { - return request.post("/admin/order/delivery/keep", data, { login: true }); -} -/** - * 订单统计图 - */ -export function getStatisticsTime(data) { - return request.get("/admin/order/time", data, { login: true }); -} -/** - * 线下付款订单确认付款 - */ -export function setOfflinePay(data) { - return request.post("/admin/order/offline", data, { login: true }); -} -/** - * 订单确认退款 - */ -export function setOrderRefund(data) { - return request.post("/admin/order/refund", data, { login: true }); -} - -/** - * 获取快递公司 - * @returns {*} - */ -export function getLogistics() { - return request.get("/logistics", {}, { login: false }); -} - -/** - * 订单核销 - * @returns {*} - */ -export function orderVerific(verify_code, is_confirm) { - return request.post("order/order_verific", { verify_code, is_confirm }); -} diff --git a/api/api.js b/api/api.js index f14a331b..26432320 100644 --- a/api/api.js +++ b/api/api.js @@ -55,14 +55,6 @@ export function getUserCoupons(data){ return request.get('coupon/list',data) } -/** - * 文章分类列表 - * -*/ -export function getArticleCategoryList(){ - return request.get('article/category/list',{},{noAuth:true}) -} - /** * 文章列表 * @param int cid @@ -72,22 +64,6 @@ export function getArticleList(cid,data){ return request.get('article/list/' + cid, data,{noAuth:true}) } -/** - * 文章 热门列表 - * -*/ -export function getArticleHotList(){ - return request.get('article/hot/list',{},{noAuth:true}); -} - -/** - * 文章 轮播列表 - * -*/ -export function getArticleBannerList(){ - return request.get('article/banner/list',{},{noAuth:true}) -} - /** * 文章详情 * @param int id diff --git a/api/promotion/article.js b/api/promotion/article.js new file mode 100644 index 00000000..fb43d44b --- /dev/null +++ b/api/promotion/article.js @@ -0,0 +1,22 @@ +import request from "@/utils/request.js"; + +// 获得文章分类列表 +export function getArticleCategoryList() { + return request.get("app-api/promotion/article-category/list", {}, { + noAuth: true // TODO 芋艿:后续要做调整 + }); +} + +// 获得文章列表 +export function getArticleList(data) { + return request.get("app-api/promotion/article/list", data, { + noAuth: true // TODO 芋艿:后续要做调整 + }); +} + +// 获得文章分页 +export function getArticlePage(data) { + return request.get("app-api/promotion/article/page", data, { + noAuth: true // TODO 芋艿:后续要做调整 + }); +} diff --git a/pages/index/index.vue b/pages/index/index.vue index 03e32659..cac43db2 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -45,15 +45,16 @@ + - + | - + @@ -63,8 +64,9 @@ - + + diff --git a/pages/news_details/index.vue b/pages/news_details/index.vue index 3d38b985..7e69f6a0 100644 --- a/pages/news_details/index.vue +++ b/pages/news_details/index.vue @@ -4,7 +4,7 @@ {{articleInfo.title}} {{articleInfo.author}} - {{articleInfo.createTime}} + {{articleInfo.createTime}} {{articleInfo.visit}} @@ -21,7 +21,9 @@ ¥{{store_info.otPrice}} - 查看商品 + + 查看商品 + @@ -30,7 +32,7 @@ - + @@ -64,39 +66,39 @@ productId: 0 }; }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - if (options.hasOwnProperty('id')){ - this.id = options.id; - }else{ - // #ifndef H5 - uni.navigateBack({delta: 1 }); - // #endif - // #ifdef H5 - history.back(); - // #endif - } - }, - onShow: function () { - this.getArticleOne(); - }, - /** - * 用户点击右上角分享 - */ - // #ifdef MP - onShareAppMessage: function() { - return { - title: this.articleInfo.title, - imageUrl: this.articleInfo.imageInput.length ? this.articleInfo.imageInput[0] : "", - desc: this.articleInfo.synopsis, - path: '/pages/news_details/index?id=' + this.id - }; - }, - // #endif + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + if (options.hasOwnProperty('id')) { + this.id = options.id; + } else{ + // #ifndef H5 + uni.navigateBack({delta: 1 }); + // #endif + // #ifdef H5 + history.back(); + // #endif + } + }, + onShow: function () { + this.getArticleOne(); + }, + /** + * 用户点击右上角分享 + */ + // #ifdef MP + onShareAppMessage: function() { + return { + title: this.articleInfo.title, + imageUrl: this.articleInfo.imageInput.length ? this.articleInfo.imageInput[0] : "", + desc: this.articleInfo.synopsis, + path: '/pages/news_details/index?id=' + this.id + }; + }, + // #endif methods: { - getArticleOne:function(){ + getArticleOne:function(){ let that = this; getArticleDetails({id:that.id}).then(res=>{ uni.setNavigationBarTitle({ @@ -109,7 +111,7 @@ } that.content = res.data.content; // #ifdef H5 - if(this.$wechat.isWeixin()){ + if (this.$wechat.isWeixin()) { this.setShareInfo(); } // #endif diff --git a/pages/news_list/index.vue b/pages/news_list/index.vue index 6fa8e865..bd49668d 100644 --- a/pages/news_list/index.vue +++ b/pages/news_list/index.vue @@ -1,75 +1,76 @@ - -