Преглед изворни кода

feat(merchant):新增商家优惠券

yizhiyang пре 1 година
родитељ
комит
c07b5f2918

+ 18 - 0
src/api/merchant/store.js

@@ -0,0 +1,18 @@
+import request from '@/utils/request';
+
+/**
+ * @description 优惠券接口 - 根据商家ID查询优惠券分页
+ * @param {*} data
+ * @returns
+ */
+
+export function getMerchantCoupon(merchantId, data) {
+  return request({
+    url: `/maintain/coupon/${merchantId}/paging`,
+    data: data,
+    method: 'GET',
+    headers: {
+      'Content-Type': 'application/x-www-form-urlencoded',
+    },
+  });
+}

+ 6 - 0
src/pages.json

@@ -450,6 +450,12 @@
             "navigationBarTitleText": "预约列表"
           }
         },
+        {
+          "path": "store/couponManage",
+          "style": {
+            "navigationBarTitleText": "商品优惠"
+          }
+        },
         {
           "path": "order/index",
           "style": {

+ 43 - 0
src/pages/merchant/store/couponManage.vue

@@ -0,0 +1,43 @@
+<template>
+  <view class="couponManage"> 1111111111 </view>
+</template>
+
+<script>
+import { getMerchantCoupon } from '@/api/merchant/store.js';
+export default {
+  data() {
+    return {
+      list: {},
+      params: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+    };
+  },
+  created() {
+    this.list = this.$store.state.data.merchantInfo;
+  },
+  mounted() {
+    this.getDataListInit();
+  },
+  methods: {
+    getDataListInit() {
+      let result = Object.assign(
+        {},
+        {
+          paging: `${this.params.pageNum},${this.params.pageSize}`,
+        },
+      );
+      getMerchantCoupon(this.list.merchant.id, { ...result }).then(res => {
+        console.log(res);
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.couponManage {
+  background-color: pink;
+}
+</style>

+ 5 - 0
src/pages/merchant/store/index.vue

@@ -156,6 +156,11 @@ export default {
             url: '/pages/merchant/store/evaluateManagement',
           });
           break;
+        case 3:
+          uni.navigateTo({
+            url: '/pages/merchant/store/couponManage',
+          });
+          break;
         case 5:
           uni.navigateTo({
             url: '/pages/merchant/store/myTeam',