Compare commits

...

3 Commits
master ... yh

  1. 20
      api/http.js
  2. 22
      api/store.js
  3. 39
      api/user.js
  4. 27
      app.js
  5. 1
      app.json
  6. 7
      app.wxss
  7. 9
      pages/companyInfo/index.js
  8. 11
      pages/companyInfo/index.wxml
  9. 5
      pages/companyInfo/index.wxss
  10. 98
      pages/goodsDetail/index.js
  11. 38
      pages/goodsDetail/index.wxml
  12. 57
      pages/goodsDetail/index.wxss
  13. 21
      pages/goodsList/index.js
  14. 11
      pages/goodsList/index.wxml
  15. 5
      pages/goodsList/index.wxss
  16. 65
      pages/home/index.js
  17. 17
      pages/home/index.wxml
  18. 9
      pages/home/index.wxss
  19. 9
      pages/login/index.js
  20. 53
      pages/user/bindCard/index.js
  21. 8
      pages/user/bindCard/index.wxml
  22. 50
      pages/user/cashOut/index.js
  23. 7
      pages/user/cashOut/index.wxml
  24. 11
      pages/user/cashOut/index.wxss
  25. 33
      pages/user/index.js
  26. 3
      pages/user/index.json
  27. 50
      pages/user/index.wxml
  28. 21
      pages/user/myTeam/index.js
  29. 3
      pages/user/myTeam/index.json
  30. 16
      pages/user/myTeam/index.wxml
  31. 29
      pages/user/profit/index.js
  32. 27
      pages/user/profit/index.wxml
  33. 17
      project.private.config.json

20
api/http.js

