Commit 162955ff by wangyalan-git

增加分销中心页面/确认订单支付页面/邀请页面

parent 8dadca82
...@@ -26,14 +26,14 @@ App({ ...@@ -26,14 +26,14 @@ App({
data; data;
if (view) { if (view) {
data = view.data; data = view.data;
console.log('是否重写分享方法', data.isOverShare); console.log('是否重写分享方法', this.globalData.userInfo);
if (!data.isOverShare) { if (!data.isOverShare) {
data.isOverShare = true; data.isOverShare = true;
view.onShareAppMessage = function () { view.onShareAppMessage = function () {
//你的分享配置 //你的分享配置
return { return {
title: '中厦全供', title: '中厦全供',
path: '/pages/index/index' path: '/pages/index/index?shareCode='+ this.globalData.userInfo.shareCode
}; };
} }
} }
...@@ -41,6 +41,7 @@ App({ ...@@ -41,6 +41,7 @@ App({
}) })
}, },
globalData: { globalData: {
userInfo: '',
// 定义全局请求队列 // 定义全局请求队列
requestQueue: [], requestQueue: [],
// 是否正在进行登陆 // 是否正在进行登陆
......
{ {
"pages": [ "pages": [
"pages/index/index", "pages/index/index",
"pages/logs/logs", "pages/logs/logs",
"pages/user/user", "pages/user/user",
...@@ -20,7 +19,14 @@ ...@@ -20,7 +19,14 @@
"pages/login/login", "pages/login/login",
"pages/prod-classify/prod-classify", "pages/prod-classify/prod-classify",
"pages/recent-news/recent-news", "pages/recent-news/recent-news",
"pages/news-detail/news-detail" "pages/news-detail/news-detail",
"pages/invite/invite",
"pages/distribution/index",
"pages/userAccount/comDetails/index",
"pages/userAccount/distributionOrder/index",
"pages/userAccount/myTeam/index",
"pages/userAccount/withdrawalRecord/index",
"pages/userAccount/balanceWithdraw/index"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
......
/**
* LRU 文件存储,使用该 downloader 可以让下载的文件存储在本地,下次进入小程序后可以直接使用
* 详细设计文档可查看 https://juejin.im/post/5b42d3ede51d4519277b6ce3
*/
const util = require('./util');
const SAVED_FILES_KEY = 'savedFiles';
const KEY_TOTAL_SIZE = 'totalSize';
const KEY_PATH = 'path';
const KEY_TIME = 'time';
const KEY_SIZE = 'size';
// 可存储总共为 6M,目前小程序可允许的最大本地存储为 10M
let MAX_SPACE_IN_B = 6 * 1024 * 1024;
let savedFiles = {};
export default class Dowloader {
constructor() {
// app 如果设置了最大存储空间,则使用 app 中的
if (getApp().PAINTER_MAX_LRU_SPACE) {
MAX_SPACE_IN_B = getApp().PAINTER_MAX_LRU_SPACE;
}
wx.getStorage({
key: SAVED_FILES_KEY,
success: function (res) {
if (res.data) {
savedFiles = res.data;
}
},
});
}
/**
* 下载文件,会用 lru 方式来缓存文件到本地
* @param {String} url 文件的 url
*/
download(url, lru) {
return new Promise((resolve, reject) => {
if (!(url && util.isValidUrl(url))) {
resolve(url);
return;
}
if (!lru) {
// 无 lru 情况下直接判断 临时文件是否存在,不存在重新下载
wx.getFileInfo({
filePath: url,
success: () => {
resolve(url);
},
fail: () => {
downloadFile(url, lru).then((path) => {
resolve(path);
}, () => {
reject();
});
},
})
return
}
const file = getFile(url);
if (file) {
// 检查文件是否正常,不正常需要重新下载
wx.getSavedFileInfo({
filePath: file[KEY_PATH],
success: (res) => {
resolve(file[KEY_PATH]);
},
fail: (error) => {
console.error(`the file is broken, redownload it, ${JSON.stringify(error)}`);
downloadFile(url, lru).then((path) => {
resolve(path);
}, () => {
reject();
});
},
});
} else {
downloadFile(url, lru).then((path) => {
resolve(path);
}, () => {
reject();
});
}
});
}
}
function downloadFile(url, lru) {
return new Promise((resolve, reject) => {
wx.downloadFile({
url: url,
success: function (res) {
if (res.statusCode !== 200) {
console.error(`downloadFile ${url} failed res.statusCode is not 200`);
reject();
return;
}
const {
tempFilePath
} = res;
wx.getFileInfo({
filePath: tempFilePath,
success: (tmpRes) => {
const newFileSize = tmpRes.size;
lru ? doLru(newFileSize).then(() => {
saveFile(url, newFileSize, tempFilePath).then((filePath) => {
resolve(filePath);
});
}, () => {
resolve(tempFilePath);
}) : resolve(tempFilePath);
},
fail: (error) => {
// 文件大小信息获取失败,则此文件也不要进行存储
console.error(`getFileInfo ${res.tempFilePath} failed, ${JSON.stringify(error)}`);
resolve(res.tempFilePath);
},
});
},
fail: function (error) {
console.error(`downloadFile failed, ${JSON.stringify(error)} `);
reject();
},
});
});
}
function saveFile(key, newFileSize, tempFilePath) {
return new Promise((resolve, reject) => {
wx.saveFile({
tempFilePath: tempFilePath,
success: (fileRes) => {
const totalSize = savedFiles[KEY_TOTAL_SIZE] ? savedFiles[KEY_TOTAL_SIZE] : 0;
savedFiles[key] = {};
savedFiles[key][KEY_PATH] = fileRes.savedFilePath;
savedFiles[key][KEY_TIME] = new Date().getTime();
savedFiles[key][KEY_SIZE] = newFileSize;
savedFiles['totalSize'] = newFileSize + totalSize;
wx.setStorage({
key: SAVED_FILES_KEY,
data: savedFiles,
});
resolve(fileRes.savedFilePath);
},
fail: (error) => {
console.error(`saveFile ${key} failed, then we delete all files, ${JSON.stringify(error)}`);
// 由于 saveFile 成功后,res.tempFilePath 处的文件会被移除,所以在存储未成功时,我们还是继续使用临时文件
resolve(tempFilePath);
// 如果出现错误,就直接情况本地的所有文件,因为你不知道是不是因为哪次lru的某个文件未删除成功
reset();
},
});
});
}
/**
* 清空所有下载相关内容
*/
function reset() {
wx.removeStorage({
key: SAVED_FILES_KEY,
success: () => {
wx.getSavedFileList({
success: (listRes) => {
removeFiles(listRes.fileList);
},
fail: (getError) => {
console.error(`getSavedFileList failed, ${JSON.stringify(getError)}`);
},
});
},
});
}
function doLru(size) {
if (size > MAX_SPACE_IN_B) {
return Promise.reject()
}
return new Promise((resolve, reject) => {
let totalSize = savedFiles[KEY_TOTAL_SIZE] ? savedFiles[KEY_TOTAL_SIZE] : 0;
if (size + totalSize <= MAX_SPACE_IN_B) {
resolve();
return;
}
// 如果加上新文件后大小超过最大限制,则进行 lru
const pathsShouldDelete = [];
// 按照最后一次的访问时间,从小到大排序
const allFiles = JSON.parse(JSON.stringify(savedFiles));
delete allFiles[KEY_TOTAL_SIZE];
const sortedKeys = Object.keys(allFiles).sort((a, b) => {
return allFiles[a][KEY_TIME] - allFiles[b][KEY_TIME];
});
for (const sortedKey of sortedKeys) {
totalSize -= savedFiles[sortedKey].size;
pathsShouldDelete.push(savedFiles[sortedKey][KEY_PATH]);
delete savedFiles[sortedKey];
if (totalSize + size < MAX_SPACE_IN_B) {
break;
}
}
savedFiles['totalSize'] = totalSize;
wx.setStorage({
key: SAVED_FILES_KEY,
data: savedFiles,
success: () => {
// 保证 storage 中不会存在不存在的文件数据
if (pathsShouldDelete.length > 0) {
removeFiles(pathsShouldDelete);
}
resolve();
},
fail: (error) => {
console.error(`doLru setStorage failed, ${JSON.stringify(error)}`);
reject();
},
});
});
}
function removeFiles(pathsShouldDelete) {
for (const pathDel of pathsShouldDelete) {
let delPath = pathDel;
if (typeof pathDel === 'object') {
delPath = pathDel.filePath;
}
wx.removeSavedFile({
filePath: delPath,
fail: (error) => {
console.error(`removeSavedFile ${pathDel} failed, ${JSON.stringify(error)}`);
},
});
}
}
function getFile(key) {
if (!savedFiles[key]) {
return;
}
savedFiles[key]['time'] = new Date().getTime();
wx.setStorage({
key: SAVED_FILES_KEY,
data: savedFiles,
});
return savedFiles[key];
}
\ No newline at end of file
/* eslint-disable */
// 当ctx传入当前文件,const grd = ctx.createCircularGradient() 和
// const grd = this.ctx.createLinearGradient() 无效,因此只能分开处理
// 先分析,在外部创建grd,再传入使用就可以
!(function () {
var api = {
isGradient: function(bg) {
if (bg && (bg.startsWith('linear') || bg.startsWith('radial'))) {
return true;
}
return false;
},
doGradient: function(bg, width, height, ctx) {
if (bg.startsWith('linear')) {
linearEffect(width, height, bg, ctx);
} else if (bg.startsWith('radial')) {
radialEffect(width, height, bg, ctx);
}
},
}
function analizeGrad(string) {
const colorPercents = string.substring(0, string.length - 1).split("%,");
const colors = [];
const percents = [];
for (let colorPercent of colorPercents) {
colors.push(colorPercent.substring(0, colorPercent.lastIndexOf(" ")).trim());
percents.push(colorPercent.substring(colorPercent.lastIndexOf(" "), colorPercent.length) / 100);
}
return {colors: colors, percents: percents};
}
function radialEffect(width, height, bg, ctx) {
const colorPer = analizeGrad(bg.match(/radial-gradient\((.+)\)/)[1]);
const grd = ctx.createCircularGradient(0, 0, width < height ? height / 2 : width / 2);
for (let i = 0; i < colorPer.colors.length; i++) {
grd.addColorStop(colorPer.percents[i], colorPer.colors[i]);
}
ctx.fillStyle = grd;
//ctx.fillRect(-(width / 2), -(height / 2), width, height);
}
function analizeLinear(bg, width, height) {
const direction = bg.match(/([-]?\d{1,3})deg/);
const dir = direction && direction[1] ? parseFloat(direction[1]) : 0;
let coordinate;
switch (dir) {
case 0: coordinate = [0, -height / 2, 0, height / 2]; break;
case 90: coordinate = [width / 2, 0, -width / 2, 0]; break;
case -90: coordinate = [-width / 2, 0, width / 2, 0]; break;
case 180: coordinate = [0, height / 2, 0, -height / 2]; break;
case -180: coordinate = [0, -height / 2, 0, height / 2]; break;
default:
let x1 = 0;
let y1 = 0;
let x2 = 0;
let y2 = 0;
if (direction[1] > 0 && direction[1] < 90) {
x1 = (width / 2) - ((width / 2) * Math.tan((90 - direction[1]) * Math.PI * 2 / 360) - height / 2) * Math.sin(2 * (90 - direction[1]) * Math.PI * 2 / 360) / 2;
y2 = Math.tan((90 - direction[1]) * Math.PI * 2 / 360) * x1;
x2 = -x1;
y1 = -y2;
} else if (direction[1] > -180 && direction[1] < -90) {
x1 = -(width / 2) + ((width / 2) * Math.tan((90 - direction[1]) * Math.PI * 2 / 360) - height / 2) * Math.sin(2 * (90 - direction[1]) * Math.PI * 2 / 360) / 2;
y2 = Math.tan((90 - direction[1]) * Math.PI * 2 / 360) * x1;
x2 = -x1;
y1 = -y2;
} else if (direction[1] > 90 && direction[1] < 180) {
x1 = (width / 2) + (-(width / 2) * Math.tan((90 - direction[1]) * Math.PI * 2 / 360) - height / 2) * Math.sin(2 * (90 - direction[1]) * Math.PI * 2 / 360) / 2;
y2 = Math.tan((90 - direction[1]) * Math.PI * 2 / 360) * x1;
x2 = -x1;
y1 = -y2;
} else {
x1 = -(width / 2) - (-(width / 2) * Math.tan((90 - direction[1]) * Math.PI * 2 / 360) - height / 2) * Math.sin(2 * (90 - direction[1]) * Math.PI * 2 / 360) / 2;
y2 = Math.tan((90 - direction[1]) * Math.PI * 2 / 360) * x1;
x2 = -x1;
y1 = -y2;
}
coordinate = [x1, y1, x2, y2];
break;
}
return coordinate;
}
function linearEffect(width, height, bg, ctx) {
const param = analizeLinear(bg, width, height);
const grd = ctx.createLinearGradient(param[0], param[1], param[2], param[3]);
const content = bg.match(/linear-gradient\((.+)\)/)[1];
const colorPer = analizeGrad(content.substring(content.indexOf(',') + 1));
for (let i = 0; i < colorPer.colors.length; i++) {
grd.addColorStop(colorPer.percents[i], colorPer.colors[i]);
}
ctx.fillStyle = grd
//ctx.fillRect(-(width / 2), -(height / 2), width, height);
}
module.exports = { api }
})();
function isValidUrl(url) {
return /(ht|f)tp(s?):\/\/([^ \\/]*\.)+[^ \\/]*(:[0-9]+)?\/?/.test(url);
}
/**
* 深度对比两个对象是否一致
* from: https://github.com/epoberezkin/fast-deep-equal
* @param {Object} a 对象a
* @param {Object} b 对象b
* @return {Boolean} 是否相同
*/
/* eslint-disable */
function equal(a, b) {
if (a === b) return true;
if (a && b && typeof a == 'object' && typeof b == 'object') {
var arrA = Array.isArray(a)
, arrB = Array.isArray(b)
, i
, length
, key;
if (arrA && arrB) {
length = a.length;
if (length != b.length) return false;
for (i = length; i-- !== 0;)
if (!equal(a[i], b[i])) return false;
return true;
}
if (arrA != arrB) return false;
var dateA = a instanceof Date
, dateB = b instanceof Date;
if (dateA != dateB) return false;
if (dateA && dateB) return a.getTime() == b.getTime();
var regexpA = a instanceof RegExp
, regexpB = b instanceof RegExp;
if (regexpA != regexpB) return false;
if (regexpA && regexpB) return a.toString() == b.toString();
var keys = Object.keys(a);
length = keys.length;
if (length !== Object.keys(b).length)
return false;
for (i = length; i-- !== 0;)
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
for (i = length; i-- !== 0;) {
key = keys[i];
if (!equal(a[key], b[key])) return false;
}
return true;
}
return a!==a && b!==b;
}
module.exports = {
isValidUrl,
equal
};
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view style='position: relative;{{customStyle}};{{painterStyle}}'>
<canvas canvas-id="photo" style="{{photoStyle}};position: absolute; left: -9999px; top: -9999rpx;" />
<canvas canvas-id="bottom" style="{{painterStyle}};position: absolute;" />
<canvas canvas-id="k-canvas" style="{{painterStyle}};position: absolute;" />
<canvas canvas-id="top" style="{{painterStyle}};position: absolute;" />
<canvas
canvas-id="front"
style="{{painterStyle}};position: absolute;"
bindtouchstart="onTouchStart"
bindtouchmove="onTouchMove"
bindtouchend="onTouchEnd"
bindtouchcancel="onTouchCancel"
disable-scroll="{{true}}" />
</view>
// pages/person/person2.js
// var util = require('../../config/util.js');
// var api = require('../../config/api.js');
// var user = require('../../services/user.js');
Page({
/**
* 页面的初始数据
*/
data: {
userLevel: 0, // 0二维码不显示,1显示
islogin: false,
username: '请登录/注册',
picture: '',
user_level: 0,//中厦全供认证判断 3已认证
integral: 0,//积分
},
// 获取分销基础信息
distribution(token) {
var that = this;
util.request(api.distribution, { token: token }).then(res => {
console.log(res)
that.setData({
pageInfo: res.data
})
})
},
// 提现信息
myAccount(token) {
var that = this;
var token = wx.getStorageSync('token');
util.request(api.myAccount, { 'token': token }).then(res => {
that.setData({
myAccountInfo: res.data
})
})
},
// 页面跳转
goPage(data) {
wx.navigateTo({
url: data.currentTarget.dataset.page,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
// let that = this;
// var token = wx.getStorageSync('token');
// that.distribution(token);
// that.myAccount(token);
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
clickLogin() {
user.checkLogin().then(res => {
console.log('has login');
}).catch(() => {
wx.navigateTo({
url: '/pages/auth/login/login',
});
});
},
toset() {
// wx.navigateTo({
// url: "/pages/baoming/baoming"
// });
// return;
user.checkLogin().then(res => {
wx.navigateTo({
url: '/pages/person/personSet/personSet'
});
}).catch(() => {
wx.navigateTo({
url: '/pages/auth/login/login',
});
});
},
clickOrder(event) {
let idx = event.currentTarget.dataset.index;
user.checkLogin().then(res => {
if (idx == 5) {
wx.navigateTo({
url: '/pages/orders/addressSelect/address',
})
} else {
wx.navigateTo({
url: '/pages/orders/orderList/index?index=' + idx,
});
}
}).catch(() => {
wx.navigateTo({
url: '/pages/auth/login/login',
});
});
},
})
{
"usingComponents": {},
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "分销中心",
"navigationBarTextStyle": "black"
}
\ No newline at end of file
<!--pages/me/me.wxml-->
<view class="view-page">
<!-- 用户信息-背景 -->
<image class="background-img-head" src="../../images/bg@2x.png"></image>
<!-- 用户信息 -->
<view class="user-info-box">
<!-- 信息 -->
<view class="user-info-show">
<image class="user-portrait" src="{{pageInfo.userInfo.picture}}"></image>
<view class="user-name">
<view>{{pageInfo.userInfo.userName}}</view>
<view>推荐人:您是由{{pageInfo.userInfo.parentName}}推荐</view>
</view>
</view>
<!-- 数字 -->
<view class="user-info-num">
<view>
<text>{{myAccountInfo ? myAccountInfo.withdrawalSuccessful : 0}}</text>
<text>成功提现佣金</text>
</view>
<view>
<text>{{myAccountInfo ? myAccountInfo.incomeTotal : 0}}</text>
<text>可提现佣金</text>
</view>
</view>
</view>
<!-- 菜单展示 -->
<view class="menu-box-show">
<view class="menu-li" bindtap="goPage" data-page="/pages/userAccount/myTeam/index">
<image src="../../images/icon/team@2x.png"></image>
<view>
<text>我的团队</text>
<text>{{pageInfo.teamNum}}人</text>
</view>
</view>
<view class="menu-li" bindtap="goPage" data-page="/pages/userAccount/distributionOrder/index">
<image src="../../images/icon/management@2x.png"></image>
<view>
<text>分销订单</text>
<text>{{pageInfo.distributionOrderNum}}笔</text>
</view>
</view>
</view>
<view class="menu-box-show">
<view class="menu-li" bindtap="goPage" data-page="/pages/userAccount/comDetails/index">
<image src="../../images/icon/commission@2x.png"></image>
<view>
<text>佣金明细</text>
<text>{{pageInfo.commissionNum}}笔</text>
</view>
</view>
<view class="menu-li" bindtap="goPage" data-page="/pages/userAccount/withdrawalRecord/index">
<image src="../../images/icon/detaileds@2x.png"></image>
<view>
<text>提现明细</text>
<text>{{pageInfo.withdrawalSuccessful}}笔</text>
</view>
</view>
</view>
<view class="menu-box-show">
<view class="menu-li" bindtap="goPage" data-page="/pages/invite/invite">
<image src="../../images/icon/Notice@2x.png"></image>
<view>
<text>我要推广</text>
<text>点击推广</text>
</view>
</view>
<view class="menu-li" bindtap="goPage" data-page="/pages/userAccount/balanceWithdraw/index">
<image src="../../images/icon/cash.png"></image>
<view>
<text>我要提现</text>
<text>{{pageInfo.toBeWithdrawal}}元</text>
</view>
</view>
</view>
</view>
\ No newline at end of file
/* pages/me/me.wxss */
page {
background: #f4f4f4;
}
.view-page{
display: flex;
align-items: center;
flex-direction: column;
width: 100%;
}
.background-img-head{
width: 100%;
height: 400rpx;
margin-bottom: 40rpx;
}
.user-info-box{
width: 690rpx;
height: 330rpx;
border-radius: 20rpx;
background: white;
position: absolute;
top: 80rpx;
left: 30rpx;
display: flex;
align-items: center;
flex-direction: column;
}
.user-info-show{
display: flex;
align-items: center;
flex-direction: row;
width: 100%;
margin: 44rpx 0 0 0;
}
.user-portrait{
width: 112rpx;
height: 112rpx;
border-radius: 50%;
margin: 0 33rpx 0 40rpx;
}
.user-name{
flex: 1;
display: flex;
align-items: center;
flex-direction: column;
}
.user-name view:nth-child(1){
width: 100%;
font-size: 40rpx;
font-family: PingFang SC Semibold, PingFang SC Semibold-Semibold;
font-weight: 600;
text-align: left;
color: #020202;
}
.user-name view:nth-child(2){
width: 100%;
font-size: 24rpx;
font-family: PingFang SC Regular, PingFang SC Regular-Regular;
font-weight: 400;
text-align: left;
color: #999999;
margin-top: 10rpx;
}
.rule{
width: 120rpx;
height: 50rpx;
background: #030521;
border-radius: 25rpx;
text-align: center;
line-height: 50rpx;
margin-right: 30rpx;
font-size: 26rpx;
font-family: PingFang SC Regular, PingFang SC Regular-Regular;
font-weight: 400;
color: #ffffff;
}
.user-info-num{
width: 75%;
display: flex;
align-items: center;
justify-content: space-between;
margin: 44rpx 0 0 0;
}
.user-info-num view{
width: 100%;
display: flex;
align-items: center;
flex-direction: column;
}
.user-info-num view text:nth-child(1){
font-size: 40rpx;
font-family: PingFang SC Semibold, PingFang SC Semibold-Semibold;
font-weight: 600;
color: #020202;
width: 100%;
text-align: center;
}
.user-info-num view text:nth-child(2){
font-size: 26rpx;
font-family: PingFang SC Regular, PingFang SC Regular-Regular;
font-weight: 400;
width: 100%;
text-align: center;
color: #999999;
}
.menu-box-show{
width: 690rpx;
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 0 20rpx 0;
}
.menu-li{
width: 49%;
background: #ffffff;
border-radius: 5px;
display: flex;
flex-direction: column;
padding: 20rpx 0;
}
.menu-li image{
width: 67rpx;
height: 64rpx;
margin: 20rpx 0 0 20rpx;
}
.menu-li view{
display: flex;
align-items: center;
justify-content: space-between;
width: 85%;
font-size: 26rpx;
margin: 0 25rpx;
}
.menu-li view text:nth-child(2){
font-size: 24rpx;
color: #999999;
}
\ No newline at end of file
...@@ -83,14 +83,35 @@ Page({ ...@@ -83,14 +83,35 @@ Page({
wx.getSetting({ wx.getSetting({
success(res) { success(res) {
if (!res.authSetting['scope.userInfo']) { if (!res.authSetting['scope.userInfo']) {
wx.navigateTo({ if (this.options.shareCode) {
url: '/pages/login/login', wx.navigateTo({
}) url: '/pages/login/login?shareCode=' + this.options.shareCode,
})
} else {
wx.navigateTo({
url: '/pages/login/login',
})
}
} else {
if (this.options.shareCode) {
this.boundParentByShareCode(options.shareCode); // 绑定内容获取
}
} }
} }
}) })
},
boundParentByShareCode(code) {
var params = {
url: "/p/user/boundParentByShareCode",
method: "POST",
data: {
shareCode: code
},
callBack: (res) => {
console.log("绑定成功", res)
}
};
http.request(params);
}, },
getAllData() { getAllData() {
http.getCartCount(); //重新计算购物车总数量 http.getCartCount(); //重新计算购物车总数量
......
{
"usingComponents": {
"painter": "/components/painter/painter"
},
"navigationBarTitleText": "邀请海报",
"navigationBarBackgroundColor": "#000000",
"navigationBarTextStyle": "white"
}
\ No newline at end of file
<!--pages/ininvite/ininvite.wxml-->
<view class='box'>
<canvas style="width: {{canvasWidth}}px; height: {{canvasHeight}}px;" canvas-id="firstCanvas"></canvas>
<view class="bomBtn">
<button class='btn' bindtap='save'>保存图片</button>
<button class='btn' open-type="share">邀请好友</button>
</view>
</view>
\ No newline at end of file
/* pages/ininvite/ininvite.wxss */
page{
background-color: #000000;
}
.box{
width: 100%;
}
canvas{
margin: 20rpx auto;
}
/* 底部按钮 */
.bomBtn{
width: 100%;
height: 81rpx;
position: fixed;
bottom: 0;
display: flex;
align-items: center;
flex-direction: row;
}
.bomBtn .btn{
width: 50%;
font-size: 28rpx;
color: #fff;
background: #FC9F48;
border-radius: 0;
border: 0;
height: 100%;
line-height: 81rpx;
}
.bomBtn .btn:nth-child(2){
background: #C20C0C;
border-radius: 0;
}
\ No newline at end of file
...@@ -9,12 +9,24 @@ Page({ ...@@ -9,12 +9,24 @@ Page({
}, },
onGotUserInfo: function (res) { onGotUserInfo: function (res) {
http.updateUserInfo(); http.updateUserInfo();
wx.navigateBack({ wx.navigateBack({
delta: 1 delta: 1
}) })
}, },
boundParentByShareCode(code) {
var params = {
url: "/p/user/boundParentByShareCode",
method: "POST",
data: {
shareCode: code
},
callBack: (res) => {
console.log("绑定成功",res)
}
};
http.request(params);
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
......
...@@ -51,7 +51,7 @@ Page({ ...@@ -51,7 +51,7 @@ Page({
littleCommPage: [], littleCommPage: [],
evaluate: -1, evaluate: -1,
isCollection: false, isCollection: false,
isOverShare: true // isOverShare: true
}, },
/** /**
......
...@@ -26,20 +26,35 @@ Page({ ...@@ -26,20 +26,35 @@ Page({
remark: "", remark: "",
couponIds: [], couponIds: [],
payType: 1, payType: 1,
balance: 100 balance: 0,
disabledBalance: false
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function(options) { onLoad: function (options) {
this.getUserAccount()
this.setData({ this.setData({
orderEntry: options.orderEntry, orderEntry: options.orderEntry,
}); });
}, },
getUserAccount: function () {
var params = {
url: "/p/user/userAccount",
method: "GET",
data: {},
callBack: res => {
this.setData({
balance: res.result.amount
})
console.log("res", res, this)
}
};
http.request(params);
},
//加载订单数据 //加载订单数据
loadOrderData: function() { loadOrderData: function () {
var addrId = 0; var addrId = 0;
if (this.data.userAddr != null) { if (this.data.userAddr != null) {
addrId = this.data.userAddr.addrId; addrId = this.data.userAddr.addrId;
...@@ -82,7 +97,6 @@ Page({ ...@@ -82,7 +97,6 @@ Page({
} }
}) })
} }
this.setData({ this.setData({
orderItems: orderItems, orderItems: orderItems,
actualTotal: res.actualTotal, actualTotal: res.actualTotal,
...@@ -91,6 +105,7 @@ Page({ ...@@ -91,6 +105,7 @@ Page({
userAddr: res.userAddr, userAddr: res.userAddr,
transfee: res.shopCartOrders[0].transfee, transfee: res.shopCartOrders[0].transfee,
shopReduce: res.shopCartOrders[0].shopReduce, shopReduce: res.shopCartOrders[0].shopReduce,
disabledBalance: this.data.balance < res.actualTotal ? true : false
}); });
}, },
errCallBack: res => { errCallBack: res => {
...@@ -101,7 +116,7 @@ Page({ ...@@ -101,7 +116,7 @@ Page({
http.request(params); http.request(params);
}, },
payTypeChange(e){ payTypeChange(e) {
console.log(e.detail.value) console.log(e.detail.value)
this.setData({ this.setData({
payType: e.detail.value payType: e.detail.value
...@@ -132,7 +147,7 @@ Page({ ...@@ -132,7 +147,7 @@ Page({
/** /**
* 提交订单 * 提交订单
*/ */
toPay: function() { toPay: function () {
if (!this.data.userAddr) { if (!this.data.userAddr) {
wx.showToast({ wx.showToast({
title: '请选择地址', title: '请选择地址',
...@@ -140,12 +155,10 @@ Page({ ...@@ -140,12 +155,10 @@ Page({
}) })
return; return;
} }
this.submitOrder(); this.submitOrder();
}, },
submitOrder: function () {
submitOrder: function() {
wx.showLoading({ wx.showLoading({
mask: true mask: true
}); });
...@@ -160,7 +173,16 @@ Page({ ...@@ -160,7 +173,16 @@ Page({
}, },
callBack: res => { callBack: res => {
wx.hideLoading(); wx.hideLoading();
this.calWeixinPay(res.orderNumbers); if (this.data.payType == 1) {
this.calWeixinPay(res.orderNumbers);
} else if (this.data.payType == 3) {
this.balancePay(res.orderNumbers)
} else {
wx.showToast({
title: '暂无此支付方式',
icon: "none"
})
}
} }
}; };
http.request(params); http.request(params);
...@@ -169,7 +191,7 @@ Page({ ...@@ -169,7 +191,7 @@ Page({
/** /**
* 唤起微信支付 * 唤起微信支付
*/ */
calWeixinPay: function(orderNumbers) { calWeixinPay: function (orderNumbers) {
wx.showLoading({ wx.showLoading({
mask: true mask: true
}); });
...@@ -180,7 +202,7 @@ Page({ ...@@ -180,7 +202,7 @@ Page({
payType: 1, payType: 1,
orderNumbers: orderNumbers orderNumbers: orderNumbers
}, },
callBack: function(res) { callBack: function (res) {
wx.hideLoading(); wx.hideLoading();
wx.requestPayment({ wx.requestPayment({
timeStamp: res.timeStamp, timeStamp: res.timeStamp,
...@@ -205,18 +227,46 @@ Page({ ...@@ -205,18 +227,46 @@ Page({
}; };
http.request(params); http.request(params);
}, },
/**
* 余额支付
*/
balancePay: function (orderNumbers) {
wx.showLoading({
mask: true
});
var params = {
url: "/p/order/balancePay",
method: "POST",
data: {
payType: 3,
orderNumbers: orderNumbers
},
callBack: function (res) {
wx.hideLoading();
// console.log("支付成功");
wx.navigateTo({
url: '/pages/pay-result/pay-result?sts=1&orderNumbers=' + orderNumbers + "&orderType=" + this.data.orderType,
})
},
errCallBack: function () {
wx.navigateTo({
url: '/pages/pay-result/pay-result?sts=0&orderNumbers=' + orderNumbers + "&orderType=" + this.data.orderType,
})
}
};
http.request(params);
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function() { onReady: function () {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function() { onShow: function () {
var pages = getCurrentPages(); var pages = getCurrentPages();
var currPage = pages[pages.length - 1]; var currPage = pages[pages.length - 1];
if (currPage.data.selAddress == "yes") { if (currPage.data.selAddress == "yes") {
...@@ -231,51 +281,51 @@ Page({ ...@@ -231,51 +281,51 @@ Page({
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function() { onHide: function () {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function() { onUnload: function () {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function() { onPullDownRefresh: function () {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function() { onReachBottom: function () {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function() { onShareAppMessage: function () {
}, },
changeCouponSts: function(e) { changeCouponSts: function (e) {
this.setData({ this.setData({
couponSts: e.currentTarget.dataset.sts couponSts: e.currentTarget.dataset.sts
}); });
}, },
showCouponPopup: function() { showCouponPopup: function () {
this.setData({ this.setData({
popupShow: true popupShow: true
}); });
}, },
closePopup: function() { closePopup: function () {
this.setData({ this.setData({
popupShow: false popupShow: false
}); });
...@@ -284,7 +334,7 @@ Page({ ...@@ -284,7 +334,7 @@ Page({
/** /**
* 去地址页面 * 去地址页面
*/ */
toAddrListPage: function() { toAddrListPage: function () {
wx.navigateTo({ wx.navigateTo({
url: '/pages/delivery-address/delivery-address?order=0', url: '/pages/delivery-address/delivery-address?order=0',
}) })
...@@ -292,7 +342,7 @@ Page({ ...@@ -292,7 +342,7 @@ Page({
/** /**
* 确定选择好的优惠券 * 确定选择好的优惠券
*/ */
choosedCoupon: function() { choosedCoupon: function () {
this.loadOrderData(); this.loadOrderData();
this.setData({ this.setData({
popupShow: false popupShow: false
...@@ -302,7 +352,7 @@ Page({ ...@@ -302,7 +352,7 @@ Page({
/** /**
* 优惠券子组件发过来 * 优惠券子组件发过来
*/ */
checkCoupon: function(e) { checkCoupon: function (e) {
var ths = this; var ths = this;
let index = ths.data.couponIds.indexOf(e.detail.couponId); let index = ths.data.couponIds.indexOf(e.detail.couponId);
if (index === -1) { if (index === -1) {
......
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
</view> </view>
<view class="btn"> <view class="btn">
<label> <label>
<radio value="3" checked="{{payType == 3}}" disabled="{{!balance}}" color="#eb2444" /> <radio value="3" checked="{{payType == 3}}" disabled="{{disabledBalance}}" color="#eb2444" />
</label> </label>
</view> </view>
</view> </view>
......
...@@ -9,27 +9,28 @@ Page({ ...@@ -9,27 +9,28 @@ Page({
data: { data: {
orderAmount: '', orderAmount: '',
sts: '', sts: '',
collectionCount: 0 collectionCount: 0,
userAccount: ''
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function(options) { onLoad: function (options) {
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function() { onReady: function () {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function() { onShow: function () {
//加载订单数字 //加载订单数字
var ths = this; var ths = this;
...@@ -39,7 +40,7 @@ Page({ ...@@ -39,7 +40,7 @@ Page({
url: "/p/myOrder/orderCount", url: "/p/myOrder/orderCount",
method: "GET", method: "GET",
data: {}, data: {},
callBack: function(res) { callBack: function (res) {
wx.hideLoading(); wx.hideLoading();
ths.setData({ ths.setData({
orderAmount: res orderAmount: res
...@@ -48,78 +49,82 @@ Page({ ...@@ -48,78 +49,82 @@ Page({
}; };
http.request(params); http.request(params);
this.showCollectionCount(); this.showCollectionCount();
this.getUserAccount()
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function() { onHide: function () {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function() { onUnload: function () {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function() { onPullDownRefresh: function () {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function() { onReachBottom: function () {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function() { onShareAppMessage: function () {
}, },
toDistCenter: function () { toDistCenter: function () {
wx.showToast({ wx.navigateTo({
icon: "none", url: '/pages/distribution/index',
title: '正在开发中'
}) })
}, },
toCouponCenter: function() { toCouponCenter: function () {
wx.showToast({ wx.showToast({
icon: "none", icon: "none",
title: '正在开发中' title: '正在开发中'
}) })
}, },
toMyCouponPage: function() { toMyCouponPage: function () {
wx.showToast({ wx.showToast({
icon: "none", icon: "none",
title: '正在开发中' title: '正在开发中'
}) })
}, },
toAddressList: function() { toInvitePage: function () {
wx.navigateTo({
url: '/pages/invite/invite',
})
},
toAddressList: function () {
wx.navigateTo({ wx.navigateTo({
url: '/pages/delivery-address/delivery-address', url: '/pages/delivery-address/delivery-address',
}) })
}, },
// 跳转绑定手机号 // 跳转绑定手机号
toBindingPhone: function() { toBindingPhone: function () {
wx.navigateTo({ wx.navigateTo({
url: '/pages/binding-phone/binding-phone', url: '/pages/binding-phone/binding-phone',
}) })
}, },
toOrderListPage: function(e) { toOrderListPage: function (e) {
var sts = e.currentTarget.dataset.sts; var sts = e.currentTarget.dataset.sts;
wx.navigateTo({ wx.navigateTo({
url: '/pages/orderList/orderList?sts=' + sts, url: '/pages/orderList/orderList?sts=' + sts,
...@@ -128,14 +133,14 @@ Page({ ...@@ -128,14 +133,14 @@ Page({
/** /**
* 查询所有的收藏量 * 查询所有的收藏量
*/ */
showCollectionCount: function() { showCollectionCount: function () {
var ths = this; var ths = this;
wx.showLoading(); wx.showLoading();
var params = { var params = {
url: "/p/user/collection/count", url: "/p/user/collection/count",
method: "GET", method: "GET",
data: {}, data: {},
callBack: function(res) { callBack: function (res) {
wx.hideLoading(); wx.hideLoading();
ths.setData({ ths.setData({
collectionCount: res collectionCount: res
...@@ -144,10 +149,25 @@ Page({ ...@@ -144,10 +149,25 @@ Page({
}; };
http.request(params); http.request(params);
}, },
// 用户余额/积分
getUserAccount: function () {
var params = {
url: "/p/user/userAccount",
method: "GET",
data: {},
callBack: res => {
this.setData({
userAccount: res.result,
})
console.log("res", res, this)
}
};
http.request(params);
},
/** /**
* 我的收藏跳转 * 我的收藏跳转
*/ */
myCollectionHandle: function() { myCollectionHandle: function () {
var url = '/pages/prod-classify/prod-classify?sts=5'; var url = '/pages/prod-classify/prod-classify?sts=5';
var id = 0; var id = 0;
var title = "我的收藏商品"; var title = "我的收藏商品";
......
...@@ -9,10 +9,20 @@ ...@@ -9,10 +9,20 @@
<open-data type="userNickName"></open-data> <open-data type="userNickName"></open-data>
</view> </view>
</view> </view>
<view class='binding-phone'> <view class="prod-col" style="margin-top: 0;padding-top: 0;">
<view class="col-item" bindtap=''>
<view class="num">{{userAccount.amount || 0}}</view>
<view class="tit">余额</view>
</view>
<view class="col-item">
<view class="num">{{userAccount.integral || 0}}</view>
<view class="tit">积分</view>
</view>
</view>
<!-- <view class='binding-phone'>
<text class='show-tip'>绑定手机号后可查看订单和领取优惠券,</text> <text class='show-tip'>绑定手机号后可查看订单和领取优惠券,</text>
<text class='gotobinding' bindtap='toBindingPhone'>去绑定</text> <text class='gotobinding' bindtap='toBindingPhone'>去绑定</text>
</view> </view> -->
<!-- end 用户信息 --> <!-- end 用户信息 -->
<view class='list-cont'> <view class='list-cont'>
...@@ -87,6 +97,13 @@ ...@@ -87,6 +97,13 @@
</view> </view>
<view class='arrowhead'></view> <view class='arrowhead'></view>
</view> </view>
<view class='memu-item' bindtap='toInvitePage'>
<view class="i-name">
<image src='../../images/icon/toDelivery.png'></image>
<text>我要邀请</text>
</view>
<view class='arrowhead'></view>
</view>
<view class='memu-item' bindtap='toAddressList'> <view class='memu-item' bindtap='toAddressList'>
<view class="i-name"> <view class="i-name">
<image src='../../images/icon/myAddr.png'></image> <image src='../../images/icon/myAddr.png'></image>
......
// pages/newly/redpacket.js
// var util = require('../../config/util.js');
// var api = require('../../config/api.js');
Page({
/**
* 页面的初始数据
*/
data: {
imgStr: '',
amount: '',
name: '',
actualAmount: '',
how: false,//是否显示如何上传收款码提示框
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.getData();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
},
getData() {
},
gotoShow: function() {
var that = this
wx.chooseImage({
count: 1, // 最多可以选择的图片张数,默认9
sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有
sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有
success: function(res) {
// success
var tempFilePaths = res.tempFilePaths;
// that.setData({
// imgStr: wx.getFileSystemManager().readFileSync(res.tempFilePaths[0], "base64")
// })
that.setData({
imgStr: res.tempFilePaths
})
},
fail: function() {
// fail
},
complete: function() {
// complete
}
})
},
amountinput(e) {
let value = e.detail.value
let actualAmount = (value * 0.92).toFixed(2);
console.log(value, actualAmount)
this.setData({
amount: value,
actualAmount: actualAmount
})
},
nameinput(e) {
let value = e.detail.value
console.log(value)
this.setData({
name: value
})
},
bankinput(e) {
let value = e.detail.value
console.log(value)
this.setData({
bank: value
})
},
bankCardinput(e) {
let value = e.detail.value
console.log(value)
this.setData({
bankCard: value
})
},
//最新提现做法
inputimg: function() {
let that = this;
var token = wx.getStorageSync('token');
var openid = wx.getStorageSync('openid')
util.request(api.newly_balanceWithdraw, {
token: token,
openid: openid,
amount: that.data.amount,
name: that.data.name,
bank: that.data.bank,
bankCard: that.data.bankCard
}).then(function (res) {
if (res.status === 200) {
wx.hideLoading()
wx.showToast({
title: '操作成功,我们将尽快为您提现',
icon: 'none'
})
} else {
wx.hideLoading()
wx.showToast({
title: res.desc,
icon: 'none'
})
}
});
},
//之前提现做法
inputimg2: function() {
let that = this;
if (that.data.imgStr != '' && that.data.amount > 0 && that.data.name != '') {
console.log(that.data.imgStr)
wx.showLoading({
title: '正在上传图片,请等待...'
});
var token = wx.getStorageSync('token');
if (token) {
wx.uploadFile({
url: api.newly_balanceWithdraw, //仅为示例,非真实的接口地址
filePath: that.data.imgStr[0],
name: 'file',
formData: {
token: token,
amount: that.data.amount,
name: that.data.name
},
success: function(res) {
console.log(res)
wx.hideLoading()
if (res.statusCode == 200) {
var obj = JSON.parse(res.data)
console.log(obj, obj.status)
if (obj.status==200){
wx.showToast({
title: '操作成功,我们将尽快为您提现',
icon: 'none'
})
that.setData({
imgStr: '',
amount: '',
name: ''
})
}else{
wx.showToast({
title: obj.desc,
icon: 'none'
})
}
} else {
wx.showToast({
title: '操作失败,请稍后重试',
icon: 'none'
})
}
}
})
// util.request(api.newly_balanceWithdraw, {
// token: token,
// file: that.data.imgStr,
// amount: that.data.amount,
// name: that.data.name
// }).then(function (res) {
// if (res.status === 200) {
// wx.hideLoading()
// wx.showToast({
// title: '操作成功,我们将尽快为您提现',
// icon: 'none'
// })
// } else {
// wx.hideLoading()
// wx.showToast({
// title: res.desc,
// icon: 'none'
// })
// }
// });
}
} else {
wx.showToast({
title: '请填写完整的提现信息',
icon: 'none'
})
}
},
//点击如何上传收款码
showHow(){
this.setData({
how: true,
});
},
hideHow(){
this.setData({
how: false,
})
}
})
\ No newline at end of file
{
"navigationBarTitleText": "余额提现"
}
\ No newline at end of file
<!--pages/newly/redpacket.wxml-->
<view class="container">
<view class='content'>
<view class='top'>
<view class='li'>
<text class='txt'>收款人</text>
<input class='input' type='text' value="{{name}}" bindinput="nameinput" placeholder-class='phcolor' placeholder='请输入收款人姓名'></input>
</view>
<view class='li'>
<text class='txt'>开户行</text>
<input class='input' type='text' value="{{bank}}" bindinput="bankinput" placeholder-class='phcolor' placeholder='请输入开户行'></input>
</view>
<view class='li'>
<text class='txt'>银行卡号</text>
<input class='input' type='text' value="{{bankCard}}" bindinput="bankCardinput" placeholder-class='phcolor' placeholder='请输入银行卡号'></input>
</view>
<view class='li'>
<text class='txt'>提现金额</text>
<input class='input' type='text' value="{{amount}}" bindinput="amountinput" placeholder-class='phcolor' placeholder='请输入提现金额'></input>
</view>
<view class='li'>
<text class='txt'>到账金额</text>
<text class='input' wx:if="{{amount>=50}}">{{actualAmount}}</text>
</view>
</view>
</view>
<view class="botton-container">
<!-- <view class='inputimg' type="default" bindtap="gotoShow">点击上传您的收款码</view> -->
<view class='inputimg' type="default" bindtap="inputimg">48小时内到账,确认提现</view>
<!-- <view class='how-container' bindtap="showHow">
<image class='how-img' src="/images/newly/notice.png"></image>
<text class='how-txt'>如何上传收款码?</text>
</view> -->
</view>
<view class="notice-container">
<text class='txt-notice-title'>【温馨提醒】</text>
<text class='txt-notice'></text>
<text class='txt-notice'>1、金额满200元方可提现;\n2、提现收0.6%手续费;\n3、购物可全额抵扣;</text>
</view>
<view class="coupon-notice-window" wx:if="{{how}}">
<view class="container">
<view class="root-corner"></view>
<view class="root">
<view class="content-container">
<text class="title">提示</text>
<!-- 微信 -->
<view class="row-container margin-top">
<image class="logo" src="/images/newly/wechat.png"></image>
<text class="logo-text">如何传微信收款码?</text>
</view>
<text class="logo-desc">1、打开微信,点击右上角“+”\n2、点击收款码,再点二维码收款\n3、保存收款码即可上传</text>
<!-- 支付宝 -->
<view class="row-container margin-top">
<image class="logo" src="/images/newly/alipay.png"></image>
<text class="logo-text">如何传支付宝收款码?</text>
</view>
<text class="logo-desc">1、打开支付宝,点击收钱”\n2、保存收款码即可上传</text>
</view>
<view class="btn" bindtap="hideHow">
<text class="btn-text">知道啦</text>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
page {
background: #f4f4f4;
}
.container {
background: #f4f4f4;
width: 100%;
height: 100%;
min-height: 100%;
overflow: hidden;
}
.content {
width: 100%;
height: 100%;
padding: 40rpx 20rpx 0 20rpx;
display: flex;
flex-direction: column;
}
.top {
float: left;
width: 95%;
background-color: #fff;
border-radius: 20rpx;
box-sizing: border-box;
padding: 10rpx 40rpx;
}
.top .li-line {
width: 100%;
height: 3rpx;
background-color: #CCCCCC;
}
.top .li {
float: left;
width: 100%;
height: 120rpx;
line-height: 120rpx;
position: relative;
box-sizing: border-box;
padding-left: 180rpx;
font-size: 34rpx;
}
.top .li .txt {
position: absolute;
left: 0;
top: 0;
width: 180rpx;
font-size: 37rpx;
color: #333;
}
.top .li .input {
float: left;
width: 100%;
border: 0;
height: 120rpx;
line-height: 120rpx;
font-size: 30rpx;
}
.phcolor {
font-size: 30rpx;
color: #C4C4C4;
}
.top .showimg {
float: left;
width: 100%;
}
.botton-container{
width: 100%;
margin-top: 30rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.botton-container .inputimg {
width: 95%;
font-size: 30rpx;
height: 76rpx;
line-height: 76rpx;
margin-top: 10rpx;
background-color: #E4BC98;
text-align: center;
border-radius: 15rpx;
color: rgb(83, 37, 3);
}
.botton-container .inputimg2 {
width: 95%;
font-size: 30rpx;
height: 76rpx;
line-height: 76rpx;
margin-top: 30rpx;
background-color: rgb(235, 84, 1);
color: #fff;
text-align: center;
border-radius: 15rpx;
}
.how-container{
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
margin-top: 30rpx;
}
.how-container .how-img{
width: 30rpx;
height: 30rpx;
}
.how-container .how-txt{
color: black;
font-size: 28rpx;
margin-left: 10rpx;
}
.notice-container{
width: 100%;
display: flex;
flex-direction: column;
margin-left: 100rpx;
margin-top: 50rpx;
}
.txt-notice{
font-size: 26rpx;
line-height: 50rpx;
color: rgba(0, 0, 0, 1);
}
.txt-notice-title{
font-size: 26rpx;
line-height: 50rpx;
color: rgb(235, 84, 1);
}
.coupon-notice-window{
position: fixed;
z-index: 998;
width: 100%;
height: 100%;
left: 0;
top: 0;
background-color: rgba(0, 0, 0, 0.6);
}
.coupon-notice-window .container{
background-color: rgba(0, 0, 0, 0);
position: relative;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.coupon-notice-window .container .root-corner{
position: absolute;
z-index: 666;
width: 600rpx;
height: 800rpx;
margin-top: 20rpx;
border-radius: 25rpx;
background-color: white;
}
.coupon-notice-window .container .root{
position: absolute;
z-index: 667;
width: 600rpx;
height: 800rpx;
}
.coupon-notice-window .container .content-container{
display: flex;
flex-direction: column;
justify-content: center;
margin-left: 50rpx;
margin-right: 10rpx;
}
.coupon-notice-window .container .content-container .title{
color: black;
font-size: 40rpx;
width: 100%;
text-align: center;
margin-top: 70rpx;
margin-left: -20rpx;
font-weight: bold;
}
.coupon-notice-window .container .content-container .row-container{
display: flex;
flex-direction: row;
align-items: center
}
.margin-top{
margin-top: 20rpx;
}
.logo {
width: 50rpx;
height: 50rpx;
}
.logo-text{
margin-left: 15rpx;
color: black;
font-size: 35rpx;
font-weight: bold;
}
.logo-desc{
font-size: 33rpx;
color: rgb(62, 62, 62);
margin-top: 20rpx;
margin-bottom: 40rpx;
}
.coupon-notice-window .container .btn{
width: 450rpx;
height: 70rpx;
margin-top: 20rpx;
border-radius: 15rpx;
background-color: rgb(235, 84, 1);
margin-left: auto;
margin-right: auto;
display: flex;
align-items: center;
justify-content: center;
}
.coupon-notice-window .container .btn .btn-text{
font-size: 34rpx;
color: white;
}
\ No newline at end of file
// pages/userAccount/comDetails/index.js
// var util = require('../../../config/util.js');
// var api = require('../../../config/api.js');
// var user = require('../../../services/user.js');
// var utils = require('../../../utils/util.js')
Page({
/**
* 页面的初始数据
*/
data: {
},
// 获取页面数据
myAccount(){
var that = this;
var token = wx.getStorageSync('token');
util.request(api.myAccount, {'token': token}).then(res => {
that.setData({
pageInfo: res.data
})
})
},
// 页面跳转
goPage(data){
wx.navigateTo({
url: data.currentTarget.dataset.page,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// this.myAccount();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "佣金明细"
}
\ No newline at end of file
<!--pages/userAccount/comDetails/index.wxml-->
<view class="page-view">
<!-- 头部数据 -->
<view class="head-box">
<view class="title-text">累计收入(元)</view>
<view class="title-num">¥{{pageInfo.incomeTotal}}</view>
<view class="title-li">
<view>
<text>可提现佣金</text>
<text>¥{{pageInfo.toBeWithdrawal}}</text>
</view>
<view>
<text>待打款佣金</text>
<text>¥{{pageInfo.pendingPayment}}</text>
</view>
<view>
<text>累计提现金额</text>
<text>¥{{pageInfo.withdrawalSuccessful}}</text>
</view>
</view>
</view>
<!-- 菜单列表 -->
<view class="menu-box">
<view bindtap="goPage" data-page="/pages/newly/balanceWithdraw">
<image src="../../../images/icon/cash.png"></image>
<text>提现申请</text>
</view>
<view bindtap="goPage" data-page="/pages/userAccount/distributionOrder/index">
<image src="../../../images/icon/management@2x.png"></image>
<text>账户明细</text>
</view>
<view bindtap="goPage" data-page="/pages/userAccount/withdrawalRecord/index">
<image src="../../../images/icon/detaileds@2x.png"></image>
<text>提现记录</text>
</view>
</view>
</view>
\ No newline at end of file
/* pages/userAccount/comDetails/index.wxss */
page {
background: #f4f4f4;
}
.page-view {
width: 100%;
display: flex;
align-items: center;
flex-direction: column;
min-height: 100vh;
}
.head-box {
width: 100%;
display: flex;
align-items: center;
flex-direction: column;
color: white;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAABxCAYAAACkwXoWAAABS2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxMzggNzkuMTU5ODI0LCAyMDE2LzA5LzE0LTAxOjA5OjAxICAgICAgICAiPgogPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIi8+CiA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgo8P3hwYWNrZXQgZW5kPSJyIj8+IEmuOgAAAZBJREFUeJzt1DEBwCAAwLAxYfhEGXJABkcTBb065trnAwj6XwcAvGKAQJYBAlkGCGQZIJBlgECWAQJZBghkGSCQZYBAlgECWQYIZBkgkGWAQJYBAlkGCGQZIJBlgECWAQJZBghkGSCQZYBAlgECWQYIZBkgkGWAQJYBAlkGCGQZIJBlgECWAQJZBghkGSCQZYBAlgECWQYIZBkgkGWAQJYBAlkGCGQZIJBlgECWAQJZBghkGSCQZYBAlgECWQYIZBkgkGWAQJYBAlkGCGQZIJBlgECWAQJZBghkGSCQZYBAlgECWQYIZBkgkGWAQJYBAlkGCGQZIJBlgECWAQJZBghkGSCQZYBAlgECWQYIZBkgkGWAQJYBAlkGCGQZIJBlgECWAQJZBghkGSCQZYBAlgECWQYIZBkgkGWAQJYBAlkGCGQZIJBlgECWAQJZBghkGSCQZYBAlgECWQYIZBkgkGWAQJYBAlkGCGQZIJBlgECWAQJZBghkGSCQZYBAlgECWQYIZBkgkGWAQJYBAlkGCGRdKykDj9OUNYkAAAAASUVORK5CYII=");
}
.title-text {
margin-top: 40rpx;
font-size: 32rpx;
}
.title-num {
margin: 10rpx 0 0 0;
font-size: 30rpx;
}
.title-li {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin: 40rpx 0 40rpx 0;
}
.title-li view {
width: 100%;
display: flex;
align-items: center;
flex-direction: column;
}
.title-li view text {
width: 100%;
text-align: center;
font-size: 30rpx;
margin: 10rpx 0 0 0;
}
.menu-box {
display: flex;
align-items: center;
flex-direction: column;
box-shadow: 0rpx 1rpx 15rpx #bababa;
width: 690rpx;
padding: 30rpx 0;
background: white;
border-radius: 20rpx;
margin: 40rpx 0;
}
.menu-box view {
display: flex;
align-items: center;
flex-direction: row;
width: 100%;
}
.menu-box view image {
width: 67rpx;
height: 64rpx;
margin: 20rpx 0 0 20rpx;
}
.menu-box view text {
font-size: 28rpx;
}
\ No newline at end of file
// var util = require('../../../config/util.js');
// var api = require('../../../config/api.js');
// var user = require('../../../services/user.js');
// var utils = require('../../../utils/util.js')
Page({
/**
* 页面的初始数据
*/
data: {
// pageImgHead: api.Url_URI,
tabs: [
{ name: '全部', type: 0 },
{ name: '待分成', type: 1 },
{ name: '已分成', type: 2 },
{ name: '取消分成', type: 3 }
],
getTabs: 0,
pageNo: 1,
list: [],
total: 0
},
// 选项卡切换
tabsGet(data) {
this.setData({ getTabs: data.currentTarget.dataset.index, list: [] })
this.userMyTeam(data.currentTarget.dataset.index)
},
// 列表内容
userMyTeam(type) {
var that = this;
var token = wx.getStorageSync('token');
var userInfo = JSON.parse(wx.getStorageSync('userinfo'));
util.request(api.distributionOrder, {
'type': that.data.tabs[type].type,
'token': token,
'pageNo': that.data.pageNo,
'pageSize': 10
}).then(res => {
var info = res.data.pageBean.list;
// debugger
for (var i in info) {
info[i].amountAll = (info[i].amount * info[i].goodsNum).toFixed(2)
that.data.list.push(info[i])
}
that.setData({
list: that.data.list,
total: res.data.pageBean.totalCount
})
console.log(that.data.list)
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// this.userMyTeam(0);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if (this.data.total > this.data.list.length) {
that.setData({
pageNo: pageNo++
})
// this.userMyTeam(this.data.tabs[this.data.getTabs].type)
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "分销订单"
}
\ No newline at end of file
<view class="page">
<!-- 选项卡 -->
<view class="tabs">
<view wx:for="{{tabs}}" wx:key="index" bindtap="tabsGet" data-index="{{index}}"
class="{{getTabs == index ? 'tabsTrue' : 'tabsFalse'}}">{{item.name}}</view>
</view>
<!-- 列表展示 -->
<view class="list-box">
<!-- 列表展示 -->
<view class="li-box" wx:for="{{list}}" wx:key="index">
<view class="li-head">
<text>分销等级:{{item.distributionLevel}}</text>
<text>下单人:{{item.userName}}</text>
</view>
<view class="li-body">
<image src="{{pageImgHead}}{{item.bannerJson}}"></image>
<view class="li-user">
<text>{{item.goodsName}}</text>
<text>x{{item.goodsNum}}</text>
</view>
<view class="li-num">¥{{item.goodsAmount}}</view>
</view>
<view class="li-bottom">
<view>
<text>订单编号:{{item.subOrderId}}</text>
<text>下单时间:{{item.insertTime}}</text>
</view>
<view>佣金:¥{{item.amountAll}}</view>
</view>
</view>
<!-- 暂无内容 -->
<view class="offList" wx:if="{{list.length == 0}}">—— 暂无内容 ——</view>
</view>
</view>
\ No newline at end of file
page {
background: #f4f4f4;
}
.tabs{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
height: 80rpx;
background: white;
position: fixed;
top: 0;
}
.tabs view{
width: 100%;
text-align: center;
}
.tabsTrue{
font-size: 32rpx;
font-weight: bold;
}
.tabsFalse{
font-size: 28rpx;
color: #999999;
}
.list-box{
margin-top: 90rpx;
display: flex;
align-items: center;
flex-direction: column;
min-height: 80vh;
}
.li-box{
display: flex;
align-items: center;
flex-direction: column;
box-shadow: 0rpx 1rpx 15rpx #bababa;
width: 690rpx;
padding: 30rpx 0;
background: white;
border-radius: 20rpx;
margin: 20rpx 0;
}
.li-box image{
width: 130rpx;
height: 130rpx;
margin: 0 20rpx 0 20rpx;
}
.li-body{
display: flex;
align-items: center;
flex-direction: row;
width: 100%;
margin: 20rpx 0
}
.li-user{
flex: 1;
display: flex;
align-items: center;
flex-direction: column;
font-size: 30rpx;
margin: 0 0 0 20rpx;
height: 130rpx;
}
.li-user text{
width: 100%;
}
.li-user text:nth-child(1){
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.li-user text:nth-child(2){
color: #999999;
}
.li-num{
color: #030521;
font-size: 32rpx;
margin: 0 20rpx;
font-weight: bold;
}
.offList{
font-size: 30rpx;
color: #999999;
}
.li-head{
width: 100%;
display: flex;
align-items: center;
flex-direction: row;
border-bottom: 1rpx solid #F2F2F2;
padding: 0 0 20rpx 0;
}
.li-head text:nth-child(1){
flex: 1;
font-size: 30rpx;
margin-left: 20rpx;
}
.li-head text:nth-child(2){
font-size: 30rpx;
margin-right: 20rpx;
}
.li-bottom{
display: flex;
align-items: center;
flex-direction: row;
width: 100%;
border-top: 1rpx solid #F2F2F2;
padding: 20rpx 0 0 0;
}
.li-bottom view:nth-child(1){
flex: 1;
display: flex;
align-items: center;
flex-direction: column;
margin: 0 0 0 20rpx;
}
.li-bottom view:nth-child(1) text{
width: 100%;
font-size: 24rpx;
color: #999999;
}
.li-bottom view:nth-child(2){
font-size: 32rpx;
color: #030521;
font-weight: bold;
margin: 0 20rpx;
}
\ No newline at end of file
// pages/userAccount/myTeam/index.js
// var util = require('../../../config/util.js');
// var api = require('../../../config/api.js');
// var user = require('../../../services/user.js');
Page({
/**
* 页面的初始数据
*/
data: {
tabs: [{name: '一级会员'}, {name: '二级会员'}],
getTabs: 0,
list: []
},
// 选项卡切换
tabsGet(data){
this.setData({ getTabs: data.currentTarget.dataset.index, list: [] })
this.userMyTeam(data.currentTarget.dataset.index)
},
// 列表内容
userMyTeam(type){
var that = this;
var token = wx.getStorageSync('token');
var userInfo = JSON.parse(wx.getStorageSync('userinfo'));
util.request(api.userMyTeam, {
'type': type + 1,
'token': token
}).then(res => {
that.setData({
list: res.data.teamParamList
})
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// this.userMyTeam(0);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "我的团队"
}
\ No newline at end of file
<!--pages/userAccount/myTeam/index.wxml-->
<view class="page">
<!-- 选项卡 -->
<view class="tabs">
<view wx:for="{{tabs}}" wx:key="index" bindtap="tabsGet" data-index="{{index}}"
class="{{getTabs == index ? 'tabsTrue' : 'tabsFalse'}}">{{item.name}}</view>
</view>
<!-- 列表展示 -->
<view class="list-box">
<!-- 列表展示 -->
<view class="li-box" wx:for="{{list}}" wx:key="index">
<image src="{{item.picture}}"></image>
<view class="li-user">
<text>会员名称:{{item.userName}}</text>
<text>成为会员:{{itme.registerTime}}</text>
</view>
<view class="li-num">
<text>¥{{item.amount}}</text>
<view>{{item.teamNum}}个成员</view>
</view>
</view>
<!-- 暂无内容 -->
<view class="offList" wx:if="{{list.length == 0}}">—— 暂无内容 ——</view>
</view>
</view>
\ No newline at end of file
/* pages/userAccount/myTeam/index.wxss */
page {
background: #f4f4f4;
}
.tabs{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
height: 80rpx;
background: white;
position: fixed;
top: 0;
}
.tabs view{
width: 100%;
text-align: center;
}
.tabsTrue{
font-size: 32rpx;
font-weight: bold;
}
.tabsFalse{
font-size: 28rpx;
color: #999999;
}
.list-box{
margin-top: 90rpx;
display: flex;
align-items: center;
flex-direction: column;
min-height: 80vh;
}
.li-box{
display: flex;
align-items: center;
flex-direction: row;
box-shadow: 0rpx 1rpx 15rpx #bababa;
width: 690rpx;
padding: 30rpx 0;
background: white;
border-radius: 20rpx;
margin: 20rpx 0;
}
.li-box image{
width: 90rpx;
height: 90rpx;
border-radius: 50%;
margin: 0 20rpx 0 20rpx;
}
.li-user{
flex: 1;
display: flex;
align-items: center;
flex-direction: column;
font-size: 30rpx;
}
.li-user text{
width: 100%;
}
.li-user text:nth-child(2){
color: #999999;
}
.li-num{
display: flex;
align-items: center;
flex-direction: column;
margin: 0 20rpx 0 0;
}
.li-num text{
font-size: 30rpx;
}
.li-num view{
color: white;
background: #030521;
font-size: 22rpx;
height: 40rpx;
line-height: 40rpx;
padding: 0 10rpx;
border-radius: 10rpx;
}
.offList{
font-size: 30rpx;
color: #999999;
}
\ No newline at end of file
// var util = require('../../../config/util.js');
// var api = require('../../../config/api.js');
// var user = require('../../../services/user.js');
// var utils = require('../../../utils/util.js')
Page({
/**
* 页面的初始数据
*/
data: {
tabs: [
{ name: '全部', type: 3 },
{ name: '待审核', type: 0 },
{ name: '已审核', type: 1 },
{ name: '未通过', type: 2 }
],
getTabs: 0,
pageNo: 1,
list: [],
total: 0
},
// 选项卡切换
tabsGet(data) {
this.setData({ getTabs: data.currentTarget.dataset.index, list: [] })
this.userMyTeam(data.currentTarget.dataset.index)
},
// 列表内容
userMyTeam(type) {
var that = this;
var token = wx.getStorageSync('token');
var userInfo = JSON.parse(wx.getStorageSync('userinfo'));
util.request(api.listWithdraw, {
'type': that.data.tabs[type].type,
'token': token,
'pageNo': that.data.pageNo,
'pageSize': 10
}).then(res => {
var info = res.data.withdrawList.list;
// debugger
for(var i in info){
info[i].createTime = utils.formatTimeTwo(info[i].createTime.time, 'Y:M:D h:m:s')
that.data.list.push(info[i])
}
that.setData({
list: that.data.list,
total: res.data.withdrawList.totalCount
})
console.log(that.data.list)
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// this.userMyTeam(0);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if (this.data.total > this.data.list.length){
that.setData({
pageNo: pageNo++
})
this.userMyTeam(this.data.tabs[this.data.getTabs].type)
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "提现记录"
}
\ No newline at end of file
<view class="page">
<!-- 选项卡 -->
<view class="tabs">
<view wx:for="{{tabs}}" wx:key="index" bindtap="tabsGet" data-index="{{index}}"
class="{{getTabs == index ? 'tabsTrue' : 'tabsFalse'}}">{{item.name}}</view>
</view>
<!-- 列表展示 -->
<view class="list-box">
<!-- 列表展示 -->
<view class="li-box" wx:for="{{list}}" wx:key="index">
<view class="li-head">
<text wx:if="{{item.status == 0}}">待审核</text>
<text wx:if="{{item.status == 1}}">已审核</text>
<text wx:if="{{item.status == 0}}">未通过</text>
<text>-</text>
</view>
<view class="li-body">
<view class="li-user">
<text>姓名:{{item.name}}</text>
<text>提现时间:{{item.createTime}}</text>
</view>
<view class="li-num">¥{{item.amount}}</view>
</view>
</view>
<!-- 暂无内容 -->
<view class="offList" wx:if="{{list.length == 0}}">—— 暂无内容 ——</view>
</view>
</view>
\ No newline at end of file
page {
background: #f4f4f4;
}
.tabs{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
height: 80rpx;
background: white;
position: fixed;
top: 0;
}
.tabs view{
width: 100%;
text-align: center;
}
.tabsTrue{
font-size: 32rpx;
font-weight: bold;
}
.tabsFalse{
font-size: 28rpx;
color: #999999;
}
.list-box{
margin-top: 90rpx;
display: flex;
align-items: center;
flex-direction: column;
min-height: 80vh;
}
.li-box{
display: flex;
align-items: center;
flex-direction: column;
box-shadow: 0rpx 1rpx 15rpx #bababa;
width: 690rpx;
padding: 30rpx 0;
background: white;
border-radius: 20rpx;
margin: 20rpx 0;
}
.li-box image{
width: 90rpx;
height: 90rpx;
border-radius: 50%;
margin: 0 20rpx 0 20rpx;
}
.li-body{
display: flex;
align-items: center;
flex-direction: row;
width: 100%;
}
.li-user{
flex: 1;
display: flex;
align-items: center;
flex-direction: column;
font-size: 30rpx;
margin: 0 0 0 20rpx;
}
.li-user text{
width: 100%;
}
.li-user text:nth-child(2){
color: #999999;
}
.li-num{
color: #030521;
font-size: 32rpx;
margin-right: 20rpx;
}
.offList{
font-size: 30rpx;
color: #999999;
}
.li-head{
width: 100%;
display: flex;
align-items: center;
flex-direction: row;
border-bottom: 1rpx solid #F2F2F2;
padding: 0 0 20rpx 0;
}
.li-head text:nth-child(1){
flex: 1;
font-size: 30rpx;
margin-left: 20rpx;
}
.li-head text:nth-child(2){
font-size: 30rpx;
margin-right: 20rpx;
}
\ No newline at end of file
var domain = "http://192.168.31.105:8086/capi"; //统一接口域名,测试环境 var domain = "http://192.168.31.110:8086/capi"; //统一接口域名,测试环境
exports.domain = domain; exports.domain = domain;
...@@ -19,7 +19,7 @@ function request(params, isGetTonken) { ...@@ -19,7 +19,7 @@ function request(params, isGetTonken) {
method: params.method == undefined ? "POST" : params.method, method: params.method == undefined ? "POST" : params.method,
dataType: 'json', dataType: 'json',
responseType: params.responseType == undefined ? 'text' : params.responseType, responseType: params.responseType == undefined ? 'text' : params.responseType,
success: function(res) { success: function (res) {
if (res.statusCode == 200) { if (res.statusCode == 200) {
//如果有定义了params.callBack,则调用 params.callBack(res.data) //如果有定义了params.callBack,则调用 params.callBack(res.data)
if (params.callBack) { if (params.callBack) {
...@@ -56,7 +56,7 @@ function request(params, isGetTonken) { ...@@ -56,7 +56,7 @@ function request(params, isGetTonken) {
wx.hideLoading(); wx.hideLoading();
} }
}, },
fail: function(err) { fail: function (err) {
wx.hideLoading(); wx.hideLoading();
wx.showToast({ wx.showToast({
title: "服务器出了点小差", title: "服务器出了点小差",
...@@ -67,7 +67,7 @@ function request(params, isGetTonken) { ...@@ -67,7 +67,7 @@ function request(params, isGetTonken) {
} }
//通过code获取token,并保存到缓存 //通过code获取token,并保存到缓存
var getToken = function() { var getToken = function () {
wx.login({ wx.login({
success: res => { success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId // 发送 res.code 到后台换取 openId, sessionKey, unionId
...@@ -91,6 +91,7 @@ var getToken = function() { ...@@ -91,6 +91,7 @@ var getToken = function() {
wx.setStorageSync('token', ''); wx.setStorageSync('token', '');
} else { } else {
wx.setStorageSync('token', 'bearer' + result.access_token); //把token存入缓存,请求接口数据时要用 wx.setStorageSync('token', 'bearer' + result.access_token); //把token存入缓存,请求接口数据时要用
this.getUserInfo()
} }
var globalData = getApp().globalData; var globalData = getApp().globalData;
globalData.isLanding = false; globalData.isLanding = false;
...@@ -103,7 +104,19 @@ var getToken = function() { ...@@ -103,7 +104,19 @@ var getToken = function() {
} }
}) })
} }
// 用户信息
function getUserInfo() {
var params = {
url: "/p/user/getUserInfo",
method: "GET",
data: {},
callBack: (res) => {
console.log('用户信息', res.result)
app.globalData.userInfo = res.result
}
};
http.request(params);
}
// 更新用户头像昵称 // 更新用户头像昵称
function updateUserInfo() { function updateUserInfo() {
wx.getUserInfo({ wx.getUserInfo({
...@@ -127,7 +140,7 @@ function getCartCount() { ...@@ -127,7 +140,7 @@ function getCartCount() {
url: "/p/shopCart/prodCount", url: "/p/shopCart/prodCount",
method: "GET", method: "GET",
data: {}, data: {},
callBack: function(res) { callBack: function (res) {
if (res > 0) { if (res > 0) {
wx.setTabBarBadge({ wx.setTabBarBadge({
index: 2, index: 2,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment