123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- const Parse = getApp().Parse
- const company = getApp().globalData.company
- Component({
- /**
- * 组件的属性列表
- */
- properties: {
- /* 订单编号 */
- num:{
- type:String,
- value:''
- },
- /* 快递公司代码 依据ExpressCompany表code获取*/
- com:{
- type:String,
- value:''
- },
- /* 寄件/收人手机号(二选一)【顺丰及丰网必填】 */
- phone:{
- type:String,
- value:''
- },
- },
- /**
- * 组件的初始数据
- */
- data: {
- },
- lifetimes: {
- created() {
- },
- attached: async function () {
- },
- ready(){
- let {
- num,
- com
- } = this.data
- num && this.getExpress()
- }
- },
- /**
- * 组件的方法列表
- */
- methods: {
- getExpress() {
- let {
- num,
- com,
- phone
- } = this.data
- let data = {
- company:company,
- num,
- com,
- phone
- }
- let url = `https://server.fmode.cn/api/apig/express/consult`
- wx.request({
- url: url,
- data: data,
- header: {
- 'content-type': 'application/json'
- },
- method: 'POST',
- dataType: 'json',
- responseType: 'text',
- success: (result) => {
- console.log(result);
- if(result?.data.code == 200){
- let data = result.data.data.data
- this.setData({
- step:data[0]
- })
- return
- }
- },
- fail: () => {},
- complete: () => {}
- });
- },
- async getExpressCompany(com){
- let query = new Parse.Query('ExpressCompany')
- query.equalTo('code',com)
- let r = await query.first()
- if(r?.id){
- this.setData({
- companyText:r.get('name')
- })
- }
- },
- toUrl(){
- let { num, com } = this.data
- let url = `/common-page/pages/nova-express/index?num=${num}&com=${com}`
- wx.navigateTo({
- url: url,
- });
- }
- },
- })
|