123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- <template>
- <view class="container">
- <view class="main">
- <view class="flex-y-center main-home" @click="choice" :data-url='item.url' :data-type='item.type' :data-id='item.id'
- :data-index="index" v-for="(item,index) in list" :key="item.id">
- <view class="main-icon">
- <i class="iconfont iconxuanzhong" v-if="checked==index"></i>
- <i class="iconfont iconweixuanzhong" v-else style="color:#bfbfbf"></i>
- </view>
-
- <view :data-index='index' class="item flex-row">
- <image src="../../static/images/icon_game.png" mode="aspectFit" class="type-img" v-if="item.type == 7"></image>
- <image src="../../static/images/icon_6.png" mode="aspectFit" class="type-img" v-if="item.type == 4"></image>
- <image src="../../static/images/icon_5.png" mode="aspectFit" class="type-img" v-if="item.type == 3"></image>
- <image src="../../static/images/icon_2.png" mode="aspectFit" class="type-img" v-if="item.type == 2"></image>
- <image src="../../static/images/icon_4.png" mode="aspectFit" class="type-img" v-if="item.type == 1"></image>
- <image src="../../static/images/icon_7.png" mode="aspectFit" class="type-img" v-if="item.type == 6"></image>
- <view class="info">
- <view class="title text-1" v-if="item.description">{{item.description}}</view>
- <view class="desc flex-row-between">
- <view class="time content">{{item.url}}</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- list: [
- ],
- page: 1,
- checked:-1,
- }
- },
-
- onLoad() {
- uni.setNavigationBarTitle({
- title:`${this.$test.$test}列表`
- })
- this.page = 1;
- this.list = [];
-
- this.funeng_list();
- },
- onShow() {
-
- },
- onReachBottom(e) {
- this.funeng_list()
- },
- methods: {
-
- choice(e) {
- let id= e.currentTarget.dataset.id,type= e.currentTarget.dataset.type;
- this.checked = e.currentTarget.dataset.index;
- var url= e.currentTarget.dataset.url;
- var pages = getCurrentPages();
- var currPage = pages[pages.length - 1]; //当前页面
- var prevPage = pages[pages.length - 2]; //上一个页面
- //可以打印prevPage看看
- console.log(prevPage)
- //h5的写法
- // #ifdef H5
- prevPage.save_url=url;
- prevPage.id=id;
- prevPage.type=type;
- prevPage.code_url=url;
-
- // #endif
- // #ifdef MP-WEIXIN
- //小程序的写法 具体要怎么写可以打印一下prevPage看一下
- prevPage.$vm.save_url=url;
- prevPage.$vm.code_url=url;
- prevPage.$vm.id=id;
- prevPage.$vm.type=type;
- // #endif
- uni.navigateBack();
- },
-
- viewRecords(e) {
- var index = e.currentTarget.dataset.index,
- card_num = this.list[index].card_num,
- type = this.list[index].type;
- uni.navigateTo({
- url: "../viewRecords/viewRecords?card_num=" + card_num + '&type=' + type
- })
- },
- funeng_list() {
- this.request({
- url: "user/funeng_list",
- data: {
- page: this.page,
- token: uni.getStorageSync("token"),
- },
- }).then(res => {
- console.log(res, "res")
- if (res.code === '200') {
- // for(var i of res.data){
- // i.checked=false;
- // }
- this.list = this.list.concat(res.data);
- this.page = this.page + 1;
- }
- });
- }
- }
- }
- </script>
- <style>
- page {
- background: #F9F9F9;
- }
- .content {
- word-wrap: break-word;
- word-break: break-all;
- }
- .iconxuanzhong {
- color: #007AFF;
- }
- .header {
- width: 100%;
- height: 198rpx;
- position: relative;
- }
- .header .bg-img {
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- z-index: -1;
- width: 100%;
- height: 198rpx;
- }
- .header .info {
- width: 100%;
- height: 100%;
- display: flex;
- flex-flow: row nowrap;
- justify-content: center;
- align-items: center;
- }
- .header .info .num {
- font-size: 70rpx;
- font-weight: 700;
- font-family: DIN Alternate, DIN Alternate-Bold;
- color: #fff;
- line-height: 1;
- }
- .header .info .desc {
- font-size: 32rpx;
- line-height: 1;
- color: #fff;
- margin-top: 39rpx;
- }
- .main {
- /* background-color: #fff; */
- border-radius: 20rpx 20rpx 0 0;
- margin-top: 20rpx;
- padding: 20rpx 40rpx 0;
- }
- .main .page-title {
- padding: 28rpx 0 40rpx;
- }
- .main .page-title .title {
- font-size: 36rpx;
- color: #262626;
- line-height: 50rpx;
- font-weight: 600;
- }
- .main .item {
- background-color: #fff;
- border-radius: 8rpx;
- padding: 20rpx 32rpx 20rpx 34rpx;
- width: 606rpx;
- }
- .main-home {
- margin-bottom: 40rpx;
- }
- .main .item .type-img {
- display: block;
- flex: none;
- width: 40rpx;
- height: 40rpx;
- margin-right: 26rpx;
- }
- .main .item .info {
- flex: auto;
- }
- .main .item .info .title {
- /* width: 538rpx; */
- font-size: 30rpx;
- font-weight: 500;
- color: #323232;
- line-height: 42rpx;
- margin-bottom: 16rpx;
- }
- .main .item .info .desc {
- /* margin-top: 16rpx; */
- }
- .main .item .info .num {
- font-size: 28rpx;
- font-weight: 400;
- color: #3387FF;
- line-height: 40rpx;
- }
- .main .item .info .time {
- font-size: 28rpx;
- font-weight: 400;
- color: #999;
- line-height: 40rpx;
- }
- .main-icon {
- margin-right: 33rpx;
- }
- .main-icon .iconfont{
- font-size: 38rpx;
- }
- </style>
|