shenxin 4 年之前
父節點
當前提交
18022f473a
共有 54 個文件被更改,包括 475 次插入69 次删除
  1. 2 1
      src/App.vue
  2. 36 0
      src/api/commissionApi.js
  3. 3 3
      src/api/request.js
  4. 8 1
      src/api/userApi.js
  5. 10 6
      src/components/feed.vue
  6. 36 3
      src/main.js
  7. 4 2
      src/pages.json
  8. 0 4
      src/pages/index.vue
  9. 22 2
      src/pages/my.vue
  10. 12 2
      src/pagesSub/activity/activityDetail.vue
  11. 35 5
      src/pagesSub/commission/commission.vue
  12. 48 6
      src/pagesSub/commission/commissionApply.vue
  13. 2 2
      src/pagesSub/commission/commissionConfirm.vue
  14. 63 9
      src/pagesSub/commission/commissionRecord.vue
  15. 49 13
      src/pagesSub/commission/components/ApplyList.vue
  16. 111 8
      src/pagesSub/commission/invite.vue
  17. 16 1
      src/pagesSub/order/submitOutcome.vue
  18. 二進制
      src/static/common/bg_sy.png
  19. 二進制
      src/static/common/def_location.png
  20. 二進制
      src/static/common/def_network_err.png
  21. 二進制
      src/static/common/def_order.png
  22. 二進制
      src/static/common/icon_bq_ybm.png
  23. 二進制
      src/static/common/icon_bq_yqg.png
  24. 二進制
      src/static/common/icon_lc_fgx.png
  25. 二進制
      src/static/common/icon_numbei_1.png
  26. 二進制
      src/static/common/icon_numbei_2.png
  27. 二進制
      src/static/common/icon_numbei_3.png
  28. 二進制
      src/static/common/icon_numbei_4.png
  29. 二進制
      src/static/common/logo_bt.png
  30. 二進制
      src/static/common/logo_gywm.png
  31. 二進制
      src/static/icon/aboutour.png
  32. 二進制
      src/static/icon/avatar.png
  33. 二進制
      src/static/icon/icon_arrow.png
  34. 二進制
      src/static/icon/icon_bt.png
  35. 二進制
      src/static/icon/icon_commission.png
  36. 二進制
      src/static/icon/icon_commission_book.png
  37. 二進制
      src/static/icon/icon_commission_go.png
  38. 二進制
      src/static/icon/icon_dingwei.png
  39. 二進制
      src/static/icon/icon_dp.png
  40. 二進制
      src/static/icon/icon_kf.png
  41. 二進制
      src/static/icon/icon_money.png
  42. 二進制
      src/static/icon/icon_pp_elm.png
  43. 二進制
      src/static/icon/icon_pp_lxsj.png
  44. 二進制
      src/static/icon/icon_pp_mt.png
  45. 二進制
      src/static/icon/icon_pz_close.png
  46. 二進制
      src/static/icon/icon_success.png
  47. 二進制
      src/static/icon/icon_zujian_sctp.png
  48. 二進制
      src/static/icon/jiantou.png
  49. 二進制
      src/static/icon/order.png
  50. 二進制
      src/static/icon/problem.png
  51. 二進制
      src/static/icon/wechat-logo.png
  52. 10 0
      src/store/index.js
  53. 3 1
      src/store/storageKeys.js
  54. 5 0
      src/uni.scss

+ 2 - 1
src/App.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-01-25 11:32:04
- * @LastEditTime: 2021-03-18 11:10:09
+ * @LastEditTime: 2021-03-19 14:18:30
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \rebatedine-mini\src\App.vue
@@ -26,6 +26,7 @@ export default {
         this.$store.state.ossImgResize = data.oss_img_resize
         this.$store.state.enable_commission = data.enable_commission
         this.$store.state.commission_banner = data.commission_banner
+        this.$store.state.min_apply_amount = data.min_apply_amount
       }
     }
   }

+ 36 - 0
src/api/commissionApi.js

@@ -0,0 +1,36 @@
+/*
+ * @Author: your name
+ * @Date: 2021-03-18 22:04:33
+ * @LastEditTime: 2021-03-19 13:46:34
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: \rebatedine-mini\src\api\commissionApi.js
+ */
+import ajax from './request'
+export const getCommissionApplyList = data => {
+  return ajax.get({
+    url: 'mobile/commission/apply/list',
+    data
+  })
+}
+
+export const getCommissionRecordList = data => {
+  return ajax.get({
+    url: 'mobile/commission/record/list',
+    data
+  })
+}
+
+export const commitCommissionApply = data => {
+  return ajax.post({
+    url: 'mobile/commission/apply/commit',
+    data
+  })
+}
+
+export const getCommissionFeedList = () => {
+  return ajax.get({
+    url: 'mobile/commission/feed/list',
+    data: {}
+  })
+}

