目录
小程序端代码
后台代码
首页 微信小程序 小程序开发 微信小程序支付接口的实例详解

微信小程序支付接口的实例详解

Apr 22, 2017 am 11:53 AM

微信小程序支付

  • list

  • -paddingleft-2">

  • 微信提供文档的业务流程时序图

  • 第一步
    进入小程序,下单,请求下单支付,调用小程序登录API来获取Openid,生成商户订单,这些都是在小程序端完成的业务。

小程序端代码

// pages/pay/pay.jsvar app = getApp();
Page({
    data: {},
    onLoad: function (options) {
        // 页面初始化 options为页面跳转所带来的参数
    },    /* 微信支付 */
    wxpay: function () {
        var that = this
        //登陆获取code
        wx.login({
            success: function (res) {
                console.log(res.code)                //获取openid
                that.getOpenId(res.code)
            }
        });
    },
    getOpenId: function (code) {
        var that = this;
        wx.request({
            url: "https://api.weixin.qq.com/sns/jscode2session?appid=wxa142513e524e496c&secret=5d6a7d86048884e7c60f84f7aa85253c&js_code=" + code + "&grant_type=authorization_code",
            data: {},
            method: 'GET',
            success: function (res) {
                console.log('返回openId')
                console.log(res.data)
                that.generateOrder(res.data.openid)
            },
            fail: function () {
                // fail
            },
            complete: function () {
                // complete
            }
        })
    },    /**生成商户订单 */
    generateOrder: function (openid) {
        var that = this
        //统一支付
        wx.request({
            url: 'http://localhost:8070/RMS/pay_pay.action',
            method: 'GET',
            data: {
                total_fee: '5',
                body: '支付测试',
                attach:'真假酒水'
            },
            success: function (res) {
                console.log(res)                var pay = res.data                //发起支付
                var timeStamp = pay[0].timeStamp;
                console.log("timeStamp:"+timeStamp)                var packages = pay[0].package;
                console.log("package:"+packages)                var paySign = pay[0].paySign;
                console.log("paySign:"+paySign)                var nonceStr = pay[0].nonceStr;
                 console.log("nonceStr:"+nonceStr)                var param = { "timeStamp": timeStamp, "package": packages, "paySign": paySign, "signType": "MD5", "nonceStr": nonceStr };
                that.pay(param)
            },
        })
    },    /* 支付   */
    pay: function (param) {
        console.log("支付")
        console.log(param)
        wx.requestPayment({
            timeStamp: param.timeStamp,
            nonceStr: param.nonceStr,
            package: param.package,
            signType: param.signType,
            paySign: param.paySign,
            success: function (res) {
                // success
                console.log("支付")
                console.log(res)
                wx.navigateBack({
                    delta: 1, // 回退前 delta(默认为1) 页面
                    success: function (res) {
                        wx.showToast({
                            title: '支付成功',
                            icon: 'success',
                            duration: 2000
                        })
                    },
                    fail: function () {
                        // fail

                    },
                    complete: function () {
                        // complete
                    }
                })
            },
            fail: function (res) {
                // fail
                console.log("支付失败")
                console.log(res)
            },
            complete: function () {
                // complete
                console.log("pay complete")
            }
        })
    }
})
登录后复制
  • 第二步
    调用支付统一下单API来获取prepay_id,并将小程序调起支付数据需要签名的字段appId,timeStamp,nonceStr,package再次签名

后台代码

