diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/BaseController/BaseSimpleCrudController.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/BaseController/BaseSimpleCrudController.cs index c3969036..b285609e 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/BaseController/BaseSimpleCrudController.cs +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/BaseController/BaseSimpleCrudController.cs @@ -31,7 +31,6 @@ namespace Yi.Framework.ApiMicroservice.Controllers /// /// /// - [Permission($"{nameof(T)}:get")] [Route("{id}")] [HttpGet] public virtual async Task GetById([FromRoute]long id) diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/Shop/SpuController.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/Shop/SpuController.cs index bd4e9dc7..48030c83 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/Shop/SpuController.cs +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/Shop/SpuController.cs @@ -36,6 +36,13 @@ namespace Yi.Framework.ApiMicroservice.Controllers return Result.Success().SetData(await _iSpuService.SelctPageList(eneity, page)); } + [Route("{id}")] + [HttpGet] + public override async Task GetById([FromRoute] long id) + { + return Result.Success().SetData(await _repository._DbQueryable.Includes(u=>u.Skus).SingleAsync(u=>u.Id.Equals(id))); + } + diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/System/AccountController.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/System/AccountController.cs index 574d6680..6d34d03f 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/System/AccountController.cs +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/System/AccountController.cs @@ -122,7 +122,6 @@ namespace Yi.Framework.ApiMicroservice.Controllers /// /// [HttpGet] - //[Authorize] public async Task GetUserAllInfo() { //通过鉴权jwt获取到用户的id diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db index a80e2499..2888ca2c 100644 Binary files a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db and b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db differ diff --git a/Yi.Framework.Net6/Yi.Framework.WebCore/MiddlewareExtend/ErrorHandExtension.cs b/Yi.Framework.Net6/Yi.Framework.WebCore/MiddlewareExtend/ErrorHandExtension.cs index 63e3ce36..256dced0 100644 --- a/Yi.Framework.Net6/Yi.Framework.WebCore/MiddlewareExtend/ErrorHandExtension.cs +++ b/Yi.Framework.Net6/Yi.Framework.WebCore/MiddlewareExtend/ErrorHandExtension.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Yi.Framework.Common.Enum; using Yi.Framework.Common.Models; namespace Yi.Framework.WebCore.MiddlewareExtend @@ -69,8 +70,10 @@ namespace Yi.Framework.WebCore.MiddlewareExtend { resp = Result.Error(msg); } + resp.SetCode((ResultCodeEnum)statusCode); var result = JsonConvert.SerializeObject(resp); context.Response.ContentType = "application/json;charset=utf-8"; + return context.Response.WriteAsync(result); } } diff --git a/Yi.Vue3.x.Vant/components.d.ts b/Yi.Vue3.x.Vant/components.d.ts index 9709bee6..26d80cd0 100644 --- a/Yi.Vue3.x.Vant/components.d.ts +++ b/Yi.Vue3.x.Vant/components.d.ts @@ -7,14 +7,19 @@ export {} declare module '@vue/runtime-core' { export interface GlobalComponents { + AppCard: typeof import('./src/components/AppCard.vue')['default'] AppCreateTime: typeof import('./src/components/AppCreateTime.vue')['default'] AppGrid: typeof import('./src/components/AppGrid.vue')['default'] AppUserIcon: typeof import('./src/components/AppUserIcon.vue')['default'] HelloWorld: typeof import('./src/components/HelloWorld.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + VanActionBar: typeof import('vant/es')['ActionBar'] + VanActionBarButton: typeof import('vant/es')['ActionBarButton'] + VanActionBarIcon: typeof import('vant/es')['ActionBarIcon'] VanActionSheet: typeof import('vant/es')['ActionSheet'] VanButton: typeof import('vant/es')['Button'] + VanCell: typeof import('vant/es')['Cell'] VanCellGroup: typeof import('vant/es')['CellGroup'] VanCol: typeof import('vant/es')['Col'] VanDivider: typeof import('vant/es')['Divider'] @@ -26,6 +31,7 @@ declare module '@vue/runtime-core' { VanList: typeof import('vant/es')['List'] VanLoading: typeof import('vant/es')['Loading'] VanNavBar: typeof import('vant/es')['NavBar'] + VanPopup: typeof import('vant/es')['Popup'] VanPullRefresh: typeof import('vant/es')['PullRefresh'] VanRow: typeof import('vant/es')['Row'] VanSticky: typeof import('vant/es')['Sticky'] diff --git a/Yi.Vue3.x.Vant/src/api/spuApi.ts b/Yi.Vue3.x.Vant/src/api/spuApi.ts index 9f52a64f..e2a1faf2 100644 --- a/Yi.Vue3.x.Vant/src/api/spuApi.ts +++ b/Yi.Vue3.x.Vant/src/api/spuApi.ts @@ -1,18 +1,25 @@ import myaxios from '@/utils/myaxios' export default { - add(data:any) { - return myaxios({ - url: `/spu/add`, - method: 'post', - data: data - }) - }, - pageList(data:any) { - return myaxios({ - url: '/spu/pageList', - method: 'get', - params: data - }) - } + add(data: any) { + return myaxios({ + url: `/spu/add`, + method: 'post', + data: data + }) + }, + pageList(data: any) { + return myaxios({ + url: '/spu/pageList', + method: 'get', + params: data + }) + }, + getById(id: any) { + return myaxios({ + url: `/spu/GetById/${id}`, + method: 'get', + }) + }, + } \ No newline at end of file diff --git a/Yi.Vue3.x.Vant/src/components/AppCard.vue b/Yi.Vue3.x.Vant/src/components/AppCard.vue new file mode 100644 index 00000000..50f18f95 --- /dev/null +++ b/Yi.Vue3.x.Vant/src/components/AppCard.vue @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + +¥79.0 + + + + + \ No newline at end of file diff --git a/Yi.Vue3.x.Vant/src/view/shop/shopDetails.vue b/Yi.Vue3.x.Vant/src/view/shop/shopDetails.vue index f99b463c..563411a4 100644 --- a/Yi.Vue3.x.Vant/src/view/shop/shopDetails.vue +++ b/Yi.Vue3.x.Vant/src/view/shop/shopDetails.vue @@ -1,5 +1,44 @@ - 这里是商品详情页 + 这里是商品详情页,当所有规格组全部选择完后,就会匹配sku列表,匹配成功才显示价格,即绑定好的sku + + 商品名称:{{spuItem.spuName}} + 规格组: {{spec.specsGroupName}} + 规格值: {{name}} + + + + 价格:{{sku.price}}Sku:{{sku}} + + + + 返回商品首页 - \ No newline at end of file + + + + + + + + + +> \ No newline at end of file diff --git a/Yi.Vue3.x.Vant/src/view/shop/shopIndex.vue b/Yi.Vue3.x.Vant/src/view/shop/shopIndex.vue index 5880c164..18cf4dcf 100644 --- a/Yi.Vue3.x.Vant/src/view/shop/shopIndex.vue +++ b/Yi.Vue3.x.Vant/src/view/shop/shopIndex.vue @@ -1,23 +1,68 @@ - 这里是商城主页 - - 1 - 2 - 3 - 4 - - - - + + + + + 1 + 2 + 3 + 4 + + + + + + + + + + + + 点击前往搜索 - + + + \ No newline at end of file diff --git a/Yi.Vue3.x.Vant/src/view/shop/shopSearch.vue b/Yi.Vue3.x.Vant/src/view/shop/shopSearch.vue index 1bab92f2..0e478c53 100644 --- a/Yi.Vue3.x.Vant/src/view/shop/shopSearch.vue +++ b/Yi.Vue3.x.Vant/src/view/shop/shopSearch.vue @@ -1,14 +1,16 @@ 这里是商品搜索页 - 点击进入商品详情 + 返回商品首页 这个是spu: + 商品名称:{{item.spuName}} + 点击进入该商品详情 规格组: {{spec.specsGroupName}} 规格值: {{name}} - +