list.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  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">0</view>
  20. <view class="item-name">待审核</view>
  21. </view>
  22. <view class="info-item">
  23. <view class="item-value">0</view>
  24. <view class="item-name">已通过</view>
  25. </view>
  26. <view class="info-item">
  27. <view class="item-value" @click.stop="pageTo({url:'/admin/shopYeChange/list'})">{{balance}}</view>
  28. <view class="item-name">余额 <text style="color:#3385FF;margin-left:10upx;text-decoration:underline;" @click.stop="pageTo({url:'/admin/home/me',type:4})">提现</text></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. balance:0,
  80. constant: this.$constant,
  81. tabIndex: 0,
  82. tabs: [
  83. {
  84. name: "全部",
  85. key: "0"
  86. },
  87. {
  88. name: "待审核",
  89. key: "1"
  90. },
  91. {
  92. name: "已通过",
  93. key: "2"
  94. }
  95. ],
  96. invitedNum: "", //已邀请
  97. payNum: "", //已付费数量
  98. income: "" //累计收益
  99. };
  100. },
  101. onLoad() {},
  102. onPullDownRefresh() {
  103. this.resetList();
  104. console.log(2222)
  105. this._list().then(res => {
  106. uni.stopPullDownRefresh();
  107. });
  108. },
  109. onReachBottom() {
  110. if (!this.list.finished) {
  111. this._list().then(res => {
  112. uni.stopPullDownRefresh();
  113. });
  114. } else {
  115. uni.stopPullDownRefresh();
  116. }
  117. },
  118. mounted(){
  119. },
  120. methods: {
  121. inviteGhs(){
  122. this.pageTo({url: '/pagesInvite/inviteGhsShop'})
  123. },
  124. inviteHd(){
  125. this.$msg('开发中')
  126. return false
  127. this.pageTo({url: '/pagesInvite/inviteShop'})
  128. //查看分享的路径,不要删除 shish 20210517
  129. // console.log('pagesClient/official/index','ghsShopAdminId='+ this.loginInfo.shopAdminId)
  130. // getWeixinId().then(res => {
  131. // uni.navigateToMiniProgram({
  132. // appId: res.data.hd.miniAppId,
  133. // path: 'pagesClient/official/index?ghsShopAdminId='+this.loginInfo.shopAdminId,
  134. // //develop 开发板 trial 体验版 release 正式版
  135. // envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
  136. // extraData: {
  137. // //'ghsShopAdminId': this.loginInfo.shopAdminId
  138. // },
  139. // success(res) {
  140. // // 打开成功
  141. // }
  142. // })
  143. // });
  144. },
  145. async init() {
  146. this._list();
  147. },
  148. _list() {
  149. return appyleListApi({
  150. status: this.tabs[this.tabIndex].key,
  151. page: this.list.page,
  152. pageSize: this.list.pageSize
  153. }).then(res => {
  154. const {
  155. data: { invitedNum, payNum, income,balance }
  156. } = res;
  157. this.invitedNum = invitedNum;
  158. this.payNum = payNum;
  159. this.income = income;
  160. this.balance = parseFloat(balance)
  161. this.completes(res);
  162. });
  163. },
  164. change(e) {
  165. if (this.tabIndex == e.index) {
  166. return false;
  167. } else {
  168. this.tabIndex = e.index;
  169. this.resetList();
  170. this._list();
  171. }
  172. },
  173. changePageTab(e) {
  174. if (this.pageIndex == e.index) {
  175. return false;
  176. } else {
  177. this.pageIndex = e.index;
  178. this.resetList();
  179. this._list();
  180. }
  181. }
  182. }
  183. };
  184. </script>
  185. <style lang="scss" scoped>
  186. .invite-page {
  187. height: 100%;
  188. display: flex;
  189. flex-direction: column;
  190. .info-view {
  191. margin-top: 20upx;
  192. padding: 40upx 30upx;
  193. background-color: #fff;
  194. .info-main {
  195. display: flex;
  196. align-items: center;
  197. .logo {
  198. flex-shrink: 0;
  199. width: 100upx;
  200. height: 100upx;
  201. border-radius: 50%;
  202. }
  203. .content {
  204. flex: 1;
  205. margin: 0 20upx;
  206. .name {
  207. font-size: 32upx;
  208. font-weight: 400;
  209. color: #040404;
  210. }
  211. .mark {
  212. margin-top: 10upx;
  213. font-size: 24upx;
  214. font-weight: 400;
  215. color: #999999;
  216. }
  217. }
  218. .user-wrap-right {
  219. width: 180upx;
  220. background-color: #fff;
  221. margin-right: 0;
  222. padding: 0;
  223. &::after {
  224. border: none;
  225. }
  226. }
  227. .btn {
  228. flex-shrink: 0;
  229. height: 80upx;
  230. }
  231. }
  232. .info-list {
  233. margin-top: 50upx;
  234. display: flex;
  235. .info-item {
  236. flex: 1;
  237. display: flex;
  238. flex-direction: column;
  239. align-items: center;
  240. .item-name {
  241. margin-top: 15upx;
  242. font-size: 24upx;
  243. font-weight: 400;
  244. color: #999999;
  245. }
  246. .item-value {
  247. font-size: 30upx;
  248. font-family: DIN Alternate;
  249. font-weight: bold;
  250. color: #333333;
  251. }
  252. }
  253. }
  254. }
  255. .list-title {
  256. padding: 30upx 30upx 15upx;
  257. font-size: 24upx;
  258. font-weight: 400;
  259. color: #999999;
  260. }
  261. .invite-list {
  262. flex: 1;
  263. padding-bottom: 50upx;
  264. }
  265. }
  266. </style>