list.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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 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. inviteGhs(){
  125. this.$msg('开发中')
  126. return false
  127. this.pageTo({url: '/pagesInvite/inviteGhsShop'})
  128. },
  129. inviteHd(){
  130. this.$msg('开发中')
  131. return false
  132. this.pageTo({url: '/pagesInvite/inviteShop'})
  133. //查看分享的路径,不要删除 shish 20210517
  134. // console.log('pagesClient/official/index','ghsShopAdminId='+ this.loginInfo.shopAdminId)
  135. // getWeixinId().then(res => {
  136. // uni.navigateToMiniProgram({
  137. // appId: res.data.hd.miniAppId,
  138. // path: 'pagesClient/official/index?ghsShopAdminId='+this.loginInfo.shopAdminId,
  139. // //develop 开发板 trial 体验版 release 正式版
  140. // envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
  141. // extraData: {
  142. // //'ghsShopAdminId': this.loginInfo.shopAdminId
  143. // },
  144. // success(res) {
  145. // // 打开成功
  146. // }
  147. // })
  148. // });
  149. },
  150. async init() {
  151. this._list();
  152. },
  153. _list() {
  154. return appyleListApi({
  155. status: this.tabs[this.tabIndex].key,
  156. page: this.list.page,
  157. pageSize: this.list.pageSize
  158. }).then(res => {
  159. const {
  160. data: { invitedNum, payNum, income }
  161. } = res;
  162. this.invitedNum = invitedNum;
  163. this.payNum = payNum;
  164. this.income = income;
  165. this.completes(res);
  166. });
  167. },
  168. change(e) {
  169. if (this.tabIndex == e.index) {
  170. return false;
  171. } else {
  172. this.tabIndex = e.index;
  173. this.resetList();
  174. this._list();
  175. }
  176. },
  177. changePageTab(e) {
  178. if (this.pageIndex == e.index) {
  179. return false;
  180. } else {
  181. this.pageIndex = e.index;
  182. this.resetList();
  183. this._list();
  184. }
  185. }
  186. }
  187. };
  188. </script>
  189. <style lang="scss" scoped>
  190. .invite-page {
  191. height: 100%;
  192. display: flex;
  193. flex-direction: column;
  194. .info-view {
  195. margin-top: 20upx;
  196. padding: 40upx 30upx;
  197. background-color: #fff;
  198. .info-main {
  199. display: flex;
  200. align-items: center;
  201. .logo {
  202. flex-shrink: 0;
  203. width: 100upx;
  204. height: 100upx;
  205. border-radius: 50%;
  206. }
  207. .content {
  208. flex: 1;
  209. margin: 0 20upx;
  210. .name {
  211. font-size: 32upx;
  212. font-weight: 400;
  213. color: #040404;
  214. }
  215. .mark {
  216. margin-top: 10upx;
  217. font-size: 24upx;
  218. font-weight: 400;
  219. color: #999999;
  220. }
  221. }
  222. .user-wrap-right {
  223. width: 180upx;
  224. background-color: #fff;
  225. margin-right: 0;
  226. padding: 0;
  227. &::after {
  228. border: none;
  229. }
  230. }
  231. .btn {
  232. flex-shrink: 0;
  233. height: 80upx;
  234. }
  235. }
  236. .info-list {
  237. margin-top: 50upx;
  238. display: flex;
  239. .info-item {
  240. flex: 1;
  241. display: flex;
  242. flex-direction: column;
  243. align-items: center;
  244. .item-name {
  245. margin-top: 15upx;
  246. font-size: 24upx;
  247. font-weight: 400;
  248. color: #999999;
  249. }
  250. .item-value {
  251. font-size: 30upx;
  252. font-family: DIN Alternate;
  253. font-weight: bold;
  254. color: #333333;
  255. }
  256. }
  257. }
  258. }
  259. .list-title {
  260. padding: 30upx 30upx 15upx;
  261. font-size: 24upx;
  262. font-weight: 400;
  263. color: #999999;
  264. }
  265. .invite-list {
  266. flex: 1;
  267. padding-bottom: 50upx;
  268. }
  269. }
  270. </style>