mine.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. <template>
  2. <view class="container mine clearfix">
  3. <!-- <cu-custom :navbar-data='nvabarData' @navigateBack="hanldNavigateBack"></cu-custom> -->
  4. <view class="tui-header-box" :style="{height:CustomBar+'px',background:'rgba(255,255,255,'+opcity+')'}">
  5. <view class="tui-header" :style="{paddingTop:top+'px', opacity:opcity,lineHeight: CustomBar+'px'}"></view>
  6. <view class="header-sit" @tap="navigator('/pages/user/setting/setting')">
  7. <text class="iconfont icon-shezhi"></text>
  8. </view>
  9. </view>
  10. <view class="user-section">
  11. <view class="header-content">
  12. <view class="header-mine">
  13. <view class="header-mine-right">
  14. <view class="mine-name">官方直营店</view>
  15. <view class="mine-num">
  16. <text class="iconfont icon-VIP"></text>
  17. <text class="text">店铺账号:{{userName}}</text>
  18. </view>
  19. </view>
  20. <view class="header-mine-left">
  21. <view class="logo-m">
  22. <text class="iconfont icon-wode2" v-if="headAddress == ''"></text>
  23. <image v-else :src="headAddress" mode="widthFix"></image>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="header-tabs">
  28. <view class="title">账户</view>
  29. <view class="main">
  30. <view class="main-item" @click="navigator('/pages/user/account/account')">
  31. <text class="iconfont icon-daifukuan"></text>
  32. <text class="text">资金管理</text>
  33. </view>
  34. <!-- <view class="main-item" @click="navigator('/pages/user/account/balance-details')">
  35. <text class="iconfont icon-icon"></text>
  36. <text class="text">账户流水</text>
  37. </view>
  38. --> <view class="main-item" @click="navigator('/pages/user/account/account-bank')">
  39. <text class="iconfont icon-yinhangqia1"></text>
  40. <text class="text">提现账号</text>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="header-tabs">
  45. <view class="title">店铺</view>
  46. <view class="main">
  47. <view class="main-item">
  48. <text class="iconfont icon-shezhi1"></text>
  49. <text class="text">店铺设置</text>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. import wxLogin from '@/services/wxLogin.js'
  59. import { mapState,mapMutations } from 'vuex'
  60. export default{
  61. data() {
  62. return{
  63. nvabarData: { //顶部自定义导航
  64. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  65. showSearch: 0,
  66. title: '', // 导航栏 中间的标题
  67. haveBack:false,
  68. home:false,
  69. textLeft:this.$store.state.isIphone,
  70. bgColor:'#D33020',
  71. textColor:'#ffffff'
  72. },
  73. icon:'',
  74. userName:'',
  75. CustomBar:this.CustomBar,// 顶部导航栏高度
  76. nickname:'轻描淡写',
  77. headAddress:'',
  78. userMoney:0.00,
  79. contactNumber:'',
  80. height: 64, //header高度
  81. top: 0, //标题图标距离顶部距离
  82. scrollH: 0, //滚动总高度
  83. opcity: 0,
  84. userIdentity:'', //机构等级
  85. toBePaid:0, //待付款
  86. toBeDelivered:0, //待发货
  87. toBeReceived:0, //待收货
  88. toBeEvaluated:0, //已发货角标
  89. refund:0,//账户余额
  90. invalidOrder:0,//退货/款角标
  91. balance:0,//优惠券数量
  92. couponCount:0,//优惠券数量
  93. collectionCount:'',//收藏
  94. }
  95. },
  96. onLoad(){
  97. let obj = {}
  98. // #ifdef MP-WEIXIN
  99. obj = wx.getMenuButtonBoundingClientRect()
  100. // #endif
  101. // #ifdef MP-BAIDU
  102. obj = swan.getMenuButtonBoundingClientRect()
  103. // #endif
  104. // #ifdef MP-ALIPAY
  105. my.hideAddToDesktopMenu()
  106. // #endif
  107. uni.getSystemInfo({
  108. success: (res) => {
  109. this.width = obj.left || res.windowWidth
  110. this.height = obj.top ? (obj.top + obj.height + 8) : (res.statusBarHeight + 44)
  111. this.top = obj.top ? (obj.top + (obj.height - 32) / 2) : (res.statusBarHeight + 6)
  112. this.scrollH = res.windowWidth * 0.6
  113. }
  114. })
  115. },
  116. filters: {
  117. NumFormat(value) {
  118. if(!value) return '0.00'
  119. /*原来用的是Number(value).toFixed(0),这样取整时有问题,例如0.51取整之后为1,感谢Nils指正*/
  120. /*后来改成了 Number(value)|0,但是输入超过十一位就为负数了,具体见评论 */
  121. var intPart = Number(value) - Number(value)%1 //获取整数部分(这里是windy93的方法)
  122. var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') //将整数部分逢三一断
  123. var floatPart = '.00' //预定义小数部分
  124. var value2Array = value.toString().split('.')
  125. //=2表示数据有小数位
  126. if(value2Array.length == 2) {
  127. floatPart = value2Array[1].toString() //拿到小数部分
  128. if(floatPart.length == 1) { //补0,实际上用不着
  129. return intPartFormat + '.' + floatPart + '0'
  130. } else {
  131. return intPartFormat + '.' + floatPart
  132. }
  133. } else {
  134. return intPartFormat + floatPart
  135. }
  136. }
  137. },
  138. computed: {
  139. ...mapState(['hasLogin','userInfo'])
  140. },
  141. methods:{
  142. navigator(url){//跳转
  143. this.$api.navigateTo(url)
  144. },
  145. getUserInfo(){
  146. this.$api.getComStorage('userInfo').then((resolve) =>{
  147. console.log(resolve)
  148. this.headAddress = resolve.icon
  149. this.userName = resolve.phone
  150. })
  151. }
  152. },
  153. onPullDownRefresh() {//下拉刷新
  154. uni.stopPullDownRefresh()
  155. },
  156. onPageScroll(e) {
  157. let scroll = e.scrollTop <= 0 ? 0 : e.scrollTop
  158. let opcity = scroll / this.scrollH
  159. if (this.opcity >= 1 && opcity >= 1) {
  160. return
  161. }
  162. this.opcity = opcity
  163. this.iconOpcity = 0.5 * (1 - opcity < 0 ? 0 : 1 - opcity)
  164. },
  165. onShow(){
  166. if(this.hasLogin){
  167. this.getUserInfo()
  168. }
  169. }
  170. }
  171. </script>
  172. <style lang="scss">
  173. @import "@/uni.scss";
  174. page{
  175. background:#FFF;
  176. }
  177. .tui-header-box {
  178. width: 100%;
  179. }
  180. .tui-header {
  181. width: 100%;
  182. font-size: 16px;
  183. font-weight: 500;
  184. height: 32px;
  185. display: flex;
  186. align-items: center;
  187. justify-content: center;
  188. position: relative;
  189. padding: 0 40rpx;
  190. }
  191. .header-sit{
  192. width: 200rpx;
  193. height: 80rpx;
  194. line-height: 80rpx;
  195. box-sizing: border-box;
  196. padding-left: 40rpx;
  197. text-align: left;
  198. .icon-shezhi{
  199. font-size: 54rpx;
  200. color: #666666;
  201. }
  202. }
  203. .mine{
  204. width: 100%;
  205. height: 100%;
  206. position:relative;
  207. }
  208. .header-content{
  209. width: 100%;
  210. height: 480rpx;
  211. position: relative;
  212. .header-mine{
  213. width:100%;
  214. padding:40rpx;
  215. height: 200rpx;
  216. position: relative;
  217. .header-mine-left{
  218. width: 120rpx;
  219. height: 120rpx;
  220. float: right;
  221. .logo-m{
  222. width: 120rpx;
  223. height: 120rpx;
  224. background: linear-gradient(to right, rgba(133,160,250,.6), rgba(101,109,250,1));
  225. border: 2rpx solid #FFFFFF;
  226. border-radius: 100%;
  227. line-height: 120rpx;
  228. text-align: center;
  229. image{
  230. width: 120rpx;
  231. height: 120rpx;
  232. border-radius: 100%;
  233. display: block;
  234. }
  235. .icon-wode2{
  236. font-size: 66rpx;
  237. color: #FFFFFF;
  238. }
  239. }
  240. }
  241. .header-mine-right{
  242. float: left;
  243. .mine-name{
  244. font-size: $font-size-40;
  245. line-height: 60rpx;
  246. color: #333333;
  247. font-weight: 600;
  248. font-family: '正楷';
  249. }
  250. .mine-num{
  251. .text{
  252. display: block;
  253. float: left;
  254. line-height: 60rpx;
  255. font-size: $font-size-28;
  256. color: #333333;
  257. }
  258. .icon-VIP{
  259. display: block;
  260. float: left;
  261. width: 60rpx;
  262. height: 60rpx;
  263. line-height: 60rpx;
  264. text-align: center;
  265. font-size: 60rpx;
  266. color: #4688fa;
  267. }
  268. }
  269. }
  270. }
  271. .header-tabs{
  272. width: 100%;
  273. height: auto;
  274. padding:40rpx;
  275. .title{
  276. font-size: $font-size-36;
  277. line-height: 60rpx;
  278. color: #333333;
  279. font-weight: bold;
  280. }
  281. .main{
  282. width: 100%;
  283. margin-top: 40rpx;
  284. height: 140rpx;
  285. .main-item{
  286. float: left;
  287. width: 180rpx;
  288. text-align: center;
  289. .iconfont{
  290. width: 100%;
  291. height: 80rpx;
  292. line-height:80rpx;
  293. display: block;
  294. float: left;
  295. font-size:60rpx;
  296. color: #4688fa ;
  297. }
  298. .text{
  299. width: 100%;
  300. height:60rpx;
  301. line-height: 60rpx;
  302. display: block;
  303. float: left;
  304. font-size:$font-size-30;
  305. color: #000000;
  306. text-align: center;
  307. }
  308. }
  309. }
  310. }
  311. .tui-header-btm {
  312. width: 100%;
  313. padding: 0 30rpx;
  314. box-sizing: border-box;
  315. display: flex;
  316. align-items: center;
  317. justify-content: space-between;
  318. color: #fff;
  319. }
  320. .tui-btm-item {
  321. flex: 1;
  322. display: flex;
  323. flex-direction: column;
  324. align-items: center;
  325. justify-content: center;
  326. }
  327. .tui-btm-num {
  328. font-size: 32rpx;
  329. font-weight: 600;
  330. position: relative;
  331. }
  332. .tui-btm-text {
  333. font-size: 24rpx;
  334. opacity: 0.85;
  335. padding-top: 4rpx;
  336. }
  337. }
  338. .uni-badge--small {
  339. -webkit-transform: scale(.8);
  340. -ms-transform: scale(.8);
  341. transform: scale(.8);
  342. -webkit-transform-origin: center center;
  343. -ms-transform-origin: center center;
  344. transform-origin: center center;
  345. }
  346. .uni-badge {
  347. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  348. -webkit-box-sizing: border-box;
  349. box-sizing: border-box;
  350. font-size: 12px;
  351. line-height: 1;
  352. display: inline-block;
  353. padding: 3px 6px;
  354. color: #333;
  355. border-radius: 100px;
  356. background-color: #f1f1f1;
  357. }
  358. .uni-badge-error {
  359. color: #fff;
  360. background-color: #dd524d;
  361. }
  362. </style>