IndexHeader.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template>
  2. <view class="div main-content">
  3. <view class="div head-wrap color-base-bg">
  4. <view class="div img-content" style="height: 134px;">
  5. <image mode="aspectFit" class="img" :src="pointbg" />
  6. <view class="div">
  7. <view class="div">
  8. <view class="div"></view>
  9. </view>
  10. <view class="div">
  11. <view class="div"></view>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="div wrap" v-if="isOnline">
  16. <view class="div member-wrap">
  17. <view class="div headimg">
  18. <view class="div img-content">
  19. <image mode="aspectFit" class="img" :src="user.member_avatar" />
  20. </view>
  21. </view>
  22. <view class="div text-content point">
  23. <text class="span">{{user.member_points}}</text>
  24. </view>
  25. <view class="div text-content point-name">
  26. <text class="span">积分</text>
  27. </view>
  28. <view class="div rule" @click="showPopup('shareVisible')">
  29. <text class="span text-content iconfont iconwenhao">
  30. <text class="span">&#xe674;</text>
  31. </text>
  32. <text class="span text-content font-size-tag">
  33. <text class="span">兑换规则</text>
  34. </text>
  35. </view>
  36. </view>
  37. <view class="div action-wrap">
  38. <view class="div view-content" @click="goScoreList">
  39. 积分明细
  40. <text class="span text-content iconfont iconright">
  41. <text class="span">&#xe650;</text>
  42. </text>
  43. </view>
  44. <view class="div view-content split"></view>
  45. <view class="div view-content" @click="goOrder">
  46. 兑换记录
  47. <text class="span text-content iconfont iconright">
  48. <text class="span">&#xe650;</text>
  49. </text>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="div wrap no-login" v-else>
  54. <view class="div">
  55. <view class="div lineheight-clear">
  56. <view class="div text-content font-size-toolbar login-btn" @click="showLogin">
  57. <text class="span">立即登录</text>
  58. </view>
  59. </view>
  60. <view class="div lineheight-clear">
  61. <view class="div text-content font-size-tag">
  62. <text class="span">登录后查看我的积分</text>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. <uni-popup background-color="#fff" ref="shareVisible" type="bottom">
  69. <view class="div tips-layer">
  70. <view class="div head">
  71. <view class="div title">
  72. 积分说明
  73. </view>
  74. <view class="div iconfont iconclose" @click="hidePopup('shareVisible')">
  75. <text class="span">&#xe65a;</text>
  76. </view>
  77. </view>
  78. <view class="div body">
  79. <view class="div detail">
  80. <view class="div tip">
  81. 积分的获取
  82. </view>
  83. <view class="div font-size-base">
  84. 1、积分可在注册、签到、消费时获得。
  85. </view>
  86. <view class="div font-size-base">
  87. 2、在购买商品时可获得积分。
  88. </view>
  89. <view class="div tip">
  90. 积分的使用
  91. </view>
  92. <view class="div font-size-base">
  93. 1、积分可用于兑换积分中心的商品。
  94. </view>
  95. <view class="div font-size-base">
  96. 2、积分可在参与某些活动时使用。
  97. </view>
  98. <view class="div font-size-base">
  99. 3、积分不得转让,出售,不设有效期。
  100. </view>
  101. <view class="div tip">
  102. 积分的查询
  103. </view>
  104. <view class="div font-size-base">
  105. 1、积分可在会员中心中查询具体数额以及明细。
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. </uni-popup>
  111. </view>
  112. </template>
  113. <script>
  114. import { urlencode } from '@/util/common'
  115. import { mapState } from 'vuex'
  116. import { getMemberIndex } from '../../../api/member'
  117. import { env } from '../../../static/config'
  118. export default {
  119. name: 'index',
  120. data () {
  121. return {
  122. user: {},
  123. pointbg: env.SITE_URL+'/uploads/home/h5/home/point_bg.png'
  124. }
  125. },
  126. components: {
  127. },
  128. created: function () {
  129. if (this.isOnline) {
  130. getMemberIndex().then(
  131. response => {
  132. if (response && response.result.member_info) {
  133. this.user = response.result.member_info
  134. }
  135. },
  136. error => {}
  137. )
  138. }
  139. },
  140. computed: {
  141. ...mapState({
  142. isOnline: state => state.member.isOnline
  143. })
  144. },
  145. methods:{
  146. showPopup(id){
  147. this.$refs[id].open()
  148. },
  149. hidePopup(id){
  150. this.$refs[id].close()
  151. },
  152. showLogin () {
  153. uni.navigateTo({url:'/pages/home/memberlogin/Login'})
  154. },
  155. goScoreList () {
  156. if (this.isOnline) {
  157. uni.navigateTo({ url: '/pages/member/point/PointList'+'?'+urlencode( { index: 0 } )})
  158. } else {
  159. this.showLogin()
  160. }
  161. },
  162. goOrder(){
  163. if (this.isOnline) {
  164. uni.navigateTo({ url: '/pages/member/pointsorder/OrderList'+'?'+urlencode( { index: 0 } )})
  165. } else {
  166. this.showLogin()
  167. }
  168. }
  169. }
  170. }
  171. </script>
  172. <style scoped lang="scss">
  173. .font-size-activity-tag {font-size:$h6!important;}
  174. .color-tip { color: #909399!important; }
  175. .color-base-text {color: #ff4544!important;}
  176. .img-content >img{width: 100%;height: 100%;}
  177. .tips-layer .head {position: relative;}
  178. .tips-layer .title {height: 40px;line-height: 40px;text-align: center;font-size:$h2;font-weight: 700;}
  179. .tips-layer .iconclose{position: absolute;top: 4px;right: 22px;font-size:$h2;font-weight: 500;}
  180. .tips-layer .body .detail {padding: 10px;margin-bottom:10px}
  181. .margin-bottom {margin-bottom: 10px!important;}
  182. .tips-layer .body .detail .font-size-base {margin-bottom: 5px;}
  183. .main-content{font-size:$subFontSize;line-height: 1.8;}
  184. .font-size-tag {font-size:$fontSize!important;}
  185. .color-base-bg {background-color: #ff4544!important;}
  186. .head-wrap {width: 100vw;line-height: 1;position: relative;height: 135px}
  187. .head-wrap > .img-content {width: 100%}
  188. .head-wrap .wrap {width: 100%;height: 100%;position: absolute;z-index: 5;top: 0;left: 0}
  189. .head-wrap .member-wrap {height: 95px;padding: 25px 15px 15px 15px;display: flex;align-items: center;box-sizing: border-box}
  190. .head-wrap .member-wrap .headimg {width: 50px;height: 50px;background: #fff;border: 2px solid #fff;border-radius: 50%;overflow: hidden}
  191. .head-wrap .member-wrap .headimg .img-content {width: 100%;height: 100%}
  192. .head-wrap .member-wrap .point {margin-left: 15px;color: #fff;font-size:$h1}
  193. .head-wrap .member-wrap .point-name {font-size:$fontSize;color: #fff;margin-left: 2px;margin-top: 2px}
  194. .head-wrap .member-wrap .iconjifen1 {color: #fff;margin-left: 4px}
  195. .head-wrap .member-wrap .rule {-webkit-box-flex: 1;-webkit-flex: 1;flex: 1;text-align: right;color: #fff}
  196. .head-wrap .member-wrap .iconwenhao {font-size:$fontSize;color: #fff;margin-right: 3px}
  197. .head-wrap .action-wrap {display: flex;-webkit-box-pack: justify;-webkit-justify-content: space-between;justify-content: space-between;align-items: center;height: 40px;background-color: hsla(0,0%,100%,.1)}
  198. .head-wrap .action-wrap .view-content {line-height: 1;text-align: center;width: calc((100vw - 0.5px) / 2);color: #fff}
  199. .head-wrap .action-wrap .view-content .text-content {font-size:$fontSize;margin-left: 4px}
  200. .head-wrap .action-wrap .view-content.split {width: 0.5px;height: 25px;background-color: hsla(0,0%,93.3%,.3);-webkit-flex-shrink: 0;flex-shrink: 0}
  201. .head-wrap .action-wrap .view-content .img-content {width: 100%}
  202. .head-wrap .no-login {display: flex;align-items: center;-webkit-box-pack: center;-webkit-justify-content: center;justify-content: center;text-align: center}
  203. .head-wrap .no-login .text-content {color: #fff}
  204. .head-wrap .no-login .login-btn {display: inline-block;height: 35px;line-height: 35px;width: 100px;border: 1px solid #fff;border-radius: 35px;margin-bottom: 10px}
  205. </style>