extension.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <template>
  2. <view class="content">
  3. <view class="content-money">
  4. <view class="money-box">
  5. <view class="goback-box" @click="toBack">
  6. <image class="goback" src="../../static/img/fanhui.png" mode=""></image>
  7. </view>
  8. <view class="header">我的推广</view>
  9. <image class="tuiguang_bg" src="../../static/img/share-bg.png"></image>
  10. <!-- <view class="money_img"><image :src="list.avatar || img"></image></view> -->
  11. <view class="money-frame">
  12. <!-- <view class="money_name">我的推广</view> -->
  13. <view class="money_num">
  14. {{ all || '0' }}
  15. <text class="money_ren">人</text>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
  21. <!-- 空白页 -->
  22. <empty v-if="orderList.length === 0"></empty>
  23. <!-- 订单列表 -->
  24. <view v-for="(item, index) in orderList" :key="index" class="order-item flex">
  25. <view class="title-box flex_item">
  26. <view class="title-avatar"><image :src="item.avatar"></image></view>
  27. <view class="list_tpl">
  28. <view class="title">
  29. <text>{{ item.nickname }}</text>
  30. </view>
  31. <view class="time">
  32. <text>{{ item.time }}</text>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <uni-load-more :status="loadingType"></uni-load-more>
  38. </scroll-view>
  39. </view>
  40. </template>
  41. <script>
  42. import { mapState, mapMutations } from 'vuex';
  43. import uniLoadMore from '@/uview-ui/components/u-loading-page/u-loading-page.vue';
  44. import empty from '@/uview-ui/components/u-empty/u-empty.vue';
  45. export default {
  46. components: {
  47. empty,
  48. uniLoadMore
  49. },
  50. onReady() {
  51. // 初始化获取页面宽度
  52. uni.createSelectorQuery()
  53. .select('.content')
  54. .fields(
  55. {
  56. size: true
  57. },
  58. data => {
  59. // console.log(data);
  60. // console.log(Math.floor((data.width / 750) * 300));
  61. // 保存头部高度
  62. this.maxheight = data.height - Math.floor((data.width / 750) * 470) - 44;
  63. // console.log(this.maxheight);
  64. }
  65. )
  66. .exec();
  67. },
  68. data() {
  69. return {
  70. // 头部图高度
  71. maxheight: '',
  72. orderList: [
  73. {
  74. nickname:'lan',
  75. time:'2021-9-9'
  76. }
  77. ],
  78. all: '',
  79. loadingType:'',
  80. page: 1,
  81. limit: 10,
  82. };
  83. },
  84. onLoad(options) {},
  85. onShow() {
  86. },
  87. methods: {
  88. // 页面跳转
  89. navto(e) {
  90. uni.navigateTo({
  91. url: e
  92. });
  93. },
  94. // 点击返回 我的页面
  95. toBack() {
  96. uni.switchTab({
  97. url: '/pages/user/user'
  98. });
  99. }
  100. }
  101. };
  102. </script>
  103. <style lang="scss">
  104. page {
  105. background: #ffffff;
  106. height: 100%;
  107. }
  108. .content-money {
  109. padding-bottom: 30rpx;
  110. background: $page-color-base;
  111. .buttom-box {
  112. position: relative;
  113. background-color: #ffffff;
  114. text-align: center;
  115. margin: 0 30rpx;
  116. padding: 30rpx 0;
  117. border-radius: $border-radius-sm;
  118. margin-top: -80rpx;
  119. .buttom {
  120. font-size: $font-lg;
  121. flex-grow: 1;
  122. .money {
  123. font-weight: bold;
  124. font-size: 32rpx;
  125. color: #ff0000;
  126. }
  127. }
  128. .text {
  129. color: #666666;
  130. }
  131. .interval {
  132. width: 2rpx;
  133. height: 60rpx;
  134. background-color: #eeeeee;
  135. }
  136. .icon {
  137. height: 50rpx;
  138. width: 48rpx;
  139. margin: 0 auto;
  140. .icon-img {
  141. width: 100%;
  142. height: 100%;
  143. }
  144. }
  145. }
  146. }
  147. .money-box {
  148. // background: $base-color;
  149. height: 424rpx;
  150. color: #ffffff;
  151. text-align: center;
  152. font-size: 35rpx;
  153. position: relative;
  154. // padding-top: 60rpx;
  155. .header {
  156. position: absolute;
  157. left: 0;
  158. top: 0;
  159. width: 100%;
  160. height: 80rpx;
  161. font-size: 32rpx;
  162. font-weight: 700;
  163. z-index: 99;
  164. display: flex;
  165. justify-content: center;
  166. align-items: center;
  167. }
  168. .goback-box {
  169. position: absolute;
  170. left: 18rpx;
  171. top: 0;
  172. height: 80rpx;
  173. display: flex;
  174. align-items: center;
  175. }
  176. .goback {
  177. z-index: 100;
  178. width: 34rpx;
  179. height: 34rpx;
  180. }
  181. .tuiguang_bg {
  182. width: 100%;
  183. height: 424rpx;
  184. position: relative;
  185. }
  186. .money_img {
  187. width: 100%;
  188. height: 120rpx;
  189. text-align: center;
  190. padding-top: 50rpx;
  191. padding-bottom: 135rpx;
  192. image {
  193. width: 120rpx;
  194. height: 120rpx;
  195. border: 4rpx solid #fd5f6f;
  196. border-radius: 50%;
  197. }
  198. }
  199. .money-frame {
  200. position: absolute;
  201. top: 0;
  202. width: 100%;
  203. padding-top: 120rpx;
  204. // left: 30rpx;
  205. // height: 460rpx;
  206. // display: flex;
  207. // align-items: flex-start;
  208. // flex-direction: column;
  209. // justify-content: center;
  210. }
  211. .money_name {
  212. width: 100%;
  213. text-align: center;
  214. font-size: 32rpx;
  215. font-family: PingFang SC;
  216. font-weight: bold;
  217. color: #ffffff;
  218. }
  219. .money_num {
  220. font-size: 72rpx;
  221. font-family: PingFang SC;
  222. font-weight: bold;
  223. color: #ffffff;
  224. .money_ren {
  225. font-size: 36rpx;
  226. }
  227. }
  228. }
  229. .navbar {
  230. display: flex;
  231. height: 40px;
  232. padding: 0 5px;
  233. background: #fff;
  234. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  235. position: relative;
  236. z-index: 10;
  237. .nav-item {
  238. flex: 1;
  239. display: flex;
  240. justify-content: center;
  241. align-items: center;
  242. height: 100%;
  243. font-size: 15px;
  244. color: $font-color-dark;
  245. position: relative;
  246. &.current {
  247. color: #ff0000;
  248. &:after {
  249. content: '';
  250. position: absolute;
  251. left: 50%;
  252. bottom: 0;
  253. transform: translateX(-50%);
  254. width: 44px;
  255. height: 0;
  256. border-bottom: 2px solid #ff0000;
  257. }
  258. }
  259. }
  260. }
  261. // 列表
  262. .order-item {
  263. padding: 20rpx 30rpx;
  264. line-height: 1.5;
  265. .title-box {
  266. width: 100%;
  267. .title-avatar {
  268. width: 100rpx;
  269. height: 100rpx;
  270. margin-right: 25rpx;
  271. background: #03A9F4;
  272. border-radius: 100%;
  273. image {
  274. width: 100%;
  275. height: 100%;
  276. border-radius: 100%;
  277. }
  278. }
  279. .list_tpl {
  280. width: 85%;
  281. .title {
  282. font-size: $font-lg;
  283. color: $font-color-base;
  284. overflow: hidden; //超出的文本隐藏
  285. text-overflow: ellipsis; //溢出用省略号显示
  286. white-space: nowrap;
  287. }
  288. .time {
  289. font-size: $font-base;
  290. color: $font-color-light;
  291. }
  292. }
  293. }
  294. .money {
  295. color: #db1935;
  296. font-size: $font-lg;
  297. }
  298. }
  299. .list-scroll-content {
  300. height: 100%;
  301. }
  302. .content {
  303. height: 100%;
  304. .empty-content {
  305. background-color: #ffffff;
  306. }
  307. }
  308. </style>