### 方法1:直接覆盖
>[info]条件:需商城版本号为最新版本
### 方法2:指定文件修改
#### paycenter文件修改
1. 执行sql语句在paycenter内
--小程序支付数据
INSERT `pay_payment_channel` SET `payment_channel_id` = '16' , `payment_channel_code` = 'wxapp' , `payment_channel_name` = '小程序支付' , `payment_channel_image` = '' , `payment_channel_config` = '' , `payment_channel_status` = '0' , `payment_channel_allow` = 'wap' , `payment_channel_wechat` = '0' , `payment_channel_enable` = '1' ;
2. `\paycenter\libraries\Api`在该文件目录下直接上传`wxapp`文件夹
3. `\paycenter\paycenter\api\payment`在该文件目录下直接上传`wxapp`文件夹
4. `\paycenter\paycenter\controllers\Api\Payment\ChannelCtl.php`修改该文件代码
老版本情况修改该方法为
/**
* 修改
*
* @access public
*/
public function edit()
{
$data['payment_channel_id'] = request_string('payment_channel_id'); // ID
$data['payment_channel_code'] = request_string('payment_channel_code'); // 代码名称
$data['payment_channel_name'] = request_string('payment_channel_name'); // 支付名称
// $data['payment_channel_config'] = decode_json(request_string('payment_channel_config')); // 支付接口配置信息
$data['payment_channel_wechat'] = request_string('payment_channel_wechat'); // 微信中是否可以使用
$data['payment_channel_enable'] = request_string('payment_channel_enable'); // 是否启用
$payment_channel_config = request_row('payment_channel_config'); // 支付接口配置信息
if($data['payment_channel_code']== "wx_native"){ //微信支付特殊处理
$data['payment_channel_config']["appid"] = $payment_channel_config['account'];
$data['payment_channel_config']["key"] = $payment_channel_config['key'];
$data['payment_channel_config']["mchid"] = $payment_channel_config['partner'];
$data['payment_channel_config']["appsecret"] = $payment_channel_config['appsecret'];
}
elseif($data['payment_channel_code']== "app_wx_native" || $data['payment_channel_code']== "app_h5_wx_native"){ //微信支付特殊处理
$data['payment_channel_config']["appid"] = $payment_channel_config['account'];
$data['payment_channel_config']["key"] = $payment_channel_config['key'];
$data['payment_channel_config']["mchid"] = $payment_channel_config['partner'];
$data['payment_channel_config']["appsecret"] = $payment_channel_config['appsecret'];
}elseif($data['payment_channel_code']== "wxapp"){//小程序支付特殊处理
$data['payment_channel_config']["appid"] = $payment_channel_config['account'];
$data['payment_channel_config']["key"] = $payment_channel_config['key'];
$data['payment_channel_config']["mchid"] = $payment_channel_config['partner'];
$data['payment_channel_config']["appsecret"] = $payment_channel_config['appsecret'];
}
else{
$account = "$data[payment_channel_code]"."_account"; //拼接json 商户账号
$key = "$data[payment_channel_code]"."_key"; //拼接json 商户key
$partner = "$data[payment_channel_code]"."_partner"; //拼接json 商户号
$data['payment_channel_config'][$account] = $payment_channel_config['account'];
$data['payment_channel_config'][$key] = $payment_channel_config['key'];
$data['payment_channel_config'][$partner] = $payment_channel_config['partner'];
}
$payment_channel_id = $_REQUEST['payment_channel_id'];
$data_rs = $data;
unset($data['payment_channel_id']);
$flag = $this->paymentChannelModel->editChannel($payment_channel_id, $data);
$this->data->addBody(-140, $data_rs);
}
新版本修改方法
public static $wxPaymentChannelCode = ['wx_native', 'app_wx_native', 'app_h5_wx_native', 'wxapp'];
5.`\paycenter\paycenter\controllers\PayCtl.php`在该方法内修改并新增以下文件
/**
* 微信统一下单,返回app (生成预付订单)
*/
public function createWXOrder()
{
$trade_type = request_string('trade_type');
$uorder_id = request_string('uorder_id');
if (empty($uorder_id)) {
return $this->data->addBody(-140, [], _('无效访问参数'), 250);
}
$unionOrderModel = new Union_OrderModel();
//恢复ConsumeTrade表金额记录,之前数据可能有误
$uorder_data = $unionOrderModel->getOne($uorder_id);
$urow = $unionOrderModel->getByWhere(array('inorder'=>$uorder_data['inorder']));
$uorder_id_row = array_column($urow,'union_order_id');
//订单支付的总金额
$payment_amount = $uorder_data['trade_payment_amount'];
$edit_union_order_row = ['union_online_pay_amount'=> $payment_amount,
'union_cards_pay_amount'=> 0,
'union_money_pay_amount'=> 0,
'payment_channel_id'=>$trade_type
];
$flag = $unionOrderModel->editUnionOrder($uorder_id_row, $edit_union_order_row);
if ($flag === false) {
return $this->data->addBody(-140, [], _('交易订单记录初始化失败'), 250);
}
//单据详情
$order_row = array_merge($uorder_data, $edit_union_order_row);
if($trade_type == 'APP') //原生BBC
{
$payment_model = PaymentModel::create('app_wx_native');
}
elseif($trade_type == 'APPH5')//买家版App
{
$payment_model = PaymentModel::create('app_h5_wx_native');
}elseif($trade_type == 'APP_H5')//卖家版App
{
$payment_model = PaymentModel::create('seller_app_h5_wx_native');
}elseif($trade_type == 'WXAPP'){ //小程序
$openid= request_string('openid');
$body = $order_row['trade_title'];
$total_fee = floatval($order_row['union_online_pay_amount']*100);
$payment_model = PaymentModel::create('wxapp',array(),$openid,$body,$total_fee);
}elseif($trade_type == 'IM_WXAPP'){ //IMApp
$payment_model = PaymentModel::create('im_wxapp');
}else{
//PC扫码
$payment_model = PaymentModel::create('wx_native');
}
$result = $payment_model->pay($order_row, true);
$this->data->addBody(-140, ['orderString'=> $result, 'APPID'=> APPID_DEF, 'MCHID'=> MCHID_DEF,'timeStamp'=>(string)time()], 'success', 200);
}
/*修改小程序订单状态*/
public function order_status(){
$order_id = request_string('order_id');
$buyer_id = request_string('buyer_id');
//处理一步回调-通知商城更新订单状态
//修改订单表中的各种状态
$Consume_DepositModel = new Consume_DepositModel();
$rs = $Consume_DepositModel->notifyShop($order_id,$buyer_id);
$this->data->addBody(-140, $rs, 'success', 200);
}
6.`\paycenter\paycenter\models\Payment`在该文件夹下面新增`wxapp.php`文件
7.`\paycenter\paycenter\models\PaymentModel.php`修改以下方法
/**
* 得到支付句柄
*
* @param array $channel 使用的支付驱动
* @param array $reset_config 重新设定支付配置、覆盖支付默认选项
*
* @return Object Payment Object
*
* @access public
*/
public static function create($channel, $reset_config= [],$openid=null,$body=null,$total_fee=null)
{
$Payment_ChannelModel = new Payment_ChannelModel();
$config_row = $Payment_ChannelModel->getChannelConfig($channel);
if (!$config_row)
{
throw new Exception(_('支付配置数据错误!'));
}
$config_row = $reset_config ? array_merge($config_row, $reset_config) : $config_row;
$PaymentModel = null;
switch ($channel) {
case 'alipay':
if (!Yf_Utils_Device::isMobile())
{
$PaymentModel = new Payment_Alipay($config_row);
}
else
{
$PaymentModel = new Payment_AlipayWap($config_row);
}
break;
case 'tenpay':
$PaymentModel = new Payment_TenpayModel($config_row);
break;
case 'tenpay_wap':
$PaymentModel = new Payment_TenpayWapModel($config_row);
break;
case 'unionpay':
$PaymentModel = new Payment_UnionPayModel($config_row);
break;
case 'paypal':
$PaymentModel = new Payment_Paypal($config_row);
break;
case 'app_h5_wx_native':
case 'wx_native':
//微信变量, 不变动程序,修正数据
!defined('APPID_DEF') && define('APPID_DEF', $config_row['appid']);
!defined('MCHID_DEF') && define('MCHID_DEF', $config_row['mchid']);
!defined('KEY_DEF') && define('KEY_DEF', $config_row['key']);
!defined('APPSECRET_DEF') && define('APPSECRET_DEF', $config_row['appsecret']);
!defined('SSLCERT_PATH_DEF') && define('SSLCERT_PATH', LIB_PATH . '/Api/wx/cert/apiclient_cert.pem');
!defined('SSLKEY_PATH_DEF') && define('SSLKEY_PATH', LIB_PATH . '/Api/wx/cert/apiclient_key.pem');
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false || $_GET['trade_type']=='JSAPI')
{
$PaymentModel = new Payment_WxJsModel($config_row);
}
else
{
$PaymentModel = new Payment_WxNativeModel($config_row);
}
break;
case 'bestpay':
$PaymentModel = new Payment_BestpayModel($config_row);
break;
case 'app_wx_native':
!defined('APPID_DEF') && define('APPID_DEF', $config_row['appid']);
!defined('MCHID_DEF') && define('MCHID_DEF', $config_row['mchid']);
!defined('KEY_DEF') && define('KEY_DEF', $config_row['key']);
!defined('APPSECRET_DEF') && define('APPSECRET_DEF', $config_row['appsecret']);
!defined('SSLCERT_PATH_DEF') && define('SSLCERT_PATH', LIB_PATH . '/Api/wx/cert/apiclient_cert.pem');
!defined('SSLKEY_PATH_DEF') && define('SSLKEY_PATH', LIB_PATH . '/Api/wx/cert/apiclient_key.pem');
$PaymentModel = new Payment_WxNativeModel($config_row);
break;
case 'wxapp':
!defined('APPID_DEF') && define('APPID_DEF', $config_row['appid']);
!defined('MCHID_DEF') && define('MCHID_DEF', $config_row['mchid']);
!defined('KEY_DEF') && define('KEY_DEF', $config_row['key']);
!defined('APPSECRET_DEF') && define('APPSECRET_DEF', $config_row['appsecret']);
!defined('SSLCERT_PATH_DEF') && define('SSLCERT_PATH', LIB_PATH . '/Api/wxapp/cert/apiclient_cert.pem');
!defined('SSLKEY_PATH_DEF') && define('SSLKEY_PATH', LIB_PATH . '/Api/wxapp/cert/apiclient_key.pem');
$PaymentModel = new Payment_Wxapp($openid,$body,$total_fee);
break;
default:
# code...
break;
}
return $PaymentModel;
}
#### paycenter_admin文件修改
1.`\paycenter_admin\admin\views\default\Payment\ChannelCtl\manage.php`修改此文件内js部分
老版本修改
var paymentChannelNameCombo = $("#payment_channel_name").combo({
data: [{
id: "alipay",
name: "支付宝PC端"
},{
id: "alipayMobile",
name: "支付宝手机端"
}, {
id: "wx_native",
name: "微信支付PC端"
}, {
id: "app_wx_native",
name: "微信支付手机端(原生)"
}, {
id: "app_h5_wx_native",
name: "微信支付手机端(套壳)"
}, {
id: "unionpay",
name: "银联支付"
}, {
id: "bestpay",
name: "翼支付"
}, {
id: "baitiao",
name: "白条"
},{
id: "wxapp",
name: "小程序支付"
}],
value: "id",
text: "name",
width: 180,
callback: {
onChange: function () {
$('#payment_channel_code').val(this.getValue());
uploader.options.formData.paymentType = this.getValue();
}
}
}).getCombo();
....
if ($.inArray(rowData.payment_channel_code, ['wx_native', 'app_wx_native', 'app_h5_wx_native','wxapp']) > -1) {
$("#account").val(rowData.payment_channel_config["appid"]);
$("#key").val(rowData.payment_channel_config["key"]);
$("#partner").val(rowData.payment_channel_config["mchid"]);
$("#appsecret").val(rowData.payment_channel_config["appsecret"]);
$("#kaifa").css("display", "block");
$("label[for='payment_channel_config[account]']").text("微信公众号身份");
$("label[for='payment_channel_config[key]']").text("商户支付密钥");
$("label[for='payment_channel_config[partner]']").text("受理商ID");
$("#appsecret").attr("disabled", false);
} else {
var account = rowData.payment_channel_code + "_account";
var key = rowData.payment_channel_code + "_key";
var partner = rowData.payment_channel_code + "_partner";
$("#account").val(rowData.payment_channel_config[account]);
$("#key").val(rowData.payment_channel_config[key]);
$("#partner").val(rowData.payment_channel_config[partner]);
}
新版本修改
var uploader,
paymentChannelNameCombo,
wx = ['wx_native', 'app_wx_native', 'app_h5_wx_native','wxapp'],
alipay = ['alipay', 'alipayMobile'];
.....
paymentChannelNameCombo = $("#payment_channel_name").combo({
data: [{
id: "alipay",
name: "支付宝电脑端"
},{
id: "alipayMobile",
name: "支付宝手机端"
}, {
id: "wx_native",
name: "微信支付电脑端"
}, {
id: "app_wx_native",
name: "微信支付手机端(原生)"
}, {
id: "app_h5_wx_native",
name: "微信支付手机端(套壳)"
}, {
id: "unionpay",
name: "银联支付"
}, {
id: "bestpay",
name: "翼支付"
}, {
id: "baitiao",
name: "白条"
},{
id: "wxapp",
name: "小程序支付"
}],
value: "id",
text: "name",
width: 180,
callback: {
onChange: function () {
var v = this.getValue();
if ($.inArray(v, wx) > -1) {
showWx(v)
} else if ($.inArray(v, alipay) > -1) {
showAlipay();
} else {
show();
}
}
}
}).getCombo();
#### ucenter文件修改
1.`\ucenter\ucenter\controllers\Connect`文件夹下新增`WxappCtl.php`文件
2.`\ucenter\ucenter\controllers\Plugin\Perm.php`修改文件内容
//无需权限判断的文件
$not_perm = array('Login', 'Api', 'ImApi', 'Index', 'Connect_Qq', 'Connect_Weixin', 'Connect_WeixinIn','Connect_Weibo','Connect_Bind','Connect', 'Upload', 'OAuth2', 'Base_AppVersion','Connect_Wxapp');
3.`\ucenter\ucenter\controllers\Plugin\LoginCtl.php`新增方法
/*
* 小程序短信验证码获取
* */
public function wxappregCode(){
$mobile = request_string('mobile');
$check_code = mt_rand(100000, 999999);
if($mobile && Yf_Utils_String::isMobile($mobile)){
//判断手机号是否已经注册过
$User_InfoDetail = new User_InfoDetailModel();
$checkmobile = $User_InfoDetail->checkMobile($mobile);
if($checkmobile){
$msg = _('该手机号已注册');
$status = 250;
}else{
$save_result = $this->_saveCodeCache($mobile,$check_code,'verify_code');
if(!$save_result){
$msg = _('发送失败');
$status = 250;
}else{
//发送短消息
$message_model = new Message_TemplateModel();
$pattern = array('/\[weburl_name\]/','/\[yzm\]/');
$replacement = array(Web_ConfigModel::value("site_name"),$check_code);
$message_info = $message_model->getTemplateInfo(array('code'=>'regist_verify'), $pattern ,$replacement);
if(!$message_info['is_phone']){
$this->data->addBody(-140,array() , _('信息内容创建失败'), 250);
}
$contents = $message_info['content_phone'];
$result = Sms::send($mobile, $contents);
if ($result){
$msg = _('发送成功');
$status = 200;
}else{
$msg = _('发送失败');
$status = 250;
}
}
}
}else{
$msg = __('发送失败');
$status = 250;
}
$data = array();
if(DEBUG===true){
$data['user_code'] = $check_code;
}
return $this->data->addBody(-140,$data , $msg, $status);
}
#### shop文件修改
1.`\shop\shop\controllers\Buyer\FavoritesCtl.php`修改该方法内分页为10
2.`\shop\shop\controllers\Buyer\OrderCtl.php`修改方法`addOrder`在该方法内加入以下代码
if (request_string('wxapp') == 'wxapp') {
if (!is_array($cart_id)) {
$cart_id = explode(',', $cart_id);
}
if (!is_array($shop_id)) {
$shop_id = explode(',', $shop_id);
}
if (!is_array($remark)) {
$remark = explode(',', $remark);
}
if (!is_array($voucher_id)) {
$voucher_id = explode(',', $voucher_id);
}
}
3.`\shop\shop\controllers\Goods\EvaluationCtl.php`修改`addGoodsEvaluation`方法加入如下代码
if(request_int('wxapp') == 1){
$evaluation = json_decode($evaluation);
}
4.`\shop\shop\controllers\Goods\GoodsCtl.php`修改`goodslist`方法指定的位置加入如下代码
goodslist方法内修改
//判断是否有属性
$property_value_row = array();
$cond_row['common_state'] = Goods_CommonModel::GOODS_STATE_NORMAL;
$cond_row['common_verify'] = Goods_CommonModel::GOODS_VERIFY_ALLOW;
if(request_string('type_wxapp') == 'wxapp' && request_string('type_wxapp')){
$cond_row['common_is_tuan'] = 0;
}
$data = $Goods_CommonModel->getGoodsList($cond_row, $order_row, $page, $rows, $property_value_row);
$data['transport_area'] = $transport_area;
5.`\shop\shop\controllers\IndexCtl.php` `index`方法内指定的位置修改以下代码
if ($layout_data_val['mb_tpl_layout_type'] == 'goods') {
$goods = array();
$item = array();
$mb_tpl_layout_data = $layout_data_val['mb_tpl_layout_data'];
if (request_string('type_wxapp') == 'wxapp') {
$common_list = $goods_CommonModel->getByWhere(array('common_id:IN' => $mb_tpl_layout_data, 'common_is_tuan' => 0));
} else {
$common_list = $goods_CommonModel->getByWhere(array('common_id:IN' => $mb_tpl_layout_data));
}
if ($common_list) {
foreach ($common_list as $common_id => $common_data) {
$goods_id = pos($common_data['goods_id']);
if (is_array($goods_id)) {
$goods_id = pos($goods_id);
}
$item[$common_id]['goods_id'] = $goods_id;
$item[$common_id]['goods_name'] = $common_data['common_name'];
$item[$common_id]['goods_promotion_price'] = $common_data['common_price'];
$item[$common_id]['goods_image'] = sprintf('%s!360x360', $common_data['common_image']);
$item[$common_id]['goods_salenum'] = $common_data['common_salenum'];
$item[$common_id]['goods_evaluation_count'] = $common_data['common_evaluate'];
}
$goods['item'] = array_values($item);
$goods['title'] = $layout_data_val['mb_tpl_layout_title'];
$data[$mb_tpl_layout_id + 1]['goods'] = $goods;
}
}
加入新方法
/*
* 小程序关联用户注册paycenter
* */
public function wxappcheckApp()
{
//本地读取远程信息
$key = Yf_Registry::get('paycenter_api_key');
$url = Yf_Registry::get('paycenter_api_url');
$app_id = Yf_Registry::get('paycenter_app_id');
$formvars = array();
$formvars['us'] = request_int('us');
$formvars['ks'] = request_string('ks');
$formvars['app_id'] = $app_id;
$url = sprintf('%s?ctl=%s&met=%s&typ=%s', $url, 'Login', 'check', 'json');
$init_rs = get_url_with_encrypt($key, $url, $formvars);
if ($init_rs['status'] == 200) {
return $this->data->setError($init_rs['msg'], $init_rs);
} else {
$msg = __('账号或密码错误');
return $this->data->setError($msg, array());
}
}
6.在`shop\controllers\Goods\GoodsCtl.php`方法内 goods方法修改
foreach($data['goods_commend_list'] as $dkey=>$dval)
{
if($data['goods_commend_list'][$dkey]['common_spec_name'] == null)
$data['goods_commend_list'][$dkey]['common_spec_name'] = '';
if($data['goods_commend_list'][$dkey]['common_spec_value'] == null)
$data['goods_commend_list'][$dkey]['common_spec_value'] = '';
if($data['goods_commend_list'][$dkey]['common_property'] == null)
$data['goods_commend_list'][$dkey]['common_property'] = '';
if($data['goods_commend_list'][$dkey]['common_location'] == null)
$data['goods_commend_list'][$dkey]['common_location'] = '';
if($data['goods_commend_list'][$dkey]['common_distributor_description'] == null)
$data['goods_commend_list'][$dkey]['common_distributor_description'] = '';
}
//新增部分开始
$a = array();
if($goods_info['common_spec_name']){
$spec_list = array();
$spec_list = $goods_info['common_spec_name'];
foreach ($goods_info['common_spec_value_c'] as $key => $value) {
foreach ($value as $key1 => $value1) {
$arr[$key][$key1]['specs_value_id'] = $key1;
$arr[$key][$key1]['specs_value_name'] = $value1;
}
}
foreach ($arr as $k => $value) {
$a[$spec_list[$k]]= $value;
}
}
//新增部分结束
//获取商品的促销信息
$promotion_info = $this->getPromotionInfo($goods_id);
$data['promotion_info'] = $promotion_info;
$data['goods_info']['show_goods_spec_str'] = $show_goods_spec_str;
//新增部分开始
$data['goods_info']['spec_list'] = $a;//小程序获取规格列表
//新增部分结束
5.`\shop\shop\controllers\ShopCtl.php`修改`goodsList`方法指定的位置加入如下代码
$cond_row['common_state'] = Goods_CommonModel::GOODS_STATE_NORMAL;
$cond_row['common_verify'] = 1;
if(request_string('type_wxapp') == 'wxapp' && request_string('type_wxapp')){
$cond_row['common_is_tuan'] = 0;
}
$datas = $Goods_CommonModel->getGoodsList($cond_row, $order_row, $page, $rows);
$Yf_Page->totalRows = $datas['totalsize'];
$page_nav = $Yf_Page->prompt();
$data = $datas['items'];
6.`\shop\shop\controllers\ShopCtl.php`修改方法`directsellerGoodsList`
返回值增加新字段
$data['shop_wap_qrcode'] = Yf_Registry::get('base_url')."/shop/api/qrcode.php?data=".urlencode(Yf_Registry::get('shop_wap_url')."/tmpl/member/directseller_store.html?uid=".$uid);
7.`\shop\models\Goods\BaseModel.php`修改该文件内`getGoodsDetailInfoByGoodId`方法
//限时折扣
if (!empty($goods_base['xianshi_info']) && $goods_base['xianshi_info']['discount_price'] < $goods_base['goods_price'])
{
if ($goods_base['goods_price'] > $goods_base['xianshi_info']['discount_price'])
{
$goods_base['promotion_type'] = 'xianshi';
$goods_base['title'] = $goods_base['xianshi_info']['discount_name'];
$goods_base['remark'] = $goods_base['xianshi_info']['discount_title'];
$goods_base['promotion_price'] = $goods_base['xianshi_info']['discount_price'];
$goods_base['down_price'] = $goods_base['goods_price'] - $goods_base['xianshi_info']['discount_price'];
$goods_base['lower_limit'] = $goods_base['xianshi_info']['goods_lower_limit'];
$goods_base['xianshi_lower_limit'] = $goods_base['xianshi_info']['goods_lower_limit'];
$goods_base['explain'] = $goods_base['xianshi_info']['discount_explain'];
$goods_base['groupbuy_starttime'] = $goods_base['xianshi_info']['goods_start_time'];
$goods_base['groupbuy_endtime'] = $goods_base['xianshi_info']['goods_end_time'];
$goods_base['groupbuy_starttimes'] = strtotime($goods_base['xianshi_info']['goods_start_time']);//小程序
$goods_base['groupbuy_endtimes'] = strtotime($goods_base['xianshi_info']['goods_end_time']);//小程序
$goods_base['promotion_is_start'] = $goods_base['groupbuy_starttime'] > date('Y-m-d H:i:s') ? 0 : 1;
}
unset($goods_base['xianshi_info']);
}
### 新增bannenr链接
1.修改文件`shop_wap\tmpl\product_detail.php`
在该页面头部部门加入以下代码
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script type="text/javascript">
var url = '../product_detail/product_detail?goods_id='+<?php echo $_GET['goods_id']?>;
wx.miniProgram.redirectTo({url:url})
</script>
2.修改文件`shop_wap\tmpl\store_intro.php`
在该页面头部部门加入以下代码
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script type="text/javascript">
var url = '../store_intro/store_intro?shop_id='+<?php echo $_GET['shop_id']?>;
wx.miniProgram.redirectTo({url:url})
</script>
3.修改文件`shop_wap\tmpl\voucher_list.php`
在该页面头部部门加入以下代码
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script type="text/javascript">
var url = '../voucher_center/voucher_center';
wx.miniProgram.redirectTo({url:url})
</script>
4.修改文件`shop_wap\tmpl\redpacket_plat.php`
在该页面头部部门加入以下代码
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script type="text/javascript">
var url = '../voucher_center/voucher_center';
wx.miniProgram.redirectTo({url:url})
</script>
5.修改文件`shop_wap\tmpl\store.php`
在该页面头部部门加入以下代码
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script type="text/javascript">
var url = '../store/store?shop_id='+<?php echo $_GET['shop_id']?>;
wx.miniProgram.redirectTo({url:url})
</script>
>[warning]注意:当遇到收货地址无法选择的时候,修改文件`pages/address_opera_eidt/adress_opera_eidt.wxml`这个文件中找到`district_is_level`这个变量替换成`district_is_leaf`,修改完成之后用同样的方法修改pages/address_opera/adress_opera.wxml
NaNundefined
>[help]更换启动页背景图片方式
首先访问如下地址[http://imgbase64.duoshitong.com/](http://imgbase64.duoshitong.com/)
然后上传你所准备的图片生成base64位编码,复制你的编码。
最后替换`page/authorize_login/authorze_login.wxml`里面的编码即可
### 商品详情不显示图片
修改文件wxParse/htm2json
- 商城api接口
- 首页数据获取
- 分类接口
- 购物车接口
- 商品信息接口
- 搜索接口
- 订单列表接口
- 店铺接口
- 收藏接口
- 收货地址接口
- 生成订单接口
- 支付接口
- 会员中心接口
- 登录注册接口
- 关于我们
- 图片上传
- 分销中心
- 分销明细
- 代金券
- 平台红包列表
- 分销申请列表
- 我的推广
- 微信小程序
- 简介
- 开发前准备
- 目录结构介绍
- 发起请求
- 网络请求提交表单
- 代码及开发所遇到问题总结
- 导航跳转时所遇到的问题
- 缓存数据与数据取得的问题
- 如何引入外部css
- 如何定义与使用全局变量
- 如何定义新的界面
- 微信小程序支付
- 小程序的手机验证码登录
- 上传,下载
- 提示框
- app.json配置
- 配置demo
- pages
- window
- tabBar
- networkTimeout
- debug
- page.json
- 缓存
- 特效
- 滑动方式
- 城市切换
- 五星好评
- Switch
- 上拉加载
- wxml 标签
- 视图容器
- 基础内容
- 表单组件
- 导航
- 媒体组件
- 自定义提示框
- 小程序内访问网页
- 倒计时显示
- 微信小程序,如何在返回前一个页面时,执行前一个页面的方法
- 在本地可以请求到数据,但手机上是请求不到的
- curl请求失败
- 代码同步
- 短信平台更换