index.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. <template>
  2. <view>
  3. <view style="background:url(/static/my/bg.png) no-repeat;background-size: 100%;padding-bottom: 150rpx;">
  4. <view style="text-align: center;padding-top: 100rpx;font-size: 30rpx;line-height: 150%;">
  5. <image src="/static/tx1.png" style="width: 150rpx;height:150rpx;"></image>
  6. <view style="color: #fff;">{{ userinfo.xm }}</view>
  7. <view style="color: #c2c7ad;">ID号:{{ userinfo.sjh }}</view>
  8. </view>
  9. </view>
  10. <view class="tab">
  11. <view class="t">
  12. <view class="tit" @click="topage('/pages/integer/integer')">
  13. <view>{{ userinfo ? userinfo.jifen : 0 }}</view>
  14. <view>积分</view>
  15. </view>
  16. <view class="tit" @click="topage('/pages/integer/tjsymx')">
  17. <view>{{userinfo?userinfo.tuijian:0}}</view>
  18. <view>推荐收益</view>
  19. </view>
  20. <view class="tit" @click="topage('/pages/ppb/index')">
  21. <view>{{userinfo.lzc}}</view>
  22. <view style="font-family: Arial, Helvetica, sans-serif;">拍拍宝</view>
  23. </view>
  24. </view>
  25. <view class="t">
  26. <view class="tit" @click="topage('/pages/integer/symx')">
  27. <view>{{userinfo?userinfo.shouyi:0}}</view>
  28. <view>收益</view>
  29. </view>
  30. <view class="tit" @click="topage('/pages/integer/credit1?lx=lp')">
  31. <view>{{ userinfo ? userinfo.lepiao : 0 }}</view>
  32. <view>乐票</view>
  33. </view>
  34. <view class="tit" @click="topage('/pages/zichan/index')">
  35. <view>{{userinfo?userinfo.zc:0}}</view>
  36. <view>资产</view>
  37. </view>
  38. </view>
  39. <view class="t">
  40. <view class="tit" @click="topage('/pages/yuyue/index')">
  41. <view>{{userinfo?userinfo.qg:0}}</view>
  42. <view>抢购记录</view>
  43. </view>
  44. <view class="tit" @click="topage('/pages/zhuanrang/index')">
  45. <view>{{userinfo?userinfo.zr:0}}</view>
  46. <view>转让记录</view>
  47. </view>
  48. <view class="tit" @click="topage('/pages/integer/credit1')">
  49. <view>{{userinfo?userinfo.yy:0}}</view>
  50. <view>预约记录</view>
  51. </view>
  52. </view>
  53. </view>
  54. <view style="width: calc(100% - 100rpx);margin: auto;margin-top: 20rpx;display: table;">
  55. <image src="/static/my/a.png" style="width:350rpx;height: 210rpx;float: left;" @click="onClick_1"></image>
  56. <view style="float: right;width:calc(100% - 370rpx);float: right;">
  57. <image src="/static/my/b.png" style="width:100%;height: 100rpx;" @click="onRenzheng"></image>
  58. <image src="/static/my/c.png" style="width:100%;height: 100rpx;margin-top:4rpx;" @click="onPayaccount"></image>
  59. </view>
  60. </view>
  61. <view class="f">
  62. <view class="d" @click="shequ">
  63. <view><image src="/static/my/cc.png"></view>
  64. <view>我的社区</view>
  65. <view><image src="/static/my/aa.png"></view>
  66. </view>
  67. <view class="d" @click="fuxiao">
  68. <view><image src="/static/my/fx.png"></view>
  69. <view>我的复销</view>
  70. <view><image src="/static/my/aa.png"></view>
  71. </view>
  72. <view class="d" @click="updateaccount">
  73. <view><image src="/static/my/bb.png"></view>
  74. <view>安全中心</view>
  75. <view><image src="/static/my/aa.png"></view>
  76. </view>
  77. <view class="d" @click="exit">
  78. <view><image src="/static/my/dd.png"></view>
  79. <view>退出登录</view>
  80. <view><image src="/static/my/aa.png"></view>
  81. </view>
  82. </view>
  83. <view style="text-align: center;font-size: 28rpx;line-height: 300%;color: #c2c7ad;">版本号:{{bbh}}</view>
  84. <uni-popup ref="popup" type="center" isMaskClick="false">
  85. <view style="width:90%;margin: auto;">
  86. <view style="border-radius:30rpx 30rpx 0 0;background: #fff;border-bottom: #ddd solid 1rpx;text-align: center;line-height: 300%;">玩家守则</view>
  87. <view style="background:#f9f9f9;padding:30rpx;font-size:28rpx;line-height: 200%;height:600rpx;overflow-y: scroll;"><rich-text :nodes="wjsz"></rich-text></view>
  88. <view style="border-radius:0 0 30rpx 30rpx;background: #93a234;color: #fff;text-align: center;line-height: 300%;" @click="$refs.popup.close()">
  89. 我知道了
  90. </view>
  91. </view>
  92. </uni-popup>
  93. </view>
  94. </template>
  95. <script>
  96. export default {
  97. data() {
  98. return {
  99. constants: {},
  100. userinfo: null,
  101. data: {
  102. _token: "",
  103. uid: 0,
  104. },
  105. bbh:'0',
  106. wjsz:''
  107. };
  108. },
  109. onLoad() {
  110. plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
  111. this.bbh=wgtinfo.version
  112. })
  113. },
  114. onShow() {
  115. var user = this.$api.getUserinfo();
  116. if (user) {
  117. this.userinfo = user;
  118. this.data.id = user.id;
  119. this.getMhUserinfo();
  120. } else {
  121. this.userinfo = null;
  122. uni.showToast({
  123. title:"请先登录",
  124. icon:"none"
  125. })
  126. setTimeout(function(){
  127. uni.navigateTo({
  128. url:"/pages/lanhu_login/index"
  129. })
  130. },1000)
  131. }
  132. },
  133. methods: {
  134. topage(page) {
  135. uni.navigateTo({
  136. url: page
  137. })
  138. },
  139. getMhUserinfo() {
  140. var data = new Object();
  141. data.uid = this.data.id;
  142. //data.uid = 1000025;
  143. data.src='my';
  144. this.$api
  145. .MhPostModel(data, 'user/info')
  146. .then(res => {
  147. if (res.data.code != 1) {
  148. uni.showModal({
  149. title: '提示',
  150. content: '账号异常!',
  151. showCancel:false,
  152. success: function (res) {
  153. if (res.confirm) {
  154. uni.navigateTo({
  155. url: '/pages/lanhu_login/index'
  156. });
  157. } else if (res.cancel) {
  158. console.log('用户点击取消');
  159. }
  160. }
  161. });
  162. } else {
  163. this.userinfo = res.data.data;
  164. if(this.userinfo.scyd==0){
  165. this.$refs.popup.open()
  166. }
  167. if(this.userinfo.duihuan==1){
  168. uni.showModal({
  169. title: '提示',
  170. content: '请进入兑换区复购,恢复预约功能!',
  171. showCancel:false,
  172. success: function (res) {
  173. if (res.confirm) {
  174. uni.navigateTo({
  175. url: '/pages/shop/duihuan'
  176. });
  177. } else if (res.cancel) {
  178. console.log('用户点击取消');
  179. }
  180. }
  181. });
  182. }
  183. this.$api.setUserinfo(res.data.data);
  184. uni.switchTab({
  185. url: "/pages/my/index"
  186. })
  187. }
  188. this.wjsz=res.data.data.wjsz
  189. })
  190. .catch(err => {
  191. // console.log('request fail', JSON.stringify(err));
  192. });
  193. },
  194. updateaccount() {
  195. if (!this.userinfo) {
  196. uni.navigateTo({
  197. url: '/pages/lanhu_login/index'
  198. });
  199. return;
  200. }
  201. uni.navigateTo({
  202. url: '/pages/lanhu_updateaccount/index'
  203. });
  204. },
  205. shequ() {
  206. if (!this.userinfo) {
  207. uni.navigateTo({
  208. url: '/pages/lanhu_login/index'
  209. });
  210. return;
  211. }
  212. uni.navigateTo({
  213. url: 'shequ'
  214. });
  215. },
  216. fuxiao() {
  217. if (!this.userinfo) {
  218. uni.navigateTo({
  219. url: '/pages/lanhu_login/index'
  220. });
  221. return;
  222. }
  223. uni.navigateTo({
  224. url: 'fuxiao'
  225. });
  226. },
  227. onPayaccount() {
  228. if (!this.userinfo) {
  229. uni.navigateTo({
  230. url: '/pages/lanhu_login/index'
  231. });
  232. return;
  233. }
  234. uni.navigateTo({
  235. url: '/pages/shoukuan/shoukuan'
  236. });
  237. },
  238. onRenzheng() {
  239. if (!this.userinfo) {
  240. uni.navigateTo({
  241. url: '/pages/lanhu_login/index'
  242. });
  243. return;
  244. }
  245. uni.navigateTo({
  246. url: '/pages/lanhu_renzhen/index'
  247. });
  248. },
  249. onClick_1() {
  250. if (!this.userinfo) {
  251. uni.navigateTo({
  252. url: '/pages/lanhu_login/index'
  253. });
  254. return;
  255. }
  256. uni.navigateTo({
  257. url: '/pages/lanhu_poster/index?uid=' + this.userinfo.id
  258. });
  259. },
  260. exit() {
  261. this.$api.setUserinfo(null);
  262. var user = this.$api.getUserinfo();
  263. if (user) {
  264. this.userinfo = user;
  265. } else {
  266. this.userinfo = null;
  267. }
  268. uni.showToast({
  269. title: '退出成功',
  270. icon: 'none'
  271. });
  272. setTimeout(function() {
  273. uni.navigateTo({
  274. url: "/pages/lanhu_login/index"
  275. })
  276. }, 1000)
  277. },
  278. toLogin() {
  279. uni.navigateTo({
  280. url: '/pages/lanhu_login/index'
  281. });
  282. }
  283. }
  284. };
  285. </script>
  286. <style lang="css">
  287. @import '../common/common.css';
  288. @import './assets/style/index.rpx.css';
  289. page {
  290. background: #F2F2F6;
  291. }
  292. .tab {
  293. background: #fff;
  294. margin: auto;
  295. margin-top: -100rpx;padding: 30rpx 0;
  296. display: flex;
  297. border-radius: 10rpx;
  298. width: calc(100% - 100rpx);display: table;
  299. }
  300. .tab .t{display: flex;
  301. justify-content: space-between;
  302. align-items: center;margin-top: 30rpx;
  303. }
  304. .tit {
  305. display: block;
  306. text-align: center;width: 33%;
  307. }
  308. .tit view:nth-child(1) {
  309. color: #333333;
  310. font-weight: bold;
  311. font-family: Arial, Helvetica, sans-serif;
  312. font-size: 32rpx;
  313. }
  314. .tit view:nth-child(2) {
  315. font-size: 28rpx;
  316. color: #999999;
  317. }
  318. .f{width: calc(100% - 100rpx);background: #FFFFFF;margin: auto;border-radius: 10rpx;margin-top: 20rpx;padding:20rpx 40rpx;}
  319. .d{display: table;width: 100%;height: 80rpx;}
  320. .d view:nth-child(1){float: left;height: 80rpx;padding-top: 20rpx;}
  321. .d view:nth-child(1) image{width: 40rpx;height: 40rpx;}
  322. .d view:nth-child(2){float: left;color: #333333;font-size: 28rpx;line-height: 80rpx;margin-left: 20rpx;}
  323. .d view:nth-child(3){float: right;height: 80rpx;padding-top: 20rpx;}
  324. .d view:nth-child(3) image{width: 30rpx;height: 30rpx;}
  325. </style>