Leo 3 éve
szülő
commit
9ac874e4b8

+ 3 - 3
README.md

@@ -3,9 +3,9 @@
 2. 会员权益  vip会员  签到  自主积分  会员活动  商务合作
 3. 最新推荐  -> 店铺相关推荐
 
-二  会员权益 
-1. 普通会员  vip会员
-2. 权益名称 所属会员  logo  介绍  权重
+二  会员权益 pages/vip/index
+1. 普通会员  vip会员 pages/vip/index
+2. 权益名称 所属会员  logo  介绍  权重 pages/vip/detail?id=xxx
 
 三 vip会员 
 1. 介绍页 写死,权限只是展示,不可点击,

+ 8 - 0
src/lib/api/home.js

@@ -0,0 +1,8 @@
+import request from "../utils/request";
+
+/**
+ * 首页
+ *
+ * [API](https://console-docs.apipost.cn/preview/888dcf083e39e4e4/ae9a5ffd745e57d1?target_id=de989ff3-3e32-4362-a094-b1b22af04a87)
+ */
+export const homeModules = () => request.get("/weapp/index/module");

+ 4 - 0
src/lib/api/task.js

@@ -0,0 +1,4 @@
+import request from "../utils/request";
+
+export const getTaskInfo = (session) =>
+  request.get("/weapp/getTaskInfo/" + session);

+ 15 - 0
src/lib/api/vpi.js

@@ -0,0 +1,15 @@
+import request from "../utils/request";
+
+/**
+ * 会员权限列表页
+ *
+ * [api](https://console-docs.apipost.cn/preview/888dcf083e39e4e4/ae9a5ffd745e57d1?target_id=f0977f36-30f2-4495-bb03-680ef4a7ca14)
+ */
+export const getVipList = () => request.get("/weapp/legals/list");
+
+/**
+ * 会员权限详情页
+ *
+ * [api](https://console-docs.apipost.cn/preview/888dcf083e39e4e4/ae9a5ffd745e57d1?target_id=6deab440-b9f9-44ca-b0f9-1e06be8156cb)
+ */
+export const getVipDetail = () => request.get("/weapp/legals/list");

+ 27 - 1
src/pages.json

@@ -78,6 +78,22 @@
         "navigationBarTitleText": "商务合作",
         "enablePullDownRefresh": false
       }
+    },
+    {
+      "path": "pages/vip/index",
+      "style": {
+        "navigationBarTitleText": "会员权益",
+        "navigationBarBackgroundColor": "#FFFFFF",
+        "backgroundColor": "#F5F5F5"
+      }
+    },
+    {
+      "path": "pages/vip/detail",
+      "style": {
+        "navigationBarTitleText": "会员权益",
+        "navigationBarBackgroundColor": "#FFFFFF",
+        "backgroundColor": "#F5F5F5"
+      }
     }
     // {
     //   "path": "pages/help/help_about",
@@ -251,6 +267,16 @@
   },
   "condition": {
     "current": 0,
-    "list": []
+    "list": [
+      {
+        "name": "vip",
+        "path": "pages/vip/index"
+      },
+      {
+        "name": "vip detail",
+        "path": "pages/vip/detail",
+        "query": "id=1"
+      }
+    ]
   }
 }

+ 4 - 3
src/pages/index/index.vue

@@ -73,7 +73,8 @@
   </view>
 </template>
 <script>
-import api from "@/lib/api/api";
+import { homeModules } from "@/lib/api/home";
+import { getTaskInfo } from "@/lib/api/task";
 import listItem from "@/components/list-item/list-item.vue";
 
 export default {
@@ -170,7 +171,7 @@ export default {
   methods: {
     async loadModules() {
       try {
-        const data = await api.homeModules();
+        const data = await homeModules();
         if (data.errno == 10000) {
           this.modules = data.data;
           // this.endTime = data.diff_time;
@@ -196,7 +197,7 @@ export default {
         this.showTask = true;
         return Promise.reject();
       }
-      const data = await api.getTaskInfo(this.userInfo.session);
+      const data = await getTaskInfo(this.userInfo.session);
       this.showTask = !data.is_current_signin;
     },
 

+ 15 - 0
src/pages/vip/detail.vue

@@ -0,0 +1,15 @@
+<template>
+  <view class="content"></view>
+</template>
+
+<script>
+export default {
+  name: "VipDetail",
+  data() {
+    return {};
+  },
+  methods: {},
+};
+</script>
+
+<style></style>

+ 113 - 0
src/pages/vip/index.vue

@@ -0,0 +1,113 @@
+<template>
+  <view class="content">
+    <view class="tabs flex-row">
+      <view
+        v-for="item in list"
+        :key="item.name"
+        class="tab"
+        :class="item.name === current ? 'current' : ''"
+        @tap="current = item.name"
+      >
+        <text>{{ item.name }}</text>
+      </view>
+    </view>
+    <view
+      class="items"
+      v-for="c in list"
+      :key="c.name"
+      v-show="c.name === current"
+    >
+      <navigator
+        class="item"
+        v-for="item in c.list"
+        :key="item.id"
+        :url="`pages/vip/detail?id=${item.id}`"
+      >
+        <image class="icon" :src="item.logo"></image>
+        {{ item.name }}
+      </navigator>
+    </view>
+  </view>
+</template>
+
+<script>
+import { getVipList } from "@/lib/api/vpi";
+
+export default {
+  name: "VipDetail",
+  data() {
+    return {
+      list: [],
+      current: "",
+    };
+  },
+  onLoad() {
+    this.getVipList();
+  },
+  methods: {
+    async getVipList() {
+      const data = await getVipList();
+      this.current = data.data[0].name;
+      this.list = data.data;
+    },
+  },
+};
+</script>
+
+<style lang="scss">
+.content {
+  background: #f5f5f5;
+  min-height: 100vh;
+  position: relative;
+}
+.tabs {
+  width: 100%;
+  height: 76rpx;
+  background: #ffffff;
+  letter-spacing: 3rpx;
+  position: sticky;
+  top: 0;
+  z-index: 99;
+  .tab {
+    width: 50%;
+    text-align: center;
+    font-size: 32rpx;
+    font-weight: 500;
+    color: #9496a5;
+    text {
+      box-sizing: border-box;
+      display: inline-flex;
+      align-items: center;
+      justify-content: center;
+      height: 76rpx;
+    }
+  }
+  .current {
+    color: #08c2c3;
+    text {
+      padding-top: 8rpx;
+      border-bottom: 8rpx solid #08c2c3;
+    }
+  }
+}
+.items {
+  width: 100%;
+  display: flex;
+  .item {
+    width: 25%;
+    box-sizing: border-box;
+    background: #fff;
+    border: 1rpx solid #f5f5f5;
+    padding: 20rpx 0;
+    font-size: 28rpx;
+    color: #666;
+    text-align: center;
+    .icon {
+      display: block;
+      width: 100rpx;
+      height: 100rpx;
+      margin: 0 auto 10rpx;
+    }
+  }
+}
+</style>