index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  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. <navigator url="/pages/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" class="box pd16_15 flex alcenter"
  39. 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. <uni-popup ref="popup" type="center">
  53. <image :show-menu-by-longpress="true" class="qrcode-img" :src="kefu.url"></image>
  54. </uni-popup>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import {
  60. getKefu
  61. } from "@/common/apis/common.js"
  62. import {
  63. getUserInfo
  64. } from "@/common/apis/my.js"
  65. export default {
  66. data() {
  67. return {
  68. isLogin: false,
  69. showLogin: false,
  70. isBirthday: true,
  71. showBirthday: false,
  72. showQrcode: true,
  73. avatar: '',
  74. userinfo: {
  75. type: "微信用户",
  76. },
  77. kefu: {
  78. url: "",
  79. },
  80. vipLevel: 0,
  81. iskq: 0,
  82. uid: 0,
  83. staticUrl: this.$config.staticUrl,
  84. memberMenus: [
  85. // {name:'观看历史',type:'link',model:'',link:'/pages/client/tuan/zjgk',icon:this.$config.staticUrl + 'vipcard_icon_my_card@2x.png',show:1},
  86. // {name:'我的追剧',type:'link',model:'',link:'/pages/client/tuan/zjjl',icon:this.$config.staticUrl + 'vipcard_icon_my_order@2x.png',show:1},
  87. {
  88. name: '我的追剧',
  89. type: 'link',
  90. model: 'tab',
  91. link: '/pages/zhuiju/index',
  92. icon: this.$config.zystaticUrl + '/static/img/wode/zhuij.png',
  93. show: 1
  94. },
  95. {
  96. name: '充值记录',
  97. type: 'link',
  98. model: '',
  99. link: '/pages/member/orders',
  100. icon: this.$config.zystaticUrl + '/static/img/wode/wd-cz.png',
  101. show: 1
  102. },
  103. {
  104. name: '消费记录',
  105. type: 'link',
  106. model: '',
  107. link: '/pages/member/consume',
  108. icon: this.$config.zystaticUrl + '/static/img/wode/xiaofei.png',
  109. show: 1
  110. },
  111. {
  112. name: '联系客服',
  113. type: 'kefu',
  114. model: '',
  115. link: '/pages/client/tuan/wdxh',
  116. icon: this.$config.zystaticUrl + '/static/img/wode/kefu.png',
  117. show: 1
  118. },
  119. // {name:'收货地址',type:'git link',model:'',link:'/pages/client/member/address',icon:this.$config.staticUrl + 'vipcard_icon_my_address@2x.png',show:0},
  120. // {name:'官方商城',type:'link',model:'',link:'/pages/client/shop',icon:this.$config.staticUrl + 'vipcard_icon_my_integral@2x.png',show:0},
  121. // {name:'联系客服',type:'link',model:'',link:'/pages/client/vipcard/adviser',icon:this.$config.staticUrl + 'vipcard_icon_my_advise@2x.png',show:1},
  122. // {name:'我的团队',type:'link',model:'',link:'/pages/client/mytuandui',icon:this.$config.staticUrl + 'vipcard_icon_my_invite@2x.png',show:3},
  123. // {name:'分销订单',type:'link',model:'',link:'/pages/client/vipcard/fxlog',icon:this.$config.staticUrl + 'vipcard_icon_my_integral@2x.png',show:3},
  124. ],
  125. }
  126. },
  127. computed: {
  128. getMenus() {
  129. let arr = new Array;
  130. for (var a in this.memberMenus) {
  131. if (this.memberMenus[a].show == 1 || (this.iskq == 1 && this.memberMenus[a].show == 3)) {
  132. arr.push(this.memberMenus[a]);
  133. }
  134. }
  135. return arr;
  136. }
  137. },
  138. async onLoad() {
  139. let res = await getKefu();
  140. this.kefu = res.data;
  141. },
  142. async onShow() {
  143. let res = await getUserInfo();
  144. this.userinfo = res.data;
  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. previewImage(e) {
  235. console.log('e', e);
  236. uni.previewImage({
  237. urls: this.kefu.url,
  238. longPressActions: {
  239. // itemList: ['发送给朋友', '保存图片', '收藏'],
  240. success: function (data) {
  241. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  242. },
  243. fail: function (err) {
  244. console.log(err.errMsg);
  245. }
  246. }
  247. });
  248. }
  249. },
  250. }
  251. </script>
  252. <style>
  253. @import url("style/index.css");
  254. </style>