小程序社区团购demo

概述

实现了用户登录或者手机号,加入团长,邀请团长,各种佣金明细等页面

详细

需求:

根据市场信息反馈,社区团购比较火,有流量的用户可以推广页面

实现了功能:

实现了用户微信登录自动获取手机号,加入团长,邀请团长,展示各种佣金明细等页面;

产品部分页面展示

image.png

image.png

产品目录

image.png

部分wxml代码

<view class="container">
<view class="my">
<view class="my-left" wx:if="{{phone!=''}}">
<view class="avater">
<open-data class="avater" type="userAvatarUrl"></open-data>
</view>
<view class="my-left-name">
<open-data class="wx-name"type="userNickName"></open-data>
<text>联系电话:{{phone}}</text>
<text>用户来源:鑫灿生态</text>
</view>
</view>
<view class="my-left" wx:else>
<image src="https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=387264399,2368088084&fm=26&gp=0.jpg">
</image>
<view class="my-left-name">
<button bindgetuserinfo="bindGetUserInfo" formType="submit" hoverClass="none" lang="zh_CN" openType="getUserInfo" style="width:150rpx;font-size:34rpx;font-weight:400;color:#892B1F"><text class="wx-name">授权登录</text></button>
</view>
</view>
<navigator hover-class="none" class="my-right" url="/pages/perfect/index">
<image src="../../static/img/vip.png"></image>
<text class="user-data">完善资料</text>
</navigator>
</view>
<view class="lists">
<navigator hover-class="none" url="/pages/team/index" class="list" style="background:#FEFAF2">
<image src="../../static/img/addteam.png"></image>
<text>加入团长</text>
</navigator>
<navigator hover-class="none" class="list" style="background:#EFF9F7">
<image src="../../static/img/share.png"></image>
<text>邀请团长 </text>
</navigator>
<navigator hover-class="none" url="/pages/perfect/index" class="list" style="background:#F2F6FE">
<image src="../../static/img/userdata.png"></image>
<text>完善资料</text>
</navigator>
<navigator hover-class="none" url="/pages/teamrecord/index" class="list" style="background:#FDF4F4">
<image src="../../static/img/record.png"></image>
<text>拓团明细</text>
</navigator>
<navigator hover-class="none" class="list" url="/pages/withdrawal/index" style="background:#FEFAF2">
<image src="../../static/img/yongjin.png"></image>
<text>佣金提现</text>
</navigator>
<navigator hover-class="none" class="list" url="/pages/bindnumber/index" style="background:#F4F2FE">
<image src="../../static/img/lianmen.png"></image>
<text>联盟编号</text>
</navigator>
<navigator hover-class="none" class="list" url="/pages/librarys/index" style="background:#F2F6FE">
<image src="../../static/img/dataku.png"></image>
<text>资料库</text>
</navigator>
<navigator hover-class="none" class="list" style="background:#FDF4F4">
<image src="../../static/img/news.png"></image>
<text>官方客服</text>
</navigator>
<navigator hover-class="none" url="/pages/commission/index" class="list" style="background:#FDF4F4">
<image src="../../static/img/yongjinmx.png"></image>
<text>佣金明细</text>
</navigator>
</view>
<view class="tost">
<view class="tost-txt">
<view style="font-weight:bold;color:#333333;font-size:34rpx">申请流程:</view>
<view class="tost-t">
步骤1: 为保证福建省颠倒是非回复收到回复河东狮吼兑换是非得失
</view>
<view class="tost-t">
步骤2: 为保证福建省颠倒是非回复收到回复河东狮吼兑换是非得失
</view>
<view style="font-weight:bold;color:red;font-size:34rpx;padding-top:20rpx">特别注意</view>
<view class="tost-t">
v第三方数据电脑手机辐射的发烧多少度师傅
</view>
</view>
</view>
<view class="model" wx:if="{{isShow}}">
<view class="model-content">
<view class="getphone">
社区团购拓客系统请求获取您的手机号
</view>
<button bindgetphonenumber="getPhoneNumber" hoverClass="none" open-type="getPhoneNumber" style="width:80%;font-size:34rpx;font-weight:400;color:#892B1F"><text class="wx-name">获取手机号</text></button>
</view>
</view>
</view>

部分css代码

.my {
background: #F7CC1D;
height: 211rpx;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 47rpx 0 34rpx 34rpx;
color: #6D4B30;
font-size: 24rpx;
box-sizing: border-box;
}
 
.avater {
width: 133rpx;
height: 133rpx;
border-radius: 50%;
overflow: hidden;
}
 
.my-left {
display: flex;
align-items: center;
}
 
.my-left image {
width: 133rpx;
height: 133rpx;
border-radius: 50%;
}
 
.my-left-name {
display: flex;
flex-flow: column;
padding-left: 27rpx;
}
 
.my-left-name button {
padding: 0;
background: transparent;
font-size: 34rpx;
}
 
.my-right {
width: 164rpx;
height: 45rpx;
background: #FFFFFF;
border-radius: 23rpx 0px 0px 23rpx;
display: flex;
align-items: center;
justify-content: center;
}
 
.my-right image {
width: 30rpx;
height: 30rpx;
}
 
.wx-name {
font-size: 34rpx;
}
 
.user-data {
padding-left: 10rpx;
}
 
.lists {
display: flex;
flex-wrap: wrap;
align-items: center;
padding: 17.5rpx;
}
 