package cn.it.shop.action;import java.io.ByteArrayInputStream;import java.io.InputStream;import java.io.UnsupportedEncodingException;import java.text.SimpleDateFormat;import java.util.Date;import java.util.HashMap;import java.util.List;import java.util.Map;import org.dom4j.Document;import org.dom4j.DocumentException;import org.dom4j.Element;import org.dom4j.io.SAXReader;import cn.it.shop.util.MessageUtil;import cn.it.shop.util.PayUtil;import cn.it.shop.util.PaymentPo;import cn.it.shop.util.UUIDHexGenerator;import net.sf.json.JSONArray;import net.sf.json.JSONObject;/** 
* @author 
* @version 创建时间:2017年1月21日 下午4:59:03 
* 小程序端请求的后台action,返回签名后的数据传到前台
*/public class PayAction {    private String total_fee;//总金额
    private String body;//商品描述
    private String detail;//商品详情    
    private String attach;//附加数据
    private String time_start;//交易起始时间
    private String time_expire;//交易结束时间 
    private String openid;//用户标识

    private JSONArray jsonArray=new JSONArray();    public String pay() throws UnsupportedEncodingException, DocumentException{

         body = new String(body.getBytes("UTF-8"),"ISO-8859-1");  
        String appid = "替换为自己的小程序ID";//小程序ID
        String mch_id = "替换为自己的商户号";//商户号
        String nonce_str = UUIDHexGenerator.generate();//随机字符串
        String today = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());        String code = PayUtil.createCode(8);        String out_trade_no = mch_id+today+code;//商户订单号
        String spbill_create_ip = "替换为自己的终端IP";//终端IP
        String notify_url = "http://www.weixin.qq.com/wxpay/pay.php";//通知地址
        String trade_type = "JSAPI";//交易类型  
        String openid="替换为用户的openid";//用户标识

        /**/
        PaymentPo paymentPo = new PaymentPo();

        paymentPo.setAppid(appid);
        paymentPo.setMch_id(mch_id);
        paymentPo.setNonce_str(nonce_str);        String newbody=new String(body.getBytes("ISO-8859-1"),"UTF-8");//以utf-8编码放入paymentPo,微信支付要求字符编码统一采用UTF-8字符编码
        paymentPo.setBody(newbody);
        paymentPo.setOut_trade_no(out_trade_no);
        paymentPo.setTotal_fee(total_fee);
        paymentPo.setSpbill_create_ip(spbill_create_ip);
        paymentPo.setNotify_url(notify_url);
        paymentPo.setTrade_type(trade_type);
        paymentPo.setOpenid(openid);        // 把请求参数打包成数组
        Map<String, String> sParaTemp = new HashMap<String, String>();
        sParaTemp.put("appid", paymentPo.getAppid());
        sParaTemp.put("mch_id", paymentPo.getMch_id());
        sParaTemp.put("nonce_str", paymentPo.getNonce_str());
        sParaTemp.put("body",  paymentPo.getBody());
        sParaTemp.put("out_trade_no", paymentPo.getOut_trade_no());
        sParaTemp.put("total_fee",paymentPo.getTotal_fee());
        sParaTemp.put("spbill_create_ip", paymentPo.getSpbill_create_ip());
        sParaTemp.put("notify_url",paymentPo.getNotify_url());
        sParaTemp.put("trade_type", paymentPo.getTrade_type());
        sParaTemp.put("openid", paymentPo.getOpenid());        // 除去数组中的空值和签名参数
        Map<String, String> sPara = PayUtil.paraFilter(sParaTemp);        String prestr = PayUtil.createLinkString(sPara); // 把数组所有元素,按照“参数=参数值”的模式用“&”字符拼接成字符串
        String key = "&key=替换为商户支付密钥"; // 商户支付密钥
        //MD5运算生成签名
        String mysign = PayUtil.sign(prestr, key, "utf-8").toUpperCase();
        paymentPo.setSign(mysign);        //打包要发送的xml
        String respXml = MessageUtil.messageToXML(paymentPo);        // 打印respXml发现,得到的xml中有“”不对,应该替换成“_”
        respXml = respXml.replace(, "_");        String url = "https://api.mch.weixin.qq.com/pay/unifiedorder";//统一下单API接口链接
        String param = respXml;        //String result = SendRequestForUrl.sendRequest(url, param);//发起请求
        String result =PayUtil.httpRequest(url, "POST", param);        // 将解析结果存储在HashMap中
        Map<String, String> map = new HashMap<String, String>();
         InputStream in=new ByteArrayInputStream(result.getBytes());  
        // 读取输入流
        SAXReader reader = new SAXReader();
        Document document = reader.read(in);        // 得到xml根元素
        Element root = document.getRootElement();        // 得到根元素的所有子节点
        @SuppressWarnings("unchecked")        List<Element> elementList = root.elements();
        for (Element element : elementList) {            map.put(element.getName(), element.getText());
        }        // 返回信息
        String return_code = map.get("return_code");//返回状态码
        String return_msg = map.get("return_msg");//返回信息
        System.out.println("return_msg"+return_msg);
        JSONObject JsonObject=new JSONObject() ;        if(return_code=="SUCCESS"||return_code.equals(return_code)){            // 业务结果
            String prepay_id = map.get("prepay_id");//返回的预付单信息
            String nonceStr=UUIDHexGenerator.generate();
            JsonObject.put("nonceStr", nonceStr);
            JsonObject.put("package", "prepay_id="+prepay_id);
            Long timeStamp= System.currentTimeMillis()/1000;
            JsonObject.put("timeStamp", timeStamp+"");            String stringSignTemp = "appId="+appid+"&nonceStr=" + nonceStr + "&package=prepay_id=" + prepay_id+ "&signType=MD5&timeStamp=" + timeStamp;            //再次签名
            String paySign=PayUtil.sign(stringSignTemp, "&key=替换为自己的密钥", "utf-8").toUpperCase();
            JsonObject.put("paySign", paySign);
            jsonArray.add(JsonObject);
        }        return "pay";

    }    public String getTotal_fee() {        return total_fee;
    }    public void setTotal_fee(String total_fee) {
        this.total_fee = total_fee;
    }    public String getBody() {        return body;
    }    public void setBody(String body) {
        this.body = body;
    }    public JSONArray getJsonArray() {        return jsonArray;
    }    public void setJsonArray(JSONArray jsonArray) {
        this.jsonArray = jsonArray;
    }    public String getDetail() {        return detail;
    }    public void setDetail(String detail) {
        this.detail = detail;
    }    public String getAttach() {        return attach;
    }    public void setAttach(String attach) {
        this.attach = attach;
    }    public String getTime_start() {        return time_start;
    }    public void setTime_start(String time_start) {
        this.time_start = time_start;
    }    public String getTime_expire() {        return time_expire;
    }    public void setTime_expire(String time_expire) {
        this.time_expire = time_expire;
    }    public String getOpenid() {        return openid;
    }    public void setOpenid(String openid) {
        this.openid = openid;
    }
}
登录后复制
  • 后台业务逻辑涉及到的工具类及参数封装类

