mypoints.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. <template>
  2. <view class="mypoints">
  3. <navbar ref="navbar" :config="config" backColor="#666"></navbar>
  4. <view class="top">
  5. <view class="top-item">
  6. <view class="own">
  7. <!-- <view class="image" v-if="myMsg.head_photo">
  8. <image :src="myMsg.head_photo" mode=""></image>
  9. </view>
  10. <view class="image" v-else>
  11. <image :src="imgUrl+'/head-on.png'" mode=""></image>
  12. </view> -->
  13. <view class="name">
  14. {{myMsg.nickname}}
  15. </view>
  16. <view class="detailed" @click="goTodetailed()">
  17. <text class="iconfont">&#xe60a;</text>
  18. <div>积分明细</div>
  19. </view>
  20. </view>
  21. <view class="available">
  22. <view class="available-name">
  23. 可使用积分
  24. </view>
  25. <view class="available-number">
  26. <text>{{ integralNum }}</text>积分
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="content">
  32. <view class="content-top">
  33. <view class="task">
  34. 积分任务
  35. </view>
  36. <view class="line">
  37. </view>
  38. <view class="do">
  39. 做任务赚积分
  40. </view>
  41. </view>
  42. <view class="content-item">
  43. <view class="purchase">
  44. <view class="purchase-commodity">
  45. 购买商品
  46. </view>
  47. <view class="introduce">
  48. 购买商品越多,积分返利越多
  49. </view>
  50. </view>
  51. <view class="complete" @click="goToHomePage()">
  52. 立即完成
  53. </view>
  54. </view>
  55. <!-- <view class="content-item">
  56. <view class="purchase">
  57. <view class="purchase-commodity">
  58. 浏览作品/文章
  59. </view>
  60. <view class="introduce">
  61. {{integral.browse}}分/次,每天上限{{integral.browse_limit}}分
  62. </view>
  63. </view>
  64. <view class="complete" @click="goToRecommend()">
  65. 立即完成
  66. </view>
  67. </view>
  68. <view class="content-item">
  69. <view class="purchase">
  70. <view class="purchase-commodity">
  71. 点赞作品/文章
  72. </view>
  73. <view class="introduce">
  74. {{integral.like}}分/次,每天上限{{integral.like_limit}}分
  75. </view>
  76. </view>
  77. <view class="complete" @click="goToRecommend()">
  78. 立即完成
  79. </view>
  80. </view>
  81. <view class="content-item">
  82. <view class="purchase">
  83. <view class="purchase-commodity">
  84. 转发作品/文章
  85. </view>
  86. <view class="introduce">
  87. {{integral.share}}分/次,每天上限{{integral.share_limit}}分
  88. </view>
  89. </view>
  90. <view class="complete" @click="goToRecommend()">
  91. 立即完成
  92. </view>
  93. </view>
  94. <view class="content-item">
  95. <view class="purchase">
  96. <view class="purchase-commodity">
  97. 评论作品/文章
  98. </view>
  99. <view class="introduce">
  100. {{integral.comment}}分/每次提交评论,每天上限{{integral.comment_limit }}分
  101. </view>
  102. </view>
  103. <view class="complete" @click="goToRecommend()">
  104. 立即完成
  105. </view>
  106. </view>
  107. <view class="content-item">
  108. <view class="purchase">
  109. <view class="purchase-commodity">
  110. 作品被浏览
  111. </view>
  112. <view class="introduce">
  113. {{integral.by_browse}}分/次,单个作品/每天 上限{{integral.by_browse_limit}}分
  114. </view>
  115. </view>
  116. <view class="complete" @click="goToCommunity()">
  117. 立即完成
  118. </view>
  119. </view>
  120. <view class="content-item">
  121. <view class="purchase">
  122. <view class="purchase-commodity">
  123. 作品被点赞
  124. </view>
  125. <view class="introduce">
  126. {{integral.by_like}}分/次,单个作品/每天 上限{{integral.by_like_limit}}分
  127. </view>
  128. </view>
  129. <view class="complete" @click="goToCommunity()">
  130. 立即完成
  131. </view>
  132. </view>
  133. <view class="content-item">
  134. <view class="purchase">
  135. <view class="purchase-commodity">
  136. 作品被评论
  137. </view>
  138. <view class="introduce">
  139. {{integral.by_comment}}分/每次提交评论,单个作品/每天 上限{{integral.by_comment_limit}}分
  140. </view>
  141. </view>
  142. <view class="complete" @click="goToCommunity()">
  143. 立即完成
  144. </view>
  145. </view>
  146. <view class="content-item">
  147. <view class="purchase">
  148. <view class="purchase-commodity">
  149. 作品被转发
  150. </view>
  151. <view class="introduce">
  152. {{integral.by_share}}分/次,单个作品/每天 上限{{integral.by_share_limit}}分
  153. </view>
  154. </view>
  155. <view class="complete" @click="goToCommunity()">
  156. 立即完成
  157. </view>
  158. </view> -->
  159. </view>
  160. </view>
  161. </template>
  162. <script>
  163. import {
  164. recordInfo
  165. } from "../../../api/notice.js"
  166. import {
  167. getAccountInfo
  168. } from "@/api/login.js"
  169. import {
  170. myUserInfo
  171. } from "@/api/government.js"
  172. export default {
  173. data() {
  174. return {
  175. config: {
  176. back: true, //false是tolbar页面 是则不写
  177. title: '我的积分',
  178. color: '#1A1A1A',
  179. //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
  180. backgroundColor: [1, "#FFFFFF"],
  181. statusBarFontColor: '#1A1A1A',
  182. },
  183. myMsg: {}, //我的个人信息
  184. integral: {}, //我的积分
  185. imgUrl: this.$mConfig.staticUrl,
  186. id: 0,
  187. integralNum: 0
  188. }
  189. },
  190. onShow() {
  191. this.getMyList()
  192. this.getMyMsg()
  193. this.getuserInfo()
  194. },
  195. methods: {
  196. getuserInfo() {
  197. let shop = uni.getStorageSync('shop')
  198. this.$http.get('/account/getAccountInfo/' + shop.id).then(async res => {
  199. if (res && res.code == 200) {
  200. this.id = res.data.id
  201. }
  202. })
  203. myUserInfo().then(res => {
  204. this.integralNum = res.data.integralAble
  205. })
  206. },
  207. // integralNum
  208. //跳个人主页
  209. goToCommunity() {
  210. let that = this
  211. uni.navigateTo({
  212. url: "/pages/research/community/homepage?user_id=" + that.id
  213. })
  214. },
  215. //跳研吧
  216. goToRecommend() {
  217. // uni.navigateTo({
  218. // url:"/pages/index/recommend"
  219. // })
  220. },
  221. //跳主页
  222. goToHomePage() {
  223. uni.redirectTo({
  224. url: "/pages/index/lidaPage"
  225. })
  226. },
  227. //跳转积分明细
  228. goTodetailed() {
  229. uni.navigateTo({
  230. url: "./pointsDetails"
  231. })
  232. },
  233. //获取积分接口
  234. getMyList() {
  235. this.$http.get(recordInfo).then(res => {
  236. if (res && res.code == 200) {
  237. this.integral = res.data
  238. console.log(this.integral)
  239. }
  240. })
  241. },
  242. //获取我的信息
  243. getMyMsg() {
  244. this.$http.get(getAccountInfo).then(res => {
  245. if (res && res.code == 200) {
  246. this.myMsg = res.data
  247. }
  248. })
  249. }
  250. }
  251. }
  252. </script>
  253. <style lang="scss" scoped>
  254. .content {
  255. background-color: #ffffff;
  256. border-radius: 40rpx 40rpx 0 0;
  257. padding: 38rpx 30rpx 0;
  258. .content-item {
  259. display: flex;
  260. justify-content: space-between;
  261. align-items: center;
  262. border-bottom: 1rpx solid #E6E6E6;
  263. padding-bottom: 36rpx;
  264. .purchase {
  265. .purchase-commodity {
  266. margin-top: 30rpx;
  267. font-size: 28rpx;
  268. color: #1A1A1A;
  269. font-weight: 400;
  270. }
  271. .introduce {
  272. font-size: 24rpx;
  273. margin-top: 17rpx;
  274. color: #999999;
  275. font-weight: 400;
  276. line-height: 30rpx;
  277. }
  278. }
  279. .complete {
  280. color: #ffffff;
  281. font-size: 28rpx;
  282. font-weight: 500;
  283. padding: 12rpx 35rpx;
  284. border-radius: 32rpx;
  285. background-color: rgb(64, 194, 213);
  286. }
  287. }
  288. .content-top {
  289. display: flex;
  290. align-items: center;
  291. .task {
  292. font-size: 36rpx;
  293. color: #1A1A1A;
  294. font-weight: 700;
  295. }
  296. .line {
  297. width: 1rpx;
  298. height: 32rpx;
  299. background-color: #707070;
  300. margin: 16rpx;
  301. }
  302. .do {
  303. font-size: 24rpx;
  304. font-weight: 400;
  305. color: #666666;
  306. }
  307. }
  308. }
  309. .mypoints {
  310. background-color: #F5F5F5;
  311. }
  312. .top {
  313. // margin: 25rpx 30rpx 0 30rpx ;
  314. padding: 25rpx 30rpx 0;
  315. .top-item {
  316. background-color: rgb(64, 194, 213);
  317. // background-repeat: no-repeat;
  318. // border-radius: 18rpx;
  319. border-top-right-radius: 18rpx;
  320. border-top-left-radius: 18rpx;
  321. padding: 30rpx 20rpx;
  322. .available {
  323. text-align: center;
  324. color: #ffffff;
  325. // margin-top: 50rpx;
  326. .available-name {
  327. margin-bottom: 6rpx;
  328. font-size: 30rpx;
  329. font-weight: 400;
  330. line-height: 24rpx;
  331. // text-shadow: 0rpx 11rpx 49rpx #2A0709;
  332. }
  333. .available-number {
  334. font-size: 28rpx;
  335. font-weight: 700;
  336. color: #FFFFFF;
  337. text {
  338. font-size: 50rpx;
  339. }
  340. }
  341. }
  342. .own {
  343. display: flex;
  344. align-items: center;
  345. .image {
  346. image {
  347. width: 86rpx;
  348. height: 86rpx;
  349. border-radius: 50%;
  350. }
  351. }
  352. .name {
  353. flex: 1;
  354. margin-left: 20rpx;
  355. font-size: 36rpx;
  356. font-weight: 400;
  357. color: #ffffff;
  358. }
  359. .detailed {
  360. font-size: 24rpx;
  361. // line-height: 30rpx;
  362. color: rgb(64, 194, 213);
  363. font-weight: 400;
  364. // padding: 10rpx 30rpx 14rpx ;
  365. background-color: #ffffff;
  366. border-radius: 28rpx;
  367. display: flex;
  368. align-items: center;
  369. justify-content: center;
  370. width: 195rpx;
  371. height: 55rpx;
  372. .iconfont {
  373. font-size: 30rpx;
  374. margin-right: 16rpx;
  375. }
  376. }
  377. }
  378. }
  379. }
  380. </style>