@ -1,9 +1,10 @@
const baseURL = 'http://192.168.0.112:8088/api/'; // const baseURL= 'http://192.168.0.111:8088/api/';
const baseURL= "https://www.cyjyyjy.com/api/"
export function $http(methods,url,params){ export function $http(methods,url,params){
var header = { var header = {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization' : wx.getStorageSync('token') || '' 'Authorization':'Bearer '+ wx.getStorageSync('token') || '',
'dept': '22'
}; };
return new Promise((resolve,reject)=>{ return new Promise((resolve,reject)=>{
wx.showLoading({ wx.showLoading({
@ -21,14 +22,23 @@ export function $http(methods,url,params){
wx.navigateTo({ wx.navigateTo({
url: '/pages/login/index', url: '/pages/login/index',
}) })
return
}
if(res.data.success){
resolve(res);
} else{
wx.showToast({
title: '服务器错误,请稍后再试!',
icon: 'none'
})
reject(err)
} }
resolve(res);
}, },
fail: err=> { fail: err=> {
wx.hideLoading(); wx.hideLoading();
wx.showToast({ wx.showToast({
title: '服务器错误,请稍后再试!', title: '服务器错误,请稍后再试!',
icon : 'none' icon: 'none'
}) })
reject(err) reject(err)
} }

22
api/store.js

@ -0,0 +1,22 @@
const http = require('./http.js')
/*
* 商品分类
* */
export function getCategory() {
return http.$http('get','category');
}
/*
* 商品列表
* */
export function getProducts(q) {
return http.$http('get','products',q)
}
/*
* 商品详情
* */
export function getProductDetail(id) {
return http.$http('get',"/product/detail/" + id)
}

39
api/user.js

@ -1,12 +1,31 @@
const http = require('./http.js') const http = require('./http.js')
export function bingPhone(){ //绑定银行卡
return new Promise((resolve,reject)=> { export function bingCard(data){
http.$http().then((res)=>{ return http.$http('post','userBank/saveBankInfo',data)
if(res.success){
resolve(res)
} else{
resolve(res)
}
})
})
} }
//提现
export function cash(data){
return http.$http('post','extract/cash',data)
}
//获取用户信息
export function getUserInfo(){
return http.$http('get','userinfo')
}
//立即咨询
export function saleLeads(data){
return http.$http('post','user/saleLeads',data)
}
// 获取我的团队
export function getMyTeam(){
return http.$http('post','extract/cash')
}
// 积分动态
export function getIntegralList(data){
return http.$http('get','integral/list',data)
}

27
app.js

@ -2,7 +2,6 @@
const http = require('./api/http.js') const http = require('./api/http.js')
App({ App({
onLaunch() { onLaunch() {
// 登录
}, },
login(){ login(){
return new Promise((resolve,reject)=>{ return new Promise((resolve,reject)=>{
@ -17,10 +16,23 @@ App({
let data = { let data = {
code: result.code, code: result.code,
iv: res.iv, iv: res.iv,
encryptedData:res.encryptedData encryptedData: res.encryptedData
} }
console.log(data)
http.$http('post','wxapp/auth',data).then((result)=>{ http.$http('post','wxapp/auth',data).then((result)=>{
console.log('数据已返回') if(result.data.success){
wx.setStorageSync('token', result.data.data.token)
wx.setStorageSync('userInfo', result.data.data.user)
wx.showToast({
title: '授权成功!',
icon: 'none'
})
} else{
wx.showToast({
title: result.data.msg,
icon: 'none'
})
}
resolve(result) resolve(result)
}) })
} }
@ -32,7 +44,14 @@ App({
}) })
}) })
}, },
alertMessage(msg){
wx.showToast({
title: msg,
icon: 'none'
})
},
globalData: { globalData: {
$http: http.$http http: http.$http,
products: []
} }
}) })

1
app.json

@ -1,5 +1,6 @@
{ {
"pages":[ "pages":[
"pages/home/index", "pages/home/index",
"pages/goodsList/index", "pages/goodsList/index",
"pages/goodsDetail/index", "pages/goodsDetail/index",

7
app.wxss

@ -11,7 +11,6 @@ image {
box-sizing: border-box; box-sizing: border-box;
} }
image{ image{
/* border-radius: 8rpx; */
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
@ -96,3 +95,9 @@ image{
margin: 60rpx auto; margin: 60rpx auto;
} }
.loading-status{
text-align: center;
font-size: 28rpx;
color: #B9B9B9;
}

9
pages/companyInfo/index.js

@ -1,21 +1,24 @@
// pages/companyInfo/index.js // pages/companyInfo/index.js
const app = getApp()
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
products: app.globalData.products
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({
products: app.globalData.products
})
}, },
toList(){ toList(){
wx.navigateTo({ wx.switchTab({
url: '/pages/goodsList/index', url: '/pages/goodsList/index',
}) })
}, },

11
pages/companyInfo/index.wxml

@ -6,16 +6,15 @@
<image src="../../images/title1.png"></image> <image src="../../images/title1.png"></image>
</view> </view>
<view class="introduse-box"> <view class="introduse-box">
<text>深圳市瑞梦思时代科技有限公司,瑞蓢国际集团旗下全资子公司,以能量家居系统、智慧健康睡眠生态系统为主打的核心品牌。当前旗下产品包括“重塑本元”、“吉祥卧”床垫,“少年强”青少年床垫,旅行垫,魔术减负能量背包等。\n</text> <text>深圳市瑞梦思时代科技有限公司,瑞蓢国际集团旗下全资子公司,以能量家居系统、智慧健康睡眠生态系统为主打的核心品牌。当前旗下产品包括“重塑本元”、“吉祥卧”床垫,“少年强”青少年床垫,旅行垫,魔术减负能量背包等。\n瑞梦思以“专注每一天,健康每一夜”为目标,为人们研发贯穿生活各方面的能量家居产品,让每个家庭,每个人都能从源头开始防患于未然,远离亚健康,享受真正健康轻松的幸福生活。</text>
<text>瑞梦思以“专注每一天,健康每一夜”为目标,为人们研发贯穿生活各方面的能量家居产品,让每个家庭,每个人都能从源头开始防患于未然,远离亚健康,享受真正健康轻松的幸福生活。</text>
</view> </view>
<view class="title-box"> <view class="title-box">
<image src="../../images/title2.png"></image> <image src="../../images/title2.png"></image>
</view> </view>
<view class="list-box acea-row row-between"> <view class="list-box acea-row row-around">
<view class="item"><image src="../../images/jixiang.png" mode="aspectFill"></image></view> <view class="item" wx:for="{{products}}" wx:key="index">
<view class="item"><image src="../../images/jixiang.png" mode="aspectFill"></image></view> <image src="{{item.image}}" mode="aspectFill"></image>
<view class="item"><image src="../../images/jixiang.png" mode="aspectFill"></image></view> </view>
</view> </view>
</view> </view>
<view class="submit-btn" bindtap="toList">更多商品</view> <view class="submit-btn" bindtap="toList">更多商品</view>

5
pages/companyInfo/index.wxss

@ -17,6 +17,7 @@
.title-box{ .title-box{
width: 100%; width: 100%;
height: 92rpx; height: 92rpx;
margin: 32rpx 0;
} }
.title-box image{ .title-box image{
width: 100%; width: 100%;
@ -25,8 +26,8 @@
.introduse-box{ .introduse-box{
padding: 12rpx 0; padding: 12rpx 0;
color: #0B204C; color: #0B204C;
font-size: 24rpx; font-size: 28rpx;
line-height: 34rpx; line-height: 42rpx;
font-weight: 500; font-weight: 500;
text-indent: 1em; text-indent: 1em;
} }

98
pages/goodsDetail/index.js

@ -1,42 +1,102 @@
// pages/goodsDetail/index.js // pages/goodsDetail/index.js
const app = getApp()
const user = require('../../api/user.js')
const store = require('../../api/store.js')
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
showMask: false,
form:{
name: '',
phone: '',
id: ''
},
detail: {}
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({
'form.id': options.id
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getProductDetail()
},
getProductDetail(){
store.getProductDetail(this.data.form.id).then((res)=>{
res.data.data.storeInfo.description.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
console.log('detail',res)
this.setData({
detail: res.data.data
})
})
},
showMaskDialog(){
this.setData({
showMask: true
})
},
hideMaskDialog(){
this.setData({
showMask: false
})
},
stopProp(){},
inpName(e){
this.setData({
'form.name': e.detail.value
})
},
inpPhone(e){
this.setData({
'form.phone': e.detail.value
})
},
//提交咨询
submitInfo(){
if(this.data.form.name == '' ){
return this.alertMessage('请输入您的姓名')
} else if(this.data.form.phone == ''){
return this.alertMessage('请输入您的电话')
}
user.saleLeads(this.data.form).then((res)=>{
wx.showModal({
title: '温馨提示',
content: '恭喜您预约成功,稍后会有专属服务老师与您联系。',
showCancel: false
})
this.setData({
showMask: false
})
})
},
alertMessage(msg){
wx.showToast({
title: msg,
icon: 'none'
})
}, },
toHome(){ toHome(){
wx.navigateTo({ wx.switchTab({
url: '/pages/home/index', url: '/pages/home/index',
}) })
}, },
toList(){ toList(){
wx.navigateTo({ wx.switchTab({
url: '/pages/goodsList/index', url: '/pages/goodsList/index',
}) })
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
@ -70,6 +130,10 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
return{
title: this.data.detail.storeInfo.storeName,
imageUrl: this.data.detail.storeInfo.image,
path: '/pages/goodsDetail/index?id='+ this.data.detail.storeInfo.id
}
} }
}) })

38
pages/goodsDetail/index.wxml

@ -2,23 +2,21 @@
<view class="detail-page"> <view class="detail-page">
<view class="swiper-box"> <view class="swiper-box">
<swiper> <swiper>
<block> <block wx:for="{{detail.storeInfo.sliderImageArr}}" wx:key="index">
<swiper-item> <swiper-item>
<view class="swiper-item"> <image src="{{item}}" mode="aspectFill"></image>
<image src="../../images/jixiang.png" mode="widthFix"></image>
</view>
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
</view> </view>
<view class="goods-info-box acea-row row-between"> <view class="goods-info-box acea-row row-between">
<view class="info-l-box"> <view class="info-l-box">
<view class="name line1">瑞梦思·布胡斯智能床垫</view> <view class="name line1">{{detail.storeInfo.storeName || '瑞梦思'}}</view>
<view class="price"><text class="fz20">¥</text>129000-289000</view> <view class="price"><text class="fz20">¥</text>{{detail.storeInfo.price || 0}}</view>
<view class="old-price">原价:¥<text class="row-line">99999</text></view> <view class="old-price">原价:¥<text class="row-line">{{detail.storeInfo.otPrice || 0}}</text></view>
</view> </view>
<view class="info-r-box"> <view class="info-r-box">
<view>销量:999+</view> <view>销量:{{detail.storeInfo.sales || 0}}</view>
<button open-type="share" class="share-btn acea-row row-center-wrapper"> <button open-type="share" class="share-btn acea-row row-center-wrapper">
<image src="../../images/share.png"></image> <image src="../../images/share.png"></image>
<text>分享</text> <text>分享</text>
@ -31,10 +29,7 @@
<view class="row-line"></view> <view class="row-line"></view>
</view> </view>
<view class="produce-detail"> <view class="produce-detail">
<image src="../../images/jixiang.png" mode="widthFix"></image> <rich-text nodes="{{detail.storeInfo.description}}"></rich-text>
<image src="../../images/jixiang.png" mode="widthFix"></image>
<image src="../../images/chongsu.png" mode="widthFix"></image>
<image src="../../images/chongsu.png" mode="widthFix"></image>
</view> </view>
<view class="footer-box acea-row row-between-wrapper"> <view class="footer-box acea-row row-between-wrapper">
<view class="icons-box acea-row"> <view class="icons-box acea-row">
@ -47,9 +42,22 @@
<text>商品列表</text> <text>商品列表</text>
</view> </view>
</view> </view>
<view class="submit-btn">立即咨询</view> <view class="submit-btn" bindtap="showMaskDialog">立即预约</view>
</view> </view>
<view class="mask-box"> <view class="mask-box" wx:if="{{showMask}}" bindtap="hideMaskDialog">
<view class="form">
<image src="../../images/company-bg.png" class="info-bg"></image>
<view class="inp-box" catchtap="stopProp">
<view class="inp-item acea-row row-middle">
<text class="label">您的姓名:</text>
<input type="text" placeholder="请输入您的姓名" bindinput="inpName" value="{{form.name}}" />
</view>
<view class="inp-item acea-row row-middle" catchtap="stopProp">
<text class="label">您的电话:</text>
<input type="text" maxlength="11" placeholder="请输入您的电话" bindinput="inpPhone" value="{{form.phone}}" />
</view>
</view>
<view class="submit-btn submit-btn2" catchtap="submitInfo">立即预约</view>
</view>
</view> </view>
</view> </view>

57
pages/goodsDetail/index.wxss

@ -119,3 +119,60 @@
.submit-btn{ .submit-btn{
margin: 0; margin: 0;
} }
.mask-box{
width: 100%;
height: 100%;
background: rgba(0,0,0,.6);
position: fixed;
top: 0;
left: 0;
}
.form{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
width: 690rpx;
min-height: 420rpx;
background: #fff;
border-radius: 12rpx;
font-size: 28rpx;
color: #1D1D1D;
}
.form .info-bg{
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
.inp-box{
width: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 3;
padding: 32px 130rpx;
}
.inp-item{
width: 100%;
height: 72rpx;
border: 2rpx solid #1D1D1D;
border-radius: 8rpx;
padding: 0rpx 30rpx;
margin-bottom: 40rpx;
}
.inp-item input{
width: 60%;
}
.label{
margin-right: 4rpx;
}
.submit-btn2{
position: absolute;
bottom: 35rpx;
left: 50%;
transform: translateX(-50%);
z-index: 3;
}

21
pages/goodsList/index.js

@ -1,22 +1,35 @@
// pages/goodsList/index.js // pages/goodsList/index.js
const app = getApp()
const user = require('../../api/user.js')
const store = require('../../api/store.js')
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
products: [],
loadingStatus: '没有更多了。。。'
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(this.data.products)
this.getProducts()
},
//获取产品列表
getProducts(){
store.getCategory().then((res)=>{
this.setData({
products: res.data.data[0].children[0].products
})
})
}, },
toDetail(e){ toDetail(e){
let id = e.currentTarget.dataset.id
wx.navigateTo({ wx.navigateTo({
url: '/pages/goodsDetail/index', url: '/pages/goodsDetail/index?id=' + id,
}) })
}, },
/** /**

11
pages/goodsList/index.wxml

@ -1,16 +1,17 @@
<!--pages/goodsList/index.wxml--> <!--pages/goodsList/index.wxml-->
<view class="goodsList-page"> <view class="goodsList-page">
<view class="goods-list"> <view class="goods-list">
<view class="goods-item acea-row" wx:for="{{3}}" :key="index" bindtap="toDetail" data-id="id"> <view class="goods-item acea-row" wx:for="{{products}}" wx:key="index" bindtap="toDetail" data-id="{{item.id}}">
<image src="../../images/jixiang.png" mode="aspectFill"></image> <image src="{{item.image}}" mode="aspectFill"></image>
<view class="goods-info"> <view class="goods-info">
<view class="name line2">瑞梦思·夏季新款独家定制款独家定制智能款独家定制智能智能床垫</view> <view class="name line2">{{item.storeName}}</view>
<view class="desc">高级智能床垫·安心休息</view> <view class="desc">{{item.storeInfo}}</view>
<view class="price"> <view class="price">
<text class="s-word">¥</text> <text class="s-word">¥</text>
<text>129000</text> <text>{{item.price}}</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="loading-status">{{loadingStatus}}</view>
</view> </view>

5
pages/goodsList/index.wxss

@ -46,3 +46,8 @@
.price .s-word{ .price .s-word{
font-size: 24rpx; font-size: 24rpx;
} }
.loading-status{
text-align: center;
font-size: 28rpx;
color: #B9B9B9;
}

65
pages/home/index.js

@ -1,6 +1,7 @@
// pages/home/index.js // pages/home/index.js
const app = getApp() const app = getApp()
const user = require('../../api/user.js') const user = require('../../api/user.js')
const store = require('../../api/store.js')
Page({ Page({
/** /**
@ -10,8 +11,11 @@ Page({
isAuth: false, //是否认证 isAuth: false, //是否认证
authorize: false, authorize: false,
canIUseGetUserProfile: false, canIUseGetUserProfile: false,
name: '', form: {
phone: '' name: '',
phone: '',
},
products: []
}, },
/** /**
@ -19,25 +23,54 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
// this.getUserInfo() // this.getUserInfo()
console.log(app)
if (wx.getUserProfile) { if (wx.getUserProfile) {
this.setData({ this.setData({
canIUseGetUserProfile: true canIUseGetUserProfile: true
}) })
} }
app.globalData.$http() this.getProducts()
},
//获取产品列表
getProducts(){
store.getCategory().then((res)=>{
this.setData({
products: res.data.data[0].children[0].products
})
app.globalData.products = res.data.data[0].children[0].products
})
}, },
getUserInfoProfile(){ getUserInfoProfile(){
app.login().then((res)=>{ app.login().then((res)=>{
console.log(res) if(res.data.success){
this.setData({
isAuth: true
})
}
})
},
inpName(e){
this.setData({
'form.name': e.detail.value
})
},
inpPhone(e){
this.setData({
'form.phone': e.detail.value
}) })
}, },
submitInfo(){ submitInfo(){
if(this.data.name == '' ){ if(this.data.form.name == '' ){
return this.alertMessage('请输入您的姓名') return this.alertMessage('请输入您的姓名')
} else if(this.data.phone == ''){ } else if(this.data.form.phone == ''){
return this.alertMessage('请输入您的电话') return this.alertMessage('请输入您的电话')
} }
user.saleLeads(this.data.form).then((res)=>{
wx.showModal({
title: '温馨提示',
content: '恭喜您预约成功,稍后会有专属服务老师与您联系。',
showCancel: false
})
})
}, },
alertMessage(msg){ alertMessage(msg){
wx.showToast({ wx.showToast({
@ -45,9 +78,10 @@ Page({
icon: 'none' icon: 'none'
}) })
}, },
toDetial(){ toDetial(e){
let id = e.currentTarget.dataset.id
wx.navigateTo({ wx.navigateTo({
url: '/pages/goodsDetail/index', url: '/pages/goodsDetail/index?id='+ id,
}) })
}, },
toCompany(){ toCompany(){
@ -55,18 +89,15 @@ Page({
url: '/pages/companyInfo/index', url: '/pages/companyInfo/index',
}) })
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
if(wx.getStorageSync('token')){
this.setData({
isAuth: true
})
}
}, },
/** /**

17
pages/home/index.wxml

@ -19,11 +19,8 @@
<view class="title">商品介绍</view> <view class="title">商品介绍</view>
<view class="row-line"></view> <view class="row-line"></view>
</view> </view>
<view class="goods-item" bindtap="toDetial"> <view class="goods-item" bindtap="toDetial" wx:for="{{products}}" wx:key="index" data-id="{{item.id}}">
<image src="../../images/jixiang.png" mode="widthFix"></image> <image src="{{item.image}}" mode="widthFix"></image>
</view>
<view class="goods-item">
<image src="../../images/chongsu.png" mode="widthFix"></image>
</view> </view>
</view> </view>
<view class="form-box"> <view class="form-box">
@ -36,16 +33,16 @@
<view class="inp-box"> <view class="inp-box">
<view class="inp-item acea-row row-middle"> <view class="inp-item acea-row row-middle">
<text class="label">您的姓名:</text> <text class="label">您的姓名:</text>
<input type="text" placeholder="请输入您的姓名" /> <input type="text" placeholder="请输入您的姓名" bindinput="inpName" value="{{form.name}}" />
</view> </view>
<view class="inp-item acea-row row-middle"> <view class="inp-item acea-row row-middle">
<text class="label">您的电话:</text> <text class="label">您的电话:</text>
<input type="text" maxlength="11" placeholder="请输入您的电话" /> <input type="text" maxlength="11" placeholder="请输入您的电话" bindinput="inpPhone" value="{{form.phone}}" />
</view> </view>
</view> </view>
</view> </view>
<button class="submit-btn" wx:if="{{canIUseGetUserProfile && !isAuth}}" bindtap="getUserInfoProfile">立即咨询</button> <button class="submit-btn" wx:if="{{canIUseGetUserProfile && !isAuth}}" bindtap="getUserInfoProfile">立即预约</button>
<button class="submit-btn" wx:if="{{!canIUseGetUserProfile && !isAuth}}" open-type="getUserInfo" bindtap="getUserInfo">立即咨询</button> <button class="submit-btn" wx:if="{{!canIUseGetUserProfile && !isAuth}}" open-type="getUserInfo" bindtap="getUserInfo">立即预约</button>
<view class="submit-btn" wx:if="{{isAuth}}" bindtap="submitInfo">立即咨询</view> <view class="submit-btn" wx:if="{{isAuth}}" bindtap="submitInfo">立即预约</view>
</view> </view>
</view> </view>

9
pages/home/index.wxss

@ -88,14 +88,14 @@
} }
.form{ .form{
width: 100%; width: 100%;
height: 232rpx; height: 280rpx;
font-size: 24rpx; font-size: 28rpx;
color: #1D1D1D; color: #1D1D1D;
position: relative; position: relative;
} }
.form .info-bg{ .form .info-bg{
width: 100%; width: 100%;
height: 232rpx; height: 100%;
position: absolute; position: absolute;
} }
.inp-box{ .inp-box{
@ -106,7 +106,7 @@
} }
.inp-item{ .inp-item{
width: 100%; width: 100%;
height: 50rpx; height: 72rpx;
border: 2rpx solid #1D1D1D; border: 2rpx solid #1D1D1D;
border-radius: 8rpx; border-radius: 8rpx;
padding: 0rpx 30rpx; padding: 0rpx 30rpx;
@ -122,3 +122,4 @@
width: 318rpx !important; width: 318rpx !important;
padding: 0 !important; padding: 0 !important;
} }

9
pages/login/index.js

@ -22,11 +22,10 @@ Page({
}, },
getUserProfile(e) { getUserProfile(e) {
// 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
wx.getUserProfile({ app.login().then((res)=>{
desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 if(res.data.success){
success: (response) => { wx.navigateBack({
wx.showLoading({ delta: 1,
title: '登陆中...',
}) })
} }
}) })

53
pages/user/bindCard/index.js

@ -1,11 +1,17 @@
// pages/user/bindCard/index.js // pages/user/bindCard/index.js
const app = getApp()
const user = require('../../../api/user.js')
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
form: {
name: '',
card: '',
bank: ''
}
}, },
/** /**
@ -14,7 +20,50 @@ Page({
onLoad: function (options) { onLoad: function (options) {
}, },
inpChange(e){
let t= e.currentTarget.dataset.type
switch (t){
case 'name':
this.setData({
'form.name': e.detail.value
})
break
case 'card':
this.setData({
'form.card': e.detail.value
})
break
case 'bank':
this.setData({
'form.bank': e.detail.value
})
break
}
},
submit(){
console.log(this.data.form)
if(this.data.form.name == '' ){
return app.alertMessage('请输入持卡人姓名')
} else if(this.data.form.card == ''){
return app.alertMessage('请输入银行卡号')
} else if(this.data.form.bank == ''){
return app.alertMessage('请输入开户行')
}
user.bingCard({
bankName: this.data.form.bank,
cardNumber: this.data.form.card,
cardholderName: this.data.form.name
}).then((res)=>{
wx.showToast({
title: '绑定成功!',
})
setTimeout(()=>{
wx.navigateBack({
delta: 1,
})
},1500)
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */

8
pages/user/bindCard/index.wxml

@ -3,16 +3,16 @@
<view class="form"> <view class="form">
<view class="form-item"> <view class="form-item">
<view class="label">持卡人</view> <view class="label">持卡人</view>
<input type="text" placeholder="请输入持卡人姓名" /> <input type="text" bindinput="inpChange" data-type="name" value="{{form.name}}" placeholder="请输入持卡人姓名" />
</view> </view>
<view class="form-item"> <view class="form-item">
<view class="label">银行卡号</view> <view class="label">银行卡号</view>
<input type="text" placeholder="请输入银行卡号" /> <input type="text" bindinput="inpChange" data-type="card" value="{{form.card}}" placeholder="请输入银行卡号" />
</view> </view>
<view class="form-item"> <view class="form-item">
<view class="label">开户行</view> <view class="label">开户行</view>
<input type="text" placeholder="请输入开户行" /> <input type="text" bindinput="inpChange" data-type="bank" value="{{form.bank}}" placeholder="请输入开户行" />
</view> </view>
</view> </view>
<view class="submit">确定</view> <view class="submit" bindtap="submit">确定</view>
</view> </view>

50
pages/user/cashOut/index.js

@ -1,11 +1,13 @@
// pages/user/cashOut/index.js // pages/user/cashOut/index.js
const app = getApp()
const user = require('../../../api/user.js')
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
userInfo: {},
cashNum: ''
}, },
/** /**
@ -14,7 +16,41 @@ Page({
onLoad: function (options) { onLoad: function (options) {
}, },
allCash(){
this.setData({
cashNum: this.data.brokeragePrice
})
},
cashChange(e){
this.setData({
cashNum: e.detail.value
})
},
cashClick(){
if(this.data.userInfo.userBank){
if(this.data.cashNum == '' || this.data.cashNum <= 100){
return app.alertMessage('请输入正确的积分')
}
user.cash({
extractType: 'bank',
money: this.data.cashNum
}).then((res)=>{
wx.showToast({
title: '申请提现成功',
})
setTimeout(()=>{
wx.navigateBack({
delta: 1,
})
},1500)
})
} else{
wx.navigateTo({
url: '/pages/user/bindCard/index',
})
}
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
@ -26,9 +62,15 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.getUserInfo()
},
getUserInfo(){
user.getUserInfo().then((res)=> {
this.setData({
userInfo: res.data.data
})
})
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */

7
pages/user/cashOut/index.wxml

@ -4,7 +4,7 @@
<image src="../../../images/profit.png" class="profit-bg"></image> <image src="../../../images/profit.png" class="profit-bg"></image>
<view class="profit-info"> <view class="profit-info">
<view>当前可提现积分<text class="s-word">(积分比例为1:1)</text></view> <view>当前可提现积分<text class="s-word">(积分比例为1:1)</text></view>
<view class="fz70">300</view> <view class="fz70">{{userInfo.brokeragePrice || 0}}</view>
</view> </view>
</view> </view>
<view class="tips">注:提现需在每月20-26日进行,其他时间不可提现</view> <view class="tips">注:提现需在每月20-26日进行,其他时间不可提现</view>
@ -12,8 +12,9 @@
<view class="tit">提现金额</view> <view class="tit">提现金额</view>
<view class="inp-box acea-row row-between row-middle"> <view class="inp-box acea-row row-between row-middle">
<text class="fz50">¥</text> <text class="fz50">¥</text>
<input type="text" placeholder="最低提现100积分" /> <input type="text" bindinput="cashChange" value="{{cashNum}}" placeholder="最低提现100积分" />
<view class="colO">全部提现</view> <view class="colO" bindtap="allCash">全部提现</view>
</view> </view>
</view> </view>
<view class="submit-btn" bindtap="cashClick">提现</view>
</view> </view>

11
pages/user/cashOut/index.wxss

@ -66,3 +66,14 @@
.colO{ .colO{
color: #F68514; color: #F68514;
} }
.submit-btn{
width: 440rpx;
height: 88rpx;
background: #F7C37A;
border-radius: 44rpx;
text-align: center;
line-height: 88rpx;
font-size: 42rpx;
color: #FFFFFF;
margin: 110rpx auto 0;
}

33
pages/user/index.js

@ -1,28 +1,19 @@
// pages/user/index.js // pages/user/index.js
const app = getApp() const app = getApp()
const userApi = require('../../api/user.js') const user = require('../../api/user.js')
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
userInfo: {}
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
userApi.bingPhone().then(res=>{
console.log(res)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
}, },
@ -30,9 +21,25 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.getUserInfo()
},
getUserInfo(){
user.getUserInfo().then((res)=> {
this.setData({
userInfo: res.data.data
})
})
},
toCashOut(){
wx.navigateTo({
url: '/pages/user/cashOut/index?brokeragePrice=' + this.data.userInfo.brokeragePrice,
})
},
call(){
wx.makePhoneCall({
phoneNumber: '15623111593',
})
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */

3
pages/user/index.json

@ -1,4 +1,5 @@
{ {
"usingComponents": {}, "usingComponents": {},
"navigationBarTitleText": "我的" "navigationBarTitleText": "我的",
"enablePullDownRefresh": true
} }

50
pages/user/index.wxml

@ -1,10 +1,10 @@
<!--pages/user/index.wxml--> <!--pages/user/index.wxml-->
<view class="user-page"> <view class="user-page">
<view class="user-box acea-row row-middle"> <view class="user-box acea-row row-middle">
<view class="avatar"><image src="../../images/logo.png"></image></view> <view class="avatar"><image src="{{userInfo.avatar || '../../images/logo.png'}}"></image></view>
<view class="userInfo"> <view class="userInfo">
<view class="name">赵铁柱</view> <view class="name">{{userInfo.nickname || '瑞梦思'}}</view>
<view class="id-num">ID:2123</view> <view class="id-num">ID:{{userInfo.uid}}</view>
</view> </view>
</view> </view>
<view class="panel-box"> <view class="panel-box">
@ -13,57 +13,61 @@
<view class="profit-box"> <view class="profit-box">
<view class="mt20"> <view class="mt20">
<view>今日收益</view> <view>今日收益</view>
<view class="fz40">200积分</view> <view class="fz40">{{userInfo.todayBrokerage || 0}}积分</view>
</view> </view>
<view class=""> <view class="">
<view>累计收益</view> <view>累计收益</view>
<view class="fz40">200积分</view> <view class="fz40">{{userInfo.brokeragePrice || 0}}积分</view>
</view> </view>
</view> </view>
<view class="col-line"></view> <view class="col-line"></view>
<view class="sale-box"> <view class="sale-box">
<view class="mt20"> <view class="mt20">
<view>推广人数</view> <view>推广人数</view>
<view class="fz40">20人</view> <view class="fz40">{{userInfo.spreadCount || 0}}人</view>
</view> </view>
<view class=""> <view class="">
<view>今日收益</view> <view>今日新增</view>
<view class="fz40">20人</view> <view class="fz40">{{userInfo.todaySpreadNum || 0}}人</view>
</view> </view>
</view> </view>
<view class="to-more-box"> <navigator url="/pages/user/profit/index" hover-class="none">
<image src="../../images/jifen-icon.png" class="jifen-icon"></image> <view class="to-more-box">
<view class="col-text">积分详情</view> <image src="../../images/jifen-icon.png" class="jifen-icon"></image>
<image src="../../images/arror-d.png" class="arror-r-icon"></image> <view class="col-text">积分详情</view>
</view> <image src="../../images/arror-d.png" class="arror-r-icon"></image>
</view>
</navigator>
</view> </view>
</view> </view>
<view class="menu-list"> <view class="menu-list">
<view class="menu-item acea-row row-middle row-between"> <view class="menu-item acea-row row-middle row-between" bindtap="toCashOut">
<view class="item-l acea-row row-middle"> <view class="item-l acea-row row-middle">
<image src="../../images/menu1.png"></image> <image src="../../images/menu1.png"></image>
<text>去提现</text> <text>去提现</text>
</view> </view>
<image src="../../images/arror-r.png" class="arrow-r"></image> <image src="../../images/arror-r.png" class="arrow-r"></image>
</view> </view>
<view class="menu-item acea-row row-middle row-between"> <navigator url="/pages/user/myTeam/index" hover-class="none">
<view class="item-l acea-row row-middle"> <view class="menu-item acea-row row-middle row-between">
<image src="../../images/menu2.png"></image> <view class="item-l acea-row row-middle">
<text>我的团队</text> <image src="../../images/menu2.png"></image>
<text>我的团队</text>
</view>
<image src="../../images/arror-r.png" class="arrow-r"></image>
</view> </view>
<image src="../../images/arror-r.png" class="arrow-r"></image> </navigator>
</view> <!-- <view class="menu-item acea-row row-middle row-between">
<view class="menu-item acea-row row-middle row-between">
<view class="item-l acea-row row-middle"> <view class="item-l acea-row row-middle">
<image src="../../images/menu3.png"></image> <image src="../../images/menu3.png"></image>
<text>设置</text> <text>设置</text>
</view> </view>
<image src="../../images/arror-r.png" class="arrow-r"></image> <image src="../../images/arror-r.png" class="arrow-r"></image>
</view> </view> -->
<view class="menu-item acea-row row-middle row-between"> <view class="menu-item acea-row row-middle row-between">
<view class="item-l acea-row row-middle"> <view class="item-l acea-row row-middle">
<image src="../../images/menu4.png"></image> <image src="../../images/menu4.png"></image>
<text>官方客服电话:027-88888877</text> <text bindtap="call">官方客服电话:15623111593</text>
</view> </view>
</view> </view>
</view> </view>

21
pages/user/myTeam/index.js

@ -1,20 +1,33 @@
// pages/user/myTeam/index.js // pages/user/myTeam/index.js
const app = getApp()
const user = require('../../../api/user.js')
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
teamInfo: {},
loadingStatus: '没有更多了。。。'
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({
userInfo: wx.getStorageSync('userInfo')
})
this.getTeam()
},
getTeam(){
user.getMyTeam().then((res)=>{
this.setData({
teamInfo: res.data.data
})
wx.stopPullDownRefresh()
})
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
@ -47,7 +60,7 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
this.getTeam()
}, },
/** /**

3
pages/user/myTeam/index.json

@ -1,4 +1,5 @@
{ {
"usingComponents": {}, "usingComponents": {},
"navigationBarTitleText": "我的团队" "navigationBarTitleText": "我的团队",
"enablePullDownRefresh": true
} }

16
pages/user/myTeam/index.wxml

@ -3,15 +3,15 @@
<view class="data-panel-box acea-row row-between"> <view class="data-panel-box acea-row row-between">
<view> <view>
<view>今日新增</view> <view>今日新增</view>
<view class="fz40">20人</view> <view class="fz40">{{teamInfo.todayNum}}人</view>
</view> </view>
<view> <view>
<view>一级</view> <view>一级</view>
<view class="fz40">12人</view> <view class="fz40">{{teamInfo.firstNum}}人</view>
</view> </view>
<view> <view>
<view>二级</view> <view>二级</view>
<view class="fz40">8人</view> <view class="fz40">{{teamInfo.secondNum}}人</view>
</view> </view>
</view> </view>
@ -21,10 +21,16 @@
<view class="h-item w180">二级积分收益</view> <view class="h-item w180">二级积分收益</view>
</view> </view>
<view class="t-body"> <view class="t-body">
<view class="b-item acea-row row-middle row-between"> <view class="b-item acea-row row-middle row-between" wx:for="{{teamInfo.teamList}}" wx:key="index">
<view class="name">{{item.name}}</view>
<view class="name w180">{{item.firstNum}}积分</view>
<view class="name w180">{{item.secondNum}}积分</view>
</view>
<!-- <view class="b-item acea-row row-middle row-between">
<view class="name">李元芳</view> <view class="name">李元芳</view>
<view class="name w180">500积分</view> <view class="name w180">500积分</view>
<view class="name w180">9030积分</view> <view class="name w180">9030积分</view>
</view> </view> -->
</view> </view>
<view class="loading-status">{{loadingStatus}}</view>
</view> </view>

29
pages/user/profit/index.js

@ -1,18 +1,43 @@
// pages/user/profit/index.js // pages/user/profit/index.js
const app = getApp()
const user = require('../../../api/user.js')
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
userInfo: {},
integralList: [],
page: 1,
pagesize: 300,
loadingStatus: '没有更多了。。。'
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({
userInfo: wx.getStorageSync('userInfo')
})
this.getIntegralList()
},
getIntegralList(){
let data= {
page: this.data.page,
limit: this.data.pagesize
}
user.getIntegralList(data).then((res)=>{
this.setData({
integralList: res.data.data.content
})
})
},
toCashOut(){
wx.navigateTo({
url: '/pages/user/cashOut/index?brokeragePrice=' + this.data.userInfo.brokeragePrice,
})
}, },
/** /**

27
pages/user/profit/index.wxml

@ -2,10 +2,10 @@
<view class="profit-page"> <view class="profit-page">
<view class="user-box acea-row row-middle"> <view class="user-box acea-row row-middle">
<view class="avatar"><image src="../../../images/logo.png"></image></view> <view class="avatar"><image src="{{userInfo.avatar}}"></image></view>
<view class="userInfo"> <view class="userInfo">
<view class="name">赵铁柱</view> <view class="name">{{userInfo.nickname}}</view>
<view class="id-num">ID:2123</view> <view class="id-num">ID:{{userInfo.uid}}</view>
</view> </view>
</view> </view>
@ -15,20 +15,31 @@
<view class="acea-row row-between"> <view class="acea-row row-between">
<view class=""> <view class="">
<view>今日收益</view> <view>今日收益</view>
<view class="fz40">200积分</view> <view class="fz40">{{userInfo.todayBrokerage}}积分</view>
</view> </view>
<view class=""> <view class="">
<view>累计收益</view> <view>累计收益</view>
<view class="fz40">200积分</view> <view class="fz40">{{userInfo.brokeragePrice}}积分</view>
</view> </view>
</view> </view>
<view class="to-cash-out">去提现</view> <view class="to-cash-out" bindtap="toCashOut">去提现</view>
</view> </view>
</view> </view>
<view class="int-list"> <view class="int-list">
<view class="int-t">积分动态</view> <view class="int-t">积分动态</view>
<view class="int-item" wx:for="{{3}}" :key="index"> <view class="int-item" wx:for="{{integralList}}" wx:key="index">
<view>
<view class="title">{{item.title}}</view>
<view class="time colR">{{item.createTime}}</view>
</view>
<view class="">
<view class="title fz40 colR">{{item.pm == 0 ? '-' : '+'}}{{item.number}}积分</view>
<view class="time">{{item.mark}}</view>
</view>
</view>
<view class="loading-status">{{loadingStatus}}</view>
<!-- <view class="int-item">
<view> <view>
<view class="title">禅易风云</view> <view class="title">禅易风云</view>
<view class="time colR">2021-11-26</view> <view class="time colR">2021-11-26</view>
@ -37,6 +48,6 @@
<view class="title fz40 colR">+500积分</view> <view class="title fz40 colR">+500积分</view>
<view class="time">一级收益</view> <view class="time">一级收益</view>
</view> </view>
</view> </view> -->
</view> </view>
</view> </view>

17
project.private.config.json

@ -0,0 +1,17 @@
{
"setting": {},
"condition": {
"plugin": {
"list": []
},
"game": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": []
}
}
}
Loading…
Cancel
Save