微信壁纸小程序搭建,uniapp版本

        这是一个用uniapp 写的微信壁纸小程序,ui框架采用uview,支持流量主banner广告、激励视频广告、视频广告。

        小程序用积分限制用户无限制下载,用户可以通过看激励广告直接无消耗下载壁纸。

        用户可通过签到、分享小程序和积分兑换码获得积分,其中签到时,看激励广告可以获得3倍积分。

        小程序配备登录功能,将用户名和图片名存入数据库,将用户头像存入azure云储存中,不占用服务器空间。

页面展示如下:

首页

部分代码展示:

<template>
	<view>
		<view>
			<home v-if="PageCur=='0'" ref="home"></home>
			<category v-if="PageCur=='1'" ref="category"></category>
			<search v-if="PageCur=='2'" ref="search"></search>
			<mine v-if="PageCur=='3'" ref="mine"></mine>
		</view>
		<view class="tabbar">
			<u-tabbar :value="PageCur" @change="change1"  :fixed="true" :placeholder="true" :safeAreaInsetBottom="false">
				<u-tabbar-item text="首页" icon="home"></u-tabbar-item>
				<u-tabbar-item text="分类" icon="tags"></u-tabbar-item>
				<u-tabbar-item text="搜索" icon="search"></u-tabbar-item>
				<u-tabbar-item text="我的" icon="account"></u-tabbar-item>
			</u-tabbar>
		</view>
	</view>
</template>

<script>
	var App = require("@/common.js");
	import home from "@/pages/index/index.vue"; //首页
	import category from "@/pages/category/category.vue"; //首页
	import search from "@/pages/search/search.vue"; //搜索页
	import mine from "@/pages/mine/mine.vue"; //搜索页
	export default {
		components: {
			home,
			category,
			search,
			mine
		},

		data() {
			return {
				PageCur: 0,
				map1: [
					"首页",
					"分类",
					"搜索",
					"我的"
				],
			}
		},
		mounted() {
			let _this = this;
			_this.wxlogin();
		},
		methods: {
			change1(name) {
				this.PageCur = name;
				uni.setNavigationBarTitle({
					title: this.map1[name]
				});
			},
			async userLogin(code) {
				const res = await App._getRequest({
					url: '/getSettingAndUserInfo?code=' + code,
					method: 'GET'
				});
				if (res.data["code"] === 200) {
					uni.setStorageSync("userinfo",res.data["data"]["userinfo"])
					uni.setStorageSync("setting",res.data["data"]["setting"])
					uni.setStorageSync("share",res.data["data"]["share_setting"])
				} else {
					uni.showToast({
						icon: "error",
						title: "服务器问题",
					})
					uni.clearStorageSync();
				}
			},
			wxlogin() {
				let _this = this;
				wx.login({
					provider: 'weixin',
					onlyAuthorize: true,
					success: (logincode) => {
						_this.userLogin(logincode.code)
					},
					fail(err) {
						uni.showToast({
							icon: "error",
							title: err.errMsg,
						})
					}
				})
			}
		},
	}
</script>

<style>
</style>

源码获取可见我的gitee: 微信壁纸小程序uniapp: 这是一个用uniapp 写的微信壁纸小程序,ui框架采用uview,支持流量主banner广告、激励视频广告、视频广告。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

LLGululu

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值