MessageUtil 
package cn.it.shop.util;import java.io.IOException;import java.io.Writer;import java.util.HashMap;import java.util.List;import javax.servlet.http.HttpServletRequest;import org.dom4j.Document;import org.dom4j.Element;import org.dom4j.io.SAXReader;import com.thoughtworks.xstream.XStream;import com.thoughtworks.xstream.core.util.QuickWriter;import com.thoughtworks.xstream.io.HierarchicalStreamWriter;import com.thoughtworks.xstream.io.xml.PrettyPrintWriter;import com.thoughtworks.xstream.io.xml.XppDriver;public class MessageUtil {

    public static HashMap<String,String> parseXML(HttpServletRequest request) throws Exception, IOException{
        HashMap<String,String> map=new HashMap<String,String>();        // 通过IO获得Document
        SAXReader reader = new SAXReader();
        Document doc = reader.read(request.getInputStream());        //得到xml的根节点
        Element root=doc.getRootElement();
        recursiveParseXML(root,map);        return map;
    }    private static void recursiveParseXML(Element root,HashMap<String,String> map){        //得到根节点的子节点列表
        List<Element> elementList=root.elements();        //判断有没有子元素列表
        if(elementList.size()==0){
            map.put(root.getName(), root.getTextTrim());
        }        else{            //遍历
            for(Element e:elementList){
                recursiveParseXML(e,map);
            }
        }
    }    private static XStream xstream = new XStream(new XppDriver() {        public HierarchicalStreamWriter createWriter(Writer out) {            return new PrettyPrintWriter(out) {                // 对所有xml节点都增加CDATA标记
                boolean cdata = true;                public void startNode(String name, Class clazz) {                    super.startNode(name, clazz);
                }                protected void writeText(QuickWriter writer, String text) {                    if (cdata) {
                        writer.write("<![CDATA[");
                        writer.write(text);
                        writer.write("]]>");
                    } else {
                        writer.write(text);
                    }
                }
            };
        }
    });    public static String messageToXML(PaymentPo paymentPo){
        xstream.alias("xml",PaymentPo.class);        return xstream.toXML(paymentPo);
    }
}

