index.vue 7.3 KB

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