panyong 3 лет назад
Родитель
Сommit
f6445fe2f6

+ 2 - 1
htmldev/cps/src/App.vue

@@ -36,6 +36,7 @@ export default {
   watch: {
     '$route.name': {
       handler: function (newVal) {
+        const condition = ['PaymentCode', 'ShareMiddle', 'CategoryIndex', 'CategoryDetail'].findIndex(item => item === newVal) === -1
         if (!newVal) {
           return
         }
@@ -45,7 +46,7 @@ export default {
           this.active = newVal
         }
         // 为中转页的时候不调用
-        if (!this.$store.getters['common/isInit'] && newVal !== 'PaymentCode' && newVal !== 'ShareMiddle') {
+        if (!this.$store.getters['common/isInit'] && condition) {
           this.$store.dispatch('common/getUserInfo')
           this.$store.dispatch('common/getOrdertype')
           this.$store.commit('common/UPDATE_ISINIT', true)

+ 1 - 1
htmldev/cps/src/api/request.js

@@ -55,7 +55,7 @@ request.interceptors.request.use(request => {
 
   // 因为微信开发者工具重复授权,本地开发时写死
   if (/^(0|192|10|localhost)/.test(domain)) {
-    request.headers.wechatToken = 'e9a85a94839cb6f8c1aed06625f6f6a4'
+    request.headers.wechatToken = '1ba0a97c52bcd02b03ab8e4d55e14740'
   } else {
     request.headers.wechatToken = getCookieValue('fanbutingwechatToken')
   }

+ 2 - 0
htmldev/cps/src/main.js

@@ -7,6 +7,7 @@ import VueCookie from 'vue-cookie'
 import refreshTitle from './utils/refreshTitle'
 import './utils/filter'
 import './assets/styles/icon.scss'
+import { Lazyload } from 'vant'
 // 全站配置
 window.SITE_CONFIG = {}
 Vue.prototype.$refreshTitle = refreshTitle
@@ -22,6 +23,7 @@ Vue.directive('myBlur', {
   }
 })
 
+Vue.use(Lazyload)
 Vue.use(VueCookie)
 Vue.config.ignoredElements = ['wx-open-launch-weapp']
 

+ 5 - 5
htmldev/cps/src/router/index.js

@@ -157,13 +157,13 @@ const routes = [
         }
       },
       {
-        path: '/detail',
+        path: '/detail/:source/:goodsId',
         name: 'CategoryDetail',
         component: _import('views/category/detail/index'),
-        meta: {
-          isUseCache: false,
-          keepAlive: true
-        }
+        props: (route) => ({
+          source: route.params.source,
+          goodsId: route.params.goodsId
+        })
       }
     ]
   }

+ 3 - 1
htmldev/cps/src/store/modules/common.js

@@ -11,7 +11,9 @@ const state = {
     user_crash_balance: 0, // 累计提现(单位为分)
     user_unreceive_balance: 0, // 用户未结算金额(单位为分)
     created_at: '', // 注册时间
-    id: '' // 用户ID
+    id: '', // 用户ID
+    last_month_money: '', // 上月预估收益
+    month_money: '' // 本月预估收益
   },
   orderType: [], // 订单类型
   inviteId: '', // 邀请人ID,分享链接携带

+ 2 - 2
htmldev/cps/src/views/bill/child/main.vue

@@ -175,9 +175,9 @@ export default {
   beforeDestroy () {
     this.scroll && this.scroll.destroy()
   },
-  beforeRouteLeave (to, form, next) {
+  beforeRouteLeave (to, from, next) {
     if (['Mine', 'OrderDetail'].findIndex(item => item === to.name) > -1) {
-      form.meta.isUseCache = true
+      from.meta.isUseCache = true
     }
     next()
   }

+ 15 - 0
htmldev/cps/src/views/category/detail/api/api.js

@@ -0,0 +1,15 @@
+import request from '@/api/request'
+
+/**
+ * 商品详情页
+ * @param source 来源
+ * @param goodsId 商品ID
+ */
+export const apiGoodsDetail = (source, goodsId) => request({
+  method: 'GET',
+  url: '/api/buy/goods/detail',
+  params: {
+    source: source,
+    goods_id: goodsId
+  }
+})

+ 9 - 5
htmldev/cps/src/views/category/detail/child/banner/index.vue

@@ -24,20 +24,24 @@ export default {
     swiper,
     swiperSlide
   },
+  props: {
+    arrBanner: {
+      type: Array,
+      default: function () {
+        return []
+      }
+    }
+  },
   computed: {
     fbtSWOptions () {
       return {
         // loop: true,
-        // autoplay: this.arrBanner.length > 1,
-        autoplay: false,
+        autoplay: this.arrBanner.length > 1,
         pagination: {
           el: '.sw-pagination',
           clickable: true
         }
       }
-    },
-    arrBanner () {
-      return ['http://p1.music.126.net/uuO0NVbTBmvumV6Qa-ExJw==/109951166598780468.jpg?imageView&quality=89', 'http://p1.music.126.net/2gK-S1egQdDTMgs8zTzmFg==/109951166598932300.jpg?imageView&quality=89']
     }
   }
 }

+ 122 - 19
htmldev/cps/src/views/category/detail/index.vue

@@ -1,67 +1,160 @@
 <template>
-  <div>
+  <div
+    class="padding-bottom-94">
     <!--轮播图-->
-    <Banner/>
+    <Banner
+      :arrBanner="goodsCarouselPictures"/>
     <!--价格信息-->
     <div class="main">
       <div class="header">
         <div class="price-wrap">
           <p class="price">
             <span>¥</span>
-            <span>129</span>
+            <span>{{ goodsInfo.price && (goodsInfo.price * 1).toFixed(2) }}</span>
           </p>
           <p class="origin">券后价</p>
         </div>
         <div class="income">
           <span>预估收益 ¥</span>
-          <span>44.77</span>
+          <span>{{ goodsInfo.commission && (goodsInfo.commission * 1).toFixed(2) }}</span>
         </div>
       </div>
-      <p class="origin-price">原价¥ 599</p>
+      <p class="origin-price">原价¥ {{ goodsInfo.market_price && (goodsInfo.market_price * 1).toFixed(2) }}</p>
       <div
         class="name-wrap">
-        <img src="" alt="">
-        <p>这是名字这是名字这是名字这是名字这是名字这是名这是名字这是名字这是名字这是名字这是名字这是名</p>
+        <p>{{ goodsInfo.goods_name }}</p>
       </div>
-      <div class="coupon-wrap">
+      <div
+        class="coupon-wrap"
+        @click="jumpShops"
+        v-if="couponInfo.fav > 0">
         <div>
-          <p class="amount">333元优惠券</p>
-          <p class="expires">10月20日-11月11日</p>
+          <p class="amount">{{ couponInfo.fav }}元优惠券</p>
+          <p class="expires">{{
+              couponInfo.use_begin_time.replace(/\s\d{2}|:\d{2}/g, '').replace('-', '年').replace('-', '月') + '日'
+            }}-{{
+              couponInfo.use_end_time.replace(/\s\d{2}|:\d{2}/g, '').replace('-', '年').replace('-', '月') + '日'
+            }}</p>
         </div>
         <van-button type="default">立即领券</van-button>
       </div>
     </div>
+    <!--商品详情图片-->
+    <div
+      class="photo-list">
+      <img
+        v-lazy="str"
+        alt=""
+        v-for="(str, index) in goodsDetailPictures"
+        :key="index">
+    </div>
     <!--底部按钮-->
     <div class="footer">
-      <a href="javascript:;">
+      <a
+        href="javascript:;"
+        @click="showShareTip">
         <span>分享赚</span>
-        <span>¥99999.79</span>
+        <span>¥{{ goodsInfo.commission }}</span>
       </a>
-      <a href="javascript:;">
+      <a
+        href="javascript:;"
+        @click="jumpShops">
         <span>自购省</span>
-        <span>券¥99999.79 + ¥99999999.79</span>
+        <span>券¥{{ couponInfo.fav }} + ¥{{ goodsInfo.commission }}</span>
       </a>
     </div>
+    <!--弹窗:分享提示-->
+    <ShareTipInWechat
+      ref="fbtShareTipInWechat"/>
   </div>
 </template>
 
 <script>
+import funWxShare from '@/utils/wxShare0.0'
 import Banner from './child/banner'
-import { Button } from 'vant'
+import ShareTipInWechat from '../../common/shareTipInWechat'
+import { Button, Toast } from 'vant'
+import { apiGoodsDetail } from './api/api'
+import { platform } from '../../../utils/platform'
 
 export default {
   name: 'index',
   components: {
     Banner,
+    ShareTipInWechat,
     'van-button': Button
+  },
+  props: {
+    source: {
+      type: String,
+      default: ''
+    },
+    goodsId: {
+      type: [String, Number],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      goodsInfo: {},
+      couponInfo: {}, // 优惠券相关
+      goodsCarouselPictures: [], // 商品轮播图
+      goodsDetailPictures: [] // 商品详情图片
+    }
+  },
+  created () {
+    this.funInit()
+  },
+  methods: {
+    async funInit () {
+      try {
+        const { status, data, msg } = await apiGoodsDetail(this.source, this.goodsId)
+        if (status) {
+          let coverImg = ''
+          this.goodsInfo = data
+          this.couponInfo = data.coupon_info
+          if (Array.isArray(data.goods_carousel_pictures)) {
+            this.goodsCarouselPictures = data.goods_carousel_pictures
+          }
+          if (Array.isArray(data.goods_detail_pictures)) {
+            this.goodsDetailPictures = data.goods_detail_pictures
+          }
+          if (this.goodsCarouselPictures.length) {
+            coverImg = this.goodsCarouselPictures[0]
+          } else if (this.goodsDetailPictures.length) {
+            coverImg = this.goodsDetailPictures[0]
+          }
+          platform.isWeixin && funWxShare('返不停', data.goods_name, coverImg, data.url)
+        } else {
+          Toast(msg)
+        }
+      } catch (e) {}
+    },
+    showShareTip () {
+      if (!(Object.keys(this.goodsInfo).length)) {
+        Toast('数据加载中,稍后重试')
+        return
+      }
+      this.$refs.fbtShareTipInWechat.init()
+    },
+    jumpShops () {
+      if (!(Object.keys(this.goodsInfo).length)) {
+        Toast('数据加载中,稍后重试')
+        return
+      }
+      top.location.href = this.goodsInfo.url
+    }
   }
 }
 </script>
 
 <style lang="scss" scoped>
+.padding-bottom-94 {
+  padding-bottom: 94px;
+}
+
 .main {
-  width: 365px;
-  padding-bottom: 120px;
+  width: 355px;
   margin: 0 auto;
 }
 
@@ -137,7 +230,7 @@ export default {
 }
 
 .name-wrap {
-  margin-top: 10px;
+  margin: 10px 0 14px;
   overflow: hidden;
 
   img {
@@ -161,7 +254,6 @@ export default {
   justify-content: flex-end;
   width: 359px;
   height: 84px;
-  margin-top: 14px;
   background: url("./image/ic_coupon_big.png") center center/100% 100% no-repeat;
 
   & > div {
@@ -244,4 +336,15 @@ export default {
     }
   }
 }
+
+.photo-list {
+  margin-top: 14px;
+
+  img {
+    display: block;
+    width: 100%;
+    max-width: 800px;
+    margin: 0 auto;
+  }
+}
 </style>

+ 16 - 3
htmldev/cps/src/views/category/index/api/api.js

@@ -1,9 +1,22 @@
 import request from '@/api/request'
 
 /**
- * 类目/活动/频道接口
+ * 获取电商平台分
  */
-export const apiCateList = () => request({
+export const apiCateList = (source) => request({
   method: 'GET',
-  url: '/api/pdd/cate/list'
+  url: '/api/buy/cate/list',
+  params: {
+    source: source
+  }
+})
+
+/**
+ * 获取商品列表
+ * @param obj
+ */
+export const apiGoodsList = (obj) => request({
+  method: 'POST',
+  url: '/api/buy/goods/list',
+  data: obj
 })

+ 51 - 61
htmldev/cps/src/views/category/index/child/main.vue

@@ -22,43 +22,46 @@
         v-for="(item, index) in list"
         :key="index"
         class="list-item border-bottom-1px"
-        @click="getOrderDetail(item.id)">
+        @click="getOrderDetail(item.goods_id)">
         <div class="photo">
-          <img src="" alt="">
+          <img
+            :src="item.goods_thumb_url"
+            alt="">
         </div>
         <div class="info">
           <div
             class="top">
-            <img src="" alt="">
-            <p>这是名字这是名字这是名字这是名字这是名字这是名</p>
+            <p>{{ item.goods_name }}</p>
           </div>
           <div class="middle">
             <div class="price-wrap">
               <p class="price">
                 <span>¥</span>
-                <span>129</span>
+                <span>{{ item.price && (item.price * 1).toFixed(2) }}</span>
               </p>
-              <p class="origin">¥599</p>
-            </div>
-            <div class="sale-count">
-              <span>已售</span>
-              <span>0</span>
+              <p class="origin">¥{{ item.market_price && (item.market_price * 1).toFixed(2) }}</p>
             </div>
+            <!--暂时不用这个字段-->
+            <!--<div class="sale-count">-->
+            <!--<span>已售</span>-->
+            <!--<span>0</span>-->
+            <!--</div>-->
           </div>
-          <div class="card">
-            <p class="coupon">
+          <div class="card" v-show="item.discount > 0 && item.commission > 0">
+            <p class="coupon" v-show="item.discount > 0">
               <span>券</span>
-              <span>¥470</span>
+              <span>¥{{ item.discount }}</span>
             </p>
-            <p class="profit">
+            <p class="profit" v-show="item.commission > 0">
               <span>分享赚</span>
-              <span>¥&nbsp;42.77</span>
+              <span>¥&nbsp;{{ item.commission | fen2Yuan }}</span>
             </p>
           </div>
-          <div class="shop">
-            <img src="" alt="">
-            <p>店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名</p>
-          </div>
+          <!--暂时不用这个字段-->
+          <!--<div class="shop">-->
+          <!--<img src="" alt="">-->
+          <!--<p>店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名</p>-->
+          <!--</div>-->
         </div>
       </li>
       <li class="pullup-wrapper">
@@ -80,20 +83,20 @@
 <script>
 import BScroll from 'better-scroll'
 import { Toast, Loading } from 'vant'
-import { apiOrderList } from '../../../order/api/api'
+import { apiGoodsList } from '../api/api'
 
 export default {
   components: {
     'van-loading': Loading
   },
   props: {
-    orderPlatformSonType: {
-      type: Number,
-      default: 0
+    source: {
+      type: String,
+      default: ''
     },
-    orderStatus: {
-      type: Number,
-      default: 0
+    catId: {
+      type: [String, Number],
+      default: ''
     }
   },
   data () {
@@ -107,22 +110,19 @@ export default {
       scroll: null
     }
   },
-  activated () {
-    if (!this.$route.meta.isUseCache) {
+  methods: {
+    init () {
       this.finished = false
       this.isRefresh = false
       this.isFetchLock = false
       this.pagenum = 0
       this.pagesize = 20
       this.list = []
-      this.scroll = null
+      if (this.scroll) {
+        this.scroll.scrollTo(0, 0)
+      }
       this.getList()
-    } else {
-      this.scroll && this.scroll.refresh()
-    }
-    this.$route.meta.isUseCache = false
-  },
-  methods: {
+    },
     onRefresh () {
       this.pagenum = 0
       this.pagesize = 20
@@ -140,17 +140,14 @@ export default {
       this.isFetchLock = true
       this.pagenum++
       try {
-        const { status, data, msg } = await apiOrderList({
+        const { status, data, msg } = await apiGoodsList({
           page: this.pagenum,
           page_size: this.pagesize,
-          order_platform_son_type: this.orderPlatformSonType,
-          order_status: this.orderStatus
+          source: this.source,
+          cat_id: this.catId
         })
         if (status) {
-          // const { list } = data
-          // todo
-          console.log(data)
-          const list = [1, 2, 3, 4, 5]
+          const { list } = data
           // 下拉刷新数据清空
           if (this.isRefresh) {
             this.isRefresh = false
@@ -205,18 +202,18 @@ export default {
         this.isFetchLock = false
       }
     },
-    async getOrderDetail (id) {
-      this.$router.push({ name: 'CategoryDetail' })
+    getOrderDetail (id) {
+      this.$router.push({
+        name: 'CategoryDetail',
+        params: {
+          source: this.source,
+          goodsId: id
+        }
+      })
     }
   },
   beforeDestroy () {
     this.scroll && this.scroll.destroy()
-  },
-  beforeRouteLeave (to, form, next) {
-    if (['Mine', 'OrderDetail'].findIndex(item => item === to.name) > -1) {
-      form.meta.isUseCache = true
-    }
-    next()
   }
 }
 </script>
@@ -279,7 +276,6 @@ export default {
   margin-right: 10px;
   border-radius: 6px;
   overflow: hidden;
-  background: pink;
 
   img {
     display: block;
@@ -293,20 +289,15 @@ export default {
 }
 
 .top {
-  overflow: hidden;
-
-  img {
-    width: 30px;
-    height: 16px;
-    margin-right: 4px;
-    float: left;
-  }
-
   p {
+    display: -webkit-box;
     font-size: 14px;
     font-weight: bold;
     color: #333333;
     line-height: 18px;
+    -webkit-line-clamp: 2;
+    -webkit-box-orient: vertical;
+    overflow: hidden;
   }
 }
 
@@ -423,7 +414,6 @@ export default {
     width: 12px;
     height: 11px;
     margin-right: 6px;
-    background: pink;
   }
 
   p {

+ 69 - 32
htmldev/cps/src/views/category/index/index.vue

@@ -9,13 +9,14 @@
         :title-active-color="'#FFF'"
         :title-inactive-color="'#8A8A8A'"
         :background="'#fff'"
+        @click="fetchCateList"
         ref="fbtBusinessList">
         <van-tab
-          v-for="index in 10"
-          :key="index">
+          :name="item.value"
+          v-for="item in sourceList"
+          :key="item.value">
           <template #title>
-            <img src="" alt="">
-            <i>选项</i>
+            <i>{{ item.name }}</i>
           </template>
         </van-tab>
       </van-tabs>
@@ -24,18 +25,18 @@
     <div
       class="cate-header">
       <van-tabs
-        v-model="cateValue"
+        v-model="catId"
         :color="'#F09E38'"
         :title-active-color="'#333333'"
         :title-inactive-color="'#515151'"
         :background="'#fff'"
+        @click="selectCateId"
         ref="fbtCateList">
         <van-tab
-          v-for="index in 10"
-          :key="index">
-          <template #title>
-            {{ index % 2 === 0 ? '选项选项' : '选项' }}
-          </template>
+          :name="item.id"
+          v-for="item in cateList"
+          :key="item.id">
+          <template #title>{{ item.name }}</template>
         </van-tab>
       </van-tabs>
       <van-dropdown-menu
@@ -47,10 +48,10 @@
           </template>
           <ul>
             <li
-              :class="{'active': i === cateValue}"
-              v-for="i in 10"
-              :key="i"
-              @click="onConfirm(i)">选项选项{{ i }}
+              :class="{'active': item.id === catId}"
+              v-for="item in cateList"
+              :key="item.id"
+              @click="onConfirm(item)">{{ item.name }}
             </li>
           </ul>
         </van-dropdown-item>
@@ -58,9 +59,8 @@
     </div>
     <!--商品列表-->
     <Main
-      :orderPlatformSonType="orderPlatformSonType"
-      :orderStatus="orderStatus"
-      @setOrderDetail="setOrderDetail"
+      :source="this.businessValue"
+      :catId="catId"
       ref="myMain"/>
   </div>
 </template>
@@ -82,45 +82,82 @@ export default {
   },
   data () {
     return {
+      sourceList: [
+        {
+          name: '京东',
+          value: 'jd'
+        },
+        {
+          name: '唯品会',
+          value: 'vip'
+        },
+        {
+          name: '拼多多',
+          value: 'pdd'
+        },
+        {
+          name: '考拉',
+          value: 'kaola'
+        },
+        {
+          name: '淘宝',
+          value: 'taobao'
+        }
+      ], // 商家列表
       businessValue: 'jd',
-      cateValue: 0,
-      orderPlatformSonType: 0,
-      orderStatus: 0
+      catId: '',
+      cateList: [] // 分类列表
     }
   },
   activated () {
     if (!this.$route.meta.isUseCache) {
+      this.businessValue = this.sourceList[0].value
+      this.catId = ''
       this.fetchCateList()
+    } else {
+      if (this.$refs.myMain && this.$refs.myMain.scroll) {
+        this.$refs.myMain.scroll.refresh()
+      }
     }
     setTimeout(() => {
       this.$refs.fbtBusinessList.resize()
-      this.$refs.fbtCateList.resize()
     }, 500)
     this.$route.meta.isUseCache = false
   },
   methods: {
     async fetchCateList () {
       try {
-        const { status, data, msg } = await apiCateList()
+        const { status, data, msg } = await apiCateList(this.businessValue)
         if (status) {
-          console.log(data)
+          this.cateList = data
+
+          setTimeout(() => {
+            this.$refs.fbtCateList.resize()
+            this.$refs.myMain.init()
+          }, 500)
         } else {
           Toast(msg)
         }
       } catch (e) {}
     },
-    onConfirm (val) {
-      this.cateValue = val
+    selectCateId () {
       this.$nextTick(() => {
-        this.$refs.fbtCateDropdownMenu.toggle()
+        this.$refs.myMain.init()
       })
     },
-    setOrderDetail (obj) {
-      if (Object.prototype.toString.call(obj) === '[object Object]') {
-        this.orderDetail = obj
-        this.showDetail = true
-      }
+    onConfirm (obj) {
+      this.catId = obj.id
+      this.$nextTick(() => {
+        this.$refs.fbtCateDropdownMenu.toggle()
+        this.$refs.myMain.init()
+      })
+    }
+  },
+  beforeRouteLeave (to, from, next) {
+    if (['CategoryDetail'].findIndex(item => item === to.name) > -1) {
+      from.meta.isUseCache = true
     }
+    next()
   }
 }
 </script>
@@ -156,6 +193,7 @@ export default {
       .van-tab__text {
         display: flex;
         align-items: center;
+        justify-content: center;
         width: 67px;
         height: 23px;
         padding: 0 12px;
@@ -166,7 +204,6 @@ export default {
           width: 16px;
           height: 16px;
           margin-right: 3px;
-          background: pink;
         }
 
         i {

+ 1 - 1
htmldev/cps/src/views/common/openWxMiniProgram/index.vue

@@ -93,7 +93,7 @@ export default {
           // type 类型:1-h5 2-小程序
           const { type, url } = data
           this.accountId = data.app_id
-          this.appPath = data.page_path
+          // this.appPath = data.page_path
           if (type === 2 && isSupportJumpWXmini()) {
             this.showFlag = true
           } else {

+ 0 - 0
htmldev/cps/src/views/invite/image/icon_01@2x.png → htmldev/cps/src/views/common/shareTipInWechat/image/icon_01@2x.png


+ 43 - 0
htmldev/cps/src/views/common/shareTipInWechat/index.vue

@@ -0,0 +1,43 @@
+<template>
+  <van-popup
+    class="fbt-van-popup-share"
+    position="top"
+    v-model="booShareTip">
+    <img
+      src="./image/icon_01@2x.png"
+      alt="">
+  </van-popup>
+</template>
+
+<script>
+import { Popup } from 'vant'
+
+export default {
+  name: 'index',
+  components: {
+    'van-popup': Popup
+  },
+  data () {
+    return {
+      booShareTip: false
+    }
+  },
+  methods: {
+    init () {
+      this.booShareTip = true
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.fbt-van-popup-share {
+  background: transparent;
+
+  img {
+    display: block;
+    width: 100%;
+    height: 286px;
+  }
+}
+</style>

+ 2 - 2
htmldev/cps/src/views/fans/child/main.vue

@@ -179,9 +179,9 @@ export default {
   beforeDestroy () {
     this.scroll && this.scroll.destroy()
   },
-  beforeRouteLeave (to, form, next) {
+  beforeRouteLeave (to, from, next) {
     if (['Mine', 'OrderDetail'].findIndex(item => item === to.name) > -1) {
-      form.meta.isUseCache = true
+      from.meta.isUseCache = true
     }
     next()
   }

+ 8 - 15
htmldev/cps/src/views/invite/index.vue

@@ -5,21 +5,15 @@
       ref="myMall"
       @showShareTip="showShareTip"/>
     <!--弹窗:分享提示-->
-    <van-popup
-      class="fbt-van-popup-share"
-      position="top"
-      v-model="booShareTip">
-      <img
-        src="./image/icon_01@2x.png"
-        alt="">
-    </van-popup>
+    <ShareTipInWechat
+      ref="fbtShareTipInWechat"/>
   </div>
 </template>
 
 <script>
 import funWxShare from '@/utils/wxShare0.0'
 import Mall from '../marketing/save/mall'
-import { Popup } from 'vant'
+import ShareTipInWechat from '../common/shareTipInWechat'
 import { getHomeList } from '@/views/marketing/api'
 import { platform } from '@/utils/platform'
 
@@ -27,12 +21,11 @@ export default {
   name: 'index',
   components: {
     Mall,
-    'van-popup': Popup
+    ShareTipInWechat
   },
   data () {
     return {
-      shops: [],
-      booShareTip: false
+      shops: []
     }
   },
   activated () {
@@ -60,12 +53,12 @@ export default {
     },
     showShareTip (obj) {
       platform.isWeixin && funWxShare(obj.category_name, obj.category_desc, obj.category_img_url, `${location.origin}/shareMiddle?redirectUrl=${encodeURIComponent(obj.link_url)}`)
-      this.booShareTip = true
+      this.$refs.fbtShareTipInWechat.init()
     }
   },
-  beforeRouteLeave (to, form, next) {
+  beforeRouteLeave (to, from, next) {
     if (['Mine', 'MarketingSave'].findIndex(item => item === to.name) > -1) {
-      form.meta.isUseCache = true
+      from.meta.isUseCache = true
     }
     this.$store.dispatch('common/getUserInfo')
     next()

+ 2 - 2
htmldev/cps/src/views/marketing/index.vue

@@ -136,9 +136,9 @@ export default {
       this.scroll.scrollTo(this.initTranslate(tabId), 0, 300)
     }
   },
-  beforeRouteLeave (to, form, next) {
+  beforeRouteLeave (to, from, next) {
     if (['Mine'].findIndex(item => item === to.name) > -1) {
-      form.meta.isUseCache = true
+      from.meta.isUseCache = true
     }
     next()
   }

+ 2 - 2
htmldev/cps/src/views/marketing/make/index.vue

@@ -170,9 +170,9 @@ export default {
   beforeDestroy () {
     this.scroll && this.scroll.destroy()
   },
-  beforeRouteLeave (to, form, next) {
+  beforeRouteLeave (to, from, next) {
     if (['MarketingSave', 'MarketingReturn'].findIndex(item => item === to.name) > -1) {
-      form.meta.isUseCache = true
+      from.meta.isUseCache = true
     }
     next()
   }

+ 2 - 2
htmldev/cps/src/views/marketing/return/index.vue

@@ -162,9 +162,9 @@ export default {
   beforeDestroy () {
     this.scroll && this.scroll.destroy()
   },
-  beforeRouteLeave (to, form, next) {
+  beforeRouteLeave (to, from, next) {
     if (['MarketingSave', 'MarketingMake'].findIndex(item => item === to.name) > -1) {
-      form.meta.isUseCache = true
+      from.meta.isUseCache = true
     }
     next()
   }

+ 2 - 2
htmldev/cps/src/views/marketing/save/index.vue

@@ -129,9 +129,9 @@ export default {
   beforeDestroy () {
     this.shopsScroll && this.shopsScroll.destroy()
   },
-  beforeRouteLeave (to, form, next) {
+  beforeRouteLeave (to, from, next) {
     if (['MarketingReturn', 'MarketingMake'].findIndex(item => item === to.name) > -1) {
-      form.meta.isUseCache = true
+      from.meta.isUseCache = true
     }
     next()
   }

+ 117 - 41
htmldev/cps/src/views/mine/index.vue

@@ -1,58 +1,92 @@
 <template>
-  <div class="mine-conatainer">
-    <div class="header">
-      <div class="avatar">
-        <img
-          :src="userInfo.user_head_img_url"
-          alt="">
+  <div
+    class="mine-conatainer"
+    ref="fbyMine">
+    <div>
+      <div class="header">
+        <div class="avatar">
+          <img
+            :src="userInfo.user_head_img_url"
+            alt="">
+        </div>
       </div>
+      <div class="income-wrap">
+        <div>
+          <p>上月预估收入(元)</p>
+          <p>¥{{ userInfo.last_month_money | fen2Yuan }}</p>
+        </div>
+        <div>
+          <p>本月预估收入(元)</p>
+          <p>¥{{ userInfo.month_money | fen2Yuan }}</p>
+        </div>
+      </div>
+      <ul>
+        <li @click="$router.push({name: 'Order'})">
+          <p class="left">
+            <i class="label icon-order"></i>
+            <span class="label">下单记录</span>
+          </p>
+          <p class="right">
+            <i class="arrow"></i>
+          </p>
+        </li>
+        <li @click="$router.push({name: 'Wallet'})">
+          <p class="left">
+            <i class="label icon-wallet"></i>
+            <span class="label">可提现余额</span>
+          </p>
+          <p class="right">
+            <span class="value">{{ userInfo.user_balance | fen2Yuan }}</span>
+            <i class="arrow"></i>
+          </p>
+        </li>
+        <li @click="$router.push({name: 'Fans'})">
+          <p class="left">
+            <i class="label icon-wallet"></i>
+            <span class="label">粉丝</span>
+          </p>
+          <p class="right">
+            <span class="value">{{ userInfo.user_fans_num }}</span>
+            <i class="arrow"></i>
+          </p>
+        </li>
+      </ul>
+      <router-link
+        class="jump-recommend"
+        :to="{name: 'Recommend'}"></router-link>
     </div>
-    <ul>
-      <li @click="$router.push({name: 'Order'})">
-        <p class="left">
-          <i class="label icon-order"></i>
-          <span class="label">下单记录</span>
-        </p>
-        <p class="right">
-          <i class="arrow"></i>
-        </p>
-      </li>
-      <li @click="$router.push({name: 'Wallet'})">
-        <p class="left">
-          <i class="label icon-wallet"></i>
-          <span class="label">钱包</span>
-        </p>
-        <p class="right">
-          <span class="value">{{ userInfo.user_balance | fen2Yuan }}</span>
-          <i class="arrow"></i>
-        </p>
-      </li>
-      <li @click="$router.push({name: 'Fans'})">
-        <p class="left">
-          <i class="label icon-wallet"></i>
-          <span class="label">粉丝</span>
-        </p>
-        <p class="right">
-          <span class="value">{{ userInfo.user_fans_num }}</span>
-          <i class="arrow"></i>
-        </p>
-      </li>
-    </ul>
-    <router-link
-      class="jump-recommend"
-      :to="{name: 'Recommend'}"></router-link>
   </div>
 </template>
 
 <script>
+import BScroll from 'better-scroll'
 import { mapGetters } from 'vuex'
 
 export default {
   name: 'index',
+  data () {
+    return {
+      scroll: null
+    }
+  },
   computed: {
     ...mapGetters({
       userInfo: 'common/userinfo'
     })
+  },
+  activated () {
+    if (!this.$route.meta.isUseCache) {
+      setTimeout(() => {
+        this.scroll = new BScroll(this.$refs.fbyMine, {
+          click: true,
+          scrollbar: true
+        })
+      }, 500)
+    } else {
+      if (this.scroll) {
+        this.scroll.refresh()
+      }
+    }
   }
 }
 </script>
@@ -63,8 +97,10 @@ export default {
   left: 0;
   top: 0;
   right: 0;
-  bottom: 0;
+  bottom: 50px;
   width: 100%;
+  padding-bottom: 20px;
+  overflow: hidden;
 }
 
 .header {
@@ -86,6 +122,46 @@ export default {
   }
 }
 
+.income-wrap {
+  display: flex;
+  align-items: center;
+  width: 335px;
+  margin: 17px auto;
+  padding: 16px 0;
+  border-radius: 10px;
+  background: #FFFFFF;
+  box-shadow: 0 2px 4px 0 rgba(31, 49, 74, 0.12);
+
+  & > div {
+    position: relative;
+    left: 0;
+    top: 0;
+    flex: 1;
+
+    &:nth-of-type(2) {
+      &:before {
+        @include vertical-center;
+        left: 0;
+        height: 86%;
+        content: '';
+        border-left: 1px solid #ccc;
+      }
+    }
+  }
+
+  p {
+    width: 100%;
+    font-size: 14px;
+    color: #333333;
+    line-height: 20px;
+    text-align: center;
+
+    &:nth-of-type(2) {
+      margin-top: 4px;
+    }
+  }
+}
+
 ul {
   width: 335px;
   margin: 0 auto;

+ 2 - 2
htmldev/cps/src/views/order/child/main.vue

@@ -207,9 +207,9 @@ export default {
   beforeDestroy () {
     this.scroll && this.scroll.destroy()
   },
-  beforeRouteLeave (to, form, next) {
+  beforeRouteLeave (to, from, next) {
     if (['Mine', 'OrderDetail'].findIndex(item => item === to.name) > -1) {
-      form.meta.isUseCache = true
+      from.meta.isUseCache = true
     }
     next()
   }