itemuser.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. <template>
  2. <view :style="colorStyle">
  3. <!-- <view style="padding-top: 30rpx;">
  4. <view class="money">
  5. 建议售价:{{greeMoney}}
  6. </view>
  7. </view> -->
  8. <view class="promoter-list">
  9. <view class='list' v-if="recordList.length">
  10. <block v-for="(item,index) in recordList" :key="index">
  11. <view class='item acea-row row-between-wrapper' :class="index == 0 ? 'radius15' : ''">
  12. <view class="picTxt acea-row row-between-wrapper">
  13. <view class='pictrue'>
  14. <image :src='item.avatar'></image>
  15. </view>
  16. <view class='text'>
  17. <view class='name line1'>{{item.nickname}}</view>
  18. <view>手机号: {{item.phone}}</view>
  19. </view>
  20. </view>
  21. <view class="right">
  22. <view><text class="num">{{item.green_integral|| 0}}</text></view>
  23. <view @click="callPhone(item.phone)">
  24. <image class="phoneOpen" src="../../../static/images/phone.png" mode="scaleToFill">
  25. </image>
  26. </view>
  27. </view>
  28. </view>
  29. </block>
  30. </view>
  31. <view v-if="recordList.length == 0">
  32. <emptyPage title="暂无数据~"></emptyPage>
  33. </view>
  34. </view>
  35. <home v-if="navigation"></home>
  36. <!-- #ifdef MP -->
  37. <authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize>
  38. <!-- #endif -->
  39. </view>
  40. </template>
  41. <script>
  42. import {
  43. getGreedUserList
  44. } from '@/api/user.js';
  45. import {
  46. toLogin
  47. } from '@/libs/login.js';
  48. import {
  49. getIndexData
  50. } from '@/api/api.js';
  51. import {
  52. mapGetters
  53. } from "vuex";
  54. import emptyPage from '@/components/emptyPage.vue'
  55. import home from '@/components/home';
  56. import colors from '@/mixins/color.js';
  57. export default {
  58. components: {
  59. home,
  60. emptyPage
  61. },
  62. mixins: [colors],
  63. data() {
  64. return {
  65. page: 1,
  66. limit: 20,
  67. recordList: [],
  68. isAuto: false, //没有授权的不会自动授权
  69. isShowAuth: false, //是否隐藏授权
  70. count: 0,
  71. status: false,
  72. // greeMoney: '',
  73. };
  74. },
  75. computed: mapGetters(['isLogin']),
  76. onLoad() {
  77. // getIndexData().then((res) => {
  78. // this.greeMoney = res.data.green_integral_price
  79. // });
  80. if (this.isLogin) {
  81. this.userSpreadNewList();
  82. } else {
  83. //#ifndef MP
  84. toLogin();
  85. //#endif
  86. //#ifdef MP
  87. this.isShowAuth = true;
  88. //#endif
  89. }
  90. },
  91. onShow: function() {
  92. if (this.is_show) this.userSpreadNewList();
  93. },
  94. onHide: function() {
  95. this.is_show = true;
  96. },
  97. methods: {
  98. callPhone(phone) {
  99. // #ifndef APP
  100. uni.makePhoneCall({
  101. phoneNumber: `${phone}`,
  102. fail(e) {
  103. console.log(e)
  104. }
  105. })
  106. // #endif
  107. // #ifdef APP
  108. if (uni.getSystemInfoSync().platform == 'android') {
  109. uni.showModal({
  110. title: '申请拨打电话权限',
  111. content: '是否允许App拨打电话?',
  112. cancelText: '拒绝',
  113. confirmText: '允许',
  114. success: res => {
  115. if (res.confirm) {
  116. uni.makePhoneCall({
  117. phoneNumber: `${phone}`,
  118. fail(e) {
  119. console.log(e)
  120. }
  121. })
  122. }
  123. },
  124. fail: () => {},
  125. complete: () => {}
  126. });
  127. } else {
  128. uni.makePhoneCall({
  129. phoneNumber: `${phone}`,
  130. fail(e) {
  131. console.log(e)
  132. }
  133. })
  134. }
  135. // #endif
  136. },
  137. onLoadFun(e) {
  138. this.userSpreadNewList();
  139. this.isShowAuth = false;
  140. },
  141. // 授权关闭
  142. authColse: function(e) {
  143. this.isShowAuth = e
  144. },
  145. userSpreadNewList: function() {
  146. let that = this;
  147. if (that.status == true) return;
  148. let page = that.page;
  149. let limit = that.limit;
  150. let recordList = that.recordList;
  151. let recordListNew = [];
  152. getGreedUserList({
  153. page: page,
  154. limit: limit,
  155. }).then(res => {
  156. let len = res.data.list.length;
  157. let recordListData = res.data.list;
  158. recordListNew = recordList.concat(recordListData);
  159. that.status = limit > len;
  160. that.page = page + 1;
  161. that.$set(that, 'recordList', recordListNew);
  162. that.count = res.data.count;
  163. });
  164. }
  165. },
  166. onReachBottom: function() {
  167. this.userSpreadNewList();
  168. }
  169. }
  170. </script>
  171. <style scoped lang="scss">
  172. .money {
  173. padding: 30rpx;
  174. margin: 0 30rpx;
  175. background-color: #FFF;
  176. border-radius: 10rpx;
  177. }
  178. .promoter-list .nav {
  179. background-color: #fff;
  180. height: 86rpx;
  181. line-height: 86rpx;
  182. font-size: 28rpx;
  183. color: #282828;
  184. border-bottom: 1rpx solid #eee;
  185. }
  186. .promoter-list .nav .item.on {
  187. border-bottom: 5rpx solid var(--view-theme);
  188. color: var(--view-theme);
  189. }
  190. .promoter-list .search {
  191. width: 100%;
  192. background-color: var(--view-theme);
  193. border-bottom: 1px solid #f2f2f2;
  194. height: 86rpx;
  195. padding: 0 30rpx;
  196. box-sizing: border-box;
  197. }
  198. .promoter-list .search .input {
  199. width: 100%;
  200. height: 60rpx;
  201. border-radius: 50rpx;
  202. background-color: #f5f5f5;
  203. position: relative;
  204. }
  205. .promoter-list .search .input input {
  206. height: 100%;
  207. font-size: 26rpx;
  208. width: 100%;
  209. padding-left: 30rpx;
  210. }
  211. .promoter-list .search .input .placeholder {
  212. color: #bbb;
  213. }
  214. .promoter-list .search .input .iconfont {
  215. position: absolute;
  216. right: 28rpx;
  217. color: #999;
  218. font-size: 28rpx;
  219. top: 50%;
  220. transform: translateY(-50%);
  221. }
  222. .promoter-list .search .iconfont {
  223. font-size: 45rpx;
  224. color: #515151;
  225. background-color: var(--view-theme);
  226. width: 110rpx;
  227. height: 60rpx;
  228. line-height: 60rpx;
  229. }
  230. .promoter-list .list {
  231. margin-top: 12rpx;
  232. }
  233. .promoter-list .list .sortNav {
  234. background-color: #fff;
  235. height: 76rpx;
  236. border-bottom: 1rpx solid #eee;
  237. color: #333;
  238. font-size: 28rpx;
  239. }
  240. .promoter-list .list .sortNav .sortItem {
  241. text-align: center;
  242. flex: 1;
  243. }
  244. .promoter-list .list .sortNav .sortItem image {
  245. width: 24rpx;
  246. height: 24rpx;
  247. margin-left: 6rpx;
  248. vertical-align: -3rpx;
  249. }
  250. .promoter-list .list .item {
  251. background-color: #fff;
  252. border-bottom: 1rpx solid #eee;
  253. height: 152rpx;
  254. padding: 0 30rpx 0 20rpx;
  255. font-size: 24rpx;
  256. color: #666;
  257. margin: 0 30rpx;
  258. }
  259. .promoter-list .list .item .picTxt {
  260. width: 440rpx;
  261. }
  262. .promoter-list .list .item .picTxt .pictrue {
  263. width: 106rpx;
  264. height: 106rpx;
  265. border-radius: 50%;
  266. }
  267. .promoter-list .list .item .picTxt .pictrue image {
  268. width: 100%;
  269. height: 100%;
  270. border-radius: 50%;
  271. border: 3rpx solid #fff;
  272. box-shadow: 0 0 10rpx #aaa;
  273. box-sizing: border-box;
  274. }
  275. .promoter-list .list .item .picTxt .text {
  276. width: 304rpx;
  277. font-size: 24rpx;
  278. color: #666;
  279. }
  280. .promoter-list .list .item .picTxt .text .name {
  281. font-size: 28rpx;
  282. color: #333;
  283. margin-bottom: 13rpx;
  284. }
  285. .promoter-list .list .item .right {
  286. width: 190rpx;
  287. text-align: right;
  288. font-size: 22rpx;
  289. color: #333;
  290. }
  291. .promoter-list .list .item .right .num {
  292. margin-right: 7rpx;
  293. }
  294. .top_num {
  295. padding: 30rpx;
  296. font-size: 26rpx;
  297. color: #666;
  298. }
  299. .main_color {
  300. color: #E93323;
  301. }
  302. .radius15 {
  303. border-radius: 14rpx 14rpx 0 0;
  304. }
  305. .phoneOpen {
  306. width: 50rpx;
  307. height: 50rpx;
  308. background-color: skyblue;
  309. border-radius: 100%;
  310. margin-top: 10rpx;
  311. }
  312. </style>