index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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="handleJumpBuy">
  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. handleJumpBuy(){
  86. if(this.$platform === 'ios'){
  87. uni.showModal({
  88. title: '提示',
  89. content: '由于相关规范,iOS功能暂不可用',
  90. success: function (res) {
  91. // res.confirm res.cancel
  92. }
  93. });
  94. return false
  95. }
  96. this.$jump({url:'/pages/my/member',type:'to'})
  97. },
  98. getPhoneNumber(phoneNumber){
  99. uni.checkSession({
  100. success: data => {
  101. this.$u.api.userBindPhone(phoneNumber.detail).then(data => {
  102. this.$u.vuex(this.$const.USER_DATA,data)
  103. this.userData = data;
  104. })
  105. },
  106. fail: err => {
  107. this.sureClearCache()
  108. }
  109. })
  110. },
  111. getUser(){
  112. this.$u.api.userGet().then(data => {
  113. console.log('-->data',data)
  114. })
  115. },
  116. getSetting(){
  117. this.$u.api.settingGet().then(data => {
  118. this.setting = data;
  119. })
  120. },
  121. handleClearCache(){
  122. this.modal.show = true
  123. },
  124. sureClearCache(){
  125. this.$u.vuex(this.$const.USER_TOKEN,null)
  126. this.$u.vuex(this.$const.USER_DATA,null)
  127. this.$jump({url:'/pages/login/login?redirect=pages/my/index',type:'redirect'})
  128. }
  129. },
  130. onLoad(){
  131. this.userData = this.vuex_user_data
  132. //this.getUser();
  133. },
  134. onShow(){
  135. this.getSetting();
  136. }
  137. }
  138. </script>
  139. <style lang="scss" scoped>
  140. /deep/.u-cell{
  141. padding: 22rpx 32rpx !important;
  142. }
  143. .container{
  144. padding: 0;
  145. height: 100vh;
  146. .customer{
  147. position: relative;
  148. .bg{
  149. position: absolute;
  150. background: url("@/static/images/bg.png") no-repeat center;
  151. background-size: 100% 100%;
  152. height: 300rpx;
  153. left: 0;
  154. top: 0;
  155. width: 750rpx;
  156. z-index: 0;
  157. }
  158. .info{
  159. height: 300rpx;
  160. position: relative;
  161. color: #ffffff;
  162. z-index: 1;
  163. .nickname{
  164. margin: 8rpx 0;
  165. font-weight: 600;
  166. }
  167. }
  168. }
  169. .tab-list{
  170. margin-top: 32rpx;
  171. .icon{
  172. width: 32rpx;
  173. height: 32rpx;
  174. background-size: cover;
  175. background-repeat: no-repeat;
  176. background-position: center;
  177. margin-right: 8rpx;
  178. &.bridge{
  179. background-image: url("@/static/images/icons/bridge.png");
  180. }
  181. &.kefu{
  182. background-image: url("@/static/images/icons/kefu.png");
  183. }
  184. &.member{
  185. background-image: url("@/static/images/icons/member.png");
  186. }
  187. &.share{
  188. background-image: url("@/static/images/icons/share.png");
  189. }
  190. &.wechat{
  191. background-image: url("@/static/images/icons/wechat.png");
  192. }
  193. }
  194. }
  195. .qrcode{
  196. margin-top: 32rpx;
  197. >.title{
  198. padding: 8rpx 0;
  199. color: #6e6e6e;
  200. }
  201. }
  202. }
  203. </style>