app-index.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <view>
  3. <view v-if="region.index" class="app-region-user" :style="{'background-image': `url(${region.index})`}">
  4. <view class="dir-left-nowrap user-info">
  5. <image class="avatar" :src="detail.avatar"></image>
  6. <view>
  7. <view class="name">{{detail.nickname}}</view>
  8. <view class="dir-left-nowrap cross-center">
  9. <view class="level" @click="toUpdate">
  10. <text v-if="detail.level == 1">省代理</text>
  11. <text v-if="detail.level == 2">市代理</text>
  12. <text v-if="detail.level == 3">区/县代理</text>
  13. <image class="right-arrow" src="/static/image/icon/arrow-right-white.png"></image>
  14. <image v-if="detail.is_up == 1 && detail.level_up_log && detail.level_up_log.status != 2" class="is-up" src="../image/up.png"></image>
  15. <image v-if="detail.is_up == 1 && detail.level_up_log && detail.level_up_log.status == 2" class="is-up" src="../image/up-lose.png"></image>
  16. <image v-if="detail.is_up == 0 && detail.level_up_log && detail.level_up_log.status == 1" class="is-up" src="../image/up-success.png"></image>
  17. </view>
  18. <view class="rate main-between cross-center">
  19. <view>{{setting.form.rate ? setting.form.rate : '分红比例'}}{{detail.bonus_rate}}%</view>
  20. <view @click="toAbout" class="about dir-right-nowrap cross-center">
  21. <image src="/static/image/icon/question.png"></image>
  22. <text>说明</text>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="price main-between cross-center">
  29. <view>
  30. <view class="price-detail">{{detail.total_bonus}}</view>
  31. <view>{{setting.form.total_bonus ? setting.form.total_bonus : '可提现分红'}}(元)</view>
  32. </view>
  33. <view @click="toCash" class="cash-btn">提现</view>
  34. </view>
  35. </view>
  36. <view class="app-region-bonus main-between">
  37. <view class="bonus-item">
  38. <view>{{setting.form.cash_bonus ? setting.form.cash_bonus : '已提现分红'}}(元)</view>
  39. <view class="bonus-price">{{detail.cash_bonus}}</view>
  40. </view>
  41. <view class="bonus-item">
  42. <view>{{setting.form.all_bonus ? setting.form.all_bonus : '累计分红'}}(元)</view>
  43. <view class="bonus-price">{{detail.all_bonus}}</view>
  44. </view>
  45. </view>
  46. <view class="app-region-menu main-center cross-center">
  47. <view @click="toBonus" class="menu-item dir-top-nowrap cross-center">
  48. <image class="menu-icon" :src="region.bonus"></image>
  49. <view>{{setting.form.region ? setting.form.region : '代理分红'}}</view>
  50. </view>
  51. <view @click="toDetail" class="menu-item dir-top-nowrap cross-center">
  52. <image class="menu-icon" :src="region.cash"></image>
  53. <view>{{setting.form.cash_detail ? setting.form.cash_detail : '提现明细'}}</view>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import { mapState } from "vuex";
  60. export default {
  61. name: 'app-index',
  62. props: {
  63. detail: {
  64. type: Object
  65. },
  66. setting: {
  67. type: Object
  68. },
  69. },
  70. computed: {
  71. ...mapState({
  72. region: state => state.mallConfig.__wxapp_img.region,
  73. })
  74. },
  75. methods: {
  76. toUpdate() {
  77. if(this.detail.is_up == 1 && this.detail.level_up_log && this.detail.level_up_log.status == 2) {
  78. uni.navigateTo({
  79. url: '/plugins/region/index/index?up=1'
  80. });
  81. }else {
  82. uni.navigateTo({
  83. url: '/plugins/region/update/update'
  84. });
  85. }
  86. },
  87. toCash() {
  88. uni.navigateTo({
  89. url: '/plugins/region/cash/cash'
  90. });
  91. },
  92. toBonus() {
  93. let name = this.setting.form.region ? this.setting.form.region : '';
  94. let cash_detail_name = this.setting.form.cash_detail ? this.setting.form.cash_detail : '';
  95. uni.navigateTo({
  96. url: '/plugins/region/bonus/bonus?name=' + name + '&cash_detail=' + cash_detail_name
  97. });
  98. },
  99. toDetail() {
  100. let name = this.setting.form.cash_detail ? this.setting.form.cash_detail : '';
  101. uni.navigateTo({
  102. url: '/plugins/region/cash-detail/cash-detail?name=' + name
  103. });
  104. },
  105. toOrder() {
  106. let name = this.setting.form.order ? this.setting.form.order : '';
  107. uni.navigateTo({
  108. url: '/plugins/region/order/order?name=' + name
  109. });
  110. },
  111. toAbout() {
  112. uni.navigateTo({
  113. url: '/plugins/region/about/about'
  114. });
  115. },
  116. },
  117. creatd(options) {
  118. let that = this;
  119. }
  120. }
  121. </script>
  122. <style scoped lang="scss">
  123. .app-region-user {
  124. width: 100%;
  125. height: #{460rpx};
  126. padding: #{56rpx};
  127. background-size: 100% 100%;
  128. position: relative;
  129. font-size: #{26rpx};
  130. color: #fff;
  131. .user-info {
  132. margin-bottom: #{40rpx};
  133. position: relative;
  134. width:fit-content;
  135. width:-webkit-fit-content;
  136. width:-moz-fit-content;
  137. width: 100%;
  138. >view {
  139. width: 100%;
  140. }
  141. .name {
  142. font-size: #{32rpx};
  143. margin-bottom: #{10rpx};
  144. }
  145. .level {
  146. font-size: #{24rpx};
  147. border-radius: #{20rpx};
  148. height: #{40rpx};
  149. line-height: #{38rpx};
  150. padding: 0 #{16rpx};
  151. border: #{2rpx} solid #fff;
  152. flex-shrink: 0;
  153. position: relative;
  154. .is-up {
  155. position: absolute;
  156. top: #{-14rpx};
  157. right: #{-14rpx};
  158. width: #{28rpx};
  159. height: #{28rpx};
  160. }
  161. .right-arrow {
  162. height:#{18rpx};
  163. width:#{10rpx};
  164. margin-left:#{8rpx};
  165. margin-right: 0;
  166. display: inline-block;
  167. }
  168. }
  169. .rate {
  170. height: #{60rpx};
  171. line-height: #{60rpx};
  172. font-size: #{26rpx};
  173. color: #fff;
  174. margin-left: 24rpx;
  175. width: 100%;
  176. .about {
  177. image {
  178. width: #{28rpx};
  179. height: #{28rpx};
  180. margin-left: #{12rpx};
  181. }
  182. }
  183. }
  184. .avatar {
  185. width: #{80rpx};
  186. border-radius: #{40rpx};
  187. flex-shrink: 0;
  188. height: #{80rpx};
  189. border: #{2rpx} solid #fff;
  190. margin-right: #{28rpx};
  191. display: block;
  192. }
  193. }
  194. .price {
  195. font-size: #{24rpx};
  196. color: #fff;
  197. margin-top: #{20rpx};
  198. padding-top: #{20rpx};
  199. border-top: #{2rpx} solid #e2e2e2;
  200. .price-detail {
  201. font-size: #{64rpx};
  202. font-family: DIN;
  203. margin-bottom: #{6rpx};
  204. }
  205. .cash-btn {
  206. padding: 0 #{42rpx};
  207. border-radius: #{32rpx};
  208. height: #{64rpx};
  209. line-height: #{64rpx};
  210. font-size: #{28rpx};
  211. color: #3484F3;
  212. text-align: center;
  213. background-color: #fff;
  214. }
  215. }
  216. }
  217. .app-region-bonus {
  218. margin-top: #{-80rpx};
  219. padding: 0 #{24rpx};
  220. height: #{170rpx};
  221. .bonus-item {
  222. background-color: #fff;
  223. position: relative;
  224. z-index: 2;
  225. width: #{330rpx};
  226. height: #{124rpx};
  227. border-radius: #{16rpx};
  228. box-shadow: 0 0 #{10rpx} rgba(0,0,0,.05);
  229. padding: 0 #{32rpx};
  230. padding-top: #{20rpx};
  231. color: #999999;
  232. font-size: #{26rpx};
  233. .bonus-price {
  234. font-size: #{40rpx};
  235. font-family: DIN;
  236. color: #353535;
  237. margin-top: #{4rpx};
  238. }
  239. }
  240. }
  241. .app-region-menu {
  242. margin: #{24rpx};
  243. margin-top: #{-20rpx};
  244. border-radius: #{16rpx};
  245. background-color: #fff;
  246. padding: #{64rpx} #{27rpx} #{50rpx};
  247. box-shadow: 0 0 #{10rpx} rgba(0,0,0,.05);
  248. .menu-item {
  249. width: #{216rpx};
  250. margin: 0 #{47rpx};
  251. font-size: #{28rpx};
  252. color: #353535;
  253. .menu-icon {
  254. width: #{120rpx};
  255. height: #{120rpx};
  256. margin-bottom: #{20rpx};
  257. display: block;
  258. }
  259. }
  260. }
  261. </style>