task.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. <template>
  2. <view class="">
  3. <view class="top-wrap">
  4. <view class="user-calling">
  5. <view class="calling">
  6. <image class="avatar" :src="userInfo.avatar" mode="" v-if="userInfo.avatar"></image>
  7. <image class="avatar" src="../../static/error/missing-face.png" mode="" v-else></image>
  8. <view class="u-name">
  9. {{userInfo.phone}}
  10. </view>
  11. <image class="user-shop-icon" v-if="pUser.zero_level" :src="pUser.zero_level.icon" mode=""></image>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="flex banne">
  16. <image src="../../static/img/jfc.png" mode="" @click="navto('/pages/zero/award?type=9')"></image>
  17. <image src="../../static/img/scjf.png" mode="" @click="navto('/pages/zero/award?type=10')"></image>
  18. </view>
  19. <view class="gg-wrap flex">
  20. <image src="../../static/icon/jiang.png" mode=""></image>
  21. <view class="gg-tit">
  22. <view class="tit">
  23. 观看视频赚阅读积分
  24. </view>
  25. <view class="">
  26. 观看可获得阅读积分
  27. </view>
  28. </view>
  29. <view class="gg-btn" @click="navto('/pages/zero/ren')">
  30. 去观看
  31. </view>
  32. </view>
  33. <view class="bottom-list" v-for="key in navList">
  34. <view class="flex list-item">
  35. <view class="logo-wrap" :style="{'background-color': key.bgc}">
  36. <image :src="key.img" mode="" class="logo"></image>
  37. </view>
  38. <view class="much">
  39. <view class="">
  40. {{key.name}}
  41. </view>
  42. <view class="val">
  43. 余额:{{pUser[key.val]*1 || '0'}}
  44. </view>
  45. </view>
  46. <view class="btn" v-if="key.hz" @click="navto('/pages/zero/jfhz?type=3')">
  47. 兑换余额宝
  48. </view>
  49. <!-- <view class="btn" v-if="key.gs" @click="navto('/pages/zero/gs')">
  50. 挂售
  51. </view> -->
  52. <view class="btn" v-if="key.dy" @click="navto('/pages/zero/jfhz?type=0')">
  53. 兑换阅读积分
  54. </view>
  55. <view class="btn" v-if="key.agent" @click="navto('/pages/zero/jfhz?type=1')">
  56. 兑换复投积分
  57. </view>
  58. <!-- <view class="btn" v-if="key.ygs" @click="navto('/pages/zero/gs?type=1')"> -->
  59. <view class="btn" v-if="key.ygs" @click="openT">
  60. 挂售/买入
  61. </view>
  62. <view class="btn" v-if="key.ye" @click="navto('/pages/zero/jfhz?type=2')">
  63. 兑换阅读积分
  64. </view>
  65. <view class="more" @click="navto('/pages/user/sz?type=' + key.type)">
  66. 明细
  67. </view>
  68. <image src="../../static/icon/back.png" mode="" class="black"></image>
  69. </view>
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. import {
  75. mapState,
  76. mapMutations
  77. } from 'vuex';
  78. import {
  79. passUser
  80. } from '@/api/zero.js'
  81. import {
  82. getUserInfo,
  83. getLevelList
  84. } from '@/api/user.js';
  85. export default {
  86. data() {
  87. return {
  88. pUser: {},
  89. listList: [],
  90. navList: [{
  91. name: '阅读积分',
  92. val: 'points',
  93. type: 8,
  94. hz: true,
  95. gs: true,
  96. dy: false,
  97. agent: false,
  98. img: '../../static/icon/task1.png',
  99. bgc: '#fef2f2'
  100. },
  101. {
  102. name: '通证',
  103. val: 'pass',
  104. type: 9,
  105. gs: false,
  106. hz: false,
  107. dy: true,
  108. agent: false,
  109. img: '../../static/icon/task2.png',
  110. bgc: '#fcf7e3'
  111. },
  112. {
  113. name: '商场积分',
  114. val: 'integral',
  115. type: 10,
  116. hz: false,
  117. dy: false,
  118. agent: true,
  119. img: '../../static/icon/task3.png',
  120. bgc: '#f7ecfc'
  121. },
  122. {
  123. name: '余额宝',
  124. val: 'freeze_points',
  125. type: 11,
  126. hz: false,
  127. dy: false,
  128. agent: false,
  129. ye: true,
  130. ygs: true,
  131. img: '../../static/icon/yeb.png',
  132. bgc: '#fcf5eb'
  133. },
  134. ]
  135. }
  136. },
  137. computed: {
  138. ...mapState('user', ['userInfo', 'hasLogin'])
  139. },
  140. onShow() {
  141. this.getLevelList()
  142. this.passUser()
  143. },
  144. methods: {
  145. openT() {
  146. uni.showActionSheet({
  147. itemList:['挂售','买入'],
  148. success(e) {
  149. console.log(e.tapIndex)
  150. if(e.tapIndex == 0) {
  151. uni.navigateTo({
  152. url:'/pages/zero/gs?type=1'
  153. })
  154. }else {
  155. uni.navigateTo({
  156. url:'/pages/zero/gs?type=3'
  157. })
  158. }
  159. }
  160. })
  161. },
  162. passUser() {
  163. passUser().then(res => {
  164. // console.log(res);
  165. this.pUser = res.data
  166. })
  167. },
  168. getLevelList() {
  169. getLevelList().then(res => {
  170. this.listList = res.data.list
  171. })
  172. },
  173. showLevel(val) {
  174. let data = this.listList.find(item => item.grade == val)
  175. console.log(data);
  176. if (data) {
  177. return data.icon
  178. } else {
  179. return ''
  180. }
  181. },
  182. navto(url) {
  183. uni.navigateTo({
  184. url,
  185. fail() {
  186. uni.switchTab({
  187. url
  188. })
  189. }
  190. })
  191. },
  192. }
  193. }
  194. </script>
  195. <style lang="scss" scoped>
  196. page {
  197. background-color: #fff;
  198. min-height: 100%;
  199. }
  200. .top-wrap {
  201. // height: 260rpx;
  202. padding-top: 220rpx;
  203. background-color: #282623;
  204. }
  205. .user-calling {
  206. height: 115rpx;
  207. border-radius: 50rpx 50rpx 0 0;
  208. background-color: #fff;
  209. position: relative;
  210. }
  211. .calling {
  212. width: 720rpx;
  213. height: 190rpx;
  214. position: absolute;
  215. left: 0;
  216. right: 0;
  217. top: -110rpx;
  218. background-image: url('../../static/img/calling.png');
  219. background-size: contain;
  220. margin: auto;
  221. .avatar {
  222. width: 106rpx;
  223. height: 106rpx;
  224. border-radius: 50%;
  225. position: absolute;
  226. top: 40rpx;
  227. left: 48rpx;
  228. }
  229. .u-name {
  230. position: absolute;
  231. top: 57rpx;
  232. left: 193rpx;
  233. font-size: 36rpx;
  234. font-weight: bold;
  235. color: #773B00;
  236. }
  237. .user-shop-icon {
  238. position: absolute;
  239. top: 110rpx;
  240. left: 193rpx;
  241. width: 120rpx;
  242. height: 40rpx;
  243. }
  244. }
  245. .banne {
  246. justify-content: center;
  247. padding: 20rpx 0;
  248. background-color: #fff;
  249. image {
  250. width: 340rpx;
  251. height: 204rpx;
  252. margin: 0 8rpx;
  253. }
  254. }
  255. .bottom-list {
  256. .list-item {
  257. width: 670rpx;
  258. height: 131rpx;
  259. // background-color: red;
  260. border-bottom: 1px solid #E8E8E8;
  261. margin: auto;
  262. .logo-wrap {
  263. width: 81rpx;
  264. height: 81rpx;
  265. border-radius: 50%;
  266. display: flex;
  267. justify-content: center;
  268. align-items: center;
  269. .logo {
  270. width: 40rpx;
  271. height: 40rpx;
  272. }
  273. }
  274. .much {
  275. padding-left: 14rpx;
  276. flex-grow: 1;
  277. font-size: 30rpx;
  278. font-weight: bold;
  279. color: #333333;
  280. .val {
  281. padding-top: 15rpx;
  282. font-size: 22rpx;
  283. font-weight: 500;
  284. color: #999999;
  285. }
  286. }
  287. .btn {
  288. // width: 127rpx;
  289. height: 52rpx;
  290. padding: 0 10px;
  291. border: 2px solid #ff5050;
  292. border-radius: 26rpx;
  293. display: flex;
  294. justify-content: center;
  295. align-items: center;
  296. font-size: 26rpx;
  297. font-weight: 500;
  298. color: #ff5050;
  299. margin-right: 10rpx;
  300. }
  301. .more {
  302. font-size: 24rpx;
  303. font-weight: 500;
  304. color: #999999;
  305. padding-right: 14rpx;
  306. }
  307. .black {
  308. width: 16rpx;
  309. height: 27rpx;
  310. }
  311. }
  312. }
  313. .gg-wrap {
  314. width: 702rpx;
  315. height: 140rpx;
  316. background: #FEFEFE;
  317. box-shadow: 0rpx 0rpx 29rpx 0rpx rgba(231, 71, 68, 0.09);
  318. border-radius: 4rpx;
  319. margin: 20rpx auto;
  320. padding: 30rpx 40rpx 40rpx 90rpx;
  321. position: relative;
  322. image {
  323. position: absolute;
  324. top: 0;
  325. left: 26rpx;
  326. width: 45rpx;
  327. height: 60rpx;
  328. }
  329. .gg-tit {
  330. font-size: 24rpx;
  331. font-weight: 500;
  332. color: #999999;
  333. .tit {
  334. padding-bottom: 20rpx;
  335. font-size: 32rpx;
  336. font-weight: bold;
  337. color: #333333;
  338. }
  339. }
  340. .gg-btn {
  341. width: 125rpx;
  342. height: 46rpx;
  343. background: linear-gradient(60deg, #FF8F3B, #FF3106);
  344. border-radius: 23rpx;
  345. font-size: 24rpx;
  346. font-weight: 500;
  347. color: #FFFFFF;
  348. text-align: center;
  349. line-height: 45rpx;
  350. }
  351. }
  352. </style>