wbspool 4 rokov pred
rodič
commit
9957cc22af

+ 7 - 0
src/common/config/api.js

@@ -30,6 +30,7 @@ const api = {
         myLikeArticles:`${root}/cms/myLikeArticles`,
         myViewArticles:`${root}/cms/myViewArticles`,
         myCommentArticles:`${root}/cms/myCommentArticles`,
+        banners:`${root}/cms/banners`,
     },
     mzUser:{
         login:`${root}/mzUser/login`,
@@ -40,11 +41,17 @@ const api = {
         perfectInfo:`${root}/mzUser/perfectInfo`,
         createVipOrder:`${root}/mzUser/createVipOrder`,
         confirmVipOrder:`${root}/mzUser/confirmVipOrder`,
+        createProductOrder:`${root}/mzUser/createProductOrder`,
+        confirmProductOrder:`${root}/mzUser/confirmProductOrder`,
+        myVipSmOrders:`${root}/mzUser/myVipSmOrders`,
+        myProductOrders:`${root}/mzUser/myProductOrders`,
     },
     common:{
         uploadFile:`${root}/common/uploadFile`,
         vipSmeals:`${root}/common/vipSmeals`,
         simpleArticle:`${root}/common/simpleArticle`,
+        productDetail:`${root}/common/productDetail`,
+        banners:`${root}/common/banners`,
     }
 };
 

+ 2 - 2
src/h5/components/ui-swiper/ui-swiper.vue

@@ -3,14 +3,14 @@
     <swiper ref="swiper" class="relative w-full h-full" :options="swiperOption">
       <swiper-slide v-for="(item, index) in items" :key="index">
         <div class="w-full h-full absolute bg-[rgba(0,0,0,0.3)]"></div>
