mypoints.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  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>{{myMsg.integral_able}}</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 {recordInfo} from "../../../api/notice.js"
  164. import {getAccountInfo} from "@/api/login.js"
  165. export default{
  166. data(){
  167. return{
  168. config: {
  169. back: true, //false是tolbar页面 是则不写
  170. title: '我的积分',
  171. color: '#1A1A1A',
  172. //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
  173. backgroundColor: [1, "#FFFFFF"],
  174. statusBarFontColor: '#1A1A1A',
  175. },
  176. myMsg:{}, //我的个人信息
  177. integral:{}, //我的积分
  178. imgUrl: this.$mConfig.staticUrl,
  179. id: 0
  180. }
  181. },
  182. onShow() {
  183. this.getMyList()
  184. this.getMyMsg()
  185. this.getuserInfo()
  186. },
  187. methods:{
  188. getuserInfo(){
  189. let shop = uni.getStorageSync('shop')
  190. this.$http.get('/account/getAccountInfo/'+shop.id).then(async res => {
  191. if (res && res.code == 200) {
  192. this.id =res.data.id
  193. }
  194. })
  195. },
  196. //跳个人主页
  197. goToCommunity(){
  198. let that = this
  199. uni.navigateTo({
  200. url:"/pages/research/community/homepage?user_id=" + that.id
  201. })
  202. },
  203. //跳研吧
  204. goToRecommend(){
  205. // uni.navigateTo({
  206. // url:"/pages/index/recommend"
  207. // })
  208. },
  209. //跳主页
  210. goToHomePage(){
  211. uni.redirectTo({
  212. url:"/pages/index/lidaPage"
  213. })
  214. },
  215. //跳转积分明细
  216. goTodetailed(){
  217. uni.navigateTo({
  218. url:"./pointsDetails"
  219. })
  220. },
  221. //获取积分接口
  222. getMyList(){
  223. this.$http.get(recordInfo).then(res=>{
  224. if(res&&res.code==200){
  225. this.integral = res.data
  226. console.log(this.integral)
  227. }
  228. })
  229. },
  230. //获取我的信息
  231. getMyMsg(){
  232. this.$http.get(getAccountInfo).then(res=>{
  233. if(res&&res.code==200){
  234. this.myMsg = res.data
  235. }
  236. })
  237. }
  238. }
  239. }
  240. </script>
  241. <style lang="scss" scoped>
  242. .content{
  243. background-color: #ffffff;
  244. border-radius: 40rpx 40rpx 0 0;
  245. padding: 38rpx 30rpx 0;
  246. .content-item{
  247. display: flex;
  248. justify-content: space-between;
  249. align-items: center;
  250. border-bottom: 1rpx solid #E6E6E6;
  251. padding-bottom: 36rpx;
  252. .purchase{
  253. .purchase-commodity{
  254. margin-top: 30rpx;
  255. font-size: 28rpx;
  256. color: #1A1A1A;
  257. font-weight: 400;
  258. }
  259. .introduce{
  260. font-size: 24rpx;
  261. margin-top: 17rpx;
  262. color: #999999;
  263. font-weight: 400;
  264. line-height: 30rpx;
  265. }
  266. }
  267. .complete{
  268. color: #ffffff;
  269. font-size: 28rpx;
  270. font-weight: 500;
  271. padding: 12rpx 35rpx;
  272. border-radius: 32rpx;
  273. background-color: rgb(64,194,213);
  274. }
  275. }
  276. .content-top{
  277. display: flex;
  278. align-items: center;
  279. .task{
  280. font-size: 36rpx;
  281. color: #1A1A1A;
  282. font-weight: 700;
  283. }
  284. .line{
  285. width: 1rpx;
  286. height: 32rpx;
  287. background-color: #707070;
  288. margin: 16rpx;
  289. }
  290. .do{
  291. font-size: 24rpx;
  292. font-weight: 400;
  293. color: #666666;
  294. }
  295. }
  296. }
  297. .mypoints{
  298. background-color: #F5F5F5;
  299. }
  300. .top{
  301. // margin: 25rpx 30rpx 0 30rpx ;
  302. padding: 25rpx 30rpx 0;
  303. .top-item{
  304. background-color: rgb(64,194,213);
  305. // background-repeat: no-repeat;
  306. // border-radius: 18rpx;
  307. border-top-right-radius: 18rpx;
  308. border-top-left-radius: 18rpx;
  309. padding: 30rpx 20rpx;
  310. .available{
  311. text-align: center;
  312. color: #ffffff;
  313. // margin-top: 50rpx;
  314. .available-name{
  315. margin-bottom: 6rpx;
  316. font-size: 30rpx;
  317. font-weight: 400;
  318. line-height: 24rpx;
  319. // text-shadow: 0rpx 11rpx 49rpx #2A0709;
  320. }
  321. .available-number{
  322. font-size: 28rpx;
  323. font-weight: 700;
  324. color: #FFFFFF;
  325. text{
  326. font-size: 50rpx;
  327. }
  328. }
  329. }
  330. .own{
  331. display: flex;
  332. align-items: center;
  333. .image{
  334. image{
  335. width: 86rpx;
  336. height: 86rpx;
  337. border-radius: 50%;
  338. }
  339. }
  340. .name{
  341. flex: 1;
  342. margin-left: 20rpx;
  343. font-size: 36rpx;
  344. font-weight: 400;
  345. color: #ffffff;
  346. }
  347. .detailed{
  348. font-size: 24rpx;
  349. // line-height: 30rpx;
  350. color: rgb(64,194,213);
  351. font-weight: 400;
  352. // padding: 10rpx 30rpx 14rpx ;
  353. background-color: #ffffff;
  354. border-radius: 28rpx;
  355. display: flex;
  356. align-items: center;
  357. justify-content: center;
  358. width: 195rpx;
  359. height: 55rpx;
  360. .iconfont{
  361. font-size: 30rpx;
  362. margin-right: 16rpx;
  363. }
  364. }
  365. }
  366. }
  367. }
  368. </style>