@ -1 +1 @@
|
||||
<?php
namespace app\admin\controller\setting;
use think\Url;
use service\FormBuilder as Form;
use think\Request;
use service\UtilService as Util;
use service\JsonService as Json;
use app\admin\controller\AuthController;
use app\admin\model\system\SystemConfigTab as ConfigTabModel;
use app\admin\model\system\SystemConfig as ConfigModel;
/**
* 配置分类控制器
* Class SystemConfigTab
* @package app\admin\controller\system
*/
class SystemConfigTab extends AuthController
{
/**
* 子子段
* @return mixed|\think\response\Json
*/
public function sonConfigTab(){
$tab_id = input('tab_id');
if(!$tab_id) return Json::fail('参数错误');
$this->assign('tab_id',$tab_id);
$list = ConfigModel::getAll($tab_id);
foreach ($list as $k=>$v){
$list[$k]['value'] = json_decode($v['value'],true);
if($v['type'] == 'radio' || $v['type'] == 'checkbox'){
$list[$k]['value'] = ConfigTabModel::getRadioOrCheckboxValueInfo($v['menu_name'],$v['value']);
}
if($v['type'] == 'upload' && !empty($v['value'])){
if($v['upload_type'] == 1 || $v['upload_type'] == 3) $list[$k]['value'] = explode(',',$v['value']);
}
}
$this->assign('list',$list);
return $this->fetch();
}
/**
* 基础配置
* @return mixed
*/
public function index(){
$where = Util::getMore([
['status',''],
['title',''],
],$this->request);
$this->assign('where',$where);
$this->assign(ConfigTabModel::getSystemConfigTabPage($where));
return $this->fetch();
}
/**
* 添加配置分类
* @return mixed
*/
public function create(){
$form = Form::create(Url::build('save'),[
Form::input('title','分类昵称'),
Form::input('eng_title','分类字段'),
Form::frameInputOne('icon','图标',Url::build('admin/widget.widgets/icon',array('fodder'=>'icon')))->icon('ionic'),
Form::radio('type','类型',0)->options([['value'=>0,'label'=>'系统'],['value'=>1,'label'=>'公众号'],['value'=>2,'label'=>'小程序'],['value'=>3,'label'=>'其它']]),
Form::radio('status','状态',1)->options([['value'=>1,'label'=>'显示'],['value'=>2,'label'=>'隐藏']])
]);
$form->setMethod('post')->setTitle('添加分类配置');
$this->assign(compact('form'));
return $this->fetch('public/form-builder');
}
/**
* 保存分类名称
* @param Request $request
* @return \think\response\Json
*/
public function save(Request $request){
$data = Util::postMore([
'eng_title',
'status',
'title',
'icon',
'type'],$request);
if(!$data['title']) return Json::fail('请输入按钮名称');
ConfigTabModel::set($data);
return Json::successful('添加菜单成功!');
}
/**
* 修改分类
* @param $id
* @return mixed
*/
public function edit($id){
$menu = ConfigTabModel::get($id)->getData();
if(!$menu) return Json::fail('数据不存在!');
$form = Form::create(Url::build('update',array('id'=>$id)),[
Form::input('title','分类昵称',$menu['title']),
Form::input('eng_title','分类字段',$menu['eng_title']),
Form::frameInputOne('icon','图标',Url::build('admin/widget.widgets/icon',array('fodder'=>'icon')),$menu['icon'])->icon('ionic'),
Form::radio('type','类型',$menu['type'])->options([['value'=>0,'label'=>'系统'],['value'=>1,'label'=>'公众号'],['value'=>2,'label'=>'小程序'],['value'=>3,'label'=>'其它']]),
Form::radio('status','状态',$menu['status'])->options([['value'=>1,'label'=>'显示'],['value'=>2,'label'=>'隐藏']])
]);
$form->setMethod('post')->setTitle('添加分类配置');
$this->assign(compact('form'));
return $this->fetch('public/form-builder');
}
/**
* @param Request $request
* @param $id
* @return \think\response\Json
*/
public function update(Request $request, $id)
{
$data = Util::postMore(['title','status','eng_title','icon','type'],$request);
if(!$data['title']) return Json::fail('请输入分类昵称');
if(!$data['eng_title']) return Json::fail('请输入分类字段');
if(!ConfigTabModel::get($id)) return Json::fail('编辑的记录不存在!');
ConfigTabModel::edit($data,$id);
return Json::successful('修改成功!');
}
/**
* @param $id
* @return \think\response\Json
*/
public function delete($id){
if(!ConfigTabModel::del($id))
return Json::fail(ConfigTabModel::getErrorInfo('删除失败,请稍候再试!'));
else
return Json::successful('删除成功!');
}
}
|
||||
<?php
namespace app\admin\controller\setting;
use think\Url;
use service\FormBuilder as Form;
use think\Request;
use service\UtilService as Util;
use service\JsonService as Json;
use app\admin\controller\AuthController;
use app\admin\model\system\SystemConfigTab as ConfigTabModel;
use app\admin\model\system\SystemConfig as ConfigModel;
/**
* 配置分类控制器
* Class SystemConfigTab
* @package app\admin\controller\system
*/
class SystemConfigTab extends AuthController
{
/**
* 子子段
* @return mixed|\think\response\Json
*/
public function sonconfigtab(){
$tab_id = input('tab_id');
if(!$tab_id) return Json::fail('参数错误');
$this->assign('tab_id',$tab_id);
$list = ConfigModel::getAll($tab_id);
foreach ($list as $k=>$v){
$list[$k]['value'] = json_decode($v['value'],true);
if($v['type'] == 'radio' || $v['type'] == 'checkbox'){
$list[$k]['value'] = ConfigTabModel::getRadioOrCheckboxValueInfo($v['menu_name'],$v['value']);
}
if($v['type'] == 'upload' && !empty($v['value'])){
if($v['upload_type'] == 1 || $v['upload_type'] == 3) $list[$k]['value'] = explode(',',$v['value']);
}
}
$this->assign('list',$list);
return $this->fetch();
}
/**
* 基础配置
* @return mixed
*/
public function index(){
$where = Util::getMore([
['status',''],
['title',''],
],$this->request);
$this->assign('where',$where);
$this->assign(ConfigTabModel::getSystemConfigTabPage($where));
return $this->fetch();
}
/**
* 添加配置分类
* @return mixed
*/
public function create(){
$form = Form::create(Url::build('save'),[
Form::input('title','分类昵称'),
Form::input('eng_title','分类字段'),
Form::frameInputOne('icon','图标',Url::build('admin/widget.widgets/icon',array('fodder'=>'icon')))->icon('ionic'),
Form::radio('type','类型',0)->options([['value'=>0,'label'=>'系统'],['value'=>1,'label'=>'公众号'],['value'=>2,'label'=>'小程序'],['value'=>3,'label'=>'其它']]),
Form::radio('status','状态',1)->options([['value'=>1,'label'=>'显示'],['value'=>2,'label'=>'隐藏']])
]);
$form->setMethod('post')->setTitle('添加分类配置');
$this->assign(compact('form'));
return $this->fetch('public/form-builder');
}
/**
* 保存分类名称
* @param Request $request
* @return \think\response\Json
*/
public function save(Request $request){
$data = Util::postMore([
'eng_title',
'status',
'title',
'icon',
'type'],$request);
if(!$data['title']) return Json::fail('请输入按钮名称');
ConfigTabModel::set($data);
return Json::successful('添加菜单成功!');
}
/**
* 修改分类
* @param $id
* @return mixed
*/
public function edit($id){
$menu = ConfigTabModel::get($id)->getData();
if(!$menu) return Json::fail('数据不存在!');
$form = Form::create(Url::build('update',array('id'=>$id)),[
Form::input('title','分类昵称',$menu['title']),
Form::input('eng_title','分类字段',$menu['eng_title']),
Form::frameInputOne('icon','图标',Url::build('admin/widget.widgets/icon',array('fodder'=>'icon')),$menu['icon'])->icon('ionic'),
Form::radio('type','类型',$menu['type'])->options([['value'=>0,'label'=>'系统'],['value'=>1,'label'=>'公众号'],['value'=>2,'label'=>'小程序'],['value'=>3,'label'=>'其它']]),
Form::radio('status','状态',$menu['status'])->options([['value'=>1,'label'=>'显示'],['value'=>2,'label'=>'隐藏']])
]);
$form->setMethod('post')->setTitle('添加分类配置');
$this->assign(compact('form'));
return $this->fetch('public/form-builder');
}
/**
* @param Request $request
* @param $id
* @return \think\response\Json
*/
public function update(Request $request, $id)
{
$data = Util::postMore(['title','status','eng_title','icon','type'],$request);
if(!$data['title']) return Json::fail('请输入分类昵称');
if(!$data['eng_title']) return Json::fail('请输入分类字段');
if(!ConfigTabModel::get($id)) return Json::fail('编辑的记录不存在!');
ConfigTabModel::edit($data,$id);
return Json::successful('修改成功!');
}
/**
* @param $id
* @return \think\response\Json
*/
public function delete($id){
if(!ConfigTabModel::del($id))
return Json::fail(ConfigTabModel::getErrorInfo('删除失败,请稍候再试!'));
else
return Json::successful('删除成功!');
}
}
|
||||
58
doc.md
@ -1,20 +1,9 @@
|
||||
## CRMEB开源文档地址:https://gitee.com/ZhongBangKeJi/CRMEB
|
||||
|
||||
## 运行环境
|
||||
CRMEB可以支持Windows/Unix服务器环境,需要PHP5.5.9以上,Mysql5.1以上版本支持, 可运行于包括Apache、IIS和nginx在内的多种WEB服务器和模式,支持Mysql数据库,引擎用InnoDB;
|
||||
|
||||
如果使用curl发起https请求的时候报错:“SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed”
|
||||
服务器需要安装证书免费的,方法如下:
|
||||
http://curl.haxx.se/ca/cacert.pem [下载](http://curl.haxx.se/ca/cacert.pem)
|
||||
curl.cainfo 参数(php.ini)来指定CA根证书库的位置
|
||||
|
||||
如果使用小程序必须使用https协议[百科了解一下](https://baike.baidu.com/item/https/285356),服务器需要安装ssl证书
|
||||
|
||||
|
||||
框架本身没有什么特别模块要求,具体的应用系统运行环境要求视开发所涉及的模块。 CRMEB底层运行的内存消耗极低,而本身的文件大小也是轻量级的,因此不会出现 空间和内存占用的瓶颈。对于刚刚接触PHP或者CRMEB的新手,我们推荐使用集成开发 环境WAMPServer或者phpstudy(都是一个集成了Apache、PHP和MySQL的开发 套件,而且支持不同PHP版本、MySQL版本和Apache版本的切换)来使用CRMEB 进行本地开发和测试。
|
||||
|
||||
## 安装使用
|
||||
|
||||
## 一键安装
|
||||
上传你的代码,直接在浏览器中输入你的域名或IP(例如:www.yourdomain.com),
|
||||
安装可以直接访问根目录下index.php,页可以设置对外目录为crmeb,就默认访问crmeb目录下的index.php
|
||||
@ -62,58 +51,13 @@ globalData: {
|
||||
},
|
||||
```
|
||||
|
||||
### # 伪静态
|
||||
1、Nginx
|
||||
~~~
|
||||
location / {
|
||||
if (!-e $request_filename) {
|
||||
rewrite ^(.*)$ /index.php?s=$1 last;
|
||||
break;
|
||||
}
|
||||
}
|
||||
~~~
|
||||
2、Apache
|
||||
.htaccess文件
|
||||
~~~
|
||||
RewriteEngine
|
||||
on
|
||||
|
||||
#不显示index.php
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME}
|
||||
!-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^(.*)$ index.php/$1
|
||||
[QSA,PT,L]
|
||||
~~~
|
||||
3、iis服务
|
||||
web.config
|
||||
~~~
|
||||
<rewrite>
|
||||
<rules>
|
||||
<rule name="OrgPage" stopProcessing="true">
|
||||
<match url="^(.*)$" />
|
||||
<conditions logicalGrouping="MatchAll">
|
||||
<add input="{HTTP_HOST}" pattern="^(.*)$" />
|
||||
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
|
||||
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
|
||||
</conditions>
|
||||
<action type="Rewrite" url="index.php/{R:1}" />
|
||||
</rule>
|
||||
</rules>
|
||||
</rewrite>
|
||||
~~~
|
||||
更多参考:https://www.kancloud.cn/manual/thinkphp5/177576
|
||||
|
||||
项目支持公众号商城和小程序商城可单独配置使用,如需公众号和小程序账户同步,请申请微信开放平台进行绑定
|
||||
开放平台申请地址:https://open.weixin.qq.com/
|
||||
|
||||
开源项目不含:砍价和拼团功能
|
||||
如需砍价和拼团完功能请淘宝购买仅需49元
|
||||
官方淘宝地址:https://shop120689819.taobao.com/
|
||||
官方淘宝地址:https://xazbkj.taobao.com/
|
||||
|
||||
更多帮助文档:https://gitee.com/ZhongBangKeJi/CRMEB/wikis/%E5%BC%80%E5%8F%91%E6%96%87%E6%A1%A3?sort_id=680379
|
||||
帮助文档:https://gitee.com/ZhongBangKeJi/CRMEB/wikis
|
||||
数据字典:请配置public/mysql.php 访问查看
|
||||
技术支持QQ群:116279623
|
||||
form-builder帮助文档:https://github.com/xaboy/form-builder
|
||||
104
sql_log.sql
Normal file
@ -0,0 +1,104 @@
|
||||
-- 表注释
|
||||
alter table eb_store_coupon_issue comment '优惠券前台领取表';
|
||||
alter table eb_store_coupon_issue_user comment '优惠券前台用户领取记录表';
|
||||
alter table eb_store_pink comment '拼团表';
|
||||
alter table eb_user_notice_see comment '用户通知发送记录表';
|
||||
alter table eb_user_extract comment '用户提现表';
|
||||
alter table eb_user_group comment '用户分组表';
|
||||
alter table eb_user_recharge comment '用户充值表';
|
||||
alter table eb_user_notice comment '用户通知表';
|
||||
alter table eb_store_visit comment '产品浏览分析表';
|
||||
|
||||
-- --产品浏览分析表表 字段
|
||||
alter table eb_store_visit modify column product_id int(11) comment '产品ID';
|
||||
alter table eb_store_visit modify column cate_id int(11) comment '产品分类ID';
|
||||
alter table eb_store_visit modify column type char(50) comment '产品类型';
|
||||
alter table eb_store_visit modify column uid int(11) comment '用户ID';
|
||||
alter table eb_store_visit modify column count int(11) comment '访问次数';
|
||||
alter table eb_store_visit modify column content varchar(255) comment '备注描述';
|
||||
alter table eb_store_visit modify column add_time int(11) comment '添加时间';
|
||||
|
||||
--
|
||||
-- 字段注释
|
||||
-- 缓存表 字段
|
||||
-- alter table eb_cache modify column key varchar(32) comment '缓存key唯一值';
|
||||
alter table eb_cache modify column result text comment '缓存数据';
|
||||
alter table eb_cache modify column add_time int(10) comment '缓存时间';
|
||||
|
||||
-- --优惠券前台领取表 字段
|
||||
alter table eb_store_coupon_issue modify column cid int(10) comment '优惠券ID';
|
||||
alter table eb_store_coupon_issue modify column start_time int(10) comment '优惠券领取开启时间';
|
||||
alter table eb_store_coupon_issue modify column end_time int(10) comment '优惠券领取结束时间';
|
||||
alter table eb_store_coupon_issue modify column total_count int(10) comment '优惠券领取数量';
|
||||
alter table eb_store_coupon_issue modify column remain_count int(10) comment '优惠券剩余领取数量';
|
||||
alter table eb_store_coupon_issue modify column add_time int(10) comment '优惠券添加时间';
|
||||
|
||||
-- 优惠券前台用户领取记录表 字段
|
||||
alter table eb_store_coupon_issue_user modify column uid int(10) comment '领取优惠券用户ID';
|
||||
alter table eb_store_coupon_issue_user modify column issue_coupon_id int(10) comment '优惠券前台领取ID';
|
||||
alter table eb_store_coupon_issue_user modify column add_time int(10) comment '领取时间';
|
||||
|
||||
-- --用户分组表 字段
|
||||
alter table eb_user_group modify column group_name varchar(64) comment '用户分组名称';
|
||||
|
||||
-- --用户充值表 字段
|
||||
alter table eb_user_recharge modify column uid int(10) comment '充值用户UID';
|
||||
alter table eb_user_recharge modify column order_id varchar(32) comment '订单号';
|
||||
alter table eb_user_recharge modify column price decimal(8,2) comment '充值金额';
|
||||
alter table eb_user_recharge modify column recharge_type varchar(32) comment '充值类型';
|
||||
alter table eb_user_recharge modify column paid tinyint(1) comment '是否充值';
|
||||
alter table eb_user_recharge modify column pay_time int(10) comment '充值支付时间';
|
||||
alter table eb_user_recharge modify column add_time int(12) comment '充值时间';
|
||||
|
||||
-- --添加配置类型
|
||||
ALTER TABLE `eb_system_config_tab` ADD `type` INT(2) NULL DEFAULT '0' COMMENT '配置类型' AFTER `icon`;
|
||||
|
||||
-- --添加小程序openid
|
||||
ALTER TABLE `eb_wechat_user` ADD `routine_openid` varchar(32) NULL DEFAULT '' COMMENT '小程序唯一身份ID' AFTER `openid`;
|
||||
-- --添加微信openid 允许为空
|
||||
ALTER TABLE `eb_wechat_user` CHANGE `openid` `openid` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '用户的标识,对当前公众号唯一';
|
||||
-- --添加附件记录表 允许为空
|
||||
DROP TABLE IF EXISTS `eb_system_attachment`;
|
||||
CREATE TABLE `eb_system_attachment` (
|
||||
`att_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL COMMENT '附件名称',
|
||||
`att_dir` varchar(200) NOT NULL COMMENT '附件路径',
|
||||
`satt_dir` varchar(200) NOT NULL COMMENT '附件压缩路径',
|
||||
`att_size` char(30) NOT NULL COMMENT '附件大小',
|
||||
`att_type` char(30) NOT NULL COMMENT '附件类型',
|
||||
`pid` int(10) NOT NULL COMMENT '分类ID0编辑器,1产品图片,2拼团图片,3砍价图片,4秒杀图片,5文章图片,6组合数据图',
|
||||
`time` int(11) NOT NULL COMMENT '上传时间',
|
||||
PRIMARY KEY (`att_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='附件管理表';
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
-- --修改文章表名称
|
||||
ALTER TABLE eb_wechat_news RENAME TO eb_article
|
||||
-- --修改文章内容表名称
|
||||
ALTER TABLE eb_wechat_news_content RENAME TO eb_article_content
|
||||
-- 文章表 添加 is_hot字段和is_banner字段
|
||||
alter table eb_article modify column is_hot tinyint(1) comment '是否热门(小程序)';
|
||||
alter table eb_article modify column is_banner tinyint(1) comment '是否轮播图(小程序)';
|
||||
-- 砍价产品表 添加 is_hot字段和is_banner字段
|
||||
alter table eb_store_bargain modify column look int(11) comment '砍价产品浏览量';
|
||||
alter table eb_store_bargain modify column share int(11) comment '砍价成品分享次数';
|
||||
-- --添加小程序模板消息表 允许为空
|
||||
DROP TABLE IF EXISTS `eb_routine_template`;
|
||||
CREATE TABLE `eb_routine_template` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`tempkey` char(50) NOT NULL COMMENT '模板编号',
|
||||
`name` char(100) NOT NULL COMMENT '模板名',
|
||||
`content` varchar(1000) NOT NULL COMMENT '回复内容',
|
||||
`tempid` char(100) NOT NULL COMMENT '模板ID',
|
||||
`add_time` varchar(15) NOT NULL COMMENT '添加时间',
|
||||
`status` tinyint(4) NOT NULL COMMENT '模板状态',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='小程序模板消息表';
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
-- --修改优惠劵领取为负数,还可以领
|
||||
ALTER TABLE `eb_store_coupon_issue` ADD `is_permanent` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '是否无限张数' AFTER `remain_count`;
|
||||
|
||||
-- 订单表 添加 is_channel字段
|
||||
alter table eb_store_order modify column is_channel tinyint(1) comment '支付渠道(0微信公众号1微信小程序)';
|
||||
|
||||
-- 客服通知
|
||||
ALTER TABLE `eb_store_service` ADD `notify` INT(2) NULL DEFAULT '0' COMMENT '订单通知1开启0关闭' AFTER `status`;
|
||||
@ -1,5 +1,6 @@
|
||||
{
|
||||
express_icon.jpgexpress_icon.jpgexpress_{
|
||||
"pages": [
|
||||
"pages/loading/loading",
|
||||
"pages/load/load",
|
||||
"pages/login-status/login-status",
|
||||
"pages/payment/payment",
|
||||
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
BIN
view/crmebN/images/express_icon.jpg
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@ -37,7 +37,7 @@ Page({
|
||||
method: 'POST',
|
||||
data: {
|
||||
address: addressP,
|
||||
is_default: 0,
|
||||
is_default: 1,
|
||||
real_name: res.userName,
|
||||
post_code: res.postalCode,
|
||||
phone: res.telNumber,
|
||||
@ -85,25 +85,14 @@ Page({
|
||||
header: header,
|
||||
success: function (res) {
|
||||
if (res.data.code == 200) {
|
||||
if (res.data.data.length < 1) {
|
||||
wx.showToast({
|
||||
title: '暂无收货地址,请先添加收货地址',
|
||||
icon: 'none',
|
||||
duration: 1000,
|
||||
})
|
||||
setTimeout(function () {
|
||||
that.addAddress();
|
||||
}, 1100)
|
||||
} else {
|
||||
that.setData({
|
||||
addressArray: res.data.data
|
||||
})
|
||||
for (var i in res.data.data){
|
||||
if (res.data.data[i].is_default){
|
||||
that.setData({
|
||||
_num: res.data.data[i].id
|
||||
})
|
||||
}
|
||||
that.setData({
|
||||
addressArray: res.data.data
|
||||
})
|
||||
for (var i in res.data.data) {
|
||||
if (res.data.data[i].is_default) {
|
||||
that.setData({
|
||||
_num: res.data.data[i].id
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||