-        <img class="w-full h-full object-cover" :src="item.url" />
+        <img class="w-full h-full object-cover" :src="item.bannerUrl" />
 
         <div
           :class="`absolute bottom-23rem left-26rem font-normal z-50 flex text-white text-size-20rem ${
             titleClass ?? ''
           }`"
         >
-          {{ item.title }}
+          {{ item.content }}
         </div>
       </swiper-slide>
     </swiper>

+ 5 - 0
src/pc/App.vue

@@ -21,6 +21,11 @@
          this.$store.commit('UPDATE_LOGIN_INFO',resp.data.data.mzUser)
       }
 
+
+      let br = await  this.$http.post(this.$api.common.banners);
+      if (br.data.status === 200) {
+        this.$store.commit('UPDATE_BANNER',br.data.data.banners)
+      }
     }
   }
 </script>

+ 1 - 0
src/pc/components.d.ts

@@ -21,6 +21,7 @@ declare module '@vue/runtime-core' {
     RouterLink: typeof import('vue-router')['RouterLink']
     RouterView: typeof import('vue-router')['RouterView']
     TimeLimitBtn: typeof import('./components/TimeLimitBtn.vue')['default']
+    UiBanner: typeof import('./components/ui-banner/ui-banner.vue')['default']
     UiDevider: typeof import('./components/ui-devider/ui-devider.vue')['default']
     UiHotArticle: typeof import('./components/ui-hot-artcile/ui-hot-article.vue')['default']
     UiInput: typeof import('./components/ui-input/ui-input.vue')['default']

+ 34 - 0
src/pc/components/ui-banner/ui-banner.vue

@@ -0,0 +1,34 @@
+<template>
+    <ui-swiper v-bind="$attrs" v-on="$listeners" :items="banners" titleClass="swiper-title" :showPagination="showPagination" :paginationclass="paginationclass" :titleClass="titleClass" :class="`swiper ${bannerClass}`"
+               :class="bannerClass"></ui-swiper>
+</template>
+
+<script>
+    export default {
+        props: {
+            flag: '',
+            bannerClass: {
+                type: String,
+                default() {
+                    return {}
+                }
+            },
+            showPagination: {
+                default: false,
+            },
+            paginationclass:{
+                default: ''
+            } ,
+            titleClass: {},
+        },
+        computed: {
+            banners() {
+                return this.$store.state.banners.filter(e => e.position == this.flag);
+            }
+        }
+    }
+</script>
+
+<style scoped>
+
+</style>

+ 6 - 8
src/pc/components/ui-hot-artcile/ui-hot-article.vue

@@ -11,14 +11,12 @@
         </div>
         <ui-devider></ui-devider>
         <div class="h-21px"></div>
-        <ui-swiper
-                class="mb-20px"
-                :items="[
-              { url: '/imgs/article_cover1.png', title: '这是标题' },
-              { url: '/imgs/article_cover1.png', title: '这是标题' },
-            ]"
-                titleClass="swiper-title"
-        ></ui-swiper>
+        <ui-banner
+                   flag="热榜文章"
+                   bannerClass=" mb-20px" titleClass="swiper-title">
+
+        </ui-banner>
+
         <ui-devider></ui-devider>
 
         <div v-for="item in cmsArticles" :key="item">

+ 4 - 4
src/pc/components/ui-order-table/ui-order-table.vue

@@ -13,8 +13,8 @@
     <div class="h-20px"></div>
     <div v-for="(item, index) in data" :key="index" class="mb-20px">
       <div class="h-50px bg-[#F7F7F7] flex justify-between items-center px-10px">
-        <div class="text-black whitespace-nowrap text-left">hy645586466152123</div>
-        <div class="text-black text-left whitespace-nowrap">2022-08-30 09:35:30</div>
+        <div class="text-black whitespace-nowrap text-left">{{item.number}}</div>
+        <div class="text-black text-left whitespace-nowrap">{{item.createTimeStr}}</div>
       </div>
       <el-table
         header-cell-class-name="!bg-[#F7F7F7] font-normal text-size-14px "
@@ -26,13 +26,13 @@
         <el-table-column v-for="(item, index) in columns" :key="index" v-bind="item">
           <template v-slot:header>
             <div v-if="index === 0" class="text-black whitespace-nowrap text-left">
-              hy645586466152123
+              {{item.number}}
             </div>
             <div
               v-if="index === columns.length - 1 && index > 0"
               class="text-black text-left whitespace-nowrap"
             >
-              2022-08-30 09:35:30
+              {{item.createTimeStr}}
             </div>
           </template>
           <template v-slot:default="props" v-if="$scopedSlots[index] || $slots[index]">

+ 26 - 9
src/pc/components/ui-small-article/ui-small-article.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="flex bg-white items-center h-87px">
+  <div @click="handleGoTo(item)" class="flex bg-white items-center h-87px">
     <div class="relative">
       <img v-if="item.cover" class="w-116px h-65px object-cover" :src="item.coverUrl" />
       <div v-if="item.vip === '1'" class="absolute left-0 top-0 text-white text-size-12px">
@@ -19,22 +19,39 @@
       </div>
       <div class="h-14px"></div>
     </div>
+    <vip-srv-box ref="vsb"></vip-srv-box>
+
   </div>
 </template>
 
 <script>
-export default {
+  export default {
+    components: {},
+    props: {
+      item: {
+        type: Object,
+        default() {
+          return {};
+        }
+      }
+    },
+    data() {
+      return {
+        dialogVisible: false
+      }
+    },
+    methods: {
 
-  props:{
-      item:{
-        type:Object,
-        default(){
-          return {}
+      handleGoTo(item) {
+        if (!this.$store.state.userinfo.exipreVip) {
+          this.$refs.vsb.open();
+          return;
         }
+        this.$router.push('/article-detail?code=' + item.code)
       }
-  }
 
-};
+    }
+  };
 </script>
 
 <style></style>

+ 2 - 2
src/pc/components/ui-swiper/ui-swiper.vue

@@ -3,14 +3,14 @@
     <swiper ref="swiper" class="relative w-full h-full" :options="swiperOption">
       <swiper-slide v-for="(item, index) in items" :key="index">
         <div class="w-full h-full absolute bg-[rgba(0,0,0,0.3)]"></div>
-        <img class="w-full h-full object-cover" :src="item.url" />
+        <img class="w-full h-full object-cover" :src="item.bannerUrl" />
 
         <div
           :class="`absolute bottom-23px left-26px font-normal z-50 flex text-white text-size-20px ${
             titleClass ?? ''
           }`"
         >
-          {{ item.title }}
+          {{ item.content }}
         </div>
       </swiper-slide>
     </swiper>

+ 3 - 5
src/pc/pages/aboutus/aboutus.vue

@@ -1,10 +1,8 @@
 <template>
   <div>
-    <ui-swiper
-      :showPagination="true"
-      :items="banner1"
-      class="w-screen h-350px"
-    ></ui-swiper>
+
+    <ui-banner flag="关于我们"  :showPagination="true" banner-class="w-screen h-350px"></ui-banner>
+
 
     <div class="w-1200px m-auto">
       <div class="mt-68px text-[#000A04] text-size-36px text-center font-light">

+ 2 - 1
src/pc/pages/article-detail/article-detail.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="w-1200px detail">
-    <img src="/imgs/article-banner.png" class="my-20px" />
+    <ui-banner flag="文章详情"  :showPagination="true" banner-class=" my-20px"></ui-banner>
+
     <div class="flex">
       <div class="left mr-20px w-860px">
         <ui-shadow-box class="w-full bg-white h-auto px-30px pt-30px mb-14px">

+ 6 - 1
src/pc/pages/home/_components/home-tags.vue

@@ -6,7 +6,7 @@
     <div class="h-12.5px"></div>
     <div class="flex flex-wrap">
 <!--      <div class="tag selected">热门标签</div>-->
-      <div v-for="(item, index) in labels" :key="index" class="tag">{{item.name}}</div>
+      <div v-for="(item, index) in labels" @click="handleGoTo(item)" :key="index" class="tag">{{item.name}}</div>
     </div>
   </ui-shadow-box>
 </template>
@@ -18,6 +18,11 @@ export default {
         labels:[]
      }
   },
+    methods:{
+        handleGoTo(item){
+             this.$router.push('/search?keywords=' + item.name)
+        }
+    },
   async created() {
       let resp = await  this.$http.post(this.$api.cms.labels);
       if(resp.data.status === 200){

+ 30 - 9
src/pc/pages/home/home.vue

@@ -4,18 +4,39 @@
 
         <div class="flex">
             <div>
-                <ui-swiper
-                        :showPagination="true"
-                        :items="banner1"
-                        class="w-600px h-337px"
-                ></ui-swiper>
+                <ui-banner :showPagination="true"
+                           flag="首页"
+                           bannerClass="w-600px h-337px">
+
+                </ui-banner>
             </div>
             <div class="w-10px"></div>
             <div class="swiper-group">
-                <ui-swiper :items="banner1" titleClass="swiper-title" class="swiper"></ui-swiper>
-                <ui-swiper :items="banner1" titleClass="swiper-title" class="swiper"></ui-swiper>
-                <ui-swiper :items="banner1" titleClass="swiper-title" class="swiper"></ui-swiper>
-                <ui-swiper :items="banner1" titleClass="swiper-title" class="swiper"></ui-swiper>
+                <ui-banner
+                           flag="首页1"
+                           titleClass="swiper-title"
+                           >
+
+                </ui-banner>
+                <ui-banner
+                        flag="首页2"
+                        titleClass="swiper-title"
+                        >
+
+                </ui-banner>
+                <ui-banner
+                        flag="首页3"
+                        titleClass="swiper-title"
+                        >
+
+                </ui-banner>
+                <ui-banner
+                        flag="首页4"
+                        titleClass="swiper-title"
+                        >
+
+                </ui-banner>
+
             </div>
         </div>
         <div class="h-20px"></div>

+ 49 - 16
src/pc/pages/product/order-detail.vue

@@ -7,16 +7,16 @@
         <ui-devider></ui-devider>
         <div class="mt-50px flex items-center">
           <div class="w-100px mr-25px">{{ $t("收货人") }}</div>
-          <ui-input :placeholder="$t('请输入收货人')" class="!w-444px"></ui-input>
+          <ui-input v-model="form.linkman" :placeholder="$t('请输入收货人')" class="!w-444px"></ui-input>
         </div>
         <div class="mt-50px flex items-center">
           <div class="w-100px mr-25px">{{ $t("收货电话") }}</div>
-          <ui-input :placeholder="$t('请输入收货电话')" class="!w-587px"></ui-input>
+          <ui-input v-model="form.phone" :placeholder="$t('请输入收货电话')" class="!w-587px"></ui-input>
         </div>
 
         <div class="mt-50px flex items-center">
           <div class="w-100px mr-25px">{{ $t("收货地址") }}</div>
-          <ui-input :placeholder="$t('请输入收货地址')" class="!w-912px"></ui-input>
+          <ui-input v-model="form.address" :placeholder="$t('请输入收货地址')" class="!w-912px"></ui-input>
         </div>
         <div class="mb-20px text-size-16px mt-50px">{{ $t("商品信息") }}</div>
 
@@ -32,20 +32,19 @@
             <div class="flex-1 text-center">小计</div>
           </div>
           <ui-devider class="bg-[#B8B8B8]"></ui-devider>
-          <div class="order-body flex mt-30px items-center relative">
-            <img src="/imgs/product_item.png" class="w-100px h-100px object-contain" />
-            <div class="w-300px text-center text-size-16px">这里是产品名称</div>
-            <div class="flex-1 text-center font-thin text-size-16px">79.00</div>
+          <div  class="order-body flex mt-30px items-center relative">
+            <img :src="form.coverUrl" class="w-100px h-100px object-contain" />
+            <div class="w-300px text-center text-size-16px">{{form.name}}</div>
+            <div class="flex-1 text-center font-thin text-size-16px">{{form.price.toFixed(2)}}</div>
             <div class="flex-1 text-center">
               <el-input-number
-                v-model="num"
-                @change="handleChange"
+                v-model="form.num"
                 :min="1"
                 :max="10"
                 label="描述文字"
               ></el-input-number>
             </div>
-            <div class="flex-1 text-center font-thin text-size-16px">79.00</div>
+            <div class="flex-1 text-center font-thin text-size-16px">{{(form.price * form.num).toFixed(2)}}</div>
           </div>
         </div>
         <div
@@ -56,13 +55,13 @@
             ><span class="font-thin text-size-36px text-primary">¥79.00</span>
           </div>
 
-          <div class="text-size-16px text-primary mb-10px">
-            {{ $t("收货人") }}:陈小婷 86+18926171468
+          <div v-if="form.linkman && form.phone" class="text-size-16px text-primary mb-10px">
+            {{ $t("收货人") }}:{{form.linkman}} {{form.phone}}
           </div>
-          <div class="text-size-16px text-primary mb-20px">
-            {{ $t("收货地址") }}:广东广州海珠区新满西中53号
+          <div v-if="form.address" class="text-size-16px text-primary mb-20px">
+            {{ $t("收货地址") }}:{{form.address}}
           </div>
-          <el-button class="!text-white !w-200px !h-40px !bg-primary" round>提交订单</el-button>
+          <el-button @click="handleSubmit" class="!text-white !w-200px !h-40px !bg-primary" round>提交订单</el-button>
         </div>
       </div>
     </div>
@@ -70,7 +69,41 @@
 </template>
 
 <script>
-export default {};
+export default {
+
+  data(){
+      return {
+        form:{
+          linkman:'',
+          phone:'',
+          address:'',
+        }
+      }
+  },
+  methods:{
+    async handleSubmit(){
+      let resp = await this.$http.post(this.$api.mzUser.createProductOrder,this.$qs.stringify(this.form))
+      if(resp.data.status === 200){
+        await this.$confirm('请在弹出的窗口完成付款操作?', '提示', {
+          confirmButtonText: '已完成付款',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+        resp = await this.$http.post(this.$api.mzUser.confirmProductOrder,this.$qs.stringify({orderCode:resp.data.data.productOrder.code}))
+
+        if(resp.data.status === 200){
+          this.$message.success("购买成功");
+          this.$router.push('/user/order?type=product')
+        }
+
+      }
+    }
+  },
+  created() {
+     this.form = Object.assign(this.form,this.$store.state.cart[0]);
+  }
+
+};
 </script>
 
 <style></style>

+ 33 - 92
src/pc/pages/product/product-detail.vue

@@ -1,15 +1,15 @@
 <template>
   <div class="w-1200px mt-20px flex justify-between">
-    <div class="w-860px h-full bg-white px-30px pt-30px pb-50px">
+    <div v-if="product" class="w-860px h-full bg-white px-30px pt-30px pb-50px">
       <div class="flex mb-30px">
         <img class="w-400px h-400px object-cover mr-20px" src="/imgs/product_item.png" />
 
         <div>
           <div class="font-thin text-size-20px leading-28px mb-20px">
-            这里是产品名称这里是产品名称这里是
+             {{product.name}}
           </div>
           <div class="font-normal text-[#686868] text-size-14px leading-20px mb-44px">
-            这里是文章简介或摘要内容,这里是文章简介或摘要内容这里是文章简介或摘要内容,这里是文章简介
+             {{product.summary}}
           </div>
           <div class="flex items-start mb-42px">
             <div
@@ -18,7 +18,7 @@
               购买说明:
             </div>
             <div class="font-normal text-size-14px leading-20px">
-              购买说明内容购买说明内容购买说明内容购买说明 购买说明内容购买说明内容内容
+              {{product.buyDesc}}
             </div>
           </div>
           <div class="flex items-center mb-33px">
@@ -27,7 +27,7 @@
             >
               价格:
             </div>
-            <div class="text-primary text-size-36px font-light">¥99.00</div>
+            <div class="text-primary text-size-36px font-light">¥{{product.price.toFixed(2)}}</div>
           </div>
           <div class="flex items-center mb-33px">
             <div
@@ -36,7 +36,7 @@
               数量:
             </div>
             <div>
-              <el-input-number></el-input-number>
+              <el-input-number min="1" v-model="num"></el-input-number>
             </div>
             <div class="font-normal text-[#686868] text-size-14px">
               <span class="ml-20px">{{ $t("件") }}</span>
@@ -44,7 +44,7 @@
             </div>
           </div>
           <div class="flex justify-center">
-            <el-button @click="$router.push('order-detail')" class="!text-white !w-200px !h-40px !bg-primary" round>{{
+            <el-button @click="handleBuy" class="!text-white !w-200px !h-40px !bg-primary" round>{{
               $t("立即购买")
             }}</el-button>
           </div>
@@ -52,17 +52,17 @@
       </div>
       <ui-devider></ui-devider>
       <div class="text-size-24px mt-36px mb-34px">产品详情</div>
-      <div class="product-intro" v-html="html"></div>
+      <div class="product-intro" v-html="product.detail"></div>
     </div>
     <div class="w-320px">
-      <ui-swiper
-        class="mb-20px"
-        :items="[
-          { url: 'imgs/article_cover1.png', title: '这是标题' },
-          { url: 'imgs/article_cover1.png', title: '这是标题' },
-        ]"
-        titleClass="swiper-title"
-      ></ui-swiper>
+      <ui-banner
+              class="mb-20px"
+              flag="产品详情"
+              titleClass="swiper-title"
+      >
+
+      </ui-banner>
+
     </div>
   </div>
 </template>
@@ -71,84 +71,25 @@
 export default {
   data() {
     return {
-      html: `<p><span style="font-size:16px">据央视新闻7月22日消息,俄罗斯国防部发言人科纳申科夫21日通报说,俄军在尼古拉耶夫和克拉玛托尔斯克打击了乌军多个指挥所。</span></p>
-
-<p>&nbsp;</p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16px"><img alt="" src="/imgs/article-detail-pic-1.png" style="width:100%" /></span></p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16px">据央视新闻7月22日消息,俄罗斯国防部发言人科纳申科夫21日通报说,俄军在尼古拉耶夫和克拉玛托尔斯克打击了乌军多个指挥所。</span></p>
-
-<p>&nbsp;</p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16px">另据央视新闻报道称,当地时间21日,欧洲理事会公布了针对俄罗斯的新制裁措施,包括禁止进口来自俄罗斯金和珠宝;增加了俄罗斯可用于军用的物资和技术禁运清单,增加了对俄罗斯个人和实体的制裁。俄军打击乌军指挥所 乌军击退俄军进攻</span></p>
-
-<p>&nbsp;</p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16px">俄罗斯国防部发言人科纳申科夫21日通报说,俄军在尼古拉耶夫和克拉玛托尔斯克打击了乌军多个指挥所,在顿涅茨克和尼古拉耶夫等地摧毁了多个乌军弹药库。另外,俄军还击落乌空军1架苏-25战机、1架米-8直升机和5架军用无人机。</span></p>
-
-<p>&nbsp;</p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16px">另据乌克兰国家通讯社21日援引乌各地军事部门的消息报道,俄军继续对苏梅、哈尔科夫、卢甘斯克、顿涅茨克等地区进行大规模炮击。在乌军阻击下,俄军未能在巴赫穆特方向取得突破,没有占领乌格列戈尔斯克发电厂。</span></p>
-
-<p>&nbsp;</p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16px">俄外长称在乌军事目标发生变化,与西方向乌军提供武器有关。</span></p>
-
-<p>&nbsp;</p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16px"><img alt="" src="/imgs/article-detail-pic-1.png" style="width:100%" /></span></p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16px">据央视新闻7月22日消息,俄罗斯国防部发言人科纳申科夫21日通报说,俄军在尼古拉耶夫和克拉玛托尔斯克打击了乌军多个指挥所。</span></p>
-
-<p>&nbsp;</p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16px">另据央视新闻报道称,当地时间21日,欧洲理事会公布了针对俄罗斯的新制裁措施,包括禁止进口来自俄罗斯金和珠宝;增加了俄罗斯可用于军用的物资和技术禁运清单,增加了对俄罗斯个人和实体的制裁。俄军打击乌军指挥所 乌军击退俄军进攻</span></p>
-
-<p>&nbsp;</p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16px">俄罗斯国防部发言人科纳申科夫21日通报说,俄军在尼古拉耶夫和克拉玛托尔斯克打击了乌军多个指挥所,在顿涅茨克和尼古拉耶夫等地摧毁了多个乌军弹药库。另外,俄军还击落乌空军1架苏-25战机、1架米-8直升机和5架军用无人机。</span></p>
-
-<p>&nbsp;</p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16px">另据乌克兰国家通讯社21日援引乌各地军事部门的消息报道,俄军继续对苏梅、哈尔科夫、卢甘斯克、顿涅茨克等地区进行大规模炮击。在乌军阻击下,俄军未能在巴赫穆特方向取得突破,没有占领乌格列戈尔斯克发电厂。</span></p>
-
-<p>&nbsp;</p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16px">俄外长称在乌军事目标发生变化,与西方向乌军提供武器有关。</span></p>
-
-<p>&nbsp;</p>
-
-<p>&nbsp;</p>
-
-
-`,
+      html: ``,
+      product:'',
+      num:1
     };
   },
+  methods:{
+     handleBuy(){
+       this.$store.commit('ADD_CART',{product:this.product,price:this.product.price,num:this.num,coverUrl:this.product.coverUrl,name:this.product.name,productCode:this.product.code});
+       this.$router.push('order-detail')
+     }
+  },
+  async created() {
+
+    let resp = await  this.$http.post(this.$api.common.productDetail,this.$qs.stringify(this.$route.query));
+    if(resp.data.status === 200){
+       this.product = resp.data.data.product;
+    }
+
+  }
 };
 </script>
 

+ 2 - 5
src/pc/pages/publish/publish.vue

@@ -1,10 +1,7 @@
 <template>
     <div>
-        <ui-swiper
-                :showPagination="true"
-                :items="banner1"
-                class="w-screen h-350px"
-        ></ui-swiper>
+        <ui-banner flag="投稿"  :showPagination="true" banner-class="w-screen h-350px"></ui-banner>
+
 
         <div class="w-1200px m-auto">
             <div class="mt-68px text-[#000A04] text-size-36px text-center font-light">

+ 2 - 5
src/pc/pages/realtime-news/realtime-news.vue

@@ -1,10 +1,7 @@
 <template>
   <div>
-    <ui-swiper
-      :showPagination="true"
-      :items="banner1"
-      class="w-screen h-350px"
-    ></ui-swiper>
+    <ui-banner flag="实时新闻"  :showPagination="true" banner-class="w-screen h-350px"></ui-banner>
+
 
     <div class="w-1200px m-auto">
       <div class="flex justify-between">

+ 4 - 5
src/pc/pages/recommend/recommend.vue

@@ -1,10 +1,8 @@
 <template>
   <div>
-    <ui-swiper
-      :showPagination="true"
-      :items="banner1"
-      class="w-screen h-350px"
-    ></ui-swiper>
+
+
+    <ui-banner flag="推荐"  :showPagination="true" banner-class="w-screen h-350px"></ui-banner>
 
     <div class="w-1200px m-auto">
       <div class="flex justify-between">
@@ -27,6 +25,7 @@
 
 <script>
 export default {
+  components: {},
   data() {
     return {
       banner1: [

+ 1 - 0
src/pc/pages/search/search.vue

@@ -35,6 +35,7 @@ export default {
     }
   },
   async created() {
+    this.keywords = this.$route.query.keywords;
     this.loadLatestArts(this.pageIndex);
   }
 

+ 135 - 134
src/pc/pages/user/user-order.vue

@@ -1,146 +1,147 @@
 <template>
-  <div>
-    <div class="h-34px"></div>
-    <ui-title-devider :showBorder="false" title="我的订单"></ui-title-devider>
-    <div class="pl-27px">
-      <el-tabs v-model="activeName" @tab-click="handleClick">
-        <el-tab-pane label="会员订单" name="first">
-          <ui-order-table :data="vipOrdersData" :columns="vipOrders"></ui-order-table>
-        </el-tab-pane>
-        <el-tab-pane label="商品订单" name="second">
-          <ui-order-table :data="goodsOrdersData" :columns="goodsOrders">
-            <template v-slot:0="{ row }">
-              <img class="w-full h-full object-contain" :src="row.pic" />
-            </template>
-          </ui-order-table>
-        </el-tab-pane>
-      </el-tabs>
+    <div>
+        <div class="h-34px"></div>
+        <ui-title-devider :showBorder="false" title="我的订单"></ui-title-devider>
+        <div class="pl-27px">
+            <el-tabs v-model="activeName" @tab-click="handleClick">
+                <el-tab-pane label="会员订单" name="first">
+                    <ui-order-table :data="vipOrdersData" :columns="vipOrders"></ui-order-table>
+                </el-tab-pane>
+                <el-tab-pane label="商品订单" name="second">
+                    <ui-order-table :data="goodsOrdersData" :columns="goodsOrders">
+                        <template v-slot:0="{ row }">
+                            <img class="w-full h-full object-contain" :src="row.coverUrl"/>
+                        </template>
+                        <template v-slot:2="{ row }">
+                            <div style="text-align: left">
+                                <span>收货人:{{row.linkman}}</span> <br>
+                                <span>联系电话:{{row.phone}}</span> <br>
+                                <span>地址:{{row.address}}</span>
+                            </div>
+                        </template>
+                    </ui-order-table>
+                </el-tab-pane>
+            </el-tabs>
+        </div>
     </div>
-  </div>
 </template>
 
 <script>
-export default {
-  data() {
-    return {
-      activeName: "first",
-      vipOrdersData: [
-        {
-          name: "杨贵妃",
-          time: "30(天)",
-          price: "¥99",
-          status: "已支付",
-          payType: "微信",
-        },
-        {
-          name: "杨贵妃",
-          time: "30(天)",
-          price: "¥99",
-          status: "已支付",
-          payType: "微信",
-        },
-      ],
-      vipOrders: [
-        {
-          prop: "name",
-          label: "会员名称",
-          align: "center",
-        },
-        {
-          prop: "time",
-          label: "时长/(天)",
-          align: "center",
-        },
-        {
-          prop: "price",
-          label: "实付金额",
-          align: "center",
-        },
-        {
-          prop: "status",
-          label: "交易状态",
-          align: "center",
-        },
-        {
-          prop: "payType",
-          label: "支付方式",
-          align: "center",
-        },
-      ],
-      goodsOrdersData: [
-        {
-          pic: "/imgs/article_cover_small1.png",
-          name: "这是产品名",
-          addressInfo: "xxxxx",
-          count: "99",
-          price: "¥99",
-          status: "已交易",
-          payType: "微信",
-        },
-        {
-          pic: "/imgs/article_cover_small1.png",
-          name: "这是产品名",
-          addressInfo: "xxxxx",
-          count: "99",
-          price: "¥99",
-          status: "已交易",
-          payType: "微信",
+    export default {
+        data() {
+            return {
+                activeName: "first",
+                vipOrdersData: [],
+                vipOrders: [
+                    {
+                        prop: "refVipSmName",
+                        label: "会员名称",
+                        align: "center",
+                    },
+                    {
+                        prop: "expire",
+                        label: "时长/(天)",
+                        align: "center",
+                    },
+                    {
+                        prop: "sum",
+                        label: "实付金额",
+                        align: "center",
+                    },
+                    {
+                        prop: "statusDesc",
+                        label: "交易状态",
+                        align: "center",
+                    },
+                    {
+                        prop: "payTypeDesc",
+                        label: "支付方式",
+                        align: "center",
+                    },
+                ],
+                goodsOrdersData: [],
+                goodsOrders: [
+                    {
+                        prop: "coverUrl",
+                        label: "产品图",
+                        align: "center",
+                        width: "88px",
+                    },
+                    {
+                        prop: "name",
+                        label: "产品名",
+                        align: "center",
+                    },
+                    {
+                        prop: "addressInfo",
+                        label: "收货信息",
+                        align: "center",
+                    },
+                    {
+                        prop: "num",
+                        label: "数量",
+                        align: "center",
+                    },
+                    {
+                        prop: "sum",
+                        label: "实付金额",
+                        align: "center",
+                    },
+                    {
+                        prop: "statusDesc",
+                        label: "交易状态",
+                        align: "center",
+                    },
+                    {
+                        prop: "payTypeDesc",
+                        label: "支付方式",
+                        align: "center",
+                    },
+                ],
+            };
+        },
+        methods: {
+
+            async handleLoadVipOrders() {
+
+                let resp = await this.$http.post(this.$api.mzUser.myVipSmOrders, this.$qs.stringify({onPage: false}));
+                if (resp.data.status === 200) {
+                    this.vipOrdersData = resp.data.data.vipOrders;
+                }
+
+            },
+            async handleLoadProductOrders() {
+
+                let resp = await this.$http.post(this.$api.mzUser.myProductOrders, this.$qs.stringify({onPage: false}));
+                if (resp.data.status === 200) {
+                    this.goodsOrdersData = resp.data.data.productOrders;
+                }
+
+            }
+
         },
-        {
-          pic: "/imgs/article_cover_small1.png",
-          name: "这是产品名",
-          addressInfo: "xxxxx",
-          count: "99",
-          price: "¥99",
-          status: "已交易",
-          payType: "微信",
+        watch: {
+            activeName: {
+                immediate: true,
+                handler() {
+                    if (this.activeName === 'first') {
+                        this.handleLoadVipOrders();
+                    } else {
+                        this.handleLoadProductOrders();
+                    }
+                }
+            }
+        },
+        created() {
+                if(this.$route.query.type === 'product'){
+                    this.activeName = 'second';
+                }
         }
-      ],
-      goodsOrders: [
-        {
-          prop: "pic",
-          label: "产品图",
-          align: "center",
-          width: "88px",
-        },
-        {
-          prop: "name",
-          label: "产品名",
-          align: "center",
-        },
-        {
-          prop: "addressInfo",
-          label: "收货信息",
-          align: "center",
-        },
-        {
-          prop: "count",
-          label: "数量",
-          align: "center",
-        },
-        {
-          prop: "price",
-          label: "实付金额",
-          align: "center",
-        },
-        {
-          prop: "status",
-          label: "交易状态",
-          align: "center",
-        },
-        {
-          prop: "payType",
-          label: "支付方式",
-          align: "center",
-        },
-      ],
     };
-  },
-};
 </script>
 
 <style>
-.header {
-  @apply bg-primary;
-}
+    .header {
+        @apply bg-primary;
+    }
 </style>

+ 9 - 1
src/pc/store.js

@@ -5,11 +5,19 @@ Vue.use(Vuex)
 
 export default new Vuex.Store({
   state: {
-      userinfo:''
+      userinfo:'',
+      banners:[],
+      cart:[]
   },
   mutations: {
       UPDATE_LOGIN_INFO(state,param){
          state.userinfo = param;
+      },
+      UPDATE_BANNER(state,param){
+          state.banners = param;
+      },
+      ADD_CART(state,param){
+          state.cart.push(param);
       }
   },
   actions: {