Browse Source

更新代码

yh
杨豪 3 years ago
parent
commit
378fc78c5b
  1. 10
      api/http.js
  2. 2
      api/user.js
  3. 5
      pages/companyInfo/index.wxml
  4. 1
      pages/companyInfo/index.wxss
  5. 3
      pages/goodsDetail/index.js
  6. 8
      pages/goodsDetail/index.wxml
  7. 8
      pages/goodsDetail/index.wxss
  8. 8
      pages/home/index.wxss
  9. 2
      pages/user/cashOut/index.js
  10. 2
      pages/user/cashOut/index.wxml
  11. 12
      pages/user/index.js
  12. 2
      pages/user/index.wxml
  13. 21
      pages/user/myTeam/index.js
  14. 3
      pages/user/myTeam/index.json
  15. 16
      pages/user/myTeam/index.wxml

10
api/http.js

@ -1,9 +1,9 @@
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' :'Bearer '+ wx.getStorageSync('token') || '', 'Authorization':'Bearer '+ wx.getStorageSync('token') || '',
'dept': '22' 'dept': '22'
}; };
return new Promise((resolve,reject)=>{ return new Promise((resolve,reject)=>{
@ -29,7 +29,7 @@ export function $http(methods,url,params){
} else{ } else{
wx.showToast({ wx.showToast({
title: '服务器错误,请稍后再试!', title: '服务器错误,请稍后再试!',
icon : 'none' icon: 'none'
}) })
reject(err) reject(err)
} }
@ -38,7 +38,7 @@ export function $http(methods,url,params){
wx.hideLoading(); wx.hideLoading();
wx.showToast({ wx.showToast({
title: '服务器错误,请稍后再试!', title: '服务器错误,请稍后再试!',
icon : 'none' icon: 'none'
}) })
reject(err) reject(err)
} }

2
api/user.js

@ -15,7 +15,7 @@ export function saleLeads(data){
// 获取我的团队 // 获取我的团队
export function getMyTeam(){ export function getMyTeam(){
return http.$http('get','getTeam') return http.$http('post','user/myTeam')
} }
// 积分动态 // 积分动态

5
pages/companyInfo/index.wxml

@ -6,13 +6,12 @@
<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" wx:for="{{products}}" wx:key="index"> <view class="item" wx:for="{{products}}" wx:key="index">
<image src="{{item.image}}" mode="aspectFill"></image> <image src="{{item.image}}" mode="aspectFill"></image>
</view> </view>

1
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%;

3
pages/goodsDetail/index.js

@ -33,8 +33,9 @@ Page({
}, },
getProductDetail(){ getProductDetail(){
store.getProductDetail(this.data.form.id).then((res)=>{ 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) console.log('detail',res)
res.data.data.storeInfo.description.replace(/\<img/gi, '<img style="max-width:100%;height:auto;"')
this.setData({ this.setData({
detail: res.data.data detail: res.data.data
}) })

8
pages/goodsDetail/index.wxml

@ -11,12 +11,12 @@
</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">{{detail.storeInfo.storeName}}</view> <view class="name line1">{{detail.storeInfo.storeName || '瑞梦思'}}</view>
<view class="price"><text class="fz20">¥</text>{{detail.storeInfo.price}}</view> <view class="price"><text class="fz20">¥</text>{{detail.storeInfo.price || 0}}</view>
<view class="old-price">原价:¥<text class="row-line">{{detail.storeInfo.otPrice}}</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>销量:{{detail.storeInfo.sales}}</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>

8
pages/goodsDetail/index.wxss

@ -134,10 +134,10 @@
left: 50%; left: 50%;
transform: translate(-50%,-50%); transform: translate(-50%,-50%);
width: 690rpx; width: 690rpx;
min-height: 370rpx; min-height: 420rpx;
background: #fff; background: #fff;
border-radius: 12rpx; border-radius: 12rpx;
font-size: 24rpx; font-size: 28rpx;
color: #1D1D1D; color: #1D1D1D;
} }
.form .info-bg{ .form .info-bg{
@ -157,7 +157,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;
@ -171,7 +171,7 @@
} }
.submit-btn2{ .submit-btn2{
position: absolute; position: absolute;
bottom: 46rpx; bottom: 35rpx;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
z-index: 3; z-index: 3;

8
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;

2
pages/user/cashOut/index.js

@ -5,7 +5,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
brokeragePrice: 20 brokeragePrice: 0
}, },
/** /**

2
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">{{brokeragePrice}}</view> <view class="fz70">{{brokeragePrice || 0}}</view>
</view> </view>
</view> </view>
<view class="tips">注:提现需在每月20-26日进行,其他时间不可提现</view> <view class="tips">注:提现需在每月20-26日进行,其他时间不可提现</view>

12
pages/user/index.js

@ -1,6 +1,6 @@
// 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({
/** /**
@ -14,9 +14,6 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
// userApi.getMyTeam().then((res)=>{
// console.log(res)
// })
}, },
@ -27,7 +24,7 @@ Page({
this.getUserInfo() this.getUserInfo()
}, },
getUserInfo(){ getUserInfo(){
userApi.getUserInfo().then((res)=> { user.getUserInfo().then((res)=> {
this.setData({ this.setData({
userInfo: res.data.data userInfo: res.data.data
}) })
@ -38,6 +35,11 @@ Page({
url: '/pages/user/cashOut/index?brokeragePrice=' + this.data.userInfo.brokeragePrice, url: '/pages/user/cashOut/index?brokeragePrice=' + this.data.userInfo.brokeragePrice,
}) })
}, },
call(){
wx.makePhoneCall({
phoneNumber: '15623111593',
})
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */

2
pages/user/index.wxml

@ -67,7 +67,7 @@
<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>

Loading…
Cancel
Save