From d45b5613dd642146029b88384b09a4ab662e52eb Mon Sep 17 00:00:00 2001 From: x3zvawq Date: Fri, 7 Feb 2025 15:57:04 +0800 Subject: [PATCH] =?UTF-8?q?feat(manufacture):=20=E6=8A=80=E8=89=BA?= =?UTF-8?q?=E5=8A=A9=E6=89=8B=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/css/manufacture/cart.less | 180 ++++++++++++ src/assets/css/manufacture/equip.less | 181 ++++++++++++ src/assets/css/manufacture/index.less | 157 ++++++++++ src/assets/css/manufacture/item_price.less | 144 +++++++++ src/assets/css/manufacture/make.less | 80 +++++ src/assets/css/manufacture/plan.less | 154 ++++++++++ src/assets/css/manufacture/recipe.less | 119 ++++++++ src/assets/data/manufacture.json | 17 ++ src/components/manufacture/Cart.vue | 261 ++++++++++++++++ src/components/manufacture/CreatePlan.vue | 148 ++++++++++ src/components/manufacture/Equip.vue | 76 +++++ src/components/manufacture/ItemIcon.vue | 165 +++++++++++ src/components/manufacture/MyList.vue | 130 ++++++++ src/components/manufacture/Plan.vue | 252 ++++++++++++++++ src/components/manufacture/PriceItem.vue | 107 +++++++ src/components/manufacture/Recipe.vue | 310 ++++++++++++++++++++ src/components/manufacture/RecipeDetail.vue | 174 +++++++++++ src/pages/pvg/index.js | 27 ++ src/pages/pvg/router.js | 29 ++ src/pages/pvg/store.js | 16 + src/service/manufacture/item.js | 24 ++ src/service/manufacture/manufacture.js | 48 +++ src/service/manufacture/plan.js | 51 ++++ src/store/bus.js | 3 + src/views/pvg/Index.vue | 43 +++ src/views/pvg/Manufacture.vue | 224 ++++++++++++++ vue.config.js | 6 + 27 files changed, 3126 insertions(+) create mode 100644 src/assets/css/manufacture/cart.less create mode 100644 src/assets/css/manufacture/equip.less create mode 100644 src/assets/css/manufacture/index.less create mode 100644 src/assets/css/manufacture/item_price.less create mode 100644 src/assets/css/manufacture/make.less create mode 100644 src/assets/css/manufacture/plan.less create mode 100644 src/assets/css/manufacture/recipe.less create mode 100644 src/assets/data/manufacture.json create mode 100644 src/components/manufacture/Cart.vue create mode 100644 src/components/manufacture/CreatePlan.vue create mode 100644 src/components/manufacture/Equip.vue create mode 100644 src/components/manufacture/ItemIcon.vue create mode 100644 src/components/manufacture/MyList.vue create mode 100644 src/components/manufacture/Plan.vue create mode 100644 src/components/manufacture/PriceItem.vue create mode 100644 src/components/manufacture/Recipe.vue create mode 100644 src/components/manufacture/RecipeDetail.vue create mode 100644 src/pages/pvg/index.js create mode 100644 src/pages/pvg/router.js create mode 100644 src/pages/pvg/store.js create mode 100644 src/service/manufacture/item.js create mode 100644 src/service/manufacture/manufacture.js create mode 100644 src/service/manufacture/plan.js create mode 100644 src/store/bus.js create mode 100644 src/views/pvg/Index.vue create mode 100644 src/views/pvg/Manufacture.vue diff --git a/src/assets/css/manufacture/cart.less b/src/assets/css/manufacture/cart.less new file mode 100644 index 00000000..473dea47 --- /dev/null +++ b/src/assets/css/manufacture/cart.less @@ -0,0 +1,180 @@ +.m-manufacture { + .pt(40px); +} +.m-manufacture-title { + .u-del { + .fz(16px); + background: #fff; + letter-spacing: 1px; + border: 1px solid #fff; + &:hover { + background: #07ad36; + border: 1px solid #07ad36; + } + } +} +.m-manufacture-title__myList { + .flex; + .pr(20px); + align-items: center; + justify-content: space-between; +} +.m-cart-body { + .flex; + .w(420px); + .r(10px); + gap: 20px; + justify-content: space-between; + flex-direction: column; + box-sizing: border-box; + min-height: 700px; + .m-cart-scroll { + .pr(10px); + width: calc(100% - 10px); + overflow: auto; + min-height: 530px; + max-height: calc(100vh - 415px); + } + + .m-cart-list { + .r(10px); + background-color: #fff; + min-height: 530px; + padding: 20px; + box-sizing: border-box; + } + .m-title { + .flex; + justify-content: space-between; + align-items: center; + border-bottom: 3px double #eee; + .u-label { + .bold; + .fz(20px,2.5); + i { + .mr(5px); + } + } + } + .m-item { + padding: 10px 0; + border-bottom: 1px solid #dcdfe6; + &:last-child { + border-bottom: 0; + } + .u-header { + display: flex; + justify-content: space-between; + padding: 10px 2px 5px 2px; + .u-header-inner { + .flex; + } + .u-img { + .mr(10px); + .size(24px); + } + .u-title { + .fz(14px,24px); + .bold; + } + .u-del { + background: #fff; + letter-spacing: 1px; + &:hover { + background: #07ad36; + border: 1px solid #07ad36; + } + } + } + .u-info { + .el-divider { + margin-top: 10px; + margin-bottom: 10px; + } + .el-divider__text { + color: #999; + .fz(12px); + .pl(10px); + .pr(10px); + } + .u-children { + .ml(1em); + .pt(10px); + } + .u-child { + .flex; + align-items: center; + justify-content: space-between; + .mb(5px); + &:hover { + background-color: @bg-gray; + } + .u-img { + .flex; + align-items: center; + img { + .size(24px); + } + span { + .fz(12px); + .ml(5px); + opacity: 0.8; + } + } + .c-game-price { + .fz(12px); + } + } + .u-item-num { + .flex; + .fz(13px); + .pt(10px); + justify-content: flex-end; + align-items: center; + } + } + } + + .m-null { + .fz(15px); + .r(10px); + .x; + .flex; + justify-content: center; + align-items: center; + min-height: 530px; + line-height: calc(100vh - 415px); + color: #999; + background-color: #fff; + } + .m-all { + display: flex; + padding: 10px 0; + justify-content: space-between; + + .u-label { + .bold; + } + .u-value { + .fz(13px,2); + b, + .u-price-num span { + color: #c00; + .bold; + } + } + .u-num { + .flex; + justify-content: flex-end; + } + } +} +.m-stat { + .size(calc(100% - 10px),144px); + .r(10px); + box-sizing: border-box; + background-color: #fff; + right: 0; + bottom: 0; + padding: 20px; +} diff --git a/src/assets/css/manufacture/equip.less b/src/assets/css/manufacture/equip.less new file mode 100644 index 00000000..6b53a418 --- /dev/null +++ b/src/assets/css/manufacture/equip.less @@ -0,0 +1,181 @@ +.m-plan-equip { + .size(520px, 720px); + background-color: @bg-black; + border: 6px solid #444; + .r(6px); + .auto(x); + + .u-info { + .mt(120px); + .w(280px); + .auto(x); + .x; + } + .u-title { + .nobreak; + .fz(1rem, 2); + .bold; + color: #fff; + } + + .u-author { + img { + .r(2px); + .size(20px); + .y; + } + img { + .mr(5px); + } + span { + .fz(13px, 2.5); + color: #ccc; + } + } + + .u-time { + color: #999; + .fz(12px); + } + + .u-qrcodebox { + .mt(60px); + .w(140px); + .auto(x); + + .w-qrcode-static { + .u-txt { + .mt(10px); + color: #999; + .fz(12px, 16px); + } + svg { + fill: #999; + .size(16px); + .y(-4px); + } + .u-pic { + .r(2px); + padding: 10px 8px 8px 8px; + } + } + } + + .pr; + .u-plan-equip { + .pa; + .flex; + flex-direction: column; + .u-name { + .w(150px); + margin: 5px 0 0 0; + .x; + } + .quality-1 { + color: #fff; + } + .quality-2 { + color: #00d24b; + } + .quality-3 { + color: #007eff; + } + .quality-4 { + color: #ff2dff; + } + .quality-5 { + color: #ffa500; + } + } + + .u-equip-melee_weapon { + .lt(120px, 600px); + } + .u-equip-range_weapon { + .lt(240px, 600px); + } + + .u-equip-helm { + .lt(-10px, 70px); + } + + .u-equip-chest { + .lt(-10px, 250px); + } + + .u-equip-waist { + .lt(-10px, 430px); + } + + .u-equip-bangle { + .lt(380px, 70px); + } + + .u-equip-pants { + .lt(380px, 160px); + } + + .u-equip-boots { + .lt(380px, 250px); + } + + .u-equip-amulet { + .lt(380px, 340px); + } + + .u-equip-pendant { + .lt(380px, 430px); + } + + .u-equip-ring_1 { + .lt(380px, 520px); + } + + .u-equip-ring_2 { + .lt(380px, 610px); + } + + .u-misc { + .pa; + .lt(30px, 600px); + } + + .u-logo { + .db; + svg, + span { + transition: 0.2s ease-in-out; + } + svg { + .size(56px); + fill: #fff; + } + span { + .db; + color: #fff; + font-family: Consolas; + .fz(12px); + // .bold; + } + &:hover { + span { + color: #0cf; + } + svg { + fill: #0cf; + } + } + } + + .u-meta { + .fz(12px); + .db; + color: #fff; + } +} +.u-plan-equip { + .m-item-icon { + flex-direction: column; + align-items: center; + } +} diff --git a/src/assets/css/manufacture/index.less b/src/assets/css/manufacture/index.less new file mode 100644 index 00000000..8cb5bbc3 --- /dev/null +++ b/src/assets/css/manufacture/index.less @@ -0,0 +1,157 @@ +.m-manufacture-container { + padding: 20px 0; +} + +.m-manufacture-header { + // padding: 20px 0; + // .x; + display: flex; + align-items: flex-end; + + .u-title { + margin: 0; + font-weight: 300; + } + + .u-settings { + .ml(10px); + } + + .u-servers { + .el-input__prefix { + left: 1px; + top: 1px; + .r(5px); + } + .el-input--prefix .el-input__inner { + padding-left: 150px; + width: 280px; + } + + .u-prefix { + .db; + .h(30px); + .lh(30px); + + background-color: #f5f7fa; + color: #909399; + + border-right: 1px solid #dcdfe6; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; + + padding: 0 10px; + white-space: nowrap; + } + } + + padding-bottom: 10px; + border-bottom: 1px solid #eee; +} + +.m-manufacture-sidebar { + border-right: 1px solid @border-hr; + + .u-tabs { + .mb(10px); + .r(4px); + user-select: none; + background-color: @bg-light; + display: inline-flex; + justify-content: center; + align-items: center; + padding: 10px 1px; + border: 1px solid #eee; + box-sizing: border-box; + width: 100%; + + .u-tab { + .w(45px); + .x; + .fz(15px); + .bold; + .pointer; + filter: grayscale(100%); + background-repeat: no-repeat; + background-size: 42px; + background-position: top center; + margin: 0 17px; + .pt(39px); + color: @color; + &:hover { + filter: grayscale(0); + } + } + .active { + color: @color-link; + filter: grayscale(0); + } + .u-tab-tailoring { + background-image: url("@{img_path}image/cooking/newcraft1-37.png"); + &:hover { + background-image: url("@{img_path}image/cooking/newcraft1-38.png"); + } + } + .u-tab-cooking { + background-image: url("@{img_path}image/cooking/newcraft1-45.png"); + &:hover { + background-image: url("@{img_path}image/cooking/newcraft1-46.png"); + } + } + .u-tab-medicine { + background-image: url("@{img_path}image/cooking/newcraft1-65.png"); + &:hover { + background-image: url("@{img_path}image/cooking/newcraft1-67.png"); + } + } + .u-tab-founding { + background-image: url("@{img_path}image/cooking/newcraft1-69.png"); + &:hover { + background-image: url("@{img_path}image/cooking/newcraft1-70.png"); + } + } + .u-tab-furniture { + background-image: url("@{img_path}image/cooking/newcraft1-91.png"); + &:hover { + background-image: url("@{img_path}image/cooking/newcraft1-92.png"); + } + } + } + + .m-list .u-list { + height: 75vh; + overflow-y: auto; + } +} + +.m-manufacture-main { + .flex; + .mt(10px); + .r(5px); + width: 100%; + box-sizing: border-box; +} + +.m-manufacture-sidebar { + flex-shrink: 0; + flex-basis: 400px; + padding-right: 20px; +} + +.m-manufacture-content { + display: flex; + padding: 0 20px; + gap: 20px; + flex-grow: 1; + + .u-middle { + flex: 1 1 520px; + background-color: @bg-light; + .r(4px); + padding: 40px 80px; + border: 1px solid #eee; + } + .u-right { + flex: 1 0 350px; + } +} diff --git a/src/assets/css/manufacture/item_price.less b/src/assets/css/manufacture/item_price.less new file mode 100644 index 00000000..d388b6e6 --- /dev/null +++ b/src/assets/css/manufacture/item_price.less @@ -0,0 +1,144 @@ +.m-item_price { + padding: 20px 0; + .m-header { + .flex; + padding-bottom: 10px; + border-bottom: 1px solid #eee; + align-items: flex-end; + gap: 10px; + .u-title { + font-weight: 300; + margin: 0; + flex-shrink: 0; + } + .u-servers { + .el-input__prefix { + left: 1px; + top: 1px; + .r(5px); + } + .el-input--prefix .el-input__inner { + padding-left: 150px; + width: 280px; + } + + .u-prefix { + .db; + .h(30px); + .lh(30px); + + background-color: #f5f7fa; + color: #909399; + + border-right: 1px solid #dcdfe6; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; + + padding: 0 10px; + white-space: nowrap; + } + } + } + .m-search { + margin: 20px 0; + .u-search { + .lh(36px); + input { + height: 38px; + } + } + } +} + +.m-transaction-box { + max-height: 400px; + overflow-y: auto; + overflow-x: hidden; +} + +.m-price-list { + animation: priceAni 10s linear infinite; + + .m-item { + .r(5px); + padding: 20px 10px 10px 10px; + background-color: #fafbfc; + .mt(20px); + } + .u-group-title { + .mb(20px); + font-weight: 600; + color: #666666; + padding: 0 10px; + } + + .u-item { + .db; + .clearfix; + .mb(10px); + cursor: pointer; + transition: 0.1s ease-in-out; + &:hover { + background-color: #ceefff; + } + } + + .u-icon { + .fl; + .mr(10px); + .size(32px); + } + + .u-content { + display: flex; + align-items: center; + justify-content: space-between; + .fz(12px, 32px); + .bold; + } + + .u-name { + .db; + // max-width: 180px; + overflow: hidden; + .nobreak; + } + + .u-price { + color: @color; + white-space: nowrap; + } + .u-trending { + &.up { + color: #fc3c3c; + } + &.down { + color: #49c10f; + } + &.keep { + color: #aaa; + } + } +} + +@media screen and (max-width: 1980px) { + .m-price-list { + .el-col { + .w(33%); + } + } +} +@media screen and (max-width: @smallpc) { + .m-price-list { + .el-col { + .w(50%); + } + } +} +@media screen and (max-width: @phone) { + .m-price-list { + .el-col { + .w(100%); + } + } +} diff --git a/src/assets/css/manufacture/make.less b/src/assets/css/manufacture/make.less new file mode 100644 index 00000000..2aa9ea17 --- /dev/null +++ b/src/assets/css/manufacture/make.less @@ -0,0 +1,80 @@ +.m-manufacture-make { + .m-list { + .u-input { + .mb(10px); + } + .u-null { + .db; + .x; + .r(5px); + .fz(14px,3); + .pointer; + // background-color: #eee; + color: @color; + } + } + .u-list { + .fz(15px,2); + padding: 0 10px; + background-color: #fff; + border: 1px solid @border-hr; + .r(3px); + .pointer; + .el-collapse-item__header { + .bold; + letter-spacing: 5px; + text-indent: 1em; + } + } + .u-child-title { + .x; + .bold; + .fz(15px,2); + .mb(15px); + border-bottom: 1px solid @border-hr; + } + .u-child { + .flex; + .pointer; + .fz(14px,30px); + .r(3px); + padding: 5px 5px 5px 1em; + justify-content: space-between; + &:hover { + background-color: #ecf4ff; + } + &.active { + background-color: #fff4ca; + &:hover { + .u-btn { + .flex; + } + } + } + .u-label { + .flex; + align-items: center; + .u-img { + .size(24px); + .mr(6px); + } + span { + .fz(13px); + .w(180px); + .nobreak; + .bold; + } + } + .u-btn { + .none; + align-items: center; + .el-input-number--mini { + width: 110px; + .mr(5px); + } + } + } + .m-detail { + padding: 20px; + } +} diff --git a/src/assets/css/manufacture/plan.less b/src/assets/css/manufacture/plan.less new file mode 100644 index 00000000..d5a17945 --- /dev/null +++ b/src/assets/css/manufacture/plan.less @@ -0,0 +1,154 @@ +.m-plan-dialog { + .w(100%); + max-width: 800px; + .el-dialog__body { + .pt(0); + } + .m-dialog-content { + .flex; + flex-direction: column; + gap: 20px; + min-height: 300px; + } + + .m-plan-description { + .flex; + gap: 10px; + flex-direction: column; + color: #3d454d; + .u-time { + .fz(12px); + .color(#999); + } + .u-title b { + .bold; + .fz(16px); + } + .u-del { + .ml(20px); + .color(#007eff); + .pointer; + &:hover { + filter: brightness(110%); + } + } + } + + .m-plan-item { + .flex; + flex-direction: column; + gap: 20px; + .m-border { + .flex; + .r(10px); + flex-direction: column; + gap: 20px; + padding: 10px 20px; + border: 1px solid #eee; + background-color: #f9f9f9; + .m-content { + .flex; + flex-wrap: wrap; + gap: 10px; + } + .u-title { + .fz(16px,2); + .bold; + .x; + border-bottom: 1px solid #ddd; + } + + .u-item { + .flex; + margin: 0 20px 10px 0; + flex-direction: column; + align-items: center; + gap: 5px; + + .u-name { + .fz(12px); + } + } + .u-img { + .pr; + .u-count { + .pa; + .rb(0,0); + .fz(12px); + .z(3); + color: #fff; + text-align: right; + padding: 0 3px 0 5px; + background-color: rgba(0, 0, 0, 0.6); + border-radius: 3px 0 0 3px; + &::before { + content: "×"; + } + } + } + } + } + // 装备 + .m-plan-equips { + padding: 30px 0 0 0; + .m-content { + .flex; + .pt(40px); + flex-direction: row; + gap: 10px; + } + .m-item-icon { + .fz(12px); + } + .u-list { + width: 25%; + .u-item { + .r(5px); + .mb(10px); + border: 1px solid #eee; + padding: 10px; + .u-title { + .db; + } + } + .u-equip, + .u-equip-null { + .db; + .mt(10px); + } + .u-equip { + .pr; + .r(5px); + background-color: @color; + &:first-child:before { + content: "主"; + .pa; + .r(4px); + .bold; + .x; + .lh(24px); + .lt(-26px,2px); + width: 24px; + color: #fff; + background-color: #0366d6; + border: 1px solid #0366d6; + } + } + } + } + .quality-1 { + color: #888; + } + .quality-2 { + color: #00d24b; + } + .quality-3 { + color: #007eff; + } + .quality-4 { + color: #ff2dff; + } + .quality-5 { + color: #ffa500; + } +} diff --git a/src/assets/css/manufacture/recipe.less b/src/assets/css/manufacture/recipe.less new file mode 100644 index 00000000..ddb0327e --- /dev/null +++ b/src/assets/css/manufacture/recipe.less @@ -0,0 +1,119 @@ +.m-recipe-detail { + .flex; + .w(100%); + gap: 20px; + flex-direction: column; + padding: 20px 15px; + .m-item { + .flex; + .fz(14px); + gap: 10px; + color: #000; + align-items: center; + .u-name { + .fz(20px,32px); + .bold; + } + .m-text { + .flex; + flex-direction: column; + gap: 10px; + } + .u-info span { + .mr(10px); + } + } + + .u-img { + .pr; + .size(58px); + .r(5px); + .clip; + flex-shrink: 0; + img { + .full; + } + .u-border { + .pa; + .lt(0,0); + .size(100%); + box-sizing: border-box; + background-size: contain; + .z(2); + } + .u-amount { + .pa; + .rb(2px,2px); + .fz(14px); + .color(white); + .z(3); + text-shadow: black 0 0 4px; + font-weight: bolder; + } + } + + .u-price { + .fz(12px); + .mt(10px); + opacity: 0.9; + .u-price-num, + .u-null { + .bold; + color: #c00; + } + .u-null { + .ml(10px); + color: #d00; + } + } + .u-desc { + .fz(13px,1.5); + opacity: 0.8; + } + .u-children { + .flex; + .w(100%); + flex-direction: column; + .el-divider__text { + background-color: #fafafa; + padding: 0 10px; + } + } + .u-child { + .flex; + padding: 10px 0; + align-items: center; + border-bottom: 1px solid #ddd; + .u-img { + .mr(20px); + .size(48px); + } + .u-info { + .flex; + flex-direction: column; + .u-name { + .flex; + .fz(16px,1.2); + .bold; + align-items: baseline; + .u-num { + .fz(12px); + .pl(20px); + font-weight: normal; + } + } + } + } + .m-add { + .flex; + .pt(20px); + justify-content: center; + .el-input-number { + .mr(20px); + } + } +} + +.u-icon-popper { + padding: 0; +} diff --git a/src/assets/data/manufacture.json b/src/assets/data/manufacture.json new file mode 100644 index 00000000..ebe2e7ce --- /dev/null +++ b/src/assets/data/manufacture.json @@ -0,0 +1,17 @@ +{ + "craft_types": { + "std": [ + { "key": "tailoring", "name": "缝纫", "ProfessionID": "5" }, + { "key": "cooking", "name": "烹饪", "ProfessionID": "4" }, + { "key": "medicine", "name": "制药", "ProfessionID": "7" }, + { "key": "founding", "name": "锻造", "ProfessionID": "6" }, + { "key": "furniture", "name": "梓匠", "ProfessionID": "15" } + ], + "origin": [ + { "key": "tailoring", "name": "缝纫", "ProfessionID": "5" }, + { "key": "cooking", "name": "烹饪", "ProfessionID": "4" }, + { "key": "medicine", "name": "制药", "ProfessionID": "7" }, + { "key": "founding", "name": "锻造", "ProfessionID": "6" } + ] + } +} diff --git a/src/components/manufacture/Cart.vue b/src/components/manufacture/Cart.vue new file mode 100644 index 00000000..97e8c251 --- /dev/null +++ b/src/components/manufacture/Cart.vue @@ -0,0 +1,261 @@ + + + + diff --git a/src/components/manufacture/CreatePlan.vue b/src/components/manufacture/CreatePlan.vue new file mode 100644 index 00000000..ba2981af --- /dev/null +++ b/src/components/manufacture/CreatePlan.vue @@ -0,0 +1,148 @@ + + + + + diff --git a/src/components/manufacture/Equip.vue b/src/components/manufacture/Equip.vue new file mode 100644 index 00000000..184fd091 --- /dev/null +++ b/src/components/manufacture/Equip.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/src/components/manufacture/ItemIcon.vue b/src/components/manufacture/ItemIcon.vue new file mode 100644 index 00000000..815c3278 --- /dev/null +++ b/src/components/manufacture/ItemIcon.vue @@ -0,0 +1,165 @@ + + + + + diff --git a/src/components/manufacture/MyList.vue b/src/components/manufacture/MyList.vue new file mode 100644 index 00000000..4accb676 --- /dev/null +++ b/src/components/manufacture/MyList.vue @@ -0,0 +1,130 @@ + + + + + diff --git a/src/components/manufacture/Plan.vue b/src/components/manufacture/Plan.vue new file mode 100644 index 00000000..c95b237d --- /dev/null +++ b/src/components/manufacture/Plan.vue @@ -0,0 +1,252 @@ + + + diff --git a/src/components/manufacture/PriceItem.vue b/src/components/manufacture/PriceItem.vue new file mode 100644 index 00000000..05fe5abb --- /dev/null +++ b/src/components/manufacture/PriceItem.vue @@ -0,0 +1,107 @@ + + + diff --git a/src/components/manufacture/Recipe.vue b/src/components/manufacture/Recipe.vue new file mode 100644 index 00000000..a9df705f --- /dev/null +++ b/src/components/manufacture/Recipe.vue @@ -0,0 +1,310 @@ + + + diff --git a/src/components/manufacture/RecipeDetail.vue b/src/components/manufacture/RecipeDetail.vue new file mode 100644 index 00000000..e8afafc7 --- /dev/null +++ b/src/components/manufacture/RecipeDetail.vue @@ -0,0 +1,174 @@ + + + diff --git a/src/pages/pvg/index.js b/src/pages/pvg/index.js new file mode 100644 index 00000000..8ea8d2f4 --- /dev/null +++ b/src/pages/pvg/index.js @@ -0,0 +1,27 @@ +Vue.config.productionTip = false; + +// 第三方UI组件 +import Vue from "vue"; +import ElementUI from "element-ui"; +Vue.use(ElementUI); + +// 通用UI模块 +import JX3BOX_UI from '@jx3box/jx3box-common-ui' +import "@jx3box/jx3box-common/css/element.css"; +import "@jx3box/jx3box-common/css/normalize.css"; +Vue.use(JX3BOX_UI); + +import reporter from "@jx3box/jx3box-common/js/reporter"; +reporter.install(Vue); + +// 数据与路由 +import router from "./router"; +import store from "./store"; + +import App from "@/views/pvg/Index.vue"; +new Vue({ + router, + store, + render: h => h(App), +}).$mount("#app"); + diff --git a/src/pages/pvg/router.js b/src/pages/pvg/router.js new file mode 100644 index 00000000..a4ed2db2 --- /dev/null +++ b/src/pages/pvg/router.js @@ -0,0 +1,29 @@ +import Vue from "vue"; +import VueRouter from "vue-router"; + +// 解决重复点击路由报错的BUG +const originalPush = VueRouter.prototype.push; +VueRouter.prototype.push = function push(location) { + return originalPush.call(this, location).catch((err) => err); +}; + +Vue.use(VueRouter); + +const routes = [ + { + name: "manufacture", + path: "/manufacture", + component: () => import("@/views/pvg/Manufacture.vue"), + meta: { + name: "技艺助手", + }, + }, +]; + +const router = new VueRouter({ + mode: "history", + base: "/pvg", + routes, +}); + +export default router; diff --git a/src/pages/pvg/store.js b/src/pages/pvg/store.js new file mode 100644 index 00000000..46c294a6 --- /dev/null +++ b/src/pages/pvg/store.js @@ -0,0 +1,16 @@ +import Vue from "vue"; +import Vuex from "vuex"; + +Vue.use(Vuex); + +let store = { + state: { + client: location.href.includes("origin") ? "origin" : "std", + }, + mutations: {}, + getters: {}, + actions: {}, + modules: {}, +}; + +export default new Vuex.Store(store); diff --git a/src/service/manufacture/item.js b/src/service/manufacture/item.js new file mode 100644 index 00000000..121d1173 --- /dev/null +++ b/src/service/manufacture/item.js @@ -0,0 +1,24 @@ +import { $cms, $next, $node } from "@jx3box/jx3box-common/js/https"; + +function getProfile() { + return $cms({ mute: true }) + .get("/api/cms/user/my/profile") + .then((res) => { + return res.data.data; + }); +} + +function getGoodsData(params) { + return $next().get(`api/item-groups/with-prices`, { + params, + }); +} + +// 获取物品 +function get_item(item_id) { + if (!item_id) return; + return $node().get(`/item/${item_id}`); +} + + +export { getProfile, getGoodsData, get_item }; diff --git a/src/service/manufacture/manufacture.js b/src/service/manufacture/manufacture.js new file mode 100644 index 00000000..c5b8d1aa --- /dev/null +++ b/src/service/manufacture/manufacture.js @@ -0,0 +1,48 @@ +import { $node, $cms, $next } from "@jx3box/jx3box-common/js/https"; +import { __dataPath } from "@jx3box/jx3box-common/data/jx3box.json"; +import axios from "axios"; +const $n = $node(); + +// 获取技艺分组分类 +async function getCraftJson() { + const res = await axios.get(`${__dataPath}pvx/manufacture/output/craft_belong.json`); + return res; +} +// 获取技艺某种类型的列表 +function getManufactures(params) { + return $n.get("/manufactures", { params }); +} +// 获取技艺某种类型的单个详细信息 +function getManufactureItem(type, id, client = "std") { + return $n.get(`/manufacture/${type}/${id}`, { + params: { + client, + }, + }); +} +// 根据ids获取对应信息 +function getOther(params) { + return $n.get(`/other`, { params }); +} +// 获取商店物品价格 +function getItemsPrice(params) { + return $n.get(`/craft/price`, { params }); +} +// 获取交易行物品价格 +function getAuctionPrice(params) { + return $next().get(`/api/item-price/list`, { params }); +} + +function getUserInfo() { + return $cms().get("/api/cms/user/my/info"); +} + +export { + getManufactures, + getManufactureItem, + getCraftJson, + getOther, + getItemsPrice, + getAuctionPrice, + getUserInfo, +}; \ No newline at end of file diff --git a/src/service/manufacture/plan.js b/src/service/manufacture/plan.js new file mode 100644 index 00000000..8367807f --- /dev/null +++ b/src/service/manufacture/plan.js @@ -0,0 +1,51 @@ +import { $cms, $node } from "@jx3box/jx3box-common/js/https"; + + +// 获取列表 +function getItemPlans(params) { + return $cms() + .get(`/api/cms/app/item-plan`, { params }) + .then((res) => { + return res.data.data; + }); +} +// 单个清单搜索 +function getItemPlanID(id) { + return $cms() + .get(`/api/cms/app/item-plan/${id}`) + .then((res) => { + return res.data.data; + }); +} +// 删除清单 +function delItemPlan(id) { + return $cms().delete(`/api/cms/app/item-plan/${id}`); +} + +// 多个清单搜索 +function searchItemsID(params) { + return $node() + .get(`/item/list`, { params }) + .then((res) => { + return res.data.data; + }); +} +// 获取我的清单 +function getMyPlans() { + return $cms() + .get(`/api/cms/app/item-plan/mine`, { params: { no_page: 1, _no_cache: 1 } }) + .then((res) => { + return res.data.data; + }); +} + +function updatePlan(id, data) { + return $cms().put(`/api/cms/app/item-plan/${id}`, data); +} + +// 新增清单 +function addMyPlan(data) { + return $cms().post(`/api/cms/app/item-plan`, data); +} + +export { getItemPlans, getItemPlanID, delItemPlan, searchItemsID, getMyPlans, updatePlan, addMyPlan }; diff --git a/src/store/bus.js b/src/store/bus.js new file mode 100644 index 00000000..a71854ea --- /dev/null +++ b/src/store/bus.js @@ -0,0 +1,3 @@ +import Vue from "vue"; +const Bus = new Vue(); +export default Bus \ No newline at end of file diff --git a/src/views/pvg/Index.vue b/src/views/pvg/Index.vue new file mode 100644 index 00000000..3d3d2aaa --- /dev/null +++ b/src/views/pvg/Index.vue @@ -0,0 +1,43 @@ + + + + + diff --git a/src/views/pvg/Manufacture.vue b/src/views/pvg/Manufacture.vue new file mode 100644 index 00000000..aac6952a --- /dev/null +++ b/src/views/pvg/Manufacture.vue @@ -0,0 +1,224 @@ + + + + + diff --git a/vue.config.js b/vue.config.js index e8b7c921..ae8ddace 100644 --- a/vue.config.js +++ b/vue.config.js @@ -14,6 +14,12 @@ module.exports = { template: "public/index.html", filename: "adventure/index.html", }, + pvg: { + title: "商贾奇才 - JX3BOX", + entry: "src/pages/pvg/index.js", + template: "public/index.html", + filename: "pvg/index.html", + } }, //❤️ Proxy ~