index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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.free_coin|| 0}}</label>
  28. <label class="coin-text">赠送看币</label>
  29. </div>
  30. </div>
  31. <div class="mt16 box-cj"><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. <!-- <image src=""></image> -->
  51. <!-- <com-footer model="member"></com-footer> -->
  52. <uni-popup ref="popup" type="center">
  53. <image class="qrcode-img" :src="kefu.url"></image>
  54. </uni-popup>
  55. <dialog-birthday v-if="showBirthday" @closed="showBirthday = false"></dialog-birthday>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. import {
  61. getKefu
  62. } from "@/common/apis/common.js"
  63. import {
  64. getUserInfo
  65. } from "@/common/apis/my.js"
  66. export default {
  67. data() {
  68. return {
  69. isLogin: false,
  70. showLogin: false,
  71. isBirthday: true,
  72. showBirthday: false,
  73. showQrcode: true,
  74. avatar: '',
  75. userinfo: {
  76. type: "微信用户",
  77. },
  78. kefu: {
  79. url: "",
  80. },
  81. vipLevel: 0,
  82. iskq: 0,
  83. uid: 0,
  84. staticUrl: this.$config.staticUrl,
  85. memberMenus: [
  86. // {name:'观看历史',type:'link',model:'',link:'/pages/client/tuan/zjgk',icon:this.$config.staticUrl + 'vipcard_icon_my_card@2x.png',show:1},
  87. // {name:'我的追剧',type:'link',model:'',link:'/pages/client/tuan/zjjl',icon:this.$config.staticUrl + 'vipcard_icon_my_order@2x.png',show:1},
  88. {
  89. name: '我的追剧',
  90. type: 'link',
  91. model: 'tab',
  92. link: '/pages/client/zui',
  93. icon: this.$config.zystaticUrl + '/static/img/wode/zhuij.png',
  94. show: 1
  95. },
  96. {
  97. name: '充值记录',
  98. type: 'link',
  99. model: '',
  100. link: '/pages/client/orders/oreders',
  101. icon: this.$config.zystaticUrl + '/static/img/wode/wd-cz.png',
  102. show: 1
  103. },
  104. {
  105. name: '消费记录',
  106. type: 'link',
  107. model: '',
  108. link: '/pages/client/consume/consume',
  109. icon: this.$config.zystaticUrl + '/static/img/wode/xiaofei.png',
  110. show: 1
  111. },
  112. {
  113. name: '联系客服',
  114. type: 'kefu',
  115. model: '',
  116. link: '/pages/client/tuan/wdxh',
  117. icon: this.$config.zystaticUrl + '/static/img/wode/kefu.png',
  118. show: 1
  119. },
  120. // {name:'收货地址',type:'git link',model:'',link:'/pages/client/member/address',icon:this.$config.staticUrl + 'vipcard_icon_my_address@2x.png',show:0},
  121. // {name:'官方商城',type:'link',model:'',link:'/pages/client/shop',icon:this.$config.staticUrl + 'vipcard_icon_my_integral@2x.png',show:0},
  122. // {name:'联系客服',type:'link',model:'',link:'/pages/client/vipcard/adviser',icon:this.$config.staticUrl + 'vipcard_icon_my_advise@2x.png',show:1},
  123. // {name:'我的团队',type:'link',model:'',link:'/pages/client/mytuandui',icon:this.$config.staticUrl + 'vipcard_icon_my_invite@2x.png',show:3},
  124. // {name:'分销订单',type:'link',model:'',link:'/pages/client/vipcard/fxlog',icon:this.$config.staticUrl + 'vipcard_icon_my_integral@2x.png',show:3},
  125. ],
  126. }
  127. },
  128. computed: {
  129. getMenus() {
  130. let arr = new Array;
  131. for (var a in this.memberMenus) {
  132. if (this.memberMenus[a].show == 1 || (this.iskq == 1 && this.memberMenus[a].show == 3)) {
  133. arr.push(this.memberMenus[a]);
  134. }
  135. }
  136. return arr;
  137. }
  138. },
  139. async onLoad() {
  140. this.kefu = await getKefu();
  141. },
  142. async onShow() {
  143. let info = await getUserInfo();
  144. this.userinfo = info;
  145. },
  146. onShareAppMessage: function(res) {
  147. // #ifdef MP-WEIXIN
  148. var href = '/pages/login/login?fxpid=' + this.uid
  149. console.log(res)
  150. let that = this;
  151. const obj = {
  152. title: "发送给好友",
  153. imageUrl: '',
  154. path: href,
  155. success: function(res) {
  156. console.log(res, "转发成功")
  157. },
  158. fail: function(res) {
  159. wx.showToast({
  160. title: '发送失败',
  161. icon: 'none'
  162. })
  163. }
  164. }
  165. return obj
  166. // #endif
  167. },
  168. onShareTimeline(e) {
  169. },
  170. methods: {
  171. showPopu(type = "kefu") {
  172. if (type == "kefu") {
  173. this.$refs.popup.open('center')
  174. }
  175. },
  176. opset() {
  177. uni.navigateTo({
  178. url: '/pages/set/set'
  179. })
  180. },
  181. opsets() {
  182. uni.navigateTo({
  183. url: '/pages/set/grzl/grzl'
  184. })
  185. },
  186. memberLinkTo(e) {
  187. let index = parseInt(e.currentTarget.dataset.index);
  188. if (this.getMenus[index].link != '') {
  189. if (this.getMenus[index].model == 'integral') {
  190. uni.redirectTo({
  191. url: this.getMenus[index].link
  192. })
  193. } else if (this.getMenus[index].model == 'tab') {
  194. uni.switchTab({
  195. url: this.getMenus[index].link
  196. })
  197. } else {
  198. uni.navigateTo({
  199. url: this.getMenus[index].link
  200. })
  201. }
  202. }
  203. },
  204. birthdayAct() {
  205. if (this.isBirthday) {
  206. uni.navigateTo({
  207. url: '/pages/client/member/birthday'
  208. })
  209. } else {
  210. uni.navigateTo({
  211. url: '/pages/client/member/info'
  212. })
  213. }
  214. },
  215. copyId(uid) {
  216. console.log('uid', uid);
  217. uni.setClipboardData({
  218. data: uid+"",
  219. success: () => {
  220. uni.showToast({
  221. title: '复制成功',
  222. icon: "none"
  223. })
  224. },
  225. fail: function(err) {
  226. uni.showToast({
  227. title: '复制失败',
  228. duration: 2000,
  229. icon: 'none'
  230. });
  231. }
  232. })
  233. }
  234. }
  235. }
  236. </script>
  237. <style>
  238. @import url("style/index.css");
  239. </style>