mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-04-01 18:20:53 +00:00
小程序更新修复退款问题,添加分享海报,首页授权页面修改,添加微信收获地址
This commit is contained in:
parent
1740495c3f
commit
4e198e30be
@ -52,3 +52,131 @@ function setView($uid,$product_id=0,$cate=0,$type='',$content='',$min=20){
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建海报图片
|
||||
* @param array $product
|
||||
* @return bool|string
|
||||
*/
|
||||
function createPoster($product = array()){
|
||||
header("Content-type: image/jpg");
|
||||
$filePath = 'public/uploads/poster/'.time().'.jpg';
|
||||
$dir = iconv("UTF-8", "GBK", "public/uploads/poster");
|
||||
if(!file_exists($dir)) mkdir($dir,0775,true);
|
||||
$config = array(
|
||||
'text'=>array(
|
||||
array(
|
||||
'text'=>substr(iconv_substr($product['store_name'],0,mb_strlen($product['store_name']),'utf-8'),0,24).'...',
|
||||
'left'=>50,
|
||||
'top'=>500,
|
||||
'fontPath'=>ROOT_PATH.'public/uploads/poster/simsunb.ttf', //字体文件
|
||||
'fontSize'=>16, //字号
|
||||
'fontColor'=>'40,40,40', //字体颜色
|
||||
'angle'=>0,
|
||||
),
|
||||
array(
|
||||
'text'=>'¥'.$product['price'],
|
||||
'left'=>50,
|
||||
'top'=>580,
|
||||
'fontPath'=>ROOT_PATH.'public/uploads/poster/simsunb.ttf', //字体文件
|
||||
'fontSize'=>16, //字号
|
||||
'fontColor'=>'40,40,40', //字体颜色
|
||||
'angle'=>0,
|
||||
)
|
||||
),
|
||||
'image'=>array(
|
||||
array(
|
||||
'url'=>$product['image'],
|
||||
'left'=>50,
|
||||
'top'=>70,
|
||||
'right'=>0,
|
||||
'stream'=>0,
|
||||
'bottom'=>0,
|
||||
'width'=>350,
|
||||
'height'=>350,
|
||||
'opacity'=>100,
|
||||
),
|
||||
array(
|
||||
'url'=>$product['code_path'],
|
||||
'left'=>250,
|
||||
'top'=>480,
|
||||
'right'=>0,
|
||||
'stream'=>0,
|
||||
'bottom'=>0,
|
||||
'width'=>160,
|
||||
'height'=>180,
|
||||
'opacity'=>100,
|
||||
),
|
||||
),
|
||||
'background'=>ROOT_PATH.'public/uploads/poster/background.jpg' //背景图
|
||||
);
|
||||
$imageDefault = array(
|
||||
'left'=>0,
|
||||
'top'=>0,
|
||||
'right'=>0,
|
||||
'bottom'=>0,
|
||||
'width'=>100,
|
||||
'height'=>100,
|
||||
'opacity'=>100
|
||||
);
|
||||
$textDefault = array(
|
||||
'text'=>'2222222222',
|
||||
'left'=>0,
|
||||
'top'=>0,
|
||||
'fontSize'=>32, //字号
|
||||
'fontColor'=>'255,255,255', //字体颜色
|
||||
'angle'=>0,
|
||||
);
|
||||
$background = $config['background'];//海报最底层得背景
|
||||
//背景方法
|
||||
$backgroundInfo = getimagesize($background);
|
||||
$backgroundFun = 'imagecreatefrom'.image_type_to_extension($backgroundInfo[2], false);
|
||||
$background = $backgroundFun($background);
|
||||
// $backgroundWidth = imagesx($background); //背景宽度
|
||||
// $backgroundHeight = imagesy($background); //背景高度
|
||||
$backgroundWidth = 460; //背景宽度
|
||||
$backgroundHeight = 700; //背景高度
|
||||
$imageRes = imageCreatetruecolor($backgroundWidth,$backgroundHeight);
|
||||
$color = imagecolorallocate($imageRes, 0, 0, 0);
|
||||
imagefill($imageRes, 0, 0, $color);
|
||||
// imageColorTransparent($imageRes, $color); //颜色透明
|
||||
imagecopyresampled($imageRes,$background,0,0,0,0,imagesx($background),imagesy($background),imagesx($background),imagesy($background)); //处理了图片
|
||||
if(!empty($config['image'])){
|
||||
foreach ($config['image'] as $key => $val) {
|
||||
$val = array_merge($imageDefault,$val);
|
||||
$info = getimagesize($val['url']);
|
||||
$function = 'imagecreatefrom'.image_type_to_extension($info[2], false);
|
||||
if($val['stream']){ //如果传的是字符串图像流
|
||||
$info = getimagesizefromstring($val['url']);
|
||||
$function = 'imagecreatefromstring';
|
||||
}
|
||||
$res = $function($val['url']);
|
||||
$resWidth = $info[0];
|
||||
$resHeight = $info[1];
|
||||
//建立画板 ,缩放图片至指定尺寸
|
||||
$canvas=imagecreatetruecolor($val['width'], $val['height']);
|
||||
imagefill($canvas, 0, 0, $color);
|
||||
//关键函数,参数(目标资源,源,目标资源的开始坐标x,y, 源资源的开始坐标x,y,目标资源的宽高w,h,源资源的宽高w,h)
|
||||
imagecopyresampled($canvas, $res, 0, 0, 0, 0, $val['width'], $val['height'],$resWidth,$resHeight);
|
||||
$val['left'] = $val['left']<0?$backgroundWidth- abs($val['left']) - $val['width']:$val['left'];
|
||||
$val['top'] = $val['top']<0?$backgroundHeight- abs($val['top']) - $val['height']:$val['top'];
|
||||
//放置图像
|
||||
imagecopymerge($imageRes,$canvas, $val['left'],$val['top'],$val['right'],$val['bottom'],$val['width'],$val['height'],$val['opacity']);//左,上,右,下,宽度,高度,透明度
|
||||
} }
|
||||
//处理文字
|
||||
if(!empty($config['text'])){
|
||||
foreach ($config['text'] as $key => $val) {
|
||||
$val = array_merge($textDefault,$val);
|
||||
list($R,$G,$B) = explode(',', $val['fontColor']);
|
||||
$fontColor = imagecolorallocate($imageRes, $R, $G, $B);
|
||||
$val['left'] = $val['left']<0?$backgroundWidth- abs($val['left']):$val['left'];
|
||||
$val['top'] = $val['top']<0?$backgroundHeight- abs($val['top']):$val['top'];
|
||||
imagettftext($imageRes,$val['fontSize'],$val['angle'],$val['left'],$val['top'],$fontColor,$val['fontPath'],$val['text']);
|
||||
}
|
||||
}
|
||||
//生成图片
|
||||
$res = imagejpeg ($imageRes,$filePath,90); //保存到本地
|
||||
imagedestroy($imageRes);
|
||||
if(!$res) return false;
|
||||
return $filePath;
|
||||
}
|
||||
@ -876,9 +876,7 @@ class AuthApi extends AuthController{
|
||||
['refund_reason_wap_img',''],
|
||||
['refund_reason_wap_explain',''],
|
||||
],$request);
|
||||
if($data['refund_reason_wap_img']){
|
||||
$data['refund_reason_wap_img'] = explode(',',$data['refund_reason_wap_img']);
|
||||
}
|
||||
if($data['refund_reason_wap_img']) $data['refund_reason_wap_img'] = explode(',',$data['refund_reason_wap_img']);
|
||||
if(!$uni || $data['text'] == '') return JsonService::fail('参数错误!');
|
||||
$res = StoreOrder::orderApplyRefund($uni,$this->userInfo['uid'],$data['text'],$data['refund_reason_wap_explain'],$data['refund_reason_wap_img']);
|
||||
if($res)
|
||||
@ -1437,7 +1435,11 @@ class AuthApi extends AuthController{
|
||||
$path = 'public/uploads/routine/'.$this->userInfo['uid'].'.jpg';
|
||||
$domain=SystemConfigService::get('site_url').'/';
|
||||
if(file_exists($path)) return JsonService::successful($domain.$path);
|
||||
else file_put_contents($path,RoutineCode::getCode($this->userInfo['uid']));
|
||||
else{
|
||||
$dir = iconv("UTF-8", "GBK", "public/uploads/routine");
|
||||
mkdir ($dir,0775,true);
|
||||
file_put_contents($path,RoutineCode::getCode($this->userInfo['uid']));
|
||||
}
|
||||
return JsonService::successful($domain.$path);
|
||||
}
|
||||
|
||||
@ -1890,14 +1892,14 @@ class AuthApi extends AuthController{
|
||||
* @param string $path
|
||||
* @param int $width
|
||||
*/
|
||||
public function get_pages($path = '',$productId = 0,$width = 430){
|
||||
if($path == '' || !$productId) return JsonService::fail('参数错误'); header('content-type:image/jpg');
|
||||
if(!$this->userInfo['uid']) return JsonService::fail('授权失败,请重新授权');
|
||||
$path = 'public/uploads/routinepage/'.$productId.'.jpg';
|
||||
if(file_exists($path)) return JsonService::successful($path);
|
||||
else file_put_contents($path,RoutineCode::getCode($this->userInfo['uid']));
|
||||
return JsonService::successful($path);
|
||||
}
|
||||
// public function get_pages($path = '',$productId = 0,$width = 430){
|
||||
// if($path == '' || !$productId) return JsonService::fail('参数错误'); header('content-type:image/jpg');
|
||||
// if(!$this->userInfo['uid']) return JsonService::fail('授权失败,请重新授权');
|
||||
// $path = 'public/uploads/routinepage/'.$productId.'.jpg';
|
||||
// if(file_exists($path)) return JsonService::successful($path);
|
||||
// else file_put_contents($path,RoutineCode::getCode($this->userInfo['uid']));
|
||||
// return JsonService::successful($path);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 文章列表
|
||||
@ -1944,6 +1946,26 @@ class AuthApi extends AuthController{
|
||||
return JsonService::successful($content);
|
||||
}
|
||||
|
||||
public function poster($id = 0){
|
||||
if(!$id) return JsonService::fail('参数错误');
|
||||
$productInfo = StoreProduct::getValidProduct($id,'store_name,id,price,image,code_path');
|
||||
if(empty($productInfo)) return JsonService::fail('参数错误');
|
||||
if($productInfo['code_path'] == '') {
|
||||
$codePath = 'public/uploads/codepath/product/'.$productInfo['id'].'.jpg';
|
||||
if(!file_exists($codePath)){
|
||||
$dir = iconv("UTF-8", "GBK", "public/uploads/codepath/product");
|
||||
mkdir($dir,0775,true);
|
||||
file_put_contents($codePath,RoutineCode::getPages('pages/product-con/index?id='.$productInfo['id']));
|
||||
}
|
||||
$res = StoreProduct::edit(['code_path'=>$codePath],$id);
|
||||
if($res) $productInfo['code_path'] = $codePath;
|
||||
else return JsonService::fail('没有查看权限');
|
||||
}
|
||||
$posterPath = createPoster($productInfo);
|
||||
return JsonService::successful($posterPath);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 刷新数据缓存
|
||||
*/
|
||||
|
||||
@ -1,35 +1,24 @@
|
||||
<?php
|
||||
namespace app\wap\controller;
|
||||
|
||||
use service\WechatService;
|
||||
|
||||
namespace app\routine\controller;
|
||||
use behavior\wechat\PaymentBehavior;
|
||||
use service\HookService;
|
||||
use service\RoutineNotify;
|
||||
|
||||
/**
|
||||
* 微信服务器 验证控制器
|
||||
* Class Wechat
|
||||
* @package app\wap\controller
|
||||
* 小程序支付回调
|
||||
* Class Routine
|
||||
* @package app\routine\controller
|
||||
*/
|
||||
class Wechat
|
||||
class Routine
|
||||
{
|
||||
|
||||
/**
|
||||
* 微信服务器 验证
|
||||
*/
|
||||
public function serve()
|
||||
{
|
||||
WechatService::serve();
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付 异步回调
|
||||
*/
|
||||
public function notify()
|
||||
{
|
||||
WechatService::handleNotify();
|
||||
}
|
||||
|
||||
|
||||
|
||||
$result = RoutineNotify::notify();
|
||||
if($result) HookService::listen('wechat_pay_success_'.strtolower($result['attach']),$result['out_trade_no'],$result,true,PaymentBehavior::class);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
9
application/routine/model/store/StoreOrder.php
Executable file → Normal file
9
application/routine/model/store/StoreOrder.php
Executable file → Normal file
@ -378,11 +378,16 @@ class StoreOrder extends ModelBasic
|
||||
if(!$res)
|
||||
return self::setErrorInfo('申请退款失败!');
|
||||
else{
|
||||
try{
|
||||
$adminIds = SystemConfigService::get('site_store_admin_uids');
|
||||
if(!$adminIds || !($adminList = array_unique(array_filter(explode(',',trim($adminIds)))))) return false;
|
||||
if(!empty($adminIds)){
|
||||
try{
|
||||
if(!($adminList = array_unique(array_filter(explode(',',trim($adminIds)))))){
|
||||
self::setErrorInfo('申请退款成功,');
|
||||
return false;
|
||||
}
|
||||
RoutineTemplate::sendOrderRefundStatus($order,$refundReasonWap,$adminList);//小程序 发送模板消息
|
||||
}catch (\Exception $e){}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,8 +9,10 @@ namespace app\routine\model\store;
|
||||
|
||||
use app\routine\model\store\StoreCombination;
|
||||
use app\routine\model\user\User;
|
||||
use app\routine\model\user\UserBill;
|
||||
use app\routine\model\user\WechatUser;
|
||||
use basic\ModelBasic;
|
||||
use service\SystemConfigService;
|
||||
use service\WechatTemplateService;
|
||||
use think\Url;
|
||||
use traits\ModelTrait;
|
||||
@ -148,16 +150,22 @@ class StorePink extends ModelBasic
|
||||
* @param $pid
|
||||
*/
|
||||
public static function orderPinkAfter($uidAll,$pid){
|
||||
foreach ($uidAll as $v){
|
||||
$openid = WechatUser::uidToOpenid($v);
|
||||
WechatTemplateService::sendTemplate($openid,WechatTemplateService::ORDER_USER_GROUPS_SUCCESS,[
|
||||
'first'=>'亲,您的拼团已经完成了',
|
||||
'keyword1'=> self::where('id',$pid)->whereOr('k_id',$pid)->where('uid',$v)->value('order_id'),
|
||||
'keyword2'=> self::alias('p')->where('p.id',$pid)->whereOr('p.k_id',$pid)->where('p.uid',$v)->join('__STORE_COMBINATION__ c','c.id=p.cid')->value('c.title'),
|
||||
'remark'=>'点击查看订单详情'
|
||||
],Url::build('My/order_pink_after',['id'=>$pid],true,true));
|
||||
}
|
||||
self::where('uid','IN',implode(',',$uidAll))->where('id',$pid)->whereOr('k_id',$pid)->update(['is_tpl'=>1]);
|
||||
// foreach ($uidAll as $v){
|
||||
// $openid = WechatUser::uidToOpenid($v);
|
||||
// WechatTemplateService::sendTemplate($openid,WechatTemplateService::ORDER_USER_GROUPS_SUCCESS,[
|
||||
// 'first'=>'亲,您的拼团已经完成了',
|
||||
// 'keyword1'=> self::where('id',$pid)->whereOr('k_id',$pid)->where('uid',$v)->value('order_id'),
|
||||
// 'keyword2'=> self::alias('p')->where('p.id',$pid)->whereOr('p.k_id',$pid)->where('p.uid',$v)->join('__STORE_COMBINATION__ c','c.id=p.cid')->value('c.title'),
|
||||
// 'remark'=>'点击查看订单详情'
|
||||
// ],Url::build('My/order_pink_after',['id'=>$pid],true,true));
|
||||
// }
|
||||
self::beginTrans();
|
||||
$res1 = self::where('uid','IN',implode(',',$uidAll))->where('id',$pid)->whereOr('k_id',$pid)->update(['is_tpl'=>1]);
|
||||
$res2 = true;
|
||||
// if(SystemConfigService::get('colonel_status')) $res2 = self::setRakeBackColonel($pid);
|
||||
// else $res2 = true;
|
||||
$res = $res1 && $res2;
|
||||
self::checkTrans($res);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -339,4 +347,27 @@ class StorePink extends ModelBasic
|
||||
else return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 拼团成功后给团长返佣金
|
||||
* @param int $id
|
||||
* @return bool
|
||||
*/
|
||||
// public static function setRakeBackColonel($id = 0){
|
||||
// if(!$id) return false;
|
||||
// $pinkRakeBack = self::where('id',$id)->field('people,price,uid,id')->find()->toArray();
|
||||
// $countPrice = bcmul($pinkRakeBack['people'],$pinkRakeBack['price'],2);
|
||||
// if(bcsub((float)$countPrice,0,2) <= 0) return true;
|
||||
// $rakeBack = (SystemConfigService::get('rake_back_colonel') ?: 0)/100;
|
||||
// if($rakeBack <= 0) return true;
|
||||
// $rakeBackPrice = bcmul($countPrice,$rakeBack,2);
|
||||
// if($rakeBackPrice <= 0) return true;
|
||||
// $mark = '拼团成功,奖励佣金'.floatval($rakeBackPrice);
|
||||
// self::beginTrans();
|
||||
// $res1 = UserBill::income('获得拼团佣金',$pinkRakeBack['uid'],'now_money','colonel',$rakeBackPrice,$id,0,$mark);
|
||||
// $res2 = User::bcInc($pinkRakeBack['uid'],'now_money',$rakeBackPrice,'uid');
|
||||
// $res = $res1 && $res2;
|
||||
// self::checkTrans($res);
|
||||
// return $res;
|
||||
// }
|
||||
}
|
||||
@ -81,7 +81,9 @@ class User extends ModelBasic
|
||||
*/
|
||||
public static function isUserSpread($uid = 0){
|
||||
if(!$uid) return false;
|
||||
$isPromoter = self::where('uid',$uid)->value('is_promoter');
|
||||
$status = (int)SystemConfigService::get('store_brokerage_statu');
|
||||
$isPromoter = true;
|
||||
if($status == 1) $isPromoter = self::where('uid',$uid)->value('is_promoter');
|
||||
if($isPromoter) return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
7
application/routine/model/user/UserRecharge.php
Executable file → Normal file
7
application/routine/model/user/UserRecharge.php
Executable file → Normal file
@ -24,14 +24,15 @@ class UserRecharge extends ModelBasic
|
||||
|
||||
public static function addRecharge($uid,$price,$recharge_type = 'weixin',$paid = 0)
|
||||
{
|
||||
$order_id = self::getNewOrderId();
|
||||
$order_id = self::getNewOrderId($uid);
|
||||
return self::set(compact('order_id','uid','price','recharge_type','paid'));
|
||||
}
|
||||
|
||||
public static function getNewOrderId()
|
||||
public static function getNewOrderId($uid = 0)
|
||||
{
|
||||
if(!$uid) return false;
|
||||
$count = (int) self::where('add_time',['>=',strtotime(date("Y-m-d"))],['<',strtotime(date("Y-m-d",strtotime('+1 day')))])->count();
|
||||
return 'wx1'.date('YmdHis',time()).(10000+$count+1);
|
||||
return 'wx1'.date('YmdHis',time()).(10000+$count+$uid);
|
||||
}
|
||||
|
||||
public static function jsPay($orderInfo)
|
||||
|
||||
@ -47,124 +47,9 @@ App({
|
||||
})
|
||||
setTimeout(function () {
|
||||
wx.navigateTo({
|
||||
url: '/pages/enter/enter',
|
||||
url: '/pages/load/load',
|
||||
})
|
||||
}, 2000)
|
||||
}, 1500)
|
||||
}
|
||||
},
|
||||
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',
|
||||
})
|
||||
},
|
||||
})
|
||||
},
|
||||
getUserInfoEnter: 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 (that.globalData.openPages != '') {
|
||||
wx.navigateTo({
|
||||
url: that.globalData.openPages
|
||||
})
|
||||
} else {
|
||||
wx.reLaunch({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('登录失败!' + res.errMsg)
|
||||
}
|
||||
},
|
||||
fail: function (res) {
|
||||
wx.showToast({
|
||||
title: '授权失败,请重新打开小程序',
|
||||
icon: 'none',
|
||||
duration: 1500,
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: function (res) {
|
||||
wx.showToast({
|
||||
title: '授权失败,请重新授权',
|
||||
icon: 'none',
|
||||
duration: 1500,
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
})
|
||||
@ -3,9 +3,9 @@
|
||||
"pages/load/load",
|
||||
"pages/login-status/login-status",
|
||||
"pages/payment/payment",
|
||||
"pages/home/home",
|
||||
"pages/new-con/new-con",
|
||||
"pages/new-list/new-list",
|
||||
"pages/enter/enter",
|
||||
"pages/index/index",
|
||||
"pages/refunding/refunding",
|
||||
"pages/miao-list/miao-list",
|
||||
@ -14,13 +14,11 @@
|
||||
"pages/product-countdown/index",
|
||||
"pages/refund-page/refund-page",
|
||||
"pages/refund-order/refund-order",
|
||||
"pages/cut-one/cut-one",
|
||||
"pages/spread/spread",
|
||||
"pages/promotion-order/promotion-order",
|
||||
"pages/coupon/coupon",
|
||||
"pages/news-list/news-list",
|
||||
"pages/product-con/index",
|
||||
"pages/product-pinke/index",
|
||||
"pages/comment-con/comment-con",
|
||||
"pages/orderForm/orderForm",
|
||||
"pages/orders-list/orders-list",
|
||||
|
||||
@ -33,9 +33,9 @@ page{font-size: 28rpx; background-color: #f7f7f7; color: #333;}
|
||||
.line{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
||||
.line2{word-break:break-all;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
|
||||
.zhao{position:fixed;top:0;left:0;right:0;bottom:0;background-color:#000;opacity:0.7;}
|
||||
.index-con{position:fixed; right:6rpx;top: 20%; width: 80rpx; height: 100rpx;}
|
||||
.index-con{position:fixed; left:6rpx;top: 20%; width: 80rpx; height: 100rpx;}
|
||||
.index-con image{width: 82rpx; height: 82rpx;}
|
||||
.index-con navigator{width: 82rpx; height: 82rpx;position: absolute;bottom: 0;left: 0}
|
||||
.index-con .index-area{display:inline-block;top:88rpx;left:0px;position:relative;height: 500rpx;width:82rpx;}
|
||||
.index-con navigator{width: 82rpx; height: 100rpx;position: absolute;bottom: 0;left: 0}
|
||||
.index-con .index-area{display:inline-block;top:88rpx;left:0px;position:relative;height: 600rpx;width:82rpx;}
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 229 KiB After Width: | Height: | Size: 57 KiB |
@ -11,7 +11,6 @@ Page({
|
||||
onLoad: function (options) {
|
||||
app.setBarColor();
|
||||
app.setUserInfo();
|
||||
console.log(options);
|
||||
if (options.cartId) {
|
||||
this.setData({
|
||||
cartId: options.cartId,
|
||||
@ -21,6 +20,60 @@ Page({
|
||||
}
|
||||
this.getAddress();
|
||||
},
|
||||
getWxAddress:function(){
|
||||
var that = this;
|
||||
wx.authorize({
|
||||
scope: 'scope.address',
|
||||
success: function(res) {
|
||||
wx.chooseAddress({
|
||||
success: function(res) {
|
||||
console.log(res);
|
||||
var addressP = {};
|
||||
addressP.province = res.provinceName;
|
||||
addressP.city = res.cityName;
|
||||
addressP.district = res.countyName;
|
||||
wx.request({
|
||||
url: app.globalData.url + '/routine/auth_api/edit_user_address?uid=' + app.globalData.uid,
|
||||
method: 'POST',
|
||||
data: {
|
||||
address: addressP,
|
||||
is_default: 0,
|
||||
real_name: res.userName,
|
||||
post_code: res.postalCode,
|
||||
phone: res.telNumber,
|
||||
detail: res.detailInfo,
|
||||
id: 0
|
||||
},
|
||||
success: function (res) {
|
||||
if (res.data.code == 200) {
|
||||
wx.showToast({
|
||||
title: '添加成功',
|
||||
icon: 'success',
|
||||
duration: 1000
|
||||
})
|
||||
that.getAddress();
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: function(res) {
|
||||
if (res.errMsg == 'chooseAddress:cancel'){
|
||||
wx.showToast({
|
||||
title: '取消选择',
|
||||
icon: 'none',
|
||||
duration: 1500
|
||||
})
|
||||
}
|
||||
},
|
||||
complete: function(res) {},
|
||||
})
|
||||
},
|
||||
fail: function(res) {
|
||||
console.log(res);
|
||||
},
|
||||
complete: function(res) {},
|
||||
})
|
||||
},
|
||||
getAddress: function () {
|
||||
var that = this;
|
||||
var header = {
|
||||
|
||||
@ -19,4 +19,8 @@
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class='footer' bindtap='addAddress'>新增地址</view>
|
||||
<view style='height:80rpx'></view>
|
||||
<view class='footer'>
|
||||
<view class='system-address' bindtap='addAddress'>新增地址</view>
|
||||
<view class='weixin-address' bindtap='getWxAddress'>微信地址</view>
|
||||
</view>
|
||||
|
||||
@ -11,4 +11,7 @@
|
||||
.Maddress{font-size:26rpx;}
|
||||
.edit,.del{width:112rpx;height:54rpx;border:1rpx solid #999999;border-radius:8rpx;text-align:center;line-height:54rpx;display:inline-block;font-size:24rpx;}
|
||||
.del{margin-left:20rpx;}
|
||||
.footer{width:100%;height:100rpx;line-height:100rpx;font-size:30rpx;text-align:center;color:#ffffff;background-color:#FF3D3D;position:fixed;bottom:0;}
|
||||
.footer{width:100%;height:100rpx;line-height:100rpx;font-size:30rpx;
|
||||
text-align:center;color:#ffffff;background-color:#eb4e2b;position:fixed;bottom:0;}
|
||||
.footer .system-address{width:50%;float:left;}
|
||||
.footer .weixin-address{width:50%;float:right;background-color:#f3b23e}
|
||||
@ -16,6 +16,7 @@ Page({
|
||||
*/
|
||||
onLoad:function (opends) {
|
||||
app.setBarColor();
|
||||
app.setUserInfo();
|
||||
var that = this;
|
||||
this.getUserInfo();
|
||||
this.getUserExtractBank();
|
||||
@ -167,4 +168,6 @@ Page({
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
@ -20,11 +20,11 @@ Page({
|
||||
*/
|
||||
onLoad: function (e) {
|
||||
app.setBarColor();
|
||||
app.setUserInfo();
|
||||
var header = {
|
||||
'content-type': 'application/x-www-form-urlencoded'
|
||||
};
|
||||
var that = this;
|
||||
console.log(e);
|
||||
if (e.unique) {
|
||||
var unique = e.unique;
|
||||
that.setData({
|
||||
|
||||
@ -12,7 +12,10 @@
|
||||
<textarea placeholder='宝贝满足你的期待么?说说你的想法,分享给想买的他们吧~' placeholder-class='placeholder' name = 'comment'></textarea>
|
||||
<view class='imgul'>
|
||||
<block wx:for="{{dataimg}}">
|
||||
<view class='imgpic'><image src='{{url}}{{item.data.url}}' class='dataimg'></image><icon class='iconfont icon-guanbi guanbi'></icon></view>
|
||||
<view class='imgpic'>
|
||||
<image src='{{item.data.url}}' class='dataimg'></image>
|
||||
<icon class='iconfont icon-guanbi guanbi' data-id='{{index}}' bindtap='delImages'></icon>
|
||||
</view>
|
||||
</block>
|
||||
<view class='upimg' bindtap='uploadpic' hidden='{{hidden}}'></view>
|
||||
</view>
|
||||
|
||||
@ -20,6 +20,7 @@ Page({
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
app.setBarColor();
|
||||
app.setUserInfo();
|
||||
var productId = options.productId;
|
||||
this.setData({
|
||||
productId: productId
|
||||
|
||||
@ -20,6 +20,7 @@ Page({
|
||||
},
|
||||
onLoad: function (options) {
|
||||
app.setBarColor();
|
||||
app.setUserInfo();
|
||||
if (options.cartId){
|
||||
this.setData({
|
||||
cartId: options.cartId,
|
||||
|
||||
@ -12,7 +12,6 @@ Page({
|
||||
|
||||
},
|
||||
headertaps:function(e){
|
||||
// console.log(e);
|
||||
this.setData({
|
||||
_active: e.target.dataset.idx
|
||||
});
|
||||
|
||||
@ -29,7 +29,7 @@ Page({
|
||||
dataType : 'json',
|
||||
success: function (res) {
|
||||
that.setData({
|
||||
logo: res.data.data.site_logo,
|
||||
logo: app.globalData.url + res.data.data.site_logo,
|
||||
name: res.data.data.site_name
|
||||
})
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ Page({
|
||||
},
|
||||
onLoad: function (options) {
|
||||
app.setBarColor();
|
||||
app.setUserInfo();
|
||||
var header = {
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
};
|
||||
|
||||
@ -58,7 +58,6 @@ Page({
|
||||
method: 'POST',
|
||||
header: header,
|
||||
success: function (res) {
|
||||
console.log(res.data.data.banner);
|
||||
that.setData({
|
||||
imgUrls: res.data.data.banner,
|
||||
recommendLsit: res.data.data.best,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
.swiper-item{position: relative; width: 100%;}
|
||||
.swiper_banner swiper-item image{width: 100%; height: 400rpx;}
|
||||
.swiper-box .wx-swiper-dots.wx-swiper-dots-horizontal{width: 100%; padding-right: 30rpx;display: flex;justify-content:flex-end;box-sizing: border-box;}
|
||||
.nav{ width: 100%; padding:0 20rpx; box-sizing: border-box; height: 197rpx; align-items: center; background-color: #fff;}
|
||||
.nav{ width: 100%; padding:0 10rpx; box-sizing: border-box; height: 197rpx; align-items: center; background-color: #fff;}
|
||||
.nav .nav-item{width: 25%;}
|
||||
.nav .nav-item image{width: 80rpx; height:80rpx;}
|
||||
.nav .nav-item text{display: blcok;}
|
||||
|
||||
@ -16,6 +16,8 @@ Page({
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
app.setBarColor();
|
||||
app.setUserInfo();
|
||||
this.getUserInfo();
|
||||
this.getList();
|
||||
},//user_integral_list
|
||||
|
||||
@ -1,71 +1,63 @@
|
||||
// pages/load/load.js
|
||||
var app = getApp();
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
logo: '',
|
||||
name: '',
|
||||
spid: 0,
|
||||
url: app.globalData.url,
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
if (options.scene) {
|
||||
app.globalData.spid = options.scene;
|
||||
}
|
||||
var that = this;
|
||||
that.getEnterLogo();
|
||||
app.setBarColor();
|
||||
app.getUserInfo();
|
||||
if (options.scene) that.data.spid = options.scene;
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
getEnterLogo: function () {
|
||||
var that = this;
|
||||
wx.request({
|
||||
url: app.globalData.url + '/routine/login/get_enter_logo',
|
||||
method: 'post',
|
||||
dataType : 'json',
|
||||
success: function (res) {
|
||||
that.setData({
|
||||
logo: res.data.data.site_logo,
|
||||
name: res.data.data.site_name
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
//获取用户信息并且授权
|
||||
getUserInfo: function(e){
|
||||
var userInfo = e.detail.userInfo;
|
||||
userInfo.spid = this.data.spid;
|
||||
wx.login({
|
||||
success: function (res) {
|
||||
if (res.code) {
|
||||
userInfo.code = res.code;
|
||||
wx.request({
|
||||
url: app.globalData.url + '/routine/login/index',
|
||||
method: 'post',
|
||||
dataType : 'json',
|
||||
data: {
|
||||
info: userInfo
|
||||
},
|
||||
success: function (res) {
|
||||
app.globalData.uid = res.data.data.uid;
|
||||
if (app.globalData.openPages != '' && app.globalData.openPages != undefined) {//跳转到指定页面
|
||||
wx.navigateTo({
|
||||
url: app.globalData.openPages
|
||||
})
|
||||
} else {//跳转到首页
|
||||
wx.reLaunch({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('登录失败!' + res.errMsg)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
})
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "引导页"
|
||||
"navigationBarTitleText": "授权"
|
||||
}
|
||||
@ -1,4 +1,8 @@
|
||||
<view class='loading-pic'>
|
||||
<image src='/images/long.gif'></image>
|
||||
<view>正在加载中...</view>
|
||||
<view class="warrant">
|
||||
<view class='white'>
|
||||
<view class='pictrue'></view>
|
||||
<view class='tip'>您的信息和数据将受到保护</view>
|
||||
<button class='but' type="primary" open-type="getUserInfo" lang="zh_CN" bindgetuserinfo="getUserInfo">授权并登录</button>
|
||||
</view>
|
||||
<view class='mask'></view>
|
||||
</view>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -13,6 +13,8 @@ Page({
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
app.setBarColor();
|
||||
app.setUserInfo();
|
||||
this.getSiteServicePhone();
|
||||
},
|
||||
|
||||
|
||||
@ -8,8 +8,13 @@ Page({
|
||||
lovely:'',
|
||||
url: app.globalData.urlImages,
|
||||
},
|
||||
setTouchMove: function (e) {
|
||||
var that = this;
|
||||
wxh.home(that, e);
|
||||
},
|
||||
onLoad: function (options) {
|
||||
app.setBarColor();
|
||||
app.setUserInfo();
|
||||
this.getList();
|
||||
},
|
||||
getList: function () {
|
||||
|
||||
@ -31,10 +31,4 @@
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<movable-area class='index-con' >
|
||||
<movable-view class='index-area' direction="all">
|
||||
<navigator url='/pages/index/index' hover-class='none' open-type = "switchTab" >
|
||||
<image src='/images/home.png'></image>
|
||||
</navigator>
|
||||
</movable-view>
|
||||
</movable-area>
|
||||
<include src="/pages/home/home.wxml"/>
|
||||
|
||||
@ -17,3 +17,4 @@
|
||||
.list-time{position:absolute;bottom:10rpx;font-size:45rpx;left:18rpx;}
|
||||
.list-time>text{width:38rpx;height:38rpx;line-height:38rpx;text-align:center;display:inline-block;vertical-align:middle;background-color:#333333;color:#FFFFFF;font-size:20rpx;border-radius:5rpx;margin-right: 16rpx;}
|
||||
.list-time-top{background-color:rgba(255, 255, 255, 0.5);position:absolute;bottom:0;width:100%;height:60rpx;}
|
||||
@import "/pages/home/home.wxss";
|
||||
@ -16,11 +16,16 @@ Page({
|
||||
countDownSecond:"00"
|
||||
},
|
||||
|
||||
setTouchMove: function (e) {
|
||||
var that = this;
|
||||
wxh.home(that, e);
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
app.setBarColor();
|
||||
app.setUserInfo();
|
||||
var that = this;
|
||||
var timeStamp = "1912245455"
|
||||
wxh.time2(timeStamp, that);
|
||||
|
||||
@ -41,10 +41,4 @@
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<movable-area class='index-con' >
|
||||
<movable-view class='index-area' direction="all">
|
||||
<navigator url='/pages/index/index' hover-class='none' open-type = "switchTab" >
|
||||
<image src='/images/home.png'></image>
|
||||
</navigator>
|
||||
</movable-view>
|
||||
</movable-area>
|
||||
<include src="/pages/home/home.wxml"/>
|
||||
|
||||
@ -14,3 +14,4 @@
|
||||
.bottom-flag{font-size:26rpx;color:#FFA200;}
|
||||
.bottom-but{width:140rpx;height:58rpx;text-align:center;line-height:58rpx;border-radius:100rpx;background-color:#FF3D3D;color:#fff;font-size:24rpx;box-shadow:-1rpx 0rpx 5rpx #FF3D3D;}
|
||||
.bottom-on{color:#999999!important;}
|
||||
@import "/pages/home/home.wxss";
|
||||
|
||||
@ -17,6 +17,7 @@ Page({
|
||||
onLoad: function (options) {
|
||||
var that = this;
|
||||
app.setBarColor();
|
||||
app.setUserInfo();
|
||||
if (options.id){
|
||||
that.setData({
|
||||
newId: options.id
|
||||
|
||||
@ -23,6 +23,7 @@ Page({
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
app.setBarColor();
|
||||
app.setUserInfo();
|
||||
this.getNewList();
|
||||
this.getArticleBanner();
|
||||
this.getArticleHot();
|
||||
|
||||
@ -20,6 +20,7 @@ Page({
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
app.setBarColor();
|
||||
app.setUserInfo();
|
||||
this.getNoticeList();
|
||||
},
|
||||
getNoticeList:function(){
|
||||
|
||||
@ -8,7 +8,7 @@ Page({
|
||||
data: {
|
||||
cartArr: [
|
||||
{ "name": "微信", "icon": "icon-weixinzhifu", value:'weixin'},
|
||||
// { "name": "余额支付", "icon": "icon-yuezhifu", value: 'yue' },
|
||||
{ "name": "余额支付", "icon": "icon-yuezhifu", value: 'yue' },
|
||||
// { "name": "线下付款", "icon": "icon-wallet", value: 'offline' },
|
||||
// { "name": "到店自提", "icon": "icon-dianpu", value: 'ziti' },
|
||||
],
|
||||
@ -39,6 +39,7 @@ Page({
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
app.setBarColor();
|
||||
app.setUserInfo();
|
||||
var that = this;
|
||||
if (options.pinkId){
|
||||
that.setData({
|
||||
|
||||
@ -15,6 +15,8 @@ Page({
|
||||
*/
|
||||
onLoad: function (e) {
|
||||
app.setBarColor();
|
||||
app.globalData.openPages = '/pages/orders-con/orders-con?order_id=' + e.order_id;
|
||||
app.setUserInfo();
|
||||
var header = {
|
||||
'content-type': 'application/x-www-form-urlencoded'
|
||||
};
|
||||
|
||||
@ -116,8 +116,6 @@
|
||||
<view wx:if="{{ordercon._status._type==1 && ordercon.combination_id}}" class='pay-btn' bindtap='goJoinPink' data-uni='{{ordercon.pink_id}}'>查看拼团</view>
|
||||
<navigator wx:if="{{ordercon._status._type==2 && ordercon.delivery_type == 'express'}}" hover-class="none" url='/pages/logistics/logistics?orderId={{ordercon.order_id}}'><view class='delete-btn' >查看物流</view></navigator>
|
||||
<view wx:if="{{ordercon._status._type==2}}" class='pay-btn' bindtap='confirmOrder' data-uni='{{ordercon.order_id}}'>确认收货</view>
|
||||
<view wx:if="{{ordercon._status._type==4}}" class='delete-btn' bindtap='delOrder' data-uni='{{ordercon.order_id}}'>删除订单</view>
|
||||
<!-- <navigator wx:if="{{ordercon._status._type==3}}" hover-class="none" url='/pages/product-con/index'><view class='delete-btn'>再次购买</view></navigator> -->
|
||||
<!-- <navigator wx:if="{{ordercon._status._type==3}}" hover-class="none" url='/pages/comment-con/comment-con?order_id={{ordercon.order_id}}'><view class='pay-btn'>立即评价</view></navigator> -->
|
||||
<view wx:if="{{ordercon._status._type==4 || ordercon._status._type==0}}" class='delete-btn' bindtap='delOrder' data-uni='{{ordercon.order_id}}'>删除订单</view>
|
||||
<navigator wx:if="{{!ordercon.seckill_id && !ordercon.bargain_id && !ordercon.combination_id && (ordercon._status._type==3||ordercon._status._type==4)}}" hover-class="none" bindtap='goIndex'><view class='pay-btn'>再次购买</view></navigator>
|
||||
</view>
|
||||
@ -13,6 +13,10 @@ Page({
|
||||
title: "玩命加载中...",
|
||||
hidden: false
|
||||
},
|
||||
setTouchMove: function (e) {
|
||||
var that = this;
|
||||
wxh.home(that, e);
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
|
||||
@ -52,12 +52,6 @@
|
||||
</block>
|
||||
<view class='loading flex'><icon class='iconfont icon-jiazaizhong loadingpic' hidden='{{hidden}}'></icon>{{title}}</view>
|
||||
</view>
|
||||
<movable-area class='index-con' >
|
||||
<movable-view class='index-area' direction="all">
|
||||
<navigator url='/pages/index/index' hover-class='none' open-type = "switchTab" >
|
||||
<image src='/images/home.png'></image>
|
||||
</navigator>
|
||||
</movable-view>
|
||||
</movable-area>
|
||||
<include src="/pages/home/home.wxml"/>
|
||||
|
||||
|
||||
|
||||
@ -28,3 +28,4 @@
|
||||
.state-ytk{color:#333!important;}
|
||||
.youfei{font-size:22rpx;}
|
||||
.kuang{border:1rpx solid #999!important;background-color:#fff!important;color:#999!important;}
|
||||
@import "/pages/home/home.wxss";
|
||||
@ -14,6 +14,8 @@ Page({
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
app.setBarColor();
|
||||
app.setUserInfo();
|
||||
this.getUserInfo();
|
||||
},
|
||||
getUserInfo:function(){
|
||||
|
||||
@ -8,6 +8,7 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
posterImage:'',//海报路径
|
||||
attrName:'',
|
||||
attr:'选择商品属性',
|
||||
attrValue:'',
|
||||
@ -42,6 +43,10 @@ Page({
|
||||
status:0,
|
||||
actionSheetHidden:true,
|
||||
},
|
||||
setTouchMove: function (e) {
|
||||
var that = this;
|
||||
wxh.home(that, e);
|
||||
},
|
||||
goPhone: function () {
|
||||
wx.request({
|
||||
url: app.globalData.url + '/routine/auth_api/get_site_phone?uid=' + app.globalData.uid,
|
||||
@ -136,6 +141,61 @@ Page({
|
||||
actionSheetHidden: !this.data.actionSheetHidden
|
||||
})
|
||||
},
|
||||
savePosterPath:function(){
|
||||
var that = this;
|
||||
wx.downloadFile({
|
||||
url: that.data.posterImage,
|
||||
success: function(res) {
|
||||
var path = res.tempFilePath;
|
||||
wx.saveImageToPhotosAlbum({
|
||||
filePath: path,
|
||||
success: function(res) {
|
||||
wx.showToast({
|
||||
title: '保存成功',
|
||||
icon: 'success',
|
||||
duration: 1500,
|
||||
})
|
||||
},
|
||||
fail: function (res) {
|
||||
wx.showToast({
|
||||
title: '保存失败',
|
||||
icon: 'none',
|
||||
duration: 1500,
|
||||
})
|
||||
},
|
||||
complete: function(res) {},
|
||||
})
|
||||
},
|
||||
fail: function(res) {},
|
||||
complete: function(res) {},
|
||||
})
|
||||
},
|
||||
goPoster:function(){
|
||||
var that = this;
|
||||
wx.request({
|
||||
url: app.globalData.url + '/routine/auth_api/poster?uid=' + app.globalData.uid,
|
||||
method: 'GET',
|
||||
data: {
|
||||
id: that.data.id,
|
||||
},
|
||||
success: function (res) {
|
||||
if(res.data.code == 200){
|
||||
that.setData({
|
||||
posterImage: app.globalData.url + res.data.msg,
|
||||
actionSheetHidden: !that.data.actionSheetHidden
|
||||
})
|
||||
that.savePosterPath();
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: 'none',
|
||||
duration: 1500,
|
||||
mask: true,
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
goPhoto:function(){
|
||||
var that = this;
|
||||
wx.showActionSheet({
|
||||
|
||||
@ -15,13 +15,21 @@
|
||||
</view>
|
||||
<action-sheet hidden="{{actionSheetHidden}}" bindchange="listenerActionSheet" >
|
||||
<action-sheet-item >
|
||||
<button open-type="share" class='contact'>发送给朋友</button>
|
||||
</action-sheet-item>
|
||||
<!-- <action-sheet-item bindtap='goPhoto' class='action-sheet'>
|
||||
<button open-type="share" class='contact' >
|
||||
<view class='iconn'></view>
|
||||
发送给朋友
|
||||
</button>
|
||||
<button class='contact' bindtap='goPoster' >
|
||||
<view class='iconn iconn1'></view>
|
||||
生成海报
|
||||
</action-sheet-item> -->
|
||||
</button>
|
||||
<!-- <view bindtap='goPoster' class='action-sheet'>
|
||||
<view class='iconn iconn1'></view>
|
||||
生成海报
|
||||
</view> -->
|
||||
</action-sheet-item>
|
||||
<!--自动隐藏action-sheet-->
|
||||
<action-sheet-cancel>取消</action-sheet-cancel>
|
||||
<!-- <action-sheet-cancel>取消</action-sheet-cancel> -->
|
||||
</action-sheet>
|
||||
<view class='price-wrapper flex'>
|
||||
<view class='price'><text>¥</text>{{storeInfo.price}}</view>
|
||||
@ -38,10 +46,10 @@
|
||||
<view>销量:{{storeInfo.sales}}{{storeInfo.unit_name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class='block-bar' bindtap='goCoupon'>
|
||||
<view class='block-bar' bindtap='goCoupon'>
|
||||
<text class='title'>领券</text>
|
||||
<text>领取优惠券 </text>
|
||||
</view> -->
|
||||
</view>
|
||||
<!-- <view class='block-bar integral' wx:if="{{storeInfo.give_integral > 0}}">
|
||||
<text class='title'>积分</text>
|
||||
<text>购买可获得{{storeInfo.give_integral}}积分</text>
|
||||
@ -108,12 +116,6 @@
|
||||
<view class='payment-btn' bindtap='goOrder'>确认下单</view>
|
||||
</view>
|
||||
</view>
|
||||
<movable-area class='index-con' >
|
||||
<movable-view class='index-area' direction="all">
|
||||
<navigator url='/pages/index/index' hover-class='none' open-type = "switchTab" >
|
||||
<image src='/images/home.png'></image>
|
||||
</navigator>
|
||||
</movable-view>
|
||||
</movable-area>
|
||||
<include src="/pages/home/home.wxml"/>
|
||||
<include src="/pages/foo-tan/foo-tan.wxml"/>
|
||||
<import src="/wxParse/wxParse.wxml"/>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -30,6 +30,7 @@ Page({
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
app.setBarColor();
|
||||
app.setUserInfo();
|
||||
if (options.id){
|
||||
this.setData({
|
||||
seckillId: options.id
|
||||
|
||||
@ -100,3 +100,5 @@
|
||||
|
||||
<include src="/pages/foo-tan/foo-tan.wxml"/>
|
||||
<import src="/wxParse/wxParse.wxml"/>
|
||||
|
||||
|
||||
|
||||
@ -54,5 +54,6 @@ 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;}
|
||||
@import "/pages/foo-tan/foo-tan.wxss";
|
||||
@import "/wxParse/wxParse.wxss";
|
||||
.wxParse-p{margin-bottom:-4px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -49,32 +49,7 @@ Page({
|
||||
app.setUserInfo();
|
||||
var that = this;
|
||||
that.getCartCount();
|
||||
wx.request({
|
||||
url: app.globalData.url + '/routine/auth_api/get_product_list?uid=' + app.globalData.uid,
|
||||
method: 'GET',
|
||||
success: function (res) {
|
||||
if (res.data.code==200){
|
||||
that.setData({
|
||||
Arraylike: res.data.data
|
||||
})
|
||||
}else{
|
||||
that.setData({
|
||||
Arraylike: []
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: function (res){
|
||||
console.log('submit fail');
|
||||
},
|
||||
complete: function (res) {
|
||||
console.log('submit complete');
|
||||
}
|
||||
})
|
||||
},
|
||||
parameterShow: function () {
|
||||
var that = this;
|
||||
|
||||
|
||||
that.getProductList();
|
||||
},
|
||||
goCart:function(){
|
||||
wx.switchTab({
|
||||
@ -193,32 +168,9 @@ Page({
|
||||
SoerErId = that.data.sorter[indexSoerEr].id;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
that.setData({
|
||||
total: '全部'
|
||||
})
|
||||
}
|
||||
|
||||
wx.request({
|
||||
url: app.globalData.url + '/routine/auth_api/get_product_list?uid=' + app.globalData.uid,
|
||||
data: { cid: that.data.cid, sid: SoerErId},
|
||||
method: 'GET',
|
||||
success: function (res) {
|
||||
if(res.data.code==200){
|
||||
that.setData({
|
||||
sid: SoerErId,
|
||||
offset:0,
|
||||
Arraylike: res.data.data
|
||||
})
|
||||
}else{
|
||||
that.setData({
|
||||
sid: 0,
|
||||
offset: 0,
|
||||
Arraylike: []
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
}else that.setData({total: '全部'})
|
||||
that.setData({sid: SoerErId})
|
||||
that.getProductList();
|
||||
},
|
||||
wholeproduct:function(e){
|
||||
var that=this;
|
||||
@ -238,27 +190,8 @@ Page({
|
||||
})
|
||||
}
|
||||
}
|
||||
wx.request({
|
||||
url: app.globalData.url + '/routine/auth_api/get_product_list?uid=' + app.globalData.uid,
|
||||
data: { cid: cid, sid:''},
|
||||
method: 'GET',
|
||||
success: function (res) {
|
||||
if (res.data.code == 200) {
|
||||
that.setData({
|
||||
sid: 0,
|
||||
offset: 0,
|
||||
Arraylike: res.data.data,
|
||||
hiddendown: true
|
||||
})
|
||||
} else {
|
||||
that.setData({
|
||||
sid: 0,
|
||||
offset: 0,
|
||||
Arraylike: []
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
that.setData({ hiddendown: true })
|
||||
that.getProductList();
|
||||
},
|
||||
getCartCount: function () {
|
||||
var that = this;
|
||||
@ -278,31 +211,12 @@ Page({
|
||||
},
|
||||
allproduct: function () {
|
||||
var that = this;
|
||||
wx.request({
|
||||
url: app.globalData.url + '/routine/auth_api/get_product_list?uid=' + app.globalData.uid,
|
||||
data: { cid: '', sid: '' },
|
||||
method: 'GET',
|
||||
success: function (res) {
|
||||
if (res.data.code == 200) {
|
||||
that.setData({
|
||||
sid: 0,
|
||||
offset: 0,
|
||||
total: '全部',
|
||||
taber: '-1',
|
||||
Arraylike: res.data.data,
|
||||
hiddendown: true
|
||||
})
|
||||
} else {
|
||||
that.setData({
|
||||
sid: 0,
|
||||
offset: 0,
|
||||
total: '',
|
||||
taber:'-1',
|
||||
Arraylike: []
|
||||
})
|
||||
}
|
||||
},
|
||||
cid: '',
|
||||
sid: '',
|
||||
hiddendown: true,
|
||||
})
|
||||
that.getProductList();
|
||||
},
|
||||
maskhide:function(e){
|
||||
this.setData({
|
||||
@ -319,34 +233,11 @@ Page({
|
||||
var priceOrder = '';
|
||||
var t = that.data.t;
|
||||
var n=t+1;
|
||||
if (n%2>0){
|
||||
priceOrder ='asc';
|
||||
}else{
|
||||
priceOrder='desc';
|
||||
}
|
||||
if (n%2>0) priceOrder ='asc';
|
||||
else priceOrder='desc';
|
||||
var sid = that.data.sid;
|
||||
wx.request({
|
||||
url: app.globalData.url + '/routine/auth_api/get_product_list?uid=' + app.globalData.uid,
|
||||
data: { sid: sid, priceOrder: priceOrder },
|
||||
method: 'GET',
|
||||
success: function (res) {
|
||||
if (res.data.code==200){
|
||||
that.setData({
|
||||
t:n,
|
||||
price: priceOrder,
|
||||
offset: 0,
|
||||
Arraylike: res.data.data
|
||||
})
|
||||
}else{
|
||||
that.setData({
|
||||
t: 0,
|
||||
price: '',
|
||||
offset: 0,
|
||||
Arraylike: []
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
that.setData({ price: priceOrder, t: n, })
|
||||
that.getProductList();
|
||||
},
|
||||
navactive1: function (e) {
|
||||
var that = this;
|
||||
@ -358,37 +249,10 @@ Page({
|
||||
var salesOrder = '';
|
||||
var t = that.data.t;
|
||||
var n = t + 1;
|
||||
console.log(n);
|
||||
if (n%2>0) {
|
||||
salesOrder = 'asc';
|
||||
} else{
|
||||
salesOrder='desc';
|
||||
}
|
||||
var sid= that.data.sid;
|
||||
var priceOrder = that.data.price;
|
||||
wx.request({
|
||||
url: app.globalData.url + '/routine/auth_api/get_product_list?uid=' + app.globalData.uid,
|
||||
data: { sid: sid, priceOrder: priceOrder, salesOrder: salesOrder},
|
||||
method: 'GET',
|
||||
success: function (res) {
|
||||
if(res.data.code==200){
|
||||
that.setData({
|
||||
t: n,
|
||||
sales: salesOrder,
|
||||
offset: 0,
|
||||
Arraylike: res.data.data
|
||||
})
|
||||
}else{
|
||||
that.setData({
|
||||
t: 0,
|
||||
sales: '',
|
||||
offset: 0,
|
||||
Arraylike: []
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
if (n%2>0) salesOrder = 'asc';
|
||||
else salesOrder='desc';
|
||||
that.setData({ sales: salesOrder, t: n, })
|
||||
that.getProductList();
|
||||
},
|
||||
navactive2: function (e) {
|
||||
var that = this;
|
||||
@ -398,48 +262,12 @@ Page({
|
||||
})
|
||||
var act = e.target.dataset.act;
|
||||
var news = '';
|
||||
if (act == 3) {
|
||||
news = 1;
|
||||
}else{
|
||||
news='';
|
||||
}
|
||||
var sid = that.data.sid;
|
||||
var limit = 20;
|
||||
var priceOrder = that.data.price;
|
||||
var salesOrder = that.data.sales;
|
||||
var offset = that.data.offset;
|
||||
var startpage = limit * offset;
|
||||
var header = {
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
};
|
||||
wx.request({
|
||||
url: app.globalData.url + '/routine/auth_api/get_product_list?uid=' + app.globalData.uid,
|
||||
data: { sid: sid, priceOrder: priceOrder, salesOrder: salesOrder, news: news, first: startpage, limit: limit},
|
||||
header: header,
|
||||
method: 'GET',
|
||||
success: function (res) {
|
||||
if(res.data.code==200){
|
||||
that.setData({
|
||||
news: news,
|
||||
offset: 0,
|
||||
Arraylike: res.data.data
|
||||
})
|
||||
}else{
|
||||
that.setData({
|
||||
news: '',
|
||||
offset: 0,
|
||||
Arraylike: []
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
if (act == 3) news = 1;
|
||||
else news = '';
|
||||
if (that.data.news) news = '';
|
||||
that.setData({ news: news})
|
||||
that.getProductList();
|
||||
},
|
||||
// qsort:function(e){
|
||||
// this.setData({
|
||||
// taber:-1,
|
||||
// hiddendown: true
|
||||
// })
|
||||
// },
|
||||
searchSubmit:function(e){
|
||||
var that = this;
|
||||
wx.request({
|
||||
@ -572,7 +400,6 @@ Page({
|
||||
}
|
||||
}
|
||||
}
|
||||
// console.log(array);
|
||||
that.setData({
|
||||
productAttr: array
|
||||
})
|
||||
@ -718,10 +545,53 @@ Page({
|
||||
|
||||
// })
|
||||
},
|
||||
getProductList:function(){
|
||||
var that = this;
|
||||
var news = that.data.news;
|
||||
var sid = that.data.sid;
|
||||
var cid = that.data.cid;
|
||||
var limit = 20;
|
||||
var priceOrder = that.data.price;
|
||||
var salesOrder = that.data.sales;
|
||||
var offset = 0;
|
||||
var startpage = limit * offset;
|
||||
wx.request({
|
||||
url: app.globalData.url + '/routine/auth_api/get_product_list?uid=' + app.globalData.uid,
|
||||
data: { sid: sid, cid: cid, priceOrder: priceOrder, salesOrder: salesOrder, news: news, first: startpage, limit: limit },
|
||||
method: 'GET',
|
||||
success: function (res) {
|
||||
if (res.data.code == 200) {
|
||||
var len = res.data.data.length;
|
||||
var ladding = [];
|
||||
for (var i in res.data.data) {
|
||||
ladding.push(res.data.data[i]);
|
||||
}
|
||||
that.setData({
|
||||
Arraylike: ladding,
|
||||
offset: offset + 1
|
||||
})
|
||||
if (len < limit) {
|
||||
that.setData({
|
||||
title: "数据已经加载完成",
|
||||
hidden: true
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: function (res) {
|
||||
console.log('submit fail');
|
||||
},
|
||||
complete: function (res) {
|
||||
console.log('submit complete');
|
||||
}
|
||||
})
|
||||
},
|
||||
onReachBottom: function (p) {
|
||||
var that = this;
|
||||
var news = '';
|
||||
var sid = that.data.sid;
|
||||
var cid = that.data.cid;
|
||||
var limit = 20;
|
||||
var priceOrder = that.data.price;
|
||||
var salesOrder = that.data.sales;
|
||||
@ -732,7 +602,7 @@ Page({
|
||||
};
|
||||
wx.request({
|
||||
url: app.globalData.url + '/routine/auth_api/get_product_list?uid=' + app.globalData.uid,
|
||||
data: { sid: sid, priceOrder: priceOrder, salesOrder: salesOrder, news: news,first: startpage ,limit: limit},
|
||||
data: { sid: sid, cid: cid, priceOrder: priceOrder, salesOrder: salesOrder, news: news,first: startpage ,limit: limit},
|
||||
method: 'GET',
|
||||
header: header,
|
||||
success: function (res) {
|
||||
|
||||
@ -15,6 +15,8 @@ Page({
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
app.setBarColor();
|
||||
app.setUserInfo();
|
||||
var that = this;
|
||||
var header = {
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
|
||||
@ -151,4 +151,5 @@ Page({
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
@ -18,6 +18,7 @@ Page({
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
app.setBarColor();
|
||||
app.setUserInfo();
|
||||
this.getorderlist();
|
||||
},
|
||||
searchSubmit: function () {
|
||||
|
||||
@ -20,6 +20,7 @@ Page({
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
app.setBarColor();
|
||||
app.setUserInfo();
|
||||
if (options.orderId){
|
||||
this.setData({
|
||||
orderId: options.orderId
|
||||
|
||||
@ -16,6 +16,7 @@ Page({
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
app.setBarColor();
|
||||
app.setUserInfo();
|
||||
if (options.id){
|
||||
this.setData({
|
||||
orderId: options.id
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
var app = getApp();
|
||||
var wxh = require('../../utils/wxh.js');
|
||||
// pages/spread/spread.js
|
||||
Page({
|
||||
|
||||
@ -16,6 +17,10 @@ Page({
|
||||
hiddens:true
|
||||
},
|
||||
|
||||
setTouchMove: function (e) {
|
||||
var that = this;
|
||||
wxh.home(that, e);
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
|
||||
@ -45,10 +45,4 @@
|
||||
<view class='tan-footer'>分销二维码</view>
|
||||
</view>
|
||||
<view class='zhao' hidden='{{hiddens}}' bindtap='tanguan'></view>
|
||||
<movable-area class='index-con' >
|
||||
<movable-view class='index-area' direction="all">
|
||||
<navigator url='/pages/index/index' hover-class='none' open-type = "switchTab" >
|
||||
<image src='/images/home.png'></image>
|
||||
</navigator>
|
||||
</movable-view>
|
||||
</movable-area>
|
||||
<include src="/pages/home/home.wxml"/>
|
||||
|
||||
@ -32,5 +32,6 @@ page{background-color:#fff;}
|
||||
.tan-icon{position:absolute;top:-218rpx;right:-153rpx;font-size:30rpx!important;width:60rpx;height:60rpx;text-align:center;line-height:60rpx;background-color:#E0E0E0;color:#A0A0A0;border-radius:50%;}
|
||||
.text-infos{display: flex;align-items: center; margin-left:20rpx;}
|
||||
.icon-erweima1{position: relative;top:5rpx;margin-right:10rpx;}
|
||||
@import "/pages/home/home.wxss";
|
||||
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
var app = getApp();
|
||||
var wxh = require('../../utils/wxh.js');
|
||||
// pages/user/user.js
|
||||
Page({
|
||||
|
||||
@ -13,6 +14,10 @@ Page({
|
||||
collect:''
|
||||
},
|
||||
|
||||
setTouchMove: function (e) {
|
||||
var that = this;
|
||||
wxh.home(that, e);
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
|
||||
@ -147,10 +147,8 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<movable-area class='index-con' >
|
||||
<movable-view class='index-area' direction="all">
|
||||
<navigator url='/pages/index/index' hover-class='none' open-type = "switchTab" >
|
||||
<image src='/images/home.png'></image>
|
||||
</navigator>
|
||||
</movable-view>
|
||||
</movable-area>
|
||||
<include src="/pages/home/home.wxml"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -15,9 +15,9 @@ min-width:26rpx;height:26rpx;text-align:center;line-height:26rpx;}
|
||||
.title-bar{padding:0 28rpx; height: 88rpx; align-items: center; justify-content: space-between; border-bottom: 1px solid #f7f7f7; }
|
||||
.title-bar navigator{font-size: 24rpx; color:#999;}
|
||||
.list-wrapper{ flex-wrap: wrap; align-items: center;}
|
||||
.list-wrapper .item{width: 25%; text-align: center; margin-top:30rpx;position: relative}
|
||||
.list-wrapper .item{width: 25%; text-align: center;margin:20rpx 0;position: relative}
|
||||
.list-wrapper .item .iconfont{font-size: 45rpx;}
|
||||
.list-wrapper .item .text{font-size: 24rpx; color:#555;}
|
||||
.list-wrapper .item .text{font-size: 24rpx; color:#555;margin-top:10rpx;}
|
||||
|
||||
.orders image{width: 42rpx; height: 45rpx;}
|
||||
.orders .list-wrapper{height: 142rpx;}
|
||||
@ -37,3 +37,4 @@ min-width:26rpx;height:26rpx;text-align:center;line-height:26rpx;}
|
||||
.contact-but{background-color:#ffffff;line-height:normal!important;}
|
||||
.contact-but::after{border:none;}
|
||||
.item-span{min-width:26rpx;height:26rpx;border-radius:50rpx;background-color:#ff3d3d;color: #fff;display:block;font-size:20rpx;text-align:center;line-height:26rpx;position:absolute;right:46rpx;top:0;}
|
||||
@import "/pages/home/home.wxss";
|
||||
|
||||
@ -15,6 +15,14 @@ var carmin = function (that){
|
||||
minusStatus: minusStatus
|
||||
});
|
||||
}
|
||||
//返回首页
|
||||
var home = function (that, e) {
|
||||
if (e.touches[0].clientY < 500 && e.touches[0].clientY > 0) {
|
||||
that.setData({
|
||||
top: e.touches[0].clientY
|
||||
})
|
||||
}
|
||||
}
|
||||
//购物车加
|
||||
var carjia = function(that){
|
||||
var num = that.data.num;
|
||||
@ -143,5 +151,6 @@ module.exports = {
|
||||
time: time,
|
||||
footan: footan,
|
||||
tapsize: tapsize,
|
||||
home: home,
|
||||
time2: time2
|
||||
}
|
||||
@ -17,9 +17,9 @@
|
||||
color: #666;
|
||||
line-height: 1.8;
|
||||
}
|
||||
.wxParse-p{margin-bottom: -4px;}
|
||||
view{
|
||||
word-break:break-all;
|
||||
margin-bottom: -5rpx;
|
||||
}
|
||||
.wxParse-inline{
|
||||
display: inline;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user