可以搜索小程序名称: 快递最后一公里
实例indexjs代码
var app = getApp();
Page({
/
页面的初始数据
/
data: {
//三张轮播
imgUrls: [
{
imageUrl: '/images/weicha/timg1jpg',
},
{
imageUrl: '/images/weicha/timg2jpg',
},
{
imageUrl: '/images/weicha/timg3jpg',
}
],
indicatorDots: false,
autoplay: false,
interval: 5000,
duration: 800,
},
onSwiperTab: function (e) {
/var postId = etargetdatasetpostId;
wxnavigateTo({
url: postId,
});/
},
/
生命周期函数--监听页面加载
/
onLoad: function (options) {
apploginWinCha(thisinitPageData);
},
//初始化登录才能查看的数据
initPageData: function () {
thissetData({
componentList: [
{
id: 1,
url: '/weicha/express/courier/index',
imageUrl: '/images/weicha/timg1_1jpg',
title: '快递小哥(送快递)',
queryType: 'courier'
},
{
id: 2,
url: '/weicha/express/seller/index',
imageUrl: '/images/weicha/timg1_2jpg',
title: '合作商家(代收快递)',
queryType: 'seller'
},
{
id: 3,
url: '/weicha/express/personal/index',
imageUrl: '/images/weicha/timg1_3jpg',
title: '收件人(签收快递)'
},
{
id: 4,
url: '/weicha/express/logistics/index',
imageUrl: '/images/weicha/timg1_4jpg',
title: '快递物流查询'
}
]
});
},
onItemClick: function (e) {
var targetUrl = ecurrentTargetdatasetpay;
var targetQueryType = ecurrentTargetdatasetindex;
if (targetQueryType == "seller") {
var reqData = {
seller_openId: appglobalDataopenid,
status: '2'
};
thisqueryDBUtil("sellerInfo", reqData, targetQueryType, targetUrl,
"亲,您暂未申请商家,请提交商家申请!");
} else if (targetQueryType == "courier") {
var reqData = {
courier_openId: appglobalDataopenid,
status: '2'
};
thisqueryDBUtil("courierInfo", reqData, targetQueryType, targetUrl,
"亲,您暂未申请快递员,请提交快递员申请!");;
} else {
wxnavigateTo({
url: targetUrl
});
}
},
queryDBUtil: function (reqCollectionName, reqData,queryType, retUrl,retMgs){
wxcloudcallFunction({
name: "utilsDB",
data: {
collectionName: reqCollectionName,
collectionWhere: reqData
},
complete: res => {
let retStatus = '1';
if (resresultdatalength >= 1) {
retStatus = resresultdata[0]status;
}
if (retStatus == '2') {
if (queryType == "seller"){
appglobalDataseller = resresultdata[0];
} else if (queryType == "courier"){
appglobalDatacourier = resresultdata[0];
}
wxnavigateTo({
url: retUrl
});
} else {
wxshowToast({
icon: 'none',
title: retMgs
});
}
},
fail: err => {
wxshowToast({
icon: 'none',
title: retMgs
});
}
});
}
})
以上就是关于微信小程序的index.js怎么写详细代码见下方↓全部的内容,包括:微信小程序的index.js怎么写详细代码见下方↓、、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)