Browse Source

refactor: 更新API接口名称和参数以保持一致性和清晰性

- 将 `addressDefault` 接口更名为 `updateDefaultAddress`,以更清晰地表达其功能
- 将 `iconId` 参数更名为 `shopIconId`,以提高代码的可读性
- 添加 `getClassify` 接口以支持获取分类功能
- 移除不必要的注释代码,保持代码简洁
master
前端-胡立永 3 weeks ago
parent
commit
a6199c7792
4 changed files with 17 additions and 6 deletions
  1. +11
    -0
      api/model/index.js
  2. +4
    -4
      pages/index/category.vue
  3. +1
    -1
      pages_order/mine/address.vue
  4. +1
    -1
      pages_order/product/productList.vue

+ 11
- 0
api/model/index.js View File

@ -16,6 +16,11 @@ const api = {
url: '/index/getProductDetail',
method: 'GET',
},
// 获取分类
getClassify: {
url: '/index/getClassify',
method: 'GET',
},
// 获取商品列表
getProductList: {
url: '/index/getProductList',
@ -86,6 +91,12 @@ const api = {
method: 'POST',
limit : 1000,
},
// 修改默认地址
updateDefaultAddress: {
url: '/info/updateDefaultAddress',
method: 'POST',
limit : 1000,
},
// 删除地址
deleteAddress: {
url: '/info/deleteAddress',


+ 4
- 4
pages/index/category.vue View File

@ -10,9 +10,9 @@
:barItemBadgeStyle="{right:'20px',top:'12px'}"
@change="change">
<uv-vtabs-item>
<view class="category-title">
<!-- <view class="category-title">
租赁
</view>
</view> -->
<view class="list">
<view class="item" v-for="(item,index) in list" :key="index"
@click="$utils.navigateTo(`/pages_order/product/productDetail?id=${item.id}`)">
@ -61,7 +61,7 @@
methods: {
//
getCategory() {
this.$api('getIcon', res => {
this.$api('getClassify', res => {
if(res.code == 200) {
this.category = res.result
if(this.category.length > 0) {
@ -73,7 +73,7 @@
//
getProductList(shopIconId) {
this.$api('getProductList', {
shopIconId: shopIconId,
shopClassId: shopIconId,
pageNo: 1,
pageSize: 99999
}, res => {


+ 1
- 1
pages_order/mine/address.vue View File

@ -107,7 +107,7 @@
//
editDefault(id) {
this.$api('addressDefault', {
this.$api('updateDefaultAddress', {
id: id,
}, res => {
if (res.code == 200) {


+ 1
- 1
pages_order/product/productList.vue View File

@ -27,7 +27,7 @@
onLoad({title, iconId}) {
this.title = title
this.iconId = iconId
this.queryParams.iconId = iconId
this.queryParams.shopIconId = iconId
},
methods: {


Loading…
Cancel
Save