mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-20 01:12:50 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
3e28aee589
@ -1273,29 +1273,17 @@ class AuthApi extends AuthController{
|
|||||||
->join('__STORE_ORDER__ B','A.link_id = B.id AND B.uid = '.$uid)->select()->toArray();
|
->join('__STORE_ORDER__ B','A.link_id = B.id AND B.uid = '.$uid)->select()->toArray();
|
||||||
return JsonService::successful($list);
|
return JsonService::successful($list);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* 申请提现
|
|
||||||
*/
|
|
||||||
// public function user_extract()
|
|
||||||
// {
|
|
||||||
// if(UserExtract::userExtract($this->userInfo,UtilService::postMore([
|
|
||||||
// ['type','','','extract_type'],'real_name','alipay_code','bank_code','bank_address',['price','','','extract_price']
|
|
||||||
// ])))
|
|
||||||
// return JsonService::successful('申请提现成功!');
|
|
||||||
// else
|
|
||||||
// return JsonService::fail(Extract::getErrorInfo());
|
|
||||||
// }
|
|
||||||
public function user_extract()
|
public function user_extract()
|
||||||
{ $request = Request::instance();
|
{ $request = Request::instance();
|
||||||
$list=$request->param();
|
$list=$request->param();
|
||||||
$data=$list['lists'];
|
$data=$list['lists'];
|
||||||
// dump($data);
|
|
||||||
// dump($this->userInfo);
|
|
||||||
if(UserExtract::userExtract($this->userInfo,$data))
|
if(UserExtract::userExtract($this->userInfo,$data))
|
||||||
return JsonService::successful('申请提现成功!');
|
return JsonService::successful('申请提现成功!');
|
||||||
else
|
else
|
||||||
return JsonService::fail(UserExtract::getErrorInfo());
|
return JsonService::fail(UserExtract::getErrorInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 提现列表
|
* 提现列表
|
||||||
*/
|
*/
|
||||||
@ -1315,28 +1303,20 @@ class AuthApi extends AuthController{
|
|||||||
* @param int $first
|
* @param int $first
|
||||||
* @param int $limit
|
* @param int $limit
|
||||||
*/
|
*/
|
||||||
public function subordinateOrderlist($first = 0, $limit = 8)
|
public function subordinateOrderlist($first = 0, $limit = 8){
|
||||||
{ $request = Request::instance();
|
$request = Request::instance();
|
||||||
$lists=$request->param();
|
$lists=$request->param();
|
||||||
$xuid=$lists['uid'];$status=$lists['status'];
|
$xUid = $lists['uid'];
|
||||||
if($status==0){
|
$status = $lists['status'];
|
||||||
$type='';
|
if($status == 0) $type='';
|
||||||
}elseif($status==1){
|
elseif($status == 1) $type=4;
|
||||||
$type=4;
|
elseif($status == 2) $type=3;
|
||||||
}elseif($status==2){
|
else return false;
|
||||||
$type=3;
|
$list = [];
|
||||||
}else{
|
if(!$xUid){
|
||||||
return false;
|
$arr = User::where('spread_uid',$this->userInfo['uid'])->column('uid');
|
||||||
}
|
foreach($arr as $v) $list = StoreOrder::getUserOrderList($v,$type,$first,$limit);
|
||||||
if($xuid==0){
|
}else $list = StoreOrder::getUserOrderList($xUid,$type,$first,$limit);
|
||||||
$arr=User::where('spread_uid',$this->userInfo['uid'])->column('uid');
|
|
||||||
foreach($arr as $v){
|
|
||||||
|
|
||||||
$list = StoreOrder::getUserOrderList($v,$type,$first,$limit);
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
$list = StoreOrder::getUserOrderList($xuid,$type,$first,$limit);
|
|
||||||
}
|
|
||||||
foreach ($list as $k=>$order){
|
foreach ($list as $k=>$order){
|
||||||
$list[$k] = StoreOrder::tidyOrder($order,true);
|
$list[$k] = StoreOrder::tidyOrder($order,true);
|
||||||
if($list[$k]['_status']['_type'] == 3){
|
if($list[$k]['_status']['_type'] == 3){
|
||||||
@ -1354,16 +1334,18 @@ class AuthApi extends AuthController{
|
|||||||
*/
|
*/
|
||||||
public function subordinateOrderlistmoney()
|
public function subordinateOrderlistmoney()
|
||||||
{
|
{
|
||||||
$arr=User::where('spread_uid',$this->userInfo['uid'])->column('uid');
|
$request = Request::instance();
|
||||||
foreach($arr as $v){
|
$lists=$request->param();
|
||||||
$list = StoreOrder::getUserOrderList($v,$type='');
|
$status = $lists['status'];
|
||||||
}
|
$type = '';
|
||||||
|
if($status == 1) $type = 4;
|
||||||
foreach ($list as $k=>$v){
|
elseif($status == 2) $type = 3;
|
||||||
$arr[]=$v['pay_price'];
|
$arr = User::where('spread_uid',$this->userInfo['uid'])->column('uid');
|
||||||
}
|
$list = StoreOrder::getUserOrderCount(implode(',',$arr),$type);
|
||||||
$cont=count($list);
|
$price = [];
|
||||||
$sum=array_sum($arr);
|
foreach ($list as $k=>$v) $price[]=$v['pay_price'];
|
||||||
|
$cont = count($list);
|
||||||
|
$sum = array_sum($price);
|
||||||
return JsonService::successful(['cont'=>$cont,'sum'=>$sum]);
|
return JsonService::successful(['cont'=>$cont,'sum'=>$sum]);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -644,6 +644,17 @@ class StoreOrder extends ModelBasic
|
|||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取推广人地下用户的订单金额
|
||||||
|
* @param string $uid
|
||||||
|
* @param string $status
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function getUserOrderCount($uid = '',$status = ''){
|
||||||
|
$res = self::statusByWhere($status)->where('uid','IN',$uid)->column('pay_price');
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
public static function searchUserOrder($uid,$order_id)
|
public static function searchUserOrder($uid,$order_id)
|
||||||
{
|
{
|
||||||
$order = self::where('uid',$uid)->where('order_id',$order_id)->where('is_del',0)->field('seckill_id,bargain_id,combination_id,id,order_id,pay_price,total_num,total_price,pay_postage,total_postage,paid,status,refund_status,pay_type,coupon_price,deduction_price,delivery_type')
|
$order = self::where('uid',$uid)->where('order_id',$order_id)->where('is_del',0)->field('seckill_id,bargain_id,combination_id,id,order_id,pay_price,total_num,total_price,pay_postage,total_postage,paid,status,refund_status,pay_type,coupon_price,deduction_price,delivery_type')
|
||||||
|
|||||||
@ -38,7 +38,9 @@ class UserExtract extends ModelBasic
|
|||||||
public static function userExtract($userInfo,$data){
|
public static function userExtract($userInfo,$data){
|
||||||
if(!in_array($data['extract_type'],self::$extractType))
|
if(!in_array($data['extract_type'],self::$extractType))
|
||||||
return self::setErrorInfo('提现方式不存在');
|
return self::setErrorInfo('提现方式不存在');
|
||||||
$balance = bcsub($userInfo['now_money'],$data['money']);
|
$userInfo = User::get($userInfo['uid']);
|
||||||
|
if($data['money'] > $userInfo['now_money']) return self::setErrorInfo('余额不足');;
|
||||||
|
$balance = bcsub($userInfo['now_money'],$data['money'],2);
|
||||||
$insertData = [
|
$insertData = [
|
||||||
'uid'=>$userInfo['uid'],
|
'uid'=>$userInfo['uid'],
|
||||||
'extract_type'=>$data['extract_type'],
|
'extract_type'=>$data['extract_type'],
|
||||||
@ -84,24 +86,13 @@ class UserExtract extends ModelBasic
|
|||||||
if(!$res1) return self::setErrorInfo('提现失败');
|
if(!$res1) return self::setErrorInfo('提现失败');
|
||||||
$res2 = User::edit(['now_money'=>$balance],$userInfo['uid'],'uid');
|
$res2 = User::edit(['now_money'=>$balance],$userInfo['uid'],'uid');
|
||||||
$res3 = UserBill::expend('余额提现',$userInfo['uid'],'now_money','extract',$data['money'],$res1['id'],$balance,$mark);
|
$res3 = UserBill::expend('余额提现',$userInfo['uid'],'now_money','extract',$data['money'],$res1['id'],$balance,$mark);
|
||||||
|
|
||||||
$res = $res2 && $res3;
|
$res = $res2 && $res3;
|
||||||
// WechatTemplateService::sendTemplate(
|
self::checkTrans($res);
|
||||||
// WechatUser::uidToOpenid($userInfo['uid']),
|
if($res){
|
||||||
// WechatTemplateService::USER_BALANCE_CHANGE,
|
//发送模板消息
|
||||||
// [
|
|
||||||
// 'first'=>'你好,申请余额提现成功!',
|
|
||||||
// 'keyword1'=>'余额提现',
|
|
||||||
// 'keyword2'=>date('Y-m-d'),
|
|
||||||
// 'keyword3'=>$data['money'],
|
|
||||||
// 'remark'=>'点击查看我的余额明细'
|
|
||||||
// ],
|
|
||||||
// Url::build('wap/My/balance',[],true,true)
|
|
||||||
// );
|
|
||||||
if($res)
|
|
||||||
return true;
|
return true;
|
||||||
else
|
}
|
||||||
return self::setErrorInfo('提现失败!');
|
else return self::setErrorInfo('提现失败!');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -2,155 +2,169 @@
|
|||||||
var app = getApp();
|
var app = getApp();
|
||||||
// var wxh = require('../../utils/wxh.js');
|
// var wxh = require('../../utils/wxh.js');
|
||||||
App({
|
App({
|
||||||
onLaunch: function () {
|
onLaunch: function () {
|
||||||
// 展示本地存储能力
|
// 展示本地存储能力
|
||||||
var that = this;
|
var that = this;
|
||||||
var logs = wx.getStorageSync('logs') || []
|
var logs = wx.getStorageSync('logs') || []
|
||||||
logs.unshift(Date.now())
|
logs.unshift(Date.now())
|
||||||
wx.setStorageSync('logs', logs)
|
wx.setStorageSync('logs', logs)
|
||||||
that.getRoutineStyle();
|
that.getRoutineStyle();
|
||||||
},
|
},
|
||||||
globalData: {
|
globalData: {
|
||||||
routineStyle:'#ffffff',
|
routineStyle:'#ffffff',
|
||||||
uid: null,
|
uid: null,
|
||||||
openPages:'',
|
openPages:'',
|
||||||
spid:0,
|
spid:0,
|
||||||
urlImages: '',
|
urlImages: '',
|
||||||
url: 'https://shop.crmeb.net/'
|
url: 'https://shop.crmeb.net/'
|
||||||
},
|
},
|
||||||
getRoutineStyle:function(){
|
getRoutineStyle:function(){
|
||||||
var that = this;
|
var that = this;
|
||||||
wx.request({
|
wx.request({
|
||||||
url: that.globalData.url + '/routine/login/get_routine_style',
|
url: that.globalData.url + '/routine/login/get_routine_style',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
dataType : 'json',
|
dataType : 'json',
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
that.globalData.routineStyle = res.data.data.routine_style;
|
that.globalData.routineStyle = res.data.data.routine_style;
|
||||||
that.setBarColor();
|
that.setBarColor();
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
setBarColor:function(){
|
|
||||||
var that = this;
|
|
||||||
wx.setNavigationBarColor({
|
|
||||||
frontColor: '#000000',
|
|
||||||
backgroundColor: that.globalData.routineStyle,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
setUserInfo : function(){
|
|
||||||
var that = this;
|
|
||||||
if (that.globalData.uid == null) {//是否存在用户信息,如果不存在跳转到首页
|
|
||||||
wx.showToast({
|
|
||||||
title: '用户信息获取失败',
|
|
||||||
icon: 'none',
|
|
||||||
duration: 1500,
|
|
||||||
})
|
|
||||||
setTimeout(function () {
|
|
||||||
wx.navigateTo({
|
|
||||||
url: '/pages/enter/enter',
|
|
||||||
})
|
|
||||||
}, 2000)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getUserInfo: function () {
|
|
||||||
var that = this;
|
|
||||||
wx.getUserInfo({
|
|
||||||
lang: 'zh_CN',
|
|
||||||
success: function (res) {
|
|
||||||
var userInfo = res.userInfo
|
|
||||||
wx.login({
|
|
||||||
success: function (res) {
|
|
||||||
if (res.code) {
|
|
||||||
userInfo.code = res.code;
|
|
||||||
userInfo.spid = that.globalData.spid;
|
|
||||||
wx.request({
|
|
||||||
url: that.globalData.url + '/routine/login/index',
|
|
||||||
method: 'post',
|
|
||||||
dataType : 'json',
|
|
||||||
data: {
|
|
||||||
info: userInfo
|
|
||||||
},
|
|
||||||
success: function (res) {
|
|
||||||
that.globalData.uid = res.data.data.uid;
|
|
||||||
if (!res.data.data.status){
|
|
||||||
wx.redirectTo({
|
|
||||||
url: '/pages/login-status/login-status',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (that.globalData.openPages != '') {
|
|
||||||
wx.reLaunch({
|
|
||||||
url: that.globalData.openPages
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
wx.switchTab({
|
|
||||||
url: '/pages/index/index'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: function () {
|
|
||||||
console.log('获取用户信息失败');
|
|
||||||
wx.navigateTo({
|
|
||||||
url: '/pages/enter/enter',
|
|
||||||
})
|
|
||||||
},
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
console.log('登录失败!' + res.errMsg)
|
|
||||||
}
|
}
|
||||||
},
|
})
|
||||||
fail: function () {
|
},
|
||||||
console.log('获取用户信息失败');
|
setBarColor:function(){
|
||||||
wx.navigateTo({
|
var that = this;
|
||||||
url: '/pages/enter/enter',
|
wx.setNavigationBarColor({
|
||||||
|
frontColor: '#000000',
|
||||||
|
backgroundColor: that.globalData.routineStyle,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
setUserInfo : function(){
|
||||||
|
var that = this;
|
||||||
|
if (that.globalData.uid == null) {//是否存在用户信息,如果不存在跳转到首页
|
||||||
|
wx.showToast({
|
||||||
|
title: '用户信息获取失败',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1500,
|
||||||
})
|
})
|
||||||
},
|
setTimeout(function () {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/enter/enter',
|
||||||
|
})
|
||||||
|
}, 2000)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getUserInfo: function () {
|
||||||
|
var that = this;
|
||||||
|
wx.getUserInfo({
|
||||||
|
lang: 'zh_CN',
|
||||||
|
success: function (res) {
|
||||||
|
var userInfo = res.userInfo
|
||||||
|
wx.login({
|
||||||
|
success: function (res) {
|
||||||
|
if (res.code) {
|
||||||
|
userInfo.code = res.code;
|
||||||
|
userInfo.spid = that.globalData.spid;
|
||||||
|
wx.request({
|
||||||
|
url: that.globalData.url + '/routine/login/index',
|
||||||
|
method: 'post',
|
||||||
|
dataType : 'json',
|
||||||
|
data: {
|
||||||
|
info: userInfo
|
||||||
|
},
|
||||||
|
success: function (res) {
|
||||||
|
that.globalData.uid = res.data.data.uid;
|
||||||
|
if (!res.data.data.status){
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '/pages/login-status/login-status',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (that.globalData.openPages != '') {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: that.globalData.openPages
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
wx.switchTab({
|
||||||
|
url: '/pages/index/index'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: function () {
|
||||||
|
console.log('获取用户信息失败');
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/enter/enter',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.log('登录失败!' + res.errMsg)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: function () {
|
||||||
|
console.log('获取用户信息失败');
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/enter/enter',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail:function(){
|
||||||
|
console.log('获取用户信息失败');
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/enter/enter',
|
||||||
|
})
|
||||||
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
fail:function(){
|
getUserInfoEnter: function () {
|
||||||
console.log('获取用户信息失败');
|
var that = this;
|
||||||
wx.navigateTo({
|
wx.getUserInfo({
|
||||||
url: '/pages/enter/enter',
|
lang: 'zh_CN',
|
||||||
})
|
success: function (res) {
|
||||||
},
|
var userInfo = res.userInfo
|
||||||
})
|
wx.login({
|
||||||
},
|
success: function (res) {
|
||||||
getUserInfoEnter: function () {
|
if (res.code) {
|
||||||
var that = this;
|
userInfo.code = res.code;
|
||||||
wx.getUserInfo({
|
userInfo.spid = that.globalData.spid;
|
||||||
lang: 'zh_CN',
|
wx.request({
|
||||||
success: function (res) {
|
url: that.globalData.url + '/routine/login/index',
|
||||||
var userInfo = res.userInfo
|
method: 'post',
|
||||||
wx.login({
|
dataType : 'json',
|
||||||
success: function (res) {
|
data: {
|
||||||
if (res.code) {
|
info: userInfo
|
||||||
userInfo.code = res.code;
|
},
|
||||||
userInfo.spid = that.globalData.spid;
|
success: function (res) {
|
||||||
wx.request({
|
that.globalData.uid = res.data.data.uid;
|
||||||
url: that.globalData.url + '/routine/login/index',
|
if (that.globalData.openPages != '') {
|
||||||
method: 'post',
|
wx.navigateTo({
|
||||||
dataType : 'json',
|
url: that.globalData.openPages
|
||||||
data: {
|
})
|
||||||
info: userInfo
|
} else {
|
||||||
},
|
wx.reLaunch({
|
||||||
success: function (res) {
|
url: '/pages/index/index'
|
||||||
that.globalData.uid = res.data.data.uid;
|
})
|
||||||
if (that.globalData.openPages != '') {
|
}
|
||||||
wx.reLaunch({
|
}
|
||||||
url: that.globalData.openPages
|
})
|
||||||
})
|
} else {
|
||||||
} else {
|
console.log('登录失败!' + res.errMsg)
|
||||||
wx.reLaunch({
|
}
|
||||||
url: '/pages/index/index'
|
},
|
||||||
})
|
fail: function (res) {
|
||||||
}
|
wx.showToast({
|
||||||
}
|
title: '授权失败,请重新打开小程序',
|
||||||
})
|
icon: 'none',
|
||||||
} else {
|
duration: 1500,
|
||||||
console.log('登录失败!' + res.errMsg)
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: function (res) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '授权失败,请重新授权',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1500,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
})
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
@ -18,6 +18,7 @@
|
|||||||
"pages/spread/spread",
|
"pages/spread/spread",
|
||||||
"pages/promotion-order/promotion-order",
|
"pages/promotion-order/promotion-order",
|
||||||
"pages/coupon/coupon",
|
"pages/coupon/coupon",
|
||||||
|
"pages/cut-list/cut-list",
|
||||||
"pages/news-list/news-list",
|
"pages/news-list/news-list",
|
||||||
"pages/product-con/index",
|
"pages/product-con/index",
|
||||||
"pages/product-pinke/index",
|
"pages/product-pinke/index",
|
||||||
@ -33,6 +34,7 @@
|
|||||||
"pages/integral-con/integral-con",
|
"pages/integral-con/integral-con",
|
||||||
"pages/orders-con/orders-con",
|
"pages/orders-con/orders-con",
|
||||||
"pages/order-confirm/order-confirm",
|
"pages/order-confirm/order-confirm",
|
||||||
|
"pages/pink-list/index",
|
||||||
"pages/productSort/productSort",
|
"pages/productSort/productSort",
|
||||||
"pages/address/address",
|
"pages/address/address",
|
||||||
"pages/feree/feree",
|
"pages/feree/feree",
|
||||||
|
|||||||
@ -1,163 +1,170 @@
|
|||||||
var app = getApp();
|
var app = getApp();
|
||||||
// pages/cash/cash.js
|
// pages/cash/cash.js
|
||||||
Page({
|
Page({
|
||||||
data: {
|
data: {
|
||||||
ooo:'',
|
ooo:'',
|
||||||
_num:0,
|
_num:0,
|
||||||
url: app.globalData.urlImages,
|
url: app.globalData.urlImages,
|
||||||
hiddentap: true,
|
hiddentap: true,
|
||||||
hidde: true,
|
hidde: true,
|
||||||
minmoney:'',
|
money:'',
|
||||||
money:'',
|
index:0,
|
||||||
index:0,
|
array:["请选择银行","招商银行","建设银行","农业银行"]
|
||||||
array:["请选择银行","招商银行","建设银行","农业银行"]
|
},
|
||||||
},
|
/**
|
||||||
/**
|
* 生命周期函数--监听页面加载
|
||||||
* 生命周期函数--监听页面加载
|
*/
|
||||||
*/
|
onLoad:function (opends) {
|
||||||
onLoad:function (opends) {
|
app.setBarColor();
|
||||||
app.setBarColor();
|
var that = this;
|
||||||
var money = opends.money;
|
this.getUserInfo();
|
||||||
var that = this;
|
this.getUserExtractBank();
|
||||||
that.setData({
|
wx.request({
|
||||||
money: money
|
url: app.globalData.url + '/routine/auth_api/minmoney?uid=' + app.globalData.uid,
|
||||||
})
|
method: 'POST',
|
||||||
this.getUserExtractBank();
|
success: function (res) {
|
||||||
wx.request({
|
that.setData({
|
||||||
url: app.globalData.url + '/routine/auth_api/minmoney?uid=' + app.globalData.uid,
|
minmoney: res.data.msg
|
||||||
method: 'POST',
|
})
|
||||||
success: function (res) {
|
}
|
||||||
that.setData({
|
|
||||||
minmoney: res.data.msg
|
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
})
|
getUserInfo:function(){
|
||||||
},
|
var that = this;
|
||||||
getUserExtractBank:function () {
|
wx.request({
|
||||||
var that = this;
|
url: app.globalData.url + '/routine/auth_api/my?uid=' + app.globalData.uid,
|
||||||
wx.request({
|
method: 'POST',
|
||||||
url: app.globalData.url + '/routine/auth_api/get_user_extract_bank?uid=' + app.globalData.uid,
|
success: function (res) {
|
||||||
method: 'get',
|
that.setData({
|
||||||
success: function (res) {
|
money: res.data.data.now_money
|
||||||
that.setData({
|
})
|
||||||
array: res.data.data
|
}
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
});
|
getUserExtractBank:function () {
|
||||||
},
|
var that = this;
|
||||||
cardtap:function(e){
|
wx.request({
|
||||||
var flag = this.data.hiddentap;
|
url: app.globalData.url + '/routine/auth_api/get_user_extract_bank?uid=' + app.globalData.uid,
|
||||||
if (flag){
|
method: 'get',
|
||||||
this.setData({
|
success: function (res) {
|
||||||
hiddentap: false
|
that.setData({
|
||||||
})
|
array: res.data.data
|
||||||
}else{
|
});
|
||||||
this.setData({
|
}
|
||||||
hiddentap: true
|
});
|
||||||
})
|
},
|
||||||
}
|
cardtap:function(e){
|
||||||
},
|
var flag = this.data.hiddentap;
|
||||||
idnumtap: function (e) {
|
if (flag){
|
||||||
this.setData({
|
this.setData({
|
||||||
_num: e.target.dataset.idnum,
|
hiddentap: false
|
||||||
hiddentap: true
|
})
|
||||||
})
|
}else{
|
||||||
if (e.target.dataset.idnum==1){
|
this.setData({
|
||||||
this.setData({
|
hiddentap: true
|
||||||
hidde: false
|
})
|
||||||
})
|
}
|
||||||
}else{
|
},
|
||||||
this.setData({
|
idnumtap: function (e) {
|
||||||
hidde: true
|
this.setData({
|
||||||
})
|
_num: e.target.dataset.idnum,
|
||||||
}
|
hiddentap: true
|
||||||
},
|
|
||||||
maskhide:function(e){
|
|
||||||
this.setData({
|
|
||||||
hiddentap: true
|
|
||||||
})
|
|
||||||
},
|
|
||||||
bindPickerChange:function(e){
|
|
||||||
this.setData({
|
|
||||||
index: e.detail.value
|
|
||||||
})
|
|
||||||
},
|
|
||||||
formSubmit:function(e){
|
|
||||||
var header = {
|
|
||||||
// 'content-type': 'application/x-www-form-urlencoded',
|
|
||||||
'cookie': app.globalData.sessionId//读取cookie
|
|
||||||
};
|
|
||||||
var that = this;
|
|
||||||
var flag = true;
|
|
||||||
var warn = "";
|
|
||||||
var minmon = that.data.minmoney;
|
|
||||||
var mymoney = that.data.money;
|
|
||||||
var list={};
|
|
||||||
if (that.data.hidde==true){
|
|
||||||
list.$name = e.detail.value.name;
|
|
||||||
list.cardnum = e.detail.value.cardnum;
|
|
||||||
list.bankname = that.data.array[that.data.index];
|
|
||||||
list.money = e.detail.value.money;
|
|
||||||
list.money = Number(list.money);
|
|
||||||
list.extract_type = 'bank';
|
|
||||||
if (list.$name == "") {
|
|
||||||
warn = "请填写持卡人姓名";
|
|
||||||
} else if (list.cardnum == "") {
|
|
||||||
warn = "请输入银行卡号";
|
|
||||||
} else if (list.bankname == "请选择银行") {
|
|
||||||
warn = "请选择银行";
|
|
||||||
} else if (list.money < minmon) {
|
|
||||||
warn = "请输入正确的金额"
|
|
||||||
} else if (list.money > mymoney) {
|
|
||||||
warn = "您的余额不足"
|
|
||||||
}else {
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
if (flag == true) {
|
|
||||||
wx.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: warn
|
|
||||||
})
|
})
|
||||||
}
|
if (e.target.dataset.idnum==1){
|
||||||
} else {
|
this.setData({
|
||||||
list.weixin = e.detail.value.weixin;
|
hidde: false
|
||||||
list.money = e.detail.value.wmoney;
|
})
|
||||||
list.money = Number(list.money);
|
}else{
|
||||||
list.extract_type = 'weixin';
|
this.setData({
|
||||||
if (list.weixin == "") {
|
hidde: true
|
||||||
warn = "请填写微信号";
|
})
|
||||||
} else if (list.money < minmon) {
|
}
|
||||||
warn = "请输入正确的金额"
|
},
|
||||||
} else if (list.money > mymoney) {
|
maskhide:function(e){
|
||||||
warn = "您的余额不足"
|
this.setData({
|
||||||
} else {
|
hiddentap: true
|
||||||
flag = false;
|
})
|
||||||
}
|
},
|
||||||
if (flag == true) {
|
bindPickerChange:function(e){
|
||||||
wx.showModal({
|
this.setData({
|
||||||
title: '提示',
|
index: e.detail.value
|
||||||
content: warn
|
})
|
||||||
|
},
|
||||||
|
formSubmit:function(e){
|
||||||
|
var header = {
|
||||||
|
// 'content-type': 'application/x-www-form-urlencoded',
|
||||||
|
'cookie': app.globalData.sessionId//读取cookie
|
||||||
|
};
|
||||||
|
var that = this;
|
||||||
|
var flag = true;
|
||||||
|
var warn = "";
|
||||||
|
var minmon = that.data.minmoney;
|
||||||
|
var mymoney = that.data.money;
|
||||||
|
var list={};
|
||||||
|
if (that.data.hidde==true){
|
||||||
|
list.$name = e.detail.value.name;
|
||||||
|
list.cardnum = e.detail.value.cardnum;
|
||||||
|
list.bankname = that.data.array[that.data.index];
|
||||||
|
list.money = e.detail.value.money;
|
||||||
|
list.money = Number(list.money);
|
||||||
|
list.extract_type = 'bank';
|
||||||
|
if (list.$name == "") {
|
||||||
|
warn = "请填写持卡人姓名";
|
||||||
|
} else if (list.cardnum == "") {
|
||||||
|
warn = "请输入银行卡号";
|
||||||
|
} else if (list.bankname == "请选择银行") {
|
||||||
|
warn = "请选择银行";
|
||||||
|
} else if (list.money < minmon) {
|
||||||
|
warn = "请输入正确的金额"
|
||||||
|
} else if (list.money > mymoney) {
|
||||||
|
warn = "您的余额不足"
|
||||||
|
}else {
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
if (flag == true) {
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: warn
|
||||||
|
})
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
list.weixin = e.detail.value.weixin;
|
||||||
|
list.money = e.detail.value.wmoney;
|
||||||
|
list.money = Number(list.money);
|
||||||
|
list.extract_type = 'weixin';
|
||||||
|
if (list.weixin == "") {
|
||||||
|
warn = "请填写微信号";
|
||||||
|
} else if (list.money < minmon) {
|
||||||
|
warn = "请输入正确的金额"
|
||||||
|
} else if (list.money > mymoney) {
|
||||||
|
warn = "您的余额不足"
|
||||||
|
} else {
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
if (flag == true) {
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: warn
|
||||||
|
})
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.url + '/routine/auth_api/user_extract?uid=' + app.globalData.uid,
|
||||||
|
data: { lists: list},
|
||||||
|
method: 'POST',
|
||||||
|
header: header,
|
||||||
|
success: function (res) {
|
||||||
|
that.setData({
|
||||||
|
money: (that.data.money - list.money).toFixed(2)
|
||||||
|
})
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: 'success',
|
||||||
|
duration: 1500
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
wx.request({
|
|
||||||
url: app.globalData.url + '/routine/auth_api/user_extract?uid=' + app.globalData.uid,
|
|
||||||
data: { lists: list},
|
|
||||||
method: 'POST',
|
|
||||||
header: header,
|
|
||||||
success: function (res) {
|
|
||||||
// console.log(res);
|
|
||||||
wx.showToast({
|
|
||||||
title: res.data.msg,
|
|
||||||
icon: 'success',
|
|
||||||
duration: 1500
|
|
||||||
})
|
|
||||||
// that.setData({
|
|
||||||
// mainArray: res.data.data
|
|
||||||
// })
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -2,244 +2,253 @@
|
|||||||
var app = getApp();
|
var app = getApp();
|
||||||
var wxh = require('../../utils/wxh.js');
|
var wxh = require('../../utils/wxh.js');
|
||||||
Page({
|
Page({
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
xinghidden:true,
|
xinghidden:true,
|
||||||
xinghidden2:true,
|
xinghidden2:true,
|
||||||
xinghidden3: true,
|
xinghidden3: true,
|
||||||
url: app.globalData.urlImages,
|
url: '',
|
||||||
hidden:false,
|
hidden:false,
|
||||||
unique:'',
|
unique:'',
|
||||||
uni:'',
|
uni:'',
|
||||||
dataimg:[]
|
dataimg:[]
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad: function (e) {
|
onLoad: function (e) {
|
||||||
app.setBarColor();
|
app.setBarColor();
|
||||||
var header = {
|
var header = {
|
||||||
'content-type': 'application/x-www-form-urlencoded'
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
};
|
};
|
||||||
var that = this;
|
var that = this;
|
||||||
console.log(e);
|
console.log(e);
|
||||||
if (e.unique) {
|
if (e.unique) {
|
||||||
var unique = e.unique;
|
var unique = e.unique;
|
||||||
that.setData({
|
that.setData({
|
||||||
unique: unique,
|
unique: unique,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (e.uni){
|
if (e.uni){
|
||||||
that.setData({
|
that.setData({
|
||||||
uni: e.uni
|
uni: e.uni
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
wx.showLoading({ title: "正在加载中……" });
|
wx.showLoading({ title: "正在加载中……" });
|
||||||
wx.request({
|
wx.request({
|
||||||
url: app.globalData.url + '/routine/auth_api/get_order_product?uid=' + app.globalData.uid,
|
url: app.globalData.url + '/routine/auth_api/get_order_product?uid=' + app.globalData.uid,
|
||||||
data: { unique: unique},
|
data: { unique: unique},
|
||||||
method: 'get',
|
method: 'get',
|
||||||
header: header,
|
header: header,
|
||||||
success: function (res) {
|
|
||||||
wx.hideLoading();
|
|
||||||
that.setData({
|
|
||||||
ordercon: res.data.data
|
|
||||||
});
|
|
||||||
},
|
|
||||||
fail: function (res) {
|
|
||||||
console.log('submit fail');
|
|
||||||
},
|
|
||||||
complete: function (res) {
|
|
||||||
console.log('submit complete');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
|
||||||
*/
|
|
||||||
onReady: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
tapxing:function(e){
|
|
||||||
var index = e.target.dataset.index;
|
|
||||||
this.setData({
|
|
||||||
xinghidden: false,
|
|
||||||
xing: index
|
|
||||||
})
|
|
||||||
},
|
|
||||||
tapxing2: function (e) {
|
|
||||||
var index = e.target.dataset.index;
|
|
||||||
this.setData({
|
|
||||||
xinghidden2: false,
|
|
||||||
xing2: index
|
|
||||||
})
|
|
||||||
},
|
|
||||||
tapxing3: function (e) {
|
|
||||||
var index = e.target.dataset.index;
|
|
||||||
this.setData({
|
|
||||||
xinghidden3: false,
|
|
||||||
xing3: index
|
|
||||||
})
|
|
||||||
},
|
|
||||||
uploadpic:function(e){
|
|
||||||
var that = this;
|
|
||||||
wx.chooseImage({
|
|
||||||
count: 1, //最多可以选择的图片总数
|
|
||||||
sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
|
|
||||||
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
|
|
||||||
success: function (res) {
|
|
||||||
// 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
|
|
||||||
var tempFilePaths = res.tempFilePaths;
|
|
||||||
//启动上传等待中...
|
|
||||||
wx.showLoading({
|
|
||||||
title: '图片上传中',
|
|
||||||
})
|
|
||||||
console.log(tempFilePaths);
|
|
||||||
var len = tempFilePaths.length;
|
|
||||||
for (var i = 0; i < len; i++) {
|
|
||||||
wx.uploadFile({
|
|
||||||
url: app.globalData.url + '/routine/auth_api/upload?uid=' + app.globalData.uid,
|
|
||||||
filePath: tempFilePaths[i],
|
|
||||||
name: 'pics',
|
|
||||||
formData: {
|
|
||||||
'filename': 'pics'
|
|
||||||
},
|
|
||||||
header: {
|
|
||||||
"Content-Type": "multipart/form-data"
|
|
||||||
},
|
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
wx.hideLoading();
|
wx.hideLoading();
|
||||||
console.log(res);
|
|
||||||
if(res.statusCode == 403){
|
|
||||||
wx.showToast({
|
|
||||||
title: res.data,
|
|
||||||
icon: 'none',
|
|
||||||
duration: 1500,
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
var data = JSON.parse(res.data);
|
|
||||||
that.data.dataimg.push(data);
|
|
||||||
that.setData({
|
that.setData({
|
||||||
dataimg: that.data.dataimg
|
ordercon: res.data.data
|
||||||
});
|
});
|
||||||
var len2 = that.data.dataimg.length;
|
|
||||||
if (len2 >= 8) {
|
|
||||||
that.setData({
|
|
||||||
hidden: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
fail: function (res) {
|
fail: function (res) {
|
||||||
wx.showToast({
|
console.log('submit fail');
|
||||||
title: '上传图片失败',
|
},
|
||||||
|
complete: function (res) {
|
||||||
|
console.log('submit complete');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
tapxing:function(e){
|
||||||
|
var index = e.target.dataset.index;
|
||||||
|
this.setData({
|
||||||
|
xinghidden: false,
|
||||||
|
xing: index
|
||||||
|
})
|
||||||
|
},
|
||||||
|
tapxing2: function (e) {
|
||||||
|
var index = e.target.dataset.index;
|
||||||
|
this.setData({
|
||||||
|
xinghidden2: false,
|
||||||
|
xing2: index
|
||||||
|
})
|
||||||
|
},
|
||||||
|
tapxing3: function (e) {
|
||||||
|
var index = e.target.dataset.index;
|
||||||
|
this.setData({
|
||||||
|
xinghidden3: false,
|
||||||
|
xing3: index
|
||||||
|
})
|
||||||
|
},
|
||||||
|
delImages:function(e){
|
||||||
|
var that = this;
|
||||||
|
var dataimg = that.data.dataimg;
|
||||||
|
var index = e.currentTarget.dataset.id;
|
||||||
|
dataimg.splice(index,1);
|
||||||
|
that.setData({
|
||||||
|
dataimg: dataimg
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
uploadpic:function(e){
|
||||||
|
var that = this;
|
||||||
|
wx.chooseImage({
|
||||||
|
count: 1, //最多可以选择的图片总数
|
||||||
|
sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
|
||||||
|
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
|
||||||
|
success: function (res) {
|
||||||
|
// 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
|
||||||
|
var tempFilePaths = res.tempFilePaths;
|
||||||
|
//启动上传等待中...
|
||||||
|
wx.showLoading({
|
||||||
|
title: '图片上传中',
|
||||||
|
})
|
||||||
|
var len = tempFilePaths.length;
|
||||||
|
for (var i = 0; i < len; i++) {
|
||||||
|
wx.uploadFile({
|
||||||
|
url: app.globalData.url + '/routine/auth_api/upload?uid=' + app.globalData.uid,
|
||||||
|
filePath: tempFilePaths[i],
|
||||||
|
name: 'pics',
|
||||||
|
formData: {
|
||||||
|
'filename': 'pics'
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "multipart/form-data"
|
||||||
|
},
|
||||||
|
success: function (res) {
|
||||||
|
wx.hideLoading();
|
||||||
|
if(res.statusCode == 403){
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1500,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
var data = JSON.parse(res.data);
|
||||||
|
data.data.url = app.globalData.url + data.data.url;
|
||||||
|
that.data.dataimg.push(data);
|
||||||
|
that.setData({
|
||||||
|
dataimg: that.data.dataimg
|
||||||
|
});
|
||||||
|
var len2 = that.data.dataimg.length;
|
||||||
|
if (len2 >= 8) {
|
||||||
|
that.setData({
|
||||||
|
hidden: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: function (res) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '上传图片失败',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
formSubmit:function(e){
|
||||||
|
var header = {
|
||||||
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
|
};
|
||||||
|
var that = this;
|
||||||
|
var unique = that.data.unique;
|
||||||
|
var comment = e.detail.value.comment;
|
||||||
|
var product_score = that.data.xing;
|
||||||
|
var service_score = that.data.xing2;
|
||||||
|
var pics = [];
|
||||||
|
var dataimg = that.data.dataimg;
|
||||||
|
for (var i = 0; i < dataimg.length;i++){
|
||||||
|
pics.push(that.data.url+dataimg[i].data.url)
|
||||||
|
};
|
||||||
|
if (comment==""){
|
||||||
|
wx.showToast({
|
||||||
|
title: '请填写你对宝贝的心得!',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
})
|
})
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
wx.showLoading({ title: "正在发布评论……" });
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.url + '/routine/auth_api/user_comment_product?uid=' + app.globalData.uid+'&unique=' + unique,
|
||||||
|
data: {comment: comment, product_score: product_score, service_score: service_score, pics: pics},
|
||||||
|
method: 'post',
|
||||||
|
header: header,
|
||||||
|
success: function (res) {
|
||||||
|
wx.hideLoading();
|
||||||
|
if (res.data.code==200){
|
||||||
|
wx.showToast({
|
||||||
|
title: '评价成功',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 1000
|
||||||
|
})
|
||||||
|
setTimeout(function(){
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/orders-con/orders-con?order_id='+that.data.uni,
|
||||||
|
})
|
||||||
|
},1200)
|
||||||
|
}else{
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: function (res) {
|
||||||
|
console.log('submit fail');
|
||||||
|
},
|
||||||
|
complete: function (res) {
|
||||||
|
console.log('submit complete');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
}
|
/**
|
||||||
});
|
* 生命周期函数--监听页面显示
|
||||||
},
|
*/
|
||||||
formSubmit:function(e){
|
onShow: function () {
|
||||||
var header = {
|
|
||||||
'content-type': 'application/x-www-form-urlencoded'
|
},
|
||||||
};
|
|
||||||
var that = this;
|
/**
|
||||||
var unique = that.data.unique;
|
* 生命周期函数--监听页面隐藏
|
||||||
var comment = e.detail.value.comment;
|
*/
|
||||||
var product_score = that.data.xing;
|
onHide: function () {
|
||||||
var service_score = that.data.xing2;
|
|
||||||
var pics = [];
|
},
|
||||||
var dataimg = that.data.dataimg;
|
|
||||||
for (var i = 0; i < dataimg.length;i++){
|
/**
|
||||||
pics.push(that.data.url+dataimg[i].data.url)
|
* 生命周期函数--监听页面卸载
|
||||||
};
|
*/
|
||||||
if (comment==""){
|
onUnload: function () {
|
||||||
wx.showToast({
|
|
||||||
title: '请填写你对宝贝的心得!',
|
},
|
||||||
icon: 'none',
|
|
||||||
duration: 2000
|
/**
|
||||||
})
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
return false;
|
*/
|
||||||
|
onPullDownRefresh: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage: function () {
|
||||||
|
|
||||||
}
|
}
|
||||||
wx.showLoading({ title: "正在发布评论……" });
|
|
||||||
wx.request({
|
|
||||||
url: app.globalData.url + '/routine/auth_api/user_comment_product?uid=' + app.globalData.uid+'&unique=' + unique,
|
|
||||||
data: {comment: comment, product_score: product_score, service_score: service_score, pics: pics},
|
|
||||||
method: 'post',
|
|
||||||
header: header,
|
|
||||||
success: function (res) {
|
|
||||||
wx.hideLoading();
|
|
||||||
if (res.data.code==200){
|
|
||||||
wx.showToast({
|
|
||||||
title: '评价成功',
|
|
||||||
icon: 'success',
|
|
||||||
duration: 1000
|
|
||||||
})
|
|
||||||
setTimeout(function(){
|
|
||||||
wx.navigateTo({
|
|
||||||
url: '/pages/orders-con/orders-con?order_id='+that.data.uni,
|
|
||||||
})
|
|
||||||
},1200)
|
|
||||||
}else{
|
|
||||||
wx.showToast({
|
|
||||||
title: res.data.msg,
|
|
||||||
icon: 'none',
|
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: function (res) {
|
|
||||||
console.log('submit fail');
|
|
||||||
},
|
|
||||||
complete: function (res) {
|
|
||||||
console.log('submit complete');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面显示
|
|
||||||
*/
|
|
||||||
onShow: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面隐藏
|
|
||||||
*/
|
|
||||||
onHide: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面卸载
|
|
||||||
*/
|
|
||||||
onUnload: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
|
||||||
*/
|
|
||||||
onPullDownRefresh: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面上拉触底事件的处理函数
|
|
||||||
*/
|
|
||||||
onReachBottom: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户点击右上角分享
|
|
||||||
*/
|
|
||||||
onShareAppMessage: function () {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
@ -1,18 +1,52 @@
|
|||||||
// pages/integral-con/integral-con.js
|
// pages/integral-con/integral-con.js
|
||||||
|
var app = getApp();
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
|
userInfo:[],
|
||||||
|
integralInfo:[],
|
||||||
|
first:0,
|
||||||
|
limit:8,
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad: function (options) {
|
onLoad: function (options) {
|
||||||
|
this.getUserInfo();
|
||||||
|
this.getList();
|
||||||
|
},//user_integral_list
|
||||||
|
getList:function(){
|
||||||
|
var that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.url + '/routine/auth_api/user_integral_list?uid=' + app.globalData.uid,
|
||||||
|
method: 'GET',
|
||||||
|
data:{
|
||||||
|
first: that.data.first,
|
||||||
|
limit: that.data.limit,
|
||||||
|
},
|
||||||
|
success: function (res) {
|
||||||
|
that.setData({
|
||||||
|
integralInfo: res.data.data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getUserInfo:function(){
|
||||||
|
var that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.url + '/routine/auth_api/my?uid=' + app.globalData.uid,
|
||||||
|
method: 'POST',
|
||||||
|
success: function (res) {
|
||||||
|
that.setData({
|
||||||
|
userInfo: res.data.data,
|
||||||
|
})
|
||||||
|
console.log(that.data.userInfo);
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -54,7 +88,29 @@ Page({
|
|||||||
* 页面上拉触底事件的处理函数
|
* 页面上拉触底事件的处理函数
|
||||||
*/
|
*/
|
||||||
onReachBottom: function () {
|
onReachBottom: function () {
|
||||||
|
var that = this;
|
||||||
|
var first = that.data.first;
|
||||||
|
var limit = that.data.limit;
|
||||||
|
if (!first) first = 1;
|
||||||
|
var startpage = limit * first;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.url + '/routine/auth_api/user_integral_list?uid=' + app.globalData.uid,
|
||||||
|
method: 'GET',
|
||||||
|
data: {
|
||||||
|
first: startpage,
|
||||||
|
limit: that.data.limit,
|
||||||
|
},
|
||||||
|
success: function (res) {
|
||||||
|
var len = res.data.data.length;
|
||||||
|
for (var i = 0; i < len; i++) {
|
||||||
|
that.data.integralInfo.push(res.data.data[i])
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
first: first + 1,
|
||||||
|
integralInfo: that.data.integralInfo
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,28 +1,30 @@
|
|||||||
<view class='header flex'>
|
<view class='header flex'>
|
||||||
<text class='text'>我的积分</text>
|
<text class='text'>我的积分</text>
|
||||||
<view class='count'>10000</view>
|
<view class='count'>{{userInfo.integral}}</view>
|
||||||
<navigator hover-class='none'>获取积分</navigator>
|
<navigator hover-class='none' url="/pages/index/index" open-type='switchTab'>获取积分</navigator>
|
||||||
</view>
|
</view>
|
||||||
<view class='details-list'>
|
<view class='details-list'>
|
||||||
<view class='title'><text>积分明细</text></view>
|
<view class='title'><text>积分明细</text></view>
|
||||||
<view class='list-wrapper'>
|
<view class='list-wrapper'>
|
||||||
<view class='list-item flex expenditure'>
|
<block wx:for="{{integralInfo}}">
|
||||||
|
<view class='list-item flex expenditure' wx:if="{{item.pm == 1}}">
|
||||||
<view class='left-wrapper'>
|
<view class='left-wrapper'>
|
||||||
<view class='order-num'>支付订单,订单编号178954654145</view>
|
<view class='order-num'>{{item.mark}}</view>
|
||||||
<view class='time-bar'>2017/10/10 14:50</view>
|
<view class='time-bar'>{{item.add_time}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='right-wrapper'>
|
<view class='right-wrapper'>
|
||||||
<text class='status-txt'>-1666</text>积分
|
<text class='status-txt'>+{{item.number}}</text>积分
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='list-item flex'>
|
<view class='list-item flex' wx:else>
|
||||||
<view class='left-wrapper'>
|
<view class='left-wrapper'>
|
||||||
<view class='order-num'>支付订单,订单编号178954654145</view>
|
<view class='order-num'>{{item.mark}}</view>
|
||||||
<view class='time-bar'>2017/10/10 14:50</view>
|
<view class='time-bar'>{{item.add_time}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='right-wrapper'>
|
<view class='right-wrapper'>
|
||||||
<text class='status-txt'>-1666</text>积分
|
<text class='status-txt'>-{{item.number}}</text>积分
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</block>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -315,9 +315,10 @@ Page({
|
|||||||
url: '/pages/buycar/buycar'
|
url: '/pages/buycar/buycar'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
toAddress:function(){
|
toAddress: function () {
|
||||||
|
var that = this;
|
||||||
wx.navigateTo({ //跳转至指定页面并关闭其他打开的所有页面(这个最好用在返回至首页的的时候)
|
wx.navigateTo({ //跳转至指定页面并关闭其他打开的所有页面(这个最好用在返回至首页的的时候)
|
||||||
url: '/pages/addaddress/addaddress?cartId=' + this.data.cartId + '&pinkId=' + that.data.pinkId + '&couponId=' + that.data.couponId
|
url: '/pages/addaddress/addaddress?cartId=' + that.data.cartId + '&pinkId=' + that.data.pinkId + '&couponId=' + that.data.couponId
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getConfirm: function (cartIdsStr){
|
getConfirm: function (cartIdsStr){
|
||||||
|
|||||||
@ -3,283 +3,288 @@ var app = getApp();
|
|||||||
var wxh = require('../../utils/wxh.js');
|
var wxh = require('../../utils/wxh.js');
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
url: app.globalData.urlImages
|
url: app.globalData.urlImages
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad: function (e) {
|
onLoad: function (e) {
|
||||||
app.setBarColor();
|
app.setBarColor();
|
||||||
var header = {
|
var header = {
|
||||||
'content-type': 'application/x-www-form-urlencoded'
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
};
|
};
|
||||||
var uni = e.order_id;
|
var uni = e.order_id;
|
||||||
var that = this;
|
var that = this;
|
||||||
wx.showLoading({ title: "正在加载中……" });
|
wx.showLoading({ title: "正在加载中……" });
|
||||||
wx.request({
|
wx.request({
|
||||||
url: app.globalData.url + '/routine/auth_api/get_order?uid=' + app.globalData.uid,
|
url: app.globalData.url + '/routine/auth_api/get_order?uid=' + app.globalData.uid,
|
||||||
data: { uni: uni },
|
data: { uni: uni },
|
||||||
method: 'get',
|
method: 'get',
|
||||||
header: header,
|
header: header,
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
wx.hideLoading();
|
wx.hideLoading();
|
||||||
that.setData({
|
that.setData({
|
||||||
ordercon:res.data.data
|
ordercon:res.data.data
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: function (res) {
|
||||||
|
console.log('submit fail');
|
||||||
|
},
|
||||||
|
complete: function (res) {
|
||||||
|
console.log('submit complete');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fail: function (res) {
|
getPay:function(e){
|
||||||
console.log('submit fail');
|
var that = this;
|
||||||
},
|
wx.request({
|
||||||
complete: function (res) {
|
url: app.globalData.url + '/routine/auth_api/pay_order?uid=' + app.globalData.uid +'&uni='+e.target.dataset.id,
|
||||||
console.log('submit complete');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getPay:function(e){
|
|
||||||
var that = this;
|
|
||||||
wx.request({
|
|
||||||
url: app.globalData.url + '/routine/auth_api/pay_order?uid=' + app.globalData.uid +'&uni='+e.target.dataset.id,
|
|
||||||
method: 'get',
|
|
||||||
success: function (res) {
|
|
||||||
var data = res.data.data;
|
|
||||||
if (res.data.code == 200 && res.data.data.status == 'WECHAT_PAY') {
|
|
||||||
var jsConfig = res.data.data.result.jsConfig;
|
|
||||||
console.log(jsConfig);
|
|
||||||
wx.requestPayment({
|
|
||||||
timeStamp: jsConfig.timeStamp,
|
|
||||||
nonceStr: jsConfig.nonceStr,
|
|
||||||
package: jsConfig.package,
|
|
||||||
signType: jsConfig.signType,
|
|
||||||
paySign: jsConfig.paySign,
|
|
||||||
success: function (res) {
|
|
||||||
wx.showToast({
|
|
||||||
title: '支付成功',
|
|
||||||
icon: 'success',
|
|
||||||
duration: 1000,
|
|
||||||
})
|
|
||||||
setTimeout(function () {
|
|
||||||
wx.navigateTo({ //跳转至指定页面并关闭其他打开的所有页面(这个最好用在返回至首页的的时候)
|
|
||||||
url: '/pages/orders-con/orders-con?order_id=' + data.result.orderId
|
|
||||||
})
|
|
||||||
}, 1200)
|
|
||||||
},
|
|
||||||
fail: function (res) {
|
|
||||||
wx.showToast({
|
|
||||||
title: '支付失败',
|
|
||||||
icon: 'success',
|
|
||||||
duration: 1000,
|
|
||||||
})
|
|
||||||
// setTimeout(function () {
|
|
||||||
// wx.navigateTo({
|
|
||||||
// url: '/pages/orders-con/orders-con?order_id=' + data.result.orderId
|
|
||||||
// })
|
|
||||||
// }, 1200)
|
|
||||||
},
|
|
||||||
complete: function (res) {
|
|
||||||
console.log(res);
|
|
||||||
if (res.errMsg == 'requestPayment:cancel') {
|
|
||||||
wx.showToast({
|
|
||||||
title: '取消支付',
|
|
||||||
icon: 'none',
|
|
||||||
duration: 1000,
|
|
||||||
})
|
|
||||||
// setTimeout(function () {
|
|
||||||
// wx.navigateTo({ //跳转至指定页面并关闭其他打开的所有页面(这个最好用在返回至首页的的时候)
|
|
||||||
// url: '/pages/orders-con/orders-con?order_id=' + data.result.orderId
|
|
||||||
// })
|
|
||||||
// }, 1200)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
} else if (res.data.code == 200){
|
|
||||||
wx.showToast({
|
|
||||||
title: res.data.msg,
|
|
||||||
icon: 'success',
|
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
setTimeout(function () {
|
|
||||||
wx.navigateTo({ //跳转至指定页面并关闭其他打开的所有页面(这个最好用在返回至首页的的时候)
|
|
||||||
url: '/pages/orders-con/orders-con?order_id=' + data.result.orderId
|
|
||||||
})
|
|
||||||
}, 1200)
|
|
||||||
}else{
|
|
||||||
wx.showToast({
|
|
||||||
title: res.data.msg,
|
|
||||||
icon: 'none',
|
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
setTimeout(function () {
|
|
||||||
wx.navigateTo({ //跳转至指定页面并关闭其他打开的所有页面(这个最好用在返回至首页的的时候)
|
|
||||||
url: '/pages/orders-con/orders-con?order_id=' + data.result.orderId
|
|
||||||
})
|
|
||||||
}, 1200)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: function (res) {
|
|
||||||
console.log('submit fail');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
delOrder:function(e){
|
|
||||||
var header = {
|
|
||||||
'content-type': 'application/x-www-form-urlencoded'
|
|
||||||
};
|
|
||||||
var uni = e.currentTarget.dataset.uni;
|
|
||||||
var that = this;
|
|
||||||
wx.showModal({
|
|
||||||
title: '确认删除订单?',
|
|
||||||
content: '订单删除后将无法查看',
|
|
||||||
success: function (res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
wx.request({
|
|
||||||
url: app.globalData.url + '/routine/auth_api/user_remove_order?uid=' + app.globalData.uid,
|
|
||||||
data: { uni: uni },
|
|
||||||
method: 'get',
|
method: 'get',
|
||||||
header: header,
|
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
if (res.data.code == 200) {
|
var data = res.data.data;
|
||||||
wx.showToast({
|
if (res.data.code == 200 && res.data.data.status == 'WECHAT_PAY') {
|
||||||
title: '成功',
|
var jsConfig = res.data.data.result.jsConfig;
|
||||||
icon: 'success',
|
console.log(jsConfig);
|
||||||
duration: 2000
|
wx.requestPayment({
|
||||||
})
|
timeStamp: jsConfig.timeStamp,
|
||||||
} else {
|
nonceStr: jsConfig.nonceStr,
|
||||||
wx.showToast({
|
package: jsConfig.package,
|
||||||
title: res.data.msg,
|
signType: jsConfig.signType,
|
||||||
icon: 'none',
|
paySign: jsConfig.paySign,
|
||||||
duration: 2000
|
success: function (res) {
|
||||||
})
|
wx.showToast({
|
||||||
}
|
title: '支付成功',
|
||||||
// that.setData({
|
icon: 'success',
|
||||||
// ordercon: that.data.ordercon
|
duration: 1000,
|
||||||
// });
|
})
|
||||||
|
setTimeout(function () {
|
||||||
|
wx.navigateTo({ //跳转至指定页面并关闭其他打开的所有页面(这个最好用在返回至首页的的时候)
|
||||||
|
url: '/pages/orders-con/orders-con?order_id=' + data.result.orderId
|
||||||
|
})
|
||||||
|
}, 1200)
|
||||||
|
},
|
||||||
|
fail: function (res) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '支付失败',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 1000,
|
||||||
|
})
|
||||||
|
// setTimeout(function () {
|
||||||
|
// wx.navigateTo({
|
||||||
|
// url: '/pages/orders-con/orders-con?order_id=' + data.result.orderId
|
||||||
|
// })
|
||||||
|
// }, 1200)
|
||||||
|
},
|
||||||
|
complete: function (res) {
|
||||||
|
console.log(res);
|
||||||
|
if (res.errMsg == 'requestPayment:cancel') {
|
||||||
|
wx.showToast({
|
||||||
|
title: '取消支付',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000,
|
||||||
|
})
|
||||||
|
// setTimeout(function () {
|
||||||
|
// wx.navigateTo({ //跳转至指定页面并关闭其他打开的所有页面(这个最好用在返回至首页的的时候)
|
||||||
|
// url: '/pages/orders-con/orders-con?order_id=' + data.result.orderId
|
||||||
|
// })
|
||||||
|
// }, 1200)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
} else if (res.data.code == 200){
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: 'success',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
setTimeout(function () {
|
||||||
|
wx.navigateTo({ //跳转至指定页面并关闭其他打开的所有页面(这个最好用在返回至首页的的时候)
|
||||||
|
url: '/pages/orders-con/orders-con?order_id=' + data.result.orderId
|
||||||
|
})
|
||||||
|
}, 1200)
|
||||||
|
}else{
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
setTimeout(function () {
|
||||||
|
wx.navigateTo({ //跳转至指定页面并关闭其他打开的所有页面(这个最好用在返回至首页的的时候)
|
||||||
|
url: '/pages/orders-con/orders-con?order_id=' + data.result.orderId
|
||||||
|
})
|
||||||
|
}, 1200)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
fail: function (res) {
|
fail: function (res) {
|
||||||
console.log('submit fail');
|
console.log('submit fail');
|
||||||
},
|
|
||||||
complete: function (res) {
|
|
||||||
console.log('submit complete');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (res.cancel) {
|
},
|
||||||
console.log('用户点击取消')
|
delOrder:function(e){
|
||||||
}
|
var header = {
|
||||||
}
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
})
|
};
|
||||||
},
|
var uni = e.currentTarget.dataset.uni;
|
||||||
goTel:function(e){
|
var that = this;
|
||||||
console.log(e);
|
wx.showModal({
|
||||||
wx.makePhoneCall({
|
title: '确认删除订单?',
|
||||||
phoneNumber: e.currentTarget.dataset.tel //仅为示例,并非真实的电话号码
|
content: '订单删除后将无法查看',
|
||||||
})
|
|
||||||
},
|
|
||||||
goJoinPink:function(e){
|
|
||||||
var uni = e.currentTarget.dataset.uni;
|
|
||||||
wx.navigateTo({
|
|
||||||
url: '/pages/join-pink/index?id=' + uni,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
confirmOrder:function(e){
|
|
||||||
var header = {
|
|
||||||
'content-type': 'application/x-www-form-urlencoded'
|
|
||||||
};
|
|
||||||
var uni = e.currentTarget.dataset.uni;
|
|
||||||
var that = this;
|
|
||||||
wx.showModal({
|
|
||||||
title: '确认收货',
|
|
||||||
content: '为保障权益,请收到货确认无误后,再确认收货',
|
|
||||||
success: function (res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
wx.request({
|
|
||||||
url: app.globalData.url + '/routine/auth_api/user_take_order?uid=' + app.globalData.uid,
|
|
||||||
data: { uni: uni },
|
|
||||||
method: 'get',
|
|
||||||
header: header,
|
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
if(res.data.code==200){
|
if (res.confirm) {
|
||||||
wx.navigateTo({
|
wx.request({
|
||||||
url: '/pages/orders-list/orders-list?nowstatus=4',
|
url: app.globalData.url + '/routine/auth_api/user_remove_order?uid=' + app.globalData.uid,
|
||||||
})
|
data: { uni: uni },
|
||||||
}else{
|
method: 'get',
|
||||||
wx.showToast({
|
header: header,
|
||||||
title: res.data.msg,
|
success: function (res) {
|
||||||
icon: 'none',
|
if (res.data.code == 200) {
|
||||||
duration: 2000
|
wx.showToast({
|
||||||
})
|
title: '成功',
|
||||||
}
|
icon: 'success',
|
||||||
that.setData({
|
duration: 2000
|
||||||
ordercon: that.data.ordercon
|
})
|
||||||
});
|
setTimeout(function(){
|
||||||
},
|
wx.navigateTo({
|
||||||
fail: function (res) {
|
url: '/pages/orders-list/orders-list',
|
||||||
console.log('submit fail');
|
})
|
||||||
},
|
},1500)
|
||||||
complete: function (res) {
|
} else {
|
||||||
console.log('submit complete');
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// that.setData({
|
||||||
|
// ordercon: that.data.ordercon
|
||||||
|
// });
|
||||||
|
},
|
||||||
|
fail: function (res) {
|
||||||
|
console.log('submit fail');
|
||||||
|
},
|
||||||
|
complete: function (res) {
|
||||||
|
console.log('submit complete');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (res.cancel) {
|
||||||
|
console.log('用户点击取消')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
} else if (res.cancel) {
|
},
|
||||||
console.log('用户点击取消')
|
goTel:function(e){
|
||||||
}
|
console.log(e);
|
||||||
}
|
wx.makePhoneCall({
|
||||||
})
|
phoneNumber: e.currentTarget.dataset.tel //仅为示例,并非真实的电话号码
|
||||||
},
|
})
|
||||||
goIndex:function(){
|
},
|
||||||
wx.switchTab({
|
goJoinPink:function(e){
|
||||||
url: '/pages/index/index'
|
var uni = e.currentTarget.dataset.uni;
|
||||||
})
|
wx.navigateTo({
|
||||||
},
|
url: '/pages/join-pink/index?id=' + uni,
|
||||||
/**
|
})
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
},
|
||||||
*/
|
confirmOrder:function(e){
|
||||||
onReady: function () {
|
var header = {
|
||||||
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
|
};
|
||||||
|
var uni = e.currentTarget.dataset.uni;
|
||||||
|
var that = this;
|
||||||
|
wx.showModal({
|
||||||
|
title: '确认收货',
|
||||||
|
content: '为保障权益,请收到货确认无误后,再确认收货',
|
||||||
|
success: function (res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.url + '/routine/auth_api/user_take_order?uid=' + app.globalData.uid,
|
||||||
|
data: { uni: uni },
|
||||||
|
method: 'get',
|
||||||
|
header: header,
|
||||||
|
success: function (res) {
|
||||||
|
if(res.data.code==200){
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/orders-list/orders-list?nowstatus=4',
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
ordercon: that.data.ordercon
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: function (res) {
|
||||||
|
console.log('submit fail');
|
||||||
|
},
|
||||||
|
complete: function (res) {
|
||||||
|
console.log('submit complete');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (res.cancel) {
|
||||||
|
console.log('用户点击取消')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goIndex:function(){
|
||||||
|
wx.switchTab({
|
||||||
|
url: '/pages/index/index'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow: function () {
|
onShow: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面隐藏
|
* 生命周期函数--监听页面隐藏
|
||||||
*/
|
*/
|
||||||
onHide: function () {
|
onHide: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面卸载
|
* 生命周期函数--监听页面卸载
|
||||||
*/
|
*/
|
||||||
onUnload: function () {
|
onUnload: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
*/
|
*/
|
||||||
onPullDownRefresh: function () {
|
onPullDownRefresh: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面上拉触底事件的处理函数
|
* 页面上拉触底事件的处理函数
|
||||||
*/
|
*/
|
||||||
onReachBottom: function () {
|
onReachBottom: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户点击右上角分享
|
* 用户点击右上角分享
|
||||||
*/
|
*/
|
||||||
onShareAppMessage: function () {
|
onShareAppMessage: function () {
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -39,6 +39,14 @@ Page({
|
|||||||
},
|
},
|
||||||
success: function (res) { }
|
success: function (res) { }
|
||||||
})
|
})
|
||||||
|
if (!e.detail.value.number) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '请输入充值金额',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000,
|
||||||
|
})
|
||||||
|
return false;
|
||||||
|
}
|
||||||
wx.request({
|
wx.request({
|
||||||
url: app.globalData.url + '/routine/auth_api/user_wechat_recharge?uid=' + app.globalData.uid,
|
url: app.globalData.url + '/routine/auth_api/user_wechat_recharge?uid=' + app.globalData.uid,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<form bindsubmit='submitSub' report-submit='true'>
|
<form bindsubmit='submitSub' report-submit='true'>
|
||||||
<view class="pay-bg">
|
<view class="pay-bg">
|
||||||
<view class='title'>输入金额</view>
|
<view class='title'>输入金额</view>
|
||||||
<view class='input flex'><text>¥</text><input type='number' placeholder='0.00' placeholder-class='placeholder' name='number'></input></view>
|
<view class='input flex'><text>¥</text><input type='digit' placeholder='0.00' placeholder-class='placeholder' name='number'></input></view>
|
||||||
<view class='tip'>提示:当前余额为 <text>¥{{userinfo.now_money}}</text></view>
|
<view class='tip'>提示:当前余额为 <text>¥{{userinfo.now_money}}</text></view>
|
||||||
<button class='but' form-type='submit'>立即充值</button>
|
<button class='but' form-type='submit'>立即充值</button>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -38,10 +38,10 @@
|
|||||||
<view>销量:{{storeInfo.sales}}{{storeInfo.unit_name}}</view>
|
<view>销量:{{storeInfo.sales}}{{storeInfo.unit_name}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='block-bar' bindtap='goCoupon'>
|
<!-- <view class='block-bar' bindtap='goCoupon'>
|
||||||
<text class='title'>领券</text>
|
<text class='title'>领券</text>
|
||||||
<text>领取优惠券 </text>
|
<text>领取优惠券 </text>
|
||||||
</view>
|
</view> -->
|
||||||
<!-- <view class='block-bar integral' wx:if="{{storeInfo.give_integral > 0}}">
|
<!-- <view class='block-bar integral' wx:if="{{storeInfo.give_integral > 0}}">
|
||||||
<text class='title'>积分</text>
|
<text class='title'>积分</text>
|
||||||
<text>购买可获得{{storeInfo.give_integral}}积分</text>
|
<text>购买可获得{{storeInfo.give_integral}}积分</text>
|
||||||
|
|||||||
@ -77,10 +77,6 @@
|
|||||||
<text>客服</text>
|
<text>客服</text>
|
||||||
</view>
|
</view>
|
||||||
</button>
|
</button>
|
||||||
<view class='item' bindtap='setCollect'>
|
|
||||||
<view class='iconfont icon-pingjia {{collect==true?"icon-xingxing":""}}'></view>
|
|
||||||
<text>收藏</text>
|
|
||||||
</view>
|
|
||||||
<view class='item' bindtap='getCar'>
|
<view class='item' bindtap='getCar'>
|
||||||
<view class='iconfont icon-gouwuche'><span class='item-span'>{{CartCount}}</span></view>
|
<view class='iconfont icon-gouwuche'><span class='item-span'>{{CartCount}}</span></view>
|
||||||
<text>购物车</text>
|
<text>购物车</text>
|
||||||
@ -104,5 +100,3 @@
|
|||||||
|
|
||||||
<include src="/pages/foo-tan/foo-tan.wxml"/>
|
<include src="/pages/foo-tan/foo-tan.wxml"/>
|
||||||
<import src="/wxParse/wxParse.wxml"/>
|
<import src="/wxParse/wxParse.wxml"/>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -34,7 +34,7 @@ swiper-item{position: relative; width: 100%;}
|
|||||||
.foot .fn-btns .item .iconfont.icon-xingxing{color: #ff7000;}
|
.foot .fn-btns .item .iconfont.icon-xingxing{color: #ff7000;}
|
||||||
|
|
||||||
|
|
||||||
.foot .btns-wrapper{width: 446rpx; height: 100%; line-height: 110rpx; color: #fff; font-size: 30rpx;}
|
.foot .btns-wrapper{width: 688rpx; height: 100%; line-height: 110rpx; color: #fff; font-size: 30rpx;}
|
||||||
.foot .btns-wrapper view{flex: 1; text-align: center;}
|
.foot .btns-wrapper view{flex: 1; text-align: center;}
|
||||||
.foot .btns-wrapper .buy-btn{background-color: #ff7000;}
|
.foot .btns-wrapper .buy-btn{background-color: #ff7000;}
|
||||||
.foot .btns-wrapper .payment-btn{background-color: #ff3d3d;}
|
.foot .btns-wrapper .payment-btn{background-color: #ff3d3d;}
|
||||||
@ -54,6 +54,3 @@ swiper-item{position: relative; width: 100%;}
|
|||||||
.countdown-time text{height:35rpx;padding:0 8rpx;display:inline-block;background-color:#fff;color:#ff3d3d;line-height:35rpx;border-radius:5rpx;margin-top:8rpx;}
|
.countdown-time text{height:35rpx;padding:0 8rpx;display:inline-block;background-color:#fff;color:#ff3d3d;line-height:35rpx;border-radius:5rpx;margin-top:8rpx;}
|
||||||
@import "/pages/foo-tan/foo-tan.wxss";
|
@import "/pages/foo-tan/foo-tan.wxss";
|
||||||
@import "/wxParse/wxParse.wxss";
|
@import "/wxParse/wxParse.wxss";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -84,24 +84,18 @@
|
|||||||
<view class='iconfont icon-kefu'></view>
|
<view class='iconfont icon-kefu'></view>
|
||||||
<text>客服</text>
|
<text>客服</text>
|
||||||
</view>
|
</view>
|
||||||
<view class='item' bindtap='setCollect'>
|
|
||||||
<view class="iconfont icon-pingjia {{collect==true?'icon-xingxing':''}}"></view>
|
|
||||||
<text>收藏</text>
|
|
||||||
</view>
|
|
||||||
<view class='item' bindtap='getCar'>
|
<view class='item' bindtap='getCar'>
|
||||||
<view class='iconfont icon-gouwuche'><span class='item-span'>{{CartCount}}</span></view>
|
<view class='iconfont icon-gouwuche'><span class='item-span'>{{CartCount}}</span></view>
|
||||||
<text>购物车</text>
|
<text>购物车</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='btns-wrapper flex'>
|
<view class='btns-wrapper flex'>
|
||||||
<!-- <view class='buy-btn'>加入购物车</view> -->
|
|
||||||
<form class="form-btn" bindsubmit="parameterShow" report-submit='true'>
|
<form class="form-btn" bindsubmit="parameterShow" report-submit='true'>
|
||||||
<input type='text' style="display:none" name="pinkId" value='0'></input>
|
<input type='text' style="display:none" name="pinkId" value='0'></input>
|
||||||
<button class='payment-btn' form-type='submit'>确认下单</button>
|
<button class='payment-btn' form-type='submit'>确认下单</button>
|
||||||
</form>
|
</form>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="model-bg {{show==true ? 'show':''}} {{prostatus==true ? 'show':''}}" bindtap='modelbg'></view> -->
|
|
||||||
<view class="pinklist-model {{show==true ? 'show':''}}">
|
<view class="pinklist-model {{show==true ? 'show':''}}">
|
||||||
<view class='tit-bar'>正在拼单</view>
|
<view class='tit-bar'>正在拼单</view>
|
||||||
<scroll-view scroll-y style="max-height:635rpx;">
|
<scroll-view scroll-y style="max-height:635rpx;">
|
||||||
@ -126,4 +120,3 @@
|
|||||||
</view>
|
</view>
|
||||||
<include src="/pages/foo-tan/foo-tan.wxml"/>
|
<include src="/pages/foo-tan/foo-tan.wxml"/>
|
||||||
<import src="/wxParse/wxParse.wxml"/>
|
<import src="/wxParse/wxParse.wxml"/>
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ swiper-item{position: relative; width: 100%;}
|
|||||||
.foot .fn-btns .item{flex: 1; text-align: center; font-size: 22rpx; color: #666;}
|
.foot .fn-btns .item{flex: 1; text-align: center; font-size: 22rpx; color: #666;}
|
||||||
.foot .fn-btns .item .iconfont{font-size: 35rpx; color: #999;position:relative;}
|
.foot .fn-btns .item .iconfont{font-size: 35rpx; color: #999;position:relative;}
|
||||||
.foot .fn-btns .item .iconfont.icon-xingxing{color: #ff7000;}
|
.foot .fn-btns .item .iconfont.icon-xingxing{color: #ff7000;}
|
||||||
.foot .btns-wrapper{width: 445rpx; height: 100%; line-height: 110rpx; color: #fff; font-size: 30rpx;}
|
.foot .btns-wrapper{width: 688rpx; height: 100%; line-height: 110rpx; color: #fff; font-size: 30rpx;}
|
||||||
.foot .btns-wrapper view{flex: 1; text-align: center;}
|
.foot .btns-wrapper view{flex: 1; text-align: center;}
|
||||||
.foot .btns-wrapper .buy-btn{background-color: #ff7000;}
|
.foot .btns-wrapper .buy-btn{background-color: #ff7000;}
|
||||||
.foot .btns-wrapper .payment-btn{background-color: #ff3d3d;}
|
.foot .btns-wrapper .payment-btn{background-color: #ff3d3d;}
|
||||||
|
|||||||
@ -1,154 +1,154 @@
|
|||||||
var app = getApp();
|
var app = getApp();
|
||||||
// pages/promotion-order/promotion-order.js
|
// pages/promotion-order/promotion-order.js
|
||||||
Page({
|
Page({
|
||||||
data: {
|
data: {
|
||||||
url: app.globalData.urlImages,
|
url: app.globalData.urlImages,
|
||||||
currentTab:"",
|
currentTab:"",
|
||||||
hiddens:true,
|
hiddens:true,
|
||||||
icondui:0,
|
icondui:0,
|
||||||
icondui2: 0,
|
icondui2: 0,
|
||||||
alloeder: ['全部订单', '已评价', '已发货'],
|
alloeder: ['全部订单', '已评价', '已发货'],
|
||||||
allOrder:"全部订单",
|
allOrder:"全部订单",
|
||||||
promoter:"推广粉丝",
|
promoter:"推广粉丝",
|
||||||
promoterList: [],
|
promoterList: [],
|
||||||
orderlist:[],
|
orderlist:[],
|
||||||
orderconut:'',
|
orderconut:'',
|
||||||
ordermoney:''
|
ordermoney:''
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad: function (options) {
|
onLoad: function (options) {
|
||||||
app.setBarColor();
|
app.setBarColor();
|
||||||
app.setUserInfo();
|
app.setUserInfo();
|
||||||
var header = {
|
var header = {
|
||||||
'content-type': 'application/x-www-form-urlencoded',
|
'content-type': 'application/x-www-form-urlencoded',
|
||||||
};
|
};
|
||||||
this.orderlist();
|
this.orderlist();
|
||||||
this.extension(header);
|
this.extension(header);
|
||||||
this.orderlistmoney();
|
this.orderlistmoney();
|
||||||
|
|
||||||
},
|
},
|
||||||
extension: function (header){
|
extension: function (header){
|
||||||
var that = this;
|
var that = this;
|
||||||
wx.request({
|
wx.request({
|
||||||
url: app.globalData.url + '/routine/auth_api/get_spread_list?uid=' + app.globalData.uid,
|
url: app.globalData.url + '/routine/auth_api/get_spread_list?uid=' + app.globalData.uid,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
header: header,
|
header: header,
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
// console.log(res.data.data);
|
// console.log(res.data.data);
|
||||||
if (res.data.code==200){
|
if (res.data.code==200){
|
||||||
that.setData({
|
that.setData({
|
||||||
promoterList: res.data.data.list
|
promoterList: res.data.data.list
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
that.setData({
|
that.setData({
|
||||||
promoterList: []
|
promoterList: []
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
spread: function () {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '../../pages/spread/spread',
|
||||||
|
success: function (res) { },
|
||||||
|
fail: function (res) { },
|
||||||
|
complete: function (res) { },
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
ordertap:function(e){
|
||||||
|
var currentTab = e.target.dataset.index;
|
||||||
|
this.setData({
|
||||||
|
currentTab:currentTab,
|
||||||
|
hiddens:false
|
||||||
|
})
|
||||||
|
console.log(this.data.currentTab)
|
||||||
|
},
|
||||||
|
icondui:function(e){
|
||||||
|
var that=this;
|
||||||
|
var icondui = e.target.dataset.ider;
|
||||||
|
|
||||||
|
that.setData({
|
||||||
|
icondui: icondui,
|
||||||
|
hiddens: true,
|
||||||
|
allOrder: that.data.alloeder[icondui],
|
||||||
|
currentTab: -1
|
||||||
|
})
|
||||||
|
that.orderlist();
|
||||||
|
this.orderlistmoney();
|
||||||
|
},
|
||||||
|
icondui2:function(e){
|
||||||
|
var that = this;
|
||||||
|
var icondui2 = e.target.dataset.ider;
|
||||||
|
var promoterLists = that.data.promoterList;
|
||||||
|
var len = promoterLists.length;
|
||||||
|
for (var index in promoterLists){
|
||||||
|
if (promoterLists[index]['uid'] == icondui2){
|
||||||
|
var promoter = promoterLists[index]['nickname'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
spread: function () {
|
|
||||||
wx.navigateTo({
|
|
||||||
url: '../../pages/spread/spread',
|
|
||||||
success: function (res) { },
|
|
||||||
fail: function (res) { },
|
|
||||||
complete: function (res) { },
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
ordertap:function(e){
|
that.setData({
|
||||||
var currentTab = e.target.dataset.index;
|
icondui2: icondui2,
|
||||||
this.setData({
|
hiddens: true,
|
||||||
currentTab:currentTab,
|
promoter: promoter,
|
||||||
hiddens:false
|
currentTab: -1
|
||||||
})
|
})
|
||||||
console.log(this.data.currentTab)
|
that.orderlist();
|
||||||
},
|
},
|
||||||
icondui:function(e){
|
zhaoguan:function(e){
|
||||||
var that=this;
|
this.setData({
|
||||||
var icondui = e.target.dataset.ider;
|
hiddens: true,
|
||||||
|
currentTab: -1
|
||||||
that.setData({
|
})
|
||||||
icondui: icondui,
|
},
|
||||||
hiddens: true,
|
orderlist: function (){
|
||||||
allOrder: that.data.alloeder[icondui],
|
var header = {
|
||||||
currentTab: -1
|
'content-type': 'application/x-www-form-urlencoded',
|
||||||
})
|
};
|
||||||
that.orderlist();
|
var that = this;
|
||||||
},
|
var icondui = that.data.icondui;
|
||||||
icondui2:function(e){
|
var icondui2 = that.data.icondui2;
|
||||||
var that = this;
|
wx.request({
|
||||||
var icondui2 = e.target.dataset.ider;
|
url: app.globalData.url + '/routine/auth_api/subordinateOrderlist?uid=' + app.globalData.uid,
|
||||||
var promoterLists = that.data.promoterList;
|
data: { uid: icondui2, status: icondui},
|
||||||
var len = promoterLists.length;
|
method: 'POST',
|
||||||
for (var index in promoterLists){
|
header: header,
|
||||||
if (promoterLists[index]['uid'] == icondui2){
|
success: function (res) {
|
||||||
var promoter = promoterLists[index]['nickname'];
|
if (res.data.code==200){
|
||||||
}
|
that.setData({
|
||||||
|
orderlist: res.data.data
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
that.setData({
|
||||||
|
orderlist: []
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
orderlistmoney: function () {
|
||||||
|
var that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.url + '/routine/auth_api/subordinateOrderlistmoney?uid=' + app.globalData.uid,
|
||||||
|
data: { status: that.data.icondui},
|
||||||
|
method: 'POST',
|
||||||
|
success: function (res) {
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
that.setData({
|
||||||
|
ordermoney: res.data.data.sum,
|
||||||
|
orderconut: res.data.data.cont
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
that.setData({
|
||||||
|
ordermoney:'',
|
||||||
|
orderconut:''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
that.setData({
|
|
||||||
icondui2: icondui2,
|
|
||||||
hiddens: true,
|
|
||||||
promoter: promoter,
|
|
||||||
currentTab: -1
|
|
||||||
})
|
|
||||||
that.orderlist();
|
|
||||||
},
|
|
||||||
zhaoguan:function(e){
|
|
||||||
this.setData({
|
|
||||||
hiddens: true,
|
|
||||||
currentTab: -1
|
|
||||||
})
|
|
||||||
},
|
|
||||||
orderlist: function (){
|
|
||||||
var header = {
|
|
||||||
'content-type': 'application/x-www-form-urlencoded',
|
|
||||||
};
|
|
||||||
var that = this;
|
|
||||||
var icondui = that.data.icondui;
|
|
||||||
var icondui2 = that.data.icondui2;
|
|
||||||
wx.request({
|
|
||||||
url: app.globalData.url + '/routine/auth_api/subordinateOrderlist?uid=' + app.globalData.uid,
|
|
||||||
data: { uid: icondui2, status: icondui},
|
|
||||||
method: 'POST',
|
|
||||||
header: header,
|
|
||||||
success: function (res) {
|
|
||||||
if (res.data.code==200){
|
|
||||||
that.setData({
|
|
||||||
orderlist: res.data.data
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
that.setData({
|
|
||||||
orderlist: []
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
orderlistmoney: function () {
|
|
||||||
var that = this;
|
|
||||||
wx.request({
|
|
||||||
url: app.globalData.url + '/routine/auth_api/subordinateOrderlistmoney?uid=' + app.globalData.uid,
|
|
||||||
data: { uid: 0, status: 0 },
|
|
||||||
method: 'POST',
|
|
||||||
success: function (res) {
|
|
||||||
if (res.data.code == 200) {
|
|
||||||
that.setData({
|
|
||||||
ordermoney: res.data.data.sum,
|
|
||||||
orderconut: res.data.data.cont
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
that.setData({
|
|
||||||
ordermoney:'',
|
|
||||||
orderconut:''
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -33,13 +33,13 @@ Page({
|
|||||||
search: e.detail.value
|
search: e.detail.value
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getorderlist: function (e) {
|
getorderlist: function () {
|
||||||
var header = {
|
var header = {
|
||||||
'content-type': 'application/x-www-form-urlencoded',
|
'content-type': 'application/x-www-form-urlencoded',
|
||||||
};
|
};
|
||||||
var that = this;
|
var that = this;
|
||||||
var search = that.data.search;
|
var search = that.data.search;
|
||||||
var limit = 4;
|
var limit = 8;
|
||||||
var orderType = that.data.orderType;
|
var orderType = that.data.orderType;
|
||||||
var first = that.data.first;
|
var first = that.data.first;
|
||||||
var startpage = limit * first;
|
var startpage = limit * first;
|
||||||
@ -49,7 +49,6 @@ Page({
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
header: header,
|
header: header,
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
console.log(res);
|
|
||||||
var $data = res.data.data;
|
var $data = res.data.data;
|
||||||
if (!startpage && !$data.length){
|
if (!startpage && !$data.length){
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
@ -115,7 +114,7 @@ Page({
|
|||||||
* 页面上拉触底事件的处理函数
|
* 页面上拉触底事件的处理函数
|
||||||
*/
|
*/
|
||||||
onReachBottom: function () {
|
onReachBottom: function () {
|
||||||
|
this.getorderlist();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -103,9 +103,8 @@ Page({
|
|||||||
success: function (res) {
|
success: function (res) {
|
||||||
wx.hideLoading();
|
wx.hideLoading();
|
||||||
var data = JSON.parse(res.data);
|
var data = JSON.parse(res.data);
|
||||||
console.log(data);
|
|
||||||
if (data.code == 200) {
|
if (data.code == 200) {
|
||||||
that.data.dataimg.push(data.data.url);
|
that.data.dataimg.push(app.globalData.url+data.data.url);
|
||||||
}
|
}
|
||||||
that.setData({
|
that.setData({
|
||||||
dataimg: that.data.dataimg
|
dataimg: that.data.dataimg
|
||||||
@ -184,6 +183,11 @@ Page({
|
|||||||
icon: 'success',
|
icon: 'success',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
})
|
})
|
||||||
|
setTimeout(function(){
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/orders-con/orders-con?order_id=' + that.data.orderId
|
||||||
|
})
|
||||||
|
},1500)
|
||||||
}else{
|
}else{
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: res.data.msg,
|
title: res.data.msg,
|
||||||
|
|||||||
@ -2,179 +2,132 @@ var app = getApp();
|
|||||||
// pages/user/user.js
|
// pages/user/user.js
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
url: app.globalData.urlImages,
|
url: app.globalData.urlImages,
|
||||||
userinfo:[],
|
userinfo:[],
|
||||||
orderStatusNum:[],
|
orderStatusNum:[],
|
||||||
coupon:'',
|
coupon:'',
|
||||||
collect:''
|
collect:''
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad: function (options) {
|
onLoad: function (options) {
|
||||||
app.setBarColor();
|
app.setBarColor();
|
||||||
app.setUserInfo();
|
app.setUserInfo();
|
||||||
var header = {
|
var header = {
|
||||||
'content-type': 'application/x-www-form-urlencoded',
|
'content-type': 'application/x-www-form-urlencoded',
|
||||||
};
|
};
|
||||||
var that = this;
|
var that = this;
|
||||||
wx.request({
|
wx.request({
|
||||||
url: app.globalData.url + '/routine/auth_api/my?uid=' + app.globalData.uid,
|
url: app.globalData.url + '/routine/auth_api/my?uid=' + app.globalData.uid,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
header: header,
|
header: header,
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
that.setData({
|
that.setData({
|
||||||
userinfo: res.data.data,
|
userinfo: res.data.data,
|
||||||
orderStatusNum: res.data.data.orderStatusNum
|
orderStatusNum: res.data.data.orderStatusNum
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
goNotification:function(){
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/news-list/news-list',
|
||||||
})
|
})
|
||||||
that.coupon();
|
},
|
||||||
that.collect();
|
onShow: function () {
|
||||||
}
|
var header = {
|
||||||
});
|
'content-type': 'application/x-www-form-urlencoded',
|
||||||
},
|
};
|
||||||
goNotification:function(){
|
var that = this;
|
||||||
wx.navigateTo({
|
wx.request({
|
||||||
url: '/pages/news-list/news-list',
|
url: app.globalData.url + '/routine/auth_api/my?uid=' + app.globalData.uid,
|
||||||
})
|
method: 'POST',
|
||||||
},
|
header: header,
|
||||||
onShow: function () {
|
success: function (res) {
|
||||||
var header = {
|
that.setData({
|
||||||
'content-type': 'application/x-www-form-urlencoded',
|
userinfo: res.data.data
|
||||||
};
|
})
|
||||||
var that = this;
|
}
|
||||||
wx.request({
|
});
|
||||||
url: app.globalData.url + '/routine/auth_api/my?uid=' + app.globalData.uid,
|
},
|
||||||
method: 'POST',
|
/**
|
||||||
header: header,
|
* 生命周期函数--我的余额
|
||||||
success: function (res) {
|
*/
|
||||||
that.setData({
|
money:function(){
|
||||||
userinfo: res.data.data
|
wx.navigateTo({
|
||||||
|
url: '/pages/main/main?now=' + this.data.userinfo.now_money + '&uid='+app.globalData.uid,
|
||||||
|
success: function (res) { },
|
||||||
|
fail: function (res) { },
|
||||||
|
complete: function (res) { },
|
||||||
})
|
})
|
||||||
that.coupon();
|
},
|
||||||
that.collect();
|
/**
|
||||||
}
|
* 生命周期函数--我的积分
|
||||||
});
|
*/
|
||||||
},
|
integral: function () {
|
||||||
/**
|
wx.navigateTo({
|
||||||
* 生命周期函数--优惠卷个数
|
url: '/pages/integral-con/integral-con?inte=' + this.data.userinfo.integral + '&uid=' + app.globalData.uid,
|
||||||
*/
|
success: function (res) { },
|
||||||
coupon: function () {
|
fail: function (res) { },
|
||||||
var header = {
|
complete: function (res) { },
|
||||||
'content-type': 'application/x-www-form-urlencoded',
|
|
||||||
};
|
|
||||||
var that = this;
|
|
||||||
wx.request({
|
|
||||||
url: app.globalData.url + '/routine/auth_api/get_use_coupons?uid=' + app.globalData.uid,
|
|
||||||
data:{types:0},
|
|
||||||
method: 'GET',
|
|
||||||
header: header,
|
|
||||||
success: function (res) {
|
|
||||||
that.setData({
|
|
||||||
// coupon: res.data.data.length
|
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
})
|
/**
|
||||||
},
|
* 生命周期函数--我的优惠卷
|
||||||
/**
|
*/
|
||||||
* 生命周期函数--收藏个数
|
coupons: function () {
|
||||||
*/
|
wx.navigateTo({
|
||||||
collect: function () {
|
url: '/pages/coupon/coupon',
|
||||||
var header = {
|
success: function (res) { },
|
||||||
'content-type': 'application/x-www-form-urlencoded',
|
fail: function (res) { },
|
||||||
'cookie': app.globalData.sessionId//读取cookie
|
complete: function (res) { },
|
||||||
};
|
|
||||||
var that = this;
|
|
||||||
wx.request({
|
|
||||||
url: app.globalData.url + '/routine/auth_api/get_user_collect_product?uid=' + app.globalData.uid,
|
|
||||||
method: 'GET',
|
|
||||||
header: header,
|
|
||||||
success: function (res) {
|
|
||||||
that.setData({
|
|
||||||
// collect: res.data.data.length
|
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
})
|
/**
|
||||||
},
|
* 生命周期函数--我的收藏
|
||||||
/**
|
*/
|
||||||
* 生命周期函数--我的余额
|
collects: function () {
|
||||||
*/
|
wx.navigateTo({
|
||||||
money:function(){
|
url: '/pages/collect/collect',
|
||||||
wx.navigateTo({
|
})
|
||||||
url: '/pages/main/main?now=' + this.data.userinfo.now_money + '&uid='+app.globalData.uid,
|
},
|
||||||
success: function (res) { },
|
/**
|
||||||
fail: function (res) { },
|
* 生命周期函数--我的推广人
|
||||||
complete: function (res) { },
|
*/
|
||||||
})
|
extension:function(){
|
||||||
},
|
wx.navigateTo({
|
||||||
/**
|
url: '/pages/feree/feree',
|
||||||
* 生命周期函数--我的积分
|
success: function (res) { },
|
||||||
*/
|
fail: function (res) { },
|
||||||
integral: function () {
|
complete: function (res) { },
|
||||||
wx.navigateTo({
|
})
|
||||||
url: '/pages/integral-con/integral-con?inte=' + this.data.userinfo.integral + '&uid=' + app.globalData.uid,
|
},
|
||||||
success: function (res) { },
|
/**
|
||||||
fail: function (res) { },
|
* 生命周期函数--我的推广
|
||||||
complete: function (res) { },
|
*/
|
||||||
})
|
myextension: function () {
|
||||||
},
|
wx.navigateTo({
|
||||||
/**
|
url: '/pages/extension/extension',
|
||||||
* 生命周期函数--我的优惠卷
|
success: function (res) { },
|
||||||
*/
|
fail: function (res) { },
|
||||||
coupons: function () {
|
complete: function (res) { },
|
||||||
wx.navigateTo({
|
})
|
||||||
url: '/pages/coupon/coupon',
|
},
|
||||||
success: function (res) { },
|
/**
|
||||||
fail: function (res) { },
|
* 生命周期函数--我的砍价
|
||||||
complete: function (res) { },
|
*/
|
||||||
})
|
// cut_down_the_price:function(){
|
||||||
},
|
// wx.navigateTo({
|
||||||
/**
|
// url: '../../pages/feree/feree',
|
||||||
* 生命周期函数--我的收藏
|
// success: function (res) { },
|
||||||
*/
|
// fail: function (res) { },
|
||||||
collects: function () {
|
// complete: function (res) { },
|
||||||
wx.navigateTo({
|
// })
|
||||||
url: '/pages/collect/collect',
|
// }
|
||||||
success: function (res) { },
|
|
||||||
fail: function (res) { },
|
|
||||||
complete: function (res) { },
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 生命周期函数--我的推广人
|
|
||||||
*/
|
|
||||||
extension:function(){
|
|
||||||
wx.navigateTo({
|
|
||||||
url: '/pages/feree/feree',
|
|
||||||
success: function (res) { },
|
|
||||||
fail: function (res) { },
|
|
||||||
complete: function (res) { },
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 生命周期函数--我的推广
|
|
||||||
*/
|
|
||||||
myextension: function () {
|
|
||||||
wx.navigateTo({
|
|
||||||
url: '/pages/extension/extension',
|
|
||||||
success: function (res) { },
|
|
||||||
fail: function (res) { },
|
|
||||||
complete: function (res) { },
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 生命周期函数--我的砍价
|
|
||||||
*/
|
|
||||||
// cut_down_the_price:function(){
|
|
||||||
// wx.navigateTo({
|
|
||||||
// url: '../../pages/feree/feree',
|
|
||||||
// success: function (res) { },
|
|
||||||
// fail: function (res) { },
|
|
||||||
// complete: function (res) { },
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
})
|
})
|
||||||
@ -19,11 +19,11 @@
|
|||||||
<view class='text' >我的积分</view>
|
<view class='text' >我的积分</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='amount-item' bindtap='coupons'>
|
<view class='amount-item' bindtap='coupons'>
|
||||||
<view class='count'>{{coupon ? coupon : 0}}</view>
|
<view class='count'>{{userinfo.couponCount ? userinfo.couponCount : 0}}</view>
|
||||||
<view class='text' >优惠券</view>
|
<view class='text' >优惠券</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='amount-item' bindtap='collects'>
|
<view class='amount-item' bindtap='collects'>
|
||||||
<view class='count'>{{collect ? collect : 0}}</view>
|
<view class='count'>{{userinfo.like ? userinfo.like : 0}}</view>
|
||||||
<view class='text' >收藏商品</view>
|
<view class='text' >收藏商品</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -56,6 +56,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class='item'>
|
<view class='item'>
|
||||||
<navigator hover-class="none" url='/pages/refund-order/refund-order'>
|
<navigator hover-class="none" url='/pages/refund-order/refund-order'>
|
||||||
|
<view class='item-span' wx:if="{{orderStatusNum.noRefund}}">{{orderStatusNum.noRefund}}</view>
|
||||||
<image src='/images/dfh.png'></image>
|
<image src='/images/dfh.png'></image>
|
||||||
<view class='text'>退款/售后</view>
|
<view class='text'>退款/售后</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
@ -153,7 +154,3 @@
|
|||||||
</navigator>
|
</navigator>
|
||||||
</movable-view>
|
</movable-view>
|
||||||
</movable-area>
|
</movable-area>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
"compileType": "miniprogram",
|
"compileType": "miniprogram",
|
||||||
"libVersion": "1.9.94",
|
"libVersion": "1.9.94",
|
||||||
"appid": "wx7bc36cccc15e4be2",
|
"appid": "wx7bc36cccc15e4be2",
|
||||||
"projectname": "crmebn_831",
|
"projectname": "crmebn",
|
||||||
"condition": {
|
"condition": {
|
||||||
"search": {
|
"search": {
|
||||||
"current": -1,
|
"current": -1,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user