本文目录:
- 1、小程序怎么做?
- 2、我用易语言写了个小程序,现在想把它做成开机自动启动的 那个代码怎么写,最好详细点,本人小白
- 3、微信小程序的index.js怎么写?详细代码见下方↓
小程序怎么做?
微信版本升级后,打开微信,点击底部的“发现”这个菜单项,就会发现升级后的“发现”菜单里,增加了“小程序”这样一个功能。
2.点击打开小程序后,可以看到有附近的小程序和我的小程序,附近的小程序是所在定位周边的小程序。
下面的小程序列表可以看到的是我们之前打开过的一些小程序,如果有自己觉得很好用的小程序就可以点击左上角,添加到我的小程序里面。
3.微信小程序还有具有搜索功能,打开搜索页面可以输入想要找的小程序。
我用易语言写了个小程序,现在想把它做成开机自动启动的 那个代码怎么写,最好详细点,本人小白
方法一:可以手动把写好的程序放到系统启动组下。
方法二:启动时自动复制自身到启动组
.版本 2
.支持库 shell
.子程序 __启动窗口_创建完毕
复制文件 (取运行路径 (), 取特定目录 (7))
.版本 2
.子程序 取运行路径, 文本型, 公开, 返回程序自身运行路径。如:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\EDV4E.tmp
.局部变量 文件名, 文本型
文件名 = 取空白文本 (256)
GetModuleFileNameA (0, 文件名, 256)
返回 (文件名)
.版本 2
.DLL命令 GetModuleFileNameA, 整数型, “kernel32.dll”, “GetModuleFileNameA”, , 获取一个已装载模板的完整路径名称 如执行成功,返回复制到lpFileName的实际字符数量;零表示失败。会设置GetLastError
.参数 模块句柄, 整数型, , 一个模块的句柄。可以是一个DLL模块,或者是一个应用程序的实例句柄
.参数 文件名缓冲区, 文本型, , 指定一个字串缓冲区,要在其中容纳文件的用NULL字符中止的路径名,hModule模块就是从这个文件装载进来的
.参数 缓冲区大小, 整数型, , 装载到缓冲区lpFileName的最大字符数量;
微信小程序的index.js怎么写?详细代码见下方↓
微信小程序实例index.js代码如下:
可以搜索小程序名称: 快递最后一公里
实例index.js代码
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
//三张图片轮播
imgUrls: [
{
imageUrl: ‘/images/weicha/timg1.jpg’,
},
{
imageUrl: ‘/images/weicha/timg2.jpg’,
},
{
imageUrl: ‘/images/weicha/timg3.jpg’,
}
],
indicatorDots: false,
autoplay: false,
interval: 5000,
duration: 800,
},
onSwiperTab: function (e) {
/*var postId = e.target.dataset.postId;
wx.navigateTo({
url: postId,
});*/
},
/**
* 生命周期函数–监听页面加载
*/
onLoad: function (options) {
app.loginWinCha(this.initPageData);
},
//初始化登录才能查看的数据
initPageData: function () {
this.setData({
componentList: [
{
id: 1,
url: ‘../weicha/express/courier/index’,
imageUrl: ‘/images/weicha/timg1_1.jpg’,
title: ‘快递小哥(送快递)’,
queryType: ‘courier’
},
{
id: 2,
url: ‘../weicha/express/seller/index’,
imageUrl: ‘/images/weicha/timg1_2.jpg’,
title: ‘合作商家(代收快递)’,
queryType: ‘seller’
},
{
id: 3,
url: ‘../weicha/express/personal/index’,
imageUrl: ‘/images/weicha/timg1_3.jpg’,
title: ‘收件人(签收快递)’
},
{
id: 4,
url: ‘../weicha/express/logistics/index’,
imageUrl: ‘/images/weicha/timg1_4.jpg’,
title: ‘快递物流查询’
}
]
});
},
onItemClick: function (e) {
var targetUrl = e.currentTarget.dataset.pay;
var targetQueryType = e.currentTarget.dataset.index;
if (targetQueryType == “seller”) {
var reqData = {
seller_openId: app.globalData.openid,
status: ‘2’
};
this.queryDBUtil(“sellerInfo”, reqData, targetQueryType, targetUrl,
“亲,您暂未申请商家,请提交商家申请!”);
} else if (targetQueryType == “courier”) {
var reqData = {
courier_openId: app.globalData.openid,
status: ‘2’
};
this.queryDBUtil(“courierInfo”, reqData, targetQueryType, targetUrl,
“亲,您暂未申请快递员,请提交快递员申请!”);;
} else {
wx.navigateTo({
url: targetUrl
});
}
},
queryDBUtil: function (reqCollectionName, reqData,queryType, retUrl,retMgs){
wx.cloud.callFunction({
name: “utilsDB”,
data: {
collectionName: reqCollectionName,
collectionWhere: reqData
},
complete: res = {
let retStatus = ‘1’;
if (res.result.data.length = 1) {
retStatus = res.result.data[0].status;
}
if (retStatus == ‘2’) {
if (queryType == “seller”){
app.globalData.seller = res.result.data[0];
} else if (queryType == “courier”){
app.globalData.courier = res.result.data[0];
}
wx.navigateTo({
url: retUrl
});
} else {
wx.showToast({
icon: ‘none’,
title: retMgs
});
}
},
fail: err = {
wx.showToast({
icon: ‘none’,
title: retMgs
});
}
});
}
})
本文来源:https://www.yuntue.com/post/99635.html | 云服务器网,转载请注明出处!

微信扫一扫打赏
支付宝扫一扫打赏