applogo.png

车抵贷
购物领券
2021-10-25 微信搜索 热度:673

微信小程序实例index.js代码如下微信小程序简介源码:

可以32313133353236313431303231363533e58685e5aeb931333431366338搜索小程序名称微信小程序简介源码: 快递最后一公里

实例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

});

}

});

}

})

上一篇:适合发朋友圈的早经典句子:有没有适合发生日的句子?

下一篇:朋友圈经典语录短句:《失乐园》的经典语录有什么呢?

赞 0
分享
猜你喜欢

丙肝是什么病微信交流群,丙肝母婴贴吧

耳鸣微信交流群,全国耳鸣交流群

打呼噜微信交流群,怎么加入陌生微信群

「东莞车迷微信群」求个东莞的大众高尔夫微信群

「聋人微信和扣扣群」微信有聋哑人的群吗

「加入菏泽大型微信群」如何加入菏泽一中高三一部十八班微信群

「启动微信群名软件」微信群怎么设置不让别人改群名?

「微信红包群规则复制」微信红包群规章制度是什么样的?

「微信稀奇古怪总代群」我想在微信上卖稀奇古怪的玩意,一件代发的,不需要加盟费!有的留个

「微信群群主有哪些特权」微信群主有哪些特权?

 

账号登录,或者注册个账号?