mine.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. <template>
  2. <view>
  3. <statusBar :item="navBarData"></statusBar>
  4. <view class="mineBox">
  5. <view class="userInformation" >
  6. <view class="userAvatar" @click="gotoMineEdit">
  7. <image
  8. :src="userAvatar!=='' ? userAvatar : 'https://teacherapi.cocorobo.cn/teaching-file/static//mine/Avatar_default.png'"
  9. mode="aspectFill"></image>
  10. </view>
  11. <view class="userInfo" @click="gotoMineEdit">
  12. <view class="infoTextone">
  13. <text class="twoZ-font">{{ !username ? '未登录' : username }}</text>
  14. <!-- <span v-if="isManage!==''" class="manage bq-font">管理员</span> -->
  15. </view>
  16. <view class="infoTexttwo">
  17. <text style="font-size: 26rpx;font-weight: 400;line-height: 42rpx;color: #999999;">
  18. {{signature!=='' ? signature : '个性签名' }}
  19. </text>
  20. <!-- <text style="font-size: 26rpx;font-weight: 400;line-height: 42rpx;color: #999999;"></text> -->
  21. </view>
  22. </view>
  23. <!-- <view class="msgInfo">
  24. <view class="msgImg" @click="goMsg">
  25. 消息
  26. </view>
  27. </view> -->
  28. </view>
  29. <view class="userOptionsBox">
  30. <view class="optionsItemBox">
  31. <!-- <view class="optionItem" @click="goToSub(1)">
  32. <view class="option_left">
  33. <span class="option_icon">
  34. <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/Subscribe.png" mode="aspectFill">
  35. </image>
  36. </span>
  37. <text class="option_text fwb-font">我的订阅</text>
  38. </view>
  39. <view class="option_right">
  40. <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/arrow-right.png" mode="aspectFill">
  41. </image>
  42. </view>
  43. </view> -->
  44. <view class="optionItem" @click="goMsg">
  45. <view class="option_left">
  46. <view class="option_icon">
  47. <image style="width: 80%;height: 80%;" src="../../static/Vectorldang.png" mode="aspectFill">
  48. </image>
  49. </view>
  50. <text class="option_text fwb-font">我的消息</text>
  51. </view>
  52. <view class="option_right">
  53. <view class="msgq" v-if="msgn>0">
  54. {{msgn}}
  55. </view>
  56. <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/arrow-right.png" mode="aspectFill">
  57. </image>
  58. </view>
  59. </view>
  60. <view class="optionItem" @click="gotoMineCollect">
  61. <view class="option_left">
  62. <span class="option_icon">
  63. <image src="https://teacherapi.cocorobo.cn/teaching-file/static/mine/Collect.png" mode="aspectFill">
  64. </image>
  65. </span>
  66. <text class="option_text fwb-font">我的收藏</text>
  67. </view>
  68. <view class="option_right">
  69. <image src="https://teacherapi.cocorobo.cn/teaching-file/static/mine/arrow-right.png" mode="aspectFill">
  70. </image>
  71. </view>
  72. </view>
  73. <view class="optionItem" @click="gotoMineActive">
  74. <view class="option_left">
  75. <span class="option_icon">
  76. <image src="https://teacherapi.cocorobo.cn/teaching-file/static/mine/active.png" mode="aspectFill">
  77. </image>
  78. </span>
  79. <text class="option_text fwb-font">我的活动</text>
  80. </view>
  81. <view class="option_right">
  82. <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/arrow-right.png" mode="aspectFill">
  83. </image>
  84. </view>
  85. </view>
  86. <!-- <view class="optionItem" @click="gotoMineClass">
  87. <view class="option_left">
  88. <span class="option_icon">
  89. <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/myClass.png" mode="aspectFill">
  90. </image>
  91. </span>
  92. <text class="option_text fwb-font">我的教研室</text>
  93. </view>
  94. <view class="option_right">
  95. <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/arrow-right.png" mode="aspectFill">
  96. </image>
  97. </view>
  98. </view> -->
  99. <!-- <view class="optionItem" @click="gotomyRelease">
  100. <view class="option_left">
  101. <span class="option_icon">
  102. <image src="https://teacherapi.cocorobo.cn/teaching-file/static//fabu.png" mode="aspectFill">
  103. </image>
  104. </span>
  105. <text class="option_text fwb-font">我的发布</text>
  106. </view>
  107. <view class="option_right">
  108. <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/arrow-right.png" mode="aspectFill">
  109. </image>
  110. </view>
  111. </view> -->
  112. </view>
  113. <view class="optionsItemBox">
  114. <view class="optionItem">
  115. <view class="option_left">
  116. <span class="option_icon">
  117. <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/help.png" mode="aspectFill">
  118. </image>
  119. </span>
  120. <text class="option_text fwb-font">反馈帮助</text>
  121. </view>
  122. <view class="option_right">
  123. <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/arrow-right.png" mode="aspectFill">
  124. </image>
  125. </view>
  126. </view>
  127. <view class="optionItem" @click="gotoMineEdit">
  128. <view class="option_left">
  129. <span class="option_icon">
  130. <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/setting.png" mode="aspectFill">
  131. </image>
  132. </span>
  133. <text class="option_text fwb-font">我的设置</text>
  134. </view>
  135. <view class="option_right">
  136. <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/arrow-right.png" mode="aspectFill">
  137. </image>
  138. </view>
  139. </view>
  140. <!-- <beUpload @getFile="getFile" :navName="'上传文件'" :accept="accept" :progress="progress">111</beUpload> -->
  141. </view>
  142. </view>
  143. </view>
  144. </view>
  145. </template>
  146. <script>
  147. export default {
  148. data() {
  149. return {
  150. accept: "*",
  151. progress: {
  152. value: 50,
  153. show: false,
  154. },
  155. navBarData: {
  156. title: '我的',
  157. btn: 0
  158. },
  159. msgn:0,
  160. // 用户名
  161. username: '',
  162. // 头像
  163. userAvatar: 'https://teacherapi.cocorobo.cn/teaching-file/static/mine/Avatar.png',
  164. // 学校
  165. signature:'',
  166. isManage: ''
  167. };
  168. },
  169. methods: {
  170. // 我的收藏
  171. gotoMineCollect() {
  172. uni.navigateTo({
  173. // url: '/pages/mineCollect/mineCollect'
  174. url:'/pages/mineCollNew/mineCollNew'
  175. })
  176. },
  177. // 我的设置
  178. gotoMineEdit() {
  179. uni.navigateTo({
  180. url: '/pages/mineEdit/mineEdit'
  181. })
  182. },
  183. // 我的活动
  184. gotoMineActive() {
  185. uni.navigateTo({
  186. url: '/pages/mineActive/mineActive'
  187. })
  188. },
  189. // 信息
  190. goMsg(){
  191. uni.navigateTo({
  192. url: '/pages/msg/msg'
  193. })
  194. },
  195. // 获取未读信息
  196. getMag() {
  197. this.$request('/selectAllMessage', "POST", {
  198. oid: this.$store.state.user.openid
  199. }).then(res => {
  200. console.log('获取未读信息',res[0][0].msg);
  201. let num = res[0][0].msg
  202. this.msgn=num
  203. if (num == 0) {
  204. uni.hideTabBarRedDot({
  205. index: 3
  206. })
  207. } else {
  208. uni.setTabBarBadge({
  209. index: 3,
  210. text: num.toString()
  211. })
  212. }
  213. })
  214. }
  215. // 我的发布
  216. // gotomyRelease() {
  217. // const value = this.$store.state.user.openid;
  218. // if (value == '') {
  219. // uni.navigateTo({
  220. // url: "/pages/login_Wechat/login_Wechat",
  221. // });
  222. // } else {
  223. // uni.navigateTo({
  224. // url: '/pages/mineRelease/mineRelease'
  225. // })
  226. // }
  227. // },
  228. // 我的订阅
  229. // goToSub(i) {
  230. // uni.navigateTo({
  231. // url: '/pages/mineSubscribe/mineSubscribe'
  232. // });
  233. // },
  234. // 我的教研室
  235. // gotoMineClass() {
  236. // uni.navigateTo({
  237. // url: '/pages/mineClass/mineClass'
  238. // })
  239. // },
  240. },
  241. onShow() {
  242. this.getMag() // 调用app.js中的方法
  243. console.log(this.$store.state);
  244. this.userAvatar = this.$store.state.user.avatar;
  245. this.username = this.$store.state.user.username;
  246. // 学校
  247. this.signature=this.$store.state.user.school==null?'':this.$store.state.user.school;
  248. // this.isManage = this.$store.state.user.openid;
  249. // console.log(this.isManage == "");
  250. }
  251. };
  252. </script>
  253. <style lang="scss" scoped>
  254. .mineBox {
  255. width: 100%;
  256. // 头像信息
  257. .userInformation {
  258. width: 100%;
  259. height: 100px;
  260. padding: 0 18px;
  261. background-color: white;
  262. display: flex;
  263. justify-content: flex-start;
  264. align-items: center;
  265. .userAvatar {
  266. flex: 1;
  267. // height: 80%;
  268. display: flex;
  269. align-items: center;
  270. image {
  271. width: 128rpx;
  272. height: 128rpx;
  273. border-radius: 50%;
  274. }
  275. }
  276. .userInfo {
  277. margin-left: 10px;
  278. flex: 4;
  279. height: 80%;
  280. display: flex;
  281. flex-direction: column;
  282. justify-content: space-evenly;
  283. .infoTextone {
  284. display: flex;
  285. align-items: center;
  286. span {
  287. &:first-child {
  288. color: #000;
  289. // font-size: 40rpx;
  290. font-weight: 600;
  291. }
  292. &.manage {
  293. border: 1px #ffa338 solid;
  294. // font-size: 11px;
  295. display: flex;
  296. white-space: nowrap;
  297. justify-content: center;
  298. align-items: center;
  299. padding: 2px 4px;
  300. border-radius: 3px;
  301. margin-right: 10rpx;
  302. color: #ffa338;
  303. margin-left: 5px;
  304. }
  305. }
  306. }
  307. .infoTexttwo {
  308. span {
  309. color: rgb(153, 153, 153);
  310. // font-size: 26rpx;
  311. }
  312. }
  313. }
  314. .msgInfo{
  315. width: 70rpx;
  316. position: relative;
  317. height: 80%;
  318. .msgImg{
  319. position: absolute;
  320. top: 0;
  321. right: 0;
  322. width: 64rpx;
  323. height: 64rpx;
  324. }
  325. }
  326. }
  327. // 个人资料选项
  328. .userOptionsBox {
  329. width: 100%;
  330. margin-top: 10px;
  331. .optionsItemBox {
  332. background-color: #fff;
  333. width: 100%;
  334. margin-bottom: 10px;
  335. padding: 5px 23px;
  336. .optionItem {
  337. display: flex;
  338. justify-content: space-between;
  339. align-items: center;
  340. height: 81rpx;
  341. // font-size: 28rpx;
  342. .option_left {
  343. display: flex;
  344. align-items: center;
  345. height: 40rpx;
  346. .option_icon {
  347. height: 100%;
  348. width: 40rpx;
  349. image {
  350. width: 100%;
  351. height: 100%;
  352. }
  353. }
  354. .option_text {
  355. margin-left: 10px;
  356. color: rgba(0, 0, 0, 0.8);
  357. }
  358. }
  359. .option_right {
  360. height: 40rpx;
  361. display: flex;
  362. align-items: center;
  363. .msgq{
  364. width: 32rpx;height: 32rpx;background-color:rgba(213, 73, 65, 1);border-radius: 50rpx;
  365. color: #fff;
  366. font-size: 20rpx;
  367. display: flex;justify-content: center;align-items: center;
  368. }
  369. image {
  370. height: 34rpx;
  371. width: 30rpx;
  372. margin-left: 20rpx;
  373. }
  374. }
  375. }
  376. }
  377. }
  378. }
  379. </style>