index.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. <template>
  2. <view>
  3. <view class="user-top">
  4. <!-- <u-navbar title="我的" :is-back="false" :border-bottom="false" title-color="#ffffff"></u-navbar> -->
  5. <view class="user-top-bg"></view>
  6. <view class="e-ul">
  7. <view class="e-li clearfix">
  8. <view class="float_left"><image :src="enterprise.logo" mode="aspectFill"></image></view>
  9. <view class="float_left en-info">
  10. <view class="en-name clearfix">
  11. <view class="float_left" style="margin-right: 14rpx;">{{ userInfo.name || '--' }}</view>
  12. <view class="float_left" style="line-height: 36rpx;"><u-icon name="arrow-right" color="#879BBA" size="20"></u-icon></view>
  13. </view>
  14. <view class="shop">
  15. <text class="title float_left">{{ supplier_data.roleName || '' }}</text>
  16. <view class="en-time float_left">
  17. <view class="en_tig1" v-if="enterprise.expireStatus">已打烊</view>
  18. <view class="en_tig" v-else>营业中</view>
  19. </view>
  20. </view>
  21. </view>
  22. <!-- <view class="en-time">
  23. <text class="en_tig" v-if="enterprise.expireStatus">已打烊</text>
  24. <text class="en_tig" v-else>营业中</text>
  25. </view> -->
  26. <view class="enterprise">
  27. <view class="enterprise_btn" @click="goPage('/pages/enterprise/index','reLaunch')">
  28. <u-icon name="content_ico_city" custom-prefix="custom-icon" size="28"></u-icon>
  29. <text style="margin-left: 16rpx;">切换企业</text>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="profit" v-if="userInfo.staffId">
  36. <view class="tabs-view">
  37. <u-tabs
  38. :list="list"
  39. font-size="24"
  40. inactive-color="#5C79B0"
  41. :is-scroll="false"
  42. :current="current"
  43. @change="tabChange"
  44. ></u-tabs>
  45. </view>
  46. <view class="profit-ul">
  47. <view class="profit-item">
  48. <view class="money"><text class="rmb-icon">¥</text>{{ $utils.formatNub(total_profit) }}</view>
  49. <view class="profit-item-list">总提成</view>
  50. </view>
  51. <view class="profit-item" style="border-left: 2rpx solid #ECF0F7;">
  52. <view class="money"><text class="rmb-icon">¥</text>{{ $utils.formatNub(proportion_profit) }}</view>
  53. <view class="profit-item-list">比例提成</view>
  54. </view>
  55. <view class="profit-item" style="border-left: 2rpx solid #ECF0F7;">
  56. <view class="money"><text class="rmb-icon">¥</text>{{ $utils.formatNub(goods_profit) }}</view>
  57. <view class="profit-item-list">商品提成</view>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="menu_ul">
  62. <view class="model-tit">商家工具</view>
  63. <view class="menu_li">
  64. <view class="menu_li_cont" @click="goPage('/pages/index/WxCode')">
  65. <image src="../../static/img/ic-rjtg.png" mode=""></image>
  66. <view class="menu_li_text">软件推广</view>
  67. </view>
  68. <view class="menu_li_cont" @click="goPage('/pagesT/user/editPwd')">
  69. <image src="../../static/img/ic-xgmm.png" mode=""></image>
  70. <view class="menu_li_text">修改密码</view>
  71. </view>
  72. <view class="menu_li_cont" @click="goPage('/pagesT/user/editID')">
  73. <image src="../../static/img/ic-xgzh.png" mode=""></image>
  74. <view class="menu_li_text">修改账号</view>
  75. </view>
  76. <view class="menu_li_cont" @click="logout">
  77. <image src="../../static/img/ic-tcdl.png" mode=""></image>
  78. <view class="menu_li_text">退出登录</view>
  79. </view>
  80. </view>
  81. </view>
  82. <!-- 底部tabbar -->
  83. <Tabbar v-model="tabbar_current"></Tabbar>
  84. </view>
  85. </template>
  86. <script>
  87. import { mapActions } from 'vuex';
  88. export default {
  89. data() {
  90. return {
  91. tabbar_current: 4,
  92. userCenterId: '',
  93. goods_profit: '', //商品收益
  94. proportion_profit: '', //比例收益
  95. total_profit: '', //总收益
  96. current: 0,
  97. list: [
  98. {
  99. name: '总提成'
  100. },
  101. {
  102. name: '月提成'
  103. },
  104. {
  105. name: '日提成'
  106. }
  107. ],
  108. supplier_data: {}
  109. };
  110. },
  111. computed: {
  112. userInfo() {
  113. return this.$store.state.userInfo;
  114. },
  115. enterprise() {
  116. return this.$store.state.enterprise;
  117. }
  118. },
  119. onLoad() {
  120. this.tabChange(0);
  121. // this.onShareAppMessage();
  122. },
  123. onShareAppMessage(res) {
  124. return {
  125. title: '六牛云商',
  126. path: '/pages/index/index'
  127. };
  128. },
  129. methods: {
  130. ...mapActions({
  131. logout: 'logout'
  132. }),
  133. tabChange(index) {
  134. console.log(index,'切换');
  135. if(!this.userInfo.staffId){
  136. return
  137. }
  138. this.current = index;
  139. this.$u.api.getStaffInfo(this.userInfo.staffId).then(res => {
  140. if (this.current === 1) {
  141. this.proportion_profit = res.data.rewardData.rewardMonth.order;
  142. this.goods_profit = res.data.rewardData.rewardMonth.goods;
  143. this.total_profit = res.data.rewardData.rewardMonth.total;
  144. } else if (this.current === 2) {
  145. this.proportion_profit = res.data.rewardData.rewardDay.order;
  146. this.goods_profit = res.data.rewardData.rewardDay.goods;
  147. this.total_profit = res.data.rewardData.rewardDay.total;
  148. } else {
  149. this.proportion_profit = res.data.rewardData.rewardTotal.order;
  150. this.goods_profit = res.data.rewardData.rewardTotal.goods;
  151. this.total_profit = res.data.rewardData.rewardTotal.total;
  152. }
  153. this.supplier_data = res.data;
  154. });
  155. },
  156. ...mapActions({
  157. logout: 'logout'
  158. }),
  159. changeEn() {
  160. this.goPage('/pages/enterprise/index');
  161. }
  162. }
  163. };
  164. </script>
  165. <style scoped lang="scss">
  166. .profit {
  167. width: 690rpx;
  168. margin: 0 auto;
  169. border-radius: 8rpx;
  170. box-shadow: 0rpx 40rpx 40rpx -20rpx rgba(45, 64, 94, 0.06);
  171. overflow: hidden;
  172. .tabs-view {
  173. border-bottom: 1rpx solid #f1f1f1;
  174. }
  175. .profit-ul {
  176. padding: 30rpx 0;
  177. display: flex;
  178. background-color: #ffffff;
  179. border-radius: 10rpx;
  180. .profit-item {
  181. flex: 3;
  182. text-align: center;
  183. font-weight: bold;
  184. .money {
  185. font-size: 32rpx;
  186. color: $uni-color-primary;
  187. font-weight: bold;
  188. font-family: DIN-Medium;
  189. .rmb-icon{
  190. font-size: 24rpx;
  191. }
  192. }
  193. .profit-item-list {
  194. font-weight: 400;
  195. margin-top: 10rpx;
  196. font-size: 22rpx;
  197. color: #62738e;
  198. }
  199. }
  200. }
  201. }
  202. .btn-view {
  203. width: 600rpx;
  204. margin: 0 auto;
  205. }
  206. .user-top {
  207. background-size: 100% 100%;
  208. padding-bottom: 64rpx;
  209. .user-top-bg {
  210. position: absolute;
  211. top: 0;
  212. right: 0;
  213. width: 585rpx;
  214. height: 208rpx;
  215. background: linear-gradient(315deg, #00fa69 0%, #ffed81 100%);
  216. opacity: 0.2;
  217. filter: blur(50rpx);
  218. }
  219. .e-ul {
  220. padding-top: 120rpx;
  221. .e-li {
  222. width: 700rpx;
  223. margin: 50rpx auto 0;
  224. color: #fff;
  225. border-radius: 10rpx;
  226. padding: 0 20rpx;
  227. position: relative;
  228. image {
  229. width: 98rpx;
  230. height: 98rpx;
  231. border-radius: 100%;
  232. margin-right: 16rpx;
  233. background-color: #ffffff;
  234. border: 2rpx solid #FFFFFF;
  235. }
  236. .en-time {
  237. margin-top: 6rpx;
  238. margin-left: 16rpx;
  239. .en_tig {
  240. width: 124rpx;
  241. height: 32rpx;
  242. background-color: rgb(203, 238, 226);
  243. color: #00c395;
  244. font-size: 20rpx;
  245. line-height: 32rpx;
  246. text-align: center;
  247. }
  248. .en_tig1 {
  249. width: 124rpx;
  250. height: 32rpx;
  251. background-color: rgb(255, 232, 233);
  252. color: rgb(255, 109, 116);
  253. font-size: 20rpx;
  254. line-height: 32rpx;
  255. text-align: center;
  256. }
  257. }
  258. .enterprise {
  259. position: absolute;
  260. right: 0;
  261. top: 50%;
  262. transform: translateY(-50%);
  263. .enterprise_btn {
  264. width: 208rpx;
  265. height: 64rpx;
  266. font-size: 28rpx;
  267. color: #fff;
  268. background-color: #2d405e;
  269. line-height: 64rpx;
  270. text-align: center;
  271. border-radius: 64rpx;
  272. }
  273. }
  274. .en-info {
  275. .en-name {
  276. padding-top: 10rpx;
  277. font-weight: 700;
  278. font-size: 30rpx;
  279. color: #2d405e;
  280. }
  281. .shop {
  282. margin-top: 10rpx;
  283. font-size: 26rpx;
  284. .title {
  285. color: #b8c0c8;
  286. opacity: 0.8;
  287. }
  288. }
  289. }
  290. }
  291. }
  292. .user_info {
  293. display: flex;
  294. color: #fff;
  295. padding: 30rpx;
  296. align-items: center;
  297. font-size: 32rpx;
  298. .user_set {
  299. flex: 1;
  300. text-align: center;
  301. .tip {
  302. margin-top: 10rpx;
  303. font-size: 24rpx;
  304. }
  305. }
  306. .user_line {
  307. flex: 1;
  308. height: 60rpx;
  309. line-height: 60rpx;
  310. text-align: center;
  311. }
  312. }
  313. }
  314. .menu_ul {
  315. background-color: #fff;
  316. margin-bottom: 30rpx;
  317. font-size: 26rpx;
  318. width: 690rpx;
  319. margin: 40rpx auto 0;
  320. border-radius: 8rpx;
  321. box-shadow: 0rpx 40rpx 40rpx -20rpx rgba(45, 64, 94, 0.06);
  322. .model-tit {
  323. padding: 0 32upx;
  324. line-height: 88upx;
  325. font-weight: bold;
  326. font-size: 28rpx;
  327. color: #2d405e;
  328. }
  329. .menu_li {
  330. width: 100%;
  331. display: flex;
  332. padding-bottom: 40rpx;
  333. .menu_li_cont {
  334. margin-top: 16rpx;
  335. flex: 1;
  336. text-align: center;
  337. image {
  338. margin: 0 auto;
  339. width: 72rpx;
  340. height: 72rpx;
  341. }
  342. .menu_li_text {
  343. font-size: 26rpx;
  344. color: #2d405e;
  345. margin-top: 16rpx;
  346. }
  347. }
  348. }
  349. .menu_li_btm {
  350. width: 100%;
  351. height: 112rpx;
  352. line-height: 112rpx;
  353. text-align: center;
  354. image {
  355. width: 290rpx;
  356. height: 24rpx;
  357. }
  358. }
  359. }
  360. </style>