.list {
display: flex;
flex-flow: column;
width: 28.6%;
justify-content: center;
align-items: center;
font-size: 26rpx;
color: #333333;
margin: 10rpx 17.5rpx 20rpx 17.5rpx;
width: 206rpx;
height: 206rpx;
border-radius: 10rpx;
}
 
.list image {
width: 100rpx;
height: 100rpx;
}
 
.tost {
padding: 20rpx 37rpx;
}
 
.tost-txt {
background: #FFFFFF;
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.1);
border-radius: 20px;
color: #666666;
padding: 32rpx;
font-size: 30rpx;
}
 
.tost-t {
display: flex;
padding-top: 20rpx;
}
 
.model {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 99;
}
 
.model-content {
width: 80%;
height: 500rpx;
background: #FFF;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border-radius: 30rpx;
padding:50rpx;
box-sizing: border-box;
position: relative;
display: flex;
flex-flow: column;
align-items: center;
color: #333333;
font-size: 32rpx;
}
.model-content button{
position: absolute;
bottom: 50rpx;
height: 88rpx;
background: #F7CC1D;
border-radius: 47rpx;
display: flex;
justify-content: center;
align-items: center;
color: #892B1F;
font-size: 32rpx;
font-weight: 500;
margin-top: 42rpx;
}

部分js代码

//获取应用实例
const app = getApp()
Page({
data: {
phone: "",
session_key: "",
isShow:false,
userInfo:{},
inviteUserphone:""
},
onLoad: function (option) {
let phone = wx.getStorageSync('phone')
let userInfo = wx.getStorageSync('userInfo')
this.setData({
inviteUserphone:option.phone,
})
if (phone && userInfo) {
this.setData({
phone: phone,
userInfo:userInfo
})
} else {
this.getUserInfo()
}
},
//获取用户信息
bindGetUserInfo: function (e) {
if(e.detail.errMsg=="getUserInfo:ok"){
this.setData({
userInfo:e.detail.userInfo,
isShow:true
})
}else{
return
}
},
//获取code
getUserInfo: function (e) {
let that = this
wx.login({
success(res) {
let code = res.code;
wx.request({
url: 'https://api.youju.looksr.com/wx/unauth/getSessionKey',
method: 'GET',
header: {
'content-type': 'application/json'
},
data: {
code: code
},
success: function (res) {
that.setData({
session_key: res.data.data.session_key,
})
}
})
}
})
},
//获取手机号
getPhoneNumber(e) {
let that = this;
wx.request({
url: 'https://api.youju.looksr.com/wx/unauth/dencrypteData',
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded'
},
data: {
sessionKey: that.data.session_key,
encryptedData: e.detail.encryptedData,
iv: e.detail.iv
},
success: function (res) {
// wx.setStorageSync('phone', res.data.data)
that.getUserData(res.data.data)
}
})
},
getUserData:function(phone){
let that = this;
wx.request({
url: 'https://api.youju.looksr.com/MeituanRegimentalCommander/api/unauth/info/my',
method: 'GET',
header: {
'content-type': 'application/json'
},
data: {
phone: phone
},
success: function (res) {
if(res.data.resultCode == 0){
that.submitUser(phone)
}else{
wx.setStorageSync('phone', phone)
wx.setStorageSync('userInfo', that.data.userInfo)
that.setData({
phone: phone,
isShow:false
})
}
}
})
},
//保存用户信息
submitUser:function(phone){
let that = this;
wx.request({
url: 'https://api.youju.looksr.com/MeituanRegimentalCommander/api/unauth/add',
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded'
},
data: {
inviteUserphone: that.data.inviteUserphone ? that.data.inviteUserphone : "",
wxNickName: that.data.userInfo.nickName,
wxAvatar: that.data.userInfo.avatarUrl,
phone: phone,
platform:0,
},
success: function (res) {
if(res.data.resultCode == 1){
wx.setStorageSync('phone', phone)
wx.setStorageSync('userInfo', that.data.userInfo)
that.setData({
phone: phone,
isShow:false
})
}
}
})
},
/**
   * 用户点击右上角分享
   */
onShareAppMessage: function () {
return {
title:"社区团购拓客系统",
path:"pages/index/index?phone="+this.data.phone
}
}
})

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
小程序生成图片demo是一个基于小程序开发的应用程序,它可以通过用户输入的文字、图片、模板等元素来生成一张新的图片。这个demo可以应用于各种场景,比如生成带有个性化文字的生日祝福图片、生成带有公司logo和产品图片的宣传海报等等。 在使用小程序生成图片demo的过程中,用户首先可以选择一个图片模板,然后根据自己的需求来编辑文字内容,比如生日祝福语、公司口号等等。接着,用户可以选择插入自己喜欢的图片元素,比如自己的照片或者公司logo。最后,用户可以预览生成的图片,并可以选择保存到手机相册或者分享到朋友圈等社交平台。 这个demo的设计理念是简单易用,用户可以通过简单的操作来生成个性化的图片,而不需要具备专业的设计技能。通过小程序生成图片demo,用户可以在自己的手机上方便快捷地制作各种个性化的图片,满足用户在不同场景下的个性化需求。 在开发小程序生成图片demo的过程中,我们主要采用了小程序的canvas绘图能力,结合用户输入的文字和图片元素,通过算法将它们合成一张新的图片。同时,我们也考虑了用户体验和界面设计,使得用户可以直观地编辑和预览生成的图片。 总的来说,小程序生成图片demo是一个方便实用的应用程序,可以帮助用户快速生成个性化的图片,满足用户在生活、工作等各种场景下的不同需求。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

西安未央

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

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

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

打赏作者

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

抵扣说明:

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

余额充值