From d0a13cc604df5b1ba30f6083800051379b7163ca Mon Sep 17 00:00:00 2001 From: WeiRan <2392355487@qq.com> Date: Tue, 3 Sep 2024 09:40:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E6=AD=A5=E7=BC=96=E5=86=99=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=AC=A1=E6=95=B0=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/apitest/apitest.js | 19 +++++++++ src/api/background/apimanage.js | 7 ++++ src/api/market/product.js | 17 +++++--- src/views/background/apimanage/index.vue | 39 ++++++++++++++---- src/views/background/apiupdmessage/index.vue | 25 ++++++++++-- src/views/market/apitest/index.vue | 43 +++++++++++++++----- src/views/market/product/index.vue | 9 +++- 7 files changed, 132 insertions(+), 27 deletions(-) diff --git a/src/api/apitest/apitest.js b/src/api/apitest/apitest.js index 3d90232..68480e4 100644 --- a/src/api/apitest/apitest.js +++ b/src/api/apitest/apitest.js @@ -10,6 +10,25 @@ export function apitest(email){ } + +export function reducetestcount(data){ + return request({ + url:"/market/product/reducetestcount", + method: "POST", + data: data + }) +} + +export function iftest(data){ + return request({ + url:"/market/product/iftest", + method: "POST", + data: data + }) +} + + + export function sendrequest(options){ // 确保options是一个对象,并且包含必要的属性 if (!options || typeof options !== 'object' || !options.apiRouter || typeof options.parameter === 'undefined') { diff --git a/src/api/background/apimanage.js b/src/api/background/apimanage.js index 6b04e0b..c9f90b9 100644 --- a/src/api/background/apimanage.js +++ b/src/api/background/apimanage.js @@ -47,3 +47,10 @@ export function delapi(productId){ }) } +export function getprice(productId){ + return request({ + url:"/background/apimanage/getprice/"+productId, + method: "POST", + }) +} + diff --git a/src/api/market/product.js b/src/api/market/product.js index 26f0d05..6d639b7 100644 --- a/src/api/market/product.js +++ b/src/api/market/product.js @@ -9,15 +9,14 @@ export function selectList(data){ } -export function selectTypeList(data){ +export function selectTypeList(data) { return request({ - url:"/market/product/typeList", + url: "/market/product/typeList", method: "POST", data: data }) - - -}export function selectproductspecification(data){ +} +export function selectproductspecification(data){ return request({ url:"/market/product/specification", method: "POST", @@ -25,5 +24,13 @@ export function selectTypeList(data){ }) } +export function ifbuy(data){ + return request({ + url:"/market/product/ifbuy", + method: "POST", + data: data + }) +} + diff --git a/src/views/background/apimanage/index.vue b/src/views/background/apimanage/index.vue index 30bd006..53a7aed 100644 --- a/src/views/background/apimanage/index.vue +++ b/src/views/background/apimanage/index.vue @@ -119,7 +119,7 @@ @@ -149,8 +149,13 @@ - - + + + + + + + 价格 @@ -187,14 +192,13 @@ //例如:import 《组件名称》 from '《组件路径》, import { addproduct, - delapi, - productStateLis, - productStateList, + delapi, getprice, selectapiList, UpdproductState } from "@/api/background/apimanage"; import {resetForm} from "@/utils/muyu"; import {add} from "lodash/math"; +import api from "js-cookie"; export default { name: "Apimanage", @@ -205,6 +209,13 @@ export default { //这里存放数据" return { tableData:[], + moneyData:[], + money:{ + timemoney:'', + daymoney:'', + monthmoney:'', + yearmoney:'' + }, ruleForm:{ pageNum:1, pageSize:9, @@ -269,7 +280,21 @@ export default { }, //修改 handleEdit(row){ - this.$router.push({path:"/apiupdmessage/index",query:{api:row}}) + //查询中间表,获取不同规格对应的价格 + getprice(row.productId).then(response=>{ + this.moneyData=response.data + this.money.timemoney=this.moneyData[0].middlePrice + this.money.daymoney=this.moneyData[1].middlePrice + this.money.monthmoney=this.moneyData[2].middlePrice + this.money.yearmoney=this.moneyData[3].middlePrice + row.timemoney = this.money.timemoney; + row.daymoney = this.money.daymoney; + row.monthmoney = this.money.monthmoney; + row.yearmoney = this.money.yearmoney; + this.$router.push({path:"/apiupdmessage/index",query:{api:row}}) + }) + + }, //删除 handleDelete(row){ diff --git a/src/views/background/apiupdmessage/index.vue b/src/views/background/apiupdmessage/index.vue index 97fdbba..55a38b7 100644 --- a/src/views/background/apiupdmessage/index.vue +++ b/src/views/background/apiupdmessage/index.vue @@ -20,9 +20,6 @@ - - - @@ -38,6 +35,28 @@ + + + + + + + + + + 价格 + + + + + + + + + + + + 修改 重置 diff --git a/src/views/market/apitest/index.vue b/src/views/market/apitest/index.vue index 31e9cc1..b157f23 100644 --- a/src/views/market/apitest/index.vue +++ b/src/views/market/apitest/index.vue @@ -19,8 +19,15 @@
- 测试 - 立即申请 + + 立即使用 + 续约 + + + 测试 + 立即申请 + +
@@ -191,7 +198,7 @@