PaymentPo//封装支付参数实体package cn.it.shop.util;/** 
* @author * @version 创建时间:2017年1月21日 下午4:20:52 
* 类说明 
*/public class PaymentPo {
    private String appid;//小程序ID
    private String mch_id;//商户号
    private String device_info;//设备号
    private String nonce_str;//随机字符串
    private String sign;//签名
    private String body;//商品描述  
    private String detail;//商品详情    
    private String attach;//附加数据
    private String out_trade_no;//商户订单号
    private String fee_type;//货币类型
    private String spbill_create_ip;//终端IP
    private String time_start;//交易起始时间
    private String time_expire;//交易结束时间 
    private String goods_tag;//商品标记
    private String total_fee;//总金额
    private String notify_url;//通知地址    
    private String trade_type;//交易类型    
    private String limit_pay;//指定支付方式
    private String openid;//用户标识
    public String getAppid() {        return appid;
    }    public void setAppid(String appid) {        this.appid = appid;
    }    public String getMch_id() {        return mch_id;
    }    public void setMch_id(String mch_id) {        this.mch_id = mch_id;
    }    public String getNonce_str() {        return nonce_str;
    }    public void setNonce_str(String nonce_str) {        this.nonce_str = nonce_str;
    }    public String getSign() {        return sign;
    }    public void setSign(String sign) {        this.sign = sign;
    }    public String getBody() {        return body;
    }    public void setBody(String body) {        this.body = body;
    }    public String getOut_trade_no() {        return out_trade_no;
    }    public void setOut_trade_no(String out_trade_no) {        this.out_trade_no = out_trade_no;
    }    public String getTotal_fee() {        return total_fee;
    }    public void setTotal_fee(String total_fee) {        this.total_fee = total_fee;
    }    public String getNotify_url() {        return notify_url;
    }    public void setNotify_url(String notify_url) {        this.notify_url = notify_url;
    }    public String getTrade_type() {        return trade_type;
    }    public void setTrade_type(String trade_type) {        this.trade_type = trade_type;
    }    public String getOpenid() {        return openid;
    }    public void setOpenid(String openid) {        this.openid = openid;
    }    public String getSpbill_create_ip() {        return spbill_create_ip;
    }    public void setSpbill_create_ip(String spbill_create_ip) {        this.spbill_create_ip = spbill_create_ip;
    }    public String getDevice_info() {        return device_info;
    }    public void setDevice_info(String device_info) {        this.device_info = device_info;
    }    public String getDetail() {        return detail;
    }    public void setDetail(String detail) {        this.detail = detail;
    }    public String getAttach() {        return attach;
    }    public void setAttach(String attach) {        this.attach = attach;
    }    public String getFee_type() {        return fee_type;
    }    public void setFee_type(String fee_type) {        this.fee_type = fee_type;
    }    public String getTime_start() {        return time_start;
    }    public void setTime_start(String time_start) {        this.time_start = time_start;
    }    public String getTime_expire() {        return time_expire;
    }    public void setTime_expire(String time_expire) {        this.time_expire = time_expire;
    }    public String getGoods_tag() {        return goods_tag;
    }    public void setGoods_tag(String goods_tag) {        this.goods_tag = goods_tag;
    }    public String getLimit_pay() {        return limit_pay;
    }    public void setLimit_pay(String limit_pay) {        this.limit_pay = limit_pay;
    }

}
PayUtilpackage cn.it.shop.util;import java.io.BufferedReader;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream;import java.io.UnsupportedEncodingException;import java.net.HttpURLConnection;import java.net.URL;import java.util.ArrayList;import java.util.Collections;import java.util.HashMap;import java.util.List;import java.util.Map;import org.apache.commons.codec.digest.DigestUtils;/**
 * @author 
 * @version 创建时间:2017年1月17日 下午7:46:29 类说明
 */public class PayUtil {
    /**
     * 签名字符串
     * @param text需要签名的字符串
     * @param key 密钥
     * @param input_charset编码格式
     * @return 签名结果
     */
    public static String sign(String text, String key, String input_charset) {
        text = text + key;        return DigestUtils.md5Hex(getContentBytes(text, input_charset));
    }    /**
     * 签名字符串
     *  @param text需要签名的字符串
     * @param sign 签名结果
     * @param key密钥
     * @param input_charset 编码格式
     * @return 签名结果
     */
    public static boolean verify(String text, String sign, String key, String input_charset) {
        text = text + key;
        String mysign = DigestUtils.md5Hex(getContentBytes(text, input_charset));        if (mysign.equals(sign)) {            return true;
        } else {            return false;
        }
    }    /**
     * @param content
     * @param charset
     * @return
     * @throws SignatureException
     * @throws UnsupportedEncodingException
     */
    public static byte[] getContentBytes(String content, String charset) {        if (charset == null || "".equals(charset)) {            return content.getBytes();
        }        try {            return content.getBytes(charset);
        } catch (UnsupportedEncodingException e) {            throw new RuntimeException("MD5签名过程中出现错误,指定的编码集不对,您目前指定的编码集是:" + charset);
        }
    }    /**
     * 生成6位或10位随机数 param codeLength(多少位)
     * @return
     */
    public static String createCode(int codeLength) {
        String code = "";        for (int i = 0; i < codeLength; i++) {
            code += (int) (Math.random() * 9);
        }        return code;
    }    private static boolean isValidChar(char ch) {        if ((ch >= &#39;0&#39; && ch <= &#39;9&#39;) || (ch >= &#39;A&#39; && ch <= &#39;Z&#39;) || (ch >= &#39;a&#39; && ch <= &#39;z&#39;))            return true;        if ((ch >= 0x4e00 && ch <= 0x7fff) || (ch >= 0x8000 && ch <= 0x952f))            return true;// 简体中文汉字编码
        return false;
    }    /**
     * 除去数组中的空值和签名参数
     * @param sArray 签名参数组
     * @return 去掉空值与签名参数后的新签名参数组
     */
    public static Map<String, String> paraFilter(Map<String, String> sArray) {
        Map<String, String> result = new HashMap<String, String>();        if (sArray == null || sArray.size() <= 0) {            return result;
        }        for (String key : sArray.keySet()) {
            String value = sArray.get(key);            if (value == null || value.equals("") || key.equalsIgnoreCase("sign")
                    || key.equalsIgnoreCase("sign_type")) {                continue;
            }
            result.put(key, value);
        }        return result;
    }    /**
     * 把数组所有元素排序,并按照“参数=参数值”的模式用“&”字符拼接成字符串
     * @param params 需要排序并参与字符拼接的参数组
     * @return 拼接后字符串
     */
    public static String createLinkString(Map<String, String> params) {
        List<String> keys = new ArrayList<String>(params.keySet());
        Collections.sort(keys);

        String prestr = "";        for (int i = 0; i < keys.size(); i++) {
            String key = keys.get(i);
            String value = params.get(key);            if (i == keys.size() - 1) {// 拼接时,不包括最后一个&字符
                prestr = prestr + key + "=" + value;
            } else {
                prestr = prestr + key + "=" + value + "&";
            }
        }        return prestr;
    }    /**
     * 
     * @param requestUrl请求地址
     * @param requestMethod请求方法
     * @param outputStr参数
     */
    public static String httpRequest(String requestUrl,String requestMethod,String outputStr){        // 创建SSLContext
        StringBuffer buffer=null;        try{
        URL url = new URL(requestUrl);
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setRequestMethod(requestMethod);
        conn.setDoOutput(true);
        conn.setDoInput(true);
        conn.connect();        //往服务器端写内容
        if(null !=outputStr){
            OutputStream os=conn.getOutputStream();
            os.write(outputStr.getBytes("utf-8"));
            os.close();
        }        // 读取服务器端返回的内容
        InputStream is = conn.getInputStream();
        InputStreamReader isr = new InputStreamReader(is, "utf-8");
        BufferedReader br = new BufferedReader(isr);
        buffer = new StringBuffer();
        String line = null;        while ((line = br.readLine()) != null) {
                      buffer.append(line);
        }
        }catch(Exception e){
            e.printStackTrace();
        }        return buffer.toString();
        }   
    public static String urlEncodeUTF8(String source){
        String result=source;        try {
            result=java.net.URLEncoder.encode(source, "UTF-8");
        } catch (UnsupportedEncodingException e) {            // TODO Auto-generated catch block
            e.printStackTrace();
        }        return result;
    }
}
UUIDHexGeneratorpackage cn.it.shop.util;import java.net.InetAddress;/**
 * @author 
 * @version 创建时间:2017年1月17日 下午7:45:06 类说明
 */public class UUIDHexGenerator {
    private static String sep = "";    private static final int IP;    private static short counter = (short) 0;    private static final int JVM = (int) (System.currentTimeMillis() >>> 8);    private static UUIDHexGenerator uuidgen = new UUIDHexGenerator();    static {        int ipadd;        try {
            ipadd = toInt(InetAddress.getLocalHost().getAddress());
        } catch (Exception e) {
            ipadd = 0;
        }
        IP = ipadd;
    }    public static UUIDHexGenerator getInstance() {        return uuidgen;
    }    public static int toInt(byte[] bytes) {        int result = 0;        for (int i = 0; i < 4; i++) {
            result = (result << 8) - Byte.MIN_VALUE + (int) bytes[i];
        }        return result;
    }    protected static String format(int intval) {
        String formatted = Integer.toHexString(intval);
        StringBuffer buf = new StringBuffer("00000000");
        buf.replace(8 - formatted.length(), 8, formatted);        return buf.toString();
    }    protected static String format(short shortval) {
        String formatted = Integer.toHexString(shortval);
        StringBuffer buf = new StringBuffer("0000");
        buf.replace(4 - formatted.length(), 4, formatted);        return buf.toString();
    }    protected static int getJVM() {        return JVM;
    }    protected synchronized static short getCount() {        if (counter < 0) {
            counter = 0;
        }        return counter++;
    }    protected static int getIP() {        return IP;
    }    protected static short getHiTime() {        return (short) (System.currentTimeMillis() >>> 32);
    }    protected static int getLoTime() {        return (int) System.currentTimeMillis();
    }    public static String generate() {        return new StringBuffer(36).append(format(getIP())).append(sep).append(format(getJVM())).append(sep)
                .append(format(getHiTime())).append(sep).append(format(getLoTime())).append(sep)
                .append(format(getCount())).toString();
    }    /**
     * @param args
     */
    public static void main(String[] args) {
        String id="";
        UUIDHexGenerator uuid = UUIDHexGenerator.getInstance();        /*
        for (int i = 0; i < 100; i++) {
            id = uuid.generate();

        }*/
        id = uuid.generate();
        System.out.println(id);
    }
}
登录后复制

第一次写,写的不是太完整,希望同大家多多交流,一起进步。

以上是微信小程序支付接口的实例详解的详细内容。更多信息请关注PHP中文网其他相关文章!

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

热门话题

Java教程
1677
14
CakePHP 教程
1431
52
Laravel 教程
1334
25
PHP教程
1280
29
C# 教程
1257
24
百度地图打车如何支付   打车的付款步骤介绍 百度地图打车如何支付 打车的付款步骤介绍 Mar 13, 2024 am 10:04 AM

  百度地图APP现在已经都成为了超多用户们首选的出行导航的软件,那么这里的一些功能全面,都能够免费的让大家进行选择操作哦,解决自己日常出行方面会遇到的一些问题,完全都能够查询到自己的一些出行的路线,规划自己的一些出行的方案,查询完对应的这一些路线,都能根据自己的需求,选择合适的一些出行方式,那么你们不管是选择一些公共交通,骑行,步行或者是打车等,都能满足你们的,有着对应的一些导航路线,成功的带领你们去往某地,那么大家选择打车的话,都能感到更加的方便,超多的一些司机们都是会在线接单,打车变得超级

闲鱼微信小程序正式上线 闲鱼微信小程序正式上线 Feb 10, 2024 pm 10:39 PM

闲鱼官方微信小程序悄然上线,在小程序中可以发布闲置与买家/卖家私信交流、查看个人资料及订单、搜索物品等,有用好奇闲鱼微信小程序叫什么,现在快来看一下。闲鱼微信小程序叫什么答案:闲鱼,闲置交易二手买卖估价回收。1、在小程序中可以发布闲置、与买家/卖家私信交流、查看个人资料及订单、搜索指定物品等功能;2、在小程序的页面中有首页、附近、发闲置、消息、我的5项功能;3、想要使用的话必要要开通微信支付才可以购买;

实现微信小程序中的图片滤镜效果 实现微信小程序中的图片滤镜效果 Nov 21, 2023 pm 06:22 PM

实现微信小程序中的图片滤镜效果随着社交媒体应用的流行,人们越来越喜欢在照片中应用滤镜效果,以增强照片的艺术效果和吸引力。在微信小程序中也可以实现图片滤镜效果,为用户提供更多有趣和创造性的照片编辑功能。本文将介绍如何在微信小程序中实现图片滤镜效果,并提供具体的代码示例。首先,我们需要在微信小程序中使用canvas组件来加载和编辑图片。canvas组件可以在页面

实现微信小程序中的下拉菜单效果 实现微信小程序中的下拉菜单效果 Nov 21, 2023 pm 03:03 PM

实现微信小程序中的下拉菜单效果,需要具体代码示例随着移动互联网的普及,微信小程序成为了互联网开发的重要一环,越来越多的人开始关注和使用微信小程序。微信小程序的开发相比传统的APP开发更加简便快捷,但也需要掌握一定的开发技巧。在微信小程序的开发中,下拉菜单是一个常见的UI组件,实现了更好的用户操作体验。本文将详细介绍如何在微信小程序中实现下拉菜单效果,并提供具

闲鱼微信小程序叫什么 闲鱼微信小程序叫什么 Feb 27, 2024 pm 01:11 PM

闲鱼官方微信小程序已经悄然上线,它为用户提供了一个便捷的平台,让你可以轻松地发布和交易闲置物品。在小程序中,你可以与买家或卖家进行私信交流,查看个人资料和订单,以及搜索你想要的物品。那么闲鱼在微信小程序中究竟叫什么呢,这篇教程攻略将为您详细介绍,想要了解的用户们快来跟着本文继续阅读吧!闲鱼微信小程序叫什么答案:闲鱼,闲置交易二手买卖估价回收。1、在小程序中可以发布闲置、与买家/卖家私信交流、查看个人资料及订单、搜索指定物品等功能;2、在小程序的页面中有首页、附近、发闲置、消息、我的5项功能;3、

微信小程序实现图片上传功能 微信小程序实现图片上传功能 Nov 21, 2023 am 09:08 AM

微信小程序实现图片上传功能随着移动互联网的发展,微信小程序已经成为了人们生活中不可或缺的一部分。微信小程序不仅提供了丰富的应用场景,还支持开发者自定义功能,其中包括图片上传功能。本文将介绍如何在微信小程序中实现图片上传功能,并提供具体的代码示例。一、前期准备工作在开始编写代码之前,我们需要先下载并安装微信开发者工具,并注册成为微信开发者。同时,还需要了解微信

使用微信小程序实现轮播图切换效果 使用微信小程序实现轮播图切换效果 Nov 21, 2023 pm 05:59 PM

使用微信小程序实现轮播图切换效果微信小程序是一种轻量级的应用程序,具有简单、高效的开发和使用特点。在微信小程序中,实现轮播图切换效果是常见的需求。本文将介绍如何使用微信小程序实现轮播图切换效果,并给出具体的代码示例。首先,在微信小程序的页面文件中,添加一个轮播图组件。例如,可以使用&lt;swiper&gt;标签来实现轮播图的切换效果。在该组件中,可以通过b

实现微信小程序中的图片旋转效果 实现微信小程序中的图片旋转效果 Nov 21, 2023 am 08:26 AM

实现微信小程序中的图片旋转效果,需要具体代码示例微信小程序是一种轻量级的应用程序,为用户提供了丰富的功能和良好的用户体验。在小程序中,开发者可以利用各种组件和API来实现各种效果。其中,图片旋转效果是一种常见的动画效果,可以为小程序增添趣味性和视觉效果。在微信小程序中实现图片旋转效果,需要使用小程序提供的动画API。下面是一个具体的代码示例,展示了如何在小程

See all articles