user.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. <template>
  2. <view class="pagecon">
  3. <view class="userInfo dffs">
  4. <image class="headimg" :src="userInfo.userInfo.avatar" mode=""></image>
  5. <view class="uinfo">
  6. <navigator :url="userInfo.userInfo.user_id ? '' : '/pages/login/login'" class="uinfoPho">
  7. {{ userInfo.userInfo.nickname || '欢迎登陆' }}
  8. <image v-if="userInfo.userInfo.level_time != 0" :src="userInfo.userInfo.level_logo||'/static/img/pro/usVip.png'" mode=""></image>
  9. </navigator> <text class="fontssm prosecond">{{userInfo.userInfo.rank_name||"普通会员"}}</text>
  10. <!-- <button type="primary" shape="circle" class="loginButton" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">{{ newsInfo.user_phone || '获取手机号' }}</button> -->
  11. </view>
  12. </view>
  13. <view class="usBotList dfsb">
  14. <navigator url="/pages/user/mine/mineBean" class="usli dffd">
  15. <text class="monnum">{{ userInfo.userInfo.bean || 0 }}</text>
  16. <text class="montext">我的学豆</text>
  17. </navigator>
  18. <navigator url="/pages/user/coupon/myCoup" class="usli dffd">
  19. <text class="monnum">{{ userInfo.userInfo.kj_num || 0 }}</text>
  20. <text class="montext">我的卡券</text>
  21. </navigator>
  22. <navigator url="/pages/user/mine/collect?type=1" class="usli dffd">
  23. <text class="monnum">{{ userInfo.userInfo.collect_num || 0 }}</text>
  24. <text class="montext">收藏</text>
  25. </navigator>
  26. <navigator v-if="showVideo==1" url="/pages/user/mine/buy" class="usli dffd">
  27. <text class="monnum">{{ userInfo.userInfo.video_num || 0 }}</text>
  28. <text class="montext">视频</text>
  29. </navigator>
  30. </view>
  31. <navigator v-if="userInfo.userInfo.level_time == 0" url="/pages/user/mine/member" class="flone">
  32. <image class="member" src="/static/img/pro/usUpd.png" mode=""></image>
  33. </navigator>
  34. <view class="ordBox oneBox">
  35. <view class="gdHead">我的订单</view>
  36. <view class="userNav dfsa">
  37. <navigator url="/pagesA/mall/order?state=0" class="userLi">
  38. <image src="/static/img/pro/usordall.png" mode=""></image>
  39. <view class="fontssm">全部订单</view>
  40. </navigator>
  41. <navigator url="/pagesA/mall/order?state=1" class="userLi">
  42. <image src="/static/img/pro/usordtwo.png" mode=""></image>
  43. <view class="fontssm">待付款</view>
  44. </navigator>
  45. <navigator url="/pagesA/mall/order?state=2" class="userLi">
  46. <image src="/static/img/pro/usordthr.png" mode=""></image>
  47. <view class="fontssm">已付款</view>
  48. </navigator>
  49. <navigator url="/pagesA/mall/order?state=3" class="userLi">
  50. <image src="/static/img/pro/usordfour.png" mode=""></image>
  51. <view class="fontssm">已发货</view>
  52. </navigator>
  53. </view>
  54. </view>
  55. <view class="monwarp dfsb">
  56. <image src="/static/img/pro/usmonbg.png" class="monbg" mode=""></image>
  57. <view class="monbg textBox dfsb">
  58. <view class="left">
  59. <text class="white fontsm">资产总金额(元)</text>
  60. <view class="leftbot white">
  61. {{ show ? userInfo.userInfo.money : '***' }}
  62. <image @click="show = !show" :src="show ? '/static/img/pro/usmoneye.png' : '/static/img/pro/usmoneyeno.png'" mode=""></image>
  63. </view>
  64. </view>
  65. <navigator url="/pages/user/funManage/funManage" class="right white fontsm">
  66. <image class="rigicon" src="/static/img/pro/usmonicon.png" mode=""></image>
  67. 查看账单
  68. </navigator>
  69. </view>
  70. </view>
  71. <view class="ordBox oneBox">
  72. <view class="gdHead">我的信息</view>
  73. <view class="userNav dfsa">
  74. <navigator url="/pages/user/mine/userInfo" class="userLi">
  75. <image src="/static/img/pro/usnav1.png" mode=""></image>
  76. <view class="fontssm">个人信息</view>
  77. </navigator>
  78. <navigator url="/pages/user/mine/member" class="userLi">
  79. <image src="/static/img/pro/usnav2.png" mode=""></image>
  80. <view class="fontssm">会员</view>
  81. </navigator>
  82. <navigator url="/pages/user/coupon/myCoup" class="userLi">
  83. <image src="/static/img/pro/usnav3.png" mode=""></image>
  84. <view class="fontssm">卡券</view>
  85. </navigator>
  86. <navigator url="/pages/user/funManage/recharge" class="userLi">
  87. <image src="/static/img/pro/usnav4.png" mode=""></image>
  88. <view class="fontssm">学豆充值</view>
  89. </navigator>
  90. </view>
  91. </view>
  92. <view class="ordBox oneBox">
  93. <view class="gdHead">我的内容</view>
  94. <view class="userNav dfsa">
  95. <navigator url="/pages/user/mine/team" class="userLi">
  96. <image src="/static/img/pro/usnav5.png" mode=""></image>
  97. <view class="fontssm">我的推荐</view>
  98. </navigator>
  99. <navigator url="/pages/user/mine/down" class="userLi">
  100. <image src="/static/img/pro/usnav6.png" mode=""></image>
  101. <view class="fontssm">我的下载</view>
  102. </navigator>
  103. <navigator url="/pages/user/mine/poster" class="userLi">
  104. <image src="/static/img/pro/usnav7.png" mode=""></image>
  105. <view class="fontssm">我的海报</view>
  106. </navigator>
  107. <navigator url="/pages/user/mine/collect?type=1" class="userLi">
  108. <image src="/static/img/pro/usnav8.png" mode=""></image>
  109. <view class="fontssm">我的收藏</view>
  110. </navigator>
  111. </view>
  112. </view>
  113. <view class="ordBox oneBox">
  114. <view class="gdHead">其他</view>
  115. <view class="userNav dfsa">
  116. <navigator url="/pages/news/notice" class="userLi">
  117. <image src="/static/img/pro/usnav9.png" mode=""></image>
  118. <view class="fontssm">公告</view>
  119. </navigator>
  120. <navigator url="/pages/user/mine/feedBack" class="userLi">
  121. <image src="/static/img/pro/usnav10.png" mode=""></image>
  122. <view class="fontssm">意见反馈</view>
  123. </navigator>
  124. <navigator url="/pages/user/other/other" class="userLi">
  125. <image src="/static/img/pro/usnav11.png" mode=""></image>
  126. <view class="fontssm">留言板</view>
  127. </navigator>
  128. <!-- <navigator url="/pages/mall/myOrder?state=4">
  129. </navigator> -->
  130. <button type="default" open-type="contact" class="userLi defaultBtn">
  131. <image src="/static/img/pro/usnav12.png" mode=""></image>
  132. <view class="fontssm">在线客服</view>
  133. </button>
  134. </view>
  135. </view>
  136. </view>
  137. </template>
  138. <script>
  139. import { mapState, mapActions } from 'vuex';
  140. export default {
  141. computed: {
  142. // ...mapState({ userInfo: state => state.userInfo })
  143. },
  144. data() {
  145. return {
  146. showVideo: '0',
  147. show: false,
  148. userInfo: {
  149. userInfo: {},
  150. order_nums: {}
  151. }
  152. };
  153. },
  154. onShow(opt) {
  155. this.onload();
  156. this.showVideo = uni.getStorageSync('showVideo')||0;
  157. // this.$store.dispatch('getUserInfo');
  158. },
  159. methods: {
  160. xaizai() {
  161. uni.downloadFile({
  162. url: 'https://ht.xinmingyi.cn/11111.docx', //仅为示例,并非真实的资源
  163. success: res => {
  164. if (res.statusCode === 200) {
  165. var filePath1 = res.tempFilePath;
  166. // console.log(res.tempFilePath);
  167. uni.saveFile({
  168. tempFilePath: filePath1,
  169. success: function(res2) {
  170. console.log('文件:', res2.savedFilePath);
  171. uni.showToast({
  172. title: 'save成功' + res2.savedFilePath,
  173. duration: 2000
  174. });
  175. uni.openDocument({
  176. filePath: filePath1,
  177. showMenu: true,
  178. success: function(res) {
  179. uni.showToast({
  180. title: '打开文档成功成功',
  181. duration: 2000
  182. });
  183. }
  184. });
  185. },
  186. fail: res => {
  187. uni.showToast({
  188. title: 'save失败',
  189. duration: 2000
  190. });
  191. }
  192. });
  193. }
  194. },
  195. fail: res => {
  196. console.log(res);
  197. uni.showToast({
  198. title: 'down失败',
  199. duration: 2000
  200. });
  201. }
  202. });
  203. },
  204. showPopup(key) {
  205. this.$refs[key].open();
  206. },
  207. async onload() {
  208. const res = await this.$api.request('user/userInfo');
  209. console.log("我的更新用户信息",res)
  210. if (res.code == '200') {
  211. this.userInfo = res.data;
  212. this.$store.commit('setStateAttr', {
  213. key: 'userInfo',
  214. val: this.userInfo
  215. });
  216. } else {
  217. this.$api.toast(res.msg);
  218. }
  219. },
  220. navTo() {
  221. uni.navigateTo({
  222. url: '/pages/user/set/userInfo'
  223. });
  224. }
  225. }
  226. };
  227. </script>
  228. <style lang="scss" scoped>
  229. .pagecon {
  230. min-height: 100vh;
  231. background: #f7f6f9;
  232. padding: 0 30rpx 0;
  233. .userInfo {
  234. padding: 55rpx 0rpx 48rpx;
  235. width: 100%;
  236. .headimg {
  237. width: 100rpx;
  238. height: 100rpx;
  239. border-radius: 50%;
  240. background-color: #f5fcfc;
  241. margin-right: 30rpx;
  242. }
  243. .uinfo {
  244. flex: 1;
  245. .uinfoPho {
  246. font-size: 36rpx;
  247. font-family: PingFangSC-Semibold, PingFang SC;
  248. font-weight: 600;
  249. line-height: 50rpx;
  250. margin-bottom: 10rpx;
  251. image {
  252. width: 35rpx;
  253. height: 31rpx;
  254. margin : 0 15rpx;
  255. }
  256. }
  257. .prosecond{
  258. background-color: rgba($prosecond,0.2);
  259. padding: 4rpx 12rpx;
  260. border-radius: 10rpx;
  261. }
  262. }
  263. }
  264. .usBotList {
  265. justify-content: space-evenly;
  266. .usli {
  267. align-items: center;
  268. .monnum {
  269. text-align: center;
  270. font-size: 36rpx;
  271. font-family: DIN-Medium, DIN;
  272. font-weight: 500;
  273. line-height: 46rpx;
  274. }
  275. .montext {
  276. color: #666;
  277. margin-top: 4rpx;
  278. font-size: 26rpx;
  279. line-height: 37rpx;
  280. }
  281. }
  282. }
  283. .monwarp {
  284. position: relative;
  285. overflow: hidden;
  286. width: 690rpx;
  287. height: 114rpx;
  288. .monbg {
  289. position: absolute;
  290. top: 0;
  291. left: 0;
  292. width: 100%;
  293. height: 100%;
  294. }
  295. .textBox {
  296. padding: 26rpx 0 26rpx 17rpx;
  297. }
  298. .white {
  299. color: #fff;
  300. }
  301. .left {
  302. .leftbot {
  303. image {
  304. margin-left: 16rpx;
  305. width: 30rpx;
  306. height: 20rpx;
  307. }
  308. }
  309. }
  310. .right {
  311. // width: 158rpx;
  312. height: 50rpx;
  313. line-height: 50rpx;
  314. background: rgba(#ffffff, 0.4);
  315. border-radius: 100rpx 0rpx 0rpx 100rpx;
  316. padding-left: 28rpx;
  317. .rigicon {
  318. width: 20rpx;
  319. height: 22rpx;
  320. margin-right: 9rpx;
  321. }
  322. }
  323. }
  324. .flone {
  325. margin: 54rpx 0rpx 23rpx;
  326. .member {
  327. width: 691rpx;
  328. height: 82rpx;
  329. }
  330. }
  331. .ordBox {
  332. margin: 24rpx 0rpx 20rpx;
  333. background-color: #fff;
  334. border-radius: 16rpx;
  335. .gdHead {
  336. padding: 27rpx 27rpx 3rpx;
  337. font-family: PingFangSC-Medium, PingFang SC;
  338. font-weight: 600;
  339. font-size: 30rpx;
  340. line-height: 42rpx;
  341. }
  342. .userNav {
  343. flex-wrap: wrap;
  344. justify-content: space-around;
  345. padding: 30rpx 0;
  346. .userLi {
  347. display: flex;
  348. flex-direction: column;
  349. align-items: center;
  350. color: #626262;
  351. font-size: 24rpx;
  352. line-height: 36rpx;
  353. position: relative;
  354. image {
  355. width: 52rpx;
  356. height: 52rpx;
  357. // padding: 5rpx;
  358. margin: 0 auto 10rpx;
  359. }
  360. }
  361. }
  362. .specNav {
  363. width: 100%;
  364. padding: 0 32rpx;
  365. .userLi {
  366. padding: 30rpx 0;
  367. align-items: center;
  368. border-bottom: 1rpx solid #f5f5f5;
  369. image {
  370. width: 48rpx;
  371. height: 48rpx;
  372. margin-right: 24rpx;
  373. }
  374. .litext {
  375. flex: 1;
  376. font-size: 32rpx;
  377. line-height: 30rpx;
  378. color: $textcom;
  379. }
  380. }
  381. }
  382. }
  383. }
  384. </style>