mine.vue 8.9 KB

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