Browse Source

最近访问的店铺

shish 5 years ago
parent
commit
ee7224df03
3 changed files with 106 additions and 0 deletions
  1. 5 0
      mallApp/src/api/user/index.js
  2. 6 0
      mallApp/src/pages.json
  3. 95 0
      mallApp/src/pages/home/recent.vue

+ 5 - 0
mallApp/src/api/user/index.js

@@ -0,0 +1,5 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+export const recentShop = data => {
+	return https.get('/user/recent-shop', data)
+}

+ 6 - 0
mallApp/src/pages.json

@@ -1,5 +1,11 @@
 {
 	"pages": [
+		{
+			"path": "pages/home/recent",
+			"style": {
+				"navigationBarTitleText": "最近访问的店铺"
+			}
+		},
 		{
 			"path": "pages/home/index",
 			"style": {

+ 95 - 0
mallApp/src/pages/home/recent.vue

@@ -0,0 +1,95 @@
+<template>
+  <view class="latest-content_box">
+      <view class="shop-list_box">
+          <template v-if="!$util.isEmpty(list)">
+          <view 
+            :key="item.shopId"
+            @click="pageTo({
+              url: '/pages/home/index?account='+item.shopId,
+              type:4
+            })"
+            v-for="item in list">
+            <app-avatar-module :src="item.shopImg" />
+            <view class="tit">
+              {{item.shopName}}
+            </view>
+          </view>
+          </template>
+          <div v-else>
+            暂无数据
+          </div>
+      </view>
+  </view>
+</template>
+
+<script>
+import { recentShop } from "@/api/user";
+import { share } from "@/mixins";
+import AppAvatarModule from "@/components/module/app-avatar";
+import {mapGetters} from 'vuex'
+export default {
+  name: "recent",
+  components: {AppAvatarModule},
+  mixins: [share],
+  data() {
+    return {
+      list:[]
+    };
+  },
+  computed: {
+		...mapGetters({ userInfo: "getUser" })
+	},
+  onLoad() {
+
+  },
+  methods: {
+    async init(){
+         console.log(111111111111)
+        try {
+          const { data } = await recentShop({})
+          this.list = data
+        } catch(e){
+        }   
+      }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+  .shop-title_box {
+    color: #333333;
+    font-size: 30upx;
+    font-weight: 600;
+    padding: 48upx 0 80upx 40upx;
+  }
+  .shop-list_box {
+    padding:0 60upx;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    flex-wrap: wrap;
+    & > view {
+      width: 120upx;
+      margin-bottom: 70upx;
+      & .tit {
+        text-align: center;
+        margin-top: 30upx;
+      }
+    }
+  }
+  .app-footer {
+     font-size: 28upx;
+    & .des {
+      &  > text {
+        color: #3385FF;
+        display: inline-block;
+        margin-left: 3upx;
+      }
+      & .iconfont {
+        color: #3385FF;
+        font-size: 22upx;
+        margin-left: 2upx;
+      }
+    }
+  }
+</style>