You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

372 lines
7.3 KiB

3 years ago
  1. <template>
  2. <view class="app">
  3. <view class="user-item" @click="test">
  4. <text class="user-item-title">头像</text>
  5. <view class="user-img-section">
  6. <image src="/static/base/user.png" class="user-img"></image>
  7. <image src="/static/base/arrow.png" class="arrow-img"></image>
  8. </view>
  9. </view>
  10. <view class="user-item user-item-height">
  11. <text class="user-item-title">微信昵称</text>
  12. <text class="user-item-txt">ZHANGSAN</text>
  13. </view>
  14. <view class="user-item user-item-height">
  15. <text class="user-item-title">微信号</text>
  16. <text class="user-item-txt">张三</text>
  17. </view>
  18. <view class="user-item user-item-height">
  19. <text class="user-item-title">我的二维码</text>
  20. <view class="user-img-section">
  21. <image src="/static/base/qrcode.png" class="qrcode-img"></image>
  22. <image src="/static/base/arrow.png" class="arrow-img"></image>
  23. </view>
  24. </view>
  25. <view class="user-item user-item-height">
  26. <text class="user-item-title">认证信息</text>
  27. <image src="/static/base/arrow.png" class="arrow-img"></image>
  28. </view>
  29. <view class="user-item user-item-height">
  30. <text class="user-item-title">我的等级变更记录</text>
  31. <image src="/static/base/arrow.png" class="arrow-img"></image>
  32. </view>
  33. <view class="user-item user-item-height">
  34. <text class="user-item-title">更多</text>
  35. <image src="/static/base/arrow.png" class="arrow-img"></image>
  36. </view>
  37. <view class="user-item user-item-height">
  38. <text class="user-item-title">更换主题</text>
  39. <image src="/static/base/arrow.png" class="arrow-img"></image>
  40. </view>
  41. <view class="user-item user-item-height">
  42. <text class="user-item-title">设置</text>
  43. <image src="/static/base/arrow.png" class="arrow-img"></image>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import wx from 'weixin-js-sdk'
  49. import {mapState, mapGetters} from 'vuex'
  50. import tabbarMixin from './mixin/tabbar'
  51. export default {
  52. mixins: [tabbarMixin],
  53. data(){
  54. return {
  55. historyList: []
  56. }
  57. },
  58. computed: {
  59. ...mapState(['userInfo', 'orderCount', 'couponCount']),
  60. ...mapGetters(['hasLogin']),
  61. },
  62. onShow(){
  63. this.loadHistory();
  64. this.$store.dispatch('getUserInfo'); //更新订单数量
  65. this.$store.dispatch('getOrderCount'); //更新订单数量
  66. this.$store.dispatch('getCouponCount'); //更新优惠券数量
  67. },
  68. methods: {
  69. test(){
  70. console.log('876')
  71. wx.checkJsApi({
  72. jsApiList: ['chooseImage'], // 需要检测的JS接口列表,所有JS接口列表见附录2,
  73. success: function(res) {
  74. // 以键值对的形式返回,可用的api值true,不可用为false
  75. // 如:{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"}
  76. }
  77. });
  78. },
  79. //加载浏览记录
  80. loadHistory(){
  81. const list = uni.getStorageSync('productHistory');
  82. this.historyList = list || [];
  83. },
  84. //清空浏览记录
  85. clearHistory(){
  86. uni.removeStorage({
  87. key: 'productHistory'
  88. })
  89. this.historyList = [];
  90. }
  91. }
  92. }
  93. </script>
  94. <style>
  95. page{
  96. background-color: white;
  97. }
  98. </style>
  99. <style scoped lang='scss'>
  100. .user-item{
  101. display: flex;
  102. flex-direction: row;
  103. justify-content: space-between;
  104. align-items: center;
  105. border-bottom: 1rpx solid $separatorColor;
  106. margin: 0rpx 30rpx;
  107. box-sizing: content-box;
  108. }
  109. .user-item-height{
  110. height: 100rpx;
  111. line-height: 100rpx;
  112. }
  113. .user-item-title{
  114. font-size: 15px;
  115. /* font-weight: 500; */
  116. color: #333333;
  117. }
  118. .user-img-section{
  119. display: flex;
  120. flex-direction: row;
  121. justify-content: flex-start;
  122. align-items: center;
  123. }
  124. .user-img{
  125. margin: 30rpx 10rpx 30rpx;
  126. width: 120rpx;
  127. height: 120rpx;
  128. }
  129. .qrcode-img{
  130. width: 60rpx;
  131. height: 60rpx;
  132. }
  133. .arrow-img{
  134. width: 32rpx;
  135. height: 32rpx;
  136. }
  137. .user-item-txt{
  138. font-size: 15px;
  139. /* font-weight: 500; */
  140. color: #333333;
  141. }
  142. .app{
  143. padding-bottom: 20rpx;
  144. }
  145. .top{
  146. position: relative;
  147. overflow: hidden;
  148. padding-top: calc(var(--status-bar-height) + 52rpx);
  149. padding-bottom: 6rpx;
  150. .u-bg{
  151. position: absolute;
  152. left: 0;
  153. top: 0;
  154. width: 100%;
  155. height: 330rpx;
  156. }
  157. .user-wrapper{
  158. display:flex;
  159. flex-direction: column;
  160. flex-direction: row;
  161. align-items: center;
  162. position: relative;
  163. z-index: 5;
  164. padding: 20rpx 30rpx 60rpx;
  165. }
  166. .login-box{
  167. font-size: 36rpx;
  168. color: #fff;
  169. }
  170. .avatar{
  171. flex-shrink: 0;
  172. width: 130rpx;
  173. height: 130rpx;
  174. border-radius: 100px;
  175. margin-right: 24rpx;
  176. border: 4rpx solid #fff;
  177. background-color: #fff;
  178. }
  179. .username{
  180. font-size: 34rpx;
  181. color: #fff;
  182. }
  183. .user-group{
  184. align-self: flex-start;
  185. padding: 10rpx 16rpx;
  186. margin-top: 16rpx;
  187. font-size: 20rpx;
  188. color: #fff;
  189. background-color: rgba(255,255,255,.3);
  190. border-radius: 100rpx;
  191. }
  192. .arc-line{
  193. position: absolute;
  194. left: 0;
  195. bottom: 0;
  196. z-index: 9;
  197. width: 100%;
  198. height: 32rpx;
  199. }
  200. }
  201. .money-wrap{
  202. display:flex;
  203. justify-content: space-around;
  204. width: 700rpx;
  205. margin: 6rpx auto 0;
  206. padding: 14rpx 0;
  207. background: #fff;
  208. border-radius: 10rpx;
  209. .item{
  210. flex-direction: column;
  211. width: 130rpx;
  212. height: 120rpx;
  213. border-radius: 8rpx;
  214. font-size: 24rpx;
  215. color: #606266;
  216. }
  217. .num{
  218. margin-bottom: 20rpx;
  219. font-size: 32rpx;
  220. color: #333;
  221. font-weight: 700;
  222. }
  223. }
  224. .order-wrap{
  225. width: 700rpx;
  226. margin: 20rpx auto 0;
  227. background: #fff;
  228. border-radius: 10rpx;
  229. .o-header{
  230. padding: 28rpx 20rpx 6rpx 26rpx;
  231. .tit{
  232. flex: 1;
  233. font-size: 32rpx;
  234. color: #333;
  235. font-weight: 700;
  236. }
  237. .more{
  238. font-size: 24rpx;
  239. color: #999;
  240. }
  241. .icon-you{
  242. margin-left: 4rpx;
  243. font-size: 20rpx;
  244. color: #999;
  245. }
  246. }
  247. .o-list{
  248. display:flex;
  249. justify-content: space-around;
  250. padding: 20rpx 0;
  251. }
  252. .item{
  253. flex-direction: column;
  254. width: 130rpx;
  255. height: 130rpx;
  256. border-radius: 8rpx;
  257. font-size: 24rpx;
  258. color: #606266;
  259. position: relative;
  260. .mix-icon{
  261. font-size: 50rpx;
  262. margin-bottom: 20rpx;
  263. color: #fa436a;
  264. }
  265. .icon-shouhoutuikuan{
  266. font-size: 44rpx;
  267. }
  268. }
  269. .number{
  270. position: absolute;
  271. right: 22rpx;
  272. top: 6rpx;
  273. min-width: 34rpx;
  274. height: 34rpx;
  275. line-height: 30rpx;
  276. text-align: center;
  277. padding: 0 8rpx;
  278. font-size: 18rpx;
  279. color: #fff;
  280. border: 2rpx solid #fff;
  281. background-color: $base-color;
  282. border-radius: 100rpx;
  283. }
  284. }
  285. .option-wrap{
  286. width: 700rpx;
  287. margin: 20rpx auto 0;
  288. margin-top: 20rpx;
  289. background: #fff;
  290. border-radius:10rpx;
  291. .sec-header{
  292. padding: 26rpx 14rpx 0 24rpx;
  293. font-size: 28rpx;
  294. color: #333;
  295. .icon-lishijilu{
  296. font-size: 46rpx;
  297. color: #50bf8b;
  298. margin-right: 16rpx;
  299. line-height: 40rpx;
  300. }
  301. .icon-lajitong{
  302. padding: 4rpx 10rpx;
  303. font-size: 36rpx;
  304. color: #999;
  305. }
  306. }
  307. .pro-list{
  308. flex-wrap: nowrap;
  309. padding: 20rpx 0 12rpx;
  310. &:before, &:after{
  311. content: '';
  312. min-width: 30rpx;
  313. height: 30rpx;
  314. }
  315. &:after{
  316. min-width: 20rpx;
  317. }
  318. image{
  319. flex-shrink: 0;
  320. width: 144rpx;
  321. height: 144rpx;
  322. margin-right: 16rpx;
  323. border-radius: 8rpx;
  324. }
  325. }
  326. }
  327. </style>