index.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <view class="body">
  3. <view class="pd24_20 flex alcenter space user-info">
  4. <view class="flex alcenter">
  5. <view class="member-face">
  6. <image class="face" :src="statics.defaultFace"></image>
  7. <!-- <image class="vip-level" :src="userinfo.group_id>1?statics.vipLevelImg[0]:''"></image> -->
  8. </view>
  9. <view class="ml15">
  10. <view class="ft16 cl-main">{{ userinfo.type }}</view>
  11. <view class="mt12 ft12 cl-notice">ID:{{ userinfo.uid || '' }}
  12. <image @click="copyId(userinfo.uid || '')" style="margin-left: 10px; width: 30rpx;height: 15px;"
  13. src="/static/img/wode/cpoy.png" />
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="pd24_20">
  19. <div class="box pd16_15 creadit-box">
  20. <div class="mt16 coin-box">
  21. <div class="flex alcenter coin-item">
  22. <label class="coin-text">{{ userinfo.charge_coin || 0 }}</label>
  23. <label class="coin-text">永久看币</label>
  24. </div>
  25. <label class="box-line">|</label>
  26. <div class="flex alcenter coin-item">
  27. <label class="coin-text">{{ userinfo.reward_coin || 0 }}</label>
  28. <label class="coin-text">赠送看币</label>
  29. </div>
  30. </div>
  31. <div class="mt16 box-cj" @click="topay"><label class="btn-cz">去充值</label></div>
  32. </div>
  33. <!-- <home-vipcard :userinfo="userinfo" @loginAct="showLoginAct" @qrcode="showQrcode = true"></home-vipcard> -->
  34. <view class="flex wrap space mt16">
  35. <view v-for="(item, index) in getMenus" :key="index" :class="index > 1 ? 'mt16' : ''">
  36. <view v-if="item.type == 'link'" :data-index="index" @click="memberLinkTo"
  37. class="box pd16_15 flex alcenter" style="width: 320rpx;">
  38. <image :src="item.icon" style="width: 64rpx;height: 64rpx;"></image>
  39. <text class="ml15 ft14 ftw500 cl-main">{{ item.name }}</text>
  40. </view>
  41. <view v-else style="width: 320rpx;" @click="showPopu(item.type)">
  42. <button class="box pd16_15 flex alcenter" style="padding: 32rpx 30rpx; margin: 0;">
  43. <image :src="item.icon" style="width: 64rpx;height: 64rpx;"></image>
  44. <text class="ml15 ft14 ftw500 cl-main">{{ item.name }}</text>
  45. </button>
  46. </view>
  47. </view>
  48. </view>
  49. <com-copyright></com-copyright>
  50. <uni-popup ref="popup" type="center">
  51. <image :show-menu-by-longpress="true" class="qrcode-img" :src="kefu.url"></image>
  52. </uni-popup>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. import {
  58. getKefu
  59. } from "@/common/apis/common.js"
  60. import {
  61. getUserInfo
  62. } from "@/common/apis/my.js"
  63. export default {
  64. data() {
  65. return {
  66. isLogin: false,
  67. showLogin: false,
  68. isBirthday: true,
  69. showBirthday: false,
  70. showQrcode: true,
  71. avatar: '',
  72. userinfo: {
  73. type: "微信用户",
  74. },
  75. kefu: {
  76. url: "",
  77. },
  78. vipLevel: 0,
  79. iskq: 0,
  80. uid: 0,
  81. staticUrl: this.$config.staticUrl,
  82. memberMenus: [{
  83. name: '我的追剧',
  84. type: 'link',
  85. model: 'tab',
  86. link: '/pages/zhuiju/index',
  87. icon: this.$config.zystaticUrl + '/static/img/wode/zhuij.png',
  88. show: 1
  89. },
  90. {
  91. name: '充值记录',
  92. type: 'link',
  93. model: '',
  94. link: '/pages/member/orders',
  95. icon: this.$config.zystaticUrl + '/static/img/wode/wd-cz.png',
  96. show: 1
  97. },
  98. {
  99. name: '消费记录',
  100. type: 'link',
  101. model: '',
  102. link: '/pages/member/consume',
  103. icon: this.$config.zystaticUrl + '/static/img/wode/xiaofei.png',
  104. show: 1
  105. },
  106. {
  107. name: '联系客服',
  108. type: 'kefu',
  109. model: '',
  110. link: '/pages/client/tuan/wdxh',
  111. icon: this.$config.zystaticUrl + '/static/img/wode/kefu.png',
  112. show: 1
  113. },
  114. ],
  115. }
  116. },
  117. computed: {
  118. getMenus() {
  119. let arr = new Array;
  120. for (var a in this.memberMenus) {
  121. if (this.memberMenus[a].show == 1 || (this.iskq == 1 && this.memberMenus[a].show == 3)) {
  122. arr.push(this.memberMenus[a]);
  123. }
  124. }
  125. return arr;
  126. }
  127. },
  128. async onLoad() {
  129. try {
  130. let res = await getKefu();
  131. this.kefu = res.data;
  132. } catch (e) {
  133. //TODO handle the exception
  134. }
  135. },
  136. async onShow() {
  137. try {
  138. let res = await getUserInfo();
  139. this.userinfo = res.data;
  140. } catch (e) {
  141. //TODO handle the exception
  142. }
  143. },
  144. methods: {
  145. topay() {
  146. uni.navigateTo({
  147. url: '/pages/pay/pay'
  148. })
  149. },
  150. showPopu(type = "kefu") {
  151. if (type == "kefu") {
  152. this.$refs.popup.open('center')
  153. }
  154. },
  155. memberLinkTo(e) {
  156. let index = parseInt(e.currentTarget.dataset.index);
  157. if (this.getMenus[index].link != '') {
  158. if (this.getMenus[index].model == 'integral') {
  159. uni.redirectTo({
  160. url: this.getMenus[index].link
  161. })
  162. } else if (this.getMenus[index].model == 'tab') {
  163. uni.switchTab({
  164. url: this.getMenus[index].link
  165. })
  166. } else {
  167. uni.navigateTo({
  168. url: this.getMenus[index].link
  169. })
  170. }
  171. }
  172. },
  173. copyId(uid) {
  174. console.log('uid', uid);
  175. uni.setClipboardData({
  176. data: uid + "",
  177. success: () => {
  178. uni.showToast({
  179. title: '复制成功',
  180. icon: "none"
  181. })
  182. },
  183. fail: function(err) {
  184. uni.showToast({
  185. title: '复制失败',
  186. duration: 2000,
  187. icon: 'none'
  188. });
  189. }
  190. })
  191. },
  192. },
  193. }
  194. </script>
  195. <style lang="scss" scoped>
  196. @import url("style/index.css");
  197. </style>