index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <app-layout class="app-my">
  3. <view class="container">
  4. <view class="customer">
  5. <view class="bg"></view>
  6. <view class="info dir-top-wrap cross-center main-center">
  7. <view class="head-img">
  8. <u-image
  9. width="140"
  10. height="140"
  11. :src="userData.head_img"
  12. shape="circle"></u-image>
  13. </view>
  14. <view class="nickname">{{userData.nickname}}</view>
  15. <view class="mobile">
  16. <!--#ifdef MP-WEIXIN-->
  17. <u-button size="mini"
  18. v-if="!userData.phone_num"
  19. :custom-style="{backgroundColor: '#097268'}"
  20. type="success" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">获取手机号</u-button>
  21. <text v-else>{{userData.phone_num}}</text>
  22. <!--#endif-->
  23. </view>
  24. </view>
  25. </view>
  26. <u-cell-group :border="false" class="tab-list">
  27. <u-cell-item title="桥架会员" :border-bottom="false" bg-color="#f9f9f9" @click="$jump({url:'/pages/my/member',type:'to'})">
  28. <view slot="icon" class="icon bridge"></view>
  29. </u-cell-item>
  30. <u-cell-item title="会员购买记录" :border-bottom="false" bg-color="#f9f9f9" @click="$jump({url:'/pages/my/member-record',type:'to'})">
  31. <view slot="icon" class="icon member"></view>
  32. </u-cell-item>
  33. <u-cell-item title="分销中心" v-if="setting.open_share" :border-bottom="false" bg-color="#f9f9f9" @click="$jump({url:'/pages/share/index',type:'to'})">
  34. <view slot="icon" class="icon share"></view>
  35. </u-cell-item>
  36. <u-cell-item title="微信号" :border-bottom="false" bg-color="#f9f9f9">
  37. {{setting.service_wechat}}
  38. <view slot="icon" class="icon wechat"></view>
  39. </u-cell-item>
  40. <u-cell-item title="在线客服" :border-bottom="false" bg-color="#f9f9f9">
  41. <view slot="icon" class="icon kefu"></view>
  42. </u-cell-item>
  43. <u-cell-item title="清除缓存" :border-bottom="false" icon="reload" bg-color="#f9f9f9" @click="handleClearCache">
  44. </u-cell-item>
  45. </u-cell-group>
  46. <view class="qrcode dir-top-wrap cross-center">
  47. <view class="img">
  48. <u-image
  49. width="260"
  50. height="260"
  51. :src="setting.service_qrcode"
  52. ></u-image>
  53. </view>
  54. <text class="title">扫描二维码联系客服</text>
  55. </view>
  56. </view>
  57. <u-modal v-model="modal.show"
  58. :show-cancel-button="true"
  59. content="确定清除缓存?"
  60. cancel-text="取消"
  61. cancel-color="#CCCCCC"
  62. confirm-text="确定"
  63. confirm-color="#046E64"
  64. @confirm="sureClearCache"
  65. >
  66. </u-modal>
  67. </app-layout>
  68. </template>
  69. <script>
  70. import appLayout from "@/components/app-layout"
  71. export default {
  72. components:{
  73. appLayout,
  74. },
  75. data() {
  76. return {
  77. userData: this.vuex_user_data,
  78. setting: {},
  79. modal: {
  80. show : false
  81. }
  82. }
  83. },
  84. methods: {
  85. getPhoneNumber(phoneNumber){
  86. uni.checkSession({
  87. success: data => {
  88. this.$u.api.userBindPhone(phoneNumber.detail).then(data => {
  89. this.$u.vuex(this.$const.USER_DATA,data)
  90. this.userData = data;
  91. })
  92. },
  93. fail: err => {
  94. this.sureClearCache()
  95. }
  96. })
  97. },
  98. getUser(){
  99. this.$u.api.userGet().then(data => {
  100. console.log('-->data',data)
  101. })
  102. },
  103. getSetting(){
  104. this.$u.api.settingGet().then(data => {
  105. this.setting = data;
  106. })
  107. },
  108. handleClearCache(){
  109. this.modal.show = true
  110. },
  111. sureClearCache(){
  112. this.$u.vuex(this.$const.USER_TOKEN,null)
  113. this.$u.vuex(this.$const.USER_DATA,null)
  114. this.$jump({url:'/pages/login/login?redirect=pages/my/index',type:'redirect'})
  115. }
  116. },
  117. onLoad(){
  118. this.userData = this.vuex_user_data
  119. //this.getUser();
  120. },
  121. onShow(){
  122. this.getSetting();
  123. }
  124. }
  125. </script>
  126. <style lang="scss" scoped>
  127. /deep/.u-cell{
  128. padding: 22rpx 32rpx !important;
  129. }
  130. .container{
  131. padding: 0;
  132. height: 100vh;
  133. .customer{
  134. position: relative;
  135. .bg{
  136. position: absolute;
  137. background: url("@/static/images/bg.png") no-repeat center;
  138. background-size: 100% 100%;
  139. height: 300rpx;
  140. left: 0;
  141. top: 0;
  142. width: 750rpx;
  143. z-index: 0;
  144. }
  145. .info{
  146. height: 300rpx;
  147. position: relative;
  148. color: #ffffff;
  149. z-index: 1;
  150. .nickname{
  151. margin: 8rpx 0;
  152. font-weight: 600;
  153. }
  154. }
  155. }
  156. .tab-list{
  157. margin-top: 32rpx;
  158. .icon{
  159. width: 32rpx;
  160. height: 32rpx;
  161. background-size: cover;
  162. background-repeat: no-repeat;
  163. background-position: center;
  164. margin-right: 8rpx;
  165. &.bridge{
  166. background-image: url("@/static/images/icons/bridge.png");
  167. }
  168. &.kefu{
  169. background-image: url("@/static/images/icons/kefu.png");
  170. }
  171. &.member{
  172. background-image: url("@/static/images/icons/member.png");
  173. }
  174. &.share{
  175. background-image: url("@/static/images/icons/share.png");
  176. }
  177. &.wechat{
  178. background-image: url("@/static/images/icons/wechat.png");
  179. }
  180. }
  181. }
  182. .qrcode{
  183. margin-top: 32rpx;
  184. >.title{
  185. padding: 8rpx 0;
  186. color: #6e6e6e;
  187. }
  188. }
  189. }
  190. </style>