+ 3 - 3
src/api/request.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-01-25 11:32:04
- * @LastEditTime: 2021-03-18 15:56:19
+ * @LastEditTime: 2021-03-19 11:00:41
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \rebatedine-mini\src\api\request.js
@@ -16,8 +16,8 @@ export default {
   config: {
     // baseUrl: 'https://apitest.qcbwc.cn/bwc/',
     baseUrl:
-      process.env.NODE_ENV === 'development1'
-        ? 'http://192.168.12.252:18333/'
+      process.env.NODE_ENV === 'development'
+        ? 'https://apitest.topboom0912.com/bwc/'
         : 'https://api.qcbwc.cn/',
     data: '',
     header: {

+ 8 - 1
src/api/userApi.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-01-25 11:32:04
- * @LastEditTime: 2021-01-27 13:25:49
+ * @LastEditTime: 2021-03-18 16:16:43
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \rebatedine-mini\src\api\userApi.js
@@ -16,6 +16,13 @@ export const editUserInfo = data => {
   })
 }
 
+export const getUserInfoByToken = () => {
+  return ajax.get({
+    url: 'mobile/user/getUserInfoByToken',
+    data: {}
+  })
+}
+
 // 参与活动
 export const editJoinActivity = data => {
   return ajax.post({

+ 10 - 6
src/components/feed.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-03-18 11:33:39
- * @LastEditTime: 2021-03-18 15:47:04
+ * @LastEditTime: 2021-03-19 13:57:50
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \rebatedine-mini\src\components\feed.vue
@@ -9,9 +9,10 @@
 <template>
   <view class="feed">
     <image :src="imageUrl"
-           class="avatar"></image>
+           class="avatar"
+           v-if="flase"></image>
     <view class="feed-container">
-      <text class="content">111111</text>
+      <text class="content">{{content}}</text>
     </view>
   </view>
 </template>
@@ -19,7 +20,10 @@
 export default {
   props: {
     imageUrl: {
-      default: '~@/static/icon/avatar.png'
+      default: ''
+    },
+    content: {
+      default: ''
     }
   }
 }
@@ -35,7 +39,7 @@ export default {
     height: 50rpx;
     border-radius: 25rpx;
     z-index: 100;
-    background-image: url(~@/static/icon/avatar.png);
+    background-image: url(/static/icon/avatar.png);
     background-size: 100%;
   }
   .feed-container {
@@ -49,7 +53,7 @@ export default {
     color: #fff;
     font-weight: 400;
     .content {
-      margin-left: 58rpx;
+      margin-left: 25rpx;
       font-size: 22rpx;
     }
   }

+ 36 - 3
src/main.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-01-25 11:32:04
- * @LastEditTime: 2021-03-11 09:53:56
+ * @LastEditTime: 2021-03-19 09:40:02
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \rebatedine-mini\src\main.js
@@ -35,18 +35,51 @@ Vue.filter('imgListFilter', (fileList, type) => {
 })
 
 Vue.mixin({
+  onLoad (options) {
+    options = this.dealOptions(options)
+    const inviteId = options.INVITE_ID
+    if (inviteId && !this.$store.state.INVITE_ID) {
+      this.$store.commit('saveInviteId', inviteId)
+    }
+  },
+  methods: {
+    dealOptions (options) {
+      let option = options
+      if (Object.prototype.hasOwnProperty.call(option, 'scene')) {
+        const str = decodeURIComponent(option.scene).split('&')
+        const json = {}
+        str.forEach(item => {
+          const index = item.indexOf('=')
+          json[item.slice(0, index)] = item.slice(index + 1)
+        })
+        option = json
+      }
+      for (const key in option) {
+        option[key.toUpperCase()] = option[key]
+      }
+      return option
+    }
+  },
   onShareAppMessage (res) {
     const title = '请你趣吃霸王餐'
+    let url = '/pages/index'
+    if (this.$store.userInfo) {
+      url += '?invite_id=' + this.$store.userInfo.id
+    }
     return {
       title: title,
-      path: '/pages/index'
+      path: url
     }
   },
   onShareTimeline (res) {
     const title = '请你趣吃霸王餐'
+    let url = '/pages/index'
+    if (this.$store.userInfo) {
+      url += '?invite_id=' + this.$store.userInfo.id
+    }
     return {
       title: title,
-      path: '/pages/index'
+      path: url
     }
   }
 })

+ 4 - 2
src/pages.json

@@ -62,13 +62,15 @@
         {
           "path": "commission",
           "style": {
-            "navigationBarTitleText": "我的返利金"
+            "navigationBarTitleText": "我的返利金",
+            "enablePullDownRefresh": true
           }
         },
         {
           "path": "commissionRecord",
           "style": {
-            "navigationBarTitleText": "分佣查看"
+            "navigationBarTitleText": "分佣查看",
+            "enablePullDownRefresh": true
           }
         },
         {

+ 0 - 4
src/pages/index.vue

@@ -380,10 +380,6 @@ export default {
         padding: 32px 0;
       }
     }
-    .touch-bottom {
-      padding: 30px 0;
-      color: #babbbc;
-    }
   }
   .def-content {
     margin-top: 212px;

+ 22 - 2
src/pages/my.vue

@@ -19,7 +19,8 @@
         </view>
       </block>
     </view>
-    <view class="commission">
+    <view class="commission"
+          @click="jumpToCommissionApply">
       <view class="left">
         <image src="~@/static/icon/icon_commission.png"
                class="icon"></image>
@@ -27,7 +28,7 @@
       </view>
       <view class="right">
         <text class="right-flag">¥</text>
-        <text class="right-money">199</text>
+        <text class="right-money">{{userInfo ? (userInfo.amount*1/100).toFixed(2) : '--'}}</text>
       </view>
     </view>
     <image class="banner"
@@ -64,6 +65,7 @@
 </template>
 
 <script>
+import * as api from '../api/userApi'
 export default {
   data () {
     return {}
@@ -76,6 +78,15 @@ export default {
       return this.$store.state.commission_banner
     }
   },
+  onShow () {
+    if (this.userInfo) {
+      api.getUserInfoByToken().then(({ code, data }) => {
+        if (code === 200) {
+          this.$store.commit('updateUserInfo', data)
+        }
+      })
+    }
+  },
   methods: {
     toDetail (type) {
       let url
@@ -104,6 +115,15 @@ export default {
         url: '/pagesSub/other/login'
       })
     },
+    jumpToCommissionApply () {
+      if (this.userInfo) {
+        uni.navigateTo({ url: '/pagesSub/commission/commission' })
+      } else {
+        uni.navigateTo({
+          url: '/pagesSub/other/login'
+        })
+      }
+    },
     jumpToCommission () {
       if (this.userInfo) {
         uni.navigateTo({ url: '/pagesSub/commission/invite' })

+ 12 - 2
src/pagesSub/activity/activityDetail.vue

@@ -287,7 +287,7 @@ export default {
     const title = `${this.detail.activity_type === 1 ? '【免费吃】' : '【返利餐】'}${this.detail.title}`
     return {
       title: title,
-      path: `/pagesSub/activity/activityDetail?id=${this.detail.id}`,
+      path: this.getShareUrl(),
       imageUrl: this.detail.imgs
     }
   },
@@ -295,11 +295,18 @@ export default {
     const title = `${this.detail.activity_type === 1 ? '【免费吃】' : '【返利餐】'}${this.detail.title}`
     return {
       title: title,
-      path: `/pagesSub/activity/activityDetail?id=${this.detail.id}`,
+      path: this.getShareUrl(),
       imageUrl: this.detail.imgs
     }
   },
   methods: {
+    getShareUrl () {
+      let url = `/pagesSub/activity/activityDetail?id=${this.detail.id}`
+      if (this.userInfo) {
+        url += '&invite_id=' + this.userInfo.id
+      }
+      return url
+    },
     reNowTime () {
       clearTimeout(this.timer)
       this.timer = setTimeout(() => {
@@ -353,6 +360,9 @@ export default {
         if (this.$store.state.lng) {
           params.lng = this.$store.state.lng
         }
+        if (this.$store.state.INVITE_ID) {
+          params.invite_id = this.$store.state.INVITE_ID
+        }
       } else {
         params.record_id = this.detail.user_activity_id
       }

+ 35 - 5
src/pagesSub/commission/commission.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-03-18 13:14:13
- * @LastEditTime: 2021-03-18 15:44:36
+ * @LastEditTime: 2021-03-19 15:47:45
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \rebatedine-mini\src\pagesSub\commission\commission.vue
@@ -15,14 +15,14 @@
               @click="jumpToCommissionRecord">
           <text class="label">分佣查看</text>
           <image class="icon"
-                 src="~@/static/icon/jiantou.png"></image>
+                 src="~@/static/icon/icon_arrow.png"></image>
         </view>
         <view class="commission-top-middle">
           <image src="~@/static/icon/icon_money.png"
                  class="icon"></image>
-          <text class="label">0.00</text>
+          <text class="label">{{(userInfo.amount/100).toFixed(2)}}</text>
         </view>
-        <text class="commission-top-tips">提现金额将在提现后,工作日隔天到账</text>
+        <text class="commission-top-tips">提现金额将在提现后,一个工作日隔天到账</text>
         <button class="commission-top-button"
                 @click="jumpToApply">提 现</button>
       </view>
@@ -45,7 +45,8 @@
           <swiper-item class="swiper-item"
                        v-for="(item, index) in list"
                        :key="index">
-            <apply-list></apply-list>
+            <apply-list :type="index"
+                        :ref="'list-' + index"></apply-list>
           </swiper-item>
         </swiper>
       </view>
@@ -55,6 +56,7 @@
 
 <script>
 import ApplyList from './components/ApplyList.vue'
+import * as userApi from '../../api/userApi'
 export default {
   components: { ApplyList },
   data () {
@@ -70,8 +72,34 @@ export default {
         }]
     }
   },
+  onShow () {
+    userApi.getUserInfoByToken().then(({ code, data }) => {
+      if (code === 200) {
+        this.$store.commit('updateUserInfo', data)
+      }
+    })
+  },
+  onPullDownRefresh () {
+    this.$refs[`list-${this.current}`][0].refresh()
+  },
+  onReachBottom () {
+    // if (this.isMoreData) {
+    //   this.getList()
+    // }
+  },
+  computed: {
+    userInfo () {
+      return this.$store.state.userInfo
+    }
+  },
   methods: {
     jumpToApply () {
+      if (!this.$store.state.userInfo.alipay_account) {
+        uni.navigateTo({
+          url: '/pagesSub/my/userDetail?toastType=1'
+        })
+        return
+      }
       uni.navigateTo({
         url: '/pagesSub/commission/commissionApply'
       })
@@ -149,6 +177,7 @@ export default {
         color: #212121;
         margin-bottom: -24rpx;
         margin-left: 4rpx;
+        font-weight: 600;
       }
     }
     &-tips {
@@ -156,6 +185,7 @@ export default {
       font-size: 22rpx;
       color: #767778;
       text-align: center;
+      font-weight: 200;
     }
     &-button {
       margin-top: 56rpx;

+ 48 - 6
src/pagesSub/commission/commissionApply.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-03-18 15:02:07
- * @LastEditTime: 2021-03-18 15:45:31
+ * @LastEditTime: 2021-03-19 15:48:53
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \rebatedine-mini\src\pagesSub\commission\commissionApply.vue
@@ -13,11 +13,12 @@
       <text class="content-title">提现金额</text>
       <view class="content-input">
         <text class="content-input-flag">¥</text>
-        <input type="number"
-               class="content-input-input" />
+        <input type="digit"
+               class="content-input-input"
+               v-model="apply_amount" />
       </view>
       <view class="content-divider"></view>
-      <text class="content-tips">可提现金额5元</text>
+      <text class="content-tips">最低提现金额{{(this.$store.state.min_apply_amount/100).toFixed(2)}},可提现金额{{(userInfo.amount/100).toFixed(2)}}元</text>
     </view>
     <button class="button"
             @click="onConfirm">工作日隔天到账,确认提现</button>
@@ -25,10 +26,50 @@
 </template>
 
 <script>
+import * as userApi from '../../api/userApi'
+import * as commissionApi from '../../api/commissionApi'
 export default {
+  data () {
+    return {
+      apply_amount: ''
+    }
+  },
+  computed: {
+    userInfo () {
+      return this.$store.state.userInfo
+    }
+  },
+  onShow () {
+    if (this.userInfo) {
+      userApi.getUserInfoByToken().then(({ code, data }) => {
+        if (code === 200) {
+          this.$store.commit('updateUserInfo', data)
+        }
+      })
+    }
+  },
   methods: {
     onConfirm () {
-
+      if (this.apply_amount > this.userInfo.amount) {
+        uni.showToast({
+          title: '提现金额不能大于当前可用金额',
+          icon: 'none'
+        })
+      }
+      if (!this.$store.state.userInfo.alipay_account) {
+        uni.navigateTo({
+          url: '/pagesSub/my/userDetail?toastType=1'
+        })
+        return
+      }
+      commissionApi.commitCommissionApply({ amount: this.apply_amount * 100 }).then(({ code, msg }) => {
+        if (code === 200) {
+          console.log('success')
+          uni.redirectTo({ url: '/pagesSub/commission/commissionConfirm' })
+        } else {
+          uni.showToast({ title: msg, icon: 'none' })
+        }
+      })
     }
   }
 }
@@ -52,7 +93,7 @@ export default {
     &-flag {
       color: #212121;
       font-size: 60rpx;
-      font-weight: 500;
+      font-weight: 600;
     }
     &-input {
       font-size: 92rpx;
@@ -78,6 +119,7 @@ export default {
 .button {
   margin: 56rpx 40rpx 0 40rpx;
   height: 88rpx;
+  line-height: 88rpx;
   background: #ff6632;
   border-radius: 44rpx;
   font-size: 32rpx;

+ 2 - 2
src/pagesSub/commission/commissionConfirm.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-03-18 15:26:54
- * @LastEditTime: 2021-03-18 15:40:31
+ * @LastEditTime: 2021-03-19 15:51:22
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \rebatedine-mini\src\pagesSub\commission\commissionConfirm.vue
@@ -62,7 +62,7 @@ export default {
     color: #111111;
     background: #ffffff;
     border-radius: 44rpx;
-    border: 1px solid #d3d4d5;
+    border: 2rpx solid #d3d4d5;
   }
 }
 </style>

+ 63 - 9
src/pagesSub/commission/commissionRecord.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-03-18 14:43:45
- * @LastEditTime: 2021-03-18 15:01:03
+ * @LastEditTime: 2021-03-19 09:03:26
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \rebatedine-mini\src\pagesSub\commission\commissionRecord.vue
@@ -9,7 +9,8 @@
 <template>
   <view class="main">
     <network-error />
-    <scroll-view class="list">
+    <scroll-view class="list"
+                 scroll-y>
       <view v-for="(item,index) in list"
             :key="index"
             class="item">
@@ -23,20 +24,72 @@
         </view>
         <view class="gap"></view>
       </view>
+      <view class="touch-bottom u-font-22 line-32 u-text-center">{{isMoreData ? '加载中...' : '到底了~'}}</view>
     </scroll-view>
   </view>
 </template>
 <script>
+import * as commissionApi from '../../api/commissionApi'
 export default {
   data () {
     return {
-      list: [{
-        created_at: '2020-11-30 23:11:11',
-        nick_name: 'Grace'
-      }, {
-        created_at: '2020-11-30 23:11:11',
-        nick_name: 'Grace'
-      }]
+      triggered: false,
+      page_no: 0,
+      isMoreData: true,
+      list: []
+    }
+  },
+  mounted () {
+    this.getList()
+  },
+  onPullDownRefresh () {
+    this.triggered = true
+    this.getList()
+  },
+  onReachBottom () {
+    if (this.isMoreData) {
+      this.getList()
+    }
+  },
+  methods: {
+    getList () {
+      const params = { page_no: this.page_no, page_size: 10 }
+      if (this.triggered) {
+        params.page_no = 0
+      }
+      commissionApi.getCommissionRecordList(params).then(({ code, data }) => {
+        if (code === 200) {
+          if (this.triggered) {
+            this.page_no = 0
+          }
+          if (this.page_no === 0) {
+            this.list = data.list
+          } else {
+            this.list.push(...data.list)
+          }
+          if (data.list.length < 10) {
+            this.isMoreData = false
+          } else {
+            this.isMoreData = true
+            this.page_no++
+          }
+        }
+        this.triggered = false
+        uni.stopPullDownRefresh()
+      }, () => {
+        this.triggered = false
+        uni.stopPullDownRefresh()
+      })
+    },
+    onreachBottom () {
+      if (this.isMoreData) {
+        this.getList()
+      }
+    }
+  },
+  computed: {
+    userInfo () {
+      return this.$store.state.userInfo
     }
   }
 }
@@ -61,6 +114,7 @@ export default {
         background-size: 100%;
         width: 72rpx;
         height: 72rpx;
+        border-radius: 36rpx;
       }
       .name {
         font-size: 30rpx;

+ 49 - 13
src/pagesSub/commission/components/ApplyList.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-03-18 14:08:34
- * @LastEditTime: 2021-03-18 15:01:30
+ * @LastEditTime: 2021-03-19 16:21:24
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \rebatedine-mini\src\pagesSub\commission\components\ApplyList.vue
@@ -15,16 +15,18 @@
           class="item">
       <view class="item-content">
         <view class="item-left">
-          <text class="name">提现</text>
+          <text class="name">{{item.status === 3 ? (item.reason ? item.reason : '') : '提现'}}</text>
           <text class="time">{{item.created_at}}</text>
         </view>
         <text class="amount">-{{(item.amount/100).toFixed(2)}}</text>
       </view>
       <view class="gap"></view>
     </view>
+    <view class="touch-bottom u-font-22 line-32 u-text-center">{{isMoreData ? '加载中...' : '到底了~'}}</view>
   </scroll-view>
 </template>
 <script>
+import * as commissionApi from '../../../api/commissionApi'
 export default {
   props: {
     type: {
@@ -33,22 +35,56 @@ export default {
   },
   data () {
     return {
-      list: [{
-        amount: 1000,
-        created_at: '2021-11-30 23:11:11'
-      }, {
-        amount: 1000,
-        created_at: '2021-11-30 23:11:11'
-      }, {
-        amount: 1000,
-        created_at: '2021-11-30 23:11:11'
-      }]
+      triggered: false,
+      page_no: 0,
+      isMoreData: true,
+      list: []
     }
   },
+  mounted () {
+    this.getList()
+  },
   methods: {
+    refresh () {
+      if (!this.triggered) {
+        this.triggered = true
+        this.getList()
+      }
+    },
+    getList () {
+      const params = { type: this.type, page_no: this.page_no, page_size: 10 }
+      if (this.triggered) {
+        params.page_no = 0
+      }
+      commissionApi.getCommissionApplyList(params).then(({ code, data }) => {
+        if (code === 200) {
+          if (this.triggered) {
+            this.page_no = 0
+          }
+          if (this.page_no === 0) {
+            this.list = data.list
+          } else {
+            this.list.push(...data.list)
+          }
+          if (data.list.length < 10) {
+            this.isMoreData = false
+          } else {
+            this.isMoreData = true
+            this.page_no++
+          }
+        }
+        this.triggered = false
+        uni.stopPullDownRefresh()
+      }, () => {
+        this.triggered = false
+        uni.stopPullDownRefresh()
+      })
+    },
     // scroll-view到底部加载更多
     onreachBottom () {
-
+      if (this.isMoreData) {
+        this.getList()
+      }
     }
   }
 }

+ 111 - 8
src/pagesSub/commission/invite.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-03-18 11:16:06
- * @LastEditTime: 2021-03-18 15:43:42
+ * @LastEditTime: 2021-03-19 15:44:14
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \rebatedine-mini\src\pagesSub\commission\invite.vue
@@ -10,9 +10,18 @@
   <view class="main">
     <network-error />
     <view class="top">
-      <feed class="top-feed"></feed>
+
+      <feed class="top-feed"
+            v-show="feedContent"
+            :content="feedContent"></feed>
+
       <view class="container">
-        <button class="button">立即邀请</button>
+        <button class="button"
+                v-if="!userInfo"
+                @click="jumpToLogin">立即邀请</button>
+        <button class="button"
+                open-type="share"
+                v-if="userInfo">立即邀请</button>
         <button class="button-disable">面对面扫码 敬请期待</button>
       </view>
     </view>
@@ -20,25 +29,34 @@
       <view class="middle-top">
         <view class="middle-top-left">
           <view class="middle-top-left-top">
-            <text class="number">0</text>
+            <text class="number">{{(userInfo.total_amount/100).toFixed(0)}}</text>
             <text class="unit">元</text>
           </view>
           <text class="tips">累计收益</text>
         </view>
         <view class="middle-top-right">
           <view class="middle-top-right-top">
-            <text class="number">0</text>
+            <text class="number">{{userInfo.invite_count}}</text>
             <text class="unit">位</text>
           </view>
           <text class="tips">成功邀请</text>
         </view>
       </view>
       <view class="middle-middle">
-        <view class="middle-middle-button">
+        <button class="middle-middle-button"
+                v-if="!userInfo"
+                @click="jumpToLogin">
           <text class="text">立即邀请好友</text>
           <image class="icon"
                  src="~@/static/icon/icon_commission_go.png"></image>
-        </view>
+        </button>
+        <button class="middle-middle-button"
+                open-type="share"
+                v-if="userInfo">
+          <text class="text">立即邀请好友</text>
+          <image class="icon"
+                 src="~@/static/icon/icon_commission_go.png"></image>
+        </button>
         <view class="middle-middle-money"
               @click="jumpToCommission">
           <image class="icon"
@@ -55,11 +73,83 @@
 
 <script>
 import Feed from '../../components/feed'
+import * as userApi from '../../api/userApi'
+import * as commissionApi from '../../api/commissionApi'
 export default {
   components: {
     Feed
   },
+  data () {
+    return {
+      feeds: [],
+      feedContent: null,
+      feedTimer: null
+    }
+  },
+  onUnload () {
+    if (this.feedTimer) {
+      clearInterval(this.feedTimer)
+    }
+  },
+  onShow () {
+    userApi.getUserInfoByToken().then(({ code, data }) => {
+      if (code === 200) {
+        this.$store.commit('updateUserInfo', data)
+      }
+    })
+    this.feedTimer = setInterval(() => {
+      if (this.feeds.length === 0) {
+        commissionApi.getCommissionFeedList().then(({ code, data }) => {
+          if (code === 200) {
+            this.feeds = data
+            if (this.feeds.length > 0) {
+              const item = this.feeds.pop()
+              this.feedContent = item.content
+            }
+          }
+        })
+      } else {
+        const item = this.feeds.pop()
+        this.feedContent = item.content
+      }
+    }, 3000)
+  },
+  onHide () {
+    if (this.feedTimer) {
+      clearInterval(this.feedTimer)
+      this.feedTimer = null
+    }
+  },
+  onShareAppMessage (res) {
+    const title = '亲爱的,我请你趣吃霸王餐啦!赶紧查收!'
+    return {
+      title: title,
+      path: this.getShareUrl(),
+      imageUrl: 'https://image.qcbwc.cn/share/invite-share.png'
+    }
+  },
+  onShareTimeline (res) {
+    const title = '亲爱的,我请你趣吃霸王餐啦!赶紧查收!'
+    return {
+      title: title,
+      path: this.getShareUrl(),
+      imageUrl: 'https://image.qcbwc.cn/share/invite-share.png'
+    }
+  },
   methods: {
+    change () {
+      this.show = !this.show
+    },
+    getShareUrl () {
+      let url = '/pages/index'
+      if (this.userInfo) {
+        url += '?invite_id=' + this.userInfo.id
+      }
+      return url
+    },
+    jumpToLogin () {
+      uni.navigateTo({ url: '/pagesSub/other/login' })
+    },
     jumpToCommission () {
       uni.navigateTo({
         url: '/pagesSub/commission/commission'
@@ -69,6 +159,9 @@ export default {
   computed: {
     awardUrl () {
       return 'https://image.qcbwc.cn/background/invite_bottom.png?t=' + new Date().getTime()
+    },
+    userInfo () {
+      return this.$store.state.userInfo
     }
   }
 }
@@ -95,6 +188,7 @@ export default {
     margin-top: 956rpx;
     .button {
       height: 88rpx;
+      line-height: 88rpx;
       width: 65%;
       background: linear-gradient(
         180deg,
@@ -112,6 +206,7 @@ export default {
     .button-disable {
       height: 88rpx;
       width: 65%;
+      line-height: 88rpx;
       border-radius: 44rpx;
       margin-bottom: 32rpx;
       font-size: 32rpx;
@@ -131,8 +226,12 @@ export default {
   &-top {
     position: absolute;
     display: flex;
-    width: 100%;
+    width: 90%;
+    margin-left: 5%;
     margin-top: 130rpx;
+    &-left {
+      border-right: 2rpx solid #d3d4d5;
+    }
     &-left,
     &-right {
       flex: 1;
@@ -147,11 +246,13 @@ export default {
         color: #ed2701;
         .number {
           font-size: 80rpx;
+          font-weight: 600;
         }
         .unit {
           margin-bottom: 14rpx;
           font-size: 28rpx;
           margin-left: 4rpx;
+          font-weight: 600;
         }
       }
 
@@ -174,6 +275,7 @@ export default {
       display: flex;
       width: 65%;
       height: 88rpx;
+      line-height: 88rpx;
       justify-content: center;
       align-items: center;
       background: linear-gradient(
@@ -186,6 +288,7 @@ export default {
       border-radius: 44rpx;
       .text {
         font-size: 32rpx;
+        font-weight: 600;
         color: #fcebc6;
       }
       .icon {

+ 16 - 1
src/pagesSub/order/submitOutcome.vue

@@ -36,11 +36,26 @@ export default {
     const title = `${this.detail.activity_type === 1 ? '【免费吃】' : '【返利餐】'}${this.detail.title}`
     return {
       title: title,
-      path: `/pagesSub/activity/activityDetail?id=${this.detail.id}`,
+      path: this.getShareUrl(),
+      imageUrl: this.detail.imgs
+    }
+  },
+  onShareTimeline (res) {
+    const title = `${this.detail.activity_type === 1 ? '【免费吃】' : '【返利餐】'}${this.detail.title}`
+    return {
+      title: title,
+      path: this.getShareUrl(),
       imageUrl: this.detail.imgs
     }
   },
   methods: {
+    getShareUrl () {
+      let url = `/pagesSub/activity/activityDetail?id=${this.detail.id}`
+      if (this.userInfo) {
+        url += '&invite_id=' + this.userInfo.id
+      }
+      return url
+    },
     // 获取用户经纬度
     getLocation () {
       return new Promise((resolve, reject) => {

二進制
src/static/common/bg_sy.png


二進制
src/static/common/def_location.png


二進制
src/static/common/def_network_err.png


二進制
src/static/common/def_order.png


二進制
src/static/common/icon_bq_ybm.png


二進制
src/static/common/icon_bq_yqg.png


二進制
src/static/common/icon_lc_fgx.png


二進制
src/static/common/icon_numbei_1.png


二進制
src/static/common/icon_numbei_2.png


二進制
src/static/common/icon_numbei_3.png


二進制
src/static/common/icon_numbei_4.png


二進制
src/static/common/logo_bt.png


二進制
src/static/common/logo_gywm.png


二進制
src/static/icon/aboutour.png


二進制
src/static/icon/avatar.png


二進制
src/static/icon/icon_arrow.png


二進制
src/static/icon/icon_bt.png


二進制
src/static/icon/icon_commission.png


二進制
src/static/icon/icon_commission_book.png


二進制
src/static/icon/icon_commission_go.png


二進制
src/static/icon/icon_dingwei.png


二進制
src/static/icon/icon_dp.png


二進制
src/static/icon/icon_kf.png


二進制
src/static/icon/icon_money.png


二進制
src/static/icon/icon_pp_elm.png


二進制
src/static/icon/icon_pp_lxsj.png


二進制
src/static/icon/icon_pp_mt.png


二進制
src/static/icon/icon_pz_close.png


二進制
src/static/icon/icon_success.png


二進制
src/static/icon/icon_zujian_sctp.png


二進制
src/static/icon/jiantou.png


二進制
src/static/icon/order.png


二進制
src/static/icon/problem.png


二進制
src/static/icon/wechat-logo.png


+ 10 - 0
src/store/index.js

@@ -10,10 +10,12 @@ const store = new Vuex.Store({
     imgPrefix: 'https://image.qcbwc.cn/',
     ossImgResize: {},
     enable_commission: false,
+    min_apply_amount: 2000,
     commission_banner: 'https://image.qcbwc.cn/banner/commission-banner.png',
     openid: uni.getStorageSync(storageKeys.OPENIDID) || '', // 微信code换取openid
     userInfo: uni.getStorageSync(storageKeys.USER_INFO) || {}, // 用户信息
     cateId: '',
+    INVITE_ID: uni.getStorageSync(storageKeys.INVITE_ID) || '',
     lat: uni.getStorageSync(storageKeys.LAT) || '',
     lng: uni.getStorageSync(storageKeys.LNG) || ''
   },
@@ -21,6 +23,14 @@ const store = new Vuex.Store({
     changeOssImgResize (state, data) {
       state.ossImgResize = data
     },
+    saveInviteId (state, data) {
+      if (data) {
+        if (!state.INVITE_ID) {
+          state.INVITE_ID = data
+          uni.setStorageSync(storageKeys.INVITE_ID, data)
+        }
+      }
+    },
     changeLocation (state, data) {
       if (data) {
         state.lat = data.lat

+ 3 - 1
src/store/storageKeys.js

@@ -1,13 +1,15 @@
 /*
  * @Author: your name
  * @Date: 2021-01-25 11:32:04
- * @LastEditTime: 2021-03-12 11:54:23
+ * @LastEditTime: 2021-03-19 09:26:12
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \rebatedine-mini\src\store\storageKeys.js
  */
 export const OPENIDID = 'OPENIDID' // openid
 
+export const INVITE_ID = 'INVITE_ID'
+
 export const USER_TOKEN = 'USER_TOKEN'
 
 export const USER_INFO = 'USER_INFO'

+ 5 - 0
src/uni.scss

@@ -20,6 +20,11 @@ $u-border-color: #EAEBEC;
   line-height: $line * 2;
 }
 
+.touch-bottom {
+  padding: 30px 0;
+  color: #babbbc;
+}
+
 .u-primary-color {
   color: $u-type-primary;
 }