list.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <template>
  2. <view class="invite-page app-content">
  3. <view class="info-view">
  4. <view class="info-main">
  5. <app-avatar-module :width="100" />
  6. <view class="content">
  7. <view class="name"> {{ userInfo.name || "" }}</view>
  8. <view class="mark"> 普通等级 </view>
  9. </view>
  10. <button class="user-wrap-right" @tap="inviteHd">
  11. <img :src="`${constant.imgUrl}/retail/interest/invite-store.png`" mode="widthFix" />
  12. </button>
  13. <button class="user-wrap-right" @tap="inviteGhs">
  14. <img :src="`${constant.imgUrl}/ghs/me/yqghs.png`" mode="widthFix" />
  15. </button>
  16. </view>
  17. <view class="info-list">
  18. <view class="info-item">
  19. <view class="item-value">{{ invitedNum || 0 }}</view>
  20. <view class="item-name">已邀请</view>
  21. </view>
  22. <view class="info-item">
  23. <view class="item-value">{{ payNum || 0 }}</view>
  24. <view class="item-name">已购买</view>
  25. </view>
  26. <view class="info-item">
  27. <view class="item-value">{{ income || 0.00 }}</view>
  28. <view class="item-name">累计收益</view>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="list-title">
  33. 邀请列表
  34. </view>
  35. <view class="tabs">
  36. <Tabs
  37. :tabs="tabs"
  38. :currentTab="tabIndex"
  39. @change="change"
  40. :itemWidth="'20%'"
  41. :padding="0"
  42. ></Tabs>
  43. </view>
  44. <view scroll-y class="invite-list">
  45. <block v-if="!$util.isEmpty(list.data)">
  46. <InviteItem v-for="(item, index) in list.data" :info="item" :key="index">
  47. </InviteItem>
  48. </block>
  49. <block v-else>
  50. <app-wrapper-empty title="暂无记录" :is-empty="$util.isEmpty(list.data)" />
  51. </block>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. import Tabs from "@/components/plugin/tabs";
  57. import InviteItem from "./inviteItem";
  58. import { appyleListApi,getWeixinId } from "@/api/invite/index";
  59. import { list } from "@/mixins";
  60. import AppWrapperEmpty from "@/components/app-wrapper-empty";
  61. import AppAvatarModule from "@/components/module/app-avatar";
  62. import {mapGetters} from 'vuex'
  63. export default {
  64. name: "pagesInvite",
  65. components: {
  66. Tabs,
  67. InviteItem,
  68. AppWrapperEmpty,
  69. AppAvatarModule
  70. },
  71. mixins: [list],
  72. computed: {
  73. ...mapGetters({ userInfo: "getUser",loginInfo: "getLoginInfo"})
  74. },
  75. data() {
  76. return {
  77. merchantInfo: {},
  78. pageIndex: 0,
  79. constant: this.$constant,
  80. tabIndex: 0,
  81. tabs: [
  82. {
  83. name: "全部",
  84. key: "0"
  85. },
  86. {
  87. name: "待审核",
  88. key: "1"
  89. },
  90. {
  91. name: "试用中",
  92. key: "2"
  93. },
  94. {
  95. name: "已购买",
  96. key: "4"
  97. }
  98. ],
  99. invitedNum: "", //已邀请
  100. payNum: "", //已付费数量
  101. income: "" //累计收益
  102. };
  103. },
  104. onLoad() {},
  105. onPullDownRefresh() {
  106. this.resetList();
  107. console.log(2222)
  108. this._list().then(res => {
  109. uni.stopPullDownRefresh();
  110. });
  111. },
  112. onReachBottom() {
  113. if (!this.list.finished) {
  114. this._list().then(res => {
  115. uni.stopPullDownRefresh();
  116. });
  117. } else {
  118. uni.stopPullDownRefresh();
  119. }
  120. },
  121. mounted(){
  122. },
  123. methods: {
  124. inviteHd(){
  125. this.pageTo({url: '/pagesInvite/inviteHdShop'})
  126. },
  127. inviteGhs(){
  128. this.$msg('开发中')
  129. return false
  130. this.pageTo({url: '/pagesInvite/inviteShop'})
  131. //查看分享的路径,不要删除 shish 20210517
  132. // console.log('pagesClient/official/index?hdShopAdminId='+this.loginInfo.shopAdminId)
  133. // getWeixinId().then(res => {
  134. // uni.navigateToMiniProgram({
  135. // appId: res.data.ghs.miniAppId,
  136. // path: 'pagesClient/official/index?hdShopAdminId='+this.loginInfo.shopAdminId,
  137. // //develop 开发版 trial 体验版 release 正式版
  138. // envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
  139. // extraData: {
  140. // //'hdShopAdminId': this.loginInfo.shopAdminId
  141. // },
  142. // success(res) {
  143. // // 打开成功
  144. // }
  145. // })
  146. // })
  147. },
  148. async init() {
  149. this._list();
  150. },
  151. _list() {
  152. return appyleListApi({
  153. status: this.tabs[this.tabIndex].key,
  154. page: this.list.page,
  155. pageSize: this.list.pageSize
  156. }).then(res => {
  157. const {
  158. data: { invitedNum, payNum, income }
  159. } = res;
  160. this.invitedNum = invitedNum;
  161. this.payNum = payNum;
  162. this.income = income;
  163. this.completes(res);
  164. });
  165. },
  166. change(e) {
  167. if (this.tabIndex == e.index) {
  168. return false;
  169. } else {
  170. this.tabIndex = e.index;
  171. this.resetList();
  172. this._list();
  173. }
  174. },
  175. changePageTab(e) {
  176. if (this.pageIndex == e.index) {
  177. return false;
  178. } else {
  179. this.pageIndex = e.index;
  180. this.resetList();
  181. this._list();
  182. }
  183. }
  184. }
  185. };
  186. </script>
  187. <style lang="scss" scoped>
  188. .invite-page {
  189. height: 100%;
  190. display: flex;
  191. flex-direction: column;
  192. .info-view {
  193. margin-top: 20upx;
  194. padding: 40upx 30upx;
  195. background-color: #fff;
  196. .info-main {
  197. display: flex;
  198. align-items: center;
  199. .logo {
  200. flex-shrink: 0;
  201. width: 100upx;
  202. height: 100upx;
  203. border-radius: 50%;
  204. }
  205. .content {
  206. flex: 1;
  207. margin: 0 20upx;
  208. .name {
  209. font-size: 32upx;
  210. font-weight: 400;
  211. color: #040404;
  212. }
  213. .mark {
  214. margin-top: 10upx;
  215. font-size: 24upx;
  216. font-weight: 400;
  217. color: #999999;
  218. }
  219. }
  220. .user-wrap-right {
  221. width: 180upx;
  222. background-color: #fff;
  223. margin-right: 0;
  224. padding: 0;
  225. &::after {
  226. border: none;
  227. }
  228. }
  229. .btn {
  230. flex-shrink: 0;
  231. height: 80upx;
  232. }
  233. }
  234. .info-list {
  235. margin-top: 50upx;
  236. display: flex;
  237. .info-item {
  238. flex: 1;
  239. display: flex;
  240. flex-direction: column;
  241. align-items: center;
  242. .item-name {
  243. margin-top: 15upx;
  244. font-size: 24upx;
  245. font-weight: 400;
  246. color: #999999;
  247. }
  248. .item-value {
  249. font-size: 30upx;
  250. font-family: DIN Alternate;
  251. font-weight: bold;
  252. color: #333333;
  253. }
  254. }
  255. }
  256. }
  257. .list-title {
  258. padding: 30upx 30upx 15upx;
  259. font-size: 24upx;
  260. font-weight: 400;
  261. color: #999999;
  262. }
  263. .invite-list {
  264. flex: 1;
  265. padding-bottom: 50upx;
  266. }
  267. }
  268. </style>